@octopus-community/react-native 1.0.7 → 1.0.8
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/android/src/main/java/com/octopuscommunity/octopusreactnativesdk/OctopusSDKInitializer.kt +31 -0
- package/android/src/main/java/com/octopuscommunity/octopusreactnativesdk/OctopusUIActivity.kt +31 -19
- package/android/src/main/java/com/octopuscommunity/octopusreactnativesdk/OctopusUIConfiguration.kt +6 -0
- package/android/src/main/java/com/octopuscommunity/octopusreactnativesdk/OctopusUIConfigurationManager.kt +12 -0
- package/ios/OctopusReactNativeSdk.swift +9 -1
- package/ios/OctopusSDKInitializer.swift +32 -0
- package/ios/OctopusUIConfiguration.swift +6 -0
- package/ios/OctopusUIManager.swift +51 -10
- package/lib/module/initialize.js +4 -0
- package/lib/module/initialize.js.map +1 -1
- package/lib/typescript/src/initialize.d.ts +13 -0
- package/lib/typescript/src/initialize.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/initialize.ts +14 -0
package/android/src/main/java/com/octopuscommunity/octopusreactnativesdk/OctopusSDKInitializer.kt
CHANGED
|
@@ -23,6 +23,10 @@ class OctopusSDKInitializer {
|
|
|
23
23
|
val themeConfig = parseThemeConfig(options)
|
|
24
24
|
OctopusThemeManager.setThemeConfig(themeConfig)
|
|
25
25
|
|
|
26
|
+
// Store UI configuration separately
|
|
27
|
+
val uiConfiguration = parseUIConfiguration(options)
|
|
28
|
+
OctopusUIConfigurationManager.setUIConfiguration(uiConfiguration)
|
|
29
|
+
|
|
26
30
|
OctopusSDK.initialize(
|
|
27
31
|
context = context,
|
|
28
32
|
apiKey = apiKey,
|
|
@@ -118,6 +122,33 @@ class OctopusSDKInitializer {
|
|
|
118
122
|
return null
|
|
119
123
|
}
|
|
120
124
|
|
|
125
|
+
fun parseUIConfiguration(options: ReadableMap): OctopusUIConfiguration? {
|
|
126
|
+
val uiMap = options.getMap("ui")
|
|
127
|
+
var bottomContentPadding: Double? = null
|
|
128
|
+
|
|
129
|
+
uiMap?.let { uiOptions ->
|
|
130
|
+
val candidateKeys = listOf("bottomSafeAreaInset", "bottomPadding", "contentPadding", "contentPaddingBottom")
|
|
131
|
+
for (key in candidateKeys) {
|
|
132
|
+
if (uiOptions.hasKey(key)) {
|
|
133
|
+
bottomContentPadding = try {
|
|
134
|
+
uiOptions.getDouble(key).coerceAtLeast(0.0)
|
|
135
|
+
} catch (e: Exception) {
|
|
136
|
+
null
|
|
137
|
+
}
|
|
138
|
+
if (bottomContentPadding != null) {
|
|
139
|
+
break
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
return if (bottomContentPadding != null) {
|
|
146
|
+
OctopusUIConfiguration(bottomContentPadding = bottomContentPadding)
|
|
147
|
+
} else {
|
|
148
|
+
null
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
121
152
|
private fun parsePreProcessedFontsConfig(parsedConfig: ReadableMap): OctopusFontsConfig? {
|
|
122
153
|
val textStylesMap = parsedConfig.getMap("textStyles")
|
|
123
154
|
val textStyles = mutableMapOf<String, OctopusTextStyleConfig>()
|
package/android/src/main/java/com/octopuscommunity/octopusreactnativesdk/OctopusUIActivity.kt
CHANGED
|
@@ -12,7 +12,9 @@ import android.util.Log
|
|
|
12
12
|
import androidx.activity.ComponentActivity
|
|
13
13
|
import androidx.activity.compose.setContent
|
|
14
14
|
import androidx.compose.foundation.layout.Box
|
|
15
|
+
import androidx.compose.foundation.layout.PaddingValues
|
|
15
16
|
import androidx.compose.foundation.layout.fillMaxSize
|
|
17
|
+
import androidx.compose.foundation.layout.padding
|
|
16
18
|
import androidx.compose.runtime.Composable
|
|
17
19
|
import androidx.compose.runtime.LaunchedEffect
|
|
18
20
|
import androidx.compose.runtime.getValue
|
|
@@ -20,6 +22,7 @@ import androidx.compose.runtime.mutableStateOf
|
|
|
20
22
|
import androidx.compose.runtime.remember
|
|
21
23
|
import androidx.compose.runtime.setValue
|
|
22
24
|
import androidx.compose.ui.Modifier
|
|
25
|
+
import androidx.compose.ui.unit.Dp
|
|
23
26
|
import androidx.compose.ui.graphics.Color
|
|
24
27
|
import androidx.compose.ui.graphics.asImageBitmap
|
|
25
28
|
import androidx.compose.ui.graphics.painter.BitmapPainter
|
|
@@ -32,11 +35,13 @@ import com.octopuscommunity.sdk.ui.OctopusDrawablesDefaults
|
|
|
32
35
|
import com.octopuscommunity.sdk.ui.OctopusTheme
|
|
33
36
|
import com.octopuscommunity.sdk.ui.OctopusTypographyDefaults
|
|
34
37
|
import com.octopuscommunity.sdk.ui.OctopusTypography
|
|
38
|
+
import com.octopuscommunity.sdk.ui.home.OctopusHomeDefaults
|
|
35
39
|
import com.octopuscommunity.sdk.ui.components.OctopusNavigationHandler
|
|
36
40
|
import androidx.compose.ui.text.TextStyle
|
|
37
41
|
import androidx.compose.ui.text.font.FontFamily
|
|
38
42
|
import androidx.compose.ui.text.font.FontWeight
|
|
39
43
|
import androidx.compose.ui.unit.sp
|
|
44
|
+
import androidx.compose.ui.unit.dp
|
|
40
45
|
import com.octopuscommunity.sdk.ui.home.OctopusHomeScreen
|
|
41
46
|
import com.octopuscommunity.sdk.ui.octopusComposables
|
|
42
47
|
import com.octopuscommunity.sdk.ui.octopusDarkColorScheme
|
|
@@ -151,14 +156,18 @@ private fun OctopusUI(onBack: () -> Unit) {
|
|
|
151
156
|
|
|
152
157
|
// Create typography based on theme config
|
|
153
158
|
val typography = createCustomTypography(themeConfig)
|
|
159
|
+
val uiConfiguration = OctopusUIConfigurationManager.getUIConfiguration()
|
|
154
160
|
|
|
155
|
-
// Apply theme with custom colors, logo, and
|
|
161
|
+
// Apply theme with custom colors, logo, typography, and content padding
|
|
156
162
|
OctopusTheme(
|
|
157
163
|
colorScheme = finalColorScheme,
|
|
158
164
|
drawables = drawables,
|
|
159
165
|
typography = typography
|
|
160
166
|
) {
|
|
161
|
-
OctopusUIContent(
|
|
167
|
+
OctopusUIContent(
|
|
168
|
+
bottomContentPadding = uiConfiguration?.bottomContentPadding?.toFloat()?.dp,
|
|
169
|
+
onBack = onBack
|
|
170
|
+
)
|
|
162
171
|
}
|
|
163
172
|
}
|
|
164
173
|
|
|
@@ -213,7 +222,7 @@ private fun createTextStyle(textStyleConfig: OctopusTextStyleConfig?, defaultSty
|
|
|
213
222
|
|
|
214
223
|
|
|
215
224
|
@Composable
|
|
216
|
-
private fun OctopusUIContent(onBack: () -> Unit) {
|
|
225
|
+
private fun OctopusUIContent(bottomContentPadding: Dp?, onBack: () -> Unit) {
|
|
217
226
|
Box(modifier = Modifier.fillMaxSize()) {
|
|
218
227
|
val navController = rememberNavController()
|
|
219
228
|
|
|
@@ -222,23 +231,26 @@ private fun OctopusUIContent(onBack: () -> Unit) {
|
|
|
222
231
|
startDestination = "OctopusHome"
|
|
223
232
|
) {
|
|
224
233
|
composable(route = "OctopusHome") {
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
}
|
|
235
|
-
) {
|
|
236
|
-
OctopusHomeScreen(
|
|
237
|
-
navController = navController,
|
|
238
|
-
backIcon = true,
|
|
239
|
-
onBack = onBack
|
|
240
|
-
)
|
|
234
|
+
OctopusNavigationHandler(
|
|
235
|
+
navigateToLogin = {
|
|
236
|
+
OctopusEventEmitter.instance?.emitLoginRequired()
|
|
237
|
+
},
|
|
238
|
+
navigateToProfileEdit = { fieldToEdit ->
|
|
239
|
+
OctopusEventEmitter.instance?.emitEditUser(fieldToEdit)
|
|
240
|
+
},
|
|
241
|
+
navigateToClientObject = {
|
|
242
|
+
// TODO : Bridge Post react
|
|
241
243
|
}
|
|
244
|
+
) {
|
|
245
|
+
OctopusHomeScreen(
|
|
246
|
+
navController = navController,
|
|
247
|
+
backIcon = true,
|
|
248
|
+
floatingActionsPadding = OctopusHomeDefaults.floatingActionsPadding(
|
|
249
|
+
bottom = bottomContentPadding ?: 16.dp
|
|
250
|
+
),
|
|
251
|
+
onBack = onBack
|
|
252
|
+
)
|
|
253
|
+
}
|
|
242
254
|
}
|
|
243
255
|
octopusComposables(
|
|
244
256
|
navController = navController,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
package com.octopuscommunity.octopusreactnativesdk
|
|
2
|
+
|
|
3
|
+
object OctopusUIConfigurationManager {
|
|
4
|
+
private var uiConfiguration: OctopusUIConfiguration? = null
|
|
5
|
+
|
|
6
|
+
fun setUIConfiguration(config: OctopusUIConfiguration?) {
|
|
7
|
+
uiConfiguration = config
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
fun getUIConfiguration(): OctopusUIConfiguration? = uiConfiguration
|
|
11
|
+
}
|
|
12
|
+
|
|
@@ -17,6 +17,7 @@ class OctopusReactNativeSdk: NSObject, RCTBridgeModule {
|
|
|
17
17
|
private var theme: OctopusTheme?
|
|
18
18
|
private var logoSource: [String: Any]?
|
|
19
19
|
private var fontConfiguration: [String: Any]?
|
|
20
|
+
private var uiConfiguration: OctopusUIConfiguration?
|
|
20
21
|
|
|
21
22
|
// MARK: - RCTBridgeModule
|
|
22
23
|
|
|
@@ -40,6 +41,7 @@ class OctopusReactNativeSdk: NSObject, RCTBridgeModule {
|
|
|
40
41
|
self.theme = sdkInitializer.parseTheme(from: options)
|
|
41
42
|
self.logoSource = sdkInitializer.getLogoSource(from: options)
|
|
42
43
|
self.fontConfiguration = sdkInitializer.getFontConfiguration(from: options)
|
|
44
|
+
self.uiConfiguration = sdkInitializer.parseUIConfiguration(from: options)
|
|
43
45
|
resolve(nil)
|
|
44
46
|
} catch {
|
|
45
47
|
reject("INITIALIZE_ERROR", "Failed to initialize Octopus SDK: \(error.localizedDescription)", error)
|
|
@@ -115,7 +117,13 @@ class OctopusReactNativeSdk: NSObject, RCTBridgeModule {
|
|
|
115
117
|
|
|
116
118
|
DispatchQueue.main.async {
|
|
117
119
|
do {
|
|
118
|
-
try self.uiManager.openUI(
|
|
120
|
+
try self.uiManager.openUI(
|
|
121
|
+
octopus: octopus,
|
|
122
|
+
theme: self.theme,
|
|
123
|
+
logoSource: self.logoSource,
|
|
124
|
+
fontConfiguration: self.fontConfiguration,
|
|
125
|
+
uiConfiguration: self.uiConfiguration
|
|
126
|
+
)
|
|
119
127
|
resolve(nil)
|
|
120
128
|
} catch {
|
|
121
129
|
reject("OPEN_UI_ERROR", error.localizedDescription, error)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Octopus
|
|
2
2
|
import OctopusUI
|
|
3
3
|
import SwiftUI
|
|
4
|
+
import CoreGraphics
|
|
4
5
|
|
|
5
6
|
class OctopusSDKInitializer {
|
|
6
7
|
func initialize(options: [String: Any], eventManager: OctopusEventManager) throws -> OctopusSDK {
|
|
@@ -144,6 +145,37 @@ class OctopusSDKInitializer {
|
|
|
144
145
|
return nil
|
|
145
146
|
}
|
|
146
147
|
|
|
148
|
+
func parseUIConfiguration(from options: [String: Any]) -> OctopusUIConfiguration? {
|
|
149
|
+
guard let uiOptions = options["ui"] as? [String: Any] else {
|
|
150
|
+
return nil
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
let supportedKeys = [
|
|
154
|
+
"bottomSafeAreaInset",
|
|
155
|
+
"bottomPadding",
|
|
156
|
+
"contentPadding",
|
|
157
|
+
"contentPaddingBottom",
|
|
158
|
+
]
|
|
159
|
+
|
|
160
|
+
var bottomInset: CGFloat?
|
|
161
|
+
|
|
162
|
+
for key in supportedKeys {
|
|
163
|
+
if let value = uiOptions[key] as? NSNumber {
|
|
164
|
+
bottomInset = CGFloat(truncating: value)
|
|
165
|
+
break
|
|
166
|
+
} else if let value = uiOptions[key] as? Double {
|
|
167
|
+
bottomInset = CGFloat(value)
|
|
168
|
+
break
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
guard let finalInset = bottomInset else {
|
|
173
|
+
return nil
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
return OctopusUIConfiguration(bottomSafeAreaInset: max(0, finalInset))
|
|
177
|
+
}
|
|
178
|
+
|
|
147
179
|
private func parseConnectionMode(from connectionModeMap: [String: Any], eventManager: OctopusEventManager) throws -> ConnectionMode {
|
|
148
180
|
let connectionModeType = connectionModeMap["type"] as? String
|
|
149
181
|
|
|
@@ -7,24 +7,35 @@ import React
|
|
|
7
7
|
class OctopusUIManager {
|
|
8
8
|
private weak var presentedViewController: UIViewController?
|
|
9
9
|
|
|
10
|
-
func openUI(
|
|
10
|
+
func openUI(
|
|
11
|
+
octopus: OctopusSDK,
|
|
12
|
+
theme: OctopusUI.OctopusTheme?,
|
|
13
|
+
logoSource: [String: Any]?,
|
|
14
|
+
fontConfiguration: [String: Any]?,
|
|
15
|
+
uiConfiguration: OctopusUIConfiguration?
|
|
16
|
+
) throws {
|
|
11
17
|
guard let presentingViewController = RCTPresentedViewController() else {
|
|
12
18
|
throw NSError(domain: "OPEN_UI_ERROR", code: 0, userInfo: [NSLocalizedDescriptionKey: "Could not find presenting view controller"])
|
|
13
19
|
}
|
|
14
20
|
|
|
15
21
|
// Create custom theme with font configuration
|
|
16
22
|
let customTheme = createCustomTheme(baseTheme: theme, fontConfiguration: fontConfiguration)
|
|
17
|
-
|
|
18
|
-
let
|
|
19
|
-
.environment(\.octopusTheme, customTheme)
|
|
20
|
-
|
|
21
|
-
let hostingController = UIHostingController(rootView: AnyView(octopusHomeScreen))
|
|
22
|
-
hostingController.modalPresentationStyle = .fullScreen
|
|
23
|
+
let bottomSafeAreaInset = uiConfiguration?.bottomSafeAreaInset
|
|
24
|
+
let initialTheme = (theme != nil || fontConfiguration != nil) ? customTheme : nil
|
|
23
25
|
|
|
26
|
+
let hostingController = UIHostingController(
|
|
27
|
+
rootView: makeHomeScreenView(octopus: octopus, theme: initialTheme, bottomSafeAreaInset: bottomSafeAreaInset)
|
|
28
|
+
)
|
|
29
|
+
hostingController.modalPresentationStyle = .fullScreen
|
|
30
|
+
|
|
24
31
|
// Apply theme if provided
|
|
25
32
|
if let _ = theme {
|
|
26
33
|
// Apply theme immediately (without logo) to avoid delay
|
|
27
|
-
hostingController.rootView =
|
|
34
|
+
hostingController.rootView = makeHomeScreenView(
|
|
35
|
+
octopus: octopus,
|
|
36
|
+
theme: customTheme,
|
|
37
|
+
bottomSafeAreaInset: bottomSafeAreaInset
|
|
38
|
+
)
|
|
28
39
|
|
|
29
40
|
// Then load logo asynchronously and update theme if logo loads
|
|
30
41
|
if let logoSource = logoSource {
|
|
@@ -36,7 +47,11 @@ class OctopusUIManager {
|
|
|
36
47
|
fonts: customTheme.fonts,
|
|
37
48
|
assets: OctopusUI.OctopusTheme.Assets(logo: logoImage)
|
|
38
49
|
)
|
|
39
|
-
hostingController?.rootView =
|
|
50
|
+
hostingController?.rootView = self.makeHomeScreenView(
|
|
51
|
+
octopus: octopus,
|
|
52
|
+
theme: updatedTheme,
|
|
53
|
+
bottomSafeAreaInset: bottomSafeAreaInset
|
|
54
|
+
)
|
|
40
55
|
} else {
|
|
41
56
|
// Theme is already applied, no need to do anything
|
|
42
57
|
}
|
|
@@ -53,7 +68,11 @@ class OctopusUIManager {
|
|
|
53
68
|
fonts: OctopusUI.OctopusTheme.Fonts(),
|
|
54
69
|
assets: OctopusUI.OctopusTheme.Assets(logo: logoImage)
|
|
55
70
|
)
|
|
56
|
-
hostingController?.rootView =
|
|
71
|
+
hostingController?.rootView = self.makeHomeScreenView(
|
|
72
|
+
octopus: octopus,
|
|
73
|
+
theme: logoTheme,
|
|
74
|
+
bottomSafeAreaInset: bottomSafeAreaInset
|
|
75
|
+
)
|
|
57
76
|
}
|
|
58
77
|
}
|
|
59
78
|
}
|
|
@@ -142,6 +161,28 @@ class OctopusUIManager {
|
|
|
142
161
|
presentedViewController = nil
|
|
143
162
|
}
|
|
144
163
|
}
|
|
164
|
+
|
|
165
|
+
private func makeHomeScreenView(octopus: OctopusSDK, theme: OctopusUI.OctopusTheme?, bottomSafeAreaInset: CGFloat?) -> AnyView {
|
|
166
|
+
if let inset = bottomSafeAreaInset {
|
|
167
|
+
if let theme = theme {
|
|
168
|
+
return AnyView(
|
|
169
|
+
OctopusHomeScreen(octopus: octopus, bottomSafeAreaInset: inset)
|
|
170
|
+
.environment(\.octopusTheme, theme)
|
|
171
|
+
)
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
return AnyView(OctopusHomeScreen(octopus: octopus, bottomSafeAreaInset: inset))
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
if let theme = theme {
|
|
178
|
+
return AnyView(
|
|
179
|
+
OctopusHomeScreen(octopus: octopus)
|
|
180
|
+
.environment(\.octopusTheme, theme)
|
|
181
|
+
)
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
return AnyView(OctopusHomeScreen(octopus: octopus))
|
|
185
|
+
}
|
|
145
186
|
|
|
146
187
|
private func createCustomTheme(baseTheme: OctopusUI.OctopusTheme?, fontConfiguration: [String: Any]?) -> OctopusUI.OctopusTheme {
|
|
147
188
|
// If no font configuration, return the base theme or default
|
package/lib/module/initialize.js
CHANGED
|
@@ -33,6 +33,10 @@ import { parseFontConfig } from "./internals/fontParser.js";
|
|
|
33
33
|
* 2. Dual mode colors - separate color sets for light and dark modes
|
|
34
34
|
*/
|
|
35
35
|
|
|
36
|
+
/**
|
|
37
|
+
* UI customization options for platform-specific layout adjustments.
|
|
38
|
+
*/
|
|
39
|
+
|
|
36
40
|
/**
|
|
37
41
|
* Configuration params for initializing the Octopus SDK.
|
|
38
42
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["OctopusReactNativeSdk","Appearance","colorSchemeManager","parseFontConfig","initialize","params","colorScheme","getColorScheme","processedTheme","theme","fonts","parsedConfig","undefined","paramsWithColorScheme","setTheme","startListening"],"sourceRoot":"../../src","sources":["initialize.ts"],"mappings":";;AAAA,SAASA,qBAAqB,QAAQ,6BAA0B;AAGhE,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,kBAAkB,QAAQ,mCAAgC;AACnE,SAASC,eAAe,QAA+B,2BAAwB;;AAE/E;AACA;AACA;;AAYA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;;AAQA;AACA;AACA;;AA0BA;AACA;AACA;AACA;AACA;AACA;AACA;;AAyBA;AACA;AACA;;
|
|
1
|
+
{"version":3,"names":["OctopusReactNativeSdk","Appearance","colorSchemeManager","parseFontConfig","initialize","params","colorScheme","getColorScheme","processedTheme","theme","fonts","parsedConfig","undefined","paramsWithColorScheme","setTheme","startListening"],"sourceRoot":"../../src","sources":["initialize.ts"],"mappings":";;AAAA,SAASA,qBAAqB,QAAQ,6BAA0B;AAGhE,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,kBAAkB,QAAQ,mCAAgC;AACnE,SAASC,eAAe,QAA+B,2BAAwB;;AAE/E;AACA;AACA;;AAYA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;;AAQA;AACA;AACA;;AA0BA;AACA;AACA;AACA;AACA;AACA;AACA;;AAyBA;AACA;AACA;;AAUA;AACA;AACA;;AA0BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,UAAUA,CAACC,MAAwB,EAAiB;EAClE;EACA,MAAMC,WAAW,GAAGL,UAAU,CAACM,cAAc,CAAC,CAAC;;EAE/C;EACA,MAAMC,cAAc,GAAGH,MAAM,CAACI,KAAK,GAC/B;IACE,GAAGJ,MAAM,CAACI,KAAK;IACfC,KAAK,EAAEL,MAAM,CAACI,KAAK,CAACC,KAAK,GACrB;MACE,GAAGL,MAAM,CAACI,KAAK,CAACC,KAAK;MACrBC,YAAY,EAAER,eAAe,CAACE,MAAM,CAACI,KAAK,CAACC,KAAK;IAClD,CAAC,GACDE;EACN,CAAC,GACDA,SAAS;EAEb,MAAMC,qBAAqB,GAAG;IAC5B,GAAGR,MAAM;IACTI,KAAK,EAAED,cAAc;IACrBF,WAAW,EAAEA,WAAW,IAAIM;EAC9B,CAAC;;EAED;EACAV,kBAAkB,CAACY,QAAQ,CAACN,cAAc,IAAI,IAAI,CAAC;;EAEnD;EACAN,kBAAkB,CAACa,cAAc,CAAC,CAAC;EAEnC,OAAOf,qBAAqB,CAACI,UAAU,CAACS,qBAAqB,CAAC;AAChE","ignoreList":[]}
|
|
@@ -89,6 +89,17 @@ export interface OctopusTheme {
|
|
|
89
89
|
image?: ImageResolvedAssetSource;
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* UI customization options for platform-specific layout adjustments.
|
|
94
|
+
*/
|
|
95
|
+
export interface OctopusUIOptions {
|
|
96
|
+
/**
|
|
97
|
+
* Additional bottom inset applied to the Octopus UI.
|
|
98
|
+
* - On iOS, mapped to `bottomSafeAreaInset` (points)
|
|
99
|
+
* - On Android, mapped to `contentPadding` bottom (dp)
|
|
100
|
+
*/
|
|
101
|
+
bottomSafeAreaInset?: number;
|
|
102
|
+
}
|
|
92
103
|
/**
|
|
93
104
|
* Configuration params for initializing the Octopus SDK.
|
|
94
105
|
*/
|
|
@@ -111,6 +122,8 @@ export interface InitializeParams {
|
|
|
111
122
|
};
|
|
112
123
|
/** Optional theme customization for the Octopus UI */
|
|
113
124
|
theme?: OctopusTheme;
|
|
125
|
+
/** Optional UI customization for layout-related tweaks */
|
|
126
|
+
ui?: OctopusUIOptions;
|
|
114
127
|
}
|
|
115
128
|
/**
|
|
116
129
|
* Initializes the Octopus SDK with the provided configuration.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.d.ts","sourceRoot":"","sources":["../../../src/initialize.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAG7D,OAAO,EAAmB,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,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AAgB,EAAE,CAAC;KACtC,GACD;QACE,0CAA0C;QAC1C,IAAI,EAAE,SAAS,CAAC;KACjB,CAAC;IACN,sDAAsD;IACtD,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,0DAA0D;IAC1D,EAAE,CAAC,EAAE,gBAAgB,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CA8BlE"}
|
package/package.json
CHANGED
package/src/initialize.ts
CHANGED
|
@@ -101,6 +101,18 @@ export interface OctopusTheme {
|
|
|
101
101
|
};
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
+
/**
|
|
105
|
+
* UI customization options for platform-specific layout adjustments.
|
|
106
|
+
*/
|
|
107
|
+
export interface OctopusUIOptions {
|
|
108
|
+
/**
|
|
109
|
+
* Additional bottom inset applied to the Octopus UI.
|
|
110
|
+
* - On iOS, mapped to `bottomSafeAreaInset` (points)
|
|
111
|
+
* - On Android, mapped to `contentPadding` bottom (dp)
|
|
112
|
+
*/
|
|
113
|
+
bottomSafeAreaInset?: number;
|
|
114
|
+
}
|
|
115
|
+
|
|
104
116
|
/**
|
|
105
117
|
* Configuration params for initializing the Octopus SDK.
|
|
106
118
|
*/
|
|
@@ -125,6 +137,8 @@ export interface InitializeParams {
|
|
|
125
137
|
};
|
|
126
138
|
/** Optional theme customization for the Octopus UI */
|
|
127
139
|
theme?: OctopusTheme;
|
|
140
|
+
/** Optional UI customization for layout-related tweaks */
|
|
141
|
+
ui?: OctopusUIOptions;
|
|
128
142
|
}
|
|
129
143
|
|
|
130
144
|
/**
|