payment-kit 1.13.108 → 1.13.110

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.
@@ -1,7 +1,6 @@
1
1
  /* eslint-disable no-console */
2
2
  import { spawnSync } from 'child_process';
3
- import { chmodSync, existsSync, mkdirSync, symlinkSync } from 'fs';
4
- import { dirname, join } from 'path';
3
+ import { join } from 'path';
5
4
 
6
5
  // eslint-disable-next-line import/prefer-default-export
7
6
  export async function ensureSqliteBinaryFile() {
@@ -18,19 +17,6 @@ export async function ensureSqliteBinaryFile() {
18
17
 
19
18
  const appDir = process.env.BLOCKLET_APP_DIR!;
20
19
 
21
- // link `node-pre-gyp` to .bin for download or build sqlite3
22
- try {
23
- const srcPath = join(appDir, 'node_modules/@mapbox/node-pre-gyp/bin/node-pre-gyp');
24
- const binPath = join(appDir, 'node_modules/.bin/node-pre-gyp');
25
- if (!existsSync(binPath) && existsSync(srcPath)) {
26
- mkdirSync(dirname(binPath), { recursive: true });
27
- symlinkSync(srcPath, binPath);
28
- chmodSync(binPath, '755');
29
- }
30
- } catch (error) {
31
- console.warn(error.message);
32
- }
33
-
34
20
  spawnSync('npm', ['run', 'install'], {
35
21
  cwd: join(appDir, 'node_modules/sqlite3'),
36
22
  stdio: 'inherit',
package/blocklet.yml CHANGED
@@ -14,7 +14,7 @@ repository:
14
14
  type: git
15
15
  url: git+https://github.com/blocklet/payment-kit.git
16
16
  specVersion: 1.2.8
17
- version: 1.13.108
17
+ version: 1.13.110
18
18
  logo: logo.png
19
19
  files:
20
20
  - dist
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "payment-kit",
3
- "version": "1.13.108",
3
+ "version": "1.13.110",
4
4
  "scripts": {
5
- "dev": "COMPONENT_STORE_URL=https://test.store.blocklet.dev blocklet dev",
5
+ "dev": "cross-env COMPONENT_STORE_URL=https://test.store.blocklet.dev blocklet dev",
6
6
  "eject": "vite eject",
7
7
  "lint": "tsc --noEmit && eslint src api/src --ext .mjs,.js,.jsx,.ts,.tsx",
8
8
  "lint:fix": "npm run lint -- --fix",
@@ -98,7 +98,7 @@
98
98
  "rimraf": "^3.0.2",
99
99
  "sequelize": "^6.35.1",
100
100
  "sql-where-parser": "^2.2.1",
101
- "sqlite3": "^5.1.6",
101
+ "sqlite3": "^5.1.7",
102
102
  "stripe": "^13.11.0",
103
103
  "typewriter-effect": "^2.21.0",
104
104
  "ufo": "^1.3.2",
@@ -110,7 +110,7 @@
110
110
  "@abtnode/types": "1.16.22",
111
111
  "@arcblock/eslint-config": "^0.2.4",
112
112
  "@arcblock/eslint-config-ts": "^0.2.4",
113
- "@did-pay/types": "1.13.108",
113
+ "@did-pay/types": "1.13.110",
114
114
  "@types/cookie-parser": "^1.4.6",
115
115
  "@types/cors": "^2.8.17",
116
116
  "@types/dotenv-flow": "^3.3.3",
@@ -149,5 +149,5 @@
149
149
  "parser": "typescript"
150
150
  }
151
151
  },
152
- "gitHead": "2d898eb6fb22e234d95e5da8adb5e9ffdb1e0cb2"
152
+ "gitHead": "d62b501d4c5ea402b0b6bfd989a301f9b6b7bea3"
153
153
  }
@@ -79,7 +79,7 @@ export default function Layout(props: any) {
79
79
  return (
80
80
  <Center>
81
81
  <Stack maxWidth="sm" direction="column" alignItems="center" spacing={3}>
82
- <Avatar src={window.blocklet.appLogo} sx={{ width: 80, height: 80 }} />
82
+ <Avatar src={window.blocklet.appLogo} sx={{ width: 80, height: 80 }} variant="rounded" />
83
83
  <Stack direction="column" alignItems="center" spacing={3}>
84
84
  <Typography variant="h4">{window.blocklet.appName}</Typography>
85
85
  <Button size="large" variant="contained" color="secondary" onClick={handleLogin}>
@@ -74,7 +74,7 @@ PriceForm.defaultProps = {
74
74
 
75
75
  const INPUT_WIDTH = 260;
76
76
 
77
- const hasMoreCurrency = (methods: TPaymentMethodExpanded[]) => {
77
+ const hasMoreCurrency = (methods: TPaymentMethodExpanded[] = []) => {
78
78
  return methods.every((method) => method.payment_currencies.length > 1) || methods.length > 1;
79
79
  };
80
80
 
@@ -83,7 +83,7 @@ export default function PriceForm({ prefix, simple }: PriceFormProps) {
83
83
 
84
84
  const { t } = useLocaleContext();
85
85
  const { control, setValue, getFieldState } = useFormContext();
86
- const { settings, livemode } = useSettingsContext();
86
+ const { settings = {} as any, livemode } = useSettingsContext();
87
87
 
88
88
  const currencies = useFieldArray({ control, name: getFieldName('currency_options') });
89
89
 
@@ -92,6 +92,7 @@ export default function PriceForm({ prefix, simple }: PriceFormProps) {
92
92
  const isMetered = useWatch({ control, name: getFieldName('recurring.usage_type') }) === 'metered';
93
93
  const isCustomInterval = useWatch({ control, name: getFieldName('recurring.interval_config') }) === 'month_2';
94
94
  const model = useWatch({ control, name: getFieldName('model') });
95
+ const positive = (v: number) => v >= 0;
95
96
 
96
97
  return (
97
98
  <Root direction="column" alignItems="flex-start" spacing={2}>
@@ -146,8 +147,12 @@ export default function PriceForm({ prefix, simple }: PriceFormProps) {
146
147
  type="number"
147
148
  size="small"
148
149
  sx={{ width: INPUT_WIDTH }}
149
- error={!!getFieldState(getFieldName('unit_amount')).error}
150
- helperText={getFieldState(getFieldName('unit_amount')).error?.message}
150
+ error={!!getFieldState(getFieldName('unit_amount')).error || !positive(field.value)}
151
+ helperText={
152
+ !positive(field.value)
153
+ ? t('admin.price.unit_amount.positive')
154
+ : getFieldState(getFieldName('unit_amount')).error?.message
155
+ }
151
156
  InputProps={{
152
157
  endAdornment: <InputAdornment position="end">{settings.baseCurrency.symbol}</InputAdornment>,
153
158
  }}
@@ -6,7 +6,14 @@ export default function Status(props: ChipProps) {
6
6
  size="small"
7
7
  variant="outlined"
8
8
  {...props}
9
- sx={{ ...(props.sx || {}), borderRadius: '4px', height: 20, lineHeight: 1, textTransform: 'capitalize' }}
9
+ sx={{
10
+ ...(props.sx || {}),
11
+ borderRadius: '4px',
12
+ height: 20,
13
+ lineHeight: 1,
14
+ textTransform: 'capitalize',
15
+ marginRight: '10px',
16
+ }}
10
17
  />
11
18
  );
12
19
  }
package/tsconfig.json CHANGED
@@ -3,6 +3,8 @@
3
3
  "files": true
4
4
  },
5
5
  "compilerOptions": {
6
+ "ignoreDeprecations": "5.0",
7
+
6
8
  /* Visit https://aka.ms/tsconfig to read more about this file */
7
9
  /* Projects */
8
10
  // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */