@quillmark/svelte 0.27.0 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +4 -4
- package/README.md +26 -8
- package/THEMING.md +10 -8
- package/dist/core/address.d.ts +35 -64
- package/dist/core/address.js +35 -55
- package/dist/core/bloom.d.ts +4 -10
- package/dist/core/bloom.js +14 -27
- package/dist/core/codec/blocks.d.ts +41 -43
- package/dist/core/codec/blocks.js +97 -130
- package/dist/core/codec/code.d.ts +7 -10
- package/dist/core/codec/code.js +37 -46
- package/dist/core/codec/decode.d.ts +19 -23
- package/dist/core/codec/decode.js +76 -111
- package/dist/core/codec/encode.d.ts +11 -15
- package/dist/core/codec/encode.js +60 -67
- package/dist/core/codec/field.d.ts +62 -95
- package/dist/core/codec/field.js +107 -179
- package/dist/core/codec/islands.d.ts +33 -41
- package/dist/core/codec/islands.js +76 -86
- package/dist/core/codec/lists.d.ts +17 -26
- package/dist/core/codec/lists.js +117 -157
- package/dist/core/codec/marks.d.ts +4 -3
- package/dist/core/codec/marks.js +8 -3
- package/dist/core/codec/prose.css +84 -46
- package/dist/core/codec/schema.d.ts +18 -23
- package/dist/core/codec/schema.js +84 -76
- package/dist/core/codec/slash.d.ts +42 -48
- package/dist/core/codec/slash.js +0 -0
- package/dist/core/codec/table-copy.d.ts +4 -3
- package/dist/core/codec/table-copy.js +25 -7
- package/dist/core/codec/table-view.d.ts +12 -12
- package/dist/core/codec/table-view.js +460 -383
- package/dist/core/codec/table.d.ts +94 -61
- package/dist/core/codec/table.js +331 -83
- package/dist/core/codec/tasks.d.ts +6 -0
- package/dist/core/codec/tasks.js +30 -3
- package/dist/core/errors.d.ts +15 -30
- package/dist/core/errors.js +2 -6
- package/dist/core/index.js +7 -12
- package/dist/core/lifecycle.d.ts +7 -16
- package/dist/core/lifecycle.js +10 -21
- package/dist/core/rebind.svelte.d.ts +10 -20
- package/dist/core/rebind.svelte.js +15 -27
- package/dist/core/rungs.d.ts +14 -11
- package/dist/core/rungs.js +17 -19
- package/dist/core/teardown.d.ts +4 -6
- package/dist/core/teardown.js +7 -10
- package/dist/core/theme.css +74 -54
- package/dist/index.js +3 -8
- package/dist/preset/app.css +3 -1
- package/dist/preset/index.css +6 -8
- package/dist/preset/recipes.css +12 -15
- package/dist/preset/scale.css +18 -17
- package/dist/preset/shell.css +10 -0
- package/dist/preview/bridge.d.ts +18 -22
- package/dist/preview/bridge.js +29 -58
- package/dist/preview/controller.d.ts +21 -29
- package/dist/preview/controller.js +14 -39
- package/dist/preview/geometry.d.ts +13 -34
- package/dist/preview/geometry.js +13 -34
- package/dist/preview/index.js +4 -16
- package/dist/preview/paint.d.ts +3 -3
- package/dist/preview/paint.js +28 -68
- package/dist/preview/strings.d.ts +1 -1
- package/dist/preview/strings.js +2 -14
- package/dist/preview/zoom.d.ts +18 -23
- package/dist/preview/zoom.js +28 -27
- package/dist/visual/ArrayField.svelte +77 -16
- package/dist/visual/BooleanField.svelte +27 -14
- package/dist/visual/Card.svelte +61 -48
- package/dist/visual/CardControls.svelte +5 -11
- package/dist/visual/DateField.svelte +20 -4
- package/dist/visual/EnumField.svelte +3 -0
- package/dist/visual/FieldHint.svelte +2 -1
- package/dist/visual/FormatPopover.svelte +82 -15
- package/dist/visual/FormatPopover.svelte.d.ts +4 -0
- package/dist/visual/MatrixAdd.svelte +30 -12
- package/dist/visual/MatrixField.svelte +24 -16
- package/dist/visual/NumberField.svelte +7 -0
- package/dist/visual/ObjectField.svelte +4 -4
- package/dist/visual/ProseField.svelte +0 -5
- package/dist/visual/TipsCard.svelte +11 -10
- package/dist/visual/VariantField.svelte +3 -1
- package/dist/visual/VisualEditorInner.svelte +19 -3
- package/dist/visual/controls.css +7 -2
- package/dist/visual/fonts.d.ts +18 -0
- package/dist/visual/fonts.js +59 -0
- package/dist/visual/icons/nodes.d.ts +0 -5
- package/dist/visual/icons/nodes.js +0 -4
- package/dist/visual/props.d.ts +14 -1
- package/dist/visual/strings.d.ts +7 -0
- package/dist/visual/strings.js +5 -2
- package/dist/visual/structure.d.ts +43 -87
- package/dist/visual/structure.js +42 -83
- package/package.json +2 -2
|
@@ -8,110 +8,143 @@ export declare const ALIGNS: readonly TableAlign[];
|
|
|
8
8
|
/** The zero cell: empty text, no marks. */
|
|
9
9
|
export declare function emptyCell(): TableCell;
|
|
10
10
|
/**
|
|
11
|
-
* The row index space the chrome and the ops share: **0 is the header**, 1…n the body
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* so index 0 moves and deletes like any other. The one row the model refuses is the
|
|
15
|
-
* last, there being no table under it.
|
|
11
|
+
* The row index space the chrome and the ops share: **0 is the header**, 1…n the body rows. A row
|
|
12
|
+
* op works {@link allRows}, and whichever row lands at index 0 is the header afterwards. The one
|
|
13
|
+
* row the model refuses is the last, there being no table under it.
|
|
16
14
|
*/
|
|
17
15
|
export declare function rowCount(props: TableProps): number;
|
|
18
16
|
/** The cells of row `r` in that space. */
|
|
19
17
|
export declare function rowCells(props: TableProps, r: number): TableCell[];
|
|
20
|
-
/**
|
|
21
|
-
*
|
|
18
|
+
/**
|
|
19
|
+
* Whether a row holds no text, telling a row on offer from one taken up (`table-view.ts` §`step`).
|
|
20
|
+
* Text alone: a mark over none is invisible.
|
|
21
|
+
*/
|
|
22
22
|
export declare function rowEmpty(props: TableProps, r: number): boolean;
|
|
23
23
|
/** The cell at `(row, column)`, or the zero cell where the rectangle does not reach. */
|
|
24
24
|
export declare function cellAt(props: TableProps, r: number, c: number): TableCell;
|
|
25
25
|
/** The table's column count: the one number `header`, every row and `aligns` share. */
|
|
26
26
|
export declare function columnCount(props: TableProps): number;
|
|
27
27
|
/**
|
|
28
|
-
* The rectangularizing constructor: one column count
|
|
29
|
-
* `aligns` and `widths`, padding with empty cells, `none` and auto-fit.
|
|
30
|
-
*
|
|
31
|
-
* gets a rectangle back, and a table is never narrower than one column. The layout
|
|
32
|
-
* keys ride through, each absent at its default as the store writes it.
|
|
28
|
+
* The rectangularizing constructor: one column count (the widest thing present, at least one)
|
|
29
|
+
* across `header`, every row, `aligns` and `widths`, padding with empty cells, `none` and auto-fit.
|
|
30
|
+
* The layout keys ride through, each absent at its default as the store writes it.
|
|
33
31
|
*/
|
|
34
32
|
export declare function normalizeTable(props: TableProps): TableProps;
|
|
33
|
+
/** How many rows from the top draw as header rows, absent being one. */
|
|
34
|
+
export declare function headRows(props: TableProps): number;
|
|
35
|
+
/** The columns and rows a drawn cell spans. */
|
|
36
|
+
export interface Span {
|
|
37
|
+
colspan: number;
|
|
38
|
+
rowspan: number;
|
|
39
|
+
}
|
|
40
|
+
/** {@link spansOf} over a table's rows, header first. */
|
|
41
|
+
export declare function spanGrid(props: TableProps): (Span | null)[][];
|
|
42
|
+
/**
|
|
43
|
+
* The drawn cell whose span covers `(r, c)`; the slot itself where nothing covers it or it lies
|
|
44
|
+
* outside the grid.
|
|
45
|
+
*/
|
|
46
|
+
export declare function anchorAt(grid: (Span | null)[][], r: number, c: number): {
|
|
47
|
+
r: number;
|
|
48
|
+
c: number;
|
|
49
|
+
span: Span;
|
|
50
|
+
};
|
|
35
51
|
/**
|
|
36
|
-
* The rows as one list, header first: the space a row op works in
|
|
37
|
-
* separate field because a table always has one
|
|
38
|
-
*
|
|
39
|
-
* lets move and delete treat every row alike, and {@link fromRows} splits it back.
|
|
52
|
+
* The rows as one list, header first: the space a row op works in, so move and delete treat every
|
|
53
|
+
* row alike. `header` is a separate field because a table always has one; {@link fromRows} splits
|
|
54
|
+
* it back.
|
|
40
55
|
*/
|
|
41
56
|
export declare function allRows(props: TableProps): TableCell[][];
|
|
42
|
-
/** A fresh table: a header plus `bodyRows` empty rows, every column unaligned.
|
|
43
|
-
* Growth is cheap (Tab at the last cell appends a row), so the default is small. */
|
|
57
|
+
/** A fresh table: a header plus `bodyRows` empty rows, every column unaligned. */
|
|
44
58
|
export declare function newTable(cols?: number, bodyRows?: number): TableProps;
|
|
45
59
|
/** `props` with the cell at `(r, c)` replaced. */
|
|
46
60
|
export declare function withCell(props: TableProps, r: number, c: number, cell: TableCell): TableProps;
|
|
47
61
|
/** A new empty body row below row `r` (row 0, the header, opens the first body row). */
|
|
48
62
|
export declare function insertRow(props: TableProps, r: number): TableProps;
|
|
49
|
-
/**
|
|
50
|
-
*
|
|
51
|
-
*
|
|
63
|
+
/**
|
|
64
|
+
* Drop row `r`, the header included: the row left at index 0 becomes the header. A no-op at the
|
|
65
|
+
* last row, which is the removal of the table and the island's to answer.
|
|
66
|
+
*/
|
|
52
67
|
export declare function deleteRow(props: TableProps, r: number): TableProps;
|
|
53
68
|
/** A new empty column after column `c`. */
|
|
54
69
|
export declare function insertColumn(props: TableProps, c: number): TableProps;
|
|
55
70
|
/** Drop column `c`; a no-op at one column (a table has at least one). */
|
|
56
71
|
export declare function deleteColumn(props: TableProps, c: number): TableProps;
|
|
57
|
-
/**
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
|
|
72
|
+
/**
|
|
73
|
+
* Row `r` moved by `by` places, clamped: a drag past the rectangle is a no-op, not an error. The
|
|
74
|
+
* header travels like any other row; being the header is holding index 0.
|
|
75
|
+
*/
|
|
61
76
|
export declare function moveRow(props: TableProps, r: number, by: number): TableProps;
|
|
62
|
-
/**
|
|
63
|
-
*
|
|
64
|
-
*
|
|
77
|
+
/**
|
|
78
|
+
* Column `c` moved by `by` places, clamped. `aligns` and `widths` travel with the column, being its
|
|
79
|
+
* properties.
|
|
80
|
+
*/
|
|
65
81
|
export declare function moveColumn(props: TableProps, c: number, by: number): TableProps;
|
|
66
82
|
/**
|
|
67
|
-
* Every cell in the inclusive rectangle emptied, alignment kept
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
* reaches here is a proper sub-rectangle and the shape it leaves is the shape it found.
|
|
71
|
-
*
|
|
72
|
-
* A cell keeps its own alignment, and a column its alignment and width: what a clear
|
|
73
|
-
* empties is text.
|
|
83
|
+
* Every cell in the inclusive rectangle emptied, alignment kept (a cell its own, a column its
|
|
84
|
+
* alignment and width): a delete over a block covering no whole rank. A rectangle spanning one axis
|
|
85
|
+
* deletes ranks and one spanning both is the table, so what reaches here is a proper sub-rectangle.
|
|
74
86
|
*/
|
|
75
87
|
export declare function clearCells(props: TableProps, r0: number, c0: number, r1: number, c1: number): TableProps;
|
|
76
|
-
/**
|
|
77
|
-
*
|
|
88
|
+
/**
|
|
89
|
+
* Set column `c`'s alignment and clear its cells' own `align`, which would outrank it
|
|
90
|
+
* (`table-view.ts`).
|
|
91
|
+
*/
|
|
78
92
|
export declare function setAlign(props: TableProps, c: number, align: TableAlign): TableProps;
|
|
79
|
-
/** Draw the
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
93
|
+
/** Draw the top `head` rows as header rows (`table-view.ts`). */
|
|
94
|
+
export declare function setHead(props: TableProps, head: number): TableProps;
|
|
95
|
+
/** An inclusive block of cells, in the row space {@link rowCount} names. */
|
|
96
|
+
export interface CellBlock {
|
|
97
|
+
r0: number;
|
|
98
|
+
c0: number;
|
|
99
|
+
r1: number;
|
|
100
|
+
c1: number;
|
|
101
|
+
}
|
|
102
|
+
/** `block` grown until every drawn cell it touches lies wholly inside it. */
|
|
103
|
+
export declare function closeBlock(props: TableProps, block: CellBlock): CellBlock;
|
|
104
|
+
/**
|
|
105
|
+
* Whether `block` can be one cell: more than one drawn cell, inside the header rows or the body.
|
|
106
|
+
*/
|
|
107
|
+
export declare function canMerge(props: TableProps, block: CellBlock): boolean;
|
|
108
|
+
/**
|
|
109
|
+
* The block's cells as one, at its top-left: the text of each drawn cell holding any, in reading
|
|
110
|
+
* order, a line apiece, every other slot an empty one the span covers, alignment kept. The top-left
|
|
111
|
+
* cell's alignment is the merged cell's. A block {@link canMerge} refuses comes back as it was.
|
|
112
|
+
*/
|
|
113
|
+
export declare function mergeCells(props: TableProps, block: CellBlock): TableProps;
|
|
114
|
+
/**
|
|
115
|
+
* The merged cell covering `(r, c)` back to the cells under it: its text stays top-left, the rest
|
|
116
|
+
* are the empty cells it covered.
|
|
117
|
+
*/
|
|
118
|
+
export declare function splitCell(props: TableProps, r: number, c: number): TableProps;
|
|
119
|
+
/**
|
|
120
|
+
* Set or clear the column weights (`table-view.ts`); `undefined` returns every column to auto-fit.
|
|
121
|
+
*/
|
|
84
122
|
export declare function setWidths(props: TableProps, widths: (number | null)[] | undefined): TableProps;
|
|
85
123
|
/**
|
|
86
|
-
* Each column's share of the table's width, summing to 1, or `undefined` for a table
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
* the weights hold, cannot ask.
|
|
124
|
+
* Each column's share of the table's width, summing to 1, or `undefined` for a table that auto-fits
|
|
125
|
+
* throughout. An auto-fit column beside weighted ones takes the mean weight, since the editor's
|
|
126
|
+
* fixed-layout grid cannot size it to content as the page does.
|
|
90
127
|
*/
|
|
91
128
|
export declare function columnShares(props: TableProps): number[] | undefined;
|
|
92
129
|
/**
|
|
93
|
-
* A cell as a one-paragraph `Content
|
|
94
|
-
*
|
|
95
|
-
* the one USV `pmToContent` projects a break back to. The cell's marks are that
|
|
96
|
-
* content's marks, both being offsets into the same text.
|
|
130
|
+
* A cell as a one-paragraph `Content` for `decode` under `cellSchema`: each `\n` opens a
|
|
131
|
+
* `continues` line, the hard break it decodes to. The cell's marks are that content's marks.
|
|
97
132
|
*/
|
|
98
133
|
export declare function cellContent(cell: TableCell): Content;
|
|
99
134
|
/**
|
|
100
135
|
* The cell a nested PM doc projects, carrying `prior`'s identity anchors through.
|
|
101
136
|
*
|
|
102
|
-
* Anchors inside a cell are
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
* anchor through the cell's own delta by the rule the store applies to a field's,
|
|
108
|
-
* and a mark the splice deleted through lands where the splice left it rather than
|
|
109
|
-
* pointing past the text.
|
|
137
|
+
* Anchors inside a cell are preserved verbatim, never minted: they are not in the field plugin's
|
|
138
|
+
* coordinate space (its position map holds one `atom` run for the whole table), so the popover
|
|
139
|
+
* withholds its `anchor` button in a cell. Preserving still means rebasing: `mapMarks` carries each
|
|
140
|
+
* held anchor through the cell's delta by the store's rule, and a mark the splice deleted through
|
|
141
|
+
* lands where the splice left it.
|
|
110
142
|
*/
|
|
111
143
|
export declare function cellFromDoc(doc: PMNode, prior: TableCell): TableCell;
|
|
112
|
-
/**
|
|
113
|
-
*
|
|
114
|
-
*
|
|
144
|
+
/**
|
|
145
|
+
* Whether two cells are the same value, telling an own edit from an external one (an undo, a
|
|
146
|
+
* re-hydrate) without a flag. Marks compare structurally, as `reconcile.ts` states.
|
|
147
|
+
*/
|
|
115
148
|
export declare function cellEqual(a: TableCell, b: TableCell): boolean;
|
|
116
149
|
/** Whether two tables have the same rectangle, alignment, header and widths: the
|
|
117
150
|
* change that forces a rebuild rather than a per-cell reseed. */
|