@shadow-garden/bapbong-model 0.10.0 → 0.11.1
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/index.cjs +15 -1
- package/dist/index.js +15 -1
- package/dist/lib/model.d.ts +7 -1
- package/dist/lib/model.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -186,7 +186,9 @@ var schema = new import_prosemirror_model.Schema({
|
|
|
186
186
|
// w:tabs — [{ pos, val: 'left'|'right'|'center'|'decimal', leader? }]
|
|
187
187
|
// in px from the paragraph's content left edge, or null. Importer-set.
|
|
188
188
|
tabs: { default: null },
|
|
189
|
-
// w:spacing — { before?, after?, line?, lineRule
|
|
189
|
+
// w:spacing — { before?, after?, line?, lineRule?, beforeAuto?,
|
|
190
|
+
// afterAuto? }, or null. The two *Auto flags record that Word computes
|
|
191
|
+
// the gap itself; before/after hold what it works out to here.
|
|
190
192
|
spacing: { default: null },
|
|
191
193
|
// w:bookmarkStart names anchored in this paragraph (["_Toc89595219"]),
|
|
192
194
|
// or null. Link hrefs of the form "#name" resolve against these —
|
|
@@ -260,6 +262,18 @@ var schema = new import_prosemirror_model.Schema({
|
|
|
260
262
|
parseDOM: [{ tag: "br" }],
|
|
261
263
|
toDOM: () => ["br"]
|
|
262
264
|
},
|
|
265
|
+
// A column break (w:br w:type="column"). Inline, not a paragraph flag:
|
|
266
|
+
// ST_BrType `column` restarts "the next character in the document … in a
|
|
267
|
+
// new text column", so it cuts WHERE IT SITS. A factsheet in the corpus
|
|
268
|
+
// proves the difference — its break has a floating table anchored in the
|
|
269
|
+
// run BEFORE it, which belongs to the column being left behind.
|
|
270
|
+
column_break: {
|
|
271
|
+
inline: true,
|
|
272
|
+
group: "inline",
|
|
273
|
+
selectable: false,
|
|
274
|
+
parseDOM: [{ tag: "br.column-break" }],
|
|
275
|
+
toDOM: () => ["br", { class: "column-break" }]
|
|
276
|
+
},
|
|
263
277
|
// Inline image. `src` is typically a data URL (the importer inlines the
|
|
264
278
|
// embedded media); width/height are CSS pixels, null if unspecified.
|
|
265
279
|
image: {
|
package/dist/index.js
CHANGED
|
@@ -154,7 +154,9 @@ var schema = new Schema({
|
|
|
154
154
|
// w:tabs — [{ pos, val: 'left'|'right'|'center'|'decimal', leader? }]
|
|
155
155
|
// in px from the paragraph's content left edge, or null. Importer-set.
|
|
156
156
|
tabs: { default: null },
|
|
157
|
-
// w:spacing — { before?, after?, line?, lineRule
|
|
157
|
+
// w:spacing — { before?, after?, line?, lineRule?, beforeAuto?,
|
|
158
|
+
// afterAuto? }, or null. The two *Auto flags record that Word computes
|
|
159
|
+
// the gap itself; before/after hold what it works out to here.
|
|
158
160
|
spacing: { default: null },
|
|
159
161
|
// w:bookmarkStart names anchored in this paragraph (["_Toc89595219"]),
|
|
160
162
|
// or null. Link hrefs of the form "#name" resolve against these —
|
|
@@ -228,6 +230,18 @@ var schema = new Schema({
|
|
|
228
230
|
parseDOM: [{ tag: "br" }],
|
|
229
231
|
toDOM: () => ["br"]
|
|
230
232
|
},
|
|
233
|
+
// A column break (w:br w:type="column"). Inline, not a paragraph flag:
|
|
234
|
+
// ST_BrType `column` restarts "the next character in the document … in a
|
|
235
|
+
// new text column", so it cuts WHERE IT SITS. A factsheet in the corpus
|
|
236
|
+
// proves the difference — its break has a floating table anchored in the
|
|
237
|
+
// run BEFORE it, which belongs to the column being left behind.
|
|
238
|
+
column_break: {
|
|
239
|
+
inline: true,
|
|
240
|
+
group: "inline",
|
|
241
|
+
selectable: false,
|
|
242
|
+
parseDOM: [{ tag: "br.column-break" }],
|
|
243
|
+
toDOM: () => ["br", { class: "column-break" }]
|
|
244
|
+
},
|
|
231
245
|
// Inline image. `src` is typically a data URL (the importer inlines the
|
|
232
246
|
// embedded media); width/height are CSS pixels, null if unspecified.
|
|
233
247
|
image: {
|
package/dist/lib/model.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { Schema } from 'prosemirror-model';
|
|
|
8
8
|
* extend THIS schema so the importer, layout engine, and (canvas) painter all
|
|
9
9
|
* agree on one document model.
|
|
10
10
|
*/
|
|
11
|
-
export declare const schema: Schema<"paragraph" | "doc" | "text" | "hard_break" | "image" | "page_field" | "table" | "table_row" | "table_cell", "strong" | "em" | "underline" | "strike" | "dstrike" | "smallCaps" | "textColor" | "fontSize" | "vertAlign" | "letterSpacing" | "kern" | "charScale" | "position" | "highlight" | "fontFamily" | "link" | "footnote" | "carryRPr">;
|
|
11
|
+
export declare const schema: Schema<"paragraph" | "doc" | "text" | "hard_break" | "column_break" | "image" | "page_field" | "table" | "table_row" | "table_cell", "strong" | "em" | "underline" | "strike" | "dstrike" | "smallCaps" | "textColor" | "fontSize" | "vertAlign" | "letterSpacing" | "kern" | "charScale" | "position" | "highlight" | "fontFamily" | "link" | "footnote" | "carryRPr">;
|
|
12
12
|
/** Concrete schema type, handy for typing Node/Mark across packages. */
|
|
13
13
|
export type BapbongSchema = typeof schema;
|
|
14
14
|
/**
|
|
@@ -35,6 +35,12 @@ export interface Spacing {
|
|
|
35
35
|
after?: number;
|
|
36
36
|
line?: number;
|
|
37
37
|
lineRule?: 'auto' | 'exact' | 'atLeast';
|
|
38
|
+
/** w:beforeAutospacing / w:afterAutospacing — "determine the spacing
|
|
39
|
+
* automatically, matching an HTML document". `before`/`after` then hold the
|
|
40
|
+
* amount the importer resolved for this paragraph's position (0 where Word
|
|
41
|
+
* suppresses it), and these flags are what the exporter writes back. */
|
|
42
|
+
beforeAuto?: boolean;
|
|
43
|
+
afterAuto?: boolean;
|
|
38
44
|
}
|
|
39
45
|
export interface ParagraphAttrs {
|
|
40
46
|
list: ListInfo | null;
|
package/dist/lib/model.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/lib/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAwF3C;;;;;;;;GAQG;AACH,eA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