@doubao-dev/template 0.9.1 → 0.10.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
@@ -31,20 +31,20 @@ export default function ProductCard() {
31
31
 
32
32
  ## 选择模板
33
33
 
34
- 安装包使用者请查阅[在线卡片模板文档](https://developer.doubao.com/docs/templates/)。下表链接到仓库中的参考文档,供浏览源码和维护文档时使用。
34
+ 按业务场景选择模板,点击链接查看对应的在线文档。
35
35
 
36
- | 场景 | 模板与仓内参考 |
36
+ | 场景 | 模板文档 |
37
37
  | --- | --- |
38
- | 商品、服务、内容列表 | [ContentCard](../../../docs/templates/content-card.mdx) |
39
- | 报价与方案选择 | [PriceActionCard](../../../docs/templates/price-action-card.mdx) |
40
- | 优惠券展示与使用 | [CouponCard](../../../docs/templates/coupon-card.mdx) |
41
- | 下单、支付确认 | [CheckoutCard](../../../docs/templates/checkout-card.mdx) |
42
- | 交通票务列表 | [TransitCard](../../../docs/templates/transit-card.mdx) |
43
- | 地图、位置和叫车信息 | [MapCard](../../../docs/templates/map-card.mdx) |
44
- | 人工确认选项 | [AskHumanCard](../../../docs/templates/ask-human-card.mdx) |
45
- | 多种内容组成一张卡片 | [CompositeCard](../../../docs/templates/composite-card.mdx) |
38
+ | 商品、服务、内容列表 | [ContentCard](https://open.doubao.com/apps-plugin/docs/templates/content-card) |
39
+ | 报价与方案选择 | [PriceActionCard](https://open.doubao.com/apps-plugin/docs/templates/price-action-card) |
40
+ | 优惠券展示与使用 | [CouponCard](https://open.doubao.com/apps-plugin/docs/templates/coupon-card) |
41
+ | 下单、支付确认 | [CheckoutCard](https://open.doubao.com/apps-plugin/docs/templates/checkout-card) |
42
+ | 交通票务列表 | [TransitCard](https://open.doubao.com/apps-plugin/docs/templates/transit-card) |
43
+ | 地图、位置和叫车信息 | [MapCard](https://open.doubao.com/apps-plugin/docs/templates/map-card) |
44
+ | 人工确认选项 | [AskHumanCard](https://open.doubao.com/apps-plugin/docs/templates/ask-human-card) |
45
+ | 多种内容组成一张卡片 | [CompositeCard](https://open.doubao.com/apps-plugin/docs/templates/composite-card) |
46
46
 
47
- 标题、标签、价格、选项、数量调节、勾选框和协议声明见 [Primitives](../../../docs/templates/shared-components.mdx#primitives)。
47
+ 标题、标签、价格、选项、数量调节、勾选框和协议声明见 [Primitives](https://open.doubao.com/apps-plugin/docs/templates/shared-components#primitives)。
48
48
 
49
49
  `Checkbox`、`Agreement` 从 `@doubao-dev/template/primitives` 导入。
50
50
  `PriceActionCardItem.checkbox` 配置右侧勾选框,替换该项操作按钮;不传时保持按钮布局。
@@ -56,7 +56,7 @@ export default function ProductCard() {
56
56
  - `header`、内容区和 `footer` 独立配置;`onClick` 作用于卡片根节点。
57
57
  - 模板和 Primitives 不声明或暴露组件级 CSS 变量,可以直接使用已有的全局主题 token。
58
58
 
59
- 完整示例、Props、展示限制和回调行为统一维护在[卡片模板文档](../../../docs/templates/index.mdx),具体类型以项目安装版本为准。
59
+ 完整示例、Props、展示限制和回调行为统一维护在[卡片模板文档](https://open.doubao.com/apps-plugin/docs/templates/),具体类型以项目安装版本为准。
60
60
 
61
61
  ## 模板构建检查
62
62
 
@@ -135,6 +135,7 @@ function TemplateTransportSummary(props) {
135
135
  const priceNode = renderTemplateTransportSummaryPrice(price, tag, priceActionText, priceActionTone, showPriceActionIcon, priceExtraLoading, tagTone, 'dark' === theme, onPriceClick);
136
136
  const hasRoute = Boolean(departureNode || transferNode || arrivalNode);
137
137
  const hasRouteRow = hasRoute || null != priceNode;
138
+ const hasRouteHitArea = null != onRouteClick && (null != titleNode || hasRoute);
138
139
  if (null == titleNode && !hasRouteRow) return null;
139
140
  return <view className={clsx('doubao-template-transport-summary', className)}>
140
141
  {titleNode}
@@ -142,9 +143,10 @@ function TemplateTransportSummary(props) {
142
143
  {departureNode}
143
144
  {transferNode}
144
145
  {arrivalNode}
146
+ {hasRouteHitArea ? <view className="doubao-template-transport-summary__route-hit-area" catchtap={onRouteClick}/> : null}
145
147
  {priceNode}
146
148
  </view>}
147
- {null != onRouteClick && (null != titleNode || hasRoute) ? <view className="doubao-template-transport-summary__route-hit-area" catchtap={onRouteClick}/> : null}
149
+ {hasRouteHitArea ? <view className="doubao-template-transport-summary__route-hit-area" catchtap={onRouteClick}/> : null}
148
150
  </view>;
149
151
  }
150
152
  export { TemplateTransportSummary };
@@ -1 +1 @@
1
- .doubao-template-transport-summary{position:relative;display:flex;flex-direction:column;justify-content:flex-start;width:100%;min-width:0;box-sizing:border-box;padding:12px 12px 16px}.doubao-template-transport-summary__price-extra{position:relative;display:flex;width:100%;min-width:0}.doubao-template-transport-summary__price-extra-content{display:flex;flex-direction:row;align-items:center;justify-content:flex-end;width:100%;min-width:0}.doubao-template-transport-summary__price-extra-content--loading{visibility:hidden}.doubao-template-transport-summary__price-extra-loading-overlay{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:flex-end}.doubao-template-transport-summary__price-extra-loading{position:relative;width:16px;height:16px;flex-shrink:0}.doubao-template-transport-summary__price-extra-loading-spoke{position:absolute;top:1.333px;left:7.167px;width:1.667px;height:4.167px;border-radius:999px;transform-origin:50% 6.667px;animation:doubao-template-price-extra-loading-fade 1s linear infinite}.doubao-template-transport-summary__price-extra-loading--highlight .doubao-template-transport-summary__price-extra-loading-spoke{background-color:var(--theme-default-link)}.doubao-template-transport-summary__price-extra-loading--tag-marketing .doubao-template-transport-summary__price-extra-loading-spoke{background-color:#e66805}.doubao-template-transport-summary__price-extra-loading--muted .doubao-template-transport-summary__price-extra-loading-spoke{background-color:var(--neutral-70)}.doubao-template-transport-summary__price-extra-loading--tag-neutral .doubao-template-transport-summary__price-extra-loading-spoke{background-color:#666}.doubao-theme-dark .doubao-template-transport-summary__price-extra-loading--tag-marketing .doubao-template-transport-summary__price-extra-loading-spoke{background-color:var(--warning-500)}.doubao-theme-dark .doubao-template-transport-summary__price-extra-loading--tag-neutral .doubao-template-transport-summary__price-extra-loading-spoke{background-color:#bababa}.doubao-template-transport-summary__price-extra-loading-spoke--0{transform:rotate(0deg);animation-delay:0s}.doubao-template-transport-summary__price-extra-loading-spoke--1{transform:rotate(45deg);animation-delay:-0.125s}.doubao-template-transport-summary__price-extra-loading-spoke--2{transform:rotate(90deg);animation-delay:-0.25s}.doubao-template-transport-summary__price-extra-loading-spoke--3{transform:rotate(135deg);animation-delay:-0.375s}.doubao-template-transport-summary__price-extra-loading-spoke--4{transform:rotate(180deg);animation-delay:-0.5s}.doubao-template-transport-summary__price-extra-loading-spoke--5{transform:rotate(225deg);animation-delay:-0.625s}.doubao-template-transport-summary__price-extra-loading-spoke--6{transform:rotate(270deg);animation-delay:-0.75s}.doubao-template-transport-summary__price-extra-loading-spoke--7{transform:rotate(315deg);animation-delay:-0.875s}.doubao-template-transport-summary__route-hit-area{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1}.doubao-template-transport-summary__title,.doubao-template-transport-summary__route-point-main,.doubao-template-transport-summary__route-point-sub,.doubao-template-transport-summary__transfer-label,.doubao-template-transport-summary__price{display:flex;flex-direction:row;align-items:center;min-width:0;overflow:hidden;flex-shrink:0}.doubao-template-transport-summary__title{height:20px;max-width:100%;box-sizing:border-box}.doubao-template-transport-summary__title-text,.doubao-template-transport-summary__route-point-main-text,.doubao-template-transport-summary__arrival-day-offset-text,.doubao-template-transport-summary__route-point-sub-text,.doubao-template-transport-summary__transfer-label-text{overflow:hidden;font-family:"PingFang SC",sans-serif;font-style:normal;text-overflow:ellipsis;white-space:nowrap}.doubao-template-transport-summary__title-text{color:var(--neutral-100);font-size:13px;font-weight:400;line-height:20px}.doubao-template-transport-summary__route-row{position:relative;display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;align-content:flex-start;justify-content:space-between;width:100%;height:46px;min-width:0;margin-top:2px;overflow:hidden}.doubao-template-transport-summary__route-point{display:flex;flex-shrink:0;flex-direction:column;justify-content:center;width:66px;min-width:0;height:42px}.doubao-template-transport-summary__route-point--arrival{align-items:flex-end}.doubao-template-transport-summary__arrival{position:relative;display:flex;flex-shrink:0;width:66px;min-width:0;height:42px}.doubao-template-transport-summary__arrival .doubao-template-transport-summary__route-point{width:100%;height:42px}.doubao-template-transport-summary__route-point-main,.doubao-template-transport-summary__route-point-sub{width:100%}.doubao-template-transport-summary__route-point--arrival .doubao-template-transport-summary__route-point-main,.doubao-template-transport-summary__route-point--arrival .doubao-template-transport-summary__route-point-sub{justify-content:flex-end}.doubao-template-transport-summary__route-point--arrival .doubao-template-transport-summary__route-point-main-text,.doubao-template-transport-summary__route-point--arrival .doubao-template-transport-summary__route-point-sub-text{text-align:right}.doubao-template-transport-summary__route-point-main{height:22px}.doubao-template-transport-summary__route-point-sub{height:16px;margin-top:2px}.doubao-template-transport-summary__route-point-main-text{min-width:0;color:var(--neutral-100);font-family:"SF Pro",sans-serif;font-size:17px;font-weight:600;line-height:22px}.doubao-template-transport-summary__arrival-day-offset{position:absolute;top:2px;left:100%;display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;height:14px}.doubao-template-transport-summary__arrival-day-offset-text{color:var(--neutral-100);font-size:10px;font-weight:400;line-height:normal}.doubao-template-transport-summary__route-point-sub-text{color:var(--neutral-70);font-size:12px;font-weight:400;line-height:16px}.doubao-template-transport-summary__transfer-label-text{color:var(--neutral-50);font-size:10px;font-weight:400;line-height:14px}.doubao-template-transport-summary__transfer{display:flex;flex:none;flex-direction:row;align-items:center;justify-content:center;width:56px;min-width:0;height:42px;box-sizing:border-box}.doubao-template-transport-summary__transfer-inner{display:flex;flex-direction:column;align-items:center;justify-content:center;width:56px;min-width:0;height:38px}.doubao-template-transport-summary__transfer-label{height:14px}.doubao-template-transport-summary__transfer-arrow{display:flex;flex-direction:row;align-items:center;justify-content:center;width:36px;height:6px;flex-shrink:0}.doubao-template-transport-summary__transfer-arrow-icon{width:36px;height:6px;flex-shrink:0}.doubao-template-transport-summary__price{position:relative;z-index:2;flex:0 0 88px;flex-direction:column;align-items:flex-end;justify-content:center;width:88px;height:42px;box-sizing:border-box}.doubao-template-transport-summary__price>.doubao-price{justify-content:flex-end;width:100%;min-width:0;overflow:hidden}.doubao-template-transport-summary__price .doubao-price__amount,.doubao-template-transport-summary__price .doubao-price__main,.doubao-template-transport-summary__price .doubao-price__integer-group{max-width:100%;min-width:0;overflow:hidden}.doubao-template-transport-summary__price .doubao-price__main,.doubao-template-transport-summary__price .doubao-price__integer-group,.doubao-template-transport-summary__price .doubao-price__integer{flex-shrink:1}.doubao-template-transport-summary__price .doubao-price__integer{min-width:0;overflow:hidden;text-overflow:ellipsis}.doubao-template-transport-summary__price--with-action{gap:1px;height:39px}.doubao-template-transport-summary__price-action{display:flex;flex-direction:row;align-items:center;justify-content:flex-end;width:100%;min-width:0;height:16px;overflow:hidden}.doubao-template-transport-summary__price-action-text{min-width:0;overflow:hidden;font-family:"PingFang SC",sans-serif;font-size:12px;font-style:normal;font-weight:400;line-height:16px;text-align:right;text-overflow:ellipsis;white-space:nowrap}.doubao-template-transport-summary__price-action-text--highlight{color:var(--theme-default-link)}.doubao-template-transport-summary__price-action-text--muted{color:var(--neutral-70)}.doubao-template-transport-summary__price-action-icon{width:10px;height:10px;margin-right:-3px;flex-shrink:0;opacity:.34}.doubao-template-transport-summary__price--with-tag{gap:4px;height:46px}@keyframes doubao-template-price-extra-loading-fade{0%{opacity:1}100%{opacity:.2}}
1
+ .doubao-template-transport-summary{position:relative;display:flex;flex-direction:column;justify-content:flex-start;width:100%;min-width:0;box-sizing:border-box;padding:12px 12px 16px}.doubao-template-transport-summary__price-extra{position:relative;display:flex;width:100%;min-width:0}.doubao-template-transport-summary__price-extra-content{display:flex;flex-direction:row;align-items:center;justify-content:flex-end;width:100%;min-width:0}.doubao-template-transport-summary__price-extra-content--loading{visibility:hidden}.doubao-template-transport-summary__price-extra-loading-overlay{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:flex-end}.doubao-template-transport-summary__price-extra-loading{position:relative;width:16px;height:16px;flex-shrink:0}.doubao-template-transport-summary__price-extra-loading-spoke{position:absolute;top:1.333px;left:7.167px;width:1.667px;height:4.167px;border-radius:999px;transform-origin:50% 6.667px;animation:doubao-template-price-extra-loading-fade 1s linear infinite}.doubao-template-transport-summary__price-extra-loading--highlight .doubao-template-transport-summary__price-extra-loading-spoke{background-color:var(--theme-default-link)}.doubao-template-transport-summary__price-extra-loading--tag-marketing .doubao-template-transport-summary__price-extra-loading-spoke{background-color:#e66805}.doubao-template-transport-summary__price-extra-loading--muted .doubao-template-transport-summary__price-extra-loading-spoke{background-color:var(--neutral-70)}.doubao-template-transport-summary__price-extra-loading--tag-neutral .doubao-template-transport-summary__price-extra-loading-spoke{background-color:#666}.doubao-theme-dark .doubao-template-transport-summary__price-extra-loading--tag-marketing .doubao-template-transport-summary__price-extra-loading-spoke{background-color:var(--warning-500)}.doubao-theme-dark .doubao-template-transport-summary__price-extra-loading--tag-neutral .doubao-template-transport-summary__price-extra-loading-spoke{background-color:#bababa}.doubao-template-transport-summary__price-extra-loading-spoke--0{transform:rotate(0deg);animation-delay:0s}.doubao-template-transport-summary__price-extra-loading-spoke--1{transform:rotate(45deg);animation-delay:-0.125s}.doubao-template-transport-summary__price-extra-loading-spoke--2{transform:rotate(90deg);animation-delay:-0.25s}.doubao-template-transport-summary__price-extra-loading-spoke--3{transform:rotate(135deg);animation-delay:-0.375s}.doubao-template-transport-summary__price-extra-loading-spoke--4{transform:rotate(180deg);animation-delay:-0.5s}.doubao-template-transport-summary__price-extra-loading-spoke--5{transform:rotate(225deg);animation-delay:-0.625s}.doubao-template-transport-summary__price-extra-loading-spoke--6{transform:rotate(270deg);animation-delay:-0.75s}.doubao-template-transport-summary__price-extra-loading-spoke--7{transform:rotate(315deg);animation-delay:-0.875s}.doubao-template-transport-summary__route-hit-area{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1}.doubao-template-transport-summary__title,.doubao-template-transport-summary__route-point-main,.doubao-template-transport-summary__route-point-sub,.doubao-template-transport-summary__transfer-label,.doubao-template-transport-summary__price{display:flex;flex-direction:row;align-items:center;min-width:0;overflow:hidden;flex-shrink:0}.doubao-template-transport-summary__title{height:20px;max-width:100%;box-sizing:border-box}.doubao-template-transport-summary__title-text,.doubao-template-transport-summary__route-point-main-text,.doubao-template-transport-summary__arrival-day-offset-text,.doubao-template-transport-summary__route-point-sub-text,.doubao-template-transport-summary__transfer-label-text{overflow:hidden;font-family:"PingFang SC",sans-serif;font-style:normal;text-overflow:ellipsis;white-space:nowrap}.doubao-template-transport-summary__title-text{color:var(--neutral-100);font-size:13px;font-weight:400;line-height:20px}.doubao-template-transport-summary__route-row{position:relative;z-index:2;display:flex;flex-direction:row;flex-wrap:wrap;row-gap:4px;align-items:center;align-content:flex-start;justify-content:space-between;width:100%;height:46px;min-width:0;margin-top:2px;overflow:hidden}.doubao-template-transport-summary__route-point{display:flex;flex-shrink:0;flex-direction:column;justify-content:center;width:66px;min-width:0;height:42px}.doubao-template-transport-summary__route-point--arrival{align-items:flex-end}.doubao-template-transport-summary__arrival{position:relative;display:flex;flex-shrink:0;width:66px;min-width:0;height:42px}.doubao-template-transport-summary__arrival .doubao-template-transport-summary__route-point{width:100%;height:42px}.doubao-template-transport-summary__route-point-main,.doubao-template-transport-summary__route-point-sub{width:100%}.doubao-template-transport-summary__route-point--arrival .doubao-template-transport-summary__route-point-main,.doubao-template-transport-summary__route-point--arrival .doubao-template-transport-summary__route-point-sub{justify-content:flex-end}.doubao-template-transport-summary__route-point--arrival .doubao-template-transport-summary__route-point-main-text,.doubao-template-transport-summary__route-point--arrival .doubao-template-transport-summary__route-point-sub-text{text-align:right}.doubao-template-transport-summary__route-point-main{height:22px}.doubao-template-transport-summary__route-point-sub{height:16px;margin-top:2px}.doubao-template-transport-summary__route-point-main-text{min-width:0;color:var(--neutral-100);font-family:"SF Pro",sans-serif;font-size:17px;font-weight:600;line-height:22px}.doubao-template-transport-summary__arrival-day-offset{position:absolute;top:2px;left:100%;display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;height:14px}.doubao-template-transport-summary__arrival-day-offset-text{color:var(--neutral-100);font-size:10px;font-weight:400;line-height:normal}.doubao-template-transport-summary__route-point-sub-text{color:var(--neutral-70);font-size:12px;font-weight:400;line-height:16px}.doubao-template-transport-summary__transfer-label-text{width:100%;min-width:0;color:var(--neutral-50);font-size:10px;font-weight:400;line-height:14px;text-align:center}.doubao-template-transport-summary__transfer{display:flex;flex:none;flex-direction:row;align-items:center;justify-content:center;width:56px;min-width:0;height:42px;box-sizing:border-box}.doubao-template-transport-summary__transfer-inner{display:flex;flex-direction:column;align-items:center;justify-content:center;width:56px;min-width:0;height:38px}.doubao-template-transport-summary__transfer-label{width:100%;height:14px}.doubao-template-transport-summary__transfer-arrow{display:flex;flex-direction:row;align-items:center;justify-content:center;width:36px;height:6px;flex-shrink:0}.doubao-template-transport-summary__transfer-arrow-icon{width:36px;height:6px;flex-shrink:0}.doubao-template-transport-summary__price{position:relative;z-index:2;flex:0 0 88px;flex-direction:column;align-items:flex-end;justify-content:center;width:88px;height:42px;box-sizing:border-box}.doubao-template-transport-summary__price>.doubao-price{justify-content:flex-end;width:100%;min-width:0;overflow:hidden}.doubao-template-transport-summary__price .doubao-price__amount,.doubao-template-transport-summary__price .doubao-price__main,.doubao-template-transport-summary__price .doubao-price__integer-group{max-width:100%;min-width:0;overflow:hidden}.doubao-template-transport-summary__price .doubao-price__main,.doubao-template-transport-summary__price .doubao-price__integer-group,.doubao-template-transport-summary__price .doubao-price__integer{flex-shrink:1}.doubao-template-transport-summary__price .doubao-price__integer{min-width:0;overflow:hidden;text-overflow:ellipsis}.doubao-template-transport-summary__price--with-action{gap:1px;height:39px}.doubao-template-transport-summary__price-action{display:flex;flex-direction:row;align-items:center;justify-content:flex-end;width:100%;min-width:0;height:16px;overflow:hidden}.doubao-template-transport-summary__price-action-text{min-width:0;overflow:hidden;font-family:"PingFang SC",sans-serif;font-size:12px;font-style:normal;font-weight:400;line-height:16px;text-align:right;text-overflow:ellipsis;white-space:nowrap}.doubao-template-transport-summary__price-action-text--highlight{color:var(--theme-default-link)}.doubao-template-transport-summary__price-action-text--muted{color:var(--neutral-70)}.doubao-template-transport-summary__price-action-icon{width:10px;height:10px;margin-right:-3px;flex-shrink:0;opacity:.34}.doubao-template-transport-summary__price--with-tag{gap:4px;height:46px}@keyframes doubao-template-price-extra-loading-fade{0%{opacity:1}100%{opacity:.2}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doubao-dev/template",
3
- "version": "0.9.1",
3
+ "version": "0.10.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {