@superdoc-dev/cli 0.11.0-next.1 → 0.11.0-next.2
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.js +291 -33
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -209584,7 +209584,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
|
|
|
209584
209584
|
init_remark_gfm_BhnWr3yf_es();
|
|
209585
209585
|
});
|
|
209586
209586
|
|
|
209587
|
-
// ../../packages/superdoc/dist/chunks/src-
|
|
209587
|
+
// ../../packages/superdoc/dist/chunks/src-DTrWuNvy.es.js
|
|
209588
209588
|
function deleteProps(obj, propOrProps) {
|
|
209589
209589
|
const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
|
|
209590
209590
|
const removeNested = (target, pathParts, index2 = 0) => {
|
|
@@ -269017,6 +269017,7 @@ function lineHeightBeforeIndex(lines, fromLine, targetIndex) {
|
|
|
269017
269017
|
function computeCaretLayoutRectGeometry({ layout, blocks: blocks2, measures, painterHost, viewportHost, visibleHost, zoom }, pos, includeDomFallback = true) {
|
|
269018
269018
|
if (!layout)
|
|
269019
269019
|
return null;
|
|
269020
|
+
const originalPos = pos;
|
|
269020
269021
|
let effectivePos = pos;
|
|
269021
269022
|
let hit = getFragmentAtPosition(layout, blocks2, measures, pos);
|
|
269022
269023
|
if (!hit) {
|
|
@@ -269088,28 +269089,105 @@ function computeCaretLayoutRectGeometry({ layout, blocks: blocks2, measures, pai
|
|
|
269088
269089
|
};
|
|
269089
269090
|
const pageEl = getPageElementByIndex(painterHost ?? null, hit.pageIndex);
|
|
269090
269091
|
const pageRect = pageEl?.getBoundingClientRect();
|
|
269092
|
+
if (includeDomFallback && pageRect) {
|
|
269093
|
+
const selection = pageEl?.ownerDocument?.getSelection();
|
|
269094
|
+
if (selection?.rangeCount && selection.isCollapsed) {
|
|
269095
|
+
const nativeRange = selection.getRangeAt(0);
|
|
269096
|
+
if (typeof nativeRange.getBoundingClientRect === "function") {
|
|
269097
|
+
const nativeRect = nativeRange.getBoundingClientRect();
|
|
269098
|
+
const inPageBounds = Number.isFinite(nativeRect.left) && Number.isFinite(nativeRect.top) && Number.isFinite(nativeRect.height) && nativeRect.height > 0 && nativeRect.left >= pageRect.left - 2 && nativeRect.left <= pageRect.right + 2 && nativeRect.top >= pageRect.top - 2 && nativeRect.top <= pageRect.bottom + 2;
|
|
269099
|
+
const nativeX = (nativeRect.left - pageRect.left) / zoom;
|
|
269100
|
+
const nativeY = (nativeRect.top - pageRect.top) / zoom;
|
|
269101
|
+
const withinGeometrySanity = Math.abs(nativeX - result.x) <= 80;
|
|
269102
|
+
if (inPageBounds && withinGeometrySanity)
|
|
269103
|
+
return {
|
|
269104
|
+
pageIndex: hit.pageIndex,
|
|
269105
|
+
x: nativeX,
|
|
269106
|
+
y: nativeY,
|
|
269107
|
+
height: line.lineHeight
|
|
269108
|
+
};
|
|
269109
|
+
}
|
|
269110
|
+
}
|
|
269111
|
+
}
|
|
269091
269112
|
let domCaretX = null;
|
|
269092
269113
|
let domCaretY = null;
|
|
269093
|
-
const
|
|
269094
|
-
|
|
269095
|
-
|
|
269096
|
-
|
|
269097
|
-
|
|
269098
|
-
|
|
269099
|
-
|
|
269100
|
-
|
|
269101
|
-
|
|
269102
|
-
|
|
269103
|
-
if (
|
|
269104
|
-
|
|
269105
|
-
|
|
269106
|
-
|
|
269107
|
-
|
|
269108
|
-
|
|
269109
|
-
|
|
269114
|
+
const spanCandidates = [];
|
|
269115
|
+
const pushUnique = (el) => {
|
|
269116
|
+
if (!spanCandidates.includes(el))
|
|
269117
|
+
spanCandidates.push(el);
|
|
269118
|
+
};
|
|
269119
|
+
const collectSpans = (root3) => {
|
|
269120
|
+
if (!root3)
|
|
269121
|
+
return;
|
|
269122
|
+
const spans = root3.querySelectorAll("span[data-pm-start][data-pm-end]");
|
|
269123
|
+
for (const span of Array.from(spans))
|
|
269124
|
+
if (span instanceof HTMLElement)
|
|
269125
|
+
pushUnique(span);
|
|
269126
|
+
};
|
|
269127
|
+
const lineEls = pageEl?.querySelectorAll(".superdoc-line[data-pm-start][data-pm-end]");
|
|
269128
|
+
let localLineEl = null;
|
|
269129
|
+
for (const lineEl of Array.from(lineEls ?? [])) {
|
|
269130
|
+
if (!(lineEl instanceof HTMLElement))
|
|
269131
|
+
continue;
|
|
269132
|
+
const lineStart = Number(lineEl.dataset.pmStart);
|
|
269133
|
+
const lineEnd = Number(lineEl.dataset.pmEnd);
|
|
269134
|
+
if (!Number.isFinite(lineStart) || !Number.isFinite(lineEnd))
|
|
269135
|
+
continue;
|
|
269136
|
+
if (effectivePos >= lineStart && effectivePos <= lineEnd) {
|
|
269137
|
+
localLineEl = lineEl;
|
|
269110
269138
|
break;
|
|
269111
269139
|
}
|
|
269112
269140
|
}
|
|
269141
|
+
collectSpans(localLineEl);
|
|
269142
|
+
if (spanCandidates.length === 0) {
|
|
269143
|
+
const MAX_PM_DISTANCE = 8;
|
|
269144
|
+
const pageSpans = pageEl?.querySelectorAll("span[data-pm-start][data-pm-end]");
|
|
269145
|
+
for (const span of Array.from(pageSpans ?? [])) {
|
|
269146
|
+
if (!(span instanceof HTMLElement))
|
|
269147
|
+
continue;
|
|
269148
|
+
const pmStart = Number(span.dataset.pmStart);
|
|
269149
|
+
const pmEnd = Number(span.dataset.pmEnd);
|
|
269150
|
+
if (!Number.isFinite(pmStart) || !Number.isFinite(pmEnd))
|
|
269151
|
+
continue;
|
|
269152
|
+
if (effectivePos >= pmStart && effectivePos <= pmEnd) {
|
|
269153
|
+
pushUnique(span);
|
|
269154
|
+
continue;
|
|
269155
|
+
}
|
|
269156
|
+
if (Math.abs(pmStart - effectivePos) <= MAX_PM_DISTANCE || Math.abs(pmEnd - effectivePos) <= MAX_PM_DISTANCE)
|
|
269157
|
+
pushUnique(span);
|
|
269158
|
+
}
|
|
269159
|
+
}
|
|
269160
|
+
const domProbePositions = Array.from(new Set([
|
|
269161
|
+
originalPos,
|
|
269162
|
+
effectivePos,
|
|
269163
|
+
originalPos - 1,
|
|
269164
|
+
originalPos + 1
|
|
269165
|
+
])).filter((candidate) => candidate >= 0);
|
|
269166
|
+
let resolved = false;
|
|
269167
|
+
for (const probePos of domProbePositions) {
|
|
269168
|
+
for (const spanEl of spanCandidates) {
|
|
269169
|
+
const pmStart = Number(spanEl.dataset.pmStart);
|
|
269170
|
+
const pmEnd = Number(spanEl.dataset.pmEnd);
|
|
269171
|
+
if (probePos >= pmStart && probePos <= pmEnd && spanEl.firstChild?.nodeType === Node.TEXT_NODE) {
|
|
269172
|
+
const textNode = spanEl.firstChild;
|
|
269173
|
+
const charIndex = Math.min(probePos - pmStart, textNode.length);
|
|
269174
|
+
const rangeObj = document.createRange();
|
|
269175
|
+
rangeObj.setStart(textNode, charIndex);
|
|
269176
|
+
rangeObj.setEnd(textNode, charIndex);
|
|
269177
|
+
if (typeof rangeObj.getBoundingClientRect !== "function")
|
|
269178
|
+
continue;
|
|
269179
|
+
const rangeRect = rangeObj.getBoundingClientRect();
|
|
269180
|
+
if (pageRect) {
|
|
269181
|
+
domCaretX = (rangeRect.left - pageRect.left) / zoom;
|
|
269182
|
+
domCaretY = (rangeRect.top - pageRect.top) / zoom;
|
|
269183
|
+
resolved = true;
|
|
269184
|
+
break;
|
|
269185
|
+
}
|
|
269186
|
+
}
|
|
269187
|
+
}
|
|
269188
|
+
if (resolved)
|
|
269189
|
+
break;
|
|
269190
|
+
}
|
|
269113
269191
|
if (includeDomFallback && domCaretX != null && domCaretY != null)
|
|
269114
269192
|
return {
|
|
269115
269193
|
pageIndex: hit.pageIndex,
|
|
@@ -284668,7 +284746,148 @@ var Node$13 = class Node$14 {
|
|
|
284668
284746
|
if (!allowedRanges?.length)
|
|
284669
284747
|
return false;
|
|
284670
284748
|
return allowedRanges.some((allowed) => range.from >= allowed.from && range.to <= allowed.to);
|
|
284671
|
-
}, PermissionRanges, Protection, DOM_CLASS_NAMES, DATA_ATTRS, DATASET_KEYS, DRAGGABLE_SELECTOR, VerticalNavigationPluginKey, createDefaultState = () => ({ goalX: null }), VerticalNavigation,
|
|
284749
|
+
}, PermissionRanges, Protection, DOM_CLASS_NAMES, DATA_ATTRS, DATASET_KEYS, DRAGGABLE_SELECTOR, VerticalNavigationPluginKey, createDefaultState = () => ({ goalX: null }), VerticalNavigation, STRONG_RTL_CHAR_RE$1, STRONG_LTR_CHAR_RE, isStrongRtl = (char) => STRONG_RTL_CHAR_RE$1.test(char), isStrongLtr = (char) => STRONG_LTR_CHAR_RE.test(char), hasMixedDirectionBoundary = (leftChar, rightChar) => isStrongRtl(leftChar) && isStrongLtr(rightChar) || isStrongLtr(leftChar) && isStrongRtl(rightChar), resolveCaretPoint = (doc$12, range) => {
|
|
284750
|
+
const rect = range.getBoundingClientRect();
|
|
284751
|
+
if (rect && Number.isFinite(rect.left) && Number.isFinite(rect.top)) {
|
|
284752
|
+
if (rect.width === 0 && rect.height === 0)
|
|
284753
|
+
return null;
|
|
284754
|
+
const midY = rect.height > 0 ? rect.top + rect.height / 2 : rect.top;
|
|
284755
|
+
return {
|
|
284756
|
+
x: rect.left,
|
|
284757
|
+
y: midY
|
|
284758
|
+
};
|
|
284759
|
+
}
|
|
284760
|
+
const node3 = range.startContainer?.nodeType === Node.TEXT_NODE ? range.startContainer.parentElement : range.startContainer;
|
|
284761
|
+
if (!node3 || !(node3 instanceof HTMLElement))
|
|
284762
|
+
return null;
|
|
284763
|
+
const fallbackRect = node3.getBoundingClientRect();
|
|
284764
|
+
if (!fallbackRect)
|
|
284765
|
+
return null;
|
|
284766
|
+
return {
|
|
284767
|
+
x: fallbackRect.left,
|
|
284768
|
+
y: fallbackRect.top + fallbackRect.height / 2
|
|
284769
|
+
};
|
|
284770
|
+
}, resolveLineElement = (doc$12, point5) => {
|
|
284771
|
+
return doc$12.elementsFromPoint(point5.x, point5.y).find((el) => el instanceof HTMLElement ? el.classList.contains("superdoc-line") : false);
|
|
284772
|
+
}, collectVisualChars = (lineEl, view, targetX = null) => {
|
|
284773
|
+
const doc$12 = lineEl.ownerDocument;
|
|
284774
|
+
const nodeFilter = doc$12.defaultView?.NodeFilter;
|
|
284775
|
+
if (!nodeFilter)
|
|
284776
|
+
return [];
|
|
284777
|
+
const chars = [];
|
|
284778
|
+
const walker = doc$12.createTreeWalker(lineEl, nodeFilter.SHOW_TEXT);
|
|
284779
|
+
const RANGE_WINDOW_PX = 96;
|
|
284780
|
+
const hasTargetX = Number.isFinite(targetX);
|
|
284781
|
+
let node3 = walker.nextNode();
|
|
284782
|
+
while (node3) {
|
|
284783
|
+
const textNode = node3;
|
|
284784
|
+
const text5 = textNode.textContent ?? "";
|
|
284785
|
+
for (let i4 = 0;i4 < text5.length; i4 += 1) {
|
|
284786
|
+
const char = text5[i4];
|
|
284787
|
+
if (!char || /\s/.test(char))
|
|
284788
|
+
continue;
|
|
284789
|
+
let pmStart;
|
|
284790
|
+
let pmEnd;
|
|
284791
|
+
try {
|
|
284792
|
+
pmStart = view.posAtDOM(textNode, i4);
|
|
284793
|
+
pmEnd = view.posAtDOM(textNode, i4 + 1);
|
|
284794
|
+
} catch {
|
|
284795
|
+
continue;
|
|
284796
|
+
}
|
|
284797
|
+
if (!Number.isFinite(pmStart) || !Number.isFinite(pmEnd) || pmEnd <= pmStart)
|
|
284798
|
+
continue;
|
|
284799
|
+
const range = doc$12.createRange();
|
|
284800
|
+
range.setStart(textNode, i4);
|
|
284801
|
+
range.setEnd(textNode, i4 + 1);
|
|
284802
|
+
const rect = range.getBoundingClientRect();
|
|
284803
|
+
if (rect.width <= 0 || rect.height <= 0)
|
|
284804
|
+
continue;
|
|
284805
|
+
if (hasTargetX && rect.right < targetX - RANGE_WINDOW_PX)
|
|
284806
|
+
continue;
|
|
284807
|
+
if (hasTargetX && rect.left > targetX + RANGE_WINDOW_PX)
|
|
284808
|
+
continue;
|
|
284809
|
+
chars.push({
|
|
284810
|
+
char,
|
|
284811
|
+
pmStart,
|
|
284812
|
+
pmEnd,
|
|
284813
|
+
centerX: rect.left + rect.width / 2,
|
|
284814
|
+
centerY: rect.top + rect.height / 2
|
|
284815
|
+
});
|
|
284816
|
+
}
|
|
284817
|
+
node3 = walker.nextNode();
|
|
284818
|
+
}
|
|
284819
|
+
return chars;
|
|
284820
|
+
}, resolveBoundaryChars = (chars, caretPoint) => {
|
|
284821
|
+
if (chars.length === 0)
|
|
284822
|
+
return null;
|
|
284823
|
+
const sameBand = chars.filter((c) => Math.abs(c.centerY - caretPoint.y) <= 8);
|
|
284824
|
+
const band = sameBand.length > 0 ? sameBand : chars;
|
|
284825
|
+
band.sort((a2, b$1) => a2.centerX - b$1.centerX);
|
|
284826
|
+
let left$1 = null;
|
|
284827
|
+
let right$1 = null;
|
|
284828
|
+
for (const c of band) {
|
|
284829
|
+
if (c.centerX < caretPoint.x) {
|
|
284830
|
+
left$1 = c;
|
|
284831
|
+
continue;
|
|
284832
|
+
}
|
|
284833
|
+
right$1 = c;
|
|
284834
|
+
break;
|
|
284835
|
+
}
|
|
284836
|
+
if (!left$1 || !right$1)
|
|
284837
|
+
return null;
|
|
284838
|
+
return {
|
|
284839
|
+
left: left$1,
|
|
284840
|
+
right: right$1
|
|
284841
|
+
};
|
|
284842
|
+
}, resolveMixedBidiBackspaceRange = ({ state, view }) => {
|
|
284843
|
+
const { selection } = state;
|
|
284844
|
+
if (!selection?.empty)
|
|
284845
|
+
return null;
|
|
284846
|
+
const doc$12 = view?.dom?.ownerDocument;
|
|
284847
|
+
const nativeSelection = doc$12?.getSelection?.();
|
|
284848
|
+
if (!nativeSelection || nativeSelection.rangeCount === 0)
|
|
284849
|
+
return null;
|
|
284850
|
+
const range = nativeSelection.getRangeAt(0);
|
|
284851
|
+
if (!range.collapsed)
|
|
284852
|
+
return null;
|
|
284853
|
+
const caretPoint = resolveCaretPoint(doc$12, range);
|
|
284854
|
+
if (!caretPoint)
|
|
284855
|
+
return null;
|
|
284856
|
+
const lineEl = resolveLineElement(doc$12, caretPoint);
|
|
284857
|
+
if (!lineEl)
|
|
284858
|
+
return null;
|
|
284859
|
+
const lineText = lineEl.textContent ?? "";
|
|
284860
|
+
const hasRtl = STRONG_RTL_CHAR_RE$1.test(lineText);
|
|
284861
|
+
const hasLtr = STRONG_LTR_CHAR_RE.test(lineText);
|
|
284862
|
+
if (!hasRtl || !hasLtr)
|
|
284863
|
+
return null;
|
|
284864
|
+
let chars = collectVisualChars(lineEl, view, caretPoint.x);
|
|
284865
|
+
if (chars.length < 2)
|
|
284866
|
+
chars = collectVisualChars(lineEl, view, null);
|
|
284867
|
+
const boundary = resolveBoundaryChars(chars, caretPoint);
|
|
284868
|
+
if (!boundary)
|
|
284869
|
+
return null;
|
|
284870
|
+
if (!hasMixedDirectionBoundary(boundary.left.char, boundary.right.char))
|
|
284871
|
+
return null;
|
|
284872
|
+
if (selection.from !== boundary.right.pmStart && selection.from !== boundary.left.pmEnd)
|
|
284873
|
+
return null;
|
|
284874
|
+
return {
|
|
284875
|
+
from: boundary.left.pmStart,
|
|
284876
|
+
to: boundary.left.pmEnd
|
|
284877
|
+
};
|
|
284878
|
+
}, mixedBidiBackspace = () => ({ state, view, tr, dispatch }) => {
|
|
284879
|
+
const range = resolveMixedBidiBackspaceRange({
|
|
284880
|
+
state,
|
|
284881
|
+
view
|
|
284882
|
+
});
|
|
284883
|
+
if (!range)
|
|
284884
|
+
return false;
|
|
284885
|
+
if (dispatch) {
|
|
284886
|
+
tr.delete(range.from, range.to);
|
|
284887
|
+
tr.scrollIntoView();
|
|
284888
|
+
}
|
|
284889
|
+
return true;
|
|
284890
|
+
}, MixedBidiBackspace, createPermissionBlockMarkerNode = ({ name, attributes }) => Node$13.create({
|
|
284672
284891
|
name,
|
|
284673
284892
|
group: "block",
|
|
284674
284893
|
inline: false,
|
|
@@ -284864,6 +285083,7 @@ var Node$13 = class Node$14 {
|
|
|
284864
285083
|
Image,
|
|
284865
285084
|
NodeResizer,
|
|
284866
285085
|
CustomSelection,
|
|
285086
|
+
MixedBidiBackspace,
|
|
284867
285087
|
MathInline,
|
|
284868
285088
|
MathBlock,
|
|
284869
285089
|
PassthroughInline,
|
|
@@ -284963,6 +285183,7 @@ var Node$13 = class Node$14 {
|
|
|
284963
285183
|
PermissionRanges,
|
|
284964
285184
|
Protection,
|
|
284965
285185
|
VerticalNavigation,
|
|
285186
|
+
MixedBidiBackspace,
|
|
284966
285187
|
MathInline,
|
|
284967
285188
|
MathBlock,
|
|
284968
285189
|
PassthroughInline,
|
|
@@ -286489,6 +286710,7 @@ var Node$13 = class Node$14 {
|
|
|
286489
286710
|
() => commands$1.backspaceAtomBefore(),
|
|
286490
286711
|
() => commands$1.backspaceNextToRun(),
|
|
286491
286712
|
() => commands$1.backspaceAcrossRuns(),
|
|
286713
|
+
() => commands$1.mixedBidiBackspace?.() ?? false,
|
|
286492
286714
|
() => commands$1.deleteSelection(),
|
|
286493
286715
|
() => commands$1.removeNumberingProperties(),
|
|
286494
286716
|
() => commands$1.joinBackward(),
|
|
@@ -291957,7 +292179,27 @@ menclose::after {
|
|
|
291957
292179
|
}
|
|
291958
292180
|
element3.style.textAlign = resolveTextAlign(attrs?.alignment, rtl);
|
|
291959
292181
|
return rtl;
|
|
291960
|
-
}, shouldUseSegmentPositioning = (hasExplicitPositioning, hasSegments, isRtl) => hasExplicitPositioning && hasSegments && !isRtl,
|
|
292182
|
+
}, shouldUseSegmentPositioning = (hasExplicitPositioning, hasSegments, isRtl) => hasExplicitPositioning && hasSegments && !isRtl, RTL_DATE_LIKE_TOKEN_RE, STRONG_RTL_CHAR_RE, LATIN_DIGIT_NEUTRAL_ONLY_RE, RLM = "", normalizeRtlDateTokenForWordParity = (text5) => {
|
|
292183
|
+
if (!RTL_DATE_LIKE_TOKEN_RE.test(text5))
|
|
292184
|
+
return text5;
|
|
292185
|
+
return text5.replace(/[./-]/g, (separator) => `${RLM}${separator}${RLM}`);
|
|
292186
|
+
}, resolveRunDirectionAttribute = (opts) => {
|
|
292187
|
+
if (opts.isRtlTagged) {
|
|
292188
|
+
const sample = (opts.runText ?? opts.effectiveText).trim();
|
|
292189
|
+
if (!sample)
|
|
292190
|
+
return "rtl";
|
|
292191
|
+
if (RTL_DATE_LIKE_TOKEN_RE.test(sample))
|
|
292192
|
+
return "rtl";
|
|
292193
|
+
if (STRONG_RTL_CHAR_RE.test(sample))
|
|
292194
|
+
return "rtl";
|
|
292195
|
+
if (LATIN_DIGIT_NEUTRAL_ONLY_RE.test(sample))
|
|
292196
|
+
return null;
|
|
292197
|
+
return "rtl";
|
|
292198
|
+
}
|
|
292199
|
+
if (typeof opts.runText === "string" && RTL_DATE_LIKE_TOKEN_RE.test(opts.runText))
|
|
292200
|
+
return "ltr";
|
|
292201
|
+
return null;
|
|
292202
|
+
}, MATHML_NS$19 = "http://www.w3.org/1998/Math/MathML", OPERATOR_CHARS, STY_TO_VARIANT, SCR_TO_VARIANT, convertMathRun = (node3, doc$12) => {
|
|
291961
292203
|
const text5 = extractText(node3);
|
|
291962
292204
|
if (!text5)
|
|
291963
292205
|
return null;
|
|
@@ -292747,10 +292989,6 @@ menclose::after {
|
|
|
292747
292989
|
if (runToken === "totalPageCount")
|
|
292748
292990
|
return context.totalPages ? String(context.totalPages) : run2.text ?? "";
|
|
292749
292991
|
return run2.text ?? "";
|
|
292750
|
-
}, RTL_DATE_LIKE_TOKEN_RE, RLM = "", normalizeRtlDateTokenForWordParity = (text5) => {
|
|
292751
|
-
if (!RTL_DATE_LIKE_TOKEN_RE.test(text5))
|
|
292752
|
-
return text5;
|
|
292753
|
-
return text5.replace(/[./-]/g, (separator) => `${RLM}${separator}${RLM}`);
|
|
292754
292992
|
}, createDomPainter = (options) => {
|
|
292755
292993
|
const painter = new DomPainter(options);
|
|
292756
292994
|
return {
|
|
@@ -301569,7 +301807,13 @@ menclose::after {
|
|
|
301569
301807
|
#isCompositionKeyboardEvent(event) {
|
|
301570
301808
|
return event.isComposing || event.keyCode === 229 || event.key === "Dead" || event.key === "Compose";
|
|
301571
301809
|
}
|
|
301572
|
-
}, isObject2 = (value) => typeof value === "object" && value !== null,
|
|
301810
|
+
}, isObject2 = (value) => typeof value === "object" && value !== null, shouldUseNativeCaretFallback = (selection, pos) => {
|
|
301811
|
+
if (!selection)
|
|
301812
|
+
return false;
|
|
301813
|
+
if (!selection.empty)
|
|
301814
|
+
return false;
|
|
301815
|
+
return selection.head === pos;
|
|
301816
|
+
}, INTERNAL_OBJECT_MIME_TYPE = "application/x-superdoc-internal-object", INTERNAL_MIME_TYPE = "application/x-field-annotation", FIELD_ANNOTATION_DATA_TYPE = "fieldAnnotation", IMAGE_EXTENSIONS, DragDropManager = class {
|
|
301573
301817
|
#deps = null;
|
|
301574
301818
|
#dragOverRaf = null;
|
|
301575
301819
|
#pendingDragOver = null;
|
|
@@ -304109,7 +304353,7 @@ menclose::after {
|
|
|
304109
304353
|
return;
|
|
304110
304354
|
console.log(...args$1);
|
|
304111
304355
|
}, HEADER_FOOTER_INIT_BUDGET_MS = 200, MAX_ZOOM_WARNING_THRESHOLD = 10, MAX_SELECTION_RECTS_PER_USER = 100, SEMANTIC_RESIZE_DEBOUNCE_MS = 120, MIN_SEMANTIC_CONTENT_WIDTH_PX = 1, GLOBAL_PERFORMANCE, PresentationEditor, ICONS, TEXTS, tableActionsOptions;
|
|
304112
|
-
var
|
|
304356
|
+
var init_src_DTrWuNvy_es = __esm(() => {
|
|
304113
304357
|
init_rolldown_runtime_Bg48TavK_es();
|
|
304114
304358
|
init_SuperConverter_CnwfJPj6_es();
|
|
304115
304359
|
init_jszip_C49i9kUs_es();
|
|
@@ -322675,6 +322919,14 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
322675
322919
|
})];
|
|
322676
322920
|
}
|
|
322677
322921
|
});
|
|
322922
|
+
STRONG_RTL_CHAR_RE$1 = /[\u0590-\u08FF]/;
|
|
322923
|
+
STRONG_LTR_CHAR_RE = /[A-Za-z\u00C0-\u024F]/;
|
|
322924
|
+
MixedBidiBackspace = Extension.create({
|
|
322925
|
+
name: "mixedBidiBackspace",
|
|
322926
|
+
addCommands() {
|
|
322927
|
+
return { mixedBidiBackspace };
|
|
322928
|
+
}
|
|
322929
|
+
});
|
|
322678
322930
|
PermStart = Node$13.create({
|
|
322679
322931
|
name: "permStart",
|
|
322680
322932
|
group: "inline",
|
|
@@ -330779,6 +331031,9 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
330779
331031
|
"wave",
|
|
330780
331032
|
"doubleWave"
|
|
330781
331033
|
]);
|
|
331034
|
+
RTL_DATE_LIKE_TOKEN_RE = /^-?\d+(?:[./-]\d+)+$/;
|
|
331035
|
+
STRONG_RTL_CHAR_RE = /[\u0590-\u08FF]/;
|
|
331036
|
+
LATIN_DIGIT_NEUTRAL_ONLY_RE = /^[\s0-9A-Za-z./\-_:,+()]+$/;
|
|
330782
331037
|
OPERATOR_CHARS = new Set([
|
|
330783
331038
|
"+",
|
|
330784
331039
|
"-",
|
|
@@ -333797,10 +334052,13 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
333797
334052
|
this.pendingTooltips.set(elem, linkData.tooltip);
|
|
333798
334053
|
}
|
|
333799
334054
|
applyRunStyles(elem, run2, isActiveLink);
|
|
333800
|
-
|
|
333801
|
-
|
|
333802
|
-
|
|
333803
|
-
|
|
334055
|
+
const dirAttr = resolveRunDirectionAttribute({
|
|
334056
|
+
runText: textRun.text,
|
|
334057
|
+
effectiveText,
|
|
334058
|
+
isRtlTagged: textRun.bidi?.rtl === true
|
|
334059
|
+
});
|
|
334060
|
+
if (dirAttr)
|
|
334061
|
+
elem.setAttribute("dir", dirAttr);
|
|
333804
334062
|
const commentAnnotations = textRun.comments;
|
|
333805
334063
|
if (!!commentAnnotations?.length) {
|
|
333806
334064
|
elem.dataset.commentIds = commentAnnotations.map((c) => c.commentId).join(",");
|
|
@@ -334916,7 +335174,6 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
334916
335174
|
"path(",
|
|
334917
335175
|
"rect("
|
|
334918
335176
|
];
|
|
334919
|
-
RTL_DATE_LIKE_TOKEN_RE = /^-?\d+(?:[./-]\d+)+$/;
|
|
334920
335177
|
CLIP_PATH_PREFIXES = [
|
|
334921
335178
|
"inset(",
|
|
334922
335179
|
"polygon(",
|
|
@@ -341842,7 +342099,8 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
341842
342099
|
}, pos, includeDomFallback);
|
|
341843
342100
|
}
|
|
341844
342101
|
#computeCaretLayoutRect(pos) {
|
|
341845
|
-
const
|
|
342102
|
+
const useNativeFallback = shouldUseNativeCaretFallback(this.editor?.state?.selection, pos);
|
|
342103
|
+
const geometry = this.#computeCaretLayoutRectGeometry(pos, useNativeFallback);
|
|
341846
342104
|
let dom = null;
|
|
341847
342105
|
try {
|
|
341848
342106
|
dom = this.#computeDomCaretPageLocal(pos);
|
|
@@ -342314,7 +342572,7 @@ var init_zipper_BxRAi0_5_es = __esm(() => {
|
|
|
342314
342572
|
|
|
342315
342573
|
// ../../packages/superdoc/dist/super-editor.es.js
|
|
342316
342574
|
var init_super_editor_es = __esm(() => {
|
|
342317
|
-
|
|
342575
|
+
init_src_DTrWuNvy_es();
|
|
342318
342576
|
init_SuperConverter_CnwfJPj6_es();
|
|
342319
342577
|
init_jszip_C49i9kUs_es();
|
|
342320
342578
|
init_xml_js_CqGKpaft_es();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superdoc-dev/cli",
|
|
3
|
-
"version": "0.11.0-next.
|
|
3
|
+
"version": "0.11.0-next.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"superdoc": "./dist/index.js"
|
|
@@ -25,20 +25,20 @@
|
|
|
25
25
|
"@types/ws": "^8.5.13",
|
|
26
26
|
"typescript": "^5.9.2",
|
|
27
27
|
"@superdoc/document-api": "0.0.1",
|
|
28
|
+
"@superdoc/pm-adapter": "0.0.0",
|
|
28
29
|
"superdoc": "1.33.1",
|
|
29
|
-
"@superdoc/super-editor": "0.0.1"
|
|
30
|
-
"@superdoc/pm-adapter": "0.0.0"
|
|
30
|
+
"@superdoc/super-editor": "0.0.1"
|
|
31
31
|
},
|
|
32
32
|
"module": "src/index.ts",
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
36
|
"optionalDependencies": {
|
|
37
|
-
"@superdoc-dev/cli-darwin-arm64": "0.11.0-next.
|
|
38
|
-
"@superdoc-dev/cli-darwin-x64": "0.11.0-next.
|
|
39
|
-
"@superdoc-dev/cli-linux-
|
|
40
|
-
"@superdoc-dev/cli-
|
|
41
|
-
"@superdoc-dev/cli-
|
|
37
|
+
"@superdoc-dev/cli-darwin-arm64": "0.11.0-next.2",
|
|
38
|
+
"@superdoc-dev/cli-darwin-x64": "0.11.0-next.2",
|
|
39
|
+
"@superdoc-dev/cli-linux-arm64": "0.11.0-next.2",
|
|
40
|
+
"@superdoc-dev/cli-windows-x64": "0.11.0-next.2",
|
|
41
|
+
"@superdoc-dev/cli-linux-x64": "0.11.0-next.2"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"predev": "node scripts/ensure-superdoc-build.js",
|