# @adobe/cq-react-editable-components 中文文档

规范地址：https://npmcn.com/package/%40adobe/cq-react-editable-components/

版本：1\.3\.3
npm 元数据更新时间：2026-10-01T01:32:52.924Z
中文译文更新时间：2026-11-06T05:38:03.170Z
软件包许可：Apache-2\.0

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40adobe/cq-react-editable-components
原文对照：https://npmcn.com/package/%40adobe/cq-react-editable-components/?lang=original
项目主页：https://www.adobe.com/go/aem6_4_docs_spa_en
源码仓库：https://git.corp.adobe.com/CQ/spa-react-editable-components

弃用说明：Package has been renamed\. Please use @adobe/aem-react-editable-components

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：149 kB，32 个文件
- 模块格式：CommonJS
- TypeScript 类型：包内自带
- 运行依赖：2 个
- peer 依赖：react ^16\.13\.1，react-dom ^16\.13\.1，@adobe/cq-spa-component-mapping ~1\.1\.0，@adobe/cq-spa-page-model-manager ~1\.2\.0
- 首次发布：2018-04-17T13:55:45.898Z
- 最新版本发布：2020-08-25T07:23:20.861Z
- 近 30 天下载量：4737（2026-10-05 至 2026-11-03，npm 官方下载统计）
- 已发布版本数：22（近 12 个月 0 个）

## 中文简介

