[{"data":1,"prerenderedAt":1890},["ShallowReactive",2],{"quirekit-doc:\u002Fclassic\u002Ffiles":3,"quirekit-source:classic\u002Fpersistence\u002Fobserver.ts":638,"quirekit-source:classic\u002Fpersistence\u002Fsave.ts":639,"mdc--z4krew-key":640,"mdc-98idjt-key":1361},{"id":4,"title":5,"body":6,"description":626,"extension":627,"keywords":628,"locale":629,"meta":630,"navigation":631,"order":632,"path":633,"section":634,"seo":635,"stem":636,"__hash__":637},"docs\u002Fclassic\u002Ffiles.zh-CN.md","保存、打开与文件转换",{"type":7,"value":8,"toc":617},"minimark",[9,24,29,48,52,70,74,88,99,102,112,116,129,140,143,186,192,199,203,220,274,288,292,384,407,411,421,570,577,580,584,595,606,613],[10,11,12,13,17,18,23],"p",{},"Classic 不会自动把正文写进你的数据库。应用负责保存位置、文档身份和未保存提示；产品提供当前内容及已安装的格式服务。本页从已挂载的 ",[14,15,16],"code",{},"instance"," 开始，创建方式见",[19,20,22],"a",{"href":21},"\u002Fclassic\u002Fquick-start","快速接入","。",[25,26,28],"h2",{"id":27},"_1-记录真正的正文变化","1. 记录真正的正文变化",[10,30,31,32,35,36,39,40,43,44,47],{},"产品插件的 ",[14,33,34],{},"onUpdate"," 还会响应选区和界面刷新，不适合直接当作“正文已修改”。在插件的 ",[14,37,38],{},"onMount"," 订阅当前 Core 的 ",[14,41,42],{},"update","，比较前后文档身份，在 ",[14,45,46],{},"onUnmount"," 解除订阅。结构更新重建 Core 后会重新绑定；语言、只读和内置主题更新保留原订阅。",[49,50],"docs-recipe",{"name":51},"classic\u002Fpersistence\u002Fobserver",[10,53,54,55,58,59,23,62,65,66,69],{},"创建时把 ",[14,56,57],{},"createClassicDraftObserver(() => { dirty = true })"," 加入实例的 ",[14,60,61],{},"plugins",[14,63,64],{},"dirty"," 是应用自己的状态；一个插件对象只交给一个实例。例程不在每次变化时序列化全文，切换只读也不会误报正文修改。显式使用 ",[14,67,68],{},"emitUpdate: false"," 的恢复流程应由宿主建立新的已保存基线。",[25,71,73],{"id":72},"_2-保存一个确定的版本","2. 保存一个确定的版本",[10,75,76,79,80,83,84,87],{},[14,77,78],{},"instance.getJSON()"," 读取当前规范内容。备份还应带上自己的版本、模型和文档 ID；文档名称可通过 ",[14,81,82],{},"instance.setDocumentName(name)"," 更新，名称由应用另行持久化，不包含在 ",[14,85,86],{},"getJSON()"," 中。",[10,89,90,91,94,95,98],{},"下面的 Word 草稿例程先捕获内容，再等待存储确认。返回 ",[14,92,93],{},"true"," 才表示当前页面仍停留在刚保存的版本；返回 ",[14,96,97],{},"false"," 表示这次写入完成了，但期间发生了编辑、重挂载或退出，不应清除未保存提示。",[49,100],{"name":101},"classic\u002Fpersistence\u002Fsave",[10,103,104,107,108,23],{},[14,105,106],{},"repository.write(source)"," 由你连接接口或本地存储，失败应拒绝 Promise。保存按钮在请求期间禁用，或由 repository 串行写同一文档；返回值只保护界面的保存状态，不能阻止服务端并发请求倒序覆盖。多用户编辑还需要版本冲突协议。这个例程只保存 JSON，图片字节仍需",[19,109,111],{"href":110},"\u002Fbuild\u002Fresources","持久媒体服务",[25,113,115],{"id":114},"_3-打开-json-备份","3. 打开 JSON 备份",[10,117,118,119,123,124,128],{},"先读取原文件，检查模型、版本、节点、标记、属性和 Schema，再提交。完整校验顺序见",[19,120,122],{"href":121},"\u002Fguide\u002Fcontent","内容校验","与",[19,125,127],{"href":126},"\u002Fbuild\u002Ffiles","文件操作","。损坏文件不能替换当前草稿。",[10,130,131,132,135,136,139],{},"内置 ",[14,133,134],{},"json"," 服务读取原生规范文档 JSON，并通过相同的提交边界严格替换；它不识别本页例程带有版本、模型和 ",[14,137,138],{},"content"," 包装的业务备份。业务备份先由应用解包校验，再按下面的流程打开。",[10,141,142],{},"打开另一份业务文档时，先处理当前未保存修改，再建立新会话边界：",[144,145,151],"pre",{"className":146,"code":147,"filename":148,"language":149,"meta":150,"style":150},"language-ts shiki shiki-themes github-light github-light github-dark","instance.update({ document: validatedContent })\ninstance.setDocumentName('项目说明')\n","提交已经校验的备份","ts","",[14,152,153,168],{"__ignoreMap":150},[154,155,158,162,165],"span",{"class":156,"line":157},"line",1,[154,159,161],{"class":160},"sVPnS","instance.",[154,163,42],{"class":164},"sgQzM",[154,166,167],{"class":160},"({ document: validatedContent })\n",[154,169,171,173,176,179,183],{"class":156,"line":170},2,[154,172,161],{"class":160},[154,174,175],{"class":164},"setDocumentName",[154,177,178],{"class":160},"(",[154,180,182],{"class":181},"s-HEn","'项目说明'",[154,184,185],{"class":160},")\n",[10,187,188,189,23],{},"这会销毁旧 Core 并用新正文挂载；原撤销历史不会保留。插件通过挂载钩子重新订阅。应用同步切换文档 ID、存储键和已保存基线，并取消旧文档的保存任务。不要在输入事件中反复传入 ",[14,190,191],{},"document",[10,193,194,195,198],{},"只恢复当前会话正文时，可以使用 Core 的 ",[14,196,197],{},"replaceDocument()","，它连同顶层属性替换且本次不计入历史；这与创建新会话的生命周期不同。",[25,200,202],{"id":201},"_4-装配-docx-dotx-服务","4. 装配 DOCX \u002F DOTX 服务",[10,204,205,208,209,212,213,216,217,219],{},[14,206,207],{},"createClassicWordDocxPlugin()"," 默认注册 ",[14,210,211],{},"docx","、",[14,214,215],{},"dotx"," 两个服务。它们与 Word preset 配合，通过 ",[14,218,61],{}," 安装一次。预设本身不代表这些服务已经注册。",[144,221,224],{"className":146,"code":222,"filename":223,"language":149,"meta":150,"style":150},"plugins: [createClassicWordDocxPlugin({\n  onReport(report) {\n    showConversionReport(report.warnings, report.diagnostics)\n  },\n})]\n","在快速接入的 plugins 中安装",[14,225,226,239,253,262,268],{"__ignoreMap":150},[154,227,228,230,233,236],{"class":156,"line":157},[154,229,61],{"class":164},[154,231,232],{"class":160},": [",[154,234,235],{"class":164},"createClassicWordDocxPlugin",[154,237,238],{"class":160},"({\n",[154,240,241,244,246,250],{"class":156,"line":170},[154,242,243],{"class":164},"  onReport",[154,245,178],{"class":160},[154,247,249],{"class":248},"sde8i","report",[154,251,252],{"class":160},") {\n",[154,254,256,259],{"class":156,"line":255},3,[154,257,258],{"class":164},"    showConversionReport",[154,260,261],{"class":160},"(report.warnings, report.diagnostics)\n",[154,263,265],{"class":156,"line":264},4,[154,266,267],{"class":160},"  },\n",[154,269,271],{"class":156,"line":270},5,[154,272,273],{"class":160},"})]\n",[10,275,276,279,280,283,284,23],{},[14,277,278],{},"showConversionReport"," 是你的界面函数：区分解析警告与内容近似、保留或丢失的诊断。导入成功不代表完全无损；不符合 Schema 的块可能被降级为纯文本并报告 ",[14,281,282],{},"schema-invalid-block","。不要把一次成功返回显示成“格式完全保留”。配置见 ",[19,285,287],{"href":286},"\u002Fplugins\u002Freference\u002Fcreate-classic-word-docx-plugin","DOCX 插件参考",[25,289,291],{"id":290},"_5-调用文件服务","5. 调用文件服务",[144,293,296],{"className":146,"code":294,"filename":295,"language":149,"meta":150,"style":150},"await instance.importDocument('docx', {\n  data: new Uint8Array(await file.arrayBuffer()),\n  fileName: file.name,\n  mimeType: file.type,\n})\nconst artifact = await instance.exportDocument('docx')\n","传入文件字节并取得导出产物",[14,297,298,318,342,347,352,357],{"__ignoreMap":150},[154,299,300,304,307,310,312,315],{"class":156,"line":157},[154,301,303],{"class":302},"sDD9d","await",[154,305,306],{"class":160}," instance.",[154,308,309],{"class":164},"importDocument",[154,311,178],{"class":160},[154,313,314],{"class":181},"'docx'",[154,316,317],{"class":160},", {\n",[154,319,320,323,326,329,331,333,336,339],{"class":156,"line":170},[154,321,322],{"class":160},"  data: ",[154,324,325],{"class":302},"new",[154,327,328],{"class":164}," Uint8Array",[154,330,178],{"class":160},[154,332,303],{"class":302},[154,334,335],{"class":160}," file.",[154,337,338],{"class":164},"arrayBuffer",[154,340,341],{"class":160},"()),\n",[154,343,344],{"class":156,"line":255},[154,345,346],{"class":160},"  fileName: file.name,\n",[154,348,349],{"class":156,"line":264},[154,350,351],{"class":160},"  mimeType: file.type,\n",[154,353,354],{"class":156,"line":270},[154,355,356],{"class":160},"})\n",[154,358,360,363,367,370,373,375,378,380,382],{"class":156,"line":359},6,[154,361,362],{"class":302},"const",[154,364,366],{"class":365},"sUNQB"," artifact",[154,368,369],{"class":302}," =",[154,371,372],{"class":302}," await",[154,374,306],{"class":160},[154,376,377],{"class":164},"exportDocument",[154,379,178],{"class":160},[154,381,314],{"class":181},[154,383,185],{"class":160},[10,385,386,389,390,393,394,396,397,212,400,212,403,406],{},[14,387,388],{},"file"," 是宿主选择的 ",[14,391,392],{},"File","。DOCX 需要字节，不能传文本；DOTX 使用 ",[14,395,215],{}," 服务 ID。导出返回 ",[14,398,399],{},"data",[14,401,402],{},"fileName",[14,404,405],{},"mimeType","，宿主负责下载或上传，成功生成文件不等于数据库已保存。服务不存在、没有对应操作或产品未挂载时，调用会拒绝 Promise；转换失败也需要捕获并展示。",[25,408,410],{"id":409},"_6-取消与防止迟到覆盖","6. 取消与防止迟到覆盖",[10,412,413,416,417,420],{},[14,414,415],{},"importDocument()"," 为每次调用捕获当前 Core 与正文版本。新的导入、正文修改（包括修改后撤销）、只读配置更新、卸载或销毁，会让尚未提交的旧导入失效。移动光标不使正文版本过期。官方 DOCX 服务在最后的同步提交边界复核这些条件，过期时拒绝为 ",[14,418,419],{},"AbortError","，保留当前正文与名称，也不发成功转换报告。",[144,422,425],{"className":146,"code":423,"filename":424,"language":149,"meta":150,"style":150},"const opening = new AbortController()\ntry {\n  const data = new Uint8Array(await file.arrayBuffer())\n  await instance.importDocument('docx', {\n    data, fileName: file.name, mimeType: file.type,\n  }, { signal: opening.signal })\n} catch (error) {\n  if (!(error instanceof DOMException && error.name === 'AbortError')) throw error\n}\n\u002F\u002F 用户取消、选择另一文件或退出时，由宿主调用 opening.abort()\n","宿主取消一次打开操作",[14,426,427,445,453,478,493,498,503,515,557,563],{"__ignoreMap":150},[154,428,429,431,434,436,439,442],{"class":156,"line":157},[154,430,362],{"class":302},[154,432,433],{"class":365}," opening",[154,435,369],{"class":302},[154,437,438],{"class":302}," new",[154,440,441],{"class":164}," AbortController",[154,443,444],{"class":160},"()\n",[154,446,447,450],{"class":156,"line":170},[154,448,449],{"class":302},"try",[154,451,452],{"class":160}," {\n",[154,454,455,458,461,463,465,467,469,471,473,475],{"class":156,"line":255},[154,456,457],{"class":302},"  const",[154,459,460],{"class":365}," data",[154,462,369],{"class":302},[154,464,438],{"class":302},[154,466,328],{"class":164},[154,468,178],{"class":160},[154,470,303],{"class":302},[154,472,335],{"class":160},[154,474,338],{"class":164},[154,476,477],{"class":160},"())\n",[154,479,480,483,485,487,489,491],{"class":156,"line":264},[154,481,482],{"class":302},"  await",[154,484,306],{"class":160},[154,486,309],{"class":164},[154,488,178],{"class":160},[154,490,314],{"class":181},[154,492,317],{"class":160},[154,494,495],{"class":156,"line":270},[154,496,497],{"class":160},"    data, fileName: file.name, mimeType: file.type,\n",[154,499,500],{"class":156,"line":359},[154,501,502],{"class":160},"  }, { signal: opening.signal })\n",[154,504,506,509,512],{"class":156,"line":505},7,[154,507,508],{"class":160},"} ",[154,510,511],{"class":302},"catch",[154,513,514],{"class":160}," (error) {\n",[154,516,518,521,524,527,530,533,536,539,542,545,548,551,554],{"class":156,"line":517},8,[154,519,520],{"class":302},"  if",[154,522,523],{"class":160}," (",[154,525,526],{"class":302},"!",[154,528,529],{"class":160},"(error ",[154,531,532],{"class":302},"instanceof",[154,534,535],{"class":164}," DOMException",[154,537,538],{"class":302}," &&",[154,540,541],{"class":160}," error.name ",[154,543,544],{"class":302},"===",[154,546,547],{"class":181}," 'AbortError'",[154,549,550],{"class":160},")) ",[154,552,553],{"class":302},"throw",[154,555,556],{"class":160}," error\n",[154,558,560],{"class":156,"line":559},9,[154,561,562],{"class":160},"}\n",[154,564,566],{"class":156,"line":565},10,[154,567,569],{"class":568},"sqmzS","\u002F\u002F 用户取消、选择另一文件或退出时，由宿主调用 opening.abort()\n",[10,571,572,573,576],{},"在读取文件字节前建立 controller；选择新文件时先取消上一次，防止旧文件的 ",[14,574,575],{},"arrayBuffer()"," 迟到后才启动导入。Abort 可以及时结束调用方等待，但底层不支持取消的 codec 仍可能完成内部解析；最终提交仍被拦截。已经提交的写入不能通过随后 abort 撤销。",[10,578,579],{},"只读会在导入入口与提交前各检查一次，应用还需检查业务授权。若要打开完全不同的业务文档，仍需处理未保存修改、存储键和会话边界；导入不是文档管理系统。",[25,581,583],{"id":582},"_7-自定义-import-的迁移","7. 自定义 import 的迁移",[10,585,586,587,590,591,23],{},"自定义服务先解析和校验，再在 ",[14,588,589],{},"context.commit(() => editor.commands.replaceDocument(...))"," 中执行一次同步命令，并在提交后报告成功。不要把 async 回调传给 commit，也不要在 commit 外直接写正文。旧插件若绕过这个合同直接调用命令，运行时无法回滚其任意副作用；应升级插件后再依赖过期保护。完整上下文见 ",[19,592,594],{"href":593},"\u002Fclassic\u002Fapi","Classic API",[10,596,597,598,602,603,23],{},"导出是否捕获点击时快照由服务实现决定；官方 DOCX 服务会捕获开始时的正文。导入图片的暂存与失败清理见",[19,599,601],{"href":600},"\u002Fclassic\u002Fmedia","持久媒体","。自己开发 Core 产品时，仍使用",[19,604,605],{"href":126},"解析、校验、提交的宿主流程",[10,607,608,609,23],{},"实例和配置的完整字段见",[19,610,612],{"href":611},"\u002Fclassic\u002Freference","Classic 实例与配置参考",[614,615,616],"style",{},"html pre.shiki code .sVPnS, html code.shiki .sVPnS{--shiki-default:#24292E;--shiki-light:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sgQzM, html code.shiki .sgQzM{--shiki-default:#6F42C1;--shiki-light:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .s-HEn, html code.shiki .s-HEn{--shiki-default:#032F62;--shiki-light:#032F62;--shiki-dark:#9ECBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sde8i, html code.shiki .sde8i{--shiki-default:#E36209;--shiki-light:#E36209;--shiki-dark:#FFAB70}html pre.shiki code .sDD9d, html code.shiki .sDD9d{--shiki-default:#D73A49;--shiki-light:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sUNQB, html code.shiki .sUNQB{--shiki-default:#005CC5;--shiki-light:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sqmzS, html code.shiki .sqmzS{--shiki-default:#6A737D;--shiki-light:#6A737D;--shiki-dark:#6A737D}",{"title":150,"searchDepth":170,"depth":170,"links":618},[619,620,621,622,623,624,625],{"id":27,"depth":170,"text":28},{"id":72,"depth":170,"text":73},{"id":114,"depth":170,"text":115},{"id":201,"depth":170,"text":202},{"id":290,"depth":170,"text":291},{"id":409,"depth":170,"text":410},{"id":582,"depth":170,"text":583},"为 Classic 接入未保存状态、版本化 JSON 和 DOCX 服务，并处理保存失败与格式损失。","md",null,"zh-CN",{},true,-1,"\u002Fclassic\u002Ffiles","Classic 开发",{"title":5,"description":626},"classic\u002Ffiles.zh-CN","s_jONhXW2NUk9U3u8d-Vx1-nMyrglUKlHy_XjD_eo9o","import type { QuireEditor, QuireEditorUpdateEvent } from \"@quirekit\u002Fcore\";\nimport { defineClassicEditorPlugin } from \"@quirekit\u002Fclassic-editor\";\nimport type { ClassicEditorPlugin } from \"@quirekit\u002Fclassic-editor\";\n\n\u002F**\n * Observes document changes across product remounts without treating UI updates as edits.\n * @param onChange - Host callback that marks the current document as unsaved.\n * @returns Product plugin; create a separate plugin object for each Classic instance.\n *\u002F\nexport function createClassicDraftObserver(onChange: () => void): ClassicEditorPlugin {\n  let owner: QuireEditor | undefined;\n\n  \u002F** @param event - Accepted update, which can also represent an editability change. *\u002F\n  function onUpdate(event: QuireEditorUpdateEvent): void {\n    \u002F\u002F Core already suppresses equal-content updates; an editability notification\n    \u002F\u002F retains the same immutable document. The observer needs only identity.\n    if (event.previousState.doc !== event.editor.state.doc) onChange();\n  }\n\n  \u002F** Releases the subscription belonging to the previous mounted Core. *\u002F\n  function detach(): void {\n    owner?.off(\"update\", onUpdate);\n    owner = undefined;\n  }\n\n  return defineClassicEditorPlugin({\n    id: \"app.draft-observer\",\n    \u002F** @param context - Current mount, whose Core owns this subscription. *\u002F\n    onMount(context) {\n      detach();\n      owner = context.editor;\n      owner?.on(\"update\", onUpdate);\n    },\n    onUnmount: detach,\n    onDestroy: detach,\n  });\n}\n","import type { ClassicDraftOwner, ClassicDraftRepository } from \".\u002Ftypes\";\n\n\u002F**\n * Saves one revision without clearing changes made while storage was pending.\n * @param instance - Mounted product that owns the current document.\n * @param repository - Application storage; it must serialize writes for the same document.\n * @returns Whether the acknowledged revision still belongs to the active Core and document.\n *\u002F\nexport async function saveClassicDraft(\n  instance: ClassicDraftOwner,\n  repository: ClassicDraftRepository\n): Promise\u003Cboolean> {\n  const editor = instance.editor;\n  if (instance.isDestroyed || !editor || editor.isDestroyed) {\n    throw new Error(\"Mount the document before saving\");\n  }\n\n  \u002F\u002F Capture before awaiting: a later edit or product remount owns a different revision.\n  const document = editor.state.doc;\n  const source = JSON.stringify({ version: 1, model: \"word-v1\", content: instance.getJSON() });\n  await repository.write(source);\n\n  return !instance.isDestroyed && !editor.isDestroyed\n    && instance.editor === editor && editor.state.doc === document;\n}\n",{"data":641,"body":642},{},{"type":643,"children":644},"root",[645,1356],{"type":646,"tag":144,"props":647,"children":649},"element",{"className":146,"code":648,"language":149,"meta":150,"style":150},"import type { QuireEditor, QuireEditorUpdateEvent } from \"@quirekit\u002Fcore\";\nimport { defineClassicEditorPlugin } from \"@quirekit\u002Fclassic-editor\";\nimport type { ClassicEditorPlugin } from \"@quirekit\u002Fclassic-editor\";\n\n\u002F**\n * Observes document changes across product remounts without treating UI updates as edits.\n * @param onChange - Host callback that marks the current document as unsaved.\n * @returns Product plugin; create a separate plugin object for each Classic instance.\n *\u002F\nexport function createClassicDraftObserver(onChange: () => void): ClassicEditorPlugin {\n  let owner: QuireEditor | undefined;\n\n  \u002F** @param event - Accepted update, which can also represent an editability change. *\u002F\n  function onUpdate(event: QuireEditorUpdateEvent): void {\n    \u002F\u002F Core already suppresses equal-content updates; an editability notification\n    \u002F\u002F retains the same immutable document. The observer needs only identity.\n    if (event.previousState.doc !== event.editor.state.doc) onChange();\n  }\n\n  \u002F** Releases the subscription belonging to the previous mounted Core. *\u002F\n  function detach(): void {\n    owner?.off(\"update\", onUpdate);\n    owner = undefined;\n  }\n\n  return defineClassicEditorPlugin({\n    id: \"app.draft-observer\",\n    \u002F** @param context - Current mount, whose Core owns this subscription. *\u002F\n    onMount(context) {\n      detach();\n      owner = context.editor;\n      owner?.on(\"update\", onUpdate);\n    },\n    onUnmount: detach,\n    onDestroy: detach,\n  });\n}\n\n",[650],{"type":646,"tag":14,"props":651,"children":652},{"__ignoreMap":150},[653,690,715,743,751,760,768,791,808,816,883,920,928,951,1000,1009,1018,1051,1060,1068,1077,1107,1135,1157,1165,1173,1191,1210,1233,1255,1268,1286,1312,1321,1330,1339,1348],{"type":646,"tag":154,"props":654,"children":655},{"class":156,"line":157},[656,663,668,674,679,685],{"type":646,"tag":154,"props":657,"children":659},{"style":658},"--shiki-default:#D73A49;--shiki-light:#D73A49;--shiki-dark:#F97583",[660],{"type":661,"value":662},"text","import",{"type":646,"tag":154,"props":664,"children":665},{"style":658},[666],{"type":661,"value":667}," type",{"type":646,"tag":154,"props":669,"children":671},{"style":670},"--shiki-default:#24292E;--shiki-light:#24292E;--shiki-dark:#E1E4E8",[672],{"type":661,"value":673}," { QuireEditor, QuireEditorUpdateEvent } ",{"type":646,"tag":154,"props":675,"children":676},{"style":658},[677],{"type":661,"value":678},"from",{"type":646,"tag":154,"props":680,"children":682},{"style":681},"--shiki-default:#032F62;--shiki-light:#032F62;--shiki-dark:#9ECBFF",[683],{"type":661,"value":684}," \"@quirekit\u002Fcore\"",{"type":646,"tag":154,"props":686,"children":687},{"style":670},[688],{"type":661,"value":689},";\n",{"type":646,"tag":154,"props":691,"children":692},{"class":156,"line":170},[693,697,702,706,711],{"type":646,"tag":154,"props":694,"children":695},{"style":658},[696],{"type":661,"value":662},{"type":646,"tag":154,"props":698,"children":699},{"style":670},[700],{"type":661,"value":701}," { defineClassicEditorPlugin } ",{"type":646,"tag":154,"props":703,"children":704},{"style":658},[705],{"type":661,"value":678},{"type":646,"tag":154,"props":707,"children":708},{"style":681},[709],{"type":661,"value":710}," \"@quirekit\u002Fclassic-editor\"",{"type":646,"tag":154,"props":712,"children":713},{"style":670},[714],{"type":661,"value":689},{"type":646,"tag":154,"props":716,"children":717},{"class":156,"line":255},[718,722,726,731,735,739],{"type":646,"tag":154,"props":719,"children":720},{"style":658},[721],{"type":661,"value":662},{"type":646,"tag":154,"props":723,"children":724},{"style":658},[725],{"type":661,"value":667},{"type":646,"tag":154,"props":727,"children":728},{"style":670},[729],{"type":661,"value":730}," { ClassicEditorPlugin } ",{"type":646,"tag":154,"props":732,"children":733},{"style":658},[734],{"type":661,"value":678},{"type":646,"tag":154,"props":736,"children":737},{"style":681},[738],{"type":661,"value":710},{"type":646,"tag":154,"props":740,"children":741},{"style":670},[742],{"type":661,"value":689},{"type":646,"tag":154,"props":744,"children":745},{"class":156,"line":264},[746],{"type":646,"tag":154,"props":747,"children":748},{"emptyLinePlaceholder":631},[749],{"type":661,"value":750},"\n",{"type":646,"tag":154,"props":752,"children":753},{"class":156,"line":270},[754],{"type":646,"tag":154,"props":755,"children":757},{"style":756},"--shiki-default:#6A737D;--shiki-light:#6A737D;--shiki-dark:#6A737D",[758],{"type":661,"value":759},"\u002F**\n",{"type":646,"tag":154,"props":761,"children":762},{"class":156,"line":359},[763],{"type":646,"tag":154,"props":764,"children":765},{"style":756},[766],{"type":661,"value":767}," * Observes document changes across product remounts without treating UI updates as edits.\n",{"type":646,"tag":154,"props":769,"children":770},{"class":156,"line":505},[771,776,781,786],{"type":646,"tag":154,"props":772,"children":773},{"style":756},[774],{"type":661,"value":775}," * ",{"type":646,"tag":154,"props":777,"children":778},{"style":658},[779],{"type":661,"value":780},"@param",{"type":646,"tag":154,"props":782,"children":783},{"style":670},[784],{"type":661,"value":785}," onChange",{"type":646,"tag":154,"props":787,"children":788},{"style":756},[789],{"type":661,"value":790}," - Host callback that marks the current document as unsaved.\n",{"type":646,"tag":154,"props":792,"children":793},{"class":156,"line":517},[794,798,803],{"type":646,"tag":154,"props":795,"children":796},{"style":756},[797],{"type":661,"value":775},{"type":646,"tag":154,"props":799,"children":800},{"style":658},[801],{"type":661,"value":802},"@returns",{"type":646,"tag":154,"props":804,"children":805},{"style":756},[806],{"type":661,"value":807}," Product plugin; create a separate plugin object for each Classic instance.\n",{"type":646,"tag":154,"props":809,"children":810},{"class":156,"line":559},[811],{"type":646,"tag":154,"props":812,"children":813},{"style":756},[814],{"type":661,"value":815}," *\u002F\n",{"type":646,"tag":154,"props":817,"children":818},{"class":156,"line":565},[819,824,829,835,839,844,849,854,859,865,870,874,879],{"type":646,"tag":154,"props":820,"children":821},{"style":658},[822],{"type":661,"value":823},"export",{"type":646,"tag":154,"props":825,"children":826},{"style":658},[827],{"type":661,"value":828}," function",{"type":646,"tag":154,"props":830,"children":832},{"style":831},"--shiki-default:#6F42C1;--shiki-light:#6F42C1;--shiki-dark:#B392F0",[833],{"type":661,"value":834}," createClassicDraftObserver",{"type":646,"tag":154,"props":836,"children":837},{"style":670},[838],{"type":661,"value":178},{"type":646,"tag":154,"props":840,"children":841},{"style":831},[842],{"type":661,"value":843},"onChange",{"type":646,"tag":154,"props":845,"children":846},{"style":658},[847],{"type":661,"value":848},":",{"type":646,"tag":154,"props":850,"children":851},{"style":670},[852],{"type":661,"value":853}," () ",{"type":646,"tag":154,"props":855,"children":856},{"style":658},[857],{"type":661,"value":858},"=>",{"type":646,"tag":154,"props":860,"children":862},{"style":861},"--shiki-default:#005CC5;--shiki-light:#005CC5;--shiki-dark:#79B8FF",[863],{"type":661,"value":864}," void",{"type":646,"tag":154,"props":866,"children":867},{"style":670},[868],{"type":661,"value":869},")",{"type":646,"tag":154,"props":871,"children":872},{"style":658},[873],{"type":661,"value":848},{"type":646,"tag":154,"props":875,"children":876},{"style":831},[877],{"type":661,"value":878}," ClassicEditorPlugin",{"type":646,"tag":154,"props":880,"children":881},{"style":670},[882],{"type":661,"value":452},{"type":646,"tag":154,"props":884,"children":886},{"class":156,"line":885},11,[887,892,897,901,906,911,916],{"type":646,"tag":154,"props":888,"children":889},{"style":658},[890],{"type":661,"value":891},"  let",{"type":646,"tag":154,"props":893,"children":894},{"style":670},[895],{"type":661,"value":896}," owner",{"type":646,"tag":154,"props":898,"children":899},{"style":658},[900],{"type":661,"value":848},{"type":646,"tag":154,"props":902,"children":903},{"style":831},[904],{"type":661,"value":905}," QuireEditor",{"type":646,"tag":154,"props":907,"children":908},{"style":658},[909],{"type":661,"value":910}," |",{"type":646,"tag":154,"props":912,"children":913},{"style":861},[914],{"type":661,"value":915}," undefined",{"type":646,"tag":154,"props":917,"children":918},{"style":670},[919],{"type":661,"value":689},{"type":646,"tag":154,"props":921,"children":923},{"class":156,"line":922},12,[924],{"type":646,"tag":154,"props":925,"children":926},{"emptyLinePlaceholder":631},[927],{"type":661,"value":750},{"type":646,"tag":154,"props":929,"children":931},{"class":156,"line":930},13,[932,937,941,946],{"type":646,"tag":154,"props":933,"children":934},{"style":756},[935],{"type":661,"value":936},"  \u002F** ",{"type":646,"tag":154,"props":938,"children":939},{"style":658},[940],{"type":661,"value":780},{"type":646,"tag":154,"props":942,"children":943},{"style":670},[944],{"type":661,"value":945}," event",{"type":646,"tag":154,"props":947,"children":948},{"style":756},[949],{"type":661,"value":950}," - Accepted update, which can also represent an editability change. *\u002F\n",{"type":646,"tag":154,"props":952,"children":954},{"class":156,"line":953},14,[955,960,965,969,975,979,984,988,992,996],{"type":646,"tag":154,"props":956,"children":957},{"style":658},[958],{"type":661,"value":959},"  function",{"type":646,"tag":154,"props":961,"children":962},{"style":831},[963],{"type":661,"value":964}," onUpdate",{"type":646,"tag":154,"props":966,"children":967},{"style":670},[968],{"type":661,"value":178},{"type":646,"tag":154,"props":970,"children":972},{"style":971},"--shiki-default:#E36209;--shiki-light:#E36209;--shiki-dark:#FFAB70",[973],{"type":661,"value":974},"event",{"type":646,"tag":154,"props":976,"children":977},{"style":658},[978],{"type":661,"value":848},{"type":646,"tag":154,"props":980,"children":981},{"style":831},[982],{"type":661,"value":983}," QuireEditorUpdateEvent",{"type":646,"tag":154,"props":985,"children":986},{"style":670},[987],{"type":661,"value":869},{"type":646,"tag":154,"props":989,"children":990},{"style":658},[991],{"type":661,"value":848},{"type":646,"tag":154,"props":993,"children":994},{"style":861},[995],{"type":661,"value":864},{"type":646,"tag":154,"props":997,"children":998},{"style":670},[999],{"type":661,"value":452},{"type":646,"tag":154,"props":1001,"children":1003},{"class":156,"line":1002},15,[1004],{"type":646,"tag":154,"props":1005,"children":1006},{"style":756},[1007],{"type":661,"value":1008},"    \u002F\u002F Core already suppresses equal-content updates; an editability notification\n",{"type":646,"tag":154,"props":1010,"children":1012},{"class":156,"line":1011},16,[1013],{"type":646,"tag":154,"props":1014,"children":1015},{"style":756},[1016],{"type":661,"value":1017},"    \u002F\u002F retains the same immutable document. The observer needs only identity.\n",{"type":646,"tag":154,"props":1019,"children":1021},{"class":156,"line":1020},17,[1022,1027,1032,1037,1042,1046],{"type":646,"tag":154,"props":1023,"children":1024},{"style":658},[1025],{"type":661,"value":1026},"    if",{"type":646,"tag":154,"props":1028,"children":1029},{"style":670},[1030],{"type":661,"value":1031}," (event.previousState.doc ",{"type":646,"tag":154,"props":1033,"children":1034},{"style":658},[1035],{"type":661,"value":1036},"!==",{"type":646,"tag":154,"props":1038,"children":1039},{"style":670},[1040],{"type":661,"value":1041}," event.editor.state.doc) ",{"type":646,"tag":154,"props":1043,"children":1044},{"style":831},[1045],{"type":661,"value":843},{"type":646,"tag":154,"props":1047,"children":1048},{"style":670},[1049],{"type":661,"value":1050},"();\n",{"type":646,"tag":154,"props":1052,"children":1054},{"class":156,"line":1053},18,[1055],{"type":646,"tag":154,"props":1056,"children":1057},{"style":670},[1058],{"type":661,"value":1059},"  }\n",{"type":646,"tag":154,"props":1061,"children":1063},{"class":156,"line":1062},19,[1064],{"type":646,"tag":154,"props":1065,"children":1066},{"emptyLinePlaceholder":631},[1067],{"type":661,"value":750},{"type":646,"tag":154,"props":1069,"children":1071},{"class":156,"line":1070},20,[1072],{"type":646,"tag":154,"props":1073,"children":1074},{"style":756},[1075],{"type":661,"value":1076},"  \u002F** Releases the subscription belonging to the previous mounted Core. *\u002F\n",{"type":646,"tag":154,"props":1078,"children":1080},{"class":156,"line":1079},21,[1081,1085,1090,1095,1099,1103],{"type":646,"tag":154,"props":1082,"children":1083},{"style":658},[1084],{"type":661,"value":959},{"type":646,"tag":154,"props":1086,"children":1087},{"style":831},[1088],{"type":661,"value":1089}," detach",{"type":646,"tag":154,"props":1091,"children":1092},{"style":670},[1093],{"type":661,"value":1094},"()",{"type":646,"tag":154,"props":1096,"children":1097},{"style":658},[1098],{"type":661,"value":848},{"type":646,"tag":154,"props":1100,"children":1101},{"style":861},[1102],{"type":661,"value":864},{"type":646,"tag":154,"props":1104,"children":1105},{"style":670},[1106],{"type":661,"value":452},{"type":646,"tag":154,"props":1108,"children":1110},{"class":156,"line":1109},22,[1111,1116,1121,1125,1130],{"type":646,"tag":154,"props":1112,"children":1113},{"style":670},[1114],{"type":661,"value":1115},"    owner?.",{"type":646,"tag":154,"props":1117,"children":1118},{"style":831},[1119],{"type":661,"value":1120},"off",{"type":646,"tag":154,"props":1122,"children":1123},{"style":670},[1124],{"type":661,"value":178},{"type":646,"tag":154,"props":1126,"children":1127},{"style":681},[1128],{"type":661,"value":1129},"\"update\"",{"type":646,"tag":154,"props":1131,"children":1132},{"style":670},[1133],{"type":661,"value":1134},", onUpdate);\n",{"type":646,"tag":154,"props":1136,"children":1138},{"class":156,"line":1137},23,[1139,1144,1149,1153],{"type":646,"tag":154,"props":1140,"children":1141},{"style":670},[1142],{"type":661,"value":1143},"    owner ",{"type":646,"tag":154,"props":1145,"children":1146},{"style":658},[1147],{"type":661,"value":1148},"=",{"type":646,"tag":154,"props":1150,"children":1151},{"style":861},[1152],{"type":661,"value":915},{"type":646,"tag":154,"props":1154,"children":1155},{"style":670},[1156],{"type":661,"value":689},{"type":646,"tag":154,"props":1158,"children":1160},{"class":156,"line":1159},24,[1161],{"type":646,"tag":154,"props":1162,"children":1163},{"style":670},[1164],{"type":661,"value":1059},{"type":646,"tag":154,"props":1166,"children":1168},{"class":156,"line":1167},25,[1169],{"type":646,"tag":154,"props":1170,"children":1171},{"emptyLinePlaceholder":631},[1172],{"type":661,"value":750},{"type":646,"tag":154,"props":1174,"children":1176},{"class":156,"line":1175},26,[1177,1182,1187],{"type":646,"tag":154,"props":1178,"children":1179},{"style":658},[1180],{"type":661,"value":1181},"  return",{"type":646,"tag":154,"props":1183,"children":1184},{"style":831},[1185],{"type":661,"value":1186}," defineClassicEditorPlugin",{"type":646,"tag":154,"props":1188,"children":1189},{"style":670},[1190],{"type":661,"value":238},{"type":646,"tag":154,"props":1192,"children":1194},{"class":156,"line":1193},27,[1195,1200,1205],{"type":646,"tag":154,"props":1196,"children":1197},{"style":670},[1198],{"type":661,"value":1199},"    id: ",{"type":646,"tag":154,"props":1201,"children":1202},{"style":681},[1203],{"type":661,"value":1204},"\"app.draft-observer\"",{"type":646,"tag":154,"props":1206,"children":1207},{"style":670},[1208],{"type":661,"value":1209},",\n",{"type":646,"tag":154,"props":1211,"children":1213},{"class":156,"line":1212},28,[1214,1219,1223,1228],{"type":646,"tag":154,"props":1215,"children":1216},{"style":756},[1217],{"type":661,"value":1218},"    \u002F** ",{"type":646,"tag":154,"props":1220,"children":1221},{"style":658},[1222],{"type":661,"value":780},{"type":646,"tag":154,"props":1224,"children":1225},{"style":670},[1226],{"type":661,"value":1227}," context",{"type":646,"tag":154,"props":1229,"children":1230},{"style":756},[1231],{"type":661,"value":1232}," - Current mount, whose Core owns this subscription. *\u002F\n",{"type":646,"tag":154,"props":1234,"children":1236},{"class":156,"line":1235},29,[1237,1242,1246,1251],{"type":646,"tag":154,"props":1238,"children":1239},{"style":831},[1240],{"type":661,"value":1241},"    onMount",{"type":646,"tag":154,"props":1243,"children":1244},{"style":670},[1245],{"type":661,"value":178},{"type":646,"tag":154,"props":1247,"children":1248},{"style":971},[1249],{"type":661,"value":1250},"context",{"type":646,"tag":154,"props":1252,"children":1253},{"style":670},[1254],{"type":661,"value":252},{"type":646,"tag":154,"props":1256,"children":1258},{"class":156,"line":1257},30,[1259,1264],{"type":646,"tag":154,"props":1260,"children":1261},{"style":831},[1262],{"type":661,"value":1263},"      detach",{"type":646,"tag":154,"props":1265,"children":1266},{"style":670},[1267],{"type":661,"value":1050},{"type":646,"tag":154,"props":1269,"children":1271},{"class":156,"line":1270},31,[1272,1277,1281],{"type":646,"tag":154,"props":1273,"children":1274},{"style":670},[1275],{"type":661,"value":1276},"      owner ",{"type":646,"tag":154,"props":1278,"children":1279},{"style":658},[1280],{"type":661,"value":1148},{"type":646,"tag":154,"props":1282,"children":1283},{"style":670},[1284],{"type":661,"value":1285}," context.editor;\n",{"type":646,"tag":154,"props":1287,"children":1289},{"class":156,"line":1288},32,[1290,1295,1300,1304,1308],{"type":646,"tag":154,"props":1291,"children":1292},{"style":670},[1293],{"type":661,"value":1294},"      owner?.",{"type":646,"tag":154,"props":1296,"children":1297},{"style":831},[1298],{"type":661,"value":1299},"on",{"type":646,"tag":154,"props":1301,"children":1302},{"style":670},[1303],{"type":661,"value":178},{"type":646,"tag":154,"props":1305,"children":1306},{"style":681},[1307],{"type":661,"value":1129},{"type":646,"tag":154,"props":1309,"children":1310},{"style":670},[1311],{"type":661,"value":1134},{"type":646,"tag":154,"props":1313,"children":1315},{"class":156,"line":1314},33,[1316],{"type":646,"tag":154,"props":1317,"children":1318},{"style":670},[1319],{"type":661,"value":1320},"    },\n",{"type":646,"tag":154,"props":1322,"children":1324},{"class":156,"line":1323},34,[1325],{"type":646,"tag":154,"props":1326,"children":1327},{"style":670},[1328],{"type":661,"value":1329},"    onUnmount: detach,\n",{"type":646,"tag":154,"props":1331,"children":1333},{"class":156,"line":1332},35,[1334],{"type":646,"tag":154,"props":1335,"children":1336},{"style":670},[1337],{"type":661,"value":1338},"    onDestroy: detach,\n",{"type":646,"tag":154,"props":1340,"children":1342},{"class":156,"line":1341},36,[1343],{"type":646,"tag":154,"props":1344,"children":1345},{"style":670},[1346],{"type":661,"value":1347},"  });\n",{"type":646,"tag":154,"props":1349,"children":1351},{"class":156,"line":1350},37,[1352],{"type":646,"tag":154,"props":1353,"children":1354},{"style":670},[1355],{"type":661,"value":562},{"type":646,"tag":614,"props":1357,"children":1358},{},[1359],{"type":661,"value":1360},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"data":1362,"body":1363},{},{"type":643,"children":1364},[1365,1886],{"type":646,"tag":144,"props":1366,"children":1368},{"className":146,"code":1367,"language":149,"meta":150,"style":150},"import type { ClassicDraftOwner, ClassicDraftRepository } from \".\u002Ftypes\";\n\n\u002F**\n * Saves one revision without clearing changes made while storage was pending.\n * @param instance - Mounted product that owns the current document.\n * @param repository - Application storage; it must serialize writes for the same document.\n * @returns Whether the acknowledged revision still belongs to the active Core and document.\n *\u002F\nexport async function saveClassicDraft(\n  instance: ClassicDraftOwner,\n  repository: ClassicDraftRepository\n): Promise\u003Cboolean> {\n  const editor = instance.editor;\n  if (instance.isDestroyed || !editor || editor.isDestroyed) {\n    throw new Error(\"Mount the document before saving\");\n  }\n\n  \u002F\u002F Capture before awaiting: a later edit or product remount owns a different revision.\n  const document = editor.state.doc;\n  const source = JSON.stringify({ version: 1, model: \"word-v1\", content: instance.getJSON() });\n  await repository.write(source);\n\n  return !instance.isDestroyed && !editor.isDestroyed\n    && instance.editor === editor && editor.state.doc === document;\n}\n\n",[1369],{"type":646,"tag":14,"props":1370,"children":1371},{"__ignoreMap":150},[1372,1401,1408,1415,1423,1444,1465,1481,1488,1514,1535,1552,1583,1604,1640,1671,1678,1685,1693,1714,1780,1802,1809,1839,1879],{"type":646,"tag":154,"props":1373,"children":1374},{"class":156,"line":157},[1375,1379,1383,1388,1392,1397],{"type":646,"tag":154,"props":1376,"children":1377},{"style":658},[1378],{"type":661,"value":662},{"type":646,"tag":154,"props":1380,"children":1381},{"style":658},[1382],{"type":661,"value":667},{"type":646,"tag":154,"props":1384,"children":1385},{"style":670},[1386],{"type":661,"value":1387}," { ClassicDraftOwner, ClassicDraftRepository } ",{"type":646,"tag":154,"props":1389,"children":1390},{"style":658},[1391],{"type":661,"value":678},{"type":646,"tag":154,"props":1393,"children":1394},{"style":681},[1395],{"type":661,"value":1396}," \".\u002Ftypes\"",{"type":646,"tag":154,"props":1398,"children":1399},{"style":670},[1400],{"type":661,"value":689},{"type":646,"tag":154,"props":1402,"children":1403},{"class":156,"line":170},[1404],{"type":646,"tag":154,"props":1405,"children":1406},{"emptyLinePlaceholder":631},[1407],{"type":661,"value":750},{"type":646,"tag":154,"props":1409,"children":1410},{"class":156,"line":255},[1411],{"type":646,"tag":154,"props":1412,"children":1413},{"style":756},[1414],{"type":661,"value":759},{"type":646,"tag":154,"props":1416,"children":1417},{"class":156,"line":264},[1418],{"type":646,"tag":154,"props":1419,"children":1420},{"style":756},[1421],{"type":661,"value":1422}," * Saves one revision without clearing changes made while storage was pending.\n",{"type":646,"tag":154,"props":1424,"children":1425},{"class":156,"line":270},[1426,1430,1434,1439],{"type":646,"tag":154,"props":1427,"children":1428},{"style":756},[1429],{"type":661,"value":775},{"type":646,"tag":154,"props":1431,"children":1432},{"style":658},[1433],{"type":661,"value":780},{"type":646,"tag":154,"props":1435,"children":1436},{"style":670},[1437],{"type":661,"value":1438}," instance",{"type":646,"tag":154,"props":1440,"children":1441},{"style":756},[1442],{"type":661,"value":1443}," - Mounted product that owns the current document.\n",{"type":646,"tag":154,"props":1445,"children":1446},{"class":156,"line":359},[1447,1451,1455,1460],{"type":646,"tag":154,"props":1448,"children":1449},{"style":756},[1450],{"type":661,"value":775},{"type":646,"tag":154,"props":1452,"children":1453},{"style":658},[1454],{"type":661,"value":780},{"type":646,"tag":154,"props":1456,"children":1457},{"style":670},[1458],{"type":661,"value":1459}," repository",{"type":646,"tag":154,"props":1461,"children":1462},{"style":756},[1463],{"type":661,"value":1464}," - Application storage; it must serialize writes for the same document.\n",{"type":646,"tag":154,"props":1466,"children":1467},{"class":156,"line":505},[1468,1472,1476],{"type":646,"tag":154,"props":1469,"children":1470},{"style":756},[1471],{"type":661,"value":775},{"type":646,"tag":154,"props":1473,"children":1474},{"style":658},[1475],{"type":661,"value":802},{"type":646,"tag":154,"props":1477,"children":1478},{"style":756},[1479],{"type":661,"value":1480}," Whether the acknowledged revision still belongs to the active Core and document.\n",{"type":646,"tag":154,"props":1482,"children":1483},{"class":156,"line":517},[1484],{"type":646,"tag":154,"props":1485,"children":1486},{"style":756},[1487],{"type":661,"value":815},{"type":646,"tag":154,"props":1489,"children":1490},{"class":156,"line":559},[1491,1495,1500,1504,1509],{"type":646,"tag":154,"props":1492,"children":1493},{"style":658},[1494],{"type":661,"value":823},{"type":646,"tag":154,"props":1496,"children":1497},{"style":658},[1498],{"type":661,"value":1499}," async",{"type":646,"tag":154,"props":1501,"children":1502},{"style":658},[1503],{"type":661,"value":828},{"type":646,"tag":154,"props":1505,"children":1506},{"style":831},[1507],{"type":661,"value":1508}," saveClassicDraft",{"type":646,"tag":154,"props":1510,"children":1511},{"style":670},[1512],{"type":661,"value":1513},"(\n",{"type":646,"tag":154,"props":1515,"children":1516},{"class":156,"line":565},[1517,1522,1526,1531],{"type":646,"tag":154,"props":1518,"children":1519},{"style":971},[1520],{"type":661,"value":1521},"  instance",{"type":646,"tag":154,"props":1523,"children":1524},{"style":658},[1525],{"type":661,"value":848},{"type":646,"tag":154,"props":1527,"children":1528},{"style":831},[1529],{"type":661,"value":1530}," ClassicDraftOwner",{"type":646,"tag":154,"props":1532,"children":1533},{"style":670},[1534],{"type":661,"value":1209},{"type":646,"tag":154,"props":1536,"children":1537},{"class":156,"line":885},[1538,1543,1547],{"type":646,"tag":154,"props":1539,"children":1540},{"style":971},[1541],{"type":661,"value":1542},"  repository",{"type":646,"tag":154,"props":1544,"children":1545},{"style":658},[1546],{"type":661,"value":848},{"type":646,"tag":154,"props":1548,"children":1549},{"style":831},[1550],{"type":661,"value":1551}," ClassicDraftRepository\n",{"type":646,"tag":154,"props":1553,"children":1554},{"class":156,"line":922},[1555,1559,1563,1568,1573,1578],{"type":646,"tag":154,"props":1556,"children":1557},{"style":670},[1558],{"type":661,"value":869},{"type":646,"tag":154,"props":1560,"children":1561},{"style":658},[1562],{"type":661,"value":848},{"type":646,"tag":154,"props":1564,"children":1565},{"style":831},[1566],{"type":661,"value":1567}," Promise",{"type":646,"tag":154,"props":1569,"children":1570},{"style":670},[1571],{"type":661,"value":1572},"\u003C",{"type":646,"tag":154,"props":1574,"children":1575},{"style":861},[1576],{"type":661,"value":1577},"boolean",{"type":646,"tag":154,"props":1579,"children":1580},{"style":670},[1581],{"type":661,"value":1582},"> {\n",{"type":646,"tag":154,"props":1584,"children":1585},{"class":156,"line":930},[1586,1590,1595,1599],{"type":646,"tag":154,"props":1587,"children":1588},{"style":658},[1589],{"type":661,"value":457},{"type":646,"tag":154,"props":1591,"children":1592},{"style":861},[1593],{"type":661,"value":1594}," editor",{"type":646,"tag":154,"props":1596,"children":1597},{"style":658},[1598],{"type":661,"value":369},{"type":646,"tag":154,"props":1600,"children":1601},{"style":670},[1602],{"type":661,"value":1603}," instance.editor;\n",{"type":646,"tag":154,"props":1605,"children":1606},{"class":156,"line":953},[1607,1611,1616,1621,1626,1631,1635],{"type":646,"tag":154,"props":1608,"children":1609},{"style":658},[1610],{"type":661,"value":520},{"type":646,"tag":154,"props":1612,"children":1613},{"style":670},[1614],{"type":661,"value":1615}," (instance.isDestroyed ",{"type":646,"tag":154,"props":1617,"children":1618},{"style":658},[1619],{"type":661,"value":1620},"||",{"type":646,"tag":154,"props":1622,"children":1623},{"style":658},[1624],{"type":661,"value":1625}," !",{"type":646,"tag":154,"props":1627,"children":1628},{"style":670},[1629],{"type":661,"value":1630},"editor ",{"type":646,"tag":154,"props":1632,"children":1633},{"style":658},[1634],{"type":661,"value":1620},{"type":646,"tag":154,"props":1636,"children":1637},{"style":670},[1638],{"type":661,"value":1639}," editor.isDestroyed) {\n",{"type":646,"tag":154,"props":1641,"children":1642},{"class":156,"line":1002},[1643,1648,1652,1657,1661,1666],{"type":646,"tag":154,"props":1644,"children":1645},{"style":658},[1646],{"type":661,"value":1647},"    throw",{"type":646,"tag":154,"props":1649,"children":1650},{"style":658},[1651],{"type":661,"value":438},{"type":646,"tag":154,"props":1653,"children":1654},{"style":831},[1655],{"type":661,"value":1656}," Error",{"type":646,"tag":154,"props":1658,"children":1659},{"style":670},[1660],{"type":661,"value":178},{"type":646,"tag":154,"props":1662,"children":1663},{"style":681},[1664],{"type":661,"value":1665},"\"Mount the document before saving\"",{"type":646,"tag":154,"props":1667,"children":1668},{"style":670},[1669],{"type":661,"value":1670},");\n",{"type":646,"tag":154,"props":1672,"children":1673},{"class":156,"line":1011},[1674],{"type":646,"tag":154,"props":1675,"children":1676},{"style":670},[1677],{"type":661,"value":1059},{"type":646,"tag":154,"props":1679,"children":1680},{"class":156,"line":1020},[1681],{"type":646,"tag":154,"props":1682,"children":1683},{"emptyLinePlaceholder":631},[1684],{"type":661,"value":750},{"type":646,"tag":154,"props":1686,"children":1687},{"class":156,"line":1053},[1688],{"type":646,"tag":154,"props":1689,"children":1690},{"style":756},[1691],{"type":661,"value":1692},"  \u002F\u002F Capture before awaiting: a later edit or product remount owns a different revision.\n",{"type":646,"tag":154,"props":1694,"children":1695},{"class":156,"line":1062},[1696,1700,1705,1709],{"type":646,"tag":154,"props":1697,"children":1698},{"style":658},[1699],{"type":661,"value":457},{"type":646,"tag":154,"props":1701,"children":1702},{"style":861},[1703],{"type":661,"value":1704}," document",{"type":646,"tag":154,"props":1706,"children":1707},{"style":658},[1708],{"type":661,"value":369},{"type":646,"tag":154,"props":1710,"children":1711},{"style":670},[1712],{"type":661,"value":1713}," editor.state.doc;\n",{"type":646,"tag":154,"props":1715,"children":1716},{"class":156,"line":1070},[1717,1721,1726,1730,1735,1740,1745,1750,1755,1760,1765,1770,1775],{"type":646,"tag":154,"props":1718,"children":1719},{"style":658},[1720],{"type":661,"value":457},{"type":646,"tag":154,"props":1722,"children":1723},{"style":861},[1724],{"type":661,"value":1725}," source",{"type":646,"tag":154,"props":1727,"children":1728},{"style":658},[1729],{"type":661,"value":369},{"type":646,"tag":154,"props":1731,"children":1732},{"style":861},[1733],{"type":661,"value":1734}," JSON",{"type":646,"tag":154,"props":1736,"children":1737},{"style":670},[1738],{"type":661,"value":1739},".",{"type":646,"tag":154,"props":1741,"children":1742},{"style":831},[1743],{"type":661,"value":1744},"stringify",{"type":646,"tag":154,"props":1746,"children":1747},{"style":670},[1748],{"type":661,"value":1749},"({ version: ",{"type":646,"tag":154,"props":1751,"children":1752},{"style":861},[1753],{"type":661,"value":1754},"1",{"type":646,"tag":154,"props":1756,"children":1757},{"style":670},[1758],{"type":661,"value":1759},", model: ",{"type":646,"tag":154,"props":1761,"children":1762},{"style":681},[1763],{"type":661,"value":1764},"\"word-v1\"",{"type":646,"tag":154,"props":1766,"children":1767},{"style":670},[1768],{"type":661,"value":1769},", content: instance.",{"type":646,"tag":154,"props":1771,"children":1772},{"style":831},[1773],{"type":661,"value":1774},"getJSON",{"type":646,"tag":154,"props":1776,"children":1777},{"style":670},[1778],{"type":661,"value":1779},"() });\n",{"type":646,"tag":154,"props":1781,"children":1782},{"class":156,"line":1079},[1783,1787,1792,1797],{"type":646,"tag":154,"props":1784,"children":1785},{"style":658},[1786],{"type":661,"value":482},{"type":646,"tag":154,"props":1788,"children":1789},{"style":670},[1790],{"type":661,"value":1791}," repository.",{"type":646,"tag":154,"props":1793,"children":1794},{"style":831},[1795],{"type":661,"value":1796},"write",{"type":646,"tag":154,"props":1798,"children":1799},{"style":670},[1800],{"type":661,"value":1801},"(source);\n",{"type":646,"tag":154,"props":1803,"children":1804},{"class":156,"line":1109},[1805],{"type":646,"tag":154,"props":1806,"children":1807},{"emptyLinePlaceholder":631},[1808],{"type":661,"value":750},{"type":646,"tag":154,"props":1810,"children":1811},{"class":156,"line":1137},[1812,1816,1820,1825,1830,1834],{"type":646,"tag":154,"props":1813,"children":1814},{"style":658},[1815],{"type":661,"value":1181},{"type":646,"tag":154,"props":1817,"children":1818},{"style":658},[1819],{"type":661,"value":1625},{"type":646,"tag":154,"props":1821,"children":1822},{"style":670},[1823],{"type":661,"value":1824},"instance.isDestroyed ",{"type":646,"tag":154,"props":1826,"children":1827},{"style":658},[1828],{"type":661,"value":1829},"&&",{"type":646,"tag":154,"props":1831,"children":1832},{"style":658},[1833],{"type":661,"value":1625},{"type":646,"tag":154,"props":1835,"children":1836},{"style":670},[1837],{"type":661,"value":1838},"editor.isDestroyed\n",{"type":646,"tag":154,"props":1840,"children":1841},{"class":156,"line":1159},[1842,1847,1852,1856,1861,1865,1870,1874],{"type":646,"tag":154,"props":1843,"children":1844},{"style":658},[1845],{"type":661,"value":1846},"    &&",{"type":646,"tag":154,"props":1848,"children":1849},{"style":670},[1850],{"type":661,"value":1851}," instance.editor ",{"type":646,"tag":154,"props":1853,"children":1854},{"style":658},[1855],{"type":661,"value":544},{"type":646,"tag":154,"props":1857,"children":1858},{"style":670},[1859],{"type":661,"value":1860}," editor ",{"type":646,"tag":154,"props":1862,"children":1863},{"style":658},[1864],{"type":661,"value":1829},{"type":646,"tag":154,"props":1866,"children":1867},{"style":670},[1868],{"type":661,"value":1869}," editor.state.doc ",{"type":646,"tag":154,"props":1871,"children":1872},{"style":658},[1873],{"type":661,"value":544},{"type":646,"tag":154,"props":1875,"children":1876},{"style":670},[1877],{"type":661,"value":1878}," document;\n",{"type":646,"tag":154,"props":1880,"children":1881},{"class":156,"line":1167},[1882],{"type":646,"tag":154,"props":1883,"children":1884},{"style":670},[1885],{"type":661,"value":562},{"type":646,"tag":614,"props":1887,"children":1888},{},[1889],{"type":661,"value":1360},1793045224432]