@doubao-dev/template 0.9.0 → 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
 
@@ -14,20 +14,24 @@ function isCheckoutCardNodeEmpty(content) {
14
14
  function hasCheckoutCardProductItemContent(item) {
15
15
  return null != item.title && item.title.length > 0 || null != item.spec && item.spec.length > 0 || null != item.imageSrc && item.imageSrc.length > 0 || !isCheckoutCardNodeEmpty(item.image) || null != item.pricePrefix && item.pricePrefix.length > 0 || !isCheckoutCardTextEmpty(item.price) || !isCheckoutCardTextEmpty(item.quantity);
16
16
  }
17
- function renderCheckoutCardProductItem({ item, index }) {
18
- if (!hasCheckoutCardProductItemContent(item)) return null;
17
+ function renderCheckoutCardProductItem({ item, index, showDivider }) {
19
18
  const { key, onClick, ...productSummaryProps } = item;
20
19
  return <view className="doubao-checkout-card__product" key={key ?? index}>
20
+ {showDivider && <view className="doubao-checkout-card__divider"/>}
21
21
  <TemplateProductSummary {...productSummaryProps} onClick={onClick}/>
22
22
  </view>;
23
23
  }
24
24
  function CheckoutCard(props) {
25
25
  const { header, productItems = [], infoItems = [], feeItems = [], totalLabel, totalPrice, footer, onClick } = props;
26
26
  const cardStyle = useHostCardStyle();
27
- const productNodes = productItems.map((item, index)=>renderCheckoutCardProductItem({
27
+ const productNodes = productItems.reduce((nodes, item, index)=>{
28
+ if (hasCheckoutCardProductItemContent(item)) nodes.push(renderCheckoutCardProductItem({
28
29
  item,
29
- index
30
- })).filter((node)=>null != node);
30
+ index,
31
+ showDivider: nodes.length > 0
32
+ }));
33
+ return nodes;
34
+ }, []);
31
35
  return <view className={useThemeClassName('doubao-checkout-card')} style={cardStyle} bindtap={onClick} clip-radius="true">
32
36
  <TemplateCardHeader actionText={header?.actionText} statusText={header?.statusText} showAction={header?.showAction} onActionClick={header?.onActionClick}/>
33
37
 
@@ -1 +1 @@
1
- .doubao-checkout-card{display:flex;flex-direction:column;align-items:stretch;width:100%;box-sizing:border-box;overflow:hidden;background-color:var(--bg-base-1);border:1px solid var(--bg-base-2-overlay);border-radius:12px}.doubao-checkout-card__products{display:flex;flex-direction:column;align-items:stretch;width:100%}.doubao-checkout-card__product{position:relative}.doubao-checkout-card__product+.doubao-checkout-card__product::before{position:absolute;top:0;right:16px;left:16px;height:1px;background-color:var(--neutral-transparent-1);content:""}
1
+ .doubao-checkout-card{display:flex;flex-direction:column;align-items:stretch;width:100%;box-sizing:border-box;overflow:hidden;background-color:var(--bg-base-1);border:1px solid var(--bg-base-2-overlay);border-radius:12px}.doubao-checkout-card__products{display:flex;flex-direction:column;align-items:stretch;width:100%}.doubao-checkout-card__product{position:relative}.doubao-checkout-card__divider{position:absolute;top:0;right:16px;left:16px;height:1px;pointer-events:none;background-color:var(--neutral-transparent-1)}
@@ -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}}
@@ -40,7 +40,7 @@ function ContentCardItemView({ item, isLast }) {
40
40
  const subtitleNode = renderContentCardText(subtitle, 'doubao-content-card__subtitle');
41
41
  const descriptionNode = renderContentCardText(description, "doubao-content-card__description");
42
42
  const actionNode = renderContentCardAction(item.action);
43
- return <view className={clsx('doubao-content-card__item', isLast && 'doubao-content-card__item--last', !hasThumbnail && 'doubao-content-card__item--without-thumbnail')} {...null != item.onClick ? {
43
+ return <view className={clsx('doubao-content-card__item', !hasThumbnail && 'doubao-content-card__item--without-thumbnail')} {...null != item.onClick ? {
44
44
  catchtap: item.onClick
45
45
  } : {}}>
46
46
  <view className="doubao-content-card__content">
@@ -56,6 +56,7 @@ function ContentCardItemView({ item, isLast }) {
56
56
  {actionNode}
57
57
  </view>}
58
58
  </view>
59
+ {!isLast && <view className={clsx('doubao-content-card__divider', !hasThumbnail && 'doubao-content-card__divider--without-thumbnail')}/>}
59
60
  </view>;
60
61
  }
61
62
  function ContentCardContent({ items }) {
@@ -1 +1 @@
1
- .doubao-content-card{display:flex;flex-direction:column;align-items:stretch;width:100%;box-sizing:border-box;overflow:hidden;background-color:var(--bg-base-1);border:1px solid var(--bg-base-2-overlay);border-radius:12px}.doubao-content-card__body{width:100%;box-sizing:border-box}.doubao-content-card__item{position:relative;width:100%;padding:12px;box-sizing:border-box}.doubao-content-card__item--without-thumbnail{padding-top:16px;padding-bottom:16px}.doubao-content-card__item::after{position:absolute;right:0;bottom:0;left:104px;height:1px;content:"";background-color:var(--neutral-transparent-1)}.doubao-content-card__item--without-thumbnail::after{left:12px}.doubao-content-card__item--last::after{display:none}.doubao-content-card__content{display:flex;flex-direction:row;align-items:center;gap:12px;width:100%;min-width:0}.doubao-content-card__main{display:flex;flex:1 1 0;flex-direction:row;align-items:center;gap:12px;min-width:0}.doubao-content-card__thumbnail{align-self:flex-start;width:80px;height:80px;flex-shrink:0;overflow:hidden;background-color:var(--bg-base-1-overlay);border-radius:5px}.doubao-content-card__thumbnail-image{width:100%;height:100%}.doubao-content-card__text{display:flex;flex:1 1 0;flex-direction:column;align-items:flex-start;gap:2px;min-width:0}.doubao-content-card__title{width:100%;overflow:hidden;color:var(--neutral-100);font-family:"PingFang SC",sans-serif;font-size:16px;font-style:normal;font-weight:500;line-height:24px;text-overflow:ellipsis;white-space:nowrap}.doubao-content-card__title-custom,.doubao-content-card__subtitle-custom,.doubao-content-card__description-custom{display:flex;flex-direction:row;align-items:center;width:100%;max-width:100%;overflow:hidden}.doubao-content-card__secondary,.doubao-content-card__tertiary{display:flex;flex-direction:row;align-items:center;width:100%;min-width:0;overflow:hidden}.doubao-content-card__subtitle,.doubao-content-card__description{width:100%;overflow:hidden;color:var(--neutral-70);font-family:"PingFang SC",sans-serif;font-size:13px;font-style:normal;font-weight:400;line-height:20px;text-overflow:ellipsis;white-space:nowrap}.doubao-content-card__item-action{display:flex;flex-shrink:0;flex-direction:row;align-items:center;justify-content:center}.doubao-content-card__item:not(.doubao-content-card__item--without-thumbnail) .doubao-content-card__content{align-items:flex-start}.doubao-content-card__item:not(.doubao-content-card__item--without-thumbnail) .doubao-content-card__item-action{height:80px}.doubao-content-card__item-action-button{width:auto;min-width:60px;max-width:100px}.doubao-content-card__item-action-switch{flex-shrink:0}.doubao-content-card__item-action-playback{display:flex;flex-shrink:0;align-items:center;justify-content:center;width:32px;height:32px}.doubao-content-card__item-action-playback--disabled{opacity:.4}.doubao-content-card__item-action-playback-icon{width:32px;height:32px}
1
+ .doubao-content-card{display:flex;flex-direction:column;align-items:stretch;width:100%;box-sizing:border-box;overflow:hidden;background-color:var(--bg-base-1);border:1px solid var(--bg-base-2-overlay);border-radius:12px}.doubao-content-card__body{width:100%;box-sizing:border-box}.doubao-content-card__item{position:relative;width:100%;padding:12px;box-sizing:border-box}.doubao-content-card__item--without-thumbnail{padding-top:16px;padding-bottom:16px}.doubao-content-card__divider{position:absolute;right:0;bottom:0;left:104px;height:1px;pointer-events:none;background-color:var(--neutral-transparent-1)}.doubao-content-card__divider--without-thumbnail{left:12px}.doubao-content-card__content{display:flex;flex-direction:row;align-items:center;gap:12px;width:100%;min-width:0}.doubao-content-card__main{display:flex;flex:1 1 0;flex-direction:row;align-items:center;gap:12px;min-width:0}.doubao-content-card__thumbnail{align-self:flex-start;width:80px;height:80px;flex-shrink:0;overflow:hidden;background-color:var(--bg-base-1-overlay);border-radius:5px}.doubao-content-card__thumbnail-image{width:100%;height:100%}.doubao-content-card__text{display:flex;flex:1 1 0;flex-direction:column;align-items:flex-start;gap:2px;min-width:0}.doubao-content-card__title{width:100%;overflow:hidden;color:var(--neutral-100);font-family:"PingFang SC",sans-serif;font-size:16px;font-style:normal;font-weight:500;line-height:24px;text-overflow:ellipsis;white-space:nowrap}.doubao-content-card__title-custom,.doubao-content-card__subtitle-custom,.doubao-content-card__description-custom{display:flex;flex-direction:row;align-items:center;width:100%;max-width:100%;overflow:hidden}.doubao-content-card__secondary,.doubao-content-card__tertiary{display:flex;flex-direction:row;align-items:center;width:100%;min-width:0;overflow:hidden}.doubao-content-card__subtitle,.doubao-content-card__description{width:100%;overflow:hidden;color:var(--neutral-70);font-family:"PingFang SC",sans-serif;font-size:13px;font-style:normal;font-weight:400;line-height:20px;text-overflow:ellipsis;white-space:nowrap}.doubao-content-card__item-action{display:flex;flex-shrink:0;flex-direction:row;align-items:center;justify-content:center}.doubao-content-card__item:not(.doubao-content-card__item--without-thumbnail) .doubao-content-card__content{align-items:flex-start}.doubao-content-card__item:not(.doubao-content-card__item--without-thumbnail) .doubao-content-card__item-action{height:80px}.doubao-content-card__item-action-button{width:auto;min-width:60px;max-width:100px}.doubao-content-card__item-action-switch{flex-shrink:0}.doubao-content-card__item-action-playback{display:flex;flex-shrink:0;align-items:center;justify-content:center;width:32px;height:32px}.doubao-content-card__item-action-playback--disabled{opacity:.4}.doubao-content-card__item-action-playback-icon{width:32px;height:32px}
@@ -21,7 +21,7 @@ function PriceActionCardItemView({ item, isLast }) {
21
21
  const hasBadge = !isPriceActionCardTextEmpty(item.badgeText);
22
22
  const hasAction = null != item.actionText && item.actionText.length > 0;
23
23
  const infoRows = (item.infoRows ?? []).filter((infoRow)=>!isPriceActionCardTextEmpty(infoRow.text)).slice(0, PRICE_ACTION_CARD_INFO_ROW_LIMIT);
24
- return <view className={clsx('doubao-price-action-card__item', isLast && 'doubao-price-action-card__item--last', null != item.checkbox && 'doubao-price-action-card__item--checkbox')} {...null != item.onClick ? {
24
+ return <view className={clsx('doubao-price-action-card__item', null != item.checkbox && 'doubao-price-action-card__item--checkbox')} {...null != item.onClick ? {
25
25
  catchtap: item.onClick
26
26
  } : {}}>
27
27
  <view className="doubao-price-action-card__item-content">
@@ -38,6 +38,7 @@ function PriceActionCardItemView({ item, isLast }) {
38
38
  </view>
39
39
  {null != item.checkbox ? <Checkbox {...item.checkbox}/> : hasAction ? <Button className="doubao-price-action-card__item-action" type="default" text={item.actionText} onClick={item.onActionClick}/> : null}
40
40
  </view>
41
+ {!isLast && <view className="doubao-price-action-card__divider"/>}
41
42
  </view>;
42
43
  }
43
44
  function PriceActionCard(props) {
@@ -1 +1 @@
1
- .doubao-price-action-card{display:flex;flex-direction:column;align-items:stretch;width:100%;box-sizing:border-box;overflow:hidden;background-color:var(--bg-base-1);border:1px solid var(--bg-base-2-overlay);border-radius:12px}.doubao-price-action-card__body{width:100%;box-sizing:border-box}.doubao-price-action-card__default{width:100%;box-sizing:border-box}.doubao-price-action-card__item{position:relative;display:flex;flex-direction:row;align-items:center;width:100%;height:82px;padding:20px 12px;box-sizing:border-box}.doubao-price-action-card__item::after{position:absolute;right:0;bottom:0;left:95px;height:1px;content:"";background-color:var(--neutral-transparent-1)}.doubao-price-action-card__item--last::after{display:none}.doubao-price-action-card__item--checkbox{height:74px;padding:16px 12px}.doubao-price-action-card__item--checkbox .doubao-price-action-card__value{width:75px;box-sizing:border-box}.doubao-price-action-card__item-content{display:flex;flex-direction:row;align-items:center;width:100%;gap:12px}.doubao-price-action-card__value{display:flex;flex-direction:column;align-items:flex-start;padding:0 4px;width:94px;min-width:0;flex-shrink:0}.doubao-price-action-card__value>.doubao-price{width:100%;min-width:0;overflow:hidden}.doubao-price-action-card__value>.doubao-price .doubao-price__amount,.doubao-price-action-card__value>.doubao-price .doubao-price__main,.doubao-price-action-card__value>.doubao-price .doubao-price__integer-group{max-width:100%;min-width:0;overflow:hidden}.doubao-price-action-card__value>.doubao-price .doubao-price__main,.doubao-price-action-card__value>.doubao-price .doubao-price__integer-group,.doubao-price-action-card__value>.doubao-price .doubao-price__integer{flex-shrink:1}.doubao-price-action-card__value>.doubao-price .doubao-price__integer{min-width:0;overflow:hidden;text-overflow:ellipsis}.doubao-price-action-card__badge{height:20px;max-width:100%;padding:2px 3px;box-sizing:border-box;overflow:hidden;color:var(--theme-default-link);font-family:"PingFang SC",sans-serif;font-size:11px;font-style:normal;font-weight:400;line-height:14px;text-overflow:ellipsis;white-space:nowrap;background-color:var(--primary-transparent-1);border-radius:4px}.doubao-price-action-card__info{display:flex;flex:1 1 0;flex-direction:column;justify-content:center;min-width:0}.doubao-price-action-card__info-row{width:100%;overflow:hidden;color:var(--neutral-70);font-family:"PingFang SC",sans-serif;font-size:13px;font-style:normal;font-weight:400;line-height:20px;text-overflow:ellipsis;white-space:nowrap}.doubao-price-action-card__info-row+.doubao-price-action-card__info-row{margin-top:2px}.doubao-price-action-card__item-action{width:auto;min-width:60px;max-width:100px;height:38px;flex-shrink:0;--doubao-button-border-radius: 8px;--doubao-button-default-border-radius: 8px;--doubao-button-default-height: 38px;--doubao-button-default-padding-x: 12px;--doubao-button-default-padding-y: 0;--doubao-button-default-font-size: 14px;--doubao-button-default-line-height: 20px;--doubao-button-default-bg: var(--bg-base-1-overlay);--doubao-button-default-text: var(--neutral-100)}
1
+ .doubao-price-action-card{display:flex;flex-direction:column;align-items:stretch;width:100%;box-sizing:border-box;overflow:hidden;background-color:var(--bg-base-1);border:1px solid var(--bg-base-2-overlay);border-radius:12px}.doubao-price-action-card__body{width:100%;box-sizing:border-box}.doubao-price-action-card__default{width:100%;box-sizing:border-box}.doubao-price-action-card__item{position:relative;display:flex;flex-direction:row;align-items:center;width:100%;height:82px;padding:20px 12px;box-sizing:border-box}.doubao-price-action-card__divider{position:absolute;right:0;bottom:0;left:95px;height:1px;pointer-events:none;background-color:var(--neutral-transparent-1)}.doubao-price-action-card__item--checkbox{height:74px;padding:16px 12px}.doubao-price-action-card__item--checkbox .doubao-price-action-card__value{width:75px;box-sizing:border-box}.doubao-price-action-card__item-content{display:flex;flex-direction:row;align-items:center;width:100%;gap:12px}.doubao-price-action-card__value{display:flex;flex-direction:column;align-items:flex-start;padding:0 4px;width:94px;min-width:0;flex-shrink:0}.doubao-price-action-card__value>.doubao-price{width:100%;min-width:0;overflow:hidden}.doubao-price-action-card__value>.doubao-price .doubao-price__amount,.doubao-price-action-card__value>.doubao-price .doubao-price__main,.doubao-price-action-card__value>.doubao-price .doubao-price__integer-group{max-width:100%;min-width:0;overflow:hidden}.doubao-price-action-card__value>.doubao-price .doubao-price__main,.doubao-price-action-card__value>.doubao-price .doubao-price__integer-group,.doubao-price-action-card__value>.doubao-price .doubao-price__integer{flex-shrink:1}.doubao-price-action-card__value>.doubao-price .doubao-price__integer{min-width:0;overflow:hidden;text-overflow:ellipsis}.doubao-price-action-card__badge{height:20px;max-width:100%;padding:2px 3px;box-sizing:border-box;overflow:hidden;color:var(--theme-default-link);font-family:"PingFang SC",sans-serif;font-size:11px;font-style:normal;font-weight:400;line-height:14px;text-overflow:ellipsis;white-space:nowrap;background-color:var(--primary-transparent-1);border-radius:4px}.doubao-price-action-card__info{display:flex;flex:1 1 0;flex-direction:column;justify-content:center;min-width:0}.doubao-price-action-card__info-row{width:100%;overflow:hidden;color:var(--neutral-70);font-family:"PingFang SC",sans-serif;font-size:13px;font-style:normal;font-weight:400;line-height:20px;text-overflow:ellipsis;white-space:nowrap}.doubao-price-action-card__info-row+.doubao-price-action-card__info-row{margin-top:2px}.doubao-price-action-card__item-action{width:auto;min-width:60px;max-width:100px;height:38px;flex-shrink:0;--doubao-button-border-radius: 8px;--doubao-button-default-border-radius: 8px;--doubao-button-default-height: 38px;--doubao-button-default-padding-x: 12px;--doubao-button-default-padding-y: 0;--doubao-button-default-font-size: 14px;--doubao-button-default-line-height: 20px;--doubao-button-default-bg: var(--bg-base-1-overlay);--doubao-button-default-text: var(--neutral-100)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doubao-dev/template",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {