@prototyp/skeletor 1.0.2 → 1.0.4
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/README.md +24 -23
- package/lib/module/components/InputFocusScrollView/InputFocusScrollView.js.map +1 -1
- package/lib/typescript/src/components/InputFocusScrollView/InputFocusScrollView.d.ts +2 -2
- package/lib/typescript/src/components/InputFocusScrollView/InputFocusScrollView.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/components/InputFocusScrollView/InputFocusScrollView.tsx +2 -4
- package/.eslintrc.json +0 -19
- package/.github/CODEOWNERS +0 -2
- package/.gitignore +0 -5
- package/prototyp-skeletor-v1.0.0.tgz +0 -0
- package/tsconfig.json +0 -16
- package/yarn.lock +0 -6080
package/README.md
CHANGED
|
@@ -13,24 +13,25 @@ Add the SkeletorProvider component as the (or one of) top wrapper of your applic
|
|
|
13
13
|
```javascript
|
|
14
14
|
/// index.js
|
|
15
15
|
const App = () => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
return (
|
|
17
|
+
<SkeletorProvider>
|
|
18
|
+
<StoreProvider>
|
|
19
|
+
<RootNavigator />
|
|
20
|
+
</StoreProvider>
|
|
21
|
+
</SkeletorProvider>
|
|
22
|
+
);
|
|
23
23
|
};
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
Configure the SkeletorProvider properties with whatever you desire. Here is the list of all configurable properties for the SkeletorProvider component:
|
|
27
27
|
|
|
28
28
|
```javascript
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
interface SkeletorConfig {
|
|
30
|
+
defaultFont: Font | undefined;
|
|
31
|
+
defaultFontSize: [number, number] | number;
|
|
32
|
+
defaultStatusBarType: "dark-content" | "light-content" | "default";
|
|
33
|
+
defaultTextColor: string;
|
|
34
|
+
}
|
|
34
35
|
```
|
|
35
36
|
|
|
36
37
|
For Skeletor to detect the fonts you have added, you will have to create a type defintion file to override the existing Font type like in the following example:
|
|
@@ -43,7 +44,7 @@ type Font = "Helvetica" | "Roboto" | "San Francisco";
|
|
|
43
44
|
Then you can configure the `defaultFont` property as follows:
|
|
44
45
|
|
|
45
46
|
```javascript
|
|
46
|
-
<SkeletorProvider defaultFont="
|
|
47
|
+
<SkeletorProvider defaultFont="Helvetica">...</SkeletorProvider>
|
|
47
48
|
```
|
|
48
49
|
|
|
49
50
|
To get access to the skeletor styles in other components, you can use the provided `useSkeletor` hook that will return the entire Skeletor configuration object. For instance:
|
|
@@ -115,11 +116,11 @@ To use the `Text` component, simply import it and pass in the desired props.
|
|
|
115
116
|
import { Text } from "./Text";
|
|
116
117
|
|
|
117
118
|
function MyComponent() {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
119
|
+
return (
|
|
120
|
+
<Text font="Arial" size={[14, 18]} color="#333" textAlign="center">
|
|
121
|
+
Hello World!
|
|
122
|
+
</Text>
|
|
123
|
+
);
|
|
123
124
|
}
|
|
124
125
|
```
|
|
125
126
|
|
|
@@ -186,12 +187,12 @@ Use cases are many, but simple. This component is intended to be used as a build
|
|
|
186
187
|
|
|
187
188
|
```typescript
|
|
188
189
|
<Block
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
190
|
+
maxHeight="75%"
|
|
191
|
+
flexDirection="row"
|
|
192
|
+
align="flex-start"
|
|
193
|
+
justify="space-between"
|
|
193
194
|
>
|
|
194
|
-
|
|
195
|
+
... ...
|
|
195
196
|
</Block>
|
|
196
197
|
```
|
|
197
198
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useRef","useState","Platform","ScrollView","StyleSheet","Dimensions","InputFocusScrollView","children","style","contentContainerStyle","height","focusPositionOffset","margins","paddings","rest","screenHeight","get","current","ref","scrollTarget","setScrollTarget","scrollPosition","setScrollPosition","onInputFocus","e","OS","currentTarget","measureLayout","nope","top","nuuh","elementHeight","scrollY","undefined","scrollTo","y","console","error","onScrollViewLayout","nativeEvent","target","onContentSizeChange","animated","containerStyles","flatten","styles","contentStyles","content","create","full","auto","flexGrow","paddingBottom"],"sourceRoot":"../../src","sources":["InputFocusScrollView.tsx"],"mappings":";AAAA,OAAOA,KAAK,
|
|
1
|
+
{"version":3,"names":["React","useRef","useState","Platform","ScrollView","StyleSheet","Dimensions","InputFocusScrollView","children","style","contentContainerStyle","height","focusPositionOffset","margins","paddings","rest","screenHeight","get","current","ref","scrollTarget","setScrollTarget","scrollPosition","setScrollPosition","onInputFocus","e","OS","currentTarget","measureLayout","nope","top","nuuh","elementHeight","scrollY","undefined","scrollTo","y","console","error","onScrollViewLayout","nativeEvent","target","onContentSizeChange","animated","containerStyles","flatten","styles","contentStyles","content","create","full","auto","flexGrow","paddingBottom"],"sourceRoot":"../../src","sources":["InputFocusScrollView.tsx"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAC/C,SACEC,QAAQ,EAGRC,UAAU,EAEVC,UAAU,EAEVC,UAAU,QACL,cAAc;AAcrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,oBAAyD,GAAG,QASnE;EAAA,IAToE;IACxEC,QAAQ;IACRC,KAAK;IACLC,qBAAqB;IACrBC,MAAM,GAAG,MAAM;IACfC,mBAAmB,GAAG,GAAG;IACzBC,OAAO;IACPC,QAAQ;IACR,GAAGC;EACL,CAAC;EACC,MAAMC,YAAY,GAAGf,MAAM,CAACK,UAAU,CAACW,GAAG,CAAC,QAAQ,CAAC,CAACN,MAAM,CAAC,CAACO,OAAO;EACpE,MAAMC,GAAG,GAAGlB,MAAM,CAAa,IAAI,CAAC;EACpC,MAAM,CAACmB,YAAY,EAAEC,eAAe,CAAC,GAAGnB,QAAQ,EAAiB;EACjE;EACA,MAAM,CAACoB,cAAc,EAAEC,iBAAiB,CAAC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,aAAa,GAAG1C,UAAU,CAACwC,OAAO,CAAC,CACvCC,MAAM,CAACE,OAAO,EACd;IAAE,GAAGlC;EAAS,CAAC,EACfJ,qBAAqB,CACtB,CAAC;EAEF,oBACE,oBAAC,UAAU;IACT,GAAG,EAAES,GAAI;IACT,uBAAuB;IACvB,mBAAmB,EAAE,EAAG;IACxB,QAAQ,EAAEoB,kBAAmB;IAC7B,mBAAmB,EAAEG,mBAAoB;IACzC,4BAA4B,EAAE,KAAM;IACpC,8BAA8B,EAAE,KAAM;IACtC,KAAK,EAAEE,eAAgB;IACvB,qBAAqB,EAAEG;EAAc,GACjChC,IAAI,GAEPP,QAAQ,CAACgB,YAAY,CAAC,CACZ;AAEjB,CAAC;AAED,MAAMsB,MAAM,GAAGzC,UAAU,CAAC4C,MAAM,CAAC;EAC/BC,IAAI,EAAE;IAAEvC,MAAM,EAAE;EAAO,CAAC;EACxBwC,IAAI,EAAE;IAAExC,MAAM,EAAE;EAAO,CAAC;EACxBqC,OAAO,EAAE;IACPI,QAAQ,EAAE,CAAC;IACXC,aAAa,EAAE;EACjB;AACF,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { NativeSyntheticEvent, ScrollViewProps, TextInputFocusEventData } from "react-native";
|
|
3
3
|
import { Spacing } from "../../models";
|
|
4
4
|
export interface InputFocusScrollViewProps extends Omit<ScrollViewProps, "children">, Spacing {
|
|
@@ -14,5 +14,5 @@ export interface InputFocusScrollViewProps extends Omit<ScrollViewProps, "childr
|
|
|
14
14
|
* @example <InputFocusScrollView>{(onInputFocus) => <TextInput onFocus={onInputFocus} ... />}</InputFocusScrollView>
|
|
15
15
|
* NOTE: This works on iOS only, Android does this by default with @param android:windowSoftInputMode
|
|
16
16
|
*/
|
|
17
|
-
export declare const InputFocusScrollView: React.FC<
|
|
17
|
+
export declare const InputFocusScrollView: React.FC<InputFocusScrollViewProps>;
|
|
18
18
|
//# sourceMappingURL=InputFocusScrollView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputFocusScrollView.d.ts","sourceRoot":"","sources":["../../../../../src/components/InputFocusScrollView/InputFocusScrollView.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"InputFocusScrollView.d.ts","sourceRoot":"","sources":["../../../../../src/components/InputFocusScrollView/InputFocusScrollView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAChD,OAAO,EAGL,oBAAoB,EAEpB,eAAe,EAEf,uBAAuB,EAExB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,WAAW,yBACf,SAAQ,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,EACvC,OAAO;IACT,4LAA4L;IAC5L,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,QAAQ,EAAE,CACR,YAAY,EAAE,CAAC,CAAC,EAAE,oBAAoB,CAAC,uBAAuB,CAAC,KAAK,IAAI,KACrE,KAAK,CAAC,SAAS,CAAC;CACtB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CA6EpE,CAAC"}
|
package/package.json
CHANGED
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
"name": "@prototyp/skeletor",
|
|
3
3
|
"description": "React-Native UI and functional toolkit",
|
|
4
4
|
"author": "Luka Buljan <luka@prototyp.digital>",
|
|
5
|
-
"version": "1.0.
|
|
5
|
+
"version": "1.0.4",
|
|
6
6
|
"types": "lib/typescript/src/index.d.ts",
|
|
7
7
|
"main": "lib/module/index.js",
|
|
8
8
|
"react-native": "src/index.ts",
|
|
9
9
|
"module": "lib/module/index.js",
|
|
10
|
+
"homepage": "https://github.com/prototypdigital/skeletor",
|
|
10
11
|
"repository": {
|
|
11
12
|
"type": "git",
|
|
12
|
-
"directory": "
|
|
13
|
+
"directory": "https://github.com/prototypdigital/skeletor"
|
|
13
14
|
},
|
|
14
15
|
"scripts": {
|
|
15
16
|
"prepack": "bob build"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useRef, useState } from "react";
|
|
2
2
|
import {
|
|
3
3
|
Platform,
|
|
4
4
|
LayoutChangeEvent,
|
|
@@ -29,9 +29,7 @@ export interface InputFocusScrollViewProps
|
|
|
29
29
|
* @example <InputFocusScrollView>{(onInputFocus) => <TextInput onFocus={onInputFocus} ... />}</InputFocusScrollView>
|
|
30
30
|
* NOTE: This works on iOS only, Android does this by default with @param android:windowSoftInputMode
|
|
31
31
|
*/
|
|
32
|
-
export const InputFocusScrollView: React.FC<
|
|
33
|
-
PropsWithChildren<InputFocusScrollViewProps>
|
|
34
|
-
> = ({
|
|
32
|
+
export const InputFocusScrollView: React.FC<InputFocusScrollViewProps> = ({
|
|
35
33
|
children,
|
|
36
34
|
style,
|
|
37
35
|
contentContainerStyle,
|
package/.eslintrc.json
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "@react-native-community",
|
|
3
|
-
"parser": "@typescript-eslint/parser",
|
|
4
|
-
"plugins": ["@typescript-eslint", "import", "prettier"],
|
|
5
|
-
"rules": {
|
|
6
|
-
"quotes": ["error", "double", { "avoidEscape": true }],
|
|
7
|
-
"react-hooks/exhaustive-deps": "off"
|
|
8
|
-
},
|
|
9
|
-
"overrides": [
|
|
10
|
-
{
|
|
11
|
-
"files": ["*.ts", "*.tsx"],
|
|
12
|
-
"rules": {
|
|
13
|
-
"@typescript-eslint/no-shadow": ["error"],
|
|
14
|
-
"no-shadow": "off",
|
|
15
|
-
"no-undef": "off"
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
]
|
|
19
|
-
}
|
package/.github/CODEOWNERS
DELETED
package/.gitignore
DELETED
|
Binary file
|
package/tsconfig.json
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "@tsconfig/react-native/tsconfig.json" /* Recommended React Native TSConfig base */,
|
|
3
|
-
"exclude": ["__tests__", "./*.config.js", "index.js", "node_modules"],
|
|
4
|
-
"compilerOptions": {
|
|
5
|
-
/* Visit https://aka.ms/tsconfig.json to read more about this file */
|
|
6
|
-
|
|
7
|
-
/* Completeness */
|
|
8
|
-
"skipLibCheck": true /* Skip type checking all .d.ts files. */,
|
|
9
|
-
"baseUrl": "src",
|
|
10
|
-
"rootDirs": ["src"],
|
|
11
|
-
"typeRoots": ["./src/types"],
|
|
12
|
-
"lib": ["es2016"],
|
|
13
|
-
"jsx": "react-native",
|
|
14
|
-
"noEmit": false
|
|
15
|
-
}
|
|
16
|
-
}
|