@planningcenter/chat-react-native 1.3.0-rc.4 → 1.3.0-rc.6
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/CHANGELOG.md +25 -0
- package/build/components/conversations.d.ts +1 -1
- package/build/components/conversations.d.ts.map +1 -1
- package/build/components/conversations.js +19 -34
- package/build/components/conversations.js.map +1 -1
- package/build/components/error_boundary.d.ts +3 -1
- package/build/components/error_boundary.d.ts.map +1 -1
- package/build/components/error_boundary.js.map +1 -1
- package/build/contexts/api_provider.d.ts +13 -0
- package/build/contexts/api_provider.d.ts.map +1 -0
- package/build/contexts/api_provider.js +51 -0
- package/build/contexts/api_provider.js.map +1 -0
- package/build/contexts/chat_context.d.ts +15 -0
- package/build/contexts/chat_context.d.ts.map +1 -0
- package/build/contexts/chat_context.js +18 -0
- package/build/contexts/chat_context.js.map +1 -0
- package/build/hooks/use_async_storage.d.ts +4 -0
- package/build/hooks/use_async_storage.d.ts.map +1 -0
- package/build/hooks/use_async_storage.js +31 -0
- package/build/hooks/use_async_storage.js.map +1 -0
- package/build/hooks/use_create_chat_theme.d.ts +10 -0
- package/build/hooks/use_create_chat_theme.d.ts.map +1 -0
- package/build/hooks/use_create_chat_theme.js +20 -0
- package/build/hooks/use_create_chat_theme.js.map +1 -0
- package/build/hooks/use_theme.d.ts +3 -0
- package/build/hooks/use_theme.d.ts.map +1 -0
- package/build/hooks/use_theme.js +7 -0
- package/build/hooks/use_theme.js.map +1 -0
- package/build/index.d.ts +5 -3
- package/build/index.d.ts.map +1 -1
- package/build/index.js +3 -2
- package/build/index.js.map +1 -1
- package/build/utils/theme.d.ts +34 -0
- package/build/utils/theme.d.ts.map +1 -0
- package/build/utils/theme.js +33 -0
- package/build/utils/theme.js.map +1 -0
- package/build/vendor/tapestry/tapestry_alias_tokens_color_map.d.ts +41 -0
- package/build/vendor/tapestry/tapestry_alias_tokens_color_map.d.ts.map +1 -0
- package/build/vendor/tapestry/tapestry_alias_tokens_color_map.js +50 -0
- package/build/vendor/tapestry/tapestry_alias_tokens_color_map.js.map +1 -0
- package/build/vendor/tapestry/tokens.d.ts +38 -0
- package/build/vendor/tapestry/tokens.d.ts.map +1 -0
- package/build/vendor/tapestry/tokens.js +50 -0
- package/build/vendor/tapestry/tokens.js.map +1 -0
- package/package.json +4 -2
- package/src/components/conversations.tsx +24 -37
- package/src/components/error_boundary.tsx +1 -1
- package/src/contexts/api_provider.tsx +69 -0
- package/src/contexts/chat_context.tsx +29 -0
- package/src/hooks/use_async_storage.ts +41 -0
- package/src/hooks/use_create_chat_theme.tsx +31 -0
- package/src/hooks/use_theme.tsx +9 -0
- package/src/index.tsx +12 -3
- package/src/types.d.ts +9 -4
- package/src/utils/theme.ts +73 -0
- package/src/vendor/tapestry/tapestry_alias_tokens_color_map.ts +82 -0
- package/src/vendor/tapestry/tokens.ts +97 -0
- package/build/context/chat_context.d.ts +0 -9
- package/build/context/chat_context.d.ts.map +0 -1
- package/build/context/chat_context.js +0 -7
- package/build/context/chat_context.js.map +0 -1
- package/src/context/chat_context.tsx +0 -14
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { tokens } from './tokens'
|
|
2
|
+
|
|
3
|
+
// Copied from `@planningcenter/tapestry` package.
|
|
4
|
+
// Defining these tokens locally is a temporary solution until the package supports mobile.
|
|
5
|
+
// Tokens Reference: https://planningcenter.github.io/tapestry/?path=/docs/foundations-design-tokens--docs
|
|
6
|
+
|
|
7
|
+
interface NeutralColors {
|
|
8
|
+
name: string
|
|
9
|
+
fillColorNeutral000: string
|
|
10
|
+
fillColorNeutral010: string
|
|
11
|
+
fillColorNeutral020: string
|
|
12
|
+
fillColorNeutral030: string
|
|
13
|
+
fillColorNeutral040: string
|
|
14
|
+
fillColorNeutral050Base: string
|
|
15
|
+
fillColorNeutral060: string
|
|
16
|
+
fillColorNeutral070: string
|
|
17
|
+
fillColorNeutral080: string
|
|
18
|
+
fillColorNeutral090: string
|
|
19
|
+
fillColorNeutral100Inverted: string
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const neutralsLight: NeutralColors = {
|
|
23
|
+
name: 'light',
|
|
24
|
+
fillColorNeutral000: tokens.colorNeutral12,
|
|
25
|
+
fillColorNeutral010: tokens.colorNeutral24,
|
|
26
|
+
fillColorNeutral020: tokens.colorNeutral45,
|
|
27
|
+
fillColorNeutral030: tokens.colorNeutral58,
|
|
28
|
+
fillColorNeutral040: tokens.colorNeutral81,
|
|
29
|
+
fillColorNeutral050Base: tokens.colorNeutral88,
|
|
30
|
+
fillColorNeutral060: tokens.colorNeutral93,
|
|
31
|
+
fillColorNeutral070: tokens.colorNeutral95,
|
|
32
|
+
fillColorNeutral080: tokens.colorNeutral97,
|
|
33
|
+
fillColorNeutral090: tokens.colorNeutral98,
|
|
34
|
+
fillColorNeutral100Inverted: tokens.colorNeutral100White,
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const neutralsDark: NeutralColors = {
|
|
38
|
+
name: 'dark',
|
|
39
|
+
fillColorNeutral000: tokens.colorNeutral98,
|
|
40
|
+
fillColorNeutral010: tokens.colorNeutral88,
|
|
41
|
+
fillColorNeutral020: tokens.colorNeutral68,
|
|
42
|
+
fillColorNeutral030: tokens.colorNeutral50,
|
|
43
|
+
fillColorNeutral040: tokens.colorNeutral32,
|
|
44
|
+
fillColorNeutral050Base: tokens.colorNeutral24,
|
|
45
|
+
fillColorNeutral060: tokens.colorNeutral19,
|
|
46
|
+
fillColorNeutral070: tokens.colorNeutral17,
|
|
47
|
+
fillColorNeutral080: tokens.colorNeutral15,
|
|
48
|
+
fillColorNeutral090: tokens.colorNeutral12,
|
|
49
|
+
fillColorNeutral100Inverted: tokens.colorNeutral7,
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
interface SemanticAliasesColors {
|
|
53
|
+
name: string
|
|
54
|
+
iconColorDefaultPrimary: string
|
|
55
|
+
iconColorDefaultSecondary: string
|
|
56
|
+
iconColorDefaultDim: string
|
|
57
|
+
iconColorDefaultDisabled: string
|
|
58
|
+
iconColorDefaultInverted: string
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const semanticAliasesLight: SemanticAliasesColors = {
|
|
62
|
+
name: 'light',
|
|
63
|
+
iconColorDefaultPrimary: neutralsLight.fillColorNeutral010,
|
|
64
|
+
iconColorDefaultSecondary: neutralsLight.fillColorNeutral020,
|
|
65
|
+
iconColorDefaultDim: neutralsLight.fillColorNeutral030,
|
|
66
|
+
iconColorDefaultDisabled: neutralsLight.fillColorNeutral040,
|
|
67
|
+
iconColorDefaultInverted: neutralsLight.fillColorNeutral100Inverted,
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const semanticAliasesDark: SemanticAliasesColors = {
|
|
71
|
+
name: 'dark',
|
|
72
|
+
iconColorDefaultPrimary: neutralsDark.fillColorNeutral010,
|
|
73
|
+
iconColorDefaultSecondary: neutralsDark.fillColorNeutral020,
|
|
74
|
+
iconColorDefaultDim: neutralsDark.fillColorNeutral030,
|
|
75
|
+
iconColorDefaultDisabled: neutralsDark.fillColorNeutral040,
|
|
76
|
+
iconColorDefaultInverted: neutralsDark.fillColorNeutral100Inverted,
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export const tapestryAliasTokensColorMap = {
|
|
80
|
+
light: { ...neutralsLight, ...semanticAliasesLight },
|
|
81
|
+
dark: { ...neutralsDark, ...semanticAliasesDark },
|
|
82
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
// Copied from `@planningcenter/tapestry` package.
|
|
2
|
+
// Defining these tokens locally is a temporary solution until the package supports mobile.
|
|
3
|
+
// Tokens Reference: https://planningcenter.github.io/tapestry/?path=/docs/foundations-design-tokens--docs
|
|
4
|
+
|
|
5
|
+
interface ColorPrimitves {
|
|
6
|
+
colorNeutral7: string
|
|
7
|
+
colorNeutral12: string
|
|
8
|
+
colorNeutral15: string
|
|
9
|
+
colorNeutral17: string
|
|
10
|
+
colorNeutral19: string
|
|
11
|
+
colorNeutral24: string
|
|
12
|
+
colorNeutral32: string
|
|
13
|
+
colorNeutral45: string
|
|
14
|
+
colorNeutral50: string
|
|
15
|
+
colorNeutral58: string
|
|
16
|
+
colorNeutral68: string
|
|
17
|
+
colorNeutral81: string
|
|
18
|
+
colorNeutral88: string
|
|
19
|
+
colorNeutral93: string
|
|
20
|
+
colorNeutral95: string
|
|
21
|
+
colorNeutral97: string
|
|
22
|
+
colorNeutral98: string
|
|
23
|
+
colorNeutral100White: string
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const colorPrimitives: ColorPrimitves = {
|
|
27
|
+
colorNeutral7: 'hsl(0, 0%, 7%)',
|
|
28
|
+
colorNeutral12: 'hsl(0, 0%, 12%)',
|
|
29
|
+
colorNeutral15: 'hsl(0, 0%, 15%)',
|
|
30
|
+
colorNeutral17: 'hsl(0, 0%, 17%)',
|
|
31
|
+
colorNeutral19: 'hsl(0, 0%, 19%)',
|
|
32
|
+
colorNeutral24: 'hsl(0, 0%, 24%)',
|
|
33
|
+
colorNeutral32: 'hsl(0, 0%, 32%)',
|
|
34
|
+
colorNeutral45: 'hsl(0, 0%, 45%)',
|
|
35
|
+
colorNeutral50: 'hsl(0, 0%, 50%)',
|
|
36
|
+
colorNeutral58: 'hsl(0, 0%, 58%)',
|
|
37
|
+
colorNeutral68: 'hsl(0, 0%, 68%)',
|
|
38
|
+
colorNeutral81: 'hsl(0, 0%, 81%)',
|
|
39
|
+
colorNeutral88: 'hsl(0, 0%, 88%)',
|
|
40
|
+
colorNeutral93: 'hsl(0, 0%, 93%)',
|
|
41
|
+
colorNeutral95: 'hsl(0, 0%, 95%)',
|
|
42
|
+
colorNeutral97: 'hsl(0, 0%, 97%)',
|
|
43
|
+
colorNeutral98: 'hsl(0, 0%, 98%)',
|
|
44
|
+
colorNeutral100White: 'hsl(0, 0%, 100%)',
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
interface NumericPrimitives {
|
|
48
|
+
spacingFourth: number
|
|
49
|
+
spacingHalf: number
|
|
50
|
+
spacing1: number
|
|
51
|
+
spacing2: number
|
|
52
|
+
spacing3: number
|
|
53
|
+
spacing4: number
|
|
54
|
+
spacing5: number
|
|
55
|
+
spacing6: number
|
|
56
|
+
spacing7: number
|
|
57
|
+
borderRadiusSm: number
|
|
58
|
+
borderRadiusMd: number
|
|
59
|
+
borderRadiusLg: number
|
|
60
|
+
borderRadiusXl: number
|
|
61
|
+
borderRadiusRound: number
|
|
62
|
+
borderSizeDefault: number
|
|
63
|
+
borderSizeThick: number
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const numericPrimtives: NumericPrimitives = {
|
|
67
|
+
spacingFourth: 2,
|
|
68
|
+
spacingHalf: 4,
|
|
69
|
+
spacing1: 8,
|
|
70
|
+
spacing2: 16,
|
|
71
|
+
spacing3: 24,
|
|
72
|
+
spacing4: 32,
|
|
73
|
+
spacing5: 40,
|
|
74
|
+
spacing6: 48,
|
|
75
|
+
spacing7: 56,
|
|
76
|
+
borderRadiusSm: 2,
|
|
77
|
+
borderRadiusMd: 4,
|
|
78
|
+
borderRadiusLg: 8,
|
|
79
|
+
borderRadiusXl: 16,
|
|
80
|
+
borderRadiusRound: 56,
|
|
81
|
+
borderSizeDefault: 1,
|
|
82
|
+
borderSizeThick: 2,
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
interface NumericAliases {
|
|
86
|
+
borderRadiusDefault: number
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const numericAliases: NumericAliases = {
|
|
90
|
+
borderRadiusDefault: numericPrimtives.borderRadiusMd,
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export const tokens = {
|
|
94
|
+
...colorPrimitives,
|
|
95
|
+
...numericPrimtives,
|
|
96
|
+
...numericAliases,
|
|
97
|
+
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { OauthToken } from '../types';
|
|
2
|
-
type ContextValue = {
|
|
3
|
-
token: OauthToken | null;
|
|
4
|
-
onTokenExpired: () => void;
|
|
5
|
-
theme: any;
|
|
6
|
-
};
|
|
7
|
-
export declare const ChatContext: import("react").Context<ContextValue>;
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=chat_context.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat_context.d.ts","sourceRoot":"","sources":["../../src/context/chat_context.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAErC,KAAK,YAAY,GAAG;IAClB,KAAK,EAAE,UAAU,GAAG,IAAI,CAAA;IACxB,cAAc,EAAE,MAAM,IAAI,CAAA;IAC1B,KAAK,EAAE,GAAG,CAAA;CACX,CAAA;AAED,eAAO,MAAM,WAAW,uCAItB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat_context.js","sourceRoot":"","sources":["../../src/context/chat_context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AASrC,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAe;IACrD,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,IAAI;IACX,cAAc,EAAE,GAAG,EAAE,GAAE,CAAC;CACzB,CAAC,CAAA","sourcesContent":["import { createContext } from 'react'\nimport { OauthToken } from '../types'\n\ntype ContextValue = {\n token: OauthToken | null\n onTokenExpired: () => void\n theme: any\n}\n\nexport const ChatContext = createContext<ContextValue>({\n theme: null,\n token: null,\n onTokenExpired: () => {},\n})\n"]}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { createContext } from 'react'
|
|
2
|
-
import { OauthToken } from '../types'
|
|
3
|
-
|
|
4
|
-
type ContextValue = {
|
|
5
|
-
token: OauthToken | null
|
|
6
|
-
onTokenExpired: () => void
|
|
7
|
-
theme: any
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const ChatContext = createContext<ContextValue>({
|
|
11
|
-
theme: null,
|
|
12
|
-
token: null,
|
|
13
|
-
onTokenExpired: () => {},
|
|
14
|
-
})
|