react-native-ui-lib 7.39.0-snapshot.6477 → 7.39.0-snapshot.6479

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-ui-lib",
3
- "version": "7.39.0-snapshot.6477",
3
+ "version": "7.39.0-snapshot.6479",
4
4
  "main": "src/index.js",
5
5
  "types": "src/index.d.ts",
6
6
  "author": "Ethan Sharabi <ethan.shar@gmail.com>",
@@ -2,7 +2,7 @@ import isUndefined from 'lodash/isUndefined';
2
2
  import React, { useMemo, forwardRef } from 'react';
3
3
  import { Image, StyleSheet } from 'react-native';
4
4
  import { asBaseComponent, Constants } from "../../commons/new";
5
- import { getAsset, isSvg, isBase64ImageContent } from "../../utils/imageUtils";
5
+ import { getAsset, isSvg, isWebImageSource } from "../../utils/imageUtils";
6
6
  import Badge from "../badge";
7
7
  import SvgImage from "../svgImage";
8
8
 
@@ -56,7 +56,7 @@ const Icon = forwardRef((props, ref) => {
56
56
  tintColor
57
57
  }, style]} />;
58
58
  const renderSvg = () => <SvgImage fsTagName={recorderTag} data={source} {...iconSize} {...props} />;
59
- if (typeof source === 'string' && isBase64ImageContent(source) && Constants.isWeb) {
59
+ if (isWebImageSource(source)) {
60
60
  return renderImage();
61
61
  }
62
62
  return <>
@@ -29,18 +29,30 @@
29
29
  }
30
30
  ],
31
31
  "snippet": [
32
- "<Timeline",
33
- " topLine={{type: Timeline.lineTypes.DASHED}}",
34
- " bottomLine={{state: Timeline.states.SUCCESS}}",
35
- " point={{state: Timeline.states.SUCCESS}}",
32
+ "<Timeline ",
33
+ " topLine={{",
34
+ " state: Timeline.states.ERROR",
35
+ " }$1}",
36
+ " bottomLine={{",
37
+ " type: Timeline.lineTypes.DASHED,",
38
+ " color: Colors.orange40",
39
+ " }$2}",
40
+ " point={{",
41
+ " type: Timeline.pointTypes.OUTLINE,",
42
+ " color: Colors.orange40,",
43
+ " icon: Assets.icons.demo.camera,",
44
+ " anchorRef: alignToTitle ? titleRef : undefined",
45
+ " }$3}",
36
46
  ">",
37
- " <View padding-20 bg-grey60 br30>",
38
- " <Text text70BO>Title</Text>",
39
- " <View marginT-5 padding-8 bg-white br30>",
40
- " <Text>Description</Text>",
41
- " </View>",
42
- " </View>",
43
- " </Timeline>"
47
+ " <View flex centerH paddingH-20>",
48
+ " <Text text70 dark10 ref={titleRef}>",
49
+ " {title}",
50
+ " </Text>",
51
+ " <Text dark40>",
52
+ " {description}",
53
+ " </Text>",
54
+ " </View>",
55
+ "</Timeline>"
44
56
  ],
