Skip to content

Commit e213c14

Browse files
committed
更新 sober
1 parent 85385c7 commit e213c14

File tree

3 files changed

+29
-12
lines changed

3 files changed

+29
-12
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"mitt": "^3.0.1",
1919
"pinia": "^3.0.3",
2020
"prettier": "^3.6.2",
21-
"sober": "1.1.1",
21+
"sober": "1.1.9",
2222
"utf8": "^3.0.0",
2323
"vite-plugin-node-polyfills": "^0.23.0",
2424
"vue": "^3.5.18",

patches/sober.patch

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,25 @@
11
diff --git a/dist/popup.js b/dist/popup.js
2-
index 1bbbdb44c20b1d49411b4b00ad14e520aed8f28e..f2e848576299d8d4ebd694b5df7ebb2eb5c1bc7b 100644
2+
index 44ca9cc8adfe7d887eca0d6640023442df6a2b50..999be5e20117655a479eeb808695ca75be215314 100644
33
--- a/dist/popup.js
44
+++ b/dist/popup.js
5-
@@ -1,2 +1,2 @@
6-
-import{useElement as w}from"./core/element.js";import{convertCSSDuration as y}from"./core/utils/CSSUtils.js";const E="s-popup",k={align:"bottom"},S=":host{display:inline-block;vertical-align:middle;text-align:left}dialog{inset:0;width:100%;height:100%;background:none;border:none;padding:0;max-width:none;max-height:none;outline:none;position:relative;overflow:hidden;color:inherit}dialog::backdrop{background:none}.scrim{position:absolute;top:0;left:0;width:100%;height:100%}.container{position:relative;width:fit-content;max-width:100%;max-height:100%}::slotted(:not([slot])){border-radius:4px;max-width:100%;max-height:100%;white-space:nowrap;box-shadow:var(--s-elevation-level2, 0 2px 4px -1px rgba(0, 0, 0, .2), 0 4px 5px 0 rgba(0, 0, 0, .14), 0 1px 10px 0 rgba(0, 0, 0, .12));background:var(--s-color-surface-container, #ECEEF0)}",C='<slot name="trigger"></slot><dialog class="popup" part="popup"><div class="scrim" part="scrim"></div><div class="container" part="container"><slot></slot></div></dialog>';class b extends w({style:S,template:C,props:k,setup(l){const r=l.querySelector("dialog"),n=l.querySelector(".container"),p=getComputedStyle(this),h=()=>{const e=p.getPropertyValue("--s-motion-easing-standard")||"cubic-bezier(0.2, 0, 0, 1.0)",t=p.getPropertyValue("--s-motion-duration-medium4")||"400ms";return{easing:e,duration:y(t)}},d=e=>{if(!this.isConnected||r.open)return;const t={top:0,left:0,origin:[]};if(r.showModal(),!this.dispatchEvent(new Event("show",{cancelable:!0})))return r.close();const o=n.offsetWidth,c=n.offsetHeight;if(!e||e instanceof HTMLElement){const g=e??this;if(!g)return;const i=g.getBoundingClientRect(),a={middle(f){t.origin[0]="center",t.left=i.left-(o-i.width)/2;const m=()=>(t.top=i.top+i.height,t.origin[1]="top",t.top+c>innerHeight),u=()=>(t.top=i.top-c,t.origin[1]="bottom",t.top<0);t.left<0&&(t.left=i.left,t.origin[0]="left"),t.left+o>innerWidth&&(t.left=i.left+i.width-o,t.origin[0]="right"),f==="top"&&u()&&m(),f==="bottom"&&m()&&u()},left(){return t.origin=["right","top"],t.left=i.left-o,t.top=i.top,t.left<0},right(){return t.origin=["left","top"],t.left=i.left+i.width,t.top=i.top,t.left+o>innerWidth}};switch(this.align){case"bottom":case"top":a.middle(this.align);break;case"left":a.left()&&a.right();break;case"right":a.right()&&a.left();break}}else t.top=e.y,t.left=e.x,t.origin=e.origin?.split(" ")??["left","top"],e.x+o>innerWidth&&(t.left=e.x-o,t.origin[0]="right"),e.y+c>innerHeight&&(t.top=e.y-c,t.origin[1]="bottom");n.style.transformOrigin=t.origin.join(" "),n.style.top=`${Math.max(t.top,0)}px`,n.style.left=`${Math.max(t.left,0)}px`;const x=n.animate({transform:["scale(.9)","scale(1)"],opacity:[0,1]},h());this.setAttribute("showed",""),x.finished.then(()=>this.dispatchEvent(new Event("showed")))},s=()=>{if(!this.isConnected||!r.open||n.getAnimations().length>0||!this.dispatchEvent(new Event("close",{cancelable:!0})))return;const e=n.animate({transform:["scale(1)","scale(.9)"],opacity:[1,0]},h());this.removeAttribute("showed"),e.finished.then(()=>{r.close(),this.dispatchEvent(new Event("closed"))})},v=e=>r.open?s():d(e);return l.querySelector("slot[name=trigger]").addEventListener("click",()=>d()),l.querySelector(".scrim").addEventListener("pointerdown",s),{expose:{show:d,toggle:v,close:s},onMounted:()=>addEventListener("resize",s),onUnmounted:()=>removeEventListener("resize",s)}}}){}b.define(E);export{b as Popup};
7-
+import{useElement as w}from"./core/element.js";import{convertCSSDuration as y}from"./core/utils/CSSUtils.js";const E="s-popup",k={align:"bottom"},S=":host{display:inline-block;vertical-align:middle;text-align:left}dialog{inset:0;width:100%;height:100%;background:none;border:none;padding:0;max-width:none;max-height:none;outline:none;position:relative;overflow:hidden;color:inherit}dialog::backdrop{background:none}.scrim{cursor:default;position:absolute;top:0;left:0;width:100%;height:100%}.container{position:relative;width:fit-content;max-width:100%;max-height:100%}::slotted(:not([slot])){border-radius:4px;max-width:100%;max-height:100%;white-space:nowrap;box-shadow:var(--s-elevation-level2, 0 2px 4px -1px rgba(0, 0, 0, .2), 0 4px 5px 0 rgba(0, 0, 0, .14), 0 1px 10px 0 rgba(0, 0, 0, .12));background:var(--s-color-surface-container, #ECEEF0)}",C='<slot name="trigger"></slot><dialog class="popup" part="popup"><div class="scrim" part="scrim"></div><div class="container" part="container"><slot></slot></div></dialog>';class b extends w({style:S,template:C,props:k,setup(l){const r=l.querySelector("dialog"),n=l.querySelector(".container"),p=getComputedStyle(this),h=()=>{const e=p.getPropertyValue("--s-motion-easing-standard")||"cubic-bezier(0.2, 0, 0, 1.0)",t=p.getPropertyValue("--s-motion-duration-medium4")||"400ms";return{easing:e,duration:y(t)}},d=e=>{if(!this.isConnected||r.open)return;const t={top:0,left:0,origin:[]};if(r.showModal(),!this.dispatchEvent(new Event("show",{cancelable:!0})))return r.close();const o=n.offsetWidth,c=n.offsetHeight;if(!e||e instanceof HTMLElement){const g=e??this;if(!g)return;const i=g.getBoundingClientRect(),a={middle(f){t.origin[0]="center",t.left=i.left-(o-i.width)/2;const m=()=>(t.top=i.top+i.height,t.origin[1]="top",t.top+c>innerHeight),u=()=>(t.top=i.top-c,t.origin[1]="bottom",t.top<0);t.left<0&&(t.left=i.left,t.origin[0]="left"),t.left+o>innerWidth&&(t.left=i.left+i.width-o,t.origin[0]="right"),f==="top"&&u()&&m(),f==="bottom"&&m()&&u()},left(){return t.origin=["right","top"],t.left=i.left-o,t.top=i.top,t.left<0},right(){return t.origin=["left","top"],t.left=i.left+i.width,t.top=i.top,t.left+o>innerWidth}};switch(this.align){case"bottom":case"top":a.middle(this.align);break;case"left":a.left()&&a.right();break;case"right":a.right()&&a.left();break}}else t.top=e.y,t.left=e.x,t.origin=e.origin?.split(" ")??["left","top"],e.x+o>innerWidth&&(t.left=e.x-o,t.origin[0]="right"),e.y+c>innerHeight&&(t.top=e.y-c,t.origin[1]="bottom");n.style.transformOrigin=t.origin.join(" "),n.style.top=`${Math.max(t.top,0)}px`,n.style.left=`${Math.max(t.left,0)}px`;const x=n.animate({transform:["scale(.9)","scale(1)"],opacity:[0,1]},h());this.setAttribute("showed",""),x.finished.then(()=>this.dispatchEvent(new Event("showed")))},s=()=>{if(!this.isConnected||!r.open||n.getAnimations().length>0||!this.dispatchEvent(new Event("close",{cancelable:!0})))return;const e=n.animate({transform:["scale(1)","scale(.9)"],opacity:[1,0]},h());this.removeAttribute("showed"),e.finished.then(()=>{r.close(),this.dispatchEvent(new Event("closed"))})},v=e=>r.open?s():d(e);return l.querySelector("slot[name=trigger]").addEventListener("click",()=>d()),l.querySelector(".scrim").addEventListener("pointerdown",s),{expose:{show:d,toggle:v,close:s},onMounted:()=>addEventListener("resize",s),onUnmounted:()=>removeEventListener("resize",s)}}}){}b.define(E);export{b as Popup};
8-
//# sourceMappingURL=popup.js.map
5+
@@ -37,6 +37,7 @@ dialog::backdrop{
6+
inset: 0;
7+
width: 100%;
8+
height: 100%;
9+
+ cursor: default;
10+
}
11+
.container{
12+
display: block;
13+
diff --git a/dist/ripple.js b/dist/ripple.js
14+
index ec5557b80470a19dad7f406f64d58dc1842ca2c2..1ce051673bba1d7b1901fe9405c158c550161075 100644
15+
--- a/dist/ripple.js
16+
+++ b/dist/ripple.js
17+
@@ -40,7 +40,7 @@ const style = /*css*/ `
18+
opacity: 0;
19+
border-radius: 50%;
20+
background: currentColor;
21+
- filter: blur(12px) opacity(var(--ripple-opacity, .18));
22+
+ filter: opacity(var(--ripple-opacity, .18));
23+
}
24+
`;
25+
const template = /*html*/ `

pnpm-lock.yaml

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)