@aiquants/markdown-explorer 0.17.0 → 0.18.0
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/CHANGELOG.md +39 -0
- package/README.md +6 -5
- package/dist/{EditSurface-0owpPyLE.js → EditSurface-B2bzY1b_.js} +3 -3
- package/dist/{EditSurface-D-nhilRk.cjs → EditSurface-BRuIjA9L.cjs} +1 -1
- package/dist/{ExplorerSplit-bpEvHrCo.cjs → ExplorerSplit-BE1VJuok.cjs} +1 -1
- package/dist/{ExplorerSplit-8c93p1hy.js → ExplorerSplit-qAKZsLZa.js} +3 -3
- package/dist/{MultiLayout-BXfzR6XC.cjs → MultiLayout-Bc6RYc3U.cjs} +1 -1
- package/dist/{MultiLayout-Dy3DD_09.js → MultiLayout-rsmtFma5.js} +251 -247
- package/dist/{NativeScrollBar-CI9fTvkt.js → NativeScrollBar-Dq3YeUVY.js} +1 -1
- package/dist/{NativeScrollBar-Ddn0iHjv.cjs → NativeScrollBar-DqTkrnPZ.cjs} +1 -1
- package/dist/{TreeLayout-eFQmzpNj.js → TreeLayout-BPa7NdeT.js} +3 -3
- package/dist/{TreeLayout-CKZ-XQgn.cjs → TreeLayout-DXoEAcpD.cjs} +1 -1
- package/dist/core/geometry.d.cts +1 -1
- package/dist/core/geometry.d.ts +1 -1
- package/dist/core/labels.d.cts +1 -0
- package/dist/core/labels.d.ts +1 -0
- package/dist/{index-h9e3p5Pd.js → index-25s_q0vD.js} +7 -5
- package/dist/{index-5gwNJ8CB.cjs → index-W3iAjkLb.cjs} +4 -4
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/{location-G7psbmv_.js → location-B-m9scLf.js} +82 -82
- package/dist/{location-D85EXiPt.cjs → location-BVEN_Ihk.cjs} +1 -1
- package/dist/{merge-CS3p9BVw.js → merge-B9jrWxMa.js} +1 -1
- package/dist/{merge-C_g05UGC.cjs → merge-DuTAponF.cjs} +1 -1
- package/dist/server.cjs +1 -1
- package/dist/server.js +1 -1
- package/dist/styles/markdown-explorer.css +1 -1
- package/dist/{useSplitPersistence-DRjsPZdH.cjs → useSplitPersistence-Ba-v64n-.cjs} +1 -1
- package/dist/{useSplitPersistence-B1b5Lg5E.js → useSplitPersistence-Cc4tDxB4.js} +1 -1
- package/docs/behavior/dom-hooks.md +1 -1
- package/docs/behavior/layout.md +16 -11
- package/docs/behavior/localization.md +2 -1
- package/package.json +5 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as p } from "react/jsx-runtime";
|
|
2
2
|
import { ScrollBar as m } from "@aiquants/virtualscroll";
|
|
3
3
|
import { useCallback as b, useMemo as S, useSyncExternalStore as h } from "react";
|
|
4
|
-
import { u as T } from "./index-
|
|
4
|
+
import { u as T } from "./index-25s_q0vD.js";
|
|
5
5
|
import { N as f } from "./scrollBarGeometry-DOBdGNV-.js";
|
|
6
6
|
import { T as d, N as v } from "./tapScrollCircle-u4EXeLhx.js";
|
|
7
7
|
const u = (e) => ({ scrollTop: e.scrollTop, scrollHeight: e.scrollHeight, clientHeight: e.clientHeight }), g = (e, t) => e.scrollTop === t.scrollTop && e.scrollHeight === t.scrollHeight && e.clientHeight === t.clientHeight, C = (e) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("react/jsx-runtime"),h=require("@aiquants/virtualscroll"),a=require("react"),v=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("react/jsx-runtime"),h=require("@aiquants/virtualscroll"),a=require("react"),v=require("./index-W3iAjkLb.cjs"),g=require("./scrollBarGeometry-C46jBtmM.cjs"),S=require("./tapScrollCircle-C5DGI-0H.cjs"),p=e=>({scrollTop:e.scrollTop,scrollHeight:e.scrollHeight,clientHeight:e.clientHeight}),m=(e,t)=>e.scrollTop===t.scrollTop&&e.scrollHeight===t.scrollHeight&&e.clientHeight===t.clientHeight,f=e=>{let t=p(e);return{getSnapshot:()=>t,subscribe:s=>{const o=()=>{const i=p(e);m(t,i)||(t=i,s())};let n=0;const c=()=>{n===0&&(n=requestAnimationFrame(()=>{n=0,o()}))},r=typeof ResizeObserver>"u"?null:new ResizeObserver(c),l=()=>{if(r!==null){r.disconnect(),r.observe(e);for(const i of e.children)r.observe(i)}};l();const u=typeof MutationObserver>"u"?null:new MutationObserver(()=>{l(),c()});return u?.observe(e,{childList:!0}),e.addEventListener("scroll",o,{passive:!0}),o(),()=>{e.removeEventListener("scroll",o),u?.disconnect(),r?.disconnect(),cancelAnimationFrame(n)}}}},b=e=>{const t=a.useMemo(()=>f(e),[e]);return a.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot)},d=(e,t)=>{const s=typeof t=="function"?t(e.scrollTop):t;return e.scrollTo({top:s,behavior:"instant"}),e.scrollTop},C=({scroller:e,withCircle:t})=>{const{locale:s}=v.useExplorer(),{scrollTop:o,scrollHeight:n,clientHeight:c}=b(e),r=a.useCallback(l=>d(e,l),[e]);return T.jsx(h.ScrollBar,{contentSize:n,viewportSize:c,scrollPosition:o,onScroll:r,scrollBarWidth:g.NATIVE_SCROLL_BAR_WIDTH,enableThumbDrag:!0,enableTrackClick:!0,enableArrowButtons:!0,enableArrowButtonTabStops:!1,tapScrollCircleOptions:t?S.TAP_SCROLL_CIRCLE:S.NO_TAP_SCROLL_CIRCLE,locale:s})};exports.NativeScrollBar=C;exports.scrollScrollerTo=d;exports.useScrollerMetrics=b;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as w, jsxs as _ } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo as v, useCallback as m, useSyncExternalStore as C, useEffect as S, useState as M } from "react";
|
|
3
3
|
import { useLocation as A } from "react-router";
|
|
4
|
-
import { e as p, c as L } from "./location-
|
|
5
|
-
import { u as h, r as y, F as G, c as j, N as H, d as q, e as U, D as $, P as z, f as B } from "./index-
|
|
6
|
-
import { E as Y, a as J, b as K } from "./ExplorerSplit-
|
|
4
|
+
import { e as p, c as L } from "./location-B-m9scLf.js";
|
|
5
|
+
import { u as h, r as y, F as G, c as j, N as H, d as q, e as U, D as $, P as z, f as B } from "./index-25s_q0vD.js";
|
|
6
|
+
import { E as Y, a as J, b as K } from "./ExplorerSplit-qAKZsLZa.js";
|
|
7
7
|
const Q = (t, e) => t.claim !== e.claim || t.readme.status !== e.readme.status ? !1 : t.readme.status === "failed" && e.readme.status === "failed" ? t.readme.failure === e.readme.failure : t.readme.status === "ok" && e.readme.status === "ok" ? t.readme.readme === e.readme.readme : !0, V = (t, e, n) => {
|
|
8
8
|
let r = null;
|
|
9
9
|
return () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react/jsx-runtime"),u=require("react"),T=require("react-router"),p=require("./location-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react/jsx-runtime"),u=require("react"),T=require("react-router"),p=require("./location-BVEN_Ihk.cjs"),d=require("./index-W3iAjkLb.cjs"),x=require("./ExplorerSplit-BE1VJuok.cjs"),P=(t,e)=>t.claim!==e.claim||t.readme.status!==e.readme.status?!1:t.readme.status==="failed"&&e.readme.status==="failed"?t.readme.failure===e.readme.failure:t.readme.status==="ok"&&e.readme.status==="ok"?t.readme.readme===e.readme.readme:!0,F=(t,e,n)=>{let r=null;return()=>{const a=t.version(),c=t.read(e),o=c.status!=="pending";if(r!==null&&r.version===a&&r.tree===c&&r.settled===o)return r.state;const l=d.readFolderReadme(t,e,n),s=r!==null&&P(r.state,l)?r.state:l;return r={version:a,tree:c,settled:o,state:s},s}},_=(t,e,n)=>{let r=!0,a=null;const c=()=>{r&&n()},o=()=>{const s=t.read(e);s===a||s.status!=="pending"||(a=s,s.then(c,c))};o();const l=t.subscribe(()=>{o(),n()});return()=>{r=!1,l()}},j=()=>d.FOLDER_README_LOADING,q=(t,e)=>{const{trees:n}=d.useExplorer(),r=u.useMemo(()=>e===null?null:F(n,t,e),[n,t,e]),a=u.useCallback(f=>r===null?()=>{}:_(n,t,f),[r,n,t]),c=u.useCallback(()=>r===null?null:r(),[r]),o=u.useCallback(()=>r===null?null:j(),[r]),l=u.useSyncExternalStore(a,c,o),s=l?.claim===!0;return u.useEffect(()=>e===null?void 0:n.open(t),[n,t,e]),u.useEffect(()=>e===null||!s?void 0:n.claimChildren(t,new Map([[e,"direct"]])),[n,t,e,s]),l===null?null:l.readme},y=new Set,H=Object.freeze({kind:"loading"}),L=(t,e)=>e.status==="loading"?H:e.status==="failed"?{kind:"failure",folder:t,failure:e.failure,onRetry:e.retry}:{kind:"no-readme",folder:t},A=({location:t})=>{const{config:e}=d.useExplorer(),n=d.useExplorerNavigate(),{hash:r}=T.useLocation(),{source:a,doc:c,folder:o,overrides:l,markup:s}=t,[f,S]=u.useState(x.EMPTY_SELECTION),w=u.useMemo(()=>({gathered:f,onGatheredChange:S}),[f]),v=q(a,o),i=v===null?c:v.status==="ok"?v.readme:null,k=u.useMemo(()=>o===null||v===null?d.NO_DOCUMENT:L(o,v),[o,v]),h=u.useCallback(m=>n(p.explorerHref(e,{view:"tree",source:a,doc:m,overrides:l}),"browse"),[n,e,a,l]),O=u.useCallback(m=>n(p.explorerHref(e,{view:"tree",source:a,folder:m,overrides:l}),"browse"),[n,e,a,l]),g=u.useCallback(m=>n(p.explorerHref(e,{view:"tree",source:m,doc:c,folder:o,overrides:l,markup:s}),"switch-source"),[n,e,c,o,l,s]),C=u.useCallback(m=>n(`${p.explorerHref(e,{view:"tree",source:m,doc:c,folder:o,overrides:l,markup:s})}${r}`,"browse"),[n,e,c,o,l,s,r]),R=u.useCallback(m=>{const E=p.canonicalMultiDocuments(e,m);n(p.explorerHref(e,{view:"multi",source:a,docs:E,markup:s&&i!==null&&E.includes(i)?[i]:[]}),"switch-view")},[n,e,a,i,s]),M=u.useMemo(()=>({href:p.explorerHref(e,i===null?{view:"multi",source:a}:{view:"multi",source:a,docs:[i],markup:s?[i]:[]}),target:"multi"}),[e,a,i,s]),D=u.useMemo(()=>({kind:"page",view:"tree",overrides:l,embed:{}}),[l]),N=d.usePageMarkupToggle(t);return b.jsx(x.ExplorerSplit,{view:"tree",explorer:b.jsx(x.ExplorerPane,{mode:"tree",sourceId:a,currentPath:o===null?c:o,openPaths:y,onOpenDocument:h,onOpenFolder:O,currentFolder:o!==null,onSourceChange:g,onRevealSource:C,viewSwitch:M,tray:w,onOpenSelection:R}),content:b.jsxs("div",{className:"aqmx-document-column aqmx-tree-document",...d.CONTENT_PANE,children:[i===null?null:b.jsx(d.DocumentRefreshBar,{path:i,placement:d.PAGE_DOCUMENT_REFRESH,markup:N}),b.jsx(d.DocumentPane,{path:i,absence:k,markup:s,variant:D})]})})};exports.TreeLayout=A;
|
package/dist/core/geometry.d.cts
CHANGED
|
@@ -27,7 +27,7 @@ export declare const FIBONACCI_DURATIONS_MS: readonly [
|
|
|
27
27
|
233,
|
|
28
28
|
377
|
|
29
29
|
];
|
|
30
|
-
export declare const CONTROL_BLOCK_PIXELS =
|
|
30
|
+
export declare const CONTROL_BLOCK_PIXELS = 44;
|
|
31
31
|
export declare const COARSE_TARGET_PIXELS = 44;
|
|
32
32
|
export declare const FINE_TARGET_PIXELS = 24;
|
|
33
33
|
export declare const PANEL_MAX_BLOCK_RATIO: number;
|
package/dist/core/geometry.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export declare const FIBONACCI_DURATIONS_MS: readonly [
|
|
|
27
27
|
233,
|
|
28
28
|
377
|
|
29
29
|
];
|
|
30
|
-
export declare const CONTROL_BLOCK_PIXELS =
|
|
30
|
+
export declare const CONTROL_BLOCK_PIXELS = 44;
|
|
31
31
|
export declare const COARSE_TARGET_PIXELS = 44;
|
|
32
32
|
export declare const FINE_TARGET_PIXELS = 24;
|
|
33
33
|
export declare const PANEL_MAX_BLOCK_RATIO: number;
|
package/dist/core/labels.d.cts
CHANGED
|
@@ -247,6 +247,7 @@ export type MarkdownExplorerLabels = {
|
|
|
247
247
|
readonly panelSwitchToCustomDrag: string;
|
|
248
248
|
readonly panelSwitchToNormalDrag: string;
|
|
249
249
|
readonly panelCustomDragBadge: string;
|
|
250
|
+
readonly panelMove: string;
|
|
250
251
|
readonly panelMovePreviousColumn: string;
|
|
251
252
|
readonly panelMoveNextColumn: string;
|
|
252
253
|
readonly panelMoveUp: string;
|
package/dist/core/labels.d.ts
CHANGED
|
@@ -247,6 +247,7 @@ export type MarkdownExplorerLabels = {
|
|
|
247
247
|
readonly panelSwitchToCustomDrag: string;
|
|
248
248
|
readonly panelSwitchToNormalDrag: string;
|
|
249
249
|
readonly panelCustomDragBadge: string;
|
|
250
|
+
readonly panelMove: string;
|
|
250
251
|
readonly panelMovePreviousColumn: string;
|
|
251
252
|
readonly panelMoveNextColumn: string;
|
|
252
253
|
readonly panelMoveUp: string;
|
|
@@ -2,7 +2,7 @@ import { jsxs as F, jsx as c, Fragment as Pe } from "react/jsx-runtime";
|
|
|
2
2
|
import * as y from "react";
|
|
3
3
|
import { createContext as pe, use as ne, useMemo as G, useSyncExternalStore as ee, useRef as _, useLayoutEffect as H, useCallback as P, useId as Se, useEffect as te, Component as tn, Suspense as ke, lazy as it, useState as B, useEffectEvent as le } from "react";
|
|
4
4
|
import { useParams as _n, useSearchParams as In, matchPath as Bn, useBlocker as zn, useNavigate as jn, Link as Hn, useHref as $e, useLocation as nn, useRevalidator as Vn } from "react-router";
|
|
5
|
-
import { j as Un, g as rn, z as Zn, E as on, a as ln, B as Gn, D as wt, G as Wn, H as be, e as ye, I as Kn, J as Xn, K as gt, L as Yn, M as bt, O as Jn, w as Qn, Q as er } from "./location-
|
|
5
|
+
import { j as Un, g as rn, z as Zn, E as on, a as ln, B as Gn, D as wt, G as Wn, H as be, e as ye, I as Kn, J as Xn, K as gt, L as Yn, M as bt, O as Jn, w as Qn, Q as er } from "./location-B-m9scLf.js";
|
|
6
6
|
import { F as se, i as tr, G as nr, y as J, x as rr, H as Et, z as Ve, I as or, J as ir, K as lr, L as ar, N as sr, f as cr, O as yt, v as dr, P as ur, Q as fr, R as mr, B as hr, w as pr, S as vr, T as wr, U as gr, u as xt } from "./dataRoute-CObbjNxG.js";
|
|
7
7
|
import { HostedScrollArea as St, useMarkdownToolbarState as br, MarkdownViewer as an } from "@aiquants/markdown";
|
|
8
8
|
import { SOURCE_LINES_ATTRIBUTE as sn, parseSourceLines as Er } from "@aiquants/markdown/source-lines";
|
|
@@ -261,6 +261,7 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
261
261
|
panelSwitchToCustomDrag: "Switch to the custom drag mode",
|
|
262
262
|
panelSwitchToNormalDrag: "Back to the normal drag mode",
|
|
263
263
|
panelCustomDragBadge: "Custom",
|
|
264
|
+
panelMove: "Move the panel",
|
|
264
265
|
panelMovePreviousColumn: "Move to the previous column",
|
|
265
266
|
panelMoveNextColumn: "Move to the next column",
|
|
266
267
|
panelMoveUp: "Move up",
|
|
@@ -521,6 +522,7 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
521
522
|
panelSwitchToCustomDrag: "カスタムのドラッグの方式に切り替え",
|
|
522
523
|
panelSwitchToNormalDrag: "通常のドラッグの方式に戻す",
|
|
523
524
|
panelCustomDragBadge: "カスタム",
|
|
525
|
+
panelMove: "パネルを移動",
|
|
524
526
|
panelMovePreviousColumn: "前の列へ移動",
|
|
525
527
|
panelMoveNextColumn: "次の列へ移動",
|
|
526
528
|
panelMoveUp: "上へ移動",
|
|
@@ -738,7 +740,7 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
738
740
|
E(a, s, { kind: "failed", failure: j.failure });
|
|
739
741
|
return;
|
|
740
742
|
}
|
|
741
|
-
const { mergeDraft: Y } = await import("./merge-
|
|
743
|
+
const { mergeDraft: Y } = await import("./merge-B9jrWxMa.js");
|
|
742
744
|
if (!R(a, s) || C.aborted) return;
|
|
743
745
|
const V = m.get(a);
|
|
744
746
|
V?.flush();
|
|
@@ -1060,7 +1062,7 @@ function co({
|
|
|
1060
1062
|
}
|
|
1061
1063
|
const uo = /* @__PURE__ */ y.forwardRef(co);
|
|
1062
1064
|
let Ge = null;
|
|
1063
|
-
const yn = () => (Ge ??= import("./EditSurface-
|
|
1065
|
+
const yn = () => (Ge ??= import("./EditSurface-B2bzY1b_.js").catch((e) => {
|
|
1064
1066
|
throw Ge = null, e;
|
|
1065
1067
|
}), Ge), fo = () => {
|
|
1066
1068
|
yn().catch(() => {
|
|
@@ -1237,7 +1239,7 @@ const at = `[${sn}]`, po = "[data-aqmd-content]", vo = 'a[href], button, input,
|
|
|
1237
1239
|
}),
|
|
1238
1240
|
[u, m]
|
|
1239
1241
|
);
|
|
1240
|
-
}, Ao = it(() => import("./NativeScrollBar-
|
|
1242
|
+
}, Ao = it(() => import("./NativeScrollBar-Dq3YeUVY.js").then((e) => ({ default: e.NativeScrollBar })));
|
|
1241
1243
|
class No extends tn {
|
|
1242
1244
|
state = { failed: !1 };
|
|
1243
1245
|
static getDerivedStateFromError() {
|
|
@@ -3415,7 +3417,7 @@ const ga = () => {
|
|
|
3415
3417
|
});
|
|
3416
3418
|
return u.observe(l, { childList: !0, subtree: !0 }), () => u.disconnect();
|
|
3417
3419
|
}, [t, e]);
|
|
3418
|
-
}, Ma = it(() => import("./TreeLayout-
|
|
3420
|
+
}, Ma = it(() => import("./TreeLayout-BPa7NdeT.js").then((e) => ({ default: e.TreeLayout }))), Oa = it(() => import("./MultiLayout-rsmtFma5.js").then((e) => ({ default: e.MultiLayout }))), Ca = 64, La = {
|
|
3419
3421
|
request: (e) => {
|
|
3420
3422
|
requestAnimationFrame(e);
|
|
3421
3423
|
}
|