@superdoc-dev/cli 0.2.0-next.117 → 0.2.0-next.119
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 +227 -33
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -134408,7 +134408,7 @@ var init_remark_gfm_CjV8kaUy_es = __esm(() => {
|
|
|
134408
134408
|
init_remark_gfm_z_sDF4ss_es();
|
|
134409
134409
|
});
|
|
134410
134410
|
|
|
134411
|
-
// ../../packages/superdoc/dist/chunks/src-
|
|
134411
|
+
// ../../packages/superdoc/dist/chunks/src-Crr00svT.es.js
|
|
134412
134412
|
function deleteProps(obj, propOrProps) {
|
|
134413
134413
|
const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
|
|
134414
134414
|
const removeNested = (target, pathParts, index2 = 0) => {
|
|
@@ -170961,6 +170961,97 @@ async function measureTableBlock(block, constraints) {
|
|
|
170961
170961
|
const columnWidth = Math.max(1, Math.floor(effectiveTargetWidth / maxCellCount));
|
|
170962
170962
|
columnWidths = Array.from({ length: maxCellCount }, () => columnWidth);
|
|
170963
170963
|
}
|
|
170964
|
+
const isFixedLayout = block.attrs?.tableLayout === "fixed";
|
|
170965
|
+
const gridLooksLikePlaceholder = columnWidths.reduce((a2, b$1) => a2 + b$1, 0) < maxWidth * 0.1;
|
|
170966
|
+
if (!isFixedLayout && gridLooksLikePlaceholder) {
|
|
170967
|
+
const gridColCount = columnWidths.length;
|
|
170968
|
+
const maxContentWidths = new Array(gridColCount).fill(0);
|
|
170969
|
+
const autoFitRowspanTracker = new Array(gridColCount).fill(0);
|
|
170970
|
+
for (const row2 of block.rows) {
|
|
170971
|
+
let colIndex = 0;
|
|
170972
|
+
for (const cell2 of row2.cells) {
|
|
170973
|
+
const colspan = cell2.colSpan ?? 1;
|
|
170974
|
+
const rowspan = cell2.rowSpan ?? 1;
|
|
170975
|
+
while (colIndex < gridColCount && autoFitRowspanTracker[colIndex] > 0) {
|
|
170976
|
+
autoFitRowspanTracker[colIndex]--;
|
|
170977
|
+
colIndex++;
|
|
170978
|
+
}
|
|
170979
|
+
if (colIndex >= gridColCount)
|
|
170980
|
+
break;
|
|
170981
|
+
if (colspan === 1) {
|
|
170982
|
+
const cellPadding = cell2.attrs?.padding ?? DEFAULT_CELL_PADDING$1;
|
|
170983
|
+
const paddingH = (cellPadding.left ?? 4) + (cellPadding.right ?? 4);
|
|
170984
|
+
const cellBlocks = cell2.blocks ?? (cell2.paragraph ? [cell2.paragraph] : []);
|
|
170985
|
+
let cellMaxWidth = 0;
|
|
170986
|
+
for (const cellBlock of cellBlocks) {
|
|
170987
|
+
const maxMeasure = await measureBlock(cellBlock, {
|
|
170988
|
+
maxWidth: 99999,
|
|
170989
|
+
maxHeight: Infinity
|
|
170990
|
+
});
|
|
170991
|
+
let blockMaxWidth = 0;
|
|
170992
|
+
if (maxMeasure.kind === "paragraph") {
|
|
170993
|
+
for (const line of maxMeasure.lines)
|
|
170994
|
+
if (line.width > blockMaxWidth)
|
|
170995
|
+
blockMaxWidth = line.width;
|
|
170996
|
+
} else if (maxMeasure.kind === "image" || maxMeasure.kind === "drawing")
|
|
170997
|
+
blockMaxWidth = maxMeasure.width;
|
|
170998
|
+
else if (maxMeasure.kind === "table")
|
|
170999
|
+
blockMaxWidth = maxMeasure.totalWidth;
|
|
171000
|
+
else if (maxMeasure.kind === "list") {
|
|
171001
|
+
for (const item of maxMeasure.items)
|
|
171002
|
+
if (item.paragraph) {
|
|
171003
|
+
const gutterWidth = (item.indentLeft ?? 0) + (item.markerWidth ?? 0);
|
|
171004
|
+
for (const line of item.paragraph.lines) {
|
|
171005
|
+
const lineTotal = gutterWidth + line.width;
|
|
171006
|
+
if (lineTotal > blockMaxWidth)
|
|
171007
|
+
blockMaxWidth = lineTotal;
|
|
171008
|
+
}
|
|
171009
|
+
}
|
|
171010
|
+
}
|
|
171011
|
+
if (blockMaxWidth > cellMaxWidth)
|
|
171012
|
+
cellMaxWidth = blockMaxWidth;
|
|
171013
|
+
}
|
|
171014
|
+
const totalWidth$1 = cellMaxWidth + paddingH;
|
|
171015
|
+
if (totalWidth$1 > maxContentWidths[colIndex])
|
|
171016
|
+
maxContentWidths[colIndex] = totalWidth$1;
|
|
171017
|
+
}
|
|
171018
|
+
if (rowspan > 1)
|
|
171019
|
+
for (let c = 0;c < colspan && colIndex + c < gridColCount; c++)
|
|
171020
|
+
autoFitRowspanTracker[colIndex + c] = rowspan - 1;
|
|
171021
|
+
colIndex += colspan;
|
|
171022
|
+
}
|
|
171023
|
+
for (let col = colIndex;col < gridColCount; col++)
|
|
171024
|
+
if (autoFitRowspanTracker[col] > 0)
|
|
171025
|
+
autoFitRowspanTracker[col]--;
|
|
171026
|
+
}
|
|
171027
|
+
const contentTotal = maxContentWidths.reduce((a2, b$1) => a2 + b$1, 0);
|
|
171028
|
+
if (contentTotal > 0)
|
|
171029
|
+
if (contentTotal <= maxWidth) {
|
|
171030
|
+
for (let i$1 = 0;i$1 < gridColCount; i$1++)
|
|
171031
|
+
if (maxContentWidths[i$1] > columnWidths[i$1])
|
|
171032
|
+
columnWidths[i$1] = maxContentWidths[i$1];
|
|
171033
|
+
const expandedTotal = columnWidths.reduce((a2, b$1) => a2 + b$1, 0);
|
|
171034
|
+
if (expandedTotal > maxWidth && gridColCount > 0) {
|
|
171035
|
+
const scale = maxWidth / expandedTotal;
|
|
171036
|
+
for (let i$1 = 0;i$1 < gridColCount; i$1++)
|
|
171037
|
+
columnWidths[i$1] = Math.max(1, Math.round(columnWidths[i$1] * scale));
|
|
171038
|
+
const scaledSum = columnWidths.reduce((a2, b$1) => a2 + b$1, 0);
|
|
171039
|
+
if (scaledSum !== maxWidth) {
|
|
171040
|
+
const diff = maxWidth - scaledSum;
|
|
171041
|
+
columnWidths[gridColCount - 1] = Math.max(1, columnWidths[gridColCount - 1] + diff);
|
|
171042
|
+
}
|
|
171043
|
+
}
|
|
171044
|
+
} else {
|
|
171045
|
+
const scale = maxWidth / contentTotal;
|
|
171046
|
+
for (let i$1 = 0;i$1 < gridColCount; i$1++)
|
|
171047
|
+
columnWidths[i$1] = Math.max(1, Math.round(maxContentWidths[i$1] * scale));
|
|
171048
|
+
const scaledSum = columnWidths.reduce((a2, b$1) => a2 + b$1, 0);
|
|
171049
|
+
if (scaledSum !== maxWidth && gridColCount > 0) {
|
|
171050
|
+
const diff = maxWidth - scaledSum;
|
|
171051
|
+
columnWidths[gridColCount - 1] = Math.max(1, columnWidths[gridColCount - 1] + diff);
|
|
171052
|
+
}
|
|
171053
|
+
}
|
|
171054
|
+
}
|
|
170964
171055
|
const gridColumnCount = columnWidths.length;
|
|
170965
171056
|
const calculateCellWidth = (startCol, colspan) => {
|
|
170966
171057
|
let width = 0;
|
|
@@ -170989,12 +171080,7 @@ async function measureTableBlock(block, constraints) {
|
|
|
170989
171080
|
if (rowspan > 1)
|
|
170990
171081
|
for (let c = 0;c < colspan && gridColIndex + c < gridColumnCount; c++)
|
|
170991
171082
|
rowspanTracker[gridColIndex + c] = rowspan - 1;
|
|
170992
|
-
const cellPadding = cell2.attrs?.padding ??
|
|
170993
|
-
top: 0,
|
|
170994
|
-
left: 4,
|
|
170995
|
-
right: 4,
|
|
170996
|
-
bottom: 0
|
|
170997
|
-
};
|
|
171083
|
+
const cellPadding = cell2.attrs?.padding ?? DEFAULT_CELL_PADDING$1;
|
|
170998
171084
|
const paddingTop = cellPadding.top ?? 0;
|
|
170999
171085
|
const paddingBottom = cellPadding.bottom ?? 0;
|
|
171000
171086
|
const paddingLeft = cellPadding.left ?? 4;
|
|
@@ -196966,7 +197052,7 @@ var Node$13 = class Node$14 {
|
|
|
196966
197052
|
day: "2-digit",
|
|
196967
197053
|
year: "numeric"
|
|
196968
197054
|
});
|
|
196969
|
-
}, AnnotatorHelpers, PARTS_MAP_KEY = "parts", META_MAP_KEY = "meta", META_PARTS_SCHEMA_VERSION_KEY = "partsSchemaVersion", META_PARTS_MIGRATION_KEY = "partsMigration", META_PARTS_LAST_HYDRATED_AT_KEY = "partsLastHydratedAt", META_PARTS_FALLBACK_MODE_KEY = "partsFallbackMode", META_PARTS_CAPABILITY_KEY = "partsCapability", SOURCE_COLLAB_REMOTE_PARTS = "collab:remote:parts", SOURCE_COLLAB_REMOTE_PREFIX = "collab:remote:", EXCLUDED_PART_IDS, CRITICAL_PART_IDS, SOURCE_HEADER_FOOTER_LOCAL = "header-footer-sync:local", HEADER_PATTERN, FOOTER_PATTERN, DEFAULT_HDR_FTR_ATTRS, HEADER_REL_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", FOOTER_REL_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", isApplyingRemoteParts = false, headlessBindingStateByEditor, headlessCleanupRegisteredEditors, collaborationCleanupByEditor, registerHeadlessBindingCleanup = (editor, cleanup) => {
|
|
197055
|
+
}, AnnotatorHelpers, PARTS_MAP_KEY = "parts", META_MAP_KEY = "meta", META_PARTS_SCHEMA_VERSION_KEY = "partsSchemaVersion", META_PARTS_MIGRATION_KEY = "partsMigration", META_PARTS_LAST_HYDRATED_AT_KEY = "partsLastHydratedAt", META_PARTS_FALLBACK_MODE_KEY = "partsFallbackMode", META_PARTS_CAPABILITY_KEY = "partsCapability", SOURCE_COLLAB_REMOTE_PARTS = "collab:remote:parts", SOURCE_COLLAB_REMOTE_PREFIX = "collab:remote:", EXCLUDED_PART_IDS, CRITICAL_PART_IDS, SOURCE_HEADER_FOOTER_LOCAL = "header-footer-sync:local", HEADER_PATTERN, FOOTER_PATTERN, DEFAULT_HDR_FTR_ATTRS, HEADER_REL_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", FOOTER_REL_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", isApplyingRemoteParts = false, headlessBindingStateByEditor, headlessCleanupRegisteredEditors, META_BODY_SECT_PR_KEY = "bodySectPr", BODY_SECT_PR_SYNC_META_KEY = "bodySectPrSync", collaborationCleanupByEditor, registerHeadlessBindingCleanup = (editor, cleanup) => {
|
|
196970
197056
|
if (!cleanup || headlessCleanupRegisteredEditors.has(editor))
|
|
196971
197057
|
return;
|
|
196972
197058
|
headlessCleanupRegisteredEditors.add(editor);
|
|
@@ -196974,6 +197060,81 @@ var Node$13 = class Node$14 {
|
|
|
196974
197060
|
cleanup();
|
|
196975
197061
|
headlessCleanupRegisteredEditors.delete(editor);
|
|
196976
197062
|
});
|
|
197063
|
+
}, cloneJsonValue = (value) => {
|
|
197064
|
+
if (value == null)
|
|
197065
|
+
return null;
|
|
197066
|
+
return JSON.parse(JSON.stringify(value));
|
|
197067
|
+
}, serializeComparableValue = (value) => JSON.stringify(value ?? null), getEditorBodySectPr = (editor) => editor?.state?.doc?.attrs?.bodySectPr ?? null, setEditorConverterBodySectPr = (editor, bodySectPr) => {
|
|
197068
|
+
if (!editor?.converter)
|
|
197069
|
+
return;
|
|
197070
|
+
editor.converter.bodySectPr = cloneJsonValue(bodySectPr);
|
|
197071
|
+
}, syncBodySectPrToMetaMap = (ydoc, editor) => {
|
|
197072
|
+
const metaMap = ydoc.getMap("meta");
|
|
197073
|
+
const nextBodySectPr = cloneJsonValue(getEditorBodySectPr(editor));
|
|
197074
|
+
const currentMetaBodySectPr = cloneJsonValue(metaMap.get(META_BODY_SECT_PR_KEY) ?? null);
|
|
197075
|
+
setEditorConverterBodySectPr(editor, nextBodySectPr);
|
|
197076
|
+
if (serializeComparableValue(nextBodySectPr) === serializeComparableValue(currentMetaBodySectPr))
|
|
197077
|
+
return false;
|
|
197078
|
+
metaMap.set(META_BODY_SECT_PR_KEY, nextBodySectPr);
|
|
197079
|
+
return true;
|
|
197080
|
+
}, applyBodySectPrFromMetaMap = (editor, ydoc) => {
|
|
197081
|
+
const nextBodySectPr = cloneJsonValue(ydoc.getMap("meta").get(META_BODY_SECT_PR_KEY) ?? null);
|
|
197082
|
+
const currentBodySectPr = cloneJsonValue(getEditorBodySectPr(editor));
|
|
197083
|
+
setEditorConverterBodySectPr(editor, nextBodySectPr);
|
|
197084
|
+
if (serializeComparableValue(nextBodySectPr) === serializeComparableValue(currentBodySectPr))
|
|
197085
|
+
return false;
|
|
197086
|
+
if (!editor?.state?.tr)
|
|
197087
|
+
return false;
|
|
197088
|
+
const nextDocAttrs = {
|
|
197089
|
+
...editor.state.doc?.attrs ?? {},
|
|
197090
|
+
bodySectPr: nextBodySectPr
|
|
197091
|
+
};
|
|
197092
|
+
const tr = editor.state.tr.setNodeMarkup(0, undefined, nextDocAttrs).setMeta("addToHistory", false).setMeta(BODY_SECT_PR_SYNC_META_KEY, true);
|
|
197093
|
+
if (typeof editor.dispatch === "function") {
|
|
197094
|
+
editor.dispatch(tr);
|
|
197095
|
+
return true;
|
|
197096
|
+
}
|
|
197097
|
+
if (typeof editor.view?.dispatch === "function") {
|
|
197098
|
+
editor.view.dispatch(tr);
|
|
197099
|
+
return true;
|
|
197100
|
+
}
|
|
197101
|
+
return false;
|
|
197102
|
+
}, registerBodySectPrSync = (editor, ydoc, provider, cleanupState) => {
|
|
197103
|
+
const metaMap = ydoc.getMap("meta");
|
|
197104
|
+
const metaMapObserver = (event) => {
|
|
197105
|
+
if (!event?.changes?.keys?.has?.(META_BODY_SECT_PR_KEY))
|
|
197106
|
+
return;
|
|
197107
|
+
applyBodySectPrFromMetaMap(editor, ydoc);
|
|
197108
|
+
};
|
|
197109
|
+
metaMap.observe(metaMapObserver);
|
|
197110
|
+
cleanupState.metaMap = metaMap;
|
|
197111
|
+
cleanupState.metaMapObserver = metaMapObserver;
|
|
197112
|
+
const applyInitialBodySectPr = () => {
|
|
197113
|
+
if (editor.isDestroyed)
|
|
197114
|
+
return;
|
|
197115
|
+
applyBodySectPrFromMetaMap(editor, ydoc);
|
|
197116
|
+
};
|
|
197117
|
+
if (!provider)
|
|
197118
|
+
applyInitialBodySectPr();
|
|
197119
|
+
else
|
|
197120
|
+
cleanupState.bodySectPrPendingCleanup = onCollaborationProviderSynced(provider, applyInitialBodySectPr);
|
|
197121
|
+
if (typeof editor.on === "function" && !editor.options?.isHeadless) {
|
|
197122
|
+
const bodySectPrTransactionHandler = ({ transaction }) => {
|
|
197123
|
+
if (!transaction || transaction.getMeta?.(BODY_SECT_PR_SYNC_META_KEY))
|
|
197124
|
+
return;
|
|
197125
|
+
if (Boolean(transaction.getMeta?.(ySyncPluginKey)?.isChangeOrigin)) {
|
|
197126
|
+
applyBodySectPrFromMetaMap(editor, ydoc);
|
|
197127
|
+
return;
|
|
197128
|
+
}
|
|
197129
|
+
const previousBodySectPr = cloneJsonValue(transaction.before?.attrs?.bodySectPr ?? null);
|
|
197130
|
+
const nextBodySectPr = cloneJsonValue(getEditorBodySectPr(editor));
|
|
197131
|
+
if (serializeComparableValue(previousBodySectPr) === serializeComparableValue(nextBodySectPr))
|
|
197132
|
+
return;
|
|
197133
|
+
syncBodySectPrToMetaMap(ydoc, editor);
|
|
197134
|
+
};
|
|
197135
|
+
editor.on("transaction", bodySectPrTransactionHandler);
|
|
197136
|
+
cleanupState.bodySectPrTransactionHandler = bodySectPrTransactionHandler;
|
|
197137
|
+
}
|
|
196977
197138
|
}, Collaboration, createSyncPlugin = (ydoc, editor) => {
|
|
196978
197139
|
const fragment2 = ydoc.getXmlFragment("supereditor");
|
|
196979
197140
|
const onFirstRender = () => {
|
|
@@ -196988,6 +197149,7 @@ var Node$13 = class Node$14 {
|
|
|
196988
197149
|
Object.entries(editor.options.mediaFiles).forEach(([key$1, value]) => {
|
|
196989
197150
|
mediaMap.set(key$1, value);
|
|
196990
197151
|
});
|
|
197152
|
+
syncBodySectPrToMetaMap(ydoc, editor);
|
|
196991
197153
|
const metaMap = ydoc.getMap("meta");
|
|
196992
197154
|
metaMap.set("fonts", editor.options.fonts);
|
|
196993
197155
|
metaMap.set("bootstrap", {
|
|
@@ -197067,30 +197229,36 @@ var Node$13 = class Node$14 {
|
|
|
197067
197229
|
const transactionHandler = ({ transaction }) => {
|
|
197068
197230
|
if (!editor.options.ydoc)
|
|
197069
197231
|
return;
|
|
197070
|
-
if (transaction.getMeta(ySyncPluginKey)?.isChangeOrigin)
|
|
197071
|
-
|
|
197072
|
-
const binding = ensureInitializedBinding();
|
|
197073
|
-
if (!binding)
|
|
197232
|
+
if (transaction.getMeta(ySyncPluginKey)?.isChangeOrigin) {
|
|
197233
|
+
applyBodySectPrFromMetaMap(editor, editor.options.ydoc);
|
|
197074
197234
|
return;
|
|
197075
|
-
|
|
197076
|
-
|
|
197077
|
-
const addToHistory = transaction.getMeta("addToHistory") !== false;
|
|
197078
|
-
if (!addToHistory)
|
|
197079
|
-
yUndoPluginKey.getState(editor.state)?.undoManager?.stopCapturing?.();
|
|
197080
|
-
const syncToYjs = () => {
|
|
197081
|
-
const ydoc = editor.options.ydoc;
|
|
197082
|
-
if (!ydoc)
|
|
197083
|
-
return;
|
|
197084
|
-
ydoc.transact((tr) => {
|
|
197085
|
-
tr?.meta?.set?.("addToHistory", addToHistory);
|
|
197086
|
-
binding._prosemirrorChanged(editor.state.doc);
|
|
197087
|
-
}, ySyncPluginKey);
|
|
197088
|
-
};
|
|
197089
|
-
if (typeof binding.mux === "function") {
|
|
197090
|
-
binding.mux(syncToYjs);
|
|
197235
|
+
}
|
|
197236
|
+
if (transaction.getMeta?.(BODY_SECT_PR_SYNC_META_KEY))
|
|
197091
197237
|
return;
|
|
197238
|
+
const previousBodySectPr = cloneJsonValue(transaction.before?.attrs?.bodySectPr ?? null);
|
|
197239
|
+
const nextBodySectPr = cloneJsonValue(getEditorBodySectPr(editor));
|
|
197240
|
+
const bodySectPrChanged = serializeComparableValue(previousBodySectPr) !== serializeComparableValue(nextBodySectPr);
|
|
197241
|
+
const binding = ensureInitializedBinding();
|
|
197242
|
+
if (binding && typeof binding._prosemirrorChanged === "function") {
|
|
197243
|
+
const addToHistory = transaction.getMeta("addToHistory") !== false;
|
|
197244
|
+
if (!addToHistory)
|
|
197245
|
+
yUndoPluginKey.getState(editor.state)?.undoManager?.stopCapturing?.();
|
|
197246
|
+
const syncToYjs = () => {
|
|
197247
|
+
const ydoc = editor.options.ydoc;
|
|
197248
|
+
if (!ydoc)
|
|
197249
|
+
return;
|
|
197250
|
+
ydoc.transact((tr) => {
|
|
197251
|
+
tr?.meta?.set?.("addToHistory", addToHistory);
|
|
197252
|
+
binding._prosemirrorChanged(editor.state.doc);
|
|
197253
|
+
}, ySyncPluginKey);
|
|
197254
|
+
};
|
|
197255
|
+
if (typeof binding.mux === "function")
|
|
197256
|
+
binding.mux(syncToYjs);
|
|
197257
|
+
else
|
|
197258
|
+
syncToYjs();
|
|
197092
197259
|
}
|
|
197093
|
-
|
|
197260
|
+
if (bodySectPrChanged)
|
|
197261
|
+
syncBodySectPrToMetaMap(editor.options.ydoc, editor);
|
|
197094
197262
|
};
|
|
197095
197263
|
editor.on("transaction", transactionHandler);
|
|
197096
197264
|
ensureInitializedBinding();
|
|
@@ -200628,7 +200796,7 @@ var Node$13 = class Node$14 {
|
|
|
200628
200796
|
nativeSelectionStylesInjected = true;
|
|
200629
200797
|
}, gradientIdCounter = 0, EMUS_PER_INCH = 914400, maxSize = 5000, cache$1, makeKey = (text5, font, letterSpacing) => {
|
|
200630
200798
|
return `${text5}|${font}|${letterSpacing || 0}`;
|
|
200631
|
-
}, fontMetricsCache, MAX_CACHE_SIZE$1 = 1000, METRICS_TEST_STRING = "MHgypbdlÁÉÍ", computeTabStops, measurementConfig, canvasContext = null, DEFAULT_TAB_INTERVAL_TWIPS$2 = 720, TWIPS_PER_PX$1, twipsToPx$2 = (twips) => twips / TWIPS_PER_PX$1, pxToTwips$1 = (px) => Math.round(px * TWIPS_PER_PX$1), DEFAULT_TAB_INTERVAL_PX$1, TAB_EPSILON$1 = 0.1, DEFAULT_DECIMAL_SEPARATOR$1 = ".", ALLOWED_TAB_VALS, FIELD_ANNOTATION_PILL_PADDING = 8, FIELD_ANNOTATION_LINE_HEIGHT_MULTIPLIER = 1.2, FIELD_ANNOTATION_VERTICAL_PADDING = 6, DEFAULT_FIELD_ANNOTATION_FONT_SIZE = 16, DEFAULT_PARAGRAPH_FONT_SIZE = 12, DEFAULT_PARAGRAPH_FONT_FAMILY = "Arial", isValidFontSize = (value) => typeof value === "number" && Number.isFinite(value) && value > 0, normalizeFontSize$1 = (value, fallback = DEFAULT_PARAGRAPH_FONT_SIZE) => {
|
|
200799
|
+
}, fontMetricsCache, MAX_CACHE_SIZE$1 = 1000, METRICS_TEST_STRING = "MHgypbdlÁÉÍ", computeTabStops, measurementConfig, canvasContext = null, DEFAULT_TAB_INTERVAL_TWIPS$2 = 720, TWIPS_PER_PX$1, twipsToPx$2 = (twips) => twips / TWIPS_PER_PX$1, pxToTwips$1 = (px) => Math.round(px * TWIPS_PER_PX$1), DEFAULT_TAB_INTERVAL_PX$1, TAB_EPSILON$1 = 0.1, DEFAULT_CELL_PADDING$1, DEFAULT_DECIMAL_SEPARATOR$1 = ".", ALLOWED_TAB_VALS, FIELD_ANNOTATION_PILL_PADDING = 8, FIELD_ANNOTATION_LINE_HEIGHT_MULTIPLIER = 1.2, FIELD_ANNOTATION_VERTICAL_PADDING = 6, DEFAULT_FIELD_ANNOTATION_FONT_SIZE = 16, DEFAULT_PARAGRAPH_FONT_SIZE = 12, DEFAULT_PARAGRAPH_FONT_FAMILY = "Arial", isValidFontSize = (value) => typeof value === "number" && Number.isFinite(value) && value > 0, normalizeFontSize$1 = (value, fallback = DEFAULT_PARAGRAPH_FONT_SIZE) => {
|
|
200632
200800
|
if (isValidFontSize(value))
|
|
200633
200801
|
return value;
|
|
200634
200802
|
if (typeof value === "string") {
|
|
@@ -216354,7 +216522,7 @@ var Node$13 = class Node$14 {
|
|
|
216354
216522
|
return false;
|
|
216355
216523
|
return Boolean(checker(attrs));
|
|
216356
216524
|
}, SuperToolbar, ICONS, TEXTS, tableActionsOptions;
|
|
216357
|
-
var
|
|
216525
|
+
var init_src_Crr00svT_es = __esm(() => {
|
|
216358
216526
|
init_rolldown_runtime_B2q5OVn9_es();
|
|
216359
216527
|
init_SuperConverter_BBGfKYpx_es();
|
|
216360
216528
|
init_jszip_ChlR43oI_es();
|
|
@@ -224051,10 +224219,15 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
224051
224219
|
const cleanupState = {
|
|
224052
224220
|
mediaMap,
|
|
224053
224221
|
mediaMapObserver,
|
|
224222
|
+
metaMap: null,
|
|
224223
|
+
metaMapObserver: null,
|
|
224054
224224
|
partSyncHandle: null,
|
|
224055
|
-
partSyncPendingCleanup: null
|
|
224225
|
+
partSyncPendingCleanup: null,
|
|
224226
|
+
bodySectPrPendingCleanup: null,
|
|
224227
|
+
bodySectPrTransactionHandler: null
|
|
224056
224228
|
};
|
|
224057
224229
|
collaborationCleanupByEditor.set(this.editor, cleanupState);
|
|
224230
|
+
registerBodySectPrSync(this.editor, this.options.ydoc, this.editor.options.collaborationProvider, cleanupState);
|
|
224058
224231
|
if (typeof this.editor.on === "function") {
|
|
224059
224232
|
const editor = this.editor;
|
|
224060
224233
|
const ydoc = this.options.ydoc;
|
|
@@ -224086,8 +224259,12 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
224086
224259
|
if (!cleanup)
|
|
224087
224260
|
return;
|
|
224088
224261
|
cleanup.mediaMap.unobserve(cleanup.mediaMapObserver);
|
|
224262
|
+
cleanup.metaMap?.unobserve?.(cleanup.metaMapObserver);
|
|
224089
224263
|
cleanup.partSyncHandle?.destroy();
|
|
224090
224264
|
cleanup.partSyncPendingCleanup?.();
|
|
224265
|
+
cleanup.bodySectPrPendingCleanup?.();
|
|
224266
|
+
if (cleanup.bodySectPrTransactionHandler && typeof this.editor.off === "function")
|
|
224267
|
+
this.editor.off("transaction", cleanup.bodySectPrTransactionHandler);
|
|
224091
224268
|
collaborationCleanupByEditor.delete(this.editor);
|
|
224092
224269
|
},
|
|
224093
224270
|
addCommands() {
|
|
@@ -226047,8 +226224,19 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
226047
226224
|
return;
|
|
226048
226225
|
this.options.isNewFile = false;
|
|
226049
226226
|
const doc$2 = this.#generatePmData();
|
|
226227
|
+
const nextBodySectPr = JSON.parse(JSON.stringify(doc$2.attrs?.bodySectPr ?? null));
|
|
226050
226228
|
const tr = this.state.tr.replaceWith(0, this.state.doc.content.size, doc$2).setMeta("addToHistory", false);
|
|
226051
226229
|
this.#dispatchTransaction(tr);
|
|
226230
|
+
const ydoc = this.options.ydoc;
|
|
226231
|
+
if (ydoc)
|
|
226232
|
+
ydoc.getMap("meta").set("bodySectPr", nextBodySectPr);
|
|
226233
|
+
if (Object.keys(doc$2.attrs).length > 0) {
|
|
226234
|
+
const attrsTr = this.state.tr.setNodeMarkup(0, undefined, {
|
|
226235
|
+
...this.state.doc.attrs ?? {},
|
|
226236
|
+
...doc$2.attrs ?? {}
|
|
226237
|
+
}).setMeta("addToHistory", false);
|
|
226238
|
+
this.#dispatchTransaction(attrsTr);
|
|
226239
|
+
}
|
|
226052
226240
|
setTimeout(() => {
|
|
226053
226241
|
this.#initComments();
|
|
226054
226242
|
}, 50);
|
|
@@ -230616,6 +230804,12 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
230616
230804
|
};
|
|
230617
230805
|
TWIPS_PER_PX$1 = 1440 / 96;
|
|
230618
230806
|
DEFAULT_TAB_INTERVAL_PX$1 = twipsToPx$2(DEFAULT_TAB_INTERVAL_TWIPS$2);
|
|
230807
|
+
DEFAULT_CELL_PADDING$1 = {
|
|
230808
|
+
top: 0,
|
|
230809
|
+
left: 4,
|
|
230810
|
+
right: 4,
|
|
230811
|
+
bottom: 0
|
|
230812
|
+
};
|
|
230619
230813
|
ALLOWED_TAB_VALS = new Set([
|
|
230620
230814
|
"start",
|
|
230621
230815
|
"center",
|
|
@@ -249914,7 +250108,7 @@ var init_zipper_DqXT7uTa_es = __esm(() => {
|
|
|
249914
250108
|
|
|
249915
250109
|
// ../../packages/superdoc/dist/super-editor.es.js
|
|
249916
250110
|
var init_super_editor_es = __esm(() => {
|
|
249917
|
-
|
|
250111
|
+
init_src_Crr00svT_es();
|
|
249918
250112
|
init_SuperConverter_BBGfKYpx_es();
|
|
249919
250113
|
init_jszip_ChlR43oI_es();
|
|
249920
250114
|
init_xml_js_DLE8mr0n_es();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superdoc-dev/cli",
|
|
3
|
-
"version": "0.2.0-next.
|
|
3
|
+
"version": "0.2.0-next.119",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"superdoc": "./dist/index.js"
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"@types/node": "22.19.2",
|
|
22
22
|
"typescript": "^5.9.2",
|
|
23
23
|
"@superdoc/document-api": "0.0.1",
|
|
24
|
-
"@superdoc/pm-adapter": "0.0.0",
|
|
25
24
|
"@superdoc/super-editor": "0.0.1",
|
|
25
|
+
"@superdoc/pm-adapter": "0.0.0",
|
|
26
26
|
"superdoc": "1.18.0"
|
|
27
27
|
},
|
|
28
28
|
"module": "src/index.ts",
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"access": "public"
|
|
31
31
|
},
|
|
32
32
|
"optionalDependencies": {
|
|
33
|
-
"@superdoc-dev/cli-darwin-arm64": "0.2.0-next.
|
|
34
|
-
"@superdoc-dev/cli-
|
|
35
|
-
"@superdoc-dev/cli-
|
|
36
|
-
"@superdoc-dev/cli-windows-x64": "0.2.0-next.
|
|
37
|
-
"@superdoc-dev/cli-linux-arm64": "0.2.0-next.
|
|
33
|
+
"@superdoc-dev/cli-darwin-arm64": "0.2.0-next.119",
|
|
34
|
+
"@superdoc-dev/cli-darwin-x64": "0.2.0-next.119",
|
|
35
|
+
"@superdoc-dev/cli-linux-x64": "0.2.0-next.119",
|
|
36
|
+
"@superdoc-dev/cli-windows-x64": "0.2.0-next.119",
|
|
37
|
+
"@superdoc-dev/cli-linux-arm64": "0.2.0-next.119"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
40
|
"dev": "bun run src/index.ts",
|