showai-reader 0.13.15-reader.ytq46wui → 0.13.16-reader.6m5ebdeb
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/README.md +2 -2
- package/chunks/{MultiLevelView-NDMQMWLQ.js → MultiLevelView-ZHIRKPVW.js} +1 -1
- package/chunks/RichTextEditor-FC2KCQQO.js +158 -0
- package/chunks/chunk-2RNYCCRC.js +1 -0
- package/chunks/{chunk-FTF6X2QC.js → chunk-RZVRGCWV.js} +1 -1
- package/chunks/chunk-Y6PMG2JD.js +8 -0
- package/index.js +1 -1
- package/manifest.json +4 -4
- package/package.json +1 -1
- package/{reader-YTQ46WUI.js → reader-6M5EBDEB.js} +45 -45
- package/chunks/RichTextEditor-QASVADBA.js +0 -158
- package/chunks/chunk-6IKOY4TJ.js +0 -8
- package/chunks/chunk-NFQ4LFVO.js +0 -1
- /package/{reader-YTQ46WUI.js.LEGAL.txt → reader-6M5EBDEB.js.LEGAL.txt} +0 -0
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# showai-reader
|
|
2
2
|
|
|
3
|
-
The [ShowAI](https://showai.renaissancemind.ai) page reader, built from ShowAI 0.13.
|
|
3
|
+
The [ShowAI](https://showai.renaissancemind.ai) page reader, built from ShowAI 0.13.16 as code-split ES modules. Inline conversation pages written by `render-artifact --cdn` import it and load each component's code only when the page uses it.
|
|
4
4
|
|
|
5
5
|
```js
|
|
6
|
-
const { mount } = await import("https://cdn.jsdelivr.net/npm/showai-reader@0.13.
|
|
6
|
+
const { mount } = await import("https://cdn.jsdelivr.net/npm/showai-reader@0.13.16-reader.6m5ebdeb/index.js");
|
|
7
7
|
mount(document.getElementById("page"), { artifact });
|
|
8
8
|
```
|
|
9
9
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as T}from"./chunk-
|
|
1
|
+
import{b as T}from"./chunk-2RNYCCRC.js";import{W as L,X as C,Y as h,Z as W,ra as D}from"./chunk-Y6PMG2JD.js";import"./chunk-FEW7E4O3.js";import"./chunk-6EV5YHDY.js";import"./chunk-AIBH6MTQ.js";import"./chunk-5CXEJMFJ.js";import{a as B}from"./chunk-CEZN4BVH.js";import"./chunk-JPBV5VSZ.js";import"./chunk-5AW2WUSZ.js";import{j as I}from"./chunk-B4EAMYXP.js";import{a as E,b as P,c as N}from"./chunk-263IJWXK.js";import{Fb as M,Ib as S,a as w,c as O}from"./chunk-OMUYOHPU.js";import{a as R}from"./chunk-J6IRWTF7.js";import{c as b}from"./chunk-DCANE7XH.js";var i=b(O(),1);var V=R("multiLevelView",{"zh-CN":{title:"\u591A\u7EA7\u7EC4\u4EF6\u89C6\u56FE",path:"\u5C42\u7EA7\u8DEF\u5F84",back:"\u8FD4\u56DE\u4E0A\u5C42"},en:{title:"Multilevel view",path:"Level path",back:"Back to parent"}});w(`.sb-block.mlv{border:1px solid var(--sb-line, #dfe3ea);border-radius:12px;overflow:hidden;background:var(--sb-surface, #fff);color:var(--sb-text, #263248);font:13px/1.5 -apple-system,BlinkMacSystemFont,PingFang SC,sans-serif;min-width:0}.mlv-nav{display:flex;align-items:center;gap:10px;padding:9px 12px;border-bottom:1px solid var(--sb-line, #dfe3ea)}.mlv-nav button{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;border:0;border-radius:6px;min-height:30px;background:transparent;color:inherit;font:inherit;padding:4px 7px;cursor:pointer}.mlv-nav>button{width:30px}.mlv-nav button:disabled{opacity:.25;cursor:default}.mlv-nav button:hover:not(:disabled){background:var(--sb-hover, #f1f4f9)}.mlv-path{display:flex;align-items:center;gap:9px;white-space:nowrap;overflow-x:auto;scrollbar-width:none;min-width:0}.mlv-path>span{opacity:.25}.mlv-path strong{font-weight:600;padding:4px 0}.mlv-view{padding:14px;min-width:0;outline:none;animation:mlv-in .24s ease both;transform-origin:center}.mlv-view[data-direction=out]{animation-name:mlv-out}.mlv-view:focus-visible{outline:2px solid #668aeb;outline-offset:-3px}.mlv button:focus-visible{outline:2px solid #668aeb;outline-offset:-2px}.mlv-view>.sb-block{margin:0}@keyframes mlv-in{0%{opacity:0;transform:scale(.975)}to{opacity:1;transform:scale(1)}}@keyframes mlv-out{0%{opacity:0;transform:scale(1.025)}to{opacity:1;transform:scale(1)}}@media(max-width:560px){.mlv-nav{padding:7px 8px;gap:5px}.mlv-path{gap:5px;font-size:12px}.mlv-view{padding:8px}}@media(prefers-reduced-motion:reduce){.mlv-view{animation:none!important}}
|
|
2
2
|
`);var n=b(M(),1);function A({level:a,choose:c,renderWidget:l}){let r=(o,m,u,v)=>{let f=a.bindings.filter(t=>C(a,t)===v);return(0,n.jsx)(B,{bindings:f.map(t=>({event:t.event??"activate",target:t.source,handle:()=>(c(t.to),{status:"handled"})})),children:l({kind:o,data:m,readOnly:!0,inline:u})})};return(0,n.jsx)(T,{content:L(a),renderWidget:r})}function ee({data:a,renderWidget:c}){let l=(0,i.useContext)(D),r=(0,i.useMemo)(()=>W(a,l.validateWidget),[a,l.validateWidget]),o=(0,i.useMemo)(()=>new Map(r.levels.map(e=>[e.id,e])),[r]),[m,u]=N("multi-level-view.level",r.root,{accept:e=>typeof e=="string"&&o.has(e)}),[v,f]=(0,i.useState)("in"),t=o.get(m)??o.get(r.root),x=h(o,t.id),y=(0,i.useRef)(null),d=(0,i.useRef)(null),k=(0,i.useRef)(!1),s=P(),g=S(V),p=e=>{!e||!o.has(e)||e===t.id||(f(h(o,e).length<x.length?"out":"in"),k.current=!0,u(e))};(0,i.useEffect)(()=>{d.current&&(d.current.scrollLeft=d.current.scrollWidth),k.current&&y.current?.focus({preventScroll:!0})},[t.id]);let F=(0,i.useMemo)(()=>s?{...s,namespace:JSON.stringify([s.page,s.block,t.id])}:null,[s,t.id]),H=c??l.renderWidget;return(0,n.jsxs)("section",{className:"sb-block mlv","aria-label":I(r.title,g("title")),onKeyDown:e=>{e.key==="Escape"&&!e.defaultPrevented&&!e.target.closest("input,textarea")&&e.target.closest("[contenteditable]")?.getAttribute("contenteditable")!=="true"&&t.parentId&&(e.preventDefault(),e.stopPropagation(),p(t.parentId))},children:[(0,n.jsxs)("nav",{className:"mlv-nav","aria-label":g("path"),children:[(0,n.jsx)("button",{type:"button","aria-label":g("back"),disabled:t.parentId===null,onClick:()=>p(t.parentId),children:(0,n.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6","aria-hidden":"true",children:(0,n.jsx)("path",{d:"m14 5-7 7 7 7"})})}),(0,n.jsx)("div",{ref:d,className:"mlv-path",children:x.map((e,z)=>(0,n.jsxs)(i.Fragment,{children:[z>0&&(0,n.jsx)("span",{"aria-hidden":"true",children:"/"}),e.id===t.id?(0,n.jsx)("strong",{"aria-current":"location",children:e.label}):(0,n.jsx)("button",{type:"button",onClick:()=>p(e.id),children:e.label})]},e.id))})]}),(0,n.jsx)("div",{ref:y,className:"mlv-view","data-direction":v,tabIndex:-1,role:"region","aria-label":t.label,children:(0,n.jsx)(E.Provider,{value:F,children:(0,n.jsx)(A,{level:t,choose:p,renderWidget:H})})},t.id)]})}export{ee as MultiLevelViewBlock};
|