react-native-ui-lib 7.39.0-snapshot.6491 → 7.39.0-snapshot.6498

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.6491",
3
+ "version": "7.39.0-snapshot.6498",
4
4
  "main": "src/index.js",
5
5
  "types": "src/index.d.ts",
6
6
  "author": "Ethan Sharabi <ethan.shar@gmail.com>",
@@ -31,6 +31,9 @@ const VALID_COMPONENTS_CATEGORIES = [
31
31
 
32
32
  function buildDocs(apiFolders, componentsPreProcess) {
33
33
  let components = readComponentsFromApiFiles(apiFolders);
34
+
35
+ logStatistics(components);
36
+
34
37
  components = componentsPreProcess?.(components) ?? components;
35
38
  resetDocsDir();
36
39
  processComponents(components);
@@ -134,6 +137,22 @@ function generateExtendsLink(extendsLink) {
134
137
  return extendsText;
135
138
  }
136
139
 
140
+ function logStatistics(components) {
141
+ const groupedComponents = _.countBy(components, 'name');
142
+ const duplicateComponents = Object.entries(groupedComponents)
143
+ .filter(([_, count]) => count > 1)
144
+ .map(([name, count]) => `${name} (${count} times)`);
145
+
146
+ if (duplicateComponents.length > 0) {
147
+ console.log('Components with multiple occurrences:\n-', duplicateComponents.join('\n- '));
148
+ }
149
+
150
+ const componentsWithoutSnippet = components.filter(c => !c.snippet).map(c => c.name);
151
+ if (componentsWithoutSnippet.length > 0) {
152
+ console.log('Components missing snippet:\n-', componentsWithoutSnippet.join('\n- '));
153
+ }
154
+ }
155
+
137
156
  function buildOldDocs(component) {
138
157
  let content = '';
139
158
  content += `import UILivePreview from '@site/src/components/UILivePreview';\n\n`;
@@ -197,8 +216,6 @@ function buildOldDocs(component) {
197
216
  ?.map(item => _.replace(item, new RegExp(/\$[1-9]/, 'g'), ''))
198
217
  .join('\n')
199
218
  .toString()}\`}/>\n\n`;
200
- } else {
201
- console.warn(`${component.name} does not have a snippet`);
202
219
  }
203
220
 
204
221
  /* Props */
@@ -47,6 +47,7 @@ declare const constants: {
47
47
  };
48
48
  backspaceKey: string;
49
49
  enterKey: string;
50
+ getFontScale: () => number;
50
51
  };
51
52
  export default constants;
52
53
  export declare const _reset: () => void;
@@ -1,4 +1,4 @@
1
- import { Platform, Dimensions, NativeModules, I18nManager, AccessibilityInfo, StatusBar } from 'react-native';
1
+ import { Platform, Dimensions, NativeModules, I18nManager, AccessibilityInfo, StatusBar, PixelRatio } from 'react-native';
2
2
  export let orientations = /*#__PURE__*/function (orientations) {
3
3
  orientations["PORTRAIT"] = "portrait";
4
4
  orientations["LANDSCAPE"] = "landscape";
@@ -166,7 +166,9 @@ const constants = {
166
166
  },
167
167
  /* Keyboard */
168
168
  backspaceKey: 'Backspace',
169
- enterKey: 'Enter'
169
+ enterKey: 'Enter',
170
+ /* Font scale */
171
+ getFontScale: PixelRatio.getFontScale
170
172
  };
171
173
  setStatusBarHeight();
172
174
  Dimensions.addEventListener('change', updateConstants);
@@ -1,5 +1,5 @@
1
1
  import React, { useRef } from 'react';
2
- import { StyleSheet, TextInput, PixelRatio, I18nManager } from 'react-native';
2
+ import { StyleSheet, TextInput, I18nManager } from 'react-native';
3
3
  import { Colors, Typography } from "../../style";
4
4
  import { BORDER_RADIUS, getHexString, getTextColor } from "./ColorPickerPresenter";
5
5
  import View from "../view";
@@ -19,7 +19,7 @@ const ColorPickerPreview = props => {
19
19
  const textInput = useRef(null);
20
20
  const hex = getHexString(color);
21
21
  const textColor = getTextColor(hex);
22
- const fontScale = PixelRatio.getFontScale();
22
+ const fontScale = Constants.getFontScale();
23
23
  const value = Colors.isTransparent(text) ? '000000' : text;
24
24
  return <View style={[styles.preview, {
25
25
  backgroundColor: hex