{"_id":"@ctgh/a2ui-vue-editor","_rev":"8-5254c4f377e025de0b6327f4d4413ad2","name":"@ctgh/a2ui-vue-editor","dist-tags":{"latest":"0.3.1"},"versions":{"0.2.0":{"name":"@ctgh/a2ui-vue-editor","version":"0.2.0","license":"MIT","_id":"@ctgh/a2ui-vue-editor@0.2.0","maintainers":[{"name":"shuoka","email":"15811519008@163.com"}],"dist":{"shasum":"dd9e2e769908932c769f3de29b90ad0af7b3cc0a","tarball":"https://registry.npmjs.org/@ctgh/a2ui-vue-editor/-/a2ui-vue-editor-0.2.0.tgz","fileCount":12,"integrity":"sha512-+UkOirAiRDfxrBZZe+Yw/xEDumbbz8clPB9cqW0piJq3Vq1+BT2S5SM6onR5Ehas70r1Ert6gSEKKRpOKTh30w==","signatures":[{"sig":"MEUCIENQh3tYYBzrUa2jlSx5Kx3+N3f/xkIdBgbRWK9ozWH2AiEAu/+pYGOGt9YNelJDuWxDrgSHZMLMkYQt4crCl1lMnNU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":367166},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./style.css":"./dist/index.css"},"gitHead":"b059e1c283ad362f92cb0d11f97d4716c1f768c3","scripts":{"lint":"eslint src","test":"vitest run --config vitest.config.ts","build":"vite build","prepack":"npm run build","typecheck":"vue-tsc --noEmit -p tsconfig.json"},"_npmUser":{"name":"shuoka","email":"15811519008@163.com"},"repository":{"url":"https://git.ctgh.com/git/shuo.yang5/npm-star.git","type":"git","directory":"packages/a2ui-vue-editor"},"_npmVersion":"11.16.0","description":"Protocol-aware visual editor for A2UI v0.9 Vue surfaces.","directories":{},"sideEffects":["./dist/index.js","./dist/index.css"],"_nodeVersion":"24.18.0","dependencies":{"@ctgh/a2ui-vue":"0.2.0","zod-to-json-schema":"^3.25.2","@ctgh/a2ui-web-core":"0.2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"vue":"^3.5.39"},"_npmOperationalInternal":{"tmp":"tmp/a2ui-vue-editor_0.2.0_1785288969351_0.3111808141856023","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@ctgh/a2ui-vue-editor","version":"0.2.1","license":"MIT","_id":"@ctgh/a2ui-vue-editor@0.2.1","maintainers":[{"name":"shuoka","email":"15811519008@163.com"}],"dist":{"shasum":"999e794d816b29e88b82e9772c5974b64fd74c10","tarball":"https://registry.npmjs.org/@ctgh/a2ui-vue-editor/-/a2ui-vue-editor-0.2.1.tgz","fileCount":12,"integrity":"sha512-Zq5+iLJSDolQ+A6G6gZjVEbh1HMLRREgtMvaFwUqlXNTTzgjJ5lhWzm5WLCeWkgSUtGW04KWDsfRWLa8w1bvFQ==","signatures":[{"sig":"MEQCICP++bCE0Pp2TrYAMURFiMi5bdvhxDt6fIq0bSM84GjzAiB2PpSCsv9kieoie1hl2A78tgsEIvnC5EDmPkHKztjDJg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":367166},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./style.css":"./dist/index.css"},"gitHead":"b059e1c283ad362f92cb0d11f97d4716c1f768c3","scripts":{"lint":"eslint src","test":"vitest run --config vitest.config.ts","build":"vite build","prepack":"npm run build","typecheck":"vue-tsc --noEmit -p tsconfig.json"},"_npmUser":{"name":"shuoka","email":"15811519008@163.com"},"repository":{"url":"https://git.ctgh.com/git/shuo.yang5/npm-star.git","type":"git","directory":"packages/a2ui-vue-editor"},"_npmVersion":"11.16.0","description":"Protocol-aware visual editor for A2UI v0.9 Vue surfaces.","directories":{},"sideEffects":["./dist/index.js","./dist/index.css"],"_nodeVersion":"24.18.0","dependencies":{"@ctgh/a2ui-vue":"0.2.1","zod-to-json-schema":"^3.25.2","@ctgh/a2ui-web-core":"0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"vue":"^3.5.39"},"_npmOperationalInternal":{"tmp":"tmp/a2ui-vue-editor_0.2.1_1785291559203_0.5866472784417918","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@ctgh/a2ui-vue-editor","version":"0.2.2","license":"MIT","_id":"@ctgh/a2ui-vue-editor@0.2.2","maintainers":[{"name":"shuoka","email":"15811519008@163.com"}],"dist":{"shasum":"b87541e16fc57ed72d2cd0b3d5394d25a4d7f7a2","tarball":"https://registry.npmjs.org/@ctgh/a2ui-vue-editor/-/a2ui-vue-editor-0.2.2.tgz","fileCount":12,"integrity":"sha512-awfB2/fxKxWsAqlInnmBnmr7kkm6pTQ6axCkPO2imJ7hzQEBuUTKSuozUs4zQV0g+gVMpXQ0v68dbJ3U7PpDsA==","signatures":[{"sig":"MEUCIEv5XF/s69Ud2e8azzuulKYI1z1DbcUQyZY7qZSuO1TMAiEA9jf5PWNQM25ETr1XXLn6KuDnNvvMOt19pkN73C1gYMw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":369466},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./style.css":"./dist/index.css"},"gitHead":"073133de17472c2d725b54934b06bfd07e721df0","scripts":{"lint":"eslint src","test":"vitest run --config vitest.config.ts","build":"vite build","prepack":"npm run build","typecheck":"vue-tsc --noEmit -p tsconfig.json"},"_npmUser":{"name":"shuoka","email":"15811519008@163.com"},"repository":{"url":"https://git.ctgh.com/git/shuo.yang5/npm-star.git","type":"git","directory":"packages/a2ui-vue-editor"},"_npmVersion":"11.16.0","description":"Protocol-aware visual editor for A2UI v0.9 Vue surfaces.","directories":{},"sideEffects":["./dist/index.js","./dist/index.css"],"_nodeVersion":"24.18.0","dependencies":{"@ctgh/a2ui-vue":"0.2.2","zod-to-json-schema":"^3.25.2","@ctgh/a2ui-web-core":"0.2.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"vue":"^3.5.39"},"_npmOperationalInternal":{"tmp":"tmp/a2ui-vue-editor_0.2.2_1785304362821_0.8124254941939051","host":"s3://npm-registry-packages-npm-production"}},"0.2.3":{"name":"@ctgh/a2ui-vue-editor","version":"0.2.3","license":"MIT","_id":"@ctgh/a2ui-vue-editor@0.2.3","maintainers":[{"name":"shuoka","email":"15811519008@163.com"}],"dist":{"shasum":"e806f55c9d218f1b7b7256128c4ef49d2d33b310","tarball":"https://registry.npmjs.org/@ctgh/a2ui-vue-editor/-/a2ui-vue-editor-0.2.3.tgz","fileCount":13,"integrity":"sha512-JQUD/02x6lYVt5NmLCISpBYsbb2se1rVIVwswZvZnLI7swTXZ3G5ZGZUuH5hLiMOuLRaFluYWtPh3FAJRBCA8w==","signatures":[{"sig":"MEUCID8tio/NdR9hx8IdWNSsziycCZaVSo3moKbbTBKR4iR4AiEA6p/BTWJ+gzGBbJfVUktWeyKaAkJpUfovoRU/4phUd4o=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":413815},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./style.css":"./dist/index.css"},"gitHead":"807635e43b24eb34addadc184582a4981bf3dd27","scripts":{"lint":"eslint src","test":"vitest run --config vitest.config.ts","build":"vite build","prepack":"npm run build","typecheck":"vue-tsc --noEmit -p tsconfig.json"},"_npmUser":{"name":"shuoka","email":"15811519008@163.com"},"repository":{"url":"https://git.ctgh.com/git/shuo.yang5/npm-star.git","type":"git","directory":"packages/a2ui-vue-editor"},"_npmVersion":"11.16.0","description":"Protocol-aware visual editor for A2UI v0.9 Vue surfaces.","directories":{},"sideEffects":["./dist/index.js","./dist/index.css"],"_nodeVersion":"24.18.0","dependencies":{"@ctgh/a2ui-vue":"0.2.3","zod-to-json-schema":"^3.25.2","@ctgh/a2ui-web-core":"0.2.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"vue":"^3.5.39"},"_npmOperationalInternal":{"tmp":"tmp/a2ui-vue-editor_0.2.3_1785395156994_0.028319026262930036","host":"s3://npm-registry-packages-npm-production"}},"0.2.4":{"name":"@ctgh/a2ui-vue-editor","version":"0.2.4","license":"MIT","_id":"@ctgh/a2ui-vue-editor@0.2.4","maintainers":[{"name":"shuoka","email":"15811519008@163.com"}],"dist":{"shasum":"25c076f78d7d2ccbbd67d23f80e4dee2c15e17a7","tarball":"https://registry.npmjs.org/@ctgh/a2ui-vue-editor/-/a2ui-vue-editor-0.2.4.tgz","fileCount":13,"integrity":"sha512-aB+Fp1wrovryTeIRmB+Dva/ZB8vMb+4e4hNE05IVXcE5z+5BmCQ9ERnqIbUv534S665gn4Ihug80HHTRYV7aRw==","signatures":[{"sig":"MEYCIQCPb+F2Wco63kI0eMlyrOkxaUrSO/ry5bjOqw7//x7UPwIhAIXoeWGrhVHNSk3Nc4gi1sDM3IkH9vZqFzjd3H9tmiXv","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":413815},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./style.css":"./dist/index.css"},"gitHead":"9e12e041907f0edd472607916d4cdb259e8a910b","scripts":{"lint":"eslint src","test":"vitest run --config vitest.config.ts","build":"vite build","prepack":"npm run build","typecheck":"vue-tsc --noEmit -p tsconfig.json"},"_npmUser":{"name":"shuoka","email":"15811519008@163.com"},"repository":{"url":"https://git.ctgh.com/git/shuo.yang5/npm-star.git","type":"git","directory":"packages/a2ui-vue-editor"},"_npmVersion":"11.16.0","description":"Protocol-aware visual editor for A2UI v0.9 Vue surfaces.","directories":{},"sideEffects":["./dist/index.js","./dist/index.css"],"_nodeVersion":"24.18.0","dependencies":{"@ctgh/a2ui-vue":"0.2.4","zod-to-json-schema":"^3.25.2","@ctgh/a2ui-web-core":"0.2.4"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"vue":"^3.5.39"},"_npmOperationalInternal":{"tmp":"tmp/a2ui-vue-editor_0.2.4_1785462781316_0.35914122886010036","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@ctgh/a2ui-vue-editor","version":"0.3.0","license":"MIT","_id":"@ctgh/a2ui-vue-editor@0.3.0","maintainers":[{"name":"shuoka","email":"15811519008@163.com"}],"dist":{"shasum":"6fcd470cd58481425f3b89b2daee727bb5d0133b","tarball":"https://registry.npmjs.org/@ctgh/a2ui-vue-editor/-/a2ui-vue-editor-0.3.0.tgz","fileCount":13,"integrity":"sha512-LJ3p9pNtKYcD8z4w2AaC20dRowm/k0tdhbkWl1jOZ5AHZFySrzJINNG+6KXrKDzjRt+6Xqj24CPjr3nLePOnLw==","signatures":[{"sig":"MEUCIGfJ0zXR2RYjKI9zKTFH1xGS16ZxuzX45ytPTK6s2bN0AiEA4pRzysGrk/9U0b3F1/AD/wkdrtVXXCQR0i+fEvUdX3U=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":410890},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./style.css":"./dist/index.css"},"gitHead":"dc21ad193ce2ee5919ceabd509c89d7245f9bf2d","scripts":{"lint":"eslint src","test":"vitest run --config vitest.config.ts","build":"vite build","prepack":"npm run build","typecheck":"vue-tsc --noEmit -p tsconfig.json"},"_npmUser":{"name":"shuoka","email":"15811519008@163.com"},"repository":{"url":"https://git.ctgh.com/git/shuo.yang5/npm-star.git","type":"git","directory":"packages/a2ui-vue-editor"},"_npmVersion":"11.16.0","description":"Protocol-aware visual editor for A2UI v0.9 Vue surfaces.","directories":{},"sideEffects":["./dist/index.js","./dist/index.css"],"_nodeVersion":"24.18.0","dependencies":{"@ctgh/a2ui-vue":"0.3.0","zod-to-json-schema":"^3.25.2","@ctgh/a2ui-web-core":"0.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"vue":"^3.5.39"},"_npmOperationalInternal":{"tmp":"tmp/a2ui-vue-editor_0.3.0_1785917216711_0.7925284771431196","host":"s3://npm-registry-packages-npm-production"}},"0.3.1":{"_id":"@ctgh/a2ui-vue-editor@0.3.1","dist":{"shasum":"95f6f260417403ceae5903e7cb0d81938b7ac1dd","tarball":"https://registry.npmjs.org/@ctgh/a2ui-vue-editor/-/a2ui-vue-editor-0.3.1.tgz","fileCount":63,"integrity":"sha512-UyqFiG82D8JS3q04twqN/8XOXKjxe36PBd6Dxd+w1zyoiqZ0qX4bNM3HSFjhs3AAQH/G65moTR1+08QXxNyOmA==","signatures":[{"sig":"MEQCIDueRggCcNAvgnpTUdNgWOYcQk8aDvHmtvlJsvjs3qPsAiAal6fV0EsODi0Xw5jBIn7GC5rm3AxsFwQkolF1xnkcnw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDzpO6+LHs05po9XNDJUne/+zr0UXmwgvzWE3gajy1onAIhAOxDDITFJuBYmU4zglTAUg6zPQfrGmMu4UeopilG5k5N"}],"unpackedSize":1851730},"main":"./dist/index.cjs","name":"@ctgh/a2ui-vue-editor","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./style.css":"./dist/index.css"},"gitHead":"75b9f8f769c5a7ef3e03cc0f900347d427dc9c55","license":"MIT","scripts":{"lint":"eslint src","test":"vitest run --config vitest.config.ts","build":"vite build","prepack":"npm run build","typecheck":"vue-tsc --noEmit -p tsconfig.json"},"version":"0.3.1","_npmUser":{"name":"lindaxujin","email":"jinlei.xu1@ctg.cn"},"repository":{"url":"https://git.ctgh.com/git/shuo.yang5/npm-star.git","type":"git","directory":"packages/a2ui-vue-editor"},"_npmVersion":"11.6.2","description":"Protocol-aware visual editor for A2UI v0.9 Vue surfaces.","directories":{},"maintainers":[{"name":"shuoka","email":"15811519008@163.com"},{"name":"lindaxujin","email":"jinlei.xu1@ctg.cn"}],"sideEffects":["./dist/index.js","./dist/index.css"],"_nodeVersion":"24.11.1","dependencies":{"@ctgh/a2ui-vue":"0.3.1","zod-to-json-schema":"^3.25.2","@ctgh/a2ui-web-core":"0.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"vue":"^3.5.39"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/a2ui-vue-editor_0.3.1_1788935579929_0.8120602745203249"}}},"time":{"created":"2026-07-29T01:36:09.109Z","modified":"2026-09-09T06:33:00.194Z","0.2.0":"2026-07-29T01:36:09.504Z","0.2.1":"2026-07-29T02:19:19.423Z","0.2.2":"2026-07-29T05:52:42.972Z","0.2.3":"2026-07-30T07:05:57.140Z","0.2.4":"2026-07-31T01:53:01.472Z","0.3.0":"2026-08-05T08:06:56.843Z","0.3.1":"2026-09-09T06:33:00.014Z"},"license":"MIT","repository":{"url":"https://git.ctgh.com/git/shuo.yang5/npm-star.git","type":"git","directory":"packages/a2ui-vue-editor"},"description":"Protocol-aware visual editor for A2UI v0.9 Vue surfaces.","maintainers":[{"name":"shuoka","email":"15811519008@163.com"},{"name":"lindaxujin","email":"jinlei.xu1@ctg.cn"}],"readme":"# @ctgh/a2ui-vue-editor\n\n面向 A2UI v0.9 的 Vue 可视化编辑器与发布页运行时。编辑器产出可序列化的\n`PublishedPage` JSON，业务系统可以自行存储该 JSON，并在读取后直接回显完整页面。\n\n## 安装\n\n```bash\nnpm install @ctgh/a2ui-vue-editor @ctgh/a2ui-arco vue\n```\n\n编辑器页面只需引入编辑器样式：\n\n```ts\nimport '@ctgh/a2ui-vue-editor/style.css';\n```\n\n## 编辑页面\n\n`A2uiEditor` 接收一个已经创建的 A2UI `SurfaceModel`。使用原生 Vue 全量组件时，创建\nSurface 和编辑器必须传入同一个 `arcoCatalog`。\n\n```vue\n<script setup lang=\"ts\">\nimport { computed, onBeforeUnmount, shallowRef } from 'vue';\nimport { A2uiEditor, type EditorSnapshot } from '@ctgh/a2ui-vue-editor';\nimport { MessageProcessor } from '@ctgh/a2ui-vue';\nimport { arcoCatalog } from '@ctgh/a2ui-arco';\nimport '@ctgh/a2ui-vue-editor/style.css';\n\nconst processor = shallowRef(new MessageProcessor([arcoCatalog]));\nprocessor.value.processMessages([\n  { version: 'v0.9', createSurface: { surfaceId: 'page-editor', catalogId: arcoCatalog.id } },\n  {\n    version: 'v0.9',\n    updateComponents: {\n      surfaceId: 'page-editor',\n      components: [{ id: 'root', component: 'Column', children: [] }],\n    },\n  },\n]);\n\nconst surface = computed(() => processor.value.model.getSurface('page-editor'));\nlet latestSnapshot: EditorSnapshot | undefined;\n\nfunction handleChange(snapshot: EditorSnapshot) {\n  latestSnapshot = snapshot;\n}\n\nonBeforeUnmount(() => processor.value.model.dispose());\n</script>\n\n<template>\n  <A2uiEditor\n    v-if=\"surface\"\n    :surface=\"surface\"\n    :catalogs=\"[arcoCatalog]\"\n    root-id=\"root\"\n    @change=\"handleChange\"\n  />\n</template>\n```\n\n`@change` 返回的 `EditorSnapshot` 包含组件、数据、样式和动作配置。业务系统可以保存\n编辑快照用于继续编辑，也可以转换为发布 JSON 后保存。\n\n## 数据编辑与诊断\n\n编辑器左侧“数据”面板提供“数据路径”和“JSON”两种视图。数据路径展示当前值、类型和\n组件绑定次数，并支持修改单个路径；JSON 用于整体导入或处理复杂结构。“问题”面板会实时\n检查组件引用、数据绑定和 HTTP 动作配置。\n\n## 保存发布 JSON\n\n```ts\nimport { createPublishedPage, type EditorSnapshot } from '@ctgh/a2ui-vue-editor';\n\nasync function publish(pageId: string, snapshot: EditorSnapshot) {\n  const page = createPublishedPage(snapshot);\n  await fetch(`/api/pages/${pageId}`, {\n    method: 'PUT',\n    headers: { 'content-type': 'application/json' },\n    body: JSON.stringify(page),\n  });\n}\n```\n\n编辑器中的“发布”按钮展示的也是同一种 `PublishedPage` JSON。组件库不限定存储方式，\n可以保存到数据库、对象存储、配置中心或浏览器本地存储。\n\n## 读取并回显\n\n消费者读取保存的 JSON 后，将其直接传给 `A2uiPublishedPage`。运行时会恢复组件树、\n数据模型、样式和动作，不需要消费者手动创建 `MessageProcessor`。\n\n```vue\n<script setup lang=\"ts\">\nimport { onMounted, ref } from 'vue';\nimport {\n  A2uiPublishedPage,\n  type PublishedActionHandlers,\n  type PublishedPage,\n} from '@ctgh/a2ui-vue-editor';\nimport { arcoCatalog } from '@ctgh/a2ui-arco';\n\nconst page = ref<PublishedPage>();\n\nconst actionHandlers: PublishedActionHandlers = {\n  'orders.submit': async (context) => {\n    const response = await fetch('/api/orders', {\n      method: 'POST',\n      headers: { 'content-type': 'application/json' },\n      body: JSON.stringify(context),\n    });\n    if (!response.ok) throw new Error(`HTTP ${response.status}`);\n    return response.json();\n  },\n};\n\nonMounted(async () => {\n  const response = await fetch('/api/pages/order-page');\n  if (!response.ok) throw new Error(`HTTP ${response.status}`);\n  page.value = (await response.json()) as PublishedPage;\n});\n</script>\n\n<template>\n  <A2uiPublishedPage\n    v-if=\"page\"\n    :page=\"page\"\n    :catalogs=\"[arcoCatalog]\"\n    :action-handlers=\"actionHandlers\"\n    @action-error=\"({ error }) => console.error(error)\"\n  />\n</template>\n```\n\n如果页面只使用 A2UI Basic 组件，可以省略 `catalogs`。使用编辑器中的扩展或业务组件时，\n必须传入包含这些组件的同一个 Catalog。\n\n## 重新编辑已保存页面\n\n使用 `publishedPageToSnapshot()` 将发布 JSON 转回编辑快照，然后恢复 Surface，并把样式和\n动作元数据传回编辑器：\n\n```ts\nimport { applySnapshot, publishedPageToSnapshot, type PublishedPage } from '@ctgh/a2ui-vue-editor';\n\nconst snapshot = publishedPageToSnapshot(savedPage as PublishedPage);\napplySnapshot(surface, snapshot);\n```\n\n```vue\n<A2uiEditor\n  :surface=\"surface\"\n  :catalogs=\"[arcoCatalog]\"\n  :root-id=\"snapshot.rootId\"\n  :initial-editor-styles=\"snapshot.editorStyles\"\n  :initial-editor-actions=\"snapshot.editorActions\"\n  :initial-action-requests=\"snapshot.actionRequests\"\n/>\n```\n\n## 动作\n\n- **业务事件**：通过 `actionHandlers[action.name]` 处理。\n- **HTTP 接口**：无需注册 handler；GET 参数写入查询字符串，其他方法发送 JSON body。\n- **打开抽屉**：Button 可以直接选择目标 DrawerPanel，由运行时维护抽屉开关状态。\n\nHTTP 动作可以配置成功和失败写入路径，结果会写回 A2UI 数据模型并触发绑定组件更新。\n如果需要统一注入 Token、租户或请求拦截逻辑，可通过 `fetcher` 属性传入业务封装的 fetch。\n消费者 handler 与编辑器 HTTP 配置同时存在时，优先执行消费者 handler。\n\n运行时会发出以下事件：\n\n- `action` / `action-start`\n- `action-success`\n- `action-error`\n- `unhandled-action`\n- `data-change`\n\n## 协议说明\n\n`updateComponents` 是增量创建或更新消息，不会删除消息中缺失的组件。需要完整恢复页面时，\n应使用 `applySnapshot()`；只有向服务端发送增量更新时才使用 `buildUpdateMessage()`。\n","readmeFilename":"README.md"}