showai-reader 0.0.0-stage → 0.9.0-reader.cppyr4f7
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/LICENSE +21 -0
- package/README.md +9 -2
- package/chunks/ComparisonMatrix-YQJRBJHK.js +1 -0
- package/chunks/ExperimentTracker-L4ERILSH.js +1 -0
- package/chunks/ExternalDiagram-CESN6AFD.js +27619 -0
- package/chunks/Flowchart-7I3IRBXN.js +10 -0
- package/chunks/Flowchart-7I3IRBXN.js.LEGAL.txt +4 -0
- package/chunks/G2Chart-N3VN7CJU.js +1218 -0
- package/chunks/G2Chart-N3VN7CJU.js.LEGAL.txt +85 -0
- package/chunks/Mindmap-H2BMB2CH.js +2 -0
- package/chunks/RichTextEditor-XPGN2LUL.js +155 -0
- package/chunks/Scene3D-RIDB2UPZ.js +4222 -0
- package/chunks/Scene3D-RIDB2UPZ.js.LEGAL.txt +9 -0
- package/chunks/StatusTree-DE6SBNV3.js +1 -0
- package/chunks/chunk-24VJITFC.js +2 -0
- package/chunks/chunk-77DN5DLU.js +1 -0
- package/chunks/chunk-7GHGKKPY.js +2 -0
- package/chunks/chunk-C4JCEMQN.js +1 -0
- package/chunks/chunk-DG67SWQA.js +1 -0
- package/chunks/chunk-DUIGVKKG.js +1 -0
- package/chunks/chunk-EJKNO2TI.js +2 -0
- package/chunks/chunk-KF47DKNH.js +1 -0
- package/chunks/chunk-KS3LLFYE.js +326 -0
- package/chunks/chunk-LY26FKQZ.js +1 -0
- package/chunks/chunk-M3KEZP5Z.js +1 -0
- package/chunks/chunk-P5ET5XMK.js +1 -0
- package/chunks/chunk-QBNRB4AJ.js +1 -0
- package/chunks/chunk-UYGYV3XW.js +2 -0
- package/chunks/chunk-UYGYV3XW.js.LEGAL.txt +23 -0
- package/chunks/chunk-WDYURK6F.js +1 -0
- package/chunks/chunk-X2BFI7UA.js +1 -0
- package/chunks/chunk-Z2EQGXZF.js +21 -0
- package/chunks/chunk-Z2EQGXZF.js.LEGAL.txt +166 -0
- package/chunks/chunk-ZZKYSVG3.js +2 -0
- package/chunks/pdf-engine-PQMJ3BVE.js +107 -0
- package/index.js +1 -0
- package/manifest.json +9 -0
- package/package.json +17 -4
- package/reader-CPPYR4F7.js +41 -0
- package/reader-CPPYR4F7.js.LEGAL.txt +34 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
Bundled license information:
|
|
2
|
+
|
|
3
|
+
html2canvas/dist/html2canvas.js:
|
|
4
|
+
/*!
|
|
5
|
+
* html2canvas 1.4.1 <https://html2canvas.hertzen.com>
|
|
6
|
+
* Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>
|
|
7
|
+
* Released under MIT License
|
|
8
|
+
*/
|
|
9
|
+
/*! *****************************************************************************
|
|
10
|
+
Copyright (c) Microsoft Corporation.
|
|
11
|
+
|
|
12
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
13
|
+
purpose with or without fee is hereby granted.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
16
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
17
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
18
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
19
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
20
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
21
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
22
|
+
***************************************************************************** */
|
|
23
|
+
|
|
24
|
+
@antv/g-math/dist/index.esm.js:
|
|
25
|
+
/*!
|
|
26
|
+
* @antv/g-math
|
|
27
|
+
* @description Geometry util
|
|
28
|
+
* @version 3.1.0
|
|
29
|
+
* @date 12/22/2025, 3:02:36 AM
|
|
30
|
+
* @author AntVis
|
|
31
|
+
* @docs https://g.antv.antgroup.com/
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
@babel/runtime/helpers/esm/regenerator.js:
|
|
35
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
36
|
+
|
|
37
|
+
@antv/g-lite/dist/index.esm.js:
|
|
38
|
+
/*!
|
|
39
|
+
* @antv/g-lite
|
|
40
|
+
* @description A core module for rendering engine implements DOM API.
|
|
41
|
+
* @version 2.7.0
|
|
42
|
+
* @date 12/24/2025, 11:55:20 AM
|
|
43
|
+
* @author AntVis
|
|
44
|
+
* @docs https://g.antv.antgroup.com/
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
@antv/g/dist/index.esm.js:
|
|
48
|
+
/*!
|
|
49
|
+
* @antv/g
|
|
50
|
+
* @description A core module for rendering engine implements DOM API.
|
|
51
|
+
* @version 6.3.1
|
|
52
|
+
* @date 12/24/2025, 11:55:39 AM
|
|
53
|
+
* @author AntVis
|
|
54
|
+
* @docs https://g.antv.antgroup.com/
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
@antv/g-canvas/dist/index.esm.js:
|
|
58
|
+
/*!
|
|
59
|
+
* @antv/g-canvas
|
|
60
|
+
* @description A renderer implemented by Canvas 2D API
|
|
61
|
+
* @version 2.2.0
|
|
62
|
+
* @date 12/24/2025, 11:55:53 AM
|
|
63
|
+
* @author AntVis
|
|
64
|
+
* @docs https://g.antv.antgroup.com/
|
|
65
|
+
*/
|
|
66
|
+
|
|
67
|
+
@antv/g-plugin-dragndrop/dist/index.esm.js:
|
|
68
|
+
/*!
|
|
69
|
+
* @antv/g-plugin-dragndrop
|
|
70
|
+
* @description A G plugin for Drag n Drop implemented with PointerEvents
|
|
71
|
+
* @version 2.1.1
|
|
72
|
+
* @date 12/24/2025, 11:56:44 AM
|
|
73
|
+
* @author AntVis
|
|
74
|
+
* @docs https://g.antv.antgroup.com/
|
|
75
|
+
*/
|
|
76
|
+
|
|
77
|
+
@antv/g-svg/dist/index.esm.js:
|
|
78
|
+
/*!
|
|
79
|
+
* @antv/g-svg
|
|
80
|
+
* @description A renderer implemented by SVG
|
|
81
|
+
* @version 2.1.1
|
|
82
|
+
* @date 12/24/2025, 11:57:09 AM
|
|
83
|
+
* @author AntVis
|
|
84
|
+
* @docs https://g.antv.antgroup.com/
|
|
85
|
+
*/
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as S,b as X,c as O,d as he,e as fe,f as ge,g as ye,h as we}from"./chunk-DG67SWQA.js";import{a as ve}from"./chunk-ZZKYSVG3.js";import{d as Ne,e as Ce}from"./chunk-X2BFI7UA.js";import{$a as ue,Ba as A,Fa as ce,a as ae,ab as pe,c as Te,cb as me,hb as be,ka as re,kb as ke,pa as se,ra as le,va as de,z as ie}from"./chunk-Z2EQGXZF.js";import{c as W,d as xe}from"./chunk-DUIGVKKG.js";var r=W(Te(),1);var Le=xe("mindmap",{"zh-CN":{mindmap:"\u601D\u7EF4\u5BFC\u56FE",enterNodeName:"\u8BF7\u8F93\u5165\u8282\u70B9\u540D\u79F0\u3002",nodeLimit:"\u601D\u7EF4\u5BFC\u56FE\u6700\u591A\u652F\u6301 {count} \u4E2A\u8282\u70B9\u3002",radialLayout:"\u56DB\u5468\u5C55\u5F00",treeLayout:"\u5355\u5411\u5C55\u5F00","treeLayout.right":"\u5355\u5411\u5C55\u5F00\uFF0C\u5F53\u524D\u5411\u53F3","treeLayout.left":"\u5355\u5411\u5C55\u5F00\uFF0C\u5F53\u524D\u5411\u5DE6","treeLayout.rightToggle":"\u5355\u5411\u5C55\u5F00\uFF0C\u5F53\u524D\u5411\u53F3\uFF1B\u518D\u6B21\u70B9\u51FB\u5207\u6362\u5411\u5DE6","treeLayout.leftToggle":"\u5355\u5411\u5C55\u5F00\uFF0C\u5F53\u524D\u5411\u5DE6\uFF1B\u518D\u6B21\u70B9\u51FB\u5207\u6362\u5411\u53F3",nodes:"\u5BFC\u56FE\u8282\u70B9",nodeName:"\u8282\u70B9\u540D\u79F0",view:"\u601D\u7EF4\u5BFC\u56FE\u89C6\u56FE",zoomOut:"\u7F29\u5C0F\u601D\u7EF4\u5BFC\u56FE",fit:"\u663E\u793A\u5B8C\u6574\u601D\u7EF4\u5BFC\u56FE",zoomIn:"\u653E\u5927\u601D\u7EF4\u5BFC\u56FE",nodeActions:"\u601D\u7EF4\u5BFC\u56FE\u8282\u70B9\u64CD\u4F5C",editNode:"\u7F16\u8F91\u8282\u70B9",newChild:"\u65B0\u5EFA\u5B50\u8282\u70B9",child:"\u5B50\u8282\u70B9",newSibling:"\u65B0\u5EFA\u540C\u7EA7\u8282\u70B9",sibling:"\u540C\u7EA7",expandBranch:"\u5C55\u5F00\u5206\u652F",collapseBranch:"\u6298\u53E0\u5206\u652F",toggleBranch:"\u6298\u53E0 / \u5C55\u5F00",undoAction:"\u64A4\u9500\u5BFC\u56FE\u64CD\u4F5C",undo:"\u64A4\u9500",redoAction:"\u91CD\u505A\u5BFC\u56FE\u64CD\u4F5C",redo:"\u91CD\u505A",deleteNodeAndChildren:"\u5220\u9664\u8282\u70B9\u53CA\u5176\u5B50\u8282\u70B9",deleteBranch:"\u5220\u9664\u5206\u652F"},en:{mindmap:"Mind map",enterNodeName:"Enter a node name.",nodeLimit:"A mind map can have up to {count} nodes.",radialLayout:"Radial layout",treeLayout:"One-way layout","treeLayout.right":"One-way layout, currently to the right","treeLayout.left":"One-way layout, currently to the left","treeLayout.rightToggle":"One-way layout, currently to the right. Click again to switch to the left.","treeLayout.leftToggle":"One-way layout, currently to the left. Click again to switch to the right.",nodes:"Mind map nodes",nodeName:"Node name",view:"Mind map view",zoomOut:"Zoom out mind map",fit:"Show entire mind map",zoomIn:"Zoom in mind map",nodeActions:"Mind map node actions",editNode:"Edit node",newChild:"New child node",child:"Child",newSibling:"New sibling node",sibling:"Sibling",expandBranch:"Expand branch",collapseBranch:"Collapse branch",toggleBranch:"Collapse / expand",undoAction:"Undo mind map change",undo:"Undo",redoAction:"Redo mind map change",redo:"Redo",deleteNodeAndChildren:"Delete node and its children",deleteBranch:"Delete branch"}});ae(`.sm-block{position:relative}.sm-viewport{overflow:auto;overscroll-behavior-x:contain;border-radius:8px;background:radial-gradient(var(--sb-line) .6px,transparent .6px) 0 0 / 20px 20px}.sm-scroll-space{position:relative;display:flex;justify-content:center;align-items:center}.sm-map{position:absolute;flex:none;transform-origin:top left}.sm-connections{position:absolute;inset:0;width:100%!important;height:100%!important;overflow:visible;pointer-events:none}.sm-connections path{fill:none;stroke:var(--sm-branch);stroke-width:2;opacity:.7}.sm-branch-0{--sm-branch: #5f8b78}.sm-branch-1{--sm-branch: #6b89b7}.sm-branch-2{--sm-branch: #c38b55}.sm-branch-3{--sm-branch: #ab7890}.sm-branch-4{--sm-branch: #8580b5}.sm-branch-5{--sm-branch: #789c9f}.sm-node-wrap{position:absolute}.sm-block .sm-node,.sm-block .sm-node-input{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:var(--sm-node-height);padding:10px 16px;border:1.5px solid var(--sm-branch, var(--sb-accent));border-radius:9px;background:var(--sb-surface);color:var(--sb-text);font:inherit;font-size:14px;line-height:20px;text-align:center;box-shadow:0 2px 8px #00000005}.sm-node span:first-child{overflow-wrap:anywhere;white-space:pre-wrap}.sm-node:hover{background:color-mix(in srgb,var(--sm-branch, var(--sb-accent)) 8%,var(--sb-surface))}.sm-node.is-selected,.sm-node:focus-visible,.sm-node-input:focus{outline:3px solid color-mix(in srgb,var(--sm-branch, var(--sb-accent)) 30%,transparent);outline-offset:3px}.sm-root .sm-node{background:var(--sb-accent);color:var(--sb-surface);border-color:var(--sb-accent);font-weight:600}.sm-count{flex:none;font-size:11px;border-radius:4px;padding:1px 4px;background:var(--sb-soft);color:var(--sb-muted)}.sm-footer{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:10px 2px 0;color:var(--sb-muted);font-size:11px}.sm-view-controls{display:flex;flex:none;gap:2px}.sm-view-controls button{display:flex;align-items:center;justify-content:center;gap:6px;min-width:28px;height:28px;border-radius:4px}.sm-view-controls button:hover{background:var(--sb-soft)}.sm-notice{color:var(--sb-accent);font-size:12px}@media print{.sm-footer,.sm-notice{display:none}.sm-viewport{overflow:visible;background:none}}.sm-block .sm-root .sm-node:hover{background:var(--sb-accent);color:var(--sb-surface)}.editor-bubble[data-editor-keyboard-scope=mindmap]{--editor-line: var(--line);--editor-soft: var(--accent-soft);font-family:var( --font-sans, -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif );font-size:12px;font-weight:400;line-height:1;letter-spacing:0}.editor-bubble[data-editor-keyboard-scope=mindmap] .editor-tool{font:inherit}.editor-bubble[data-editor-keyboard-scope=mindmap] .sm-labeled-action{width:auto;padding:0 7px;gap:4px;color:var(--text);white-space:nowrap}.editor-bubble[data-editor-keyboard-scope=mindmap] .editor-tool svg{display:block;flex:none}.sm-block>.sb-header>.sb-actions{flex-wrap:nowrap;gap:2px;border:1px solid var(--sb-line);box-shadow:0 2px 8px #00000008;pointer-events:none}.sm-block:hover>.sb-header>.sb-actions,.sm-block>.sb-header>.sb-actions:focus-within{opacity:1;pointer-events:auto}.sm-block>.sb-header.has-caption>.sb-heading{padding-right:78px}.sm-block .sb-actions .sb-icon-button[aria-pressed=true]{color:var(--sb-accent);background:var(--sb-accent-soft)}body:has([role=menu]) .sm-block>.sb-header>.sb-actions{opacity:0;pointer-events:none}@media(hover:none){.sm-block>.sb-header>.sb-actions{opacity:1;pointer-events:auto}}@media print{.sm-block>.sb-header>.sb-actions{display:none}}
|
|
2
|
+
`);var t=W(be(),1);function Je({data:Z,onChange:R,readOnly:Me=!1}){let a=ke(Le),n=(0,r.useMemo)(()=>X(Z),[Z]),d=!Me&&!!R,L=n.nodes.find(e=>e.parentId===null),[i,M]=(0,r.useState)(L.id),[H,k]=(0,r.useState)(!1),[c,z]=(0,r.useState)(null),D=(0,r.useRef)(null),K=(0,r.useRef)(!0),[Ee,Se]=(0,r.useState)(null),[_,ze]=(0,r.useState)(null),f=!d&&_?.layout||n.layout||"radial",g=!d&&_?.direction||n.direction||"right",x=Ee??new Set(n.nodes.filter(e=>e.collapsed).map(e=>e.id)),u=(0,r.useMemo)(()=>ye({...n,layout:f,direction:g},x),[n,f,g,JSON.stringify([...x])]),[h,P]=(0,r.useState)(1),[q,$]=(0,r.useState)(null),G=(0,r.useRef)(null),E=(0,r.useRef)(null),v=(0,r.useRef)(null),N=(0,r.useRef)(new Map),U=(0,r.useId)(),p=(0,r.useRef)({past:[],future:[],expected:null}),[Q,F]=(0,r.useState)(""),y=n.nodes.find(e=>e.id===i)??L,Y=O(n,y.id).length>0,ee=()=>{let e=E.current;e&&P(Math.max(.15,Math.min(1,(e.clientWidth-20)/u.width,(e.clientHeight-20)/u.height)))};(0,r.useLayoutEffect)(ee,[f,g]),(0,r.useEffect)(()=>{let e=JSON.stringify(n);p.current.expected!==null&&p.current.expected!==e&&(p.current.past=[],p.current.future=[]),p.current.expected=e},[n]),(0,r.useEffect)(()=>{!u.nodes.some(e=>e.id===i)&&c?.id!==i&&M(L.id)},[u,i,L.id,c?.id]);let w=e=>{M(e),requestAnimationFrame(()=>{let o=N.current.get(e);o?.focus({preventScroll:!0}),o?.scrollIntoView({block:"nearest",inline:"nearest"})})};(0,r.useLayoutEffect)(()=>{c&&(v.current?.focus(),K.current?v.current?.select():v.current?.setSelectionRange(c.value.length,c.value.length),v.current?.scrollIntoView({block:"nearest",inline:"nearest"}))},[c?.id,n.nodes.length]),(0,r.useLayoutEffect)(()=>{if(!H||c||!d){$(null);return}let e=()=>{let s=N.current.get(i),l=E.current;if(!s||!l)return;let m=s.getBoundingClientRect(),b=l.getBoundingClientRect();$(m.bottom<b.top||m.top>b.bottom||m.right<b.left||m.left>b.right?null:{left:Math.max(b.left,Math.min(b.right,m.left+m.width/2)),top:Math.max(b.top,m.top)})};e(),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e);let o=new ResizeObserver(e);return E.current&&o.observe(E.current),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e),o.disconnect()}},[H,c,d,i,u,h]);let C=e=>{!d||e===n||(X(e),p.current.past=[...p.current.past.slice(-99),n],p.current.future=[],p.current.expected=JSON.stringify(e),F(""),R?.(e))},te=e=>{let o=e==="tree"&&f==="tree"?g==="right"?"left":"right":g;e===f&&o===g||(d?C({...n,layout:e,direction:o}):ze({layout:e,direction:o}))},I=(e=!1)=>{let s=(e?p.current.future:p.current.past).pop();!s||!d||((e?p.current.past:p.current.future).push(n),p.current.expected=JSON.stringify(s),R?.(s),w(s.nodes.some(l=>l.id===i)?i:L.id))},T=(e=i,o)=>{if(!d)return;let s=n.nodes.find(l=>l.id===e);s&&(D.current=e,K.current=o===void 0,$(null),z({id:e,value:o??s.label}))},J=(e=!1)=>{if(!c||D.current!==c.id)return;let o=c.value.trim();if(!e&&!o){F(a("enterNodeName")),v.current?.focus();return}D.current=null,z(null),!e&&o!==n.nodes.find(s=>s.id===c.id)?.label&&C({...n,nodes:n.nodes.map(s=>s.id===c.id?{...s,label:o}:s)}),w(c.id)},B=(e,o=!1)=>{if(!d)return;if(n.nodes.length>=S){F(a("nodeLimit",{count:S}));return}let s=crypto.randomUUID(),l=he(n,i,s,e,o);C(l),M(s),D.current=s,K.current=!0,z({id:s,value:l.nodes.find(m=>m.id===s).label})},ne=()=>{!d||y.parentId===null||(C(fe(n,i)),w(y.parentId))},V=()=>{if(!Y)return;let e=new Set(x);e.has(i)?e.delete(i):e.add(i),d?C({...n,nodes:n.nodes.map(o=>o.id===i?{...o,collapsed:e.has(i)}:o)}):Se(e),w(i)},De=e=>{if(e.nativeEvent.isComposing||e.keyCode===229||e.target.closest("input, .sm-view-controls"))return;let o=e.metaKey||e.ctrlKey,s=e.target.closest(".editor-bubble")?.id===U,l=e.target.closest(".sb-header .sb-actions");if(s||l?!o:!e.target.closest(".sm-node"))return;let m=!0;if(o&&e.key.toLowerCase()==="z"&&d)I(e.shiftKey);else if(o&&e.key.toLowerCase()==="y"&&d)I(!0);else if(o||e.altKey)m=!1;else if(e.key==="Tab"&&d&&!e.shiftKey)B("child");else if(e.key==="Tab"&&d&&e.shiftKey)C(ge(n,i)),w(i);else if(e.key==="Enter"&&d)B("sibling",e.shiftKey);else if(e.key==="F2"&&d)T();else if((e.key==="Delete"||e.key==="Backspace")&&d)ne();else if(e.key===" ")V();else if(e.key==="ArrowLeft")y.parentId&&w(y.parentId);else if(e.key==="ArrowRight")if(x.has(i))V();else{let b=O(n,i)[0];b&&w(b.id)}else if(e.key==="ArrowUp"||e.key==="ArrowDown"){let b=n.nodes.filter(j=>j.parentId===y.parentId),Ie=b.findIndex(j=>j.id===i),oe=b[Ie+(e.key==="ArrowUp"?-1:1)];oe&&w(oe.id)}else e.key==="Escape"?(k(!1),e.target.blur()):e.key.length===1&&d?T(i,e.key):m=!1;m&&(e.preventDefault(),e.stopPropagation())};return(0,t.jsxs)("section",{ref:G,className:"sb-block sm-block","aria-label":Ne(n.title,a("mindmap")),contentEditable:!1,"data-editor-keyboard-scope":"mindmap","data-mindmap-layout":f,"data-mindmap-direction":g,onClick:e=>e.stopPropagation(),onKeyDown:De,onFocus:e=>{e.target.closest(".sm-node, .sm-node-input")&&k(!0)},onBlur:e=>{!G.current?.contains(e.relatedTarget)&&!e.relatedTarget?.closest?.(`[id="${U}"]`)&&k(!1)},onContextMenu:()=>k(!1),children:[(0,t.jsxs)(Ce,{title:n.title,defaultTitle:"\u601D\u7EF4\u5BFC\u56FE",description:n.description,children:[(0,t.jsx)("button",{type:"button",className:"sb-icon-button","aria-label":a("radialLayout"),title:a("radialLayout"),"aria-pressed":f==="radial","data-surface-ui":!0,onMouseDown:e=>e.preventDefault(),onClick:()=>te("radial"),children:(0,t.jsx)(de,{size:16})}),(0,t.jsx)("button",{type:"button",className:"sb-icon-button","aria-label":a("treeLayout"),title:a(g==="right"?f==="tree"?"treeLayout.rightToggle":"treeLayout.right":f==="tree"?"treeLayout.leftToggle":"treeLayout.left"),"aria-pressed":f==="tree","data-surface-ui":!0,onMouseDown:e=>e.preventDefault(),onClick:()=>te("tree"),children:(0,t.jsx)(re,{size:16,style:{transform:g==="left"?"scaleX(-1)":void 0}})})]}),(0,t.jsx)("div",{ref:E,className:"sm-viewport",style:{height:n.height??460},children:(0,t.jsx)("div",{className:"sm-scroll-space",style:{width:u.width*h,height:u.height*h,minWidth:"100%",minHeight:"100%"},children:(0,t.jsxs)("div",{className:"sm-map",role:"tree","aria-label":a("nodes"),style:{width:u.width,height:u.height,transform:`scale(${h})`,left:`max(0px, calc(50% - ${u.width*h/2}px))`,top:`max(0px, calc(50% - ${u.height*h/2}px))`},children:[(0,t.jsx)("svg",{className:"sm-connections",width:u.width,height:u.height,"aria-hidden":"true",children:u.nodes.filter(e=>e.parentId).map(e=>{let o=u.nodes.find(s=>s.id===e.parentId);return(0,t.jsx)("path",{className:`sm-branch-${e.color}`,d:we(o,e)},e.id)})}),u.nodes.map(e=>{let o=O(n,e.id).length,s=c?.id===e.id;return(0,t.jsx)("div",{className:`sm-node-wrap sm-branch-${e.color}${e.parentId===null?" sm-root":""}`,style:{left:e.x,top:e.y,width:e.width,minHeight:e.height,"--sm-node-height":`${e.height}px`},children:s?(0,t.jsx)("input",{ref:v,className:"sm-node-input","aria-label":a("nodeName"),maxLength:200,value:c.value,onChange:l=>z({id:e.id,value:l.target.value}),onBlur:()=>J(),onKeyDown:l=>{l.stopPropagation(),!(l.nativeEvent.isComposing||l.keyCode===229)&&((l.key==="Enter"||l.key==="Tab")&&(l.preventDefault(),J()),l.key==="Escape"&&(l.preventDefault(),J(!0)))}}):(0,t.jsxs)("button",{type:"button",ref:l=>{l?N.current.set(e.id,l):N.current.delete(e.id)},className:`sm-node${H&&i===e.id?" is-selected":""}`,role:"treeitem","aria-level":e.depth+1,"aria-selected":i===e.id,"aria-expanded":o?!x.has(e.id):void 0,tabIndex:i===e.id?0:-1,onFocus:()=>M(e.id),onClick:l=>{l.currentTarget.focus({preventScroll:!0}),M(e.id),k(!0)},onDoubleClick:()=>T(e.id),children:[(0,t.jsx)("span",{children:e.label}),o>0&&x.has(e.id)&&(0,t.jsxs)("span",{className:"sm-count",children:["+",o]})]})},e.id)})]})})}),(0,t.jsx)("div",{className:"sm-footer",children:(0,t.jsxs)("div",{className:"sm-view-controls",role:"group","aria-label":a("view"),children:[(0,t.jsx)("button",{type:"button","aria-label":a("zoomOut"),disabled:h<=.15,onClick:()=>P(Math.max(.15,h/1.2)),children:(0,t.jsx)(le,{size:15})}),(0,t.jsxs)("button",{type:"button","aria-label":a("fit"),onClick:ee,children:[(0,t.jsx)(se,{size:15}),(0,t.jsxs)("span",{children:[Math.round(h*100),"%"]})]}),(0,t.jsx)("button",{type:"button","aria-label":a("zoomIn"),disabled:h>=2,onClick:()=>P(Math.min(2,h*1.2)),children:(0,t.jsx)(A,{size:15})})]})}),Q&&(0,t.jsx)("p",{role:"status",className:"sm-notice",children:Q}),q&&d&&!c&&(0,t.jsxs)(ve,{id:U,anchor:q,anchorElement:N.current.get(i),label:a("nodeActions"),keyboardScope:"mindmap",onEscape:()=>{k(!1),N.current.get(i)?.blur()},children:[(0,t.jsx)("button",{className:"editor-tool",type:"button","aria-label":a("editNode"),title:a("editNode"),onClick:()=>T(),children:(0,t.jsx)(pe,{size:16})}),(0,t.jsx)("span",{className:"toolbar-divider"}),(0,t.jsxs)("button",{className:"editor-tool sm-labeled-action",type:"button","aria-label":a("newChild"),title:a("newChild"),disabled:n.nodes.length>=S,onClick:()=>B("child"),children:[(0,t.jsx)(A,{size:16}),(0,t.jsx)("span",{children:a("child")})]}),(0,t.jsxs)("button",{className:"editor-tool sm-labeled-action",type:"button","aria-label":a("newSibling"),title:a("newSibling"),disabled:n.nodes.length>=S||y.parentId===null,onClick:()=>B("sibling"),children:[(0,t.jsx)(A,{size:16}),(0,t.jsx)("span",{children:a("sibling")})]}),(0,t.jsx)("button",{className:"editor-tool",type:"button","aria-label":x.has(i)?a("expandBranch"):a("collapseBranch"),title:a("toggleBranch"),disabled:!Y,onClick:V,children:(0,t.jsx)(ie,{size:16})}),(0,t.jsx)("button",{className:"editor-tool",type:"button","aria-label":a("undoAction"),title:a("undo"),disabled:!p.current.past.length,onClick:()=>I(),children:(0,t.jsx)(me,{size:16})}),(0,t.jsx)("button",{className:"editor-tool",type:"button","aria-label":a("redoAction"),title:a("redo"),disabled:!p.current.future.length,onClick:()=>I(!0),children:(0,t.jsx)(ce,{size:16})}),(0,t.jsx)("button",{className:"editor-tool",type:"button","aria-label":a("deleteNodeAndChildren"),title:a("deleteBranch"),disabled:y.parentId===null,onClick:ne,children:(0,t.jsx)(ue,{size:16})})]})]})}export{Je as MindmapBlock};
|