@doubao-dev/taro-runtime 0.4.0-rc.1 → 0.4.0

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.
@@ -26,29 +26,34 @@ export function request(option) {
26
26
  header
27
27
  })
28
28
  .then((res) => {
29
- if (settled)
29
+ if (settled) {
30
30
  return buildSuccessResult(res.data, res.header, res.statusCode);
31
+ }
31
32
  settled = true;
32
- if (timeoutId)
33
+ if (timeoutId) {
33
34
  clearTimeout(timeoutId);
35
+ }
34
36
  const result = buildSuccessResult(res.data, res.header, res.statusCode);
35
37
  emitSuccess({ success, complete }, result, result);
36
38
  return result;
37
39
  })
38
40
  .catch((error) => {
39
- if (settled)
41
+ if (settled) {
40
42
  return Promise.reject(error);
43
+ }
41
44
  settled = true;
42
- if (timeoutId)
45
+ if (timeoutId) {
43
46
  clearTimeout(timeoutId);
47
+ }
44
48
  const result = buildFailResult(error);
45
49
  emitFailure({ fail, complete }, result);
46
50
  return Promise.reject(result);
47
51
  });
48
52
  if (Number.isFinite(timeout) && timeout > 0) {
49
53
  timeoutId = setTimeout(() => {
50
- if (settled)
54
+ if (settled) {
51
55
  return;
56
+ }
52
57
  settled = true;
53
58
  const result = buildFailResult('timeout');
54
59
  emitFailure({ fail, complete }, result);
@@ -1,7 +1,7 @@
1
+ import type { PickerViewProps as LynxPickerViewProps, PickerColumnOption } from '@byted-doubao-apps/framework/components';
1
2
  import type { CSSProperties } from '@lynx-js/types';
2
- import type { ReactNode } from 'react';
3
3
  import type { PickerViewProps as TaroPickerViewPropsBase } from '@tarojs/components';
4
- import type { PickerViewProps as LynxPickerViewProps, PickerColumnOption } from '@byted-doubao-apps/framework/components';
4
+ import type { ReactNode } from 'react';
5
5
  export type TaroPickerViewProps = TaroPickerViewPropsBase & {
6
6
  children?: ReactNode;
7
7
  theme?: LynxPickerViewProps['theme'];
@@ -42,22 +42,30 @@ export function mapPickerViewProps(props) {
42
42
  const unsupported = [];
43
43
  const indicatorItemHeight = resolveItemHeightFromIndicatorStyle(indicatorStyle);
44
44
  unsupported.push(...getUnsupportedIndicatorStyleWarnings(indicatorStyle, indicatorItemHeight));
45
- if (indicatorClass !== undefined)
45
+ if (indicatorClass !== undefined) {
46
46
  unsupported.push('indicatorClass');
47
- if (maskStyle !== undefined)
47
+ }
48
+ if (maskStyle !== undefined) {
48
49
  unsupported.push('maskStyle');
49
- if (maskClass !== undefined)
50
+ }
51
+ if (maskClass !== undefined) {
50
52
  unsupported.push('maskClass');
51
- if (immediateChange !== undefined)
53
+ }
54
+ if (immediateChange !== undefined) {
52
55
  unsupported.push('immediateChange');
53
- if (onPickStart !== undefined)
56
+ }
57
+ if (onPickStart !== undefined) {
54
58
  unsupported.push('onPickStart');
55
- if (onPickEnd !== undefined)
59
+ }
60
+ if (onPickEnd !== undefined) {
56
61
  unsupported.push('onPickEnd');
57
- if (title !== undefined)
62
+ }
63
+ if (title !== undefined) {
58
64
  unsupported.push('title');
59
- if (ariaLabel !== undefined)
65
+ }
66
+ if (ariaLabel !== undefined) {
60
67
  unsupported.push('ariaLabel');
68
+ }
61
69
  const mapped = {};
62
70
  if (theme === 'light' || theme === 'dark') {
63
71
  mapped.theme = theme;
@@ -12,8 +12,9 @@ export function mapTextProps(props) {
12
12
  const mapped = {};
13
13
  const unsupported = [];
14
14
  Object.entries(props).forEach(([key, value]) => {
15
- if (key === 'children')
15
+ if (key === 'children') {
16
16
  return;
17
+ }
17
18
  const target = TEXT_PROP_MAP[key] ?? BASE_PROP_MAP[key];
18
19
  if (target) {
19
20
  if (target === 'text-maxline') {
@@ -2,8 +2,9 @@ export function warnUnsupported(component, unsupported) {
2
2
  if (globalThis.process?.env?.NODE_ENV === 'production') {
3
3
  return;
4
4
  }
5
- if (unsupported.length === 0)
5
+ if (unsupported.length === 0) {
6
6
  return;
7
+ }
7
8
  // eslint-disable-next-line no-console
8
9
  console.warn(`[components-taro] ${component} unsupported props:`, unsupported);
9
10
  }
@@ -37,7 +37,8 @@ export function unregisterLifecycle(type, handler, id) {
37
37
  const store = getLifecycle(id);
38
38
  const list = store[type];
39
39
  const index = list.indexOf(handler);
40
- if (index >= 0)
40
+ if (index >= 0) {
41
41
  list.splice(index, 1);
42
+ }
42
43
  }
43
44
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -37,7 +37,7 @@
37
37
  "access": "public",
38
38
  "registry": "https://registry.npmjs.org/"
39
39
  },
40
- "version": "0.4.0-rc.1",
40
+ "version": "0.4.0",
41
41
  "scripts": {
42
42
  "dev": "npm run build -- -w",
43
43
  "build": "rimraf dist bundle && tsc -p tsconfig.build.json",