@adobe/cq-react-editable-components 中文文档教程
Table of contents
The package is deprecated
包裹已被移动。 请使用 @adobe/aem-react-editable-components
Installation
npm install @adobe/cq-react-editable-components
Usage
此模块提供通用 React支持 AEM 创作的助手和组件。
它还包含以下模块(React 不可知论者):
@adobe/cq-spa-component-mapping
@adobe/cq-spa-page-model-manager
React Components
以下组件可用于构建旨在在 AEM 中编写的 React SPA:
ModelProvider
, which wraps a portion of the page model into a componentContainer
, which offers dynamic inclusion of its children componentsResponsiveGrid
, the default container grid component (already mapped towcm/foundation/components/responsivegrid
)
Map To
MapTo
帮助程序可用于直接关联资源类型使用给定的 SPA 组件。
import { MapTo } from '@adobe/cq-react-editable-components';
class MyComponent {
...
}
export default MapTo('my/resource/type')(MyComponent);
Page Model Manager
PageModelManager
API 允许管理构成 SPA 的 AEM 页面的模型表示。
ModelProvider
在内部使用它从 AEM 获取内容并将其注入到给定的 React 组件中。 当 AEM 中的内容发生变化时,它还会使 React 组件保持同步。
API
@adobe/cq-react-editable-components 1.3.3
src/Constants.ts
new Constants()
与 CQ/AEM 组件交互的有用变量。
Returns
Void
src/Utils.ts
isBrowser()
通过检查是否在浏览器上下文中返回 窗口对象的存在。
Returns
Boolean
the result of the check of the existance of the window object
Utils()
用于与 AEM 环境交互的辅助函数。
Returns
Void
isInEditor()
是在 AEM Page 编辑器的上下文中使用的应用程序。
Returns
boolean
src/HierarchyConstants.ts
new HierarchyType()
层次类型
Returns
Void
Documentation
技术文档已经可用,但如果您无法解决问题或发现错误,您可以随时联系我们并寻求帮助!
Changelog
1.3.2 - 24 August 2020
- Deprecating the library. Renaming to
aem-react-editable-components
.
1.3.1 - 20 August 2020
- Fix of types
1.3.0 - 20 August 2020
- Update codebase to TypeScript
1.2.1 - 5 June 2020
- Update to latest
cq-spa-page-model-manager
1.2.0 - 19 December 2019
- Make
react-fast-compare
a dependency instead of a peer dependency - Remove optional dependencies
1.1.0 - 5 April 2019
- NEW FEATURE Template Editor
- Give access to the list of Allowed Components from the ResponsiveGrid component
1.0.4 - 13 December 2018
- Support for latest
cq-spa-page-model-manager
andcq-spa-component-mapping
API
1.0.3 - 28 September 2018
- BREAKING CHANGE Refactoring of the Container, ResponsiveGrid and Placeholders to improve extensibility
- BREAKING CHANGE Relocation of the columnClassNames field from the ResponsiveColumn to the ResponsiveGrid to respect the latest model representation, the field type changed
- Support for latest
cq-spa-page-model-manager
API - BREAKING CHANGE 'dragDropName' support removed for EditConfig in ComponentMapping
0.0.30 - 20 June 2018
重大变化
props
传递给重命名的组件:cq_model
=>cqModel
cq_model_page_path
=> =>cqModelPagePath
cq_model_data_path
=> =>cqModelDataPath
通过预览模型进入编辑器时不显示响应式网格占位符
更改路由方法以默认支持 History API(已删除哈希路由支持)
中断性更改 ModelProvider
props
重命名为:data_path
=>数据路径
page_path
=>pagePath
force_reload
=>forceReload
0.0.29 - 15 May 2018
cq-spa-page-model-manager
的公开发布,它提供:
- Support for the latest version of the
com.adobe.cq.export.json.hierarchy
API- Support and usage of the
:path
and:children
fields to identify a page and its child pages
- Support and usage of the
0.0.28 - 20 April 2018
cq-react-editable-components 的初始公开发布。 其中:
@adobe/cq-spa-component-mapping#0.0.15
@adobe/cq-spa-page-model-manager#0.0.22
.- Updated Base React Components with support for multiple pages:
Container
supports page and items inclusionModelProvider
generatesdata-cq-page-path
anddata-cq-data-path
attributes (previously:data-cq-content-path
) respectively from thecq_model_data_path
andcq_model_page_path
properties (previously:cq_model_path
)
Contributing
欢迎投稿! 阅读贡献指南了解更多信息。
Licensing
这个项目是根据 Apache V2 许可证获得许可的。 有关详细信息,请参阅许可证。
Table of contents
The package is deprecated
The package has been moved. Please use @adobe/aem-react-editable-components
Installation
npm install @adobe/cq-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/cq-spa-component-mapping
@adobe/cq-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 componentContainer
, which offers dynamic inclusion of its children componentsResponsiveGrid
, the default container grid component (already mapped towcm/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/cq-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.
API
@adobe/cq-react-editable-components 1.3.3
src/Constants.ts
new Constants()
Useful variables for interacting with CQ/AEM components.
Returns
Void
src/Utils.ts
isBrowser()
Returns if we are in the browser context or not by checking for the existance of the window object.
Returns
Boolean
the result of the check of the existance of the window object
Utils()
Helper functions for interacting with the AEM environment.
Returns
Void
isInEditor()
Is the app used in the context of the AEM Page editor.
Returns
boolean
src/HierarchyConstants.ts
new HierarchyType()
Hierarchical types
Returns
Void
Documentation
The technical documentation is already available, but if you are unable to solve your problem or you found a bug you can always contact us and ask for help!
Changelog
1.3.2 - 24 August 2020
- Deprecating the library. Renaming to
aem-react-editable-components
.
1.3.1 - 20 August 2020
- Fix of types
1.3.0 - 20 August 2020
- Update codebase to TypeScript
1.2.1 - 5 June 2020
- Update to latest
cq-spa-page-model-manager
1.2.0 - 19 December 2019
- Make
react-fast-compare
a dependency instead of a peer dependency - Remove optional dependencies
1.1.0 - 5 April 2019
- NEW FEATURE Template Editor
- Give access to the list of Allowed Components from the ResponsiveGrid component
1.0.4 - 13 December 2018
- Support for latest
cq-spa-page-model-manager
andcq-spa-component-mapping
API
1.0.3 - 28 September 2018
- BREAKING CHANGE Refactoring of the Container, ResponsiveGrid and Placeholders to improve extensibility
- BREAKING CHANGE Relocation of the columnClassNames field from the ResponsiveColumn to the ResponsiveGrid to respect the latest model representation, the field type changed
- Support for latest
cq-spa-page-model-manager
API - BREAKING CHANGE 'dragDropName' support removed for EditConfig in ComponentMapping
0.0.30 - 20 June 2018
BREAKING CHANGE
props
that are passed to Components renamed:cq_model
=>cqModel
cq_model_page_path
=>cqModelPagePath
cq_model_data_path
=>cqModelDataPath
Responsive grid placeholder not displayed when entering the editor via the preview model
Change routing method to support History API by default (hash routing support has been removed)
BREAKING CHANGE ModelProvider
props
renamed:data_path
=>dataPath
page_path
=>pagePath
force_reload
=>forceReload
0.0.29 - 15 May 2018
Public release of cq-spa-page-model-manager
, which provides:
- Support for the latest version of the
com.adobe.cq.export.json.hierarchy
API- Support and usage of the
:path
and:children
fields to identify a page and its child pages
- Support and usage of the
0.0.28 - 20 April 2018
Initial public release of cq-react-editable-components. Including:
@adobe/cq-spa-component-mapping#0.0.15
@adobe/cq-spa-page-model-manager#0.0.22
.- Updated Base React Components with support for multiple pages:
Container
supports page and items inclusionModelProvider
generatesdata-cq-page-path
anddata-cq-data-path
attributes (previously:data-cq-content-path
) respectively from thecq_model_data_path
andcq_model_page_path
properties (previously:cq_model_path
)
Contributing
Contributions are welcomed! Read the Contributing Guide for more information.
Licensing
This project is licensed under the Apache V2 License. See LICENSE for more information.