@a3s-lab/office 0.38.1 → 0.40.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/README.md +18 -4
- package/dist/{0~7240.js → 0~2330.js} +897 -641
- package/dist/0~5024.js +240 -240
- package/dist/0~7828.js +51 -29
- package/dist/0~document-editor.js +1 -0
- package/dist/0~presentation-editor.js +264 -118
- package/dist/0~work-docx-export.js +1023 -922
- package/dist/0~work-docx-import.js +13 -4
- package/dist/0~work-office-diagnostics.js +96 -94
- package/dist/0~work-pptx-import.js +1 -1
- package/dist/0~work-presentation-transition.js +38 -0
- package/dist/4121.js +42 -9
- package/dist/4174.js +497 -233
- package/dist/4560.js +124 -9
- package/dist/internal/features/work/editors/presentation-animation-panel.d.ts +9 -7
- package/dist/internal/features/work/editors/presentation-command-types.d.ts +10 -10
- package/dist/internal/features/work/editors/presentation-slide-canvas.d.ts +6 -4
- package/dist/internal/features/work/editors/use-presentation-animation-commands.d.ts +7 -7
- package/dist/internal/features/work/work-document-format-change-tracking.d.ts +1 -1
- package/dist/internal/features/work/work-document-numbering-change-tracking.d.ts +7 -0
- package/dist/internal/features/work/work-document-numbering-changes.d.ts +29 -0
- package/dist/internal/features/work/work-docx-import.d.ts +7 -5
- package/dist/internal/features/work/work-docx-list-export.d.ts +1 -0
- package/dist/internal/features/work/work-docx-numbering-change-export.d.ts +13 -0
- package/dist/internal/features/work/work-docx-numbering-change-import.d.ts +17 -0
- package/dist/internal/features/work/work-presentation-animation.d.ts +6 -2
- package/dist/internal/features/work/work-presentation-clipboard.d.ts +0 -5
- package/dist/internal/features/work/work-types.d.ts +8 -4
- package/dist/office-kernel.wasm +0 -0
- package/dist/styles.css +162 -26
- package/package.json +8 -5
- package/dist/0~5809.js +0 -123
package/dist/4174.js
CHANGED
|
@@ -13,11 +13,11 @@ import { DOMParser as model_DOMParser, Fragment, Slice } from "@tiptap/pm/model"
|
|
|
13
13
|
import { closeHistory, isHistoryTransaction } from "@tiptap/pm/history";
|
|
14
14
|
import extension_underline from "@tiptap/extension-underline";
|
|
15
15
|
import extension_strike from "@tiptap/extension-strike";
|
|
16
|
+
import { BulletList, OrderedList } from "@tiptap/extension-list";
|
|
16
17
|
import extension_subscript from "@tiptap/extension-subscript";
|
|
17
18
|
import extension_superscript from "@tiptap/extension-superscript";
|
|
18
19
|
import { Decoration, DecorationSet } from "@tiptap/pm/view";
|
|
19
20
|
import extension_image from "@tiptap/extension-image";
|
|
20
|
-
import { BulletList, OrderedList } from "@tiptap/extension-list";
|
|
21
21
|
import { CellSelection, TableMap, isInTable, selectedRect } from "@tiptap/pm/tables";
|
|
22
22
|
import font_family from "@tiptap/extension-text-style/font-family";
|
|
23
23
|
import { TextStyle } from "@tiptap/extension-text-style";
|
|
@@ -8997,6 +8997,390 @@ function compactAttributes(value) {
|
|
|
8997
8997
|
function work_document_format_changes_isRecord(value) {
|
|
8998
8998
|
return 'object' == typeof value && null !== value && !Array.isArray(value);
|
|
8999
8999
|
}
|
|
9000
|
+
const MAX_DOCUMENT_NUMBERING_START = 2147483647;
|
|
9001
|
+
const DocumentBulletList = BulletList.extend({
|
|
9002
|
+
addAttributes () {
|
|
9003
|
+
return {
|
|
9004
|
+
...documentListIdentityAttributes(),
|
|
9005
|
+
bulletStyle: {
|
|
9006
|
+
default: 'disc',
|
|
9007
|
+
parseHTML: (element)=>parsedBulletStyle(element) ?? 'disc',
|
|
9008
|
+
renderHTML: (attributes)=>{
|
|
9009
|
+
const style = normalizeBulletStyle(attributes.bulletStyle) ?? 'disc';
|
|
9010
|
+
return 'disc' === style ? {} : {
|
|
9011
|
+
'data-office-bullet-style': style,
|
|
9012
|
+
style: `list-style-type: ${style}`
|
|
9013
|
+
};
|
|
9014
|
+
}
|
|
9015
|
+
}
|
|
9016
|
+
};
|
|
9017
|
+
}
|
|
9018
|
+
});
|
|
9019
|
+
const DocumentOrderedList = OrderedList.extend({
|
|
9020
|
+
addAttributes () {
|
|
9021
|
+
return {
|
|
9022
|
+
...this.parent?.(),
|
|
9023
|
+
...documentListIdentityAttributes()
|
|
9024
|
+
};
|
|
9025
|
+
}
|
|
9026
|
+
});
|
|
9027
|
+
const DocumentListCommands = Extension.create({
|
|
9028
|
+
name: 'documentListCommands',
|
|
9029
|
+
addCommands () {
|
|
9030
|
+
return {
|
|
9031
|
+
applyDocumentBulletList: (style)=>(props)=>applyDocumentBulletList(props, style),
|
|
9032
|
+
applyDocumentOrderedList: (style)=>(props)=>applyDocumentOrderedList(props, style),
|
|
9033
|
+
clearDocumentList: ()=>(props)=>clearDocumentList(props),
|
|
9034
|
+
continueDocumentNumbering: ()=>(props)=>continueDocumentNumbering(props),
|
|
9035
|
+
restartDocumentNumbering: ()=>(props)=>setDocumentNumberingStart(props, 1),
|
|
9036
|
+
setDocumentNumberingStart: (start)=>(props)=>setDocumentNumberingStart(props, start)
|
|
9037
|
+
};
|
|
9038
|
+
}
|
|
9039
|
+
});
|
|
9040
|
+
function documentBulletListStyle(editor) {
|
|
9041
|
+
const active = activeList(editor.state, 'bulletList');
|
|
9042
|
+
if (!active) return null;
|
|
9043
|
+
return normalizeBulletStyle(active.node.attrs.bulletStyle) ?? 'disc';
|
|
9044
|
+
}
|
|
9045
|
+
function documentOrderedListState(editor) {
|
|
9046
|
+
const active = activeList(editor.state, 'orderedList');
|
|
9047
|
+
if (!active) return null;
|
|
9048
|
+
return {
|
|
9049
|
+
start: normalizedNumberingStart(active.node.attrs.start),
|
|
9050
|
+
style: orderedListStyle(active.node.attrs.type)
|
|
9051
|
+
};
|
|
9052
|
+
}
|
|
9053
|
+
function applyDocumentBulletList(props, style) {
|
|
9054
|
+
const normalized = normalizeBulletStyle(style);
|
|
9055
|
+
if (!normalized) return false;
|
|
9056
|
+
const current = activeList(props.state, 'bulletList');
|
|
9057
|
+
if (current) return updateListAttributes(props, current, {
|
|
9058
|
+
bulletStyle: normalized,
|
|
9059
|
+
officeNumberingFormat: null,
|
|
9060
|
+
officeNumberingText: null
|
|
9061
|
+
});
|
|
9062
|
+
return props.chain().toggleBulletList().updateAttributes('bulletList', {
|
|
9063
|
+
bulletStyle: normalized
|
|
9064
|
+
}).run();
|
|
9065
|
+
}
|
|
9066
|
+
function applyDocumentOrderedList(props, style) {
|
|
9067
|
+
const type = orderedListType(style);
|
|
9068
|
+
if (void 0 === type) return false;
|
|
9069
|
+
const current = activeList(props.state, 'orderedList');
|
|
9070
|
+
if (current) return updateListAttributes(props, current, {
|
|
9071
|
+
type,
|
|
9072
|
+
officeNumberingFormat: null,
|
|
9073
|
+
officeNumberingText: null
|
|
9074
|
+
});
|
|
9075
|
+
return props.chain().toggleOrderedList().updateAttributes('orderedList', {
|
|
9076
|
+
start: 1,
|
|
9077
|
+
type
|
|
9078
|
+
}).run();
|
|
9079
|
+
}
|
|
9080
|
+
function clearDocumentList(props) {
|
|
9081
|
+
if (activeList(props.state, 'bulletList')) return props.commands.toggleBulletList();
|
|
9082
|
+
if (activeList(props.state, 'orderedList')) return props.commands.toggleOrderedList();
|
|
9083
|
+
return false;
|
|
9084
|
+
}
|
|
9085
|
+
function setDocumentNumberingStart(props, start) {
|
|
9086
|
+
if (!validNumberingStart(start)) return false;
|
|
9087
|
+
const current = activeList(props.state, 'orderedList');
|
|
9088
|
+
if (!current) return false;
|
|
9089
|
+
return updateListAttributes(props, current, {
|
|
9090
|
+
start
|
|
9091
|
+
});
|
|
9092
|
+
}
|
|
9093
|
+
function continueDocumentNumbering(props) {
|
|
9094
|
+
const current = activeList(props.state, 'orderedList');
|
|
9095
|
+
if (!current) return false;
|
|
9096
|
+
const previous = precedingOrderedList(props.state.doc, current);
|
|
9097
|
+
if (!previous) return false;
|
|
9098
|
+
const start = Math.min(MAX_DOCUMENT_NUMBERING_START, normalizedNumberingStart(previous.node.attrs.start) + previous.node.childCount);
|
|
9099
|
+
return updateListAttributes(props, current, {
|
|
9100
|
+
start,
|
|
9101
|
+
type: normalizedOrderedListType(previous.node.attrs.type),
|
|
9102
|
+
...listIdentityAttributes(previous.node)
|
|
9103
|
+
});
|
|
9104
|
+
}
|
|
9105
|
+
function listIdentityAttributes(node) {
|
|
9106
|
+
return {
|
|
9107
|
+
officeNumberingId: node.attrs.officeNumberingId ?? null,
|
|
9108
|
+
officeAbstractNumberingId: node.attrs.officeAbstractNumberingId ?? null,
|
|
9109
|
+
officeNumberingLevel: node.attrs.officeNumberingLevel ?? null,
|
|
9110
|
+
officeNumberingFormat: node.attrs.officeNumberingFormat ?? null,
|
|
9111
|
+
officeNumberingText: node.attrs.officeNumberingText ?? null,
|
|
9112
|
+
officeNumberingSuffix: node.attrs.officeNumberingSuffix ?? null,
|
|
9113
|
+
officeNumberingAlignment: node.attrs.officeNumberingAlignment ?? null,
|
|
9114
|
+
officeNumberingIndentLeft: node.attrs.officeNumberingIndentLeft ?? null,
|
|
9115
|
+
officeNumberingIndentRight: node.attrs.officeNumberingIndentRight ?? null,
|
|
9116
|
+
officeNumberingIndentStart: node.attrs.officeNumberingIndentStart ?? null,
|
|
9117
|
+
officeNumberingIndentEnd: node.attrs.officeNumberingIndentEnd ?? null,
|
|
9118
|
+
officeNumberingIndentHanging: node.attrs.officeNumberingIndentHanging ?? null,
|
|
9119
|
+
officeNumberingIndentFirstLine: node.attrs.officeNumberingIndentFirstLine ?? null,
|
|
9120
|
+
officeNumberingRestartAfterLevel: node.attrs.officeNumberingRestartAfterLevel ?? null
|
|
9121
|
+
};
|
|
9122
|
+
}
|
|
9123
|
+
function updateListAttributes({ dispatch, state }, list, attributes) {
|
|
9124
|
+
const next = {
|
|
9125
|
+
...list.node.attrs,
|
|
9126
|
+
...attributes
|
|
9127
|
+
};
|
|
9128
|
+
if (Object.entries(attributes).every(([key, value])=>list.node.attrs[key] === value)) return true;
|
|
9129
|
+
dispatch?.(state.tr.setNodeMarkup(list.position, void 0, next, list.node.marks).scrollIntoView());
|
|
9130
|
+
return true;
|
|
9131
|
+
}
|
|
9132
|
+
function activeList(state, nodeName) {
|
|
9133
|
+
const position = state.selection.$from;
|
|
9134
|
+
for(let depth = position.depth; depth > 0; depth -= 1){
|
|
9135
|
+
const node = position.node(depth);
|
|
9136
|
+
if (node.type.name === nodeName) return {
|
|
9137
|
+
depth,
|
|
9138
|
+
node,
|
|
9139
|
+
position: position.before(depth)
|
|
9140
|
+
};
|
|
9141
|
+
}
|
|
9142
|
+
return null;
|
|
9143
|
+
}
|
|
9144
|
+
function precedingOrderedList(document1, current) {
|
|
9145
|
+
let previous = null;
|
|
9146
|
+
document1.descendants((node, position)=>{
|
|
9147
|
+
if (position >= current.position) return false;
|
|
9148
|
+
if ('orderedList' !== node.type.name) return true;
|
|
9149
|
+
const parentDepth = document1.resolve(position).depth;
|
|
9150
|
+
if (parentDepth === current.depth - 1) previous = {
|
|
9151
|
+
depth: parentDepth + 1,
|
|
9152
|
+
node,
|
|
9153
|
+
position
|
|
9154
|
+
};
|
|
9155
|
+
return true;
|
|
9156
|
+
});
|
|
9157
|
+
return previous;
|
|
9158
|
+
}
|
|
9159
|
+
function parsedBulletStyle(element) {
|
|
9160
|
+
const direct = element.dataset.officeBulletStyle || element.style.listStyleType;
|
|
9161
|
+
const fromList = normalizeBulletStyle(direct);
|
|
9162
|
+
if (fromList) return fromList;
|
|
9163
|
+
return normalizeBulletStyle(element.querySelector(':scope > li')?.style.listStyleType);
|
|
9164
|
+
}
|
|
9165
|
+
function normalizeBulletStyle(value) {
|
|
9166
|
+
return 'disc' === value || 'circle' === value || 'square' === value ? value : null;
|
|
9167
|
+
}
|
|
9168
|
+
function orderedListType(style) {
|
|
9169
|
+
if ('decimal' === style) return null;
|
|
9170
|
+
if ('lower-alpha' === style) return 'a';
|
|
9171
|
+
if ('upper-alpha' === style) return 'A';
|
|
9172
|
+
if ('lower-roman' === style) return 'i';
|
|
9173
|
+
if ('upper-roman' === style) return 'I';
|
|
9174
|
+
}
|
|
9175
|
+
function orderedListStyle(value) {
|
|
9176
|
+
const type = normalizedOrderedListType(value);
|
|
9177
|
+
if ('a' === type) return 'lower-alpha';
|
|
9178
|
+
if ('A' === type) return 'upper-alpha';
|
|
9179
|
+
if ('i' === type) return 'lower-roman';
|
|
9180
|
+
if ('I' === type) return 'upper-roman';
|
|
9181
|
+
return 'decimal';
|
|
9182
|
+
}
|
|
9183
|
+
function normalizedOrderedListType(value) {
|
|
9184
|
+
return 'a' === value || 'A' === value || 'i' === value || 'I' === value ? value : null;
|
|
9185
|
+
}
|
|
9186
|
+
function normalizedNumberingStart(value) {
|
|
9187
|
+
const start = Number(value);
|
|
9188
|
+
return validNumberingStart(start) ? start : 1;
|
|
9189
|
+
}
|
|
9190
|
+
function validNumberingStart(value) {
|
|
9191
|
+
return Number.isSafeInteger(value) && value >= 1 && value <= MAX_DOCUMENT_NUMBERING_START;
|
|
9192
|
+
}
|
|
9193
|
+
function documentListIdentityAttributes() {
|
|
9194
|
+
return {
|
|
9195
|
+
officeNumberingId: work_document_lists_identityAttribute('officeNumberingId'),
|
|
9196
|
+
officeAbstractNumberingId: work_document_lists_identityAttribute('officeAbstractNumberingId'),
|
|
9197
|
+
officeNumberingLevel: work_document_lists_identityAttribute('officeNumberingLevel'),
|
|
9198
|
+
officeNumberingFormat: work_document_lists_identityAttribute('officeNumberingFormat'),
|
|
9199
|
+
officeNumberingText: work_document_lists_identityAttribute('officeNumberingText'),
|
|
9200
|
+
officeNumberingSuffix: work_document_lists_identityAttribute('officeNumberingSuffix'),
|
|
9201
|
+
officeNumberingAlignment: work_document_lists_identityAttribute('officeNumberingAlignment'),
|
|
9202
|
+
officeNumberingIndentLeft: work_document_lists_identityAttribute('officeNumberingIndentLeft'),
|
|
9203
|
+
officeNumberingIndentRight: work_document_lists_identityAttribute('officeNumberingIndentRight'),
|
|
9204
|
+
officeNumberingIndentStart: work_document_lists_identityAttribute('officeNumberingIndentStart'),
|
|
9205
|
+
officeNumberingIndentEnd: work_document_lists_identityAttribute('officeNumberingIndentEnd'),
|
|
9206
|
+
officeNumberingIndentHanging: work_document_lists_identityAttribute('officeNumberingIndentHanging'),
|
|
9207
|
+
officeNumberingIndentFirstLine: work_document_lists_identityAttribute('officeNumberingIndentFirstLine'),
|
|
9208
|
+
officeNumberingRestartAfterLevel: work_document_lists_identityAttribute('officeNumberingRestartAfterLevel')
|
|
9209
|
+
};
|
|
9210
|
+
}
|
|
9211
|
+
function work_document_lists_identityAttribute(datasetKey) {
|
|
9212
|
+
const htmlName = `data-${datasetKey.replace(/[A-Z]/g, (letter)=>`-${letter.toLowerCase()}`)}`;
|
|
9213
|
+
return {
|
|
9214
|
+
default: null,
|
|
9215
|
+
parseHTML: (element)=>element.dataset[datasetKey] ?? null,
|
|
9216
|
+
renderHTML: (attributes)=>{
|
|
9217
|
+
const value = attributes[datasetKey];
|
|
9218
|
+
return 'string' == typeof value && value.length ? {
|
|
9219
|
+
[htmlName]: value
|
|
9220
|
+
} : {};
|
|
9221
|
+
}
|
|
9222
|
+
};
|
|
9223
|
+
}
|
|
9224
|
+
const NUMBERING_SNAPSHOT_KEYS = [
|
|
9225
|
+
'start',
|
|
9226
|
+
'type',
|
|
9227
|
+
'officeNumberingId',
|
|
9228
|
+
'officeAbstractNumberingId',
|
|
9229
|
+
'officeNumberingLevel',
|
|
9230
|
+
'officeNumberingFormat',
|
|
9231
|
+
'officeNumberingText',
|
|
9232
|
+
'officeNumberingSuffix',
|
|
9233
|
+
'officeNumberingAlignment',
|
|
9234
|
+
'officeNumberingIndentLeft',
|
|
9235
|
+
'officeNumberingIndentRight',
|
|
9236
|
+
'officeNumberingIndentStart',
|
|
9237
|
+
'officeNumberingIndentEnd',
|
|
9238
|
+
'officeNumberingIndentHanging',
|
|
9239
|
+
'officeNumberingIndentFirstLine',
|
|
9240
|
+
'officeNumberingRestartAfterLevel',
|
|
9241
|
+
'level',
|
|
9242
|
+
'originalFormat',
|
|
9243
|
+
'originalSuffix'
|
|
9244
|
+
];
|
|
9245
|
+
const MAX_NUMBERING_SNAPSHOT_BYTES = 65536;
|
|
9246
|
+
const MAX_IDENTITY_LENGTH = 1024;
|
|
9247
|
+
const MAX_ORIGINAL_SUFFIX_LENGTH = 32;
|
|
9248
|
+
function serializeDocumentNumberingChange(attributes) {
|
|
9249
|
+
return JSON.stringify(normalizeDocumentNumberingChange(attributes));
|
|
9250
|
+
}
|
|
9251
|
+
function parseDocumentNumberingChange(value) {
|
|
9252
|
+
if ('string' != typeof value || !value.length || value.length > MAX_NUMBERING_SNAPSHOT_BYTES) return null;
|
|
9253
|
+
let parsed;
|
|
9254
|
+
try {
|
|
9255
|
+
parsed = JSON.parse(value);
|
|
9256
|
+
} catch {
|
|
9257
|
+
return null;
|
|
9258
|
+
}
|
|
9259
|
+
if (!work_document_numbering_changes_isRecord(parsed)) return null;
|
|
9260
|
+
const keys = Object.keys(parsed);
|
|
9261
|
+
if (keys.length !== NUMBERING_SNAPSHOT_KEYS.length || keys.some((key, index)=>key !== NUMBERING_SNAPSHOT_KEYS[index])) return null;
|
|
9262
|
+
const normalized = normalizeDocumentNumberingChange(parsed);
|
|
9263
|
+
return JSON.stringify(normalized) === value ? normalized : null;
|
|
9264
|
+
}
|
|
9265
|
+
function restoredDocumentNumberingAttributes(attributes, serialized) {
|
|
9266
|
+
const snapshot = parseDocumentNumberingChange(serialized);
|
|
9267
|
+
if (!snapshot) return null;
|
|
9268
|
+
return clearDocumentNumberingChangeAttributes({
|
|
9269
|
+
...attributes,
|
|
9270
|
+
start: snapshot.start,
|
|
9271
|
+
type: snapshot.type,
|
|
9272
|
+
officeNumberingId: snapshot.officeNumberingId,
|
|
9273
|
+
officeAbstractNumberingId: snapshot.officeAbstractNumberingId,
|
|
9274
|
+
officeNumberingLevel: snapshot.officeNumberingLevel,
|
|
9275
|
+
officeNumberingFormat: snapshot.officeNumberingFormat,
|
|
9276
|
+
officeNumberingText: snapshot.officeNumberingText,
|
|
9277
|
+
officeNumberingSuffix: snapshot.officeNumberingSuffix,
|
|
9278
|
+
officeNumberingAlignment: snapshot.officeNumberingAlignment,
|
|
9279
|
+
officeNumberingIndentLeft: snapshot.officeNumberingIndentLeft,
|
|
9280
|
+
officeNumberingIndentRight: snapshot.officeNumberingIndentRight,
|
|
9281
|
+
officeNumberingIndentStart: snapshot.officeNumberingIndentStart,
|
|
9282
|
+
officeNumberingIndentEnd: snapshot.officeNumberingIndentEnd,
|
|
9283
|
+
officeNumberingIndentHanging: snapshot.officeNumberingIndentHanging,
|
|
9284
|
+
officeNumberingIndentFirstLine: snapshot.officeNumberingIndentFirstLine,
|
|
9285
|
+
officeNumberingRestartAfterLevel: snapshot.officeNumberingRestartAfterLevel
|
|
9286
|
+
});
|
|
9287
|
+
}
|
|
9288
|
+
function clearDocumentNumberingChangeAttributes(attributes) {
|
|
9289
|
+
return {
|
|
9290
|
+
...attributes,
|
|
9291
|
+
numberingChangeKind: null,
|
|
9292
|
+
numberingChangeId: '',
|
|
9293
|
+
numberingChangeActorId: '',
|
|
9294
|
+
numberingChangeAuthor: '',
|
|
9295
|
+
numberingChangeDate: '',
|
|
9296
|
+
numberingChangeBefore: ''
|
|
9297
|
+
};
|
|
9298
|
+
}
|
|
9299
|
+
function numberingFormatFromType(type) {
|
|
9300
|
+
if ('I' === type) return 1;
|
|
9301
|
+
if ('i' === type) return 2;
|
|
9302
|
+
if ('A' === type) return 3;
|
|
9303
|
+
if ('a' === type) return 4;
|
|
9304
|
+
return 0;
|
|
9305
|
+
}
|
|
9306
|
+
function numberingTypeFromFormat(format) {
|
|
9307
|
+
if (0 === format) return null;
|
|
9308
|
+
if (1 === format) return 'I';
|
|
9309
|
+
if (2 === format) return 'i';
|
|
9310
|
+
if (3 === format) return 'A';
|
|
9311
|
+
if (4 === format) return 'a';
|
|
9312
|
+
}
|
|
9313
|
+
function normalizeDocumentNumberingChange(source) {
|
|
9314
|
+
const type = numberingType(source.type);
|
|
9315
|
+
const level = work_document_numbering_changes_boundedInteger(source.level ?? source.officeNumberingLevel, 0, 8, 0);
|
|
9316
|
+
const originalFormat = work_document_numbering_changes_boundedInteger(source.originalFormat, 0, 4, numberingFormatFromType(type));
|
|
9317
|
+
return {
|
|
9318
|
+
start: work_document_numbering_changes_boundedInteger(source.start, 1, MAX_DOCUMENT_NUMBERING_START, 1),
|
|
9319
|
+
type,
|
|
9320
|
+
officeNumberingId: boundedString(source.officeNumberingId),
|
|
9321
|
+
officeAbstractNumberingId: boundedString(source.officeAbstractNumberingId),
|
|
9322
|
+
officeNumberingLevel: boundedString(source.officeNumberingLevel),
|
|
9323
|
+
officeNumberingFormat: boundedString(source.officeNumberingFormat),
|
|
9324
|
+
officeNumberingText: boundedString(source.officeNumberingText),
|
|
9325
|
+
officeNumberingSuffix: boundedString(source.officeNumberingSuffix),
|
|
9326
|
+
officeNumberingAlignment: boundedString(source.officeNumberingAlignment),
|
|
9327
|
+
officeNumberingIndentLeft: boundedString(source.officeNumberingIndentLeft),
|
|
9328
|
+
officeNumberingIndentRight: boundedString(source.officeNumberingIndentRight),
|
|
9329
|
+
officeNumberingIndentStart: boundedString(source.officeNumberingIndentStart),
|
|
9330
|
+
officeNumberingIndentEnd: boundedString(source.officeNumberingIndentEnd),
|
|
9331
|
+
officeNumberingIndentHanging: boundedString(source.officeNumberingIndentHanging),
|
|
9332
|
+
officeNumberingIndentFirstLine: boundedString(source.officeNumberingIndentFirstLine),
|
|
9333
|
+
officeNumberingRestartAfterLevel: boundedString(source.officeNumberingRestartAfterLevel),
|
|
9334
|
+
level,
|
|
9335
|
+
originalFormat,
|
|
9336
|
+
originalSuffix: originalSuffix(source.originalSuffix)
|
|
9337
|
+
};
|
|
9338
|
+
}
|
|
9339
|
+
function numberingType(value) {
|
|
9340
|
+
return 'a' === value || 'A' === value || 'i' === value || 'I' === value ? value : null;
|
|
9341
|
+
}
|
|
9342
|
+
function originalSuffix(value) {
|
|
9343
|
+
if ('string' != typeof value || !value.length || value.length > MAX_ORIGINAL_SUFFIX_LENGTH || value.includes('%') || /[\u0000-\u001f\u007f]/.test(value)) return '.';
|
|
9344
|
+
return value;
|
|
9345
|
+
}
|
|
9346
|
+
function boundedString(value) {
|
|
9347
|
+
return 'string' == typeof value && value.length <= MAX_IDENTITY_LENGTH ? value || null : null;
|
|
9348
|
+
}
|
|
9349
|
+
function work_document_numbering_changes_boundedInteger(value, minimum, maximum, fallback) {
|
|
9350
|
+
const number = Number(value);
|
|
9351
|
+
return Number.isSafeInteger(number) && number >= minimum && number <= maximum ? number : fallback;
|
|
9352
|
+
}
|
|
9353
|
+
function work_document_numbering_changes_isRecord(value) {
|
|
9354
|
+
return 'object' == typeof value && null !== value && !Array.isArray(value);
|
|
9355
|
+
}
|
|
9356
|
+
function trackDocumentNumberingChangeTransaction(transaction, state, options) {
|
|
9357
|
+
if (!transaction.steps.some((step)=>step instanceof ReplaceAroundStep)) return false;
|
|
9358
|
+
let identity = null;
|
|
9359
|
+
let tracked = false;
|
|
9360
|
+
state.doc.descendants((before, position)=>{
|
|
9361
|
+
if ('orderedList' !== before.type.name) return;
|
|
9362
|
+
const after = transaction.doc.nodeAt(position);
|
|
9363
|
+
if (!after || after.type !== before.type || !before.content.eq(after.content)) return;
|
|
9364
|
+
const previous = serializeDocumentNumberingChange(before.attrs);
|
|
9365
|
+
const current = serializeDocumentNumberingChange(after.attrs);
|
|
9366
|
+
if (previous === current || hasNumberingChange(after)) return;
|
|
9367
|
+
identity ??= options.createChange();
|
|
9368
|
+
transaction.setNodeMarkup(position, void 0, {
|
|
9369
|
+
...after.attrs,
|
|
9370
|
+
numberingChangeKind: 'numbering',
|
|
9371
|
+
numberingChangeId: identity.id,
|
|
9372
|
+
numberingChangeActorId: identity.actorId ?? '',
|
|
9373
|
+
numberingChangeAuthor: identity.author || 'A3S Work',
|
|
9374
|
+
numberingChangeDate: identity.date || new Date().toISOString(),
|
|
9375
|
+
numberingChangeBefore: previous
|
|
9376
|
+
});
|
|
9377
|
+
tracked = true;
|
|
9378
|
+
});
|
|
9379
|
+
return tracked;
|
|
9380
|
+
}
|
|
9381
|
+
function hasNumberingChange(node) {
|
|
9382
|
+
return 'numbering' === node.attrs.numberingChangeKind;
|
|
9383
|
+
}
|
|
9000
9384
|
const MAX_DOCUMENT_TAB_POSITION_PX = 4096;
|
|
9001
9385
|
const MAX_DOCUMENT_TAB_STOPS = 64;
|
|
9002
9386
|
const DocumentParagraphTabStops = Extension.create({
|
|
@@ -9332,12 +9716,18 @@ function trackDocumentFormattingTransaction(transaction, state, type, options, p
|
|
|
9332
9716
|
const paragraphFormatting = trackDocumentParagraphFormattingTransaction(transaction, state, {
|
|
9333
9717
|
createChange: ()=>options.createChange('paragraph-formatting')
|
|
9334
9718
|
});
|
|
9335
|
-
|
|
9719
|
+
const numbering = trackDocumentNumberingChangeTransaction(transaction, state, {
|
|
9720
|
+
createChange: ()=>options.createChange('numbering')
|
|
9721
|
+
});
|
|
9722
|
+
if (identity || paragraphFormatting || numbering) transaction.setMeta(pluginKey, {
|
|
9336
9723
|
...identity ? {
|
|
9337
9724
|
formatting: true
|
|
9338
9725
|
} : {},
|
|
9339
9726
|
...paragraphFormatting ? {
|
|
9340
9727
|
paragraphFormatting: true
|
|
9728
|
+
} : {},
|
|
9729
|
+
...numbering ? {
|
|
9730
|
+
numbering: true
|
|
9341
9731
|
} : {}
|
|
9342
9732
|
});
|
|
9343
9733
|
}
|
|
@@ -9488,6 +9878,19 @@ const DocumentChange = Mark.create({
|
|
|
9488
9878
|
blockChangeAuthor: blockChangeAttribute('author'),
|
|
9489
9879
|
blockChangeDate: blockChangeAttribute('date')
|
|
9490
9880
|
}
|
|
9881
|
+
},
|
|
9882
|
+
{
|
|
9883
|
+
types: [
|
|
9884
|
+
'orderedList'
|
|
9885
|
+
],
|
|
9886
|
+
attributes: {
|
|
9887
|
+
numberingChangeKind: numberingChangeAttribute('kind', 'data-change-kind'),
|
|
9888
|
+
numberingChangeId: numberingChangeAttribute('id', 'data-change-id'),
|
|
9889
|
+
numberingChangeActorId: numberingChangeAttribute('actorId', 'data-change-actor-id'),
|
|
9890
|
+
numberingChangeAuthor: numberingChangeAttribute('author', 'data-change-author'),
|
|
9891
|
+
numberingChangeDate: numberingChangeAttribute('date', 'data-change-date'),
|
|
9892
|
+
numberingChangeBefore: numberingChangeAttribute('before', 'data-change-before')
|
|
9893
|
+
}
|
|
9491
9894
|
}
|
|
9492
9895
|
];
|
|
9493
9896
|
},
|
|
@@ -9654,6 +10057,29 @@ function collectDocumentChanges(document1) {
|
|
|
9654
10057
|
text: node.textContent
|
|
9655
10058
|
});
|
|
9656
10059
|
}
|
|
10060
|
+
if ('orderedList' === node.type.name && 'numbering' === node.attrs.numberingChangeKind) {
|
|
10061
|
+
const id = work_document_changes_stringAttribute(node.attrs.numberingChangeId) || `numbering-change-at-${position}`;
|
|
10062
|
+
const key = `numbering:${id}`;
|
|
10063
|
+
const from = position + 1;
|
|
10064
|
+
const to = from + node.content.size;
|
|
10065
|
+
const current = changes.get(key);
|
|
10066
|
+
if (current) {
|
|
10067
|
+
current.from = Math.min(current.from, from);
|
|
10068
|
+
current.to = Math.max(current.to, to);
|
|
10069
|
+
current.text = `${current.text}\n${node.textContent}`;
|
|
10070
|
+
} else changes.set(key, {
|
|
10071
|
+
id,
|
|
10072
|
+
kind: 'numbering',
|
|
10073
|
+
...work_document_changes_stringAttribute(node.attrs.numberingChangeActorId) ? {
|
|
10074
|
+
actorId: work_document_changes_stringAttribute(node.attrs.numberingChangeActorId)
|
|
10075
|
+
} : {},
|
|
10076
|
+
author: work_document_changes_stringAttribute(node.attrs.numberingChangeAuthor) || '未知审阅者',
|
|
10077
|
+
date: work_document_changes_stringAttribute(node.attrs.numberingChangeDate),
|
|
10078
|
+
from,
|
|
10079
|
+
to,
|
|
10080
|
+
text: node.textContent
|
|
10081
|
+
});
|
|
10082
|
+
}
|
|
9657
10083
|
if (!node.isText || !node.text) return;
|
|
9658
10084
|
const mark = work_document_changes_documentChangeMark(node.marks);
|
|
9659
10085
|
if (!mark) return;
|
|
@@ -9699,9 +10125,10 @@ function resolveDocumentChangesCommand({ state, tr }, type, decision, ids) {
|
|
|
9699
10125
|
function resolveDocumentChangesTransaction(state, tr, type, decision, ids) {
|
|
9700
10126
|
const segments = documentChangeSegments(state.doc, type).filter((segment)=>!ids || ids.has(segment.id));
|
|
9701
10127
|
const paragraphSegments = paragraphChangeSegments(state.doc).filter((segment)=>!ids || ids.has(segment.id));
|
|
10128
|
+
const numberingSegments = numberingChangeSegments(state.doc).filter((segment)=>!ids || ids.has(segment.id));
|
|
9702
10129
|
const blockSegments = blockChangeSegments(state.doc).filter((segment)=>!ids || ids.has(segment.id));
|
|
9703
|
-
if (!segments.length && !paragraphSegments.length && !blockSegments.length) return 0;
|
|
9704
|
-
if (paragraphSegments.some((segment)=>!parseDocumentParagraphFormatting(segment.before)) || 'reject' === decision && segments.some((segment)=>'formatting' === segment.kind && !parseDocumentCharacterFormatting(segment.before))) return 0;
|
|
10130
|
+
if (!segments.length && !paragraphSegments.length && !numberingSegments.length && !blockSegments.length) return 0;
|
|
10131
|
+
if (paragraphSegments.some((segment)=>!parseDocumentParagraphFormatting(segment.before)) || numberingSegments.some((segment)=>!parseDocumentNumberingChange(segment.before)) || 'reject' === decision && segments.some((segment)=>'formatting' === segment.kind && !parseDocumentCharacterFormatting(segment.before))) return 0;
|
|
9705
10132
|
closeHistory(tr);
|
|
9706
10133
|
tr.setMeta(documentChangePluginKey, {
|
|
9707
10134
|
decision
|
|
@@ -9726,7 +10153,15 @@ function resolveDocumentChangesTransaction(state, tr, type, decision, ids) {
|
|
|
9726
10153
|
if (!node || 'paragraph' !== node.type.name && 'heading' !== node.type.name) return 0;
|
|
9727
10154
|
const attributes = 'reject' === decision ? restoredDocumentParagraphAttributes(node.attrs, segment.before) : clearDocumentParagraphChangeAttributes(node.attrs);
|
|
9728
10155
|
if (!attributes) return 0;
|
|
9729
|
-
tr.setNodeMarkup(segment.position, void 0, attributes);
|
|
10156
|
+
tr.setNodeMarkup(segment.position, void 0, attributes);
|
|
10157
|
+
}
|
|
10158
|
+
for (const segment of numberingSegments){
|
|
10159
|
+
const position = tr.mapping.map(segment.position);
|
|
10160
|
+
const node = tr.doc.nodeAt(position);
|
|
10161
|
+
if (!node || 'orderedList' !== node.type.name) return 0;
|
|
10162
|
+
const attributes = 'reject' === decision ? restoredDocumentNumberingAttributes(node.attrs, segment.before) : clearDocumentNumberingChangeAttributes(node.attrs);
|
|
10163
|
+
if (!attributes) return 0;
|
|
10164
|
+
tr.setNodeMarkup(position, void 0, attributes);
|
|
9730
10165
|
}
|
|
9731
10166
|
for (const segment of blockSegments){
|
|
9732
10167
|
if (removedBlockIds.has(segment.id)) continue;
|
|
@@ -9746,6 +10181,7 @@ function resolveDocumentChangesTransaction(state, tr, type, decision, ids) {
|
|
|
9746
10181
|
return tr.docChanged ? new Set([
|
|
9747
10182
|
...segments,
|
|
9748
10183
|
...paragraphSegments,
|
|
10184
|
+
...numberingSegments,
|
|
9749
10185
|
...blockSegments
|
|
9750
10186
|
].map((segment)=>segment.id)).size : 0;
|
|
9751
10187
|
}
|
|
@@ -9815,6 +10251,21 @@ function paragraphChangeSegments(document1) {
|
|
|
9815
10251
|
});
|
|
9816
10252
|
return segments;
|
|
9817
10253
|
}
|
|
10254
|
+
function numberingChangeSegments(document1) {
|
|
10255
|
+
const segments = [];
|
|
10256
|
+
document1.descendants((node, position)=>{
|
|
10257
|
+
if ('orderedList' !== node.type.name || 'numbering' !== node.attrs.numberingChangeKind) return;
|
|
10258
|
+
segments.push({
|
|
10259
|
+
id: work_document_changes_stringAttribute(node.attrs.numberingChangeId) || `numbering-change-at-${position}`,
|
|
10260
|
+
kind: 'numbering',
|
|
10261
|
+
position,
|
|
10262
|
+
from: position + 1,
|
|
10263
|
+
to: position + 1 + node.content.size,
|
|
10264
|
+
before: work_document_changes_stringAttribute(node.attrs.numberingChangeBefore)
|
|
10265
|
+
});
|
|
10266
|
+
});
|
|
10267
|
+
return segments;
|
|
10268
|
+
}
|
|
9818
10269
|
function blockChangeSegments(document1) {
|
|
9819
10270
|
const segments = [];
|
|
9820
10271
|
document1.descendants((node, position)=>{
|
|
@@ -9905,6 +10356,27 @@ function paragraphChangeAttribute(field, htmlName) {
|
|
|
9905
10356
|
}
|
|
9906
10357
|
};
|
|
9907
10358
|
}
|
|
10359
|
+
function numberingChangeAttribute(field, htmlName) {
|
|
10360
|
+
const modelName = `numberingChange${field[0]?.toUpperCase() ?? ''}${field.slice(1)}`;
|
|
10361
|
+
return {
|
|
10362
|
+
default: 'kind' === field ? null : '',
|
|
10363
|
+
parseHTML: (element)=>{
|
|
10364
|
+
if ('true' !== element.getAttribute('data-document-change') || 'numbering' !== element.getAttribute('data-change-kind')) return 'kind' === field ? null : '';
|
|
10365
|
+
return 'kind' === field ? 'numbering' : element.getAttribute(htmlName) ?? '';
|
|
10366
|
+
},
|
|
10367
|
+
renderHTML: (attributes)=>{
|
|
10368
|
+
if ('numbering' !== attributes.numberingChangeKind) return {};
|
|
10369
|
+
if ('kind' === field) return {
|
|
10370
|
+
'data-document-change': 'true',
|
|
10371
|
+
'data-change-kind': 'numbering'
|
|
10372
|
+
};
|
|
10373
|
+
const value = work_document_changes_stringAttribute(attributes[modelName]);
|
|
10374
|
+
return value ? {
|
|
10375
|
+
[htmlName]: value
|
|
10376
|
+
} : {};
|
|
10377
|
+
}
|
|
10378
|
+
};
|
|
10379
|
+
}
|
|
9908
10380
|
function blockChangeAttribute(field) {
|
|
9909
10381
|
const modelName = `blockChange${field[0]?.toUpperCase() ?? ''}${field.slice(1)}`;
|
|
9910
10382
|
const htmlName = 'kind' === field ? 'data-block-change-kind' : `data-block-change-${field.replace('actorId', 'actor-id')}`;
|
|
@@ -13377,230 +13849,6 @@ const DocumentLazyBlock = core_Node.create({
|
|
|
13377
13849
|
];
|
|
13378
13850
|
}
|
|
13379
13851
|
});
|
|
13380
|
-
const MAX_DOCUMENT_NUMBERING_START = 2147483647;
|
|
13381
|
-
const DocumentBulletList = BulletList.extend({
|
|
13382
|
-
addAttributes () {
|
|
13383
|
-
return {
|
|
13384
|
-
...documentListIdentityAttributes(),
|
|
13385
|
-
bulletStyle: {
|
|
13386
|
-
default: 'disc',
|
|
13387
|
-
parseHTML: (element)=>parsedBulletStyle(element) ?? 'disc',
|
|
13388
|
-
renderHTML: (attributes)=>{
|
|
13389
|
-
const style = normalizeBulletStyle(attributes.bulletStyle) ?? 'disc';
|
|
13390
|
-
return 'disc' === style ? {} : {
|
|
13391
|
-
'data-office-bullet-style': style,
|
|
13392
|
-
style: `list-style-type: ${style}`
|
|
13393
|
-
};
|
|
13394
|
-
}
|
|
13395
|
-
}
|
|
13396
|
-
};
|
|
13397
|
-
}
|
|
13398
|
-
});
|
|
13399
|
-
const DocumentOrderedList = OrderedList.extend({
|
|
13400
|
-
addAttributes () {
|
|
13401
|
-
return {
|
|
13402
|
-
...this.parent?.(),
|
|
13403
|
-
...documentListIdentityAttributes()
|
|
13404
|
-
};
|
|
13405
|
-
}
|
|
13406
|
-
});
|
|
13407
|
-
const DocumentListCommands = Extension.create({
|
|
13408
|
-
name: 'documentListCommands',
|
|
13409
|
-
addCommands () {
|
|
13410
|
-
return {
|
|
13411
|
-
applyDocumentBulletList: (style)=>(props)=>applyDocumentBulletList(props, style),
|
|
13412
|
-
applyDocumentOrderedList: (style)=>(props)=>applyDocumentOrderedList(props, style),
|
|
13413
|
-
clearDocumentList: ()=>(props)=>clearDocumentList(props),
|
|
13414
|
-
continueDocumentNumbering: ()=>(props)=>continueDocumentNumbering(props),
|
|
13415
|
-
restartDocumentNumbering: ()=>(props)=>setDocumentNumberingStart(props, 1),
|
|
13416
|
-
setDocumentNumberingStart: (start)=>(props)=>setDocumentNumberingStart(props, start)
|
|
13417
|
-
};
|
|
13418
|
-
}
|
|
13419
|
-
});
|
|
13420
|
-
function documentBulletListStyle(editor) {
|
|
13421
|
-
const active = activeList(editor.state, 'bulletList');
|
|
13422
|
-
if (!active) return null;
|
|
13423
|
-
return normalizeBulletStyle(active.node.attrs.bulletStyle) ?? 'disc';
|
|
13424
|
-
}
|
|
13425
|
-
function documentOrderedListState(editor) {
|
|
13426
|
-
const active = activeList(editor.state, 'orderedList');
|
|
13427
|
-
if (!active) return null;
|
|
13428
|
-
return {
|
|
13429
|
-
start: normalizedNumberingStart(active.node.attrs.start),
|
|
13430
|
-
style: orderedListStyle(active.node.attrs.type)
|
|
13431
|
-
};
|
|
13432
|
-
}
|
|
13433
|
-
function applyDocumentBulletList(props, style) {
|
|
13434
|
-
const normalized = normalizeBulletStyle(style);
|
|
13435
|
-
if (!normalized) return false;
|
|
13436
|
-
const current = activeList(props.state, 'bulletList');
|
|
13437
|
-
if (current) return updateListAttributes(props, current, {
|
|
13438
|
-
bulletStyle: normalized,
|
|
13439
|
-
officeNumberingFormat: null,
|
|
13440
|
-
officeNumberingText: null
|
|
13441
|
-
});
|
|
13442
|
-
return props.chain().toggleBulletList().updateAttributes('bulletList', {
|
|
13443
|
-
bulletStyle: normalized
|
|
13444
|
-
}).run();
|
|
13445
|
-
}
|
|
13446
|
-
function applyDocumentOrderedList(props, style) {
|
|
13447
|
-
const type = orderedListType(style);
|
|
13448
|
-
if (void 0 === type) return false;
|
|
13449
|
-
const current = activeList(props.state, 'orderedList');
|
|
13450
|
-
if (current) return updateListAttributes(props, current, {
|
|
13451
|
-
type,
|
|
13452
|
-
officeNumberingFormat: null,
|
|
13453
|
-
officeNumberingText: null
|
|
13454
|
-
});
|
|
13455
|
-
return props.chain().toggleOrderedList().updateAttributes('orderedList', {
|
|
13456
|
-
start: 1,
|
|
13457
|
-
type
|
|
13458
|
-
}).run();
|
|
13459
|
-
}
|
|
13460
|
-
function clearDocumentList(props) {
|
|
13461
|
-
if (activeList(props.state, 'bulletList')) return props.commands.toggleBulletList();
|
|
13462
|
-
if (activeList(props.state, 'orderedList')) return props.commands.toggleOrderedList();
|
|
13463
|
-
return false;
|
|
13464
|
-
}
|
|
13465
|
-
function setDocumentNumberingStart(props, start) {
|
|
13466
|
-
if (!validNumberingStart(start)) return false;
|
|
13467
|
-
const current = activeList(props.state, 'orderedList');
|
|
13468
|
-
if (!current) return false;
|
|
13469
|
-
return updateListAttributes(props, current, {
|
|
13470
|
-
start
|
|
13471
|
-
});
|
|
13472
|
-
}
|
|
13473
|
-
function continueDocumentNumbering(props) {
|
|
13474
|
-
const current = activeList(props.state, 'orderedList');
|
|
13475
|
-
if (!current) return false;
|
|
13476
|
-
const previous = precedingOrderedList(props.state.doc, current);
|
|
13477
|
-
if (!previous) return false;
|
|
13478
|
-
const start = Math.min(MAX_DOCUMENT_NUMBERING_START, normalizedNumberingStart(previous.node.attrs.start) + previous.node.childCount);
|
|
13479
|
-
return updateListAttributes(props, current, {
|
|
13480
|
-
start,
|
|
13481
|
-
type: normalizedOrderedListType(previous.node.attrs.type),
|
|
13482
|
-
...listIdentityAttributes(previous.node)
|
|
13483
|
-
});
|
|
13484
|
-
}
|
|
13485
|
-
function listIdentityAttributes(node) {
|
|
13486
|
-
return {
|
|
13487
|
-
officeNumberingId: node.attrs.officeNumberingId ?? null,
|
|
13488
|
-
officeAbstractNumberingId: node.attrs.officeAbstractNumberingId ?? null,
|
|
13489
|
-
officeNumberingLevel: node.attrs.officeNumberingLevel ?? null,
|
|
13490
|
-
officeNumberingFormat: node.attrs.officeNumberingFormat ?? null,
|
|
13491
|
-
officeNumberingText: node.attrs.officeNumberingText ?? null,
|
|
13492
|
-
officeNumberingSuffix: node.attrs.officeNumberingSuffix ?? null,
|
|
13493
|
-
officeNumberingAlignment: node.attrs.officeNumberingAlignment ?? null,
|
|
13494
|
-
officeNumberingIndentLeft: node.attrs.officeNumberingIndentLeft ?? null,
|
|
13495
|
-
officeNumberingIndentRight: node.attrs.officeNumberingIndentRight ?? null,
|
|
13496
|
-
officeNumberingIndentStart: node.attrs.officeNumberingIndentStart ?? null,
|
|
13497
|
-
officeNumberingIndentEnd: node.attrs.officeNumberingIndentEnd ?? null,
|
|
13498
|
-
officeNumberingIndentHanging: node.attrs.officeNumberingIndentHanging ?? null,
|
|
13499
|
-
officeNumberingIndentFirstLine: node.attrs.officeNumberingIndentFirstLine ?? null,
|
|
13500
|
-
officeNumberingRestartAfterLevel: node.attrs.officeNumberingRestartAfterLevel ?? null
|
|
13501
|
-
};
|
|
13502
|
-
}
|
|
13503
|
-
function updateListAttributes({ dispatch, state }, list, attributes) {
|
|
13504
|
-
const next = {
|
|
13505
|
-
...list.node.attrs,
|
|
13506
|
-
...attributes
|
|
13507
|
-
};
|
|
13508
|
-
if (Object.entries(attributes).every(([key, value])=>list.node.attrs[key] === value)) return true;
|
|
13509
|
-
dispatch?.(state.tr.setNodeMarkup(list.position, void 0, next, list.node.marks).scrollIntoView());
|
|
13510
|
-
return true;
|
|
13511
|
-
}
|
|
13512
|
-
function activeList(state, nodeName) {
|
|
13513
|
-
const position = state.selection.$from;
|
|
13514
|
-
for(let depth = position.depth; depth > 0; depth -= 1){
|
|
13515
|
-
const node = position.node(depth);
|
|
13516
|
-
if (node.type.name === nodeName) return {
|
|
13517
|
-
depth,
|
|
13518
|
-
node,
|
|
13519
|
-
position: position.before(depth)
|
|
13520
|
-
};
|
|
13521
|
-
}
|
|
13522
|
-
return null;
|
|
13523
|
-
}
|
|
13524
|
-
function precedingOrderedList(document1, current) {
|
|
13525
|
-
let previous = null;
|
|
13526
|
-
document1.descendants((node, position)=>{
|
|
13527
|
-
if (position >= current.position) return false;
|
|
13528
|
-
if ('orderedList' !== node.type.name) return true;
|
|
13529
|
-
const parentDepth = document1.resolve(position).depth;
|
|
13530
|
-
if (parentDepth === current.depth - 1) previous = {
|
|
13531
|
-
depth: parentDepth + 1,
|
|
13532
|
-
node,
|
|
13533
|
-
position
|
|
13534
|
-
};
|
|
13535
|
-
return true;
|
|
13536
|
-
});
|
|
13537
|
-
return previous;
|
|
13538
|
-
}
|
|
13539
|
-
function parsedBulletStyle(element) {
|
|
13540
|
-
const direct = element.dataset.officeBulletStyle || element.style.listStyleType;
|
|
13541
|
-
const fromList = normalizeBulletStyle(direct);
|
|
13542
|
-
if (fromList) return fromList;
|
|
13543
|
-
return normalizeBulletStyle(element.querySelector(':scope > li')?.style.listStyleType);
|
|
13544
|
-
}
|
|
13545
|
-
function normalizeBulletStyle(value) {
|
|
13546
|
-
return 'disc' === value || 'circle' === value || 'square' === value ? value : null;
|
|
13547
|
-
}
|
|
13548
|
-
function orderedListType(style) {
|
|
13549
|
-
if ('decimal' === style) return null;
|
|
13550
|
-
if ('lower-alpha' === style) return 'a';
|
|
13551
|
-
if ('upper-alpha' === style) return 'A';
|
|
13552
|
-
if ('lower-roman' === style) return 'i';
|
|
13553
|
-
if ('upper-roman' === style) return 'I';
|
|
13554
|
-
}
|
|
13555
|
-
function orderedListStyle(value) {
|
|
13556
|
-
const type = normalizedOrderedListType(value);
|
|
13557
|
-
if ('a' === type) return 'lower-alpha';
|
|
13558
|
-
if ('A' === type) return 'upper-alpha';
|
|
13559
|
-
if ('i' === type) return 'lower-roman';
|
|
13560
|
-
if ('I' === type) return 'upper-roman';
|
|
13561
|
-
return 'decimal';
|
|
13562
|
-
}
|
|
13563
|
-
function normalizedOrderedListType(value) {
|
|
13564
|
-
return 'a' === value || 'A' === value || 'i' === value || 'I' === value ? value : null;
|
|
13565
|
-
}
|
|
13566
|
-
function normalizedNumberingStart(value) {
|
|
13567
|
-
const start = Number(value);
|
|
13568
|
-
return validNumberingStart(start) ? start : 1;
|
|
13569
|
-
}
|
|
13570
|
-
function validNumberingStart(value) {
|
|
13571
|
-
return Number.isSafeInteger(value) && value >= 1 && value <= MAX_DOCUMENT_NUMBERING_START;
|
|
13572
|
-
}
|
|
13573
|
-
function documentListIdentityAttributes() {
|
|
13574
|
-
return {
|
|
13575
|
-
officeNumberingId: work_document_lists_identityAttribute('officeNumberingId'),
|
|
13576
|
-
officeAbstractNumberingId: work_document_lists_identityAttribute('officeAbstractNumberingId'),
|
|
13577
|
-
officeNumberingLevel: work_document_lists_identityAttribute('officeNumberingLevel'),
|
|
13578
|
-
officeNumberingFormat: work_document_lists_identityAttribute('officeNumberingFormat'),
|
|
13579
|
-
officeNumberingText: work_document_lists_identityAttribute('officeNumberingText'),
|
|
13580
|
-
officeNumberingSuffix: work_document_lists_identityAttribute('officeNumberingSuffix'),
|
|
13581
|
-
officeNumberingAlignment: work_document_lists_identityAttribute('officeNumberingAlignment'),
|
|
13582
|
-
officeNumberingIndentLeft: work_document_lists_identityAttribute('officeNumberingIndentLeft'),
|
|
13583
|
-
officeNumberingIndentRight: work_document_lists_identityAttribute('officeNumberingIndentRight'),
|
|
13584
|
-
officeNumberingIndentStart: work_document_lists_identityAttribute('officeNumberingIndentStart'),
|
|
13585
|
-
officeNumberingIndentEnd: work_document_lists_identityAttribute('officeNumberingIndentEnd'),
|
|
13586
|
-
officeNumberingIndentHanging: work_document_lists_identityAttribute('officeNumberingIndentHanging'),
|
|
13587
|
-
officeNumberingIndentFirstLine: work_document_lists_identityAttribute('officeNumberingIndentFirstLine'),
|
|
13588
|
-
officeNumberingRestartAfterLevel: work_document_lists_identityAttribute('officeNumberingRestartAfterLevel')
|
|
13589
|
-
};
|
|
13590
|
-
}
|
|
13591
|
-
function work_document_lists_identityAttribute(datasetKey) {
|
|
13592
|
-
const htmlName = `data-${datasetKey.replace(/[A-Z]/g, (letter)=>`-${letter.toLowerCase()}`)}`;
|
|
13593
|
-
return {
|
|
13594
|
-
default: null,
|
|
13595
|
-
parseHTML: (element)=>element.dataset[datasetKey] ?? null,
|
|
13596
|
-
renderHTML: (attributes)=>{
|
|
13597
|
-
const value = attributes[datasetKey];
|
|
13598
|
-
return 'string' == typeof value && value.length ? {
|
|
13599
|
-
[htmlName]: value
|
|
13600
|
-
} : {};
|
|
13601
|
-
}
|
|
13602
|
-
};
|
|
13603
|
-
}
|
|
13604
13852
|
function createDocumentNoteIntegrityPlugin(referenceNodeName = 'documentNoteReference', definitionNodeName = 'documentNote') {
|
|
13605
13853
|
return new Plugin({
|
|
13606
13854
|
view (view) {
|
|
@@ -20071,9 +20319,9 @@ function changeIdentity(decision) {
|
|
|
20071
20319
|
return `${decision.changeKind}:${decision.changeId}`;
|
|
20072
20320
|
}
|
|
20073
20321
|
function office_document_collaboration_change_decisions_changeKind(value, shared) {
|
|
20074
|
-
if ('insertion' === value || 'deletion' === value || 'formatting' === value || 'paragraph-formatting' === value) return value;
|
|
20322
|
+
if ('insertion' === value || 'deletion' === value || 'formatting' === value || 'paragraph-formatting' === value || 'numbering' === value) return value;
|
|
20075
20323
|
if (shared) invalidSharedSidecars('tracked-change decision kind');
|
|
20076
|
-
invalidInputSidecars('an insertion, deletion, formatting,
|
|
20324
|
+
invalidInputSidecars('an insertion, deletion, formatting, paragraph-formatting, or numbering tracked-change kind');
|
|
20077
20325
|
}
|
|
20078
20326
|
function decisionAction(value, shared) {
|
|
20079
20327
|
if ('accept' === value || 'reject' === value) return value;
|
|
@@ -20741,6 +20989,10 @@ function strictDocumentChanges(document1) {
|
|
|
20741
20989
|
return false;
|
|
20742
20990
|
}
|
|
20743
20991
|
}
|
|
20992
|
+
if ('orderedList' === node.type.name && !strictNumberingChange(node)) {
|
|
20993
|
+
valid = false;
|
|
20994
|
+
return false;
|
|
20995
|
+
}
|
|
20744
20996
|
if (!node.isText || !node.text) return;
|
|
20745
20997
|
const marks = node.marks.filter((mark)=>'documentChange' === mark.type.name);
|
|
20746
20998
|
if (0 === marks.length) return;
|
|
@@ -20845,6 +21097,18 @@ function strictParagraphFormattingChange(node) {
|
|
|
20845
21097
|
if ('paragraph-formatting' !== kind) return (null == kind || '' === kind) && fields.every((field)=>null == field || '' === field);
|
|
20846
21098
|
return Boolean(strictString(node.attrs.paragraphChangeId) && null !== optionalStrictString(node.attrs.paragraphChangeActorId) && strictString(node.attrs.paragraphChangeAuthor) && strictString(node.attrs.paragraphChangeDate) && parseDocumentParagraphFormatting(node.attrs.paragraphChangeBefore));
|
|
20847
21099
|
}
|
|
21100
|
+
function strictNumberingChange(node) {
|
|
21101
|
+
const kind = node.attrs.numberingChangeKind;
|
|
21102
|
+
const fields = [
|
|
21103
|
+
node.attrs.numberingChangeId,
|
|
21104
|
+
node.attrs.numberingChangeActorId,
|
|
21105
|
+
node.attrs.numberingChangeAuthor,
|
|
21106
|
+
node.attrs.numberingChangeDate,
|
|
21107
|
+
node.attrs.numberingChangeBefore
|
|
21108
|
+
];
|
|
21109
|
+
if ('numbering' !== kind) return (null == kind || '' === kind) && fields.every((field)=>null == field || '' === field);
|
|
21110
|
+
return Boolean(strictString(node.attrs.numberingChangeId) && null !== optionalStrictString(node.attrs.numberingChangeActorId) && strictString(node.attrs.numberingChangeAuthor) && strictString(node.attrs.numberingChangeDate) && parseDocumentNumberingChange(node.attrs.numberingChangeBefore));
|
|
21111
|
+
}
|
|
20848
21112
|
const DOCUMENT_CONTENT_ROOT = 'document.content';
|
|
20849
21113
|
const MAX_DOCUMENT_COMMENT_HISTORY = 100;
|
|
20850
21114
|
const mountedDocumentBindings = new WeakMap();
|
|
@@ -21541,7 +21805,7 @@ async function importWorkDocumentFile(file, extension, context) {
|
|
|
21541
21805
|
recordDocumentImportMeasure('a3s-office.document.mammoth', mammothStartedAt, documentImportNow());
|
|
21542
21806
|
context?.controller.report('parsing', 0.8);
|
|
21543
21807
|
const markersStartedAt = documentImportNow();
|
|
21544
|
-
html = prepared ? applyDocxSectionsToHtml(result.value, prepared.sections, prepared.captionMarkers, prepared.bookmarkMarkers, prepared.changeMarkers, prepared.commentMarkers, prepared.fieldMarkers, prepared.tableOfContentsMarkers, prepared.indexMarkers, prepared.equationMarkers, prepared.citationMarkers, prepared.listMarkers, prepared.imageLayoutMarkers, prepared.paragraphIdentityMarkers, prepared.paragraphFormattingChangeMarkers, prepared.paragraphAlignmentMarkers, prepared.runFormattingMarkers, prepared.paragraphDirectionMarkers, prepared.paragraphIndentMarkers, prepared.paragraphSpacingMarkers, prepared.paragraphBorderMarkers, prepared.paragraphShadingMarkers, prepared.paragraphPaginationMarkers, prepared.bibliography, prepared.tabStopMarkers, prepared.tableCellMarkers, prepared.tableRowMarkers, prepared.tableSizingMarkers) : result.value;
|
|
21808
|
+
html = prepared ? applyDocxSectionsToHtml(result.value, prepared.sections, prepared.captionMarkers, prepared.bookmarkMarkers, prepared.changeMarkers, prepared.commentMarkers, prepared.fieldMarkers, prepared.tableOfContentsMarkers, prepared.indexMarkers, prepared.equationMarkers, prepared.citationMarkers, prepared.listMarkers, prepared.numberingChangeMarkers, prepared.imageLayoutMarkers, prepared.paragraphIdentityMarkers, prepared.paragraphFormattingChangeMarkers, prepared.paragraphAlignmentMarkers, prepared.runFormattingMarkers, prepared.paragraphDirectionMarkers, prepared.paragraphIndentMarkers, prepared.paragraphSpacingMarkers, prepared.paragraphBorderMarkers, prepared.paragraphShadingMarkers, prepared.paragraphPaginationMarkers, prepared.bibliography, prepared.tabStopMarkers, prepared.tableCellMarkers, prepared.tableRowMarkers, prepared.tableSizingMarkers) : result.value;
|
|
21545
21809
|
recordDocumentImportMeasure('a3s-office.document.markers', markersStartedAt, documentImportNow());
|
|
21546
21810
|
const layout = prepared ? {
|
|
21547
21811
|
...documentContentLayoutProperties(prepared.sections[0].layout),
|
|
@@ -21739,4 +22003,4 @@ function registerDocumentPageSurfaceGeometry(element, provider) {
|
|
|
21739
22003
|
function documentPageSurfaceGeometryForElement(element) {
|
|
21740
22004
|
return documentPageSurfaceProviders.get(element)?.() ?? null;
|
|
21741
22005
|
}
|
|
21742
|
-
export { DEFAULT_DOCUMENT_TABLE_CELL_FORMAT, DEFAULT_DOCUMENT_TABLE_CELL_MARGINS, DEFAULT_DOCUMENT_TABLE_GEOMETRY, DOCUMENT_BOOKMARK_DUPLICATE_MESSAGE, DOCUMENT_CHUNK_HYDRATION_META, DOCUMENT_CHUNK_PAGINATION_META, DOCUMENT_CHUNK_VISIBLE_IDS_META, DOCUMENT_LEGACY_TEXT_EFFECT_NAMES, DOCUMENT_LEGACY_TEXT_EMBOSS_ATTRIBUTE, DOCUMENT_LEGACY_TEXT_IMPRINT_ATTRIBUTE, DOCUMENT_LEGACY_TEXT_OUTLINE_ATTRIBUTE, DOCUMENT_LEGACY_TEXT_SHADOW_ATTRIBUTE, DOCUMENT_OPEN_TYPE_ATTRIBUTE, DOCUMENT_PAGE_BORDER_EDGES, DOCUMENT_PAGE_MARGIN_KEYS, DOCUMENT_PARAGRAPH_CHANGE_ATTRIBUTES, DOCUMENT_PARAGRAPH_FORMAT_ATTRIBUTES, DOCUMENT_STRIKE_STYLE_ATTRIBUTE, DOCUMENT_TABLE_ROW_ID_ATTRIBUTE, DOCUMENT_TABLE_ROW_TEXT_ID_ATTRIBUTE, DOCUMENT_TABLE_STYLE_OPTIONS, DOCUMENT_UNDERLINE_STYLE_ATTRIBUTE, DocumentCharacterFormatting, DocumentEquation, DocumentFontFamily, DocumentHighlight, DocumentImage, DocumentParagraphFormatting, DocumentScriptFontFormatting, DocumentStrike, DocumentSubscript, DocumentSuperscript, DocumentTableRowIdentity, DocumentTextStyle, DocumentUnderline, MAX_DOCUMENT_IMAGE_RELATIVE_HEIGHT, MAX_DOCUMENT_NUMBERING_START, activeDocumentBookmark, activeDocumentSection, activeDocumentTableStyle, applyDocumentImageCropToElement, applyDocumentImageIdentityToElement, applyDocumentImageLayerToElement, applyDocumentImageWrapContourToElement, applyDocumentPageGeometry, applyDocumentTableGeometryToElement, applyDocumentTableRowIdentityToElement, applyDocumentTextCaseStyle, canChangeDocumentIndent, canInsertDocumentComment, canSetDocumentTableRowRepeatHeader, clampDocumentMargin, collectDocumentChanges, collectDocumentCommentAnchors, collectDocumentNotes, collectDocumentTextLayoutParagraphs, createDocumentBibliography, createDocumentEquationElement, createDocumentImageIdentityRegistry, createDocumentNoteElement, createSchemaDerivedWorkDocumentModel, createWorkDocumentBlob, createWorkDocumentExtensions, createWorkDocumentModel, createWorkOfficeDocumentCollaborationBinding as createOfficeDocumentCollaborationBinding, defaultDocumentImageWrapContour, documentAutoLineHeight, documentBookmarkNameExists, documentBookmarkReferenceInstruction, documentBulletListStyle, documentCaptionKind, documentCaptionLabel, documentCharacterPositionDomAttributes, documentCharacterPositionHalfPointsFromElement, documentCharacterPositionPoints, documentCharacterScaleDomAttributes, documentCharacterScalePercentFromElement, documentCharacterSpacingDomAttributes, documentCharacterSpacingPoints, documentCharacterSpacingTwipsFromElement, documentChunkMountedIds, documentCitationCount, documentCitationInstruction, documentCitationStyle, documentCitationStyleDetails, documentCitationTags, documentCitationTagsFromInstruction, documentCommentDraftRange, documentCommentViews, documentContentLayoutProperties, documentEmphasisMarkDomAttributes, documentEmphasisMarkFromElement, documentEquationFromElement, documentEquationText, documentHasIndex, documentHasTableOfContents, documentHiddenTextDomAttributes, documentHiddenTextFromElement, documentHiddenTextKeyboardShortcut, documentImageCropFromElement, documentImageIdentityFromElement, documentImageLayerFromElement, documentImageLayoutFromElement, documentImageLayoutOptions, documentImagePositionFromElement, documentImageProperties, documentImageWrapContourFromElement, documentInitialSectionLayout, documentKerningDomAttributes, documentKerningIsEffective, documentKerningThresholdHalfPointsFromElement, documentKerningThresholdPoints, documentLazyHtmlChunkFragment, documentLazyHtmlProjection, documentLazyHtmlProjectionFingerprint, documentLegacyTextEffectsConflict, documentLegacyTextEffectsCss, documentLegacyTextEffectsDomAttributes, documentLegacyTextEffectsFromElement, documentLegacyTextEffectsFromTextStyleAttributes, documentModelForContent, documentModelForHtml, documentModelHasTrustedInitialIntegrityFeatures, documentModelUsesWindowing, documentNoteKey, documentNoteKind, documentOpenTypeCssProperties, documentOpenTypeDomAttributes, documentOpenTypeFeaturesFromElement, documentOrderedListState, documentPageBordersVisible, documentPageChromeLegacyFields, documentPageGeometryForLayout, documentPageHorizontalMarginTwips, documentPageMarginBody, documentPageMarginsForLayout, documentPageMetrics, documentPageSurfaceGeometryForElement, documentPaperSizeForGeometry, documentParagraphDirection, documentParagraphIndent, documentParagraphPagination, documentParagraphSpacing, documentParagraphTabStops, documentSectionById, documentSectionDomAttributes, documentSections, documentStrikeDomAttributes, documentStrikeFormattingFromElement, documentStrikeStyle, documentTabLeaderLabel, documentTableBordersFromElement, documentTableCellFormat, documentTableCellMarginOverridesFromElement, documentTableColumnPercentagesFromElement, documentTableGeometryFromElement, documentTableHorizontalAlignment, documentTableRowIdentityFromElement, documentTableRowOptions, documentTableSizing, documentTextCaseFromWordFlags, documentTextCaseKeyboardShortcuts, documentTextLayoutBatches, documentTextStatistics, documentTransactionsOnlyHydrateChunks, documentUnderlineColor, documentUnderlineDomAttributes, documentUnderlineFormattingFromElement, documentUnderlineKeyboardShortcuts, documentUnderlineStyle, documentWordLineHeightFactor, docxBookmarkReferenceTarget, docxDocumentFieldKind, editorDocumentBookmarkReferenceTargets, editorDocumentCaptionTargets, fileNameWithoutExtension, forgetWorkSourceBlob as forgetSourceBlob, importWorkDocumentFile, importedDocumentCharacterFormatting, initializeWorkOfficeDocumentCollaboration as initializeOfficeDocumentCollaboration, invalidateDocumentLazyHtmlProjection, isContourImageLayout, isDocumentCharacterFormatMark, isDocumentOpenTypeFeaturePatch, isValidDocumentCitationTag, materializeLazyDocumentEditorRoot, measureDocumentLayoutBlocksIncrementally, millimetersToPixels, mountWorkLiveDocumentCapture, moveWorkSourceBlob, nextDocumentTabAlignment, normalizeDocumentBookmarkName, normalizeDocumentBookmarkNativeId, normalizeDocumentBookmarkReferencesHtml, normalizeDocumentBookmarksHtml, normalizeDocumentCaptionsHtml, normalizeDocumentCharacterPositionHalfPoints, normalizeDocumentCharacterScalePercent, normalizeDocumentCharacterSpacingTwips, normalizeDocumentCitationsHtml, normalizeDocumentColumns, normalizeDocumentEmphasisMark, normalizeDocumentEquation, normalizeDocumentFieldsHtml, normalizeDocumentHiddenText, normalizeDocumentHtml, normalizeDocumentImageAlignment, normalizeDocumentImageCrop, normalizeDocumentImageIdentity, normalizeDocumentImageLayer, normalizeDocumentImageLayoutOptions, normalizeDocumentImagePosition, normalizeDocumentImageWrapContour, normalizeDocumentImageWrapSide, normalizeDocumentKerningThresholdHalfPoints, normalizeDocumentLegacyTextEffect, normalizeDocumentLegacyTextEffects, normalizeDocumentNotesHtml, normalizeDocumentOpenTypeFeatures, normalizeDocumentOpenTypeLigatures, normalizeDocumentOpenTypeNumberForm, normalizeDocumentOpenTypeNumberSpacing, normalizeDocumentOpenTypeStylisticSets, normalizeDocumentPageBorders, normalizeDocumentPageChrome, normalizeDocumentPageGeometry, normalizeDocumentPageMargins, normalizeDocumentPaperSource, normalizeDocumentParagraphIndent, normalizeDocumentStrikeStyle, normalizeDocumentTabStops, normalizeDocumentTableBorderStyle, normalizeDocumentTableBorderWidth, normalizeDocumentTableRowHeightRule, normalizeDocumentTableRowIdentity, normalizeDocumentTableVerticalAlign, normalizeDocumentTextCase, normalizeDocumentUnderlineColor, normalizeDocumentUnderlineStyle, normalizeTableColor, normalizedTabPosition, pageTwipsToMillimeters, parseDocumentCharacterFormatting, parseDocumentOpenTypeFeatures, parseDocumentParagraphFormatting, patchDocumentLazyHtmlProjection, patchDocumentOpenTypeFeatures, positionWorkLiveDocumentCapture, readWorkOfficeDocumentCollaboration as readOfficeDocumentCollaboration, readWorkSourceBlob as readSourceBlob, registerDocumentPageSurfaceGeometry, rememberWorkSourceBlob as registerSourceBlob, renderDocumentAutoLineHeight, renderDocumentTableBorders, renderDocumentTableCellMarginOverrides, resolveAllDocumentChanges, resolveDocumentPageBorders, resolveDocumentPageChrome, resolveDocumentPageMargins, resolveDocumentPageSize, resolveWorkDocumentEditorInput, retainAnchoredDocumentComments, sanitizeDocumentPageChromeHtml, selectedDocumentChunkId, selectedDocumentIndexDraft, selectedDocumentIndexEntry, selectedDocumentIndexOptions, selectedDocumentTableOfContentsOptions, serializeDocumentCharacterFormatting, serializeDocumentOpenTypeFeatures, serializeDocumentParagraphFormatting, serializeDocumentTabStops, serializeWorkDocumentNode, setCustomDocumentColumns, supportedDocxBookmarkReferenceInstruction, syncDocumentContentFromHtml, transferChangedDocumentTextStatistics, uniqueDocumentImageIdentity, updateDocumentColumnWidth, updateDocumentCustomPageMillimeters, updateDocumentGutterPosition, updateDocumentMirrorMargins, updateDocumentPageChromeVariant, updateDocumentPageMarginMillimeters, updateDocumentPageMarginMode, updateDocumentPageOrientation, updateDocumentPaperSizePreset, validateDocumentBookmarkName, windowDocumentModel, workDocumentSchema, workOfficeDocumentCollaborationFragment as officeDocumentCollaborationFragment, work_document_model_codec_createWorkDocumentModelFromContent as createWorkDocumentModelFromContent, work_document_model_codec_materializeWorkDocumentContent as materializeWorkDocumentContent, work_document_model_createSchemaValidatedWorkDocumentModel as createSchemaValidatedWorkDocumentModel, work_document_page_margins_twipsToMillimeters, work_file_download_downloadBlob, work_file_download_safeFileName, wrapsBesideImage };
|
|
22006
|
+
export { DEFAULT_DOCUMENT_TABLE_CELL_FORMAT, DEFAULT_DOCUMENT_TABLE_CELL_MARGINS, DEFAULT_DOCUMENT_TABLE_GEOMETRY, DOCUMENT_BOOKMARK_DUPLICATE_MESSAGE, DOCUMENT_CHUNK_HYDRATION_META, DOCUMENT_CHUNK_PAGINATION_META, DOCUMENT_CHUNK_VISIBLE_IDS_META, DOCUMENT_LEGACY_TEXT_EFFECT_NAMES, DOCUMENT_LEGACY_TEXT_EMBOSS_ATTRIBUTE, DOCUMENT_LEGACY_TEXT_IMPRINT_ATTRIBUTE, DOCUMENT_LEGACY_TEXT_OUTLINE_ATTRIBUTE, DOCUMENT_LEGACY_TEXT_SHADOW_ATTRIBUTE, DOCUMENT_OPEN_TYPE_ATTRIBUTE, DOCUMENT_PAGE_BORDER_EDGES, DOCUMENT_PAGE_MARGIN_KEYS, DOCUMENT_PARAGRAPH_CHANGE_ATTRIBUTES, DOCUMENT_PARAGRAPH_FORMAT_ATTRIBUTES, DOCUMENT_STRIKE_STYLE_ATTRIBUTE, DOCUMENT_TABLE_ROW_ID_ATTRIBUTE, DOCUMENT_TABLE_ROW_TEXT_ID_ATTRIBUTE, DOCUMENT_TABLE_STYLE_OPTIONS, DOCUMENT_UNDERLINE_STYLE_ATTRIBUTE, DocumentCharacterFormatting, DocumentEquation, DocumentFontFamily, DocumentHighlight, DocumentImage, DocumentParagraphFormatting, DocumentScriptFontFormatting, DocumentStrike, DocumentSubscript, DocumentSuperscript, DocumentTableRowIdentity, DocumentTextStyle, DocumentUnderline, MAX_DOCUMENT_IMAGE_RELATIVE_HEIGHT, MAX_DOCUMENT_NUMBERING_START, activeDocumentBookmark, activeDocumentSection, activeDocumentTableStyle, applyDocumentImageCropToElement, applyDocumentImageIdentityToElement, applyDocumentImageLayerToElement, applyDocumentImageWrapContourToElement, applyDocumentPageGeometry, applyDocumentTableGeometryToElement, applyDocumentTableRowIdentityToElement, applyDocumentTextCaseStyle, canChangeDocumentIndent, canInsertDocumentComment, canSetDocumentTableRowRepeatHeader, clampDocumentMargin, collectDocumentChanges, collectDocumentCommentAnchors, collectDocumentNotes, collectDocumentTextLayoutParagraphs, createDocumentBibliography, createDocumentEquationElement, createDocumentImageIdentityRegistry, createDocumentNoteElement, createSchemaDerivedWorkDocumentModel, createWorkDocumentBlob, createWorkDocumentExtensions, createWorkDocumentModel, createWorkOfficeDocumentCollaborationBinding as createOfficeDocumentCollaborationBinding, defaultDocumentImageWrapContour, documentAutoLineHeight, documentBookmarkNameExists, documentBookmarkReferenceInstruction, documentBulletListStyle, documentCaptionKind, documentCaptionLabel, documentCharacterPositionDomAttributes, documentCharacterPositionHalfPointsFromElement, documentCharacterPositionPoints, documentCharacterScaleDomAttributes, documentCharacterScalePercentFromElement, documentCharacterSpacingDomAttributes, documentCharacterSpacingPoints, documentCharacterSpacingTwipsFromElement, documentChunkMountedIds, documentCitationCount, documentCitationInstruction, documentCitationStyle, documentCitationStyleDetails, documentCitationTags, documentCitationTagsFromInstruction, documentCommentDraftRange, documentCommentViews, documentContentLayoutProperties, documentEmphasisMarkDomAttributes, documentEmphasisMarkFromElement, documentEquationFromElement, documentEquationText, documentHasIndex, documentHasTableOfContents, documentHiddenTextDomAttributes, documentHiddenTextFromElement, documentHiddenTextKeyboardShortcut, documentImageCropFromElement, documentImageIdentityFromElement, documentImageLayerFromElement, documentImageLayoutFromElement, documentImageLayoutOptions, documentImagePositionFromElement, documentImageProperties, documentImageWrapContourFromElement, documentInitialSectionLayout, documentKerningDomAttributes, documentKerningIsEffective, documentKerningThresholdHalfPointsFromElement, documentKerningThresholdPoints, documentLazyHtmlChunkFragment, documentLazyHtmlProjection, documentLazyHtmlProjectionFingerprint, documentLegacyTextEffectsConflict, documentLegacyTextEffectsCss, documentLegacyTextEffectsDomAttributes, documentLegacyTextEffectsFromElement, documentLegacyTextEffectsFromTextStyleAttributes, documentModelForContent, documentModelForHtml, documentModelHasTrustedInitialIntegrityFeatures, documentModelUsesWindowing, documentNoteKey, documentNoteKind, documentOpenTypeCssProperties, documentOpenTypeDomAttributes, documentOpenTypeFeaturesFromElement, documentOrderedListState, documentPageBordersVisible, documentPageChromeLegacyFields, documentPageGeometryForLayout, documentPageHorizontalMarginTwips, documentPageMarginBody, documentPageMarginsForLayout, documentPageMetrics, documentPageSurfaceGeometryForElement, documentPaperSizeForGeometry, documentParagraphDirection, documentParagraphIndent, documentParagraphPagination, documentParagraphSpacing, documentParagraphTabStops, documentSectionById, documentSectionDomAttributes, documentSections, documentStrikeDomAttributes, documentStrikeFormattingFromElement, documentStrikeStyle, documentTabLeaderLabel, documentTableBordersFromElement, documentTableCellFormat, documentTableCellMarginOverridesFromElement, documentTableColumnPercentagesFromElement, documentTableGeometryFromElement, documentTableHorizontalAlignment, documentTableRowIdentityFromElement, documentTableRowOptions, documentTableSizing, documentTextCaseFromWordFlags, documentTextCaseKeyboardShortcuts, documentTextLayoutBatches, documentTextStatistics, documentTransactionsOnlyHydrateChunks, documentUnderlineColor, documentUnderlineDomAttributes, documentUnderlineFormattingFromElement, documentUnderlineKeyboardShortcuts, documentUnderlineStyle, documentWordLineHeightFactor, docxBookmarkReferenceTarget, docxDocumentFieldKind, editorDocumentBookmarkReferenceTargets, editorDocumentCaptionTargets, fileNameWithoutExtension, forgetWorkSourceBlob as forgetSourceBlob, importWorkDocumentFile, importedDocumentCharacterFormatting, initializeWorkOfficeDocumentCollaboration as initializeOfficeDocumentCollaboration, invalidateDocumentLazyHtmlProjection, isContourImageLayout, isDocumentCharacterFormatMark, isDocumentOpenTypeFeaturePatch, isValidDocumentCitationTag, materializeLazyDocumentEditorRoot, measureDocumentLayoutBlocksIncrementally, millimetersToPixels, mountWorkLiveDocumentCapture, moveWorkSourceBlob, nextDocumentTabAlignment, normalizeDocumentBookmarkName, normalizeDocumentBookmarkNativeId, normalizeDocumentBookmarkReferencesHtml, normalizeDocumentBookmarksHtml, normalizeDocumentCaptionsHtml, normalizeDocumentCharacterPositionHalfPoints, normalizeDocumentCharacterScalePercent, normalizeDocumentCharacterSpacingTwips, normalizeDocumentCitationsHtml, normalizeDocumentColumns, normalizeDocumentEmphasisMark, normalizeDocumentEquation, normalizeDocumentFieldsHtml, normalizeDocumentHiddenText, normalizeDocumentHtml, normalizeDocumentImageAlignment, normalizeDocumentImageCrop, normalizeDocumentImageIdentity, normalizeDocumentImageLayer, normalizeDocumentImageLayoutOptions, normalizeDocumentImagePosition, normalizeDocumentImageWrapContour, normalizeDocumentImageWrapSide, normalizeDocumentKerningThresholdHalfPoints, normalizeDocumentLegacyTextEffect, normalizeDocumentLegacyTextEffects, normalizeDocumentNotesHtml, normalizeDocumentOpenTypeFeatures, normalizeDocumentOpenTypeLigatures, normalizeDocumentOpenTypeNumberForm, normalizeDocumentOpenTypeNumberSpacing, normalizeDocumentOpenTypeStylisticSets, normalizeDocumentPageBorders, normalizeDocumentPageChrome, normalizeDocumentPageGeometry, normalizeDocumentPageMargins, normalizeDocumentPaperSource, normalizeDocumentParagraphIndent, normalizeDocumentStrikeStyle, normalizeDocumentTabStops, normalizeDocumentTableBorderStyle, normalizeDocumentTableBorderWidth, normalizeDocumentTableRowHeightRule, normalizeDocumentTableRowIdentity, normalizeDocumentTableVerticalAlign, normalizeDocumentTextCase, normalizeDocumentUnderlineColor, normalizeDocumentUnderlineStyle, normalizeTableColor, normalizedTabPosition, numberingTypeFromFormat, pageTwipsToMillimeters, parseDocumentCharacterFormatting, parseDocumentNumberingChange, parseDocumentOpenTypeFeatures, parseDocumentParagraphFormatting, patchDocumentLazyHtmlProjection, patchDocumentOpenTypeFeatures, positionWorkLiveDocumentCapture, readWorkOfficeDocumentCollaboration as readOfficeDocumentCollaboration, readWorkSourceBlob as readSourceBlob, registerDocumentPageSurfaceGeometry, rememberWorkSourceBlob as registerSourceBlob, renderDocumentAutoLineHeight, renderDocumentTableBorders, renderDocumentTableCellMarginOverrides, resolveAllDocumentChanges, resolveDocumentPageBorders, resolveDocumentPageChrome, resolveDocumentPageMargins, resolveDocumentPageSize, resolveWorkDocumentEditorInput, retainAnchoredDocumentComments, sanitizeDocumentPageChromeHtml, selectedDocumentChunkId, selectedDocumentIndexDraft, selectedDocumentIndexEntry, selectedDocumentIndexOptions, selectedDocumentTableOfContentsOptions, serializeDocumentCharacterFormatting, serializeDocumentNumberingChange, serializeDocumentOpenTypeFeatures, serializeDocumentParagraphFormatting, serializeDocumentTabStops, serializeWorkDocumentNode, setCustomDocumentColumns, supportedDocxBookmarkReferenceInstruction, syncDocumentContentFromHtml, transferChangedDocumentTextStatistics, uniqueDocumentImageIdentity, updateDocumentColumnWidth, updateDocumentCustomPageMillimeters, updateDocumentGutterPosition, updateDocumentMirrorMargins, updateDocumentPageChromeVariant, updateDocumentPageMarginMillimeters, updateDocumentPageMarginMode, updateDocumentPageOrientation, updateDocumentPaperSizePreset, validateDocumentBookmarkName, windowDocumentModel, workDocumentSchema, workOfficeDocumentCollaborationFragment as officeDocumentCollaborationFragment, work_document_model_codec_createWorkDocumentModelFromContent as createWorkDocumentModelFromContent, work_document_model_codec_materializeWorkDocumentContent as materializeWorkDocumentContent, work_document_model_createSchemaValidatedWorkDocumentModel as createSchemaValidatedWorkDocumentModel, work_document_page_margins_twipsToMillimeters, work_file_download_downloadBlob, work_file_download_safeFileName, wrapsBesideImage };
|