@apps-in-toss/web-framework 0.0.31 → 0.0.33

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/cli/index.js CHANGED
@@ -65323,6 +65323,7 @@ async function babelBuild({
65323
65323
  const prebuilt = fileURLToPath3(import.meta.resolve(`@apps-in-toss/web-framework/prebuilt/prod/${platform2}`));
65324
65324
  const bundle = await fs2.promises.readFile(prebuilt, "utf-8");
65325
65325
  const result = await transform(bundle, {
65326
+ babelrc: false,
65326
65327
  sourceMaps: true,
65327
65328
  plugins: [
65328
65329
  [
@@ -65340,6 +65341,7 @@ async function babelBuild({
65340
65341
  brandBridgeColorMode: config.brand.bridgeColorMode,
65341
65342
  webViewType: config.webViewProps.type,
65342
65343
  webViewHeaderWithBackButton: config.webViewProps.header?.withBackButton,
65344
+ webViewInitialAccessoryButtons: JSON.stringify(config.webViewProps.header?.initialAccessoryButtons ?? []),
65343
65345
  ...config.webViewProps
65344
65346
  },
65345
65347
  identifierName: "Ait"
@@ -67801,6 +67803,7 @@ var createApp = ({ appName, web, permissions, webViewProps, brand }) => {
67801
67803
  return c4.body(transformCache.get(key));
67802
67804
  }
67803
67805
  const result = await transform2(bundle, {
67806
+ babelrc: false,
67804
67807
  plugins: [
67805
67808
  [
67806
67809
  babelJsonReplacementPlugin,
@@ -67817,6 +67820,7 @@ var createApp = ({ appName, web, permissions, webViewProps, brand }) => {
67817
67820
  brandBridgeColorMode: brand.bridgeColorMode,
67818
67821
  webViewType: webViewProps.type,
67819
67822
  webViewHeaderWithBackButton: webViewProps.header?.withBackButton,
67823
+ webViewInitialAccessoryButtons: JSON.stringify(webViewProps.header?.initialAccessoryButtons ?? []),
67820
67824
  ...webViewProps
67821
67825
  },
67822
67826
  identifierName: "Ait"
@@ -5,6 +5,20 @@ type DeepRequiredKeysOnly<T> = {
5
5
  [K in keyof T]-?: T[K] extends object ? (T[K] extends F ? T[K] : DeepRequiredKeysOnly<T[K]>) : T[K];
6
6
  };
7
7
 
8
+ type Icon = {
9
+ source: {
10
+ uri: string;
11
+ };
12
+ name?: never;
13
+ } | {
14
+ name: string;
15
+ source?: never;
16
+ };
17
+ interface InitialAccessoryButton {
18
+ id: string;
19
+ title: string;
20
+ icon: Icon;
21
+ }
8
22
  interface AppsInTossWebConfig extends AppsInTossPluginOptions {
9
23
  appName: string;
10
24
  web: {
@@ -33,6 +47,23 @@ interface AppsInTossWebConfig extends AppsInTossPluginOptions {
33
47
  * Defaults to `true` when type is 'partner', `false` when type is 'external'
34
48
  */
35
49
  withBackButton?: boolean;
50
+ /**
51
+ * @default []
52
+ *
53
+ * @example
54
+ * ```ts
55
+ * [
56
+ * {
57
+ * title: '버튼 이름',
58
+ * icon: {
59
+ * name: 'icon-name',
60
+ * source: 'icon-source',
61
+ * },
62
+ * },
63
+ * ]
64
+ * ```
65
+ */
66
+ initialAccessoryButtons?: InitialAccessoryButton[];
36
67
  };
37
68
  /**
38
69
  *
@@ -87,4 +118,4 @@ interface AppsInTossWebConfig extends AppsInTossPluginOptions {
87
118
  type AppsInTossWebConfigResponse = DeepRequiredKeysOnly<AppsInTossWebConfig>;
88
119
  declare const defineConfig: (config: AppsInTossWebConfig) => AppsInTossWebConfigResponse;
89
120
 
90
- export { type AppsInTossWebConfig, type AppsInTossWebConfigResponse, defineConfig };
121
+ export { type AppsInTossWebConfig, type AppsInTossWebConfigResponse, type InitialAccessoryButton, defineConfig };
@@ -51,7 +51,11 @@ var defineConfig = (config) => {
51
51
  bounces: true,
52
52
  allowsBackForwardNavigationGestures: true,
53
53
  pullToRefreshEnabled: true,
54
- overScrollMode: "always"
54
+ overScrollMode: "always",
55
+ header: {
56
+ withBackButton: true,
57
+ initialAccessoryButtons: []
58
+ }
55
59
  }
56
60
  };
57
61
  return merge(defaultConfig, config);