@nutui/taro-biz 0.0.1-alpha.28 → 0.0.1-alpha.29
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/index/index.d.ts +2 -0
- package/dist/cjs/index/index.js +1 -0
- package/dist/cjs/jdmaterialsblurtarget/index.d.ts +2 -0
- package/dist/cjs/jdmaterialsblurtarget/index.js +1 -1
- package/dist/cjs/jdmaterialsblurtarget.taro-BrFYwC7j.js +1 -0
- package/dist/cjs/jdmaterialview/index.d.ts +2 -0
- package/dist/cjs/jdmaterialview/index.js +1 -1
- package/dist/cjs/jdmaterialview.taro-Cq9ornMk.js +1 -0
- package/dist/cjs/typings-DP_XKs5o.js +1 -0
- package/dist/es/index/index.js +1 -1
- package/dist/es/jdmaterialview/index.js +2 -2
- package/dist/es/{jdmaterialview.taro-ipbj5Ixj.mjs → jdmaterialview.taro-CpCp2WMB.mjs} +32 -37
- package/package.json +18 -20
- package/dist/cjs/typings-oda_k1Zf.js +0 -30
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../jdmaterialview.taro-Cq9ornMk.js"),r=require("../jdmaterialsblurtarget.taro-BrFYwC7j.js");exports.JDMaterialView=e.JDMaterialView;exports.JDMaterialsBlurTarget=r.JDMaterialsBlurTarget;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../jdmaterialsblurtarget.taro-BrFYwC7j.js");exports.default=e.JDMaterialsBlurTarget;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const s=require("react/jsx-runtime"),u=require("classnames"),d=require("@tarojs/taro"),f=require("@jdtaro/ui"),m=require("./typings-DP_XKs5o.js"),g={...m.ComponentDefaults};function p(){var e;try{const r=String(((e=d.getSystemInfoSync())==null?void 0:e.platform)||"").toLowerCase();return r==="android"||r==="ios"}catch{return!1}}const n=e=>{const{className:r,style:l,children:t,blurId:a,id:y,...i}={...g,...e};if(!p())return s.jsx(s.Fragment,{children:t});const o=u("nut-jdmaterialsblurtarget",r),c=i;return s.jsx(f.View,{className:o,style:l,id:a,blurId:a,collapsable:!1,...c,children:t})};n.displayName="NutJDMaterialsBlurTarget";exports.JDMaterialsBlurTarget=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../jdmaterialview.taro-Cq9ornMk.js");exports.default=e.JDMaterialView;exports.getCornerRadius=e.getCornerRadius;exports.getFrostedPreset=e.getFrostedPreset;exports.getPreset=e.getPreset;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const D=require("react/jsx-runtime"),p=require("react"),tr=require("classnames"),g=require("@tarojs/taro"),B=require("@jdtaro/ui"),or=require("./typings-DP_XKs5o.js"),E=26,q="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)";function W(o,r,t){const e=t>=E;switch(o){case"top-solid":return e?{liquidGlass:{style:"regular",interactive:!0,darkMode:r,...r?{}:{tintColor:"rgba(255, 255, 255, 0.45)"}},boxShadow:q}:{fallbackStyle:{backgroundColor:r?"#2A2F36":"#FFFFFF"}};case"top-plain":return e?{liquidGlass:{style:"regular",interactive:!0,darkMode:r,...r?{}:{tintColor:"rgba(255, 255, 255, 0.45)"}},boxShadow:q}:{};case"top-bar":return{frostedGlass:{style:r?"regular-dark":"ultra-thin-light",tintColor:r?"rgba(0, 0, 0, 0.6)":"rgba(255, 255, 255, 0.75)"}};case"promotion-fair":return{liquidGlass:{style:"clear",interactive:!1},frostedGlass:{style:"thick-light",alpha:1},...e?{boxShadow:J}:{}};case"promotion-deep":return{liquidGlass:{style:"clear",interactive:!1},frostedGlass:{style:"ultra-thin-light",alpha:1},...e?{boxShadow:J}:{}};case"immersive":return e?{liquidGlass:{style:"regular",darkMode:!0,interactive:!0,tintColor:"rgba(0, 0, 0, 0.05)"},boxShadow:q}:{frostedGlass:{style:"regular-dark",alpha:1}};case"bottom-bar":return{gradientBlur:{minBlur:.5,maxBlur:.8,overlayAlpha:.9,overlayColor:r?"rgba(0, 0, 0, 1)":"rgba(255, 255, 255, 1)"},boxShadow:r?ar:er};default:return{}}}function K(o,r){const t=r>=E;switch(o){case"top-bar":case"bottom-bar":return 0;case"top-plain":return t?12:0;case"top-solid":case"promotion-fair":case"promotion-deep":case"immersive":return t?12:8;default:return 0}}function Y(o){switch(o){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}}const M="255, 255, 255",F="31, 34, 38";function Q(o,r){const t=Y(o);switch(o){case"top-solid":return{blurRadius:40,borderRadius:t,tintColor:r?"rgba(42, 47, 54, 1)":"rgba(255, 255, 255, 1)"};case"top-plain":return{blurRadius:0,borderRadius:t};case"top-bar":return{blurRadius:40,borderRadius:t,tintColor:r?`rgba(${F}, 0.9)`:`rgba(${M}, 0.9)`};case"promotion-fair":return{blurRadius:40,borderRadius:t,tintColor:`rgba(${M}, 0.85)`};case"promotion-deep":return{blurRadius:40,borderRadius:t,tintColor:`rgba(${M}, 0.2)`};case"immersive":return{blurRadius:40,borderRadius:t,tintColor:`rgba(${F}, 0.4)`};case"bottom-bar":return{blurRadius:50,borderRadius:t,tintColor:r?`rgba(${F}, 0.8)`:`rgba(${M}, 0.8)`};default:return{blurRadius:40,borderRadius:t}}}function sr(o){const r=o?"0, 0, 0":"255, 255, 255";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%)`}function nr(o,r){const t=r?"dark":"light",e=Y(o);switch(o){case"top-solid":return{blurScale:1,borderRadius:e,colorMode:t,overlayColor:r?"#2A2F36":"#FFFFFF"};case"top-plain":return{blurScale:0,borderRadius:e,colorMode:t};case"top-bar":return{blurScale:.9,borderRadius:e,colorMode:t,overlayColor:r?"rgba(0, 0, 0, 0.3)":"rgba(255, 255, 255, 0.62)"};case"promotion-fair":return{blurScale:.85,borderRadius:e,colorMode:"light"};case"promotion-deep":return{blurScale:.2,borderRadius:e,colorMode:"light"};case"immersive":return{blurScale:.4,borderRadius:e,colorMode:"dark"};case"bottom-bar":return{blurScale:.2,borderRadius:e,colorMode:t,backgroundGradient:sr(r),boxShadow:"0 8px 40px rgba(0, 0, 0, 0.12)"};default:return{blurScale:0,borderRadius:e,colorMode:t}}}function ir(o,r){const t=/^#?([0-9a-fA-F]{6})$/.exec(o.trim());if(!t)return o;const e=parseInt(t[1],16),a=e>>16&255,i=e>>8&255,d=e&255,f=Math.max(0,Math.min(1,r));return`rgba(${a}, ${i}, ${d}, ${f})`}const lr={...or.ComponentDefaults};function cr(){var o;try{const r=g.getSystemInfoSync(),t=String((r==null?void 0:r.platform)||"").toLowerCase(),e=String((r==null?void 0:r.system)||""),a=t==="ios",i=t==="harmony",d=a?parseInt(((o=e.match(/\d+/))==null?void 0:o[0])||"0",10):0,f=String((r==null?void 0:r.theme)||"").toLowerCase()==="dark";return{isIOS:a,isHarmony:i,iosMajor:d,dark:f}}catch{return{isIOS:!1,isHarmony:!1,iosMajor:0,dark:!1}}}function ur(){try{const o=g.getSystemInfoSync();return String((o==null?void 0:o.theme)||"").toLowerCase()==="dark"}catch{return!1}}function dr(o){const{scene:r,dark:t,overlayColor:e,cls:a,style:i,children:d,rest:f}=o,s=r?nr(r,t):void 0,c={};s?(c.blurScale=s.blurScale,c.colorMode=s.colorMode):c.colorMode=t?"dark":"light";const u={...i};(i==null?void 0:i.borderRadius)===void 0&&s&&(u.borderRadius=`${s.borderRadius}px`);const m=e??(s==null?void 0:s.overlayColor);return m&&u.backgroundColor===void 0&&(u.backgroundColor=m),s!=null&&s.backgroundGradient&&u.background===void 0&&(u.background=s.backgroundGradient),s!=null&&s.boxShadow&&u.boxShadow===void 0&&(u.boxShadow=s.boxShadow),D.jsx(B.View,{className:a,style:u,...c,...f,children:d})}function br(o){const{scene:r,dark:t,targetId:e,overlayColor:a,cls:i,style:d,children:f,rest:s}=o,c=r?Q(r,t):void 0,u={...d};c&&c.blurRadius>0&&(u.backdropFilter=`blur(${c.blurRadius}px)`),c&&u.borderRadius===void 0&&(u.borderRadius=`${c.borderRadius}px`);const m=a??(c==null?void 0:c.tintColor),S={};return e&&(S.targetId=e),r&&(S.scene=r),m&&(S.overlayColor=m),D.jsx(B.View,{className:i,style:u,...S,...s,children:f})}const U=o=>{const{className:r,style:t,children:e,scene:a,targetId:i,theme:d="auto",extractTint:f,liquidGlass:s,frostedGlass:c,gradientBlur:u,overlayColor:m,id:S,...I}={...lr,...o},T=tr("nut-jdmaterialview",r),{isIOS:v,isHarmony:z,iosMajor:C}=p.useMemo(()=>cr(),[]),$=d==="auto",[X,Z]=p.useState(()=>ur()),k=p.useCallback(n=>{const b=typeof n=="string"?n:String((n==null?void 0:n.theme)||"");Z(b.toLowerCase()==="dark")},[]);p.useEffect(()=>{var n;if($){try{(n=g.onThemeChange)==null||n.call(g,k)}catch{}return()=>{var b;try{(b=g.offThemeChange)==null||b.call(g,k)}catch{}}}},[$,k]);const x=$?X:d==="dark",l=p.useMemo(()=>a?W(a,x,C):void 0,[a,x,C]),A=s??(l==null?void 0:l.liquidGlass),w=!!f&&(a==="promotion-fair"||a==="promotion-deep"),R=i?`taro_material_${i}`:void 0,[_,rr]=p.useState(void 0),L=p.useCallback(()=>{var j;if(!v||!w||!R||!i)return;const n=g;if(typeof n.getTagById!="function"||!((j=n.JDTheme)!=null&&j.getGlassTintConfig))return;const b=n.getTagById(R),h=n.getTagById(i);b==null||h==null||b<0||h<0||n.JDTheme.getGlassTintConfig({materialTag:b,blurTag:h}).then(G=>{const y=(G==null?void 0:G.data)??G,V=y==null?void 0:y.tintColor,O=y==null?void 0:y.tintAlpha;!V||!O||O<=0||rr(ir(V,O))}).catch(()=>{})},[v,w,a,R,i]);p.useEffect(()=>{!v||!w||g.nextTick(()=>L())},[v,w,x,L,a,i]);const P=A&&_?{...A,tintColor:_}:A,H=c??(l==null?void 0:l.frostedGlass),N=u??(l==null?void 0:l.gradientBlur);if(v){const n={...l==null?void 0:l.fallbackStyle,...t};a&&n.borderRadius===void 0&&(n.borderRadius=`${K(a,C)}px`),l!=null&&l.boxShadow&&n.boxShadow===void 0&&(n.boxShadow=l.boxShadow);const b=C>=26;let h;return b&&P?h={liquidGlass:P}:H?h={frostedGlass:H}:N&&(h={gradientBlur:N}),D.jsx(B.JDIOSMaterialView,{id:R,className:T,style:n,targetId:i,materialConfig:h,...I,children:e})}return z?dr({scene:a,dark:x,overlayColor:m,cls:T,style:t,children:e,rest:I}):br({scene:a,dark:x,targetId:i,overlayColor:m,cls:T,style:t,children:e,rest:I})};U.displayName="NutJDMaterialView";exports.JDMaterialView=U;exports.getCornerRadius=K;exports.getFrostedPreset=Q;exports.getPreset=W;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const s={className:"",style:{}};exports.ComponentDefaults=s;
|
package/dist/es/index/index.js
CHANGED
|
@@ -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-CpCp2WMB.mjs";
|
|
2
|
+
import { g as s, a as o, b as g } from "../jdmaterialview.taro-CpCp2WMB.mjs";
|
|
3
3
|
export {
|
|
4
4
|
r as default,
|
|
5
5
|
s as getCornerRadius,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as B } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import
|
|
4
|
-
import p
|
|
2
|
+
import { useMemo as J, useState as V, useCallback as j, useEffect as E } from "react";
|
|
3
|
+
import rr from "classnames";
|
|
4
|
+
import p from "@tarojs/taro";
|
|
5
5
|
import { JDIOSMaterialView as or, View as K } from "@jdtaro/ui";
|
|
6
6
|
import { C as tr } from "./typings-CdeuPEKG.mjs";
|
|
7
7
|
const Y = 26, F = "0 4px 2px 0 rgba(0, 0, 0, 0.05)", W = "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)";
|
|
@@ -183,27 +183,22 @@ function cr(t, r) {
|
|
|
183
183
|
function ur(t, r) {
|
|
184
184
|
const o = /^#?([0-9a-fA-F]{6})$/.exec(t.trim());
|
|
185
185
|
if (!o) return t;
|
|
186
|
-
const e = parseInt(o[1], 16), a = e >> 16 & 255, i = e >> 8 & 255, b = e & 255,
|
|
187
|
-
return `rgba(${a}, ${i}, ${b}, ${
|
|
186
|
+
const e = parseInt(o[1], 16), a = e >> 16 & 255, i = e >> 8 & 255, b = e & 255, m = Math.max(0, Math.min(1, r));
|
|
187
|
+
return `rgba(${a}, ${i}, ${b}, ${m})`;
|
|
188
188
|
}
|
|
189
189
|
const dr = {
|
|
190
190
|
...tr
|
|
191
191
|
};
|
|
192
192
|
function br() {
|
|
193
|
-
return ["harmony", "harmonyhybrid", "jdharmony"].includes(
|
|
194
|
-
rr().toLowerCase()
|
|
195
|
-
);
|
|
196
|
-
}
|
|
197
|
-
function gr() {
|
|
198
193
|
var t;
|
|
199
194
|
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,
|
|
201
|
-
return { isIOS: a,
|
|
195
|
+
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 = o === "harmony", b = a ? parseInt(((t = e.match(/\d+/)) == null ? void 0 : t[0]) || "0", 10) : 0, m = String((r == null ? void 0 : r.theme) || "").toLowerCase() === "dark";
|
|
196
|
+
return { isIOS: a, isHarmony: i, iosMajor: b, dark: m };
|
|
202
197
|
} catch {
|
|
203
|
-
return { isIOS: !1, iosMajor: 0, dark: !1 };
|
|
198
|
+
return { isIOS: !1, isHarmony: !1, iosMajor: 0, dark: !1 };
|
|
204
199
|
}
|
|
205
200
|
}
|
|
206
|
-
function
|
|
201
|
+
function gr() {
|
|
207
202
|
try {
|
|
208
203
|
const t = p.getSystemInfoSync();
|
|
209
204
|
return String((t == null ? void 0 : t.theme) || "").toLowerCase() === "dark";
|
|
@@ -211,21 +206,21 @@ function mr() {
|
|
|
211
206
|
return !1;
|
|
212
207
|
}
|
|
213
208
|
}
|
|
214
|
-
function
|
|
215
|
-
const { scene: r, dark: o, overlayColor: e, cls: a, style: i, children: b, rest:
|
|
209
|
+
function mr(t) {
|
|
210
|
+
const { scene: r, dark: o, overlayColor: e, cls: a, style: i, children: b, rest: m } = t, s = r ? cr(r, o) : void 0, c = {};
|
|
216
211
|
s ? (c.blurScale = s.blurScale, c.colorMode = s.colorMode) : c.colorMode = o ? "dark" : "light";
|
|
217
212
|
const u = { ...i };
|
|
218
213
|
(i == null ? void 0 : i.borderRadius) === void 0 && s && (u.borderRadius = `${s.borderRadius}px`);
|
|
219
|
-
const
|
|
220
|
-
return
|
|
214
|
+
const f = e ?? (s == null ? void 0 : s.overlayColor);
|
|
215
|
+
return f && u.backgroundColor === void 0 && (u.backgroundColor = f), 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(K, { className: a, style: u, ...c, ...m, children: b });
|
|
221
216
|
}
|
|
222
|
-
function
|
|
223
|
-
const { scene: r, dark: o, targetId: e, overlayColor: a, cls: i, style: b, children:
|
|
217
|
+
function fr(t) {
|
|
218
|
+
const { scene: r, dark: o, targetId: e, overlayColor: a, cls: i, style: b, children: m, rest: s } = t, c = r ? ir(r, o) : void 0, u = { ...b };
|
|
224
219
|
c && c.blurRadius > 0 && (u.backdropFilter = `blur(${c.blurRadius}px)`), c && u.borderRadius === void 0 && (u.borderRadius = `${c.borderRadius}px`);
|
|
225
|
-
const
|
|
226
|
-
return e && (y.targetId = e), r && (y.scene = r),
|
|
220
|
+
const f = a ?? (c == null ? void 0 : c.tintColor), y = {};
|
|
221
|
+
return e && (y.targetId = e), r && (y.scene = r), f && (y.overlayColor = f), /* @__PURE__ */ B(K, { className: i, style: u, ...y, ...s, children: m });
|
|
227
222
|
}
|
|
228
|
-
const
|
|
223
|
+
const hr = (t) => {
|
|
229
224
|
const {
|
|
230
225
|
className: r,
|
|
231
226
|
style: o,
|
|
@@ -233,17 +228,17 @@ const pr = (t) => {
|
|
|
233
228
|
scene: a,
|
|
234
229
|
targetId: i,
|
|
235
230
|
theme: b = "auto",
|
|
236
|
-
extractTint:
|
|
231
|
+
extractTint: m,
|
|
237
232
|
liquidGlass: s,
|
|
238
233
|
frostedGlass: c,
|
|
239
234
|
gradientBlur: u,
|
|
240
|
-
overlayColor:
|
|
235
|
+
overlayColor: f,
|
|
241
236
|
id: y,
|
|
242
237
|
...M
|
|
243
|
-
} = { ...dr, ...t }, I =
|
|
238
|
+
} = { ...dr, ...t }, I = rr("nut-jdmaterialview", r), { isIOS: S, isHarmony: U, iosMajor: x } = J(() => br(), []), $ = b === "auto", [z, X] = V(() => gr()), A = j(
|
|
244
239
|
(n) => {
|
|
245
240
|
const g = typeof n == "string" ? n : String((n == null ? void 0 : n.theme) || "");
|
|
246
|
-
|
|
241
|
+
X(g.toLowerCase() === "dark");
|
|
247
242
|
},
|
|
248
243
|
[]
|
|
249
244
|
);
|
|
@@ -263,31 +258,31 @@ const pr = (t) => {
|
|
|
263
258
|
};
|
|
264
259
|
}
|
|
265
260
|
}, [$, A]);
|
|
266
|
-
const v = $ ?
|
|
261
|
+
const v = $ ? z : b === "dark", l = J(
|
|
267
262
|
() => a ? sr(a, v, x) : void 0,
|
|
268
263
|
[a, v, x]
|
|
269
|
-
), O = s ?? (l == null ? void 0 : l.liquidGlass), w = !!
|
|
264
|
+
), O = s ?? (l == null ? void 0 : l.liquidGlass), w = !!m && (a === "promotion-fair" || a === "promotion-deep"), G = i ? `taro_material_${i}` : void 0, [_, Z] = V(void 0), q = j(() => {
|
|
270
265
|
var C;
|
|
271
266
|
if (!S || !w || !G || !i) return;
|
|
272
267
|
const n = p;
|
|
273
268
|
if (typeof n.getTagById != "function" || !((C = n.JDTheme) != null && C.getGlassTintConfig)) return;
|
|
274
269
|
const g = n.getTagById(G), d = n.getTagById(i);
|
|
275
270
|
g == null || d == null || g < 0 || d < 0 || n.JDTheme.getGlassTintConfig({ materialTag: g, blurTag: d }).then((R) => {
|
|
276
|
-
const h = (R == null ? void 0 : R.data) ?? R,
|
|
277
|
-
!
|
|
271
|
+
const h = (R == null ? void 0 : R.data) ?? R, P = h == null ? void 0 : h.tintColor, k = h == null ? void 0 : h.tintAlpha;
|
|
272
|
+
!P || !k || k <= 0 || Z(ur(P, k));
|
|
278
273
|
}).catch(() => {
|
|
279
274
|
});
|
|
280
275
|
}, [S, w, a, G, i]);
|
|
281
276
|
E(() => {
|
|
282
277
|
!S || !w || p.nextTick(() => q());
|
|
283
278
|
}, [S, w, v, q, a, i]);
|
|
284
|
-
const L = O && _ ? { ...O, tintColor: _ } : O,
|
|
279
|
+
const L = O && _ ? { ...O, tintColor: _ } : O, H = c ?? (l == null ? void 0 : l.frostedGlass), N = u ?? (l == null ? void 0 : l.gradientBlur);
|
|
285
280
|
if (S) {
|
|
286
281
|
const n = { ...l == null ? void 0 : l.fallbackStyle, ...o };
|
|
287
282
|
a && n.borderRadius === void 0 && (n.borderRadius = `${nr(a, x)}px`), l != null && l.boxShadow && n.boxShadow === void 0 && (n.boxShadow = l.boxShadow);
|
|
288
283
|
const g = x >= 26;
|
|
289
284
|
let d;
|
|
290
|
-
return g && L ? d = { liquidGlass: L } :
|
|
285
|
+
return g && L ? d = { liquidGlass: L } : H ? d = { frostedGlass: H } : N && (d = { gradientBlur: N }), /* @__PURE__ */ B(
|
|
291
286
|
or,
|
|
292
287
|
{
|
|
293
288
|
id: G,
|
|
@@ -300,20 +295,20 @@ const pr = (t) => {
|
|
|
300
295
|
}
|
|
301
296
|
);
|
|
302
297
|
}
|
|
303
|
-
return
|
|
298
|
+
return U ? mr({ scene: a, dark: v, overlayColor: f, cls: I, style: o, children: e, rest: M }) : fr({
|
|
304
299
|
scene: a,
|
|
305
300
|
dark: v,
|
|
306
301
|
targetId: i,
|
|
307
|
-
overlayColor:
|
|
302
|
+
overlayColor: f,
|
|
308
303
|
cls: I,
|
|
309
304
|
style: o,
|
|
310
305
|
children: e,
|
|
311
306
|
rest: M
|
|
312
307
|
});
|
|
313
308
|
};
|
|
314
|
-
|
|
309
|
+
hr.displayName = "NutJDMaterialView";
|
|
315
310
|
export {
|
|
316
|
-
|
|
311
|
+
hr as J,
|
|
317
312
|
ir as a,
|
|
318
313
|
sr as b,
|
|
319
314
|
nr as g
|
package/package.json
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nutui/taro-biz",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.29",
|
|
4
4
|
"main": "dist/es/index/index.js",
|
|
5
5
|
"module": "dist/es/index/index.js",
|
|
6
6
|
"types": "dist/es/index/index.d.ts",
|
|
7
7
|
"sideEffects": [
|
|
8
8
|
"*.scss",
|
|
9
|
-
"
|
|
9
|
+
"*.css",
|
|
10
|
+
"dist/es/**/style/*",
|
|
11
|
+
"dist/cjs/**/style/*"
|
|
10
12
|
],
|
|
11
|
-
"description": "京东主站设计内部组件库",
|
|
13
|
+
"description": "京东主站设计内部组件库 (Web H5)",
|
|
12
14
|
"keywords": [
|
|
13
15
|
"nutui",
|
|
14
16
|
"react",
|
|
15
|
-
"
|
|
17
|
+
"biz",
|
|
16
18
|
"jd",
|
|
17
19
|
"material",
|
|
18
|
-
"
|
|
20
|
+
"frosted-glass"
|
|
19
21
|
],
|
|
20
22
|
"author": "jdcfe",
|
|
21
23
|
"license": "MIT",
|
|
@@ -31,7 +33,9 @@
|
|
|
31
33
|
},
|
|
32
34
|
"scripts": {
|
|
33
35
|
"dev": "vite --open --force",
|
|
36
|
+
"dev:demo": "npm run build && vite examples/h5-demo --open",
|
|
34
37
|
"build": "npm run checked && node scripts/build.mjs",
|
|
38
|
+
"build:demo": "npm run build && vite build examples/h5-demo",
|
|
35
39
|
"build:taro": "npm run checked:taro && node scripts/build-taro.mjs",
|
|
36
40
|
"checked": "tsc --project ./tsconfig.json --noEmit",
|
|
37
41
|
"checked:taro": "tsc --project ./tsconfig.taro.json --noEmit",
|
|
@@ -46,17 +50,6 @@
|
|
|
46
50
|
"react": ">=16.8.0",
|
|
47
51
|
"react-dom": ">=16.8.0"
|
|
48
52
|
},
|
|
49
|
-
"peerDependenciesMeta": {
|
|
50
|
-
"@tarojs/components": {
|
|
51
|
-
"optional": true
|
|
52
|
-
},
|
|
53
|
-
"@tarojs/taro": {
|
|
54
|
-
"optional": true
|
|
55
|
-
},
|
|
56
|
-
"@jdtaro/ui": {
|
|
57
|
-
"optional": true
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
53
|
"devDependencies": {
|
|
61
54
|
"@inquirer/prompts": "^7.0.0",
|
|
62
55
|
"@tarojs/components": "^4.0.12",
|
|
@@ -81,15 +74,20 @@
|
|
|
81
74
|
"exports": {
|
|
82
75
|
".": {
|
|
83
76
|
"types": "./dist/es/index/index.d.ts",
|
|
84
|
-
"import": "./dist/es/index/index.js"
|
|
77
|
+
"import": "./dist/es/index/index.js",
|
|
78
|
+
"require": "./dist/cjs/index/index.js"
|
|
85
79
|
},
|
|
86
80
|
"./JDMaterialView": {
|
|
87
81
|
"types": "./dist/es/jdmaterialview/index.d.ts",
|
|
88
|
-
"import": "./dist/es/jdmaterialview/index.js"
|
|
82
|
+
"import": "./dist/es/jdmaterialview/index.js",
|
|
83
|
+
"require": "./dist/cjs/jdmaterialview/index.js"
|
|
89
84
|
},
|
|
90
85
|
"./JDMaterialsBlurTarget": {
|
|
91
86
|
"types": "./dist/es/jdmaterialsblurtarget/index.d.ts",
|
|
92
|
-
"import": "./dist/es/jdmaterialsblurtarget/index.js"
|
|
93
|
-
|
|
87
|
+
"import": "./dist/es/jdmaterialsblurtarget/index.js",
|
|
88
|
+
"require": "./dist/cjs/jdmaterialsblurtarget/index.js"
|
|
89
|
+
},
|
|
90
|
+
"./dist/*": "./dist/*",
|
|
91
|
+
"./*": "./*"
|
|
94
92
|
}
|
|
95
93
|
}
|
|
@@ -1,30 +0,0 @@
|
|
|
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;
|