godanny86 / aem-react-editable-components

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Table of contents

Installation

npm install @adobe/aem-react-editable-components

Usage

This module provides generic React helpers and components supporting AEM authoring.

It also wraps and the following modules (React agnostic):

  • @adobe/aem-spa-component-mapping
  • @adobe/aem-spa-page-model-manager

React Components

The following components can be used to build React SPA aimed at being authored in AEM:

  • ModelProvider, which wraps a portion of the page model into a component
  • Container, which offers dynamic inclusion of its children components
  • ResponsiveGrid, the default container grid component (already mapped to wcm/foundation/components/responsivegrid)

Map To

The MapTo helper can be used to directly associate resource type(s) with a given SPA component.

import { MapTo } from '@adobe/aem-react-editable-components';

class MyComponent {
    ...
}

export default MapTo('my/resource/type')(MyComponent);

Page Model Manager

The PageModelManager API allows to manage the model representation of the AEM pages that are composing a SPA.

The ModelProvider internally uses it to fetch content from AEM and inject it into a given React component. It also keeps the React component in sync when the content in AEM changes.

Documentation

The technical documentation.

Contributing

Contributions are welcome! Read the Contributing Guide for more information.

Licensing

This project is licensed under the Apache V2 License. See LICENSE for more information.

About

License:Apache License 2.0


Languages

Language:TypeScript 96.9%Language:JavaScript 1.7%Language:HTML 1.3%