@nerd-bible/wordgard 0.5.3-beta3 → 0.5.3-beta5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/doc.js +55 -45
- package/dist/editor.d.ts +30 -136
- package/dist/editor.js +160 -568
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/schema.js +4 -4
- package/dist/set.d.ts +305 -0
- package/dist/set.js +814 -0
- package/dist/table.js +4 -4
- package/package.json +2 -11
package/dist/table.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Decoration,
|
|
1
|
+
import { Decoration, Wordgard } from 'wordgard/editor';
|
|
2
2
|
import { GardState, Transaction, GardSelection, Correction } from 'wordgard/state';
|
|
3
3
|
import { Table, ColSpan, RowSpan, TableRow, Cell, BlockCell, HeaderCell, BlockHeaderCell } from 'wordgard/types';
|
|
4
4
|
import { Node, ValidationError, Token, ChangeSet } from 'wordgard/doc';
|
|
@@ -236,8 +236,8 @@ const cellSelectionDeco = /*@__PURE__*/GardState.Field.define({
|
|
|
236
236
|
const selectedCell = /*@__PURE__*/Decoration.Point.attributes({ class: "wg-selected-cell" });
|
|
237
237
|
function getCellDeco(state) {
|
|
238
238
|
if (!(state.selection instanceof CellSelection))
|
|
239
|
-
return
|
|
240
|
-
return
|
|
239
|
+
return Decoration.Point.none;
|
|
240
|
+
return Decoration.Point.set(state.selection.ranges.map(({ from }) => [from - 1, selectedCell]));
|
|
241
241
|
}
|
|
242
242
|
const tableSelectionFilter = /*@__PURE__*/(() => GardState.prec.low(Transaction.extender.of(tr => {
|
|
243
243
|
let normalized = CellSelection.normalize(tr.newSelection, tr.newDoc);
|
|
@@ -790,7 +790,7 @@ function pastedCells(schema, slice, context) {
|
|
|
790
790
|
tok.type == Table.type) {
|
|
791
791
|
table = tok;
|
|
792
792
|
}
|
|
793
|
-
else if (context.
|
|
793
|
+
else if (context.some(tag => isTableContent(schema, tag.type)) ||
|
|
794
794
|
slice.content.some(tok => tok.tokenType != Token.Type.Close && isTableContent(schema, tok.type))) {
|
|
795
795
|
table = fitSlice(schema, Table, slice, context);
|
|
796
796
|
}
|
package/package.json
CHANGED
|
@@ -1,21 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nerd-bible/wordgard",
|
|
3
|
-
"version": "0.5.3-
|
|
3
|
+
"version": "0.5.3-beta5",
|
|
4
4
|
"description": "Semantic rich text editor system",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": "./dist/index.js",
|
|
9
|
-
"
|
|
10
|
-
"./types": "./dist/types.js",
|
|
11
|
-
"./schema": "./dist/schema.js",
|
|
12
|
-
"./table": "./dist/table.js",
|
|
13
|
-
"./state": "./dist/state.js",
|
|
14
|
-
"./editor": "./dist/editor.js",
|
|
15
|
-
"./command": "./dist/command.js",
|
|
16
|
-
"./history": "./dist/history.js",
|
|
17
|
-
"./collab": "./dist/collab.js",
|
|
18
|
-
"./phrases": "./dist/phrases.js"
|
|
9
|
+
"./*": "./dist/*.js"
|
|
19
10
|
},
|
|
20
11
|
"scripts": {
|
|
21
12
|
"test": "mocha test/test-*.ts",
|