@apps-in-toss/framework 2.10.3 → 2.10.5

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");
@@ -1327,8 +1384,6 @@ function HomeButton({ theme = "light", onPress, children }) {
1327
1384
  alignItems: "center",
1328
1385
  gap: 6,
1329
1386
  height: 34,
1330
- paddingLeft: 10,
1331
- paddingRight: 10,
1332
1387
  backgroundColor: theme === "light" ? import_tds_react_native10.colors.greyOpacity50 : "rgba(0, 0, 1, 0.58)",
1333
1388
  borderRadius: 99
1334
1389
  },
@@ -1351,7 +1406,8 @@ function AppTitle({ title, iconUrl, theme = "light" }) {
1351
1406
  style: {
1352
1407
  flexDirection: "row",
1353
1408
  alignItems: "center",
1354
- gap: 6
1409
+ gap: 6,
1410
+ paddingHorizontal: 10
1355
1411
  },
1356
1412
  children: [
1357
1413
  iconUrl != null && iconUrl !== "" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
@@ -1489,10 +1545,7 @@ function DefaultNavigationBar() {
1489
1545
  const parsedNavigationBar = globals.navigationBar != null ? safeParseNavigationBar(globals.navigationBar) : null;
1490
1546
  const withHomeButton = parsedNavigationBar?.withHomeButton ?? false;
1491
1547
  const withBackButton = parsedNavigationBar?.withBackButton ?? true;
1492
- const withIcon = parsedNavigationBar?.withIcon ?? true;
1493
1548
  const withTitle = parsedNavigationBar?.withTitle ?? true;
1494
- const iconURL = withIcon ? globals.brandIcon : void 0;
1495
- const title = withTitle ? globals.brandDisplayName : void 0;
1496
1549
  const theme = parsedNavigationBar?.theme ?? "light";
1497
1550
  const { navigationRightButton } = useNavigationBarContext();
1498
1551
  const navigationEvent = useNavigationEvent();
@@ -1501,7 +1554,7 @@ function DefaultNavigationBar() {
1501
1554
  TopNavigation,
1502
1555
  {
1503
1556
  left: withBackButton ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(BackButton, { theme, onPress: navigationEvent.handleBack }) : null,
1504
- center: title || iconURL ? withHomeButton ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(HomeButton, { theme, onPress: navigationEvent.handleHomeButtonClick, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(AppTitle, { theme, title, iconUrl: iconURL }) }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(AppTitle, { theme, title, iconUrl: iconURL }) : null,
1557
+ center: withTitle ? withHomeButton ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(HomeButton, { theme, onPress: navigationEvent.handleHomeButtonClick, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(AppTitle, { theme, title: globals.brandDisplayName, iconUrl: globals.brandIcon }) }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(AppTitle, { theme, title: globals.brandDisplayName, iconUrl: globals.brandIcon }) : null,
1505
1558
  right: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1506
1559
  Menu2,
1507
1560
  {
@@ -1759,10 +1812,7 @@ function PartnerWebviewNavigationBar({ onBackButtonClick, onHomeButtonClick }) {
1759
1812
  const parsedNavigationBar = globals.navigationBar != null ? safeParseNavigationBar(globals.navigationBar) : null;
1760
1813
  const withHomeButton = parsedNavigationBar?.withHomeButton ?? false;
1761
1814
  const withBackButton = parsedNavigationBar?.withBackButton ?? true;
1762
- const withIcon = parsedNavigationBar?.withIcon ?? true;
1763
1815
  const withTitle = parsedNavigationBar?.withTitle ?? true;
1764
- const iconURL = withIcon ? globals.brandIcon : void 0;
1765
- const title = withTitle ? globals.brandDisplayName : void 0;
1766
1816
  const theme = parsedNavigationBar?.theme ?? "light";
1767
1817
  const { navigationRightButton } = useNavigationBarContext();
1768
1818
  const handleClose = (0, import_react20.useCallback)(async () => {
@@ -1773,7 +1823,7 @@ function PartnerWebviewNavigationBar({ onBackButtonClick, onHomeButtonClick }) {
1773
1823
  TopNavigation,
1774
1824
  {
1775
1825
  left: withBackButton ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(BackButton, { theme, onPress: onBackButtonClick }) : null,
1776
- center: title || iconURL ? withHomeButton ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(HomeButton, { theme, onPress: onHomeButtonClick, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(AppTitle, { theme, title, iconUrl: iconURL }) }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(AppTitle, { theme, title, iconUrl: iconURL }) : null,
1826
+ center: withTitle ? withHomeButton ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(HomeButton, { theme, onPress: onHomeButtonClick, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(AppTitle, { theme, title: globals.brandDisplayName, iconUrl: globals.brandIcon }) }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(AppTitle, { theme, title: globals.brandDisplayName, iconUrl: globals.brandIcon }) : null,
1777
1827
  right: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1778
1828
  Menu2,
1779
1829
  {
@@ -3280,7 +3330,7 @@ function resolveTossAppBundleId(os) {
3280
3330
  var package_default = {
3281
3331
  name: "@apps-in-toss/framework",
3282
3332
  type: "module",
3283
- version: "2.10.3",
3333
+ version: "2.10.5",
3284
3334
  description: "The framework for Apps In Toss",
3285
3335
  scripts: {
3286
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";
@@ -1290,8 +1347,6 @@ function HomeButton({ theme = "light", onPress, children }) {
1290
1347
  alignItems: "center",
1291
1348
  gap: 6,
1292
1349
  height: 34,
1293
- paddingLeft: 10,
1294
- paddingRight: 10,
1295
1350
  backgroundColor: theme === "light" ? colors2.greyOpacity50 : "rgba(0, 0, 1, 0.58)",
1296
1351
  borderRadius: 99
1297
1352
  },
@@ -1314,7 +1369,8 @@ function AppTitle({ title, iconUrl, theme = "light" }) {
1314
1369
  style: {
1315
1370
  flexDirection: "row",
1316
1371
  alignItems: "center",
1317
- gap: 6
1372
+ gap: 6,
1373
+ paddingHorizontal: 10
1318
1374
  },
1319
1375
  children: [
1320
1376
  iconUrl != null && iconUrl !== "" && /* @__PURE__ */ jsx13(
@@ -1452,10 +1508,7 @@ function DefaultNavigationBar() {
1452
1508
  const parsedNavigationBar = globals.navigationBar != null ? safeParseNavigationBar(globals.navigationBar) : null;
1453
1509
  const withHomeButton = parsedNavigationBar?.withHomeButton ?? false;
1454
1510
  const withBackButton = parsedNavigationBar?.withBackButton ?? true;
1455
- const withIcon = parsedNavigationBar?.withIcon ?? true;
1456
1511
  const withTitle = parsedNavigationBar?.withTitle ?? true;
1457
- const iconURL = withIcon ? globals.brandIcon : void 0;
1458
- const title = withTitle ? globals.brandDisplayName : void 0;
1459
1512
  const theme = parsedNavigationBar?.theme ?? "light";
1460
1513
  const { navigationRightButton } = useNavigationBarContext();
1461
1514
  const navigationEvent = useNavigationEvent();
@@ -1464,7 +1517,7 @@ function DefaultNavigationBar() {
1464
1517
  TopNavigation,
1465
1518
  {
1466
1519
  left: withBackButton ? /* @__PURE__ */ jsx16(BackButton, { theme, onPress: navigationEvent.handleBack }) : null,
1467
- center: title || iconURL ? withHomeButton ? /* @__PURE__ */ jsx16(HomeButton, { theme, onPress: navigationEvent.handleHomeButtonClick, children: /* @__PURE__ */ jsx16(AppTitle, { theme, title, iconUrl: iconURL }) }) : /* @__PURE__ */ jsx16(AppTitle, { theme, title, iconUrl: iconURL }) : null,
1520
+ center: withTitle ? withHomeButton ? /* @__PURE__ */ jsx16(HomeButton, { theme, onPress: navigationEvent.handleHomeButtonClick, children: /* @__PURE__ */ jsx16(AppTitle, { theme, title: globals.brandDisplayName, iconUrl: globals.brandIcon }) }) : /* @__PURE__ */ jsx16(AppTitle, { theme, title: globals.brandDisplayName, iconUrl: globals.brandIcon }) : null,
1468
1521
  right: /* @__PURE__ */ jsx16(
1469
1522
  Menu2,
1470
1523
  {
@@ -1743,10 +1796,7 @@ function PartnerWebviewNavigationBar({ onBackButtonClick, onHomeButtonClick }) {
1743
1796
  const parsedNavigationBar = globals.navigationBar != null ? safeParseNavigationBar(globals.navigationBar) : null;
1744
1797
  const withHomeButton = parsedNavigationBar?.withHomeButton ?? false;
1745
1798
  const withBackButton = parsedNavigationBar?.withBackButton ?? true;
1746
- const withIcon = parsedNavigationBar?.withIcon ?? true;
1747
1799
  const withTitle = parsedNavigationBar?.withTitle ?? true;
1748
- const iconURL = withIcon ? globals.brandIcon : void 0;
1749
- const title = withTitle ? globals.brandDisplayName : void 0;
1750
1800
  const theme = parsedNavigationBar?.theme ?? "light";
1751
1801
  const { navigationRightButton } = useNavigationBarContext();
1752
1802
  const handleClose = useCallback8(async () => {
@@ -1757,7 +1807,7 @@ function PartnerWebviewNavigationBar({ onBackButtonClick, onHomeButtonClick }) {
1757
1807
  TopNavigation,
1758
1808
  {
1759
1809
  left: withBackButton ? /* @__PURE__ */ jsx22(BackButton, { theme, onPress: onBackButtonClick }) : null,
1760
- center: title || iconURL ? withHomeButton ? /* @__PURE__ */ jsx22(HomeButton, { theme, onPress: onHomeButtonClick, children: /* @__PURE__ */ jsx22(AppTitle, { theme, title, iconUrl: iconURL }) }) : /* @__PURE__ */ jsx22(AppTitle, { theme, title, iconUrl: iconURL }) : null,
1810
+ center: withTitle ? withHomeButton ? /* @__PURE__ */ jsx22(HomeButton, { theme, onPress: onHomeButtonClick, children: /* @__PURE__ */ jsx22(AppTitle, { theme, title: globals.brandDisplayName, iconUrl: globals.brandIcon }) }) : /* @__PURE__ */ jsx22(AppTitle, { theme, title: globals.brandDisplayName, iconUrl: globals.brandIcon }) : null,
1761
1811
  right: /* @__PURE__ */ jsx22(
1762
1812
  Menu2,
1763
1813
  {
@@ -3272,7 +3322,7 @@ function resolveTossAppBundleId(os) {
3272
3322
  var package_default = {
3273
3323
  name: "@apps-in-toss/framework",
3274
3324
  type: "module",
3275
- version: "2.10.3",
3325
+ version: "2.10.5",
3276
3326
  description: "The framework for Apps In Toss",
3277
3327
  scripts: {
3278
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.3",
4
+ "version": "2.10.5",
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.3",
59
- "@apps-in-toss/cli": "2.10.3",
60
- "@apps-in-toss/native-modules": "2.10.3",
61
- "@apps-in-toss/plugins": "2.10.3",
62
- "@apps-in-toss/types": "2.10.3",
63
- "@apps-in-toss/user-scripts": "^2.10.3",
58
+ "@apps-in-toss/analytics": "2.10.5",
59
+ "@apps-in-toss/cli": "2.10.5",
60
+ "@apps-in-toss/native-modules": "2.10.5",
61
+ "@apps-in-toss/plugins": "2.10.5",
62
+ "@apps-in-toss/types": "2.10.5",
63
+ "@apps-in-toss/user-scripts": "^2.10.5",
64
64
  "es-hangul": "^2.3.2"
65
65
  },
66
66
  "devDependencies": {