@ adobe/ spectrum-wc- core (中文(简体) )
Spectrum Web组件的抽象基础类.
此软件包提供了 gen2 Spectrum Web 组件的行为层, 并且是 非直接对外使用它独立于第1代——它们之间没有运行时间依赖.
详情请访问 Spectrum Web 组件仓库。 。 。 .
文件夹结构
核心包是私人/内部的,因此我们可以组织基础代码,用于可发现性和递增迁移.
core/
element/ # SpectrumElement, defineElement, and element infrastructure
mixins/ # Reusable mixins (SizedMixin, ObserveSlotPresence, etc.)
controllers/ # Reactive controllers (Lit controllers, observers, etc.)
utils/ # Utility functions (DOM helpers, label extraction, etc.)
components/ # Component base classes (already established)
命名
所有新文件夹和文件 /core 应该是kebab案.
进口
选择新代码的新顶级路径 :
@adobe/spectrum-wc-core/element@adobe/spectrum-wc-core/mixins@adobe/spectrum-wc-core/controllers@adobe/spectrum-wc-core/utils
新的代码应该使用上面的顶级路径.
移徙
见 MIGRATION.md 用于指导迁移代码的位置.