docblocks-react-ui 0.4.5 → 0.4.7
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/CHANGELOG.md +57 -0
- package/README.md +33 -4
- package/dist/{Editor-B1T7ytNQ.mjs → Editor-CTSlILEm.mjs} +1545 -1027
- package/dist/index.d.mts +29 -1
- package/dist/index.mjs +2 -2
- package/dist/mermaid/index.mjs +1 -1
- package/dist/styles.css +20 -3
- package/package.json +1 -1
|
@@ -755,10 +755,21 @@ function caretOffsetIn(root, node, offset) {
|
|
|
755
755
|
* line).
|
|
756
756
|
*/
|
|
757
757
|
function locatePosition(root, flatOffset) {
|
|
758
|
-
if (flatOffset <= 0)
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
758
|
+
if (flatOffset <= 0) {
|
|
759
|
+
const walker = document.createTreeWalker(root, NodeFilter.SHOW_TEXT);
|
|
760
|
+
let current = walker.nextNode();
|
|
761
|
+
while (current !== null) {
|
|
762
|
+
if (!isLineAnchor$1(current)) return {
|
|
763
|
+
node: current,
|
|
764
|
+
offset: 0
|
|
765
|
+
};
|
|
766
|
+
current = walker.nextNode();
|
|
767
|
+
}
|
|
768
|
+
return {
|
|
769
|
+
node: root,
|
|
770
|
+
offset: 0
|
|
771
|
+
};
|
|
772
|
+
}
|
|
762
773
|
const anchor = lineAnchorOf(root);
|
|
763
774
|
if (anchor !== null && root.lastElementChild === anchor && flatOffset >= textLengthOf(root)) return {
|
|
764
775
|
node: root,
|
|
@@ -909,8 +920,9 @@ function liveScope(scope) {
|
|
|
909
920
|
* structural gesture (the element must be rendered); `scope` confines the
|
|
910
921
|
* lookup to one editor root (a page can render the same doc in several).
|
|
911
922
|
*/
|
|
912
|
-
function focusCaretIn(blockId, offset, scope = document) {
|
|
923
|
+
function focusCaretIn(blockId, offset, scope = document, guard) {
|
|
913
924
|
afterFrame(() => {
|
|
925
|
+
if (guard !== void 0 && !guard()) return;
|
|
914
926
|
const el = Array.from(liveScope(scope).querySelectorAll(`[data-block-id="${CSS.escape(blockId)}"][data-slot="docblocks/block-content"]`)).find((candidate) => !candidate.closest("[data-slot=\"docblocks/frame-window-content\"]")) ?? null;
|
|
915
927
|
if (el === null || !el.isConnected) return;
|
|
916
928
|
el.focus();
|
|
@@ -976,6 +988,23 @@ function seatedIn(el) {
|
|
|
976
988
|
return inOrOn(sel.anchorNode) && inOrOn(sel.focusNode);
|
|
977
989
|
}
|
|
978
990
|
/**
|
|
991
|
+
* Whether the DOM selection sits in the element AT the requested flat
|
|
992
|
+
* offsets (a collapsed caret at `from`, a span over [from, to)). A
|
|
993
|
+
* selection inside the element at a different seat (a competing re-seat's
|
|
994
|
+
* transient — the container's re-seat lands at the block's edge while
|
|
995
|
+
* the history's seat is the pre-gesture's) is not the gesture's seat:
|
|
996
|
+
* the watch re-seats over it instead of stopping.
|
|
997
|
+
*/
|
|
998
|
+
function seatedAt(el, from, to) {
|
|
999
|
+
if (!seatedIn(el)) return false;
|
|
1000
|
+
const sel = window.getSelection();
|
|
1001
|
+
if (sel === null || sel.rangeCount === 0 || sel.anchorNode === null || sel.focusNode === null) return false;
|
|
1002
|
+
const anchorOffset = caretOffsetIn(el, sel.anchorNode, sel.anchorOffset);
|
|
1003
|
+
if (to === null) return anchorOffset === from;
|
|
1004
|
+
const focusOffset = caretOffsetIn(el, sel.focusNode, sel.focusOffset);
|
|
1005
|
+
return anchorOffset === from && focusOffset === to || anchorOffset === to && focusOffset === from;
|
|
1006
|
+
}
|
|
1007
|
+
/**
|
|
979
1008
|
* Restore a text range (a caret when `to` is null) inside a block's inner
|
|
980
1009
|
* editable after a structural gesture (a Tab/Shift+Tab indent, a list-type
|
|
981
1010
|
* swap) that remounts the block's subtree: the old editable is gone and
|
|
@@ -1021,7 +1050,7 @@ function restoreSelectionIn(doc, blockId, from, to, scope = document, exclude =
|
|
|
1021
1050
|
function attempt() {
|
|
1022
1051
|
const inners = Array.from(liveScope(scope).querySelectorAll(selector)).filter((el) => el.isConnected).filter((el) => el !== exclude).filter((el) => expectedParent === null || domParentBlockIdOf(el) === expectedParent).filter((el) => isSurvivorInner(el, blockType)).filter((el) => logicalTextOf(el) === doc.getText(blockId));
|
|
1023
1052
|
const el = inners.length === 1 ? inners[0] : null;
|
|
1024
|
-
if (el !== null &&
|
|
1053
|
+
if (el !== null && seatedAt(el, from, to)) {
|
|
1025
1054
|
el.focus();
|
|
1026
1055
|
stop();
|
|
1027
1056
|
return;
|
|
@@ -4129,954 +4158,889 @@ function probeFor(entry) {
|
|
|
4129
4158
|
return el;
|
|
4130
4159
|
}
|
|
4131
4160
|
//#endregion
|
|
4132
|
-
//#region src/i18n/locales/en/blocks.json
|
|
4133
|
-
var blocks_default$1 = {
|
|
4134
|
-
row: {
|
|
4135
|
-
"selectBlock": "Select block",
|
|
4136
|
-
"addBlockBelow": "Add block below",
|
|
4137
|
-
"deleteBlock": "Delete block"
|
|
4138
|
-
},
|
|
4139
|
-
task: {
|
|
4140
|
-
"markDone": "Mark task as done",
|
|
4141
|
-
"markNotDone": "Mark task as not done"
|
|
4142
|
-
},
|
|
4143
|
-
collapse: {
|
|
4144
|
-
"expand": "Expand children",
|
|
4145
|
-
"collapse": "Collapse children"
|
|
4146
|
-
},
|
|
4147
|
-
caption: {
|
|
4148
|
-
"placeholder": "Write a caption…",
|
|
4149
|
-
"edit": "Edit the caption",
|
|
4150
|
-
"add": "Add a caption",
|
|
4151
|
-
"aria": "Caption",
|
|
4152
|
-
"imageAria": "Image caption"
|
|
4153
|
-
},
|
|
4154
|
-
code: {
|
|
4155
|
-
"language": "Code language",
|
|
4156
|
-
"chooseLanguage": "Choose the code language",
|
|
4157
|
-
"searchPlaceholder": "Search language…",
|
|
4158
|
-
"searchAria": "Search language",
|
|
4159
|
-
"languages": "Languages",
|
|
4160
|
-
"copy": "Copy the code",
|
|
4161
|
-
"expand": "Expand the code",
|
|
4162
|
-
"collapse": "Collapse the code",
|
|
4163
|
-
"expandTitle": "Expand",
|
|
4164
|
-
"collapseTitle": "Collapse",
|
|
4165
|
-
"options": "Code options",
|
|
4166
|
-
"lineNumbers": "Line numbers",
|
|
4167
|
-
"wrap": "Wrap long lines",
|
|
4168
|
-
"rendering": "rendering…",
|
|
4169
|
-
"pdfPreviewUnavailable": "PDF preview unavailable ({error}). Showing the built-in viewer.",
|
|
4170
|
-
"pdfLoading": "loading preview…",
|
|
4171
|
-
"pdfPrevPage": "Previous page",
|
|
4172
|
-
"pdfNextPage": "Next page",
|
|
4173
|
-
"pdfFullscreen": "Expand to fullscreen",
|
|
4174
|
-
"pdfCloseFullscreen": "Close fullscreen"
|
|
4175
|
-
},
|
|
4176
|
-
image: {
|
|
4177
|
-
"placeholder": "image",
|
|
4178
|
-
"document": "document",
|
|
4179
|
-
"resize": "Resize the image",
|
|
4180
|
-
"download": "Download the image",
|
|
4181
|
-
"downloadTitle": "Download"
|
|
4182
|
-
},
|
|
4183
|
-
embed: {
|
|
4184
|
-
"zoomIn": "Zoom in",
|
|
4185
|
-
"zoomOut": "Zoom out",
|
|
4186
|
-
"zoomReset": "Reset zoom",
|
|
4187
|
-
"resizeHeight": "Resize embed height",
|
|
4188
|
-
"editUrl": "Edit URL",
|
|
4189
|
-
"saveUrl": "Save URL",
|
|
4190
|
-
"cancelEdit": "Cancel",
|
|
4191
|
-
"srcPlaceholder": "Embed URL (https://…)",
|
|
4192
|
-
"unsafeHint": "Only absolute http(s):// URLs are supported."
|
|
4193
|
-
},
|
|
4194
|
-
syncEmbed: {
|
|
4195
|
-
"broken": "The master document for this synced block is unavailable.",
|
|
4196
|
-
"cycle": "Circular synced block reference."
|
|
4197
|
-
},
|
|
4198
|
-
align: {
|
|
4199
|
-
"left": "Align left",
|
|
4200
|
-
"center": "Align center",
|
|
4201
|
-
"right": "Align right"
|
|
4202
|
-
},
|
|
4203
|
-
rowCount_one: "row",
|
|
4204
|
-
rowCount_few: "rows",
|
|
4205
|
-
rowCount_many: "rows",
|
|
4206
|
-
rowCount_other: "rows",
|
|
4207
|
-
error: { "render": "Could not be rendered" }
|
|
4208
|
-
};
|
|
4209
|
-
//#endregion
|
|
4210
|
-
//#region src/i18n/locales/en/canvas.json
|
|
4211
|
-
var canvas_default$1 = {
|
|
4212
|
-
view: { "label": "Canvas" },
|
|
4213
|
-
dock: {
|
|
4214
|
-
"toolbar": "Canvas tools",
|
|
4215
|
-
"modeSelect": "Switch to the select mode",
|
|
4216
|
-
"modePan": "Switch to the pan mode",
|
|
4217
|
-
"shapes": "Shapes",
|
|
4218
|
-
"shapesMenu": "Shapes menu",
|
|
4219
|
-
"text": "Text",
|
|
4220
|
-
"frame": "Frame",
|
|
4221
|
-
"container": "Container",
|
|
4222
|
-
"connector": "Connector",
|
|
4223
|
-
"pen": "Pen"
|
|
4224
|
-
},
|
|
4225
|
-
shapes: {
|
|
4226
|
-
"rect": "Rectangle",
|
|
4227
|
-
"rounded": "Rounded Rectangle",
|
|
4228
|
-
"ellipse": "Ellipse",
|
|
4229
|
-
"diamond": "Diamond",
|
|
4230
|
-
"cylinder": "Cylinder",
|
|
4231
|
-
"cloud": "Cloud"
|
|
4232
|
-
},
|
|
4233
|
-
item: {
|
|
4234
|
-
"shape": "Shape block",
|
|
4235
|
-
"text": "Text block",
|
|
4236
|
-
"frame": "Frame block",
|
|
4237
|
-
"group": "Group block",
|
|
4238
|
-
"connector": "Connector block",
|
|
4239
|
-
"other": "{type} block"
|
|
4240
|
-
},
|
|
4241
|
-
zoom: {
|
|
4242
|
-
"toolbar": "Canvas zoom",
|
|
4243
|
-
"fit": "Fit to screen",
|
|
4244
|
-
"out": "Zoom out",
|
|
4245
|
-
"in": "Zoom in",
|
|
4246
|
-
"reset": "Reset zoom"
|
|
4247
|
-
},
|
|
4248
|
-
connector: {
|
|
4249
|
-
"toolbar": "Connector options",
|
|
4250
|
-
"labelEdit": "Connector label",
|
|
4251
|
-
"straight": "Straight line",
|
|
4252
|
-
"orthogonal": "Orthogonal line",
|
|
4253
|
-
"curved": "Curved line",
|
|
4254
|
-
"lineColor": "Line color",
|
|
4255
|
-
"lineWidth": "Line width",
|
|
4256
|
-
"lineWidthTitle": "Line width (1–4 px)",
|
|
4257
|
-
"solid": "Solid line",
|
|
4258
|
-
"dashed": "Dashed line",
|
|
4259
|
-
"arrowheadStart": "Start arrowhead",
|
|
4260
|
-
"arrowheadEnd": "End arrowhead",
|
|
4261
|
-
"arrowheadsStart": "Start arrowheads",
|
|
4262
|
-
"arrowheadsEnd": "End arrowheads",
|
|
4263
|
-
"arrowheadArrow": "Arrow",
|
|
4264
|
-
"arrowheadCircle": "Circle",
|
|
4265
|
-
"arrowheadNone": "None",
|
|
4266
|
-
"arrange": "Arrange line"
|
|
4267
|
-
},
|
|
4268
|
-
shape: {
|
|
4269
|
-
"toolbar": "Shape options",
|
|
4270
|
-
"type": "Shape type",
|
|
4271
|
-
"types": "Shape types",
|
|
4272
|
-
"addText": "Add text",
|
|
4273
|
-
"addTextTitle": "Add text (or double-click the shape)",
|
|
4274
|
-
"fillColor": "Shape fill color",
|
|
4275
|
-
"strokeColor": "Shape stroke color",
|
|
4276
|
-
"borderWidth": "Shape border width",
|
|
4277
|
-
"borderWidthTitle": "Border width (1–4 px)",
|
|
4278
|
-
"borderStyle": "Shape border style",
|
|
4279
|
-
"borderStyleTitle": "Border style",
|
|
4280
|
-
"borderStyles": "Border styles",
|
|
4281
|
-
"solid": "Solid line",
|
|
4282
|
-
"dashed": "Dashed",
|
|
4283
|
-
"borderNone": "No border",
|
|
4284
|
-
"arrange": "Arrange shape"
|
|
4285
|
-
},
|
|
4286
|
-
zorder: {
|
|
4287
|
-
"title": "Arrange (z-order)",
|
|
4288
|
-
"bringForward": "Bring forward",
|
|
4289
|
-
"bringToFront": "Bring to front",
|
|
4290
|
-
"sendBackward": "Send backward",
|
|
4291
|
-
"sendToBack": "Send to back"
|
|
4292
|
-
},
|
|
4293
|
-
text: {
|
|
4294
|
-
"toolbar": "Text options",
|
|
4295
|
-
"arrange": "Arrange text",
|
|
4296
|
-
"fontFamily": "Text font family",
|
|
4297
|
-
"color": "Text color",
|
|
4298
|
-
"style": "Text style",
|
|
4299
|
-
"fontSize": "Text font size",
|
|
4300
|
-
"alignLeft": "Align left",
|
|
4301
|
-
"alignCenter": "Align center",
|
|
4302
|
-
"alignRight": "Align right"
|
|
4303
|
-
},
|
|
4304
|
-
titleChip: {
|
|
4305
|
-
"button": "Title",
|
|
4306
|
-
"setContainerTitle": "Set container title",
|
|
4307
|
-
"setFrameTitle": "Set frame title",
|
|
4308
|
-
"containerTitle": "Container title",
|
|
4309
|
-
"frameTitle": "Frame title"
|
|
4310
|
-
},
|
|
4311
|
-
colorHex: "{label} hex value"
|
|
4312
|
-
};
|
|
4313
|
-
//#endregion
|
|
4314
|
-
//#region src/i18n/locales/en/common.json
|
|
4315
|
-
var common_default$1 = {
|
|
4316
|
-
copy: "Copy",
|
|
4317
|
-
"delete": "Delete",
|
|
4318
|
-
rename: "Rename",
|
|
4319
|
-
clear: "Clear",
|
|
4320
|
-
duplicate: "Duplicate",
|
|
4321
|
-
paste: "Paste",
|
|
4322
|
-
options: "Options",
|
|
4323
|
-
moreOptions: "More options",
|
|
4324
|
-
untitled: "Untitled",
|
|
4325
|
-
noMatches: "No matches",
|
|
4326
|
-
noOptions: "No options.",
|
|
4327
|
-
newTable: "New table…",
|
|
4328
|
-
search: "Search…",
|
|
4329
|
-
color: {
|
|
4330
|
-
"custom": "Custom color",
|
|
4331
|
-
"none": "No color"
|
|
4332
|
-
},
|
|
4333
|
-
access: {
|
|
4334
|
-
"notPublished": "This document has not been published yet.",
|
|
4335
|
-
"notPublishedHint": "Readers see the document only after it has been published."
|
|
4336
|
-
},
|
|
4337
|
-
colorPicker: {
|
|
4338
|
-
"aria": "Color picker",
|
|
4339
|
-
"hexAria": "Hex color value"
|
|
4340
|
-
}
|
|
4341
|
-
};
|
|
4342
|
-
//#endregion
|
|
4343
|
-
//#region src/i18n/locales/en/database.json
|
|
4344
|
-
var database_default$1 = {
|
|
4345
|
-
state: {
|
|
4346
|
-
"loading": "Loading the table…",
|
|
4347
|
-
"notFound": "Table not found",
|
|
4348
|
-
"unknownTable": "The table \"{tableId}\" is unknown to the bridge.",
|
|
4349
|
-
"retry": "Retry"
|
|
4350
|
-
},
|
|
4351
|
-
rowCount_one: "row",
|
|
4352
|
-
rowCount_few: "rows",
|
|
4353
|
-
rowCount_many: "rows",
|
|
4354
|
-
rowCount_other: "rows",
|
|
4355
|
-
toolbar: {
|
|
4356
|
-
"undo": "Undo",
|
|
4357
|
-
"redo": "Redo",
|
|
4358
|
-
"filter": "Filter",
|
|
4359
|
-
"apply": "Apply"
|
|
4360
|
-
},
|
|
4361
|
-
columnTypes: {
|
|
4362
|
-
"text": "Text",
|
|
4363
|
-
"integer": "Integer",
|
|
4364
|
-
"decimal": "Decimal",
|
|
4365
|
-
"checkbox": "Checkbox",
|
|
4366
|
-
"date": "Date",
|
|
4367
|
-
"datetime": "Date & time",
|
|
4368
|
-
"enum": "Enum",
|
|
4369
|
-
"multiEnum": "Multi-enum",
|
|
4370
|
-
"rowLink": "Row link",
|
|
4371
|
-
"rowLinks": "Row links"
|
|
4372
|
-
},
|
|
4373
|
-
form: {
|
|
4374
|
-
"name": "Name",
|
|
4375
|
-
"decimals": "Decimals",
|
|
4376
|
-
"thousandsSeparator": "Thousands' separator",
|
|
4377
|
-
"prefix": "Prefix",
|
|
4378
|
-
"suffix": "Suffix",
|
|
4379
|
-
"allowNegative": "Allow negative",
|
|
4380
|
-
"table": "Table",
|
|
4381
|
-
"selectTable": "— Select a table —",
|
|
4382
|
-
"newTableName": "New table name",
|
|
4383
|
-
"save": "Save",
|
|
4384
|
-
"addColumn": "Add column"
|
|
4385
|
-
},
|
|
4386
|
-
"enum": {
|
|
4387
|
-
"options": "Options",
|
|
4388
|
-
"optionColor": "Option's color",
|
|
4389
|
-
"optionColorAria": "option color",
|
|
4390
|
-
"optionPlaceholder": "Option",
|
|
4391
|
-
"addOption": "+ Add option"
|
|
4392
|
-
},
|
|
4393
|
-
header: {
|
|
4394
|
-
"editOptions": "Edit options",
|
|
4395
|
-
"show": "Show column",
|
|
4396
|
-
"hide": "Hide column",
|
|
4397
|
-
"delete": "Delete column"
|
|
4398
|
-
},
|
|
4399
|
-
row: {
|
|
4400
|
-
"moveUp": "Move up",
|
|
4401
|
-
"moveDown": "Move down",
|
|
4402
|
-
"delete": "Delete row"
|
|
4403
|
-
},
|
|
4404
|
-
rows: {
|
|
4405
|
-
"loadMore": "Load more rows",
|
|
4406
|
-
"none": "No rows.",
|
|
4407
|
-
"noneFiltered": "No rows match the filter.",
|
|
4408
|
-
"add": "+ Add row"
|
|
4409
|
-
},
|
|
4410
|
-
filter: {
|
|
4411
|
-
"empty": "No columns to filter on.",
|
|
4412
|
-
"logic": "Filter logic",
|
|
4413
|
-
"matchAll": "match all of the conditions",
|
|
4414
|
-
"matchAny": "match any of the conditions",
|
|
4415
|
-
"nestedGroup": "{logic} nested group",
|
|
4416
|
-
"removeGroup": "Remove group",
|
|
4417
|
-
"condition": "+ Condition",
|
|
4418
|
-
"group": "+ Group",
|
|
4419
|
-
"valuePlaceholder": "value, value"
|
|
4420
|
-
},
|
|
4421
|
-
picker: {
|
|
4422
|
-
"searchOptions": "Search options",
|
|
4423
|
-
"searchRows": "Search rows"
|
|
4424
|
-
},
|
|
4425
|
-
disconnected: {
|
|
4426
|
-
"name": "Database",
|
|
4427
|
-
"note": "database not connected"
|
|
4428
|
-
}
|
|
4429
|
-
};
|
|
4430
|
-
//#endregion
|
|
4431
|
-
//#region src/i18n/locales/en/editor.json
|
|
4432
|
-
var editor_default$1 = {
|
|
4433
|
-
docHeader: {
|
|
4434
|
-
"pageView": "Page view",
|
|
4435
|
-
"canvasView": "Canvas view",
|
|
4436
|
-
"documentViewAria": "Document view",
|
|
4437
|
-
"editMode": "Edit mode",
|
|
4438
|
-
"viewMode": "View mode",
|
|
4439
|
-
"published": "Published",
|
|
4440
|
-
"documentModeAria": "Document mode",
|
|
4441
|
-
"documentAvatarAria": "Document avatar",
|
|
4442
|
-
"editAvatarAria": "Edit the document avatar",
|
|
4443
|
-
"editAvatar": "Edit the avatar",
|
|
4444
|
-
"documentTitleAria": "Document title",
|
|
4445
|
-
"editTitleAria": "Edit the document title",
|
|
4446
|
-
"editTitle": "Edit the title"
|
|
4447
|
-
},
|
|
4448
|
-
formatToolbar: {
|
|
4449
|
-
"aria": "Text formatting",
|
|
4450
|
-
"marks": {
|
|
4451
|
-
"bold": "Bold",
|
|
4452
|
-
"code": "Monospace",
|
|
4453
|
-
"italic": "Italic",
|
|
4454
|
-
"underline": "Underline",
|
|
4455
|
-
"strike": "Strikethrough"
|
|
4456
|
-
},
|
|
4457
|
-
"align": {
|
|
4458
|
-
"left": "Align left",
|
|
4459
|
-
"center": "Align center",
|
|
4460
|
-
"right": "Align right"
|
|
4461
|
-
},
|
|
4462
|
-
"listType": "List type",
|
|
4463
|
-
"lists": {
|
|
4464
|
-
"bullet": "Bullet list",
|
|
4465
|
-
"number": "Numbered list",
|
|
4466
|
-
"task": "To-do list",
|
|
4467
|
-
"quote": "Quote",
|
|
4468
|
-
"paragraph": "Text"
|
|
4469
|
-
},
|
|
4470
|
-
"callout": {
|
|
4471
|
-
"typeAria": "Callout type",
|
|
4472
|
-
"variant": "{variant} callout",
|
|
4473
|
-
"iconAria": "Callout icon"
|
|
4474
|
-
},
|
|
4475
|
-
"color": {
|
|
4476
|
-
"trigger": "Text and background color",
|
|
4477
|
-
"targetGroupAria": "Color target",
|
|
4478
|
-
"highlightAria": "Highlight the background",
|
|
4479
|
-
"textAria": "Color the text",
|
|
4480
|
-
"highlightLabel": "bg",
|
|
4481
|
-
"textLabel": "text"
|
|
4482
|
-
},
|
|
4483
|
-
"palette": {
|
|
4484
|
-
"callout": "callout",
|
|
4485
|
-
"highlight": "highlight",
|
|
4486
|
-
"text": "text"
|
|
4487
|
-
}
|
|
4488
|
-
},
|
|
4489
|
-
mention: {
|
|
4490
|
-
"searching": "Searching…",
|
|
4491
|
-
"people": "People",
|
|
4492
|
-
"documents": "Documents",
|
|
4493
|
-
"error": "Couldn't load mention results.",
|
|
4494
|
-
"retry": "Retry"
|
|
4495
|
-
},
|
|
4496
|
-
shared: {
|
|
4497
|
-
"swatch": "{label} color {index}",
|
|
4498
|
-
"emojiPickerGroup": "Avatar emoji",
|
|
4499
|
-
"removeAvatar": "Remove avatar",
|
|
4500
|
-
"clearTime": "Clear the time"
|
|
4501
|
-
}
|
|
4502
|
-
};
|
|
4503
|
-
//#endregion
|
|
4504
|
-
//#region src/i18n/locales/en/frame.json
|
|
4505
|
-
var frame_default$1 = { page: {
|
|
4506
|
-
"missing": "Frame not found",
|
|
4507
|
-
"windowLabel": "Frame",
|
|
4508
|
-
"windowTitle": "Frame: {title}"
|
|
4509
|
-
} };
|
|
4510
|
-
//#endregion
|
|
4511
|
-
//#region src/i18n/locales/en/slash.json
|
|
4512
|
-
var slash_default$1 = {
|
|
4513
|
-
blocks: {
|
|
4514
|
-
"text": "Text",
|
|
4515
|
-
"heading1": "Heading 1",
|
|
4516
|
-
"heading2": "Heading 2",
|
|
4517
|
-
"heading3": "Heading 3",
|
|
4518
|
-
"quote": "Quote",
|
|
4519
|
-
"callout": "Callout",
|
|
4520
|
-
"code": "Code block",
|
|
4521
|
-
"codeMermaid": "Code block (mermaid)",
|
|
4522
|
-
"divider": "Divider",
|
|
4523
|
-
"file": "File",
|
|
4524
|
-
"embed": "Embed",
|
|
4525
|
-
"database": "Database",
|
|
4526
|
-
"frame": "Frame",
|
|
4527
|
-
"table": "Table"
|
|
4528
|
-
},
|
|
4529
|
-
lists: {
|
|
4530
|
-
"bulleted": "Bulleted list",
|
|
4531
|
-
"numbered": "Numbered list",
|
|
4532
|
-
"task": "Task list"
|
|
4533
|
-
},
|
|
4534
|
-
database: {
|
|
4535
|
-
"newTable": "New table",
|
|
4536
|
-
"namePlaceholder": "New table name",
|
|
4537
|
-
"searchPlaceholder": "Search tables…",
|
|
4538
|
-
"loading": "Loading the tables…",
|
|
4539
|
-
"noMatch": "No tables match",
|
|
4540
|
-
"empty": "No tables yet — create one above."
|
|
4541
|
-
},
|
|
4542
|
-
frame: {
|
|
4543
|
-
"fallback": "Frame",
|
|
4544
|
-
"searchAria": "Search frames",
|
|
4545
|
-
"searchPlaceholder": "Search frames...",
|
|
4546
|
-
"noMatch": "No frames match",
|
|
4547
|
-
"empty": "No frames on the canvas yet"
|
|
4548
|
-
},
|
|
4549
|
-
embed: {
|
|
4550
|
-
"urlPlaceholder": "Embed URL (https://…)",
|
|
4551
|
-
"unsafeHint": "Only absolute http(s):// URLs are supported."
|
|
4552
|
-
}
|
|
4553
|
-
};
|
|
4554
|
-
//#endregion
|
|
4555
|
-
//#region src/i18n/locales/en/table.json
|
|
4556
|
-
var table_default$1 = {
|
|
4557
|
-
handle: {
|
|
4558
|
-
"columnOptions": "Column {index} options",
|
|
4559
|
-
"rowOptions": "Row {index} options",
|
|
4560
|
-
"columnMenu": "Column options",
|
|
4561
|
-
"rowMenu": "Row options"
|
|
4562
|
-
},
|
|
4563
|
-
menu: {
|
|
4564
|
-
"background": "Background",
|
|
4565
|
-
"backgroundSwatch": "Background {color}",
|
|
4566
|
-
"removeBackground": "Remove background",
|
|
4567
|
-
"insertRight": "Insert right",
|
|
4568
|
-
"insertLeft": "Insert left",
|
|
4569
|
-
"insertBelow": "Insert below",
|
|
4570
|
-
"insertAbove": "Insert above",
|
|
4571
|
-
"moveRight": "Move right",
|
|
4572
|
-
"moveLeft": "Move left",
|
|
4573
|
-
"moveDown": "Move down",
|
|
4574
|
-
"moveUp": "Move up",
|
|
4575
|
-
"clearContent": "Clear content"
|
|
4576
|
-
},
|
|
4577
|
-
resize: { "column": "Resize column {index}" },
|
|
4578
|
-
add: {
|
|
4579
|
-
"column": "Add column",
|
|
4580
|
-
"row": "Add row"
|
|
4581
|
-
},
|
|
4582
|
-
cell: { "options": "Cell options" }
|
|
4583
|
-
};
|
|
4584
|
-
//#endregion
|
|
4585
|
-
//#region src/i18n/locales/ru/blocks.json
|
|
4586
|
-
var blocks_default = {
|
|
4587
|
-
row: {
|
|
4588
|
-
"selectBlock": "Выбрать блок",
|
|
4589
|
-
"addBlockBelow": "Добавить блок ниже",
|
|
4590
|
-
"deleteBlock": "Удалить блок"
|
|
4591
|
-
},
|
|
4592
|
-
task: {
|
|
4593
|
-
"markDone": "Отметить задачу выполненной",
|
|
4594
|
-
"markNotDone": "Снять отметку о выполнении"
|
|
4595
|
-
},
|
|
4596
|
-
collapse: {
|
|
4597
|
-
"expand": "Развернуть вложенные блоки",
|
|
4598
|
-
"collapse": "Свернуть вложенные блоки"
|
|
4599
|
-
},
|
|
4600
|
-
caption: {
|
|
4601
|
-
"placeholder": "Напишите подпись…",
|
|
4602
|
-
"edit": "Изменить подпись",
|
|
4603
|
-
"add": "Добавить подпись",
|
|
4604
|
-
"aria": "Подпись",
|
|
4605
|
-
"imageAria": "Подпись к изображению"
|
|
4606
|
-
},
|
|
4607
|
-
code: {
|
|
4608
|
-
"language": "Язык кода",
|
|
4609
|
-
"chooseLanguage": "Выбрать язык кода",
|
|
4610
|
-
"searchPlaceholder": "Поиск языка…",
|
|
4611
|
-
"searchAria": "Поиск языка",
|
|
4612
|
-
"languages": "Языки",
|
|
4613
|
-
"copy": "Копировать код",
|
|
4614
|
-
"expand": "Развернуть код",
|
|
4615
|
-
"collapse": "Свернуть код",
|
|
4616
|
-
"expandTitle": "Развернуть",
|
|
4617
|
-
"collapseTitle": "Свернуть",
|
|
4618
|
-
"options": "Настройки кода",
|
|
4619
|
-
"lineNumbers": "Номера строк",
|
|
4620
|
-
"wrap": "Переносить длинные строки",
|
|
4621
|
-
"rendering": "Рисование…",
|
|
4622
|
-
"pdfPreviewUnavailable": "Превью PDF недоступно ({error}). Показан встроенный просмотрщик.",
|
|
4623
|
-
"pdfLoading": "Загрузка превью…",
|
|
4624
|
-
"pdfPrevPage": "Предыдущая страница",
|
|
4625
|
-
"pdfNextPage": "Следующая страница",
|
|
4626
|
-
"pdfFullscreen": "Развернуть на весь экран",
|
|
4627
|
-
"pdfCloseFullscreen": "Закрыть полноэкранный режим"
|
|
4628
|
-
},
|
|
4629
|
-
image: {
|
|
4630
|
-
"placeholder": "изображение",
|
|
4631
|
-
"document": "документ",
|
|
4632
|
-
"resize": "Изменить размер изображения",
|
|
4633
|
-
"download": "Скачать изображение",
|
|
4634
|
-
"downloadTitle": "Скачать"
|
|
4635
|
-
},
|
|
4636
|
-
embed: {
|
|
4637
|
-
"zoomIn": "Приблизить",
|
|
4638
|
-
"zoomOut": "Отдалить",
|
|
4639
|
-
"zoomReset": "Сбросить масштаб",
|
|
4640
|
-
"resizeHeight": "Изменить высоту встраивания",
|
|
4641
|
-
"editUrl": "Изменить ссылку",
|
|
4642
|
-
"saveUrl": "Сохранить ссылку",
|
|
4643
|
-
"cancelEdit": "Отмена",
|
|
4644
|
-
"srcPlaceholder": "URL встраивания (https://…)",
|
|
4645
|
-
"unsafeHint": "Поддерживаются только абсолютные URL http(s)://."
|
|
4646
|
-
},
|
|
4647
|
-
syncEmbed: {
|
|
4648
|
-
"broken": "Мастер-документ для этого синхронизируемого блока недоступен.",
|
|
4649
|
-
"cycle": "Циклическая ссылка синхронизируемого блока."
|
|
4650
|
-
},
|
|
4651
|
-
align: {
|
|
4652
|
-
"left": "Выровнять по левому краю",
|
|
4653
|
-
"center": "Выровнять по центру",
|
|
4654
|
-
"right": "Выровнять по правому краю"
|
|
4655
|
-
},
|
|
4656
|
-
rowCount_one: "строка",
|
|
4657
|
-
rowCount_few: "строки",
|
|
4658
|
-
rowCount_many: "строк",
|
|
4659
|
-
rowCount_other: "строк",
|
|
4660
|
-
error: { "render": "Не удалось отобразить" }
|
|
4661
|
-
};
|
|
4662
|
-
//#endregion
|
|
4663
|
-
//#region src/i18n/locales/ru/canvas.json
|
|
4664
|
-
var canvas_default = {
|
|
4665
|
-
view: { "label": "Холст" },
|
|
4666
|
-
dock: {
|
|
4667
|
-
"toolbar": "Инструменты холста",
|
|
4668
|
-
"modeSelect": "Переключиться в режим выделения",
|
|
4669
|
-
"modePan": "Переключиться в режим перемещения",
|
|
4670
|
-
"shapes": "Фигуры",
|
|
4671
|
-
"shapesMenu": "Меню фигур",
|
|
4672
|
-
"text": "Текст",
|
|
4673
|
-
"frame": "Фрейм",
|
|
4674
|
-
"container": "Контейнер",
|
|
4675
|
-
"connector": "Соединитель",
|
|
4676
|
-
"pen": "Ручка"
|
|
4677
|
-
},
|
|
4678
|
-
shapes: {
|
|
4679
|
-
"rect": "Прямоугольник",
|
|
4680
|
-
"rounded": "Скруглённый прямоугольник",
|
|
4681
|
-
"ellipse": "Эллипс",
|
|
4682
|
-
"diamond": "Ромб",
|
|
4683
|
-
"cylinder": "Цилиндр",
|
|
4684
|
-
"cloud": "Облако"
|
|
4685
|
-
},
|
|
4686
|
-
item: {
|
|
4687
|
-
"shape": "Фигура",
|
|
4688
|
-
"text": "Текст",
|
|
4689
|
-
"frame": "Фрейм",
|
|
4690
|
-
"group": "Группа",
|
|
4691
|
-
"connector": "Соединитель",
|
|
4692
|
-
"other": "Блок {type}"
|
|
4693
|
-
},
|
|
4694
|
-
zoom: {
|
|
4695
|
-
"toolbar": "Масштаб холста",
|
|
4696
|
-
"fit": "Вписать в экран",
|
|
4697
|
-
"out": "Уменьшить масштаб",
|
|
4698
|
-
"in": "Увеличить масштаб",
|
|
4699
|
-
"reset": "Сбросить масштаб"
|
|
4700
|
-
},
|
|
4701
|
-
connector: {
|
|
4702
|
-
"toolbar": "Настройки соединителя",
|
|
4703
|
-
"labelEdit": "Подпись соединителя",
|
|
4704
|
-
"straight": "Прямая линия",
|
|
4705
|
-
"orthogonal": "Ортогональная линия",
|
|
4706
|
-
"curved": "Кривая линия",
|
|
4707
|
-
"lineColor": "Цвет линии",
|
|
4708
|
-
"lineWidth": "Толщина линии",
|
|
4709
|
-
"lineWidthTitle": "Толщина линии (1–4 px)",
|
|
4710
|
-
"solid": "Сплошная линия",
|
|
4711
|
-
"dashed": "Пунктирная линия",
|
|
4712
|
-
"arrowheadStart": "Стрелка начала",
|
|
4713
|
-
"arrowheadEnd": "Стрелка конца",
|
|
4714
|
-
"arrowheadsStart": "Стрелки начала",
|
|
4715
|
-
"arrowheadsEnd": "Стрелки конца",
|
|
4716
|
-
"arrowheadArrow": "Стрела",
|
|
4717
|
-
"arrowheadCircle": "Круг",
|
|
4718
|
-
"arrowheadNone": "Нет",
|
|
4719
|
-
"arrange": "Упорядочить линию"
|
|
4720
|
-
},
|
|
4721
|
-
shape: {
|
|
4722
|
-
"toolbar": "Настройки фигуры",
|
|
4723
|
-
"type": "Тип фигуры",
|
|
4724
|
-
"types": "Типы фигур",
|
|
4725
|
-
"addText": "Добавить текст",
|
|
4726
|
-
"addTextTitle": "Добавить текст (или двойной клик по фигуре)",
|
|
4727
|
-
"fillColor": "Цвет заливки фигуры",
|
|
4728
|
-
"strokeColor": "Цвет обводки фигуры",
|
|
4729
|
-
"borderWidth": "Толщина рамки фигуры",
|
|
4730
|
-
"borderWidthTitle": "Толщина рамки (1–4 px)",
|
|
4731
|
-
"borderStyle": "Стиль рамки фигуры",
|
|
4732
|
-
"borderStyleTitle": "Стиль рамки",
|
|
4733
|
-
"borderStyles": "Стили рамки",
|
|
4734
|
-
"solid": "Сплошная линия",
|
|
4735
|
-
"dashed": "Пунктир",
|
|
4736
|
-
"borderNone": "Без рамки",
|
|
4737
|
-
"arrange": "Упорядочить фигуру"
|
|
4738
|
-
},
|
|
4739
|
-
zorder: {
|
|
4740
|
-
"title": "Порядок (z-order)",
|
|
4741
|
-
"bringForward": "Выше",
|
|
4742
|
-
"bringToFront": "На передний план",
|
|
4743
|
-
"sendBackward": "Ниже",
|
|
4744
|
-
"sendToBack": "На задний план"
|
|
4745
|
-
},
|
|
4746
|
-
text: {
|
|
4747
|
-
"toolbar": "Настройки текста",
|
|
4748
|
-
"arrange": "Упорядочить текст",
|
|
4749
|
-
"fontFamily": "Шрифт текста",
|
|
4750
|
-
"color": "Цвет текста",
|
|
4751
|
-
"style": "Стиль текста",
|
|
4752
|
-
"fontSize": "Размер шрифта",
|
|
4753
|
-
"alignLeft": "Выровнять по левому краю",
|
|
4754
|
-
"alignCenter": "Выровнять по центру",
|
|
4755
|
-
"alignRight": "Выровнять по правому краю"
|
|
4756
|
-
},
|
|
4757
|
-
titleChip: {
|
|
4758
|
-
"button": "Заголовок",
|
|
4759
|
-
"setContainerTitle": "Установить заголовок контейнера",
|
|
4760
|
-
"setFrameTitle": "Установить заголовок фрейма",
|
|
4761
|
-
"containerTitle": "Заголовок контейнера",
|
|
4762
|
-
"frameTitle": "Заголовок фрейма"
|
|
4763
|
-
},
|
|
4764
|
-
colorHex: "{label} — HEX-значение"
|
|
4765
|
-
};
|
|
4766
|
-
//#endregion
|
|
4767
|
-
//#region src/i18n/locales/ru/common.json
|
|
4768
|
-
var common_default = {
|
|
4769
|
-
copy: "Копировать",
|
|
4770
|
-
"delete": "Удалить",
|
|
4771
|
-
rename: "Переименовать",
|
|
4772
|
-
clear: "Очистить",
|
|
4773
|
-
duplicate: "Дублировать",
|
|
4774
|
-
paste: "Вставить",
|
|
4775
|
-
options: "Параметры",
|
|
4776
|
-
moreOptions: "Ещё",
|
|
4777
|
-
untitled: "Без названия",
|
|
4778
|
-
noMatches: "Нет совпадений",
|
|
4779
|
-
noOptions: "Нет вариантов.",
|
|
4780
|
-
newTable: "Новая таблица…",
|
|
4781
|
-
search: "Поиск…",
|
|
4782
|
-
color: {
|
|
4783
|
-
"custom": "Свой цвет",
|
|
4784
|
-
"none": "Без цвета"
|
|
4785
|
-
},
|
|
4786
|
-
access: {
|
|
4787
|
-
"notPublished": "Документ ещё не опубликован.",
|
|
4788
|
-
"notPublishedHint": "Читатели увидят документ только после публикации."
|
|
4789
|
-
},
|
|
4790
|
-
colorPicker: {
|
|
4791
|
-
"aria": "Выбор цвета",
|
|
4792
|
-
"hexAria": "Цвет в hex-формате"
|
|
4793
|
-
}
|
|
4794
|
-
};
|
|
4795
|
-
//#endregion
|
|
4796
|
-
//#region src/i18n/locales/ru/database.json
|
|
4797
|
-
var database_default = {
|
|
4798
|
-
state: {
|
|
4799
|
-
"loading": "Загрузка таблицы…",
|
|
4800
|
-
"notFound": "Таблица не найдена",
|
|
4801
|
-
"unknownTable": "Таблица \"{tableId}\" не найдена в базе данных.",
|
|
4802
|
-
"retry": "Повторить"
|
|
4803
|
-
},
|
|
4804
|
-
rowCount_one: "строка",
|
|
4805
|
-
rowCount_few: "строки",
|
|
4806
|
-
rowCount_many: "строк",
|
|
4807
|
-
rowCount_other: "строк",
|
|
4808
|
-
toolbar: {
|
|
4809
|
-
"undo": "Отменить",
|
|
4810
|
-
"redo": "Повторить",
|
|
4811
|
-
"filter": "Фильтр",
|
|
4812
|
-
"apply": "Применить"
|
|
4813
|
-
},
|
|
4814
|
-
columnTypes: {
|
|
4815
|
-
"text": "Текст",
|
|
4816
|
-
"integer": "Целое",
|
|
4817
|
-
"decimal": "Дробное",
|
|
4818
|
-
"checkbox": "Флажок",
|
|
4819
|
-
"date": "Дата",
|
|
4820
|
-
"datetime": "Дата и время",
|
|
4821
|
-
"enum": "Перечисление",
|
|
4822
|
-
"multiEnum": "Множественное перечисление",
|
|
4823
|
-
"rowLink": "Ссылка на строку",
|
|
4824
|
-
"rowLinks": "Ссылки на строки"
|
|
4825
|
-
},
|
|
4826
|
-
form: {
|
|
4827
|
-
"name": "Название",
|
|
4828
|
-
"decimals": "Десятичные знаки",
|
|
4829
|
-
"thousandsSeparator": "Разделитель тысяч",
|
|
4830
|
-
"prefix": "Префикс",
|
|
4831
|
-
"suffix": "Суффикс",
|
|
4832
|
-
"allowNegative": "Разрешить отрицательные",
|
|
4833
|
-
"table": "Таблица",
|
|
4834
|
-
"selectTable": "— Выберите таблицу —",
|
|
4835
|
-
"newTableName": "Название новой таблицы",
|
|
4836
|
-
"save": "Сохранить",
|
|
4837
|
-
"addColumn": "Добавить столбец"
|
|
4838
|
-
},
|
|
4839
|
-
"enum": {
|
|
4840
|
-
"options": "Варианты",
|
|
4841
|
-
"optionColor": "Цвет варианта",
|
|
4842
|
-
"optionColorAria": "цвет варианта",
|
|
4843
|
-
"optionPlaceholder": "Вариант",
|
|
4844
|
-
"addOption": "+ Добавить вариант"
|
|
4845
|
-
},
|
|
4846
|
-
header: {
|
|
4847
|
-
"editOptions": "Изменить варианты",
|
|
4848
|
-
"show": "Показать столбец",
|
|
4849
|
-
"hide": "Скрыть столбец",
|
|
4850
|
-
"delete": "Удалить столбец"
|
|
4851
|
-
},
|
|
4852
|
-
row: {
|
|
4853
|
-
"moveUp": "Переместить вверх",
|
|
4854
|
-
"moveDown": "Переместить вниз",
|
|
4855
|
-
"delete": "Удалить строку"
|
|
4856
|
-
},
|
|
4857
|
-
rows: {
|
|
4858
|
-
"loadMore": "Загрузить ещё строки",
|
|
4859
|
-
"none": "Нет строк.",
|
|
4860
|
-
"noneFiltered": "Строки не соответствуют фильтру.",
|
|
4861
|
-
"add": "+ Добавить строку"
|
|
4862
|
-
},
|
|
4863
|
-
filter: {
|
|
4864
|
-
"empty": "Нет столбцов для фильтрации.",
|
|
4865
|
-
"logic": "Логика фильтра",
|
|
4866
|
-
"matchAll": "выполнены все условия",
|
|
4867
|
-
"matchAny": "выполнено любое из условий",
|
|
4868
|
-
"nestedGroup": "Вложенная группа ({logic})",
|
|
4869
|
-
"removeGroup": "Удалить группу",
|
|
4870
|
-
"condition": "+ Условие",
|
|
4871
|
-
"group": "+ Группа",
|
|
4872
|
-
"valuePlaceholder": "значение, значение"
|
|
4873
|
-
},
|
|
4874
|
-
picker: {
|
|
4875
|
-
"searchOptions": "Поиск вариантов",
|
|
4876
|
-
"searchRows": "Поиск строк"
|
|
4877
|
-
},
|
|
4878
|
-
disconnected: {
|
|
4879
|
-
"name": "База данных",
|
|
4880
|
-
"note": "база данных не подключена"
|
|
4881
|
-
}
|
|
4882
|
-
};
|
|
4883
|
-
//#endregion
|
|
4884
|
-
//#region src/i18n/locales/ru/editor.json
|
|
4885
|
-
var editor_default = {
|
|
4886
|
-
docHeader: {
|
|
4887
|
-
"pageView": "Вид страницы",
|
|
4888
|
-
"canvasView": "Вид холста",
|
|
4889
|
-
"documentViewAria": "Вид документа",
|
|
4890
|
-
"editMode": "Режим редактирования",
|
|
4891
|
-
"viewMode": "Режим просмотра",
|
|
4892
|
-
"published": "Опубликовано",
|
|
4893
|
-
"documentModeAria": "Режим документа",
|
|
4894
|
-
"documentAvatarAria": "Аватар документа",
|
|
4895
|
-
"editAvatarAria": "Изменить аватар документа",
|
|
4896
|
-
"editAvatar": "Изменить аватар",
|
|
4897
|
-
"documentTitleAria": "Заголовок документа",
|
|
4898
|
-
"editTitleAria": "Изменить заголовок документа",
|
|
4899
|
-
"editTitle": "Изменить заголовок"
|
|
4900
|
-
},
|
|
4901
|
-
formatToolbar: {
|
|
4902
|
-
"aria": "Форматирование текста",
|
|
4903
|
-
"marks": {
|
|
4904
|
-
"bold": "Жирный",
|
|
4905
|
-
"code": "Моноширинный",
|
|
4906
|
-
"italic": "Курсив",
|
|
4907
|
-
"underline": "Подчёркнутый",
|
|
4908
|
-
"strike": "Зачёркнутый"
|
|
4909
|
-
},
|
|
4910
|
-
"align": {
|
|
4911
|
-
"left": "Выровнять по левому краю",
|
|
4912
|
-
"center": "Выровнять по центру",
|
|
4913
|
-
"right": "Выровнять по правому краю"
|
|
4914
|
-
},
|
|
4915
|
-
"listType": "Тип списка",
|
|
4916
|
-
"lists": {
|
|
4917
|
-
"bullet": "Маркированный список",
|
|
4918
|
-
"number": "Нумерованный список",
|
|
4919
|
-
"task": "Список задач",
|
|
4920
|
-
"quote": "Цитата",
|
|
4921
|
-
"paragraph": "Текст"
|
|
4922
|
-
},
|
|
4923
|
-
"callout": {
|
|
4924
|
-
"typeAria": "Тип выноски",
|
|
4925
|
-
"variant": "Выноска: {variant}",
|
|
4926
|
-
"iconAria": "Иконка выноски"
|
|
4927
|
-
},
|
|
4928
|
-
"color": {
|
|
4929
|
-
"trigger": "Цвет текста и фона",
|
|
4930
|
-
"targetGroupAria": "Объект изменения цвета",
|
|
4931
|
-
"highlightAria": "Выделить фон",
|
|
4932
|
-
"textAria": "Окрасить текст",
|
|
4933
|
-
"highlightLabel": "фон",
|
|
4934
|
-
"textLabel": "текст"
|
|
4935
|
-
},
|
|
4936
|
-
"palette": {
|
|
4937
|
-
"callout": "выноска",
|
|
4938
|
-
"highlight": "выделение",
|
|
4939
|
-
"text": "текст"
|
|
4940
|
-
}
|
|
4941
|
-
},
|
|
4942
|
-
mention: {
|
|
4943
|
-
"searching": "Поиск…",
|
|
4944
|
-
"people": "Люди",
|
|
4945
|
-
"documents": "Документы",
|
|
4946
|
-
"error": "Не удалось загрузить результаты упоминаний.",
|
|
4947
|
-
"retry": "Повторить"
|
|
4948
|
-
},
|
|
4949
|
-
shared: {
|
|
4950
|
-
"swatch": "{label}: цвет {index}",
|
|
4951
|
-
"emojiPickerGroup": "Эмодзи аватара",
|
|
4952
|
-
"removeAvatar": "Удалить аватар",
|
|
4953
|
-
"clearTime": "Очистить время"
|
|
4954
|
-
}
|
|
4955
|
-
};
|
|
4956
|
-
//#endregion
|
|
4957
|
-
//#region src/i18n/locales/ru/frame.json
|
|
4958
|
-
var frame_default = { page: {
|
|
4959
|
-
"missing": "Фрейм не найден",
|
|
4960
|
-
"windowLabel": "Фрейм",
|
|
4961
|
-
"windowTitle": "Фрейм: {title}"
|
|
4962
|
-
} };
|
|
4963
|
-
//#endregion
|
|
4964
|
-
//#region src/i18n/locales/ru/slash.json
|
|
4965
|
-
var slash_default = {
|
|
4966
|
-
blocks: {
|
|
4967
|
-
"text": "Текст",
|
|
4968
|
-
"heading1": "Заголовок 1",
|
|
4969
|
-
"heading2": "Заголовок 2",
|
|
4970
|
-
"heading3": "Заголовок 3",
|
|
4971
|
-
"quote": "Цитата",
|
|
4972
|
-
"callout": "Выноска",
|
|
4973
|
-
"code": "Блок кода",
|
|
4974
|
-
"codeMermaid": "Блок кода (mermaid)",
|
|
4975
|
-
"divider": "Разделитель",
|
|
4976
|
-
"file": "Файл",
|
|
4977
|
-
"embed": "Встраивание",
|
|
4978
|
-
"database": "База данных",
|
|
4979
|
-
"frame": "Фрейм",
|
|
4980
|
-
"table": "Таблица"
|
|
4981
|
-
},
|
|
4982
|
-
lists: {
|
|
4983
|
-
"bulleted": "Маркированный список",
|
|
4984
|
-
"numbered": "Нумерованный список",
|
|
4985
|
-
"task": "Список задач"
|
|
4986
|
-
},
|
|
4987
|
-
database: {
|
|
4988
|
-
"newTable": "Новая таблица",
|
|
4989
|
-
"namePlaceholder": "Название таблицы",
|
|
4990
|
-
"searchPlaceholder": "Поиск таблиц…",
|
|
4991
|
-
"loading": "Загрузка таблиц…",
|
|
4992
|
-
"noMatch": "Таблицы не найдены",
|
|
4993
|
-
"empty": "Таблиц пока нет — создайте новую выше."
|
|
4994
|
-
},
|
|
4995
|
-
frame: {
|
|
4996
|
-
"fallback": "Фрейм",
|
|
4997
|
-
"searchAria": "Поиск фреймов",
|
|
4998
|
-
"searchPlaceholder": "Поиск фреймов…",
|
|
4999
|
-
"noMatch": "Фреймы не найдены",
|
|
5000
|
-
"empty": "На холсте пока нет фреймов"
|
|
5001
|
-
},
|
|
5002
|
-
embed: {
|
|
5003
|
-
"urlPlaceholder": "URL встраивания (https://…)",
|
|
5004
|
-
"unsafeHint": "Поддерживаются только абсолютные URL http(s)://."
|
|
5005
|
-
}
|
|
5006
|
-
};
|
|
5007
|
-
//#endregion
|
|
5008
|
-
//#region src/i18n/locales/ru/table.json
|
|
5009
|
-
var table_default = {
|
|
5010
|
-
handle: {
|
|
5011
|
-
"columnOptions": "Настройки столбца {index}",
|
|
5012
|
-
"rowOptions": "Настройки строки {index}",
|
|
5013
|
-
"columnMenu": "Настройки столбца",
|
|
5014
|
-
"rowMenu": "Настройки строки"
|
|
5015
|
-
},
|
|
5016
|
-
menu: {
|
|
5017
|
-
"background": "Фон",
|
|
5018
|
-
"backgroundSwatch": "Фон {color}",
|
|
5019
|
-
"removeBackground": "Убрать фон",
|
|
5020
|
-
"insertRight": "Вставить справа",
|
|
5021
|
-
"insertLeft": "Вставить слева",
|
|
5022
|
-
"insertBelow": "Вставить ниже",
|
|
5023
|
-
"insertAbove": "Вставить выше",
|
|
5024
|
-
"moveRight": "Переместить вправо",
|
|
5025
|
-
"moveLeft": "Переместить влево",
|
|
5026
|
-
"moveDown": "Переместить вниз",
|
|
5027
|
-
"moveUp": "Переместить вверх",
|
|
5028
|
-
"clearContent": "Очистить содержимое"
|
|
5029
|
-
},
|
|
5030
|
-
resize: { "column": "Изменить ширину столбца {index}" },
|
|
5031
|
-
add: {
|
|
5032
|
-
"column": "Добавить столбец",
|
|
5033
|
-
"row": "Добавить строку"
|
|
5034
|
-
},
|
|
5035
|
-
cell: { "options": "Настройки ячейки" }
|
|
5036
|
-
};
|
|
5037
|
-
//#endregion
|
|
5038
4161
|
//#region src/i18n/instance.ts
|
|
5039
|
-
/**
|
|
5040
|
-
|
|
5041
|
-
* `ru-RU` stands `ru`, `en-US` stands `en`): the absent / unknown language
|
|
5042
|
-
* falls back to `en`. The library language is consumer-driven — the only
|
|
5043
|
-
* source is the `<html lang>` attribute (no locale prop).
|
|
5044
|
-
*/
|
|
5045
|
-
function resolveDocblocksLang() {
|
|
5046
|
-
return (typeof document === "undefined" ? "" : document.documentElement.lang ?? "").trim().toLowerCase().startsWith("ru") ? "ru" : "en";
|
|
5047
|
-
}
|
|
5048
|
-
/**
|
|
5049
|
-
* The package's OWN i18next instance (not the global singleton): it is
|
|
5050
|
-
* initialized over the package's shipped en+ru catalogs and never touches
|
|
5051
|
-
* the consumer's i18next setup (the `I18nextProvider` over the docblocks'
|
|
5052
|
-
* subtree routes `useTranslation` here). The inline resources resolve
|
|
5053
|
-
* synchronously, so the instance is ready by the first render.
|
|
5054
|
-
*/
|
|
5055
|
-
const docblocksI18n = createInstance().use(initReactI18next);
|
|
5056
|
-
docblocksI18n.init({
|
|
4162
|
+
/** The i18next init's options over the package's catalogs (the inline resources resolve synchronously — the instance is ready by the first render). */
|
|
4163
|
+
const INIT_OPTIONS = {
|
|
5057
4164
|
resources: {
|
|
5058
4165
|
en: {
|
|
5059
|
-
blocks:
|
|
5060
|
-
|
|
5061
|
-
|
|
5062
|
-
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
|
|
4166
|
+
blocks: {
|
|
4167
|
+
row: {
|
|
4168
|
+
"selectBlock": "Select block",
|
|
4169
|
+
"addBlockBelow": "Add block below",
|
|
4170
|
+
"deleteBlock": "Delete block"
|
|
4171
|
+
},
|
|
4172
|
+
task: {
|
|
4173
|
+
"markDone": "Mark task as done",
|
|
4174
|
+
"markNotDone": "Mark task as not done"
|
|
4175
|
+
},
|
|
4176
|
+
collapse: {
|
|
4177
|
+
"expand": "Expand children",
|
|
4178
|
+
"collapse": "Collapse children"
|
|
4179
|
+
},
|
|
4180
|
+
caption: {
|
|
4181
|
+
"placeholder": "Write a caption…",
|
|
4182
|
+
"edit": "Edit the caption",
|
|
4183
|
+
"add": "Add a caption",
|
|
4184
|
+
"aria": "Caption",
|
|
4185
|
+
"imageAria": "Image caption"
|
|
4186
|
+
},
|
|
4187
|
+
code: {
|
|
4188
|
+
"language": "Code language",
|
|
4189
|
+
"chooseLanguage": "Choose the code language",
|
|
4190
|
+
"searchPlaceholder": "Search language…",
|
|
4191
|
+
"searchAria": "Search language",
|
|
4192
|
+
"languages": "Languages",
|
|
4193
|
+
"copy": "Copy the code",
|
|
4194
|
+
"expand": "Expand the code",
|
|
4195
|
+
"collapse": "Collapse the code",
|
|
4196
|
+
"expandTitle": "Expand",
|
|
4197
|
+
"collapseTitle": "Collapse",
|
|
4198
|
+
"options": "Code options",
|
|
4199
|
+
"lineNumbers": "Line numbers",
|
|
4200
|
+
"wrap": "Wrap long lines",
|
|
4201
|
+
"rendering": "rendering…",
|
|
4202
|
+
"pdfPreviewUnavailable": "PDF preview unavailable ({error}). Showing the built-in viewer.",
|
|
4203
|
+
"pdfLoading": "loading preview…",
|
|
4204
|
+
"pdfPrevPage": "Previous page",
|
|
4205
|
+
"pdfNextPage": "Next page",
|
|
4206
|
+
"pdfFullscreen": "Expand to fullscreen",
|
|
4207
|
+
"pdfCloseFullscreen": "Close fullscreen"
|
|
4208
|
+
},
|
|
4209
|
+
image: {
|
|
4210
|
+
"placeholder": "image",
|
|
4211
|
+
"document": "document",
|
|
4212
|
+
"resize": "Resize the image",
|
|
4213
|
+
"download": "Download the image",
|
|
4214
|
+
"downloadTitle": "Download"
|
|
4215
|
+
},
|
|
4216
|
+
embed: {
|
|
4217
|
+
"zoomIn": "Zoom in",
|
|
4218
|
+
"zoomOut": "Zoom out",
|
|
4219
|
+
"zoomReset": "Reset zoom",
|
|
4220
|
+
"resizeHeight": "Resize embed height",
|
|
4221
|
+
"editUrl": "Edit URL",
|
|
4222
|
+
"saveUrl": "Save URL",
|
|
4223
|
+
"cancelEdit": "Cancel",
|
|
4224
|
+
"srcPlaceholder": "Embed URL (https://…)",
|
|
4225
|
+
"unsafeHint": "Only absolute http(s):// URLs are supported."
|
|
4226
|
+
},
|
|
4227
|
+
syncEmbed: {
|
|
4228
|
+
"broken": "The master document for this synced block is unavailable.",
|
|
4229
|
+
"cycle": "Circular synced block reference."
|
|
4230
|
+
},
|
|
4231
|
+
align: {
|
|
4232
|
+
"left": "Align left",
|
|
4233
|
+
"center": "Align center",
|
|
4234
|
+
"right": "Align right"
|
|
4235
|
+
},
|
|
4236
|
+
rowCount_one: "row",
|
|
4237
|
+
rowCount_few: "rows",
|
|
4238
|
+
rowCount_many: "rows",
|
|
4239
|
+
rowCount_other: "rows",
|
|
4240
|
+
error: { "render": "Could not be rendered" }
|
|
4241
|
+
},
|
|
4242
|
+
canvas: {
|
|
4243
|
+
view: { "label": "Canvas" },
|
|
4244
|
+
dock: {
|
|
4245
|
+
"toolbar": "Canvas tools",
|
|
4246
|
+
"modeSelect": "Switch to the select mode",
|
|
4247
|
+
"modePan": "Switch to the pan mode",
|
|
4248
|
+
"shapes": "Shapes",
|
|
4249
|
+
"shapesMenu": "Shapes menu",
|
|
4250
|
+
"text": "Text",
|
|
4251
|
+
"frame": "Frame",
|
|
4252
|
+
"container": "Container",
|
|
4253
|
+
"connector": "Connector",
|
|
4254
|
+
"pen": "Pen"
|
|
4255
|
+
},
|
|
4256
|
+
shapes: {
|
|
4257
|
+
"rect": "Rectangle",
|
|
4258
|
+
"rounded": "Rounded Rectangle",
|
|
4259
|
+
"ellipse": "Ellipse",
|
|
4260
|
+
"diamond": "Diamond",
|
|
4261
|
+
"cylinder": "Cylinder",
|
|
4262
|
+
"cloud": "Cloud"
|
|
4263
|
+
},
|
|
4264
|
+
item: {
|
|
4265
|
+
"shape": "Shape block",
|
|
4266
|
+
"text": "Text block",
|
|
4267
|
+
"frame": "Frame block",
|
|
4268
|
+
"group": "Group block",
|
|
4269
|
+
"connector": "Connector block",
|
|
4270
|
+
"other": "{type} block"
|
|
4271
|
+
},
|
|
4272
|
+
zoom: {
|
|
4273
|
+
"toolbar": "Canvas zoom",
|
|
4274
|
+
"fit": "Fit to screen",
|
|
4275
|
+
"out": "Zoom out",
|
|
4276
|
+
"in": "Zoom in",
|
|
4277
|
+
"reset": "Reset zoom"
|
|
4278
|
+
},
|
|
4279
|
+
connector: {
|
|
4280
|
+
"toolbar": "Connector options",
|
|
4281
|
+
"labelEdit": "Connector label",
|
|
4282
|
+
"straight": "Straight line",
|
|
4283
|
+
"orthogonal": "Orthogonal line",
|
|
4284
|
+
"curved": "Curved line",
|
|
4285
|
+
"lineColor": "Line color",
|
|
4286
|
+
"lineWidth": "Line width",
|
|
4287
|
+
"lineWidthTitle": "Line width (1–4 px)",
|
|
4288
|
+
"solid": "Solid line",
|
|
4289
|
+
"dashed": "Dashed line",
|
|
4290
|
+
"arrowheadStart": "Start arrowhead",
|
|
4291
|
+
"arrowheadEnd": "End arrowhead",
|
|
4292
|
+
"arrowheadsStart": "Start arrowheads",
|
|
4293
|
+
"arrowheadsEnd": "End arrowheads",
|
|
4294
|
+
"arrowheadArrow": "Arrow",
|
|
4295
|
+
"arrowheadCircle": "Circle",
|
|
4296
|
+
"arrowheadNone": "None",
|
|
4297
|
+
"arrange": "Arrange line"
|
|
4298
|
+
},
|
|
4299
|
+
shape: {
|
|
4300
|
+
"toolbar": "Shape options",
|
|
4301
|
+
"type": "Shape type",
|
|
4302
|
+
"types": "Shape types",
|
|
4303
|
+
"addText": "Add text",
|
|
4304
|
+
"addTextTitle": "Add text (or double-click the shape)",
|
|
4305
|
+
"fillColor": "Shape fill color",
|
|
4306
|
+
"strokeColor": "Shape stroke color",
|
|
4307
|
+
"borderWidth": "Shape border width",
|
|
4308
|
+
"borderWidthTitle": "Border width (1–4 px)",
|
|
4309
|
+
"borderStyle": "Shape border style",
|
|
4310
|
+
"borderStyleTitle": "Border style",
|
|
4311
|
+
"borderStyles": "Border styles",
|
|
4312
|
+
"solid": "Solid line",
|
|
4313
|
+
"dashed": "Dashed",
|
|
4314
|
+
"borderNone": "No border",
|
|
4315
|
+
"arrange": "Arrange shape"
|
|
4316
|
+
},
|
|
4317
|
+
zorder: {
|
|
4318
|
+
"title": "Arrange (z-order)",
|
|
4319
|
+
"bringForward": "Bring forward",
|
|
4320
|
+
"bringToFront": "Bring to front",
|
|
4321
|
+
"sendBackward": "Send backward",
|
|
4322
|
+
"sendToBack": "Send to back"
|
|
4323
|
+
},
|
|
4324
|
+
text: {
|
|
4325
|
+
"toolbar": "Text options",
|
|
4326
|
+
"arrange": "Arrange text",
|
|
4327
|
+
"fontFamily": "Text font family",
|
|
4328
|
+
"color": "Text color",
|
|
4329
|
+
"style": "Text style",
|
|
4330
|
+
"fontSize": "Text font size",
|
|
4331
|
+
"alignLeft": "Align left",
|
|
4332
|
+
"alignCenter": "Align center",
|
|
4333
|
+
"alignRight": "Align right"
|
|
4334
|
+
},
|
|
4335
|
+
titleChip: {
|
|
4336
|
+
"button": "Title",
|
|
4337
|
+
"setContainerTitle": "Set container title",
|
|
4338
|
+
"setFrameTitle": "Set frame title",
|
|
4339
|
+
"containerTitle": "Container title",
|
|
4340
|
+
"frameTitle": "Frame title"
|
|
4341
|
+
},
|
|
4342
|
+
colorHex: "{label} hex value"
|
|
4343
|
+
},
|
|
4344
|
+
common: {
|
|
4345
|
+
copy: "Copy",
|
|
4346
|
+
"delete": "Delete",
|
|
4347
|
+
rename: "Rename",
|
|
4348
|
+
clear: "Clear",
|
|
4349
|
+
duplicate: "Duplicate",
|
|
4350
|
+
paste: "Paste",
|
|
4351
|
+
options: "Options",
|
|
4352
|
+
moreOptions: "More options",
|
|
4353
|
+
untitled: "Untitled",
|
|
4354
|
+
noMatches: "No matches",
|
|
4355
|
+
noOptions: "No options.",
|
|
4356
|
+
newTable: "New table…",
|
|
4357
|
+
search: "Search…",
|
|
4358
|
+
color: {
|
|
4359
|
+
"custom": "Custom color",
|
|
4360
|
+
"none": "No color"
|
|
4361
|
+
},
|
|
4362
|
+
access: {
|
|
4363
|
+
"notPublished": "This document has not been published yet.",
|
|
4364
|
+
"notPublishedHint": "Readers see the document only after it has been published."
|
|
4365
|
+
},
|
|
4366
|
+
colorPicker: {
|
|
4367
|
+
"aria": "Color picker",
|
|
4368
|
+
"hexAria": "Hex color value"
|
|
4369
|
+
}
|
|
4370
|
+
},
|
|
4371
|
+
database: {
|
|
4372
|
+
state: {
|
|
4373
|
+
"loading": "Loading the table…",
|
|
4374
|
+
"notFound": "Table not found",
|
|
4375
|
+
"unknownTable": "The table \"{tableId}\" is unknown to the bridge.",
|
|
4376
|
+
"retry": "Retry"
|
|
4377
|
+
},
|
|
4378
|
+
rowCount_one: "row",
|
|
4379
|
+
rowCount_few: "rows",
|
|
4380
|
+
rowCount_many: "rows",
|
|
4381
|
+
rowCount_other: "rows",
|
|
4382
|
+
toolbar: {
|
|
4383
|
+
"undo": "Undo",
|
|
4384
|
+
"redo": "Redo",
|
|
4385
|
+
"filter": "Filter",
|
|
4386
|
+
"apply": "Apply"
|
|
4387
|
+
},
|
|
4388
|
+
columnTypes: {
|
|
4389
|
+
"text": "Text",
|
|
4390
|
+
"integer": "Integer",
|
|
4391
|
+
"decimal": "Decimal",
|
|
4392
|
+
"checkbox": "Checkbox",
|
|
4393
|
+
"date": "Date",
|
|
4394
|
+
"datetime": "Date & time",
|
|
4395
|
+
"enum": "Enum",
|
|
4396
|
+
"multiEnum": "Multi-enum",
|
|
4397
|
+
"rowLink": "Row link",
|
|
4398
|
+
"rowLinks": "Row links"
|
|
4399
|
+
},
|
|
4400
|
+
form: {
|
|
4401
|
+
"name": "Name",
|
|
4402
|
+
"decimals": "Decimals",
|
|
4403
|
+
"thousandsSeparator": "Thousands' separator",
|
|
4404
|
+
"prefix": "Prefix",
|
|
4405
|
+
"suffix": "Suffix",
|
|
4406
|
+
"allowNegative": "Allow negative",
|
|
4407
|
+
"table": "Table",
|
|
4408
|
+
"selectTable": "— Select a table —",
|
|
4409
|
+
"newTableName": "New table name",
|
|
4410
|
+
"save": "Save",
|
|
4411
|
+
"addColumn": "Add column"
|
|
4412
|
+
},
|
|
4413
|
+
"enum": {
|
|
4414
|
+
"options": "Options",
|
|
4415
|
+
"optionColor": "Option's color",
|
|
4416
|
+
"optionColorAria": "option color",
|
|
4417
|
+
"optionPlaceholder": "Option",
|
|
4418
|
+
"addOption": "+ Add option"
|
|
4419
|
+
},
|
|
4420
|
+
header: {
|
|
4421
|
+
"editOptions": "Edit options",
|
|
4422
|
+
"show": "Show column",
|
|
4423
|
+
"hide": "Hide column",
|
|
4424
|
+
"delete": "Delete column"
|
|
4425
|
+
},
|
|
4426
|
+
row: {
|
|
4427
|
+
"moveUp": "Move up",
|
|
4428
|
+
"moveDown": "Move down",
|
|
4429
|
+
"delete": "Delete row"
|
|
4430
|
+
},
|
|
4431
|
+
rows: {
|
|
4432
|
+
"loadMore": "Load more rows",
|
|
4433
|
+
"none": "No rows.",
|
|
4434
|
+
"noneFiltered": "No rows match the filter.",
|
|
4435
|
+
"add": "+ Add row"
|
|
4436
|
+
},
|
|
4437
|
+
filter: {
|
|
4438
|
+
"empty": "No columns to filter on.",
|
|
4439
|
+
"logic": "Filter logic",
|
|
4440
|
+
"matchAll": "match all of the conditions",
|
|
4441
|
+
"matchAny": "match any of the conditions",
|
|
4442
|
+
"nestedGroup": "{logic} nested group",
|
|
4443
|
+
"removeGroup": "Remove group",
|
|
4444
|
+
"condition": "+ Condition",
|
|
4445
|
+
"group": "+ Group",
|
|
4446
|
+
"valuePlaceholder": "value, value"
|
|
4447
|
+
},
|
|
4448
|
+
picker: {
|
|
4449
|
+
"searchOptions": "Search options",
|
|
4450
|
+
"searchRows": "Search rows"
|
|
4451
|
+
},
|
|
4452
|
+
disconnected: {
|
|
4453
|
+
"name": "Database",
|
|
4454
|
+
"note": "database not connected"
|
|
4455
|
+
}
|
|
4456
|
+
},
|
|
4457
|
+
editor: {
|
|
4458
|
+
docHeader: {
|
|
4459
|
+
"pageView": "Page view",
|
|
4460
|
+
"canvasView": "Canvas view",
|
|
4461
|
+
"documentViewAria": "Document view",
|
|
4462
|
+
"editMode": "Edit mode",
|
|
4463
|
+
"viewMode": "View mode",
|
|
4464
|
+
"published": "Published",
|
|
4465
|
+
"documentModeAria": "Document mode",
|
|
4466
|
+
"documentAvatarAria": "Document avatar",
|
|
4467
|
+
"editAvatarAria": "Edit the document avatar",
|
|
4468
|
+
"editAvatar": "Edit the avatar",
|
|
4469
|
+
"documentTitleAria": "Document title",
|
|
4470
|
+
"editTitleAria": "Edit the document title",
|
|
4471
|
+
"editTitle": "Edit the title"
|
|
4472
|
+
},
|
|
4473
|
+
formatToolbar: {
|
|
4474
|
+
"aria": "Text formatting",
|
|
4475
|
+
"marks": {
|
|
4476
|
+
"bold": "Bold",
|
|
4477
|
+
"code": "Monospace",
|
|
4478
|
+
"italic": "Italic",
|
|
4479
|
+
"underline": "Underline",
|
|
4480
|
+
"strike": "Strikethrough"
|
|
4481
|
+
},
|
|
4482
|
+
"align": {
|
|
4483
|
+
"left": "Align left",
|
|
4484
|
+
"center": "Align center",
|
|
4485
|
+
"right": "Align right"
|
|
4486
|
+
},
|
|
4487
|
+
"listType": "List type",
|
|
4488
|
+
"lists": {
|
|
4489
|
+
"bullet": "Bullet list",
|
|
4490
|
+
"number": "Numbered list",
|
|
4491
|
+
"task": "To-do list",
|
|
4492
|
+
"quote": "Quote",
|
|
4493
|
+
"paragraph": "Text"
|
|
4494
|
+
},
|
|
4495
|
+
"callout": {
|
|
4496
|
+
"typeAria": "Callout type",
|
|
4497
|
+
"variant": "{variant} callout",
|
|
4498
|
+
"iconAria": "Callout icon"
|
|
4499
|
+
},
|
|
4500
|
+
"color": {
|
|
4501
|
+
"trigger": "Text and background color",
|
|
4502
|
+
"targetGroupAria": "Color target",
|
|
4503
|
+
"highlightAria": "Highlight the background",
|
|
4504
|
+
"textAria": "Color the text",
|
|
4505
|
+
"highlightLabel": "bg",
|
|
4506
|
+
"textLabel": "text"
|
|
4507
|
+
},
|
|
4508
|
+
"palette": {
|
|
4509
|
+
"callout": "callout",
|
|
4510
|
+
"highlight": "highlight",
|
|
4511
|
+
"text": "text"
|
|
4512
|
+
}
|
|
4513
|
+
},
|
|
4514
|
+
mention: {
|
|
4515
|
+
"searching": "Searching…",
|
|
4516
|
+
"people": "People",
|
|
4517
|
+
"documents": "Documents",
|
|
4518
|
+
"error": "Couldn't load mention results.",
|
|
4519
|
+
"retry": "Retry"
|
|
4520
|
+
},
|
|
4521
|
+
shared: {
|
|
4522
|
+
"swatch": "{label} color {index}",
|
|
4523
|
+
"emojiPickerGroup": "Avatar emoji",
|
|
4524
|
+
"removeAvatar": "Remove avatar",
|
|
4525
|
+
"clearTime": "Clear the time"
|
|
4526
|
+
}
|
|
4527
|
+
},
|
|
4528
|
+
frame: { page: {
|
|
4529
|
+
"missing": "Frame not found",
|
|
4530
|
+
"windowLabel": "Frame",
|
|
4531
|
+
"windowTitle": "Frame: {title}"
|
|
4532
|
+
} },
|
|
4533
|
+
slash: {
|
|
4534
|
+
blocks: {
|
|
4535
|
+
"text": "Text",
|
|
4536
|
+
"heading1": "Heading 1",
|
|
4537
|
+
"heading2": "Heading 2",
|
|
4538
|
+
"heading3": "Heading 3",
|
|
4539
|
+
"quote": "Quote",
|
|
4540
|
+
"callout": "Callout",
|
|
4541
|
+
"code": "Code block",
|
|
4542
|
+
"codeMermaid": "Code block (mermaid)",
|
|
4543
|
+
"divider": "Divider",
|
|
4544
|
+
"file": "File",
|
|
4545
|
+
"embed": "Embed",
|
|
4546
|
+
"database": "Database",
|
|
4547
|
+
"frame": "Frame",
|
|
4548
|
+
"table": "Table"
|
|
4549
|
+
},
|
|
4550
|
+
lists: {
|
|
4551
|
+
"bulleted": "Bulleted list",
|
|
4552
|
+
"numbered": "Numbered list",
|
|
4553
|
+
"task": "Task list"
|
|
4554
|
+
},
|
|
4555
|
+
database: {
|
|
4556
|
+
"newTable": "New table",
|
|
4557
|
+
"namePlaceholder": "New table name",
|
|
4558
|
+
"searchPlaceholder": "Search tables…",
|
|
4559
|
+
"loading": "Loading the tables…",
|
|
4560
|
+
"noMatch": "No tables match",
|
|
4561
|
+
"empty": "No tables yet — create one above."
|
|
4562
|
+
},
|
|
4563
|
+
frame: {
|
|
4564
|
+
"fallback": "Frame",
|
|
4565
|
+
"searchAria": "Search frames",
|
|
4566
|
+
"searchPlaceholder": "Search frames...",
|
|
4567
|
+
"noMatch": "No frames match",
|
|
4568
|
+
"empty": "No frames on the canvas yet"
|
|
4569
|
+
},
|
|
4570
|
+
embed: {
|
|
4571
|
+
"urlPlaceholder": "Embed URL (https://…)",
|
|
4572
|
+
"unsafeHint": "Only absolute http(s):// URLs are supported."
|
|
4573
|
+
}
|
|
4574
|
+
},
|
|
4575
|
+
table: {
|
|
4576
|
+
handle: {
|
|
4577
|
+
"columnOptions": "Column {index} options",
|
|
4578
|
+
"rowOptions": "Row {index} options",
|
|
4579
|
+
"columnMenu": "Column options",
|
|
4580
|
+
"rowMenu": "Row options"
|
|
4581
|
+
},
|
|
4582
|
+
menu: {
|
|
4583
|
+
"background": "Background",
|
|
4584
|
+
"backgroundSwatch": "Background {color}",
|
|
4585
|
+
"removeBackground": "Remove background",
|
|
4586
|
+
"insertRight": "Insert right",
|
|
4587
|
+
"insertLeft": "Insert left",
|
|
4588
|
+
"insertBelow": "Insert below",
|
|
4589
|
+
"insertAbove": "Insert above",
|
|
4590
|
+
"moveRight": "Move right",
|
|
4591
|
+
"moveLeft": "Move left",
|
|
4592
|
+
"moveDown": "Move down",
|
|
4593
|
+
"moveUp": "Move up",
|
|
4594
|
+
"clearContent": "Clear content"
|
|
4595
|
+
},
|
|
4596
|
+
resize: { "column": "Resize column {index}" },
|
|
4597
|
+
add: {
|
|
4598
|
+
"column": "Add column",
|
|
4599
|
+
"row": "Add row"
|
|
4600
|
+
},
|
|
4601
|
+
cell: { "options": "Cell options" }
|
|
4602
|
+
}
|
|
5067
4603
|
},
|
|
5068
4604
|
ru: {
|
|
5069
|
-
blocks:
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
|
|
5074
|
-
|
|
5075
|
-
|
|
5076
|
-
|
|
4605
|
+
blocks: {
|
|
4606
|
+
row: {
|
|
4607
|
+
"selectBlock": "Выбрать блок",
|
|
4608
|
+
"addBlockBelow": "Добавить блок ниже",
|
|
4609
|
+
"deleteBlock": "Удалить блок"
|
|
4610
|
+
},
|
|
4611
|
+
task: {
|
|
4612
|
+
"markDone": "Отметить задачу выполненной",
|
|
4613
|
+
"markNotDone": "Снять отметку о выполнении"
|
|
4614
|
+
},
|
|
4615
|
+
collapse: {
|
|
4616
|
+
"expand": "Развернуть вложенные блоки",
|
|
4617
|
+
"collapse": "Свернуть вложенные блоки"
|
|
4618
|
+
},
|
|
4619
|
+
caption: {
|
|
4620
|
+
"placeholder": "Напишите подпись…",
|
|
4621
|
+
"edit": "Изменить подпись",
|
|
4622
|
+
"add": "Добавить подпись",
|
|
4623
|
+
"aria": "Подпись",
|
|
4624
|
+
"imageAria": "Подпись к изображению"
|
|
4625
|
+
},
|
|
4626
|
+
code: {
|
|
4627
|
+
"language": "Язык кода",
|
|
4628
|
+
"chooseLanguage": "Выбрать язык кода",
|
|
4629
|
+
"searchPlaceholder": "Поиск языка…",
|
|
4630
|
+
"searchAria": "Поиск языка",
|
|
4631
|
+
"languages": "Языки",
|
|
4632
|
+
"copy": "Копировать код",
|
|
4633
|
+
"expand": "Развернуть код",
|
|
4634
|
+
"collapse": "Свернуть код",
|
|
4635
|
+
"expandTitle": "Развернуть",
|
|
4636
|
+
"collapseTitle": "Свернуть",
|
|
4637
|
+
"options": "Настройки кода",
|
|
4638
|
+
"lineNumbers": "Номера строк",
|
|
4639
|
+
"wrap": "Переносить длинные строки",
|
|
4640
|
+
"rendering": "Рисование…",
|
|
4641
|
+
"pdfPreviewUnavailable": "Превью PDF недоступно ({error}). Показан встроенный просмотрщик.",
|
|
4642
|
+
"pdfLoading": "Загрузка превью…",
|
|
4643
|
+
"pdfPrevPage": "Предыдущая страница",
|
|
4644
|
+
"pdfNextPage": "Следующая страница",
|
|
4645
|
+
"pdfFullscreen": "Развернуть на весь экран",
|
|
4646
|
+
"pdfCloseFullscreen": "Закрыть полноэкранный режим"
|
|
4647
|
+
},
|
|
4648
|
+
image: {
|
|
4649
|
+
"placeholder": "изображение",
|
|
4650
|
+
"document": "документ",
|
|
4651
|
+
"resize": "Изменить размер изображения",
|
|
4652
|
+
"download": "Скачать изображение",
|
|
4653
|
+
"downloadTitle": "Скачать"
|
|
4654
|
+
},
|
|
4655
|
+
embed: {
|
|
4656
|
+
"zoomIn": "Приблизить",
|
|
4657
|
+
"zoomOut": "Отдалить",
|
|
4658
|
+
"zoomReset": "Сбросить масштаб",
|
|
4659
|
+
"resizeHeight": "Изменить высоту встраивания",
|
|
4660
|
+
"editUrl": "Изменить ссылку",
|
|
4661
|
+
"saveUrl": "Сохранить ссылку",
|
|
4662
|
+
"cancelEdit": "Отмена",
|
|
4663
|
+
"srcPlaceholder": "URL встраивания (https://…)",
|
|
4664
|
+
"unsafeHint": "Поддерживаются только абсолютные URL http(s)://."
|
|
4665
|
+
},
|
|
4666
|
+
syncEmbed: {
|
|
4667
|
+
"broken": "Мастер-документ для этого синхронизируемого блока недоступен.",
|
|
4668
|
+
"cycle": "Циклическая ссылка синхронизируемого блока."
|
|
4669
|
+
},
|
|
4670
|
+
align: {
|
|
4671
|
+
"left": "Выровнять по левому краю",
|
|
4672
|
+
"center": "Выровнять по центру",
|
|
4673
|
+
"right": "Выровнять по правому краю"
|
|
4674
|
+
},
|
|
4675
|
+
rowCount_one: "строка",
|
|
4676
|
+
rowCount_few: "строки",
|
|
4677
|
+
rowCount_many: "строк",
|
|
4678
|
+
rowCount_other: "строк",
|
|
4679
|
+
error: { "render": "Не удалось отобразить" }
|
|
4680
|
+
},
|
|
4681
|
+
canvas: {
|
|
4682
|
+
view: { "label": "Холст" },
|
|
4683
|
+
dock: {
|
|
4684
|
+
"toolbar": "Инструменты холста",
|
|
4685
|
+
"modeSelect": "Переключиться в режим выделения",
|
|
4686
|
+
"modePan": "Переключиться в режим перемещения",
|
|
4687
|
+
"shapes": "Фигуры",
|
|
4688
|
+
"shapesMenu": "Меню фигур",
|
|
4689
|
+
"text": "Текст",
|
|
4690
|
+
"frame": "Фрейм",
|
|
4691
|
+
"container": "Контейнер",
|
|
4692
|
+
"connector": "Соединитель",
|
|
4693
|
+
"pen": "Ручка"
|
|
4694
|
+
},
|
|
4695
|
+
shapes: {
|
|
4696
|
+
"rect": "Прямоугольник",
|
|
4697
|
+
"rounded": "Скруглённый прямоугольник",
|
|
4698
|
+
"ellipse": "Эллипс",
|
|
4699
|
+
"diamond": "Ромб",
|
|
4700
|
+
"cylinder": "Цилиндр",
|
|
4701
|
+
"cloud": "Облако"
|
|
4702
|
+
},
|
|
4703
|
+
item: {
|
|
4704
|
+
"shape": "Фигура",
|
|
4705
|
+
"text": "Текст",
|
|
4706
|
+
"frame": "Фрейм",
|
|
4707
|
+
"group": "Группа",
|
|
4708
|
+
"connector": "Соединитель",
|
|
4709
|
+
"other": "Блок {type}"
|
|
4710
|
+
},
|
|
4711
|
+
zoom: {
|
|
4712
|
+
"toolbar": "Масштаб холста",
|
|
4713
|
+
"fit": "Вписать в экран",
|
|
4714
|
+
"out": "Уменьшить масштаб",
|
|
4715
|
+
"in": "Увеличить масштаб",
|
|
4716
|
+
"reset": "Сбросить масштаб"
|
|
4717
|
+
},
|
|
4718
|
+
connector: {
|
|
4719
|
+
"toolbar": "Настройки соединителя",
|
|
4720
|
+
"labelEdit": "Подпись соединителя",
|
|
4721
|
+
"straight": "Прямая линия",
|
|
4722
|
+
"orthogonal": "Ортогональная линия",
|
|
4723
|
+
"curved": "Кривая линия",
|
|
4724
|
+
"lineColor": "Цвет линии",
|
|
4725
|
+
"lineWidth": "Толщина линии",
|
|
4726
|
+
"lineWidthTitle": "Толщина линии (1–4 px)",
|
|
4727
|
+
"solid": "Сплошная линия",
|
|
4728
|
+
"dashed": "Пунктирная линия",
|
|
4729
|
+
"arrowheadStart": "Стрелка начала",
|
|
4730
|
+
"arrowheadEnd": "Стрелка конца",
|
|
4731
|
+
"arrowheadsStart": "Стрелки начала",
|
|
4732
|
+
"arrowheadsEnd": "Стрелки конца",
|
|
4733
|
+
"arrowheadArrow": "Стрела",
|
|
4734
|
+
"arrowheadCircle": "Круг",
|
|
4735
|
+
"arrowheadNone": "Нет",
|
|
4736
|
+
"arrange": "Упорядочить линию"
|
|
4737
|
+
},
|
|
4738
|
+
shape: {
|
|
4739
|
+
"toolbar": "Настройки фигуры",
|
|
4740
|
+
"type": "Тип фигуры",
|
|
4741
|
+
"types": "Типы фигур",
|
|
4742
|
+
"addText": "Добавить текст",
|
|
4743
|
+
"addTextTitle": "Добавить текст (или двойной клик по фигуре)",
|
|
4744
|
+
"fillColor": "Цвет заливки фигуры",
|
|
4745
|
+
"strokeColor": "Цвет обводки фигуры",
|
|
4746
|
+
"borderWidth": "Толщина рамки фигуры",
|
|
4747
|
+
"borderWidthTitle": "Толщина рамки (1–4 px)",
|
|
4748
|
+
"borderStyle": "Стиль рамки фигуры",
|
|
4749
|
+
"borderStyleTitle": "Стиль рамки",
|
|
4750
|
+
"borderStyles": "Стили рамки",
|
|
4751
|
+
"solid": "Сплошная линия",
|
|
4752
|
+
"dashed": "Пунктир",
|
|
4753
|
+
"borderNone": "Без рамки",
|
|
4754
|
+
"arrange": "Упорядочить фигуру"
|
|
4755
|
+
},
|
|
4756
|
+
zorder: {
|
|
4757
|
+
"title": "Порядок (z-order)",
|
|
4758
|
+
"bringForward": "Выше",
|
|
4759
|
+
"bringToFront": "На передний план",
|
|
4760
|
+
"sendBackward": "Ниже",
|
|
4761
|
+
"sendToBack": "На задний план"
|
|
4762
|
+
},
|
|
4763
|
+
text: {
|
|
4764
|
+
"toolbar": "Настройки текста",
|
|
4765
|
+
"arrange": "Упорядочить текст",
|
|
4766
|
+
"fontFamily": "Шрифт текста",
|
|
4767
|
+
"color": "Цвет текста",
|
|
4768
|
+
"style": "Стиль текста",
|
|
4769
|
+
"fontSize": "Размер шрифта",
|
|
4770
|
+
"alignLeft": "Выровнять по левому краю",
|
|
4771
|
+
"alignCenter": "Выровнять по центру",
|
|
4772
|
+
"alignRight": "Выровнять по правому краю"
|
|
4773
|
+
},
|
|
4774
|
+
titleChip: {
|
|
4775
|
+
"button": "Заголовок",
|
|
4776
|
+
"setContainerTitle": "Установить заголовок контейнера",
|
|
4777
|
+
"setFrameTitle": "Установить заголовок фрейма",
|
|
4778
|
+
"containerTitle": "Заголовок контейнера",
|
|
4779
|
+
"frameTitle": "Заголовок фрейма"
|
|
4780
|
+
},
|
|
4781
|
+
colorHex: "{label} — HEX-значение"
|
|
4782
|
+
},
|
|
4783
|
+
common: {
|
|
4784
|
+
copy: "Копировать",
|
|
4785
|
+
"delete": "Удалить",
|
|
4786
|
+
rename: "Переименовать",
|
|
4787
|
+
clear: "Очистить",
|
|
4788
|
+
duplicate: "Дублировать",
|
|
4789
|
+
paste: "Вставить",
|
|
4790
|
+
options: "Параметры",
|
|
4791
|
+
moreOptions: "Ещё",
|
|
4792
|
+
untitled: "Без названия",
|
|
4793
|
+
noMatches: "Нет совпадений",
|
|
4794
|
+
noOptions: "Нет вариантов.",
|
|
4795
|
+
newTable: "Новая таблица…",
|
|
4796
|
+
search: "Поиск…",
|
|
4797
|
+
color: {
|
|
4798
|
+
"custom": "Свой цвет",
|
|
4799
|
+
"none": "Без цвета"
|
|
4800
|
+
},
|
|
4801
|
+
access: {
|
|
4802
|
+
"notPublished": "Документ ещё не опубликован.",
|
|
4803
|
+
"notPublishedHint": "Читатели увидят документ только после публикации."
|
|
4804
|
+
},
|
|
4805
|
+
colorPicker: {
|
|
4806
|
+
"aria": "Выбор цвета",
|
|
4807
|
+
"hexAria": "Цвет в hex-формате"
|
|
4808
|
+
}
|
|
4809
|
+
},
|
|
4810
|
+
database: {
|
|
4811
|
+
state: {
|
|
4812
|
+
"loading": "Загрузка таблицы…",
|
|
4813
|
+
"notFound": "Таблица не найдена",
|
|
4814
|
+
"unknownTable": "Таблица \"{tableId}\" не найдена в базе данных.",
|
|
4815
|
+
"retry": "Повторить"
|
|
4816
|
+
},
|
|
4817
|
+
rowCount_one: "строка",
|
|
4818
|
+
rowCount_few: "строки",
|
|
4819
|
+
rowCount_many: "строк",
|
|
4820
|
+
rowCount_other: "строк",
|
|
4821
|
+
toolbar: {
|
|
4822
|
+
"undo": "Отменить",
|
|
4823
|
+
"redo": "Повторить",
|
|
4824
|
+
"filter": "Фильтр",
|
|
4825
|
+
"apply": "Применить"
|
|
4826
|
+
},
|
|
4827
|
+
columnTypes: {
|
|
4828
|
+
"text": "Текст",
|
|
4829
|
+
"integer": "Целое",
|
|
4830
|
+
"decimal": "Дробное",
|
|
4831
|
+
"checkbox": "Флажок",
|
|
4832
|
+
"date": "Дата",
|
|
4833
|
+
"datetime": "Дата и время",
|
|
4834
|
+
"enum": "Перечисление",
|
|
4835
|
+
"multiEnum": "Множественное перечисление",
|
|
4836
|
+
"rowLink": "Ссылка на строку",
|
|
4837
|
+
"rowLinks": "Ссылки на строки"
|
|
4838
|
+
},
|
|
4839
|
+
form: {
|
|
4840
|
+
"name": "Название",
|
|
4841
|
+
"decimals": "Десятичные знаки",
|
|
4842
|
+
"thousandsSeparator": "Разделитель тысяч",
|
|
4843
|
+
"prefix": "Префикс",
|
|
4844
|
+
"suffix": "Суффикс",
|
|
4845
|
+
"allowNegative": "Разрешить отрицательные",
|
|
4846
|
+
"table": "Таблица",
|
|
4847
|
+
"selectTable": "— Выберите таблицу —",
|
|
4848
|
+
"newTableName": "Название новой таблицы",
|
|
4849
|
+
"save": "Сохранить",
|
|
4850
|
+
"addColumn": "Добавить столбец"
|
|
4851
|
+
},
|
|
4852
|
+
"enum": {
|
|
4853
|
+
"options": "Варианты",
|
|
4854
|
+
"optionColor": "Цвет варианта",
|
|
4855
|
+
"optionColorAria": "цвет варианта",
|
|
4856
|
+
"optionPlaceholder": "Вариант",
|
|
4857
|
+
"addOption": "+ Добавить вариант"
|
|
4858
|
+
},
|
|
4859
|
+
header: {
|
|
4860
|
+
"editOptions": "Изменить варианты",
|
|
4861
|
+
"show": "Показать столбец",
|
|
4862
|
+
"hide": "Скрыть столбец",
|
|
4863
|
+
"delete": "Удалить столбец"
|
|
4864
|
+
},
|
|
4865
|
+
row: {
|
|
4866
|
+
"moveUp": "Переместить вверх",
|
|
4867
|
+
"moveDown": "Переместить вниз",
|
|
4868
|
+
"delete": "Удалить строку"
|
|
4869
|
+
},
|
|
4870
|
+
rows: {
|
|
4871
|
+
"loadMore": "Загрузить ещё строки",
|
|
4872
|
+
"none": "Нет строк.",
|
|
4873
|
+
"noneFiltered": "Строки не соответствуют фильтру.",
|
|
4874
|
+
"add": "+ Добавить строку"
|
|
4875
|
+
},
|
|
4876
|
+
filter: {
|
|
4877
|
+
"empty": "Нет столбцов для фильтрации.",
|
|
4878
|
+
"logic": "Логика фильтра",
|
|
4879
|
+
"matchAll": "выполнены все условия",
|
|
4880
|
+
"matchAny": "выполнено любое из условий",
|
|
4881
|
+
"nestedGroup": "Вложенная группа ({logic})",
|
|
4882
|
+
"removeGroup": "Удалить группу",
|
|
4883
|
+
"condition": "+ Условие",
|
|
4884
|
+
"group": "+ Группа",
|
|
4885
|
+
"valuePlaceholder": "значение, значение"
|
|
4886
|
+
},
|
|
4887
|
+
picker: {
|
|
4888
|
+
"searchOptions": "Поиск вариантов",
|
|
4889
|
+
"searchRows": "Поиск строк"
|
|
4890
|
+
},
|
|
4891
|
+
disconnected: {
|
|
4892
|
+
"name": "База данных",
|
|
4893
|
+
"note": "база данных не подключена"
|
|
4894
|
+
}
|
|
4895
|
+
},
|
|
4896
|
+
editor: {
|
|
4897
|
+
docHeader: {
|
|
4898
|
+
"pageView": "Вид страницы",
|
|
4899
|
+
"canvasView": "Вид холста",
|
|
4900
|
+
"documentViewAria": "Вид документа",
|
|
4901
|
+
"editMode": "Режим редактирования",
|
|
4902
|
+
"viewMode": "Режим просмотра",
|
|
4903
|
+
"published": "Опубликовано",
|
|
4904
|
+
"documentModeAria": "Режим документа",
|
|
4905
|
+
"documentAvatarAria": "Аватар документа",
|
|
4906
|
+
"editAvatarAria": "Изменить аватар документа",
|
|
4907
|
+
"editAvatar": "Изменить аватар",
|
|
4908
|
+
"documentTitleAria": "Заголовок документа",
|
|
4909
|
+
"editTitleAria": "Изменить заголовок документа",
|
|
4910
|
+
"editTitle": "Изменить заголовок"
|
|
4911
|
+
},
|
|
4912
|
+
formatToolbar: {
|
|
4913
|
+
"aria": "Форматирование текста",
|
|
4914
|
+
"marks": {
|
|
4915
|
+
"bold": "Жирный",
|
|
4916
|
+
"code": "Моноширинный",
|
|
4917
|
+
"italic": "Курсив",
|
|
4918
|
+
"underline": "Подчёркнутый",
|
|
4919
|
+
"strike": "Зачёркнутый"
|
|
4920
|
+
},
|
|
4921
|
+
"align": {
|
|
4922
|
+
"left": "Выровнять по левому краю",
|
|
4923
|
+
"center": "Выровнять по центру",
|
|
4924
|
+
"right": "Выровнять по правому краю"
|
|
4925
|
+
},
|
|
4926
|
+
"listType": "Тип списка",
|
|
4927
|
+
"lists": {
|
|
4928
|
+
"bullet": "Маркированный список",
|
|
4929
|
+
"number": "Нумерованный список",
|
|
4930
|
+
"task": "Список задач",
|
|
4931
|
+
"quote": "Цитата",
|
|
4932
|
+
"paragraph": "Текст"
|
|
4933
|
+
},
|
|
4934
|
+
"callout": {
|
|
4935
|
+
"typeAria": "Тип выноски",
|
|
4936
|
+
"variant": "Выноска: {variant}",
|
|
4937
|
+
"iconAria": "Иконка выноски"
|
|
4938
|
+
},
|
|
4939
|
+
"color": {
|
|
4940
|
+
"trigger": "Цвет текста и фона",
|
|
4941
|
+
"targetGroupAria": "Объект изменения цвета",
|
|
4942
|
+
"highlightAria": "Выделить фон",
|
|
4943
|
+
"textAria": "Окрасить текст",
|
|
4944
|
+
"highlightLabel": "фон",
|
|
4945
|
+
"textLabel": "текст"
|
|
4946
|
+
},
|
|
4947
|
+
"palette": {
|
|
4948
|
+
"callout": "выноска",
|
|
4949
|
+
"highlight": "выделение",
|
|
4950
|
+
"text": "текст"
|
|
4951
|
+
}
|
|
4952
|
+
},
|
|
4953
|
+
mention: {
|
|
4954
|
+
"searching": "Поиск…",
|
|
4955
|
+
"people": "Люди",
|
|
4956
|
+
"documents": "Документы",
|
|
4957
|
+
"error": "Не удалось загрузить результаты упоминаний.",
|
|
4958
|
+
"retry": "Повторить"
|
|
4959
|
+
},
|
|
4960
|
+
shared: {
|
|
4961
|
+
"swatch": "{label}: цвет {index}",
|
|
4962
|
+
"emojiPickerGroup": "Эмодзи аватара",
|
|
4963
|
+
"removeAvatar": "Удалить аватар",
|
|
4964
|
+
"clearTime": "Очистить время"
|
|
4965
|
+
}
|
|
4966
|
+
},
|
|
4967
|
+
frame: { page: {
|
|
4968
|
+
"missing": "Фрейм не найден",
|
|
4969
|
+
"windowLabel": "Фрейм",
|
|
4970
|
+
"windowTitle": "Фрейм: {title}"
|
|
4971
|
+
} },
|
|
4972
|
+
slash: {
|
|
4973
|
+
blocks: {
|
|
4974
|
+
"text": "Текст",
|
|
4975
|
+
"heading1": "Заголовок 1",
|
|
4976
|
+
"heading2": "Заголовок 2",
|
|
4977
|
+
"heading3": "Заголовок 3",
|
|
4978
|
+
"quote": "Цитата",
|
|
4979
|
+
"callout": "Выноска",
|
|
4980
|
+
"code": "Блок кода",
|
|
4981
|
+
"codeMermaid": "Блок кода (mermaid)",
|
|
4982
|
+
"divider": "Разделитель",
|
|
4983
|
+
"file": "Файл",
|
|
4984
|
+
"embed": "Встраивание",
|
|
4985
|
+
"database": "База данных",
|
|
4986
|
+
"frame": "Фрейм",
|
|
4987
|
+
"table": "Таблица"
|
|
4988
|
+
},
|
|
4989
|
+
lists: {
|
|
4990
|
+
"bulleted": "Маркированный список",
|
|
4991
|
+
"numbered": "Нумерованный список",
|
|
4992
|
+
"task": "Список задач"
|
|
4993
|
+
},
|
|
4994
|
+
database: {
|
|
4995
|
+
"newTable": "Новая таблица",
|
|
4996
|
+
"namePlaceholder": "Название таблицы",
|
|
4997
|
+
"searchPlaceholder": "Поиск таблиц…",
|
|
4998
|
+
"loading": "Загрузка таблиц…",
|
|
4999
|
+
"noMatch": "Таблицы не найдены",
|
|
5000
|
+
"empty": "Таблиц пока нет — создайте новую выше."
|
|
5001
|
+
},
|
|
5002
|
+
frame: {
|
|
5003
|
+
"fallback": "Фрейм",
|
|
5004
|
+
"searchAria": "Поиск фреймов",
|
|
5005
|
+
"searchPlaceholder": "Поиск фреймов…",
|
|
5006
|
+
"noMatch": "Фреймы не найдены",
|
|
5007
|
+
"empty": "На холсте пока нет фреймов"
|
|
5008
|
+
},
|
|
5009
|
+
embed: {
|
|
5010
|
+
"urlPlaceholder": "URL встраивания (https://…)",
|
|
5011
|
+
"unsafeHint": "Поддерживаются только абсолютные URL http(s)://."
|
|
5012
|
+
}
|
|
5013
|
+
},
|
|
5014
|
+
table: {
|
|
5015
|
+
handle: {
|
|
5016
|
+
"columnOptions": "Настройки столбца {index}",
|
|
5017
|
+
"rowOptions": "Настройки строки {index}",
|
|
5018
|
+
"columnMenu": "Настройки столбца",
|
|
5019
|
+
"rowMenu": "Настройки строки"
|
|
5020
|
+
},
|
|
5021
|
+
menu: {
|
|
5022
|
+
"background": "Фон",
|
|
5023
|
+
"backgroundSwatch": "Фон {color}",
|
|
5024
|
+
"removeBackground": "Убрать фон",
|
|
5025
|
+
"insertRight": "Вставить справа",
|
|
5026
|
+
"insertLeft": "Вставить слева",
|
|
5027
|
+
"insertBelow": "Вставить ниже",
|
|
5028
|
+
"insertAbove": "Вставить выше",
|
|
5029
|
+
"moveRight": "Переместить вправо",
|
|
5030
|
+
"moveLeft": "Переместить влево",
|
|
5031
|
+
"moveDown": "Переместить вниз",
|
|
5032
|
+
"moveUp": "Переместить вверх",
|
|
5033
|
+
"clearContent": "Очистить содержимое"
|
|
5034
|
+
},
|
|
5035
|
+
resize: { "column": "Изменить ширину столбца {index}" },
|
|
5036
|
+
add: {
|
|
5037
|
+
"column": "Добавить столбец",
|
|
5038
|
+
"row": "Добавить строку"
|
|
5039
|
+
},
|
|
5040
|
+
cell: { "options": "Настройки ячейки" }
|
|
5041
|
+
}
|
|
5077
5042
|
}
|
|
5078
5043
|
},
|
|
5079
|
-
lng: resolveDocblocksLang(),
|
|
5080
5044
|
fallbackLng: "en",
|
|
5081
5045
|
supportedLngs: ["en", "ru"],
|
|
5082
5046
|
interpolation: {
|
|
@@ -5085,7 +5049,53 @@ docblocksI18n.init({
|
|
|
5085
5049
|
suffix: "}"
|
|
5086
5050
|
},
|
|
5087
5051
|
returnNull: false
|
|
5088
|
-
}
|
|
5052
|
+
};
|
|
5053
|
+
/** The supported-set's resolution over a raw language string (the prefix's normalization — `ru-RU` is `ru`, `en-US` is `en`): the absent / unknown language falls back to `en`. */
|
|
5054
|
+
function toDocblocksLang(lang) {
|
|
5055
|
+
return lang.trim().toLowerCase().startsWith("ru") ? "ru" : "en";
|
|
5056
|
+
}
|
|
5057
|
+
/**
|
|
5058
|
+
* Normalizes a consumer-passed locale over the supported set (the same
|
|
5059
|
+
* rules as the `<html lang>`'s read): the `ru*` prefix is `ru`, the `en*`
|
|
5060
|
+
* and the unknown / empty's values fall back to `en`.
|
|
5061
|
+
*/
|
|
5062
|
+
function normalizeDocblocksLocale(locale) {
|
|
5063
|
+
return toDocblocksLang(locale);
|
|
5064
|
+
}
|
|
5065
|
+
/**
|
|
5066
|
+
* The document's language over the supported set (the `<html lang>`
|
|
5067
|
+
* attribute's read — the legacy uncontrolled mode's source): the absent /
|
|
5068
|
+
* unknown language falls back to `en`.
|
|
5069
|
+
*/
|
|
5070
|
+
function resolveDocblocksLang() {
|
|
5071
|
+
return toDocblocksLang(typeof document === "undefined" ? "" : document.documentElement.lang ?? "");
|
|
5072
|
+
}
|
|
5073
|
+
/**
|
|
5074
|
+
* Creates a package's i18next instance over the given language: the
|
|
5075
|
+
* controlled mode's instance (one per provider over its normalized locale —
|
|
5076
|
+
* no shared cache over a mutable language, no mutation of the legacy
|
|
5077
|
+
* singleton), isolated from the consumer's i18next setup. `init` over the
|
|
5078
|
+
* inline resources runs synchronously (its Promise is not awaited — the
|
|
5079
|
+
* instance is ready by the first render), so the returned value is the
|
|
5080
|
+
* instance itself, not the init's Promise.
|
|
5081
|
+
*/
|
|
5082
|
+
function createDocblocksI18nInstance(lng) {
|
|
5083
|
+
const instance = createInstance().use(initReactI18next);
|
|
5084
|
+
instance.init({
|
|
5085
|
+
...INIT_OPTIONS,
|
|
5086
|
+
lng
|
|
5087
|
+
});
|
|
5088
|
+
return instance;
|
|
5089
|
+
}
|
|
5090
|
+
/**
|
|
5091
|
+
* The package's OWN i18next instance (not the global singleton): the legacy
|
|
5092
|
+
* uncontrolled mode's seat — it is initialized over the package's shipped
|
|
5093
|
+
* en+ru catalogs, starts on the `<html lang>`'s read (the `en`'s fallback
|
|
5094
|
+
* over the server's render, no document), and never touches the consumer's
|
|
5095
|
+
* i18next setup (the `I18nextProvider` over the docblocks' subtree routes
|
|
5096
|
+
* `useTranslation` here).
|
|
5097
|
+
*/
|
|
5098
|
+
const docblocksI18n = createDocblocksI18nInstance(resolveDocblocksLang());
|
|
5089
5099
|
if (typeof document !== "undefined") new MutationObserver(() => {
|
|
5090
5100
|
const lng = resolveDocblocksLang();
|
|
5091
5101
|
if (docblocksI18n.language !== lng) docblocksI18n.changeLanguage(lng);
|
|
@@ -5095,17 +5105,37 @@ if (typeof document !== "undefined") new MutationObserver(() => {
|
|
|
5095
5105
|
});
|
|
5096
5106
|
//#endregion
|
|
5097
5107
|
//#region src/i18n/provider.tsx
|
|
5108
|
+
/** The inherited controlled instance (the nested uncontrolled provider takes the outer one — the package's internal wrappers keep the consumer's locale without threading it through each component). */
|
|
5109
|
+
const ControlledI18nContext = createContext(null);
|
|
5098
5110
|
/**
|
|
5099
5111
|
* The docblocks' i18n scope: the package's own i18next instance over the
|
|
5100
5112
|
* subtree — the docblocks' `useTranslation` resolves against it and never
|
|
5101
5113
|
* conflicts with the consumer's global i18next singleton (the instance's
|
|
5102
5114
|
* isolation). The `EditorProvider` and the consumer-placed `DocHeader`
|
|
5103
5115
|
* both wrap over it.
|
|
5104
|
-
|
|
5105
|
-
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
|
|
5116
|
+
*
|
|
5117
|
+
* The optional `locale` prop is the controlled mode: the provider creates
|
|
5118
|
+
* its own synchronously initialized instance over the normalized locale
|
|
5119
|
+
* (one per provider, keyed by the normalized value — a locale change
|
|
5120
|
+
* selects the new instance and re-renders the subtree). The controlled
|
|
5121
|
+
* mode never mutates the legacy singleton and never calls
|
|
5122
|
+
* `changeLanguage` on it, so the concurrent subtrees over different
|
|
5123
|
+
* locales stay isolated. The provider without a locale inherits the
|
|
5124
|
+
* outer's controlled instance when nested over one; outside a controlled
|
|
5125
|
+
* provider it keeps the legacy behavior — the module-level instance
|
|
5126
|
+
* driven by the `<html lang>` attribute and its runtime flip.
|
|
5127
|
+
*/
|
|
5128
|
+
function DocblocksI18nProvider({ locale, children }) {
|
|
5129
|
+
const inherited = useContext(ControlledI18nContext);
|
|
5130
|
+
const normalized = locale === void 0 ? null : normalizeDocblocksLocale(locale);
|
|
5131
|
+
const controlled = useMemo(() => normalized === null ? null : createDocblocksI18nInstance(normalized), [normalized]);
|
|
5132
|
+
const effective = controlled ?? inherited ?? docblocksI18n;
|
|
5133
|
+
return /* @__PURE__ */ jsx(ControlledI18nContext.Provider, {
|
|
5134
|
+
value: controlled ?? inherited,
|
|
5135
|
+
children: /* @__PURE__ */ jsx(I18nextProvider, {
|
|
5136
|
+
i18n: effective,
|
|
5137
|
+
children
|
|
5138
|
+
})
|
|
5109
5139
|
});
|
|
5110
5140
|
}
|
|
5111
5141
|
//#endregion
|
|
@@ -9320,14 +9350,16 @@ function useGridColumnDrag({ columns, updateView, tableRef }) {
|
|
|
9320
9350
|
//#endregion
|
|
9321
9351
|
//#region src/database/grid/use-grid-seam-resize.ts
|
|
9322
9352
|
/** The database grid's column-seam resize: the header cell's right-edge
|
|
9323
|
-
* seam's press + drag (the live preview
|
|
9324
|
-
* width —
|
|
9325
|
-
*
|
|
9326
|
-
*
|
|
9327
|
-
*
|
|
9328
|
-
*
|
|
9329
|
-
*
|
|
9330
|
-
*
|
|
9353
|
+
* seam's press + drag (the live preview locks every column over its
|
|
9354
|
+
* rendered width — the flexible columns' stand no live shrink, so only
|
|
9355
|
+
* the dragged column moves; no bridge write until the release commits
|
|
9356
|
+
* the widths), the release (the clamped width commits when it changed —
|
|
9357
|
+
* one `updateBlock`, one undo step; the untouched columns stand their
|
|
9358
|
+
* measured rendered width, the WYSIWYG lock — the commit stands the
|
|
9359
|
+
* preview's locked layout exactly; a 0 px drag stands a no-op; a stale
|
|
9360
|
+
* visible sequence — a peer reordered / hid a column mid-drag — stands
|
|
9361
|
+
* no commit), and the cancel. The preview's state stands in the hook (the
|
|
9362
|
+
* view's read of the session's locked widths). */
|
|
9331
9363
|
function useGridSeamResize({ columns, columnWidths, updateView }) {
|
|
9332
9364
|
const [resizePreview, setResizePreview] = useState(null);
|
|
9333
9365
|
const resizeSession = useRef(null);
|
|
@@ -9344,22 +9376,34 @@ function useGridSeamResize({ columns, columnWidths, updateView }) {
|
|
|
9344
9376
|
const scope = event.currentTarget.closest("[data-slot='docblocks/database']");
|
|
9345
9377
|
const cells = Array.from(scope?.querySelectorAll("[data-slot='docblocks/database-header-cell']") ?? []);
|
|
9346
9378
|
const widthsAtStart = columns.map((_, i) => cells[i]?.offsetWidth ?? 0);
|
|
9379
|
+
const widths = columns.map((_, i) => {
|
|
9380
|
+
const measured = widthsAtStart[i] ?? 0;
|
|
9381
|
+
const set = columnWidths?.[i];
|
|
9382
|
+
return Math.max(Math.round(set !== void 0 && set > 0 ? set : measured > 0 ? measured : 112), 50);
|
|
9383
|
+
});
|
|
9384
|
+
widths[col] = Math.max(Math.round(startWidth), 50);
|
|
9347
9385
|
resizeSession.current = {
|
|
9348
9386
|
col,
|
|
9349
9387
|
startX: event.clientX,
|
|
9350
9388
|
startWidth,
|
|
9351
9389
|
width: startWidth,
|
|
9352
9390
|
visible: columns.map((entry) => entry.id),
|
|
9353
|
-
widthsAtStart
|
|
9391
|
+
widthsAtStart,
|
|
9392
|
+
widths
|
|
9354
9393
|
};
|
|
9394
|
+
setResizePreview({
|
|
9395
|
+
col,
|
|
9396
|
+
widths
|
|
9397
|
+
});
|
|
9355
9398
|
};
|
|
9356
9399
|
const onSeamPointerMove = (event) => {
|
|
9357
9400
|
const session = resizeSession.current;
|
|
9358
9401
|
if (session === null) return;
|
|
9359
9402
|
session.width = Math.max(Math.round(session.startWidth + (event.clientX - session.startX)), 50);
|
|
9403
|
+
session.widths[session.col] = session.width;
|
|
9360
9404
|
setResizePreview({
|
|
9361
9405
|
col: session.col,
|
|
9362
|
-
|
|
9406
|
+
widths: session.widths
|
|
9363
9407
|
});
|
|
9364
9408
|
};
|
|
9365
9409
|
/** The seam release: the clamped width commits when it changed (one
|
|
@@ -9850,6 +9894,7 @@ function GridBody({ blockId, bridge, tableId, filter, columnOrder, hiddenColumns
|
|
|
9850
9894
|
"data-block-type": "database",
|
|
9851
9895
|
"data-block-id": blockId,
|
|
9852
9896
|
"data-state": "ready",
|
|
9897
|
+
contentEditable: false,
|
|
9853
9898
|
className: "\n my-(--docblocks-block-spacing) flex min-h-0 flex-1 flex-col rounded-(--docblocks-radius)\n border-(length:--docblocks-table-border-width) border-(--docblocks-table-border-color) outline-none\n ",
|
|
9854
9899
|
children: /* @__PURE__ */ jsxs(CardContent, {
|
|
9855
9900
|
"data-slot": "docblocks/database",
|
|
@@ -9972,7 +10017,7 @@ function GridBody({ blockId, bridge, tableId, filter, columnOrder, hiddenColumns
|
|
|
9972
10017
|
gridTemplateRows: "auto",
|
|
9973
10018
|
gridAutoRows: "var(--docblocks-database-row-height)",
|
|
9974
10019
|
gridTemplateColumns: `${columns.map((_, index) => {
|
|
9975
|
-
const width = (resizePreview !== null
|
|
10020
|
+
const width = (resizePreview !== null ? resizePreview.widths[index] : void 0) ?? columnWidths?.[index];
|
|
9976
10021
|
return width !== void 0 ? `${width}px` : "minmax(7rem, 1fr)";
|
|
9977
10022
|
}).join(" ")} 2.5rem`
|
|
9978
10023
|
},
|
|
@@ -12857,6 +12902,7 @@ function DatabaseBlock({ id, block }) {
|
|
|
12857
12902
|
"data-slot": "docblocks/block",
|
|
12858
12903
|
"data-block-type": "database",
|
|
12859
12904
|
"data-block-id": id,
|
|
12905
|
+
contentEditable: false,
|
|
12860
12906
|
className: "\n my-(--docblocks-block-spacing) rounded-(--docblocks-radius) border-(length:--docblocks-table-border-width)\n border-(--docblocks-table-border-color) outline-none\n ",
|
|
12861
12907
|
children: /* @__PURE__ */ jsxs(CardContent, {
|
|
12862
12908
|
"data-slot": "docblocks/database",
|
|
@@ -13270,6 +13316,7 @@ function EmbedBlock({ id, block }) {
|
|
|
13270
13316
|
"data-block-type": "embed",
|
|
13271
13317
|
"data-block-id": id,
|
|
13272
13318
|
"data-kind": kind,
|
|
13319
|
+
contentEditable: false,
|
|
13273
13320
|
className: "\n group relative my-(--docblocks-block-spacing) h-(--docblocks-embed-height) overflow-hidden\n rounded-(--docblocks-radius) border-(length:--docblocks-divider-border-width)\n border-(--docblocks-divider-border-color) outline-none\n ",
|
|
13274
13321
|
style: {
|
|
13275
13322
|
...height !== null ? { height: Math.max(height, tokenMin) } : {},
|
|
@@ -14654,6 +14701,202 @@ function insertParagraphAfter(doc, after, parent, indent, scope) {
|
|
|
14654
14701
|
}
|
|
14655
14702
|
}
|
|
14656
14703
|
//#endregion
|
|
14704
|
+
//#region src/editing/page-surface.tsx
|
|
14705
|
+
/**
|
|
14706
|
+
* The page surface's input dispatch over the single page editable.
|
|
14707
|
+
*
|
|
14708
|
+
* The page container is one contenteditable (edit mode): the native DOM
|
|
14709
|
+
* selection crosses the blocks' boundaries natively (the highlight is
|
|
14710
|
+
* continuous in every engine — the WebKit family's cross-editable
|
|
14711
|
+
* clamp only applies between SIBLING editables, and the blocks are
|
|
14712
|
+
* nested inside the shared editable region). The price: every
|
|
14713
|
+
* keyboard/input event of the page surface targets the container (the
|
|
14714
|
+
* focused element), never a block's inner — the per-block handlers
|
|
14715
|
+
* (the input gestures, the commit) are registered per block in the
|
|
14716
|
+
* surface registry and dispatched from the container's handlers over
|
|
14717
|
+
* the block the live DOM selection's anchor stands in.
|
|
14718
|
+
*
|
|
14719
|
+
* The isolated surfaces (the table's and the database's cells, the
|
|
14720
|
+
* sync-embed's nested editor) sit behind a contenteditable="false"
|
|
14721
|
+
* boundary: the browser focuses their own inner there, so their keys
|
|
14722
|
+
* and inputs target themselves (their own handlers stand) and never
|
|
14723
|
+
* reach this dispatcher (its handlers stand only for events targeted
|
|
14724
|
+
* at the container).
|
|
14725
|
+
*/
|
|
14726
|
+
const PageSurfaceContext = createContext(null);
|
|
14727
|
+
/**
|
|
14728
|
+
* The page surface's registry provider: one handlers map per editor
|
|
14729
|
+
* instance (the sync-embed's nested editor stands its own instance over
|
|
14730
|
+
* its own subtree). The map is created by the editor component (its
|
|
14731
|
+
* dispatch binding reads the same map directly — the dispatch hook runs
|
|
14732
|
+
* OUTSIDE the provider's subtree, so a context read there would stand
|
|
14733
|
+
* the default null) and is identity-stable over the instance's
|
|
14734
|
+
* lifetime; the entries update in place.
|
|
14735
|
+
*/
|
|
14736
|
+
function PageSurfaceProvider({ map, children }) {
|
|
14737
|
+
const registry = useMemo(() => ({
|
|
14738
|
+
handlers: map,
|
|
14739
|
+
register: (id, handlers) => {
|
|
14740
|
+
map.set(id, handlers);
|
|
14741
|
+
},
|
|
14742
|
+
unregister: (id) => {
|
|
14743
|
+
map.delete(id);
|
|
14744
|
+
}
|
|
14745
|
+
}), [map]);
|
|
14746
|
+
return /* @__PURE__ */ jsx(PageSurfaceContext.Provider, {
|
|
14747
|
+
value: registry,
|
|
14748
|
+
children
|
|
14749
|
+
});
|
|
14750
|
+
}
|
|
14751
|
+
/** The current editor instance's surface registry (null outside the provider). */
|
|
14752
|
+
function usePageSurface() {
|
|
14753
|
+
return useContext(PageSurfaceContext);
|
|
14754
|
+
}
|
|
14755
|
+
/**
|
|
14756
|
+
* Whether the inner is a PAGE-SURFACE text block of its own editor scope:
|
|
14757
|
+
* not inside a contenteditable="false" island of the same scope (the
|
|
14758
|
+
* island's cells stand their own focused inner). An island OUTSIDE the
|
|
14759
|
+
* inner's editor root (the sync-embed's wrapper around the nested
|
|
14760
|
+
* editor) is not a boundary for that scope.
|
|
14761
|
+
*/
|
|
14762
|
+
function isPageSurfaceInner(inner) {
|
|
14763
|
+
const island = inner.closest("[contenteditable=\"false\"]");
|
|
14764
|
+
if (island === null) return true;
|
|
14765
|
+
const scope = inner.closest("[data-slot=\"docblocks/editor\"]");
|
|
14766
|
+
return scope === null || scope.contains(island) === false;
|
|
14767
|
+
}
|
|
14768
|
+
/**
|
|
14769
|
+
* The page-surface inner (if any) that contains the selection's anchor:
|
|
14770
|
+
* the dispatch target over the container-targeted event.
|
|
14771
|
+
*/
|
|
14772
|
+
function surfaceInnerOf(container, anchorNode) {
|
|
14773
|
+
if (anchorNode === null) return null;
|
|
14774
|
+
const inner = (anchorNode.nodeType === Node.ELEMENT_NODE ? anchorNode : anchorNode.parentElement ?? null)?.closest("[data-slot=\"docblocks/block-content\"]") ?? null;
|
|
14775
|
+
if (inner === null || !container.contains(inner) || isPageSurfaceInner(inner) === false) return null;
|
|
14776
|
+
return inner;
|
|
14777
|
+
}
|
|
14778
|
+
/**
|
|
14779
|
+
* The page-surface inners of one container in DOM order (the reseat's
|
|
14780
|
+
* candidates).
|
|
14781
|
+
*/
|
|
14782
|
+
function surfaceInnersOf(container) {
|
|
14783
|
+
return Array.from(container.querySelectorAll("[data-slot=\"docblocks/block-content\"]")).filter((inner) => isPageSurfaceInner(inner));
|
|
14784
|
+
}
|
|
14785
|
+
/**
|
|
14786
|
+
* Re-seat a caret stranded at a pure page-container position (between
|
|
14787
|
+
* the block rows — the transient the browser's auto-seat leaves over
|
|
14788
|
+
* some gesture paths) into the nearest block's edge: the preceding
|
|
14789
|
+
* block's end or the following block's start, by the vertical distance
|
|
14790
|
+
* (the caret's y over the range's rect, the gap's midline when the
|
|
14791
|
+
* rect is degenerate). One DOM selection write (the next
|
|
14792
|
+
* selectionchange's mapping reads the seated caret).
|
|
14793
|
+
*/
|
|
14794
|
+
function reseatContainerCaret(container, scope, doc) {
|
|
14795
|
+
const selection = window.getSelection();
|
|
14796
|
+
if (selection === null || selection.rangeCount === 0 || !selection.isCollapsed) return;
|
|
14797
|
+
const range = selection.getRangeAt(0);
|
|
14798
|
+
if (surfaceInnerOf(container, range.startContainer) !== null) return;
|
|
14799
|
+
const inners = surfaceInnersOf(container);
|
|
14800
|
+
let previous = null;
|
|
14801
|
+
let following = null;
|
|
14802
|
+
for (const inner of inners) {
|
|
14803
|
+
const innerStart = document.createRange();
|
|
14804
|
+
innerStart.setStart(inner, 0);
|
|
14805
|
+
innerStart.collapse(true);
|
|
14806
|
+
if (range.compareBoundaryPoints(Range.END_TO_START, innerStart) === -1) {
|
|
14807
|
+
if (following === null) following = inner;
|
|
14808
|
+
} else if (previous === null || previous !== inner) previous = inner;
|
|
14809
|
+
}
|
|
14810
|
+
if (previous === null && following === null) return;
|
|
14811
|
+
let caretY = null;
|
|
14812
|
+
const caretRect = range.getBoundingClientRect();
|
|
14813
|
+
if (caretRect.height > 0) caretY = caretRect.top + caretRect.height / 2;
|
|
14814
|
+
else if (previous !== null && following !== null) caretY = (previous.getBoundingClientRect().bottom + following.getBoundingClientRect().top) / 2;
|
|
14815
|
+
let target = previous;
|
|
14816
|
+
if (previous !== null && following !== null && caretY !== null) {
|
|
14817
|
+
const previousBottom = previous.getBoundingClientRect().bottom;
|
|
14818
|
+
const followingTop = following.getBoundingClientRect().top;
|
|
14819
|
+
if (Math.abs(followingTop - caretY) < Math.abs(caretY - previousBottom)) target = following;
|
|
14820
|
+
} else if (previous === null) target = following;
|
|
14821
|
+
if (target === null) return;
|
|
14822
|
+
const targetId = target.dataset.blockId;
|
|
14823
|
+
focusCaretIn(targetId, target === previous ? doc.getTextLength(targetId) : 0, scope, () => {
|
|
14824
|
+
return containerCaretNeedsReseat(container, window.getSelection()?.anchorNode ?? null);
|
|
14825
|
+
});
|
|
14826
|
+
}
|
|
14827
|
+
/**
|
|
14828
|
+
* Whether the caret's anchor sits in a pure page-container position that
|
|
14829
|
+
* needs the re-seat: inside the container's own editable flow (its
|
|
14830
|
+
* nearest contenteditable is the container) and not inside a page-surface
|
|
14831
|
+
* inner (a block's text inner is a valid caret seat, not a transient).
|
|
14832
|
+
*/
|
|
14833
|
+
function containerCaretNeedsReseat(container, anchorNode) {
|
|
14834
|
+
if (anchorNode === null || container.contains(anchorNode) === false) return false;
|
|
14835
|
+
const host = anchorNode.nodeType === Node.ELEMENT_NODE ? anchorNode : anchorNode.parentElement ?? null;
|
|
14836
|
+
if (host?.matches("input, textarea") === true) return false;
|
|
14837
|
+
if (host?.closest("[contenteditable=\"false\"]") !== null) return false;
|
|
14838
|
+
if ((host?.closest("[contenteditable=\"true\"]") ?? null) !== container) return false;
|
|
14839
|
+
return surfaceInnerOf(container, anchorNode) === null;
|
|
14840
|
+
}
|
|
14841
|
+
/**
|
|
14842
|
+
* The container-level dispatch of the page surface's per-block handlers
|
|
14843
|
+
* + the container-caret's guard: a beforeinput targeted at the container
|
|
14844
|
+
* itself (the input over a pure container position — the chromium's
|
|
14845
|
+
* bare-div's materialization) is suppressed and the caret re-seats into
|
|
14846
|
+
* the nearest block's edge.
|
|
14847
|
+
*/
|
|
14848
|
+
function usePageSurfaceDispatch(containerRef, doc, handlers) {
|
|
14849
|
+
const dispatch = useCallback((event, kind) => {
|
|
14850
|
+
const container = containerRef.current;
|
|
14851
|
+
if (container === null || event.target !== container) return;
|
|
14852
|
+
const inner = surfaceInnerOf(container, window.getSelection()?.anchorNode ?? null);
|
|
14853
|
+
if (inner === null) return;
|
|
14854
|
+
const blockHandlers = handlers.get(inner.dataset.blockId);
|
|
14855
|
+
if (blockHandlers === void 0) return;
|
|
14856
|
+
if (kind === "keydown") blockHandlers.onKeydown(event);
|
|
14857
|
+
else if (kind === "paste") blockHandlers.onPaste(event);
|
|
14858
|
+
else blockHandlers.onInput();
|
|
14859
|
+
}, [containerRef, handlers]);
|
|
14860
|
+
useEffect(() => {
|
|
14861
|
+
const container = containerRef.current;
|
|
14862
|
+
if (container === null) return;
|
|
14863
|
+
const onBeforeInput = (event) => {
|
|
14864
|
+
if (event.target !== container) return;
|
|
14865
|
+
const selection = window.getSelection();
|
|
14866
|
+
if (containerCaretNeedsReseat(container, selection?.anchorNode ?? null) === false) return;
|
|
14867
|
+
event.preventDefault();
|
|
14868
|
+
const scope = container.closest("[data-slot=\"docblocks/editor\"]") ?? document;
|
|
14869
|
+
reseatContainerCaret(container, scope, doc);
|
|
14870
|
+
};
|
|
14871
|
+
container.addEventListener("beforeinput", onBeforeInput);
|
|
14872
|
+
return () => container.removeEventListener("beforeinput", onBeforeInput);
|
|
14873
|
+
}, [containerRef, doc]);
|
|
14874
|
+
return useMemo(() => ({
|
|
14875
|
+
onKeyDown: (event) => {
|
|
14876
|
+
dispatch(event, "keydown");
|
|
14877
|
+
},
|
|
14878
|
+
onInput: (event) => {
|
|
14879
|
+
dispatch(event, "input");
|
|
14880
|
+
},
|
|
14881
|
+
onPaste: (event) => {
|
|
14882
|
+
dispatch(event, "paste");
|
|
14883
|
+
}
|
|
14884
|
+
}), [dispatch]);
|
|
14885
|
+
}
|
|
14886
|
+
/**
|
|
14887
|
+
* Park the editor root's focus over the anchor's editor instance: the
|
|
14888
|
+
* selection keys' reach when the focus stands outside the editor (the
|
|
14889
|
+
* gutter's click, the drag's release). A focus already inside the editor
|
|
14890
|
+
* stands as is (no selection change, the keys bubble from it to the root).
|
|
14891
|
+
*/
|
|
14892
|
+
function parkEditorFocus(anchor) {
|
|
14893
|
+
const root = anchor.closest("[data-slot=\"docblocks/editor\"]");
|
|
14894
|
+
if (root === null) return;
|
|
14895
|
+
const active = document.activeElement;
|
|
14896
|
+
if (active !== null && root.contains(active)) return;
|
|
14897
|
+
root.focus();
|
|
14898
|
+
}
|
|
14899
|
+
//#endregion
|
|
14657
14900
|
//#region src/editing/use-delete-block.ts
|
|
14658
14901
|
/** The page row's delete affordance (the hover's trash icon): the shared
|
|
14659
14902
|
* click gesture.
|
|
@@ -16473,16 +16716,22 @@ function syncDomSelection(root, doc, view) {
|
|
|
16473
16716
|
if (!selectionsEqual(next, view.get())) view.set(next);
|
|
16474
16717
|
}
|
|
16475
16718
|
/**
|
|
16476
|
-
* Whether the DOM selection's endpoints stand inside a
|
|
16719
|
+
* Whether the DOM selection's endpoints stand inside a block's editable
|
|
16477
16720
|
* (of any editor root): the caret is live in an editable, so the
|
|
16478
16721
|
* selection's mapping expresses a real edit position. A selection
|
|
16479
16722
|
* collapsed outside the editables (the chrome, the stale residue) does
|
|
16480
|
-
* not — the mapping must not clobber a `blocks` view there.
|
|
16723
|
+
* not — the mapping must not clobber a `blocks` view there. Neither does
|
|
16724
|
+
* a caret parked at a pure page-container position (the page's single
|
|
16725
|
+
* editable container is an editable, but the caret stands in no block —
|
|
16726
|
+
* the reseat's transient, the gutter's focus park).
|
|
16481
16727
|
*/
|
|
16482
16728
|
function domSelectionInEditable(domSelection) {
|
|
16483
|
-
const
|
|
16484
|
-
|
|
16485
|
-
|
|
16729
|
+
const inText = (node) => {
|
|
16730
|
+
const editable = editableOfNode(node);
|
|
16731
|
+
if (editable === null) return false;
|
|
16732
|
+
return editable.getAttribute("data-slot") !== "docblocks/page";
|
|
16733
|
+
};
|
|
16734
|
+
return inText(domSelection?.anchorNode ?? null) && inText(domSelection?.focusNode ?? null);
|
|
16486
16735
|
}
|
|
16487
16736
|
/** The contenteditable that owns a node (the node's element or its parent's), or null. */
|
|
16488
16737
|
function editableOfNode(node) {
|
|
@@ -17094,7 +17343,8 @@ function useBlockInput({ id, blockType, context, innerRef, wrapperRef, declareLo
|
|
|
17094
17343
|
const selection = window.getSelection();
|
|
17095
17344
|
if (selection === null || selection.rangeCount === 0) return;
|
|
17096
17345
|
const range = selection.getRangeAt(0);
|
|
17097
|
-
const el =
|
|
17346
|
+
const el = innerRef.current;
|
|
17347
|
+
if (el === null) return;
|
|
17098
17348
|
if (!el.contains(range.startContainer) || !el.contains(range.endContainer)) return;
|
|
17099
17349
|
const anchor = caretOffsetIn(el, range.startContainer, range.startOffset);
|
|
17100
17350
|
const focus = caretOffsetIn(el, range.endContainer, range.endOffset);
|
|
@@ -17157,6 +17407,29 @@ function useBlockInput({ id, blockType, context, innerRef, wrapperRef, declareLo
|
|
|
17157
17407
|
selection = view.get();
|
|
17158
17408
|
root = mappedRoot;
|
|
17159
17409
|
}
|
|
17410
|
+
if (isPageSurfaceInner(inner) && !event.ctrlKey && !event.metaKey && !event.altKey && (event.key === "Home" || event.key === "End") && selection.kind === "text" && (selection.to === null || selection.to.blockId === selection.from.blockId)) {
|
|
17411
|
+
const homeDom = window.getSelection();
|
|
17412
|
+
if (homeDom !== null && homeDom.rangeCount > 0) {
|
|
17413
|
+
const logical = logicalTextOf(inner);
|
|
17414
|
+
const endpoint = homeDom.isCollapsed ? {
|
|
17415
|
+
node: homeDom.anchorNode,
|
|
17416
|
+
offset: homeDom.anchorOffset
|
|
17417
|
+
} : effectiveFocusEnd(homeDom);
|
|
17418
|
+
if (endpoint !== null) {
|
|
17419
|
+
const caret = caretOffsetIn(inner, endpoint.node, endpoint.offset);
|
|
17420
|
+
const lineStart = logical.lastIndexOf("\n", caret - 1) + 1;
|
|
17421
|
+
const breakIndex = logical.indexOf("\n", caret);
|
|
17422
|
+
const lineEnd = breakIndex === -1 ? logical.length : breakIndex;
|
|
17423
|
+
const target = event.key === "Home" ? lineStart : lineEnd;
|
|
17424
|
+
event.preventDefault();
|
|
17425
|
+
if (event.shiftKey) {
|
|
17426
|
+
const anchorFlat = caretOffsetIn(inner, homeDom.anchorNode, homeDom.anchorOffset);
|
|
17427
|
+
restoreSelection(inner, Math.min(anchorFlat, target), Math.max(anchorFlat, target));
|
|
17428
|
+
} else restoreSelection(inner, target, null);
|
|
17429
|
+
return;
|
|
17430
|
+
}
|
|
17431
|
+
}
|
|
17432
|
+
}
|
|
17160
17433
|
if (selection.kind === "text" && selection.to !== null && selection.to.blockId !== selection.from.blockId) {
|
|
17161
17434
|
if (root !== null && handleCrossRangeKey(doc, view, selection, root, event)) return;
|
|
17162
17435
|
}
|
|
@@ -17193,7 +17466,7 @@ function useBlockInput({ id, blockType, context, innerRef, wrapperRef, declareLo
|
|
|
17193
17466
|
ids: [nextId],
|
|
17194
17467
|
anchorId: nextId
|
|
17195
17468
|
});
|
|
17196
|
-
(wrapperRef.current
|
|
17469
|
+
if (wrapperRef.current !== null) parkEditorFocus(wrapperRef.current);
|
|
17197
17470
|
}
|
|
17198
17471
|
}
|
|
17199
17472
|
}
|
|
@@ -17299,6 +17572,24 @@ function useBlockInput({ id, blockType, context, innerRef, wrapperRef, declareLo
|
|
|
17299
17572
|
if (newId !== null) focusCaretIn(newId, 0, editorRootOf(inner));
|
|
17300
17573
|
return;
|
|
17301
17574
|
}
|
|
17575
|
+
if ((event.key === "Backspace" || event.key === "Delete") && !event.nativeEvent.isComposing) {
|
|
17576
|
+
const rangeSelection = window.getSelection();
|
|
17577
|
+
if (rangeSelection !== null && rangeSelection.rangeCount > 0 && !rangeSelection.isCollapsed) {
|
|
17578
|
+
const range = rangeSelection.getRangeAt(0);
|
|
17579
|
+
if (inner.contains(range.startContainer) && inner.contains(range.endContainer)) {
|
|
17580
|
+
const anchor = caretOffsetIn(inner, range.startContainer, range.startOffset);
|
|
17581
|
+
const focus = caretOffsetIn(inner, range.endContainer, range.endOffset);
|
|
17582
|
+
const from = Math.min(anchor, focus);
|
|
17583
|
+
const to = Math.max(anchor, focus);
|
|
17584
|
+
if (from !== to) {
|
|
17585
|
+
event.preventDefault();
|
|
17586
|
+
doc.deleteText(id, from, to);
|
|
17587
|
+
restoreSelection(inner, from, null);
|
|
17588
|
+
}
|
|
17589
|
+
return;
|
|
17590
|
+
}
|
|
17591
|
+
}
|
|
17592
|
+
}
|
|
17302
17593
|
if (event.key === "Backspace" && !event.nativeEvent.isComposing) {
|
|
17303
17594
|
const domSelection = window.getSelection();
|
|
17304
17595
|
if (domSelection === null || domSelection.rangeCount === 0 || !domSelection.isCollapsed) return;
|
|
@@ -17314,10 +17605,19 @@ function useBlockInput({ id, blockType, context, innerRef, wrapperRef, declareLo
|
|
|
17314
17605
|
}
|
|
17315
17606
|
return;
|
|
17316
17607
|
}
|
|
17317
|
-
if (inCell)
|
|
17318
|
-
|
|
17608
|
+
if (inCell) {
|
|
17609
|
+
event.preventDefault();
|
|
17610
|
+
return;
|
|
17611
|
+
}
|
|
17612
|
+
if ((blockType === "quote" || blockType === "callout" || blockType === "code") && doc.getTextLength(id) > 0) {
|
|
17613
|
+
event.preventDefault();
|
|
17614
|
+
return;
|
|
17615
|
+
}
|
|
17319
17616
|
const merged = mergeWithPrevious(doc, id, context.parentId);
|
|
17320
|
-
if (merged === null)
|
|
17617
|
+
if (merged === null) {
|
|
17618
|
+
event.preventDefault();
|
|
17619
|
+
return;
|
|
17620
|
+
}
|
|
17321
17621
|
event.preventDefault();
|
|
17322
17622
|
focusCaretIn(merged.blockId, merged.offset, editorRootOf(inner));
|
|
17323
17623
|
return;
|
|
@@ -17841,6 +18141,22 @@ function useTextInner({ id, block, blockType, context, wrapperRef }) {
|
|
|
17841
18141
|
appliedRef.current = block;
|
|
17842
18142
|
}
|
|
17843
18143
|
});
|
|
18144
|
+
useEffect(() => {
|
|
18145
|
+
const el = innerRef.current;
|
|
18146
|
+
if (el === null) return;
|
|
18147
|
+
const update = () => {
|
|
18148
|
+
const anchor = window.getSelection()?.anchorNode ?? null;
|
|
18149
|
+
el.toggleAttribute("data-caret-inside", anchor !== null && el.contains(anchor));
|
|
18150
|
+
};
|
|
18151
|
+
update();
|
|
18152
|
+
document.addEventListener("selectionchange", update);
|
|
18153
|
+
return () => document.removeEventListener("selectionchange", update);
|
|
18154
|
+
}, []);
|
|
18155
|
+
usePageSurfaceRegistration(id, innerRef, {
|
|
18156
|
+
onKeydown,
|
|
18157
|
+
onInput: commitDomDelta,
|
|
18158
|
+
onPaste
|
|
18159
|
+
});
|
|
17844
18160
|
return {
|
|
17845
18161
|
innerRef,
|
|
17846
18162
|
onInput: commitDomDelta,
|
|
@@ -17848,6 +18164,35 @@ function useTextInner({ id, block, blockType, context, wrapperRef }) {
|
|
|
17848
18164
|
onKeydown
|
|
17849
18165
|
};
|
|
17850
18166
|
}
|
|
18167
|
+
/**
|
|
18168
|
+
* The page surface's registration: the per-block handlers stand in the
|
|
18169
|
+
* editor instance's surface registry (the container-level dispatch's
|
|
18170
|
+
* source) while the inner is a page-surface text block (the isolated
|
|
18171
|
+
* surfaces — the cells, the nested editors — keep their own inner-bound
|
|
18172
|
+
* handlers and stand no registration over the outer scope). The entry
|
|
18173
|
+
* updates over every handler's identity change; the unmount unregisters.
|
|
18174
|
+
*/
|
|
18175
|
+
function usePageSurfaceRegistration(id, innerRef, handlers) {
|
|
18176
|
+
const registry = usePageSurface();
|
|
18177
|
+
const { onKeydown, onInput, onPaste } = handlers;
|
|
18178
|
+
useEffect(() => {
|
|
18179
|
+
const inner = innerRef.current;
|
|
18180
|
+
if (registry === null || inner === null || isPageSurfaceInner(inner) === false) return;
|
|
18181
|
+
registry.register(id, {
|
|
18182
|
+
onKeydown,
|
|
18183
|
+
onInput,
|
|
18184
|
+
onPaste
|
|
18185
|
+
});
|
|
18186
|
+
return () => registry.unregister(id);
|
|
18187
|
+
}, [
|
|
18188
|
+
registry,
|
|
18189
|
+
id,
|
|
18190
|
+
innerRef,
|
|
18191
|
+
onKeydown,
|
|
18192
|
+
onInput,
|
|
18193
|
+
onPaste
|
|
18194
|
+
]);
|
|
18195
|
+
}
|
|
17851
18196
|
//#endregion
|
|
17852
18197
|
//#region src/editing/format-toolbar/constants.ts
|
|
17853
18198
|
/** The default format palette: the shared palette's seven pastel theme
|
|
@@ -18583,6 +18928,7 @@ function CalloutBlockMenu({ id, block }) {
|
|
|
18583
18928
|
"data-slot": "docblocks/callout-icon",
|
|
18584
18929
|
className: "absolute flex items-center justify-center",
|
|
18585
18930
|
style: iconStyle,
|
|
18931
|
+
contentEditable: false,
|
|
18586
18932
|
children: /* @__PURE__ */ jsxs(Popover, {
|
|
18587
18933
|
modal: false,
|
|
18588
18934
|
open: menuOpen,
|
|
@@ -18750,6 +19096,7 @@ function BlockCaption({ id, caption, slot, ariaLabel, placeholder }) {
|
|
|
18750
19096
|
if (viewMode) return /* @__PURE__ */ jsx("span", {
|
|
18751
19097
|
"data-slot": slot,
|
|
18752
19098
|
"aria-label": ariaLabel,
|
|
19099
|
+
contentEditable: false,
|
|
18753
19100
|
className: "\n mx-auto my-1 block w-[90%] text-center text-[0.8125em] text-muted-foreground\n dark:text-muted-foreground\n ",
|
|
18754
19101
|
children: caption
|
|
18755
19102
|
});
|
|
@@ -19185,7 +19532,7 @@ function TextBlock({ id, block, tag, nested, collapsible = false, flat = false,
|
|
|
19185
19532
|
ids: [id],
|
|
19186
19533
|
anchorId: id
|
|
19187
19534
|
});
|
|
19188
|
-
wrapperRef.current
|
|
19535
|
+
if (wrapperRef.current !== null) parkEditorFocus(wrapperRef.current);
|
|
19189
19536
|
}, [
|
|
19190
19537
|
blockContext,
|
|
19191
19538
|
doc,
|
|
@@ -19358,7 +19705,6 @@ function TextBlock({ id, block, tag, nested, collapsible = false, flat = false,
|
|
|
19358
19705
|
"data-align": alignOf(block),
|
|
19359
19706
|
"data-depth": block.type === "list-item" ? cycle : void 0,
|
|
19360
19707
|
"data-selected": selected ? "true" : void 0,
|
|
19361
|
-
tabIndex: 0,
|
|
19362
19708
|
className: cn("group", wrapperClass),
|
|
19363
19709
|
style: calloutStyle,
|
|
19364
19710
|
onKeyDown: onKeydown,
|
|
@@ -19414,6 +19760,7 @@ function TextBlock({ id, block, tag, nested, collapsible = false, flat = false,
|
|
|
19414
19760
|
block.type === "quote" && /* @__PURE__ */ jsx("div", {
|
|
19415
19761
|
"data-slot": "docblocks/quote-rule",
|
|
19416
19762
|
"aria-hidden": true,
|
|
19763
|
+
contentEditable: false,
|
|
19417
19764
|
className: "\n pointer-events-none absolute top-0 bottom-0 left-0 w-(--docblocks-quote-border-width)\n bg-(--docblocks-quote-border-color)\n "
|
|
19418
19765
|
}),
|
|
19419
19766
|
block.type === "callout" && /* @__PURE__ */ jsx(CalloutBlockMenu, {
|
|
@@ -19424,6 +19771,8 @@ function TextBlock({ id, block, tag, nested, collapsible = false, flat = false,
|
|
|
19424
19771
|
"data-slot": "docblocks/row-marker",
|
|
19425
19772
|
"data-cycle": cycle,
|
|
19426
19773
|
"data-kind": block.attrs.list,
|
|
19774
|
+
contentEditable: false,
|
|
19775
|
+
className: "select-none",
|
|
19427
19776
|
children: flatMarkerIsNumber && number !== void 0 ? numberMarkerLabel(number, cycle) : null
|
|
19428
19777
|
}),
|
|
19429
19778
|
collapsible && /* @__PURE__ */ jsx(Button, {
|
|
@@ -19840,6 +20189,7 @@ function PlaceholderBlock({ type }) {
|
|
|
19840
20189
|
return /* @__PURE__ */ jsx(Card, {
|
|
19841
20190
|
"data-slot": "docblocks/placeholder",
|
|
19842
20191
|
"data-block-type": type,
|
|
20192
|
+
contentEditable: false,
|
|
19843
20193
|
className: "my-(--docblocks-block-spacing) outline-none",
|
|
19844
20194
|
children: /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx(Badge, {
|
|
19845
20195
|
variant: "secondary",
|
|
@@ -23301,7 +23651,7 @@ function ShapeText({ id, block, box }) {
|
|
|
23301
23651
|
contentEditable: true,
|
|
23302
23652
|
"data-slot": "docblocks/shape-text-edit",
|
|
23303
23653
|
suppressContentEditableWarning: true,
|
|
23304
|
-
className: "w-full outline-none",
|
|
23654
|
+
className: "min-h-[1em] w-full outline-none",
|
|
23305
23655
|
onKeyDown: onEditKeyDown,
|
|
23306
23656
|
onBlur: commitText
|
|
23307
23657
|
}) : /* @__PURE__ */ jsx("div", {
|
|
@@ -23753,6 +24103,7 @@ function FramePageBlock({ id }) {
|
|
|
23753
24103
|
"data-slot": "docblocks/frame-page-missing",
|
|
23754
24104
|
"data-block-type": "frame",
|
|
23755
24105
|
"data-block-id": id,
|
|
24106
|
+
contentEditable: false,
|
|
23756
24107
|
className: "\n mx-0 my-(--docblocks-block-spacing) rounded-(--docblocks-radius)\n border-(length:--docblocks-table-border-width) border-dashed border-(--docblocks-table-border-color)\n outline-none\n ",
|
|
23757
24108
|
children: /* @__PURE__ */ jsx(CardContent, {
|
|
23758
24109
|
className: "flex items-center justify-center text-sm text-muted-foreground",
|
|
@@ -23813,6 +24164,7 @@ function FramePageWindow({ id, frameId, surfaceId, referenced }) {
|
|
|
23813
24164
|
"data-block-id": id,
|
|
23814
24165
|
tabIndex: 0,
|
|
23815
24166
|
onMouseDown: preventDefault,
|
|
24167
|
+
contentEditable: false,
|
|
23816
24168
|
className: "\n my-(--docblocks-block-spacing) outline-none\n focus-visible:outline-(length:--docblocks-canvas-selection-border-width) focus-visible:outline-offset-1\n focus-visible:outline-(--docblocks-canvas-selection-border-color) focus-visible:outline-dashed\n ",
|
|
23817
24169
|
children: /* @__PURE__ */ jsx("div", {
|
|
23818
24170
|
"data-slot": "docblocks/frame-page-window",
|
|
@@ -24137,6 +24489,7 @@ function ImageFigure({ id, block, url, name }) {
|
|
|
24137
24489
|
"data-align": align,
|
|
24138
24490
|
"data-selected": selected ? "true" : void 0,
|
|
24139
24491
|
tabIndex: 0,
|
|
24492
|
+
contentEditable: false,
|
|
24140
24493
|
className: cn("group relative", alignClass, "outline-none", selected && "outline-(length:--docblocks-canvas-selection-border-width) outline-offset-1 outline-(--docblocks-canvas-selection-border-color) outline-solid", `
|
|
24141
24494
|
focus-visible:outline-(length:--docblocks-canvas-selection-border-width) focus-visible:outline-offset-1
|
|
24142
24495
|
focus-visible:outline-(--docblocks-canvas-selection-border-color) focus-visible:outline-dashed
|
|
@@ -24318,6 +24671,7 @@ function SyncEmbedBlock({ id, block }) {
|
|
|
24318
24671
|
"data-block-id": id,
|
|
24319
24672
|
"data-state": state,
|
|
24320
24673
|
"data-doc-id": ref.docId,
|
|
24674
|
+
contentEditable: false,
|
|
24321
24675
|
className: "\n my-(--docblocks-block-spacing) rounded-(--docblocks-radius) border-(length:--docblocks-table-border-width)\n border-(--docblocks-table-border-color) outline-none\n ",
|
|
24322
24676
|
children: [state === "resolved" && master !== null && /* @__PURE__ */ jsx(SyncEmbedContent, {
|
|
24323
24677
|
master,
|
|
@@ -24463,6 +24817,17 @@ function languageLabel(language) {
|
|
|
24463
24817
|
function CodeHeader({ id, block, center }) {
|
|
24464
24818
|
const { t } = useTranslation("blocks");
|
|
24465
24819
|
const { doc, store, viewMode } = useEditorContext();
|
|
24820
|
+
const [caretInside, setCaretInside] = useState(false);
|
|
24821
|
+
useEffect(() => {
|
|
24822
|
+
const onChange = () => {
|
|
24823
|
+
const anchor = window.getSelection()?.anchorNode ?? null;
|
|
24824
|
+
const inner = (anchor instanceof Element ? anchor : anchor?.parentElement ?? null)?.closest(`[data-block-id="${CSS.escape(id)}"] [data-slot="docblocks/block-content"]`) ?? null;
|
|
24825
|
+
setCaretInside(inner !== null);
|
|
24826
|
+
};
|
|
24827
|
+
onChange();
|
|
24828
|
+
document.addEventListener("selectionchange", onChange);
|
|
24829
|
+
return () => document.removeEventListener("selectionchange", onChange);
|
|
24830
|
+
}, [id]);
|
|
24466
24831
|
const [languageOpen, setLanguageOpen] = useState(false);
|
|
24467
24832
|
const [query, setQuery] = useState("");
|
|
24468
24833
|
const [moreOpen, setMoreOpen] = useState(false);
|
|
@@ -24518,11 +24883,8 @@ function CodeHeader({ id, block, center }) {
|
|
|
24518
24883
|
const controlClass = menuOpen ? "opacity-100 transition-opacity" : "pointer-events-none opacity-0 transition-opacity group-hover:pointer-events-auto group-hover:opacity-100 group-focus-within/code:pointer-events-auto group-focus-within/code:opacity-100";
|
|
24519
24884
|
return /* @__PURE__ */ jsxs("div", {
|
|
24520
24885
|
"data-slot": "docblocks/code-header",
|
|
24521
|
-
|
|
24522
|
-
|
|
24523
|
-
group-focus-within:border-border
|
|
24524
|
-
group-hover:border-border
|
|
24525
|
-
`, menuOpen && "border-border"),
|
|
24886
|
+
contentEditable: false,
|
|
24887
|
+
className: cn("group/code mb-1 flex items-center justify-between gap-2 border-b pb-1 text-[0.8125em]", caretInside || menuOpen ? "border-border" : "border-transparent group-focus-within:border-border group-hover:border-border"),
|
|
24526
24888
|
onMouseDown: preventDefault,
|
|
24527
24889
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
24528
24890
|
className: cn("flex items-center gap-1.5", controlClass),
|
|
@@ -25071,6 +25433,7 @@ function CellActivation({ cellId }) {
|
|
|
25071
25433
|
};
|
|
25072
25434
|
const onKeyDown = (event) => {
|
|
25073
25435
|
if (event.key === "Enter" && !event.nativeEvent.isComposing) event.preventDefault();
|
|
25436
|
+
if (event.key === "Backspace") event.preventDefault();
|
|
25074
25437
|
};
|
|
25075
25438
|
return /* @__PURE__ */ jsx("div", {
|
|
25076
25439
|
ref,
|
|
@@ -25086,23 +25449,30 @@ function CellActivation({ cellId }) {
|
|
|
25086
25449
|
}
|
|
25087
25450
|
//#endregion
|
|
25088
25451
|
//#region src/blocks/table/TableCell.tsx
|
|
25089
|
-
/** The table's cell renderer (the drag transform
|
|
25090
|
-
*
|
|
25452
|
+
/** The table's cell renderer (the row / column drag's transform — the cell
|
|
25453
|
+
* is the transform's element: the `<tr>` is not a CSS transformable
|
|
25454
|
+
* element, so the row's drag applies over the row's cells; the dragged
|
|
25455
|
+
* cell's card background; the column/row's background is kept) + the cell's
|
|
25456
|
+
* own-content layer. */
|
|
25091
25457
|
/** One cell: its flat content sequence renders through the flat sequence renderer. */
|
|
25092
|
-
const TableCell = memo(function TableCell({ id, dragX, dragShifted }) {
|
|
25458
|
+
const TableCell = memo(function TableCell({ id, dragX, dragShifted, rowDy, rowShifted }) {
|
|
25093
25459
|
const cell = useBlock(id);
|
|
25094
25460
|
const { viewMode } = useEditorContext();
|
|
25095
25461
|
const children = cell !== void 0 && cell.type === "table-cell" ? cell.children ?? EMPTY_IDS : EMPTY_IDS;
|
|
25096
25462
|
const contextValue = useBlockContextValue(id, children, "table-cell");
|
|
25097
25463
|
if (cell === void 0 || cell.type !== "table-cell") return null;
|
|
25098
25464
|
const background = cell.attrs?.columnColor ?? cell.attrs?.rowColor;
|
|
25465
|
+
const hasDrag = dragX !== 0 || rowDy !== 0;
|
|
25466
|
+
const dragged = hasDrag && !dragShifted && !rowShifted;
|
|
25099
25467
|
const style = {
|
|
25100
25468
|
...background !== void 0 ? { background } : {},
|
|
25101
|
-
...
|
|
25102
|
-
|
|
25469
|
+
...dragged && background === void 0 ? { background: "var(--docblocks-table-drag-background, transparent)" } : {},
|
|
25470
|
+
...dragged ? { boxShadow: "var(--docblocks-table-drag-shadow, none)" } : {},
|
|
25471
|
+
...hasDrag ? {
|
|
25472
|
+
transform: `translate(${dragX}px, ${rowDy}px)`,
|
|
25103
25473
|
position: "relative",
|
|
25104
|
-
zIndex:
|
|
25105
|
-
transition:
|
|
25474
|
+
zIndex: dragged ? 10 : void 0,
|
|
25475
|
+
transition: dragged ? void 0 : DRAG_TRANSITION
|
|
25106
25476
|
} : {}
|
|
25107
25477
|
};
|
|
25108
25478
|
const hasOwnText = (cell.content ?? []).some((run) => run.text !== "");
|
|
@@ -25116,7 +25486,12 @@ const TableCell = memo(function TableCell({ id, dragX, dragShifted }) {
|
|
|
25116
25486
|
children: [hasOwnText ? /* @__PURE__ */ jsx(CellContent, {
|
|
25117
25487
|
id,
|
|
25118
25488
|
block: cell
|
|
25119
|
-
}) : null, children.length === 0 && !hasOwnText
|
|
25489
|
+
}) : null, children.length === 0 && !hasOwnText ? viewMode ? /* @__PURE__ */ jsx("span", {
|
|
25490
|
+
"aria-hidden": true,
|
|
25491
|
+
"data-slot": "docblocks/cell-empty",
|
|
25492
|
+
className: "my-(--docblocks-block-spacing) block whitespace-pre-wrap",
|
|
25493
|
+
children: ""
|
|
25494
|
+
}) : /* @__PURE__ */ jsx(CellActivation, { cellId: id }) : /* @__PURE__ */ jsx(BlockGroups, { ids: children })]
|
|
25120
25495
|
})
|
|
25121
25496
|
});
|
|
25122
25497
|
});
|
|
@@ -25178,31 +25553,26 @@ function CellContent({ id, block }) {
|
|
|
25178
25553
|
//#endregion
|
|
25179
25554
|
//#region src/blocks/table/TableRow.tsx
|
|
25180
25555
|
/** The table's row renderer: the cell ids come from the row's own
|
|
25181
|
-
* snapshot; the row / column drag transforms
|
|
25556
|
+
* snapshot; the row / column drag transforms apply over the row's cells
|
|
25557
|
+
* (the `<tr>` is not a CSS transformable element — the row's drag's dy is
|
|
25558
|
+
* the per-cell transform's part). */
|
|
25182
25559
|
/** One row: the cell ids come from the row's own snapshot. */
|
|
25183
25560
|
const TableRow = memo(function TableRow({ id, rowTransform, columnTransforms, dimmed }) {
|
|
25184
25561
|
const row = useBlock(id);
|
|
25185
25562
|
const cells = row !== void 0 && row.type === "table-row" ? row.children ?? EMPTY_IDS : EMPTY_IDS;
|
|
25186
25563
|
const contextValue = useBlockContextValue(id, cells, "table-row");
|
|
25187
25564
|
if (row === void 0 || row.type !== "table-row") return null;
|
|
25188
|
-
const dragging = rowTransform.dy !== 0;
|
|
25189
25565
|
return /* @__PURE__ */ jsx("tr", {
|
|
25190
25566
|
"data-block-id": id,
|
|
25191
|
-
style:
|
|
25192
|
-
...dragging ? {
|
|
25193
|
-
transform: `translateY(${rowTransform.dy}px)`,
|
|
25194
|
-
position: "relative",
|
|
25195
|
-
zIndex: rowTransform.shifted ? void 0 : 10,
|
|
25196
|
-
transition: rowTransform.shifted ? DRAG_TRANSITION : void 0
|
|
25197
|
-
} : {},
|
|
25198
|
-
...dimmed ? { opacity: .4 } : {}
|
|
25199
|
-
} : void 0,
|
|
25567
|
+
style: dimmed ? { opacity: .4 } : void 0,
|
|
25200
25568
|
children: /* @__PURE__ */ jsx(BlockContext.Provider, {
|
|
25201
25569
|
value: contextValue,
|
|
25202
25570
|
children: cells.map((cellId, cellIndex) => /* @__PURE__ */ jsx(TableCell, {
|
|
25203
25571
|
id: cellId,
|
|
25204
25572
|
dragX: columnTransforms[cellIndex]?.dx ?? 0,
|
|
25205
|
-
dragShifted: columnTransforms[cellIndex]?.shifted ?? false
|
|
25573
|
+
dragShifted: columnTransforms[cellIndex]?.shifted ?? false,
|
|
25574
|
+
rowDy: rowTransform.dy,
|
|
25575
|
+
rowShifted: rowTransform.shifted
|
|
25206
25576
|
}, cellId))
|
|
25207
25577
|
})
|
|
25208
25578
|
});
|
|
@@ -25525,9 +25895,11 @@ function useTableSeamResize({ docWidths, doc, id, resizeSessionRef }) {
|
|
|
25525
25895
|
*
|
|
25526
25896
|
* The row/column handles: hovering a cell reveals the column handle (above
|
|
25527
25897
|
* the column) and the row handle (left of the row). A press and drag
|
|
25528
|
-
* reorders (the live preview is a transform on the dragged row/
|
|
25529
|
-
*
|
|
25530
|
-
*
|
|
25898
|
+
* reorders (the live preview is a transform on the dragged row/column's
|
|
25899
|
+
* cells — the `<tr>` is not a CSS transformable element — with the card's
|
|
25900
|
+
* background over the uncolored cells; the release commits moveTableRow /
|
|
25901
|
+
* moveTableColumn — one command; a stale drop issues none). A press without
|
|
25902
|
+
* a drag opens the handle's menu (the
|
|
25531
25903
|
* background color palette with the conditional remove, insert / move /
|
|
25532
25904
|
* duplicate / clear / delete). The add-row / add-column chips
|
|
25533
25905
|
* (hover/focus-revealed, like the code header's controls) drive the core's
|
|
@@ -25868,6 +26240,7 @@ function TableBlock({ id, block }) {
|
|
|
25868
26240
|
return /* @__PURE__ */ jsxs("div", {
|
|
25869
26241
|
ref: frameRef,
|
|
25870
26242
|
"data-slot": "docblocks/table-scroll",
|
|
26243
|
+
contentEditable: false,
|
|
25871
26244
|
className: "group relative my-(--docblocks-block-spacing)",
|
|
25872
26245
|
children: [
|
|
25873
26246
|
/* @__PURE__ */ jsx("div", {
|
|
@@ -26176,6 +26549,7 @@ function dispatchBuiltIn(id, block, nested, collapsible, flat, number) {
|
|
|
26176
26549
|
"data-slot": "docblocks/divider",
|
|
26177
26550
|
"data-block-type": "divider",
|
|
26178
26551
|
"data-block-id": id,
|
|
26552
|
+
contentEditable: false,
|
|
26179
26553
|
className: "\n m-(--docblocks-divider-margin) border-0 border-t-(length:--docblocks-divider-border-width)\n border-t-(--docblocks-divider-border-color)\n "
|
|
26180
26554
|
});
|
|
26181
26555
|
case "image": return /* @__PURE__ */ jsx(ImageBlock, {
|
|
@@ -28367,8 +28741,17 @@ function useCrossDrag(rootRef, doc) {
|
|
|
28367
28741
|
const root = rootRef.current;
|
|
28368
28742
|
if (session === null || root === null || event.pointerId !== session.pointerId) return;
|
|
28369
28743
|
sessionRef.current = null;
|
|
28370
|
-
|
|
28371
|
-
|
|
28744
|
+
const seat = () => {
|
|
28745
|
+
if (session.moved && session.last !== null) seatCrossSelection(session.anchor, session.last);
|
|
28746
|
+
else window.getSelection()?.setBaseAndExtent(session.anchor.node, session.anchor.offset, session.anchor.node, session.anchor.offset);
|
|
28747
|
+
};
|
|
28748
|
+
seat();
|
|
28749
|
+
const seatNode = window.getSelection()?.anchorNode ?? session.anchor.node;
|
|
28750
|
+
const editable = (seatNode instanceof Element ? seatNode : seatNode.parentElement ?? null)?.closest("[contenteditable=\"true\"]") ?? null;
|
|
28751
|
+
if (editable !== null && document.activeElement !== editable) {
|
|
28752
|
+
editable.focus();
|
|
28753
|
+
seat();
|
|
28754
|
+
}
|
|
28372
28755
|
window.removeEventListener("pointermove", move);
|
|
28373
28756
|
window.removeEventListener("pointerup", end);
|
|
28374
28757
|
window.removeEventListener("pointercancel", end);
|
|
@@ -28426,6 +28809,30 @@ function useCrossDrag(rootRef, doc) {
|
|
|
28426
28809
|
window.addEventListener("pointercancel", handlers.end);
|
|
28427
28810
|
window.addEventListener("mousedown", handlers.mousedown, true);
|
|
28428
28811
|
}, [doc, rootRef]);
|
|
28812
|
+
useEffect(() => {
|
|
28813
|
+
const guard = (event) => {
|
|
28814
|
+
const root = rootRef.current;
|
|
28815
|
+
if (root === null || event.button !== 0) return;
|
|
28816
|
+
const target = event.target instanceof Element ? event.target : null;
|
|
28817
|
+
if (target === null || !root.contains(target)) return;
|
|
28818
|
+
if (document.activeElement instanceof HTMLIFrameElement) return;
|
|
28819
|
+
if (target.closest("[data-slot=\"docblocks/page\"]") === null) return;
|
|
28820
|
+
if (target.closest("input, textarea, select, button") !== null) return;
|
|
28821
|
+
const island = target.closest("[contenteditable=\"false\"]");
|
|
28822
|
+
const editable = target.closest("[contenteditable=\"true\"]");
|
|
28823
|
+
if (island !== null && editable !== null && island.contains(editable)) return;
|
|
28824
|
+
const active = document.activeElement;
|
|
28825
|
+
const activeIsland = active instanceof HTMLElement ? active.closest("[contenteditable=\"false\"]") : null;
|
|
28826
|
+
const activeEditable = active instanceof HTMLElement ? active.closest("[contenteditable=\"true\"]") : null;
|
|
28827
|
+
if (active instanceof HTMLElement && (active.matches("input, textarea") || activeIsland !== null && activeEditable !== null && activeIsland.contains(activeEditable))) return;
|
|
28828
|
+
if (island === null && editable instanceof HTMLElement && isPageSurfaceInner(editable)) return;
|
|
28829
|
+
event.preventDefault();
|
|
28830
|
+
const a = document.activeElement;
|
|
28831
|
+
if (root !== null && (a === null || !root.contains(a))) root.focus();
|
|
28832
|
+
};
|
|
28833
|
+
window.addEventListener("mousedown", guard, true);
|
|
28834
|
+
return () => window.removeEventListener("mousedown", guard, true);
|
|
28835
|
+
}, [rootRef]);
|
|
28429
28836
|
useEffect(() => {
|
|
28430
28837
|
const triple = (event) => {
|
|
28431
28838
|
const root = rootRef.current;
|
|
@@ -28488,7 +28895,8 @@ function scheduleHistoryReseat(doc, view, root) {
|
|
|
28488
28895
|
const unsubscribe = view.onChange((selection) => {
|
|
28489
28896
|
if (!alive) return;
|
|
28490
28897
|
if (selection.kind !== "text") return;
|
|
28491
|
-
run();
|
|
28898
|
+
if (typeof requestAnimationFrame === "function") requestAnimationFrame(() => alive && run());
|
|
28899
|
+
else window.setTimeout(() => alive && run(), 0);
|
|
28492
28900
|
});
|
|
28493
28901
|
window.setTimeout(() => {
|
|
28494
28902
|
alive = false;
|
|
@@ -28517,11 +28925,21 @@ function useEditing() {
|
|
|
28517
28925
|
const root = rootRef.current;
|
|
28518
28926
|
const view = selectionRef.view;
|
|
28519
28927
|
if (root === null || view === null) return;
|
|
28928
|
+
const pageContainer = root.querySelector("[data-slot='docblocks/page']");
|
|
28929
|
+
const pageSelection = window.getSelection();
|
|
28930
|
+
if (pageContainer !== null && view.get().kind !== "blocks" && Date.now() >= selectionRef.reseatUntil.current && pageSelection !== null && pageSelection.isCollapsed && containerCaretNeedsReseat(pageContainer, pageSelection.anchorNode)) {
|
|
28931
|
+
reseatContainerCaret(pageContainer, root, doc);
|
|
28932
|
+
return;
|
|
28933
|
+
}
|
|
28520
28934
|
const next = mapDomSelection(root, window.getSelection(), doc);
|
|
28521
28935
|
if (view.get().kind === "blocks" && !domSelectionInEditable(window.getSelection())) return;
|
|
28522
28936
|
const anchorNode = window.getSelection()?.anchorNode ?? null;
|
|
28523
28937
|
if ((anchorNode instanceof Element ? anchorNode : anchorNode?.parentElement ?? null)?.closest("[data-slot=\"docblocks/page-card\"]") !== null) return;
|
|
28524
28938
|
if (next.kind !== "text" && Date.now() < selectionRef.reseatUntil.current) return;
|
|
28939
|
+
if (next.kind === "text" && Date.now() < selectionRef.reseatUntil.current) {
|
|
28940
|
+
const anchor = window.getSelection()?.anchorNode ?? null;
|
|
28941
|
+
if (anchor === null || anchor.nodeType !== Node.TEXT_NODE) return;
|
|
28942
|
+
}
|
|
28525
28943
|
if (!selectionsEqual(next, view.get())) view.set(next);
|
|
28526
28944
|
};
|
|
28527
28945
|
document.addEventListener("selectionchange", onSelectionChange);
|
|
@@ -28569,6 +28987,40 @@ function useEditing() {
|
|
|
28569
28987
|
view.set({ kind: "none" });
|
|
28570
28988
|
return;
|
|
28571
28989
|
}
|
|
28990
|
+
if (root !== null) {
|
|
28991
|
+
const pageContainer = root.querySelector("[data-slot='docblocks/page']");
|
|
28992
|
+
if ((event.target === root || event.target === pageContainer) && (event.metaKey || event.ctrlKey) && event.shiftKey && (event.key === "ArrowUp" || event.key === "ArrowDown") && selection.ids.length === 1 && selection.ids[0] !== void 0) {
|
|
28993
|
+
const id = selection.ids[0];
|
|
28994
|
+
const siblings = doc.getChildren(rootBlockId);
|
|
28995
|
+
if (siblings.includes(id)) {
|
|
28996
|
+
const segment = segmentRange(doc, rootBlockId, id);
|
|
28997
|
+
if (segment !== null) {
|
|
28998
|
+
const length = segment.end - segment.start;
|
|
28999
|
+
const isSurface = (candidate) => doc.getBlock(candidate)?.type === "surface";
|
|
29000
|
+
let target = null;
|
|
29001
|
+
if (event.key === "ArrowUp") {
|
|
29002
|
+
let i = segment.start - 1;
|
|
29003
|
+
while (i >= 0 && isSurface(siblings[i])) i -= 1;
|
|
29004
|
+
if (i >= 0) target = i;
|
|
29005
|
+
} else {
|
|
29006
|
+
let j = segment.end;
|
|
29007
|
+
while (j < siblings.length && isSurface(siblings[j])) j += 1;
|
|
29008
|
+
if (j < siblings.length) target = j + 1;
|
|
29009
|
+
}
|
|
29010
|
+
if (target !== null) {
|
|
29011
|
+
event.preventDefault();
|
|
29012
|
+
moveSegmentInSequence(doc, rootBlockId, segment.start, length, target);
|
|
29013
|
+
view.set({
|
|
29014
|
+
kind: "blocks",
|
|
29015
|
+
ids: [id],
|
|
29016
|
+
anchorId: id
|
|
29017
|
+
});
|
|
29018
|
+
return;
|
|
29019
|
+
}
|
|
29020
|
+
}
|
|
29021
|
+
}
|
|
29022
|
+
}
|
|
29023
|
+
}
|
|
28572
29024
|
}
|
|
28573
29025
|
}
|
|
28574
29026
|
if (!(event.metaKey || event.ctrlKey)) return;
|
|
@@ -28898,7 +29350,7 @@ const RowItem = memo(function RowItem({ node, layoutSlide, isDragged, animated,
|
|
|
28898
29350
|
ids: [id],
|
|
28899
29351
|
anchorId: id
|
|
28900
29352
|
});
|
|
28901
|
-
rowRef.current
|
|
29353
|
+
if (rowRef.current !== null) parkEditorFocus(rowRef.current);
|
|
28902
29354
|
}, [
|
|
28903
29355
|
blockContext,
|
|
28904
29356
|
doc,
|
|
@@ -28927,7 +29379,6 @@ const RowItem = memo(function RowItem({ node, layoutSlide, isDragged, animated,
|
|
|
28927
29379
|
"data-slot": "docblocks/row",
|
|
28928
29380
|
"data-selected": selected ? "true" : void 0,
|
|
28929
29381
|
value: node.id,
|
|
28930
|
-
tabIndex: 0,
|
|
28931
29382
|
initial: animated ? ENTER : false,
|
|
28932
29383
|
animate: ANIMATE,
|
|
28933
29384
|
exit: EXIT,
|
|
@@ -28957,6 +29408,7 @@ const RowItem = memo(function RowItem({ node, layoutSlide, isDragged, animated,
|
|
|
28957
29408
|
"aria-label": t("row.selectBlock"),
|
|
28958
29409
|
variant: "ghost",
|
|
28959
29410
|
size: "icon",
|
|
29411
|
+
contentEditable: false,
|
|
28960
29412
|
onClick: onGutterClick,
|
|
28961
29413
|
onMouseDown: onHandleMouseDown,
|
|
28962
29414
|
className: cn("absolute top-[calc((var(--docblocks-line-box-height)-var(--docblocks-gutter-size))/2)]", "cursor-pointer rounded-full opacity-0 group-hover:opacity-100", "text-(--docblocks-gutter-color)", "size-5", selected && "opacity-100"),
|
|
@@ -29099,6 +29551,16 @@ const RowList = memo(function RowList({ order, nodesById, layoutSlide, draggingK
|
|
|
29099
29551
|
* gate (rows that mount before the first text input stand up instantly).
|
|
29100
29552
|
*/
|
|
29101
29553
|
/**
|
|
29554
|
+
* Whether the event's target is a text-editing surface of the page model:
|
|
29555
|
+
* the page's single editable container (the shared-editable's keys/inputs
|
|
29556
|
+
* target it, never a block's inner) or a block's own inner (the isolated
|
|
29557
|
+
* surfaces' cells stand their own focused inner).
|
|
29558
|
+
*/
|
|
29559
|
+
function isPageTextTarget(target) {
|
|
29560
|
+
if (target === null) return false;
|
|
29561
|
+
return target.closest("[data-slot=\"docblocks/page\"]") !== null || target.closest("[data-slot=\"docblocks/block-content\"]") !== null;
|
|
29562
|
+
}
|
|
29563
|
+
/**
|
|
29102
29564
|
* The grip typing flag: the editor root holds `data-docblocks-typing` from
|
|
29103
29565
|
* the first text keypress in its own content until the first pointer move
|
|
29104
29566
|
* or the focus leaving the editor — the stylesheet's unlayered rule hides
|
|
@@ -29117,7 +29579,7 @@ function useTypingFlag(rootRef) {
|
|
|
29117
29579
|
const onKeydown = (event) => {
|
|
29118
29580
|
const target = event.target instanceof Element ? event.target : null;
|
|
29119
29581
|
if (target === null || target.closest("[data-slot=\"docblocks/editor\"]") !== root) return;
|
|
29120
|
-
if (target
|
|
29582
|
+
if (isPageTextTarget(target) === false) return;
|
|
29121
29583
|
if (event.key.length !== 1 || event.key === " " || event.metaKey || event.ctrlKey || event.altKey) return;
|
|
29122
29584
|
setTyping(true);
|
|
29123
29585
|
};
|
|
@@ -29155,7 +29617,7 @@ function useEnterAnimationGate(rootRef) {
|
|
|
29155
29617
|
const target = event.target instanceof Element ? event.target : null;
|
|
29156
29618
|
if (target === null) return false;
|
|
29157
29619
|
if (target.closest("[data-slot=\"docblocks/editor\"]") !== root) return false;
|
|
29158
|
-
return target
|
|
29620
|
+
return isPageTextTarget(target);
|
|
29159
29621
|
};
|
|
29160
29622
|
const onKeydown = (event) => {
|
|
29161
29623
|
if (event.key.length !== 1 || event.metaKey || event.ctrlKey || event.altKey) return;
|
|
@@ -29446,6 +29908,8 @@ function useMotionDrag({ doc, rootBlockId, store, rootRef, rowKeys, nodesById })
|
|
|
29446
29908
|
const slideTimerRef = useRef(null);
|
|
29447
29909
|
const prevKeysRef = useRef(rowKeys);
|
|
29448
29910
|
const entryContainerRef = useRef(null);
|
|
29911
|
+
const movedRef = useRef(false);
|
|
29912
|
+
const preDragSeatRef = useRef(null);
|
|
29449
29913
|
/**
|
|
29450
29914
|
* Keep the layout slide armed for the settle window after a drag or a
|
|
29451
29915
|
* structural change, then release it so in-place content changes
|
|
@@ -29523,6 +29987,36 @@ function useMotionDrag({ doc, rootBlockId, store, rootRef, rowKeys, nodesById })
|
|
|
29523
29987
|
previewIndent,
|
|
29524
29988
|
layoutSlide,
|
|
29525
29989
|
onRowDragStart: useCallback((id) => {
|
|
29990
|
+
movedRef.current = false;
|
|
29991
|
+
const selection = window.getSelection();
|
|
29992
|
+
let seat = null;
|
|
29993
|
+
if (selection !== null && selection.rangeCount > 0) {
|
|
29994
|
+
const range = selection.getRangeAt(0);
|
|
29995
|
+
const anchorInner = textBlockOfNode(range.startContainer);
|
|
29996
|
+
const focusInner = textBlockOfNode(range.endContainer);
|
|
29997
|
+
if (anchorInner !== null && anchorInner === focusInner) {
|
|
29998
|
+
const blockId = anchorInner.dataset.blockId;
|
|
29999
|
+
if (blockId !== void 0) seat = {
|
|
30000
|
+
blockId,
|
|
30001
|
+
from: caretOffsetIn(anchorInner, range.startContainer, range.startOffset),
|
|
30002
|
+
to: selection.isCollapsed ? null : caretOffsetIn(anchorInner, range.endContainer, range.endOffset)
|
|
30003
|
+
};
|
|
30004
|
+
}
|
|
30005
|
+
}
|
|
30006
|
+
preDragSeatRef.current = seat;
|
|
30007
|
+
const suppress = (click) => {
|
|
30008
|
+
if (!movedRef.current) return;
|
|
30009
|
+
const target = click.target instanceof Element ? click.target : null;
|
|
30010
|
+
if (target !== null && target.closest("[data-slot=\"docblocks/block-content\"]") !== null) return;
|
|
30011
|
+
movedRef.current = false;
|
|
30012
|
+
click.preventDefault();
|
|
30013
|
+
click.stopPropagation();
|
|
30014
|
+
};
|
|
30015
|
+
window.addEventListener("click", suppress, {
|
|
30016
|
+
capture: true,
|
|
30017
|
+
once: true
|
|
30018
|
+
});
|
|
30019
|
+
window.setTimeout(() => window.removeEventListener("click", suppress, true), 2e3);
|
|
29526
30020
|
armSlide();
|
|
29527
30021
|
setDraggingKey(id);
|
|
29528
30022
|
setPreviewIndent(null);
|
|
@@ -29536,6 +30030,7 @@ function useMotionDrag({ doc, rootBlockId, store, rootRef, rowKeys, nodesById })
|
|
|
29536
30030
|
rootBlockId
|
|
29537
30031
|
]),
|
|
29538
30032
|
onRowDragMove: useCallback((id, event) => {
|
|
30033
|
+
movedRef.current = true;
|
|
29539
30034
|
const pointerY = pointerYOf(event);
|
|
29540
30035
|
if (pointerY === null) return;
|
|
29541
30036
|
const candidate = seamCandidateAt(id, pointerY);
|
|
@@ -29543,9 +30038,19 @@ function useMotionDrag({ doc, rootBlockId, store, rootRef, rowKeys, nodesById })
|
|
|
29543
30038
|
setPreviewIndent(candidate);
|
|
29544
30039
|
}, [seamCandidateAt]),
|
|
29545
30040
|
onRowDragEnd: useCallback((id, event) => {
|
|
30041
|
+
movedRef.current = false;
|
|
29546
30042
|
armSlide();
|
|
29547
30043
|
setDraggingKey(null);
|
|
29548
|
-
|
|
30044
|
+
const seat = preDragSeatRef.current;
|
|
30045
|
+
preDragSeatRef.current = null;
|
|
30046
|
+
if (seat !== null) {
|
|
30047
|
+
const scope = rootRef.current ?? document;
|
|
30048
|
+
const inner = Array.from(scope.querySelectorAll(`[data-block-id="${CSS.escape(seat.blockId)}"][data-slot="docblocks/block-content"]`)).find((candidate) => !candidate.closest("[data-slot=\"docblocks/frame-window-content\"]")) ?? null;
|
|
30049
|
+
if (inner !== null && inner.isConnected) {
|
|
30050
|
+
inner.focus();
|
|
30051
|
+
restoreSelection(inner, seat.from, seat.to);
|
|
30052
|
+
} else rootRef.current?.focus({ preventScroll: true });
|
|
30053
|
+
} else rootRef.current?.focus({ preventScroll: true });
|
|
29549
30054
|
const pointerY = pointerYOf(event);
|
|
29550
30055
|
setPreviewIndent(null);
|
|
29551
30056
|
if (pointerY === null) return;
|
|
@@ -29596,6 +30101,10 @@ function useMotionDrag({ doc, rootBlockId, store, rootRef, rowKeys, nodesById })
|
|
|
29596
30101
|
function Editor({ view = "page", formatPalette = FORMAT_PALETTE }) {
|
|
29597
30102
|
const { doc, store, rootBlockId, viewMode } = useEditorContext();
|
|
29598
30103
|
const rootChildren = useStore(store, (state) => state.rootChildren);
|
|
30104
|
+
const pageRef = useRef(null);
|
|
30105
|
+
const surfaceMapRef = useRef(null);
|
|
30106
|
+
if (surfaceMapRef.current === null) surfaceMapRef.current = /* @__PURE__ */ new Map();
|
|
30107
|
+
const surface = usePageSurfaceDispatch(pageRef, doc, surfaceMapRef.current);
|
|
29599
30108
|
const seqStamp = useStore(store, (state) => state.seqStamp);
|
|
29600
30109
|
const collapsedIds = useStore(store, (state) => state.collapsedIds);
|
|
29601
30110
|
const pageChildren = useMemo(() => rootChildren.filter((id) => store.getState().blocks[id]?.type !== "surface"), [
|
|
@@ -29684,20 +30193,29 @@ function Editor({ view = "page", formatPalette = FORMAT_PALETTE }) {
|
|
|
29684
30193
|
value: formatPalette,
|
|
29685
30194
|
children: /* @__PURE__ */ jsxs(BlockContext.Provider, {
|
|
29686
30195
|
value: rootContext,
|
|
29687
|
-
children: [view === "canvas" ? /* @__PURE__ */ jsx(CanvasView, {}) : /* @__PURE__ */ jsx(
|
|
29688
|
-
|
|
29689
|
-
|
|
29690
|
-
|
|
29691
|
-
|
|
29692
|
-
|
|
29693
|
-
|
|
29694
|
-
|
|
29695
|
-
|
|
29696
|
-
|
|
29697
|
-
|
|
29698
|
-
|
|
29699
|
-
|
|
29700
|
-
|
|
30196
|
+
children: [view === "canvas" ? /* @__PURE__ */ jsx(CanvasView, {}) : /* @__PURE__ */ jsx(PageSurfaceProvider, {
|
|
30197
|
+
map: surfaceMapRef.current,
|
|
30198
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
30199
|
+
ref: pageRef,
|
|
30200
|
+
"data-slot": "docblocks/page",
|
|
30201
|
+
contentEditable: !viewMode,
|
|
30202
|
+
suppressContentEditableWarning: true,
|
|
30203
|
+
onKeyDown: surface.onKeyDown,
|
|
30204
|
+
onInput: surface.onInput,
|
|
30205
|
+
onPaste: surface.onPaste,
|
|
30206
|
+
className: "\n mx-auto w-full max-w-(--docblocks-page-column-max-width) px-(--docblocks-page-padding-x)\n ",
|
|
30207
|
+
children: /* @__PURE__ */ jsx(RowList, {
|
|
30208
|
+
order,
|
|
30209
|
+
nodesById,
|
|
30210
|
+
layoutSlide: layoutSlide || draggingKey !== null,
|
|
30211
|
+
draggingKey,
|
|
30212
|
+
previewIndent,
|
|
30213
|
+
animated: enterGate.current,
|
|
30214
|
+
onReorder: onRowReorder,
|
|
30215
|
+
onDragStart: onRowDragStart,
|
|
30216
|
+
onDragMove: onRowDragMove,
|
|
30217
|
+
onDragEnd: onRowDragEnd
|
|
30218
|
+
})
|
|
29701
30219
|
})
|
|
29702
30220
|
}), viewMode ? null : /* @__PURE__ */ jsx(PresenceCaretOverlay, { rootRef })]
|
|
29703
30221
|
})
|