@fluid-topics/ft-loader 0.0.88

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/README.md ADDED
@@ -0,0 +1,19 @@
1
+ A fluid-topics loader component
2
+
3
+ ## Install
4
+
5
+ ```shell
6
+ npm install @fluid-topics/ft-loader
7
+ yarn add @fluid-topics/ft-loader
8
+ ```
9
+
10
+ ## Usage
11
+
12
+ ```typescript
13
+ import { html } from "lit"
14
+ import "@fluid-topics/ft-loader"
15
+
16
+ function render() {
17
+ return html` <ft-loader></ft-loader> `
18
+ }
19
+ ```
@@ -0,0 +1,12 @@
1
+ import { FtLitElement } from "@fluid-topics/ft-wc-utils";
2
+ export interface FtLoaderProperties {
3
+ }
4
+ export interface FtLoaderCssVariables {
5
+ "--ft-loader-color": string;
6
+ "--ft-loader-size": string;
7
+ }
8
+ export declare class FtLoader extends FtLitElement implements FtLoaderProperties {
9
+ getStyles(): import("lit").CSSResult;
10
+ getTemplate(): import("lit-html").TemplateResult<1>;
11
+ }
12
+ //# sourceMappingURL=ft-loader.d.ts.map
@@ -0,0 +1,98 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { css, html } from "lit";
8
+ import { customElement, FtLitElement } from "@fluid-topics/ft-wc-utils";
9
+ let FtLoader = class FtLoader extends FtLitElement {
10
+ getStyles() {
11
+ // language=CSS
12
+ return css `
13
+ :host {
14
+ line-height: 0;
15
+ }
16
+
17
+ .ft-loader {
18
+ display: inline-block;
19
+ position: relative;
20
+
21
+ width: var(--ft-loader-size, 80px);
22
+ height: var(--ft-loader-size, 80px);
23
+ }
24
+
25
+ .ft-loader div {
26
+ position: absolute;
27
+ top: 37.5%;
28
+ width: 25%;
29
+ height: 25%;
30
+ border-radius: 50%;
31
+ background: var(--ft-loader-color, var(--ft-color-primary, #2196F3));
32
+ animation-timing-function: cubic-bezier(0, 1, 1, 0);
33
+ }
34
+
35
+ .ft-loader div:nth-child(1) {
36
+ left: 2.5%;
37
+ animation: appear 0.6s infinite;
38
+ }
39
+
40
+ .ft-loader div:nth-child(2) {
41
+ left: 2.5%;
42
+ animation: move 0.6s infinite;
43
+ }
44
+
45
+ .ft-loader div:nth-child(3) {
46
+ left: 37.5%;
47
+ animation: move 0.6s infinite;
48
+ }
49
+
50
+ .ft-loader div:nth-child(4) {
51
+ left: 72.5%;
52
+ animation: disappear 0.6s infinite;
53
+ }
54
+
55
+ @keyframes appear {
56
+ 0% {
57
+ transform: scale(0);
58
+ }
59
+ 100% {
60
+ transform: scale(1);
61
+ }
62
+ }
63
+
64
+ @keyframes disappear {
65
+ 0% {
66
+ transform: scale(1);
67
+ }
68
+ 100% {
69
+ transform: scale(0);
70
+ }
71
+ }
72
+
73
+ @keyframes move {
74
+ 0% {
75
+ transform: translate(0, 0);
76
+ }
77
+ 100% {
78
+ transform: translate(calc(0.35 * var(--ft-loader-size, 80px)), 0);
79
+ }
80
+ }
81
+ `;
82
+ }
83
+ getTemplate() {
84
+ return html `
85
+ <div class="ft-loader">
86
+ <div></div>
87
+ <div></div>
88
+ <div></div>
89
+ <div></div>
90
+ </div>
91
+ `;
92
+ }
93
+ };
94
+ FtLoader = __decorate([
95
+ customElement("ft-loader")
96
+ ], FtLoader);
97
+ export { FtLoader };
98
+ //# sourceMappingURL=ft-loader.js.map
@@ -0,0 +1,46 @@
1
+ !function(t){
2
+ /**
3
+ * @license
4
+ * Copyright 2019 Google LLC
5
+ * SPDX-License-Identifier: BSD-3-Clause
6
+ */
7
+ const i=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,e=Symbol(),n=new Map;class s{constructor(t,i){if(this._$cssResult$=!0,i!==e)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){let t=n.get(this.cssText);return i&&void 0===t&&(n.set(this.cssText,t=new CSSStyleSheet),t.replaceSync(this.cssText)),t}toString(){return this.cssText}}const o=(t,...i)=>{const n=1===t.length?t[0]:i.reduce(((i,e,n)=>i+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(e)+t[n+1]),t[0]);return new s(n,e)},r=(t,e)=>{i?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((i=>{const e=document.createElement("style"),n=window.litNonce;void 0!==n&&e.setAttribute("nonce",n),e.textContent=i.cssText,t.appendChild(e)}))},l=i?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let i="";for(const e of t.cssRules)i+=e.cssText;return(t=>new s("string"==typeof t?t:t+"",e))(i)})(t):t
8
+ /**
9
+ * @license
10
+ * Copyright 2017 Google LLC
11
+ * SPDX-License-Identifier: BSD-3-Clause
12
+ */;var h;const a=window.trustedTypes,u=a?a.emptyScript:"",c=window.reactiveElementPolyfillSupport,d={toAttribute(t,i){switch(i){case Boolean:t=t?u:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,i){let e=t;switch(i){case Boolean:e=null!==t;break;case Number:e=null===t?null:Number(t);break;case Object:case Array:try{e=JSON.parse(t)}catch(t){e=null}}return e}},v=(t,i)=>i!==t&&(i==i||t==t),f={attribute:!0,type:String,converter:d,reflect:!1,hasChanged:v};class w extends HTMLElement{constructor(){super(),this._$Et=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Ei=null,this.o()}static addInitializer(t){var i;null!==(i=this.l)&&void 0!==i||(this.l=[]),this.l.push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((i,e)=>{const n=this._$Eh(e,i);void 0!==n&&(this._$Eu.set(n,e),t.push(n))})),t}static createProperty(t,i=f){if(i.state&&(i.attribute=!1),this.finalize(),this.elementProperties.set(t,i),!i.noAccessor&&!this.prototype.hasOwnProperty(t)){const e="symbol"==typeof t?Symbol():"__"+t,n=this.getPropertyDescriptor(t,e,i);void 0!==n&&Object.defineProperty(this.prototype,t,n)}}static getPropertyDescriptor(t,i,e){return{get(){return this[i]},set(n){const s=this[t];this[i]=n,this.requestUpdate(t,s,e)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||f}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this._$Eu=new Map,this.hasOwnProperty("properties")){const t=this.properties,i=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const e of i)this.createProperty(e,t[e])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const i=[];if(Array.isArray(t)){const e=new Set(t.flat(1/0).reverse());for(const t of e)i.unshift(l(t))}else void 0!==t&&i.push(l(t));return i}static _$Eh(t,i){const e=i.attribute;return!1===e?void 0:"string"==typeof e?e:"string"==typeof t?t.toLowerCase():void 0}o(){var t;this._$Ep=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Em(),this.requestUpdate(),null===(t=this.constructor.l)||void 0===t||t.forEach((t=>t(this)))}addController(t){var i,e;(null!==(i=this._$Eg)&&void 0!==i?i:this._$Eg=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(e=t.hostConnected)||void 0===e||e.call(t))}removeController(t){var i;null===(i=this._$Eg)||void 0===i||i.splice(this._$Eg.indexOf(t)>>>0,1)}_$Em(){this.constructor.elementProperties.forEach(((t,i)=>{this.hasOwnProperty(i)&&(this._$Et.set(i,this[i]),delete this[i])}))}createRenderRoot(){var t;const i=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return r(i,this.constructor.elementStyles),i}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostConnected)||void 0===i?void 0:i.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostDisconnected)||void 0===i?void 0:i.call(t)}))}attributeChangedCallback(t,i,e){this._$AK(t,e)}_$ES(t,i,e=f){var n,s;const o=this.constructor._$Eh(t,e);if(void 0!==o&&!0===e.reflect){const r=(null!==(s=null===(n=e.converter)||void 0===n?void 0:n.toAttribute)&&void 0!==s?s:d.toAttribute)(i,e.type);this._$Ei=t,null==r?this.removeAttribute(o):this.setAttribute(o,r),this._$Ei=null}}_$AK(t,i){var e,n,s;const o=this.constructor,r=o._$Eu.get(t);if(void 0!==r&&this._$Ei!==r){const t=o.getPropertyOptions(r),l=t.converter,h=null!==(s=null!==(n=null===(e=l)||void 0===e?void 0:e.fromAttribute)&&void 0!==n?n:"function"==typeof l?l:null)&&void 0!==s?s:d.fromAttribute;this._$Ei=r,this[r]=h(i,t.type),this._$Ei=null}}requestUpdate(t,i,e){let n=!0;void 0!==t&&(((e=e||this.constructor.getPropertyOptions(t)).hasChanged||v)(this[t],i)?(this._$AL.has(t)||this._$AL.set(t,i),!0===e.reflect&&this._$Ei!==t&&(void 0===this._$E_&&(this._$E_=new Map),this._$E_.set(t,e))):n=!1),!this.isUpdatePending&&n&&(this._$Ep=this._$EC())}async _$EC(){this.isUpdatePending=!0;try{await this._$Ep}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Et&&(this._$Et.forEach(((t,i)=>this[i]=t)),this._$Et=void 0);let i=!1;const e=this._$AL;try{i=this.shouldUpdate(e),i?(this.willUpdate(e),null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostUpdate)||void 0===i?void 0:i.call(t)})),this.update(e)):this._$EU()}catch(t){throw i=!1,this._$EU(),t}i&&this._$AE(e)}willUpdate(t){}_$AE(t){var i;null===(i=this._$Eg)||void 0===i||i.forEach((t=>{var i;return null===(i=t.hostUpdated)||void 0===i?void 0:i.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Ep}shouldUpdate(t){return!0}update(t){void 0!==this._$E_&&(this._$E_.forEach(((t,i)=>this._$ES(i,this[i],t))),this._$E_=void 0),this._$EU()}updated(t){}firstUpdated(t){}}
13
+ /**
14
+ * @license
15
+ * Copyright 2017 Google LLC
16
+ * SPDX-License-Identifier: BSD-3-Clause
17
+ */
18
+ var p;w.finalized=!0,w.elementProperties=new Map,w.elementStyles=[],w.shadowRootOptions={mode:"open"},null==c||c({ReactiveElement:w}),(null!==(h=globalThis.reactiveElementVersions)&&void 0!==h?h:globalThis.reactiveElementVersions=[]).push("1.2.2");const b=globalThis.trustedTypes,m=b?b.createPolicy("lit-html",{createHTML:t=>t}):void 0,y=`lit$${(Math.random()+"").slice(9)}$`,g="?"+y,S=`<${g}>`,$=document,E=(t="")=>$.createComment(t),j=t=>null===t||"object"!=typeof t&&"function"!=typeof t,C=Array.isArray,O=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,A=/-->/g,M=/>/g,k=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,T=/'/g,R=/"/g,_=/^(?:script|style|textarea|title)$/i,x=(t=>(i,...e)=>({_$litType$:t,strings:i,values:e}))(1),U=Symbol.for("lit-noChange"),L=Symbol.for("lit-nothing"),H=new WeakMap,z=$.createTreeWalker($,129,null,!1),N=(t,i)=>{const e=t.length-1,n=[];let s,o=2===i?"<svg>":"",r=O;for(let i=0;i<e;i++){const e=t[i];let l,h,a=-1,u=0;for(;u<e.length&&(r.lastIndex=u,h=r.exec(e),null!==h);)u=r.lastIndex,r===O?"!--"===h[1]?r=A:void 0!==h[1]?r=M:void 0!==h[2]?(_.test(h[2])&&(s=RegExp("</"+h[2],"g")),r=k):void 0!==h[3]&&(r=k):r===k?">"===h[0]?(r=null!=s?s:O,a=-1):void 0===h[1]?a=-2:(a=r.lastIndex-h[2].length,l=h[1],r=void 0===h[3]?k:'"'===h[3]?R:T):r===R||r===T?r=k:r===A||r===M?r=O:(r=k,s=void 0);const c=r===k&&t[i+1].startsWith("/>")?" ":"";o+=r===O?e+S:a>=0?(n.push(l),e.slice(0,a)+"$lit$"+e.slice(a)+y+c):e+y+(-2===a?(n.push(void 0),i):c)}const l=o+(t[e]||"<?>")+(2===i?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==m?m.createHTML(l):l,n]};class D{constructor({strings:t,_$litType$:i},e){let n;this.parts=[];let s=0,o=0;const r=t.length-1,l=this.parts,[h,a]=N(t,i);if(this.el=D.createElement(h,e),z.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(n=z.nextNode())&&l.length<r;){if(1===n.nodeType){if(n.hasAttributes()){const t=[];for(const i of n.getAttributeNames())if(i.endsWith("$lit$")||i.startsWith(y)){const e=a[o++];if(t.push(i),void 0!==e){const t=n.getAttribute(e.toLowerCase()+"$lit$").split(y),i=/([.?@])?(.*)/.exec(e);l.push({type:1,index:s,name:i[2],strings:t,ctor:"."===i[1]?V:"?"===i[1]?J:"@"===i[1]?Z:W})}else l.push({type:6,index:s})}for(const i of t)n.removeAttribute(i)}if(_.test(n.tagName)){const t=n.textContent.split(y),i=t.length-1;if(i>0){n.textContent=b?b.emptyScript:"";for(let e=0;e<i;e++)n.append(t[e],E()),z.nextNode(),l.push({type:2,index:++s});n.append(t[i],E())}}}else if(8===n.nodeType)if(n.data===g)l.push({type:2,index:s});else{let t=-1;for(;-1!==(t=n.data.indexOf(y,t+1));)l.push({type:7,index:s}),t+=y.length-1}s++}}static createElement(t,i){const e=$.createElement("template");return e.innerHTML=t,e}}function F(t,i,e=t,n){var s,o,r,l;if(i===U)return i;let h=void 0!==n?null===(s=e._$Cl)||void 0===s?void 0:s[n]:e._$Cu;const a=j(i)?void 0:i._$litDirective$;return(null==h?void 0:h.constructor)!==a&&(null===(o=null==h?void 0:h._$AO)||void 0===o||o.call(h,!1),void 0===a?h=void 0:(h=new a(t),h._$AT(t,e,n)),void 0!==n?(null!==(r=(l=e)._$Cl)&&void 0!==r?r:l._$Cl=[])[n]=h:e._$Cu=h),void 0!==h&&(i=F(t,h._$AS(t,i.values),h,n)),i}class I{constructor(t,i){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var i;const{el:{content:e},parts:n}=this._$AD,s=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:$).importNode(e,!0);z.currentNode=s;let o=z.nextNode(),r=0,l=0,h=n[0];for(;void 0!==h;){if(r===h.index){let i;2===h.type?i=new P(o,o.nextSibling,this,t):1===h.type?i=new h.ctor(o,h.name,h.strings,this,t):6===h.type&&(i=new q(o,this,t)),this.v.push(i),h=n[++l]}r!==(null==h?void 0:h.index)&&(o=z.nextNode(),r++)}return s}m(t){let i=0;for(const e of this.v)void 0!==e&&(void 0!==e.strings?(e._$AI(t,e,i),i+=e.strings.length-2):e._$AI(t[i])),i++}}class P{constructor(t,i,e,n){var s;this.type=2,this._$AH=L,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=e,this.options=n,this._$Cg=null===(s=null==n?void 0:n.isConnected)||void 0===s||s}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$Cg}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=F(this,t,i),j(t)?t===L||null==t||""===t?(this._$AH!==L&&this._$AR(),this._$AH=L):t!==this._$AH&&t!==U&&this.$(t):void 0!==t._$litType$?this.T(t):void 0!==t.nodeType?this.S(t):(t=>{var i;return C(t)||"function"==typeof(null===(i=t)||void 0===i?void 0:i[Symbol.iterator])})(t)?this.A(t):this.$(t)}M(t,i=this._$AB){return this._$AA.parentNode.insertBefore(t,i)}S(t){this._$AH!==t&&(this._$AR(),this._$AH=this.M(t))}$(t){this._$AH!==L&&j(this._$AH)?this._$AA.nextSibling.data=t:this.S($.createTextNode(t)),this._$AH=t}T(t){var i;const{values:e,_$litType$:n}=t,s="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=D.createElement(n.h,this.options)),n);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===s)this._$AH.m(e);else{const t=new I(s,this),i=t.p(this.options);t.m(e),this.S(i),this._$AH=t}}_$AC(t){let i=H.get(t.strings);return void 0===i&&H.set(t.strings,i=new D(t)),i}A(t){C(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let e,n=0;for(const s of t)n===i.length?i.push(e=new P(this.M(E()),this.M(E()),this,this.options)):e=i[n],e._$AI(s),n++;n<i.length&&(this._$AR(e&&e._$AB.nextSibling,n),i.length=n)}_$AR(t=this._$AA.nextSibling,i){var e;for(null===(e=this._$AP)||void 0===e||e.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var i;void 0===this._$AM&&(this._$Cg=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class W{constructor(t,i,e,n,s){this.type=1,this._$AH=L,this._$AN=void 0,this.element=t,this.name=i,this._$AM=n,this.options=s,e.length>2||""!==e[0]||""!==e[1]?(this._$AH=Array(e.length-1).fill(new String),this.strings=e):this._$AH=L}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,e,n){const s=this.strings;let o=!1;if(void 0===s)t=F(this,t,i,0),o=!j(t)||t!==this._$AH&&t!==U,o&&(this._$AH=t);else{const n=t;let r,l;for(t=s[0],r=0;r<s.length-1;r++)l=F(this,n[e+r],i,r),l===U&&(l=this._$AH[r]),o||(o=!j(l)||l!==this._$AH[r]),l===L?t=L:t!==L&&(t+=(null!=l?l:"")+s[r+1]),this._$AH[r]=l}o&&!n&&this.k(t)}k(t){t===L?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class V extends W{constructor(){super(...arguments),this.type=3}k(t){this.element[this.name]=t===L?void 0:t}}const B=b?b.emptyScript:"";class J extends W{constructor(){super(...arguments),this.type=4}k(t){t&&t!==L?this.element.setAttribute(this.name,B):this.element.removeAttribute(this.name)}}class Z extends W{constructor(t,i,e,n,s){super(t,i,e,n,s),this.type=5}_$AI(t,i=this){var e;if((t=null!==(e=F(this,t,i,0))&&void 0!==e?e:L)===U)return;const n=this._$AH,s=t===L&&n!==L||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,o=t!==L&&(n===L||s);s&&this.element.removeEventListener(this.name,this,n),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,e;"function"==typeof this._$AH?this._$AH.call(null!==(e=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==e?e:this.element,t):this._$AH.handleEvent(t)}}class q{constructor(t,i,e){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=e}get _$AU(){return this._$AM._$AU}_$AI(t){F(this,t)}}const K=window.litHtmlPolyfillSupport;
19
+ /**
20
+ * @license
21
+ * Copyright 2017 Google LLC
22
+ * SPDX-License-Identifier: BSD-3-Clause
23
+ */
24
+ var G,Q;null==K||K(D,P),(null!==(p=globalThis.litHtmlVersions)&&void 0!==p?p:globalThis.litHtmlVersions=[]).push("2.1.3");class X extends w{constructor(){super(...arguments),this.renderOptions={host:this},this._$Dt=void 0}createRenderRoot(){var t,i;const e=super.createRenderRoot();return null!==(t=(i=this.renderOptions).renderBefore)&&void 0!==t||(i.renderBefore=e.firstChild),e}update(t){const i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Dt=((t,i,e)=>{var n,s;const o=null!==(n=null==e?void 0:e.renderBefore)&&void 0!==n?n:i;let r=o._$litPart$;if(void 0===r){const t=null!==(s=null==e?void 0:e.renderBefore)&&void 0!==s?s:null;o._$litPart$=r=new P(i.insertBefore(E(),t),t,void 0,null!=e?e:{})}return r._$AI(t),r})(i,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!1)}render(){return U}}X.finalized=!0,X._$litElement$=!0,null===(G=globalThis.litElementHydrateSupport)||void 0===G||G.call(globalThis,{LitElement:X});const Y=globalThis.litElementPolyfillSupport;null==Y||Y({LitElement:X}),(null!==(Q=globalThis.litElementVersions)&&void 0!==Q?Q:globalThis.litElementVersions=[]).push("3.1.2"),function(){function t(t){var i=0;return function(){return i<t.length?{done:!1,value:t[i++]}:{done:!0}}}function i(i){var e="undefined"!=typeof Symbol&&Symbol.iterator&&i[Symbol.iterator];return e?e.call(i):{next:t(i)}}function e(t){if(!(t instanceof Array)){t=i(t);for(var e,n=[];!(e=t.next()).done;)n.push(e.value);t=n}return t}var n="function"==typeof Object.create?Object.create:function(t){function i(){}return i.prototype=t,new i};var s,o=function(t){t=["object"==typeof globalThis&&globalThis,t,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var i=0;i<t.length;++i){var e=t[i];if(e&&e.Math==Math)return e}throw Error("Cannot find global object")}(this),r=function(){if("undefined"!=typeof Reflect&&Reflect.construct){if(function(){function t(){}return Reflect.construct(t,[],(function(){})),new t instanceof t}())return Reflect.construct;var t=Reflect.construct;return function(i,e,n){return i=t(i,e),n&&Reflect.setPrototypeOf(i,n.prototype),i}}return function(t,i,e){return void 0===e&&(e=t),e=n(e.prototype||Object.prototype),Function.prototype.apply.call(t,e,i)||e}}();if("function"==typeof Object.setPrototypeOf)s=Object.setPrototypeOf;else{var l;t:{var h={};try{h.__proto__={a:!0},l=h.a;break t}catch(t){}l=!1}s=l?function(t,i){if(t.__proto__=i,t.__proto__!==i)throw new TypeError(t+" is not extensible");return t}:null}var a=s;if(!ShadowRoot.prototype.createElement){var u,c=window.HTMLElement,d=window.customElements.define,v=window.customElements.get,f=window.customElements,w=new WeakMap,p=new WeakMap,b=new WeakMap,m=new WeakMap;window.CustomElementRegistry=function(){this.l=new Map,this.o=new Map,this.i=new Map,this.h=new Map},window.CustomElementRegistry.prototype.define=function(t,e){if(t=t.toLowerCase(),void 0!==this.j(t))throw new DOMException("Failed to execute 'define' on 'CustomElementRegistry': the name \""+t+'" has already been used with this registry');if(void 0!==this.o.get(e))throw new DOMException("Failed to execute 'define' on 'CustomElementRegistry': this constructor has already been used with this registry");var n=e.prototype.attributeChangedCallback,s=new Set(e.observedAttributes||[]);if(g(e,s,n),n={g:e,connectedCallback:e.prototype.connectedCallback,disconnectedCallback:e.prototype.disconnectedCallback,adoptedCallback:e.prototype.adoptedCallback,attributeChangedCallback:n,formAssociated:e.formAssociated,formAssociatedCallback:e.prototype.formAssociatedCallback,formDisabledCallback:e.prototype.formDisabledCallback,formResetCallback:e.prototype.formResetCallback,formStateRestoreCallback:e.prototype.formStateRestoreCallback,observedAttributes:s},this.l.set(t,n),this.o.set(e,n),(s=v.call(f,t))||(s=y(t),d.call(f,t,s)),this===window.customElements&&(b.set(e,n),n.s=s),s=this.h.get(t)){this.h.delete(t);for(var o=(s=i(s)).next();!o.done;o=s.next())o=o.value,p.delete(o),$(o,n,!0)}return void 0!==(n=this.i.get(t))&&(n.resolve(e),this.i.delete(t)),e},window.CustomElementRegistry.prototype.upgrade=function(){j.push(this),f.upgrade.apply(f,arguments),j.pop()},window.CustomElementRegistry.prototype.get=function(t){var i;return null==(i=this.l.get(t))?void 0:i.g},window.CustomElementRegistry.prototype.j=function(t){return this.l.get(t)},window.CustomElementRegistry.prototype.whenDefined=function(t){var i=this.j(t);if(void 0!==i)return Promise.resolve(i.g);var e=this.i.get(t);return void 0===e&&((e={}).promise=new Promise((function(t){return e.resolve=t})),this.i.set(t,e)),e.promise},window.CustomElementRegistry.prototype.m=function(t,i,e){var n=this.h.get(i);n||this.h.set(i,n=new Set),e?n.add(t):n.delete(t)},window.HTMLElement=function(){var t=u;if(t)return u=void 0,t;var i=b.get(this.constructor);if(!i)throw new TypeError("Illegal constructor (custom element class must be registered with global customElements registry to be newable)");return t=Reflect.construct(c,[],i.s),Object.setPrototypeOf(t,this.constructor.prototype),w.set(t,i),t},window.HTMLElement.prototype=c.prototype;var y=function(t){function i(){var i=Reflect.construct(c,[],this.constructor);Object.setPrototypeOf(i,HTMLElement.prototype);t:{var e=i.getRootNode();if(!(e===document||e instanceof ShadowRoot)){if((e=j[j.length-1])instanceof CustomElementRegistry){var n=e;break t}(e=e.getRootNode())===document||e instanceof ShadowRoot||(e=(null==(n=m.get(e))?void 0:n.getRootNode())||document)}n=e.customElements}return(e=(n=n||window.customElements).j(t))?$(i,e):p.set(i,n),i}return o.Object.defineProperty(i,"formAssociated",{configurable:!0,enumerable:!0,get:function(){return!0}}),i.prototype.connectedCallback=function(){var i=w.get(this);i?i.connectedCallback&&i.connectedCallback.apply(this,arguments):p.get(this).m(this,t,!0)},i.prototype.disconnectedCallback=function(){var i=w.get(this);i?i.disconnectedCallback&&i.disconnectedCallback.apply(this,arguments):p.get(this).m(this,t,!1)},i.prototype.adoptedCallback=function(){var t,i;null==(t=w.get(this))||null==(i=t.adoptedCallback)||i.apply(this,arguments)},i.prototype.formAssociatedCallback=function(){var t,i=w.get(this);i&&i.formAssociated&&(null==i||null==(t=i.formAssociatedCallback)||t.apply(this,arguments))},i.prototype.formDisabledCallback=function(){var t,i=w.get(this);null!=i&&i.formAssociated&&(null==i||null==(t=i.formDisabledCallback)||t.apply(this,arguments))},i.prototype.formResetCallback=function(){var t,i=w.get(this);null!=i&&i.formAssociated&&(null==i||null==(t=i.formResetCallback)||t.apply(this,arguments))},i.prototype.formStateRestoreCallback=function(){var t,i=w.get(this);null!=i&&i.formAssociated&&(null==i||null==(t=i.formStateRestoreCallback)||t.apply(this,arguments))},i},g=function(t,i,e){if(0!==i.size&&void 0!==e){var n=t.prototype.setAttribute;n&&(t.prototype.setAttribute=function(t,s){if(t=t.toLowerCase(),i.has(t)){var o=this.getAttribute(t);n.call(this,t,s),e.call(this,t,o,s)}else n.call(this,t,s)});var s=t.prototype.removeAttribute;s&&(t.prototype.removeAttribute=function(t){if(t=t.toLowerCase(),i.has(t)){var n=this.getAttribute(t);s.call(this,t),e.call(this,t,n,null)}else s.call(this,t)})}},S=function(t){var i=Object.getPrototypeOf(t);if(i!==window.HTMLElement)return i===c?Object.setPrototypeOf(t,window.HTMLElement):S(i)},$=function(t,i,e){e=void 0!==e&&e,Object.setPrototypeOf(t,i.g.prototype),w.set(t,i),u=t;try{new i.g}catch(t){S(i.g),new i.g}i.observedAttributes.forEach((function(e){t.hasAttribute(e)&&i.attributeChangedCallback.call(t,e,null,t.getAttribute(e))})),e&&i.connectedCallback&&t.isConnected&&i.connectedCallback.call(t)},E=Element.prototype.attachShadow;Element.prototype.attachShadow=function(t){var i=E.apply(this,arguments);return t.customElements&&(i.customElements=t.customElements),i};var j=[document],C=function(t,i,e){var n=(e?Object.getPrototypeOf(e):t.prototype)[i];t.prototype[i]=function(){j.push(this);var t=n.apply(e||this,arguments);return void 0!==t&&m.set(t,this),j.pop(),t}};C(ShadowRoot,"createElement",document),C(ShadowRoot,"importNode",document),C(Element,"insertAdjacentHTML");var O=function(t){var i=Object.getOwnPropertyDescriptor(t.prototype,"innerHTML");Object.defineProperty(t.prototype,"innerHTML",Object.assign({},i,{set:function(t){j.push(this),i.set.call(this,t),j.pop()}}))};if(O(Element),O(ShadowRoot),Object.defineProperty(window,"customElements",{value:new CustomElementRegistry,configurable:!0,writable:!0}),window.ElementInternals&&window.ElementInternals.prototype.setFormValue){var A=new WeakMap,M=HTMLElement.prototype.attachInternals;HTMLElement.prototype.attachInternals=function(t){for(var i=[],n=0;n<arguments.length;++n)i[n]=arguments[n];return i=M.call.apply(M,[this].concat(e(i))),A.set(i,this),i},["setFormValue","setValidity","checkValidity","reportValidity"].forEach((function(t){var i=window.ElementInternals.prototype,n=i[t];i[t]=function(t){for(var i=[],s=0;s<arguments.length;++s)i[s]=arguments[s];if(s=A.get(this),!0!==w.get(s).formAssociated)throw new DOMException("Failed to execute "+n+" on 'ElementInternals': The target element is not a form-associated custom element.");null==n||n.call.apply(n,[this].concat(e(i)))}}));var k=function(t){var i=r(Array,[].concat(e(t)),this.constructor);return i.h=t,i},T=k,R=Array;if(T.prototype=n(R.prototype),T.prototype.constructor=T,a)a(T,R);else for(var _ in R)if("prototype"!=_)if(Object.defineProperties){var x=Object.getOwnPropertyDescriptor(R,_);x&&Object.defineProperty(T,_,x)}else T[_]=R[_];T.u=R.prototype,o.Object.defineProperty(k.prototype,"value",{configurable:!0,enumerable:!0,get:function(){var t;return(null==(t=this.h.find((function(t){return!0===t.checked})))?void 0:t.value)||""}});var U=function(t){var i=this,e=new Map;t.forEach((function(t,n){var s=t.getAttribute("name"),o=e.get(s)||[];i[+n]=t,o.push(t),e.set(s,o)})),this.length=t.length,e.forEach((function(t,e){t&&(i[e]=1===t.length?t[0]:new k(t))}))};U.prototype.namedItem=function(t){return this[t]};var L=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get:function(){for(var t=L.get.call(this,[]),e=[],n=(t=i(t)).next();!n.done;n=t.next()){n=n.value;var s=w.get(n);s&&!0!==s.formAssociated||e.push(n)}return new U(e)}})}}}.call(self);try{window.customElements.define("custom-element",null)}catch(nt){const t=window.customElements.define;window.customElements.define=(i,e,n)=>{try{t.bind(window.customElements)(i,e,n)}catch(t){console.warn(i,e,n,t)}}}
25
+ /**
26
+ * @license
27
+ * Copyright 2021 Google LLC
28
+ * SPDX-License-Identifier: BSD-3-Clause
29
+ */var tt;null===(tt=window.HTMLSlotElement)||void 0===tt||tt.prototype.assignedElements;class it extends(
30
+ /**
31
+ * @license
32
+ * Copyright 2021 Google LLC
33
+ * SPDX-License-Identifier: BSD-3-Clause
34
+ */
35
+ function(t){return class extends t{createRenderRoot(){const t=this.constructor,{registry:i,elementDefinitions:e,shadowRootOptions:n}=t;e&&!i&&(t.registry=new CustomElementRegistry,Object.entries(e).forEach((([i,e])=>t.registry.define(i,e))));const s=this.renderOptions.creationScope=this.attachShadow({...n,customElements:t.registry});return r(s,this.constructor.elementStyles),s}}}(X)){constructor(){super(),this.constructorName=this.constructor.name,this.proto=this.constructor.prototype}getStyles(){return[]}getTemplate(){return null}render(){let t=this.getStyles();return Array.isArray(t)||(t=[t]),x`${t.map((t=>x`<style>${t}</style>`))} ${this.getTemplate()}`}adoptedCallback(){Object.getPrototypeOf(this)!==this.constructorName&&Object.setPrototypeOf(this,this.proto)}updated(t){super.updated(t),setTimeout((()=>this.contentAvailableCallback(t)),0)}contentAvailableCallback(t){}}
36
+ /**
37
+ * @license
38
+ * Copyright 2017 Google LLC
39
+ * SPDX-License-Identifier: BSD-3-Clause
40
+ */const et=2;
41
+ /**
42
+ * @license
43
+ * Copyright 2017 Google LLC
44
+ * SPDX-License-Identifier: BSD-3-Clause
45
+ */
46
+ class nt extends class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,i,e){this._$Ct=t,this._$AM=i,this._$Ci=e}_$AS(t,i){return this.update(t,i)}update(t,i){return this.render(...i)}}{constructor(t){if(super(t),this.it=L,t.type!==et)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===L||null==t)return this.vt=void 0,this.it=t;if(t===U)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this.vt;this.it=t;const i=[t];return i.raw=i,this.vt={_$litType$:this.constructor.resultType,strings:i,values:[]}}}var st,ot;nt.directiveName="unsafeHTML",nt.resultType=1,navigator.vendor&&navigator.vendor.match(/apple/i)||(null===(ot=null===(st=window.safari)||void 0===st?void 0:st.pushNotification)||void 0===ot||ot.toString());var rt,lt=function(t,i,e,n){for(var s,o=arguments.length,r=o<3?i:null===n?n=Object.getOwnPropertyDescriptor(i,e):n,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(o<3?s(r):o>3?s(i,e,r):s(i,e))||r);return o>3&&r&&Object.defineProperty(i,e,r),r};t.FtLoader=class extends it{getStyles(){return o`:host{line-height:0}.ft-loader{display:inline-block;position:relative;width:var(--ft-loader-size,80px);height:var(--ft-loader-size,80px)}.ft-loader div{position:absolute;top:37.5%;width:25%;height:25%;border-radius:50%;background:var(--ft-loader-color,var(--ft-color-primary,#2196f3));animation-timing-function:cubic-bezier(0,1,1,0)}.ft-loader div:nth-child(1){left:2.5%;animation:appear .6s infinite}.ft-loader div:nth-child(2){left:2.5%;animation:move .6s infinite}.ft-loader div:nth-child(3){left:37.5%;animation:move .6s infinite}.ft-loader div:nth-child(4){left:72.5%;animation:disappear .6s infinite}@keyframes appear{0%{transform:scale(0)}100%{transform:scale(1)}}@keyframes disappear{0%{transform:scale(1)}100%{transform:scale(0)}}@keyframes move{0%{transform:translate(0,0)}100%{transform:translate(calc(.35 * var(--ft-loader-size,80px)),0)}}`}getTemplate(){return x`<div class="ft-loader"><div></div><div></div><div></div><div></div></div>`}},t.FtLoader=lt([(rt="ft-loader",t=>{window.customElements.get(rt)||window.customElements.define(rt,t)})],t.FtLoader),Object.defineProperty(t,"t",{value:!0})}({});
package/package.json ADDED
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "@fluid-topics/ft-loader",
3
+ "version": "0.0.88",
4
+ "description": "A fluid-topics loader component",
5
+ "keywords": [
6
+ "Lit"
7
+ ],
8
+ "author": "Fluid Topics <devtopics@antidot.net>",
9
+ "license": "ISC",
10
+ "main": "build/ft-loader.js",
11
+ "web": "build/ft-loader.min.js",
12
+ "typings": "build/ft-loader",
13
+ "files": [
14
+ "build/*.ts",
15
+ "build/*.js"
16
+ ],
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
+ },
21
+ "dependencies": {
22
+ "@fluid-topics/ft-wc-utils": "^0.0.88",
23
+ "lit": "^2.0.2"
24
+ },
25
+ "gitHead": "220e53dba55dfa1de1560abbc30067555f72198c"
26
+ }