@aiquants/markdown-explorer 0.23.0 → 0.24.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.
Files changed (58) hide show
  1. package/CHANGELOG.md +112 -0
  2. package/README.md +61 -21
  3. package/dist/{EditSurface-Bk4tdJ99.cjs → EditSurface-CRc4g0Qa.cjs} +5 -5
  4. package/dist/{EditSurface-Dhvw9IDD.js → EditSurface-CcWEczj3.js} +333 -336
  5. package/dist/{ExplorerSplit-Q5VqUBDE.js → ExplorerSplit-97SeIAOS.js} +81 -81
  6. package/dist/{ExplorerSplit-BAFiXU-V.cjs → ExplorerSplit-ByxxXlgs.cjs} +1 -1
  7. package/dist/{MultiLayout-Bq_TS3ez.cjs → MultiLayout-B_yMVDt_.cjs} +1 -1
  8. package/dist/{MultiLayout-DlATT7km.js → MultiLayout-CnbuAlxd.js} +22 -22
  9. package/dist/{NativeScrollBar-TsIcS3JZ.js → NativeScrollBar-BXdaM3EA.js} +1 -1
  10. package/dist/{NativeScrollBar-A6-qEpz7.cjs → NativeScrollBar-D4a7fBOS.cjs} +1 -1
  11. package/dist/{TreeLayout-zrSo4MNZ.js → TreeLayout-BIQBKAkV.js} +3 -3
  12. package/dist/{TreeLayout-l-r2pPao.cjs → TreeLayout-C6QDpEBS.cjs} +1 -1
  13. package/dist/core/config.d.cts +13 -0
  14. package/dist/core/config.d.ts +13 -0
  15. package/dist/core/contracts.d.cts +22 -4
  16. package/dist/core/contracts.d.ts +22 -4
  17. package/dist/core/labels.d.cts +9 -0
  18. package/dist/core/labels.d.ts +9 -0
  19. package/dist/core/textEncoding.d.cts +4 -0
  20. package/dist/core/textEncoding.d.ts +4 -0
  21. package/dist/{dataRoute-Diu_7gle.js → dataRoute-BEvesOvN.js} +105 -97
  22. package/dist/dataRoute-Cv7fgCW7.cjs +1 -0
  23. package/dist/index-BwTVYkTR.cjs +13 -0
  24. package/dist/index-CeZDCyEl.js +4088 -0
  25. package/dist/index.cjs +1 -1
  26. package/dist/index.d.cts +2 -2
  27. package/dist/index.d.ts +2 -2
  28. package/dist/index.js +24 -23
  29. package/dist/location-CasigkBk.cjs +1 -0
  30. package/dist/location-gXXmC7CQ.js +643 -0
  31. package/dist/{merge-BzMpSaxx.js → merge-DqjUgcV_.js} +1 -1
  32. package/dist/{merge-DlPkU2Jc.cjs → merge-QLktbpZY.cjs} +1 -1
  33. package/dist/{sanitizePolicy-Du3lFZd-.cjs → sanitizePolicy-CZwOaJ92.cjs} +1 -1
  34. package/dist/{sanitizePolicy-BvhYIqVO.js → sanitizePolicy-gVKBhabq.js} +1 -1
  35. package/dist/sanitizeWorker.cjs +1 -1
  36. package/dist/sanitizeWorker.js +1 -1
  37. package/dist/server/fileSystemSource.d.cts +1 -0
  38. package/dist/server/fileSystemSource.d.ts +1 -0
  39. package/dist/server/ports.d.cts +8 -1
  40. package/dist/server/ports.d.ts +8 -1
  41. package/dist/server.cjs +1 -1
  42. package/dist/server.d.cts +1 -0
  43. package/dist/server.d.ts +1 -0
  44. package/dist/server.js +783 -768
  45. package/dist/styles/markdown-explorer.css +1 -1
  46. package/dist/{useSplitPersistence-HfAb8Kzh.js → useSplitPersistence-BPNjvuJi.js} +1 -1
  47. package/dist/{useSplitPersistence-CR4Oxtaa.cjs → useSplitPersistence-Bmpb2prR.cjs} +1 -1
  48. package/docs/behavior/dom-hooks.md +13 -6
  49. package/docs/behavior/layout.md +19 -10
  50. package/docs/behavior/localization.md +6 -3
  51. package/docs/behavior/security.md +6 -4
  52. package/docs/behavior/url-contract.md +2 -2
  53. package/package.json +5 -5
  54. package/dist/dataRoute-vXGZMVB-.cjs +0 -1
  55. package/dist/index-BNFl3BsO.cjs +0 -13
  56. package/dist/index-Jz6zeO4O.js +0 -3703
  57. package/dist/location-8Ho8ZNv_.js +0 -499
  58. package/dist/location-DN0AI4ir.cjs +0 -1
