Core concepts(核心概念)¶
Widget set¶
A widget set is a Compass resource that represents versions of custom frontend code. Each widget set version can include multiple widgets, and each widget has its own entry point. Widget sets make it easier to manage and publish several widgets that share the same code or assets from a single code repository.
Widget¶
A widget is an individual component within a widget set, designed to perform a specific function or display particular content. Widgets are permissioned based on the widget set to which it belongs and declare a configuration shape to interact with its host application (such as Workshop).
Parameters¶
Parameters are configurable for each widget, and are designed to allow the host application (such as Workshop) to pass data into the widget. Parameters can currently be passed as primitive values (for example: a string, number, or Boolean) or arrays of primitive values. For a complete list of supported parameter types, see parameters and events.
Events¶
Events are configurable for each widget, and allow widgets a mechanism for updating parameters or signaling that the host application (such as Workshop) should perform some action.
中文翻译¶
核心概念¶
微件集(Widget set)¶
微件集是一种 Compass 资源,用于表示自定义前端代码的各个版本。每个微件集版本可包含多个微件(widget),且每个微件拥有独立的入口点。微件集能够更便捷地管理并发布多个共享同一代码库或资源的微件。
微件(Widget)¶
微件是微件集中的独立组件,旨在执行特定功能或展示特定内容。微件的权限基于其所属的微件集进行管理,并通过声明配置结构(configuration shape)与宿主应用(如 Workshop)进行交互。
参数(Parameters)¶
参数可针对每个微件进行配置,旨在允许宿主应用(如 Workshop)向微件传递数据。当前参数支持以原始值(例如字符串、数字或布尔值)或原始值数组的形式传递。有关支持的参数类型完整列表,请参阅参数与事件。
事件(Events)¶
事件可针对每个微件进行配置,为微件提供一种机制,用于更新参数或通知宿主应用(如 Workshop)执行特定操作。