@aiquants/markdown-explorer 0.26.0 → 0.28.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 +71 -0
- package/README.md +45 -26
- package/dist/{EditSurface-Blymamic.js → EditSurface-BYKUL-a1.js} +32 -32
- package/dist/{EditSurface-Co4Rvfa1.cjs → EditSurface-wXPvuB2n.cjs} +2 -2
- package/dist/{ExplorerSplit-BZ0PA3z3.js → ExplorerSplit-Bz-1G42e.js} +94 -94
- package/dist/{ExplorerSplit-WApgYMPb.cjs → ExplorerSplit-CLxr4_0K.cjs} +1 -1
- package/dist/MultiLayout-Coc-HQUb.cjs +1 -0
- package/dist/{MultiLayout-B5-1N3JD.js → MultiLayout-DpxzsXKz.js} +167 -168
- package/dist/NativeScrollBar-CDgYgxXK.cjs +1 -0
- package/dist/{NativeScrollBar-BraWuZvN.js → NativeScrollBar-DLdveoaN.js} +6 -7
- package/dist/{TreeLayout-CChoxh9W.js → TreeLayout-C8TuS9ue.js} +9 -9
- package/dist/{TreeLayout-C60lb9hP.cjs → TreeLayout-CJrJNZHq.cjs} +1 -1
- package/dist/core/config.d.cts +7 -0
- package/dist/core/config.d.ts +7 -0
- package/dist/core/contracts.d.cts +8 -2
- package/dist/core/contracts.d.ts +8 -2
- package/dist/core/dataRoute.d.cts +40 -0
- package/dist/core/dataRoute.d.ts +40 -0
- package/dist/core/labels.d.cts +10 -1
- package/dist/core/labels.d.ts +10 -1
- package/dist/{dataRoute-BEvesOvN.js → dataRoute-DLhQfdoW.js} +111 -103
- package/dist/dataRoute-DwYtgyt6.cjs +1 -0
- package/dist/index-CdYr9OQ-.js +4805 -0
- package/dist/index-CjyRD7qg.cjs +15 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +29 -28
- package/dist/{location-DIxIjqs7.js → location-CKuabtKl.js} +152 -147
- package/dist/location-l_HysaZR.cjs +1 -0
- package/dist/{merge-CgSp-0Dd.js → merge-BQgbDcHR.js} +1 -1
- package/dist/{merge-DRWmjC24.cjs → merge-DRLuveD9.cjs} +1 -1
- package/dist/{sanitizePolicy-gVKBhabq.js → sanitizePolicy-By0tKOpZ.js} +1 -1
- package/dist/{sanitizePolicy-CZwOaJ92.cjs → sanitizePolicy-T5T-3vV5.cjs} +1 -1
- package/dist/sanitizeWorker.cjs +1 -1
- package/dist/sanitizeWorker.js +1 -1
- package/dist/server/ports.d.cts +4 -3
- package/dist/server/ports.d.ts +4 -3
- package/dist/server.cjs +1 -1
- package/dist/server.js +500 -493
- package/dist/styles/markdown-explorer.css +1 -1
- package/dist/tapScrollCircle-B2A6CmmI.js +13 -0
- package/dist/tapScrollCircle-qD8iSmfq.cjs +1 -0
- package/dist/{useSplitPersistence-D-T75Hlh.cjs → useSplitPersistence-9Nu6J1WF.cjs} +1 -1
- package/dist/{useSplitPersistence-Df63lnQZ.js → useSplitPersistence-Bf4M35Il.js} +1 -1
- package/docs/behavior/dom-hooks.md +10 -6
- package/docs/behavior/layout.md +12 -4
- package/docs/behavior/localization.md +5 -2
- package/docs/behavior/security.md +7 -2
- package/docs/behavior/url-contract.md +3 -3
- package/package.json +5 -5
- package/dist/MultiLayout-dAW_JCzg.cjs +0 -1
- package/dist/NativeScrollBar-ThVMbI0Y.cjs +0 -1
- package/dist/dataRoute-Cv7fgCW7.cjs +0 -1
- package/dist/index-B6FkGD-p.cjs +0 -13
- package/dist/index-Bd6hgisa.js +0 -4097
- package/dist/location-D3DgoELB.cjs +0 -1
- package/dist/scrollBarGeometry-C46jBtmM.cjs +0 -1
- package/dist/scrollBarGeometry-DOBdGNV-.js +0 -4
- package/dist/tapScrollCircle-C5DGI-0H.cjs +0 -1
- package/dist/tapScrollCircle-u4EXeLhx.js +0 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react/jsx-runtime"),v=require("@aiquants/virtualscroll"),a=require("react"),S=require("./index-CjyRD7qg.cjs"),p=require("./tapScrollCircle-qD8iSmfq.cjs"),b=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,m=e=>{let t=b(e);return{getSnapshot:()=>t,subscribe:s=>{const o=()=>{const i=b(e);g(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)}}}},d=e=>{const t=a.useMemo(()=>m(e),[e]);return a.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot)},T=(e,t)=>{const s=typeof t=="function"?t(e.scrollTop):t;return e.scrollTo({top:s,behavior:"instant"}),e.scrollTop},f=({scroller:e,withCircle:t})=>{const{locale:s}=S.useExplorer(),{scrollTop:o,scrollHeight:n,clientHeight:c}=d(e),r=a.useCallback(l=>T(e,l),[e]);return h.jsx(v.ScrollBar,{contentSize:n,viewportSize:c,scrollPosition:o,onScroll:r,scrollBarWidth:S.NATIVE_SCROLL_BAR_WIDTH,enableThumbDrag:!0,enableTrackClick:!0,enableArrowButtons:!0,enableArrowButtonTabStops:!1,tapScrollCircleOptions:t?p.TAP_SCROLL_CIRCLE:p.NO_TAP_SCROLL_CIRCLE,locale:s})};exports.NativeScrollBar=f;exports.scrollScrollerTo=T;exports.useScrollerMetrics=d;
|
|
@@ -1,9 +1,8 @@
|
|
|
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-
|
|
5
|
-
import {
|
|
6
|
-
import { T as d, N as v } from "./tapScrollCircle-u4EXeLhx.js";
|
|
4
|
+
import { u as T, N as d } from "./index-CdYr9OQ-.js";
|
|
5
|
+
import { T as f, N as v } from "./tapScrollCircle-B2A6CmmI.js";
|
|
7
6
|
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) => {
|
|
8
7
|
let t = u(e);
|
|
9
8
|
return {
|
|
@@ -39,7 +38,7 @@ const u = (e) => ({ scrollTop: e.scrollTop, scrollHeight: e.scrollHeight, client
|
|
|
39
38
|
}, L = (e, t) => {
|
|
40
39
|
const s = typeof t == "function" ? t(e.scrollTop) : t;
|
|
41
40
|
return e.scrollTo({ top: s, behavior: "instant" }), e.scrollTop;
|
|
42
|
-
},
|
|
41
|
+
}, B = ({ scroller: e, withCircle: t }) => {
|
|
43
42
|
const { locale: s } = T(), { scrollTop: r, scrollHeight: n, clientHeight: c } = H(e), o = b((i) => L(e, i), [e]);
|
|
44
43
|
return /* @__PURE__ */ p(
|
|
45
44
|
m,
|
|
@@ -48,18 +47,18 @@ const u = (e) => ({ scrollTop: e.scrollTop, scrollHeight: e.scrollHeight, client
|
|
|
48
47
|
viewportSize: c,
|
|
49
48
|
scrollPosition: r,
|
|
50
49
|
onScroll: o,
|
|
51
|
-
scrollBarWidth:
|
|
50
|
+
scrollBarWidth: d,
|
|
52
51
|
enableThumbDrag: !0,
|
|
53
52
|
enableTrackClick: !0,
|
|
54
53
|
enableArrowButtons: !0,
|
|
55
54
|
enableArrowButtonTabStops: !1,
|
|
56
|
-
tapScrollCircleOptions: t ?
|
|
55
|
+
tapScrollCircleOptions: t ? f : v,
|
|
57
56
|
locale: s
|
|
58
57
|
}
|
|
59
58
|
);
|
|
60
59
|
};
|
|
61
60
|
export {
|
|
62
|
-
|
|
61
|
+
B as NativeScrollBar,
|
|
63
62
|
L as scrollScrollerTo,
|
|
64
63
|
H as useScrollerMetrics
|
|
65
64
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as w, jsxs as _ } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo as v, useCallback as m, useSyncExternalStore as C, useEffect as
|
|
2
|
+
import { useMemo as v, useCallback as m, useSyncExternalStore as C, useEffect as h, 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
|
|
6
|
-
import { E as Y, a as J, b as K } from "./ExplorerSplit-
|
|
4
|
+
import { e as p, c as L } from "./location-CKuabtKl.js";
|
|
5
|
+
import { u as S, r as y, F as G, d as j, e as H, f as q, g as U, D as $, P as z, h as B } from "./index-CdYr9OQ-.js";
|
|
6
|
+
import { E as Y, a as J, b as K } from "./ExplorerSplit-Bz-1G42e.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 () => {
|
|
@@ -28,11 +28,11 @@ const Q = (t, e) => t.claim !== e.claim || t.readme.status !== e.readme.status ?
|
|
|
28
28
|
r = !1, u();
|
|
29
29
|
};
|
|
30
30
|
}, X = () => G, Z = (t, e) => {
|
|
31
|
-
const { trees: n } =
|
|
31
|
+
const { trees: n } = S(), r = v(() => e === null ? null : V(n, t, e), [n, t, e]), a = m((f) => r === null ? () => {
|
|
32
32
|
} : W(n, t, f), [r, n, t]), l = m(() => r === null ? null : r(), [r]), o = m(() => r === null ? null : X(), [r]), u = C(a, l, o), s = u?.claim === !0;
|
|
33
|
-
return
|
|
33
|
+
return h(() => e === null ? void 0 : n.open(t), [n, t, e]), h(() => e === null || !s ? void 0 : n.claimChildren(t, /* @__PURE__ */ new Map([[e, "direct"]])), [n, t, e, s]), u === null ? null : u.readme;
|
|
34
34
|
}, I = /* @__PURE__ */ new Set(), ee = Object.freeze({ kind: "loading" }), te = (t, e) => e.status === "loading" ? ee : e.status === "failed" ? { kind: "failure", folder: t, failure: e.failure, onRetry: e.retry } : { kind: "no-readme", folder: t }, le = ({ location: t }) => {
|
|
35
|
-
const { config: e } =
|
|
35
|
+
const { config: e } = S(), n = j(), { hash: r } = A(), { source: a, doc: l, folder: o, overrides: u, markup: s } = t, [f, b] = M(Y), O = v(() => ({ gathered: f, onGatheredChange: b }), [f]), d = Z(a, o), c = d === null ? l : d.status === "ok" ? d.readme : null, g = v(() => o === null || d === null ? H : te(o, d), [o, d]), k = m((i) => n(p(e, { view: "tree", source: a, doc: i, overrides: u }), "browse"), [n, e, a, u]), x = m((i) => n(p(e, { view: "tree", source: a, folder: i, overrides: u }), "browse"), [n, e, a, u]), D = m((i) => n(p(e, { view: "tree", source: i, doc: l, folder: o, overrides: u, markup: s }), "switch-source"), [n, e, l, o, u, s]), N = m((i) => n(`${p(e, { view: "tree", source: i, doc: l, folder: o, overrides: u, markup: s })}${r}`, "browse"), [n, e, l, o, u, s, r]), R = m(
|
|
36
36
|
(i) => {
|
|
37
37
|
const E = L(e, i);
|
|
38
38
|
n(p(e, { view: "multi", source: a, docs: E, markup: s && c !== null && E.includes(c) ? [c] : [] }), "switch-view");
|
|
@@ -50,7 +50,7 @@ const Q = (t, e) => t.claim !== e.claim || t.readme.status !== e.readme.status ?
|
|
|
50
50
|
sourceId: a,
|
|
51
51
|
currentPath: o === null ? l : o,
|
|
52
52
|
openPaths: I,
|
|
53
|
-
onOpenDocument:
|
|
53
|
+
onOpenDocument: k,
|
|
54
54
|
onOpenFolder: x,
|
|
55
55
|
currentFolder: o !== null,
|
|
56
56
|
onSourceChange: D,
|
|
@@ -62,7 +62,7 @@ const Q = (t, e) => t.claim !== e.claim || t.readme.status !== e.readme.status ?
|
|
|
62
62
|
),
|
|
63
63
|
content: /* @__PURE__ */ _("div", { className: "aqmx-document-column aqmx-tree-document", ...U, children: [
|
|
64
64
|
c === null ? null : /* @__PURE__ */ w($, { path: c, placement: z, markup: T }),
|
|
65
|
-
/* @__PURE__ */ w(B, { path: c, absence:
|
|
65
|
+
/* @__PURE__ */ w(B, { path: c, absence: g, markup: s, variant: P })
|
|
66
66
|
] })
|
|
67
67
|
}
|
|
68
68
|
);
|
|
@@ -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-l_HysaZR.cjs"),d=require("./index-CjyRD7qg.cjs"),x=require("./ExplorerSplit-CLxr4_0K.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/config.d.cts
CHANGED
|
@@ -35,6 +35,7 @@ export type ExplorerConfigInput = {
|
|
|
35
35
|
readonly legacyTextEncoding?: string;
|
|
36
36
|
readonly spreadsheets?: {
|
|
37
37
|
readonly maxBytes?: number;
|
|
38
|
+
readonly maxWorkbookBytes?: number;
|
|
38
39
|
};
|
|
39
40
|
};
|
|
40
41
|
export type ExplorerConfig = {
|
|
@@ -60,6 +61,7 @@ export type ExplorerConfig = {
|
|
|
60
61
|
readonly legacyTextEncoding: string | null;
|
|
61
62
|
readonly spreadsheets: {
|
|
62
63
|
readonly maxBytes: number;
|
|
64
|
+
readonly maxWorkbookBytes: number;
|
|
63
65
|
};
|
|
64
66
|
};
|
|
65
67
|
export declare const DEFAULT_VIEW_SLUGS: ExplorerViewSlugs;
|
|
@@ -93,6 +95,11 @@ export declare const SPREADSHEET_BYTE_LIMITS: Readonly<{
|
|
|
93
95
|
min: 1;
|
|
94
96
|
max: number;
|
|
95
97
|
}>;
|
|
98
|
+
export declare const WORKBOOK_BYTE_LIMITS: Readonly<{
|
|
99
|
+
default: number;
|
|
100
|
+
min: 1;
|
|
101
|
+
max: number;
|
|
102
|
+
}>;
|
|
96
103
|
export declare const defineExplorerConfig: (input: ExplorerConfigInput) => ExplorerConfig;
|
|
97
104
|
export declare const revalidateExplorerConfig: (config: ExplorerConfig) => ExplorerConfig;
|
|
98
105
|
export declare const isExplorerSourceId: (value: unknown) => value is string;
|
package/dist/core/config.d.ts
CHANGED
|
@@ -35,6 +35,7 @@ export type ExplorerConfigInput = {
|
|
|
35
35
|
readonly legacyTextEncoding?: string;
|
|
36
36
|
readonly spreadsheets?: {
|
|
37
37
|
readonly maxBytes?: number;
|
|
38
|
+
readonly maxWorkbookBytes?: number;
|
|
38
39
|
};
|
|
39
40
|
};
|
|
40
41
|
export type ExplorerConfig = {
|
|
@@ -60,6 +61,7 @@ export type ExplorerConfig = {
|
|
|
60
61
|
readonly legacyTextEncoding: string | null;
|
|
61
62
|
readonly spreadsheets: {
|
|
62
63
|
readonly maxBytes: number;
|
|
64
|
+
readonly maxWorkbookBytes: number;
|
|
63
65
|
};
|
|
64
66
|
};
|
|
65
67
|
export declare const DEFAULT_VIEW_SLUGS: ExplorerViewSlugs;
|
|
@@ -93,6 +95,11 @@ export declare const SPREADSHEET_BYTE_LIMITS: Readonly<{
|
|
|
93
95
|
min: 1;
|
|
94
96
|
max: number;
|
|
95
97
|
}>;
|
|
98
|
+
export declare const WORKBOOK_BYTE_LIMITS: Readonly<{
|
|
99
|
+
default: number;
|
|
100
|
+
min: 1;
|
|
101
|
+
max: number;
|
|
102
|
+
}>;
|
|
96
103
|
export declare const defineExplorerConfig: (input: ExplorerConfigInput) => ExplorerConfig;
|
|
97
104
|
export declare const revalidateExplorerConfig: (config: ExplorerConfig) => ExplorerConfig;
|
|
98
105
|
export declare const isExplorerSourceId: (value: unknown) => value is string;
|
|
@@ -28,9 +28,15 @@ export declare const EXPLORER_IMAGE_TYPES: readonly [
|
|
|
28
28
|
export type ExplorerImageType = (typeof EXPLORER_IMAGE_TYPES)[number];
|
|
29
29
|
export declare const EXPLORER_SPREADSHEET_FORMATS: readonly [
|
|
30
30
|
"csv",
|
|
31
|
-
"tsv"
|
|
31
|
+
"tsv",
|
|
32
|
+
"workbook"
|
|
32
33
|
];
|
|
33
34
|
export type ExplorerSpreadsheetFormat = (typeof EXPLORER_SPREADSHEET_FORMATS)[number];
|
|
35
|
+
export declare const EXPLORER_SHEET_TEXT_FORMATS: readonly [
|
|
36
|
+
"csv",
|
|
37
|
+
"tsv"
|
|
38
|
+
];
|
|
39
|
+
export type ExplorerSheetTextFormat = (typeof EXPLORER_SHEET_TEXT_FORMATS)[number];
|
|
34
40
|
export declare const EXPLORER_NOTICE_TONES: readonly [
|
|
35
41
|
"info",
|
|
36
42
|
"warning",
|
|
@@ -135,7 +141,7 @@ export type ExplorerSpreadsheetDocument = {
|
|
|
135
141
|
readonly name: string;
|
|
136
142
|
readonly url: string;
|
|
137
143
|
readonly format: ExplorerSpreadsheetFormat;
|
|
138
|
-
readonly
|
|
144
|
+
readonly firstSheetText: ExplorerSheetTextFormat | null;
|
|
139
145
|
readonly edit: ExplorerExternalEdit | null;
|
|
140
146
|
};
|
|
141
147
|
export type ExplorerDocument = {
|
package/dist/core/contracts.d.ts
CHANGED
|
@@ -28,9 +28,15 @@ export declare const EXPLORER_IMAGE_TYPES: readonly [
|
|
|
28
28
|
export type ExplorerImageType = (typeof EXPLORER_IMAGE_TYPES)[number];
|
|
29
29
|
export declare const EXPLORER_SPREADSHEET_FORMATS: readonly [
|
|
30
30
|
"csv",
|
|
31
|
-
"tsv"
|
|
31
|
+
"tsv",
|
|
32
|
+
"workbook"
|
|
32
33
|
];
|
|
33
34
|
export type ExplorerSpreadsheetFormat = (typeof EXPLORER_SPREADSHEET_FORMATS)[number];
|
|
35
|
+
export declare const EXPLORER_SHEET_TEXT_FORMATS: readonly [
|
|
36
|
+
"csv",
|
|
37
|
+
"tsv"
|
|
38
|
+
];
|
|
39
|
+
export type ExplorerSheetTextFormat = (typeof EXPLORER_SHEET_TEXT_FORMATS)[number];
|
|
34
40
|
export declare const EXPLORER_NOTICE_TONES: readonly [
|
|
35
41
|
"info",
|
|
36
42
|
"warning",
|
|
@@ -135,7 +141,7 @@ export type ExplorerSpreadsheetDocument = {
|
|
|
135
141
|
readonly name: string;
|
|
136
142
|
readonly url: string;
|
|
137
143
|
readonly format: ExplorerSpreadsheetFormat;
|
|
138
|
-
readonly
|
|
144
|
+
readonly firstSheetText: ExplorerSheetTextFormat | null;
|
|
139
145
|
readonly edit: ExplorerExternalEdit | null;
|
|
140
146
|
};
|
|
141
147
|
export type ExplorerDocument = {
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ExplorerFailureReason } from "./contracts.cjs";
|
|
2
|
+
export declare const EXPLORER_DATA_OPERATIONS: readonly [
|
|
3
|
+
"tree",
|
|
4
|
+
"children",
|
|
5
|
+
"ancestors",
|
|
6
|
+
"reveal",
|
|
7
|
+
"document",
|
|
8
|
+
"text",
|
|
9
|
+
"edit",
|
|
10
|
+
"save",
|
|
11
|
+
"preview",
|
|
12
|
+
"revisions",
|
|
13
|
+
"revision",
|
|
14
|
+
"refresh",
|
|
15
|
+
"asset",
|
|
16
|
+
"link-card"
|
|
17
|
+
];
|
|
18
|
+
export type ExplorerDataOperation = (typeof EXPLORER_DATA_OPERATIONS)[number];
|
|
19
|
+
export declare const EXPLORER_DATA_QUERY: Readonly<{
|
|
20
|
+
readonly source: "source";
|
|
21
|
+
readonly path: "path";
|
|
22
|
+
readonly version: "v";
|
|
23
|
+
readonly base: "base";
|
|
24
|
+
readonly revision: "revision";
|
|
25
|
+
readonly display: "as";
|
|
26
|
+
}>;
|
|
27
|
+
export declare const explorerAssetHref: (dataPath: string, path: string, version: string | null) => string;
|
|
28
|
+
export type ExplorerAssetDisplay = "file" | "text" | "workbook";
|
|
29
|
+
export declare const explorerPlainTextHref: (assetHref: string) => string;
|
|
30
|
+
export declare const explorerWorkbookHref: (assetHref: string) => string;
|
|
31
|
+
export declare const readExplorerAssetDisplay: (search: URLSearchParams) => ExplorerAssetDisplay | null;
|
|
32
|
+
export declare const explorerLinkCardEndpoint: (dataPath: string) => string;
|
|
33
|
+
export declare const EXPLORER_SCOPE_HEADER = "X-Markdown-Explorer-Scope";
|
|
34
|
+
export declare const EXPLORER_PROOF_HEADER = "X-Markdown-Explorer";
|
|
35
|
+
export declare const EXPLORER_REFRESH_PROOF = "refresh";
|
|
36
|
+
export declare const EXPLORER_EDIT_PROOF = "edit";
|
|
37
|
+
export declare const EXPLORER_DRAFT_MEDIA_TYPE = "text/markdown";
|
|
38
|
+
export declare const isExplorerDataOperation: (segment: string | undefined) => segment is ExplorerDataOperation;
|
|
39
|
+
export declare const EXPLORER_FAILURE_STATUS: Readonly<Record<ExplorerFailureReason, number>>;
|
|
40
|
+
export declare const failureReasonOfStatus: (status: number) => ExplorerFailureReason;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ExplorerFailureReason } from "./contracts.js";
|
|
2
|
+
export declare const EXPLORER_DATA_OPERATIONS: readonly [
|
|
3
|
+
"tree",
|
|
4
|
+
"children",
|
|
5
|
+
"ancestors",
|
|
6
|
+
"reveal",
|
|
7
|
+
"document",
|
|
8
|
+
"text",
|
|
9
|
+
"edit",
|
|
10
|
+
"save",
|
|
11
|
+
"preview",
|
|
12
|
+
"revisions",
|
|
13
|
+
"revision",
|
|
14
|
+
"refresh",
|
|
15
|
+
"asset",
|
|
16
|
+
"link-card"
|
|
17
|
+
];
|
|
18
|
+
export type ExplorerDataOperation = (typeof EXPLORER_DATA_OPERATIONS)[number];
|
|
19
|
+
export declare const EXPLORER_DATA_QUERY: Readonly<{
|
|
20
|
+
readonly source: "source";
|
|
21
|
+
readonly path: "path";
|
|
22
|
+
readonly version: "v";
|
|
23
|
+
readonly base: "base";
|
|
24
|
+
readonly revision: "revision";
|
|
25
|
+
readonly display: "as";
|
|
26
|
+
}>;
|
|
27
|
+
export declare const explorerAssetHref: (dataPath: string, path: string, version: string | null) => string;
|
|
28
|
+
export type ExplorerAssetDisplay = "file" | "text" | "workbook";
|
|
29
|
+
export declare const explorerPlainTextHref: (assetHref: string) => string;
|
|
30
|
+
export declare const explorerWorkbookHref: (assetHref: string) => string;
|
|
31
|
+
export declare const readExplorerAssetDisplay: (search: URLSearchParams) => ExplorerAssetDisplay | null;
|
|
32
|
+
export declare const explorerLinkCardEndpoint: (dataPath: string) => string;
|
|
33
|
+
export declare const EXPLORER_SCOPE_HEADER = "X-Markdown-Explorer-Scope";
|
|
34
|
+
export declare const EXPLORER_PROOF_HEADER = "X-Markdown-Explorer";
|
|
35
|
+
export declare const EXPLORER_REFRESH_PROOF = "refresh";
|
|
36
|
+
export declare const EXPLORER_EDIT_PROOF = "edit";
|
|
37
|
+
export declare const EXPLORER_DRAFT_MEDIA_TYPE = "text/markdown";
|
|
38
|
+
export declare const isExplorerDataOperation: (segment: string | undefined) => segment is ExplorerDataOperation;
|
|
39
|
+
export declare const EXPLORER_FAILURE_STATUS: Readonly<Record<ExplorerFailureReason, number>>;
|
|
40
|
+
export declare const failureReasonOfStatus: (status: number) => ExplorerFailureReason;
|
package/dist/core/labels.d.cts
CHANGED
|
@@ -197,7 +197,16 @@ export type MarkdownExplorerLabels = MarkdownExplorerSpreadsheetLabels & {
|
|
|
197
197
|
readonly mediaUnsupported: string;
|
|
198
198
|
readonly fileNotShown: string;
|
|
199
199
|
readonly pdfNotShown: string;
|
|
200
|
-
readonly
|
|
200
|
+
readonly spreadsheetWorkbookFirstSheet: string;
|
|
201
|
+
readonly spreadsheetSheets: (name: string) => string;
|
|
202
|
+
readonly spreadsheetSheetName: (name: string, sheet: string) => string;
|
|
203
|
+
readonly spreadsheetUnshownSheets: (count: number) => string;
|
|
204
|
+
readonly spreadsheetUnlistedSheets: (count: number) => string;
|
|
205
|
+
readonly spreadsheetSheetLoading: string;
|
|
206
|
+
readonly spreadsheetSheetEmpty: string;
|
|
207
|
+
readonly spreadsheetWorkbookEncrypted: string;
|
|
208
|
+
readonly spreadsheetNotWorkbook: string;
|
|
209
|
+
readonly spreadsheetWorkbookTooLarge: string;
|
|
201
210
|
readonly spreadsheetTruncated: string;
|
|
202
211
|
readonly spreadsheetUnreadableEncoding: (encodings: readonly string[]) => string;
|
|
203
212
|
readonly spreadsheetEmpty: string;
|
package/dist/core/labels.d.ts
CHANGED
|
@@ -197,7 +197,16 @@ export type MarkdownExplorerLabels = MarkdownExplorerSpreadsheetLabels & {
|
|
|
197
197
|
readonly mediaUnsupported: string;
|
|
198
198
|
readonly fileNotShown: string;
|
|
199
199
|
readonly pdfNotShown: string;
|
|
200
|
-
readonly
|
|
200
|
+
readonly spreadsheetWorkbookFirstSheet: string;
|
|
201
|
+
readonly spreadsheetSheets: (name: string) => string;
|
|
202
|
+
readonly spreadsheetSheetName: (name: string, sheet: string) => string;
|
|
203
|
+
readonly spreadsheetUnshownSheets: (count: number) => string;
|
|
204
|
+
readonly spreadsheetUnlistedSheets: (count: number) => string;
|
|
205
|
+
readonly spreadsheetSheetLoading: string;
|
|
206
|
+
readonly spreadsheetSheetEmpty: string;
|
|
207
|
+
readonly spreadsheetWorkbookEncrypted: string;
|
|
208
|
+
readonly spreadsheetNotWorkbook: string;
|
|
209
|
+
readonly spreadsheetWorkbookTooLarge: string;
|
|
201
210
|
readonly spreadsheetTruncated: string;
|
|
202
211
|
readonly spreadsheetUnreadableEncoding: (encodings: readonly string[]) => string;
|
|
203
212
|
readonly spreadsheetEmpty: string;
|