@apps-in-toss/framework 2.10.4 → 2.10.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/dist/index.cjs CHANGED
@@ -1215,24 +1215,30 @@ var import_tds_react_native9 = require("@toss/tds-react-native");
1215
1215
  var import_react15 = require("react");
1216
1216
  var import_react_native20 = require("react-native");
1217
1217
  var import_jsx_runtime10 = require("react/jsx-runtime");
1218
- function TopNavigation({ left, center, right }) {
1218
+ function TopNavigation(props) {
1219
+ const { navigationBar } = getAppsInTossGlobals();
1220
+ const parsedNavigationBar = navigationBar ? safeParseNavigationBar(navigationBar) : null;
1221
+ const transparent = parsedNavigationBar?.transparentBackground ?? false;
1222
+ const theme = parsedNavigationBar?.theme ?? "light";
1223
+ if (transparent) {
1224
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TopTransparentNavigation, { ...props });
1225
+ }
1226
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TopDefaultNavigation, { theme, ...props });
1227
+ }
1228
+ function TopDefaultNavigation({ left, center, right, theme }) {
1219
1229
  const insets = (0, import_react_native_safe_area_context.useSafeAreaInsets)();
1220
1230
  const navigation = (0, import_react_native19.useNavigation)();
1221
1231
  (0, import_react15.useEffect)(() => {
1222
- const { navigationBar } = getAppsInTossGlobals();
1223
- const parsedNavigationBar = navigationBar ? safeParseNavigationBar(navigationBar) : null;
1224
- const transparent = parsedNavigationBar?.transparentBackground ?? false;
1225
- const theme = parsedNavigationBar?.theme ?? "light";
1226
1232
  navigation.setOptions({
1227
- headerTransparent: transparent,
1233
+ headerShown: true,
1234
+ headerTransparent: false,
1228
1235
  header: () => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
1229
1236
  import_react_native20.View,
1230
1237
  {
1231
1238
  style: {
1232
1239
  width: "100%",
1233
- backgroundColor: transparent ? void 0 : theme === "light" ? import_tds_react_native9.colors.lightThemeBackground : import_tds_react_native9.colors.darkThemeBackground
1240
+ backgroundColor: theme === "light" ? import_tds_react_native9.colors.lightThemeBackground : import_tds_react_native9.colors.darkThemeBackground
1234
1241
  },
1235
- pointerEvents: "box-none",
1236
1242
  children: [
1237
1243
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native20.View, { style: { width: "100%", height: insets.top } }),
1238
1244
  /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
@@ -1278,9 +1284,60 @@ function TopNavigation({ left, center, right }) {
1278
1284
  }
1279
1285
  )
1280
1286
  });
1281
- }, [navigation, insets, left, center, right]);
1287
+ }, [navigation, insets, left, center, right, theme]);
1282
1288
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, {});
1283
1289
  }
1290
+ function TopTransparentNavigation({ left, center, right }) {
1291
+ const insets = (0, import_react_native_safe_area_context.useSafeAreaInsets)();
1292
+ const navigation = (0, import_react_native19.useNavigation)();
1293
+ (0, import_react15.useEffect)(() => {
1294
+ navigation.setOptions({
1295
+ headerShown: false,
1296
+ header: () => null
1297
+ });
1298
+ }, [navigation]);
1299
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
1300
+ import_react_native20.View,
1301
+ {
1302
+ style: {
1303
+ position: "absolute",
1304
+ top: insets.top,
1305
+ left: insets.left,
1306
+ right: insets.right,
1307
+ height: 44,
1308
+ zIndex: 1,
1309
+ flexDirection: "row",
1310
+ alignItems: "center"
1311
+ },
1312
+ pointerEvents: "box-none",
1313
+ children: [
1314
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native20.View, { children: left }),
1315
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1316
+ import_react_native20.View,
1317
+ {
1318
+ style: {
1319
+ flex: 1,
1320
+ flexDirection: "row",
1321
+ alignItems: "center"
1322
+ },
1323
+ pointerEvents: "box-none",
1324
+ children: center
1325
+ }
1326
+ ),
1327
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1328
+ import_react_native20.View,
1329
+ {
1330
+ style: {
1331
+ flexDirection: "row",
1332
+ alignItems: "center"
1333
+ },
1334
+ children: right
1335
+ }
1336
+ )
1337
+ ]
1338
+ }
1339
+ );
1340
+ }
1284
1341
 
