@inkeep/open-knowledge 0.84.0-beta.8 → 0.84.0-beta.9
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/cli.mjs +6 -6
- package/dist/constants-DB1LQ7ZB.mjs +1 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.mjs +1 -1
- package/dist/init-CTlk5-Zb.mjs +1 -0
- package/dist/{init-BgqVi-9O.mjs → init-M54rry8h.mjs} +2 -2
- package/dist/{launch-json-removal-CnjxrLk6.mjs → launch-json-removal-BTInmedE.mjs} +1 -1
- package/dist/loader-BIVsqbQs.mjs +1 -0
- package/dist/{loader-B8U9rhyX.mjs → loader-C7uN3Y0b.mjs} +1 -1
- package/dist/{preview-CCxlCT_n.mjs → preview-B-Vnnn1H.mjs} +1 -1
- package/dist/preview-C3ycR4RK.mjs +1 -0
- package/dist/public/assets/{AccountSection-B014nDlY.js → AccountSection-D_ZWBqY9.js} +1 -1
- package/dist/public/assets/{ActivityModeContent-DYdjlBFR.js → ActivityModeContent-CNpMQTpC.js} +1 -1
- package/dist/public/assets/{AddPropertiesButton-DgNbHA4e.js → AddPropertiesButton-Bej6JqkA.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-9W2g7aLW.js → AgentDiffPane-DwlqjVvq.js} +1 -1
- package/dist/public/assets/{AttachmentsSection-DgA2oYx3.js → AttachmentsSection-lWzz3fp_.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-I8b5kl2c.js → CodeMirrorPropInput-fUqL63QL.js} +1 -1
- package/dist/public/assets/{ContentRulesSection-CEhqKazM.js → ContentRulesSection-DBqT2CPL.js} +1 -1
- package/dist/public/assets/{DocumentContext-BU6384lO.js → DocumentContext-CPYny_LL.js} +1 -1
- package/dist/public/assets/{EditorModeToggle-Cf0LpUPt.js → EditorModeToggle-CwAAzRZS.js} +1 -1
- package/dist/public/assets/{ExcalidrawDocEditor-zIujqXar.js → ExcalidrawDocEditor-BgISOoix.js} +1 -1
- package/dist/public/assets/FeedbackForm-CUw8I5kf.js +1 -0
- package/dist/public/assets/{ImportSkillDialog-BsdzQosb.js → ImportSkillDialog-oocNaRhL.js} +1 -1
- package/dist/public/assets/{LinkPreviewsSection-bzaka6Vy.js → LinkPreviewsSection-BfIYdcgK.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-Cc4OnPo8.js → LintConfigEditor-C7y-uwE0.js} +1 -1
- package/dist/public/assets/{LintingSection-BTbUA-sH.js → LintingSection-CVw0Trw4.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-DZWmH30D.js → ManagedArtifactProperties-CWYSaPwg.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-DWbrw9Cj.js +1 -0
- package/dist/public/assets/{MermaidDocEditor-Cxe7FJmA.js → MermaidDocEditor-haNggOCz.js} +1 -1
- package/dist/public/assets/{NetworkAccessSection-Bco3oNmX.js → NetworkAccessSection-Dw2VIaTB.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-kKXyb1ak.js → PropertyDisplayRow-BmJgg1G0.js} +1 -1
- package/dist/public/assets/{PublishToGitHubDialog-BVIwcP34.js → PublishToGitHubDialog-B3H1Ht_b.js} +1 -1
- package/dist/public/assets/ReportBugDialogBody-C4S54OZj.js +3 -0
- package/dist/public/assets/{ReportBugMenuTrigger-DIsDu8Oo.js → ReportBugMenuTrigger-C4Fua-En.js} +1 -1
- package/dist/public/assets/{SchemaConfigEditor-DbK-MAfN.js → SchemaConfigEditor-5332QPDb.js} +1 -1
- package/dist/public/assets/{SearchSection--sZel4Z5.js → SearchSection-BnUt0fix.js} +1 -1
- package/dist/public/assets/{SessionsHost-D9CZH55k.js → SessionsHost-Bsxh7bry.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-D7gXHHaO.js → SettingsDialogBody-DCZKsyME.js} +2 -2
- package/dist/public/assets/{ShareReceiveMissDialog-C4bznAx6.js → ShareReceiveMissDialog-QL8wnPd9.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-C6R2N9zy.js → SkillToolbarControls-BcZX2CeU.js} +1 -1
- package/dist/public/assets/{SourceEditor-DQP_Juhy.js → SourceEditor-UlWcsqxg.js} +1 -1
- package/dist/public/assets/{SpellingSettings-B_phbPpu.js → SpellingSettings-iTpt2iMJ.js} +1 -1
- package/dist/public/assets/{SyncSection-BXeUGdb9.js → SyncSection-CLK-Ok07.js} +1 -1
- package/dist/public/assets/{SyncStatusBadge-Du08o0Dw.js → SyncStatusBadge-WvBVHl4T.js} +1 -1
- package/dist/public/assets/{TerminalSection--ns50F78.js → TerminalSection-CutLJjli.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-DjqzdE_Z.js → TerminalWindowApp-DGqFnz7v.js} +1 -1
- package/dist/public/assets/{TextDocEditor-DalceEBj.js → TextDocEditor-BjyByWpD.js} +1 -1
- package/dist/public/assets/{ThemePluginSection-B6zsULe5.js → ThemePluginSection-rP66Rthq.js} +1 -1
- package/dist/public/assets/{ThreadView-C5ldWBBV.js → ThreadView-C8wEr90V.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-C5cs7cZg.js → TimelineDiffPane-B0JYgGU4.js} +1 -1
- package/dist/public/assets/{comment-chips-DpZR-ILM.js → comment-chips-CvvUuYYx.js} +1 -1
- package/dist/public/assets/{config-provider-Cu_pQedM.js → config-provider-CD_cgB5d.js} +1 -1
- package/dist/public/assets/config-schema-DqXlMZId.js +1 -0
- package/dist/public/assets/{doc-undo-manager--bnI6mEc.js → doc-undo-manager-bsfAZGVR.js} +1 -1
- package/dist/public/assets/field-controls-Cm0BRErk.js +1 -0
- package/dist/public/assets/{field-controls-zCgHwN0u.js → field-controls-DkllO0wI.js} +1 -1
- package/dist/public/assets/{index-BUNWe98_.js → index-CJCUy5_9.js} +7 -7
- package/dist/public/assets/{lint-config-client-t7VsdRdr.js → lint-config-client-cU_8Idn6.js} +1 -1
- package/dist/public/assets/{lint-plugins-CR0kd8mR.js → lint-plugins-1WQvmo32.js} +1 -1
- package/dist/public/assets/{markdown-lint-DvPODigW.js → markdown-lint-4M923uge.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-DAxdd3Fq.js → markdownlint-rule-browser-Dc7L583w.js} +1 -1
- package/dist/public/assets/messages-B4jVHhO2.js +1 -0
- package/dist/public/assets/messages-BITpzeqs.js +1 -0
- package/dist/public/assets/messages-BKeG34zQ.js +1 -0
- package/dist/public/assets/messages-BZqwpd3T.js +1 -0
- package/dist/public/assets/messages-BmTgZBud.js +1 -0
- package/dist/public/assets/messages-CN0W5gYM.js +1 -0
- package/dist/public/assets/messages-CNr5eJiC.js +1 -0
- package/dist/public/assets/messages-D9aZoadl.js +1 -0
- package/dist/public/assets/messages-Dm_MM5Ai.js +1 -0
- package/dist/public/assets/messages-DpDh8A5J.js +1 -0
- package/dist/public/assets/messages-DqAgxeC0.js +1 -0
- package/dist/public/assets/messages-DqhCdGJ4.js +1 -0
- package/dist/public/assets/{messages-DAEoyeao.js → messages-DriAIEni.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-XWQOt6Fr.js → pending-receive-nav-store-DfHBKcP_.js} +1 -1
- package/dist/public/assets/{progress-BhRFeByh.js → progress-ygACLgn7.js} +1 -1
- package/dist/public/assets/{saved-themes-client-BKjZgSZ2.js → saved-themes-client-fH7y_UsP.js} +1 -1
- package/dist/public/assets/{schema-section-jPMt1scY.js → schema-section-CbL9NEzs.js} +1 -1
- package/dist/public/assets/{selection-context-Cuv7GyoN.js → selection-context-BRTYZqsU.js} +1 -1
- package/dist/public/assets/{src-B2A6Sl6H.js → src-BhR9d8T9.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-DsqIPsLN.js → typing-burst-detector-C9wOG-_O.js} +1 -1
- package/dist/public/assets/{uninstall-Br5i6Ave.js → uninstall-DFi4o8aO.js} +1 -1
- package/dist/public/assets/{use-activity-panel-Cn_JBE3I.js → use-activity-panel-IWlPso5j.js} +1 -1
- package/dist/public/assets/{use-apply-config-language-BNapdqrK.js → use-apply-config-language-D16Z3UZW.js} +2 -2
- package/dist/public/assets/{use-installed-clis-Cr70uJek.js → use-installed-clis-D8r4Mco8.js} +2 -2
- package/dist/public/assets/{use-open-skill-Dz4e3fQ5.js → use-open-skill-CQIiO2Gq.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-DuxifgTs.js → use-terminal-enabled-PdxJ5Cxv.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-BTyhkiHh.js → use-timeline-entry-diff-DN-ESIxG.js} +1 -1
- package/dist/public/index.html +23 -23
- package/dist/public/uninstall.html +3 -3
- package/dist/{registry-probes-DAls8wRU.mjs → registry-probes-DiMSHaP4.mjs} +1 -1
- package/dist/{removal-file-path-6F2vYdal.mjs → removal-file-path-DIhBOx7s.mjs} +1 -1
- package/dist/{repair-launch-json-CVRIabb_.mjs → repair-launch-json-D1rIkiZe.mjs} +1 -1
- package/dist/{repair-mcp-configs-DzDCKebq.mjs → repair-mcp-configs-BCWosu__.mjs} +1 -1
- package/dist/{src-BftPhK_7.mjs → src-CyQBNnZm.mjs} +1 -1
- package/dist/src-DsfvNBEU.mjs +1 -0
- package/dist/start-ClaAiPMR.mjs +1 -0
- package/dist/{start-Dw9RbsG0.mjs → start-lANOh-Wm.mjs} +2 -2
- package/package.json +4 -4
- package/dist/constants-BV_h1uxC.mjs +0 -1
- package/dist/init-Go0uTZtY.mjs +0 -1
- package/dist/loader-DLHNUQH5.mjs +0 -1
- package/dist/preview-DHqUdp0G.mjs +0 -1
- package/dist/public/assets/FeedbackForm-BkNTltaq.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-BeqrkzNl.js +0 -1
- package/dist/public/assets/ReportBugDialogBody-DNZtJiE1.js +0 -3
- package/dist/public/assets/config-schema-k_oWDqyF.js +0 -1
- package/dist/public/assets/field-controls-D-TNpiqz.js +0 -1
- package/dist/public/assets/messages-2kQ70cnc.js +0 -1
- package/dist/public/assets/messages-6iQlSalY.js +0 -1
- package/dist/public/assets/messages-AZwAPuM-.js +0 -1
- package/dist/public/assets/messages-BFOwShYO.js +0 -1
- package/dist/public/assets/messages-BnxHXoYK.js +0 -1
- package/dist/public/assets/messages-C2KqS948.js +0 -1
- package/dist/public/assets/messages-CZk_YdoA.js +0 -1
- package/dist/public/assets/messages-CszehdID.js +0 -1
- package/dist/public/assets/messages-D7N1vQCQ.js +0 -1
- package/dist/public/assets/messages-RoeLbbVl.js +0 -1
- package/dist/public/assets/messages-aTjgW69a.js +0 -1
- package/dist/public/assets/messages-jWN9SatD.js +0 -1
- package/dist/src-qQwctWcT.mjs +0 -1
- package/dist/start-BIRIWVlY.mjs +0 -1
package/dist/public/assets/{ShareReceiveMissDialog-C4bznAx6.js → ShareReceiveMissDialog-QL8wnPd9.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{t as r}from"./compiler-runtime-BfE3aGVn.js";import{a as i,i as a,n as o,o as s,r as c}from"./pending-receive-nav-store-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{t as r}from"./compiler-runtime-BfE3aGVn.js";import{a as i,i as a,n as o,o as s,r as c}from"./pending-receive-nav-store-DfHBKcP_.js";import{t as l}from"./miss-dialog-store-CsiJb9Ou.js";import{c as u,i as d,n as f,s as p,t as m}from"./dialog-BJEjKJjL.js";import{l as h,u as g}from"./doc-hash-BJkweiX9.js";var _=r(),v=e(n(),1),y=t();function b(e){let t=e.split(`/`).filter(Boolean);return t.length>0?t[t.length-1]:e}function x(){let e=(0,_.c)(2),t=(0,v.useSyncExternalStore)(l.subscribe,l.getSnapshot,S);if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=(0,y.jsx)(C,{nav:t},t.path),e[0]=t,e[1]=n),n}function S(){return null}function C(e){let t=(0,_.c)(28),{nav:n}=e,{state:r,refetch:v}=s(n),x;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(x=function(){l.dismiss()},t[0]=x):x=t[0];let S=x,C;t[1]===n.path?C=t[2]:(C=function(){window.location.hash=g(i(n.path)),S()},t[1]=n.path,t[2]=C);let w=C,T;t[3]===n?T=t[4]:(T=function(e){c.arm(o(n,e)),window.location.hash=n.kind===`folder`?g(e):h(e),S()},t[3]=n,t[4]=T);let E=T,D;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(D=e=>{e||S()},t[5]=D):D=t[5];let O=r.phase,k=r.phase===`resolved`?r.resolution.verdict:void 0,A;t[6]===n.path?A=t[7]:(A=b(n.path),t[6]=n.path,t[7]=A);let j;t[8]===A?j=t[9]:(j=(0,y.jsx)(p,{children:(0,y.jsx)(u,{className:`truncate`,children:A})}),t[8]=A,t[9]=j);let M=r.phase===`pending`?`flex flex-col items-center justify-center gap-3 py-6 text-center text-sm text-muted-foreground`:`flex flex-col items-center justify-center gap-6 py-2 text-center`,N;t[10]!==n.path||t[11]!==E?(N=()=>E(n.path),t[10]=n.path,t[11]=E,t[12]=N):N=t[12];let P;t[13]!==w||t[14]!==n||t[15]!==E||t[16]!==v||t[17]!==r||t[18]!==N?(P=(0,y.jsx)(a,{nav:n,state:r,onBrowseFolder:w,onOpenRenamed:E,onEnableAutoSync:S,onSyncCompleted:v,onPullApplied:N}),t[13]=w,t[14]=n,t[15]=E,t[16]=v,t[17]=r,t[18]=N,t[19]=P):P=t[19];let F;t[20]!==P||t[21]!==M?(F=(0,y.jsx)(f,{className:M,children:P}),t[20]=P,t[21]=M,t[22]=F):F=t[22];let I;return t[23]!==r.phase||t[24]!==F||t[25]!==k||t[26]!==j?(I=(0,y.jsx)(m,{open:!0,onOpenChange:D,children:(0,y.jsxs)(d,{className:`sm:max-w-md`,"data-testid":`share-receive-miss-dialog`,"data-phase":O,"data-verdict":k,children:[j,F]})}),t[23]=r.phase,t[24]=F,t[25]=k,t[26]=j,t[27]=I):I=t[27],I}export{x as ShareReceiveMissDialog};
|
package/dist/public/assets/{SkillToolbarControls-C6R2N9zy.js → SkillToolbarControls-BcZX2CeU.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./utils-CPqDy6Hr.js";import{a as s,i as c,n as l,o as u,r as d,s as f,t as p}from"./select-Bu4Wm3Rf.js";import{t as m}from"./button-DzgjsZzC.js";import{l as h,n as g,r as _,t as v}from"./AddPropertiesButton-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./utils-CPqDy6Hr.js";import{a as s,i as c,n as l,o as u,r as d,s as f,t as p}from"./select-Bu4Wm3Rf.js";import{t as m}from"./button-DzgjsZzC.js";import{l as h,n as g,r as _,t as v}from"./AddPropertiesButton-Bej6JqkA.js";import{a as y,h as b,r as x,t as S,u as C}from"./dropdown-menu-DtLu9NwU.js";import{n as w}from"./file-plus-DKxOZh2k.js";import{t as T}from"./list-plus-CYMJBvrm.js";import{p as E,t as D}from"./skill-scope-qLtpopQG.js";var O=a(),k=t();function A(e){let t=(0,O.c)(21),{value:n,onRequestMove:a,disabled:m,triggerClassName:h}=e,{_:g}=i(),_=E(),v;t[0]===a?v=t[1]:(v=e=>a(e),t[0]=a,t[1]=v);let y;t[2]===g?y=t[3]:(y=g({id:`oCHfGC`}),t[2]=g,t[3]=y);let b;t[4]===h?b=t[5]:(b=o(`w-auto gap-1 text-xs font-mono uppercase`,h),t[4]=h,t[5]=b);let x;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,k.jsx)(f,{}),t[6]=x):x=t[6];let S;t[7]!==y||t[8]!==b?(S=(0,k.jsx)(u,{size:`sm`,"aria-label":y,"data-testid":`skill-level-select`,className:b,children:x}),t[7]=y,t[8]=b,t[9]=S):S=t[9];let C;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,k.jsx)(s,{children:(0,k.jsx)(r,{id:`oCHfGC`})}),t[10]=C):C=t[10];let w;t[11]===_?w=t[12]:(w=D.map(e=>(0,k.jsx)(c,{value:e,children:_[e]},e)),t[11]=_,t[12]=w);let T;t[13]===w?T=t[14]:(T=(0,k.jsx)(l,{align:`end`,children:(0,k.jsxs)(d,{children:[C,w]})}),t[13]=w,t[14]=T);let A;return t[15]!==m||t[16]!==v||t[17]!==S||t[18]!==T||t[19]!==n?(A=(0,k.jsxs)(p,{value:n,onValueChange:v,disabled:m,children:[S,T]}),t[15]=m,t[16]=v,t[17]=S,t[18]=T,t[19]=n,t[20]=A):A=t[20],A}var j=e(n(),1);function M(e){let t=(0,O.c)(12),{scope:n,name:r}=e,[i,a]=(0,j.useState)(null),o;t[0]===n?o=t[1]:(o=e=>{e!==n&&a(e)},t[0]=n,t[1]=o);let s;t[2]!==r||t[3]!==i||t[4]!==n?(s=i?{scope:n,name:r,toScope:i}:null,t[2]=r,t[3]=i,t[4]=n,t[5]=s):s=t[5];let c;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=e=>!e&&a(null),t[6]=c):c=t[6];let l;t[7]===s?l=t[8]:(l=(0,k.jsx)(h,{target:s,onOpenChange:c}),t[7]=s,t[8]=l);let u;return t[9]!==o||t[10]!==l?(u={requestMove:o,dialog:l},t[9]=o,t[10]=l,t[11]=u):u=t[11],u}function N(e){let t=(0,O.c)(41),{scope:n,name:a,showAddPropertyButton:o,onAddProperty:s,problemCount:c,problemMessages:l}=e,{_:u}=i(),d;t[0]!==a||t[1]!==n?(d={scope:n,name:a},t[0]=a,t[1]=n,t[2]=d):d=t[2];let f=M(d),p;t[3]!==f.requestMove||t[4]!==n?(p=(0,k.jsx)(A,{value:n,onRequestMove:f.requestMove,triggerClassName:`hidden @xl/toolbar:flex`}),t[3]=f.requestMove,t[4]=n,t[5]=p):p=t[5];let h;t[6]!==a||t[7]!==n?(h=(0,k.jsx)(_,{scope:n,name:a}),t[6]=a,t[7]=n,t[8]=h):h=t[8];let E;t[9]!==p||t[10]!==h?(E=(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[p,h]}),t[9]=p,t[10]=h,t[11]=E):E=t[11];let D;t[12]!==s||t[13]!==c||t[14]!==l||t[15]!==o?(D=o?(0,k.jsx)(v,{onAddProperty:s,problemCount:c,problemMessages:l,className:`hidden @xl/toolbar:inline-flex`}):null,t[12]=s,t[13]=c,t[14]=l,t[15]=o,t[16]=D):D=t[16];let j;t[17]===u?j=t[18]:(j=u({id:`Yzs3QX`}),t[17]=u,t[18]=j);let N;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,k.jsx)(w,{className:`size-4`,"aria-hidden":!0}),t[19]=N):N=t[19];let P;t[20]===j?P=t[21]:(P=(0,k.jsx)(b,{asChild:!0,children:(0,k.jsx)(m,{variant:`ghost`,size:`icon`,"aria-label":j,"data-testid":`skill-toolbar-overflow`,className:`@xl/toolbar:hidden`,children:N})}),t[20]=j,t[21]=P);let F;t[22]===f?F=t[23]:(F=e=>f.requestMove(e),t[22]=f,t[23]=F);let I;t[24]!==n||t[25]!==F?(I=(0,k.jsx)(g,{value:n,onSelect:F}),t[24]=n,t[25]=F,t[26]=I):I=t[26];let L;t[27]!==s||t[28]!==o?(L=o?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(C,{}),(0,k.jsxs)(y,{onSelect:s,children:[(0,k.jsx)(T,{}),(0,k.jsx)(r,{id:`81H_23`})]})]}):null,t[27]=s,t[28]=o,t[29]=L):L=t[29];let R;t[30]!==I||t[31]!==L?(R=(0,k.jsxs)(x,{align:`end`,className:`min-w-44`,children:[I,L]}),t[30]=I,t[31]=L,t[32]=R):R=t[32];let z;t[33]!==R||t[34]!==P?(z=(0,k.jsxs)(S,{children:[P,R]}),t[33]=R,t[34]=P,t[35]=z):z=t[35];let B;return t[36]!==f.dialog||t[37]!==z||t[38]!==E||t[39]!==D?(B=(0,k.jsxs)(k.Fragment,{children:[E,D,z,f.dialog]}),t[36]=f.dialog,t[37]=z,t[38]=E,t[39]=D,t[40]=B):B=t[40],B}export{N as SkillToolbarControls};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{At as n,Gt as r,Ln as i,Mn as a,Z as o,_t as s,bt as c,dn as l,kt as u,qt as ee,un as te,wt as d,yt as f}from"./DocumentContext-BU6384lO.js";import{t as p}from"./react-f2sANaYj.js";import{n as m}from"./dist-PQ5KMVDh.js";import{t as h}from"./compiler-runtime-BfE3aGVn.js";import{ht as g}from"./schemas-api-JUnildTL.js";import{i as _}from"./use-apply-config-theme-CYFG76sS.js";import{H as ne,I as v,L as re,N as ie,T as ae,b as y,c as oe,n as se,o as b,r as ce,t as le,v as x,w as ue,z as de}from"./typing-burst-detector-DsqIPsLN.js";import{Gn as fe,S,U as C,a as pe,at as w,i as me,o as he,qn as T,st as E}from"./CodeMirrorPropInput-I8b5kl2c.js";import{a as D,i as O}from"./constants-skills-BLHVRW90.js";import{t as k}from"./diagnostic-breadcrumb-Cr0C15nJ.js";import{n as A}from"./perf-DZJpLc5j.js";import{f as ge}from"./config-provider-Cu_pQedM.js";import{$ as j,At as M,Ct as N,E as P,J as F,K as I,Mt as L,N as R,Nt as z,Tt as _e,X as B,at as V,b as H,et as U,ft as ve,g as W,l as G,lt as ye,ot as K,pt as q,st as J,tt as Y,ut as X,v as be,wt as Z}from"./dist-D2SphF3p.js";import{i as xe,t as Se}from"./dist-DseqKdAU.js";import{i as Ce,n as we,o as Te,r as Ee}from"./dist-DKYEqMZn.js";import{o as De,r as Oe}from"./selection-context-Cuv7GyoN.js";import{C as ke,D as Ae,t as je}from"./markdown-lint-DvPODigW.js";import{l as Me}from"./lint-config-client-t7VsdRdr.js";import{a as Ne,i as Pe,n as Fe,o as Ie,r as Le,s as Re,t as ze}from"./dist-CzJghaXH.js";import{n as Be,t as Ve}from"./src-B2A6Sl6H.js";var Q=e(p(),1),He=h();function Ue(){let e=u();return e===null?null:new Set(e.keys())}function We(e,t,n){let r=[],i=R(e);if(n!=null){let a=[];for(let{from:e,to:n}of t)i.iterate({from:e,to:n,enter(e){if(e.name===`InlineCode`||e.name===`FencedCode`)return a.push({from:e.from,to:e.to}),!1}});let o=(e,t)=>a.some(n=>e>=n.from&&t<=n.to);for(let{from:i,to:a}of t){let t=e.doc.sliceString(i,a);O.lastIndex=0;for(let e=O.exec(t);e!==null;e=O.exec(t)){let t=e[2];if(!D(t))continue;let a=i+(e.index??0)+e[1].length,s=a+t.length+1;o(a,s)||r.push(I.mark({class:n.has(t)?`cm-skill-ref`:`cm-skill-ref cm-skill-ref-missing`,attributes:{"data-skill-ref":t}}).range(a,s))}}}for(let{from:a,to:o}of t)i.iterate({from:a,to:o,enter(t){if(t.name!==`InlineCode`)return;let i=e.doc.sliceString(t.from,t.to),a=i.length-i.replace(/^`+/,``).length,o=i.length-i.replace(/`+$/,``).length,c=i.slice(a,i.length-o),l=/^\/([a-z0-9][a-z0-9-]{1,63})$/.exec(c)?.[1];if(l!==void 0&&D(l)&&n!=null)return r.push(I.mark({class:n.has(l)?`cm-skill-ref`:`cm-skill-ref cm-skill-ref-missing`,attributes:{"data-skill-ref":l}}).range(t.from+a,t.to-o)),!1;let u=s.exec(c);if(u)return r.push(I.mark({class:`cm-skill-path-link`,attributes:{"data-skill-path":u[1]}}).range(t.from+a,t.to-o)),!1}});return r.sort((e,t)=>e.from-t.from||e.value.startSide-t.value.startSide),I.set(r)}function Ge(e){let t=c(e);return t===null?[]:[B.fromClass(class{decorations;constructor(e){this.decorations=We(e.state,e.visibleRanges,Ue())}update(e){(e.docChanged||e.viewportChanged||R(e.startState)!==R(e.state))&&(this.decorations=We(e.view.state,e.view.visibleRanges,Ue()))}},{decorations:e=>e.decorations}),F.domEventHandlers({mousedown(r){let i=r.target?.closest?.(`[data-skill-ref]`),a=i instanceof HTMLElement?i.dataset.skillRef:void 0;if(a!==void 0){r.preventDefault();let e=u()?.get(a);return e===void 0?d():window.location.hash=n(a,e),!0}let o=r.target?.closest?.(`.cm-skill-path-link`),s=o instanceof HTMLElement?o.dataset.skillPath:void 0;return s===void 0?!1:(r.preventDefault(),window.location.hash=f(t,e,s),!0)}})]}var Ke=I.line({attributes:{dir:`auto`}});function qe(e){let t=new M;for(let n of e.visibleRanges)for(let r=n.from;r<=n.to;){let n=e.state.doc.lineAt(r);t.add(n.from,n.from,Ke),r=n.to+1}return t.finish()}var Je=B.fromClass(class{decorations;constructor(e){this.decorations=qe(e)}update(e){(e.docChanged||e.viewportChanged)&&(this.decorations=qe(e.view))}},{decorations:e=>e.decorations}),Ye=[F.perLineTextDirection.of(!0),Je],Xe=new Set([`Link`,`Image`,`HTMLTag`,`HTMLBlock`]),Ze=`cm-lint-local-target`;function Qe(e,t){let n=Math.min(Math.max(t.line+1,1),e.lines),r=e.line(n);return Math.min(r.from+Math.max(0,t.character),r.to)}function $e(e,t){let n=W(e,t+1,100);if(n){let e=n.resolveInner(t,1);for(;e;){if(Xe.has(e.name))return{from:e.from,to:e.to};e=e.parent}}return{from:t,to:t}}function et(e){return e===`error`?`error`:e===`info`?`info`:`warning`}function tt(e,t){let n=e.doc,r=[];for(let i of t){if(i.source!==`links`)continue;let t=$e(e,Qe(n,i.range.start));r.push({from:t.from,to:Math.max(t.to,t.from),severity:et(i.severity),message:y(i),source:`${i.source}/${i.code}`,markClass:Ze})}return r}var nt=L.define();function rt(e){let t={findings:[]};return[Pe(e=>w()?tt(e.state,t.findings):[],{delay:300,needsRefresh:e=>e.transactions.some(e=>e.effects.some(e=>e.is(nt)))}),B.define(n=>{let r=e=>{t.findings=e,n.dispatch({effects:nt.of(null)}),ze(n)},i=x(e,e=>{e.status===`loaded`&&r(e.findings)}),a=E(()=>r(t.findings));return{destroy(){i(),a()}}})]}function it(e,t){return e.enabled?[Fe(),Pe(async n=>at(n.state.doc,await ke(n.state.doc.toString(),e,t)),{delay:600})]:[]}function $(e,t){let n=Math.min(Math.max(t.line+1,1),e.lines),r=e.line(n);return Math.min(r.from+Math.max(0,t.character),r.to)}function at(e,t){let n=[];for(let r of t){let t=$(e,r.range.start),i=$(e,r.range.end),a={from:t,to:Math.max(i,t),severity:r.severity,message:r.message,source:`${r.source}/${r.code}`},o=ot(r);o&&(a.actions=[o]),n.push(a)}return n}function ot(e){let t=e.fixes;return!t||t.length===0?null:{name:`Fix`,apply(e){let n=e.state.doc;e.dispatch({changes:t.map(e=>({from:$(n,e.range.start),to:$(n,e.range.end),insert:e.newText})),userEvent:`input.complete`})}}}var st=[X(),K(),J(),be(),U(),Y(),_e.allowMultipleSelections.of(!0),P(),G(),Ee(),we(),q(),j(),V(),Ne(),ye.of([...Ce,...Se,...Re,...H,...Te,...Le])],ct=I.mark({class:`cm-link-ref-broken`}),lt=/^\s{0,3}\[([^\]]+)\]:\s/,ut=/\[([^\]]*)\]\[([^\]]*)\]/g,dt=new Set([`FencedCode`,`CodeBlock`,`InlineCode`]);function ft(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 pt(e){let t=[];return R(e).iterate({enter(e){if(dt.has(e.name))return t.push({from:e.from,to:e.to}),!1}}),t.sort((e,t)=>e.from-t.from),t}function mt(e){let t=new Set,n=[],r=e.doc,i=pt(e);for(let e=1;e<=r.lines;e++){let n=r.line(e);if(ft(n.from,i))continue;let a=lt.exec(n.text);a&&t.add(a[1].toLowerCase())}for(let e=1;e<=r.lines;e++){let t=r.line(e);if(!ft(t.from,i)&&!lt.test(t.text))for(ut.lastIndex=0;;){let e=ut.exec(t.text);if(!e)break;let r=t.from+e.index;if(ft(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(ct.range(e.from,e.to));return a.sort((e,t)=>e.from-t.from),I.set(a)}var ht=z.define({create(e){return mt(e)},update(e,t){return t.docChanged?mt(t.state):e},provide:e=>F.decorations.from(e)}),gt=/^(\s*(?:[-*+]|\d+[.)]) (?:\[[ x]\] )?)/,_t=I.mark({class:`cm-del`}),vt=I.line({class:`cm-table-header`,attributes:{style:`--list-hang: 2ch`}}),yt=I.line({class:`cm-table-row`,attributes:{style:`--list-hang: 2ch`}});function bt(e){let t=0;for(let n of e)if(n===` `)t++;else if(n===` `)t+=4;else break;return t}function xt(e){if(e.doc.lines<2)return null;let t=e.doc.line(1);if(!g.test(t.text))return null;for(let n=2;n<=e.doc.lines;n++){let r=e.doc.line(n);if(g.test(r.text))return{from:t.from,to:r.to}}return null}function St(e,t){let n=[],r=R(e),i=xt(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(_t.range(e,r)),!1}if(t.name===`ListItem`){let r=e.doc.lineAt(t.from),i=gt.exec(r.text),a=i?i[1].length:2,o=I.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=bt(r.text),a=I.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(vt.range(r.from)),!1}if(t.name===`TableRow`){let r=e.doc.lineAt(t.from);return n.push(yt.range(r.from)),!1}if(t.name===`TableDelimiter`&&t.node.parent?.name===`Table`){let r=e.doc.lineAt(t.from);return n.push(yt.range(r.from)),!1}}}});return n.sort((e,t)=>e.from-t.from||e.value.startSide-t.value.startSide),I.set(n)}var Ct=class{decorations;constructor(e){this.decorations=St(e.state,e.visibleRanges)}update(e){(e.docChanged||e.viewportChanged||R(e.startState)!==R(e.state))&&(this.decorations=St(e.view.state,e.view.visibleRanges))}},wt=B.fromClass(Ct,{decorations:e=>e.decorations});function Tt(){return[wt,ht]}function Et(e,t){let n=e.trackedOrigins;return n.has(t)?!0:t?n.has(t.constructor):!1}function Dt(e){let{docName:t,ytext:n,undoManager:r}=e,i=!1,a=!1,o=!1,s=(e,t)=>{i||Et(r,t.origin)||(a=!0)};return n.observe(s),{setSourceModeActive(e){if(!o&&e!==i){if(!e){i=!1,r.stopCapturing();return}a&&(r.clear(),A(`ok/source-undo/flip-clear`,{docName:t})),a=!1,i=!0}},destroy(){o||(o=!0,n.unobserve(s))}}}var Ot=new WeakMap;function kt(e){return B.define(t=>{let n=Dt(e);return Ot.set(t,n),{destroy(){n.destroy()}}})}function At(e,t){let n=Ot.get(e);if(!n)throw Error(`createSourceUndoFlipExtension is not installed on this EditorView`);n.setSourceModeActive(t)}var jt=t(),Mt=L.define();function Nt(e,t){try{At(t.view,!1)}finally{try{l(t)}finally{T(e,t.view)}}}function Pt(e,t,n){let r=b(e.state.doc),a=r[t.index],o={docName:n,mode:`source`,index:t.index,sourceHeadingCount:r.length};if(!a){k(se,{...o,outcome:`no-target`});return}let s=i(n,`outline`,()=>{e.dispatch({selection:Z.cursor(a.from),effects:F.scrollIntoView(a.from,{y:`start`})}),e.focus()});k(se,{...o,outcome:s?`scrolled`:`declined`,targetLine:e.state.doc.lineAt(a.from).number})}function Ft(e,t,n,r){requestAnimationFrame(()=>{if(!n())return;let a=e.state.doc,o=Math.min(t.offset,a.length);i(r,`raw-mdx`,()=>{e.dispatch({selection:Z.cursor(o),effects:F.scrollIntoView(o,{y:`center`})}),e.focus()})})}function It(e,t,n){let r=e.state.doc,a=Math.min(Math.max(t.line,1),r.lines),o=r.line(a),s=Math.min(o.from+Math.max(0,t.column-1),o.to);return i(n,`problems-row`,()=>{e.dispatch({selection:Z.cursor(s),effects:F.scrollIntoView(s,{y:`start`})}),e.focus()})}function Lt(e){let t=(0,He.c)(51),{docName:n,ytext:i,provider:s,placeholder:c,isSourceModeActive:l}=e,u=(0,Q.useRef)(null),d=(0,Q.useRef)(null),[f,p]=(0,Q.useState)(null);if(f)throw f;let{resolvedTheme:h}=m(),{merged:g}=_(),y=(0,Q.useRef)(l),b=g?.editor?.wordWrap??!0,{data:x}=Me(n),S;t[0]!==x?.effective||t[1]!==g?(S=x?.effective??(g?.contentRules?Ae(g.contentRules):je),t[0]=x?.effective,t[1]=g,t[2]=S):S=t[2];let C=S,w;t[3]===C?w=t[4]:(w=JSON.stringify(C),t[3]=C,t[4]=w);let T=w,E=(0,Q.useRef)(null),D;t[5]!==n||t[6]!==l||t[7]!==C||t[8]!==c||t[9]!==s||t[10]!==h||t[11]!==b||t[12]!==i?(D=()=>{let e=u.current;if(!e)return;let t=s.configuration.name??``,f,m=zt;try{f=te({docName:t,container:e,sizeStats:{viewCount:0,bytes:i.length},factory:e=>{let l=null,u=new ge(i);try{let te=o({ydoc:s.document,ytext:i,docName:t}),d=new N,f=new N,p=new N,g=new N,_=new F({state:_e.create({doc:i.toString(),extensions:[st,Ye,Ie({scrollToMatch:e=>a(t,`find-match`)?F.scrollIntoView(e,{y:`start`}):Mt.of(null)}),ye.of([xe]),Ve(i,s.awareness,{undoManager:u}),ye.of(Be),kt({docName:t,ytext:i,undoManager:u}),...me({themeCompartment:d,resolvedTheme:h,ydoc:s.document,wordWrapCompartment:f,wordWrap:b,currentDocName:t}),Tt(),Ge(t),ne(),g.of(it(C,n)),rt(n),te,F.updateListener.of(e=>{r(e)&&ee(t)}),F.updateListener.of(e=>{!e.selectionSet&&!e.docChanged||(l!==null&&clearTimeout(l),l=setTimeout(()=>{l=null,ue(t,`source`,ae(e.view)),Oe(t,`source`,De(e.view,t))},120))}),p.of(ve(c??``)),F.theme({"&":{height:`100%`}}),F.scrollMargins.of(Rt)]}),parent:e});ue(t,`source`,ae(_)),Oe(t,`source`,De(_,t));let v=_.contentDOM;return v.addEventListener(`keydown`,m),v.addEventListener(`paste`,m),v.addEventListener(`drop`,m),v.addEventListener(`cut`,m),{view:_,ydoc:s.document,ytext:i,provider:s,undoManager:u,themeCompartment:d,wordWrapCompartment:f,placeholderCompartment:p,lintCompartment:g}}catch(e){let t=e;throw u.destroy(),t}}}),E.current=f,d.current=f.view,At(f.view,l),fe(n,f.view,`sourceEditor`),le()&&f.view.focus()}catch(e){let t=e;console.error(`[SourceEditor] mountCmEditor failed`,t),E.current=null,d.current=null,p(t instanceof Error?t:Error(String(t)))}return()=>{let e=E.current;E.current=null,d.current=null,e&&Nt(n,e)}},t[5]=n,t[6]=l,t[7]=C,t[8]=c,t[9]=s,t[10]=h,t[11]=b,t[12]=i,t[13]=D):D=t[13];let O;t[14]!==s||t[15]!==i?(O=[i,s],t[14]=s,t[15]=i,t[16]=O):O=t[16],(0,Q.useEffect)(D,O);let A,j;t[17]===l?(A=t[18],j=t[19]):(A=()=>{y.current=l;let e=d.current;e&&At(e,l)},j=[l],t[17]=l,t[18]=A,t[19]=j),(0,Q.useEffect)(A,j);let M,P;t[20]===n?(M=t[21],P=t[22]):(M=()=>{},P=[n],t[20]=n,t[21]=M,t[22]=P),(0,Q.useEffect)(M,P);let I,L;t[23]===h?(I=t[24],L=t[25]):(L=()=>{let e=E.current;e&&e.view.dispatch({effects:e.themeCompartment.reconfigure(h===`dark`?pe:he)})},I=[h],t[23]=h,t[24]=I,t[25]=L),(0,Q.useEffect)(L,I);let R,z;t[26]===b?(R=t[27],z=t[28]):(R=()=>{let e=E.current;e&&e.view.dispatch({effects:e.wordWrapCompartment.reconfigure(b?F.lineWrapping:[])})},z=[b],t[26]=b,t[27]=R,t[28]=z),(0,Q.useEffect)(R,z);let B,V;t[29]===c?(B=t[30],V=t[31]):(B=()=>{let e=E.current;e&&e.view.dispatch({effects:e.placeholderCompartment.reconfigure(ve(c??``))})},V=[c],t[29]=c,t[30]=B,t[31]=V),(0,Q.useEffect)(B,V);let H;t[32]!==n||t[33]!==C?(H=()=>{let e=E.current;e&&e.view.dispatch({effects:e.lintCompartment.reconfigure(it(C,n))})},t[32]=n,t[33]=C,t[34]=H):H=t[34];let U;t[35]===T?U=t[36]:(U=[T],t[35]=T,t[36]=U),(0,Q.useEffect)(H,U);let W,G;t[37]!==n||t[38]!==l?(W=()=>{let e=function(e){let t=e.detail;if(!t||t.docName!==n||t.mode!==`source`||!l)return;let r=d.current;if(!r){k(se,{docName:n,mode:`source`,index:t.index,outcome:`no-view`});return}Pt(r,t,n),v(n)};return window.addEventListener(ce,e),()=>window.removeEventListener(ce,e)},G=[n,l],t[37]=n,t[38]=l,t[39]=W,t[40]=G):(W=t[39],G=t[40]),(0,Q.useEffect)(W,G);let K,q;t[41]!==n||t[42]!==l?(K=()=>{let e=function(e){let t=e.detail;if(!t||t.docName!==n||!l)return;let r=d.current;r&&It(r,t,n)&&v(n)};return window.addEventListener(oe,e),()=>window.removeEventListener(oe,e)},q=[n,l],t[41]=n,t[42]=l,t[43]=K,t[44]=q):(K=t[43],q=t[44]),(0,Q.useEffect)(K,q);let J,Y;t[45]!==n||t[46]!==l||t[47]!==s?(J=()=>{if(!l)return;let e=d.current;if(!e)return;let t=de(n);if(!t)return;if(t.kind!==`selection-offset`){re(n),t.kind===`outline`?Pt(e,t.detail,n):t.kind===`lint`?It(e,t.detail,n):t.kind===`raw-mdx`&&Ft(e,t.detail,()=>y.current,n);return}let r=!1,i=null;return queueMicrotask(()=>{if(r)return;let t=de(n);t?.kind===`selection-offset`&&(i=ie({view:e,docName:n,navigation:t,ydoc:s.document,transition:{from:`wysiwyg`,to:`source`}}),i&&re(n))}),()=>{r=!0,i?.cancel(`mode-flip`)}},Y=[n,l,s],t[45]=n,t[46]=l,t[47]=s,t[48]=J,t[49]=Y):(J=t[48],Y=t[49]),(0,Q.useEffect)(J,Y);let X;return t[50]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,jt.jsx)(`div`,{ref:u,className:`source-editor h-full pb-3`}),t[50]=X):X=t[50],X}function Rt(){return{top:S()}}function zt(){return C()}export{Lt as SourceEditor,Ft as applyRawMdxNavigation};
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{At as n,Gt as r,Ln as i,Mn as a,Z as o,_t as s,bt as c,dn as l,kt as u,qt as ee,un as te,wt as d,yt as f}from"./DocumentContext-CPYny_LL.js";import{t as p}from"./react-f2sANaYj.js";import{n as m}from"./dist-PQ5KMVDh.js";import{t as h}from"./compiler-runtime-BfE3aGVn.js";import{ht as g}from"./schemas-api-JUnildTL.js";import{i as _}from"./use-apply-config-theme-CYFG76sS.js";import{H as ne,I as v,L as re,N as ie,T as ae,b as y,c as oe,n as se,o as b,r as ce,t as le,v as x,w as ue,z as de}from"./typing-burst-detector-C9wOG-_O.js";import{Gn as fe,S,U as C,a as pe,at as w,i as me,o as he,qn as T,st as E}from"./CodeMirrorPropInput-fUqL63QL.js";import{a as D,i as O}from"./constants-skills-BLHVRW90.js";import{t as k}from"./diagnostic-breadcrumb-Cr0C15nJ.js";import{n as A}from"./perf-DZJpLc5j.js";import{f as ge}from"./config-provider-CD_cgB5d.js";import{$ as j,At as M,Ct as N,E as P,J as F,K as I,Mt as L,N as R,Nt as z,Tt as _e,X as B,at as V,b as H,et as U,ft as ve,g as W,l as G,lt as ye,ot as K,pt as q,st as J,tt as Y,ut as X,v as be,wt as Z}from"./dist-D2SphF3p.js";import{i as xe,t as Se}from"./dist-DseqKdAU.js";import{i as Ce,n as we,o as Te,r as Ee}from"./dist-DKYEqMZn.js";import{o as De,r as Oe}from"./selection-context-BRTYZqsU.js";import{C as ke,D as Ae,t as je}from"./markdown-lint-4M923uge.js";import{l as Me}from"./lint-config-client-cU_8Idn6.js";import{a as Ne,i as Pe,n as Fe,o as Ie,r as Le,s as Re,t as ze}from"./dist-CzJghaXH.js";import{n as Be,t as Ve}from"./src-BhR9d8T9.js";var Q=e(p(),1),He=h();function Ue(){let e=u();return e===null?null:new Set(e.keys())}function We(e,t,n){let r=[],i=R(e);if(n!=null){let a=[];for(let{from:e,to:n}of t)i.iterate({from:e,to:n,enter(e){if(e.name===`InlineCode`||e.name===`FencedCode`)return a.push({from:e.from,to:e.to}),!1}});let o=(e,t)=>a.some(n=>e>=n.from&&t<=n.to);for(let{from:i,to:a}of t){let t=e.doc.sliceString(i,a);O.lastIndex=0;for(let e=O.exec(t);e!==null;e=O.exec(t)){let t=e[2];if(!D(t))continue;let a=i+(e.index??0)+e[1].length,s=a+t.length+1;o(a,s)||r.push(I.mark({class:n.has(t)?`cm-skill-ref`:`cm-skill-ref cm-skill-ref-missing`,attributes:{"data-skill-ref":t}}).range(a,s))}}}for(let{from:a,to:o}of t)i.iterate({from:a,to:o,enter(t){if(t.name!==`InlineCode`)return;let i=e.doc.sliceString(t.from,t.to),a=i.length-i.replace(/^`+/,``).length,o=i.length-i.replace(/`+$/,``).length,c=i.slice(a,i.length-o),l=/^\/([a-z0-9][a-z0-9-]{1,63})$/.exec(c)?.[1];if(l!==void 0&&D(l)&&n!=null)return r.push(I.mark({class:n.has(l)?`cm-skill-ref`:`cm-skill-ref cm-skill-ref-missing`,attributes:{"data-skill-ref":l}}).range(t.from+a,t.to-o)),!1;let u=s.exec(c);if(u)return r.push(I.mark({class:`cm-skill-path-link`,attributes:{"data-skill-path":u[1]}}).range(t.from+a,t.to-o)),!1}});return r.sort((e,t)=>e.from-t.from||e.value.startSide-t.value.startSide),I.set(r)}function Ge(e){let t=c(e);return t===null?[]:[B.fromClass(class{decorations;constructor(e){this.decorations=We(e.state,e.visibleRanges,Ue())}update(e){(e.docChanged||e.viewportChanged||R(e.startState)!==R(e.state))&&(this.decorations=We(e.view.state,e.view.visibleRanges,Ue()))}},{decorations:e=>e.decorations}),F.domEventHandlers({mousedown(r){let i=r.target?.closest?.(`[data-skill-ref]`),a=i instanceof HTMLElement?i.dataset.skillRef:void 0;if(a!==void 0){r.preventDefault();let e=u()?.get(a);return e===void 0?d():window.location.hash=n(a,e),!0}let o=r.target?.closest?.(`.cm-skill-path-link`),s=o instanceof HTMLElement?o.dataset.skillPath:void 0;return s===void 0?!1:(r.preventDefault(),window.location.hash=f(t,e,s),!0)}})]}var Ke=I.line({attributes:{dir:`auto`}});function qe(e){let t=new M;for(let n of e.visibleRanges)for(let r=n.from;r<=n.to;){let n=e.state.doc.lineAt(r);t.add(n.from,n.from,Ke),r=n.to+1}return t.finish()}var Je=B.fromClass(class{decorations;constructor(e){this.decorations=qe(e)}update(e){(e.docChanged||e.viewportChanged)&&(this.decorations=qe(e.view))}},{decorations:e=>e.decorations}),Ye=[F.perLineTextDirection.of(!0),Je],Xe=new Set([`Link`,`Image`,`HTMLTag`,`HTMLBlock`]),Ze=`cm-lint-local-target`;function Qe(e,t){let n=Math.min(Math.max(t.line+1,1),e.lines),r=e.line(n);return Math.min(r.from+Math.max(0,t.character),r.to)}function $e(e,t){let n=W(e,t+1,100);if(n){let e=n.resolveInner(t,1);for(;e;){if(Xe.has(e.name))return{from:e.from,to:e.to};e=e.parent}}return{from:t,to:t}}function et(e){return e===`error`?`error`:e===`info`?`info`:`warning`}function tt(e,t){let n=e.doc,r=[];for(let i of t){if(i.source!==`links`)continue;let t=$e(e,Qe(n,i.range.start));r.push({from:t.from,to:Math.max(t.to,t.from),severity:et(i.severity),message:y(i),source:`${i.source}/${i.code}`,markClass:Ze})}return r}var nt=L.define();function rt(e){let t={findings:[]};return[Pe(e=>w()?tt(e.state,t.findings):[],{delay:300,needsRefresh:e=>e.transactions.some(e=>e.effects.some(e=>e.is(nt)))}),B.define(n=>{let r=e=>{t.findings=e,n.dispatch({effects:nt.of(null)}),ze(n)},i=x(e,e=>{e.status===`loaded`&&r(e.findings)}),a=E(()=>r(t.findings));return{destroy(){i(),a()}}})]}function it(e,t){return e.enabled?[Fe(),Pe(async n=>at(n.state.doc,await ke(n.state.doc.toString(),e,t)),{delay:600})]:[]}function $(e,t){let n=Math.min(Math.max(t.line+1,1),e.lines),r=e.line(n);return Math.min(r.from+Math.max(0,t.character),r.to)}function at(e,t){let n=[];for(let r of t){let t=$(e,r.range.start),i=$(e,r.range.end),a={from:t,to:Math.max(i,t),severity:r.severity,message:r.message,source:`${r.source}/${r.code}`},o=ot(r);o&&(a.actions=[o]),n.push(a)}return n}function ot(e){let t=e.fixes;return!t||t.length===0?null:{name:`Fix`,apply(e){let n=e.state.doc;e.dispatch({changes:t.map(e=>({from:$(n,e.range.start),to:$(n,e.range.end),insert:e.newText})),userEvent:`input.complete`})}}}var st=[X(),K(),J(),be(),U(),Y(),_e.allowMultipleSelections.of(!0),P(),G(),Ee(),we(),q(),j(),V(),Ne(),ye.of([...Ce,...Se,...Re,...H,...Te,...Le])],ct=I.mark({class:`cm-link-ref-broken`}),lt=/^\s{0,3}\[([^\]]+)\]:\s/,ut=/\[([^\]]*)\]\[([^\]]*)\]/g,dt=new Set([`FencedCode`,`CodeBlock`,`InlineCode`]);function ft(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 pt(e){let t=[];return R(e).iterate({enter(e){if(dt.has(e.name))return t.push({from:e.from,to:e.to}),!1}}),t.sort((e,t)=>e.from-t.from),t}function mt(e){let t=new Set,n=[],r=e.doc,i=pt(e);for(let e=1;e<=r.lines;e++){let n=r.line(e);if(ft(n.from,i))continue;let a=lt.exec(n.text);a&&t.add(a[1].toLowerCase())}for(let e=1;e<=r.lines;e++){let t=r.line(e);if(!ft(t.from,i)&&!lt.test(t.text))for(ut.lastIndex=0;;){let e=ut.exec(t.text);if(!e)break;let r=t.from+e.index;if(ft(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(ct.range(e.from,e.to));return a.sort((e,t)=>e.from-t.from),I.set(a)}var ht=z.define({create(e){return mt(e)},update(e,t){return t.docChanged?mt(t.state):e},provide:e=>F.decorations.from(e)}),gt=/^(\s*(?:[-*+]|\d+[.)]) (?:\[[ x]\] )?)/,_t=I.mark({class:`cm-del`}),vt=I.line({class:`cm-table-header`,attributes:{style:`--list-hang: 2ch`}}),yt=I.line({class:`cm-table-row`,attributes:{style:`--list-hang: 2ch`}});function bt(e){let t=0;for(let n of e)if(n===` `)t++;else if(n===` `)t+=4;else break;return t}function xt(e){if(e.doc.lines<2)return null;let t=e.doc.line(1);if(!g.test(t.text))return null;for(let n=2;n<=e.doc.lines;n++){let r=e.doc.line(n);if(g.test(r.text))return{from:t.from,to:r.to}}return null}function St(e,t){let n=[],r=R(e),i=xt(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(_t.range(e,r)),!1}if(t.name===`ListItem`){let r=e.doc.lineAt(t.from),i=gt.exec(r.text),a=i?i[1].length:2,o=I.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=bt(r.text),a=I.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(vt.range(r.from)),!1}if(t.name===`TableRow`){let r=e.doc.lineAt(t.from);return n.push(yt.range(r.from)),!1}if(t.name===`TableDelimiter`&&t.node.parent?.name===`Table`){let r=e.doc.lineAt(t.from);return n.push(yt.range(r.from)),!1}}}});return n.sort((e,t)=>e.from-t.from||e.value.startSide-t.value.startSide),I.set(n)}var Ct=class{decorations;constructor(e){this.decorations=St(e.state,e.visibleRanges)}update(e){(e.docChanged||e.viewportChanged||R(e.startState)!==R(e.state))&&(this.decorations=St(e.view.state,e.view.visibleRanges))}},wt=B.fromClass(Ct,{decorations:e=>e.decorations});function Tt(){return[wt,ht]}function Et(e,t){let n=e.trackedOrigins;return n.has(t)?!0:t?n.has(t.constructor):!1}function Dt(e){let{docName:t,ytext:n,undoManager:r}=e,i=!1,a=!1,o=!1,s=(e,t)=>{i||Et(r,t.origin)||(a=!0)};return n.observe(s),{setSourceModeActive(e){if(!o&&e!==i){if(!e){i=!1,r.stopCapturing();return}a&&(r.clear(),A(`ok/source-undo/flip-clear`,{docName:t})),a=!1,i=!0}},destroy(){o||(o=!0,n.unobserve(s))}}}var Ot=new WeakMap;function kt(e){return B.define(t=>{let n=Dt(e);return Ot.set(t,n),{destroy(){n.destroy()}}})}function At(e,t){let n=Ot.get(e);if(!n)throw Error(`createSourceUndoFlipExtension is not installed on this EditorView`);n.setSourceModeActive(t)}var jt=t(),Mt=L.define();function Nt(e,t){try{At(t.view,!1)}finally{try{l(t)}finally{T(e,t.view)}}}function Pt(e,t,n){let r=b(e.state.doc),a=r[t.index],o={docName:n,mode:`source`,index:t.index,sourceHeadingCount:r.length};if(!a){k(se,{...o,outcome:`no-target`});return}let s=i(n,`outline`,()=>{e.dispatch({selection:Z.cursor(a.from),effects:F.scrollIntoView(a.from,{y:`start`})}),e.focus()});k(se,{...o,outcome:s?`scrolled`:`declined`,targetLine:e.state.doc.lineAt(a.from).number})}function Ft(e,t,n,r){requestAnimationFrame(()=>{if(!n())return;let a=e.state.doc,o=Math.min(t.offset,a.length);i(r,`raw-mdx`,()=>{e.dispatch({selection:Z.cursor(o),effects:F.scrollIntoView(o,{y:`center`})}),e.focus()})})}function It(e,t,n){let r=e.state.doc,a=Math.min(Math.max(t.line,1),r.lines),o=r.line(a),s=Math.min(o.from+Math.max(0,t.column-1),o.to);return i(n,`problems-row`,()=>{e.dispatch({selection:Z.cursor(s),effects:F.scrollIntoView(s,{y:`start`})}),e.focus()})}function Lt(e){let t=(0,He.c)(51),{docName:n,ytext:i,provider:s,placeholder:c,isSourceModeActive:l}=e,u=(0,Q.useRef)(null),d=(0,Q.useRef)(null),[f,p]=(0,Q.useState)(null);if(f)throw f;let{resolvedTheme:h}=m(),{merged:g}=_(),y=(0,Q.useRef)(l),b=g?.editor?.wordWrap??!0,{data:x}=Me(n),S;t[0]!==x?.effective||t[1]!==g?(S=x?.effective??(g?.contentRules?Ae(g.contentRules):je),t[0]=x?.effective,t[1]=g,t[2]=S):S=t[2];let C=S,w;t[3]===C?w=t[4]:(w=JSON.stringify(C),t[3]=C,t[4]=w);let T=w,E=(0,Q.useRef)(null),D;t[5]!==n||t[6]!==l||t[7]!==C||t[8]!==c||t[9]!==s||t[10]!==h||t[11]!==b||t[12]!==i?(D=()=>{let e=u.current;if(!e)return;let t=s.configuration.name??``,f,m=zt;try{f=te({docName:t,container:e,sizeStats:{viewCount:0,bytes:i.length},factory:e=>{let l=null,u=new ge(i);try{let te=o({ydoc:s.document,ytext:i,docName:t}),d=new N,f=new N,p=new N,g=new N,_=new F({state:_e.create({doc:i.toString(),extensions:[st,Ye,Ie({scrollToMatch:e=>a(t,`find-match`)?F.scrollIntoView(e,{y:`start`}):Mt.of(null)}),ye.of([xe]),Ve(i,s.awareness,{undoManager:u}),ye.of(Be),kt({docName:t,ytext:i,undoManager:u}),...me({themeCompartment:d,resolvedTheme:h,ydoc:s.document,wordWrapCompartment:f,wordWrap:b,currentDocName:t}),Tt(),Ge(t),ne(),g.of(it(C,n)),rt(n),te,F.updateListener.of(e=>{r(e)&&ee(t)}),F.updateListener.of(e=>{!e.selectionSet&&!e.docChanged||(l!==null&&clearTimeout(l),l=setTimeout(()=>{l=null,ue(t,`source`,ae(e.view)),Oe(t,`source`,De(e.view,t))},120))}),p.of(ve(c??``)),F.theme({"&":{height:`100%`}}),F.scrollMargins.of(Rt)]}),parent:e});ue(t,`source`,ae(_)),Oe(t,`source`,De(_,t));let v=_.contentDOM;return v.addEventListener(`keydown`,m),v.addEventListener(`paste`,m),v.addEventListener(`drop`,m),v.addEventListener(`cut`,m),{view:_,ydoc:s.document,ytext:i,provider:s,undoManager:u,themeCompartment:d,wordWrapCompartment:f,placeholderCompartment:p,lintCompartment:g}}catch(e){let t=e;throw u.destroy(),t}}}),E.current=f,d.current=f.view,At(f.view,l),fe(n,f.view,`sourceEditor`),le()&&f.view.focus()}catch(e){let t=e;console.error(`[SourceEditor] mountCmEditor failed`,t),E.current=null,d.current=null,p(t instanceof Error?t:Error(String(t)))}return()=>{let e=E.current;E.current=null,d.current=null,e&&Nt(n,e)}},t[5]=n,t[6]=l,t[7]=C,t[8]=c,t[9]=s,t[10]=h,t[11]=b,t[12]=i,t[13]=D):D=t[13];let O;t[14]!==s||t[15]!==i?(O=[i,s],t[14]=s,t[15]=i,t[16]=O):O=t[16],(0,Q.useEffect)(D,O);let A,j;t[17]===l?(A=t[18],j=t[19]):(A=()=>{y.current=l;let e=d.current;e&&At(e,l)},j=[l],t[17]=l,t[18]=A,t[19]=j),(0,Q.useEffect)(A,j);let M,P;t[20]===n?(M=t[21],P=t[22]):(M=()=>{},P=[n],t[20]=n,t[21]=M,t[22]=P),(0,Q.useEffect)(M,P);let I,L;t[23]===h?(I=t[24],L=t[25]):(L=()=>{let e=E.current;e&&e.view.dispatch({effects:e.themeCompartment.reconfigure(h===`dark`?pe:he)})},I=[h],t[23]=h,t[24]=I,t[25]=L),(0,Q.useEffect)(L,I);let R,z;t[26]===b?(R=t[27],z=t[28]):(R=()=>{let e=E.current;e&&e.view.dispatch({effects:e.wordWrapCompartment.reconfigure(b?F.lineWrapping:[])})},z=[b],t[26]=b,t[27]=R,t[28]=z),(0,Q.useEffect)(R,z);let B,V;t[29]===c?(B=t[30],V=t[31]):(B=()=>{let e=E.current;e&&e.view.dispatch({effects:e.placeholderCompartment.reconfigure(ve(c??``))})},V=[c],t[29]=c,t[30]=B,t[31]=V),(0,Q.useEffect)(B,V);let H;t[32]!==n||t[33]!==C?(H=()=>{let e=E.current;e&&e.view.dispatch({effects:e.lintCompartment.reconfigure(it(C,n))})},t[32]=n,t[33]=C,t[34]=H):H=t[34];let U;t[35]===T?U=t[36]:(U=[T],t[35]=T,t[36]=U),(0,Q.useEffect)(H,U);let W,G;t[37]!==n||t[38]!==l?(W=()=>{let e=function(e){let t=e.detail;if(!t||t.docName!==n||t.mode!==`source`||!l)return;let r=d.current;if(!r){k(se,{docName:n,mode:`source`,index:t.index,outcome:`no-view`});return}Pt(r,t,n),v(n)};return window.addEventListener(ce,e),()=>window.removeEventListener(ce,e)},G=[n,l],t[37]=n,t[38]=l,t[39]=W,t[40]=G):(W=t[39],G=t[40]),(0,Q.useEffect)(W,G);let K,q;t[41]!==n||t[42]!==l?(K=()=>{let e=function(e){let t=e.detail;if(!t||t.docName!==n||!l)return;let r=d.current;r&&It(r,t,n)&&v(n)};return window.addEventListener(oe,e),()=>window.removeEventListener(oe,e)},q=[n,l],t[41]=n,t[42]=l,t[43]=K,t[44]=q):(K=t[43],q=t[44]),(0,Q.useEffect)(K,q);let J,Y;t[45]!==n||t[46]!==l||t[47]!==s?(J=()=>{if(!l)return;let e=d.current;if(!e)return;let t=de(n);if(!t)return;if(t.kind!==`selection-offset`){re(n),t.kind===`outline`?Pt(e,t.detail,n):t.kind===`lint`?It(e,t.detail,n):t.kind===`raw-mdx`&&Ft(e,t.detail,()=>y.current,n);return}let r=!1,i=null;return queueMicrotask(()=>{if(r)return;let t=de(n);t?.kind===`selection-offset`&&(i=ie({view:e,docName:n,navigation:t,ydoc:s.document,transition:{from:`wysiwyg`,to:`source`}}),i&&re(n))}),()=>{r=!0,i?.cancel(`mode-flip`)}},Y=[n,l,s],t[45]=n,t[46]=l,t[47]=s,t[48]=J,t[49]=Y):(J=t[48],Y=t[49]),(0,Q.useEffect)(J,Y);let X;return t[50]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,jt.jsx)(`div`,{ref:u,className:`source-editor h-full pb-3`}),t[50]=X):X=t[50],X}function Rt(){return{top:S()}}function zt(){return C()}export{Lt as SourceEditor,Ft as applyRawMdxNavigation};
|