@smart_links/core 2.0.0
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/dist/ai/gateway.d.ts +12 -0
- package/dist/ai/gateway.d.ts.map +1 -0
- package/dist/ai/gateway.js +80 -0
- package/dist/ai/gateway.js.map +1 -0
- package/dist/ai/index.d.ts +4 -0
- package/dist/ai/index.d.ts.map +1 -0
- package/dist/ai/index.js +4 -0
- package/dist/ai/index.js.map +1 -0
- package/dist/ai/pipelines.d.ts +7 -0
- package/dist/ai/pipelines.d.ts.map +1 -0
- package/dist/ai/pipelines.js +89 -0
- package/dist/ai/pipelines.js.map +1 -0
- package/dist/ai/types.d.ts +74 -0
- package/dist/ai/types.d.ts.map +1 -0
- package/dist/ai/types.js +2 -0
- package/dist/ai/types.js.map +1 -0
- package/dist/api.d.ts +39 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +330 -0
- package/dist/api.js.map +1 -0
- package/dist/client.d.ts +14 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +49 -0
- package/dist/client.js.map +1 -0
- package/dist/config.d.ts +12 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +8 -0
- package/dist/config.js.map +1 -0
- package/dist/customization/SafeAreaScreen.d.ts +12 -0
- package/dist/customization/SafeAreaScreen.d.ts.map +1 -0
- package/dist/customization/SafeAreaScreen.js +7 -0
- package/dist/customization/SafeAreaScreen.js.map +1 -0
- package/dist/customization/defaults.d.ts +8 -0
- package/dist/customization/defaults.d.ts.map +1 -0
- package/dist/customization/defaults.js +101 -0
- package/dist/customization/defaults.js.map +1 -0
- package/dist/customization/index.d.ts +6 -0
- package/dist/customization/index.d.ts.map +1 -0
- package/dist/customization/index.js +6 -0
- package/dist/customization/index.js.map +1 -0
- package/dist/customization/store.d.ts +12 -0
- package/dist/customization/store.d.ts.map +1 -0
- package/dist/customization/store.js +57 -0
- package/dist/customization/store.js.map +1 -0
- package/dist/customization/styles.d.ts +121 -0
- package/dist/customization/styles.d.ts.map +1 -0
- package/dist/customization/styles.js +123 -0
- package/dist/customization/styles.js.map +1 -0
- package/dist/customization/types.d.ts +118 -0
- package/dist/customization/types.d.ts.map +1 -0
- package/dist/customization/types.js +2 -0
- package/dist/customization/types.js.map +1 -0
- package/dist/feedback.d.ts +19 -0
- package/dist/feedback.d.ts.map +1 -0
- package/dist/feedback.js +4 -0
- package/dist/feedback.js.map +1 -0
- package/dist/identity.d.ts +10 -0
- package/dist/identity.d.ts.map +1 -0
- package/dist/identity.js +44 -0
- package/dist/identity.js.map +1 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +43 -0
- package/dist/index.js.map +1 -0
- package/dist/native-api.d.ts +40 -0
- package/dist/native-api.d.ts.map +1 -0
- package/dist/native-api.js +169 -0
- package/dist/native-api.js.map +1 -0
- package/package.json +36 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/customization/store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAOpE,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,uBAAuB,EAC7B,KAAK,CAAC,EAAE,WAAW,CAAC,uBAAuB,CAAC,GAC3C,uBAAuB,CAGzB;AAqBD,KAAK,QAAQ,GAAG,MAAM,IAAI,CAAC;AAK3B,wBAAgB,0BAA0B,IAAI,uBAAuB,CAEpE;AAED,wBAAgB,4BAA4B,CAC1C,KAAK,CAAC,EAAE,WAAW,CAAC,uBAAuB,CAAC,GAC3C,uBAAuB,CAIzB;AAED,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,WAAW,CAAC,uBAAuB,CAAC,GAC1C,uBAAuB,CAIzB;AAED,oFAAoF;AACpF,wBAAgB,0BAA0B,CACxC,KAAK,CAAC,EAAE,WAAW,CAAC,uBAAuB,CAAC,GAC3C,uBAAuB,CAEzB;AAED,wBAAgB,4BAA4B,IAAI,IAAI,CAGnD;AAED,wBAAgB,gCAAgC,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,IAAI,CAG/E"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { defaultSmartLinksCustomization } from './defaults';
|
|
2
|
+
function isPlainObject(value) {
|
|
3
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
4
|
+
}
|
|
5
|
+
export function mergeCustomization(base, patch) {
|
|
6
|
+
if (!patch)
|
|
7
|
+
return base;
|
|
8
|
+
return deepMerge(base, patch);
|
|
9
|
+
}
|
|
10
|
+
function deepMerge(base, patch) {
|
|
11
|
+
if (!isPlainObject(base) || !isPlainObject(patch)) {
|
|
12
|
+
return patch ?? base;
|
|
13
|
+
}
|
|
14
|
+
const result = { ...base };
|
|
15
|
+
const patchRecord = patch;
|
|
16
|
+
for (const key of Object.keys(patchRecord)) {
|
|
17
|
+
const patchValue = patchRecord[key];
|
|
18
|
+
if (patchValue === undefined)
|
|
19
|
+
continue;
|
|
20
|
+
const baseValue = result[key];
|
|
21
|
+
if (isPlainObject(baseValue) && isPlainObject(patchValue)) {
|
|
22
|
+
result[key] = deepMerge(baseValue, patchValue);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
result[key] = patchValue;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return result;
|
|
29
|
+
}
|
|
30
|
+
let customization = { ...defaultSmartLinksCustomization };
|
|
31
|
+
const listeners = new Set();
|
|
32
|
+
export function getSmartLinksCustomization() {
|
|
33
|
+
return customization;
|
|
34
|
+
}
|
|
35
|
+
export function applySmartLinksCustomization(patch) {
|
|
36
|
+
customization = mergeCustomization(defaultSmartLinksCustomization, patch);
|
|
37
|
+
listeners.forEach((listener) => listener());
|
|
38
|
+
return customization;
|
|
39
|
+
}
|
|
40
|
+
export function updateSmartLinksCustomization(patch) {
|
|
41
|
+
customization = mergeCustomization(customization, patch);
|
|
42
|
+
listeners.forEach((listener) => listener());
|
|
43
|
+
return customization;
|
|
44
|
+
}
|
|
45
|
+
/** @deprecated Use applySmartLinksCustomization or updateSmartLinksCustomization */
|
|
46
|
+
export function setSmartLinksCustomization(patch) {
|
|
47
|
+
return applySmartLinksCustomization(patch);
|
|
48
|
+
}
|
|
49
|
+
export function resetSmartLinksCustomization() {
|
|
50
|
+
customization = { ...defaultSmartLinksCustomization };
|
|
51
|
+
listeners.forEach((listener) => listener());
|
|
52
|
+
}
|
|
53
|
+
export function subscribeSmartLinksCustomization(listener) {
|
|
54
|
+
listeners.add(listener);
|
|
55
|
+
return () => listeners.delete(listener);
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/customization/store.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,8BAA8B,EAAE,MAAM,YAAY,CAAC;AAE5D,SAAS,aAAa,CAAC,KAAc;IACnC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,MAAM,UAAU,kBAAkB,CAChC,IAA6B,EAC7B,KAA4C;IAE5C,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IACxB,OAAO,SAAS,CAAC,IAAI,EAAE,KAAK,CAA4B,CAAC;AAC3D,CAAC;AAED,SAAS,SAAS,CAAI,IAAO,EAAE,KAAqB;IAClD,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;QAClD,OAAQ,KAAW,IAAI,IAAI,CAAC;IAC9B,CAAC;IACD,MAAM,MAAM,GAAG,EAAE,GAAG,IAAI,EAA6B,CAAC;IACtD,MAAM,WAAW,GAAG,KAAgC,CAAC;IACrD,KAAK,MAAM,GAAG,IAAI,MAAM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M,UAAU,4BAA4B;IAC1C,aAAa,GAAG,EAAE,GAAG,8BAA8B,EAAE,CAAC;IACtD,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,gCAAgC,CAAC,QAAkB;IACjE,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACxB,OAAO,GAAG,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import type { SmartLinksTheme } from './types';
|
|
2
|
+
export declare function createThemedStyles(theme: SmartLinksTheme): {
|
|
3
|
+
screen: {
|
|
4
|
+
flex: number;
|
|
5
|
+
backgroundColor: string;
|
|
6
|
+
padding: number;
|
|
7
|
+
gap: number;
|
|
8
|
+
};
|
|
9
|
+
center: {
|
|
10
|
+
flex: number;
|
|
11
|
+
alignItems: "center";
|
|
12
|
+
justifyContent: "center";
|
|
13
|
+
backgroundColor: string;
|
|
14
|
+
};
|
|
15
|
+
title: {
|
|
16
|
+
fontSize: number;
|
|
17
|
+
fontWeight: "normal" | "bold" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | "ultralight" | "thin" | "light" | "medium" | "regular" | "semibold" | "condensedBold" | "condensed" | "heavy" | "black" | undefined;
|
|
18
|
+
color: string;
|
|
19
|
+
fontFamily: string | undefined;
|
|
20
|
+
};
|
|
21
|
+
body: {
|
|
22
|
+
fontSize: number;
|
|
23
|
+
fontWeight: "normal" | "bold" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | "ultralight" | "thin" | "light" | "medium" | "regular" | "semibold" | "condensedBold" | "condensed" | "heavy" | "black" | undefined;
|
|
24
|
+
color: string;
|
|
25
|
+
lineHeight: number;
|
|
26
|
+
fontFamily: string | undefined;
|
|
27
|
+
};
|
|
28
|
+
caption: {
|
|
29
|
+
fontSize: number;
|
|
30
|
+
color: string;
|
|
31
|
+
fontFamily: string | undefined;
|
|
32
|
+
};
|
|
33
|
+
link: {
|
|
34
|
+
color: string;
|
|
35
|
+
fontWeight: "normal" | "bold" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | "ultralight" | "thin" | "light" | "medium" | "regular" | "semibold" | "condensedBold" | "condensed" | "heavy" | "black" | undefined;
|
|
36
|
+
fontFamily: string | undefined;
|
|
37
|
+
};
|
|
38
|
+
input: {
|
|
39
|
+
minHeight: number;
|
|
40
|
+
borderWidth: number;
|
|
41
|
+
borderColor: string;
|
|
42
|
+
borderRadius: number;
|
|
43
|
+
padding: number;
|
|
44
|
+
backgroundColor: string;
|
|
45
|
+
color: string;
|
|
46
|
+
textAlignVertical: "top";
|
|
47
|
+
fontSize: number;
|
|
48
|
+
fontFamily: string | undefined;
|
|
49
|
+
};
|
|
50
|
+
inputSingle: {
|
|
51
|
+
borderWidth: number;
|
|
52
|
+
borderColor: string;
|
|
53
|
+
borderRadius: number;
|
|
54
|
+
padding: number;
|
|
55
|
+
backgroundColor: string;
|
|
56
|
+
color: string;
|
|
57
|
+
fontSize: number;
|
|
58
|
+
fontFamily: string | undefined;
|
|
59
|
+
};
|
|
60
|
+
button: {
|
|
61
|
+
backgroundColor: string;
|
|
62
|
+
padding: number;
|
|
63
|
+
borderRadius: number;
|
|
64
|
+
alignItems: "center";
|
|
65
|
+
justifyContent: "center";
|
|
66
|
+
minHeight: number;
|
|
67
|
+
};
|
|
68
|
+
buttonText: {
|
|
69
|
+
color: string;
|
|
70
|
+
fontWeight: "normal" | "bold" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | "ultralight" | "thin" | "light" | "medium" | "regular" | "semibold" | "condensedBold" | "condensed" | "heavy" | "black" | undefined;
|
|
71
|
+
fontSize: number;
|
|
72
|
+
fontFamily: string | undefined;
|
|
73
|
+
};
|
|
74
|
+
buttonSecondary: {
|
|
75
|
+
backgroundColor: string;
|
|
76
|
+
padding: number;
|
|
77
|
+
borderRadius: number;
|
|
78
|
+
alignItems: "center";
|
|
79
|
+
justifyContent: "center";
|
|
80
|
+
minHeight: number;
|
|
81
|
+
borderWidth: number;
|
|
82
|
+
borderColor: string;
|
|
83
|
+
};
|
|
84
|
+
buttonSecondaryText: {
|
|
85
|
+
color: string;
|
|
86
|
+
fontWeight: "normal" | "bold" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | "ultralight" | "thin" | "light" | "medium" | "regular" | "semibold" | "condensedBold" | "condensed" | "heavy" | "black" | undefined;
|
|
87
|
+
fontSize: number;
|
|
88
|
+
fontFamily: string | undefined;
|
|
89
|
+
};
|
|
90
|
+
card: {
|
|
91
|
+
padding: number;
|
|
92
|
+
borderRadius: number;
|
|
93
|
+
backgroundColor: string;
|
|
94
|
+
borderWidth: number;
|
|
95
|
+
borderColor: string;
|
|
96
|
+
};
|
|
97
|
+
row: {
|
|
98
|
+
flexDirection: "row";
|
|
99
|
+
alignItems: "center";
|
|
100
|
+
gap: number;
|
|
101
|
+
padding: number;
|
|
102
|
+
borderRadius: number;
|
|
103
|
+
backgroundColor: string;
|
|
104
|
+
borderWidth: number;
|
|
105
|
+
borderColor: string;
|
|
106
|
+
};
|
|
107
|
+
empty: {
|
|
108
|
+
textAlign: "center";
|
|
109
|
+
color: string;
|
|
110
|
+
marginTop: number;
|
|
111
|
+
fontSize: number;
|
|
112
|
+
fontFamily: string | undefined;
|
|
113
|
+
};
|
|
114
|
+
divider: {
|
|
115
|
+
borderBottomWidth: number;
|
|
116
|
+
borderBottomColor: string;
|
|
117
|
+
paddingVertical: number;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
export type ThemedStyles = ReturnType<typeof createThemedStyles>;
|
|
121
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/customization/styles.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwHxD;AAED,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
export function createThemedStyles(theme) {
|
|
3
|
+
const { colors, typography, spacing, radii } = theme;
|
|
4
|
+
return StyleSheet.create({
|
|
5
|
+
screen: {
|
|
6
|
+
flex: 1,
|
|
7
|
+
backgroundColor: colors.background,
|
|
8
|
+
padding: spacing.lg,
|
|
9
|
+
gap: spacing.md,
|
|
10
|
+
},
|
|
11
|
+
center: {
|
|
12
|
+
flex: 1,
|
|
13
|
+
alignItems: 'center',
|
|
14
|
+
justifyContent: 'center',
|
|
15
|
+
backgroundColor: colors.background,
|
|
16
|
+
},
|
|
17
|
+
title: {
|
|
18
|
+
fontSize: typography.titleSize,
|
|
19
|
+
fontWeight: typography.titleWeight,
|
|
20
|
+
color: colors.text,
|
|
21
|
+
fontFamily: typography.fontFamily,
|
|
22
|
+
},
|
|
23
|
+
body: {
|
|
24
|
+
fontSize: typography.bodySize,
|
|
25
|
+
fontWeight: typography.bodyWeight,
|
|
26
|
+
color: colors.text,
|
|
27
|
+
lineHeight: typography.bodySize * 1.5,
|
|
28
|
+
fontFamily: typography.fontFamily,
|
|
29
|
+
},
|
|
30
|
+
caption: {
|
|
31
|
+
fontSize: typography.captionSize,
|
|
32
|
+
color: colors.muted,
|
|
33
|
+
fontFamily: typography.fontFamily,
|
|
34
|
+
},
|
|
35
|
+
link: {
|
|
36
|
+
color: colors.link,
|
|
37
|
+
fontWeight: typography.buttonWeight,
|
|
38
|
+
fontFamily: typography.fontFamily,
|
|
39
|
+
},
|
|
40
|
+
input: {
|
|
41
|
+
minHeight: 120,
|
|
42
|
+
borderWidth: 1,
|
|
43
|
+
borderColor: colors.border,
|
|
44
|
+
borderRadius: radii.md,
|
|
45
|
+
padding: spacing.md,
|
|
46
|
+
backgroundColor: colors.inputBackground,
|
|
47
|
+
color: colors.text,
|
|
48
|
+
textAlignVertical: 'top',
|
|
49
|
+
fontSize: typography.bodySize,
|
|
50
|
+
fontFamily: typography.fontFamily,
|
|
51
|
+
},
|
|
52
|
+
inputSingle: {
|
|
53
|
+
borderWidth: 1,
|
|
54
|
+
borderColor: colors.border,
|
|
55
|
+
borderRadius: radii.md,
|
|
56
|
+
padding: spacing.md,
|
|
57
|
+
backgroundColor: colors.inputBackground,
|
|
58
|
+
color: colors.text,
|
|
59
|
+
fontSize: typography.bodySize,
|
|
60
|
+
fontFamily: typography.fontFamily,
|
|
61
|
+
},
|
|
62
|
+
button: {
|
|
63
|
+
backgroundColor: colors.primary,
|
|
64
|
+
padding: spacing.md,
|
|
65
|
+
borderRadius: radii.md,
|
|
66
|
+
alignItems: 'center',
|
|
67
|
+
justifyContent: 'center',
|
|
68
|
+
minHeight: 48,
|
|
69
|
+
},
|
|
70
|
+
buttonText: {
|
|
71
|
+
color: colors.primaryForeground,
|
|
72
|
+
fontWeight: typography.buttonWeight,
|
|
73
|
+
fontSize: typography.bodySize,
|
|
74
|
+
fontFamily: typography.fontFamily,
|
|
75
|
+
},
|
|
76
|
+
buttonSecondary: {
|
|
77
|
+
backgroundColor: colors.surface,
|
|
78
|
+
padding: spacing.md,
|
|
79
|
+
borderRadius: radii.md,
|
|
80
|
+
alignItems: 'center',
|
|
81
|
+
justifyContent: 'center',
|
|
82
|
+
minHeight: 48,
|
|
83
|
+
borderWidth: 1,
|
|
84
|
+
borderColor: colors.border,
|
|
85
|
+
},
|
|
86
|
+
buttonSecondaryText: {
|
|
87
|
+
color: colors.primary,
|
|
88
|
+
fontWeight: typography.buttonWeight,
|
|
89
|
+
fontSize: typography.bodySize,
|
|
90
|
+
fontFamily: typography.fontFamily,
|
|
91
|
+
},
|
|
92
|
+
card: {
|
|
93
|
+
padding: spacing.md,
|
|
94
|
+
borderRadius: radii.md,
|
|
95
|
+
backgroundColor: colors.cardBackground,
|
|
96
|
+
borderWidth: 1,
|
|
97
|
+
borderColor: colors.border,
|
|
98
|
+
},
|
|
99
|
+
row: {
|
|
100
|
+
flexDirection: 'row',
|
|
101
|
+
alignItems: 'center',
|
|
102
|
+
gap: spacing.md,
|
|
103
|
+
padding: spacing.md,
|
|
104
|
+
borderRadius: radii.md,
|
|
105
|
+
backgroundColor: colors.cardBackground,
|
|
106
|
+
borderWidth: 1,
|
|
107
|
+
borderColor: colors.border,
|
|
108
|
+
},
|
|
109
|
+
empty: {
|
|
110
|
+
textAlign: 'center',
|
|
111
|
+
color: colors.muted,
|
|
112
|
+
marginTop: spacing.xl,
|
|
113
|
+
fontSize: typography.bodySize,
|
|
114
|
+
fontFamily: typography.fontFamily,
|
|
115
|
+
},
|
|
116
|
+
divider: {
|
|
117
|
+
borderBottomWidth: 1,
|
|
118
|
+
borderBottomColor: colors.border,
|
|
119
|
+
paddingVertical: spacing.md,
|
|
120
|
+
},
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../src/customization/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,MAAM,UAAU,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;YACnC,QAAQ,EAAE,UAAU,CAAC,QAAQ;YAC7B,UAAU,EAAE,UAAU,CAAC,UAAU;SAClC;QACD,IAAI,EAAE;YACJ,OAAO,EAAE,OAAO,CAAC,EAAE;YACnB,YAAY,EAAE,KAAK,CAAC,EAAE;YACtB,eAAe,EAAE,MAAM,CAAC,cAAc;YACtC,WAAW,EAAE,CAAC;YACd,WAAW,EAAE,MAAM,CAAC,MAAM;SAC3B;QACD,GAAG,EAAE;YACH,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,OAAO,CAAC,EAAE;YACf,OAAO,EAAE,OAAO,CAAC,EAAE;YACnB,YAAY,EAAE,KAAK,CAAC,EAAE;YACtB,eAAe,EAAE,MAAM,CAAC,cAAc;YACtC,WAAW,EAAE,CAAC;YACd,WAAW,EAAE,MAAM,CAAC,MAAM;SAC3B;QACD,KAAK,EAAE;YACL,SAAS,EAAE,QAAQ;YACnB,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,SAAS,EAAE,OAAO,CAAC,EAAE;YACrB,QAAQ,EAAE,UAAU,CAAC,QAAQ;YAC7B,UAAU,EAAE,UAAU,CAAC,UAAU;SAClC;QACD,OAAO,EAAE;YACP,iBAAiB,EAAE,CAAC;YACpB,iBAAiB,EAAE,MAAM,CAAC,MAAM;YAChC,eAAe,EAAE,OAAO,CAAC,EAAE;SAC5B;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import type { TextStyle, ViewStyle } from 'react-native';
|
|
2
|
+
import type { Edge } from 'react-native-safe-area-context';
|
|
3
|
+
export type SmartLinksColors = {
|
|
4
|
+
primary: string;
|
|
5
|
+
primaryForeground: string;
|
|
6
|
+
background: string;
|
|
7
|
+
surface: string;
|
|
8
|
+
text: string;
|
|
9
|
+
muted: string;
|
|
10
|
+
border: string;
|
|
11
|
+
danger: string;
|
|
12
|
+
success: string;
|
|
13
|
+
link: string;
|
|
14
|
+
inputBackground: string;
|
|
15
|
+
cardBackground: string;
|
|
16
|
+
bannerFallback: string;
|
|
17
|
+
};
|
|
18
|
+
export type SmartLinksTypography = {
|
|
19
|
+
fontFamily?: string;
|
|
20
|
+
titleSize: number;
|
|
21
|
+
bodySize: number;
|
|
22
|
+
captionSize: number;
|
|
23
|
+
titleWeight: TextStyle['fontWeight'];
|
|
24
|
+
bodyWeight: TextStyle['fontWeight'];
|
|
25
|
+
buttonWeight: TextStyle['fontWeight'];
|
|
26
|
+
};
|
|
27
|
+
export type SmartLinksSpacing = {
|
|
28
|
+
xs: number;
|
|
29
|
+
sm: number;
|
|
30
|
+
md: number;
|
|
31
|
+
lg: number;
|
|
32
|
+
xl: number;
|
|
33
|
+
};
|
|
34
|
+
export type SmartLinksRadii = {
|
|
35
|
+
sm: number;
|
|
36
|
+
md: number;
|
|
37
|
+
lg: number;
|
|
38
|
+
full: number;
|
|
39
|
+
};
|
|
40
|
+
export type SmartLinksTheme = {
|
|
41
|
+
colors: SmartLinksColors;
|
|
42
|
+
typography: SmartLinksTypography;
|
|
43
|
+
spacing: SmartLinksSpacing;
|
|
44
|
+
radii: SmartLinksRadii;
|
|
45
|
+
};
|
|
46
|
+
export type SmartLinksNavigationConfig = {
|
|
47
|
+
feedback: string;
|
|
48
|
+
apps: string;
|
|
49
|
+
community: string;
|
|
50
|
+
blogs: string;
|
|
51
|
+
};
|
|
52
|
+
export type SmartLinksAppMetadata = {
|
|
53
|
+
appVersion?: string;
|
|
54
|
+
isPremium?: boolean;
|
|
55
|
+
};
|
|
56
|
+
export type SmartLinksFeedbackStrings = {
|
|
57
|
+
title: string;
|
|
58
|
+
contentPlaceholder: string;
|
|
59
|
+
emailPlaceholder: string;
|
|
60
|
+
submit: string;
|
|
61
|
+
submitting: string;
|
|
62
|
+
emptyContentTitle: string;
|
|
63
|
+
emptyContentMessage: string;
|
|
64
|
+
successTitle: string;
|
|
65
|
+
successMessage: string;
|
|
66
|
+
errorTitle: string;
|
|
67
|
+
attachFile: string;
|
|
68
|
+
attachmentLabel: string;
|
|
69
|
+
removeAttachment: string;
|
|
70
|
+
pickErrorTitle: string;
|
|
71
|
+
pickErrorMessage: string;
|
|
72
|
+
};
|
|
73
|
+
export type SmartLinksAppsStrings = {
|
|
74
|
+
empty: string;
|
|
75
|
+
defaultAppName: string;
|
|
76
|
+
};
|
|
77
|
+
export type SmartLinksCommunityStrings = {
|
|
78
|
+
signInGoogle: string;
|
|
79
|
+
signInRequiredTitle: string;
|
|
80
|
+
signInRequiredMessage: string;
|
|
81
|
+
back: string;
|
|
82
|
+
empty: string;
|
|
83
|
+
defaultCommunityName: string;
|
|
84
|
+
defaultPostTitle: string;
|
|
85
|
+
};
|
|
86
|
+
export type SmartLinksBlogsStrings = {
|
|
87
|
+
back: string;
|
|
88
|
+
empty: string;
|
|
89
|
+
defaultPostTitle: string;
|
|
90
|
+
};
|
|
91
|
+
export type SmartLinksAdsStrings = {
|
|
92
|
+
defaultAdName: string;
|
|
93
|
+
};
|
|
94
|
+
export type SmartLinksLocale = {
|
|
95
|
+
feedback: SmartLinksFeedbackStrings;
|
|
96
|
+
apps: SmartLinksAppsStrings;
|
|
97
|
+
community: SmartLinksCommunityStrings;
|
|
98
|
+
blogs: SmartLinksBlogsStrings;
|
|
99
|
+
ads: SmartLinksAdsStrings;
|
|
100
|
+
};
|
|
101
|
+
export type SmartLinksCustomization = {
|
|
102
|
+
theme: SmartLinksTheme;
|
|
103
|
+
locale: SmartLinksLocale;
|
|
104
|
+
navigation: SmartLinksNavigationConfig;
|
|
105
|
+
metadata: SmartLinksAppMetadata;
|
|
106
|
+
};
|
|
107
|
+
/** Partial deep merge for host-app overrides */
|
|
108
|
+
export type DeepPartial<T> = {
|
|
109
|
+
[K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K];
|
|
110
|
+
};
|
|
111
|
+
export type SmartLinksScreenProps = {
|
|
112
|
+
style?: ViewStyle;
|
|
113
|
+
contentContainerStyle?: ViewStyle;
|
|
114
|
+
testID?: string;
|
|
115
|
+
/** Safe area edges — default `['top', 'bottom']`. Use `['bottom']` when a parent supplies the top inset. */
|
|
116
|
+
safeAreaEdges?: Edge[];
|
|
117
|
+
};
|
|
118
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/customization/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AAE3D,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC;IACrC,UAAU,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC;IACpC,YAAY,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IAC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CAAC,EAAE,SAAS,CAAC;IAClB,qBAAqB,CAAC,EAAE,SAAS,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4GAA4G;IAC5G,aAAa,CAAC,EAAE,IAAI,EAAE,CAAC;CACxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/customization/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type SmartLinksFeedbackAttachment = {
|
|
2
|
+
uri: string;
|
|
3
|
+
name: string;
|
|
4
|
+
type: string;
|
|
5
|
+
};
|
|
6
|
+
export type SmartLinksFeedbackSubmitPayload = {
|
|
7
|
+
content: string;
|
|
8
|
+
platform: string;
|
|
9
|
+
version: string;
|
|
10
|
+
email?: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
is_premium?: boolean | string | number;
|
|
13
|
+
/** Local file path for native bridge (derived from attachment.uri when omitted). */
|
|
14
|
+
attachmentPath?: string;
|
|
15
|
+
/** File upload for JS HTTP fallback. */
|
|
16
|
+
attachment?: SmartLinksFeedbackAttachment;
|
|
17
|
+
};
|
|
18
|
+
export declare function toFeedbackAttachmentPath(uri: string): string;
|
|
19
|
+
//# sourceMappingURL=feedback.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedback.d.ts","sourceRoot":"","sources":["../src/feedback.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,4BAA4B,GAAG;IACzC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IACvC,oFAAoF;IACpF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,wCAAwC;IACxC,UAAU,CAAC,EAAE,4BAA4B,CAAC;CAC3C,CAAC;AAEF,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE5D"}
|
package/dist/feedback.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedback.js","sourceRoot":"","sources":["../src/feedback.ts"],"names":[],"mappings":"AAmBA,MAAM,UAAU,wBAAwB,CAAC,GAAW;IAClD,OAAO,GAAG,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare class SmartLinksIdentity {
|
|
2
|
+
static getAppUserId(): Promise<string | null>;
|
|
3
|
+
static getAttributionId(): Promise<string | null>;
|
|
4
|
+
static setAttributionId(value: string): Promise<void>;
|
|
5
|
+
static getTrackingData(): Promise<Record<string, string>>;
|
|
6
|
+
static savePromoExpiration(date: Date): Promise<void>;
|
|
7
|
+
static isPromoActive(): Promise<boolean>;
|
|
8
|
+
static getPromoExpiration(): Promise<Date | null>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=identity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../src/identity.ts"],"names":[],"mappings":"AAMA,qBAAa,kBAAkB;WAChB,YAAY,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;WAQtC,gBAAgB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;WAI1C,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;WAI9C,eAAe,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;WASlD,mBAAmB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;WAI9C,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC;WAMjC,kBAAkB,IAAI,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;CAIxD"}
|
package/dist/identity.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import AsyncStorage from '@react-native-async-storage/async-storage';
|
|
2
|
+
import { nativeGetAppUserId } from 'react-native-smartlinks';
|
|
3
|
+
const ATTRIBUTION_KEY = 'smartlinks_attribution_id';
|
|
4
|
+
const PROMO_EXPIRATION_KEY = 'smartlinks_promo_expiration';
|
|
5
|
+
export class SmartLinksIdentity {
|
|
6
|
+
static async getAppUserId() {
|
|
7
|
+
try {
|
|
8
|
+
return await nativeGetAppUserId();
|
|
9
|
+
}
|
|
10
|
+
catch {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
static async getAttributionId() {
|
|
15
|
+
return AsyncStorage.getItem(ATTRIBUTION_KEY);
|
|
16
|
+
}
|
|
17
|
+
static async setAttributionId(value) {
|
|
18
|
+
await AsyncStorage.setItem(ATTRIBUTION_KEY, value);
|
|
19
|
+
}
|
|
20
|
+
static async getTrackingData() {
|
|
21
|
+
const data = {};
|
|
22
|
+
const userId = await this.getAppUserId();
|
|
23
|
+
if (userId)
|
|
24
|
+
data.app_user_id = userId;
|
|
25
|
+
const attributionId = await this.getAttributionId();
|
|
26
|
+
if (attributionId)
|
|
27
|
+
data.attribution_id = attributionId;
|
|
28
|
+
return data;
|
|
29
|
+
}
|
|
30
|
+
static async savePromoExpiration(date) {
|
|
31
|
+
await AsyncStorage.setItem(PROMO_EXPIRATION_KEY, date.toISOString());
|
|
32
|
+
}
|
|
33
|
+
static async isPromoActive() {
|
|
34
|
+
const raw = await AsyncStorage.getItem(PROMO_EXPIRATION_KEY);
|
|
35
|
+
if (!raw)
|
|
36
|
+
return false;
|
|
37
|
+
return new Date() < new Date(raw);
|
|
38
|
+
}
|
|
39
|
+
static async getPromoExpiration() {
|
|
40
|
+
const raw = await AsyncStorage.getItem(PROMO_EXPIRATION_KEY);
|
|
41
|
+
return raw ? new Date(raw) : null;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=identity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.js","sourceRoot":"","sources":["../src/identity.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,2CAA2C,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,MAAM,eAAe,GAAG,2BAA2B,CAAC;AACpD,MAAM,oBAAoB,GAAG,6BAA6B,CAAC;AAE3D,MAAM,OAAO,kBAAkB;IAC7B,MAAM,CAAC,KAAK,CAAC,YAAY;QACvB,IAAI,CAAC;YACH,OAAO,MAAM,kBAAkB,EAAE,CAAC;QACpC,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,gBAAgB;QAC3B,OAAO,YAAY,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;IAC/C,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,KAAa;QACzC,MAAM,YAAY,CAAC,OAAO,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;IACrD,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,eAAe;QAC1B,MAAM,IAAI,GAA2B,EAAE,CAAC;QACxC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;QACzC,IAAI,MAAM;YAAE,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC;QACtC,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACpD,IAAI,aAAa;YAAE,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;QACvD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAAC,IAAU;QACzC,MAAM,YAAY,CAAC,OAAO,CAAC,oBAAoB,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;IACvE,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,aAAa;QACxB,MAAM,GAAG,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;QAC7D,IAAI,CAAC,GAAG;YAAE,OAAO,KAAK,CAAC;QACvB,OAAO,IAAI,IAAI,EAAE,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC;IACpC,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,kBAAkB;QAC7B,MAAM,GAAG,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;QAC7D,OAAO,GAAG,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACpC,CAAC;CACF"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SmartLinksApi } from './api';
|
|
2
|
+
import { defaultConfig, SmartLinksConfig } from './config';
|
|
3
|
+
import { SmartLinksClient } from './client';
|
|
4
|
+
import { SmartLinksIdentity } from './identity';
|
|
5
|
+
export declare class SmartLinksCore {
|
|
6
|
+
private static ready;
|
|
7
|
+
static get isInitialized(): boolean;
|
|
8
|
+
static get config(): SmartLinksConfig;
|
|
9
|
+
static get client(): SmartLinksClient;
|
|
10
|
+
static initialize(options: {
|
|
11
|
+
apiKey: string;
|
|
12
|
+
isDebug?: boolean;
|
|
13
|
+
firebaseProject?: string;
|
|
14
|
+
language?: string;
|
|
15
|
+
baseUrlV1?: string;
|
|
16
|
+
baseUrlV2?: string;
|
|
17
|
+
useNativeApi?: boolean;
|
|
18
|
+
}): Promise<boolean>;
|
|
19
|
+
static requireInitialized(): void;
|
|
20
|
+
}
|
|
21
|
+
export { SmartLinksApi, SmartLinksConfig, SmartLinksIdentity, SmartLinksClient, defaultConfig };
|
|
22
|
+
export { SmartLinksNativeApi } from './native-api';
|
|
23
|
+
export * from './feedback';
|
|
24
|
+
export * from './ai';
|
|
25
|
+
export * from './customization';
|
|
26
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,qBAAa,cAAc;IACzB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAS;IAE7B,MAAM,KAAK,aAAa,IAAI,OAAO,CAElC;IAED,MAAM,KAAK,MAAM,IAAI,gBAAgB,CAEpC;IAED,MAAM,KAAK,MAAM,IAAI,gBAAgB,CAEpC;WAEY,UAAU,CAAC,OAAO,EAAE;QAC/B,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,YAAY,CAAC,EAAE,OAAO,CAAC;KACxB,GAAG,OAAO,CAAC,OAAO,CAAC;IAiBpB,MAAM,CAAC,kBAAkB,IAAI,IAAI;CAKlC;AAED,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,aAAa,EAAE,CAAC;AAChG,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,cAAc,YAAY,CAAC;AAC3B,cAAc,MAAM,CAAC;AACrB,cAAc,iBAAiB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { nativeInitialize } from 'react-native-smartlinks';
|
|
2
|
+
import { SmartLinksApi } from './api';
|
|
3
|
+
import { defaultConfig } from './config';
|
|
4
|
+
import { SmartLinksClient } from './client';
|
|
5
|
+
import { SmartLinksIdentity } from './identity';
|
|
6
|
+
export class SmartLinksCore {
|
|
7
|
+
static get isInitialized() {
|
|
8
|
+
return SmartLinksCore.ready;
|
|
9
|
+
}
|
|
10
|
+
static get config() {
|
|
11
|
+
return SmartLinksClient.instance.config;
|
|
12
|
+
}
|
|
13
|
+
static get client() {
|
|
14
|
+
return SmartLinksClient.instance;
|
|
15
|
+
}
|
|
16
|
+
static async initialize(options) {
|
|
17
|
+
const config = {
|
|
18
|
+
...defaultConfig(options.apiKey),
|
|
19
|
+
isDebug: options.isDebug ?? false,
|
|
20
|
+
firebaseProject: options.firebaseProject,
|
|
21
|
+
language: options.language,
|
|
22
|
+
baseUrlV1: options.baseUrlV1,
|
|
23
|
+
baseUrlV2: options.baseUrlV2,
|
|
24
|
+
useNativeApi: options.useNativeApi ?? true,
|
|
25
|
+
};
|
|
26
|
+
SmartLinksClient.create(config);
|
|
27
|
+
const nativeReady = await nativeInitialize(config.apiKey, config.isDebug ?? false);
|
|
28
|
+
SmartLinksCore.ready = nativeReady;
|
|
29
|
+
return nativeReady;
|
|
30
|
+
}
|
|
31
|
+
static requireInitialized() {
|
|
32
|
+
if (!SmartLinksCore.ready) {
|
|
33
|
+
throw new Error('Call SmartLinks.initialize() first');
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
SmartLinksCore.ready = false;
|
|
38
|
+
export { SmartLinksApi, SmartLinksIdentity, SmartLinksClient, defaultConfig };
|
|
39
|
+
export { SmartLinksNativeApi } from './native-api';
|
|
40
|
+
export * from './feedback';
|
|
41
|
+
export * from './ai';
|
|
42
|
+
export * from './customization';
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,aAAa,EAAoB,MAAM,UAAU,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,OAAO,cAAc;IAGzB,MAAM,KAAK,aAAa;QACtB,OAAO,cAAc,CAAC,KAAK,CAAC;IAC9B,CAAC;IAED,MAAM,KAAK,MAAM;QACf,OAAO,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC;IAC1C,CAAC;IAED,MAAM,KAAK,MAAM;QACf,OAAO,gBAAgB,CAAC,QAAQ,CAAC;IACnC,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,OAQvB;QACC,MAAM,MAAM,GAAqB;YAC/B,GAAG,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC;YAChC,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,KAAK;YACjC,eAAe,EAAE,OAAO,CAAC,eAAe;YACxC,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,YAAY,EAAE,OAAO,CAAC,YAAY,IAAI,IAAI;SAC3C,CAAC;QAEF,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAChC,MAAM,WAAW,GAAG,MAAM,gBAAgB,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,IAAI,KAAK,CAAC,CAAC;QACnF,cAAc,CAAC,KAAK,GAAG,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