-   [安装](https://npmcn.com/package/%40adobe/cq-react-editable-components/#description-installation) \* 联合国 [使用量](https://npmcn.com/package/%40adobe/cq-react-editable-components/#description-usage) \* 联合国 [API 密码](https://npmcn.com/package/%40adobe/cq-react-editable-components/#description-api) \* 联合国 [文档](https://npmcn.com/package/%40adobe/cq-react-editable-components/#description-documentation) \* 联合国 [更改日志](https://npmcn.com/package/%40adobe/cq-react-editable-components/#description-changelog) \* 联合国 [捐款](https://npmcn.com/package/%40adobe/cq-react-editable-components/#description-contributing) \* 联合国 [许可证发放](https://npmcn.com/package/%40adobe/cq-react-editable-components/#description-licensing)

## 安装

```sh
npm install @adobe/cq-react-editable-components
```

也可以使用：`pnpm add @adobe/cq-react-editable-components`、`yarn add @adobe/cq-react-editable-components`、`bun add @adobe/cq-react-editable-components`

## README

# 目录

-   [安装](https://npmcn.com/package/%40adobe/cq-react-editable-components/#readme-installation)
-   [使用量](https://npmcn.com/package/%40adobe/cq-react-editable-components/#readme-usage)
-   [API 密码](https://npmcn.com/package/%40adobe/cq-react-editable-components/#readme-api)
-   [文档](https://npmcn.com/package/%40adobe/cq-react-editable-components/#readme-documentation)
-   [更改日志](https://npmcn.com/package/%40adobe/cq-react-editable-components/#readme-changelog)
    -   [捐款](https://npmcn.com/package/%40adobe/cq-react-editable-components/#readme-contributing)
    -   [许可证发放](https://npmcn.com/package/%40adobe/cq-react-editable-components/#readme-licensing)

# 套件已经贬值

包裹已经搬走了。 请使用 [@ adobe/ aem- react-editable- 组件](https://www.npmjs.com/package/@adobe/aem-react-editable-components)

## 安装

```
npm install @adobe/cq-react-editable-components
```

## 使用量

本模块提供通用的React帮助和组件,支持AEM编写.

它还会包接和下列模块(反应不可知论):

-   `@adobe/cq-spa-component-mapping`
-   `@adobe/cq-spa-page-model-manager`

### 反应组件

以下组件可用于构建 React SPA ,旨在被写入 AEM 中:

-   `ModelProvider`,将部分页面模型包成组件
-   `Container`儿童部分
-   `ResponsiveGrid`,默认的容器网格组件(已映射到 `wcm/foundation/components/responsivegrid`(中文(简体) )

### 地图到

这个 `MapTo` 帮助可以用于直接将资源类型与特定的SPA组件关联.

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

class MyComponent {
    ...
}

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

```

### 页面模型管理器

这个 `PageModelManager` API允许管理组成SPA的AEM页面的模型代表.

这个 `ModelProvider` 内部使用它从 AEM 获取内容并注入给定的 React 组件. 它还在AEM中的内容改变时保持了React组件同步.

## API 密码

### [@ adobe/cq- react-editable-组件](https://www.adobe.com/go/aem6_4_docs_spa_en) _1.3.3 国家_

### 锡克/锡克

#### 新常数( )

用于与 CQ/AEM 组件交互的有用变量.

##### 回返

-   `Void`

### 斜弧/斜角

#### 是浏览器 ()

如果我们处于浏览器上下文中, 则返回 窗口对象的存在.

##### 回返

-   `Boolean` 窗口对象是否存在的检查结果

#### Utils () (英语)

与 AEM 环境互动的辅助功能.

##### 回返

-   `Void`

#### 正在编辑器 ()

是AEM Page 编辑器上下文中使用的应用程序 .

##### 回返

-   `boolean`

### src/等级

#### 新等级Type ()

等级类型

##### 回返

-   `Void`

## 文档

这个 [技术文件](https://www.adobe.com/go/aem6_4_docs_spa_en) 已经可用,但如果您无法解决您的问题或找到一个错误,您总是可以 [联系我们](https://www.adobe.com/go/aem6_4_support_en) 并请求帮助!

## 更改日志

### 1.3.2 - 2020年8月24日 (中文(简体) )

-   贬取出库. 重命名为 `aem-react-editable-components`。 。 。 .

### 1.3.1 - 2020年8月20日 (中文(简体) )

-   类型

### 1.3.0 - 2020年8月20日 (中文(简体) )

-   更新代码库到类型脚本

### 1.2.1 - 2020年6月5日 (中文(简体) )

-   更新到最近 `cq-spa-page-model-manager`

### 1.2.0 - 2019年12月19日 (中文(简体) )

-   制作 `react-fast-compare` 依赖性而不是同伴依赖性
-   删除可选的依赖性

### 1.1.0 - 2019年4月5日 (中文(简体) )

-   **新场景** 模板编辑器
    -   提供响应Grid组件允许组件列表的访问权限

### 1.0.4 - 2018年12月13日 (中文(简体) )

-   支持最新数据 `cq-spa-page-model-manager` 财务报告和审定财务报表 `cq-spa-component-mapping` API 密码

### 1.0.3 - 2018年9月28日 (中文(简体) )

-   **破坏变化** 重新设计集装箱、应变车道和地点持有人,以提高扩展性
-   **破坏变化** 将专栏ClassNames字段从应答Column迁移到应答Grid,以尊重最新的模型表示,字段类型已更改
-   支持最新数据 `cq-spa-page-model-manager` API 密码
-   **破坏变化** 组件映射中的“ dragDropName” 支持已删除

### 0.030 - 2018年6月20日 (中文(简体) )

-   **破坏变化** `props` 转至重命名的组件:
    
    -   `cq_model` => `cqModel`
    -   `cq_model_page_path` => `cqModelPagePath`
    -   `cq_model_data_path` => `cqModelDataPath`
-   通过预览模式进入编辑器时未显示响应网格占位符
    
-   更改路由方法以默认支持历史 API( hash 路由支持已被删除)
    
-   **破坏变化** 模型提供 `props` 已更名 :
    
    -   `data_path` => `dataPath`
    -   `page_path` => `pagePath`
    -   `force_reload` => `forceReload`

### 0.029 - 2018年5月15日 (中文(简体) )

公开发布 `cq-spa-page-model-manager`,其中规定:

-   对最新版本的支持 `com.adobe.cq.export.json.hierarchy` API 密码
    -   支助和使用 `:path` 财务报告和审定财务报表 `:children` 字段以识别页面及其子页

### 0.028 - 2018年4月20日 (中文(简体) )

初步公开发布cq-react-editable组件. 包括:

-   `@adobe/cq-spa-component-mapping#0.0.15`
-   `@adobe/cq-spa-page-model-manager#0.0.22`。 。 。 .
-   支持多个页面的更新 Base React 组件 :
    -   `Container` 支持页面和项目包含
    -   `ModelProvider` 生成 `data-cq-page-path` 财务报告和审定财务报表 `data-cq-data-path` 属性(以前为: `data-cq-content-path`分别来自 `cq_model_data_path` 财务报告和审定财务报表 `cq_model_page_path` 属性( 以前: `cq_model_path`(中文(简体) )

### 捐款

欢迎捐款! 读取 [贡献指南](https://npmcn.com/package/%40adobe/cq-react-editable-components/CONTRIBUTING.md) 更多信息.

### 许可证发放

这个项目根据Apache V2许可证获得许可. 见 [自由主义](https://npmcn.com/package/%40adobe/cq-react-editable-components/LICENSE) 更多信息.

## 常见问题

### @adobe/cq-react-editable-components 是什么？

安装 \* 联合国 使用量 \* 联合国 API 密码 \* 联合国 文档 \* 联合国 更改日志 \* 联合国 捐款 \* 联合国 许可证发放注意：该包已被作者标记为弃用——Package has been renamed\. Please use @adobe/aem-react-editable-components

### 如何安装 @adobe/cq-react-editable-components？

在项目目录运行 npm install @adobe/cq-react-editable-components，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：react（^16\.13\.1）、react-dom（^16\.13\.1）、@adobe/cq-spa-component-mapping（~1\.1\.0）、@adobe/cq-spa-page-model-manager（~1\.2\.0）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。

### @adobe/cq-react-editable-components 支持 TypeScript 吗？

支持。包内自带 TypeScript 类型声明（package\.json 声明了 types 入口），安装后即可获得类型提示，无需再安装 @types 包。

### @adobe/cq-react-editable-components 支持 ESM 还是 CommonJS？

以 CommonJS 形式发布，可以直接 require\(\)；在 ES Module 项目中也可以用 import 引入（Node\.js 会把 module\.exports 作为默认导出）。

### @adobe/cq-react-editable-components 可以商用吗？

@adobe/cq-react-editable-components 使用 Apache-2\.0 许可。宽松许可：允许商业使用、修改和再分发，并附带明确的专利授权；分发时需保留许可与 NOTICE 文件，修改过的文件要注明改动。以上为概括，不构成法律意见，请以许可原文为准。

### @adobe/cq-react-editable-components 的下载量有多少？

根据 npm 官方下载统计，@adobe/cq-react-editable-components 在 2026/10/05 – 2026/11/03 这 30 天内被下载 4,737 次，日均约 158 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @adobe/cq-react-editable-components 还在维护吗？

最新版本 1\.3\.3 发布于 2020/08/25（6 年前）；至今共发布 22 个版本，其中过去 12 个月发布了 0 个；首次发布于 2018/04/17。作者已将其标记为弃用，新项目建议寻找替代方案。

