@financial-times/community-event-teaser

中文文档
11.7.4发布于 2026/11/11ISCCommonJS近 30 天下载 2173

community event teasers etc

原始使用文档
文档目录6 节
  1. Description
  2. Note
  3. Installation
  4. Usage
  5. Development
  6. Setting up your local environment

Community-event-teaser

Storybook: https://jubilant-umbrella-dd461ca9.pages.github.io

Description

  • This is a package which contains the UI component for an event.
  • The community-event-teaser provides those elements for rendering EventTeaser, EventTopicCardItem, and EventPromo
  • The community-event-teaser also provides export of two util functions: liveEventToEventTeaserProps, and initTeaserTracking

Note

  • The initTeaserTracking is using a reference of oTracking passed in the function. The package is tested and compatible with versions from 4.0.0 to 4.4.0.

Installation

npm install @financial-times/community-event-teaser

Usage

  • Example of how to use the <EventTeaser/>

    import { h, render } from '@financial-times/x-engine';
    import { EventTeaser } from "@financial-times/community-event-teaser";
    
    const container = document.querySelector('.some-container-element');
    
    render((
      <EventTeaser
        imgUrl={"https://ftweekend.live.ft.com/some-cool-image-png"}
        title={"FTWeekend Festival"}
        standfirst={"Some short description of the event"}
        eventUrl={"https://ftweekend.live.ft.com"}
        lazyLoadImage={"some__lazy-loading-classname"}
        location={"Kenwood House Gardens & Online"}
        scheduledStartTime={new Date("2021-09-04T12:00:00.000Z")}
        showImage={true}
        showBrand={true}
        showStandfirst={true}
      />), container)
    
  • Example of how to use the EventTopicCardItem

    import { h, render } from '@financial-times/x-engine';
    import { EventTopicCardItem } from "@financial-times/community-event-teaser";
    
    const container = document.querySelector('.some-container-element');
    
    render((
      <EventTopicCardItem
        title={"FTWeekend Festival"}
        eventUrl={"https://ftweekend.live.ft.com"}
        location={"Kenwood House Gardens & Online"}
        scheduledStartTime={new Date("2021-09-04T12:00:00.000Z")}
      />), container)
    

Development

Setting up your local environment

  • Simply clone this repo, cd into the directory and run:
npm install

版本与发布记录

@financial-times/community-event-teaser 共发布 254 个版本,首次发布于 2021/08/24;过去 12 个月发布了 22 个版本。

版本发布日期距今
11.7.4latest2026/11/113 天前
11.7.4-alpha.2794.1pre-release2026/11/113 天前
11.7.4-alpha.2794.02026/11/113 天前
11.7.32026/10/2124 天前
11.7.3-alpha.2752.12026/10/2124 天前
11.7.3-alpha.2752.02026/10/2025 天前

关于 @financial-times/community-event-teaser 的常见问题

@financial-times/community-event-teaser 是什么?

community event teasers etc

如何安装 @financial-times/community-event-teaser?

在项目目录运行 npm install @financial-times/community-event-teaser,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:ftdomdelegate(^5.0.0)、@financial-times/o-grid(^6.0.0)、@financial-times/sass-mq(^5.0.0)、@financial-times/x-engine(>=6.0.0)、@financial-times/o-tracking(^4.5.0)、@financial-times/o3-foundation(^3.2.1)、@financial-times/ft-date-format(^2.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@financial-times/community-event-teaser 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/financial-times__community-event-teaser 是否存在。

@financial-times/community-event-teaser 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@financial-times/community-event-teaser 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js 20.x。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@financial-times/community-event-teaser 可以商用吗?

@financial-times/community-event-teaser 使用 ISC 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@financial-times/community-event-teaser 的下载量有多少?

根据 npm 官方下载统计,@financial-times/community-event-teaser 在 2026/10/15 – 2026/11/13 这 30 天内被下载 2,173 次,日均约 72 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@financial-times/community-event-teaser 还在维护吗?

最新版本 11.7.4 发布于 2026/11/11(3 天前);至今共发布 254 个版本,其中过去 12 个月发布了 22 个;首次发布于 2021/08/24。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。