45
57
  "docs": {
46
58
  "hero": {
@@ -126,7 +138,29 @@
126
138
  "title": "Current",
127
139
  "content": [
128
140
  {
129
- "snippet": "<Timeline topLine={{state: Timeline.states.CURRENT}} bottomLine={{state: Timeline.states.CURRENT}} point={{state: Timeline.states.CURRENT}}><View style={{height: 88}}/></Timeline>"
141
+ "props": {
142
+ "state": "current",
143
+ "point": {
144
+ "type": {
145
+ "type": "bullet"
146
+ }
147
+ },
148
+ "bottomLine": {
149
+ "type": {
150
+ "type": "solid"
151
+ }
152
+ }
153
+ }
154
+ },
155
+ {
156
+ "props": {
157
+ "point": {
158
+ "type": {
159
+ "type": "bullet",
160
+ "color": "#116DFF"
161
+ }
162
+ }
163
+ }
130
164
  }
131
165
  ],
132
166
  "description": "state: current"
@@ -135,7 +169,19 @@
135
169
  "title": "Next",
136
170
  "content": [
137
171
  {
138
- "snippet": "<Timeline topLine={{state: Timeline.states.NEXT}} bottomLine={{state: Timeline.states.NEXT}} point={{state: Timeline.states.NEXT, type: Timeline.pointTypes.CIRCLE}}><View style={{height: 88}}/></Timeline>"
172
+ "props": {
173
+ "state": "next",
174
+ "point": {
175
+ "type": {
176
+ "type": "bullet"
177
+ }
178
+ },
179
+ "bottomLine": {
180
+ "type": {
181
+ "type": "solid"
182
+ }
183
+ }
184
+ }
139
185
  }
140
186
  ],
141
187
  "description": "state: next"
@@ -144,7 +190,19 @@
144
190
  "title": "Error",
145
191
  "content": [
146
192
  {
147
- "snippet": "<Timeline topLine={{state: Timeline.states.ERROR}} bottomLine={{state: Timeline.states.ERROR}} point={{state: Timeline.states.ERROR}}><View style={{height: 88}}/></Timeline>"
193
+ "props": {
194
+ "state": "error",
195
+ "point": {
196
+ "type": {
197
+ "type": "bullet"
198
+ }
199
+ },
200
+ "bottomLine": {
201
+ "type": {
202
+ "type": "solid"
203
+ }
204
+ }
205
+ }
148
206
  }
149
207
  ],
150
208
  "description": "state: error"
@@ -153,7 +211,19 @@
153
211
  "title": "Success",
154
212
  "content": [
155
213
  {
156
- "snippet": "<Timeline topLine={{state: Timeline.states.SUCCESS}} bottomLine={{state: Timeline.states.SUCCESS}} point={{state: Timeline.states.SUCCESS}}><View style={{height: 88}}/></Timeline>"
214
+ "props": {
215
+ "state": "success",
216
+ "point": {
217
+ "type": {
218
+ "type": "bullet"
219
+ }
220
+ },
221
+ "bottomLine": {
222
+ "type": {
223
+ "type": "solid"
224
+ }
225
+ }
226
+ }
157
227
  }
158
228
  ],
159
229
  "description": "state: success"
@@ -168,30 +238,15 @@
168
238
  "items": [
169
239
  {
170
240
  "title": "Bullet",
171
- "description": "type: bullet",
172
- "content": [
173
- {
174
- "snippet": "<Timeline point={{type: Timeline.pointTypes.BULLET}}><View style={{height: 88}}/></Timeline>"
175
- }
176
- ]
241
+ "description": "type: bullet"
177
242
  },
178
243
  {
179
244
  "title": "Circle",
180
- "description": "type: circle",
181
- "content": [
182
- {
183
- "snippet": "<Timeline point={{state: Timeline.states.NEXT, type: Timeline.pointTypes.CIRCLE}}><View style={{height: 88}}/></Timeline>"
184
- }
185
- ]
245
+ "description": "type: circle"
186
246
  },
187
247
  {
188
248
  "title": "Outline",
189
- "description": "type: outline",
190
- "content": [
191
- {
192
- "snippet": "<Timeline point={{type: Timeline.pointTypes.OUTLINE}}><View style={{height: 88}}/></Timeline>"
193
- }
194
- ]
249
+ "description": "type: outline"
195
250
  }
196
251
  ],
197
252
  "title": "Point",
@@ -205,7 +260,14 @@
205
260
  "title": "Text",
206
261
  "content": [
207
262
  {
208
- "snippet": "<Timeline point={{label: '1'}}><View style={{height: 88}}/></Timeline>"
263
+ "props": {
264
+ "state": "current",
265
+ "bottomLine": {
266
+ "type": {
267
+ "type": "solid"
268
+ }
269
+ }
270
+ }
209
271
  }
210
272
  ],
211
273
  "description": "text: “1”"
@@ -214,18 +276,20 @@
214
276
  "title": "Icon",
215
277
  "content": [
216
278
  {
217
- "snippet": "<Timeline point={{state: Timeline.states.SUCCESS, icon: Assets.icons.checkSmall}}><View style={{height: 88}}/></Timeline>"
279
+ "props": {
280
+ "state": "current",
281
+ "bottomLine": {
282
+ "type": {
283
+ "type": "dashed"
284
+ }
285
+ }
286
+ }
218
287
  }
219
288
  ],
220
289
  "description": "icon: Assets.icons.general.checkmarkSmall"
221
290
  },
222
291
  {
223
292
  "title": "Icon without background",
224
- "content": [
225
- {
226
- "snippet": "<Timeline point={{state: Timeline.states.SUCCESS, icon: Assets.icons.search, removeIconBackground: true}}><View style={{height: 88}}/></Timeline>"
227
- }
228
- ],
229
293
  "description": "icon: Assets.icons.general.favorite, removeIconBackground: true"
230
294
  }
231
295
  ],
@@ -237,20 +301,10 @@
237
301
  "items": [
238
302
  {
239
303
  "title": "Solid",
240
- "content": [
241
- {
242
- "snippet": "<Timeline topLine={{state: Timeline.states.CURRENT}} point={{removeIconBackground: true}}><View style={{height: 88}}/></Timeline>"
243
- }
244
- ],
245
304
  "description": "type: solid"
246
305
  },
247
306
  {
248
307
  "title": "Dashed",
249
- "content": [
250
- {
251
- "snippet": "<Timeline topLine={{state: Timeline.states.CURRENT, type: Timeline.lineTypes.DASHED}} point={{removeIconBackground: true}}><View style={{height: 88}}/></Timeline>"
252
- }
253
- ],
254
308
  "description": "type: dashed"
255
309
  }
256
310
  ],
@@ -263,11 +317,6 @@
263
317
  "items": [
264
318
  {
265
319
  "title": "Entry",
266
- "content": [
267
- {
268
- "snippet": "<Timeline topLine={{state: Timeline.states.NEXT, entry: true}} bottomLine={{state: Timeline.states.NEXT, entry: true}} point={{removeIconBackground: true}}><View style={{height: 88}}/></Timeline>"
269
- }
270
- ],
271
320
  "description": "entry: true"
272
321
  }
273
322
  ],
@@ -104,7 +104,7 @@
104
104
  {
105
105
  "props": {
106
106
  "visible": true,
107
- "message": "Mika Or was saved to contacts."
107
+ "message": "\"Mika Or\" was saved to contacts."
108
108
  }
109
109
  }
110
110
  ]
@@ -3,3 +3,4 @@ export declare function isSvgUri(source?: ImageSourceType): any;
3
3
  export declare function isSvg(source?: ImageSourceType): any;
4
4
  export declare function isBase64ImageContent(data: string): boolean;
5
5
  export declare function getAsset(assetName?: string, assetGroup?: string): any;
6
+ export declare function isWebImageSource(source?: ImageSourceType): boolean;
@@ -1,5 +1,6 @@
1
1
  import get from 'lodash/get';
2
2
  import Assets from "../assets";
3
+ import Constants from "../commons/Constants";
3
4
  export function isSvgUri(source) {
4
5
  // @ts-expect-error
5
6
  return typeof source === 'object' && source?.uri?.endsWith?.('.svg');
@@ -20,4 +21,10 @@ function isSvgData(source) {
20
21
  const sourceString = source;
21
22
  return sourceString.includes('</svg>') || sourceString.includes('data:image/svg');
22
23
  }
24
+ }
25
+ export function isWebImageSource(source) {
26
+ const isSourceString =
27
+ //@ts-ignore
28
+ typeof source === 'object' && typeof source?.default === 'string' && isBase64ImageContent(source.default) || typeof source === 'string' && isBase64ImageContent(source);
29
+ return isSourceString && Constants.isWeb;
23
30
  }