@doubao-dev/taro-runtime 0.4.1 → 0.5.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.
package/README.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # @doubao-dev/taro-runtime
2
2
 
3
- `@doubao-dev/taro-runtime` 提供豆包智能服务场景下的 Taro 运行时适配层。
3
+ 豆包应用插件的 Taro 运行时适配层,目前处于实验阶段。
4
4
 
5
- > **实验性特性**:本包当前处于实验阶段
5
+ 在 Taro 应用中安装:
6
6
 
7
- ## 安装
8
-
9
- ```bash
7
+ ```sh
10
8
  pnpm add @doubao-dev/taro-runtime
11
9
  ```
10
+
11
+ 然后按 [Taro 构建接入说明](../../taro-plugin/README.md#接入-taro-项目) 配置 Kit 的 `experiments.taro`。构建插件会将 `@tarojs/taro` 和 `@tarojs/components` 映射到本包,业务代码继续使用 Taro 的导入方式。
@@ -1,6 +1,6 @@
1
1
  import { useCallback, useContext, useEffect, useRef, useState } from '@byted-doubao-apps/framework';
2
- import { warnUnsupported } from '../base/warn-unsupported.js';
3
2
  import { RadioGroupRuntimeContext } from '../RadioGroup/context.js';
3
+ import { warnUnsupported } from '../base/warn-unsupported.js';
4
4
  import { mapRadioProps, resolveLynxRadioValue, resolveStandaloneSelectedValue, shouldDispatchStandaloneRadioChange, toRadioChangeEvent } from './map.js';
5
5
  import { markRuntimeRadio } from './shared.js';
6
6
  function RadioImpl(props) {
@@ -60,7 +60,7 @@ function RadioImpl(props) {
60
60
  const lynxStandaloneGroupProps = {
61
61
  disabled: resolvedDisabled,
62
62
  onValueChange: handleStandaloneSelect,
63
- ...(standaloneSelectedValue !== null ? { value: standaloneSelectedValue } : {})
63
+ value: standaloneSelectedValue
64
64
  };
65
65
  return (<view {...mapped}>
66
66
  <radio-group {...lynxStandaloneGroupProps}>
@@ -27,7 +27,7 @@ type MapRadioPropsResult = {
27
27
  };
28
28
  export declare function mapRadioProps(props: MappableTaroRadioProps): MapRadioPropsResult;
29
29
  export declare function resolveLynxRadioValue(value: string | undefined, fallback: string): string;
30
- export declare function resolveStandaloneSelectedValue(isChecked: boolean, value: string): string | null;
30
+ export declare function resolveStandaloneSelectedValue(isChecked: boolean, value: string): string;
31
31
  export declare function shouldDispatchStandaloneRadioChange(isChecked: boolean): boolean;
32
32
  export declare function toRadioChangeEvent(detail: {
33
33
  value?: string;
@@ -39,7 +39,8 @@ export function resolveLynxRadioValue(value, fallback) {
39
39
  return value ?? fallback;
40
40
  }
41
41
  export function resolveStandaloneSelectedValue(isChecked, value) {
42
- return isChecked ? value : null;
42
+ // Keep the inner group controlled with a value that cannot select this radio.
43
+ return isChecked ? value : `__taro_runtime_radio_unchecked_${value}`;
43
44
  }
44
45
  export function shouldDispatchStandaloneRadioChange(isChecked) {
45
46
  return !isChecked;
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.1",
40
+ "version": "0.5.0",
41
41
  "scripts": {
42
42
  "dev": "npm run build -- -w",
43
43
  "build": "rimraf dist bundle && tsc -p tsconfig.build.json",