native-pytech 1.0.78 → 1.0.80

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.
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import type Props from './types';
3
+ declare const _default: React.MemoExoticComponent<({ colorRows, ...pageProps }: Props) => React.JSX.Element>;
4
+ export default _default;
@@ -0,0 +1,12 @@
1
+ import { Host, Column, Row } from '@expo/ui/jetpack-compose';
2
+ import React, { memo } from 'react';
3
+ import Item from '../Item';
4
+ export default memo(({ colorRows, ...pageProps }) => {
5
+ return (<Host style={{ flex: 1 }}>
6
+ <Column verticalArrangement={{ spacedBy: 16 }}>
7
+ {colorRows.map((row, index) => (<Row key={index} verticalArrangement="spaceBetween">
8
+ {row.map((color, indexColor) => (<Item color={color} size={55} {...pageProps}/>))}
9
+ </Row>))}
10
+ </Column>
11
+ </Host>);
12
+ });
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import type Props from './types';
3
+ declare const _default: React.MemoExoticComponent<({ color, size, selectedColor, onSelectColor, }: Props) => React.JSX.Element>;
4
+ export default _default;
@@ -0,0 +1,14 @@
1
+ import { clip, size as sizeModifier, border, background, clickable } from '@expo/ui/jetpack-compose/modifiers';
2
+ import { Box } from '@expo/ui/jetpack-compose';
3
+ import React, { memo, useMemo } from 'react';
4
+ import { colors } from '../../../../libs/components/Gradient';
5
+ export default memo(({ color, size, selectedColor, onSelectColor, }) => {
6
+ const modifiers = useMemo(() => [
7
+ sizeModifier(size, size),
8
+ clip({ type: 'circle' }),
9
+ background(colors[color].middle),
10
+ border(1, colors[color].light),
11
+ clickable(() => onSelectColor?.(color))
12
+ ], []);
13
+ return <Box modifiers={modifiers}/>;
14
+ });
@@ -6,9 +6,9 @@ export default memo(({ onSelectColor, ...restProps }) => {
6
6
  const router = useRouter();
7
7
  const listColors = useMemo(() => Object.keys(colors), []);
8
8
  const colorRows = useMemo(() => Array.from({ length: Math.ceil(listColors.length / 4) }, (_, i) => listColors.slice(i * 4, i * 4 + 4)), [listColors]);
9
- const _onSelectColor = useCallback((color) => {
9
+ const _onSelectColor = useCallback(async (color) => {
10
+ await onSelectColor?.(color);
10
11
  router.back();
11
- onSelectColor?.(color);
12
12
  }, [onSelectColor]);
13
13
  return (<>
14
14
  <Stack.Screen.Title>Color de fondo</Stack.Screen.Title>
@@ -51,34 +51,34 @@ function Component({ data = [], renderItem, onSave, }) {
51
51
  isUniqueItem: (data?.length ?? 0) === 1,
52
52
  textFieldsRefs
53
53
  }), []);
54
- return (<>
55
- <Stack.Toolbar placement="left">
56
- <Stack.Toolbar.Button onPress={() => router.back()}>
57
- <Stack.Toolbar.Icon sf="xmark"/>
58
- </Stack.Toolbar.Button>
59
- </Stack.Toolbar>
60
-
61
- <Stack.Toolbar placement="right">
62
- <Stack.Toolbar.Button disabled={!saveEnabled} variant="done" onPress={onPressSave}>
63
- <Stack.Toolbar.Icon sf="checkmark"/>
64
- </Stack.Toolbar.Button>
65
- </Stack.Toolbar>
66
-
67
- <Host style={{ flex: 1 }}>
68
- <List>
69
- <Section>
70
- <Provider value={value}>
54
+ return (<>
55
+ <Stack.Toolbar placement="left">
56
+ <Stack.Toolbar.Button onPress={() => router.back()}>
57
+ <Stack.Toolbar.Icon sf="xmark"/>
58
+ </Stack.Toolbar.Button>
59
+ </Stack.Toolbar>
60
+
61
+ <Stack.Toolbar placement="right">
62
+ <Stack.Toolbar.Button disabled={!saveEnabled} variant="done" onPress={onPressSave}>
63
+ <Stack.Toolbar.Icon sf="checkmark"/>
64
+ </Stack.Toolbar.Button>
65
+ </Stack.Toolbar>
66
+
67
+ <Host style={{ flex: 1 }}>
68
+ <List>
69
+ <Section>
70
+ <Provider value={value}>
71
71
  {data.map((item, index) => {
72
72
  const nextIndex = index + 1;
73
73
  const value = { index, nextIndex: nextIndex < data.length ? nextIndex : undefined };
74
- return (<ItemProvider key={index} value={value}>
75
- {renderItem?.(item)}
74
+ return (<ItemProvider key={index} value={value}>
75
+ {renderItem?.(item)}
76
76
  </ItemProvider>);
77
- })}
78
- </Provider>
79
- </Section>
80
- </List>
81
- </Host>
77
+ })}
78
+ </Provider>
79
+ </Section>
80
+ </List>
81
+ </Host>
82
82
  </>);
83
83
  }
84
84
  export default memo(Component);
@@ -9,6 +9,7 @@ declare const supabase: {
9
9
  getUser: () => Promise<import("@supabase/auth-js").User>;
10
10
  execFunction: (params: import("../../utils/types").ExecFunctionParams) => Promise<any>;
11
11
  signUp: (params: import("../../utils/types").SignUpParams) => Promise<import("@supabase/auth-js").AuthResponse>;
12
+ updateMyUser: (params: import("../../utils/types").UpdateMyUserParams) => Promise<import("@supabase/auth-js").UserResponse>;
12
13
  client: import("@supabase/supabase-js").SupabaseClient<any, "public", "public", any, any>;
13
14
  };
14
15
  export default supabase;
@@ -9,3 +9,4 @@ export declare const logOut: () => Promise<{
9
9
  export declare const getUser: () => Promise<import("@supabase/auth-js").User>;
10
10
  export declare const execFunction: (params: utils.types.ExecFunctionParams) => Promise<any>;
11
11
  export declare const signUp: (params: utils.types.SignUpParams) => Promise<import("@supabase/auth-js").AuthResponse>;
12
+ export declare const updateMyUser: (params: utils.types.UpdateMyUserParams) => Promise<import("@supabase/auth-js").UserResponse>;
@@ -7,3 +7,4 @@ export const logOut = async () => await utils.logOut(supabase);
7
7
  export const getUser = async () => await utils.getUser(supabase);
8
8
  export const execFunction = async (params) => (await utils.execFunction(supabase, params));
9
9
  export const signUp = async (params) => (await utils.signUp(supabase, params));
10
+ export const updateMyUser = async (params) => (await utils.updateMyUser(supabase, params));
@@ -1,5 +1,5 @@
1
1
  import { SupabaseClient } from '@supabase/supabase-js';
2
- import type { CreateClientParams, SignUpParams, ExecFunctionParams, LogInParams, UpdateUserParams, NewUserParams } from './types';
2
+ import type { CreateClientParams, SignUpParams, ExecFunctionParams, LogInParams, UpdateUserParams, NewUserParams, UpdateMyUserParams } from './types';
3
3
  export * as types from './types';
4
4
  export declare const logIn: (supabase: SupabaseClient, params: LogInParams) => Promise<import("@supabase/auth-js").AuthTokenResponsePassword>;
5
5
  export declare const logOut: (supabase: SupabaseClient) => Promise<{
@@ -8,6 +8,7 @@ export declare const logOut: (supabase: SupabaseClient) => Promise<{
8
8
  export declare const getUser: (supabase: SupabaseClient) => Promise<import("@supabase/auth-js").User>;
9
9
  export declare const createClient: ({ url, key, options }: CreateClientParams) => SupabaseClient<any, "public", "public", any, any>;
10
10
  export declare const execFunction: (supabase: SupabaseClient, { schema, name, args }: ExecFunctionParams) => Promise<any | null>;
11
+ export declare const updateMyUser: (supabase: SupabaseClient, attributes: UpdateMyUserParams) => Promise<import("@supabase/auth-js").UserResponse>;
11
12
  export declare const getUserById: (supabase: SupabaseClient, { uid }: {
12
13
  uid: string;
13
14
  }) => Promise<import("@supabase/auth-js").UserResponse>;
@@ -15,6 +15,7 @@ export const execFunction = async (supabase, { schema = 'app', name, args }) =>
15
15
  }
16
16
  return data;
17
17
  };
18
+ export const updateMyUser = async (supabase, attributes) => (await supabase.auth.updateUser(attributes));
18
19
  export const getUserById = async (supabase, { uid }) => (await supabase.auth.admin.getUserById(uid));
19
20
  export const updateUser = async (supabase, { uid, attributes }) => (await supabase.auth.admin.updateUserById(uid, attributes));
20
21
  export const deleteUser = async (supabase, { uid }) => (await supabase.auth.admin.deleteUser(uid));
@@ -1,4 +1,4 @@
1
- import { AdminUserAttributes, SignUpWithPasswordCredentials, SupabaseClientOptions } from '@supabase/supabase-js';
1
+ import { AdminUserAttributes, SignUpWithPasswordCredentials, SupabaseClientOptions, UserAttributes } from '@supabase/supabase-js';
2
2
  export type LogInParams = {
3
3
  email: string;
4
4
  password: string;
@@ -13,6 +13,7 @@ export type ExecFunctionParams = {
13
13
  name: string;
14
14
  args?: Record<string, any>;
15
15
  };
16
+ export type UpdateMyUserParams = UserAttributes;
16
17
  export type UpdateUserParams = {
17
18
  uid: string;
18
19
  attributes: AdminUserAttributes;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "native-pytech",
3
- "version": "1.0.78",
3
+ "version": "1.0.80",
4
4
  "description": "Libreria de React Native Pytech",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",