@aiquants/markdown-explorer 0.33.0 → 0.35.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 +795 -0
- package/README.md +119 -55
- package/dist/EditSurface-CLG70Vnn.cjs +6 -0
- package/dist/EditSurface-D2j1kCEE.js +990 -0
- package/dist/ExplorerSplit-CfP1smbT.js +1589 -0
- package/dist/ExplorerSplit-D_0VohOv.cjs +2 -0
- package/dist/{MultiLayout-DYNGlNy0.js → MultiLayout-BeJ5Lubb.js} +291 -290
- package/dist/MultiLayout-CxV5SI7f.cjs +1 -0
- package/dist/NativeScrollBar-BM5NULzg.js +62 -0
- package/dist/NativeScrollBar-RWXpVhbI.cjs +1 -0
- package/dist/TreeLayout-AxLw-36S.js +103 -0
- package/dist/TreeLayout-Bg2YH-EY.cjs +1 -0
- package/dist/client/MarkdownExplorer.d.cts +14 -1
- package/dist/client/MarkdownExplorer.d.ts +14 -1
- package/dist/client/edit/lineEndings.d.cts +4 -0
- package/dist/client/edit/lineEndings.d.ts +4 -0
- package/dist/client/hostContract.d.cts +67 -0
- package/dist/client/hostContract.d.ts +67 -0
- package/dist/core/config.d.cts +7 -0
- package/dist/core/config.d.ts +7 -0
- package/dist/core/contracts.d.cts +10 -4
- package/dist/core/contracts.d.ts +10 -4
- package/dist/core/draftAnswer.d.cts +23 -0
- package/dist/core/draftAnswer.d.ts +23 -0
- package/dist/core/geometry.d.cts +1 -0
- package/dist/core/geometry.d.ts +1 -0
- package/dist/core/labels.d.cts +78 -0
- package/dist/core/labels.d.ts +78 -0
- package/dist/core/location.d.cts +3 -2
- package/dist/core/location.d.ts +3 -2
- package/dist/core/ownUrls.d.cts +15 -0
- package/dist/core/ownUrls.d.ts +15 -0
- package/dist/core/treeSettings.d.cts +3 -2
- package/dist/core/treeSettings.d.ts +3 -2
- package/dist/core/viewSettings.d.cts +5 -1
- package/dist/core/viewSettings.d.ts +5 -1
- package/dist/describeValue-CLlVRO8d.js +17 -0
- package/dist/describeValue-Ccvhbt36.cjs +1 -0
- package/dist/explorerCore-DLpDuSev.js +998 -0
- package/dist/explorerCore-DYrxS9ez.cjs +1 -0
- package/dist/index-C1YMH-yI.js +5816 -0
- package/dist/index-LQWQfpAf.cjs +18 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +7 -4
- package/dist/index.d.ts +7 -4
- package/dist/index.js +47 -42
- package/dist/licenses/@heroicons/react/LICENSE +21 -0
- package/dist/licenses/entities/LICENSE +11 -0
- package/dist/licenses/parse5/LICENSE +19 -0
- package/dist/location--KvTA0Ri.js +726 -0
- package/dist/location-D8DyDkuA.cjs +1 -0
- package/dist/lru-DC8GBmkX.js +39 -0
- package/dist/lru-SGmUyBQU.cjs +1 -0
- package/dist/{merge-D7L_pINl.js → merge-Bb_HpPhe.js} +1 -1
- package/dist/{merge-DZI4pkWI.cjs → merge-DQUYEGCx.cjs} +1 -1
- package/dist/nestingGuardWorker.js +5511 -0
- package/dist/ownUrls-B259RGgd.cjs +1 -0
- package/dist/ownUrls-Dh5g6ZJi.js +370 -0
- package/dist/sanitizeJob-BYRk17nr.js +21 -0
- package/dist/sanitizeJob-Cs9o3Vpl.cjs +1 -0
- package/dist/sanitizePolicy-CEMdaLUB.js +139 -0
- package/dist/sanitizePolicy-CiQfnxyd.cjs +2 -0
- package/dist/sanitizeWorker.cjs +1 -1
- package/dist/sanitizeWorker.js +134 -139
- package/dist/sanitizerService-BY4CPCoA.cjs +1 -0
- package/dist/sanitizerService-KWXv7bPm.js +240 -0
- package/dist/server/assetResponse.d.cts +60 -0
- package/dist/server/assetResponse.d.ts +60 -0
- package/dist/server/browser/browserPlatform.d.cts +12 -0
- package/dist/server/browser/browserPlatform.d.ts +12 -0
- package/dist/server/createMarkdownExplorer.d.cts +0 -10
- package/dist/server/createMarkdownExplorer.d.ts +0 -10
- package/dist/server/explorerCore.d.cts +12 -0
- package/dist/server/explorerCore.d.ts +12 -0
- package/dist/server/fileSystemSource.d.cts +1 -0
- package/dist/server/fileSystemSource.d.ts +1 -0
- package/dist/server/inProcessFetch.d.cts +5 -0
- package/dist/server/inProcessFetch.d.ts +5 -0
- package/dist/server/platform.d.cts +18 -0
- package/dist/server/platform.d.ts +18 -0
- package/dist/server/ports.d.cts +36 -5
- package/dist/server/ports.d.ts +36 -5
- package/dist/server/sanitizeProtocol.d.cts +3 -0
- package/dist/server/sanitizeProtocol.d.ts +3 -0
- package/dist/server/sanitizer.d.cts +5 -40
- package/dist/server/sanitizer.d.ts +5 -40
- package/dist/server/sanitizerOptions.d.cts +24 -0
- package/dist/server/sanitizerOptions.d.ts +24 -0
- package/dist/server/sanitizerService.d.cts +41 -0
- package/dist/server/sanitizerService.d.ts +41 -0
- package/dist/server/{workerPool.d.cts → workerJobs.d.cts} +0 -16
- package/dist/server/{workerPool.d.ts → workerJobs.d.ts} +0 -16
- package/dist/server.cjs +1 -1
- package/dist/server.d.cts +3 -1
- package/dist/server.d.ts +3 -1
- package/dist/server.js +270 -1343
- package/dist/serverBrowser.cjs +1 -0
- package/dist/serverBrowser.d.cts +1 -0
- package/dist/serverBrowser.d.ts +1 -0
- package/dist/serverBrowser.js +120 -0
- package/dist/serverCore.cjs +1 -0
- package/dist/serverCore.d.cts +14 -0
- package/dist/serverCore.d.ts +14 -0
- package/dist/serverCore.js +46 -0
- package/dist/storage-BpYsprog.cjs +1 -0
- package/dist/{storage-CmGHg7OA.js → storage-D1uSw-xj.js} +19 -18
- package/dist/storage.cjs +1 -1
- package/dist/storage.js +1 -1
- package/dist/styles/markdown-explorer.css +1 -1
- package/dist/tapScrollCircle-BEydRn0y.js +14 -0
- package/dist/tapScrollCircle-DdX0Wri0.cjs +1 -0
- package/dist/testing.cjs +1 -0
- package/dist/testing.d.cts +6 -0
- package/dist/testing.d.ts +6 -0
- package/dist/testing.js +4 -0
- package/dist/useSplitPersistence-B2Fj508K.cjs +1 -0
- package/dist/useSplitPersistence-Fkqak8G8.js +44 -0
- package/docs/behavior/dom-hooks.md +14 -3
- package/docs/behavior/hosting.md +123 -0
- package/docs/behavior/layout.md +69 -19
- package/docs/behavior/localization.md +28 -10
- package/docs/behavior/security.md +34 -14
- package/docs/behavior/url-contract.md +13 -6
- package/package.json +54 -16
- package/dist/EditSurface-BPqqykro.cjs +0 -6
- package/dist/EditSurface-CWq35IWQ.js +0 -972
- package/dist/ExplorerSplit-BRY4uy6x.js +0 -1493
- package/dist/ExplorerSplit-CQxr6b0v.cjs +0 -1
- package/dist/MultiLayout-TXbet9k3.cjs +0 -1
- package/dist/NativeScrollBar-BsWdvkHa.js +0 -64
- package/dist/NativeScrollBar-UpjxjLlB.cjs +0 -1
- package/dist/TreeLayout-BQEgZhz9.js +0 -72
- package/dist/TreeLayout-C0O1OGi4.cjs +0 -1
- package/dist/dataRoute-DLhQfdoW.js +0 -298
- package/dist/dataRoute-DwYtgyt6.cjs +0 -1
- package/dist/index-CO-RgTml.js +0 -4912
- package/dist/index-DSkK8iLE.cjs +0 -15
- package/dist/location-BxiJRTyw.cjs +0 -1
- package/dist/location-perTmwct.js +0 -663
- package/dist/sanitizePolicy-By0tKOpZ.js +0 -98
- package/dist/sanitizePolicy-T5T-3vV5.cjs +0 -1
- package/dist/storage-DM0EvkVf.cjs +0 -1
- package/dist/tapScrollCircle-CRKZremf.js +0 -12
- package/dist/tapScrollCircle-Cbf17x8g.cjs +0 -1
- package/dist/useSplitPersistence-Du01PHNg.js +0 -42
- package/dist/useSplitPersistence-pPmE4GTT.cjs +0 -1
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { CODE_META_ATTRIBUTE as w } from "@aiquants/markdown/code-blocks";
|
|
2
|
-
import { allowedFrameUrlOf as O, reduceFrameFeatures as L, EMBED_FRAME_REFERRER_POLICIES as D, EMBED_LINK_ATTRIBUTE as T, placeholderLinkOf as I } from "@aiquants/markdown/embeds";
|
|
3
|
-
import { SOURCE_LINES_ATTRIBUTE as E, parseSourceLines as z } from "@aiquants/markdown/source-lines";
|
|
4
|
-
import { i as M, e as x } from "./dataRoute-DLhQfdoW.js";
|
|
5
|
-
const ee = 512;
|
|
6
|
-
class H extends RangeError {
|
|
7
|
-
constructor(o) {
|
|
8
|
-
super(`[markdown-explorer] the HTML nests deeper than ${String(o)} levels`), this.name = "HtmlNestingLimitError";
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
const C = ["script", "style", "noscript", "template", "form", "button", "textarea", "select", "option", "object", "embed", "base", "meta", "link", "frame", "frameset"], U = ["srcdoc", "formaction"], j = /^(?:(?:https?|mailto|tel):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/iu, B = /* @__PURE__ */ new Set(["left", "right", "center", "justify", "start", "end"]), F = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "h6"]), u = 1, G = 3, y = 7, V = 8, S = Object.freeze({
|
|
12
|
-
a: Object.freeze(["target", "data-link-kind", "data-doc-path", "data-doc-exists", "data-footnote-ref", "data-footnote-backref"]),
|
|
13
|
-
area: Object.freeze(["target"]),
|
|
14
|
-
img: Object.freeze(["data-asset-src", "data-asset-exists"]),
|
|
15
|
-
section: Object.freeze(["data-footnotes"]),
|
|
16
|
-
code: Object.freeze([w]),
|
|
17
|
-
iframe: Object.freeze(["allow", "allowfullscreen", "frameborder", "referrerpolicy"])
|
|
18
|
-
}), P = [.../* @__PURE__ */ new Set([...Object.values(S).flatMap((t) => t.filter((o) => o.startsWith("data-"))), E])], W = /* @__PURE__ */ new Set(["src", "href", "xlink:href"]), X = /^data:/iu, $ = Object.freeze({
|
|
19
|
-
FORBID_TAGS: C,
|
|
20
|
-
FORBID_ATTR: U,
|
|
21
|
-
ADD_TAGS: ["iframe"],
|
|
22
|
-
ADD_ATTR: (t, o) => t === E || S[o]?.includes(t) === !0,
|
|
23
|
-
ADD_URI_SAFE_ATTR: P,
|
|
24
|
-
ALLOWED_URI_REGEXP: j,
|
|
25
|
-
ALLOW_DATA_ATTR: !1
|
|
26
|
-
}), K = (t) => {
|
|
27
|
-
let o = null;
|
|
28
|
-
for (const l of t.split(";")) {
|
|
29
|
-
const n = l.indexOf(":");
|
|
30
|
-
if (n < 0 || l.slice(0, n).trim().toLowerCase() !== "text-align") continue;
|
|
31
|
-
const f = l.slice(n + 1).trim().toLowerCase();
|
|
32
|
-
B.has(f) && (o = f);
|
|
33
|
-
}
|
|
34
|
-
return o === null ? null : `text-align: ${o}`;
|
|
35
|
-
}, Y = (t) => t.nodeType === G ? { kind: "text", text: t.nodeValue ?? "" } : t.nodeType === V || t.nodeType === y ? { kind: "ignored" } : t.nodeType === u && t.nodeName.toLowerCase() === "a" ? { kind: "link", href: t.getAttribute("href") } : { kind: "element" }, q = (t) => {
|
|
36
|
-
const o = t.getAttribute("type");
|
|
37
|
-
return o !== null && o.trim().toLowerCase() === "checkbox" && t.hasAttribute("disabled");
|
|
38
|
-
}, te = (t, o, l, n) => {
|
|
39
|
-
if (t.isSupported !== !0) throw new Error("[markdown-explorer] the HTML sanitizer cannot run in this environment");
|
|
40
|
-
if (!Number.isSafeInteger(n) || n <= 0) throw new RangeError(`[markdown-explorer] the HTML sanitizer's depth limit must be a positive integer; got ${String(n)}`);
|
|
41
|
-
const f = Object.freeze([...o]);
|
|
42
|
-
let m = /* @__PURE__ */ new WeakMap(), A = /* @__PURE__ */ new WeakMap(), d;
|
|
43
|
-
const p = (r) => {
|
|
44
|
-
const e = r.parentNode === null ? void 0 : m.get(r.parentNode), a = e === void 0 ? 0 : e + 1;
|
|
45
|
-
if (m.set(r, a), r.nodeType === u && a > n) throw new H(n);
|
|
46
|
-
}, b = (r, e) => {
|
|
47
|
-
if (r.nodeType !== u) return;
|
|
48
|
-
const a = r;
|
|
49
|
-
(e.tagName === "input" && !q(a) || e.tagName === "iframe" && O(a.getAttribute("src")?.trim(), f) === null) && a.parentNode?.removeChild(a);
|
|
50
|
-
}, _ = (r, e) => {
|
|
51
|
-
const a = r.nodeName.toLowerCase();
|
|
52
|
-
if (e.attrName === "style") {
|
|
53
|
-
const s = K(e.attrValue);
|
|
54
|
-
s === null ? e.keepAttr = !1 : e.attrValue = s;
|
|
55
|
-
} else if (e.attrName === "allow" && a === "iframe") {
|
|
56
|
-
const s = L(e.attrValue);
|
|
57
|
-
s === null ? e.keepAttr = !1 : e.attrValue = s;
|
|
58
|
-
} else if (e.attrName === "referrerpolicy" && a === "iframe") {
|
|
59
|
-
const s = e.attrValue.trim().toLowerCase();
|
|
60
|
-
D.has(s) ? e.attrValue = s : e.keepAttr = !1;
|
|
61
|
-
} else e.attrName === T && a === "p" ? A.set(r, r.getAttribute(T)) : W.has(e.attrName) && X.test(e.attrValue) || e.attrName === E && z(e.attrValue) === null ? e.keepAttr = !1 : e.attrName === "id" && F.has(a) && (e.forceKeepAttr = !0);
|
|
62
|
-
}, k = (r) => {
|
|
63
|
-
const e = r.getAttribute("data-asset-src");
|
|
64
|
-
e !== null && (r.getAttribute("data-asset-exists") !== "false" && M(e) ? r.setAttribute("src", x(l, e, null)) : r.removeAttribute("src"));
|
|
65
|
-
}, h = (r, e, a, s) => {
|
|
66
|
-
if (d === void 0) return;
|
|
67
|
-
const c = r.getAttribute(a);
|
|
68
|
-
if (c === null) return;
|
|
69
|
-
const i = d({ kind: e, path: c });
|
|
70
|
-
i !== void 0 && r.setAttribute(s, String(i));
|
|
71
|
-
}, g = (r) => {
|
|
72
|
-
const e = r.parentNode;
|
|
73
|
-
if (e === null) return;
|
|
74
|
-
const a = A.get(e);
|
|
75
|
-
a != null && I(a, [...e.childNodes].map(Y)) !== null && e.setAttribute(T, a);
|
|
76
|
-
}, N = (r) => {
|
|
77
|
-
if (r.nodeType !== u) return;
|
|
78
|
-
const e = r, a = e.nodeName.toLowerCase();
|
|
79
|
-
a === "img" ? (h(e, "asset", "data-asset-src", "data-asset-exists"), k(e)) : a === "a" && (h(e, "doc", "data-doc-path", "data-doc-exists"), g(e));
|
|
80
|
-
const s = e.getAttribute("target");
|
|
81
|
-
if (s === null || s.trim().toLowerCase() === "_self") return;
|
|
82
|
-
const c = e.getAttribute("rel"), i = new Set(c === null ? [] : c.split(/\s+/u).filter((R) => R !== ""));
|
|
83
|
-
i.add("noopener"), i.add("noreferrer"), e.setAttribute("rel", [...i].join(" "));
|
|
84
|
-
};
|
|
85
|
-
return (r, e) => {
|
|
86
|
-
m = /* @__PURE__ */ new WeakMap(), A = /* @__PURE__ */ new WeakMap(), d = e, t.addHook("beforeSanitizeElements", p), t.addHook("uponSanitizeElement", b), t.addHook("uponSanitizeAttribute", _), t.addHook("afterSanitizeAttributes", N);
|
|
87
|
-
try {
|
|
88
|
-
return t.sanitize(r, $);
|
|
89
|
-
} finally {
|
|
90
|
-
t.removeHook("beforeSanitizeElements", p), t.removeHook("uponSanitizeElement", b), t.removeHook("uponSanitizeAttribute", _), t.removeHook("afterSanitizeAttributes", N), d = void 0;
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
};
|
|
94
|
-
export {
|
|
95
|
-
H,
|
|
96
|
-
ee as M,
|
|
97
|
-
te as c
|
|
98
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const O=require("@aiquants/markdown/code-blocks"),i=require("@aiquants/markdown/embeds"),E=require("@aiquants/markdown/source-lines"),R=require("./dataRoute-DwYtgyt6.cjs"),w=512;class h extends RangeError{constructor(s){super(`[markdown-explorer] the HTML nests deeper than ${String(s)} levels`),this.name="HtmlNestingLimitError"}}const D=["script","style","noscript","template","form","button","textarea","select","option","object","embed","base","meta","link","frame","frameset"],z=["srcdoc","formaction"],M=/^(?:(?:https?|mailto|tel):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/iu,B=new Set(["left","right","center","justify","start","end"]),H=new Set(["h1","h2","h3","h4","h5","h6"]),T=1,U=3,C=7,x=8,k=Object.freeze({a:Object.freeze(["target","data-link-kind","data-doc-path","data-doc-exists","data-footnote-ref","data-footnote-backref"]),area:Object.freeze(["target"]),img:Object.freeze(["data-asset-src","data-asset-exists"]),section:Object.freeze(["data-footnotes"]),code:Object.freeze([O.CODE_META_ATTRIBUTE]),iframe:Object.freeze(["allow","allowfullscreen","frameborder","referrerpolicy"])}),j=[...new Set([...Object.values(k).flatMap(t=>t.filter(s=>s.startsWith("data-"))),E.SOURCE_LINES_ATTRIBUTE])],F=new Set(["src","href","xlink:href"]),G=/^data:/iu,y=Object.freeze({FORBID_TAGS:D,FORBID_ATTR:z,ADD_TAGS:["iframe"],ADD_ATTR:(t,s)=>t===E.SOURCE_LINES_ATTRIBUTE||k[s]?.includes(t)===!0,ADD_URI_SAFE_ATTR:j,ALLOWED_URI_REGEXP:M,ALLOW_DATA_ATTR:!1}),V=t=>{let s=null;for(const c of t.split(";")){const n=c.indexOf(":");if(n<0||c.slice(0,n).trim().toLowerCase()!=="text-align")continue;const d=c.slice(n+1).trim().toLowerCase();B.has(d)&&(s=d)}return s===null?null:`text-align: ${s}`},P=t=>t.nodeType===U?{kind:"text",text:t.nodeValue??""}:t.nodeType===x||t.nodeType===C?{kind:"ignored"}:t.nodeType===T&&t.nodeName.toLowerCase()==="a"?{kind:"link",href:t.getAttribute("href")}:{kind:"element"},W=t=>{const s=t.getAttribute("type");return s!==null&&s.trim().toLowerCase()==="checkbox"&&t.hasAttribute("disabled")},X=(t,s,c,n)=>{if(t.isSupported!==!0)throw new Error("[markdown-explorer] the HTML sanitizer cannot run in this environment");if(!Number.isSafeInteger(n)||n<=0)throw new RangeError(`[markdown-explorer] the HTML sanitizer's depth limit must be a positive integer; got ${String(n)}`);const d=Object.freeze([...s]);let A=new WeakMap,m=new WeakMap,f;const _=r=>{const e=r.parentNode===null?void 0:A.get(r.parentNode),a=e===void 0?0:e+1;if(A.set(r,a),r.nodeType===T&&a>n)throw new h(n)},p=(r,e)=>{if(r.nodeType!==T)return;const a=r;(e.tagName==="input"&&!W(a)||e.tagName==="iframe"&&i.allowedFrameUrlOf(a.getAttribute("src")?.trim(),d)===null)&&a.parentNode?.removeChild(a)},N=(r,e)=>{const a=r.nodeName.toLowerCase();if(e.attrName==="style"){const o=V(e.attrValue);o===null?e.keepAttr=!1:e.attrValue=o}else if(e.attrName==="allow"&&a==="iframe"){const o=i.reduceFrameFeatures(e.attrValue);o===null?e.keepAttr=!1:e.attrValue=o}else if(e.attrName==="referrerpolicy"&&a==="iframe"){const o=e.attrValue.trim().toLowerCase();i.EMBED_FRAME_REFERRER_POLICIES.has(o)?e.attrValue=o:e.keepAttr=!1}else e.attrName===i.EMBED_LINK_ATTRIBUTE&&a==="p"?m.set(r,r.getAttribute(i.EMBED_LINK_ATTRIBUTE)):F.has(e.attrName)&&G.test(e.attrValue)||e.attrName===E.SOURCE_LINES_ATTRIBUTE&&E.parseSourceLines(e.attrValue)===null?e.keepAttr=!1:e.attrName==="id"&&H.has(a)&&(e.forceKeepAttr=!0)},g=r=>{const e=r.getAttribute("data-asset-src");e!==null&&(r.getAttribute("data-asset-exists")!=="false"&&R.isAcceptableDocumentPath(e)?r.setAttribute("src",R.explorerAssetHref(c,e,null)):r.removeAttribute("src"))},S=(r,e,a,o)=>{if(f===void 0)return;const u=r.getAttribute(a);if(u===null)return;const l=f({kind:e,path:u});l!==void 0&&r.setAttribute(o,String(l))},I=r=>{const e=r.parentNode;if(e===null)return;const a=m.get(e);a!=null&&i.placeholderLinkOf(a,[...e.childNodes].map(P))!==null&&e.setAttribute(i.EMBED_LINK_ATTRIBUTE,a)},b=r=>{if(r.nodeType!==T)return;const e=r,a=e.nodeName.toLowerCase();a==="img"?(S(e,"asset","data-asset-src","data-asset-exists"),g(e)):a==="a"&&(S(e,"doc","data-doc-path","data-doc-exists"),I(e));const o=e.getAttribute("target");if(o===null||o.trim().toLowerCase()==="_self")return;const u=e.getAttribute("rel"),l=new Set(u===null?[]:u.split(/\s+/u).filter(L=>L!==""));l.add("noopener"),l.add("noreferrer"),e.setAttribute("rel",[...l].join(" "))};return(r,e)=>{A=new WeakMap,m=new WeakMap,f=e,t.addHook("beforeSanitizeElements",_),t.addHook("uponSanitizeElement",p),t.addHook("uponSanitizeAttribute",N),t.addHook("afterSanitizeAttributes",b);try{return t.sanitize(r,y)}finally{t.removeHook("beforeSanitizeElements",_),t.removeHook("uponSanitizeElement",p),t.removeHook("uponSanitizeAttribute",N),t.removeHook("afterSanitizeAttributes",b),f=void 0}}};exports.HtmlNestingLimitError=h;exports.MAX_HTML_NESTING_DEPTH=w;exports.createHtmlSanitizer=X;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const d=/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/u,s=t=>{if(typeof t!="string"||!d.test(t))throw new RangeError(`[markdown-explorer] storageNamespace must be 1-64 letters, digits, ".", "_" or "-" starting with a letter or digit; got ${JSON.stringify(t)}`)},a=t=>(s(t),Object.freeze({treeSettings:`${t}:tree-settings`,multiLayout:`${t}:multi-layout`,scope:`${t}:scope`,editPreview:`${t}:edit-preview`,editSplit:`${t}:edit-split`,treeExpansion:r=>`${t}:tree-expansion:${r}`})),i=(t,r,e)=>{console.warn(`[markdown-explorer] could not ${t} localStorage key ${JSON.stringify(r)}; continuing without it.`,e)},l=()=>{if(typeof window>"u")return null;try{return window.localStorage}catch{return null}},u=t=>{const r=l();if(r===null)return null;try{return r.getItem(t)}catch(e){return i("read",t,e),null}},g=(t,r)=>{const e=l();if(e!==null)try{e.setItem(t,r)}catch(o){i("write",t,o)}},S=t=>{s(t);const r=l();if(r===null)return;const e=`${t}:`;try{const o=[];for(let n=0;n<r.length;n+=1){const c=r.key(n);c?.startsWith(e)===!0&&o.push(c)}for(const n of o)r.removeItem(n)}catch(o){i("clear",`${t}:*`,o)}},f=(t,r)=>{const e=a(t).scope,o=u(e);return o===r?!1:(S(t),g(e,r),o!==null)};exports.assertStorageNamespace=s;exports.clearExplorerStorage=S;exports.readStorage=u;exports.storageKeys=a;exports.syncStorageScope=f;exports.writeStorage=g;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { tapScrollCircleSampleVisual as e } from "@aiquants/virtualscroll";
|
|
2
|
-
import { T as C, c as _, d as L } from "./index-CO-RgTml.js";
|
|
3
|
-
const s = Object.freeze({
|
|
4
|
-
renderVisual: e,
|
|
5
|
-
...L,
|
|
6
|
-
size: _,
|
|
7
|
-
offsetX: C
|
|
8
|
-
}), E = Object.freeze({ enabled: !1 });
|
|
9
|
-
export {
|
|
10
|
-
E as NO_TAP_SCROLL_CIRCLE,
|
|
11
|
-
s as TAP_SCROLL_CIRCLE
|
|
12
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("@aiquants/virtualscroll"),e=require("./index-DSkK8iLE.cjs"),L=Object.freeze({renderVisual:C.tapScrollCircleSampleVisual,...e.TAP_SCROLL_CIRCLE_SPEED_RANGE,size:e.TAP_SCROLL_CIRCLE_SIZE,offsetX:e.TAP_SCROLL_CIRCLE_OFFSET_X}),_=Object.freeze({enabled:!1});exports.NO_TAP_SCROLL_CIRCLE=_;exports.TAP_SCROLL_CIRCLE=L;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { useSyncExternalStore as d, useRef as c, useLayoutEffect as E, useCallback as a, useEffect as S, useMemo as h } from "react";
|
|
2
|
-
import { S as y } from "./location-perTmwct.js";
|
|
3
|
-
const m = "(pointer: coarse)", C = (e) => {
|
|
4
|
-
const t = window.matchMedia(m);
|
|
5
|
-
return t.addEventListener("change", e), () => t.removeEventListener("change", e);
|
|
6
|
-
}, L = () => window.matchMedia(m).matches, T = () => !1, v = () => d(C, L, T), w = (e) => {
|
|
7
|
-
const t = c(e);
|
|
8
|
-
E(() => {
|
|
9
|
-
t.current = e;
|
|
10
|
-
}, [e]);
|
|
11
|
-
const s = c(null), r = c(null), n = c(!1), u = a(() => {
|
|
12
|
-
r.current !== null && clearTimeout(r.current), r.current = setTimeout(() => {
|
|
13
|
-
r.current = null, s.current !== null && t.current(s.current);
|
|
14
|
-
}, y);
|
|
15
|
-
}, []);
|
|
16
|
-
S(
|
|
17
|
-
() => () => {
|
|
18
|
-
r.current !== null && clearTimeout(r.current);
|
|
19
|
-
},
|
|
20
|
-
[]
|
|
21
|
-
);
|
|
22
|
-
const i = a(
|
|
23
|
-
(o, f) => {
|
|
24
|
-
s.current = o, f.source === "keyboard" ? u() : f.source === "pointer" && (n.current = !0);
|
|
25
|
-
},
|
|
26
|
-
[u]
|
|
27
|
-
), l = a(
|
|
28
|
-
(o) => {
|
|
29
|
-
if (o) {
|
|
30
|
-
n.current = !1;
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
n.current && (n.current = !1, u());
|
|
34
|
-
},
|
|
35
|
-
[u]
|
|
36
|
-
);
|
|
37
|
-
return h(() => ({ layoutChanged: i, draggingChanged: l }), [i, l]);
|
|
38
|
-
};
|
|
39
|
-
export {
|
|
40
|
-
w as a,
|
|
41
|
-
v as u
|
|
42
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("react"),d=require("./location-BxiJRTyw.cjs"),f="(pointer: coarse)",E=r=>{const n=window.matchMedia(f);return n.addEventListener("change",r),()=>n.removeEventListener("change",r)},S=()=>window.matchMedia(f).matches,m=()=>!1,C=()=>e.useSyncExternalStore(E,S,m),R=r=>{const n=e.useRef(r);e.useLayoutEffect(()=>{n.current=r},[r]);const c=e.useRef(null),t=e.useRef(null),s=e.useRef(!1),u=e.useCallback(()=>{t.current!==null&&clearTimeout(t.current),t.current=setTimeout(()=>{t.current=null,c.current!==null&&n.current(c.current)},d.SPLIT_PERSIST_DELAY_MS)},[]);e.useEffect(()=>()=>{t.current!==null&&clearTimeout(t.current)},[]);const a=e.useCallback((o,l)=>{c.current=o,l.source==="keyboard"?u():l.source==="pointer"&&(s.current=!0)},[u]),i=e.useCallback(o=>{if(o){s.current=!1;return}s.current&&(s.current=!1,u())},[u]);return e.useMemo(()=>({layoutChanged:a,draggingChanged:i}),[a,i])};exports.useCoarsePointer=C;exports.useSplitPersistence=R;
|