superdoc 2.0.0-next.41 → 2.0.0-next.42
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/chunks/{create-super-doc-ui-CiXQlr9Z.es.js → create-super-doc-ui-BFz0iim0.es.js} +254 -1
- package/dist/chunks/{create-super-doc-ui-DZUTje3N.cjs → create-super-doc-ui-DYky1UEo.cjs} +257 -1
- package/dist/collaboration-upgrade-engine.cjs +1 -1
- package/dist/collaboration-upgrade-engine.es.js +1 -1
- package/dist/document-api/src/templates/apply.d.ts +0 -1
- package/dist/public/ui-react.cjs +1 -1
- package/dist/public/ui-react.es.js +1 -1
- package/dist/public/ui.cjs +1 -1
- package/dist/public/ui.es.js +1 -1
- package/dist/style.css +5 -5
- package/dist/style.layered.css +5 -5
- package/dist/superdoc/src/core/types/index.d.ts +4 -1
- package/dist/superdoc.cjs +9 -9
- package/dist/superdoc.es.js +9 -9
- package/dist-cdn/style.layered.css +1 -1
- package/dist-cdn/superdoc.min.css +1 -1
- package/dist-cdn/superdoc.min.js +35 -35
- package/package.json +2 -2
package/dist/chunks/{create-super-doc-ui-CiXQlr9Z.es.js → create-super-doc-ui-BFz0iim0.es.js}
RENAMED
|
@@ -1230,6 +1230,257 @@ const decodeLayoutStoryDataset = (raw) => {
|
|
|
1230
1230
|
};
|
|
1231
1231
|
`${DOM_CLASS_NAMES.BLOCK_SDT}${DATA_ATTRS.SDT_ID}`;
|
|
1232
1232
|
`${DATA_ATTRS.DRAGGABLE}`;
|
|
1233
|
+
var schemaBooleanOrNull = () => ({ oneOf: [{ type: "boolean" }, { type: "null" }] });
|
|
1234
|
+
var schemaStringOrNull = () => ({ oneOf: [{
|
|
1235
|
+
type: "string",
|
|
1236
|
+
minLength: 1
|
|
1237
|
+
}, { type: "null" }] });
|
|
1238
|
+
var schemaNumberOrNull = () => ({ oneOf: [{ type: "number" }, { type: "null" }] });
|
|
1239
|
+
var schemaObjectOrNull = (properties) => ({ oneOf: [{
|
|
1240
|
+
type: "object",
|
|
1241
|
+
properties,
|
|
1242
|
+
additionalProperties: false,
|
|
1243
|
+
minProperties: 1
|
|
1244
|
+
}, { type: "null" }] });
|
|
1245
|
+
var UNDERLINE_OBJECT_SCHEMA = {
|
|
1246
|
+
type: "object",
|
|
1247
|
+
properties: {
|
|
1248
|
+
style: { oneOf: [{
|
|
1249
|
+
type: "string",
|
|
1250
|
+
minLength: 1
|
|
1251
|
+
}, { type: "null" }] },
|
|
1252
|
+
color: { oneOf: [{
|
|
1253
|
+
type: "string",
|
|
1254
|
+
minLength: 1
|
|
1255
|
+
}, { type: "null" }] },
|
|
1256
|
+
themeColor: { oneOf: [{
|
|
1257
|
+
type: "string",
|
|
1258
|
+
minLength: 1
|
|
1259
|
+
}, { type: "null" }] }
|
|
1260
|
+
},
|
|
1261
|
+
additionalProperties: false,
|
|
1262
|
+
minProperties: 1
|
|
1263
|
+
};
|
|
1264
|
+
var STYLISTIC_SET_ITEM_SCHEMA = {
|
|
1265
|
+
type: "object",
|
|
1266
|
+
properties: {
|
|
1267
|
+
id: { type: "number" },
|
|
1268
|
+
val: { type: "boolean" }
|
|
1269
|
+
},
|
|
1270
|
+
required: ["id"],
|
|
1271
|
+
additionalProperties: false
|
|
1272
|
+
};
|
|
1273
|
+
var schemaUnderlinePatch = () => ({ oneOf: [
|
|
1274
|
+
{ type: "boolean" },
|
|
1275
|
+
{ type: "null" },
|
|
1276
|
+
UNDERLINE_OBJECT_SCHEMA
|
|
1277
|
+
] });
|
|
1278
|
+
var schemaStylisticSets = () => ({ oneOf: [{
|
|
1279
|
+
type: "array",
|
|
1280
|
+
items: STYLISTIC_SET_ITEM_SCHEMA,
|
|
1281
|
+
minItems: 1
|
|
1282
|
+
}, { type: "null" }] });
|
|
1283
|
+
function markCarrier(markName, textStyleAttr) {
|
|
1284
|
+
return {
|
|
1285
|
+
storage: "mark",
|
|
1286
|
+
markName,
|
|
1287
|
+
textStyleAttr
|
|
1288
|
+
};
|
|
1289
|
+
}
|
|
1290
|
+
function runAttributeCarrier(runPropertyKey) {
|
|
1291
|
+
return {
|
|
1292
|
+
storage: "runAttribute",
|
|
1293
|
+
nodeName: "run",
|
|
1294
|
+
runPropertyKey
|
|
1295
|
+
};
|
|
1296
|
+
}
|
|
1297
|
+
var markBoolean = (key, ooxmlElement, markName) => ({
|
|
1298
|
+
key,
|
|
1299
|
+
type: "boolean",
|
|
1300
|
+
ooxmlElement,
|
|
1301
|
+
storage: "mark",
|
|
1302
|
+
tracked: true,
|
|
1303
|
+
carrier: markCarrier(markName),
|
|
1304
|
+
schema: schemaBooleanOrNull()
|
|
1305
|
+
});
|
|
1306
|
+
var markTextStyleValue = (key, type, ooxmlElement, schema, textStyleAttr) => ({
|
|
1307
|
+
key,
|
|
1308
|
+
type,
|
|
1309
|
+
ooxmlElement,
|
|
1310
|
+
storage: "mark",
|
|
1311
|
+
tracked: true,
|
|
1312
|
+
carrier: markCarrier("textStyle", textStyleAttr ?? key),
|
|
1313
|
+
schema
|
|
1314
|
+
});
|
|
1315
|
+
var runAttribute = (key, type, ooxmlElement, schema, runPropertyKey) => ({
|
|
1316
|
+
key,
|
|
1317
|
+
type,
|
|
1318
|
+
ooxmlElement,
|
|
1319
|
+
storage: "runAttribute",
|
|
1320
|
+
tracked: false,
|
|
1321
|
+
carrier: runAttributeCarrier(runPropertyKey ?? key),
|
|
1322
|
+
schema
|
|
1323
|
+
});
|
|
1324
|
+
const INLINE_PROPERTY_REGISTRY = [
|
|
1325
|
+
markBoolean("bold", "w:b", "bold"),
|
|
1326
|
+
markBoolean("italic", "w:i", "italic"),
|
|
1327
|
+
markBoolean("strike", "w:strike", "strike"),
|
|
1328
|
+
{
|
|
1329
|
+
key: "underline",
|
|
1330
|
+
type: "object",
|
|
1331
|
+
ooxmlElement: "w:u",
|
|
1332
|
+
storage: "mark",
|
|
1333
|
+
tracked: true,
|
|
1334
|
+
carrier: markCarrier("underline"),
|
|
1335
|
+
schema: schemaUnderlinePatch()
|
|
1336
|
+
},
|
|
1337
|
+
{
|
|
1338
|
+
key: "highlight",
|
|
1339
|
+
type: "string",
|
|
1340
|
+
ooxmlElement: "w:highlight",
|
|
1341
|
+
storage: "mark",
|
|
1342
|
+
tracked: true,
|
|
1343
|
+
carrier: markCarrier("highlight"),
|
|
1344
|
+
schema: schemaStringOrNull()
|
|
1345
|
+
},
|
|
1346
|
+
markTextStyleValue("color", "string", "w:color", schemaStringOrNull()),
|
|
1347
|
+
markTextStyleValue("fontSize", "number", "w:sz", schemaNumberOrNull()),
|
|
1348
|
+
markTextStyleValue("fontFamily", "string", "w:rFonts", schemaStringOrNull()),
|
|
1349
|
+
markTextStyleValue("letterSpacing", "number", "w:spacing", schemaNumberOrNull()),
|
|
1350
|
+
markTextStyleValue("vertAlign", "string", "w:vertAlign", { oneOf: [{ enum: [
|
|
1351
|
+
"superscript",
|
|
1352
|
+
"subscript",
|
|
1353
|
+
"baseline"
|
|
1354
|
+
] }, { type: "null" }] }),
|
|
1355
|
+
markTextStyleValue("position", "number", "w:position", schemaNumberOrNull()),
|
|
1356
|
+
runAttribute("dstrike", "boolean", "w:dstrike", schemaBooleanOrNull()),
|
|
1357
|
+
runAttribute("smallCaps", "boolean", "w:smallCaps", schemaBooleanOrNull()),
|
|
1358
|
+
markTextStyleValue("caps", "boolean", "w:caps", schemaBooleanOrNull(), "textTransform"),
|
|
1359
|
+
runAttribute("shading", "object", "w:shd", schemaObjectOrNull({
|
|
1360
|
+
fill: { oneOf: [{
|
|
1361
|
+
type: "string",
|
|
1362
|
+
minLength: 1
|
|
1363
|
+
}, { type: "null" }] },
|
|
1364
|
+
color: { oneOf: [{
|
|
1365
|
+
type: "string",
|
|
1366
|
+
minLength: 1
|
|
1367
|
+
}, { type: "null" }] },
|
|
1368
|
+
val: { oneOf: [{
|
|
1369
|
+
type: "string",
|
|
1370
|
+
minLength: 1
|
|
1371
|
+
}, { type: "null" }] }
|
|
1372
|
+
})),
|
|
1373
|
+
runAttribute("border", "object", "w:bdr", schemaObjectOrNull({
|
|
1374
|
+
val: { oneOf: [{
|
|
1375
|
+
type: "string",
|
|
1376
|
+
minLength: 1
|
|
1377
|
+
}, { type: "null" }] },
|
|
1378
|
+
sz: { oneOf: [{ type: "number" }, { type: "null" }] },
|
|
1379
|
+
color: { oneOf: [{
|
|
1380
|
+
type: "string",
|
|
1381
|
+
minLength: 1
|
|
1382
|
+
}, { type: "null" }] },
|
|
1383
|
+
space: { oneOf: [{ type: "number" }, { type: "null" }] }
|
|
1384
|
+
}), "borders"),
|
|
1385
|
+
runAttribute("outline", "boolean", "w:outline", schemaBooleanOrNull()),
|
|
1386
|
+
runAttribute("shadow", "boolean", "w:shadow", schemaBooleanOrNull()),
|
|
1387
|
+
runAttribute("emboss", "boolean", "w:emboss", schemaBooleanOrNull()),
|
|
1388
|
+
runAttribute("imprint", "boolean", "w:imprint", schemaBooleanOrNull()),
|
|
1389
|
+
runAttribute("charScale", "number", "w:w", schemaNumberOrNull(), "w"),
|
|
1390
|
+
runAttribute("kerning", "number", "w:kern", schemaNumberOrNull(), "kern"),
|
|
1391
|
+
runAttribute("vanish", "boolean", "w:vanish", schemaBooleanOrNull()),
|
|
1392
|
+
runAttribute("webHidden", "boolean", "w:webHidden", schemaBooleanOrNull()),
|
|
1393
|
+
runAttribute("specVanish", "boolean", "w:specVanish", schemaBooleanOrNull()),
|
|
1394
|
+
runAttribute("rtl", "boolean", "w:rtl", schemaBooleanOrNull()),
|
|
1395
|
+
runAttribute("cs", "boolean", "w:cs", schemaBooleanOrNull()),
|
|
1396
|
+
runAttribute("bCs", "boolean", "w:bCs", schemaBooleanOrNull(), "boldCs"),
|
|
1397
|
+
runAttribute("iCs", "boolean", "w:iCs", schemaBooleanOrNull(), "italicCs"),
|
|
1398
|
+
runAttribute("eastAsianLayout", "object", "w:eastAsianLayout", schemaObjectOrNull({
|
|
1399
|
+
id: { oneOf: [{
|
|
1400
|
+
type: "string",
|
|
1401
|
+
minLength: 1
|
|
1402
|
+
}, { type: "null" }] },
|
|
1403
|
+
combine: { oneOf: [{ type: "boolean" }, { type: "null" }] },
|
|
1404
|
+
combineBrackets: { oneOf: [{
|
|
1405
|
+
type: "string",
|
|
1406
|
+
minLength: 1
|
|
1407
|
+
}, { type: "null" }] },
|
|
1408
|
+
vert: { oneOf: [{ type: "boolean" }, { type: "null" }] },
|
|
1409
|
+
vertCompress: { oneOf: [{ type: "boolean" }, { type: "null" }] }
|
|
1410
|
+
})),
|
|
1411
|
+
runAttribute("em", "string", "w:em", schemaStringOrNull()),
|
|
1412
|
+
runAttribute("fitText", "object", "w:fitText", schemaObjectOrNull({
|
|
1413
|
+
val: { oneOf: [{ type: "number" }, { type: "null" }] },
|
|
1414
|
+
id: { oneOf: [{
|
|
1415
|
+
type: "string",
|
|
1416
|
+
minLength: 1
|
|
1417
|
+
}, { type: "null" }] }
|
|
1418
|
+
})),
|
|
1419
|
+
runAttribute("snapToGrid", "boolean", "w:snapToGrid", schemaBooleanOrNull()),
|
|
1420
|
+
runAttribute("lang", "object", "w:lang", schemaObjectOrNull({
|
|
1421
|
+
val: { oneOf: [{
|
|
1422
|
+
type: "string",
|
|
1423
|
+
minLength: 1
|
|
1424
|
+
}, { type: "null" }] },
|
|
1425
|
+
eastAsia: { oneOf: [{
|
|
1426
|
+
type: "string",
|
|
1427
|
+
minLength: 1
|
|
1428
|
+
}, { type: "null" }] },
|
|
1429
|
+
bidi: { oneOf: [{
|
|
1430
|
+
type: "string",
|
|
1431
|
+
minLength: 1
|
|
1432
|
+
}, { type: "null" }] }
|
|
1433
|
+
})),
|
|
1434
|
+
runAttribute("oMath", "boolean", "w:oMath", schemaBooleanOrNull()),
|
|
1435
|
+
runAttribute("rStyle", "string", "w:rStyle", schemaStringOrNull(), "styleId"),
|
|
1436
|
+
runAttribute("rFonts", "object", "w:rFonts", schemaObjectOrNull({
|
|
1437
|
+
ascii: { oneOf: [{
|
|
1438
|
+
type: "string",
|
|
1439
|
+
minLength: 1
|
|
1440
|
+
}, { type: "null" }] },
|
|
1441
|
+
hAnsi: { oneOf: [{
|
|
1442
|
+
type: "string",
|
|
1443
|
+
minLength: 1
|
|
1444
|
+
}, { type: "null" }] },
|
|
1445
|
+
eastAsia: { oneOf: [{
|
|
1446
|
+
type: "string",
|
|
1447
|
+
minLength: 1
|
|
1448
|
+
}, { type: "null" }] },
|
|
1449
|
+
cs: { oneOf: [{
|
|
1450
|
+
type: "string",
|
|
1451
|
+
minLength: 1
|
|
1452
|
+
}, { type: "null" }] },
|
|
1453
|
+
asciiTheme: { oneOf: [{
|
|
1454
|
+
type: "string",
|
|
1455
|
+
minLength: 1
|
|
1456
|
+
}, { type: "null" }] },
|
|
1457
|
+
hAnsiTheme: { oneOf: [{
|
|
1458
|
+
type: "string",
|
|
1459
|
+
minLength: 1
|
|
1460
|
+
}, { type: "null" }] },
|
|
1461
|
+
eastAsiaTheme: { oneOf: [{
|
|
1462
|
+
type: "string",
|
|
1463
|
+
minLength: 1
|
|
1464
|
+
}, { type: "null" }] },
|
|
1465
|
+
csTheme: { oneOf: [{
|
|
1466
|
+
type: "string",
|
|
1467
|
+
minLength: 1
|
|
1468
|
+
}, { type: "null" }] },
|
|
1469
|
+
hint: { oneOf: [{
|
|
1470
|
+
type: "string",
|
|
1471
|
+
minLength: 1
|
|
1472
|
+
}, { type: "null" }] }
|
|
1473
|
+
}), "fontFamily"),
|
|
1474
|
+
runAttribute("fontSizeCs", "number", "w:szCs", schemaNumberOrNull()),
|
|
1475
|
+
runAttribute("ligatures", "string", "w14:ligatures", schemaStringOrNull()),
|
|
1476
|
+
runAttribute("numForm", "string", "w14:numForm", schemaStringOrNull()),
|
|
1477
|
+
runAttribute("numSpacing", "string", "w14:numSpacing", schemaStringOrNull()),
|
|
1478
|
+
runAttribute("stylisticSets", "array", "w14:stylisticSets", schemaStylisticSets()),
|
|
1479
|
+
runAttribute("contextualAlternates", "boolean", "w14:cntxtAlts", schemaBooleanOrNull())
|
|
1480
|
+
];
|
|
1481
|
+
new Set(INLINE_PROPERTY_REGISTRY.map((entry) => entry.key));
|
|
1482
|
+
const INLINE_PROPERTY_BY_KEY = Object.fromEntries(INLINE_PROPERTY_REGISTRY.map((entry) => [entry.key, entry]));
|
|
1483
|
+
INLINE_PROPERTY_REGISTRY.filter((entry) => entry.storage === "mark").map((entry) => entry.key), INLINE_PROPERTY_REGISTRY.filter((entry) => entry.storage === "runAttribute").map((entry) => entry.key);
|
|
1233
1484
|
var POST_DECISION_TRACKED_CHANGES_LIST_OPTIONS = Object.freeze({
|
|
1234
1485
|
mode: "background-reconcile",
|
|
1235
1486
|
refreshReason: "post-decision-background",
|
|
@@ -2298,6 +2549,7 @@ var CLEAR_INLINE_PATCH = {
|
|
|
2298
2549
|
letterSpacing: null,
|
|
2299
2550
|
dstrike: null
|
|
2300
2551
|
};
|
|
2552
|
+
var TRACKED_CLEAR_INLINE_PATCH = Object.fromEntries(Object.entries(CLEAR_INLINE_PATCH).filter(([key]) => INLINE_PROPERTY_BY_KEY[key]?.tracked === true));
|
|
2301
2553
|
function buildInlineFormatInput(spec, target, payload, active) {
|
|
2302
2554
|
switch (spec.kind) {
|
|
2303
2555
|
case "toggle": {
|
|
@@ -5774,6 +6026,7 @@ function createSuperDocUI(options) {
|
|
|
5774
6026
|
if (UNSUPPORTED_TRACKED_UI_MUTATION_ROUTES.has(route)) return unsupportedTrackedMutationReceipt(route);
|
|
5775
6027
|
return { changeMode: "tracked" };
|
|
5776
6028
|
};
|
|
6029
|
+
const clearInlinePatchForMode = () => readDocumentMode() === "suggesting" ? TRACKED_CLEAR_INLINE_PATCH : CLEAR_INLINE_PATCH;
|
|
5777
6030
|
const callEditorMutation = (route, op, input) => {
|
|
5778
6031
|
const options$1 = editorMutationOptionsForRoute(route);
|
|
5779
6032
|
if (options$1 && options$1.success === false) return options$1;
|
|
@@ -6030,7 +6283,7 @@ function createSuperDocUI(options) {
|
|
|
6030
6283
|
if (inlineOp) try {
|
|
6031
6284
|
record(callInlineFormatMutation("format.apply", inlineOp, {
|
|
6032
6285
|
target: rangeTarget,
|
|
6033
|
-
inline: { ...
|
|
6286
|
+
inline: { ...clearInlinePatchForMode() }
|
|
6034
6287
|
}));
|
|
6035
6288
|
} catch {
|
|
6036
6289
|
immediateResults.push(false);
|
|
@@ -1449,6 +1449,260 @@ const decodeLayoutStoryDataset = (raw) => {
|
|
|
1449
1449
|
};
|
|
1450
1450
|
const SDT_BLOCK_WITH_ID_SELECTOR = `.${DOM_CLASS_NAMES.BLOCK_SDT}[${DATA_ATTRS.SDT_ID}]`;
|
|
1451
1451
|
const DRAGGABLE_SELECTOR = `[${DATA_ATTRS.DRAGGABLE}="true"]`;
|
|
1452
|
+
var schemaBooleanOrNull = () => ({ oneOf: [{ type: "boolean" }, { type: "null" }] });
|
|
1453
|
+
var schemaStringOrNull = () => ({ oneOf: [{
|
|
1454
|
+
type: "string",
|
|
1455
|
+
minLength: 1
|
|
1456
|
+
}, { type: "null" }] });
|
|
1457
|
+
var schemaNumberOrNull = () => ({ oneOf: [{ type: "number" }, { type: "null" }] });
|
|
1458
|
+
var schemaObjectOrNull = (properties) => ({ oneOf: [{
|
|
1459
|
+
type: "object",
|
|
1460
|
+
properties,
|
|
1461
|
+
additionalProperties: false,
|
|
1462
|
+
minProperties: 1
|
|
1463
|
+
}, { type: "null" }] });
|
|
1464
|
+
var UNDERLINE_OBJECT_SCHEMA = {
|
|
1465
|
+
type: "object",
|
|
1466
|
+
properties: {
|
|
1467
|
+
style: { oneOf: [{
|
|
1468
|
+
type: "string",
|
|
1469
|
+
minLength: 1
|
|
1470
|
+
}, { type: "null" }] },
|
|
1471
|
+
color: { oneOf: [{
|
|
1472
|
+
type: "string",
|
|
1473
|
+
minLength: 1
|
|
1474
|
+
}, { type: "null" }] },
|
|
1475
|
+
themeColor: { oneOf: [{
|
|
1476
|
+
type: "string",
|
|
1477
|
+
minLength: 1
|
|
1478
|
+
}, { type: "null" }] }
|
|
1479
|
+
},
|
|
1480
|
+
additionalProperties: false,
|
|
1481
|
+
minProperties: 1
|
|
1482
|
+
};
|
|
1483
|
+
var STYLISTIC_SET_ITEM_SCHEMA = {
|
|
1484
|
+
type: "object",
|
|
1485
|
+
properties: {
|
|
1486
|
+
id: { type: "number" },
|
|
1487
|
+
val: { type: "boolean" }
|
|
1488
|
+
},
|
|
1489
|
+
required: ["id"],
|
|
1490
|
+
additionalProperties: false
|
|
1491
|
+
};
|
|
1492
|
+
var schemaUnderlinePatch = () => ({ oneOf: [
|
|
1493
|
+
{ type: "boolean" },
|
|
1494
|
+
{ type: "null" },
|
|
1495
|
+
UNDERLINE_OBJECT_SCHEMA
|
|
1496
|
+
] });
|
|
1497
|
+
var schemaStylisticSets = () => ({ oneOf: [{
|
|
1498
|
+
type: "array",
|
|
1499
|
+
items: STYLISTIC_SET_ITEM_SCHEMA,
|
|
1500
|
+
minItems: 1
|
|
1501
|
+
}, { type: "null" }] });
|
|
1502
|
+
function markCarrier(markName, textStyleAttr) {
|
|
1503
|
+
return {
|
|
1504
|
+
storage: "mark",
|
|
1505
|
+
markName,
|
|
1506
|
+
textStyleAttr
|
|
1507
|
+
};
|
|
1508
|
+
}
|
|
1509
|
+
function runAttributeCarrier(runPropertyKey) {
|
|
1510
|
+
return {
|
|
1511
|
+
storage: "runAttribute",
|
|
1512
|
+
nodeName: "run",
|
|
1513
|
+
runPropertyKey
|
|
1514
|
+
};
|
|
1515
|
+
}
|
|
1516
|
+
var markBoolean = (key, ooxmlElement, markName) => ({
|
|
1517
|
+
key,
|
|
1518
|
+
type: "boolean",
|
|
1519
|
+
ooxmlElement,
|
|
1520
|
+
storage: "mark",
|
|
1521
|
+
tracked: true,
|
|
1522
|
+
carrier: markCarrier(markName),
|
|
1523
|
+
schema: schemaBooleanOrNull()
|
|
1524
|
+
});
|
|
1525
|
+
var markTextStyleValue = (key, type, ooxmlElement, schema, textStyleAttr) => ({
|
|
1526
|
+
key,
|
|
1527
|
+
type,
|
|
1528
|
+
ooxmlElement,
|
|
1529
|
+
storage: "mark",
|
|
1530
|
+
tracked: true,
|
|
1531
|
+
carrier: markCarrier("textStyle", textStyleAttr ?? key),
|
|
1532
|
+
schema
|
|
1533
|
+
});
|
|
1534
|
+
var runAttribute = (key, type, ooxmlElement, schema, runPropertyKey) => ({
|
|
1535
|
+
key,
|
|
1536
|
+
type,
|
|
1537
|
+
ooxmlElement,
|
|
1538
|
+
storage: "runAttribute",
|
|
1539
|
+
tracked: false,
|
|
1540
|
+
carrier: runAttributeCarrier(runPropertyKey ?? key),
|
|
1541
|
+
schema
|
|
1542
|
+
});
|
|
1543
|
+
const INLINE_PROPERTY_REGISTRY = [
|
|
1544
|
+
markBoolean("bold", "w:b", "bold"),
|
|
1545
|
+
markBoolean("italic", "w:i", "italic"),
|
|
1546
|
+
markBoolean("strike", "w:strike", "strike"),
|
|
1547
|
+
{
|
|
1548
|
+
key: "underline",
|
|
1549
|
+
type: "object",
|
|
1550
|
+
ooxmlElement: "w:u",
|
|
1551
|
+
storage: "mark",
|
|
1552
|
+
tracked: true,
|
|
1553
|
+
carrier: markCarrier("underline"),
|
|
1554
|
+
schema: schemaUnderlinePatch()
|
|
1555
|
+
},
|
|
1556
|
+
{
|
|
1557
|
+
key: "highlight",
|
|
1558
|
+
type: "string",
|
|
1559
|
+
ooxmlElement: "w:highlight",
|
|
1560
|
+
storage: "mark",
|
|
1561
|
+
tracked: true,
|
|
1562
|
+
carrier: markCarrier("highlight"),
|
|
1563
|
+
schema: schemaStringOrNull()
|
|
1564
|
+
},
|
|
1565
|
+
markTextStyleValue("color", "string", "w:color", schemaStringOrNull()),
|
|
1566
|
+
markTextStyleValue("fontSize", "number", "w:sz", schemaNumberOrNull()),
|
|
1567
|
+
markTextStyleValue("fontFamily", "string", "w:rFonts", schemaStringOrNull()),
|
|
1568
|
+
markTextStyleValue("letterSpacing", "number", "w:spacing", schemaNumberOrNull()),
|
|
1569
|
+
markTextStyleValue("vertAlign", "string", "w:vertAlign", { oneOf: [{ enum: [
|
|
1570
|
+
"superscript",
|
|
1571
|
+
"subscript",
|
|
1572
|
+
"baseline"
|
|
1573
|
+
] }, { type: "null" }] }),
|
|
1574
|
+
markTextStyleValue("position", "number", "w:position", schemaNumberOrNull()),
|
|
1575
|
+
runAttribute("dstrike", "boolean", "w:dstrike", schemaBooleanOrNull()),
|
|
1576
|
+
runAttribute("smallCaps", "boolean", "w:smallCaps", schemaBooleanOrNull()),
|
|
1577
|
+
markTextStyleValue("caps", "boolean", "w:caps", schemaBooleanOrNull(), "textTransform"),
|
|
1578
|
+
runAttribute("shading", "object", "w:shd", schemaObjectOrNull({
|
|
1579
|
+
fill: { oneOf: [{
|
|
1580
|
+
type: "string",
|
|
1581
|
+
minLength: 1
|
|
1582
|
+
}, { type: "null" }] },
|
|
1583
|
+
color: { oneOf: [{
|
|
1584
|
+
type: "string",
|
|
1585
|
+
minLength: 1
|
|
1586
|
+
}, { type: "null" }] },
|
|
1587
|
+
val: { oneOf: [{
|
|
1588
|
+
type: "string",
|
|
1589
|
+
minLength: 1
|
|
1590
|
+
}, { type: "null" }] }
|
|
1591
|
+
})),
|
|
1592
|
+
runAttribute("border", "object", "w:bdr", schemaObjectOrNull({
|
|
1593
|
+
val: { oneOf: [{
|
|
1594
|
+
type: "string",
|
|
1595
|
+
minLength: 1
|
|
1596
|
+
}, { type: "null" }] },
|
|
1597
|
+
sz: { oneOf: [{ type: "number" }, { type: "null" }] },
|
|
1598
|
+
color: { oneOf: [{
|
|
1599
|
+
type: "string",
|
|
1600
|
+
minLength: 1
|
|
1601
|
+
}, { type: "null" }] },
|
|
1602
|
+
space: { oneOf: [{ type: "number" }, { type: "null" }] }
|
|
1603
|
+
}), "borders"),
|
|
1604
|
+
runAttribute("outline", "boolean", "w:outline", schemaBooleanOrNull()),
|
|
1605
|
+
runAttribute("shadow", "boolean", "w:shadow", schemaBooleanOrNull()),
|
|
1606
|
+
runAttribute("emboss", "boolean", "w:emboss", schemaBooleanOrNull()),
|
|
1607
|
+
runAttribute("imprint", "boolean", "w:imprint", schemaBooleanOrNull()),
|
|
1608
|
+
runAttribute("charScale", "number", "w:w", schemaNumberOrNull(), "w"),
|
|
1609
|
+
runAttribute("kerning", "number", "w:kern", schemaNumberOrNull(), "kern"),
|
|
1610
|
+
runAttribute("vanish", "boolean", "w:vanish", schemaBooleanOrNull()),
|
|
1611
|
+
runAttribute("webHidden", "boolean", "w:webHidden", schemaBooleanOrNull()),
|
|
1612
|
+
runAttribute("specVanish", "boolean", "w:specVanish", schemaBooleanOrNull()),
|
|
1613
|
+
runAttribute("rtl", "boolean", "w:rtl", schemaBooleanOrNull()),
|
|
1614
|
+
runAttribute("cs", "boolean", "w:cs", schemaBooleanOrNull()),
|
|
1615
|
+
runAttribute("bCs", "boolean", "w:bCs", schemaBooleanOrNull(), "boldCs"),
|
|
1616
|
+
runAttribute("iCs", "boolean", "w:iCs", schemaBooleanOrNull(), "italicCs"),
|
|
1617
|
+
runAttribute("eastAsianLayout", "object", "w:eastAsianLayout", schemaObjectOrNull({
|
|
1618
|
+
id: { oneOf: [{
|
|
1619
|
+
type: "string",
|
|
1620
|
+
minLength: 1
|
|
1621
|
+
}, { type: "null" }] },
|
|
1622
|
+
combine: { oneOf: [{ type: "boolean" }, { type: "null" }] },
|
|
1623
|
+
combineBrackets: { oneOf: [{
|
|
1624
|
+
type: "string",
|
|
1625
|
+
minLength: 1
|
|
1626
|
+
}, { type: "null" }] },
|
|
1627
|
+
vert: { oneOf: [{ type: "boolean" }, { type: "null" }] },
|
|
1628
|
+
vertCompress: { oneOf: [{ type: "boolean" }, { type: "null" }] }
|
|
1629
|
+
})),
|
|
1630
|
+
runAttribute("em", "string", "w:em", schemaStringOrNull()),
|
|
1631
|
+
runAttribute("fitText", "object", "w:fitText", schemaObjectOrNull({
|
|
1632
|
+
val: { oneOf: [{ type: "number" }, { type: "null" }] },
|
|
1633
|
+
id: { oneOf: [{
|
|
1634
|
+
type: "string",
|
|
1635
|
+
minLength: 1
|
|
1636
|
+
}, { type: "null" }] }
|
|
1637
|
+
})),
|
|
1638
|
+
runAttribute("snapToGrid", "boolean", "w:snapToGrid", schemaBooleanOrNull()),
|
|
1639
|
+
runAttribute("lang", "object", "w:lang", schemaObjectOrNull({
|
|
1640
|
+
val: { oneOf: [{
|
|
1641
|
+
type: "string",
|
|
1642
|
+
minLength: 1
|
|
1643
|
+
}, { type: "null" }] },
|
|
1644
|
+
eastAsia: { oneOf: [{
|
|
1645
|
+
type: "string",
|
|
1646
|
+
minLength: 1
|
|
1647
|
+
}, { type: "null" }] },
|
|
1648
|
+
bidi: { oneOf: [{
|
|
1649
|
+
type: "string",
|
|
1650
|
+
minLength: 1
|
|
1651
|
+
}, { type: "null" }] }
|
|
1652
|
+
})),
|
|
1653
|
+
runAttribute("oMath", "boolean", "w:oMath", schemaBooleanOrNull()),
|
|
1654
|
+
runAttribute("rStyle", "string", "w:rStyle", schemaStringOrNull(), "styleId"),
|
|
1655
|
+
runAttribute("rFonts", "object", "w:rFonts", schemaObjectOrNull({
|
|
1656
|
+
ascii: { oneOf: [{
|
|
1657
|
+
type: "string",
|
|
1658
|
+
minLength: 1
|
|
1659
|
+
}, { type: "null" }] },
|
|
1660
|
+
hAnsi: { oneOf: [{
|
|
1661
|
+
type: "string",
|
|
1662
|
+
minLength: 1
|
|
1663
|
+
}, { type: "null" }] },
|
|
1664
|
+
eastAsia: { oneOf: [{
|
|
1665
|
+
type: "string",
|
|
1666
|
+
minLength: 1
|
|
1667
|
+
}, { type: "null" }] },
|
|
1668
|
+
cs: { oneOf: [{
|
|
1669
|
+
type: "string",
|
|
1670
|
+
minLength: 1
|
|
1671
|
+
}, { type: "null" }] },
|
|
1672
|
+
asciiTheme: { oneOf: [{
|
|
1673
|
+
type: "string",
|
|
1674
|
+
minLength: 1
|
|
1675
|
+
}, { type: "null" }] },
|
|
1676
|
+
hAnsiTheme: { oneOf: [{
|
|
1677
|
+
type: "string",
|
|
1678
|
+
minLength: 1
|
|
1679
|
+
}, { type: "null" }] },
|
|
1680
|
+
eastAsiaTheme: { oneOf: [{
|
|
1681
|
+
type: "string",
|
|
1682
|
+
minLength: 1
|
|
1683
|
+
}, { type: "null" }] },
|
|
1684
|
+
csTheme: { oneOf: [{
|
|
1685
|
+
type: "string",
|
|
1686
|
+
minLength: 1
|
|
1687
|
+
}, { type: "null" }] },
|
|
1688
|
+
hint: { oneOf: [{
|
|
1689
|
+
type: "string",
|
|
1690
|
+
minLength: 1
|
|
1691
|
+
}, { type: "null" }] }
|
|
1692
|
+
}), "fontFamily"),
|
|
1693
|
+
runAttribute("fontSizeCs", "number", "w:szCs", schemaNumberOrNull()),
|
|
1694
|
+
runAttribute("ligatures", "string", "w14:ligatures", schemaStringOrNull()),
|
|
1695
|
+
runAttribute("numForm", "string", "w14:numForm", schemaStringOrNull()),
|
|
1696
|
+
runAttribute("numSpacing", "string", "w14:numSpacing", schemaStringOrNull()),
|
|
1697
|
+
runAttribute("stylisticSets", "array", "w14:stylisticSets", schemaStylisticSets()),
|
|
1698
|
+
runAttribute("contextualAlternates", "boolean", "w14:cntxtAlts", schemaBooleanOrNull())
|
|
1699
|
+
];
|
|
1700
|
+
const INLINE_PROPERTY_KEY_SET = new Set(INLINE_PROPERTY_REGISTRY.map((entry) => entry.key));
|
|
1701
|
+
const INLINE_PROPERTY_BY_KEY = Object.fromEntries(INLINE_PROPERTY_REGISTRY.map((entry) => [entry.key, entry]));
|
|
1702
|
+
const INLINE_PROPERTY_KEYS_BY_STORAGE = {
|
|
1703
|
+
mark: INLINE_PROPERTY_REGISTRY.filter((entry) => entry.storage === "mark").map((entry) => entry.key),
|
|
1704
|
+
runAttribute: INLINE_PROPERTY_REGISTRY.filter((entry) => entry.storage === "runAttribute").map((entry) => entry.key)
|
|
1705
|
+
};
|
|
1452
1706
|
var POST_DECISION_TRACKED_CHANGES_LIST_OPTIONS = Object.freeze({
|
|
1453
1707
|
mode: "background-reconcile",
|
|
1454
1708
|
refreshReason: "post-decision-background",
|
|
@@ -2517,6 +2771,7 @@ var CLEAR_INLINE_PATCH = {
|
|
|
2517
2771
|
letterSpacing: null,
|
|
2518
2772
|
dstrike: null
|
|
2519
2773
|
};
|
|
2774
|
+
var TRACKED_CLEAR_INLINE_PATCH = Object.fromEntries(Object.entries(CLEAR_INLINE_PATCH).filter(([key]) => INLINE_PROPERTY_BY_KEY[key]?.tracked === true));
|
|
2520
2775
|
function buildInlineFormatInput(spec, target, payload, active) {
|
|
2521
2776
|
switch (spec.kind) {
|
|
2522
2777
|
case "toggle": {
|
|
@@ -5993,6 +6248,7 @@ function createSuperDocUI(options) {
|
|
|
5993
6248
|
if (UNSUPPORTED_TRACKED_UI_MUTATION_ROUTES.has(route)) return unsupportedTrackedMutationReceipt(route);
|
|
5994
6249
|
return { changeMode: "tracked" };
|
|
5995
6250
|
};
|
|
6251
|
+
const clearInlinePatchForMode = () => readDocumentMode() === "suggesting" ? TRACKED_CLEAR_INLINE_PATCH : CLEAR_INLINE_PATCH;
|
|
5996
6252
|
const callEditorMutation = (route, op, input) => {
|
|
5997
6253
|
const options$1 = editorMutationOptionsForRoute(route);
|
|
5998
6254
|
if (options$1 && options$1.success === false) return options$1;
|
|
@@ -6249,7 +6505,7 @@ function createSuperDocUI(options) {
|
|
|
6249
6505
|
if (inlineOp) try {
|
|
6250
6506
|
record(callInlineFormatMutation("format.apply", inlineOp, {
|
|
6251
6507
|
target: rangeTarget,
|
|
6252
|
-
inline: { ...
|
|
6508
|
+
inline: { ...clearInlinePatchForMode() }
|
|
6253
6509
|
}));
|
|
6254
6510
|
} catch {
|
|
6255
6511
|
immediateResults.push(false);
|
|
@@ -7,7 +7,7 @@ const COLLABORATION_UPGRADE_ENGINE_MINIMUM_NODE_MAJOR = 20;
|
|
|
7
7
|
var PRIVATE_ENGINE_INFO = (0, __superdoc_docx_engine_collaboration_upgrade_engine.getCollaborationUpgradeEngineInfo)();
|
|
8
8
|
var ENGINE_INFO = Object.freeze({
|
|
9
9
|
...PRIVATE_ENGINE_INFO,
|
|
10
|
-
superdocVersion: "2.0.0-next.
|
|
10
|
+
superdocVersion: "2.0.0-next.42",
|
|
11
11
|
roomSchemaVersion: Object.freeze({ ...PRIVATE_ENGINE_INFO.roomSchemaVersion }),
|
|
12
12
|
supportedBundleVersions: SUPPORTED_COLLABORATION_UPGRADE_BUNDLE_VERSIONS,
|
|
13
13
|
supportedV1ReaderContractVersions: SUPPORTED_V1_READER_CONTRACT_VERSIONS
|
|
@@ -6,7 +6,7 @@ const COLLABORATION_UPGRADE_ENGINE_MINIMUM_NODE_MAJOR = 20;
|
|
|
6
6
|
var PRIVATE_ENGINE_INFO = getCollaborationUpgradeEngineInfo$1();
|
|
7
7
|
var ENGINE_INFO = Object.freeze({
|
|
8
8
|
...PRIVATE_ENGINE_INFO,
|
|
9
|
-
superdocVersion: "2.0.0-next.
|
|
9
|
+
superdocVersion: "2.0.0-next.42",
|
|
10
10
|
roomSchemaVersion: Object.freeze({ ...PRIVATE_ENGINE_INFO.roomSchemaVersion }),
|
|
11
11
|
supportedBundleVersions: SUPPORTED_COLLABORATION_UPGRADE_BUNDLE_VERSIONS,
|
|
12
12
|
supportedV1ReaderContractVersions: SUPPORTED_V1_READER_CONTRACT_VERSIONS
|
|
@@ -55,7 +55,6 @@ export type TemplateScope = 'styles' | 'numbering' | 'settings' | 'theme' | 'fon
|
|
|
55
55
|
export interface TemplatesApplyInput {
|
|
56
56
|
source: TemplatesApplySource;
|
|
57
57
|
bodyPolicy?: TemplateBodyPolicy;
|
|
58
|
-
onUnsupportedContent?: 'narrow' | 'error';
|
|
59
58
|
}
|
|
60
59
|
export interface TemplatesApplyOptions {
|
|
61
60
|
dryRun?: boolean;
|
package/dist/public/ui-react.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_rolldown_runtime = require("../chunks/rolldown-runtime-_dR15c8t.cjs");
|
|
3
|
-
const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-
|
|
3
|
+
const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-DYky1UEo.cjs");
|
|
4
4
|
let react = require("react");
|
|
5
5
|
var SuperDocUIContext = (0, react.createContext)(null);
|
|
6
6
|
function SuperDocUIProvider(props) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as createSuperDocUI } from "../chunks/create-super-doc-ui-
|
|
1
|
+
import { t as createSuperDocUI } from "../chunks/create-super-doc-ui-BFz0iim0.es.js";
|
|
2
2
|
import { createContext, createElement, useCallback, useContext, useEffect, useRef, useState } from "react";
|
|
3
3
|
var SuperDocUIContext = createContext(null);
|
|
4
4
|
function SuperDocUIProvider(props) {
|
package/dist/public/ui.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-
|
|
2
|
+
const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-DYky1UEo.cjs");
|
|
3
3
|
exports.BUILT_IN_COMMAND_IDS = require_create_super_doc_ui.BUILT_IN_COMMAND_IDS;
|
|
4
4
|
exports.createSuperDocUI = require_create_super_doc_ui.createSuperDocUI;
|
|
5
5
|
exports.shallowEqual = require_create_super_doc_ui.shallowEqual;
|
package/dist/public/ui.es.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as BUILT_IN_COMMAND_IDS, r as shallowEqual, t as createSuperDocUI } from "../chunks/create-super-doc-ui-
|
|
1
|
+
import { n as BUILT_IN_COMMAND_IDS, r as shallowEqual, t as createSuperDocUI } from "../chunks/create-super-doc-ui-BFz0iim0.es.js";
|
|
2
2
|
export { BUILT_IN_COMMAND_IDS, createSuperDocUI, shallowEqual };
|
package/dist/style.css
CHANGED
|
@@ -2674,11 +2674,11 @@ img[data-v-c95b2073] {
|
|
|
2674
2674
|
opacity: 0.55;
|
|
2675
2675
|
}
|
|
2676
2676
|
|
|
2677
|
-
.sd-option-row[data-v-
|
|
2677
|
+
.sd-option-row[data-v-05eb02fc] {
|
|
2678
2678
|
display: flex;
|
|
2679
2679
|
flex-direction: row;
|
|
2680
2680
|
}
|
|
2681
|
-
.sd-option[data-v-
|
|
2681
|
+
.sd-option[data-v-05eb02fc] {
|
|
2682
2682
|
border-radius: 50%;
|
|
2683
2683
|
cursor: pointer;
|
|
2684
2684
|
padding: 3px;
|
|
@@ -2688,15 +2688,15 @@ img[data-v-c95b2073] {
|
|
|
2688
2688
|
position: relative;
|
|
2689
2689
|
box-sizing: border-box;
|
|
2690
2690
|
}
|
|
2691
|
-
.sd-option[data-v-
|
|
2691
|
+
.sd-option[data-v-05eb02fc]:hover {
|
|
2692
2692
|
background-color: var(--sd-ui-dropdown-hover-bg, #d8dee5);
|
|
2693
2693
|
}
|
|
2694
|
-
.sd-option__icon[data-v-
|
|
2694
|
+
.sd-option__icon[data-v-05eb02fc] {
|
|
2695
2695
|
width: 20px;
|
|
2696
2696
|
height: 20px;
|
|
2697
2697
|
flex-shrink: 0;
|
|
2698
2698
|
}
|
|
2699
|
-
.sd-option__check[data-v-
|
|
2699
|
+
.sd-option__check[data-v-05eb02fc] {
|
|
2700
2700
|
width: 14px;
|
|
2701
2701
|
height: 14px;
|
|
2702
2702
|
flex-shrink: 0;
|