@itcase/storybook-config 1.3.14 → 1.3.16

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.
@@ -4,7 +4,8 @@ require('react');
4
4
  var FormSubmitWrapper = require('../../FormSubmitWrapper-Bv5qs18h.js');
5
5
  require('lodash-es/camelCase');
6
6
  require('@itcase/common');
7
- require('msw');
7
+ require('msw/http');
8
+ require('msw/utils/passthrough');
8
9
  var jsxRuntime = require('react/jsx-runtime');
9
10
 
10
11
  function hasFormParameters(parameters) {
@@ -13,7 +13,8 @@ require('lodash-es/castArray');
13
13
  require('../FormSubmitWrapper-Bv5qs18h.js');
14
14
  require('lodash-es/camelCase');
15
15
  require('@itcase/common');
16
- require('msw');
16
+ require('msw/http');
17
+ require('msw/utils/passthrough');
17
18
  require('@itcase/ui-core/context');
18
19
  require('@itcase/ui-web/components/Notification');
19
20
 
@@ -1,3 +1,4 @@
1
+ import { centeredViewportManagerHead } from '../manager/centeredViewportManagerHead.js';
1
2
  declare const MAIN_CONFIG_NEXTJS_VITE: {
2
3
  env: (config: any) => any;
3
4
  viteFinal: (config: any) => Promise<Record<string, any>>;
@@ -5,6 +6,7 @@ declare const MAIN_CONFIG_NEXTJS_VITE: {
5
6
  disableTelemetry: boolean;
6
7
  disableWhatsNewNotifications: boolean;
7
8
  };
9
+ managerHead: typeof centeredViewportManagerHead;
8
10
  tags: string[];
9
11
  };
10
12
  export { MAIN_CONFIG_NEXTJS_VITE };
@@ -1,4 +1,5 @@
1
1
  import svgr from 'vite-plugin-svgr';
2
+ import { centeredViewportManagerHead } from '../manager/centeredViewportManagerHead.js';
2
3
  import { getMediaProxyServerConfig } from '../vite/getMediaProxyServerConfig.js';
3
4
  const MAIN_CONFIG_NEXTJS_VITE = {
4
5
  env: (config) => ({
@@ -33,6 +34,7 @@ const MAIN_CONFIG_NEXTJS_VITE = {
33
34
  disableTelemetry: true,
34
35
  disableWhatsNewNotifications: true,
35
36
  },
37
+ managerHead: centeredViewportManagerHead,
36
38
  tags: ['autodocs'],
37
39
  };
38
40
  export { MAIN_CONFIG_NEXTJS_VITE };
@@ -1,3 +1,4 @@
1
+ import { centeredViewportManagerHead } from '../manager/centeredViewportManagerHead.js';
1
2
  declare const MAIN_CONFIG_REACT_NATIVE_WEB: {
2
3
  viteFinal: (viteConfig: any) => Promise<Record<string, any>>;
3
4
  addons: (string | {
@@ -21,6 +22,7 @@ declare const MAIN_CONFIG_REACT_NATIVE_WEB: {
21
22
  framework: {
22
23
  name: string;
23
24
  };
25
+ managerHead: typeof centeredViewportManagerHead;
24
26
  stories: string[];
25
27
  typescript: {
26
28
  reactDocgen: string;
@@ -1,6 +1,7 @@
1
1
  import { mergeConfig } from 'vite';
2
2
  import svgr from 'vite-plugin-svgr';
3
3
  import { ADDONS_REACT_NATIVE_WEB } from '../addons/addonsReactNativeWeb.js';
4
+ import { centeredViewportManagerHead } from '../manager/centeredViewportManagerHead.js';
4
5
  import { reactNativeWebAliasPlugin } from '../vite/reactNativeWebAliasPlugin.js';
5
6
  const REACT_NATIVE_WEB_EXTENSIONS = [
6
7
  '.web.tsx',
@@ -62,6 +63,7 @@ const MAIN_CONFIG_REACT_NATIVE_WEB = {
62
63
  framework: {
63
64
  name: '@storybook/react-native-web-vite',
64
65
  },
66
+ managerHead: centeredViewportManagerHead,
65
67
  stories: ['../stories/react-native/**/*.stories.?(ts|tsx|js|jsx)'],
66
68
  typescript: {
67
69
  reactDocgen: 'react-docgen-typescript',
@@ -1,9 +1,11 @@
1
+ import { centeredViewportManagerHead } from '../manager/centeredViewportManagerHead.js';
1
2
  declare const MAIN_CONFIG_VITE: {
2
3
  viteFinal: (config: any) => Promise<Record<string, any>>;
3
4
  core: {
4
5
  disableTelemetry: boolean;
5
6
  disableWhatsNewNotifications: boolean;
6
7
  };
8
+ managerHead: typeof centeredViewportManagerHead;
7
9
  tags: string[];
8
10
  };
9
11
  export { MAIN_CONFIG_VITE };
@@ -1,5 +1,6 @@
1
1
  import path from 'node:path';
2
2
  import svgr from 'vite-plugin-svgr';
3
+ import { centeredViewportManagerHead } from '../manager/centeredViewportManagerHead.js';
3
4
  import { getMediaProxyServerConfig } from '../vite/getMediaProxyServerConfig.js';
4
5
  const WS_OPTION_KEYS = [
5
6
  'protocol',
@@ -106,6 +107,7 @@ const MAIN_CONFIG_VITE = {
106
107
  disableTelemetry: true,
107
108
  disableWhatsNewNotifications: true,
108
109
  },
110
+ managerHead: centeredViewportManagerHead,
109
111
  tags: ['autodocs'],
110
112
  };
111
113
  export { MAIN_CONFIG_VITE };
@@ -1,9 +1,11 @@
1
+ import { centeredViewportManagerHead } from '../manager/centeredViewportManagerHead.js';
1
2
  declare const MAIN_CONFIG_WEBPACK: {
2
3
  webpackFinal: (config: any) => Promise<any>;
3
4
  core: {
4
5
  disableTelemetry: boolean;
5
6
  disableWhatsNewNotifications: boolean;
6
7
  };
8
+ managerHead: typeof centeredViewportManagerHead;
7
9
  tags: string[];
8
10
  };
9
11
  export { MAIN_CONFIG_WEBPACK };
@@ -1,4 +1,5 @@
1
1
  import chalk from 'chalk';
2
+ import { centeredViewportManagerHead } from '../manager/centeredViewportManagerHead.js';
2
3
  const STORYBOOK_PUBLIC_PATH = null;
3
4
  const WEBPACK_ALIAS = {
4
5
  src: `${process.cwd()}/src`,
@@ -36,6 +37,7 @@ const MAIN_CONFIG_WEBPACK = {
36
37
  disableTelemetry: true,
37
38
  disableWhatsNewNotifications: true,
38
39
  },
40
+ managerHead: centeredViewportManagerHead,
39
41
  tags: ['autodocs'],
40
42
  };
41
43
  export { MAIN_CONFIG_WEBPACK };
@@ -0,0 +1,2 @@
1
+ declare function centeredViewportManagerHead(head: string): string;
2
+ export { centeredViewportManagerHead };
@@ -0,0 +1,12 @@
1
+ // Storybook pins the viewport frame to the top-left of a 100% canvas.
2
+ // `safe center` keeps the start reachable when the frame is taller than the window.
3
+ const CENTERED_VIEWPORT_STYLE = `<style>
4
+ #storybook-preview-wrapper > div {
5
+ align-items: safe center;
6
+ justify-content: safe center;
7
+ }
8
+ </style>`;
9
+ function centeredViewportManagerHead(head) {
10
+ return `${head ?? ''}\n${CENTERED_VIEWPORT_STYLE}\n`;
11
+ }
12
+ export { centeredViewportManagerHead };
@@ -1,4 +1,5 @@
1
- import type { HttpHandler, JsonBodyType } from 'msw';
1
+ import type { JsonBodyType } from 'msw';
2
+ import { type HttpHandler } from 'msw/http';
2
3
  declare function serverErrorHandler(errors: JsonBodyType): HttpHandler;
3
4
  declare function serverErrorDataHandler(message: JsonBodyType): HttpHandler;
4
5
  declare function handleGetRequest(url: string, data: JsonBodyType, status?: number): HttpHandler;
@@ -1,4 +1,5 @@
1
- import { http, HttpResponse, passthrough } from 'msw';
1
+ import { http, HttpResponse } from 'msw/http';
2
+ import { passthrough } from 'msw/utils/passthrough';
2
3
  function serverErrorHandler(errors) {
3
4
  return http.all('*', ({ request }) => {
4
5
  if (request.method === 'GET') {
@@ -8,7 +8,7 @@
8
8
  max-height: none !important;
9
9
  position: relative;
10
10
  flex-direction: column;
11
- align-items: center;
11
+ align-items: safe center;
12
12
  }
13
13
  }
14
14
 
@@ -24,13 +24,13 @@
24
24
  min-height: 100%;
25
25
  display: flex;
26
26
  flex-direction: column;
27
- justify-content: center;
27
+ justify-content: safe center;
28
28
  }
29
29
 
30
30
  .docs-story {
31
31
  padding: 40px;
32
32
  display: flex;
33
- justify-content: center;
33
+ justify-content: safe center;
34
34
  }
35
35
 
36
36
  .sb-layout {
@@ -38,8 +38,8 @@
38
38
  min-height: 100vh;
39
39
  position: relative;
40
40
  display: flex;
41
- justify-content: center;
42
- align-items: center;
41
+ justify-content: safe center;
42
+ align-items: safe center;
43
43
  & > div {
44
44
  position: relative;
45
45
  inset: auto auto auto auto !important;
@@ -48,13 +48,13 @@
48
48
  &-top {
49
49
  min-height: 100vh;
50
50
  display: flex;
51
- justify-content: center;
51
+ justify-content: safe center;
52
52
  align-items: flex-start;
53
53
  &-full {
54
54
  min-width: 100vw;
55
55
  min-height: 100vh;
56
56
  display: flex;
57
- justify-content: center;
57
+ justify-content: safe center;
58
58
  align-items: flex-start;
59
59
  }
60
60
  }
@@ -62,24 +62,24 @@
62
62
  min-height: 100vh;
63
63
  display: flex;
64
64
  justify-content: flex-end;
65
- align-items: center;
65
+ align-items: safe center;
66
66
  &-full {
67
67
  min-height: 100vh;
68
68
  display: flex;
69
69
  justify-content: flex-end;
70
- align-items: center;
70
+ align-items: safe center;
71
71
  }
72
72
  }
73
73
  &-bottom {
74
74
  min-height: 100vh;
75
75
  display: flex;
76
- justify-content: center;
76
+ justify-content: safe center;
77
77
  align-items: flex-end;
78
78
  &-full {
79
79
  min-width: 100vw;
80
80
  display: flex;
81
81
  min-height: 100vh;
82
- justify-content: center;
82
+ justify-content: safe center;
83
83
  align-items: flex-end;
84
84
  }
85
85
  }
@@ -87,19 +87,19 @@
87
87
  min-height: 100vh;
88
88
  display: flex;
89
89
  justify-content: flex-start;
90
- align-items: center;
90
+ align-items: safe center;
91
91
  &-full {
92
92
  min-height: 100vh;
93
93
  display: flex;
94
94
  justify-content: flex-start;
95
- align-items: center;
95
+ align-items: safe center;
96
96
  }
97
97
  }
98
98
  &-center {
99
99
  min-height: 100vh;
100
100
  display: flex;
101
- justify-content: center;
102
- align-items: center;
101
+ justify-content: safe center;
102
+ align-items: safe center;
103
103
  & > div[class*='group width_fill'] {
104
104
  width: auto;
105
105
  }
@@ -107,8 +107,8 @@
107
107
  min-width: 100vw;
108
108
  min-height: 100vh;
109
109
  display: flex;
110
- justify-content: center;
111
- align-items: center;
110
+ justify-content: safe center;
111
+ align-items: safe center;
112
112
  & > div[class*='group width_fill'] {
113
113
  width: auto;
114
114
  }
@@ -2,7 +2,8 @@ import 'react';
2
2
  import { F as FormSubmitWrapper } from '../components/FormSubmitWrapper-EwNkaMht.js';
3
3
  import 'lodash-es/camelCase';
4
4
  import '@itcase/common';
5
- import 'msw';
5
+ import 'msw/http';
6
+ import 'msw/utils/passthrough';
6
7
  import { jsx } from 'react/jsx-runtime';
7
8
 
8
9
  function hasFormParameters(parameters) {
@@ -11,6 +11,7 @@ import 'lodash-es/castArray';
11
11
  import './components/FormSubmitWrapper-EwNkaMht.js';
12
12
  import 'lodash-es/camelCase';
13
13
  import '@itcase/common';
14
- import 'msw';
14
+ import 'msw/http';
15
+ import 'msw/utils/passthrough';
15
16
  import '@itcase/ui-core/context';
16
17
  import '@itcase/ui-web/components/Notification';
@@ -8,7 +8,7 @@ function getMswWorkerStartOptions() {
8
8
  scope: storybookPublicPath,
9
9
  },
10
10
  },
11
- onUnhandledRequest: 'bypass',
11
+ onUnhandledFrame: 'bypass',
12
12
  };
13
13
  }
14
14
  export { getMswWorkerStartOptions };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itcase/storybook-config",
3
- "version": "1.3.14",
3
+ "version": "1.3.16",
4
4
  "author": "ITCase",
5
5
  "description": "Storybook configuration package",
6
6
  "engines": {
@@ -11,6 +11,7 @@
11
11
  "build-js": "rm -rf dist && tsc -p tsconfig.build.json && NODE_ENV=production rollup -c",
12
12
  "typecheck": "tsc --noEmit --pretty -p tsconfig.json",
13
13
  "prepare": "husky && node node_modules/@itcase/config/husky-hooks/install-launcher.js",
14
+ "smart-commit": "smart-commit",
14
15
  "prepack": "npm run build",
15
16
  "ios": "react-native run-ios -- --reset-cache",
16
17
  "android": "react-native run-android -- --reset-cache",
@@ -99,83 +100,83 @@
99
100
  },
100
101
  "dependencies": {
101
102
  "@gorhom/bottom-sheet": "^5.2.14",
102
- "@itcase/config": "^1.6.69",
103
+ "@itcase/config": "^1.7.17",
103
104
  "@itcase/storybook-addon-auth": "^1.0.5",
104
105
  "@react-native-async-storage/async-storage": "^3.1.1",
105
- "@react-native-community/datetimepicker": "^9.1.0",
106
+ "@react-native-community/datetimepicker": "^9.2.1",
106
107
  "@storybook/addon-designs": "^11.1.4",
107
- "@storybook/addon-docs": "^10.5.10",
108
- "@storybook/addon-links": "^10.5.10",
109
- "@storybook/addon-mcp": "^0.7.0",
110
- "@storybook/addon-ondevice-actions": "10.5.4",
111
- "@storybook/addon-ondevice-backgrounds": "10.5.4",
112
- "@storybook/addon-ondevice-controls": "10.5.4",
113
- "@storybook/addon-ondevice-notes": "^10.5.4",
108
+ "@storybook/addon-docs": "^10.6.1",
109
+ "@storybook/addon-links": "^10.6.1",
110
+ "@storybook/addon-mcp": "^10.6.1",
111
+ "@storybook/addon-ondevice-actions": "10.6.0",
112
+ "@storybook/addon-ondevice-backgrounds": "10.6.0",
113
+ "@storybook/addon-ondevice-controls": "10.6.0",
114
+ "@storybook/addon-ondevice-notes": "^10.6.0",
114
115
  "@storybook/addon-react-native-web": "^0.0.29",
115
116
  "@storybook/addon-styling-webpack": "^3.0.2",
116
- "@storybook/addon-themes": "^10.5.10",
117
- "@storybook/addon-vitest": "^10.5.10",
117
+ "@storybook/addon-themes": "^10.6.1",
118
+ "@storybook/addon-vitest": "^10.6.1",
118
119
  "@storybook/addon-webpack5-compiler-swc": "^4.0.3",
119
- "@storybook/builder-vite": "^10.5.10",
120
- "@storybook/mcp": "0.8.0",
121
- "@storybook/nextjs": "^10.5.10",
122
- "@storybook/nextjs-vite": "^10.5.10",
123
- "@storybook/react": "^10.5.10",
124
- "@storybook/react-native": "10.5.4",
125
- "@storybook/react-native-ui-lite": "10.5.4",
126
- "@storybook/react-native-web-vite": "^10.5.10",
127
- "@storybook/react-vite": "^10.5.10",
128
- "@storybook/react-webpack5": "^10.5.10",
129
- "@vitejs/plugin-react": "^6.1.0",
130
- "@vitest/browser-playwright": "^4.1.11",
120
+ "@storybook/builder-vite": "^10.6.1",
121
+ "@storybook/mcp": "10.6.1",
122
+ "@storybook/nextjs": "^10.6.1",
123
+ "@storybook/nextjs-vite": "^10.6.1",
124
+ "@storybook/react": "^10.6.1",
125
+ "@storybook/react-native": "10.6.0",
126
+ "@storybook/react-native-ui-lite": "10.6.0",
127
+ "@storybook/react-native-web-vite": "^10.6.1",
128
+ "@storybook/react-vite": "^10.6.1",
129
+ "@storybook/react-webpack5": "^10.6.1",
130
+ "@vitejs/plugin-react": "^6.1.1",
131
+ "@vitest/browser-playwright": "^5.0.3",
131
132
  "babel-loader": "^10.1.1",
132
133
  "babel-plugin-react-docgen": "^4.2.1",
133
- "babel-plugin-react-native-web": "^0.21.2",
134
+ "babel-plugin-react-native-web": "^0.21.3",
134
135
  "babel-plugin-transform-inline-environment-variables": "^0.4.4",
135
- "chalk": "^6.0.0",
136
+ "chalk": "^6.0.1",
136
137
  "http-proxy-middleware": "^4.2.0",
137
138
  "lodash-es": "^4.18.1",
138
- "msw": "^2.15.0",
139
- "msw-storybook-addon": "^3.0.0",
140
- "react-native-gesture-handler": "^3.2.1",
139
+ "msw": "^3.0.1",
140
+ "msw-storybook-addon": "^3.0.3",
141
+ "react-native-gesture-handler": "^3.3.0",
141
142
  "react-native-reanimated": "^4.7.0",
142
- "react-native-safe-area-context": "^5.9.1",
143
+ "react-native-safe-area-context": "^5.10.1",
143
144
  "react-native-svg": "^15.15.5",
144
- "react-native-web": "^0.21.2",
145
+ "react-native-web": "^0.21.3",
145
146
  "react-native-worklets": "^0.13.0",
146
- "srvx": "^0.12.7",
147
- "storybook": "^10.5.10",
147
+ "srvx": "^1.0.5",
148
+ "storybook": "^10.6.1",
148
149
  "storybook-addon-source-link": "^2.0.1",
149
- "vite": "^8.2.2",
150
+ "vite": "^8.3.2",
150
151
  "vite-plugin-babel": "^1.7.3",
151
152
  "vite-plugin-svgr": "^5.2.0",
152
- "vitest": "^4.1.11"
153
+ "vitest": "^5.0.3"
153
154
  },
154
155
  "devDependencies": {
155
- "@babel/core": "^8.0.1",
156
- "@babel/preset-env": "^8.0.2",
156
+ "@babel/core": "^8.0.6",
157
+ "@babel/preset-env": "^8.0.6",
157
158
  "@babel/preset-react": "^8.0.1",
158
159
  "@babel/preset-typescript": "^8.0.1",
159
- "@babel/runtime": "^8.0.0",
160
- "@commitlint/cli": "^21.2.2",
161
- "@commitlint/config-conventional": "^21.2.2",
162
- "@itcase/common": "^1.2.53",
163
- "@itcase/lint": "^1.1.122",
164
- "@itcase/ui-core": "^1.10.83",
165
- "@itcase/ui-react-native": "^1.10.83",
166
- "@itcase/ui-web": "^1.10.83",
160
+ "@babel/runtime": "^8.0.5",
161
+ "@commitlint/cli": "^21.2.3",
162
+ "@commitlint/config-conventional": "^21.2.3",
163
+ "@itcase/common": "^1.2.55",
164
+ "@itcase/lint": "^1.1.126",
165
+ "@itcase/ui-core": "^1.10.102",
166
+ "@itcase/ui-react-native": "^1.10.102",
167
+ "@itcase/ui-web": "^1.10.102",
167
168
  "@react-native-community/cli": "20.2.0",
168
169
  "@react-native-community/cli-platform-android": "20.2.0",
169
170
  "@react-native-community/cli-platform-ios": "20.2.0",
170
- "@react-native/babel-preset": "0.87.0",
171
- "@react-native/eslint-config": "0.87.0",
172
- "@react-native/metro-config": "0.87.0",
173
- "@react-native/typescript-config": "0.87.0",
171
+ "@react-native/babel-preset": "0.87.1",
172
+ "@react-native/eslint-config": "0.87.1",
173
+ "@react-native/metro-config": "0.87.1",
174
+ "@react-native/typescript-config": "0.87.1",
174
175
  "@rollup/plugin-babel": "^7.1.0",
175
176
  "@rollup/plugin-commonjs": "^29.0.3",
176
177
  "@rollup/plugin-json": "^6.1.0",
177
178
  "@rollup/plugin-node-resolve": "^16.0.3",
178
- "@storybook/addon-docs": "^10.5.10",
179
+ "@storybook/addon-docs": "^10.6.1",
179
180
  "@types/react": "^18",
180
181
  "@types/react-dom": "^18",
181
182
  "babel-plugin-transform-inline-environment-variables": "^0.4.4",
@@ -183,21 +184,21 @@
183
184
  "eslint": "9.39.2",
184
185
  "glob": "^13.0.6",
185
186
  "husky": "^9.1.7",
186
- "lint-staged": "^17.3.0",
187
- "next": "^16.3.1",
188
- "prettier": "^3.9.6",
187
+ "lint-staged": "^17.6.0",
188
+ "next": "^16.3.8",
189
+ "prettier": "^3.9.9",
189
190
  "react": "^18",
190
- "react-docgen": "^8.0.3",
191
+ "react-docgen": "^8.0.4",
191
192
  "react-docgen-typescript": "^2.4.0",
192
193
  "react-dom": "^18",
193
- "react-native": "0.87.0",
194
- "react-native-web": "^0.21.2",
195
- "rollup": "^4.62.4",
194
+ "react-native": "0.87.1",
195
+ "react-native-web": "^0.21.3",
196
+ "rollup": "^4.63.6",
196
197
  "rollup-plugin-copy": "^3.5.0",
197
198
  "rollup-plugin-peer-deps-external": "^2.2.4",
198
199
  "semantic-release": "^25.0.9",
199
- "stylelint": "^17.14.1",
200
+ "stylelint": "^17.16.0",
200
201
  "typescript": "^6.0.3",
201
- "vite": "^8.2.2"
202
+ "vite": "^8.3.2"
202
203
  }
203
204
  }