@xhsreds/reds-rn-next 0.10.1-beta202512022044 → 0.10.1-beta202512022142
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/coverage/.tmp/coverage-0.json +1 -1
- package/coverage/.tmp/coverage-1.json +1 -1
- package/coverage/.tmp/coverage-11.json +1 -1
- package/coverage/.tmp/coverage-12.json +1 -1
- package/coverage/.tmp/coverage-14.json +1 -1
- package/coverage/.tmp/coverage-15.json +1 -1
- package/coverage/.tmp/coverage-16.json +1 -1
- package/coverage/.tmp/coverage-17.json +1 -1
- package/coverage/.tmp/coverage-18.json +1 -1
- package/coverage/.tmp/coverage-19.json +1 -1
- package/coverage/.tmp/coverage-2.json +1 -1
- package/coverage/.tmp/coverage-20.json +1 -1
- package/coverage/.tmp/coverage-21.json +1 -1
- package/coverage/.tmp/coverage-22.json +1 -1
- package/coverage/.tmp/coverage-24.json +1 -1
- package/coverage/.tmp/coverage-25.json +1 -1
- package/coverage/.tmp/coverage-26.json +1 -1
- package/coverage/.tmp/coverage-27.json +1 -1
- package/coverage/.tmp/coverage-28.json +1 -1
- package/coverage/.tmp/coverage-29.json +1 -1
- package/coverage/.tmp/coverage-3.json +1 -1
- package/coverage/.tmp/coverage-30.json +1 -1
- package/coverage/.tmp/coverage-31.json +1 -1
- package/coverage/.tmp/coverage-33.json +1 -1
- package/coverage/.tmp/coverage-34.json +1 -1
- package/coverage/.tmp/coverage-35.json +1 -1
- package/coverage/.tmp/coverage-36.json +1 -1
- package/coverage/.tmp/coverage-37.json +1 -1
- package/coverage/.tmp/coverage-38.json +1 -1
- package/coverage/.tmp/coverage-39.json +1 -1
- package/coverage/.tmp/coverage-4.json +1 -1
- package/coverage/.tmp/coverage-40.json +1 -1
- package/coverage/.tmp/coverage-41.json +1 -1
- package/coverage/.tmp/coverage-43.json +1 -1
- package/coverage/.tmp/coverage-5.json +1 -1
- package/coverage/.tmp/coverage-6.json +1 -1
- package/coverage/.tmp/coverage-7.json +1 -1
- package/coverage/.tmp/coverage-8.json +1 -1
- package/coverage/.tmp/coverage-9.json +1 -1
- package/lib/cjs/components/Alert/hooks/alert.js +1 -1
- package/lib/cjs/components/Image/Image.js +13 -13
- package/lib/cjs/components/Image/Image.js.map +1 -1
- package/lib/cjs/components/Portal/core/PortalHost.js +2 -3
- package/lib/cjs/components/Portal/core/PortalHost.js.map +1 -1
- package/lib/cjs/components/Portal/core/PortalProvider.js +0 -1
- package/lib/cjs/components/Portal/core/PortalProvider.js.map +1 -1
- package/lib/cjs/components/Portal/index.js +0 -1
- package/lib/cjs/components/Portal/index.js.map +1 -1
- package/lib/esm/components/Alert/hooks/alert.js +1 -1
- package/lib/esm/components/Image/Image.js +13 -13
- package/lib/esm/components/Image/Image.js.map +1 -1
- package/lib/esm/components/Portal/core/PortalHost.js +2 -3
- package/lib/esm/components/Portal/core/PortalHost.js.map +1 -1
- package/lib/esm/components/Portal/core/PortalProvider.js +0 -1
- package/lib/esm/components/Portal/core/PortalProvider.js.map +1 -1
- package/lib/esm/components/Portal/index.js +0 -1
- package/lib/esm/components/Portal/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/Image/Image.tsx +14 -9
- package/src/components/Image/demo/index.tsx +4 -5
- package/src/components/Portal/core/PortalHost.tsx +3 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PortalProvider.js","sources":["../../../../../src/components/Portal/core/PortalProvider.tsx"],"sourcesContent":["import React, { memo, useEffect, useReducer } from \"react\";\nimport { PortalHost } from \"./PortalHost\";\nimport { PortalDispatchContext, PortalStateContext } from \"./PortalContext\";\nimport { ACTIONS, ActionTypes, AddUpdatePortalAction, PortalType, RemovePortalAction } from \"../interface\";\nimport { PortalProviderProps } from \"../interface\";\n\nexport let INITIAL_STATE = {};\nexport const stateDispatch: any = {};\nconst registerHost = (state: Record<string, Array<PortalType>>, hostName: string) => {\n if (!(hostName in state)) {\n state[hostName] = [];\n }\n return state;\n};\n\nconst deregisterHost = (state: Record<string, Array<PortalType>>, hostName: string) => {\n delete state[hostName];\n return state;\n};\n\nconst addUpdatePortal = (state: Record<string, Array<PortalType>>, hostName: string, portalName: string, node: any) => {\n if (!(hostName in state)) {\n state = registerHost(state, hostName);\n }\n\n const index = state[hostName].findIndex((item) => item.name === portalName);\n if (index !== -1) {\n state[hostName][index].node = node;\n } else {\n state[hostName].push({\n name: portalName,\n node,\n });\n }\n return state;\n};\n\nconst removePortal = (state: Record<string, Array<PortalType>>, hostName: string, portalName: string) => {\n if (!(hostName in state)) {\n return state;\n }\n\n const index = state[hostName].findIndex((item) => item.name === portalName);\n if (index !== -1) state[hostName].splice(index, 1);\n return state;\n};\n\nconst reducer = (state: Record<string, Array<PortalType>>, action: ActionTypes) => {\n const { type } = action;\n let clonedState = { ...state };\n switch (type) {\n case ACTIONS.REGISTER_HOST:\n return registerHost(clonedState, action.hostName);\n case ACTIONS.DEREGISTER_HOST:\n return deregisterHost(clonedState, action.hostName);\n case ACTIONS.ADD_UPDATE_PORTAL:\n return addUpdatePortal(\n clonedState,\n action.hostName,\n (action as AddUpdatePortalAction).portalName,\n (action as AddUpdatePortalAction).node,\n );\n case ACTIONS.REMOVE_PORTAL:\n return removePortal(clonedState, action.hostName, (action as RemovePortalAction).portalName);\n default:\n return state;\n }\n};\n\nconst PortalProviderComponent = ({\n rootHostName = \"root\",\n shouldAddRootHost = true,\n children,\n}: PortalProviderProps) => {\n const [state, dispatch] = useReducer(reducer, INITIAL_STATE);\n useEffect(() => {\n stateDispatch[rootHostName] = {\n dispatch: dispatch,\n };\n }, []);\n return (\n <PortalDispatchContext.Provider value={dispatch}>\n <PortalStateContext.Provider value={state}>\n {children}\n {shouldAddRootHost && <PortalHost name={rootHostName} />}\n </PortalStateContext.Provider>\n </PortalDispatchContext.Provider>\n );\n};\n\nexport const PortalProvider = memo(PortalProviderComponent);\nPortalProvider.displayName = \"PortalProvider\";\n\nexport class PortalManager {\n dispatch: React.Dispatch<ActionTypes>;\n hostName?: string;\n constructor(props: { dispatch: React.Dispatch<ActionTypes>; hostName?: string }) {\n this.dispatch = props.dispatch;\n this.hostName = props.hostName || \"root\";\n }\n\n registerHost = (hostName: string) => {\n this.dispatch({\n type: ACTIONS.REGISTER_HOST,\n hostName,\n });\n };\n\n deregisterHost = (hostName: string) => {\n this.dispatch({\n type: ACTIONS.DEREGISTER_HOST,\n hostName,\n });\n };\n\n addPortal = (hostName: string, portalName: string, node: any) => {\n this.dispatch({\n type: ACTIONS.ADD_UPDATE_PORTAL,\n hostName,\n portalName,\n node,\n });\n };\n\n addUpdatePortal = (hostName: string, portalName: string, node: any) => {\n this.addPortal(hostName, portalName, node);\n };\n\n removePortal = (hostName: string, portalName: string) => {\n this.dispatch({\n type: ACTIONS.REMOVE_PORTAL,\n hostName,\n portalName,\n });\n };\n\n componentDidMount() {\n this.registerHost(this.hostName!);\n }\n\n componentWillUnmount() {\n this.deregisterHost(this.hostName!);\n }\n}\n"],"names":["INITIAL_STATE","stateDispatch","registerHost","state","hostName","deregisterHost","addUpdatePortal","portalName","node","index","findIndex","item","name","push","removePortal","splice","reducer","action","type","clonedState","_objectSpread","ACTIONS","REGISTER_HOST","DEREGISTER_HOST","ADD_UPDATE_PORTAL","REMOVE_PORTAL","PortalProviderComponent","_ref$rootHostName","_ref","rootHostName","_ref$shouldAddRootHos","shouldAddRootHost","children","_useReducer","useReducer","_useReducer2","_slicedToArray","dispatch","useEffect","PortalDispatchContext","Provider","value","PortalStateContext","React","createElement","PortalHost","PortalProvider","memo","displayName","PortalManager","props","_this","_classCallCheck","__publicField","addPortal","_createClass","key","componentDidMount","componentWillUnmount"],"mappings":"
|
|
1
|
+
{"version":3,"file":"PortalProvider.js","sources":["../../../../../src/components/Portal/core/PortalProvider.tsx"],"sourcesContent":["import React, { memo, useEffect, useReducer } from \"react\";\nimport { PortalHost } from \"./PortalHost\";\nimport { PortalDispatchContext, PortalStateContext } from \"./PortalContext\";\nimport { ACTIONS, ActionTypes, AddUpdatePortalAction, PortalType, RemovePortalAction } from \"../interface\";\nimport { PortalProviderProps } from \"../interface\";\n\nexport let INITIAL_STATE = {};\nexport const stateDispatch: any = {};\nconst registerHost = (state: Record<string, Array<PortalType>>, hostName: string) => {\n if (!(hostName in state)) {\n state[hostName] = [];\n }\n return state;\n};\n\nconst deregisterHost = (state: Record<string, Array<PortalType>>, hostName: string) => {\n delete state[hostName];\n return state;\n};\n\nconst addUpdatePortal = (state: Record<string, Array<PortalType>>, hostName: string, portalName: string, node: any) => {\n if (!(hostName in state)) {\n state = registerHost(state, hostName);\n }\n\n const index = state[hostName].findIndex((item) => item.name === portalName);\n if (index !== -1) {\n state[hostName][index].node = node;\n } else {\n state[hostName].push({\n name: portalName,\n node,\n });\n }\n return state;\n};\n\nconst removePortal = (state: Record<string, Array<PortalType>>, hostName: string, portalName: string) => {\n if (!(hostName in state)) {\n return state;\n }\n\n const index = state[hostName].findIndex((item) => item.name === portalName);\n if (index !== -1) state[hostName].splice(index, 1);\n return state;\n};\n\nconst reducer = (state: Record<string, Array<PortalType>>, action: ActionTypes) => {\n const { type } = action;\n let clonedState = { ...state };\n switch (type) {\n case ACTIONS.REGISTER_HOST:\n return registerHost(clonedState, action.hostName);\n case ACTIONS.DEREGISTER_HOST:\n return deregisterHost(clonedState, action.hostName);\n case ACTIONS.ADD_UPDATE_PORTAL:\n return addUpdatePortal(\n clonedState,\n action.hostName,\n (action as AddUpdatePortalAction).portalName,\n (action as AddUpdatePortalAction).node,\n );\n case ACTIONS.REMOVE_PORTAL:\n return removePortal(clonedState, action.hostName, (action as RemovePortalAction).portalName);\n default:\n return state;\n }\n};\n\nconst PortalProviderComponent = ({\n rootHostName = \"root\",\n shouldAddRootHost = true,\n children,\n}: PortalProviderProps) => {\n const [state, dispatch] = useReducer(reducer, INITIAL_STATE);\n useEffect(() => {\n stateDispatch[rootHostName] = {\n dispatch: dispatch,\n };\n }, []);\n return (\n <PortalDispatchContext.Provider value={dispatch}>\n <PortalStateContext.Provider value={state}>\n {children}\n {shouldAddRootHost && <PortalHost name={rootHostName} />}\n </PortalStateContext.Provider>\n </PortalDispatchContext.Provider>\n );\n};\n\nexport const PortalProvider = memo(PortalProviderComponent);\nPortalProvider.displayName = \"PortalProvider\";\n\nexport class PortalManager {\n dispatch: React.Dispatch<ActionTypes>;\n hostName?: string;\n constructor(props: { dispatch: React.Dispatch<ActionTypes>; hostName?: string }) {\n this.dispatch = props.dispatch;\n this.hostName = props.hostName || \"root\";\n }\n\n registerHost = (hostName: string) => {\n this.dispatch({\n type: ACTIONS.REGISTER_HOST,\n hostName,\n });\n };\n\n deregisterHost = (hostName: string) => {\n this.dispatch({\n type: ACTIONS.DEREGISTER_HOST,\n hostName,\n });\n };\n\n addPortal = (hostName: string, portalName: string, node: any) => {\n this.dispatch({\n type: ACTIONS.ADD_UPDATE_PORTAL,\n hostName,\n portalName,\n node,\n });\n };\n\n addUpdatePortal = (hostName: string, portalName: string, node: any) => {\n this.addPortal(hostName, portalName, node);\n };\n\n removePortal = (hostName: string, portalName: string) => {\n this.dispatch({\n type: ACTIONS.REMOVE_PORTAL,\n hostName,\n portalName,\n });\n };\n\n componentDidMount() {\n this.registerHost(this.hostName!);\n }\n\n componentWillUnmount() {\n this.deregisterHost(this.hostName!);\n }\n}\n"],"names":["INITIAL_STATE","stateDispatch","registerHost","state","hostName","deregisterHost","addUpdatePortal","portalName","node","index","findIndex","item","name","push","removePortal","splice","reducer","action","type","clonedState","_objectSpread","ACTIONS","REGISTER_HOST","DEREGISTER_HOST","ADD_UPDATE_PORTAL","REMOVE_PORTAL","PortalProviderComponent","_ref$rootHostName","_ref","rootHostName","_ref$shouldAddRootHos","shouldAddRootHost","children","_useReducer","useReducer","_useReducer2","_slicedToArray","dispatch","useEffect","PortalDispatchContext","Provider","value","PortalStateContext","React","createElement","PortalHost","PortalProvider","memo","displayName","PortalManager","props","_this","_classCallCheck","__publicField","addPortal","_createClass","key","componentDidMount","componentWillUnmount"],"mappings":";;;;;;;;;;;;;;;;;;;;AA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AAA;MACvD4C,KAAA,CAAKd,QAAS,CAAA;QACZnB,MAAMG,OAAQ,CAAAI,aAAA;AACdrB,QAAAA,QAAA,EAAAA,QAAA;AACAG,QAAAA,UAAA,EAAAA,UAAAA;AACF,OAAC,CAAA,CAAA;AACH,KAAA,CAAA,CAAA;AArCE,IAAA,IAAA,CAAK8B,WAAWa,KAAM,CAAAb,QAAA,CAAA;AACjB,IAAA,IAAA,CAAAjC,QAAA,GAAW8C,MAAM9C,QAAY,IAAA,MAAA,CAAA;AACpC,GAAA;EAAA,OAAAmD,YAAA,CAAAN,aAAA,EAAA,CAAA;IAAAO,GAAA,EAAA,mBAAA;AAAAf,IAAAA,KAAA,EAqCA,SAAAgB,iBAAoBA,GAAA;AACb,MAAA,IAAA,CAAAvD,YAAA,CAAa,KAAKE,QAAS,CAAA,CAAA;AAClC,KAAA;AAAA,GAAA,EAAA;IAAAoD,GAAA,EAAA,sBAAA;AAAAf,IAAAA,KAAA,EAEA,SAAAiB,oBAAuBA,GAAA;AAChB,MAAA,IAAA,CAAArD,cAAA,CAAe,KAAKD,QAAS,CAAA,CAAA;AACpC,KAAA;AAAA,GAAA,CAAA,CAAA,CAAA;AAAA,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xhsreds/reds-rn-next",
|
|
3
|
-
"version": "0.10.1-
|
|
3
|
+
"version": "0.10.1-beta202512022142",
|
|
4
4
|
"author": "贾斌(呀哈) <jiabin@xiaohongshu.com>",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"dependencies": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"react-native-fs": "2.20.0",
|
|
27
27
|
"react-native-svg": "13.14.0",
|
|
28
28
|
"@xhs/react-native-harmony": "*",
|
|
29
|
-
"@xhsreds/reds-token-next": "0.10.1-
|
|
29
|
+
"@xhsreds/reds-token-next": "0.10.1-beta202512022142"
|
|
30
30
|
},
|
|
31
31
|
"peerDependenciesMeta": {
|
|
32
32
|
"ozone-schema-web": {
|
|
@@ -206,9 +206,15 @@ const Image = ({
|
|
|
206
206
|
};
|
|
207
207
|
|
|
208
208
|
const colorMode = useColorMode();
|
|
209
|
-
|
|
210
209
|
return (
|
|
211
|
-
<View
|
|
210
|
+
<View
|
|
211
|
+
style={{
|
|
212
|
+
borderRadius: borderRadius || style?.borderRadius,
|
|
213
|
+
...(style as {}),
|
|
214
|
+
height: ((height || style?.height || 0) as number) + (style?.borderWidth || 0) * 2,
|
|
215
|
+
width: ((width || style?.width || 0) as number) + (style?.borderWidth || 0) * 2,
|
|
216
|
+
}}
|
|
217
|
+
>
|
|
212
218
|
{imageStatus !== IMAGE_STATUS.HIDE && (
|
|
213
219
|
<RNImage
|
|
214
220
|
{...props}
|
|
@@ -225,7 +231,7 @@ const Image = ({
|
|
|
225
231
|
style={{
|
|
226
232
|
width: width || style?.width,
|
|
227
233
|
height: height || style?.height,
|
|
228
|
-
borderRadius,
|
|
234
|
+
borderRadius: borderRadius || style?.borderRadius,
|
|
229
235
|
// opacity: imageStatus === IMAGE_STATUS.LOADED ? 1 : 0,
|
|
230
236
|
}}
|
|
231
237
|
// @ts-ignore
|
|
@@ -235,12 +241,11 @@ const Image = ({
|
|
|
235
241
|
{imageStatus === IMAGE_STATUS.LOADING && loadStyle !== TLoadStyle.NONE && (
|
|
236
242
|
<View
|
|
237
243
|
style={{
|
|
238
|
-
width,
|
|
239
|
-
height,
|
|
240
|
-
borderRadius,
|
|
244
|
+
width: width || style?.width,
|
|
245
|
+
height: height || style?.height,
|
|
246
|
+
borderRadius: borderRadius || style?.borderRadius,
|
|
241
247
|
...styles.loadingContainer,
|
|
242
248
|
backgroundColor: loadStyle === TLoadStyle.AVE ? aveColor : styles.loadingContainer.backgroundColor,
|
|
243
|
-
...style,
|
|
244
249
|
}}
|
|
245
250
|
>
|
|
246
251
|
{loadStyle === TLoadStyle.BLUR && (
|
|
@@ -249,7 +254,7 @@ const Image = ({
|
|
|
249
254
|
style={{
|
|
250
255
|
width: width || style?.width,
|
|
251
256
|
height: height || style?.height,
|
|
252
|
-
borderRadius,
|
|
257
|
+
borderRadius: borderRadius || style?.borderRadius,
|
|
253
258
|
}}
|
|
254
259
|
// @ts-ignore
|
|
255
260
|
apmBiz={props.apmBiz}
|
|
@@ -265,7 +270,7 @@ const Image = ({
|
|
|
265
270
|
onPress={(e) => {
|
|
266
271
|
onReload(e);
|
|
267
272
|
}}
|
|
268
|
-
style={{ width, height,
|
|
273
|
+
style={{ width, height, ...styles.loadingContainer }}
|
|
269
274
|
>
|
|
270
275
|
<RNImage
|
|
271
276
|
style={{ width: 40, height: 40 }}
|
|
@@ -16,24 +16,23 @@ export default function App() {
|
|
|
16
16
|
return (
|
|
17
17
|
<View style={{ display: "flex", flexDirection: "row" }}>
|
|
18
18
|
<ScrollView style={{ backgroundColor: "#50796633" }}>
|
|
19
|
-
<Desc>基础用法</Desc>
|
|
19
|
+
{/* <Desc>基础用法</Desc>
|
|
20
20
|
|
|
21
21
|
<Image width={150} height={150} borderRadius={30} source={{ uri: imageUrl }} abortApmCollection={true}></Image>
|
|
22
22
|
<Br />
|
|
23
23
|
|
|
24
|
-
<Desc>Image组件加边框</Desc>
|
|
24
|
+
<Desc>Image组件加边框</Desc> */}
|
|
25
25
|
|
|
26
26
|
<Image
|
|
27
27
|
width={150}
|
|
28
28
|
height={150}
|
|
29
|
-
borderRadius={30}
|
|
30
29
|
source={{ uri: imageUrl }}
|
|
31
30
|
abortApmCollection={true}
|
|
32
31
|
style={{ borderWidth: 1, borderStyle: "solid", borderColor: "red", borderRadius: 50 }}
|
|
33
32
|
></Image>
|
|
34
33
|
<Br />
|
|
35
34
|
|
|
36
|
-
<Desc>加载时显示主要色</Desc>
|
|
35
|
+
{/* <Desc>加载时显示主要色</Desc>
|
|
37
36
|
<Image loadStyle={TLoadStyle.AVE} width={150} height={150} borderRadius={30} src={imageUrl}></Image>
|
|
38
37
|
|
|
39
38
|
<Br />
|
|
@@ -94,7 +93,7 @@ export default function App() {
|
|
|
94
93
|
onReload={() => {
|
|
95
94
|
setImageUrl2(imageUrl);
|
|
96
95
|
}}
|
|
97
|
-
></Image>
|
|
96
|
+
></Image> */}
|
|
98
97
|
</ScrollView>
|
|
99
98
|
</View>
|
|
100
99
|
);
|