@tbox.cn/app-card-assets 0.1.0 → 0.1.1

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
@@ -7,3 +7,5 @@
7
7
  包不导出全量 React registry;不包含平台模板 ID,不解释远程页面配置。源码保留 750 设计尺寸,面向 template-agent 的 Less + postcss-pxtorem(rootValue=100)链。
8
8
 
9
9
  首页交互由 shared/actions.ts 适配:query 使用 home 槽 onSend,跳转使用应用 store 的 openLink 动作;接线示例见 shared/home-integration.md。
10
+
11
+ 容器与内部列宽约定见 [容器宽度](shared/home-integration.md#容器宽度)。
package/assets.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "assetVersion": "0.1.0",
3
+ "assetVersion": "0.1.1",
4
4
  "components": [
5
5
  {
6
6
  "name": "BlockIntro",
@@ -1,4 +1,6 @@
1
1
  .bannerContainer {
2
+ min-width: 0;
3
+ box-sizing: border-box;
2
4
  width: 100%;
3
5
  }
4
6
 
@@ -1,4 +1,6 @@
1
1
  .blockAnimal {
2
+ min-width: 0;
3
+ box-sizing: border-box;
2
4
  position: relative;
3
5
  width: 100%;
4
6
  height: 100%;
@@ -1,5 +1,8 @@
1
1
  /* 弹幕组件样式 */
2
2
  .danmuWallWrap {
3
+ width: 100%;
4
+ min-width: 0;
5
+ box-sizing: border-box;
3
6
  margin-bottom: 28px;
4
7
  }
5
8
 
@@ -1,4 +1,7 @@
1
1
  .cardContainer {
2
+ width: 100%;
3
+ min-width: 0;
4
+ box-sizing: border-box;
2
5
  // background-color: aqua;
3
6
  // overflow: hidden;
4
7
  // height: 506px;
@@ -23,11 +26,12 @@
23
26
  .sliderItem {
24
27
  position: absolute;
25
28
  width: 394px;
29
+ max-width: 100%;
26
30
  height: 506px;
27
31
  // overflow: hidden;
28
32
  border-radius: 40px;
29
33
  background-size: cover;
30
- left: calc(50% - 394px/2);
34
+ left: max(0px, calc(50% - 394px/2));
31
35
  top: 0;
32
36
  transition: transform 0.3s ease-in-out;
33
37
  visibility: visible;
@@ -1,4 +1,5 @@
1
1
  .cityContainer {
2
+ min-width: 0;
2
3
  margin-top: 32px;
3
4
  width: 100%;
4
5
  box-sizing: border-box;
@@ -1,4 +1,5 @@
1
1
  .welcomeSection {
2
+ min-width: 0;
2
3
  margin-top: 32px;
3
4
  display: flex;
4
5
  flex-direction: column;
@@ -1,20 +1,23 @@
1
1
  .nowList {
2
+ width: 100%;
3
+ min-width: 0;
4
+ box-sizing: border-box;
2
5
  margin-bottom: 28px;
3
6
  position: relative;
4
7
  }
5
8
 
6
9
  .listBox {
7
10
  width: 100%;
8
- display: flex;
9
- flex-direction: row;
10
- flex-wrap: wrap;
11
+ display: grid;
12
+ grid-template-columns: repeat(2, minmax(0, 1fr));
11
13
  gap: 32px;
12
14
  justify-content: center;
13
15
 
14
16
  }
15
17
 
16
18
  .listItem {
17
- width: 300px;
19
+ width: 100%;
20
+ min-width: 0;
18
21
  height: 416px;
19
22
  background-size: 100% 100%;
20
23
  }
@@ -1,4 +1,6 @@
1
1
  .articleList {
2
+ width: 100%;
3
+ min-width: 0;
2
4
  margin-bottom: 28px;
3
5
  box-sizing: border-box;
4
6
  }
@@ -1,4 +1,6 @@
1
1
  .serviceList {
2
+ width: 100%;
3
+ min-width: 0;
2
4
  margin-bottom: 28px;
3
5
  border-radius: 24px;
4
6
  background-color: rgba(255, 255, 255, 0.5);
@@ -28,21 +30,23 @@
28
30
  }
29
31
 
30
32
  .serversList {
31
- display: flex;
32
- flex-direction: row;
33
- flex-wrap: wrap;
34
- width: 622px;
33
+ display: grid;
34
+ grid-template-columns: repeat(4, minmax(0, 1fr));
35
+ width: 100%;
36
+ min-width: 0;
35
37
  }
36
38
 
37
39
  .serversItem {
38
40
  display: flex;
39
41
  justify-content: center;
40
42
  align-items: center;
41
- width: 155px;
43
+ min-width: 0;
42
44
  height: 86px;
43
45
  cursor: pointer;
44
46
  }
45
47
  .serversItemBox {
48
+ max-width: 100%;
49
+ min-width: 0;
46
50
  display: flex;
47
51
  flex-direction: column;
48
52
  justify-content: center;
@@ -59,4 +63,6 @@
59
63
  color: #1f3b63;
60
64
  margin-top: 8px;
61
65
  text-align: center;
66
+ max-width: 100%;
67
+ overflow-wrap: anywhere;
62
68
  }
@@ -1,4 +1,6 @@
1
1
  .travelType {
2
+ width: 100%;
3
+ min-width: 0;
2
4
  box-sizing: border-box;
3
5
  margin-bottom: 28px;
4
6
  }
@@ -33,6 +35,7 @@
33
35
  .optionsContainer {
34
36
  position: relative;
35
37
  width: 280px;
38
+ max-width: 100%;
36
39
  height: 164px;
37
40
  padding: 20px 24px;
38
41
  display: flex;
@@ -1,4 +1,6 @@
1
1
  .escortList {
2
+ width: 100%;
3
+ min-width: 0;
2
4
  box-sizing: border-box;
3
5
  position: relative;
4
6
  border-radius: 24px;
@@ -1,4 +1,7 @@
1
1
  .card {
2
+ width: 100%;
3
+ min-width: 0;
4
+ box-sizing: border-box;
2
5
  padding: 100px 24px 0 24px;
3
6
  margin-bottom: 28px;
4
7
  line-height: 1.5;
@@ -1,4 +1,7 @@
1
1
  .card {
2
+ width: 100%;
3
+ min-width: 0;
4
+ box-sizing: border-box;
2
5
  padding: 100px 24px 0 24px;
3
6
  margin-bottom: 28px;
4
7
  }
@@ -40,7 +43,8 @@
40
43
  }
41
44
 
42
45
  .container {
43
- //width: 100%;
46
+ width: 100%;
47
+ min-width: 0;
44
48
  //height: 100%;
45
49
  //position: relative;
46
50
  }
@@ -86,15 +90,14 @@
86
90
  padding: 24px 24px 0;
87
91
  box-sizing: border-box;
88
92
  white-space: normal;
89
- display: flex;
90
- flex-direction: row;
91
- flex-wrap: wrap;
92
- justify-content: space-between;
93
+ display: grid;
94
+ grid-template-columns: repeat(2, minmax(0, 1fr));
93
95
  gap: 12px;
94
96
  }
95
97
  .serviceItemContainer {
96
- flex: 2 1;
97
- width: 40%;
98
+ width: 100%;
99
+ min-width: 0;
100
+ box-sizing: border-box;
98
101
  padding: 20px 24px 20px 24px;
99
102
  border: 1px solid rgba(141, 159, 184, 0.4);
100
103
  border-radius: 24px;
@@ -103,6 +106,10 @@
103
106
  position: relative;
104
107
  }
105
108
 
109
+ .serviceItemContainer:last-child:nth-child(odd) {
110
+ grid-column: 1 / -1;
111
+ }
112
+
106
113
  .serviceItemContainerFill {
107
114
  width: 100%;
108
115
  }
@@ -121,7 +128,8 @@
121
128
  }
122
129
 
123
130
  .serviceItemUpperText {
124
- width: 190px;
131
+ flex: 1;
132
+ min-width: 0;
125
133
  font-size: 30px;
126
134
  line-height: 38px;
127
135
  font-weight: 500;
package/docs/Banner.md CHANGED
@@ -14,4 +14,4 @@ import Banner from '@/components/home/components/Banner';
14
14
  <Banner cardData={/* 按示例填写 */} bridgeAPI={bridge} />
15
15
  ```
16
16
 
17
- CSS Modules 使用 index.module.less,尺寸沿宿主 750 设计稿 / rootValue=100 的 rem 链。组合父容器建议 width:100%、max-width:750px(由宿主转换)、min-width:0;可直接改本地源码、顺序、样式和数据。图片 URL 仅为示例,生产使用部署者素材;没有请求真实业务数据。依赖声明以 assets.json 为准。
17
+ CSS Modules 使用 index.module.less,尺寸沿宿主 750 设计稿 / rootValue=100 的 rem 链。组合父容器宽度与布局约定见 [接入本地首页](../shared/home-integration.md#容器宽度);可直接改本地源码、顺序、样式和数据。图片 URL 仅为示例,生产使用部署者素材;没有请求真实业务数据。依赖声明以 assets.json 为准。
@@ -14,4 +14,4 @@ import BlockAnimal from '@/components/home/components/BlockAnimal';
14
14
  <BlockAnimal cardData={/* 按示例填写 */} bridgeAPI={bridge} />
15
15
  ```
16
16
 
17
- CSS Modules 使用 index.module.less,尺寸沿宿主 750 设计稿 / rootValue=100 的 rem 链。组合父容器建议 width:100%、max-width:750px(由宿主转换)、min-width:0;可直接改本地源码、顺序、样式和数据。图片 URL 仅为示例,生产使用部署者素材;没有请求真实业务数据。依赖声明以 assets.json 为准。
17
+ CSS Modules 使用 index.module.less,尺寸沿宿主 750 设计稿 / rootValue=100 的 rem 链。组合父容器宽度与布局约定见 [接入本地首页](../shared/home-integration.md#容器宽度);可直接改本地源码、顺序、样式和数据。图片 URL 仅为示例,生产使用部署者素材;没有请求真实业务数据。依赖声明以 assets.json 为准。
@@ -14,4 +14,4 @@ import BlockBarrage from '@/components/home/components/BlockBarrage';
14
14
  <BlockBarrage cardData={/* 按示例填写 */} bridgeAPI={bridge} />
15
15
  ```
16
16
 
17
- CSS Modules 使用 index.module.less,尺寸沿宿主 750 设计稿 / rootValue=100 的 rem 链。组合父容器建议 width:100%、max-width:750px(由宿主转换)、min-width:0;可直接改本地源码、顺序、样式和数据。图片 URL 仅为示例,生产使用部署者素材;没有请求真实业务数据。依赖声明以 assets.json 为准。
17
+ CSS Modules 使用 index.module.less,尺寸沿宿主 750 设计稿 / rootValue=100 的 rem 链。组合父容器宽度与布局约定见 [接入本地首页](../shared/home-integration.md#容器宽度);可直接改本地源码、顺序、样式和数据。图片 URL 仅为示例,生产使用部署者素材;没有请求真实业务数据。依赖声明以 assets.json 为准。
@@ -14,4 +14,4 @@ import BlockFanSwiper from '@/components/home/components/BlockFanSwiper';
14
14
  <BlockFanSwiper cardData={/* 按示例填写 */} bridgeAPI={bridge} />
15
15
  ```
16
16
 
17
- CSS Modules 使用 index.module.less,尺寸沿宿主 750 设计稿 / rootValue=100 的 rem 链。组合父容器建议 width:100%、max-width:750px(由宿主转换)、min-width:0;可直接改本地源码、顺序、样式和数据。图片 URL 仅为示例,生产使用部署者素材;没有请求真实业务数据。依赖声明以 assets.json 为准。
17
+ CSS Modules 使用 index.module.less,尺寸沿宿主 750 设计稿 / rootValue=100 的 rem 链。组合父容器宽度与布局约定见 [接入本地首页](../shared/home-integration.md#容器宽度);可直接改本地源码、顺序、样式和数据。图片 URL 仅为示例,生产使用部署者素材;没有请求真实业务数据。依赖声明以 assets.json 为准。
@@ -14,4 +14,4 @@ import BlockIntro from '@/components/home/components/BlockIntro';
14
14
  <BlockIntro cardData={/* 按示例填写 */} bridgeAPI={bridge} />
15
15
  ```
16
16
 
17
- CSS Modules 使用 index.module.less,尺寸沿宿主 750 设计稿 / rootValue=100 的 rem 链。组合父容器建议 width:100%、max-width:750px(由宿主转换)、min-width:0;可直接改本地源码、顺序、样式和数据。图片 URL 仅为示例,生产使用部署者素材;没有请求真实业务数据。依赖声明以 assets.json 为准。
17
+ CSS Modules 使用 index.module.less,尺寸沿宿主 750 设计稿 / rootValue=100 的 rem 链。组合父容器宽度与布局约定见 [接入本地首页](../shared/home-integration.md#容器宽度);可直接改本地源码、顺序、样式和数据。图片 URL 仅为示例,生产使用部署者素材;没有请求真实业务数据。依赖声明以 assets.json 为准。
@@ -14,4 +14,4 @@ import BlockIntroCenter from '@/components/home/components/BlockIntroCenter';
14
14
  <BlockIntroCenter cardData={/* 按示例填写 */} bridgeAPI={bridge} />
15
15
  ```
16
16
 
17
- CSS Modules 使用 index.module.less,尺寸沿宿主 750 设计稿 / rootValue=100 的 rem 链。组合父容器建议 width:100%、max-width:750px(由宿主转换)、min-width:0;可直接改本地源码、顺序、样式和数据。图片 URL 仅为示例,生产使用部署者素材;没有请求真实业务数据。依赖声明以 assets.json 为准。
17
+ CSS Modules 使用 index.module.less,尺寸沿宿主 750 设计稿 / rootValue=100 的 rem 链。组合父容器宽度与布局约定见 [接入本地首页](../shared/home-integration.md#容器宽度);可直接改本地源码、顺序、样式和数据。图片 URL 仅为示例,生产使用部署者素材;没有请求真实业务数据。依赖声明以 assets.json 为准。
@@ -14,4 +14,4 @@ import BlockNowList from '@/components/home/components/BlockNowList';
14
14
  <BlockNowList cardData={/* 按示例填写 */} bridgeAPI={bridge} />
15
15
  ```
16
16
 
17
- CSS Modules 使用 index.module.less,尺寸沿宿主 750 设计稿 / rootValue=100 的 rem 链。组合父容器建议 width:100%、max-width:750px(由宿主转换)、min-width:0;可直接改本地源码、顺序、样式和数据。图片 URL 仅为示例,生产使用部署者素材;没有请求真实业务数据。依赖声明以 assets.json 为准。
17
+ CSS Modules 使用 index.module.less,尺寸沿宿主 750 设计稿 / rootValue=100 的 rem 链。组合父容器宽度与布局约定见 [接入本地首页](../shared/home-integration.md#容器宽度);可直接改本地源码、顺序、样式和数据。图片 URL 仅为示例,生产使用部署者素材;没有请求真实业务数据。依赖声明以 assets.json 为准。
@@ -14,4 +14,4 @@ import BlockQuestionList from '@/components/home/components/BlockQuestionList';
14
14
  <BlockQuestionList cardData={/* 按示例填写 */} bridgeAPI={bridge} />
15
15
  ```
16
16
 
17
- CSS Modules 使用 index.module.less,尺寸沿宿主 750 设计稿 / rootValue=100 的 rem 链。组合父容器建议 width:100%、max-width:750px(由宿主转换)、min-width:0;可直接改本地源码、顺序、样式和数据。图片 URL 仅为示例,生产使用部署者素材;没有请求真实业务数据。依赖声明以 assets.json 为准。
17
+ CSS Modules 使用 index.module.less,尺寸沿宿主 750 设计稿 / rootValue=100 的 rem 链。组合父容器宽度与布局约定见 [接入本地首页](../shared/home-integration.md#容器宽度);可直接改本地源码、顺序、样式和数据。图片 URL 仅为示例,生产使用部署者素材;没有请求真实业务数据。依赖声明以 assets.json 为准。
@@ -14,4 +14,4 @@ import BlockServiceIconList from '@/components/home/components/BlockServiceIconL
14
14
  <BlockServiceIconList cardData={/* 按示例填写 */} bridgeAPI={bridge} />
15
15
  ```
16
16
 
17
- CSS Modules 使用 index.module.less,尺寸沿宿主 750 设计稿 / rootValue=100 的 rem 链。组合父容器建议 width:100%、max-width:750px(由宿主转换)、min-width:0;可直接改本地源码、顺序、样式和数据。图片 URL 仅为示例,生产使用部署者素材;没有请求真实业务数据。依赖声明以 assets.json 为准。
17
+ CSS Modules 使用 index.module.less,尺寸沿宿主 750 设计稿 / rootValue=100 的 rem 链。组合父容器宽度与布局约定见 [接入本地首页](../shared/home-integration.md#容器宽度);可直接改本地源码、顺序、样式和数据。图片 URL 仅为示例,生产使用部署者素材;没有请求真实业务数据。依赖声明以 assets.json 为准。
@@ -14,4 +14,4 @@ import BlockServiceList from '@/components/home/components/BlockServiceList';
14
14
  <BlockServiceList cardData={/* 按示例填写 */} bridgeAPI={bridge} />
15
15
  ```
16
16
 
17
- CSS Modules 使用 index.module.less,尺寸沿宿主 750 设计稿 / rootValue=100 的 rem 链。组合父容器建议 width:100%、max-width:750px(由宿主转换)、min-width:0;可直接改本地源码、顺序、样式和数据。图片 URL 仅为示例,生产使用部署者素材;没有请求真实业务数据。依赖声明以 assets.json 为准。
17
+ CSS Modules 使用 index.module.less,尺寸沿宿主 750 设计稿 / rootValue=100 的 rem 链。组合父容器宽度与布局约定见 [接入本地首页](../shared/home-integration.md#容器宽度);可直接改本地源码、顺序、样式和数据。图片 URL 仅为示例,生产使用部署者素材;没有请求真实业务数据。依赖声明以 assets.json 为准。
@@ -14,4 +14,4 @@ import BlockTravelCarousel from '@/components/home/components/BlockTravelCarouse
14
14
  <BlockTravelCarousel cardData={/* 按示例填写 */} bridgeAPI={bridge} />
15
15
  ```
16
16
 
17
- CSS Modules 使用 index.module.less,尺寸沿宿主 750 设计稿 / rootValue=100 的 rem 链。组合父容器建议 width:100%、max-width:750px(由宿主转换)、min-width:0;可直接改本地源码、顺序、样式和数据。图片 URL 仅为示例,生产使用部署者素材;没有请求真实业务数据。依赖声明以 assets.json 为准。
17
+ CSS Modules 使用 index.module.less,尺寸沿宿主 750 设计稿 / rootValue=100 的 rem 链。组合父容器宽度与布局约定见 [接入本地首页](../shared/home-integration.md#容器宽度);可直接改本地源码、顺序、样式和数据。图片 URL 仅为示例,生产使用部署者素材;没有请求真实业务数据。依赖声明以 assets.json 为准。
package/docs/OneCol.md CHANGED
@@ -14,4 +14,4 @@ import OneCol from '@/components/home/components/OneCol';
14
14
  <OneCol cardData={/* 按示例填写 */} bridgeAPI={bridge} />
15
15
  ```
16
16
 
17
- CSS Modules 使用 index.module.less,尺寸沿宿主 750 设计稿 / rootValue=100 的 rem 链。组合父容器建议 width:100%、max-width:750px(由宿主转换)、min-width:0;可直接改本地源码、顺序、样式和数据。图片 URL 仅为示例,生产使用部署者素材;没有请求真实业务数据。依赖声明以 assets.json 为准。
17
+ CSS Modules 使用 index.module.less,尺寸沿宿主 750 设计稿 / rootValue=100 的 rem 链。组合父容器宽度与布局约定见 [接入本地首页](../shared/home-integration.md#容器宽度);可直接改本地源码、顺序、样式和数据。图片 URL 仅为示例,生产使用部署者素材;没有请求真实业务数据。依赖声明以 assets.json 为准。
package/docs/TwoCol.md CHANGED
@@ -14,4 +14,4 @@ import TwoCol from '@/components/home/components/TwoCol';
14
14
  <TwoCol cardData={/* 按示例填写 */} bridgeAPI={bridge} />
15
15
  ```
16
16
 
17
- CSS Modules 使用 index.module.less,尺寸沿宿主 750 设计稿 / rootValue=100 的 rem 链。组合父容器建议 width:100%、max-width:750px(由宿主转换)、min-width:0;可直接改本地源码、顺序、样式和数据。图片 URL 仅为示例,生产使用部署者素材;没有请求真实业务数据。依赖声明以 assets.json 为准。
17
+ CSS Modules 使用 index.module.less,尺寸沿宿主 750 设计稿 / rootValue=100 的 rem 链。组合父容器宽度与布局约定见 [接入本地首页](../shared/home-integration.md#容器宽度);可直接改本地源码、顺序、样式和数据。图片 URL 仅为示例,生产使用部署者素材;没有请求真实业务数据。依赖声明以 assets.json 为准。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tbox.cn/app-card-assets",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "description": "可复制、可编辑的卡片源码资源",
6
6
  "files": [
@@ -1,29 +1,22 @@
1
1
  # 接入本地首页
2
2
 
3
- 复制的 components/、shared/、docs/、examples/ 属于应用源码,可直接改写。home add 只复制素材与声明运行依赖,不注册槽位。先 pnpm install,再按此文组合。
3
+ `home add` 复制源码并声明依赖,运行 `pnpm install` 后,在 `apps/client/src/business/home/Home.tsx` 组合组件。用法和数据示例见复制目录的 `docs/`、`examples/`,本地源码可直接修改。
4
4
 
5
- ## 入口与保护
5
+ ## 注册首页
6
6
 
7
- 在 apps/client/src/business/home/Home.tsx 组合所选组件与数据,直接按路径导入,不创建全量卡片 registry。用法与 JSON 示例在复制目录的 docs/ 和 examples/。
8
-
9
- 在 apps/client/src/cards/registry.ts 的 registerAll(ctx) 之后,先检查 ctx.slots.has('home')。已有 home(尤其 mall-core)时停止自动接线,确认是否替换及门禁等业务副作用如何保留,不能直接覆盖。无 home 时导入本地 Home 并注册;该文件扩展名为 .ts,使用 createElement:
7
+ 在 `apps/client/src/cards/registry.ts` 的 `registerAll(ctx)` 之后注册。已有 home 槽时先确认替换方案,保留原有业务逻辑;首页显隐复用宿主逻辑。
10
8
 
11
9
  ```ts
12
10
  import { createElement } from 'react';
13
11
  import Home from '../business/home/Home';
14
12
 
15
- // registerAll(ctx) 之后;保持原有 cards/filter/slots 导出。
16
13
  if (ctx.slots.has('home')) throw new Error('已有首页,请确认替换方案');
17
14
  ctx.slots.register('home', (props) => createElement(Home, props));
18
15
  ```
19
16
 
20
- Home 的 props 使用 @tbox.cn/app-contracts 的 HomeSlotRenderProps。不要在 slot 回调里直接运行 Hooks;由 Home 组件处理状态。模板 ChatPage 已按 historyMessages、messages、inlineOrphanCards 判断首页显隐,无需再创建一套显隐逻辑。首页收起时子组件卸载,轮播、弹幕等按自身清理函数停止动画。
21
-
22
- ## 点击与资源
17
+ ## 点击接线
23
18
 
24
- 局部 CardAssetBridge 由 shared/actions.ts 的 createCardAssetBridge 创建。query 通过 home 槽传入的 onSend,复用 ChatPage 的滚动处理、生成中门控和现有 SEND_MESSAGE 链路;不要新建 WS、调用模型接口或把 query 改成 UI_ACTION。
25
-
26
- 跳转复用应用 useChatStore 的 sendUiAction,以 openLink 本地动作进入 SDK 现有导航逻辑:浏览器 window.open,支付宝壳按深链解析结果走 navigateTo/navigateToMiniProgram,其余链接走 ap.openURL,tel 使用既有电话入口。不要另写 location.assign、window.open 或独立容器桥,也不要在失败后再补一次跳转。
19
+ query 复用 `onSend`,跳转复用 `openLink`,不要另建消息或导航链路。将 bridge 传给卡片的 `bridgeAPI`:
27
20
 
28
21
  ```tsx
29
22
  import { createCardAssetBridge } from '@/components/home/shared/actions';
@@ -35,13 +28,22 @@ function Home({ onSend }: HomeSlotRenderProps) {
35
28
  const bridge = createCardAssetBridge(onSend, (url) => {
36
29
  sendUiAction('home', { type: 'openLink', url });
37
30
  });
38
- // 将 bridge 传给本地卡片的 bridgeAPI prop。
39
31
  // return <BlockServiceList cardData={data} bridgeAPI={bridge} />;
40
32
  }
41
33
  ```
42
34
 
43
- home 是本地导航动作的来源标识,不需要创建服务端卡片实例。不要使用 sendMessage 类型的 UI_ACTION 或臆造卡片 ID 发起首页 query。
35
+ `clickAction=query` 发起对话,`jump/link` 跳转;未指定时优先 jumpUrl,其次 query。适配器过滤空值及不支持的链接。
36
+
37
+ ## 容器宽度
44
38
 
45
- 适配器过滤空 query 和空链接;链接允许 http/https、alipay/alipays/alipayrisk 深链及 tel,拦截脚本与数据 URL。clickAction=query 时只发送 query;jump/link 时只跳转。缺少 clickAction 的旧示例以 jumpUrl 优先、query 次之;未知动作不执行。Banner 的 screenHeight 不提供半屏能力,所有跳转由现有导航链处理。
39
+ 首页撑满父容器,不设置固定宽度或额外 max-width,左右留白由组合层统一维护:
40
+
41
+ ```less
42
+ .home {
43
+ width: 100%;
44
+ min-width: 0;
45
+ box-sizing: border-box;
46
+ }
47
+ ```
46
48
 
47
- 对业务数据接入、链接与图片按用户材料实现,不把素材示例描述成真实查询结果。首屏宽度、背景、间距在应用组合层维护,视觉遵循用户选定风格。
49
+ 保留卡片原有列数、滚动和动画。样式沿宿主 750 设计稿 / rootValue=100 转 rem。图片与业务数据使用用户材料;更新资源包不会自动覆盖已复制的应用源码。