@@ -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-Jz6zeO4O.js";
4
+ import { u as T } from "./index-CeZDCyEl.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-BNFl3BsO.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
+ "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-BwTVYkTR.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-8Ho8ZNv_.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-Jz6zeO4O.js";
6
- import { E as Y, a as J, b as K } from "./ExplorerSplit-Q5VqUBDE.js";
4
+ import { e as p, c as L } from "./location-gXXmC7CQ.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-CeZDCyEl.js";
6
+ import { E as Y, a as J, b as K } from "./ExplorerSplit-97SeIAOS.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-DN0AI4ir.cjs"),d=require("./index-BNFl3BsO.cjs"),x=require("./ExplorerSplit-BAFiXU-V.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;
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-CasigkBk.cjs"),d=require("./index-BwTVYkTR.cjs"),x=require("./ExplorerSplit-ByxxXlgs.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;
@@ -32,6 +32,10 @@ export type ExplorerConfigInput = {
32
32
  readonly linkCardSize?: LinkCardSize;
33
33
  };
34
34
  readonly defaultTreeSettings?: Partial<TreeSettings>;
35
+ readonly legacyTextEncoding?: string;
36
+ readonly spreadsheets?: {
37
+ readonly maxBytes?: number;
38
+ };
35
39
  };
36
40
  export type ExplorerConfig = {
37
41
  readonly basePath: string;
@@ -53,6 +57,10 @@ export type ExplorerConfig = {
53
57
  readonly iframeHosts: readonly string[];
54
58
  readonly embeds: MarkdownEmbeds;
55
59
  readonly defaultTreeSettings: TreeSettings;
60
+ readonly legacyTextEncoding: string | null;
61
+ readonly spreadsheets: {
62
+ readonly maxBytes: number;
63
+ };
56
64
  };
57
65
  export declare const DEFAULT_VIEW_SLUGS: ExplorerViewSlugs;
58
66
  export declare const MULTI_VIEW_PANEL_LIMITS: Readonly<{
@@ -80,6 +88,11 @@ export declare const REVEAL_DOCUMENT_DEPTH_LIMITS: Readonly<{
80
88
  min: 1;
81
89
  max: 64;
82
90
  }>;
91
+ export declare const SPREADSHEET_BYTE_LIMITS: Readonly<{
92
+ default: number;
93
+ min: 1;
94
+ max: number;
95
+ }>;
83
96
  export declare const defineExplorerConfig: (input: ExplorerConfigInput) => ExplorerConfig;
84
97
  export declare const revalidateExplorerConfig: (config: ExplorerConfig) => ExplorerConfig;
85
98
  export declare const isExplorerSourceId: (value: unknown) => value is string;
@@ -32,6 +32,10 @@ export type ExplorerConfigInput = {
32
32
  readonly linkCardSize?: LinkCardSize;
33
33
  };
34
34
  readonly defaultTreeSettings?: Partial<TreeSettings>;
35
+ readonly legacyTextEncoding?: string;
36
+ readonly spreadsheets?: {
37
+ readonly maxBytes?: number;
38
+ };
35
39
  };
36
40
  export type ExplorerConfig = {
37
41
  readonly basePath: string;
@@ -53,6 +57,10 @@ export type ExplorerConfig = {
53
57
  readonly iframeHosts: readonly string[];
54
58
  readonly embeds: MarkdownEmbeds;
55
59
  readonly defaultTreeSettings: TreeSettings;
60
+ readonly legacyTextEncoding: string | null;
61
+ readonly spreadsheets: {
62
+ readonly maxBytes: number;
63
+ };
56
64
  };
57
65
  export declare const DEFAULT_VIEW_SLUGS: ExplorerViewSlugs;
58
66
  export declare const MULTI_VIEW_PANEL_LIMITS: Readonly<{
@@ -80,6 +88,11 @@ export declare const REVEAL_DOCUMENT_DEPTH_LIMITS: Readonly<{
80
88
  min: 1;
81
89
  max: 64;
82
90
  }>;
91
+ export declare const SPREADSHEET_BYTE_LIMITS: Readonly<{
92
+ default: number;
93
+ min: 1;
94
+ max: number;
95
+ }>;
83
96
  export declare const defineExplorerConfig: (input: ExplorerConfigInput) => ExplorerConfig;
84
97
  export declare const revalidateExplorerConfig: (config: ExplorerConfig) => ExplorerConfig;
85
98
  export declare const isExplorerSourceId: (value: unknown) => value is string;
@@ -26,6 +26,11 @@ export declare const EXPLORER_IMAGE_TYPES: readonly [
26
26
  "svg"
27
27
  ];
28
28
  export type ExplorerImageType = (typeof EXPLORER_IMAGE_TYPES)[number];
29
+ export declare const EXPLORER_SPREADSHEET_FORMATS: readonly [
30
+ "csv",
31
+ "tsv"
32
+ ];
33
+ export type ExplorerSpreadsheetFormat = (typeof EXPLORER_SPREADSHEET_FORMATS)[number];
29
34
  export declare const EXPLORER_NOTICE_TONES: readonly [
30
35
  "info",
31
36
  "warning",
@@ -37,6 +42,7 @@ export declare const EXPLORER_DOCUMENT_KINDS: readonly [
37
42
  "text",
38
43
  "image",
39
44
  "media",
45
+ "spreadsheet",
40
46
  "file",
41
47
  "failure"
42
48
  ];
@@ -115,13 +121,22 @@ export type ExplorerTextDocument = {
115
121
  readonly truncated: boolean;
116
122
  readonly url: string;
117
123
  };
124
+ export type ExplorerExternalEdit = {
125
+ readonly kind: "external";
126
+ readonly href: string;
127
+ };
118
128
  export type ExplorerDocumentEdit = {
119
129
  readonly kind: "inline";
120
130
  } | {
121
131
  readonly kind: "draft";
122
- } | {
123
- readonly kind: "external";
124
- readonly href: string;
132
+ } | ExplorerExternalEdit;
133
+ export type ExplorerSpreadsheetDocument = {
134
+ readonly kind: "spreadsheet";
135
+ readonly name: string;
136
+ readonly url: string;
137
+ readonly format: ExplorerSpreadsheetFormat;
138
+ readonly firstSheetOnly: boolean;
139
+ readonly edit: ExplorerExternalEdit | null;
125
140
  };
126
141
  export type ExplorerDocument = {
127
142
  readonly kind: "markdown";
@@ -139,7 +154,7 @@ export type ExplorerDocument = {
139
154
  readonly name: string;
140
155
  readonly url: string;
141
156
  readonly mediaType: ExplorerMediaType;
142
- } | {
157
+ } | ExplorerSpreadsheetDocument | {
143
158
  readonly kind: "file";
144
159
  readonly name: string;
145
160
  readonly url: string;
@@ -224,6 +239,7 @@ export declare const isExplorerFailureReason: (value: unknown) => value is Explo
224
239
  export declare const isExplorerEntryType: (value: unknown) => value is ExplorerEntryType;
225
240
  export declare const isExplorerMediaType: (value: unknown) => value is ExplorerMediaType;
226
241
  export declare const isExplorerImageType: (value: unknown) => value is ExplorerImageType;
242
+ export declare const isExplorerSpreadsheetFormat: (value: unknown) => value is ExplorerSpreadsheetFormat;
227
243
  export declare const isExplorerNoticeTone: (value: unknown) => value is ExplorerNoticeTone;
228
244
  export declare const isExplorerDocumentKind: (value: unknown) => value is ExplorerDocumentKind;
229
245
  export declare const isExplorerFailureCode: (code: unknown) => code is string;
@@ -239,6 +255,8 @@ export declare const documentViolation: (value: unknown) => string | null;
239
255
  export declare const isExplorerDocument: (value: unknown) => value is ExplorerDocument;
240
256
  export declare const isExplorerTextAnswer: (value: unknown) => value is ExplorerTextAnswer;
241
257
  export declare const editViolation: (value: unknown) => string | null;
258
+ export declare const externalEditViolation: (value: unknown) => string | null;
259
+ export declare const spreadsheetFieldsViolation: (record: Readonly<Record<string, unknown>>) => string | null;
242
260
  export declare const isExplorerEditToken: (value: unknown) => value is string;
243
261
  export declare const revisionViolation: (value: unknown) => string | null;
244
262
  export declare const editAnswerViolation: (value: unknown, kinds: readonly string[]) => string | null;
@@ -26,6 +26,11 @@ export declare const EXPLORER_IMAGE_TYPES: readonly [
26
26
  "svg"
27
27
  ];
28
28
  export type ExplorerImageType = (typeof EXPLORER_IMAGE_TYPES)[number];
29
+ export declare const EXPLORER_SPREADSHEET_FORMATS: readonly [
30
+ "csv",
31
+ "tsv"
32
+ ];
33
+ export type ExplorerSpreadsheetFormat = (typeof EXPLORER_SPREADSHEET_FORMATS)[number];
29
34
  export declare const EXPLORER_NOTICE_TONES: readonly [
30
35
  "info",
31
36
  "warning",
@@ -37,6 +42,7 @@ export declare const EXPLORER_DOCUMENT_KINDS: readonly [
37
42
  "text",
38
43
  "image",
39
44
  "media",
45
+ "spreadsheet",
40
46
  "file",
41
47
  "failure"
42
48
  ];
@@ -115,13 +121,22 @@ export type ExplorerTextDocument = {
115
121
  readonly truncated: boolean;
116
122
  readonly url: string;
117
123
  };
124
+ export type ExplorerExternalEdit = {
125
+ readonly kind: "external";
126
+ readonly href: string;
127
+ };
118
128
  export type ExplorerDocumentEdit = {
119
129
  readonly kind: "inline";
120
130
  } | {
121
131
  readonly kind: "draft";
122
- } | {
123
- readonly kind: "external";
124
- readonly href: string;
132
+ } | ExplorerExternalEdit;
133
+ export type ExplorerSpreadsheetDocument = {
134
+ readonly kind: "spreadsheet";
135
+ readonly name: string;
136
+ readonly url: string;
137
+ readonly format: ExplorerSpreadsheetFormat;
138
+ readonly firstSheetOnly: boolean;
139
+ readonly edit: ExplorerExternalEdit | null;
125
140
  };
126
141
  export type ExplorerDocument = {
127
142
  readonly kind: "markdown";
@@ -139,7 +154,7 @@ export type ExplorerDocument = {
139
154
  readonly name: string;
140
155
  readonly url: string;
141
156
  readonly mediaType: ExplorerMediaType;
142
- } | {
157
+ } | ExplorerSpreadsheetDocument | {
143
158
  readonly kind: "file";
144
159
  readonly name: string;
145
160
  readonly url: string;
@@ -224,6 +239,7 @@ export declare const isExplorerFailureReason: (value: unknown) => value is Explo
224
239
  export declare const isExplorerEntryType: (value: unknown) => value is ExplorerEntryType;
225
240
  export declare const isExplorerMediaType: (value: unknown) => value is ExplorerMediaType;
226
241
  export declare const isExplorerImageType: (value: unknown) => value is ExplorerImageType;
242
+ export declare const isExplorerSpreadsheetFormat: (value: unknown) => value is ExplorerSpreadsheetFormat;
227
243
  export declare const isExplorerNoticeTone: (value: unknown) => value is ExplorerNoticeTone;
228
244
  export declare const isExplorerDocumentKind: (value: unknown) => value is ExplorerDocumentKind;
229
245
  export declare const isExplorerFailureCode: (code: unknown) => code is string;
@@ -239,6 +255,8 @@ export declare const documentViolation: (value: unknown) => string | null;
239
255
  export declare const isExplorerDocument: (value: unknown) => value is ExplorerDocument;
240
256
  export declare const isExplorerTextAnswer: (value: unknown) => value is ExplorerTextAnswer;
241
257
  export declare const editViolation: (value: unknown) => string | null;
258
+ export declare const externalEditViolation: (value: unknown) => string | null;
259
+ export declare const spreadsheetFieldsViolation: (record: Readonly<Record<string, unknown>>) => string | null;
242
260
  export declare const isExplorerEditToken: (value: unknown) => value is string;
243
261
  export declare const revisionViolation: (value: unknown) => string | null;
244
262
  export declare const editAnswerViolation: (value: unknown, kinds: readonly string[]) => string | null;
@@ -25,6 +25,7 @@ export type MarkdownExplorerLabels = MarkdownExplorerSpreadsheetLabels & {
25
25
  readonly showMarkupLabel: string;
26
26
  readonly showMarkup: string;
27
27
  readonly showSvgMarkup: string;
28
+ readonly showSpreadsheetMarkup: (format: string) => string;
28
29
  readonly showMarkupNamed: (name: string) => string;
29
30
  readonly editDocumentLabel: string;
30
31
  readonly editDocument: string;
@@ -159,6 +160,7 @@ export type MarkdownExplorerLabels = MarkdownExplorerSpreadsheetLabels & {
159
160
  readonly folderReadmeMissing: (name: string) => string;
160
161
  readonly documentLoading: string;
161
162
  readonly markupLoading: string;
163
+ readonly spreadsheetLoading: string;
162
164
  readonly documentShown: (name: string) => string;
163
165
  readonly documentFailed: (name: string, title: string) => string;
164
166
  readonly announcementSequence: (messages: readonly string[]) => string;
@@ -195,6 +197,13 @@ export type MarkdownExplorerLabels = MarkdownExplorerSpreadsheetLabels & {
195
197
  readonly mediaUnsupported: string;
196
198
  readonly fileNotShown: string;
197
199
  readonly pdfNotShown: string;
200
+ readonly spreadsheetFirstSheetOnly: string;
201
+ readonly spreadsheetTruncated: string;
202
+ readonly spreadsheetUnreadableEncoding: (encodings: readonly string[]) => string;
203
+ readonly spreadsheetEmpty: string;
204
+ readonly spreadsheetNotText: string;
205
+ readonly spreadsheetLongRow: string;
206
+ readonly spreadsheetFullscreen: (name: string) => string;
198
207
  readonly viewerLoading: string;
199
208
  readonly viewerErrorPrefix: string;
200
209
  readonly viewerStyleTitle: string;
@@ -25,6 +25,7 @@ export type MarkdownExplorerLabels = MarkdownExplorerSpreadsheetLabels & {
25
25
  readonly showMarkupLabel: string;
26
26
  readonly showMarkup: string;
27
27
  readonly showSvgMarkup: string;
28
+ readonly showSpreadsheetMarkup: (format: string) => string;
28
29
  readonly showMarkupNamed: (name: string) => string;
29
30
  readonly editDocumentLabel: string;
30
31
  readonly editDocument: string;
@@ -159,6 +160,7 @@ export type MarkdownExplorerLabels = MarkdownExplorerSpreadsheetLabels & {
159
160
  readonly folderReadmeMissing: (name: string) => string;
160
161
  readonly documentLoading: string;
161
162
  readonly markupLoading: string;
163
+ readonly spreadsheetLoading: string;
162
164
  readonly documentShown: (name: string) => string;
163
165
  readonly documentFailed: (name: string, title: string) => string;
164
166
  readonly announcementSequence: (messages: readonly string[]) => string;
@@ -195,6 +197,13 @@ export type MarkdownExplorerLabels = MarkdownExplorerSpreadsheetLabels & {
195
197
  readonly mediaUnsupported: string;
196
198
  readonly fileNotShown: string;
197
199
  readonly pdfNotShown: string;
200
+ readonly spreadsheetFirstSheetOnly: string;
201
+ readonly spreadsheetTruncated: string;
202
+ readonly spreadsheetUnreadableEncoding: (encodings: readonly string[]) => string;
203
+ readonly spreadsheetEmpty: string;
204
+ readonly spreadsheetNotText: string;
205
+ readonly spreadsheetLongRow: string;
206
+ readonly spreadsheetFullscreen: (name: string) => string;
198
207
  readonly viewerLoading: string;
199
208
  readonly viewerErrorPrefix: string;
200
209
  readonly viewerStyleTitle: string;
@@ -0,0 +1,4 @@
1
+ export declare const legacyTextEncodingOf: (label: string) => string;
2
+ export declare const textEncodingsOf: (bytes: Uint8Array, complete: boolean, legacyEncoding: string | null) => readonly string[];
3
+ export declare const decodeText: (bytes: Uint8Array, complete: boolean, legacyEncoding: string | null) => string | null;
4
+ export declare const decodeTextLeniently: (bytes: Uint8Array, complete: boolean, legacyEncoding: string | null) => string;
@@ -0,0 +1,4 @@
1
+ export declare const legacyTextEncodingOf: (label: string) => string;
2
+ export declare const textEncodingsOf: (bytes: Uint8Array, complete: boolean, legacyEncoding: string | null) => readonly string[];
3
+ export declare const decodeText: (bytes: Uint8Array, complete: boolean, legacyEncoding: string | null) => string | null;
4
+ export declare const decodeTextLeniently: (bytes: Uint8Array, complete: boolean, legacyEncoding: string | null) => string;