@nutui/taro-biz 0.0.1-alpha.22 → 0.0.1-alpha.24
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/dist/cjs/jdmaterialsblurtarget/index.js +1 -0
- package/dist/cjs/jdmaterialview/index.js +1 -0
- package/dist/cjs/typings-oda_k1Zf.js +30 -0
- package/dist/es/index/index.js +2 -2
- package/dist/es/jdmaterialsblurtarget/index.js +1 -1
- package/dist/es/jdmaterialsblurtarget.taro-Bn_5xMxm.mjs +43 -0
- package/dist/es/jdmaterialview/index.js +2 -2
- package/dist/es/jdmaterialview.taro-KasOg_jj.mjs +319 -0
- package/dist/types/packages/jdmaterialview/types.d.ts +9 -0
- package/package.json +1 -1
- package/dist/es/jdmaterialsblurtarget.taro-CuU6ZagQ.mjs +0 -30
- package/dist/es/jdmaterialview.taro-CJ45MtXg.mjs +0 -281
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("../typings-oda_k1Zf.js"),n={...t.ComponentDefaults},s=e=>{const{children:r}={...n,...e};return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:r})};s.displayName="NutJDMaterialsBlurTarget";module.exports=s;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("../typings-oda_k1Zf.js"),f=require("react"),D=require("classnames");function X(e){switch(e){case"top-bar":case"bottom-bar":return 0;case"top-solid":case"top-plain":case"promotion-fair":case"promotion-deep":case"immersive":return 8;default:return 0}}function M(e,t){return X(e)}const m="0 6PX 16PX rgba(0,0,0,0.08), inset -0.5PX -0.5PX 0.5PX rgba(255,255,255,0.4), inset 0.5PX 0.5PX 0.5PX #fff, inset 1PX 1PX 5PX rgba(45,45,45,0.08)",g="0 6PX 16PX rgba(0,0,0,0.08), inset -0.5PX -0.5PX 0.5PX rgba(255,255,255,0.1), inset 0.5PX 0.5PX 0.5PX rgba(255,255,255,0.4), inset 1PX 1PX 5PX rgba(45,45,45,0.08)";function P(e,t){const o=X(e);switch(e){case"top-solid":return{blurRadius:3,borderRadius:o,tintColor:t?"rgba(31, 34, 38, 0.6)":"rgba(255, 255, 255, 0.65)",boxShadow:t?g:m};case"top-plain":return{blurRadius:0,borderRadius:o};case"top-bar":return{blurRadius:3,borderRadius:o,tintColor:t?"rgba(31, 34, 38, 0.6)":"rgba(255, 255, 255, 0.65)",boxShadow:t?g:m};case"promotion-fair":return{blurRadius:3,borderRadius:o,tintColor:"rgba(255, 255, 255, 0.85)"};case"promotion-deep":return{blurRadius:3,borderRadius:o,tintColor:"rgba(255, 255, 255, 0.2)"};case"immersive":return{blurRadius:3,borderRadius:o,tintColor:"rgba(31, 34, 38, 0.6)",boxShadow:g};case"bottom-bar":return{blurRadius:3,borderRadius:o,tintColor:t?"rgba(31, 34, 38, 0.8)":"rgba(255, 255, 255, 0.8)"};default:return{blurRadius:3,borderRadius:o}}}const w=P,G=P;function C(e,t){switch(e){case"top-solid":case"top-bar":return t?"FG-Dark-PX":"FG-Light-PX";case"top-plain":return"FG-Clear-PX";case"immersive":return"FG-Dark-PX";case"promotion-fair":return"FG-Skin-L-PX";case"promotion-deep":return"FG-Skin-D-PX";default:return null}}const $={...h.ComponentDefaults};function N(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function W(e){return e.style.startsWith("thin")?10:e.style.startsWith("thick")?40:20}function H(e){const t={},o=e.maxBlur??0;if(o>0&&(t.backdropFilter=`blur(${o*50}px)`,t.WebkitBackdropFilter=`blur(${o*50}px)`),e.overlayAlpha&&e.overlayAlpha>0){const l=e.overlayColor||"rgba(255,255,255,1)";t.backgroundColor=l,t.opacity=e.overlayAlpha}return t}const k=e=>{const{className:t,style:o,children:l,scene:i,targetId:v,frostedGlass:s,gradientBlur:d,overlayColor:c,liquidGlass:j,...y}={...$,...e},[b,R]=f.useState(N);f.useEffect(()=>{var n;if(typeof window>"u"||typeof window.matchMedia!="function")return;const r=window.matchMedia("(prefers-color-scheme: dark)"),a=u=>R(u.matches);return(n=r.addEventListener)==null||n.call(r,"change",a),()=>{var u;return(u=r.removeEventListener)==null?void 0:u.call(r,"change",a)}},[]);const x="nut-jdmaterialview",p=i?C(i,b):null,S=D(x,p,t),F=f.useMemo(()=>{const r={...o};if(i){const a=w(i,b);p||(a.blurRadius>0&&(r.backdropFilter=`blur(${a.blurRadius}PX)`,r.WebkitBackdropFilter=`blur(${a.blurRadius}PX)`),a.tintColor!==void 0&&r.backgroundColor===void 0&&(r.backgroundColor=a.tintColor),a.boxShadow!==void 0&&r.boxShadow===void 0&&(r.boxShadow=a.boxShadow)),r.borderRadius===void 0&&(r.borderRadius=`${a.borderRadius}px`)}else if(s){const a=W(s);r.backdropFilter=`blur(${a}px)`,r.WebkitBackdropFilter=`blur(${a}px)`,s.alpha!==void 0&&(r.opacity=s.alpha);const n=s.style.endsWith("-dark");r.backgroundColor||(r.backgroundColor=n?"rgba(0, 0, 0, 0.3)":"rgba(255, 255, 255, 0.3)")}else d&&Object.assign(r,H(d));return c&&(r.backgroundColor=c),r},[o,i,b,p,s,d,c]);return h.jsxRuntimeExports.jsx("div",{className:S,style:F,"data-target-id":v,...y,children:l})};k.displayName="NutJDMaterialView";exports.default=k;exports.getCornerRadius=M;exports.getFrostedPreset=P;exports.getH5FrostedPreset=w;exports.getH5MaterialClassName=C;exports.getPreset=G;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";const Ce=require("react");var X={exports:{}},k={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Te;function lr(){if(Te)return k;Te=1;var V=Ce,P=Symbol.for("react.element"),M=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,F=V.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,A={key:!0,ref:!0,__self:!0,__source:!0};function w(_,f,T){var p,E={},b=null,I=null;T!==void 0&&(b=""+T),f.key!==void 0&&(b=""+f.key),f.ref!==void 0&&(I=f.ref);for(p in f)m.call(f,p)&&!A.hasOwnProperty(p)&&(E[p]=f[p]);if(_&&_.defaultProps)for(p in f=_.defaultProps,f)E[p]===void 0&&(E[p]=f[p]);return{$$typeof:P,type:_,key:b,ref:I,props:E,_owner:F.current}}return k.Fragment=M,k.jsx=w,k.jsxs=w,k}var D={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Oe;function fr(){return Oe||(Oe=1,process.env.NODE_ENV!=="production"&&function(){var V=Ce,P=Symbol.for("react.element"),M=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),F=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),w=Symbol.for("react.provider"),_=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),I=Symbol.for("react.offscreen"),H=Symbol.iterator,Se="@@iterator";function Pe(e){if(e===null||typeof e!="object")return null;var r=H&&e[H]||e[Se];return typeof r=="function"?r:null}var O=V.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function c(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];we("error",e,t)}}function we(e,r,t){{var n=O.ReactDebugCurrentFrame,i=n.getStackAddendum();i!==""&&(r+="%s",t=t.concat([i]));var u=t.map(function(o){return String(o)});u.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,u)}}var je=!1,xe=!1,ke=!1,De=!1,Fe=!1,Z;Z=Symbol.for("react.module.reference");function Ae(e){return!!(typeof e=="string"||typeof e=="function"||e===m||e===A||Fe||e===F||e===T||e===p||De||e===I||je||xe||ke||typeof e=="object"&&e!==null&&(e.$$typeof===b||e.$$typeof===E||e.$$typeof===w||e.$$typeof===_||e.$$typeof===f||e.$$typeof===Z||e.getModuleId!==void 0))}function Ie(e,r,t){var n=e.displayName;if(n)return n;var i=r.displayName||r.name||"";return i!==""?t+"("+i+")":t}function Q(e){return e.displayName||"Context"}function y(e){if(e==null)return null;if(typeof e.tag=="number"&&c("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case m:return"Fragment";case M:return"Portal";case A:return"Profiler";case F:return"StrictMode";case T:return"Suspense";case p:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case _:var r=e;return Q(r)+".Consumer";case w:var t=e;return Q(t._context)+".Provider";case f:return Ie(e,e.render,"ForwardRef");case E:var n=e.displayName||null;return n!==null?n:y(e.type)||"Memo";case b:{var i=e,u=i._payload,o=i._init;try{return y(o(u))}catch{return null}}}return null}var h=Object.assign,j=0,ee,re,te,ne,ae,oe,ie;function ue(){}ue.__reactDisabledLog=!0;function $e(){{if(j===0){ee=console.log,re=console.info,te=console.warn,ne=console.error,ae=console.group,oe=console.groupCollapsed,ie=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ue,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}j++}}function We(){{if(j--,j===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:h({},e,{value:ee}),info:h({},e,{value:re}),warn:h({},e,{value:te}),error:h({},e,{value:ne}),group:h({},e,{value:ae}),groupCollapsed:h({},e,{value:oe}),groupEnd:h({},e,{value:ie})})}j<0&&c("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var U=O.ReactCurrentDispatcher,N;function $(e,r,t){{if(N===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);N=n&&n[1]||""}return`
|
|
18
|
+
`+N+e}}var q=!1,W;{var Ye=typeof WeakMap=="function"?WeakMap:Map;W=new Ye}function se(e,r){if(!e||q)return"";{var t=W.get(e);if(t!==void 0)return t}var n;q=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var u;u=U.current,U.current=null,$e();try{if(r){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(d){n=d}Reflect.construct(e,[],o)}else{try{o.call()}catch(d){n=d}e.call(o.prototype)}}else{try{throw Error()}catch(d){n=d}e()}}catch(d){if(d&&n&&typeof d.stack=="string"){for(var a=d.stack.split(`
|
|
19
|
+
`),v=n.stack.split(`
|
|
20
|
+
`),s=a.length-1,l=v.length-1;s>=1&&l>=0&&a[s]!==v[l];)l--;for(;s>=1&&l>=0;s--,l--)if(a[s]!==v[l]){if(s!==1||l!==1)do if(s--,l--,l<0||a[s]!==v[l]){var g=`
|
|
21
|
+
`+a[s].replace(" at new "," at ");return e.displayName&&g.includes("<anonymous>")&&(g=g.replace("<anonymous>",e.displayName)),typeof e=="function"&&W.set(e,g),g}while(s>=1&&l>=0);break}}}finally{q=!1,U.current=u,We(),Error.prepareStackTrace=i}var S=e?e.displayName||e.name:"",R=S?$(S):"";return typeof e=="function"&&W.set(e,R),R}function Le(e,r,t){return se(e,!1)}function Ve(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function Y(e,r,t){if(e==null)return"";if(typeof e=="function")return se(e,Ve(e));if(typeof e=="string")return $(e);switch(e){case T:return $("Suspense");case p:return $("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case f:return Le(e.render);case E:return Y(e.type,r,t);case b:{var n=e,i=n._payload,u=n._init;try{return Y(u(i),r,t)}catch{}}}return""}var x=Object.prototype.hasOwnProperty,le={},fe=O.ReactDebugCurrentFrame;function L(e){if(e){var r=e._owner,t=Y(e.type,e._source,r?r.type:null);fe.setExtraStackFrame(t)}else fe.setExtraStackFrame(null)}function Me(e,r,t,n,i){{var u=Function.call.bind(x);for(var o in e)if(u(e,o)){var a=void 0;try{if(typeof e[o]!="function"){var v=Error((n||"React class")+": "+t+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw v.name="Invariant Violation",v}a=e[o](r,o,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(s){a=s}a&&!(a instanceof Error)&&(L(i),c("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,o,typeof a),L(null)),a instanceof Error&&!(a.message in le)&&(le[a.message]=!0,L(i),c("Failed %s type: %s",t,a.message),L(null))}}}var Ue=Array.isArray;function B(e){return Ue(e)}function Ne(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function qe(e){try{return ce(e),!1}catch{return!0}}function ce(e){return""+e}function ve(e){if(qe(e))return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ne(e)),ce(e)}var de=O.ReactCurrentOwner,Be={key:!0,ref:!0,__self:!0,__source:!0},pe,ge;function Je(e){if(x.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Ke(e){if(x.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Ge(e,r){typeof e.ref=="string"&&de.current}function ze(e,r){{var t=function(){pe||(pe=!0,c("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function Xe(e,r){{var t=function(){ge||(ge=!0,c("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var He=function(e,r,t,n,i,u,o){var a={$$typeof:P,type:e,key:r,ref:t,props:o,_owner:u};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function Ze(e,r,t,n,i){{var u,o={},a=null,v=null;t!==void 0&&(ve(t),a=""+t),Ke(r)&&(ve(r.key),a=""+r.key),Je(r)&&(v=r.ref,Ge(r,i));for(u in r)x.call(r,u)&&!Be.hasOwnProperty(u)&&(o[u]=r[u]);if(e&&e.defaultProps){var s=e.defaultProps;for(u in s)o[u]===void 0&&(o[u]=s[u])}if(a||v){var l=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&ze(o,l),v&&Xe(o,l)}return He(e,a,v,i,n,de.current,o)}}var J=O.ReactCurrentOwner,Ee=O.ReactDebugCurrentFrame;function C(e){if(e){var r=e._owner,t=Y(e.type,e._source,r?r.type:null);Ee.setExtraStackFrame(t)}else Ee.setExtraStackFrame(null)}var K;K=!1;function G(e){return typeof e=="object"&&e!==null&&e.$$typeof===P}function ye(){{if(J.current){var e=y(J.current.type);if(e)return`
|
|
22
|
+
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function Qe(e){return""}var _e={};function er(e){{var r=ye();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
24
|
+
|
|
25
|
+
Check the top-level render call using <`+t+">.")}return r}}function be(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=er(r);if(_e[t])return;_e[t]=!0;var n="";e&&e._owner&&e._owner!==J.current&&(n=" It was passed a child from "+y(e._owner.type)+"."),C(e),c('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),C(null)}}function he(e,r){{if(typeof e!="object")return;if(B(e))for(var t=0;t<e.length;t++){var n=e[t];G(n)&&be(n,r)}else if(G(e))e._store&&(e._store.validated=!0);else if(e){var i=Pe(e);if(typeof i=="function"&&i!==e.entries)for(var u=i.call(e),o;!(o=u.next()).done;)G(o.value)&&be(o.value,r)}}}function rr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===f||r.$$typeof===E))t=r.propTypes;else return;if(t){var n=y(r);Me(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!K){K=!0;var i=y(r);c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",i||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&c("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function tr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){C(e),c("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),C(null);break}}e.ref!==null&&(C(e),c("Invalid attribute `ref` supplied to `React.Fragment`."),C(null))}}var Re={};function me(e,r,t,n,i,u){{var o=Ae(e);if(!o){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var v=Qe();v?a+=v:a+=ye();var s;e===null?s="null":B(e)?s="array":e!==void 0&&e.$$typeof===P?(s="<"+(y(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):s=typeof e,c("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",s,a)}var l=Ze(e,r,t,i,u);if(l==null)return l;if(o){var g=r.children;if(g!==void 0)if(n)if(B(g)){for(var S=0;S<g.length;S++)he(g[S],e);Object.freeze&&Object.freeze(g)}else c("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else he(g,e)}if(x.call(r,"key")){var R=y(e),d=Object.keys(r).filter(function(sr){return sr!=="key"}),z=d.length>0?"{key: someKey, "+d.join(": ..., ")+": ...}":"{key: someKey}";if(!Re[R+z]){var ur=d.length>0?"{"+d.join(": ..., ")+": ...}":"{}";c(`A props object containing a "key" prop is being spread into JSX:
|
|
26
|
+
let props = %s;
|
|
27
|
+
<%s {...props} />
|
|
28
|
+
React keys must be passed directly to JSX without using spread:
|
|
29
|
+
let props = %s;
|
|
30
|
+
<%s key={someKey} {...props} />`,z,R,ur,R),Re[R+z]=!0}}return e===m?tr(l):rr(l),l}}function nr(e,r,t){return me(e,r,t,!0)}function ar(e,r,t){return me(e,r,t,!1)}var or=ar,ir=nr;D.Fragment=m,D.jsx=or,D.jsxs=ir}()),D}process.env.NODE_ENV==="production"?X.exports=lr():X.exports=fr();var cr=X.exports;const vr={className:"",style:{}};exports.ComponentDefaults=vr;exports.jsxRuntimeExports=cr;
|
package/dist/es/index/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { J as e } from "../jdmaterialview.taro-
|
|
2
|
-
import { J as o } from "../jdmaterialsblurtarget.taro-
|
|
1
|
+
import { J as e } from "../jdmaterialview.taro-KasOg_jj.mjs";
|
|
2
|
+
import { J as o } from "../jdmaterialsblurtarget.taro-Bn_5xMxm.mjs";
|
|
3
3
|
export {
|
|
4
4
|
e as JDMaterialView,
|
|
5
5
|
o as JDMaterialsBlurTarget
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx as a, Fragment as m } from "react/jsx-runtime";
|
|
2
|
+
import f from "classnames";
|
|
3
|
+
import u from "@tarojs/taro";
|
|
4
|
+
import { View as p } from "@jdtaro/ui";
|
|
5
|
+
import { C as d } from "./typings-CdeuPEKG.mjs";
|
|
6
|
+
const g = {
|
|
7
|
+
...d
|
|
8
|
+
};
|
|
9
|
+
function y() {
|
|
10
|
+
var t;
|
|
11
|
+
try {
|
|
12
|
+
const r = String(((t = u.getSystemInfoSync()) == null ? void 0 : t.platform) || "").toLowerCase();
|
|
13
|
+
return r === "android" || r === "ios";
|
|
14
|
+
} catch {
|
|
15
|
+
return !1;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
const T = (t) => {
|
|
19
|
+
const { className: r, style: n, children: o, blurId: e, id: N, ...i } = {
|
|
20
|
+
...g,
|
|
21
|
+
...t
|
|
22
|
+
};
|
|
23
|
+
if (!y())
|
|
24
|
+
return /* @__PURE__ */ a(m, { children: o });
|
|
25
|
+
const l = f("nut-jdmaterialsblurtarget", r), s = i, c = typeof s.onTouchStart == "function" ? void 0 : { onTouchStart: () => {
|
|
26
|
+
} };
|
|
27
|
+
return /* @__PURE__ */ a(
|
|
28
|
+
p,
|
|
29
|
+
{
|
|
30
|
+
className: l,
|
|
31
|
+
style: n,
|
|
32
|
+
id: e,
|
|
33
|
+
blurId: e,
|
|
34
|
+
...c,
|
|
35
|
+
...s,
|
|
36
|
+
children: o
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
T.displayName = "NutJDMaterialsBlurTarget";
|
|
41
|
+
export {
|
|
42
|
+
T as J
|
|
43
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { J as r } from "../jdmaterialview.taro-
|
|
2
|
-
import { g as s, a as o, b as g } from "../jdmaterialview.taro-
|
|
1
|
+
import { J as r } from "../jdmaterialview.taro-KasOg_jj.mjs";
|
|
2
|
+
import { g as s, a as o, b as g } from "../jdmaterialview.taro-KasOg_jj.mjs";
|
|
3
3
|
export {
|
|
4
4
|
r as default,
|
|
5
5
|
s as getCornerRadius,
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
import { jsx as B } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as N, useState as P, useCallback as H, useEffect as j } from "react";
|
|
3
|
+
import Z from "classnames";
|
|
4
|
+
import p, { getEnv as rr } from "@tarojs/taro";
|
|
5
|
+
import { JDIOSMaterialView as or, View as V } from "@jdtaro/ui";
|
|
6
|
+
import { C as tr } from "./typings-CdeuPEKG.mjs";
|
|
7
|
+
const E = 26, F = "0 4px 2px 0 rgba(0, 0, 0, 0.05)", J = "0 4px 8px 0 rgba(0, 0, 0, 0.05)", er = "0 -8px 4px 0 rgba(0, 0, 0, 0.12)", ar = "0 -8px 4px 0 rgba(31, 34, 38, 0.5)";
|
|
8
|
+
function sr(t, r, o) {
|
|
9
|
+
const e = o >= E;
|
|
10
|
+
switch (t) {
|
|
11
|
+
case "top-solid":
|
|
12
|
+
return e ? {
|
|
13
|
+
liquidGlass: {
|
|
14
|
+
style: "regular",
|
|
15
|
+
interactive: !0,
|
|
16
|
+
darkMode: r,
|
|
17
|
+
...r ? {} : { tintColor: "rgba(255, 255, 255, 0.45)" }
|
|
18
|
+
},
|
|
19
|
+
boxShadow: F
|
|
20
|
+
} : { fallbackStyle: { backgroundColor: r ? "#2A2F36" : "#FFFFFF" } };
|
|
21
|
+
case "top-plain":
|
|
22
|
+
return e ? {
|
|
23
|
+
liquidGlass: {
|
|
24
|
+
style: "regular",
|
|
25
|
+
interactive: !0,
|
|
26
|
+
darkMode: r,
|
|
27
|
+
...r ? {} : { tintColor: "rgba(255, 255, 255, 0.45)" }
|
|
28
|
+
},
|
|
29
|
+
boxShadow: F
|
|
30
|
+
} : {};
|
|
31
|
+
case "top-bar":
|
|
32
|
+
return {
|
|
33
|
+
frostedGlass: {
|
|
34
|
+
style: r ? "regular-dark" : "ultra-thin-light",
|
|
35
|
+
tintColor: r ? "rgba(0, 0, 0, 0.6)" : "rgba(255, 255, 255, 0.75)"
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
case "promotion-fair":
|
|
39
|
+
return {
|
|
40
|
+
liquidGlass: { style: "clear", interactive: !1 },
|
|
41
|
+
frostedGlass: { style: "thick-light", alpha: 1 },
|
|
42
|
+
// 阴影仅玻璃态显示(对齐 ObjC shadowAlpha=0.05 / fallbackShadowAlpha=0)
|
|
43
|
+
...e ? { boxShadow: J } : {}
|
|
44
|
+
};
|
|
45
|
+
case "promotion-deep":
|
|
46
|
+
return {
|
|
47
|
+
liquidGlass: { style: "clear", interactive: !1 },
|
|
48
|
+
frostedGlass: { style: "ultra-thin-light", alpha: 1 },
|
|
49
|
+
...e ? { boxShadow: J } : {}
|
|
50
|
+
};
|
|
51
|
+
case "immersive":
|
|
52
|
+
return e ? {
|
|
53
|
+
liquidGlass: {
|
|
54
|
+
style: "regular",
|
|
55
|
+
darkMode: !0,
|
|
56
|
+
interactive: !0,
|
|
57
|
+
tintColor: "rgba(0, 0, 0, 0.05)"
|
|
58
|
+
},
|
|
59
|
+
boxShadow: F
|
|
60
|
+
} : { frostedGlass: { style: "regular-dark", alpha: 1 } };
|
|
61
|
+
case "bottom-bar":
|
|
62
|
+
return {
|
|
63
|
+
gradientBlur: {
|
|
64
|
+
minBlur: 0.5,
|
|
65
|
+
maxBlur: 0.8,
|
|
66
|
+
overlayAlpha: 0.9,
|
|
67
|
+
overlayColor: r ? "rgba(0, 0, 0, 1)" : "rgba(255, 255, 255, 1)"
|
|
68
|
+
},
|
|
69
|
+
// 底导背板阴影向上(对齐 ObjC off(0,-8) radius4):亮色黑 α0.12 / 暗色深灰 α0.5
|
|
70
|
+
boxShadow: r ? ar : er
|
|
71
|
+
};
|
|
72
|
+
default:
|
|
73
|
+
return {};
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function nr(t, r) {
|
|
77
|
+
const o = r >= E;
|
|
78
|
+
switch (t) {
|
|
79
|
+
case "top-bar":
|
|
80
|
+
case "bottom-bar":
|
|
81
|
+
return 0;
|
|
82
|
+
case "top-plain":
|
|
83
|
+
return o ? 12 : 0;
|
|
84
|
+
case "top-solid":
|
|
85
|
+
case "promotion-fair":
|
|
86
|
+
case "promotion-deep":
|
|
87
|
+
case "immersive":
|
|
88
|
+
return o ? 12 : 8;
|
|
89
|
+
default:
|
|
90
|
+
return 0;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
function W(t) {
|
|
94
|
+
switch (t) {
|
|
95
|
+
case "top-bar":
|
|
96
|
+
case "bottom-bar":
|
|
97
|
+
return 0;
|
|
98
|
+
case "top-solid":
|
|
99
|
+
case "top-plain":
|
|
100
|
+
case "promotion-fair":
|
|
101
|
+
case "promotion-deep":
|
|
102
|
+
case "immersive":
|
|
103
|
+
return 8;
|
|
104
|
+
default:
|
|
105
|
+
return 0;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
const R = "255, 255, 255", D = "31, 34, 38";
|
|
109
|
+
function ir(t, r) {
|
|
110
|
+
const o = W(t);
|
|
111
|
+
switch (t) {
|
|
112
|
+
case "top-solid":
|
|
113
|
+
return {
|
|
114
|
+
blurRadius: 40,
|
|
115
|
+
borderRadius: o,
|
|
116
|
+
tintColor: r ? "rgba(42, 47, 54, 1)" : "rgba(255, 255, 255, 1)"
|
|
117
|
+
};
|
|
118
|
+
case "top-plain":
|
|
119
|
+
return { blurRadius: 0, borderRadius: o };
|
|
120
|
+
case "top-bar":
|
|
121
|
+
return {
|
|
122
|
+
blurRadius: 40,
|
|
123
|
+
borderRadius: o,
|
|
124
|
+
tintColor: r ? `rgba(${D}, 0.9)` : `rgba(${R}, 0.9)`
|
|
125
|
+
};
|
|
126
|
+
case "promotion-fair":
|
|
127
|
+
return { blurRadius: 40, borderRadius: o, tintColor: `rgba(${R}, 0.85)` };
|
|
128
|
+
case "promotion-deep":
|
|
129
|
+
return { blurRadius: 40, borderRadius: o, tintColor: `rgba(${R}, 0.2)` };
|
|
130
|
+
case "immersive":
|
|
131
|
+
return { blurRadius: 40, borderRadius: o, tintColor: `rgba(${D}, 0.4)` };
|
|
132
|
+
case "bottom-bar":
|
|
133
|
+
return {
|
|
134
|
+
blurRadius: 50,
|
|
135
|
+
borderRadius: o,
|
|
136
|
+
tintColor: r ? `rgba(${D}, 0.8)` : `rgba(${R}, 0.8)`
|
|
137
|
+
};
|
|
138
|
+
default:
|
|
139
|
+
return { blurRadius: 40, borderRadius: o };
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
function lr(t) {
|
|
143
|
+
const r = t ? "0, 0, 0" : "255, 255, 255";
|
|
144
|
+
return `linear-gradient(to bottom, rgba(${r}, 0.8) 0%, rgba(${r}, 0.8) 56%, rgba(${r}, 0.78) 66%, rgba(${r}, 0.72) 76%, rgba(${r}, 0.62) 86%, rgba(${r}, 0.49) 94%, rgba(${r}, 0.3) 100%)`;
|
|
145
|
+
}
|
|
146
|
+
function cr(t, r) {
|
|
147
|
+
const o = r ? "dark" : "light", e = W(t);
|
|
148
|
+
switch (t) {
|
|
149
|
+
case "top-solid":
|
|
150
|
+
return {
|
|
151
|
+
blurScale: 1,
|
|
152
|
+
borderRadius: e,
|
|
153
|
+
colorMode: o,
|
|
154
|
+
overlayColor: r ? "#2A2F36" : "#FFFFFF"
|
|
155
|
+
};
|
|
156
|
+
case "top-plain":
|
|
157
|
+
return { blurScale: 0, borderRadius: e, colorMode: o };
|
|
158
|
+
case "top-bar":
|
|
159
|
+
return {
|
|
160
|
+
blurScale: 0.9,
|
|
161
|
+
borderRadius: e,
|
|
162
|
+
colorMode: o,
|
|
163
|
+
overlayColor: r ? "rgba(0, 0, 0, 0.3)" : "rgba(255, 255, 255, 0.62)"
|
|
164
|
+
};
|
|
165
|
+
case "promotion-fair":
|
|
166
|
+
return { blurScale: 0.85, borderRadius: e, colorMode: "light" };
|
|
167
|
+
case "promotion-deep":
|
|
168
|
+
return { blurScale: 0.2, borderRadius: e, colorMode: "light" };
|
|
169
|
+
case "immersive":
|
|
170
|
+
return { blurScale: 0.4, borderRadius: e, colorMode: "dark" };
|
|
171
|
+
case "bottom-bar":
|
|
172
|
+
return {
|
|
173
|
+
blurScale: 0.2,
|
|
174
|
+
borderRadius: e,
|
|
175
|
+
colorMode: o,
|
|
176
|
+
backgroundGradient: lr(r),
|
|
177
|
+
boxShadow: "0 8px 40px rgba(0, 0, 0, 0.12)"
|
|
178
|
+
};
|
|
179
|
+
default:
|
|
180
|
+
return { blurScale: 0, borderRadius: e, colorMode: o };
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
function ur(t, r) {
|
|
184
|
+
const o = /^#?([0-9a-fA-F]{6})$/.exec(t.trim());
|
|
185
|
+
if (!o) return t;
|
|
186
|
+
const e = parseInt(o[1], 16), a = e >> 16 & 255, i = e >> 8 & 255, d = e & 255, m = Math.max(0, Math.min(1, r));
|
|
187
|
+
return `rgba(${a}, ${i}, ${d}, ${m})`;
|
|
188
|
+
}
|
|
189
|
+
const dr = {
|
|
190
|
+
...tr
|
|
191
|
+
};
|
|
192
|
+
function br() {
|
|
193
|
+
return ["harmony", "harmonyhybrid", "jdharmony"].includes(
|
|
194
|
+
rr().toLowerCase()
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
function gr() {
|
|
198
|
+
var t;
|
|
199
|
+
try {
|
|
200
|
+
const r = p.getSystemInfoSync(), o = String((r == null ? void 0 : r.platform) || "").toLowerCase(), e = String((r == null ? void 0 : r.system) || ""), a = o === "ios", i = a ? parseInt(((t = e.match(/\d+/)) == null ? void 0 : t[0]) || "0", 10) : 0, d = String((r == null ? void 0 : r.theme) || "").toLowerCase() === "dark";
|
|
201
|
+
return { isIOS: a, iosMajor: i, dark: d };
|
|
202
|
+
} catch {
|
|
203
|
+
return { isIOS: !1, iosMajor: 0, dark: !1 };
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
function mr() {
|
|
207
|
+
try {
|
|
208
|
+
const t = p.getSystemInfoSync();
|
|
209
|
+
return String((t == null ? void 0 : t.theme) || "").toLowerCase() === "dark";
|
|
210
|
+
} catch {
|
|
211
|
+
return !1;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
function fr(t) {
|
|
215
|
+
const { scene: r, dark: o, overlayColor: e, cls: a, style: i, children: d, rest: m } = t, s = r ? cr(r, o) : void 0, c = {};
|
|
216
|
+
s ? (c.blurScale = s.blurScale, c.colorMode = s.colorMode) : c.colorMode = o ? "dark" : "light";
|
|
217
|
+
const u = { ...i };
|
|
218
|
+
(i == null ? void 0 : i.borderRadius) === void 0 && s && (u.borderRadius = `${s.borderRadius}px`);
|
|
219
|
+
const b = e ?? (s == null ? void 0 : s.overlayColor);
|
|
220
|
+
return b && u.backgroundColor === void 0 && (u.backgroundColor = b), s != null && s.backgroundGradient && u.background === void 0 && (u.background = s.backgroundGradient), s != null && s.boxShadow && u.boxShadow === void 0 && (u.boxShadow = s.boxShadow), /* @__PURE__ */ B(V, { className: a, style: u, ...c, ...m, children: d });
|
|
221
|
+
}
|
|
222
|
+
function hr(t) {
|
|
223
|
+
const { scene: r, dark: o, targetId: e, overlayColor: a, cls: i, style: d, children: m, rest: s } = t, c = r ? ir(r, o) : void 0, u = { ...d };
|
|
224
|
+
c && c.blurRadius > 0 && (u.backdropFilter = `blur(${c.blurRadius}px)`), c && u.borderRadius === void 0 && (u.borderRadius = `${c.borderRadius}px`);
|
|
225
|
+
const b = a ?? (c == null ? void 0 : c.tintColor), y = {};
|
|
226
|
+
return e && (y.targetId = e), r && (y.scene = r), b && (y.overlayColor = b), /* @__PURE__ */ B(V, { className: i, style: u, ...y, ...s, children: m });
|
|
227
|
+
}
|
|
228
|
+
const pr = (t) => {
|
|
229
|
+
const {
|
|
230
|
+
className: r,
|
|
231
|
+
style: o,
|
|
232
|
+
children: e,
|
|
233
|
+
scene: a,
|
|
234
|
+
targetId: i,
|
|
235
|
+
theme: d = "auto",
|
|
236
|
+
extractTint: m,
|
|
237
|
+
liquidGlass: s,
|
|
238
|
+
frostedGlass: c,
|
|
239
|
+
gradientBlur: u,
|
|
240
|
+
overlayColor: b,
|
|
241
|
+
id: y,
|
|
242
|
+
...T
|
|
243
|
+
} = { ...dr, ...t }, M = Z("nut-jdmaterialview", r), { isIOS: S, iosMajor: I } = N(() => gr(), []), $ = d === "auto", [K, Y] = P(() => mr()), O = H(
|
|
244
|
+
(n) => {
|
|
245
|
+
const g = typeof n == "string" ? n : String((n == null ? void 0 : n.theme) || "");
|
|
246
|
+
Y(g.toLowerCase() === "dark");
|
|
247
|
+
},
|
|
248
|
+
[]
|
|
249
|
+
);
|
|
250
|
+
j(() => {
|
|
251
|
+
var n, g;
|
|
252
|
+
if ($) {
|
|
253
|
+
try {
|
|
254
|
+
(g = (n = p).onThemeChange) == null || g.call(n, O);
|
|
255
|
+
} catch {
|
|
256
|
+
}
|
|
257
|
+
return () => {
|
|
258
|
+
var f, C;
|
|
259
|
+
try {
|
|
260
|
+
(C = (f = p).offThemeChange) == null || C.call(f, O);
|
|
261
|
+
} catch {
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
}, [$, O]);
|
|
266
|
+
const v = $ ? K : d === "dark", l = N(
|
|
267
|
+
() => a ? sr(a, v, I) : void 0,
|
|
268
|
+
[a, v, I]
|
|
269
|
+
), k = s ?? (l == null ? void 0 : l.liquidGlass), x = !!m && (a === "promotion-fair" || a === "promotion-deep"), w = i ? `taro_material_${i}` : void 0, [_, Q] = P(void 0), L = H(() => {
|
|
270
|
+
var C;
|
|
271
|
+
if (!S || !x || !w || !i) return;
|
|
272
|
+
const n = p;
|
|
273
|
+
if (typeof n.getTagById != "function" || !((C = n.JDTheme) != null && C.getGlassTintConfig)) return;
|
|
274
|
+
const g = n.getTagById(w), f = n.getTagById(i);
|
|
275
|
+
g == null || f == null || g < 0 || f < 0 || n.JDTheme.getGlassTintConfig({ materialTag: g, blurTag: f }).then((G) => {
|
|
276
|
+
const h = (G == null ? void 0 : G.data) ?? G, q = h == null ? void 0 : h.tintColor, A = h == null ? void 0 : h.tintAlpha;
|
|
277
|
+
!q || !A || A <= 0 || Q(ur(q, A));
|
|
278
|
+
}).catch(() => {
|
|
279
|
+
});
|
|
280
|
+
}, [S, x, a, w, i]);
|
|
281
|
+
j(() => {
|
|
282
|
+
!S || !x || p.nextTick(() => L());
|
|
283
|
+
}, [S, x, v, L, a, i]);
|
|
284
|
+
const U = k && _ ? { ...k, tintColor: _ } : k, z = c ?? (l == null ? void 0 : l.frostedGlass), X = u ?? (l == null ? void 0 : l.gradientBlur);
|
|
285
|
+
if (S) {
|
|
286
|
+
const n = { ...l == null ? void 0 : l.fallbackStyle, ...o };
|
|
287
|
+
return a && n.borderRadius === void 0 && (n.borderRadius = `${nr(a, I)}px`), l != null && l.boxShadow && n.boxShadow === void 0 && (n.boxShadow = l.boxShadow), /* @__PURE__ */ B(
|
|
288
|
+
or,
|
|
289
|
+
{
|
|
290
|
+
id: w,
|
|
291
|
+
className: M,
|
|
292
|
+
style: n,
|
|
293
|
+
targetId: i,
|
|
294
|
+
liquidGlass: U,
|
|
295
|
+
frostedGlass: z,
|
|
296
|
+
gradientBlur: X,
|
|
297
|
+
...T,
|
|
298
|
+
children: e
|
|
299
|
+
}
|
|
300
|
+
);
|
|
301
|
+
}
|
|
302
|
+
return br() ? fr({ scene: a, dark: v, overlayColor: b, cls: M, style: o, children: e, rest: T }) : hr({
|
|
303
|
+
scene: a,
|
|
304
|
+
dark: v,
|
|
305
|
+
targetId: i,
|
|
306
|
+
overlayColor: b,
|
|
307
|
+
cls: M,
|
|
308
|
+
style: o,
|
|
309
|
+
children: e,
|
|
310
|
+
rest: T
|
|
311
|
+
});
|
|
312
|
+
};
|
|
313
|
+
pr.displayName = "NutJDMaterialView";
|
|
314
|
+
export {
|
|
315
|
+
pr as J,
|
|
316
|
+
ir as a,
|
|
317
|
+
sr as b,
|
|
318
|
+
nr as g
|
|
319
|
+
};
|
|
@@ -22,4 +22,13 @@ export interface JDMaterialViewProps extends BasicComponent {
|
|
|
22
22
|
* 不再随系统主题变化。(immersive、promotion-* 等场景明暗由场景语义固定,不受影响)
|
|
23
23
|
*/
|
|
24
24
|
theme?: 'auto' | 'light' | 'dark';
|
|
25
|
+
/**
|
|
26
|
+
* 是否从换肤背景提取颜色并应用到玻璃上。仅 iOS 消费,其他端不处理该属性。
|
|
27
|
+
* 仅 scene 为 promotion-fair / promotion-deep 时生效;置 true 后除首次提取外,
|
|
28
|
+
* 还会在主题(明暗)切换时重新提取。
|
|
29
|
+
*
|
|
30
|
+
* ⚠️ 置 true 时,换肤背景图必须已加载完毕——图片未加载完时提取不出正确的颜色。
|
|
31
|
+
* 故应由业务在背景图就绪后再置 true。默认 false(不提取)。
|
|
32
|
+
*/
|
|
33
|
+
extractTint?: boolean;
|
|
25
34
|
}
|
package/package.json
CHANGED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { jsx as s, Fragment as i } from "react/jsx-runtime";
|
|
2
|
-
import m from "classnames";
|
|
3
|
-
import c from "@tarojs/taro";
|
|
4
|
-
import { View as f } from "@jdtaro/ui";
|
|
5
|
-
import { C as u } from "./typings-CdeuPEKG.mjs";
|
|
6
|
-
const p = {
|
|
7
|
-
...u
|
|
8
|
-
};
|
|
9
|
-
function d() {
|
|
10
|
-
var r;
|
|
11
|
-
try {
|
|
12
|
-
return String(((r = c.getSystemInfoSync()) == null ? void 0 : r.platform) || "").toLowerCase() === "android";
|
|
13
|
-
} catch {
|
|
14
|
-
return !1;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
const g = (r) => {
|
|
18
|
-
const { className: a, style: e, children: t, blurId: o, ...n } = {
|
|
19
|
-
...p,
|
|
20
|
-
...r
|
|
21
|
-
};
|
|
22
|
-
if (!d())
|
|
23
|
-
return /* @__PURE__ */ s(i, { children: t });
|
|
24
|
-
const l = m("nut-jdmaterialsblurtarget", a);
|
|
25
|
-
return /* @__PURE__ */ s(f, { className: l, style: e, blurId: o, ...n, children: t });
|
|
26
|
-
};
|
|
27
|
-
g.displayName = "NutJDMaterialsBlurTarget";
|
|
28
|
-
export {
|
|
29
|
-
g as J
|
|
30
|
-
};
|
|
@@ -1,281 +0,0 @@
|
|
|
1
|
-
import { jsx as k } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo as $, useState as N, useCallback as P, useEffect as j } from "react";
|
|
3
|
-
import V from "classnames";
|
|
4
|
-
import h, { getEnv as T } from "@tarojs/taro";
|
|
5
|
-
import { JDIOSMaterialView as _, View as x } from "@jdtaro/ui";
|
|
6
|
-
import { C as E } from "./typings-CdeuPEKG.mjs";
|
|
7
|
-
const F = 26;
|
|
8
|
-
function H(e, r, o) {
|
|
9
|
-
const t = o >= F;
|
|
10
|
-
switch (e) {
|
|
11
|
-
case "top-solid":
|
|
12
|
-
return t ? {
|
|
13
|
-
liquidGlass: {
|
|
14
|
-
style: "regular",
|
|
15
|
-
interactive: !0,
|
|
16
|
-
darkMode: r,
|
|
17
|
-
...r ? {} : { tintColor: "rgba(255, 255, 255, 0.45)" }
|
|
18
|
-
}
|
|
19
|
-
} : { fallbackStyle: { backgroundColor: r ? "#2A2F36" : "#FFFFFF" } };
|
|
20
|
-
case "top-plain":
|
|
21
|
-
return t ? {
|
|
22
|
-
liquidGlass: {
|
|
23
|
-
style: "regular",
|
|
24
|
-
interactive: !0,
|
|
25
|
-
darkMode: r,
|
|
26
|
-
...r ? {} : { tintColor: "rgba(255, 255, 255, 0.45)" }
|
|
27
|
-
}
|
|
28
|
-
} : {};
|
|
29
|
-
case "top-bar":
|
|
30
|
-
return { frostedGlass: { style: r ? "thick-dark" : "thick-light" } };
|
|
31
|
-
case "promotion-fair":
|
|
32
|
-
return {
|
|
33
|
-
liquidGlass: { style: "clear", interactive: !1 },
|
|
34
|
-
frostedGlass: { style: "thick-light", alpha: 1 }
|
|
35
|
-
};
|
|
36
|
-
case "promotion-deep":
|
|
37
|
-
return {
|
|
38
|
-
liquidGlass: { style: "clear", interactive: !1 },
|
|
39
|
-
frostedGlass: { style: "ultra-thin-light", alpha: 1 }
|
|
40
|
-
};
|
|
41
|
-
case "immersive":
|
|
42
|
-
return t ? {
|
|
43
|
-
liquidGlass: {
|
|
44
|
-
style: "regular",
|
|
45
|
-
darkMode: !0,
|
|
46
|
-
interactive: !0,
|
|
47
|
-
tintColor: "rgba(0, 0, 0, 0.75)"
|
|
48
|
-
}
|
|
49
|
-
} : { frostedGlass: { style: "regular-dark", alpha: 1 } };
|
|
50
|
-
case "bottom-bar":
|
|
51
|
-
return {
|
|
52
|
-
gradientBlur: {
|
|
53
|
-
minBlur: 0.5,
|
|
54
|
-
maxBlur: 0.8,
|
|
55
|
-
overlayAlpha: 0.9,
|
|
56
|
-
overlayColor: r ? "rgba(0, 0, 0, 1)" : "rgba(255, 255, 255, 1)"
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
default:
|
|
60
|
-
return {};
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
function J(e, r) {
|
|
64
|
-
const o = r >= F;
|
|
65
|
-
switch (e) {
|
|
66
|
-
case "top-bar":
|
|
67
|
-
case "bottom-bar":
|
|
68
|
-
return 0;
|
|
69
|
-
case "top-plain":
|
|
70
|
-
return o ? 12 : 0;
|
|
71
|
-
case "top-solid":
|
|
72
|
-
case "promotion-fair":
|
|
73
|
-
case "promotion-deep":
|
|
74
|
-
case "immersive":
|
|
75
|
-
return o ? 12 : 8;
|
|
76
|
-
default:
|
|
77
|
-
return 0;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
function I(e) {
|
|
81
|
-
switch (e) {
|
|
82
|
-
case "top-bar":
|
|
83
|
-
case "bottom-bar":
|
|
84
|
-
return 0;
|
|
85
|
-
case "top-solid":
|
|
86
|
-
case "top-plain":
|
|
87
|
-
case "promotion-fair":
|
|
88
|
-
case "promotion-deep":
|
|
89
|
-
case "immersive":
|
|
90
|
-
return 8;
|
|
91
|
-
default:
|
|
92
|
-
return 0;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
const p = "255, 255, 255", R = "31, 34, 38";
|
|
96
|
-
function Y(e, r) {
|
|
97
|
-
const o = I(e);
|
|
98
|
-
switch (e) {
|
|
99
|
-
case "top-solid":
|
|
100
|
-
return {
|
|
101
|
-
blurRadius: 40,
|
|
102
|
-
borderRadius: o,
|
|
103
|
-
tintColor: r ? "rgba(42, 47, 54, 1)" : "rgba(255, 255, 255, 1)"
|
|
104
|
-
};
|
|
105
|
-
case "top-plain":
|
|
106
|
-
return { blurRadius: 0, borderRadius: o };
|
|
107
|
-
case "top-bar":
|
|
108
|
-
return {
|
|
109
|
-
blurRadius: 40,
|
|
110
|
-
borderRadius: o,
|
|
111
|
-
tintColor: r ? `rgba(${R}, 0.9)` : `rgba(${p}, 0.9)`
|
|
112
|
-
};
|
|
113
|
-
case "promotion-fair":
|
|
114
|
-
return { blurRadius: 40, borderRadius: o, tintColor: `rgba(${p}, 0.85)` };
|
|
115
|
-
case "promotion-deep":
|
|
116
|
-
return { blurRadius: 40, borderRadius: o, tintColor: `rgba(${p}, 0.2)` };
|
|
117
|
-
case "immersive":
|
|
118
|
-
return { blurRadius: 40, borderRadius: o, tintColor: `rgba(${R}, 0.4)` };
|
|
119
|
-
case "bottom-bar":
|
|
120
|
-
return {
|
|
121
|
-
blurRadius: 50,
|
|
122
|
-
borderRadius: o,
|
|
123
|
-
tintColor: r ? `rgba(${R}, 0.8)` : `rgba(${p}, 0.8)`
|
|
124
|
-
};
|
|
125
|
-
default:
|
|
126
|
-
return { blurRadius: 40, borderRadius: o };
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
function K(e) {
|
|
130
|
-
const r = e ? "0, 0, 0" : "255, 255, 255";
|
|
131
|
-
return `linear-gradient(to bottom, rgba(${r}, 0.8) 0%, rgba(${r}, 0.8) 56%, rgba(${r}, 0.78) 66%, rgba(${r}, 0.72) 76%, rgba(${r}, 0.62) 86%, rgba(${r}, 0.49) 94%, rgba(${r}, 0.3) 100%)`;
|
|
132
|
-
}
|
|
133
|
-
function Q(e, r) {
|
|
134
|
-
const o = r ? "dark" : "light", t = I(e);
|
|
135
|
-
switch (e) {
|
|
136
|
-
case "top-solid":
|
|
137
|
-
return {
|
|
138
|
-
blurScale: 1,
|
|
139
|
-
borderRadius: t,
|
|
140
|
-
colorMode: o,
|
|
141
|
-
overlayColor: r ? "#2A2F36" : "#FFFFFF"
|
|
142
|
-
};
|
|
143
|
-
case "top-plain":
|
|
144
|
-
return { blurScale: 0, borderRadius: t, colorMode: o };
|
|
145
|
-
case "top-bar":
|
|
146
|
-
return {
|
|
147
|
-
blurScale: 0.9,
|
|
148
|
-
borderRadius: t,
|
|
149
|
-
colorMode: o,
|
|
150
|
-
overlayColor: r ? "rgba(0, 0, 0, 0.3)" : "rgba(255, 255, 255, 0.62)"
|
|
151
|
-
};
|
|
152
|
-
case "promotion-fair":
|
|
153
|
-
return { blurScale: 0.85, borderRadius: t, colorMode: "light" };
|
|
154
|
-
case "promotion-deep":
|
|
155
|
-
return { blurScale: 0.2, borderRadius: t, colorMode: "light" };
|
|
156
|
-
case "immersive":
|
|
157
|
-
return { blurScale: 0.4, borderRadius: t, colorMode: "dark" };
|
|
158
|
-
case "bottom-bar":
|
|
159
|
-
return {
|
|
160
|
-
blurScale: 0.2,
|
|
161
|
-
borderRadius: t,
|
|
162
|
-
colorMode: o,
|
|
163
|
-
backgroundGradient: K(r),
|
|
164
|
-
boxShadow: "0 8px 40px rgba(0, 0, 0, 0.12)"
|
|
165
|
-
};
|
|
166
|
-
default:
|
|
167
|
-
return { blurScale: 0, borderRadius: t, colorMode: o };
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
const U = {
|
|
171
|
-
...E
|
|
172
|
-
};
|
|
173
|
-
function z() {
|
|
174
|
-
return ["harmony", "harmonyhybrid", "jdharmony"].includes(
|
|
175
|
-
T().toLowerCase()
|
|
176
|
-
);
|
|
177
|
-
}
|
|
178
|
-
function W() {
|
|
179
|
-
var e;
|
|
180
|
-
try {
|
|
181
|
-
const r = h.getSystemInfoSync(), o = String((r == null ? void 0 : r.platform) || "").toLowerCase(), t = String((r == null ? void 0 : r.system) || ""), i = o === "ios", u = i ? parseInt(((e = t.match(/\d+/)) == null ? void 0 : e[0]) || "0", 10) : 0, b = String((r == null ? void 0 : r.theme) || "").toLowerCase() === "dark";
|
|
182
|
-
return { isIOS: i, iosMajor: u, dark: b };
|
|
183
|
-
} catch {
|
|
184
|
-
return { isIOS: !1, iosMajor: 0, dark: !1 };
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
function X() {
|
|
188
|
-
try {
|
|
189
|
-
const e = h.getSystemInfoSync();
|
|
190
|
-
return String((e == null ? void 0 : e.theme) || "").toLowerCase() === "dark";
|
|
191
|
-
} catch {
|
|
192
|
-
return !1;
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
function Z(e) {
|
|
196
|
-
const { scene: r, dark: o, overlayColor: t, cls: i, style: u, children: b, rest: m } = e, a = r ? Q(r, o) : void 0, l = {};
|
|
197
|
-
a ? (l.blurScale = a.blurScale, l.colorMode = a.colorMode) : l.colorMode = o ? "dark" : "light";
|
|
198
|
-
const s = { ...u };
|
|
199
|
-
(u == null ? void 0 : u.borderRadius) === void 0 && a && (s.borderRadius = `${a.borderRadius}px`);
|
|
200
|
-
const d = t ?? (a == null ? void 0 : a.overlayColor);
|
|
201
|
-
return d && s.backgroundColor === void 0 && (s.backgroundColor = d), a != null && a.backgroundGradient && s.background === void 0 && (s.background = a.backgroundGradient), a != null && a.boxShadow && s.boxShadow === void 0 && (s.boxShadow = a.boxShadow), /* @__PURE__ */ k(x, { className: i, style: s, ...l, ...m, children: b });
|
|
202
|
-
}
|
|
203
|
-
function rr(e) {
|
|
204
|
-
const { scene: r, dark: o, targetId: t, overlayColor: i, cls: u, style: b, children: m, rest: a } = e, l = r ? Y(r, o) : void 0, s = { ...b };
|
|
205
|
-
l && l.blurRadius > 0 && (s.backdropFilter = `blur(${l.blurRadius}px)`), l && s.borderRadius === void 0 && (s.borderRadius = `${l.borderRadius}px`);
|
|
206
|
-
const d = i ?? (l == null ? void 0 : l.tintColor), g = {};
|
|
207
|
-
return t && (g.targetId = t), r && (g.scene = r), d && (g.overlayColor = d), /* @__PURE__ */ k(x, { className: u, style: s, ...g, ...a, children: m });
|
|
208
|
-
}
|
|
209
|
-
const or = (e) => {
|
|
210
|
-
const {
|
|
211
|
-
className: r,
|
|
212
|
-
style: o,
|
|
213
|
-
children: t,
|
|
214
|
-
scene: i,
|
|
215
|
-
targetId: u,
|
|
216
|
-
theme: b = "auto",
|
|
217
|
-
liquidGlass: m,
|
|
218
|
-
frostedGlass: a,
|
|
219
|
-
gradientBlur: l,
|
|
220
|
-
overlayColor: s,
|
|
221
|
-
...d
|
|
222
|
-
} = { ...U, ...e }, S = V("nut-jdmaterialview", r), { isIOS: q, iosMajor: v } = $(() => W(), []), C = b === "auto", [L, A] = N(() => X()), G = P(
|
|
223
|
-
(c) => {
|
|
224
|
-
const y = typeof c == "string" ? c : String((c == null ? void 0 : c.theme) || "");
|
|
225
|
-
A(y.toLowerCase() === "dark");
|
|
226
|
-
},
|
|
227
|
-
[]
|
|
228
|
-
);
|
|
229
|
-
j(() => {
|
|
230
|
-
var c, y;
|
|
231
|
-
if (C) {
|
|
232
|
-
try {
|
|
233
|
-
(y = (c = h).onThemeChange) == null || y.call(c, G);
|
|
234
|
-
} catch {
|
|
235
|
-
}
|
|
236
|
-
return () => {
|
|
237
|
-
var w, M;
|
|
238
|
-
try {
|
|
239
|
-
(M = (w = h).offThemeChange) == null || M.call(w, G);
|
|
240
|
-
} catch {
|
|
241
|
-
}
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
}, [C, G]);
|
|
245
|
-
const f = C ? L : b === "dark", n = $(
|
|
246
|
-
() => i ? H(i, f, v) : void 0,
|
|
247
|
-
[i, f, v]
|
|
248
|
-
), O = m ?? (n == null ? void 0 : n.liquidGlass), B = a ?? (n == null ? void 0 : n.frostedGlass), D = l ?? (n == null ? void 0 : n.gradientBlur);
|
|
249
|
-
if (q) {
|
|
250
|
-
const c = { ...n == null ? void 0 : n.fallbackStyle, ...o };
|
|
251
|
-
return i && c.borderRadius === void 0 && (c.borderRadius = `${J(i, v)}px`), /* @__PURE__ */ k(
|
|
252
|
-
_,
|
|
253
|
-
{
|
|
254
|
-
className: S,
|
|
255
|
-
style: c,
|
|
256
|
-
liquidGlass: O,
|
|
257
|
-
frostedGlass: B,
|
|
258
|
-
gradientBlur: D,
|
|
259
|
-
...d,
|
|
260
|
-
children: t
|
|
261
|
-
}
|
|
262
|
-
);
|
|
263
|
-
}
|
|
264
|
-
return z() ? Z({ scene: i, dark: f, overlayColor: s, cls: S, style: o, children: t, rest: d }) : rr({
|
|
265
|
-
scene: i,
|
|
266
|
-
dark: f,
|
|
267
|
-
targetId: u,
|
|
268
|
-
overlayColor: s,
|
|
269
|
-
cls: S,
|
|
270
|
-
style: o,
|
|
271
|
-
children: t,
|
|
272
|
-
rest: d
|
|
273
|
-
});
|
|
274
|
-
};
|
|
275
|
-
or.displayName = "NutJDMaterialView";
|
|
276
|
-
export {
|
|
277
|
-
or as J,
|
|
278
|
-
Y as a,
|
|
279
|
-
H as b,
|
|
280
|
-
J as g
|
|
281
|
-
};
|