@planningcenter/chat-react-native 1.4.2-rc.1 → 1.4.2
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/build/components/display/avatar.d.ts +10 -0
- package/build/components/display/avatar.d.ts.map +1 -0
- package/build/components/display/avatar.js +11 -0
- package/build/components/display/avatar.js.map +1 -0
- package/build/components/display/avatar_group.d.ts +9 -0
- package/build/components/display/avatar_group.d.ts.map +1 -0
- package/build/components/display/avatar_group.js +11 -0
- package/build/components/display/avatar_group.js.map +1 -0
- package/build/components/display/heading.d.ts +8 -0
- package/build/components/display/heading.d.ts.map +1 -0
- package/build/components/display/heading.js +53 -0
- package/build/components/display/heading.js.map +1 -0
- package/build/components/display/image.d.ts +10 -3
- package/build/components/display/image.d.ts.map +1 -1
- package/build/components/display/image.js +7 -5
- package/build/components/display/image.js.map +1 -1
- package/build/components/display/index.d.ts +4 -1
- package/build/components/display/index.d.ts.map +1 -1
- package/build/components/display/index.js +4 -1
- package/build/components/display/index.js.map +1 -1
- package/build/components/display/text.d.ts +1 -1
- package/build/components/display/text.d.ts.map +1 -1
- package/build/components/display/text.js +7 -6
- package/build/components/display/text.js.map +1 -1
- package/build/components/error_boundary.d.ts +1 -1
- package/build/components/primitive/avatar_primitive.d.ts +39 -0
- package/build/components/primitive/avatar_primitive.d.ts.map +1 -0
- package/build/components/primitive/avatar_primitive.js +204 -0
- package/build/components/primitive/avatar_primitive.js.map +1 -0
- package/build/contexts/api_provider.d.ts.map +1 -1
- package/build/contexts/api_provider.js +3 -14
- package/build/contexts/api_provider.js.map +1 -1
- package/build/contexts/chat_context.js +2 -2
- package/build/contexts/chat_context.js.map +1 -1
- package/build/index.js.map +1 -1
- package/build/screens/display.d.ts.map +1 -1
- package/build/screens/display.js +51 -10
- package/build/screens/display.js.map +1 -1
- package/build/utils/api.d.ts +9 -0
- package/build/utils/api.d.ts.map +1 -0
- package/build/utils/api.js +36 -0
- package/build/utils/api.js.map +1 -0
- package/build/utils/platform_styles.d.ts +2 -0
- package/build/utils/platform_styles.d.ts.map +1 -0
- package/build/utils/platform_styles.js +7 -0
- package/build/utils/platform_styles.js.map +1 -0
- package/build/utils/space.d.ts +3 -0
- package/build/utils/space.d.ts.map +1 -0
- package/build/utils/space.js +22 -0
- package/build/utils/space.js.map +1 -0
- package/build/utils/theme.d.ts +2 -2
- package/build/utils/theme.d.ts.map +1 -1
- package/build/utils/theme.js +2 -2
- package/build/utils/theme.js.map +1 -1
- package/build/vendor/tapestry/alias_tokens_color_map.d.ts +55 -0
- package/build/vendor/tapestry/alias_tokens_color_map.d.ts.map +1 -0
- package/build/vendor/tapestry/{tapestry_alias_tokens_color_map.js → alias_tokens_color_map.js} +4 -2
- package/build/vendor/tapestry/alias_tokens_color_map.js.map +1 -0
- package/build/vendor/tapestry/tokens.d.ts +49 -35
- package/build/vendor/tapestry/tokens.d.ts.map +1 -1
- package/build/vendor/tapestry/tokens.js +18 -0
- package/build/vendor/tapestry/tokens.js.map +1 -1
- package/package.json +8 -9
- package/src/__mocks__/@react-native-async-storage/async-storage.js +3 -0
- package/src/__mocks__/react-native-device-info.js +3 -0
- package/src/__tests__/hooks/useTheme.tsx +37 -0
- package/src/__tests__/utils/space.tsx +60 -0
- package/src/components/display/avatar.tsx +23 -0
- package/src/components/display/avatar_group.tsx +21 -0
- package/src/components/display/heading.tsx +71 -0
- package/src/components/display/image.tsx +20 -8
- package/src/components/display/index.ts +4 -1
- package/src/components/display/text.tsx +7 -6
- package/src/components/primitive/avatar_primitive.tsx +374 -0
- package/src/contexts/api_provider.tsx +4 -17
- package/src/contexts/chat_context.tsx +2 -2
- package/src/index.tsx +0 -1
- package/src/screens/display.tsx +52 -13
- package/src/utils/api.ts +47 -0
- package/src/utils/platform_styles.ts +7 -0
- package/src/utils/space.ts +39 -0
- package/src/utils/theme.ts +3 -3
- package/src/vendor/tapestry/{tapestry_alias_tokens_color_map.ts → alias_tokens_color_map.ts} +8 -5
- package/src/vendor/tapestry/tokens.ts +25 -50
- package/build/vendor/tapestry/tapestry_alias_tokens_color_map.d.ts +0 -53
- package/build/vendor/tapestry/tapestry_alias_tokens_color_map.d.ts.map +0 -1
- package/build/vendor/tapestry/tapestry_alias_tokens_color_map.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"avatar_primitive.js","sourceRoot":"","sources":["../../../src/components/primitive/avatar_primitive.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC7E,OAAO,EAAE,UAAU,EAAE,IAAI,EAAa,MAAM,cAAc,CAAA;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,KAAK,EAAc,MAAM,kBAAkB,CAAA;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAE5C,oCAAoC;AACpC,oCAAoC;AACpC,oCAAoC;AAEpC,MAAM,MAAM,GAAG;IACb,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,WAAW;IAClB,QAAQ,EAAE,cAAc;IACxB,KAAK,EAAE,WAAW;IAClB,WAAW,EAAE,iBAAiB;IAC9B,IAAI,EAAE,UAAU;CACR,CAAA;AAWV,eAAe,MAA0B,CAAA;AASzC,oCAAoC;AACpC,oCAAoC;AACpC,oCAAoC;AAEpC,MAAM,YAAY,GAAG;IACnB,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;CACA,CAAA;AAEV,MAAM,qBAAqB,GAAG;IAC5B,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;CACV,CAAA;AAMV,MAAM,SAAS,GAA+B;IAC5C,CAAC,YAAY,CAAC,EAAE,CAAC,EAAE,EAAE;IACrB,CAAC,YAAY,CAAC,EAAE,CAAC,EAAE,EAAE;CACtB,CAAA;AAED,MAAM,kBAAkB,GAA+B;IACrD,CAAC,YA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b,MAAM,EAAE,MAAM;SACf;QACD,QAAQ,EAAE;YACR,MAAM,EAAE,gBAAgB;YACxB,KAAK,EAAE,gBAAgB;YACvB,eAAe,EAAE,cAAc,CAAC,QAAQ,CAAC;YACzC,WAAW,EAAE,MAAM,CAAC,2BAA2B;YAC/C,WAAW,EAAE,CAAC;YACd,YAAY,EAAE,gBAAgB;YAC9B,QAAQ,EAAE,UAAU;YACpB,MAAM,EAAE,CAAC,CAAC;YACV,KAAK,EAAE,CAAC,CAAC;SACV;QACD,WAAW,EAAE;YACX,QAAQ,EAAE,UAAU;YACpB,GAAG,EAAE,CAAC;YACN,IAAI,EAAE,CAAC;YACP,YAAY,EAAE,cAAc;YAC5B,KAAK,EAAE,cAAc;YACrB,MAAM,EAAE,cAAc;SACvB;QACD,WAAW,EAAE;YACX,IAAI,EAAE,CAAC;YACP,GAAG,EAAE,QAAQ;SACd;QACD,QAAQ,EAAE;YACR,aAAa,EAAE,KAAK;YACpB,IAAI,EAAE,CAAC;YACP,GAAG,EAAE,QAAQ;SACd;QACD,mBAAmB,EAAE;YACnB,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,MAAM;SACf;QACD,mBAAmB,EAAE;YACnB,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,KAAK;SACd;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React, { createContext, useContext, useEffect, useState } from 'react'\nimport { StyleSheet, View, ViewProps } from 'react-native'\nimport { useTheme } from '../../hooks'\nimport { Image, ImageProps } from '../display/image'\nimport { Spinner } from '../display/spinner'\n\n// =================================\n// ====== Exports ==================\n// =================================\n\nconst Avatar = {\n Root: AvatarRoot,\n Image: AvatarImage,\n Presence: AvatarPresence,\n Group: AvatarGroup,\n GroupLoader: AvatarGroupLoader,\n Mask: AvatarMask,\n} as const\n\ntype AvatarComponents = {\n Root: React.FC<AvatarRootProps>\n Image: React.FC<AvatarImageProps>\n Presence: React.FC<AvatarPresenceProps>\n Group: React.FC<AvatarGroupProps>\n GroupLoader: React.FC<Record<string, never>>\n Mask: React.FC<AvatarMaskProps>\n}\n\nexport default Avatar as AvatarComponents\nexport type {\n AvatarImageProps,\n AvatarPresenceProps,\n AvatarGroupProps,\n AvatarMaskProps,\n AvatarRootProps,\n}\n\n// =================================\n// ====== Constants & Types ========\n// =================================\n\nconst AVATAR_SIZES = {\n md: 'md',\n lg: 'lg',\n} as const\n\nconst AVATAR_PRESENCE_TYPES = {\n online: 'online',\n offline: 'offline',\n} as const\n\n// Progrmatically creates type unions\ntype AvatarSize = (typeof AVATAR_SIZES)[keyof typeof AVATAR_SIZES]\ntype AvatarPresenceType = (typeof AVATAR_PRESENCE_TYPES)[keyof typeof AVATAR_PRESENCE_TYPES]\n\nconst AVATAR_PX: Record<AvatarSize, number> = {\n [AVATAR_SIZES.md]: 32,\n [AVATAR_SIZES.lg]: 40,\n}\n\nconst AVATAR_PRESENCE_PX: Record<AvatarSize, number> = {\n [AVATAR_SIZES.md]: 12,\n [AVATAR_SIZES.lg]: 14,\n}\n\n// =================================\n// ====== Context ==================\n// =================================\n\ninterface AvatarContextType {\n size: AvatarSize\n allImagesLoaded: boolean\n setAllImagesLoaded: React.Dispatch<React.SetStateAction<boolean>>\n}\n\nconst AvatarContext = createContext<AvatarContextType | null>(null)\n\nfunction useAvatarContext() {\n const context = useContext(AvatarContext)\n if (!context) {\n throw new Error('Avatar components must be used within Avatar.Root')\n }\n return context\n}\n\n// =================================\n// ====== AvatarRoot ===============\n// =================================\n\ninterface AvatarRootProps {\n children: React.ReactNode\n size?: AvatarSize\n}\n\nfunction AvatarRoot({ children, size = 'md' }: AvatarRootProps) {\n const [allImagesLoaded, setAllImagesLoaded] = useState(false)\n const styles = useStyles(size)\n\n return (\n <AvatarContext.Provider value={{ size, allImagesLoaded, setAllImagesLoaded }}>\n <View style={styles.rootContainer}>{children}</View>\n </AvatarContext.Provider>\n )\n}\n\nAvatarRoot.displayName = 'Avatar.Root'\n\n// =================================\n// ====== AvatarMask ===============\n// =================================\n\ntype AvatarMaskProps = ViewProps\n\nfunction AvatarMask({ children, ...props }: AvatarMaskProps) {\n const styles = useStyles()\n\n return (\n <View style={styles.mask} {...props}>\n {children}\n </View>\n )\n}\n\nAvatarMask.displayName = 'Avatar.Mask'\n\n// =================================\n// ====== AvatarImage ============\n// =================================\n\ninterface AvatarImageProps extends Omit<ImageProps, 'source'> {\n sourceUri: string\n}\n\nfunction AvatarImage({ sourceUri, ...props }: AvatarImageProps) {\n const { size } = useAvatarContext()\n\n return <Image source={{ uri: sourceUri }} loaderSize={AVATAR_PX[size]} {...props} />\n}\n\nAvatarImage.displayName = 'Avatar.Image'\n\ninterface AvatarGroupImageProps {\n sourceUri: string\n style?: ImageProps['wrapperStyle']\n onLoad?: () => void\n}\n\nfunction AvatarGroupImage({ sourceUri, style, onLoad }: AvatarGroupImageProps) {\n return (\n <Image\n source={{ uri: sourceUri }}\n loadingEnabled={false}\n wrapperStyle={style}\n onLoad={onLoad}\n />\n )\n}\n\n// =================================\n// ====== AvatarGroup ============\n// =================================\n\ninterface AvatarGroupProps {\n sourceUris: string[]\n}\n\nfunction AvatarGroup({ sourceUris }: AvatarGroupProps) {\n const styles = useStyles()\n const { setAllImagesLoaded } = useAvatarContext()\n const [loadingStatus, setLoadingStatus] = useState({\n 0: false,\n 1: false,\n 2: false,\n 3: false,\n })\n const displayUris = sourceUris.slice(0, 4)\n const hasDisplayUris = displayUris.length > 0\n\n const handleImageLoaded = index => {\n setLoadingStatus(prev => ({\n ...prev,\n [index]: true,\n }))\n }\n\n useEffect(() => {\n const allImagesLoaded =\n hasDisplayUris && displayUris.every((_, index) => loadingStatus[index] === true)\n\n setAllImagesLoaded(allImagesLoaded)\n }, [displayUris, hasDisplayUris, loadingStatus, setAllImagesLoaded])\n\n if (!hasDisplayUris) {\n return null\n }\n\n if (displayUris.length === 1) {\n return <AvatarGroupImage sourceUri={displayUris[0]} onLoad={() => handleImageLoaded(0)} />\n }\n\n if (displayUris.length === 2) {\n return (\n <View style={styles.groupRow}>\n <AvatarGroupImage\n sourceUri={displayUris[0]}\n style={styles.halfWidthFullHeight}\n onLoad={() => handleImageLoaded(0)}\n />\n <AvatarGroupImage\n sourceUri={displayUris[1]}\n style={styles.halfWidthFullHeight}\n onLoad={() => handleImageLoaded(1)}\n />\n </View>\n )\n }\n\n if (displayUris.length === 3) {\n return (\n <View style={styles.groupColumn}>\n <View style={styles.groupRow}>\n <AvatarGroupImage\n sourceUri={displayUris[0]}\n style={styles.halfWidthFullHeight}\n onLoad={() => handleImageLoaded(0)}\n />\n <View style={styles.groupColumn}>\n <AvatarGroupImage\n sourceUri={displayUris[1]}\n style={styles.fullWidthHalfHeight}\n onLoad={() => handleImageLoaded(1)}\n />\n <AvatarGroupImage\n sourceUri={displayUris[2]}\n style={styles.fullWidthHalfHeight}\n onLoad={() => handleImageLoaded(2)}\n />\n </View>\n </View>\n </View>\n )\n }\n\n return (\n <View style={styles.groupColumn}>\n <View style={styles.groupRow}>\n <AvatarGroupImage\n sourceUri={displayUris[0]}\n style={styles.halfWidthFullHeight}\n onLoad={() => handleImageLoaded(0)}\n />\n <AvatarGroupImage\n sourceUri={displayUris[1]}\n style={styles.halfWidthFullHeight}\n onLoad={() => handleImageLoaded(1)}\n />\n </View>\n <View style={styles.groupRow}>\n <AvatarGroupImage\n sourceUri={displayUris[2]}\n style={styles.halfWidthFullHeight}\n onLoad={() => handleImageLoaded(2)}\n />\n <AvatarGroupImage\n sourceUri={displayUris[3]}\n style={styles.halfWidthFullHeight}\n onLoad={() => handleImageLoaded(3)}\n />\n </View>\n </View>\n )\n}\n\nAvatarGroup.displayName = 'Avatar.Group'\n\n// =================================\n// ====== AvatarGroupLoader =========\n// =================================\n\nfunction AvatarGroupLoader() {\n const { size, allImagesLoaded } = useAvatarContext()\n const styles = useStyles(size)\n\n if (allImagesLoaded) return null\n\n return (\n <View style={styles.groupLoader}>\n <Spinner size={AVATAR_PX[size]} />\n </View>\n )\n}\n\nAvatarGroupLoader.displayName = 'Avatar.GroupLoader'\n\n// =================================\n// ====== AvatarPresence =========\n// =================================\n\ninterface AvatarPresenceProps extends ViewProps {\n presence: AvatarPresenceType\n}\n\nfunction AvatarPresence({ presence, ...props }: AvatarPresenceProps) {\n const { size } = useAvatarContext()\n const styles = useStyles(size, presence)\n\n return <View style={styles.presence} {...props} />\n}\n\nAvatarPresence.displayName = 'Avatar.Presence'\n\n// =================================\n// ====== Styles ===================\n// =================================\n\nconst useStyles = (size: AvatarSize = 'md', presence: AvatarPresenceType = 'offline') => {\n const { colors } = useTheme()\n const PRESENCE_COLOR = {\n online: colors.fillColorInteractionOnlineDefault,\n offline: colors.iconColorDefaultDisabled,\n }\n const presenceDiameter = AVATAR_PRESENCE_PX[size]\n const avatarDiameter = AVATAR_PX[size]\n const groupGap = 1\n\n return StyleSheet.create({\n rootContainer: {\n height: avatarDiameter,\n width: avatarDiameter,\n },\n mask: {\n borderRadius: avatarDiameter,\n overflow: 'hidden',\n width: '100%',\n height: '100%',\n },\n presence: {\n height: presenceDiameter,\n width: presenceDiameter,\n backgroundColor: PRESENCE_COLOR[presence],\n borderColor: colors.fillColorNeutral100Inverted,\n borderWidth: 2,\n borderRadius: presenceDiameter,\n position: 'absolute',\n bottom: -1,\n right: -1,\n },\n groupLoader: {\n position: 'absolute',\n top: 0,\n left: 0,\n borderRadius: avatarDiameter,\n width: avatarDiameter,\n height: avatarDiameter,\n },\n groupColumn: {\n flex: 1,\n gap: groupGap,\n },\n groupRow: {\n flexDirection: 'row',\n flex: 1,\n gap: groupGap,\n },\n halfWidthFullHeight: {\n width: '50%',\n height: '100%',\n },\n fullWidthHalfHeight: {\n width: '100%',\n height: '50%',\n },\n })\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api_provider.d.ts","sourceRoot":"","sources":["../../src/contexts/api_provider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"api_provider.d.ts","sourceRoot":"","sources":["../../src/contexts/api_provider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAiC,MAAM,uBAAuB,CAAA;AAClF,OAAO,KAAoB,MAAM,OAAO,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAErC,OAAO,EAAE,GAAG,EAAW,MAAM,kBAAkB,CAAA;AAqB/C,eAAO,MAAM,WAAW,aAMtB,CAAA;AAEF,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,GAAkB,EAClB,KAAK,EACL,cAAc,GACf,EAAE,SAAS,GAAG;IAAE,GAAG,CAAC,EAAE,GAAG,CAAC;IAAC,KAAK,CAAC,EAAE,UAAU,CAAC;IAAC,cAAc,EAAE,MAAM,IAAI,CAAA;CAAE,qBAU3E"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
2
2
|
import React, { useEffect } from 'react';
|
|
3
|
+
import apiRequest from '../utils/api';
|
|
3
4
|
import { session } from '../utils/session';
|
|
4
5
|
let handleTokenExpired;
|
|
5
6
|
const defaultQueryFn = ({ queryKey }) => {
|
|
@@ -7,13 +8,8 @@ const defaultQueryFn = ({ queryKey }) => {
|
|
|
7
8
|
throw new Error('No token present');
|
|
8
9
|
}
|
|
9
10
|
const url = `${session.baseUrl}${queryKey[0]}`;
|
|
10
|
-
return
|
|
11
|
-
|
|
12
|
-
Authorization: `Bearer ${session.token?.access_token}`,
|
|
13
|
-
},
|
|
14
|
-
})
|
|
15
|
-
.then(validateResponse)
|
|
16
|
-
.then(response => response.json())
|
|
11
|
+
return apiRequest(url)
|
|
12
|
+
.then(r => r.json)
|
|
17
13
|
.catch(error => {
|
|
18
14
|
if (error.message === 'Token expired') {
|
|
19
15
|
handleTokenExpired();
|
|
@@ -37,11 +33,4 @@ export function ApiProvider({ children, env = 'production', token, onTokenExpire
|
|
|
37
33
|
}, [env, token]);
|
|
38
34
|
return <QueryClientProvider client={queryClient}>{children}</QueryClientProvider>;
|
|
39
35
|
}
|
|
40
|
-
const validateResponse = (response) => {
|
|
41
|
-
const isExpired = response.status === 401;
|
|
42
|
-
if (isExpired) {
|
|
43
|
-
throw new Error('Token expired');
|
|
44
|
-
}
|
|
45
|
-
return response;
|
|
46
|
-
};
|
|
47
36
|
//# sourceMappingURL=api_provider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api_provider.js","sourceRoot":"","sources":["../../src/contexts/api_provider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"api_provider.js","sourceRoot":"","sources":["../../src/contexts/api_provider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAY,MAAM,uBAAuB,CAAA;AAClF,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGxC,OAAO,UAAU,MAAM,cAAc,CAAA;AACrC,OAAO,EAAO,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAE/C,IAAI,kBAA8B,CAAA;AAElC,MAAM,cAAc,GAAG,CAAC,EAAE,QAAQ,EAA0B,EAAE,EAAE;IAC9D,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QACnB,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAA;IACrC,CAAC;IAED,MAAM,GAAG,GAAG,GAAG,OAAO,CAAC,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAA;IAE9C,OAAO,UAAU,CAAkB,GAAG,CAAC;SACpC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;SACjB,KAAK,CAAC,KAAK,CAAC,EAAE;QACb,IAAI,KAAK,CAAC,OAAO,KAAK,eAAe,EAAE,CAAC;YACtC,kBAAkB,EAAE,CAAA;QACtB,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC,CAAC,CAAA;AACN,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC;IACzC,cAAc,EAAE;QACd,OAAO,EAAE;YACP,OAAO,EAAE,cAAc;SACxB;KACF;CACF,CAAC,CAAA;AAEF,MAAM,UAAU,WAAW,CAAC,EAC1B,QAAQ,EACR,GAAG,GAAG,YAAY,EAClB,KAAK,EACL,cAAc,GAC4D;IAC1E,OAAO,CAAC,GAAG,GAAG,GAAG,CAAA;IACjB,OAAO,CAAC,KAAK,GAAG,KAAK,CAAA;IACrB,kBAAkB,GAAG,cAAc,CAAA;IAEnC,SAAS,CAAC,GAAG,EAAE;QACb,WAAW,CAAC,iBAAiB,EAAE,CAAA;IACjC,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAA;IAEhB,OAAO,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,mBAAmB,CAAC,CAAA;AACnF,CAAC","sourcesContent":["import { JSONAPIResponse } from '@planningcenter/chat-core'\nimport { QueryClient, QueryClientProvider, QueryKey } from '@tanstack/react-query'\nimport React, { useEffect } from 'react'\nimport { ViewProps } from 'react-native'\nimport { OAuthToken } from '../types'\nimport apiRequest from '../utils/api'\nimport { ENV, session } from '../utils/session'\n\nlet handleTokenExpired: () => void\n\nconst defaultQueryFn = ({ queryKey }: { queryKey: QueryKey }) => {\n if (!session.token) {\n throw new Error('No token present')\n }\n\n const url = `${session.baseUrl}${queryKey[0]}`\n\n return apiRequest<JSONAPIResponse>(url)\n .then(r => r.json)\n .catch(error => {\n if (error.message === 'Token expired') {\n handleTokenExpired()\n }\n return null\n })\n}\n\nexport const queryClient = new QueryClient({\n defaultOptions: {\n queries: {\n queryFn: defaultQueryFn,\n },\n },\n})\n\nexport function ApiProvider({\n children,\n env = 'production',\n token,\n onTokenExpired,\n}: ViewProps & { env?: ENV; token?: OAuthToken; onTokenExpired: () => void }) {\n session.env = env\n session.token = token\n handleTokenExpired = onTokenExpired\n\n useEffect(() => {\n queryClient.invalidateQueries()\n }, [env, token])\n\n return <QueryClientProvider client={queryClient}>{children}</QueryClientProvider>\n}\n"]}
|
|
@@ -2,7 +2,7 @@ import { merge } from 'lodash';
|
|
|
2
2
|
import React, { createContext, useMemo } from 'react';
|
|
3
3
|
import { useColorScheme } from 'react-native';
|
|
4
4
|
import { defaultTheme } from '../utils/theme';
|
|
5
|
-
import {
|
|
5
|
+
import { aliasTokensColorMap } from '../vendor/tapestry/alias_tokens_color_map';
|
|
6
6
|
import { ApiProvider } from './api_provider';
|
|
7
7
|
export const ChatContext = createContext({
|
|
8
8
|
theme: undefined,
|
|
@@ -28,7 +28,7 @@ export const useCreateChatTheme = ({ theme: customTheme = {}, colorScheme: appCo
|
|
|
28
28
|
...merge({}, defaultTheme(colorScheme), customTheme),
|
|
29
29
|
colors: {
|
|
30
30
|
...merge({}, defaultTheme(colorScheme).colors, customTheme?.colors),
|
|
31
|
-
...
|
|
31
|
+
...aliasTokensColorMap[colorScheme],
|
|
32
32
|
},
|
|
33
33
|
};
|
|
34
34
|
}, [colorScheme, customTheme]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat_context.js","sourceRoot":"","sources":["../../src/contexts/chat_context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAC9B,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AACrD,OAAO,EAAmB,cAAc,EAAE,MAAM,cAAc,CAAA;AAE9D,OAAO,EAAE,YAAY,EAAgB,MAAM,gBAAgB,CAAA;AAC3D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"chat_context.js","sourceRoot":"","sources":["../../src/contexts/chat_context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAC9B,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,OAAO,EAAE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AAM,WAAW,GAAG,cAAc,IAAI,mBAAmB,CAAA;IAEzD,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,EAAE;QACjC,OAAO;YACL,GAAG,KAAK,CAAC,EAAE,EAAE,YAAY,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC;YACpD,MAAM,EAAE;gBACN,GAAG,KAAK,CAAC,EAAE,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,CAAC;gBACnE,GAAG,mBAAmB,CAAC,WAAW,CAAC;aACpC;SACF,CAAA;IACH,CAAC,EAAE,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,CAAA;IAE9B,OAAO,aAAa,CAAA;AACtB,CAAC,CAAA","sourcesContent":["import { merge } from 'lodash'\nimport React, { createContext, useMemo } from 'react'\nimport { ColorSchemeName, useColorScheme } from 'react-native'\nimport { DeepPartial, OAuthToken } from '../types'\nimport { defaultTheme, DefaultTheme } from '../utils/theme'\nimport { aliasTokensColorMap } from '../vendor/tapestry/alias_tokens_color_map'\nimport { ApiProvider } from './api_provider'\n\ntype ContextValue = {\n token?: OAuthToken\n onTokenExpired: () => void\n theme: any\n env?: 'production' | 'staging' | 'development'\n}\n\nexport const ChatContext = createContext<ContextValue>({\n theme: undefined,\n token: undefined,\n env: undefined,\n onTokenExpired: () => {},\n})\n\nexport function ChatProvider({ children, value }: { children: any; value: ContextValue }) {\n const theme = useCreateChatTheme(value.theme)\n\n if (!Object.keys(value.token || {}).length) return null\n\n return (\n <ChatContext.Provider value={{ ...value, theme }}>\n <ApiProvider env={value.env} token={value.token} onTokenExpired={value.onTokenExpired}>\n {children}\n </ApiProvider>\n </ChatContext.Provider>\n )\n}\n\ninterface CreateChatThemeProps {\n theme?: DeepPartial<DefaultTheme>\n colorScheme?: ColorSchemeName\n}\n\nexport const useCreateChatTheme = ({\n theme: customTheme = {},\n colorScheme: appColorScheme,\n}: CreateChatThemeProps) => {\n const internalColorScheme = useColorScheme() || 'light'\n const colorScheme = appColorScheme || internalColorScheme\n\n const memoizedTheme = useMemo(() => {\n return {\n ...merge({}, defaultTheme(colorScheme), customTheme),\n colors: {\n ...merge({}, defaultTheme(colorScheme).colors, customTheme?.colors),\n ...aliasTokensColorMap[colorScheme],\n },\n }\n }, [colorScheme, customTheme])\n\n return memoizedTheme\n}\n"]}
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA","sourcesContent":["export * from './components'\nexport * from './contexts'\nexport * from './hooks'\nexport * from './screens'\nexport * from './utils'\n
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA","sourcesContent":["export * from './components'\nexport * from './contexts'\nexport * from './hooks'\nexport * from './screens'\nexport * from './utils'\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"display.d.ts","sourceRoot":"","sources":["../../src/screens/display.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"display.d.ts","sourceRoot":"","sources":["../../src/screens/display.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAyBzB,wBAAgB,aAAa,sBA8C5B"}
|
package/build/screens/display.js
CHANGED
|
@@ -1,7 +1,26 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ScrollView, StyleSheet, View } from 'react-native';
|
|
3
3
|
import { useTheme } from '../hooks';
|
|
4
|
-
import { Image, Spinner, Text } from '../components/display';
|
|
4
|
+
import { Avatar, AvatarGroup, Heading, Image, Spinner, Text } from '../components/display';
|
|
5
|
+
import { space } from '../utils/space';
|
|
6
|
+
const URL = {
|
|
7
|
+
image: 'https://picsum.photos/seed/picsum/200',
|
|
8
|
+
broken: 'https://broken.url',
|
|
9
|
+
avatar: 'https://i.pravatar.cc/200?img=22',
|
|
10
|
+
avatar_fallback: 'https://avatars.planningcenteronline.com/uploads/initials/PR.png',
|
|
11
|
+
two_avatars: ['https://i.pravatar.cc/200?img=22', 'https://i.pravatar.cc/200?img=23'],
|
|
12
|
+
three_avatars: [
|
|
13
|
+
'https://i.pravatar.cc/200?img=22',
|
|
14
|
+
'https://i.pravatar.cc/200?img=23',
|
|
15
|
+
'https://i.pravatar.cc/200?img=24',
|
|
16
|
+
],
|
|
17
|
+
four_avatars: [
|
|
18
|
+
'https://i.pravatar.cc/200?img=30',
|
|
19
|
+
'https://i.pravatar.cc/200?img=29',
|
|
20
|
+
'https://i.pravatar.cc/200?img=28',
|
|
21
|
+
'https://i.pravatar.cc/200?img=27',
|
|
22
|
+
],
|
|
23
|
+
};
|
|
5
24
|
export function DisplayScreen() {
|
|
6
25
|
const styles = useStyles();
|
|
7
26
|
return (<ScrollView contentContainerStyle={styles.container} style={styles.scrollView}>
|
|
@@ -10,10 +29,26 @@ export function DisplayScreen() {
|
|
|
10
29
|
<Spinner size={24}/>
|
|
11
30
|
</View>
|
|
12
31
|
<View style={styles.row}>
|
|
13
|
-
<Image source={{ uri:
|
|
14
|
-
<Image source={{
|
|
15
|
-
|
|
16
|
-
|
|
32
|
+
<Image source={{ uri: URL.broken }} style={styles.image}/>
|
|
33
|
+
<Image source={{ uri: URL.image }} style={styles.image}/>
|
|
34
|
+
</View>
|
|
35
|
+
<View style={styles.row}>
|
|
36
|
+
<Avatar sourceUri={URL.broken}/>
|
|
37
|
+
<Avatar size="md" sourceUri={URL.avatar_fallback}/>
|
|
38
|
+
<Avatar sourceUri={URL.avatar}/>
|
|
39
|
+
</View>
|
|
40
|
+
<View style={styles.row}>
|
|
41
|
+
<Avatar presence="offline" sourceUri={URL.broken}/>
|
|
42
|
+
<Avatar presence="online" size="md" sourceUri={URL.avatar_fallback}/>
|
|
43
|
+
<Avatar presence="offline" sourceUri={URL.avatar}/>
|
|
44
|
+
</View>
|
|
45
|
+
<View style={styles.row}>
|
|
46
|
+
<AvatarGroup sourceUris={[URL.broken]}/>
|
|
47
|
+
<AvatarGroup sourceUris={[URL.broken, URL.broken, ...URL.two_avatars]}/>
|
|
48
|
+
<AvatarGroup sourceUris={[URL.avatar]}/>
|
|
49
|
+
<AvatarGroup sourceUris={URL.two_avatars}/>
|
|
50
|
+
<AvatarGroup sourceUris={URL.three_avatars}/>
|
|
51
|
+
<AvatarGroup sourceUris={URL.four_avatars}/>
|
|
17
52
|
</View>
|
|
18
53
|
<View style={styles.row}>
|
|
19
54
|
<Text>Plain text</Text>
|
|
@@ -21,25 +56,31 @@ export function DisplayScreen() {
|
|
|
21
56
|
<Text variant="tertiary">Tertiary</Text>
|
|
22
57
|
<Text variant="footnote">Footnote</Text>
|
|
23
58
|
</View>
|
|
59
|
+
<View style={styles.row}>
|
|
60
|
+
<Heading>Heading 1</Heading>
|
|
61
|
+
<Heading variant="h2">Heading 2</Heading>
|
|
62
|
+
<Heading variant="h3">Heading 3</Heading>
|
|
63
|
+
<Heading variant="h4">Heading 4</Heading>
|
|
64
|
+
</View>
|
|
24
65
|
</View>
|
|
25
66
|
</ScrollView>);
|
|
26
67
|
}
|
|
27
68
|
const useStyles = () => {
|
|
28
69
|
const { colors } = useTheme();
|
|
29
70
|
return StyleSheet.create({
|
|
30
|
-
scrollView: { flex: 1, backgroundColor: colors.
|
|
31
|
-
container: { gap:
|
|
71
|
+
scrollView: { flex: 1, backgroundColor: colors.fillColorNeutral100Inverted },
|
|
72
|
+
container: { gap: space(2), padding: space(3) },
|
|
32
73
|
listItem: { color: colors.fillColorNeutral020 },
|
|
33
74
|
row: {
|
|
34
|
-
gap:
|
|
75
|
+
gap: space(2),
|
|
35
76
|
flexDirection: 'row',
|
|
36
77
|
alignItems: 'center',
|
|
37
78
|
justifyContent: 'center',
|
|
38
79
|
flexWrap: 'wrap',
|
|
39
80
|
},
|
|
40
|
-
column: { gap:
|
|
81
|
+
column: { gap: space(4) },
|
|
41
82
|
spinnerContainer: {
|
|
42
|
-
height:
|
|
83
|
+
height: space(2.5),
|
|
43
84
|
},
|
|
44
85
|
image: {
|
|
45
86
|
width: 100,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"display.js","sourceRoot":"","sources":["../../src/screens/display.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"display.js","sourceRoot":"","sources":["../../src/screens/display.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAC1F,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAEtC,MAAM,GAAG,GAAG;IACV,KAAK,EAAE,uCAAuC;IAC9C,MAAM,EAAE,oBAAoB;IAC5B,MAAM,EAAE,kCAAkC;IAC1C,eAAe,EAAE,kEAAkE;IACnF,WAAW,EAAE,CAAC,kCAAkC,EAAE,kCAAkC,CAAC;IACrF,a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AQ,EAAE,MAAM;SACjB;QACD,MAAM,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE;QACzB,gBAAgB,EAAE;YAChB,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC;SACnB;QACD,KAAK,EAAE;YACL,KAAK,EAAE,GAAG;YACV,MAAM,EAAE,GAAG;SACZ;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { ScrollView, StyleSheet, View } from 'react-native'\nimport { useTheme } from '../hooks'\nimport { Avatar, AvatarGroup, Heading, Image, Spinner, Text } from '../components/display'\nimport { space } from '../utils/space'\n\nconst URL = {\n image: 'https://picsum.photos/seed/picsum/200',\n broken: 'https://broken.url',\n avatar: 'https://i.pravatar.cc/200?img=22',\n avatar_fallback: 'https://avatars.planningcenteronline.com/uploads/initials/PR.png',\n two_avatars: ['https://i.pravatar.cc/200?img=22', 'https://i.pravatar.cc/200?img=23'],\n three_avatars: [\n 'https://i.pravatar.cc/200?img=22',\n 'https://i.pravatar.cc/200?img=23',\n 'https://i.pravatar.cc/200?img=24',\n ],\n four_avatars: [\n 'https://i.pravatar.cc/200?img=30',\n 'https://i.pravatar.cc/200?img=29',\n 'https://i.pravatar.cc/200?img=28',\n 'https://i.pravatar.cc/200?img=27',\n ],\n}\n\nexport function DisplayScreen() {\n const styles = useStyles()\n\n return (\n <ScrollView contentContainerStyle={styles.container} style={styles.scrollView}>\n <View style={styles.column}>\n <View style={[styles.row, styles.spinnerContainer]}>\n <Spinner size={24} />\n </View>\n <View style={styles.row}>\n <Image source={{ uri: URL.broken }} style={styles.image} />\n <Image source={{ uri: URL.image }} style={styles.image} />\n </View>\n <View style={styles.row}>\n <Avatar sourceUri={URL.broken} />\n <Avatar size=\"md\" sourceUri={URL.avatar_fallback} />\n <Avatar sourceUri={URL.avatar} />\n </View>\n <View style={styles.row}>\n <Avatar presence=\"offline\" sourceUri={URL.broken} />\n <Avatar presence=\"online\" size=\"md\" sourceUri={URL.avatar_fallback} />\n <Avatar presence=\"offline\" sourceUri={URL.avatar} />\n </View>\n <View style={styles.row}>\n <AvatarGroup sourceUris={[URL.broken]} />\n <AvatarGroup sourceUris={[URL.broken, URL.broken, ...URL.two_avatars]} />\n <AvatarGroup sourceUris={[URL.avatar]} />\n <AvatarGroup sourceUris={URL.two_avatars} />\n <AvatarGroup sourceUris={URL.three_avatars} />\n <AvatarGroup sourceUris={URL.four_avatars} />\n </View>\n <View style={styles.row}>\n <Text>Plain text</Text>\n <Text variant=\"secondary\">Secondary</Text>\n <Text variant=\"tertiary\">Tertiary</Text>\n <Text variant=\"footnote\">Footnote</Text>\n </View>\n <View style={styles.row}>\n <Heading>Heading 1</Heading>\n <Heading variant=\"h2\">Heading 2</Heading>\n <Heading variant=\"h3\">Heading 3</Heading>\n <Heading variant=\"h4\">Heading 4</Heading>\n </View>\n </View>\n </ScrollView>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n\n return StyleSheet.create({\n scrollView: { flex: 1, backgroundColor: colors.fillColorNeutral100Inverted },\n container: { gap: space(2), padding: space(3) },\n listItem: { color: colors.fillColorNeutral020 },\n row: {\n gap: space(2),\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n flexWrap: 'wrap',\n },\n column: { gap: space(4) },\n spinnerContainer: {\n height: space(2.5),\n },\n image: {\n width: 100,\n height: 100,\n },\n })\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/utils/api.ts"],"names":[],"mappings":"AAUA,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,CAAC,GAAG,OAAO,EAC5C,GAAG,EAAE,MAAM,EACX,EAAE,MAAc,EAAE,IAAW,EAAE;;;CAAK,GACnC,OAAO,CAAC;IAAE,IAAI,EAAE,CAAC,CAAC;IAAC,EAAE,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,QAAQ,CAAA;CAAE,CAAC,CAuBvD"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import DeviceInfo from 'react-native-device-info';
|
|
2
|
+
import { session } from './session';
|
|
3
|
+
const brand = DeviceInfo.getBrand();
|
|
4
|
+
const model = DeviceInfo.getModel();
|
|
5
|
+
const systemName = DeviceInfo.getSystemName();
|
|
6
|
+
const systemVersion = DeviceInfo.getSystemVersion();
|
|
7
|
+
const readableVersion = DeviceInfo.getReadableVersion();
|
|
8
|
+
const appName = DeviceInfo.getApplicationName();
|
|
9
|
+
export default function apiRequest(url, { method = 'GET', data = null } = {}) {
|
|
10
|
+
const options = {
|
|
11
|
+
headers: {
|
|
12
|
+
Accept: 'application/vnd.api+json',
|
|
13
|
+
'Content-Type': 'application/json',
|
|
14
|
+
'User-Agent': `${appName}/${readableVersion} (${brand}, ${model}, ${systemName}, ${systemVersion})`,
|
|
15
|
+
Authorization: `Bearer ${session.token?.access_token}`,
|
|
16
|
+
},
|
|
17
|
+
method,
|
|
18
|
+
};
|
|
19
|
+
if (data && method !== 'GET') {
|
|
20
|
+
options.body = JSON.stringify(data);
|
|
21
|
+
}
|
|
22
|
+
return fetch(url, options)
|
|
23
|
+
.then(validateResponse)
|
|
24
|
+
.then(response => response
|
|
25
|
+
.json()
|
|
26
|
+
.then(json => ({ json: json, ok: response.ok, response }))
|
|
27
|
+
.catch(() => ({ json: null, ok: response.ok, response })));
|
|
28
|
+
}
|
|
29
|
+
const validateResponse = (response) => {
|
|
30
|
+
const isExpired = response.status === 401;
|
|
31
|
+
if (isExpired) {
|
|
32
|
+
throw new Error('Token expired');
|
|
33
|
+
}
|
|
34
|
+
return response;
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/utils/api.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAA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EAAE,EAAE,EAAE,QAAQ,CAAC,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,CACjE,CAAA;AACL,CAAC;AAED,MAAM,gBAAgB,GAAG,CAAC,QAAkB,EAAE,EAAE;IAC9C,MAAM,SAAS,GAAG,QAAQ,CAAC,MAAM,KAAK,GAAG,CAAA;IAEzC,IAAI,SAAS,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAA;IAClC,CAAC;IAED,OAAO,QAAQ,CAAA;AACjB,CAAC,CAAA","sourcesContent":["import DeviceInfo from 'react-native-device-info'\nimport { session } from './session'\n\nconst brand = DeviceInfo.getBrand()\nconst model = DeviceInfo.getModel()\nconst systemName = DeviceInfo.getSystemName()\nconst systemVersion = DeviceInfo.getSystemVersion()\nconst readableVersion = DeviceInfo.getReadableVersion()\nconst appName = DeviceInfo.getApplicationName()\n\nexport default function apiRequest<T = unknown>(\n url: string,\n { method = 'GET', data = null } = {}\n): Promise<{ json: T; ok: boolean; response: Response }> {\n const options: RequestInit = {\n headers: {\n Accept: 'application/vnd.api+json',\n 'Content-Type': 'application/json',\n 'User-Agent': `${appName}/${readableVersion} (${brand}, ${model}, ${systemName}, ${systemVersion})`,\n Authorization: `Bearer ${session.token?.access_token}`,\n },\n method,\n }\n\n if (data && method !== 'GET') {\n options.body = JSON.stringify(data)\n }\n\n return fetch(url, options)\n .then(validateResponse)\n .then(response =>\n response\n .json()\n .then(json => ({ json: json as T, ok: response.ok, response }))\n .catch(() => ({ json: null as T, ok: response.ok, response }))\n )\n}\n\nconst validateResponse = (response: Response) => {\n const isExpired = response.status === 401\n\n if (isExpired) {\n throw new Error('Token expired')\n }\n\n return response\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform_styles.d.ts","sourceRoot":"","sources":["../../src/utils/platform_styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,sBAAsB,2BAGjC,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
|
+
import { tokens } from '../vendor/tapestry/tokens';
|
|
3
|
+
export const platformFontWeightBold = Platform.select({
|
|
4
|
+
ios: tokens.fontWeightSemiBold,
|
|
5
|
+
android: tokens.fontWeightBold,
|
|
6
|
+
});
|
|
7
|
+
//# sourceMappingURL=platform_styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform_styles.js","sourceRoot":"","sources":["../../src/utils/platform_styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAElD,MAAM,CAAC,MAAM,sBAAsB,GAAG,QAAQ,CAAC,MAAM,CAAC;IACpD,GAAG,EAAE,MAAM,CAAC,kBAAkB;IAC9B,OAAO,EAAE,MAAM,CAAC,cAAc;CAC/B,CAAC,CAAA","sourcesContent":["import { Platform } from 'react-native'\nimport { tokens } from '../vendor/tapestry/tokens'\n\nexport const platformFontWeightBold = Platform.select({\n ios: tokens.fontWeightSemiBold,\n android: tokens.fontWeightBold,\n})\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"space.d.ts","sourceRoot":"","sources":["../../src/utils/space.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,aAAa,GACrB,IAAI,GACJ,GAAG,GACH,CAAC,GACD,GAAG,GACH,CAAC,GACD,GAAG,GACH,CAAC,GACD,GAAG,GACH,CAAC,GACD,GAAG,GACH,CAAC,GACD,GAAG,GACH,CAAC,GACD,GAAG,GACH,CAAC,GACD,GAAG,CAAA;AAEP,wBAAgB,KAAK,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CAalD"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { tokens } from '../vendor/tapestry/tokens';
|
|
2
|
+
export function space(value) {
|
|
3
|
+
if (value === 0.25)
|
|
4
|
+
return tokens.spacingFourth;
|
|
5
|
+
if (value === 0.5)
|
|
6
|
+
return tokens.spacingHalf;
|
|
7
|
+
if (value < 1 || value > 7.5)
|
|
8
|
+
return handleInvalidSpace(value);
|
|
9
|
+
// Reject fractional values that are not 0 or 0.5
|
|
10
|
+
const wholeValue = Math.floor(value);
|
|
11
|
+
const fractionalValue = value % 1;
|
|
12
|
+
if (fractionalValue !== 0 && fractionalValue !== 0.5)
|
|
13
|
+
return handleInvalidSpace(value);
|
|
14
|
+
// Deliver a whole value or add a half spacing token to it
|
|
15
|
+
const remainderValue = fractionalValue === 0.5 ? tokens.spacingHalf : 0;
|
|
16
|
+
return tokens[`spacing${wholeValue}`] + remainderValue;
|
|
17
|
+
}
|
|
18
|
+
function handleInvalidSpace(value) {
|
|
19
|
+
console.warn(`Invalid space value: ${value} — Must be a whole or half number between 1–7.`);
|
|
20
|
+
return 0;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=space.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"space.js","sourceRoot":"","sources":["../../src/utils/space.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAoBlD,MAAM,UAAU,KAAK,CAAC,KAAoB;IACxC,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,MAAM,CAAC,aAAa,CAAA;IAC/C,IAAI,KAAK,KAAK,GAAG;QAAE,OAAO,MAAM,CAAC,WAAW,CAAA;IAC5C,IAAI,KAAK,GAAG,CAAC,IAAI,KAAK,GAAG,GAAG;QAAE,OAAO,kBAAkB,CAAC,KAAK,CAAC,CAAA;IAE9D,iDAAiD;IACjD,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;IACpC,MAAM,eAAe,GAAG,KAAK,GAAG,CAAC,CAAA;IACjC,IAAI,eAAe,KAAK,CAAC,IAAI,eAAe,KAAK,GAAG;QAAE,OAAO,kBAAkB,CAAC,KAAK,CAAC,CAAA;IAEtF,0DAA0D;IAC1D,MAAM,cAAc,GAAG,eAAe,KAAK,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAA;IACvE,OAAO,MAAM,CAAC,UAAU,UAAU,EAAE,CAAC,GAAG,cAAc,CAAA;AACxD,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAa;IACvC,OAAO,CAAC,IAAI,CAAC,wBAAwB,KAAK,gDAAgD,CAAC,CAAA;IAC3F,OAAO,CAAC,CAAA;AACV,CAAC","sourcesContent":["import { tokens } from '../vendor/tapestry/tokens'\n\nexport type SpacingValues =\n | 0.25\n | 0.5\n | 1\n | 1.5\n | 2\n | 2.5\n | 3\n | 3.5\n | 4\n | 4.5\n | 5\n | 5.5\n | 6\n | 6.5\n | 7\n | 7.5\n\nexport function space(value: SpacingValues): number {\n if (value === 0.25) return tokens.spacingFourth\n if (value === 0.5) return tokens.spacingHalf\n if (value < 1 || value > 7.5) return handleInvalidSpace(value)\n\n // Reject fractional values that are not 0 or 0.5\n const wholeValue = Math.floor(value)\n const fractionalValue = value % 1\n if (fractionalValue !== 0 && fractionalValue !== 0.5) return handleInvalidSpace(value)\n\n // Deliver a whole value or add a half spacing token to it\n const remainderValue = fractionalValue === 0.5 ? tokens.spacingHalf : 0\n return tokens[`spacing${wholeValue}`] + remainderValue\n}\n\nfunction handleInvalidSpace(value: number) {\n console.warn(`Invalid space value: ${value} — Must be a whole or half number between 1–7.`)\n return 0\n}\n"]}
|
package/build/utils/theme.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TextStyle, ViewStyle, ColorSchemeName } from 'react-native';
|
|
2
|
-
import {
|
|
2
|
+
import { aliasTokensColorMap } from '../vendor/tapestry/alias_tokens_color_map';
|
|
3
3
|
export interface ChatTheme extends DefaultTheme {
|
|
4
|
-
colors: DefaultTheme['colors'] & (typeof
|
|
4
|
+
colors: DefaultTheme['colors'] & (typeof aliasTokensColorMap.light | typeof aliasTokensColorMap.dark);
|
|
5
5
|
}
|
|
6
6
|
/** =============================================
|
|
7
7
|
NOTE: The specific values for `colors` and the `productBadge` are temporary examples that can be replaced once we start building out UI. This line's comment can be removed at that time too.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/utils/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAEpE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/utils/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAEpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAA;AAE/E,MAAM,WAAW,SAAU,SAAQ,YAAY;IAC7C,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,GAC5B,CAAC,OAAO,mBAAmB,CAAC,KAAK,GAAG,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAA;CACvE;AAED;;;;;;;;;;;;gDAYgD;AAEhD,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,UAAU,CAAA;IAClB,qBAAqB,EAAE;QACrB,SAAS,EAAE,SAAS,CAAA;QACpB,IAAI,EAAE,SAAS,CAAA;KAChB,CAAA;CACF;AAED,eAAO,MAAM,YAAY,gBAAiB,eAAe,KAAG,YAgB3D,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;AAE5D,UAAU,UAAU;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,8BAA8B,EAAE,MAAM,CAAA;IACtC,SAAS,EAAE,MAAM,CAAA;CAClB"}
|
package/build/utils/theme.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { tokens } from '../vendor/tapestry/tokens';
|
|
2
|
-
import {
|
|
2
|
+
import { aliasTokensColorMap } from '../vendor/tapestry/alias_tokens_color_map';
|
|
3
3
|
export const defaultTheme = (colorScheme) => {
|
|
4
4
|
const scheme = colorScheme || 'light';
|
|
5
5
|
return {
|
|
@@ -7,7 +7,7 @@ export const defaultTheme = (colorScheme) => {
|
|
|
7
7
|
temporaryProductBadge: {
|
|
8
8
|
container: {
|
|
9
9
|
paddingHorizontal: tokens.spacing1,
|
|
10
|
-
backgroundColor:
|
|
10
|
+
backgroundColor: aliasTokensColorMap[scheme].fillColorNeutral070,
|
|
11
11
|
borderWidth: tokens.borderSizeDefault,
|
|
12
12
|
},
|
|
13
13
|
text: {
|
package/build/utils/theme.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../../src/utils/theme.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAClD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../../src/utils/theme.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAA;AA6B/E,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,WAA4B,EAAgB,EAAE;IACzE,MAAM,MAAM,GAAG,WAAW,IAAI,OAAO,CAAA;IAErC,OAAO;QACL,MAAM,EAAE,iBAAiB,CAAC,MAAM,CAAC;QACjC,qBAAqB,EAAE;YACrB,SAAS,EAAE;gBACT,iBAAiB,EAAE,MAAM,CAAC,QAAQ;gBAClC,eAAe,EAAE,mBAAmB,CAAC,MAAM,CAAC,CAAC,mBAAmB;gBAChE,WAAW,EAAE,MAAM,CAAC,iBAAiB;aACtC;YACD,IAAI,EAAE;gBACJ,SAAS,EAAE,QAAQ;aACpB;SACF;KACF,CAAA;AACH,CAAC,CAAA;AAUD,MAAM,eAAe,GAAe;IAClC,IAAI,EAAE,OAAO;IACb,8BAA8B,EAAE,MAAM,CAAC,cAAc;IACrD,SAAS,EAAE,KAAK;CACjB,CAAA;AAED,MAAM,cAAc,GAAe;IACjC,IAAI,EAAE,MAAM;IACZ,8BAA8B,EAAE,MAAM,CAAC,cAAc;IACrD,SAAS,EAAE,MAAM;CAClB,CAAA;AAED,MAAM,iBAAiB,GAAG;IACxB,KAAK,EAAE,eAAe;IACtB,IAAI,EAAE,cAAc;CACrB,CAAA","sourcesContent":["import { TextStyle, ViewStyle, ColorSchemeName } from 'react-native'\nimport { tokens } from '../vendor/tapestry/tokens'\nimport { aliasTokensColorMap } from '../vendor/tapestry/alias_tokens_color_map'\n\nexport interface ChatTheme extends DefaultTheme {\n colors: DefaultTheme['colors'] &\n (typeof aliasTokensColorMap.light | typeof aliasTokensColorMap.dark)\n}\n\n/** =============================================\n NOTE: The specific values for `colors` and the `productBadge` are temporary examples that can be replaced once we start building out UI. This line's comment can be removed at that time too.\n\n The default theme is intended to support two types of customizations:\n 1. Specific color properties for a chat component (eg. `primaryButtonBackgroundColor`)\n 2. Any styles for a specific component. (Use only one level of nesting.)\n ```\n primaryButton: {\n container: ViewStyle\n text: TextStyle\n }\n ```\n============================================= */\n\nexport interface DefaultTheme {\n colors: ChatColors\n temporaryProductBadge: {\n container: ViewStyle\n text: TextStyle\n }\n}\n\nexport const defaultTheme = (colorScheme: ColorSchemeName): DefaultTheme => {\n const scheme = colorScheme || 'light'\n\n return {\n colors: chatThemeColorMap[scheme],\n temporaryProductBadge: {\n container: {\n paddingHorizontal: tokens.spacing1,\n backgroundColor: aliasTokensColorMap[scheme].fillColorNeutral070,\n borderWidth: tokens.borderSizeDefault,\n },\n text: {\n textAlign: 'center',\n },\n },\n }\n}\n\nexport type TemporaryDefaultColorsType = Partial<ChatColors>\n\ninterface ChatColors {\n name: string\n temporaryButtonBackgroundColor: string\n testColor: string\n}\n\nconst colorsChatLight: ChatColors = {\n name: 'light',\n temporaryButtonBackgroundColor: tokens.colorNeutral95,\n testColor: 'red',\n}\n\nconst colorsChatDark: ChatColors = {\n name: 'dark',\n temporaryButtonBackgroundColor: tokens.colorNeutral17,\n testColor: 'blue',\n}\n\nconst chatThemeColorMap = {\n light: colorsChatLight,\n dark: colorsChatDark,\n}\n"]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export declare const aliasTokensColorMap: {
|
|
2
|
+
readonly light: {
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly iconColorDefaultPrimary: string;
|
|
5
|
+
readonly iconColorDefaultSecondary: string;
|
|
6
|
+
readonly iconColorDefaultDim: string;
|
|
7
|
+
readonly iconColorDefaultDisabled: string;
|
|
8
|
+
readonly iconColorDefaultInverted: string;
|
|
9
|
+
readonly textColorDefaultHeadline: string;
|
|
10
|
+
readonly textColorDefaultPrimary: string;
|
|
11
|
+
readonly textColorDefaultSecondary: string;
|
|
12
|
+
readonly textColorDefaultDisabled: string;
|
|
13
|
+
readonly textColorDefaultPlaceholder: string;
|
|
14
|
+
readonly textColorDefaultInverted: string;
|
|
15
|
+
readonly fillColorInteractionOnlineDefault: string;
|
|
16
|
+
readonly fillColorNeutral000: string;
|
|
17
|
+
readonly fillColorNeutral010: string;
|
|
18
|
+
readonly fillColorNeutral020: string;
|
|
19
|
+
readonly fillColorNeutral030: string;
|
|
20
|
+
readonly fillColorNeutral040: string;
|
|
21
|
+
readonly fillColorNeutral050Base: string;
|
|
22
|
+
readonly fillColorNeutral060: string;
|
|
23
|
+
readonly fillColorNeutral070: string;
|
|
24
|
+
readonly fillColorNeutral080: string;
|
|
25
|
+
readonly fillColorNeutral090: string;
|
|
26
|
+
readonly fillColorNeutral100Inverted: string;
|
|
27
|
+
};
|
|
28
|
+
readonly dark: {
|
|
29
|
+
readonly name: string;
|
|
30
|
+
readonly iconColorDefaultPrimary: string;
|
|
31
|
+
readonly iconColorDefaultSecondary: string;
|
|
32
|
+
readonly iconColorDefaultDim: string;
|
|
33
|
+
readonly iconColorDefaultDisabled: string;
|
|
34
|
+
readonly iconColorDefaultInverted: string;
|
|
35
|
+
readonly textColorDefaultHeadline: string;
|
|
36
|
+
readonly textColorDefaultPrimary: string;
|
|
37
|
+
readonly textColorDefaultSecondary: string;
|
|
38
|
+
readonly textColorDefaultDisabled: string;
|
|
39
|
+
readonly textColorDefaultPlaceholder: string;
|
|
40
|
+
readonly textColorDefaultInverted: string;
|
|
41
|
+
readonly fillColorInteractionOnlineDefault: string;
|
|
42
|
+
readonly fillColorNeutral000: string;
|
|
43
|
+
readonly fillColorNeutral010: string;
|
|
44
|
+
readonly fillColorNeutral020: string;
|
|
45
|
+
readonly fillColorNeutral030: string;
|
|
46
|
+
readonly fillColorNeutral040: string;
|
|
47
|
+
readonly fillColorNeutral050Base: string;
|
|
48
|
+
readonly fillColorNeutral060: string;
|
|
49
|
+
readonly fillColorNeutral070: string;
|
|
50
|
+
readonly fillColorNeutral080: string;
|
|
51
|
+
readonly fillColorNeutral090: string;
|
|
52
|
+
readonly fillColorNeutral100Inverted: string;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=alias_tokens_color_map.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alias_tokens_color_map.d.ts","sourceRoot":"","sources":["../../../src/vendor/tapestry/alias_tokens_color_map.ts"],"names":[],"mappings":"AAmGA,eAAO,MAAM,mBAAmB;;uBA/CxB,MAAM;0CACa,MAAM;4CACJ,MAAM;sCACZ,MAAM;2CACD,MAAM;2CACN,MAAM;2CACN,MAAM;0CACP,MAAM;4CACJ,MAAM;2CACP,MAAM;8CACH,MAAM;2CACT,MAAM;oDACG,MAAM;sCAxDpB,MAAM;sCACN,MAAM;sCACN,MAAM;sCACN,MAAM;sCACN,MAAM;0CACF,MAAM;sCACV,MAAM;sCACN,MAAM;sCACN,MAAM;sCACN,MAAM;8CACE,MAAM;;;uBAkC7B,MAAM;0CACa,MAAM;4CACJ,MAAM;sCACZ,MAAM;2CACD,MAAM;2CACN,MAAM;2CACN,MAAM;0CACP,MAAM;4CACJ,MAAM;2CACP,MAAM;8CACH,MAAM;2CACT,MAAM;oDACG,MAAM;sCAxDpB,MAAM;sCACN,MAAM;sCACN,MAAM;sCACN,MAAM;sCACN,MAAM;0CACF,MAAM;sCACV,MAAM;sCACN,MAAM;sCACN,MAAM;sCACN,MAAM;8CACE,MAAM;;CAoF3B,CAAA"}
|
package/build/vendor/tapestry/{tapestry_alias_tokens_color_map.js → alias_tokens_color_map.js}
RENAMED
|
@@ -40,6 +40,7 @@ const semanticAliasesLight = {
|
|
|
40
40
|
textColorDefaultDisabled: neutralsLight.fillColorNeutral040,
|
|
41
41
|
textColorDefaultPlaceholder: neutralsLight.fillColorNeutral030,
|
|
42
42
|
textColorDefaultInverted: tokens.colorNeutral100White,
|
|
43
|
+
fillColorInteractionOnlineDefault: tokens.colorInteractionOnlineDefault,
|
|
43
44
|
};
|
|
44
45
|
const semanticAliasesDark = {
|
|
45
46
|
name: 'dark',
|
|
@@ -54,9 +55,10 @@ const semanticAliasesDark = {
|
|
|
54
55
|
textColorDefaultDisabled: neutralsDark.fillColorNeutral040,
|
|
55
56
|
textColorDefaultPlaceholder: neutralsDark.fillColorNeutral030,
|
|
56
57
|
textColorDefaultInverted: tokens.colorNeutral7,
|
|
58
|
+
fillColorInteractionOnlineDefault: tokens.colorInteractionOnlineDefault,
|
|
57
59
|
};
|
|
58
|
-
export const
|
|
60
|
+
export const aliasTokensColorMap = {
|
|
59
61
|
light: { ...neutralsLight, ...semanticAliasesLight },
|
|
60
62
|
dark: { ...neutralsDark, ...semanticAliasesDark },
|
|
61
63
|
};
|
|
62
|
-
//# sourceMappingURL=
|
|
64
|
+
//# sourceMappingURL=alias_tokens_color_map.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alias_tokens_color_map.js","sourceRoot":"","sources":["../../../src/vendor/tapestry/alias_tokens_color_map.ts"],"names":[],"mappings":"AAAA,OAAO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aAAa,CAAC,mBAAmB;IAC3D,wBAAwB,EAAE,aAAa,CAAC,2BAA2B;IACnE,wBAAwB,EAAE,aAAa,CAAC,mBAAmB;IAC3D,uBAAuB,EAAE,aAAa,CAAC,mBAAmB;IAC1D,yBAAyB,EAAE,aAAa,CAAC,mBAAmB;IAC5D,wBAAwB,EAAE,aAAa,CAAC,mBAAmB;IAC3D,2BAA2B,EAAE,aAAa,CAAC,mBAAmB;IAC9D,wBAAwB,EAAE,MAAM,CAAC,oBAAoB;IACrD,iCAAiC,EAAE,MAAM,CAAC,6BAA6B;CAC/D,CAAA;AAEV,MAAM,mBAAmB,GAA0B;IACjD,IAAI,EAAE,MAAM;IACZ,uBAAuB,EAAE,YAAY,CAAC,mBAAmB;IACzD,yBAAyB,EAAE,YAAY,CAAC,mBAAmB;IAC3D,mBAAmB,EAAE,YAAY,CAAC,mBAAmB;IACrD,wBAAwB,EAAE,YAAY,CAAC,mBAAmB;IAC1D,wBAAwB,EAAE,YAAY,CAAC,2BAA2B;IAClE,wBAAwB,EAAE,YAAY,CAAC,mBAAmB;IAC1D,uBAAuB,EAAE,YAAY,CAAC,mBAAmB;IACzD,yBAAyB,EAAE,YAAY,CAAC,mBAAmB;IAC3D,wBAAwB,EAAE,YAAY,CAAC,mBAAmB;IAC1D,2BAA2B,EAAE,YAAY,CAAC,mBAAmB;IAC7D,wBAAwB,EAAE,MAAM,CAAC,aAAa;IAC9C,iCAAiC,EAAE,MAAM,CAAC,6BAA6B;CACxE,CAAA;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,KAAK,EAAE,EAAE,GAAG,aAAa,EAAE,GAAG,oBAAoB,EAAE;IACpD,IAAI,EAAE,EAAE,GAAG,YAAY,EAAE,GAAG,mBAAmB,EAAE;CACzC,CAAA","sourcesContent":["import { tokens } from './tokens'\n\n// Copied from `@planningcenter/tapestry` package.\n// Defining these tokens locally is a temporary solution until the package supports mobile.\n// Tokens Reference: https://planningcenter.github.io/tapestry/?path=/docs/foundations-design-tokens--docs\n\ninterface NeutralColors {\n name: string\n fillColorNeutral000: string\n fillColorNeutral010: string\n fillColorNeutral020: string\n fillColorNeutral030: string\n fillColorNeutral040: string\n fillColorNeutral050Base: string\n fillColorNeutral060: string\n fillColorNeutral070: string\n fillColorNeutral080: string\n fillColorNeutral090: string\n fillColorNeutral100Inverted: string\n}\n\nconst neutralsLight: NeutralColors = {\n name: 'light',\n fillColorNeutral000: tokens.colorNeutral12,\n fillColorNeutral010: tokens.colorNeutral24,\n fillColorNeutral020: tokens.colorNeutral45,\n fillColorNeutral030: tokens.colorNeutral58,\n fillColorNeutral040: tokens.colorNeutral81,\n fillColorNeutral050Base: tokens.colorNeutral88,\n fillColorNeutral060: tokens.colorNeutral93,\n fillColorNeutral070: tokens.colorNeutral95,\n fillColorNeutral080: tokens.colorNeutral97,\n fillColorNeutral090: tokens.colorNeutral98,\n fillColorNeutral100Inverted: tokens.colorNeutral100White,\n} as const\n\nconst neutralsDark: NeutralColors = {\n name: 'dark',\n fillColorNeutral000: tokens.colorNeutral98,\n fillColorNeutral010: tokens.colorNeutral88,\n fillColorNeutral020: tokens.colorNeutral68,\n fillColorNeutral030: tokens.colorNeutral50,\n fillColorNeutral040: tokens.colorNeutral32,\n fillColorNeutral050Base: tokens.colorNeutral24,\n fillColorNeutral060: tokens.colorNeutral19,\n fillColorNeutral070: tokens.colorNeutral17,\n fillColorNeutral080: tokens.colorNeutral15,\n fillColorNeutral090: tokens.colorNeutral12,\n fillColorNeutral100Inverted: tokens.colorNeutral7,\n} as const\n\ninterface SemanticAliasesColors {\n name: string\n iconColorDefaultPrimary: string\n iconColorDefaultSecondary: string\n iconColorDefaultDim: string\n iconColorDefaultDisabled: string\n iconColorDefaultInverted: string\n textColorDefaultHeadline: string\n textColorDefaultPrimary: string\n textColorDefaultSecondary: string\n textColorDefaultDisabled: string\n textColorDefaultPlaceholder: string\n textColorDefaultInverted: string\n fillColorInteractionOnlineDefault: string\n}\n\nconst semanticAliasesLight: SemanticAliasesColors = {\n name: 'light',\n iconColorDefaultPrimary: neutralsLight.fillColorNeutral010,\n iconColorDefaultSecondary: neutralsLight.fillColorNeutral020,\n iconColorDefaultDim: neutralsLight.fillColorNeutral030,\n iconColorDefaultDisabled: neutralsLight.fillColorNeutral040,\n iconColorDefaultInverted: neutralsLight.fillColorNeutral100Inverted,\n textColorDefaultHeadline: neutralsLight.fillColorNeutral000,\n textColorDefaultPrimary: neutralsLight.fillColorNeutral010,\n textColorDefaultSecondary: neutralsLight.fillColorNeutral020,\n textColorDefaultDisabled: neutralsLight.fillColorNeutral040,\n textColorDefaultPlaceholder: neutralsLight.fillColorNeutral030,\n textColorDefaultInverted: tokens.colorNeutral100White,\n fillColorInteractionOnlineDefault: tokens.colorInteractionOnlineDefault,\n} as const\n\nconst semanticAliasesDark: SemanticAliasesColors = {\n name: 'dark',\n iconColorDefaultPrimary: neutralsDark.fillColorNeutral010,\n iconColorDefaultSecondary: neutralsDark.fillColorNeutral020,\n iconColorDefaultDim: neutralsDark.fillColorNeutral030,\n iconColorDefaultDisabled: neutralsDark.fillColorNeutral040,\n iconColorDefaultInverted: neutralsDark.fillColorNeutral100Inverted,\n textColorDefaultHeadline: neutralsDark.fillColorNeutral000,\n textColorDefaultPrimary: neutralsDark.fillColorNeutral010,\n textColorDefaultSecondary: neutralsDark.fillColorNeutral020,\n textColorDefaultDisabled: neutralsDark.fillColorNeutral040,\n textColorDefaultPlaceholder: neutralsDark.fillColorNeutral030,\n textColorDefaultInverted: tokens.colorNeutral7,\n fillColorInteractionOnlineDefault: tokens.colorInteractionOnlineDefault,\n}\n\nexport const aliasTokensColorMap = {\n light: { ...neutralsLight, ...semanticAliasesLight },\n dark: { ...neutralsDark, ...semanticAliasesDark },\n} as const\n"]}
|