1285
1342
  // src/components/NavigationBar/TopNavigation/BackButton.tsx
1286
1343
  var import_react_native_svg = require("@granite-js/native/react-native-svg");
@@ -3273,7 +3330,7 @@ function resolveTossAppBundleId(os) {
3273
3330
  var package_default = {
3274
3331
  name: "@apps-in-toss/framework",
3275
3332
  type: "module",
3276
- version: "2.10.4",
3333
+ version: "2.10.6",
3277
3334
  description: "The framework for Apps In Toss",
3278
3335
  scripts: {
3279
3336
  typecheck: "tsc --noEmit",
package/dist/index.js CHANGED
@@ -1178,24 +1178,30 @@ import { colors } from "@toss/tds-react-native";
1178
1178
  import { useEffect as useEffect6 } from "react";
1179
1179
  import { View as View3 } from "react-native";
1180
1180
  import { Fragment as Fragment4, jsx as jsx10, jsxs as jsxs3 } from "react/jsx-runtime";
1181
- function TopNavigation({ left, center, right }) {
1181
+ function TopNavigation(props) {
1182
+ const { navigationBar } = getAppsInTossGlobals();
1183
+ const parsedNavigationBar = navigationBar ? safeParseNavigationBar(navigationBar) : null;
1184
+ const transparent = parsedNavigationBar?.transparentBackground ?? false;
1185
+ const theme = parsedNavigationBar?.theme ?? "light";
1186
+ if (transparent) {
1187
+ return /* @__PURE__ */ jsx10(TopTransparentNavigation, { ...props });
1188
+ }
1189
+ return /* @__PURE__ */ jsx10(TopDefaultNavigation, { theme, ...props });
1190
+ }
1191
+ function TopDefaultNavigation({ left, center, right, theme }) {
1182
1192
  const insets = useSafeAreaInsets();
1183
1193
  const navigation = useNavigation2();
1184
1194
  useEffect6(() => {
1185
- const { navigationBar } = getAppsInTossGlobals();
1186
- const parsedNavigationBar = navigationBar ? safeParseNavigationBar(navigationBar) : null;
1187
- const transparent = parsedNavigationBar?.transparentBackground ?? false;
1188
- const theme = parsedNavigationBar?.theme ?? "light";
1189
1195
  navigation.setOptions({
1190
- headerTransparent: transparent,
1196
+ headerShown: true,
1197
+ headerTransparent: false,
1191
1198
  header: () => /* @__PURE__ */ jsxs3(
1192
1199
  View3,
1193
1200
  {
1194
1201
  style: {
1195
1202
  width: "100%",
1196
- backgroundColor: transparent ? void 0 : theme === "light" ? colors.lightThemeBackground : colors.darkThemeBackground
1203
+ backgroundColor: theme === "light" ? colors.lightThemeBackground : colors.darkThemeBackground
1197
1204
  },
1198
- pointerEvents: "box-none",
1199
1205
  children: [
1200
1206
  /* @__PURE__ */ jsx10(View3, { style: { width: "100%", height: insets.top } }),
1201
1207
  /* @__PURE__ */ jsxs3(
@@ -1241,9 +1247,60 @@ function TopNavigation({ left, center, right }) {
1241
1247
  }
1242
1248
  )
1243
1249
  });
1244
- }, [navigation, insets, left, center, right]);
1250
+ }, [navigation, insets, left, center, right, theme]);
1245
1251
  return /* @__PURE__ */ jsx10(Fragment4, {});
1246
1252
  }
1253
+ function TopTransparentNavigation({ left, center, right }) {
1254
+ const insets = useSafeAreaInsets();
1255
+ const navigation = useNavigation2();
1256
+ useEffect6(() => {
1257
+ navigation.setOptions({
1258
+ headerShown: false,
1259
+ header: () => null
1260
+ });
1261
+ }, [navigation]);
1262
+ return /* @__PURE__ */ jsxs3(
1263
+ View3,
1264
+ {
1265
+ style: {
1266
+ position: "absolute",
1267
+ top: insets.top,
1268
+ left: insets.left,
1269
+ right: insets.right,
1270
+ height: 44,
1271
+ zIndex: 1,
1272
+ flexDirection: "row",
1273
+ alignItems: "center"
1274
+ },
1275
+ pointerEvents: "box-none",
1276
+ children: [
1277
+ /* @__PURE__ */ jsx10(View3, { children: left }),
1278
+ /* @__PURE__ */ jsx10(
1279
+ View3,
1280
+ {
1281
+ style: {
1282
+ flex: 1,
1283
+ flexDirection: "row",
1284
+ alignItems: "center"
1285
+ },
1286
+ pointerEvents: "box-none",
1287
+ children: center
1288
+ }
1289
+ ),
1290
+ /* @__PURE__ */ jsx10(
1291
+ View3,
1292
+ {
1293
+ style: {
1294
+ flexDirection: "row",
1295
+ alignItems: "center"
1296
+ },
1297
+ children: right
1298
+ }
1299
+ )
1300
+ ]
1301
+ }
1302
+ );
1303
+ }
1247
1304
 
1248
1305
  // src/components/NavigationBar/TopNavigation/BackButton.tsx
1249
1306
  import { SvgXml } from "@granite-js/native/react-native-svg";
@@ -3265,7 +3322,7 @@ function resolveTossAppBundleId(os) {
3265
3322
  var package_default = {
3266
3323
  name: "@apps-in-toss/framework",
3267
3324
  type: "module",
3268
- version: "2.10.4",
3325
+ version: "2.10.6",
3269
3326
  description: "The framework for Apps In Toss",
3270
3327
  scripts: {
3271
3328
  typecheck: "tsc --noEmit",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@apps-in-toss/framework",
3
3
  "type": "module",
4
- "version": "2.10.4",
4
+ "version": "2.10.6",
5
5
  "description": "The framework for Apps In Toss",
6
6
  "scripts": {
7
7
  "typecheck": "tsc --noEmit",
@@ -55,12 +55,12 @@
55
55
  "ait": "./bin/ait.js"
56
56
  },
57
57
  "dependencies": {
58
- "@apps-in-toss/analytics": "2.10.4",
59
- "@apps-in-toss/cli": "2.10.4",
60
- "@apps-in-toss/native-modules": "2.10.4",
61
- "@apps-in-toss/plugins": "2.10.4",
62
- "@apps-in-toss/types": "2.10.4",
63
- "@apps-in-toss/user-scripts": "^2.10.4",
58
+ "@apps-in-toss/analytics": "2.10.6",
59
+ "@apps-in-toss/cli": "2.10.6",
60
+ "@apps-in-toss/native-modules": "2.10.6",
61
+ "@apps-in-toss/plugins": "2.10.6",
62
+ "@apps-in-toss/types": "2.10.6",
63
+ "@apps-in-toss/user-scripts": "^2.10.6",
64
64
  "es-hangul": "^2.3.2"
65
65
  },
66
66
  "devDependencies": {
@@ -71,7 +71,7 @@
71
71
  "@granite-js/plugin-core": "1.0.20",
72
72
  "@granite-js/react-native": "1.0.20",
73
73
  "@granite-js/utils": "1.0.20",
74
- "@toss/tds-react-native": "2.0.3",
74
+ "@toss/tds-react-native": "2.0.4",
75
75
  "@types/kill-port": "2.0.1",
76
76
  "@types/react": "19.2.3",
77
77
  "brick-module": "0.5.2",