From 333c177f1c560fd17b04f1b1926c52b724f952f0 Mon Sep 17 00:00:00 2001 From: Chris Villa Date: Wed, 5 Jul 2023 18:39:31 +0100 Subject: [PATCH] docs: add adaptors to README --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 4908e473ad..0682bf0d1c 100644 --- a/README.md +++ b/README.md @@ -156,6 +156,8 @@ A `Field` represents a user input field shown in the Puck interface. - **options** (`object[]`): array of items to render for select-type inputs - **label** (`string`) - **value** (`string`) +- **adaptor** (`Adaptor`): Content adaptor if using the `external` input type +- **adaptorParams** (`object`): Paramaters passed to the adaptor ### `Data` @@ -169,6 +171,15 @@ The `Data` object stores the state of a page. - **props** (object): - **[prop]** (string): User defined data from component fields +### `Adaptor` + +An `Adaptor` can be used to load content from an external content repository, like Strapi.js. + +- **name** (`string`): The human-readable name of the adaptor +- **fetchList** (`(adaptorParams: object) => object`): Fetch a list of content and return an array + +> NB Using an adaptor on the reserved field name `_data` will spread the resulting data over your object, and lock the overridden fields. + ### `Plugin` Plugins that can be used to enhance Puck.