@inkeep/open-knowledge 0.4.1 → 0.5.0-beta.2
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/dist/assets/skills/open-knowledge/SKILL.md +1 -1
- package/dist/cli.mjs +5 -5
- package/dist/constants-DaHLULeB.mjs +2 -0
- package/dist/{dist-CM-e7rrB.mjs → dist-CKbBtGcV.mjs} +2 -2
- package/dist/{dist-CGdW0JZ5.mjs → dist-DD3jbGts.mjs} +2 -2
- package/dist/{dist-iEhrVwoD.mjs → dist-DLi5l7jc.mjs} +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +1 -1
- package/dist/init-BVF99f4p.mjs +408 -0
- package/dist/init-C5EZlTRi.mjs +1 -0
- package/dist/{loader-Bncr5BJi.mjs → loader-BuVjsSVh.mjs} +2 -2
- package/dist/loader-hhLpWo02.mjs +1 -0
- package/dist/preview-B3SUZJxp.mjs +1 -0
- package/dist/{preview-CpFNaoeP.mjs → preview-CgtprTPm.mjs} +2 -2
- package/dist/public/assets/ActivityModeContent-BPpQcXSp.js +2 -0
- package/dist/public/assets/ConsentDialogBody-CPwBJJLE.js +2 -0
- package/dist/public/assets/DocumentContext-DOBntg5q.js +37 -0
- package/dist/public/assets/{GraphPanel-lypmG_hQ.js → GraphPanel-C3gvPdoq.js} +2 -2
- package/dist/public/assets/{SettingsDialog-B0r_NhKC.js → SettingsDialog-DJeu0WRa.js} +2 -2
- package/dist/public/assets/SourceEditor-Xxy5TvNJ.js +2 -0
- package/dist/public/assets/{config-validation-events-CajjS6y9.js → config-validation-events-BpvRjXIZ.js} +3 -3
- package/dist/public/assets/{doc-hash-Cp6jbuyP.js → doc-hash-DefAyZGx.js} +114 -114
- package/dist/public/assets/index-Cfu0nrKh.js +1853 -0
- package/dist/public/assets/index-Cl4ZMMDO.css +1 -0
- package/dist/public/assets/{consent-store-lB0p7dI5.js → project-paths-Cs3srSjk.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-D0C4LZky.js → target-navigation-intent-Bsa-5sN4.js} +1 -1
- package/dist/public/assets/{toggle-group-Dq1Ta0Sb.js → toggle-group-fH3GS2vu.js} +1 -1
- package/dist/public/assets/{tooltip-BVo05ikW.js → tooltip-BuwIhPCp.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-Bj_bIEkO.js → typing-burst-detector-isOlON7R.js} +2 -2
- package/dist/public/index.html +10 -10
- package/dist/{src-DMe_jLWZ.mjs → src-ClUycJ-8.mjs} +2 -2
- package/dist/{start-BtHrrb3o.mjs → start-9GiauZpx.mjs} +2 -2
- package/dist/start-BOjZrRX3.mjs +1 -0
- package/package.json +1 -1
- package/dist/constants-D6K9fctf.mjs +0 -2
- package/dist/init-3AFVYf9q.mjs +0 -1
- package/dist/init-CdsG66O_.mjs +0 -408
- package/dist/loader-DTI1TGWC.mjs +0 -1
- package/dist/preview-BvnHrXsi.mjs +0 -1
- package/dist/public/assets/ActivityModeContent-B9qJjoag.js +0 -2
- package/dist/public/assets/ConsentDialogBody-Nm0bF6eX.js +0 -2
- package/dist/public/assets/DocumentContext-DXmaxXXr.js +0 -37
- package/dist/public/assets/SourceEditor-CzC_EQwX.js +0 -2
- package/dist/public/assets/index-Cuiz8Dsb.js +0 -1853
- package/dist/public/assets/index-zh5eSlzN.css +0 -1
- package/dist/start-BTbMaVtC.mjs +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CFjPhJqf.js";import{n as t,r as n,t as r}from"./compiler-runtime-CVnuRdak.js";import{A as i,Bt as a,Ft as o,Ht as s,It as c,K as l,Lt as u,Mt as d,Pt as f,Rt as p,T as m,Ut as h,Vt as g,Wt as _,b as v,dt as y,ut as ee,v as te,y as ne,zt as b}from"./DocumentContext-DXmaxXXr.js";import{Hr as re,on as x}from"./doc-hash-Cp6jbuyP.js";import{$ as S,Dt as ie,Et as C,Ft as w,J as T,Ot as E,P as D,Q as O,Tt as k,X as A,jt as j,pt as M,ut as ae,xt as N}from"./dist-Du-s1q8P.js";import{a as oe,i as se,r as ce,t as P}from"./typing-burst-detector-Bj_bIEkO.js";var F=e(t(),1),le=r(),I=class e{constructor(e,t){this.yanchor=e,this.yhead=t}toJSON(){return{yanchor:b(this.yanchor),yhead:b(this.yhead)}}static fromJSON(t){return new e(u(t.yanchor),u(t.yhead))}},L=class{constructor(e,t){this.ytext=e,this.awareness=t,this.undoManager=new f(e)}toYPos(e,t=0){return p(this.ytext,e,t)}fromYPos(e){let t=c(u(e),this.ytext.doc);if(t==null||t.type!==this.ytext)throw Error(`[y-codemirror] The position you want to retrieve was created by a different document`);return{pos:t.index,assoc:t.assoc}}toYRange(e){let t=e.assoc;return new I(this.toYPos(e.anchor,t),this.toYPos(e.head,t))}fromYRange(e){let t=this.fromYPos(e.yanchor),n=this.fromYPos(e.yhead);return t.pos===n.pos?C.cursor(n.pos,n.assoc):C.range(t.pos,n.pos)}},R=E.define({combine(e){return e[e.length-1]}}),z=N.define(),B=class{constructor(e){this.view=e,this.conf=e.state.facet(R),this._observer=(t,n)=>{if(n.origin!==this.conf){let n=t.delta,r=[],i=0;for(let e=0;e<n.length;e++){let t=n[e];t.insert==null?t.delete==null?i+=t.retain:(r.push({from:i,to:i+t.delete,insert:``}),i+=t.delete):r.push({from:i,to:i,insert:t.insert})}e.dispatch({changes:r,annotations:[z.of(this.conf)]})}},this._ytext=this.conf.ytext,this._ytext.observe(this._observer)}update(e){if(!e.docChanged||e.transactions.length>0&&e.transactions[0].annotation(z)===this.conf)return;let t=this.conf.ytext;t.doc.transact(()=>{let n=0;e.changes.iterChanges((e,r,i,a,o)=>{let s=o.sliceString(0,o.length,`
|
|
2
|
-
`);e!==r&&t.delete(e+n,r-e),s.length>0&&t.insert(e+n,s),n+=s.length-(r-e)})},this.conf)}destroy(){this._ytext.unobserve(this._observer)}},V=O.fromClass(B),H=A.baseTheme({".cm-ySelection":{},".cm-yLineSelection":{padding:0,margin:`0px 2px 0px 4px`},".cm-ySelectionCaret":{position:`relative`,borderLeft:`1px solid black`,borderRight:`1px solid black`,marginLeft:`-1px`,marginRight:`-1px`,boxSizing:`border-box`,display:`inline`},".cm-ySelectionCaretDot":{borderRadius:`50%`,position:`absolute`,width:`.4em`,height:`.4em`,top:`-.2em`,left:`-.2em`,backgroundColor:`inherit`,transition:`transform .3s ease-in-out`,boxSizing:`border-box`},".cm-ySelectionCaret:hover > .cm-ySelectionCaretDot":{transformOrigin:`bottom center`,transform:`scale(0)`},".cm-ySelectionInfo":{position:`absolute`,top:`-1.05em`,left:`-1px`,fontSize:`.75em`,fontFamily:`serif`,fontStyle:`normal`,fontWeight:`normal`,lineHeight:`normal`,userSelect:`none`,color:`white`,paddingLeft:`2px`,paddingRight:`2px`,zIndex:101,transition:`opacity .3s ease-in-out`,backgroundColor:`inherit`,opacity:0,transitionDelay:`0s`,whiteSpace:`nowrap`},".cm-ySelectionCaret:hover > .cm-ySelectionInfo":{opacity:1,transitionDelay:`0s`}}),U=N.define(),W=class extends S{constructor(e,t){super(),this.color=e,this.name=t}toDOM(){return a(`span`,[s(`class`,`cm-ySelectionCaret`),s(`style`,`background-color: ${this.color}; border-color: ${this.color}`)],[g(``),a(`div`,[s(`class`,`cm-ySelectionCaretDot`)]),g(``),a(`div`,[s(`class`,`cm-ySelectionInfo`)],[g(this.name)]),g(``)])}eq(e){return e.color===this.color}compare(e){return e.color===this.color}updateDOM(){return!1}get estimatedHeight(){return-1}ignoreEvent(){return!0}},ue=class{constructor(e){this.conf=e.state.facet(R),this._listener=({added:t,updated:n,removed:r},i,a)=>{t.concat(n).concat(r).findIndex(e=>e!==this.conf.awareness.doc.clientID)>=0&&e.dispatch({annotations:[U.of([])]})},this._awareness=this.conf.awareness,this._awareness.on(`change`,this._listener),this.decorations=j.of([])}destroy(){this._awareness.off(`change`,this._listener)}update(e){let t=this.conf.ytext,n=t.doc,r=this.conf.awareness,i=[],a=this.conf.awareness.getLocalState();if(a!=null){let n=e.view.hasFocus&&e.view.dom.ownerDocument.hasFocus(),i=n?e.state.selection.main:null,s=a.cursor==null?null:u(a.cursor.anchor),c=a.cursor==null?null:u(a.cursor.head);if(i!=null){let e=p(t,i.anchor),n=p(t,i.head);(a.cursor==null||!o(s,e)||!o(c,n))&&r.setLocalStateField(`cursor`,{anchor:e,head:n})}else a.cursor!=null&&n&&r.setLocalStateField(`cursor`,null)}r.getStates().forEach((a,o)=>{if(o===r.doc.clientID)return;let s=a.cursor;if(s==null||s.anchor==null||s.head==null)return;let l=c(s.anchor,n),u=c(s.head,n);if(l==null||u==null||l.type!==t||u.type!==t)return;let{color:d=`#30bced`,name:f=`Anonymous`}=a.user||{},p=a.user&&a.user.colorLight||d+`33`,m=_(l.index,u.index),g=h(l.index,u.index),v=e.view.state.doc.lineAt(m),y=e.view.state.doc.lineAt(g);if(v.number===y.number)i.push({from:m,to:g,value:T.mark({attributes:{style:`background-color: ${p}`},class:`cm-ySelection`})});else{i.push({from:m,to:v.from+v.length,value:T.mark({attributes:{style:`background-color: ${p}`},class:`cm-ySelection`})}),i.push({from:y.from,to:g,value:T.mark({attributes:{style:`background-color: ${p}`},class:`cm-ySelection`})});for(let t=v.number+1;t<y.number;t++){let n=e.view.state.doc.line(t).from;i.push({from:n,to:n,value:T.line({attributes:{style:`background-color: ${p}`,class:`cm-yLineSelection`}})})}}i.push({from:u.index,to:u.index,value:T.widget({side:u.index-l.index>0?-1:1,block:!1,widget:new W(d,f)})})}),this.decorations=T.set(i,!0)}},de=O.fromClass(ue,{decorations:e=>e.decorations}),fe=class{constructor(e){this.undoManager=e}addTrackedOrigin(e){this.undoManager.addTrackedOrigin(e)}removeTrackedOrigin(e){this.undoManager.removeTrackedOrigin(e)}undo(){return this.undoManager.undo()!=null}redo(){return this.undoManager.redo()!=null}},G=E.define({combine(e){return e[e.length-1]}});N.define();var pe=class{constructor(e){this.view=e,this.conf=e.state.facet(G),this._undoManager=this.conf.undoManager,this.syncConf=e.state.facet(R),this._beforeChangeSelection=null,this._mux=d(),this._onStackItemAdded=({stackItem:e,changedParentTypes:t})=>{t.has(this.syncConf.ytext)&&this._beforeChangeSelection&&!e.meta.has(this)&&e.meta.set(this,this._beforeChangeSelection)},this._onStackItemPopped=({stackItem:t})=>{let n=t.meta.get(this);if(n){let t=this.syncConf.fromYRange(n);e.dispatch(e.state.update({selection:t,effects:[A.scrollIntoView(t)]})),this._storeSelection()}},this._storeSelection=()=>{this._beforeChangeSelection=this.syncConf.toYRange(this.view.state.selection.main)},this._undoManager.on(`stack-item-added`,this._onStackItemAdded),this._undoManager.on(`stack-item-popped`,this._onStackItemPopped),this._undoManager.addTrackedOrigin(this.syncConf)}update(e){e.selectionSet&&(e.transactions.length===0||e.transactions[0].annotation(z)!==this.syncConf)&&this._storeSelection()}destroy(){this._undoManager.off(`stack-item-added`,this._onStackItemAdded),this._undoManager.off(`stack-item-popped`,this._onStackItemPopped),this._undoManager.removeTrackedOrigin(this.syncConf)}},me=O.fromClass(pe),he=({state:e,dispatch:t})=>e.facet(G).undo()||!0,ge=({state:e,dispatch:t})=>e.facet(G).redo()||!0,_e=(e,t,{undoManager:n=new f(e)}={})=>{let r=new L(e,t),i=[R.of(r),V];return t&&i.push(H,de),n!==!1&&i.push(G.of(new fe(n)),me,A.domEventHandlers({beforeinput(e,t){return e.inputType===`historyUndo`?he(t):e.inputType===`historyRedo`?ge(t):!1}})),i},ve=T.mark({class:`cm-link-ref-broken`}),K=/^\s{0,3}\[([^\]]+)\]:\s/,q=/\[([^\]]*)\]\[([^\]]*)\]/g,ye=new Set([`FencedCode`,`CodeBlock`,`InlineCode`]);function J(e,t){let n=0,r=t.length-1;for(;n<=r;){let i=n+r>>1,a=t[i];if(e<a.from)r=i-1;else if(e>=a.to)n=i+1;else return!0}return!1}function be(e){let t=[];return D(e).iterate({enter(e){if(ye.has(e.name))return t.push({from:e.from,to:e.to}),!1}}),t.sort((e,t)=>e.from-t.from),t}function Y(e){let t=new Set,n=[],r=e.doc,i=be(e);for(let e=1;e<=r.lines;e++){let n=r.line(e);if(J(n.from,i))continue;let a=K.exec(n.text);a&&t.add(a[1].toLowerCase())}for(let e=1;e<=r.lines;e++){let t=r.line(e);if(!J(t.from,i)&&!K.test(t.text))for(q.lastIndex=0;;){let e=q.exec(t.text);if(!e)break;let r=t.from+e.index;if(J(r,i))continue;let a=e[2]||e[1];n.push({from:r,to:r+e[0].length,label:a.toLowerCase()})}}let a=[];for(let e of n)t.has(e.label)||a.push(ve.range(e.from,e.to));return a.sort((e,t)=>e.from-t.from),T.set(a)}var xe=w.define({create(e){return Y(e)},update(e,t){return t.docChanged?Y(t.state):e},provide:e=>A.decorations.from(e)}),Se=/^(\s*(?:[-*+]|\d+[.)]) (?:\[[ x]\] )?)/,Ce=T.mark({class:`cm-del`}),we=T.line({class:`cm-table-header`}),X=T.line({class:`cm-table-row`});function Te(e){let t=0;for(let n of e)if(n===` `)t++;else if(n===` `)t+=4;else break;return t}function Ee(e){if(e.doc.lines<2)return null;let t=e.doc.line(1);if(t.text!==`---`)return null;for(let n=2;n<=e.doc.lines;n++){let r=e.doc.line(n);if(r.text===`---`)return{from:t.from,to:r.to}}return null}function Z(e,t){let n=[],r=D(e),i=Ee(e),a=e=>i!==null&&e>=i.from&&e<=i.to;for(let{from:i,to:o}of t)r.iterate({from:i,to:o,enter(t){if(!a(t.from)){if(t.name===`Strikethrough`){let e=t.from,r=t.to,i=t.node.cursor();if(i.firstChild())do i.name===`StrikethroughMark`&&(i.from===t.from?e=i.to:r=i.from);while(i.nextSibling());return e<r&&n.push(Ce.range(e,r)),!1}if(t.name===`ListItem`){let r=e.doc.lineAt(t.from),i=Se.exec(r.text),a=i?i[1].length:2,o=T.line({class:`cm-list-item`,attributes:{style:`--list-hang: ${a}ch`}});n.push(o.range(r.from));return}if(t.name===`FencedCode`){let r=e.doc.lineAt(t.from),i=e.doc.lineAt(t.to);for(let t=r.number+1;t<i.number;t++){let r=e.doc.line(t),i=Te(r.text),a=T.line({class:`cm-fenced-code-line`,attributes:{style:`--line-indent: ${i}`}});n.push(a.range(r.from))}return!1}if(t.name===`TableHeader`){let r=e.doc.lineAt(t.from);return n.push(we.range(r.from)),!1}if(t.name===`TableRow`){let r=e.doc.lineAt(t.from);return n.push(X.range(r.from)),!1}if(t.name===`TableDelimiter`&&t.node.parent?.name===`Table`){let r=e.doc.lineAt(t.from);return n.push(X.range(r.from)),!1}}}});return n.sort((e,t)=>e.from-t.from||e.value.startSide-t.value.startSide),T.set(n)}var De=class{decorations;constructor(e){this.decorations=Z(e.state,e.visibleRanges)}update(e){(e.docChanged||e.viewportChanged||D(e.startState)!==D(e.state))&&(this.decorations=Z(e.view.state,e.view.visibleRanges))}},Oe=O.fromClass(De,{decorations:e=>e.decorations});function ke(){return[Oe,xe]}var Ae=n(),je=56;function Q(e,t){let n=e.state.doc,r=1;if(n.lines>=1&&n.line(1).text===`---`){for(let e=2;e<=n.lines;e++)if(n.line(e).text===`---`){r=e+1;break}}let i=x(),a=0;for(let o=r;o<=n.lines;o++){let r=n.line(o);if(!i(r.text)&&/^#{1,6}\s/.test(r.text)){if(a===t.index){e.dispatch({selection:C.cursor(r.from),effects:A.scrollIntoView(r.from,{y:`start`})}),e.focus();return}a++}}}function $(e,t){requestAnimationFrame(()=>{let n=e.state.doc,r=Math.min(t.offset,n.length);e.dispatch({selection:C.cursor(r),effects:A.scrollIntoView(r,{y:`center`})}),e.focus()})}function Me(e){let t=(0,le.c)(28),{docName:n,ytext:r,provider:a,placeholder:o,isSourceModeActive:s}=e,c=(0,F.useRef)(null),u=(0,F.useRef)(null),d;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=new k,t[0]=d):d=t[0];let f=(0,F.useRef)(d),p;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(p=new k,t[1]=p):p=t[1];let m=(0,F.useRef)(p),[h,g]=(0,F.useState)(null);if(h)throw h;let{resolvedTheme:_}=re(),b=(0,F.useRef)(null),x;t[2]!==o||t[3]!==a||t[4]!==_||t[5]!==r?(x=()=>{let e=c.current;if(!e)return;let t=a.configuration.name??``,n,s=Pe;try{n=ee({docName:t,container:e,sizeStats:{viewCount:0,bytes:r.length},factory:e=>{let t=l({ydoc:a.document,ytext:r}),n=new A({state:ie.create({doc:r.toString(),extensions:[ce,ae.of([i]),_e(r,a.awareness),...te({themeCompartment:f.current,resolvedTheme:_,ydoc:a.document}),ke(),t,m.current.of(M(o??``)),A.theme({"&":{height:`100%`}}),A.scrollMargins.of(Ne)]}),parent:e}),c=n.contentDOM;return c.addEventListener(`keydown`,s),c.addEventListener(`paste`,s),c.addEventListener(`drop`,s),c.addEventListener(`cut`,s),{view:n,ydoc:a.document,ytext:r,provider:a}}}),b.current=n,u.current=n.view}catch(e){let t=e;console.error(`[SourceEditor] mountCmEditor failed`,t),b.current=null,u.current=null,g(t instanceof Error?t:Error(String(t)))}return()=>{let e=b.current;e&&y(e),b.current=null,u.current=null}},t[2]=o,t[3]=a,t[4]=_,t[5]=r,t[6]=x):x=t[6];let S;t[7]!==a||t[8]!==r?(S=[r,a],t[7]=a,t[8]=r,t[9]=S):S=t[9],(0,F.useEffect)(x,S);let C,w;t[10]===n?(C=t[11],w=t[12]):(C=()=>{},w=[n],t[10]=n,t[11]=C,t[12]=w),(0,F.useEffect)(C,w);let T,E;t[13]===_?(T=t[14],E=t[15]):(T=()=>{u.current&&u.current.dispatch({effects:f.current.reconfigure(_===`dark`?ne:v)})},E=[_],t[13]=_,t[14]=T,t[15]=E),(0,F.useEffect)(T,E);let D,O;t[16]===o?(D=t[17],O=t[18]):(O=()=>{u.current&&u.current.dispatch({effects:m.current.reconfigure(M(o??``))})},D=[o],t[16]=o,t[17]=D,t[18]=O),(0,F.useEffect)(O,D);let j,N;t[19]!==n||t[20]!==s?(j=()=>{let e=function(e){let t=e.detail;if(!t||t.mode!==`source`||!s)return;let r=u.current;r&&(Q(r,t),se(n))};return window.addEventListener(P,e),()=>window.removeEventListener(P,e)},N=[n,s],t[19]=n,t[20]=s,t[21]=j,t[22]=N):(j=t[21],N=t[22]),(0,F.useEffect)(j,N);let I,L;t[23]!==n||t[24]!==s?(I=()=>{if(!s)return;let e=u.current;if(!e)return;let t=oe(n);if(t){if(t.kind===`outline`){Q(e,t.detail);return}$(e,t.detail)}},L=[n,s],t[23]=n,t[24]=s,t[25]=I,t[26]=L):(I=t[25],L=t[26]),(0,F.useEffect)(I,L);let R;return t[27]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,Ae.jsx)(`div`,{ref:c,className:`source-editor h-full pb-3`}),t[27]=R):R=t[27],R}function Ne(){return{top:je}}function Pe(){return m()}export{Me as SourceEditor};
|