themed-markdown 0.1.88 → 0.1.90
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +219 -115
- package/dist/industryMarkdown/components/IndustryMarkdownSlide.d.ts +14 -0
- package/dist/industryMarkdown/components/IndustryMarkdownSlide.d.ts.map +1 -1
- package/dist/industryMarkdown/utils/annotationResolver.d.ts.map +1 -1
- package/dist/industryMarkdown/utils/useAnnotations.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1627,7 +1627,7 @@ var parseMarkdownChunks2 = parseMarkdownChunks;
|
|
|
1627
1627
|
import { useEffect as useEffect2, useLayoutEffect, useMemo, useRef, useState as useState2 } from "react";
|
|
1628
1628
|
|
|
1629
1629
|
// industryMarkdown/utils/annotationResolver.ts
|
|
1630
|
-
var SKIP_SELECTOR = "script, style,
|
|
1630
|
+
var SKIP_SELECTOR = "script, style, pre";
|
|
1631
1631
|
function buildTextIndex(root) {
|
|
1632
1632
|
const walker = document.createTreeWalker(root, NodeFilter.SHOW_TEXT, {
|
|
1633
1633
|
acceptNode(node) {
|
|
@@ -1709,64 +1709,61 @@ function selectionToAnchor(root, selection, contextLength = 32) {
|
|
|
1709
1709
|
}
|
|
1710
1710
|
|
|
1711
1711
|
// industryMarkdown/utils/useAnnotations.ts
|
|
1712
|
-
var MARKER_CLASS = "industry-md-annotation";
|
|
1713
1712
|
var INDICATOR_HOST_CLASS = "industry-md-annotation-indicator";
|
|
1714
|
-
|
|
1715
|
-
|
|
1713
|
+
var HIGHLIGHT_NAME = "industry-md-annotation";
|
|
1714
|
+
var HIGHLIGHT_ACTIVE_NAME = "industry-md-annotation-active";
|
|
1715
|
+
var HIGHLIGHT_HOVER_NAME = "industry-md-annotation-hover";
|
|
1716
|
+
function getHighlightApi() {
|
|
1717
|
+
if (typeof CSS === "undefined" || !("highlights" in CSS))
|
|
1718
|
+
return null;
|
|
1719
|
+
const HighlightCtor = globalThis.Highlight;
|
|
1720
|
+
if (!HighlightCtor)
|
|
1721
|
+
return null;
|
|
1722
|
+
const registry = CSS.highlights;
|
|
1723
|
+
const ensure = (name) => {
|
|
1724
|
+
let h = registry.get(name);
|
|
1725
|
+
if (!h) {
|
|
1726
|
+
h = new HighlightCtor;
|
|
1727
|
+
registry.set(name, h);
|
|
1728
|
+
}
|
|
1729
|
+
return h;
|
|
1730
|
+
};
|
|
1731
|
+
return {
|
|
1732
|
+
base: ensure(HIGHLIGHT_NAME),
|
|
1733
|
+
active: ensure(HIGHLIGHT_ACTIVE_NAME),
|
|
1734
|
+
hover: ensure(HIGHLIGHT_HOVER_NAME)
|
|
1735
|
+
};
|
|
1716
1736
|
}
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
});
|
|
1728
|
-
const hosts = root.querySelectorAll(`.${INDICATOR_HOST_CLASS}`);
|
|
1729
|
-
hosts.forEach((host) => host.parentNode?.removeChild(host));
|
|
1730
|
-
root.normalize();
|
|
1737
|
+
var OVERLAY_CLASS = "industry-md-annotation-overlay";
|
|
1738
|
+
function getOrCreateOverlay(root) {
|
|
1739
|
+
let overlay = root.querySelector(`:scope > .${OVERLAY_CLASS}`);
|
|
1740
|
+
if (overlay)
|
|
1741
|
+
return overlay;
|
|
1742
|
+
overlay = document.createElement("div");
|
|
1743
|
+
overlay.className = OVERLAY_CLASS;
|
|
1744
|
+
overlay.style.cssText = "position:absolute;inset:0;pointer-events:none;z-index:1;";
|
|
1745
|
+
root.appendChild(overlay);
|
|
1746
|
+
return overlay;
|
|
1731
1747
|
}
|
|
1732
|
-
function
|
|
1733
|
-
const
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
textNodes.push(range.commonAncestorContainer);
|
|
1748
|
+
function clearHosts(root) {
|
|
1749
|
+
const overlay = root.querySelector(`:scope > .${OVERLAY_CLASS}`);
|
|
1750
|
+
if (overlay)
|
|
1751
|
+
overlay.replaceChildren();
|
|
1752
|
+
}
|
|
1753
|
+
function positionHost(host, range, root) {
|
|
1754
|
+
const rects = range.getClientRects();
|
|
1755
|
+
if (rects.length === 0) {
|
|
1756
|
+
host.style.display = "none";
|
|
1757
|
+
return;
|
|
1743
1758
|
}
|
|
1744
|
-
const
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
if (start >= end)
|
|
1753
|
-
return;
|
|
1754
|
-
let target = textNode;
|
|
1755
|
-
if (start > 0) {
|
|
1756
|
-
target = target.splitText(start);
|
|
1757
|
-
}
|
|
1758
|
-
if (end - start < target.nodeValue.length) {
|
|
1759
|
-
target.splitText(end - start);
|
|
1760
|
-
}
|
|
1761
|
-
const marker = document.createElement("span");
|
|
1762
|
-
marker.className = MARKER_CLASS;
|
|
1763
|
-
marker.setAttribute("data-annotation-id", annotationId);
|
|
1764
|
-
marker.setAttribute("data-annotation-marker", "true");
|
|
1765
|
-
target.parentNode.insertBefore(marker, target);
|
|
1766
|
-
marker.appendChild(target);
|
|
1767
|
-
markers.push(marker);
|
|
1768
|
-
});
|
|
1769
|
-
return markers;
|
|
1759
|
+
const last = rects[rects.length - 1];
|
|
1760
|
+
const rootRect = root.getBoundingClientRect();
|
|
1761
|
+
const top = last.top - rootRect.top + root.scrollTop;
|
|
1762
|
+
const left = last.right - rootRect.left + root.scrollLeft;
|
|
1763
|
+
host.style.cssText = `position:absolute;top:${top}px;left:${left}px;` + `pointer-events:auto;line-height:${last.height}px;`;
|
|
1764
|
+
}
|
|
1765
|
+
function annotationsSignature(annotations) {
|
|
1766
|
+
return annotations.map((a) => `${a.id}|${a.anchor.exact}|${a.anchor.prefix ?? ""}|${a.anchor.suffix ?? ""}|${a.count ?? ""}`).join("::");
|
|
1770
1767
|
}
|
|
1771
1768
|
function useAnnotations({
|
|
1772
1769
|
rootRef,
|
|
@@ -1779,25 +1776,52 @@ function useAnnotations({
|
|
|
1779
1776
|
const signature = useMemo(() => annotationsSignature(annotations ?? []), [annotations]);
|
|
1780
1777
|
const annotationsRef = useRef(annotations);
|
|
1781
1778
|
annotationsRef.current = annotations;
|
|
1779
|
+
const activeIdRef = useRef(activeAnnotationId);
|
|
1780
|
+
activeIdRef.current = activeAnnotationId;
|
|
1782
1781
|
const lastAppliedRef = useRef("");
|
|
1783
1782
|
const lastResolvedIdsRef = useRef(new Set);
|
|
1783
|
+
const ownedRangesRef = useRef(new Set);
|
|
1784
|
+
const resolvedRef = useRef([]);
|
|
1785
|
+
useEffect2(() => {
|
|
1786
|
+
return () => {
|
|
1787
|
+
const api = getHighlightApi();
|
|
1788
|
+
if (api) {
|
|
1789
|
+
ownedRangesRef.current.forEach((r) => {
|
|
1790
|
+
api.base.delete(r);
|
|
1791
|
+
api.active.delete(r);
|
|
1792
|
+
api.hover.delete(r);
|
|
1793
|
+
});
|
|
1794
|
+
}
|
|
1795
|
+
ownedRangesRef.current.clear();
|
|
1796
|
+
};
|
|
1797
|
+
}, []);
|
|
1784
1798
|
useLayoutEffect(() => {
|
|
1785
1799
|
const root = rootRef.current;
|
|
1786
1800
|
if (!root)
|
|
1787
1801
|
return;
|
|
1788
1802
|
const current = annotationsRef.current ?? [];
|
|
1789
|
-
const
|
|
1790
|
-
|
|
1803
|
+
const api = getHighlightApi();
|
|
1804
|
+
const existingHostIds = new Set;
|
|
1805
|
+
root.querySelectorAll(`.${INDICATOR_HOST_CLASS}`).forEach((el) => {
|
|
1791
1806
|
const id = el.getAttribute("data-annotation-id");
|
|
1792
1807
|
if (id)
|
|
1793
|
-
|
|
1808
|
+
existingHostIds.add(id);
|
|
1794
1809
|
});
|
|
1795
1810
|
const annotationsChanged = lastAppliedRef.current !== signature;
|
|
1796
|
-
const
|
|
1797
|
-
if (!annotationsChanged &&
|
|
1811
|
+
const allHostsPresent = Array.from(lastResolvedIdsRef.current).every((id) => existingHostIds.has(id));
|
|
1812
|
+
if (!annotationsChanged && allHostsPresent) {
|
|
1798
1813
|
return;
|
|
1799
1814
|
}
|
|
1800
|
-
|
|
1815
|
+
if (api) {
|
|
1816
|
+
ownedRangesRef.current.forEach((r) => {
|
|
1817
|
+
api.base.delete(r);
|
|
1818
|
+
api.active.delete(r);
|
|
1819
|
+
api.hover.delete(r);
|
|
1820
|
+
});
|
|
1821
|
+
}
|
|
1822
|
+
ownedRangesRef.current.clear();
|
|
1823
|
+
clearHosts(root);
|
|
1824
|
+
resolvedRef.current = [];
|
|
1801
1825
|
lastAppliedRef.current = signature;
|
|
1802
1826
|
if (current.length === 0) {
|
|
1803
1827
|
lastResolvedIdsRef.current = new Set;
|
|
@@ -1805,47 +1829,79 @@ function useAnnotations({
|
|
|
1805
1829
|
return;
|
|
1806
1830
|
}
|
|
1807
1831
|
const next = [];
|
|
1832
|
+
const newResolved = [];
|
|
1808
1833
|
const resolvedIds = new Set;
|
|
1834
|
+
const activeId = activeIdRef.current;
|
|
1809
1835
|
current.forEach((annotation) => {
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1836
|
+
let range = null;
|
|
1837
|
+
try {
|
|
1838
|
+
range = resolveTextQuote(root, annotation.anchor);
|
|
1839
|
+
} catch {
|
|
1840
|
+
range = null;
|
|
1814
1841
|
}
|
|
1815
|
-
|
|
1816
|
-
if (markers.length === 0) {
|
|
1842
|
+
if (!range) {
|
|
1817
1843
|
next.push({ annotation, host: document.createElement("span"), resolved: false });
|
|
1818
1844
|
return;
|
|
1819
1845
|
}
|
|
1820
|
-
const last = markers[markers.length - 1];
|
|
1821
|
-
last.classList.add(`${MARKER_CLASS}--last`);
|
|
1822
|
-
if (typeof annotation.count === "number" && annotation.count > 0) {
|
|
1823
|
-
last.setAttribute("data-count", String(annotation.count));
|
|
1824
|
-
}
|
|
1825
1846
|
const host = document.createElement("span");
|
|
1826
1847
|
host.className = INDICATOR_HOST_CLASS;
|
|
1827
|
-
host.setAttribute("data-annotation-
|
|
1828
|
-
|
|
1848
|
+
host.setAttribute("data-annotation-id", annotation.id);
|
|
1849
|
+
if (typeof annotation.count === "number" && annotation.count > 0) {
|
|
1850
|
+
host.setAttribute("data-count", String(annotation.count));
|
|
1851
|
+
}
|
|
1852
|
+
if (activeId && annotation.id === activeId) {
|
|
1853
|
+
host.setAttribute("data-active", "true");
|
|
1854
|
+
}
|
|
1855
|
+
const overlay = getOrCreateOverlay(root);
|
|
1856
|
+
overlay.appendChild(host);
|
|
1857
|
+
positionHost(host, range, root);
|
|
1858
|
+
if (api) {
|
|
1859
|
+
ownedRangesRef.current.add(range);
|
|
1860
|
+
if (activeId && annotation.id === activeId) {
|
|
1861
|
+
api.active.add(range);
|
|
1862
|
+
} else {
|
|
1863
|
+
api.base.add(range);
|
|
1864
|
+
}
|
|
1865
|
+
}
|
|
1866
|
+
newResolved.push({ annotation, range, host });
|
|
1829
1867
|
next.push({ annotation, host, resolved: true });
|
|
1830
1868
|
resolvedIds.add(annotation.id);
|
|
1831
1869
|
});
|
|
1870
|
+
resolvedRef.current = newResolved;
|
|
1832
1871
|
lastResolvedIdsRef.current = resolvedIds;
|
|
1833
1872
|
setMounts(next);
|
|
1834
1873
|
});
|
|
1835
1874
|
useEffect2(() => {
|
|
1836
1875
|
const root = rootRef.current;
|
|
1837
|
-
if (!root)
|
|
1876
|
+
if (!root || typeof ResizeObserver === "undefined")
|
|
1838
1877
|
return;
|
|
1839
|
-
const
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1878
|
+
const reposition = () => {
|
|
1879
|
+
resolvedRef.current.forEach((entry) => positionHost(entry.host, entry.range, root));
|
|
1880
|
+
};
|
|
1881
|
+
const observer = new ResizeObserver(reposition);
|
|
1882
|
+
observer.observe(root);
|
|
1883
|
+
return () => observer.disconnect();
|
|
1884
|
+
}, [rootRef, mounts]);
|
|
1885
|
+
useEffect2(() => {
|
|
1886
|
+
const api = getHighlightApi();
|
|
1887
|
+
resolvedRef.current.forEach((entry) => {
|
|
1888
|
+
const isActive = !!activeAnnotationId && entry.annotation.id === activeAnnotationId;
|
|
1889
|
+
if (api) {
|
|
1890
|
+
if (isActive) {
|
|
1891
|
+
api.base.delete(entry.range);
|
|
1892
|
+
api.active.add(entry.range);
|
|
1893
|
+
} else {
|
|
1894
|
+
api.active.delete(entry.range);
|
|
1895
|
+
api.base.add(entry.range);
|
|
1896
|
+
}
|
|
1897
|
+
}
|
|
1898
|
+
if (isActive) {
|
|
1899
|
+
entry.host.setAttribute("data-active", "true");
|
|
1844
1900
|
} else {
|
|
1845
|
-
|
|
1901
|
+
entry.host.removeAttribute("data-active");
|
|
1846
1902
|
}
|
|
1847
1903
|
});
|
|
1848
|
-
}, [
|
|
1904
|
+
}, [activeAnnotationId, mounts]);
|
|
1849
1905
|
useEffect2(() => {
|
|
1850
1906
|
if (!onSelectionChange)
|
|
1851
1907
|
return;
|
|
@@ -1892,24 +1948,74 @@ function useAnnotations({
|
|
|
1892
1948
|
const root = rootRef.current;
|
|
1893
1949
|
if (!root)
|
|
1894
1950
|
return;
|
|
1951
|
+
const hitTest = (x, y) => {
|
|
1952
|
+
for (const entry of resolvedRef.current) {
|
|
1953
|
+
const rects = entry.range.getClientRects();
|
|
1954
|
+
for (let i = 0;i < rects.length; i++) {
|
|
1955
|
+
const r = rects[i];
|
|
1956
|
+
if (x >= r.left && x <= r.right && y >= r.top && y <= r.bottom) {
|
|
1957
|
+
return entry.annotation.id;
|
|
1958
|
+
}
|
|
1959
|
+
}
|
|
1960
|
+
}
|
|
1961
|
+
return null;
|
|
1962
|
+
};
|
|
1895
1963
|
const handleClick = (event) => {
|
|
1896
1964
|
const selection = document.getSelection();
|
|
1897
1965
|
if (selection && !selection.isCollapsed)
|
|
1898
1966
|
return;
|
|
1899
1967
|
const target = event.target;
|
|
1900
|
-
if (
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1968
|
+
if (target instanceof Element) {
|
|
1969
|
+
const host = target.closest(`.${INDICATOR_HOST_CLASS}`);
|
|
1970
|
+
if (host) {
|
|
1971
|
+
const id2 = host.getAttribute("data-annotation-id");
|
|
1972
|
+
if (id2) {
|
|
1973
|
+
onAnnotationClick(id2, event);
|
|
1974
|
+
return;
|
|
1975
|
+
}
|
|
1976
|
+
}
|
|
1977
|
+
}
|
|
1978
|
+
const id = hitTest(event.clientX, event.clientY);
|
|
1979
|
+
if (id)
|
|
1980
|
+
onAnnotationClick(id, event);
|
|
1981
|
+
};
|
|
1982
|
+
let hoveredId = null;
|
|
1983
|
+
const setHover = (id) => {
|
|
1984
|
+
if (id === hoveredId)
|
|
1907
1985
|
return;
|
|
1908
|
-
|
|
1986
|
+
const api = getHighlightApi();
|
|
1987
|
+
if (api) {
|
|
1988
|
+
if (hoveredId) {
|
|
1989
|
+
const prev = resolvedRef.current.find((e) => e.annotation.id === hoveredId);
|
|
1990
|
+
if (prev)
|
|
1991
|
+
api.hover.delete(prev.range);
|
|
1992
|
+
}
|
|
1993
|
+
if (id) {
|
|
1994
|
+
const next = resolvedRef.current.find((e) => e.annotation.id === id);
|
|
1995
|
+
if (next)
|
|
1996
|
+
api.hover.add(next.range);
|
|
1997
|
+
}
|
|
1998
|
+
}
|
|
1999
|
+
hoveredId = id;
|
|
2000
|
+
};
|
|
2001
|
+
const handleMove = (event) => {
|
|
2002
|
+
const id = hitTest(event.clientX, event.clientY);
|
|
2003
|
+
root.style.cursor = id ? "pointer" : "";
|
|
2004
|
+
setHover(id);
|
|
2005
|
+
};
|
|
2006
|
+
const handleLeave = () => {
|
|
2007
|
+
root.style.cursor = "";
|
|
2008
|
+
setHover(null);
|
|
1909
2009
|
};
|
|
1910
2010
|
root.addEventListener("click", handleClick);
|
|
2011
|
+
root.addEventListener("mousemove", handleMove);
|
|
2012
|
+
root.addEventListener("mouseleave", handleLeave);
|
|
1911
2013
|
return () => {
|
|
1912
2014
|
root.removeEventListener("click", handleClick);
|
|
2015
|
+
root.removeEventListener("mousemove", handleMove);
|
|
2016
|
+
root.removeEventListener("mouseleave", handleLeave);
|
|
2017
|
+
root.style.cursor = "";
|
|
2018
|
+
setHover(null);
|
|
1913
2019
|
};
|
|
1914
2020
|
}, [rootRef, onAnnotationClick]);
|
|
1915
2021
|
return mounts;
|
|
@@ -4078,30 +4184,25 @@ var highlightOverrides = `
|
|
|
4078
4184
|
}
|
|
4079
4185
|
`;
|
|
4080
4186
|
var annotationCSS = `
|
|
4081
|
-
|
|
4187
|
+
::highlight(industry-md-annotation) {
|
|
4082
4188
|
background-color: var(--industry-md-annotation-bg, rgba(255, 193, 7, 0.22));
|
|
4083
|
-
padding: 0.15em 0.25em;
|
|
4084
|
-
margin: 0 -0.05em;
|
|
4085
|
-
border-radius: 3px;
|
|
4086
|
-
cursor: pointer;
|
|
4087
|
-
/* Re-apply padding/radius on each line fragment when the highlight wraps. */
|
|
4088
|
-
-webkit-box-decoration-break: clone;
|
|
4089
|
-
box-decoration-break: clone;
|
|
4090
4189
|
}
|
|
4091
|
-
|
|
4190
|
+
::highlight(industry-md-annotation-active) {
|
|
4092
4191
|
background-color: var(
|
|
4093
4192
|
--industry-md-annotation-active-bg,
|
|
4094
4193
|
rgba(255, 193, 7, 0.5)
|
|
4095
4194
|
);
|
|
4096
4195
|
}
|
|
4097
|
-
|
|
4098
|
-
|
|
4196
|
+
::highlight(industry-md-annotation-hover) {
|
|
4197
|
+
background-color: var(
|
|
4198
|
+
--industry-md-annotation-hover-bg,
|
|
4199
|
+
rgba(255, 193, 7, 0.18)
|
|
4200
|
+
);
|
|
4099
4201
|
}
|
|
4100
|
-
.industry-md-annotation
|
|
4202
|
+
.industry-md-annotation-indicator[data-count]::after {
|
|
4101
4203
|
content: attr(data-count);
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
right: -0.8em;
|
|
4204
|
+
display: inline-block;
|
|
4205
|
+
transform: translate(2px, -50%);
|
|
4105
4206
|
min-width: 1.1em;
|
|
4106
4207
|
height: 1.1em;
|
|
4107
4208
|
padding: 0 0.3em;
|
|
@@ -4112,17 +4213,12 @@ var annotationCSS = `
|
|
|
4112
4213
|
rgba(180, 120, 0, 0.95)
|
|
4113
4214
|
);
|
|
4114
4215
|
color: var(--industry-md-annotation-badge-color, #fff);
|
|
4115
|
-
font-size:
|
|
4216
|
+
font-size: 11px;
|
|
4116
4217
|
font-weight: 600;
|
|
4117
4218
|
line-height: 1.1em;
|
|
4118
4219
|
text-align: center;
|
|
4119
|
-
pointer-events: none;
|
|
4120
4220
|
box-shadow: 0 0 0 1.5px var(--industry-md-annotation-badge-ring, #fff);
|
|
4121
|
-
|
|
4122
|
-
.industry-md-annotation-indicator {
|
|
4123
|
-
display: inline;
|
|
4124
|
-
margin-left: 0.25em;
|
|
4125
|
-
vertical-align: baseline;
|
|
4221
|
+
cursor: pointer;
|
|
4126
4222
|
}
|
|
4127
4223
|
`;
|
|
4128
4224
|
var fontTransitionCSS = `
|
|
@@ -4211,6 +4307,7 @@ var IndustryMarkdownSlide = React13.memo(function IndustryMarkdownSlide2({
|
|
|
4211
4307
|
containerWidth,
|
|
4212
4308
|
transparentBackground = false,
|
|
4213
4309
|
additionalPadding,
|
|
4310
|
+
disableBasePadding,
|
|
4214
4311
|
disableScroll = false,
|
|
4215
4312
|
minScreenWidth: _minScreenWidth,
|
|
4216
4313
|
maxScreenWidth: _maxScreenWidth,
|
|
@@ -4462,8 +4559,10 @@ var IndustryMarkdownSlide = React13.memo(function IndustryMarkdownSlide2({
|
|
|
4462
4559
|
const finalPadding = useMemo3(() => {
|
|
4463
4560
|
const basePadding = calculateSlidePadding.horizontal;
|
|
4464
4561
|
const baseVerticalPadding = calculateSlidePadding.vertical;
|
|
4465
|
-
const
|
|
4466
|
-
const
|
|
4562
|
+
const disableHorizontal = disableBasePadding === true || typeof disableBasePadding === "object" && !!disableBasePadding?.horizontal;
|
|
4563
|
+
const disableVertical = disableBasePadding === true || typeof disableBasePadding === "object" && !!disableBasePadding?.vertical;
|
|
4564
|
+
const baseHorizontalValue = disableHorizontal ? 0 : parseInt(basePadding.replace("px", ""), 10);
|
|
4565
|
+
const baseVerticalValue = disableVertical ? 0 : parseInt(baseVerticalPadding.replace("px", ""), 10);
|
|
4467
4566
|
const leftExtra = additionalPadding?.left ? parseInt(additionalPadding.left.replace("px", ""), 10) : 0;
|
|
4468
4567
|
const rightExtra = additionalPadding?.right ? parseInt(additionalPadding.right.replace("px", ""), 10) : 0;
|
|
4469
4568
|
const topExtra = additionalPadding?.top ? parseInt(additionalPadding.top.replace("px", ""), 10) : 0;
|
|
@@ -4473,7 +4572,12 @@ var IndustryMarkdownSlide = React13.memo(function IndustryMarkdownSlide2({
|
|
|
4473
4572
|
const bottom = Math.round(baseVerticalValue * 1.5) + bottomExtra;
|
|
4474
4573
|
const left = baseHorizontalValue + leftExtra;
|
|
4475
4574
|
return `${top}px ${right}px ${bottom}px ${left}px`;
|
|
4476
|
-
}, [
|
|
4575
|
+
}, [
|
|
4576
|
+
calculateSlidePadding.horizontal,
|
|
4577
|
+
calculateSlidePadding.vertical,
|
|
4578
|
+
additionalPadding,
|
|
4579
|
+
disableBasePadding
|
|
4580
|
+
]);
|
|
4477
4581
|
useEffect8(() => {
|
|
4478
4582
|
const slideElement = slideRef.current;
|
|
4479
4583
|
if (slideElement) {
|
|
@@ -88,6 +88,20 @@ export interface IndustryMarkdownSlideProps {
|
|
|
88
88
|
top?: string;
|
|
89
89
|
bottom?: string;
|
|
90
90
|
};
|
|
91
|
+
/**
|
|
92
|
+
* Skip the container-width-derived base padding on one or both axes.
|
|
93
|
+
* When `true` (boolean shorthand) both axes are zeroed. `additionalPadding`
|
|
94
|
+
* is still applied on top, so the parent can layer its own padding while
|
|
95
|
+
* dropping the slide's default 3%-of-width inset.
|
|
96
|
+
*
|
|
97
|
+
* Useful when the slide is embedded in a layout that already owns
|
|
98
|
+
* horizontal alignment (e.g., aligning the rendered markdown with
|
|
99
|
+
* surrounding body copy).
|
|
100
|
+
*/
|
|
101
|
+
disableBasePadding?: boolean | {
|
|
102
|
+
horizontal?: boolean;
|
|
103
|
+
vertical?: boolean;
|
|
104
|
+
};
|
|
91
105
|
disableScroll?: boolean;
|
|
92
106
|
minScreenWidth?: number;
|
|
93
107
|
maxScreenWidth?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IndustryMarkdownSlide.d.ts","sourceRoot":"","sources":["../../../industryMarkdown/components/IndustryMarkdownSlide.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AAEH,OAAO,EAAE,KAAK,EAAyB,MAAM,+BAA+B,CAAC;AAC7E,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,EACf,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAA6E,MAAM,OAAO,CAAC;AASlG,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAWpD,MAAM,WAAW,0BAA0B;IAEzC,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IAGpB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IACzD,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACtF,kBAAkB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,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W,CAAC,EAAE,UAAU,EAAE,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,KAAK,CAAC,SAAS,CAAC;IAC/D,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,mBAAmB,GAAG,IAAI,KAAK,IAAI,CAAC;IACpE,iBAAiB,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IACtE;;;;OAIG;IACH,eAAe,CAAC,EAAE;QAChB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,qBAAqB,CAAC,EAAE,MAAM,CAAC;KAChC,CAAC;CACH;AA4RD,MAAM,WAAW,oBAAoB;IACnC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,IAAI,CAAC,EAAE;QACL,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;QACpB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;QACtB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;QAClB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;KACrB,CAAC;IACF,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAGD,wBAAgB,4BAA4B,CAAC,MAAM,CAAC,EAAE,oBAAoB,GAAG,eAAe,EAAE,CA8D7F;AAED,eAAO,MAAM,qBAAqB,wDA0vBhC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotationResolver.d.ts","sourceRoot":"","sources":["../../../industryMarkdown/utils/annotationResolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"annotationResolver.d.ts","sourceRoot":"","sources":["../../../industryMarkdown/utils/annotationResolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AA8C5D;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,eAAe,GAAG,KAAK,GAAG,IAAI,CAoBzF;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,WAAW,EACjB,SAAS,EAAE,SAAS,EACpB,aAAa,SAAK,GACjB,eAAe,GAAG,IAAI,CAsBxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAnnotations.d.ts","sourceRoot":"","sources":["../../../industryMarkdown/utils/useAnnotations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9F,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"useAnnotations.d.ts","sourceRoot":"","sources":["../../../industryMarkdown/utils/useAnnotations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9F,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAmG7F,UAAU,oBAAoB,CAAC,SAAS;IACtC,OAAO,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACvC,WAAW,EAAE,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;IACrC,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,mBAAmB,GAAG,IAAI,KAAK,IAAI,CAAC;IACpE,iBAAiB,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;CACvE;AAED,MAAM,WAAW,eAAe,CAAC,SAAS;IACxC,UAAU,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAClC,IAAI,EAAE,WAAW,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAQD,wBAAgB,cAAc,CAAC,SAAS,EAAE,EACxC,OAAO,EACP,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,GAClB,EAAE,oBAAoB,CAAC,SAAS,CAAC,GAAG,eAAe,CAAC,SAAS,CAAC,EAAE,CAkShE;AAED,YAAY,EAAE,eAAe,EAAE,CAAC"}
|