-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
thaibault
committed
Mar 4, 2024
1 parent
02a0aa9
commit 973d502
Showing
8 changed files
with
133 additions
and
51 deletions.
There are no files selected for viewing
29 changes: 27 additions & 2 deletions
29
.../node_modules+@rmwc+ripple+index.js.patch → ...@rmwc-ripple-npm-14.0.11-22d1530040.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,30 @@ | ||
--- ../node_modules/@rmwc/ripple/index.js 2023-12-01 17:24:42 | ||
+++ index.alternate.js 2023-12-01 17:24:25 | ||
diff --git a/index.js b/index.js | ||
index 0e7b1179d008ded6246d4f7b511e0b71d9e595c3..4b84b41bfed830863d1e57b04c780bc128087424 100644 | ||
--- a/index.js | ||
+++ b/index.js | ||
@@ -1 +1 @@ | ||
-"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react/jsx-runtime"),s=require("react"),k=require("@rmwc/base"),B=require("@rmwc/provider"),S=require("@material/ripple"),F=t=>{const d=s.useRef(!1),{foundation:n,...i}=k.useFoundation({props:t,elements:{rootEl:!0,surfaceEl:!0},foundation:({rootEl:e,surfaceEl:E,getProps:N})=>new S.MDCRippleFoundation({addClass:r=>{E.addClass(r)},browserSupportsCssVars:()=>S.util.supportsCssVariables(window),computeBoundingRect:()=>e.ref?e.ref.getBoundingClientRect():k.emptyClientRect,containsEventTarget:r=>!!e.ref&&e.ref.contains(r),deregisterDocumentInteractionHandler:(r,m)=>document.documentElement.removeEventListener(r,m),deregisterInteractionHandler:(r,m)=>{},deregisterResizeHandler:r=>window.removeEventListener("resize",r),getWindowPageOffset:()=>({x:window.pageXOffset,y:window.pageYOffset}),isSurfaceActive:()=>e.ref?k.matches(e.ref,":active"):!1,isSurfaceDisabled:()=>!!N().disabled,removeClass:r=>{E.removeClass(r)},isUnbounded:()=>!!N().unbounded,registerDocumentInteractionHandler:(r,m)=>document.documentElement.addEventListener(r,m,{passive:!0}),registerInteractionHandler:(r,m)=>{},registerResizeHandler:r=>window.addEventListener("resize",r),updateCssVariable:(r,m)=>E.setStyle(r,m)})}),{rootEl:o}=i,a=s.useCallback(e=>{e.persist(),n.activate(e)},[n]),c=s.useCallback(e=>{e.persist(),n.deactivate()},[n]),{onFocus:p}=t,b=s.useCallback(e=>{p==null||p(e),n.handleFocus()},[n,p]),{onBlur:l}=t,R=s.useCallback(e=>{l==null||l(e),n.handleBlur()},[n,l]),{onMouseDown:u}=t,x=s.useCallback(e=>{u==null||u(e),d.current||a(e),d.current=!1},[u,a]),{onMouseUp:h}=t,y=s.useCallback(e=>{h==null||h(e),c(e)},[h,c]),{onTouchStart:f}=t,P=s.useCallback(e=>{d.current=!0,f==null||f(e),a(e)},[f,a]),{onTouchEnd:w}=t,D=s.useCallback(e=>{w==null||w(e),c(e)},[w,c]),{onKeyDown:v}=t,H=s.useCallback(e=>{v==null||v(e),a(e)},[v,a]),{onKeyUp:g}=t,q=s.useCallback(e=>{g==null||g(e),c(e)},[g,c]);return o.setProp("onFocus",b,!0),o.setProp("onBlur",R,!0),o.setProp("onMouseDown",x,!0),o.setProp("onMouseUp",y,!0),o.setProp("onTouchStart",P,!0),o.setProp("onTouchEnd",D,!0),o.setProp("onKeyDown",H,!0),o.setProp("onKeyUp",q,!0),s.useEffect(()=>{n.setUnbounded(!!t.unbounded)},[t.unbounded,n]),s.useEffect(()=>{t.disabled&&n.handleBlur()},[t.disabled,n]),{...i}},j=s.createContext({});function T(t){const{children:d,className:n,primary:i,accent:o,unbounded:a,surface:c,foundationRef:p,...b}=t,{rootEl:l,surfaceEl:R}=F(t),u=s.Children.only(d);if(!s.isValidElement(u))return null;const x=!c||!a,h=a?{"data-mdc-ripple-is-unbounded":!0}:{},y=x?R.props({style:u.props.style}):{};let f=k.classNames(n!==u.props.className&&n,y.className,u.props.className,{"mdc-ripple-surface":typeof c=="boolean"?c:c===void 0,"mdc-ripple-surface--primary":i,"rmwc-ripple-surface--primary":i,"mdc-ripple-surface--accent":o,"rmwc-ripple-surface--accent":o});b.disabled&&(f=f.replace("mdc-ripple-upgraded--background-focused",""));const P=s.cloneElement(u,{ref:l.reactRef,...u.props,...h,...l.props({...b,style:u.props.style,...y,className:f})});return C.jsx(j.Provider,{value:R.props({style:u.props.style}),children:P})}const I=({className:t,...d})=>C.jsx(j.Consumer,{children:n=>C.jsx("div",{...d,...n,className:`${t} ${n.className||""}`})}),O=({unbounded:t,accent:d,surface:n}={})=>i=>{const o=s.forwardRef(({ripple:a,...c},p)=>{const b=B.useProviderContext();a=a??b.ripple;const l=typeof a!="object"?{}:a;return a?C.jsx(T,{...c,accent:l.accent||d,unbounded:l.unbounded||t,surface:l.surface||n,children:C.jsx(i,{...c,ref:p})}):C.jsx(i,{...c,ref:p})});return o.displayName=`withRipple(${i.displayName||i.constructor.name||"Unknown"})`,o};exports.Ripple=T;exports.RippleSurface=I;exports.withRipple=O; | ||
+"use strict";var mergeRefs = function(a, b) {return function(el) {if (typeof a === 'function') a(el); else if (a && 'current' in a) a.current = el;if (typeof b === 'function') b(el); else if (b && 'current' in b) b.current = el}};Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react/jsx-runtime"),s=require("react"),k=require("@rmwc/base"),B=require("@rmwc/provider"),S=require("@material/ripple"),F=t=>{const d=s.useRef(!1),{foundation:n,...i}=k.useFoundation({props:t,elements:{rootEl:!0,surfaceEl:!0},foundation:({rootEl:e,surfaceEl:E,getProps:N})=>new S.MDCRippleFoundation({addClass:r=>{E.addClass(r)},browserSupportsCssVars:()=>S.util.supportsCssVariables(window),computeBoundingRect:()=>e.ref?e.ref.getBoundingClientRect():k.emptyClientRect,containsEventTarget:r=>!!e.ref&&e.ref.contains(r),deregisterDocumentInteractionHandler:(r,m)=>document.documentElement.removeEventListener(r,m),deregisterInteractionHandler:(r,m)=>{},deregisterResizeHandler:r=>window.removeEventListener("resize",r),getWindowPageOffset:()=>({x:window.pageXOffset,y:window.pageYOffset}),isSurfaceActive:()=>e.ref?k.matches(e.ref,":active"):!1,isSurfaceDisabled:()=>!!N().disabled,removeClass:r=>{E.removeClass(r)},isUnbounded:()=>!!N().unbounded,registerDocumentInteractionHandler:(r,m)=>document.documentElement.addEventListener(r,m,{passive:!0}),registerInteractionHandler:(r,m)=>{},registerResizeHandler:r=>window.addEventListener("resize",r),updateCssVariable:(r,m)=>E.setStyle(r,m)})}),{rootEl:o}=i,a=s.useCallback(e=>{e.persist(),n.activate(e)},[n]),c=s.useCallback(e=>{e.persist(),n.deactivate()},[n]),{onFocus:p}=t,b=s.useCallback(e=>{p==null||p(e),n.handleFocus()},[n,p]),{onBlur:l}=t,R=s.useCallback(e=>{l==null||l(e),n.handleBlur()},[n,l]),{onMouseDown:u}=t,x=s.useCallback(e=>{u==null||u(e),d.current||a(e),d.current=!1},[u,a]),{onMouseUp:h}=t,y=s.useCallback(e=>{h==null||h(e),c(e)},[h,c]),{onTouchStart:f}=t,P=s.useCallback(e=>{d.current=!0,f==null||f(e),a(e)},[f,a]),{onTouchEnd:w}=t,D=s.useCallback(e=>{w==null||w(e),c(e)},[w,c]),{onKeyDown:v}=t,H=s.useCallback(e=>{v==null||v(e),a(e)},[v,a]),{onKeyUp:g}=t,q=s.useCallback(e=>{g==null||g(e),c(e)},[g,c]);return o.setProp("onFocus",b,!0),o.setProp("onBlur",R,!0),o.setProp("onMouseDown",x,!0),o.setProp("onMouseUp",y,!0),o.setProp("onTouchStart",P,!0),o.setProp("onTouchEnd",D,!0),o.setProp("onKeyDown",H,!0),o.setProp("onKeyUp",q,!0),s.useEffect(()=>{n.setUnbounded(!!t.unbounded)},[t.unbounded,n]),s.useEffect(()=>{t.disabled&&n.handleBlur()},[t.disabled,n]),{...i}},j=s.createContext({});function T(t){const{children:d,className:n,primary:i,accent:o,unbounded:a,surface:c,foundationRef:p,...b}=t,{rootEl:l,surfaceEl:R}=F(t),u=s.Children.only(d);if(!s.isValidElement(u))return null;const x=!c||!a,h=a?{"data-mdc-ripple-is-unbounded":!0}:{},y=x?R.props({style:u.props.style}):{};let f=k.classNames(n!==u.props.className&&n,y.className,u.props.className,{"mdc-ripple-surface":typeof c=="boolean"?c:c===void 0,"mdc-ripple-surface--primary":i,"rmwc-ripple-surface--primary":i,"mdc-ripple-surface--accent":o,"rmwc-ripple-surface--accent":o});b.disabled&&(f=f.replace("mdc-ripple-upgraded--background-focused",""));const P=s.cloneElement(u,{ref:mergeRefs(u.ref, l.reactRef),...u.props,...h,...l.props({...b,style:u.props.style,...y,className:f})});return C.jsx(j.Provider,{value:R.props({style:u.props.style}),children:P})}const I=({className:t,...d})=>C.jsx(j.Consumer,{children:n=>C.jsx("div",{...d,...n,className:`${t} ${n.className||""}`})}),O=({unbounded:t,accent:d,surface:n}={})=>i=>{const o=s.forwardRef(({ripple:a,...c},p)=>{const b=B.useProviderContext();a=a??b.ripple;const l=typeof a!="object"?{}:a;return a?C.jsx(T,{...c,accent:l.accent||d,unbounded:l.unbounded||t,surface:l.surface||n,children:C.jsx(i,{...c,ref:p})}):C.jsx(i,{...c,ref:p})});return o.displayName=`withRipple(${i.displayName||i.constructor.name||"Unknown"})`,o};exports.Ripple=T;exports.RippleSurface=I;exports.withRipple=O; | ||
diff --git a/index.mjs b/index.mjs | ||
index 512d70fdda5ce91eeffcac4aad2cdabef8a4c6d4..18144a32d13cc6b7cccebbfcc1df0caa87865a57 100644 | ||
--- a/index.mjs | ||
+++ b/index.mjs | ||
@@ -96,6 +96,7 @@ const $ = (t) => { | ||
t.disabled && n.handleBlur(); | ||
}, [t.disabled, n]), { ...i }; | ||
}, H = y.createContext({}); | ||
+var mergeRefs = function(a,b) { return function(el) { if (typeof a === 'function') a(el); else if (a && 'current' in a) a.current = el;if (typeof b === 'function') b(el); else if (b && 'current' in b) b.current = el}}; | ||
function j(t) { | ||
const { | ||
children: l, | ||
@@ -126,8 +127,9 @@ function j(t) { | ||
"mdc-ripple-upgraded--background-focused", | ||
"" | ||
)); | ||
+ | ||
const E = y.cloneElement(c, { | ||
- ref: d.reactRef, | ||
+ ref: mergeRefs(c.ref, d.reactRef), | ||
...c.props, | ||
...b, | ||
...d.props({ |
23 changes: 21 additions & 2 deletions
23
.../node_modules+@rmwc+select+index.js.patch → ...@rmwc-select-npm-14.0.11-9eb2618d5f.patch
Large diffs are not rendered by default.
Oops, something went wrong.
8 changes: 5 additions & 3 deletions
8
...webpack+lib+config+normalization.js.patch → ...tches/webpack-npm-5.90.3-2a12e60d26.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters