cmswork 1.1.2 → 1.1.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/VSCodeUserSetup-x64-1.96.2.exe +0 -0
- package/package.json +1 -1
- package/Lit/.vscode/settings.json +0 -7
- package/Lit/dist/assets/index-BwL3dWu4.css +0 -1
- package/Lit/dist/assets/index-C0k3p14F.js +0 -129
- package/Lit/dist/index.html +0 -33
- package/Lit/dist/vite.svg +0 -1
- package/Lit/index.html +0 -44
- package/Lit/package.json +0 -28
- package/Lit/public/vite.svg +0 -1
- package/Lit/src/a.html +0 -43
- package/Lit/src/app-element.ts +0 -50
- package/Lit/src/assets/common.ts +0 -26
- package/Lit/src/assets/lit.svg +0 -1
- package/Lit/src/child-element.ts +0 -53
- package/Lit/src/fetch-element.ts +0 -76
- package/Lit/src/index.css +0 -39
- package/Lit/src/markdown-element.ts +0 -25
- package/Lit/src/my-element.ts +0 -144
- package/Lit/src/nav-element.ts +0 -32
- package/Lit/src/store/redux.ts +0 -34
- package/Lit/src/styles/myelement.css +0 -74
- package/Lit/src/styles/myelement.less +0 -88
- package/Lit/src/vite-env.d.ts +0 -1
- package/Lit/tsconfig.json +0 -25
- package/Lit/vite.config.ts +0 -31
- package/Lit/yarn-error.log +0 -579
- package/Lit/yarn.lock +0 -569
|
Binary file
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
:root{font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;display:flex;place-items:center;min-width:320px;min-height:100vh}@media (prefers-color-scheme: light){:root{color:#213547;background-color:#fff}}
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const n of o.addedNodes)n.tagName==="LINK"&&n.rel==="modulepreload"&&i(n)}).observe(document,{childList:!0,subtree:!0});function e(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(s){if(s.ep)return;s.ep=!0;const o=e(s);fetch(s.href,o)}})();/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2019 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/const L=globalThis,W=L.ShadowRoot&&(L.ShadyCSS===void 0||L.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Z=Symbol(),J=new WeakMap;let nt=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==Z)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(W&&t===void 0){const i=e!==void 0&&e.length===1;i&&(t=J.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&J.set(e,t))}return t}toString(){return this.cssText}};const $t=r=>new nt(typeof r=="string"?r:r+"",void 0,Z),lt=(r,...t)=>{const e=r.length===1?r[0]:t.reduce((i,s,o)=>i+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+r[o+1],r[0]);return new nt(e,r,Z)},ft=(r,t)=>{if(W)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const i=document.createElement("style"),s=L.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=e.cssText,r.appendChild(i)}},Y=W?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return $t(e)})(r):r;/**
|
|
6
|
-
* @license
|
|
7
|
-
* Copyright 2017 Google LLC
|
|
8
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
-
*/const{is:_t,defineProperty:mt,getOwnPropertyDescriptor:gt,getOwnPropertyNames:yt,getOwnPropertySymbols:vt,getPrototypeOf:At}=Object,_=globalThis,G=_.trustedTypes,bt=G?G.emptyScript:"",F=_.reactiveElementPolyfillSupport,P=(r,t)=>r,j={toAttribute(r,t){switch(t){case Boolean:r=r?bt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},q=(r,t)=>!_t(r,t),Q={attribute:!0,type:String,converter:j,reflect:!1,hasChanged:q};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),_.litPropertyMetadata??(_.litPropertyMetadata=new WeakMap);class A extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Q){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(t,i,e);s!==void 0&&mt(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){const{get:s,set:o}=gt(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return s==null?void 0:s.call(this)},set(n){const h=s==null?void 0:s.call(this);o.call(this,n),this.requestUpdate(t,h,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Q}static _$Ei(){if(this.hasOwnProperty(P("elementProperties")))return;const t=At(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(P("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(P("properties"))){const e=this.properties,i=[...yt(e),...vt(e)];for(const s of i)this.createProperty(s,e[s])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[i,s]of e)this.elementProperties.set(i,s)}this._$Eh=new Map;for(const[e,i]of this.elementProperties){const s=this._$Eu(e,i);s!==void 0&&this._$Eh.set(s,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const s of i)e.unshift(Y(s))}else t!==void 0&&e.push(Y(t));return e}static _$Eu(t,e){const i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ft(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(e=>{var i;return(i=e.hostConnected)==null?void 0:i.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var i;return(i=e.hostDisconnected)==null?void 0:i.call(e)})}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EC(t,e){var o;const i=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,i);if(s!==void 0&&i.reflect===!0){const n=(((o=i.converter)==null?void 0:o.toAttribute)!==void 0?i.converter:j).toAttribute(e,i.type);this._$Em=t,n==null?this.removeAttribute(s):this.setAttribute(s,n),this._$Em=null}}_$AK(t,e){var o;const i=this.constructor,s=i._$Eh.get(t);if(s!==void 0&&this._$Em!==s){const n=i.getPropertyOptions(s),h=typeof n.converter=="function"?{fromAttribute:n.converter}:((o=n.converter)==null?void 0:o.fromAttribute)!==void 0?n.converter:j;this._$Em=s,this[s]=h.fromAttribute(e,n.type),this._$Em=null}}requestUpdate(t,e,i){if(t!==void 0){if(i??(i=this.constructor.getPropertyOptions(t)),!(i.hasChanged??q)(this[t],e))return;this.P(t,e,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,i){this._$AL.has(t)||this._$AL.set(t,e),i.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[o,n]of this._$Ep)this[o]=n;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[o,n]of s)n.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.P(o,this[o],n)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(i=this._$EO)==null||i.forEach(s=>{var o;return(o=s.hostUpdate)==null?void 0:o.call(s)}),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(i=>{var s;return(s=i.hostUpdated)==null?void 0:s.call(i)}),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._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EC(e,this[e]))),this._$EU()}updated(t){}firstUpdated(t){}}A.elementStyles=[],A.shadowRootOptions={mode:"open"},A[P("elementProperties")]=new Map,A[P("finalized")]=new Map,F==null||F({ReactiveElement:A}),(_.reactiveElementVersions??(_.reactiveElementVersions=[])).push("2.0.4");/**
|
|
10
|
-
* @license
|
|
11
|
-
* Copyright 2017 Google LLC
|
|
12
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
|
-
*/const C=globalThis,k=C.trustedTypes,X=k?k.createPolicy("lit-html",{createHTML:r=>r}):void 0,ht="$lit$",f=`lit$${Math.random().toFixed(9).slice(2)}$`,at="?"+f,Et=`<${at}>`,y=document,O=()=>y.createComment(""),U=r=>r===null||typeof r!="object"&&typeof r!="function",K=Array.isArray,St=r=>K(r)||typeof(r==null?void 0:r[Symbol.iterator])=="function",D=`[
|
|
14
|
-
\f\r]`,w=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,tt=/-->/g,et=/>/g,m=RegExp(`>|${D}(?:([^\\s"'>=/]+)(${D}*=${D}*(?:[^
|
|
15
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),st=/'/g,it=/"/g,ct=/^(?:script|style|textarea|title)$/i,wt=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),x=wt(1),E=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),rt=new WeakMap,g=y.createTreeWalker(y,129);function dt(r,t){if(!K(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return X!==void 0?X.createHTML(t):t}const xt=(r,t)=>{const e=r.length-1,i=[];let s,o=t===2?"<svg>":t===3?"<math>":"",n=w;for(let h=0;h<e;h++){const l=r[h];let c,p,a=-1,u=0;for(;u<l.length&&(n.lastIndex=u,p=n.exec(l),p!==null);)u=n.lastIndex,n===w?p[1]==="!--"?n=tt:p[1]!==void 0?n=et:p[2]!==void 0?(ct.test(p[2])&&(s=RegExp("</"+p[2],"g")),n=m):p[3]!==void 0&&(n=m):n===m?p[0]===">"?(n=s??w,a=-1):p[1]===void 0?a=-2:(a=n.lastIndex-p[2].length,c=p[1],n=p[3]===void 0?m:p[3]==='"'?it:st):n===it||n===st?n=m:n===tt||n===et?n=w:(n=m,s=void 0);const $=n===m&&r[h+1].startsWith("/>")?" ":"";o+=n===w?l+Et:a>=0?(i.push(c),l.slice(0,a)+ht+l.slice(a)+f+$):l+f+(a===-2?h:$)}return[dt(r,o+(r[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]};class M{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let o=0,n=0;const h=t.length-1,l=this.parts,[c,p]=xt(t,e);if(this.el=M.createElement(c,i),g.currentNode=this.el.content,e===2||e===3){const a=this.el.content.firstChild;a.replaceWith(...a.childNodes)}for(;(s=g.nextNode())!==null&&l.length<h;){if(s.nodeType===1){if(s.hasAttributes())for(const a of s.getAttributeNames())if(a.endsWith(ht)){const u=p[n++],$=s.getAttribute(a).split(f),R=/([.?@])?(.*)/.exec(u);l.push({type:1,index:o,name:R[2],strings:$,ctor:R[1]==="."?Ct:R[1]==="?"?Ot:R[1]==="@"?Ut:V}),s.removeAttribute(a)}else a.startsWith(f)&&(l.push({type:6,index:o}),s.removeAttribute(a));if(ct.test(s.tagName)){const a=s.textContent.split(f),u=a.length-1;if(u>0){s.textContent=k?k.emptyScript:"";for(let $=0;$<u;$++)s.append(a[$],O()),g.nextNode(),l.push({type:2,index:++o});s.append(a[u],O())}}}else if(s.nodeType===8)if(s.data===at)l.push({type:2,index:o});else{let a=-1;for(;(a=s.data.indexOf(f,a+1))!==-1;)l.push({type:7,index:o}),a+=f.length-1}o++}}static createElement(t,e){const i=y.createElement("template");return i.innerHTML=t,i}}function S(r,t,e=r,i){var n,h;if(t===E)return t;let s=i!==void 0?(n=e._$Co)==null?void 0:n[i]:e._$Cl;const o=U(t)?void 0:t._$litDirective$;return(s==null?void 0:s.constructor)!==o&&((h=s==null?void 0:s._$AO)==null||h.call(s,!1),o===void 0?s=void 0:(s=new o(r),s._$AT(r,e,i)),i!==void 0?(e._$Co??(e._$Co=[]))[i]=s:e._$Cl=s),s!==void 0&&(t=S(r,s._$AS(r,t.values),s,i)),t}class Pt{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,s=((t==null?void 0:t.creationScope)??y).importNode(e,!0);g.currentNode=s;let o=g.nextNode(),n=0,h=0,l=i[0];for(;l!==void 0;){if(n===l.index){let c;l.type===2?c=new H(o,o.nextSibling,this,t):l.type===1?c=new l.ctor(o,l.name,l.strings,this,t):l.type===6&&(c=new Mt(o,this,t)),this._$AV.push(c),l=i[++h]}n!==(l==null?void 0:l.index)&&(o=g.nextNode(),n++)}return g.currentNode=y,s}p(t){let e=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class H{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,i,s){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cv=(s==null?void 0:s.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=S(this,t,e),U(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==E&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):St(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==d&&U(this._$AH)?this._$AA.nextSibling.data=t:this.T(y.createTextNode(t)),this._$AH=t}$(t){var o;const{values:e,_$litType$:i}=t,s=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=M.createElement(dt(i.h,i.h[0]),this.options)),i);if(((o=this._$AH)==null?void 0:o._$AD)===s)this._$AH.p(e);else{const n=new Pt(s,this),h=n.u(this.options);n.p(e),this.T(h),this._$AH=n}}_$AC(t){let e=rt.get(t.strings);return e===void 0&&rt.set(t.strings,e=new M(t)),e}k(t){K(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const o of t)s===e.length?e.push(i=new H(this.O(O()),this.O(O()),this,this.options)):i=e[s],i._$AI(o),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,e);t&&t!==this._$AB;){const s=t.nextSibling;t.remove(),t=s}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class V{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,s,o){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=o,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=d}_$AI(t,e=this,i,s){const o=this.strings;let n=!1;if(o===void 0)t=S(this,t,e,0),n=!U(t)||t!==this._$AH&&t!==E,n&&(this._$AH=t);else{const h=t;let l,c;for(t=o[0],l=0;l<o.length-1;l++)c=S(this,h[i+l],e,l),c===E&&(c=this._$AH[l]),n||(n=!U(c)||c!==this._$AH[l]),c===d?t=d:t!==d&&(t+=(c??"")+o[l+1]),this._$AH[l]=c}n&&!s&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Ct extends V{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}}class Ot extends V{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}}class Ut extends V{constructor(t,e,i,s,o){super(t,e,i,s,o),this.type=5}_$AI(t,e=this){if((t=S(this,t,e,0)??d)===E)return;const i=this._$AH,s=t===d&&i!==d||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,o=t!==d&&(i===d||s);s&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class Mt{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){S(this,t)}}const I=C.litHtmlPolyfillSupport;I==null||I(M,H),(C.litHtmlVersions??(C.litHtmlVersions=[])).push("3.2.1");const Ht=(r,t,e)=>{const i=(e==null?void 0:e.renderBefore)??t;let s=i._$litPart$;if(s===void 0){const o=(e==null?void 0:e.renderBefore)??null;i._$litPart$=s=new H(t.insertBefore(O(),o),o,void 0,e??{})}return s._$AI(r),s};/**
|
|
16
|
-
* @license
|
|
17
|
-
* Copyright 2017 Google LLC
|
|
18
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
19
|
-
*/let b=class extends A{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Ht(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return E}};var ot;b._$litElement$=!0,b.finalized=!0,(ot=globalThis.litElementHydrateSupport)==null||ot.call(globalThis,{LitElement:b});const B=globalThis.litElementPolyfillSupport;B==null||B({LitElement:b});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.1");/**
|
|
20
|
-
* @license
|
|
21
|
-
* Copyright 2017 Google LLC
|
|
22
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
23
|
-
*/const pt=r=>(t,e)=>{e!==void 0?e.addInitializer(()=>{customElements.define(r,t)}):customElements.define(r,t)};/**
|
|
24
|
-
* @license
|
|
25
|
-
* Copyright 2017 Google LLC
|
|
26
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
27
|
-
*/const Tt={attribute:!0,type:String,converter:j,reflect:!1,hasChanged:q},Nt=(r=Tt,t,e)=>{const{kind:i,metadata:s}=e;let o=globalThis.litPropertyMetadata.get(s);if(o===void 0&&globalThis.litPropertyMetadata.set(s,o=new Map),o.set(e.name,r),i==="accessor"){const{name:n}=e;return{set(h){const l=t.get.call(this);t.set.call(this,h),this.requestUpdate(n,l,r)},init(h){return h!==void 0&&this.P(n,void 0,r),h}}}if(i==="setter"){const{name:n}=e;return function(h){const l=this[n];t.call(this,h),this.requestUpdate(n,l,r)}}throw Error("Unsupported decorator location: "+i)};function T(r){return(t,e)=>typeof e=="object"?Nt(r,t,e):((i,s,o)=>{const n=s.hasOwnProperty(o);return s.constructor.createProperty(o,n?{...i,wrapped:!0}:i),n?Object.getOwnPropertyDescriptor(s,o):void 0})(r,t,e)}const Rt="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20aria-hidden='true'%20role='img'%20class='iconify%20iconify--logos'%20width='25.6'%20height='32'%20preserveAspectRatio='xMidYMid%20meet'%20viewBox='0%200%20256%20320'%3e%3cpath%20fill='%2300E8FF'%20d='m64%20192l25.926-44.727l38.233-19.114l63.974%2063.974l10.833%2061.754L192%20320l-64-64l-38.074-25.615z'%3e%3c/path%3e%3cpath%20fill='%23283198'%20d='M128%20256V128l64-64v128l-64%2064ZM0%20256l64%2064l9.202-60.602L64%20192l-37.542%2023.71L0%20256Z'%3e%3c/path%3e%3cpath%20fill='%23324FFF'%20d='M64%20192V64l64-64v128l-64%2064Zm128%20128V192l64-64v128l-64%2064ZM0%20256V128l64%2064l-64%2064Z'%3e%3c/path%3e%3cpath%20fill='%230FF'%20d='M64%20320V192l64%2064z'%3e%3c/path%3e%3c/svg%3e",Lt=""+new URL("../vite.svg",import.meta.url).href;var jt=Object.defineProperty,kt=Object.getOwnPropertyDescriptor,ut=(r,t,e,i)=>{for(var s=i>1?void 0:i?kt(t,e):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(s=(i?n(t,e,s):n(s))||s);return i&&s&&jt(t,e,s),s};let z=class extends b{constructor(){super(...arguments),this.textVal="子组件文本默认值"}render(){return x`
|
|
28
|
-
<div class='textVal'>${this.textVal}</div>
|
|
29
|
-
`}};z.styles=lt`
|
|
30
|
-
.textVal{
|
|
31
|
-
font-size:24px;
|
|
32
|
-
color: #999;
|
|
33
|
-
}
|
|
34
|
-
`;ut([T({type:String})],z.prototype,"textVal",2);z=ut([pt("child-element")],z);var zt=Object.defineProperty,Vt=Object.getOwnPropertyDescriptor,N=(r,t,e,i)=>{for(var s=i>1?void 0:i?Vt(t,e):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(s=(i?n(t,e,s):n(s))||s);return i&&s&&zt(t,e,s),s};let v=class extends b{constructor(){super(...arguments),this.docsHint="Click on the Vite and Lit logos to learn more",this.count=0,this.dataObj={name:"abc"},this.externalFunction=r=>{console.log(r)},this.arr=[{name:"一",id:1},{name:"二",id:2}]}renderListFn(){return this.count>10?x`<span style="color: ${this.count>15?"red":"green"}">当前count大于10</span>`:x`<span>当前count小于10</span>`}connectedCallback(){super.connectedCallback(),console.log("生命周期connectedCallback")}callExternalFunction(){this.externalFunction&&this.externalFunction(this.count)}render(){return x`
|
|
35
|
-
<div>
|
|
36
|
-
<a href="https://vitejs.dev" target="_blank">
|
|
37
|
-
<img src=${Lt} class="logo" alt="Vite logo" />
|
|
38
|
-
</a>
|
|
39
|
-
<a href="https://lit.dev" target="_blank">
|
|
40
|
-
<img src=${Rt} class="logo lit ${this.count>20&&"big"}" alt="Lit logo" />
|
|
41
|
-
</a>
|
|
42
|
-
<child-element textVal='${this.count>20?"父组件的count大于20":"父组件引用子组件"}'></child-element>
|
|
43
|
-
${this.arr.map(r=>x` <div>${r.name}</div> `)}
|
|
44
|
-
${this.renderListFn()}
|
|
45
|
-
</div>
|
|
46
|
-
<slot></slot>
|
|
47
|
-
<div class="card">
|
|
48
|
-
<button @click=${this._onClick} part="button">
|
|
49
|
-
count is ${this.count}
|
|
50
|
-
</button>
|
|
51
|
-
</div>
|
|
52
|
-
<p class="read-the-docs">${this.docsHint}</p>
|
|
53
|
-
<p class="read-the-docs">${this.dataObj.name}</p>
|
|
54
|
-
<button @click="${this.callExternalFunction}">
|
|
55
|
-
Call External Function
|
|
56
|
-
</button>
|
|
57
|
-
`}_onClick(){this.count++}};v.styles=lt`
|
|
58
|
-
:host {
|
|
59
|
-
max-width: 1280px;
|
|
60
|
-
margin: 0 auto;
|
|
61
|
-
padding: 2rem;
|
|
62
|
-
text-align: center;
|
|
63
|
-
}
|
|
64
|
-
.big {
|
|
65
|
-
transform: scale(2);
|
|
66
|
-
}
|
|
67
|
-
.logo {
|
|
68
|
-
height: 6em;
|
|
69
|
-
padding: 1.5em;
|
|
70
|
-
will-change: filter;
|
|
71
|
-
transition: filter 300ms;
|
|
72
|
-
}
|
|
73
|
-
.logo:hover {
|
|
74
|
-
filter: drop-shadow(0 0 2em #646cffaa);
|
|
75
|
-
}
|
|
76
|
-
.logo.lit:hover {
|
|
77
|
-
filter: drop-shadow(0 0 2em #325cffaa);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.card {
|
|
81
|
-
padding: 2em;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.read-the-docs {
|
|
85
|
-
color: #888;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
::slotted(h1) {
|
|
89
|
-
font-size: 3.2em;
|
|
90
|
-
line-height: 1.1;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
a {
|
|
94
|
-
font-weight: 500;
|
|
95
|
-
color: #646cff;
|
|
96
|
-
text-decoration: inherit;
|
|
97
|
-
}
|
|
98
|
-
a:hover {
|
|
99
|
-
color: #535bf2;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
button {
|
|
103
|
-
border-radius: 8px;
|
|
104
|
-
border: 1px solid transparent;
|
|
105
|
-
padding: 0.6em 1.2em;
|
|
106
|
-
font-size: 1em;
|
|
107
|
-
font-weight: 500;
|
|
108
|
-
font-family: inherit;
|
|
109
|
-
background-color: #1a1a1a;
|
|
110
|
-
cursor: pointer;
|
|
111
|
-
transition: border-color 0.25s;
|
|
112
|
-
}
|
|
113
|
-
button:hover {
|
|
114
|
-
border-color: #646cff;
|
|
115
|
-
}
|
|
116
|
-
button:focus,
|
|
117
|
-
button:focus-visible {
|
|
118
|
-
outline: 4px auto -webkit-focus-ring-color;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
@media (prefers-color-scheme: light) {
|
|
122
|
-
a:hover {
|
|
123
|
-
color: #747bff;
|
|
124
|
-
}
|
|
125
|
-
button {
|
|
126
|
-
background-color: #f9f9f9;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
`;N([T()],v.prototype,"docsHint",2);N([T({type:Number})],v.prototype,"count",2);N([T({type:Object})],v.prototype,"dataObj",2);N([T({type:Function})],v.prototype,"externalFunction",2);v=N([pt("my-element")],v);
|
package/Lit/dist/index.html
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<link rel="icon" type="image/svg+xml" href="./vite.svg" />
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
-
<title>Vite + Lit + TS</title>
|
|
8
|
-
<script type="module" crossorigin src="./assets/index-C0k3p14F.js"></script>
|
|
9
|
-
<link rel="stylesheet" crossorigin href="./assets/index-BwL3dWu4.css">
|
|
10
|
-
</head>
|
|
11
|
-
<body>
|
|
12
|
-
<my-element
|
|
13
|
-
id="myEle"
|
|
14
|
-
docsHint="哈哈哈哈哈"
|
|
15
|
-
count="1"
|
|
16
|
-
dataObj='{"name":"woshi"}'
|
|
17
|
-
>
|
|
18
|
-
<h1>Vite + Lit</h1>
|
|
19
|
-
</my-element>
|
|
20
|
-
</body>
|
|
21
|
-
<script>
|
|
22
|
-
window.onload = function() {
|
|
23
|
-
// 定义一个外部函数
|
|
24
|
-
function externalFunction(message) {
|
|
25
|
-
console.log('indexHtml externalFunction',message); // 弹出传入的消息
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
// 获取组件并传入外部函数
|
|
29
|
-
const myComp = document.getElementById("myEle");
|
|
30
|
-
myComp.externalFunction = externalFunction; // 传递外部函数
|
|
31
|
-
}
|
|
32
|
-
</script>
|
|
33
|
-
</html>
|
package/Lit/dist/vite.svg
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
package/Lit/index.html
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
-
<title>Vite + Lit + TS</title>
|
|
8
|
-
<link rel="stylesheet" href="./src/index.css" />
|
|
9
|
-
<!-- <script type="module" src="/src/my-element.ts"></script> -->
|
|
10
|
-
<script type="module" src="/src/app-element.ts"></script>
|
|
11
|
-
<!-- 全量引入 -->
|
|
12
|
-
<script src="https://cdn.jsdelivr.net/npm/@banana-ui/banana/umd/index.js"></script>
|
|
13
|
-
|
|
14
|
-
</head>
|
|
15
|
-
<body>
|
|
16
|
-
<!-- <my-element
|
|
17
|
-
id="myEle"
|
|
18
|
-
docsHint="哈哈哈哈"
|
|
19
|
-
count="1"
|
|
20
|
-
dataObj='{"name":"woshi"}'
|
|
21
|
-
>
|
|
22
|
-
<h1>Vite + Lit开发组件</h1>
|
|
23
|
-
</my-element> -->
|
|
24
|
-
<app-element style="width:100vw;height: 600px;padding: 30px;"></app-element>
|
|
25
|
-
</body>
|
|
26
|
-
<script>
|
|
27
|
-
// window.onload = function() {
|
|
28
|
-
// // 定义一个外部函数
|
|
29
|
-
// function externalFunction(message) {
|
|
30
|
-
// console.log('indexHtml externalFunction输出',message); // 弹出传入的消息
|
|
31
|
-
// }
|
|
32
|
-
|
|
33
|
-
// // 获取组件并传入外部函数
|
|
34
|
-
// const myComp = document.getElementById("myEle");
|
|
35
|
-
// myComp.externalFunction = externalFunction; // 传递外部函数
|
|
36
|
-
|
|
37
|
-
// setTimeout(()=>{
|
|
38
|
-
// myComp.dataObj = {
|
|
39
|
-
// name:'Forrest'
|
|
40
|
-
// }
|
|
41
|
-
// },2000)
|
|
42
|
-
// }
|
|
43
|
-
</script>
|
|
44
|
-
</html>
|
package/Lit/package.json
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "vite-lit-ts-starter",
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "0.0.0",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"dev": "vite",
|
|
8
|
-
"build": "tsc && vite build",
|
|
9
|
-
"preview": "vite preview"
|
|
10
|
-
},
|
|
11
|
-
"dependencies": {
|
|
12
|
-
"@lit-labs/router": "^0.1.3",
|
|
13
|
-
"@material/web": "^2.2.0",
|
|
14
|
-
"@reduxjs/toolkit": "^2.5.0",
|
|
15
|
-
"@types/marked": "^6.0.0",
|
|
16
|
-
"lit": "^3.1.0",
|
|
17
|
-
"marked": "^15.0.3",
|
|
18
|
-
"redux": "^4.2.1",
|
|
19
|
-
"redux-thunk": "^3.1.0"
|
|
20
|
-
},
|
|
21
|
-
"devDependencies": {
|
|
22
|
-
"@types/node": "^22.10.1",
|
|
23
|
-
"less": "^4.2.1",
|
|
24
|
-
"less-loader": "^12.2.0",
|
|
25
|
-
"typescript": "^5.2.2",
|
|
26
|
-
"vite": "^5.0.4"
|
|
27
|
-
}
|
|
28
|
-
}
|
package/Lit/public/vite.svg
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
package/Lit/src/a.html
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet">
|
|
5
|
-
<script type="importmap">
|
|
6
|
-
{
|
|
7
|
-
"imports": {
|
|
8
|
-
"@material/web/": "https://esm.run/@material/web/"
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
</script>
|
|
12
|
-
<script type="module">
|
|
13
|
-
import '@material/web/all.js';
|
|
14
|
-
import {styles as typescaleStyles} from '@material/web/typography/md-typescale-styles.js';
|
|
15
|
-
console.log(typescaleStyles)
|
|
16
|
-
document.adoptedStyleSheets.push(typescaleStyles.styleSheet);
|
|
17
|
-
</script>
|
|
18
|
-
</head>
|
|
19
|
-
<body>
|
|
20
|
-
<h1 class="md-typescale-display-medium">Hello Material!</h1>
|
|
21
|
-
<form>
|
|
22
|
-
<p class="md-typescale-body-medium">Check out these controls in a form!</p>
|
|
23
|
-
<md-checkbox></md-checkbox>
|
|
24
|
-
<div>
|
|
25
|
-
<md-radio name="group"></md-radio>
|
|
26
|
-
<md-radio name="group"></md-radio>
|
|
27
|
-
<md-radio name="group"></md-radio>
|
|
28
|
-
</div>
|
|
29
|
-
|
|
30
|
-
<md-outlined-text-field label="Favorite color" value="Purple"></md-outlined-text-field>
|
|
31
|
-
<md-filled-button>Filled</md-filled-button>
|
|
32
|
-
<md-outlined-button type="reset">Reset</md-outlined-button>
|
|
33
|
-
</form>
|
|
34
|
-
<style>
|
|
35
|
-
form {
|
|
36
|
-
display: flex;
|
|
37
|
-
flex-direction: column;
|
|
38
|
-
align-items: flex-start;
|
|
39
|
-
gap: 16px;
|
|
40
|
-
}
|
|
41
|
-
</style>
|
|
42
|
-
</body>
|
|
43
|
-
</html>
|
package/Lit/src/app-element.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { LitElement, html, css } from 'lit';
|
|
2
|
-
import { customElement } from 'lit/decorators.js';
|
|
3
|
-
import { Router } from '@lit-labs/router';
|
|
4
|
-
import './nav-element';
|
|
5
|
-
import './my-element';
|
|
6
|
-
import "./child-element";
|
|
7
|
-
import "./markdown-element";
|
|
8
|
-
import "./fetch-element";
|
|
9
|
-
import { markdownStr } from "./assets/common";
|
|
10
|
-
import "@material/web/all.js"
|
|
11
|
-
@customElement('app-element')
|
|
12
|
-
export class AppElement extends LitElement {
|
|
13
|
-
|
|
14
|
-
private router = new Router(this, [
|
|
15
|
-
{
|
|
16
|
-
path: '/',
|
|
17
|
-
render: () => {
|
|
18
|
-
return html`<my-element><h1>首页Vite + Lit开发组件</h1></my-element>`;
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
path: '/child',
|
|
23
|
-
render: () => html`<child-element></child-element>`
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
path: '/fetch/:id',
|
|
27
|
-
render: ({id}) => html`<fetch-element id=${id || ''}></fetch-element>`
|
|
28
|
-
},
|
|
29
|
-
{ path: '/markdown', render: () => html`<markdown-element content=${markdownStr}></markdown-element>` },
|
|
30
|
-
]);
|
|
31
|
-
|
|
32
|
-
render() {
|
|
33
|
-
return html`
|
|
34
|
-
<nav-element></nav-element>
|
|
35
|
-
<main class='main'>${this.router.outlet()}</main>
|
|
36
|
-
`;
|
|
37
|
-
}
|
|
38
|
-
static styles = [css`
|
|
39
|
-
.main{
|
|
40
|
-
width:100%;
|
|
41
|
-
height: calc(100% - 6rem);
|
|
42
|
-
}
|
|
43
|
-
`]
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
declare global {
|
|
47
|
-
interface HTMLElementTagNameMap {
|
|
48
|
-
'app-element': AppElement;
|
|
49
|
-
}
|
|
50
|
-
}
|
package/Lit/src/assets/common.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export const markdownStr = `# Markdown综合示例
|
|
2
|
-
|
|
3
|
-
## 角标使用
|
|
4
|
-
|
|
5
|
-
在这个例子中,我们将使用角标来表示化学元素和数学公式。例如,水分子可以表示为H<sub>2</sub>O,而爱因斯坦的质能方程可以表示为E=mc<sup>2</sup>。
|
|
6
|
-
|
|
7
|
-
## 引用图片
|
|
8
|
-
|
|
9
|
-
下面是一张关于太阳系行星轨道的示例图片:
|
|
10
|
-
|
|
11
|
-

|
|
12
|
-
|
|
13
|
-
这张图片展示行星的大致轨道。
|
|
14
|
-
|
|
15
|
-
## 代码块
|
|
16
|
-
|
|
17
|
-
接下来是一个简单的Python代码块,用于计算两个数的和:
|
|
18
|
-
|
|
19
|
-
\`\`\`python
|
|
20
|
-
def add_numbers(a, b):
|
|
21
|
-
return a + b
|
|
22
|
-
|
|
23
|
-
result = add_numbers(3, 5)
|
|
24
|
-
print("The result is:", result)
|
|
25
|
-
\`\`\`
|
|
26
|
-
`;
|
package/Lit/src/assets/lit.svg
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="25.6" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 320"><path fill="#00E8FF" d="m64 192l25.926-44.727l38.233-19.114l63.974 63.974l10.833 61.754L192 320l-64-64l-38.074-25.615z"></path><path fill="#283198" d="M128 256V128l64-64v128l-64 64ZM0 256l64 64l9.202-60.602L64 192l-37.542 23.71L0 256Z"></path><path fill="#324FFF" d="M64 192V64l64-64v128l-64 64Zm128 128V192l64-64v128l-64 64ZM0 256V128l64 64l-64 64Z"></path><path fill="#0FF" d="M64 320V192l64 64z"></path></svg>
|
package/Lit/src/child-element.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { CSSResultGroup, LitElement, css, html } from "lit";
|
|
2
|
-
import { customElement, property } from "lit/decorators.js";
|
|
3
|
-
import { store } from './store/redux'
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
@customElement("child-element")
|
|
8
|
-
export class ChildElement extends LitElement {
|
|
9
|
-
@property({type: Object})
|
|
10
|
-
router = {}
|
|
11
|
-
@property({type: String})
|
|
12
|
-
textVal = '子组件文本默认值'
|
|
13
|
-
private goTOfetch() {
|
|
14
|
-
console.log('nowcurrentTab',this.nowcurrentTab)
|
|
15
|
-
location.href = '/fetch/34'
|
|
16
|
-
}
|
|
17
|
-
nowcurrentTab:string = ''
|
|
18
|
-
connectedCallback() {
|
|
19
|
-
super.connectedCallback();
|
|
20
|
-
console.log('store',store.getState().value)
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
render() {
|
|
24
|
-
return html`
|
|
25
|
-
<div class='textVal'>
|
|
26
|
-
<b-dropdown>
|
|
27
|
-
<b-button>Banana</b-button>
|
|
28
|
-
<b-menu slot="drop">
|
|
29
|
-
<b-menu-item>Apple</b-menu-item>
|
|
30
|
-
<b-menu-item>Orange</b-menu-item>
|
|
31
|
-
</b-menu>
|
|
32
|
-
</b-dropdown>
|
|
33
|
-
${this.textVal}
|
|
34
|
-
<md-filled-button @click=${this.goTOfetch}>goTOfetch</md-filled-button>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
</div>
|
|
38
|
-
`
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
static styles?: CSSResultGroup | undefined = css`
|
|
42
|
-
.textVal{
|
|
43
|
-
font-size:24px;
|
|
44
|
-
color: #999;
|
|
45
|
-
}
|
|
46
|
-
`
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
declare global {
|
|
50
|
-
interface HTMLElementTagNameMap {
|
|
51
|
-
"child-element": ChildElement
|
|
52
|
-
}
|
|
53
|
-
}
|
package/Lit/src/fetch-element.ts
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { LitElement, css, html } from "lit";
|
|
2
|
-
import { customElement,property } from "lit/decorators.js";
|
|
3
|
-
@customElement("fetch-element")
|
|
4
|
-
export class FetchElement extends LitElement {
|
|
5
|
-
static styles = [css``]
|
|
6
|
-
|
|
7
|
-
@property({ type: String })
|
|
8
|
-
id = '';
|
|
9
|
-
connectedCallback() {
|
|
10
|
-
super.connectedCallback();
|
|
11
|
-
console.log('fetch id',this.id)
|
|
12
|
-
this.fetchData();
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
data: any[] = [];
|
|
19
|
-
loading: boolean = true;
|
|
20
|
-
error: string | null = null;
|
|
21
|
-
async fetchData() {
|
|
22
|
-
try {
|
|
23
|
-
const response = await fetch(
|
|
24
|
-
"https://jsonplaceholder.typicode.com/posts"
|
|
25
|
-
); // 示例 API
|
|
26
|
-
if (!response.ok) {
|
|
27
|
-
throw new Error("Network response was not ok");
|
|
28
|
-
}
|
|
29
|
-
this.data = await response.json();
|
|
30
|
-
} catch (err: any) {
|
|
31
|
-
this.error = err.message;
|
|
32
|
-
} finally {
|
|
33
|
-
this.loading = false;
|
|
34
|
-
this.requestUpdate(); // 请求更新以重新渲染组件
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
fetchRender() {
|
|
39
|
-
if (this.loading) {
|
|
40
|
-
return html`<div class="loading">Loading...</div>`;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (this.error) {
|
|
44
|
-
return html`<div class="error">Error: ${this.error}</div>`;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
return html`
|
|
48
|
-
<div>
|
|
49
|
-
${this.data.map(
|
|
50
|
-
(item) => html`
|
|
51
|
-
<div class="item">
|
|
52
|
-
<h3>${item.title}</h3>
|
|
53
|
-
<p>${item.body}</p>
|
|
54
|
-
</div>
|
|
55
|
-
`
|
|
56
|
-
)}
|
|
57
|
-
</div>
|
|
58
|
-
`;
|
|
59
|
-
}
|
|
60
|
-
render() {
|
|
61
|
-
return html`
|
|
62
|
-
<div>
|
|
63
|
-
|
|
64
|
-
${this.fetchRender()}
|
|
65
|
-
|
|
66
|
-
</div>
|
|
67
|
-
`;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
declare global {
|
|
73
|
-
interface HTMLElementTagNameMap {
|
|
74
|
-
"fetch-element": FetchElement;
|
|
75
|
-
}
|
|
76
|
-
}
|
package/Lit/src/index.css
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
|
|
3
|
-
line-height: 1.5;
|
|
4
|
-
font-weight: 400;
|
|
5
|
-
|
|
6
|
-
color-scheme: light dark;
|
|
7
|
-
color: rgba(255, 255, 255, 0.87);
|
|
8
|
-
background-color: #242424;
|
|
9
|
-
|
|
10
|
-
font-synthesis: none;
|
|
11
|
-
text-rendering: optimizeLegibility;
|
|
12
|
-
-webkit-font-smoothing: antialiased;
|
|
13
|
-
-moz-osx-font-smoothing: grayscale;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
a {
|
|
17
|
-
font-weight: 500;
|
|
18
|
-
color: #646cff;
|
|
19
|
-
text-decoration: inherit;
|
|
20
|
-
}
|
|
21
|
-
a:hover {
|
|
22
|
-
color: #535bf2;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
body {
|
|
26
|
-
margin: 0;
|
|
27
|
-
display: flex;
|
|
28
|
-
place-items: center;
|
|
29
|
-
min-width: 320px;
|
|
30
|
-
min-height: 100vh;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
@media (prefers-color-scheme: light) {
|
|
34
|
-
:root {
|
|
35
|
-
color: #213547;
|
|
36
|
-
background-color: #ffffff;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { LitElement, html,css } from 'lit';
|
|
3
|
-
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
-
import {marked } from 'marked';
|
|
5
|
-
@customElement('markdown-element')
|
|
6
|
-
export class MarkdownElement extends LitElement {
|
|
7
|
-
@property({ type: String }) content = '## Hello World!';
|
|
8
|
-
|
|
9
|
-
render() {
|
|
10
|
-
const htmlString = marked.parse(this.content);
|
|
11
|
-
return html`<div class="markdown-content" id='markdown' .innerHTML=${htmlString as string}></div>`;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
static styles = css`
|
|
15
|
-
.markdown-content {
|
|
16
|
-
font-size: 16px;
|
|
17
|
-
line-height: 1.6;
|
|
18
|
-
}
|
|
19
|
-
`;
|
|
20
|
-
}
|
|
21
|
-
declare global {
|
|
22
|
-
interface HTMLElementTagNameMap {
|
|
23
|
-
"markdown-element": MarkdownElement
|
|
24
|
-
}
|
|
25
|
-
}
|