wendang-react 0.6.4 → 0.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE.md +1 -1
- package/README.md +28 -1
- package/dist/bindings/yjs.js +1 -1
- package/dist/chunks/{MindMapCanvas-CVXQXNOg.js → MindMapCanvas-BA3FYy8p.js} +1 -1
- package/dist/chunks/{MindMapViewer-BI8zbQM1.js → MindMapViewer-B1_uaMHB.js} +7 -7
- package/dist/chunks/{extensions-C1fCBnEs.js → extensions-D4JlN-IP.js} +16 -14
- package/dist/chunks/mind-map-defaults-B9SSENmK.js +1 -0
- package/dist/chunks/{mind-topic-text-Bn1waxff.js → mind-topic-text-C7pIS6L9.js} +14 -15
- package/dist/chunks/worksheet-engine-Dz6P8Kiq.js +1 -0
- package/dist/document/viewer.js +4 -4
- package/dist/document.js +67 -74
- package/dist/mindmap/viewer.js +1 -1
- package/dist/mindmap.js +3 -3
- package/dist/spreadsheet.js +1 -1
- package/dist/styles/tokens.css +1 -1
- package/dist/styles/video-embed.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/engine/editor/video-block-controls.d.ts +13 -0
- package/dist/types/engine/shared/color-preview.d.ts +1 -0
- package/dist/types/engine/shared/mind-map-defaults.d.ts +3 -0
- package/dist/types/renderer/media.d.ts +2 -1
- package/integrity.json +58 -43
- package/package.json +3 -3
- package/dist/chunks/mind-map-controller-Ce76mETT.js +0 -1
- package/dist/chunks/worksheet-engine-c84sdD4N.js +0 -1
- /package/third-party-notices/{wendang-export@0.6.3-LICENSE.txt → wendang-export@0.6.5-LICENSE.txt} +0 -0
- /package/third-party-notices/{wendang-export@0.6.3-NOTICE.md.txt → wendang-export@0.6.5-NOTICE.md.txt} +0 -0
package/NOTICE.md
CHANGED
|
@@ -410,7 +410,7 @@ Wendang is licensed under the MIT License; see LICENSE. Third-party components r
|
|
|
410
410
|
| util-deprecate | 1.0.2 | MIT | LICENSE |
|
|
411
411
|
| uuid | 8.3.2 | MIT | LICENSE.md |
|
|
412
412
|
| w3c-keyname | 2.2.8 | MIT | LICENSE |
|
|
413
|
-
| wendang-export | 0.6.
|
|
413
|
+
| wendang-export | 0.6.5 | MIT | LICENSE, NOTICE.md |
|
|
414
414
|
| which-boxed-primitive | 1.1.1 | MIT | LICENSE |
|
|
415
415
|
| which-builtin-type | 1.2.1 | MIT | LICENSE |
|
|
416
416
|
| which-collection | 1.0.2 | MIT | LICENSE |
|
package/README.md
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
[在线演示](https://doc.yjmf.com) · [Vue 版本](https://www.npmjs.com/package/wendang-vue) · [数据工具与服务端校验](https://www.npmjs.com/package/wendang) · [源码](https://gitee.com/ztes/wendang)
|
|
6
6
|
|
|
7
|
+
在线使用说明:[简体中文](https://doc.yjmf.com/?view=sdk&lang=zh-CN&package=wendang-react) · [繁體中文](https://doc.yjmf.com/?view=sdk&lang=zh-TW&package=wendang-react) · [English](https://doc.yjmf.com/?view=sdk&lang=en-US&package=wendang-react) · [日本語](https://doc.yjmf.com/?view=sdk&lang=ja-JP&package=wendang-react) · [한국어](https://doc.yjmf.com/?view=sdk&lang=ko-KR&package=wendang-react) · [Español](https://doc.yjmf.com/?view=sdk&lang=es-ES&package=wendang-react)。
|
|
8
|
+
|
|
7
9
|
## 安装
|
|
8
10
|
|
|
9
11
|
在 React **18.3+ 或 19** 应用中安装:
|
|
@@ -503,7 +505,7 @@ return file; // { blob, name, warnings },宿主提示降级信息并下载 blo
|
|
|
503
505
|
}
|
|
504
506
|
```
|
|
505
507
|
|
|
506
|
-
PDF 直接生成文件,正文可搜索、复制,支持中文、图片、合并表格和重复表头。块级与行内公式按需转为可缩放矢量,保留上下标、分式、根号和矩阵等排版;语法无效或不支持时保留 LaTeX
|
|
508
|
+
PDF 直接生成文件,正文可搜索、复制,支持中文、图片、合并表格和重复表头。块级与行内公式按需转为可缩放矢量,保留上下标、分式、根号和矩阵等排版;语法无效或不支持时保留 LaTeX 并告警。公式图形不提供可编辑文本层。PDF/Word 保留并排分栏;视频以含原站链接的静态卡片保留。转换提示从 `warnings` 返回。`ContentHost.exports.request` 接管组件内的文件导出;配置后拒绝请求不回退导出当前模型,权限与版本由宿主决定。
|
|
507
509
|
|
|
508
510
|
Word 与 PDF 共用正文、标题、颜色和间距基线,保留表格列宽比例、合并、对齐、背景及图片行分组。高亮块图标与正文并排,短块同页,长块允许分页;常规公式生成可编辑的 Word 公式,复杂公式尝试图形后备并提示。正文与表格仍可编辑。Word/WPS 的字体、分页及直角边框可能与 PDF 不同。
|
|
509
511
|
|
|
@@ -583,6 +585,27 @@ export async function loadLocale(id: string): Promise<WendangLocale> {
|
|
|
583
585
|
|
|
584
586
|
工作表菜单同样使用 Provider 语言,不重建工作簿;已有日期/数字格式不被自动改写。Univer 部分金融函数和输入归一化与语言相关,业务公式仍需按目标语言验收。导出器可接收相同语言对象,例如 `wordFile(snapshot, assets, { locale: enUS })`。韩文等 PDF 正文须提供覆盖相应字形的字体,语言包不附带额外字体。示例正文与开发者参考不自动翻译。
|
|
585
587
|
|
|
588
|
+
### 韩文与外部字体接入
|
|
589
|
+
|
|
590
|
+
韩文字体可从宿主外部接入;缺少字形时仍可导出,通过 `warnings` 给出非阻断提示,部分文字可能显示异常。请使用有嵌入授权的字体,Word 的家族名需与文件一致;SDK 不主动下载外部字体。宿主可将 `warnings` 显示为带配置链接的 Notification 或 Alert。演示站右上角通知默认 12 秒后关闭,悬停或聚焦时暂停。
|
|
591
|
+
|
|
592
|
+
```ts
|
|
593
|
+
import { pdfFile, loadPdfFont } from 'wendang-react/export/pdf';
|
|
594
|
+
import { wordFile } from 'wendang-react/export/word';
|
|
595
|
+
import type { ExportSnapshot, ExportAssets } from 'wendang-react/export';
|
|
596
|
+
import type { WendangLocale } from 'wendang-react/i18n';
|
|
597
|
+
export async function exportWithExternalFont(
|
|
598
|
+
snapshot: ExportSnapshot, assets: ExportAssets, signal: AbortSignal, locale?: WendangLocale,
|
|
599
|
+
) {
|
|
600
|
+
const font = await loadPdfFont('/fonts/NotoSansCJKsc-Regular.otf', { signal });
|
|
601
|
+
const pdf = await pdfFile(snapshot, assets, { font, signal, locale });
|
|
602
|
+
const word = await wordFile(snapshot, assets, {
|
|
603
|
+
signal, locale, font: { family: 'Noto Sans CJK SC', data: font },
|
|
604
|
+
});
|
|
605
|
+
return { pdf, word }; // 每个结果的 warnings 由宿主显示为通知。
|
|
606
|
+
}
|
|
607
|
+
```
|
|
608
|
+
|
|
586
609
|
语言选择控件、当前语言标识与持久化由接入应用提供;SDK 只通过 ContentProvider 的 locale / messages 接收界面语言。演示站的语言按钮位于 examples 中,不属于 SDK 公共组件。
|
|
587
610
|
|
|
588
611
|
### 视频加载配置
|
|
@@ -618,6 +641,10 @@ export default function VideoExample() {
|
|
|
618
641
|
|
|
619
642
|
插入视频时可勾选「自动加载视频」。此选择保存为视频节点的 `attrs.autoLoad`:`true` 直接加载播放器,`false` 显示「加载视频」按钮,均不自动播放。未设置或为 `null` 的旧节点继承 Provider 的 `video.load` 默认值;平台限制和窄栏限制仍然生效。Provider 配置本身不写入正文。
|
|
620
643
|
|
|
644
|
+
在编辑态,将鼠标移到视频上,或用 Tab 聚焦视频块,即可显示视频工具栏;聚焦后按 Enter 可进入工具栏。可重新加载播放器、修改视频链接、切换自动加载、在原站打开、复制原始网页链接或删除。修改链接、加载方式和删除均支持撤销、重做;重新加载只刷新当前播放器。通用块操作仍可通过左侧块菜单完成。
|
|
645
|
+
|
|
646
|
+
点击工具栏的链条图标,在加宽的链接浮层中修改当前地址。短链接显示一行,长链接自动换行并增高;点「确认」或按 Enter 提交,按 Esc 或点击外部取消。此入口不访问剪贴板,复制原链接使用独立的复制图标。
|
|
647
|
+
|
|
621
648
|
`autoLoad` 是正文格式 13 的新持久属性;`requiredSchemaVersion` 会据此抬升最低内容版本。使用此功能的前后端应同步更新 `wendang`,工作簿格式版本仍为 10。
|
|
622
649
|
|
|
623
650
|
第三方 iframe 内文字由视频平台控制,语言包覆盖 SDK 外框、按钮与链接,不保证改变第三方播放器内部语言;原生 video 控件语言由浏览器决定。
|
package/dist/bindings/yjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{C as s}from"../chunks/extensions-
|
|
1
|
+
"use client";import{C as s}from"../chunks/extensions-D4JlN-IP.js";export{s as COLLAB_FIELD};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{c as i,b as l,a as o}from"./i18n-B0kCsIjc.js";import{useState as a,useRef as r,useEffect as d,useMemo as c}from"react";import{textDifference as s,mindMapTree as u,layoutMindMap as m,MIND_MAP_PALETTE as h,mindMapDescendants as p,projectMindSideMove as v,mindMapBranchSides as f,mindMapOutline as g,mindRelationPaths as b,mindMapMarkdown as y,mindMapSvg as w,mindMapToJson as x,MIND_MAP_MAX_TOPICS as k}from"wendang/mindmap";import{TEXT_COLORS as C,HIGHLIGHT_COLORS as N,mindTopicLineHeight as I,MIND_TOPIC_FONT as S,readableTextColor as M}from"wendang/shared";import{MIND_ICONS as D,MIND_COLORS as z,MIND_BACKGROUNDS as L,branchModel as P,searchMindMap as E,parseMindMapImport as T,importBranch as A,mindMapTemplate as _,parseMindBranch as $,ancestorIds as K}from"wendang/internal/mind-map-phase2";import{normalizeMindFolds as j,firstLevelMindFolds as B}from"wendang/internal/mind-map-folding";import{p as R}from"./mind-map-delete-CVsxdXfs.js";import{mindMapDescendants as W}from"wendang/internal/mind-map";import{m as U,s as F}from"./mind-map-input-CEWRz_t6.js";import{createPortal as G}from"react-dom";import{u as H}from"./hooks-C53Dp0pr.js";import{a as Y,c as O,W as X,d as q}from"./index-COeA2QcQ.js";import{T as J,A as V}from"./mind-topic-text-
|
|
1
|
+
"use client";import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{c as i,b as l,a as o}from"./i18n-B0kCsIjc.js";import{useState as a,useRef as r,useEffect as d,useMemo as c}from"react";import{textDifference as s,mindMapTree as u,layoutMindMap as m,MIND_MAP_PALETTE as h,mindMapDescendants as p,projectMindSideMove as v,mindMapBranchSides as f,mindMapOutline as g,mindRelationPaths as b,mindMapMarkdown as y,mindMapSvg as w,mindMapToJson as x,MIND_MAP_MAX_TOPICS as k}from"wendang/mindmap";import{TEXT_COLORS as C,HIGHLIGHT_COLORS as N,mindTopicLineHeight as I,MIND_TOPIC_FONT as S,readableTextColor as M}from"wendang/shared";import{MIND_ICONS as D,MIND_COLORS as z,MIND_BACKGROUNDS as L,branchModel as P,searchMindMap as E,parseMindMapImport as T,importBranch as A,mindMapTemplate as _,parseMindBranch as $,ancestorIds as K}from"wendang/internal/mind-map-phase2";import{normalizeMindFolds as j,firstLevelMindFolds as B}from"wendang/internal/mind-map-folding";import{p as R}from"./mind-map-delete-CVsxdXfs.js";import{mindMapDescendants as W}from"wendang/internal/mind-map";import{m as U,s as F}from"./mind-map-input-CEWRz_t6.js";import{createPortal as G}from"react-dom";import{u as H}from"./hooks-C53Dp0pr.js";import{a as Y,c as O,W as X,d as q}from"./index-COeA2QcQ.js";import{T as J,A as V}from"./mind-topic-text-C7pIS6L9.js";import{W as Q}from"./Dropdown-D98tXfe0.js";import{A as Z}from"./AnchoredPanel-C7jMoPze.js";function topicsInMarquee(e,t,n=[]){const i=new Set(e.map(e=>e.id)),l=new Set([...n].filter(e=>i.has(e)));if(t.width<=0||t.height<=0)return l;for(const n of e)n.x<t.x+t.width&&n.x+n.width>t.x&&n.y<t.y+t.height&&n.y+n.height>t.y&&l.add(n.id);return l}function MindMapComments({pageId:n,blockId:o,topicId:c,topicLabel:s,canComment:u,onClose:m,onChanged:h}){const p=i(),v=p.text,f=l(),[g,b]=a([]),[y,w]=a(""),[x,k]=a(""),[C,N]=a(!1),[I,S]=a(!0),[M,D]=a(null),[z,L]=a(null),[P,E]=a(0),T=r(!0),A=r(!1);async function perform(e){if(!A.current){A.current=!0,N(!0),k("");try{await e(),null==h||h(),T.current&&(w(""),D(null),E(e=>e+1))}catch(e){T.current&&k(String(e))}finally{A.current=!1,T.current&&N(!1)}}}d(()=>(T.current=!0,()=>{T.current=!1}),[]),d(()=>{let e=!0;if(w(""),D(null),L(null),k(""),S(!0),f.comments)return f.comments.list(n).then(t=>{e&&b(t.items.filter(e=>{var t,n;return(null==(t=e.anchor)?void 0:t.prefix)===`mind:${o}`&&(null==(n=e.anchor)?void 0:n.suffix)===c}))}).catch(t=>{e&&k(String(t))}).finally(()=>{e&&S(!1)}),()=>{e=!1};S(!1)},[f.comments,n,o,c,P]);const _=s.trim()?`「${s.trim()}」`:v("当前主题"),time=e=>{const t=new Date(e);return Number.isNaN(t.getTime())?"":t.toLocaleString(p.locale)};function compose(i){if(!M||M.id!==i.id)return null;const l="edit"===M.kind;/* @__PURE__ */
|
|
2
2
|
return e("form",{className:"mind-comment__compose",onSubmit:e=>{e.preventDefault(),M.text.trim()&&(l||u)&&perform(()=>l?f.comments.update(M.id,M.text.trim()):f.comments.create(n,M.text.trim(),M.id))},children:[
|
|
3
3
|
/* @__PURE__ */t("label",{className:"mind-comment__label",children:l?v("正在编辑评论"):v("回复 {0}",{0:i.authorName})}),
|
|
4
4
|
/* @__PURE__ */t("textarea",{"aria-label":v(l?"编辑主题讨论":"回复主题讨论"),rows:l?3:2,maxLength:5e3,value:M.text,onChange:e=>D({...M,text:e.target.value})}),
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import{c as n,b as i}from"./i18n-B0kCsIjc.js";import{useState as o,useEffect as a,Suspense as d,useRef as l,lazy as r}from"react";import{readMindMap as s,mindMapOutline as c,MIND_MAP_PALETTE as h,layoutMindMap as m,mindRelationPaths as p}from"wendang/mindmap";import{MIND_TOPIC_FONT as u,mindTopicLineHeight as v,readableTextColor as w}from"wendang/shared";import{a as f}from"./index-COeA2QcQ.js";import{T as g,A as b}from"./mind-topic-text-
|
|
2
|
-
return e("div",{ref:k,className:"mind-preview-wrap",style:{height:S},role:"group","aria-label":(null==(c=x.topics.find(e=>e.id===x.rootId))?void 0:c.text)||f("思维导图"),children:/* @__PURE__ */e("div",{className:"mind-preview-sized",style:{width:
|
|
3
|
-
/* @__PURE__ */t("svg",{className:"mind-preview-lines",width:
|
|
1
|
+
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import{c as n,b as i}from"./i18n-B0kCsIjc.js";import{useState as o,useEffect as a,Suspense as d,useRef as l,lazy as r}from"react";import{readMindMap as s,mindMapOutline as c,MIND_MAP_PALETTE as h,layoutMindMap as m,mindRelationPaths as p}from"wendang/mindmap";import{MIND_TOPIC_FONT as u,mindTopicLineHeight as v,readableTextColor as w}from"wendang/shared";import{a as f}from"./index-COeA2QcQ.js";import{T as g,A as b}from"./mind-topic-text-C7pIS6L9.js";const x=r(()=>import("./MindMapCanvas-BA3FYy8p.js").then(e=>({default:e.MindMapCanvas})));function MindMapViewer({value:i,modelValue:d,height:r,fetchAttachment:s}){var c;const f=n().text,x=i??d,k=l(null),[C,M]=o(900);if(a(()=>{const e=k.current;if(!e||"undefined"==typeof ResizeObserver)return;M(e.clientWidth||900);const t=new ResizeObserver(e=>{var t;return M((null==(t=e[0])?void 0:t.contentRect.width)||900)});return t.observe(e),()=>t.disconnect()},[]),!x)/* @__PURE__ */return e("p",{role:"alert",children:f("思维导图格式无效")});const y=m(x),N=p(x,y),I=h[x.theme],S=r??x.height,A=Math.min(1,(S-30)/y.bounds.height,Math.max(100,C-24)/y.bounds.width);/* @__PURE__ */
|
|
2
|
+
return e("div",{ref:k,className:"mind-preview-wrap",style:{height:S},role:"group","aria-label":(null==(c=x.topics.find(e=>e.id===x.rootId))?void 0:c.text)||f("思维导图"),children:/* @__PURE__ */e("div",{className:"mind-preview-sized",style:{width:y.bounds.width*A,height:y.bounds.height*A},children:/* @__PURE__ */t("div",{className:"mind-preview-scene",style:{width:y.bounds.width,height:y.bounds.height,transform:`scale(${A})`},children:[
|
|
3
|
+
/* @__PURE__ */t("svg",{className:"mind-preview-lines",width:y.bounds.width,height:y.bounds.height,viewBox:`${y.bounds.x} ${y.bounds.y} ${y.bounds.width} ${y.bounds.height}`,children:[y.edges.map(t=>/* @__PURE__ */e("path",{d:t.path,fill:"none",stroke:I,strokeWidth:2},t.id)),N.map(n=>/* @__PURE__ */t("g",{children:[
|
|
4
4
|
/* @__PURE__ */e("path",{d:n.path,fill:"none",stroke:"#9a68d4",strokeWidth:2,strokeDasharray:"6 4"}),
|
|
5
|
-
/* @__PURE__ */e("text",{x:n.x,y:n.y,fontSize:12,fill:"#9a68d4",children:n.label||{related:f("相关"),depends:f("依赖"),reference:f("参考")}[n.kind]})]},n.id))]}),
|
|
6
|
-
/* @__PURE__ */e("span",{className:"mind-preview-title",style:{minHeight:n.lines.length*v(n.fontSize||14),lineHeight:`${v(n.fontSize||14)}px`},children:/* @__PURE__ */e(g,{topic:n})}),n.description&&/* @__PURE__ */e("span",{className:"mind-preview-description",children:n.description}),n.note&&/* @__PURE__ */e("span",{className:"mind-preview-note",title:n.note,children:f("▤ 备注")}),n.attachmentId&&/* @__PURE__ */e("div",{className:"mind-preview-image",children:/* @__PURE__ */e(b,{id:n.attachmentId,alt:f("主题图片"),fetcher:s})})]},n.id))]})})})}function MindMapBlock(l){const r=n(),m=r.text,p=i(),u=l.controller,[v,w]=o(!1),[g,b]=o(!1),[k,C]=o(!1),[,M]=o(0),
|
|
5
|
+
/* @__PURE__ */e("text",{x:n.x,y:n.y,fontSize:12,fill:"#9a68d4",children:n.label||{related:f("相关"),depends:f("依赖"),reference:f("参考")}[n.kind]})]},n.id))]}),y.nodes.map(n=>/* @__PURE__ */t("div",{className:`mind-preview-topic ${n.id===x.rootId?"root":""} ${"text"===n.shape?"text":""}`,style:{left:n.x-y.bounds.x,top:n.y-y.bounds.y,width:n.width,minHeight:n.height,fontFamily:u,borderRadius:"pill"===n.shape?28:void 0,background:"text"===n.shape?"transparent":n.background||void 0,color:n.color||("text"===n.shape?"var(--color-text)":n.background?w(n.background):void 0),fontSize:n.fontSize||14,textAlign:n.align||"center","--mind-color":I},children:[(n.icon||n.done)&&/* @__PURE__ */t("span",{className:"mind-preview-icon",children:[n.done?"☑ ":"",n.icon]}),
|
|
6
|
+
/* @__PURE__ */e("span",{className:"mind-preview-title",style:{minHeight:n.lines.length*v(n.fontSize||14),lineHeight:`${v(n.fontSize||14)}px`},children:/* @__PURE__ */e(g,{topic:n})}),n.description&&/* @__PURE__ */e("span",{className:"mind-preview-description",children:n.description}),n.note&&/* @__PURE__ */e("span",{className:"mind-preview-note",title:n.note,children:f("▤ 备注")}),n.attachmentId&&/* @__PURE__ */e("div",{className:"mind-preview-image",children:/* @__PURE__ */e(b,{id:n.attachmentId,alt:f("主题图片"),fetcher:s})})]},n.id))]})})})}function MindMapBlock(l){const r=n(),m=r.text,p=i(),u=l.controller,[v,w]=o(!1),[g,b]=o(!1),[k,C]=o(!1),[,M]=o(0),y=l.node??l.value??l.modelValue,N=u?u.snapshot():y?s(y):null,I=(null==u?void 0:u.editable())??!1,S=N?c(N):[];function show(){N&&(w(!0),(null==u?void 0:u.context.viewState)&&(u.context.viewState.openId=N.id))}return a(()=>{const e=null==u?void 0:u.subscribe(()=>{M(e=>e+1),u.snapshot()||w(!1)});return()=>{null==e||e()}},[u]),a(()=>{var e;if((null==(e=null==u?void 0:u.context.viewState)?void 0:e.openId)===(null==N?void 0:N.id)&&show(),!p.location||!N)return;const linked=()=>{const e=new URLSearchParams(p.location.current().replace(/^#/,""));e.get("mind")===N.id&&e.has("topic")&&show()};return linked(),p.location.subscribe(linked)},[p.location,null==N?void 0:N.id,u]),N?/* @__PURE__ */t("section",{className:"mind-map-block","aria-label":m("思维导图"),style:{"--mind-color":h[N.theme]},onDoubleClick:e=>{e.stopPropagation(),show()},children:[
|
|
7
7
|
/* @__PURE__ */t("header",{className:"mind-map-block-header",children:[
|
|
8
8
|
/* @__PURE__ */t("span",{className:"mind-map-block-label",children:[
|
|
9
9
|
/* @__PURE__ */e("span",{"aria-hidden":"true",children:"⌘"})," ",m("思维导图")," ",
|
|
10
|
-
/* @__PURE__ */e("span",{className:"mind-map-topic-count",children:r.t("mind.topicCount",{count:
|
|
10
|
+
/* @__PURE__ */e("span",{className:"mind-map-topic-count",children:r.t("mind.topicCount",{count:N.topics.length})})]}),
|
|
11
11
|
/* @__PURE__ */t("div",{className:"mind-map-block-actions",children:[p.comments&&l.pageId&&/* @__PURE__ */e(f,{variant:"text",onClick:()=>{C(!0),show()},children:m(I?"讨论":"查看讨论")}),
|
|
12
12
|
/* @__PURE__ */e(f,{variant:"text",onClick:()=>b(!g),children:m(g?"查看导图":"文字大纲")}),
|
|
13
|
-
/* @__PURE__ */e(f,{variant:"text",onClick:show,children:I?m("编辑导图"):"放大查看"})]})]}),g?/* @__PURE__ */e("div",{className:"mind-map-preview-outline",style:{maxHeight:
|
|
13
|
+
/* @__PURE__ */e(f,{variant:"text",onClick:show,children:I?m("编辑导图"):"放大查看"})]})]}),g?/* @__PURE__ */e("div",{className:"mind-map-preview-outline",style:{maxHeight:N.height},children:S.map(t=>/* @__PURE__ */e("div",{style:{paddingLeft:18*Math.min(t.depth,20)},children:t.text||m("未命名主题")},t.id))}):/* @__PURE__ */e(MindMapViewer,{value:N,fetchAttachment:l.fetchAttachment??(null==u?void 0:u.context.fetchAttachment)}),v&&/* @__PURE__ */e(d,{fallback:/* @__PURE__ */e("p",{role:"status",children:m("正在加载导图…")}),children:/* @__PURE__ */e(x,{model:N,controller:u,pageId:l.pageId,canComment:l.canComment,allowExport:l.allowExport,fetchAttachment:l.fetchAttachment,openComments:k,onCommentsChanged:l.onCommentsChanged,onClose:function close(){w(!1),C(!1);const e=null==u?void 0:u.context.viewState;e&&e.openId===(null==N?void 0:N.id)&&(e.openId=null)}})})]}):/* @__PURE__ */e("p",{role:"alert",children:m("思维导图格式无效")})}export{MindMapBlock as M,MindMapViewer as a};
|