From 2a04cef984dc65e7ea96c4b773aa806adef3e037 Mon Sep 17 00:00:00 2001 From: Philipp Hugenroth Date: Wed, 24 Jan 2024 09:39:28 +0100 Subject: [PATCH] Add all existing data refs Signed-off-by: Philipp Hugenroth --- .../architecture/03-extensions.md | 2 - .../building-plugins/04-built-in-data-refs.md | 95 ++++++++++++++++--- 2 files changed, 84 insertions(+), 13 deletions(-) diff --git a/docs/frontend-system/architecture/03-extensions.md b/docs/frontend-system/architecture/03-extensions.md index 6d86415817..cfbabdf9bc 100644 --- a/docs/frontend-system/architecture/03-extensions.md +++ b/docs/frontend-system/architecture/03-extensions.md @@ -81,8 +81,6 @@ const extension = createExtension({ Note that while the `createExtension` is public API and used in many places, it is not typically what you use when building plugins and features. Instead there are many extension creator functions exported by both the core APIs and plugins that make it easier to create extensions for more specific usages. -... TODO ... - ## Extension Data Communication between extensions happens in one direction, from one child extension through the attachment point to its parent. The child extension outputs data which is then passed as inputs to the parent extension. This data is called Extension Data, where the shape of each individual piece of data is described by an Extension Data Reference. These references are created separately from the extensions themselves, and can be shared across multiple different kinds of extensions. Each reference consists of an ID and a TypeScript type that the data needs to conform to, and represents one type of data that can be shared between extensions. diff --git a/docs/frontend-system/building-plugins/04-built-in-data-refs.md b/docs/frontend-system/building-plugins/04-built-in-data-refs.md index ee6875e1cb..16ded9a9fd 100644 --- a/docs/frontend-system/building-plugins/04-built-in-data-refs.md +++ b/docs/frontend-system/building-plugins/04-built-in-data-refs.md @@ -3,22 +3,95 @@ id: built-in-data-refs title: Built-in data refs sidebar_label: Built-in data refs # prettier-ignore -description: Configuring or overriding built-in data refs +description: Configuring or overriding built-in extension data references --- -## Disable built-in data refs +To have a better understanding of extension data references please read [extension data section the extensions architecture documentation](../architecture/03-extensions.md#extension-data) first. -## Override built-in data refs +## Built-in extension data references -## Default built-in data refs +### Frontend Plugin API -### Example +#### Core Extension Data -#### Example +| namespace | name | type | id | +| :-------: | :----------: | :---------: | :-----------------: | +| - | reactElement | JSX.Element | `core.reactElement` | +| - | routePath | string | `core.routing.path` | +| - | routeRef | RouteRef | `core.routing.ref` | -Extensions that provides a default `light` and `dark` app themes. +#### -| kind | namespace | name | id | -| :---: | :-------: | :---: | :---------------: | -| theme | app | light | `theme:app/light` | -| theme | app | dark | `theme:app/dark` | +| namespace | name | type | id | +| :----------------: | :------------: | :-----------: | :--------------: | +| createApiExtension | factoryDataRef | AnyApiFactory | core.api.factory | + +#### + +| namespace | name | type | id | +| :---------------------------: | :--------------: | :----------------------------------: | :--------------: | +| createAppRootWrapperExtension | componentDataRef | ComponentType> | app.root.wrapper | + +#### + +| namespace | name | type | id | +| :-------------------: | :--------------: | :----------------------------------: | :--------------: | +| createRouterExtension | componentDataRef | ComponentType> | app.root.wrapper | + +#### + +```ts +type DataType = { + title: string; + icon: IconComponent; + routeRef: RouteRef; +}; +``` + +| namespace | name | type | id | +| :--------------------: | :-----------: | :------: | :------------------: | +| createNavItemExtension | targetDataRef | DataType | core.nav-item.target | + +#### + +```ts +type DataType = { + logoIcon?: JSX.Element; + logoFull?: JSX.Element; +}; +``` + +| namespace | name | type | id | +| :--------------------: | :-----------------: | :----------------------------------: | :-------------------------: | +| createNavLogoExtension | logoElementsDataRef | ComponentType> | core.nav-logo.logo-elements | + +#### + +| namespace | name | type | id | +| :-----------------------: | :--------------: | :----------------------------: | :-------------------------: | +| createSignInPageExtension | componentDataRef | ComponentType | core.sign-in-page.component | + +#### + +| namespace | name | type | id | +| :------------------: | :----------: | :------: | :--------------: | +| createThemeExtension | themeDataRef | AppTheme | core.theme.theme | + +#### + +```ts +type DataType = { + ref: ComponentRef; + impl: ComponentType; +}; +``` + +| namespace | name | type | id | +| :----------------------: | :--------------: | :------: | :----------------------: | +| createComponentExtension | componentDataRef | DataType | core.component.component | + +#### + +| namespace | name | type | id | +| :------------------------: | :----------------: | :----------------------------------------: | :--------------------------: | +| createTranslationExtension | translationDataRef | TranslationResource or TranslationMessages | core.translation.translation |