@shadow-garden/bapbong-model 0.15.0 → 0.16.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/dist/index.cjs +22 -1
- package/dist/index.js +22 -1
- package/dist/lib/model.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -407,7 +407,8 @@ function pastedImageAttrs(el) {
|
|
|
407
407
|
width: dim(e.getAttribute("width")),
|
|
408
408
|
height: dim(e.getAttribute("height")),
|
|
409
409
|
crop: dataJson(el, "data-crop"),
|
|
410
|
-
outline: dataJson(el, "data-outline")
|
|
410
|
+
outline: dataJson(el, "data-outline"),
|
|
411
|
+
effectExtent: dataJson(el, "data-effect-extent")
|
|
411
412
|
};
|
|
412
413
|
}
|
|
413
414
|
function pastedLinkAttrs(el) {
|
|
@@ -465,6 +466,14 @@ var schema = new import_prosemirror_model.Schema({
|
|
|
465
466
|
// switching styles is one small attr transaction. Importer-set;
|
|
466
467
|
// extended when the editor applies a style the sheet lacks.
|
|
467
468
|
tableStyles: { default: null },
|
|
469
|
+
// { spacing?: ParagraphSpacing } | null — the document's default
|
|
470
|
+
// paragraph properties (w:docDefaults/w:pPrDefault), the FLOOR of
|
|
471
|
+
// every paragraph's cascade. Live data like the sheet: a paragraph's
|
|
472
|
+
// `spacing` attr carries only what sits ABOVE the table-style slot
|
|
473
|
+
// (its style, numbering, direct formatting), and the layout stacks
|
|
474
|
+
// floor → table-style cell layer → attr. Importer-set; null for an
|
|
475
|
+
// editor-authored doc (whose paragraphs then carry everything).
|
|
476
|
+
paragraphDefaults: { default: null },
|
|
468
477
|
// Per-section header/footer story OVERRIDES, keyed by section index →
|
|
469
478
|
// story ('headers'|'footers') → variant ('default'|'first'|'even') →
|
|
470
479
|
// the full story doc as JSON. The first chrome EDIT the model supports
|
|
@@ -504,6 +513,10 @@ var schema = new import_prosemirror_model.Schema({
|
|
|
504
513
|
// w:spacing — { before?, after?, line?, lineRule?, beforeAuto?,
|
|
505
514
|
// afterAuto? }, or null. The two *Auto flags record that Word computes
|
|
506
515
|
// the gap itself; before/after hold what it works out to here.
|
|
516
|
+
// Carries the cascade ABOVE the table-style slot only (paragraph
|
|
517
|
+
// style, numbering, direct): the document defaults live in
|
|
518
|
+
// doc.attrs.paragraphDefaults and a table style's pPr in the sheet,
|
|
519
|
+
// and the layout stacks floor → cell layer → this attr.
|
|
507
520
|
spacing: { default: null },
|
|
508
521
|
// w:bookmarkStart names anchored in this paragraph (["_Toc89595219"]),
|
|
509
522
|
// or null. Link hrefs of the form "#name" resolve against these —
|
|
@@ -693,6 +706,12 @@ var schema = new import_prosemirror_model.Schema({
|
|
|
693
706
|
crop: { default: null },
|
|
694
707
|
// a:ln on pic:spPr — Word's picture border, as a BorderSide, or null.
|
|
695
708
|
outline: { default: null },
|
|
709
|
+
// wp:effectExtent — { l, t, r, b } in EMU, verbatim from the file, or
|
|
710
|
+
// null. The room Word keeps around the extent for what paints
|
|
711
|
+
// outside it (a picture border sits centred on the edge). Word CLIPS
|
|
712
|
+
// an inline picture to extent + effectExtent, so this has to survive
|
|
713
|
+
// a save or a framed photo loses the outer half of its top edge.
|
|
714
|
+
effectExtent: { default: null },
|
|
696
715
|
// a:solidFill on pic:spPr — "#RRGGBB" painted behind the bitmap
|
|
697
716
|
// (shows through transparency), or null.
|
|
698
717
|
background: { default: null }
|
|
@@ -709,6 +728,8 @@ var schema = new import_prosemirror_model.Schema({
|
|
|
709
728
|
if (a["height"] != null) attrs["height"] = String(a["height"]);
|
|
710
729
|
if (a["crop"]) attrs["data-crop"] = JSON.stringify(a["crop"]);
|
|
711
730
|
if (a["outline"]) attrs["data-outline"] = JSON.stringify(a["outline"]);
|
|
731
|
+
if (a["effectExtent"])
|
|
732
|
+
attrs["data-effect-extent"] = JSON.stringify(a["effectExtent"]);
|
|
712
733
|
if (a["background"])
|
|
713
734
|
attrs["data-background"] = a["background"];
|
|
714
735
|
return ["img", attrs];
|
package/dist/index.js
CHANGED
|
@@ -375,7 +375,8 @@ function pastedImageAttrs(el) {
|
|
|
375
375
|
width: dim(e.getAttribute("width")),
|
|
376
376
|
height: dim(e.getAttribute("height")),
|
|
377
377
|
crop: dataJson(el, "data-crop"),
|
|
378
|
-
outline: dataJson(el, "data-outline")
|
|
378
|
+
outline: dataJson(el, "data-outline"),
|
|
379
|
+
effectExtent: dataJson(el, "data-effect-extent")
|
|
379
380
|
};
|
|
380
381
|
}
|
|
381
382
|
function pastedLinkAttrs(el) {
|
|
@@ -433,6 +434,14 @@ var schema = new Schema({
|
|
|
433
434
|
// switching styles is one small attr transaction. Importer-set;
|
|
434
435
|
// extended when the editor applies a style the sheet lacks.
|
|
435
436
|
tableStyles: { default: null },
|
|
437
|
+
// { spacing?: ParagraphSpacing } | null — the document's default
|
|
438
|
+
// paragraph properties (w:docDefaults/w:pPrDefault), the FLOOR of
|
|
439
|
+
// every paragraph's cascade. Live data like the sheet: a paragraph's
|
|
440
|
+
// `spacing` attr carries only what sits ABOVE the table-style slot
|
|
441
|
+
// (its style, numbering, direct formatting), and the layout stacks
|
|
442
|
+
// floor → table-style cell layer → attr. Importer-set; null for an
|
|
443
|
+
// editor-authored doc (whose paragraphs then carry everything).
|
|
444
|
+
paragraphDefaults: { default: null },
|
|
436
445
|
// Per-section header/footer story OVERRIDES, keyed by section index →
|
|
437
446
|
// story ('headers'|'footers') → variant ('default'|'first'|'even') →
|
|
438
447
|
// the full story doc as JSON. The first chrome EDIT the model supports
|
|
@@ -472,6 +481,10 @@ var schema = new Schema({
|
|
|
472
481
|
// w:spacing — { before?, after?, line?, lineRule?, beforeAuto?,
|
|
473
482
|
// afterAuto? }, or null. The two *Auto flags record that Word computes
|
|
474
483
|
// the gap itself; before/after hold what it works out to here.
|
|
484
|
+
// Carries the cascade ABOVE the table-style slot only (paragraph
|
|
485
|
+
// style, numbering, direct): the document defaults live in
|
|
486
|
+
// doc.attrs.paragraphDefaults and a table style's pPr in the sheet,
|
|
487
|
+
// and the layout stacks floor → cell layer → this attr.
|
|
475
488
|
spacing: { default: null },
|
|
476
489
|
// w:bookmarkStart names anchored in this paragraph (["_Toc89595219"]),
|
|
477
490
|
// or null. Link hrefs of the form "#name" resolve against these —
|
|
@@ -661,6 +674,12 @@ var schema = new Schema({
|
|
|
661
674
|
crop: { default: null },
|
|
662
675
|
// a:ln on pic:spPr — Word's picture border, as a BorderSide, or null.
|
|
663
676
|
outline: { default: null },
|
|
677
|
+
// wp:effectExtent — { l, t, r, b } in EMU, verbatim from the file, or
|
|
678
|
+
// null. The room Word keeps around the extent for what paints
|
|
679
|
+
// outside it (a picture border sits centred on the edge). Word CLIPS
|
|
680
|
+
// an inline picture to extent + effectExtent, so this has to survive
|
|
681
|
+
// a save or a framed photo loses the outer half of its top edge.
|
|
682
|
+
effectExtent: { default: null },
|
|
664
683
|
// a:solidFill on pic:spPr — "#RRGGBB" painted behind the bitmap
|
|
665
684
|
// (shows through transparency), or null.
|
|
666
685
|
background: { default: null }
|
|
@@ -677,6 +696,8 @@ var schema = new Schema({
|
|
|
677
696
|
if (a["height"] != null) attrs["height"] = String(a["height"]);
|
|
678
697
|
if (a["crop"]) attrs["data-crop"] = JSON.stringify(a["crop"]);
|
|
679
698
|
if (a["outline"]) attrs["data-outline"] = JSON.stringify(a["outline"]);
|
|
699
|
+
if (a["effectExtent"])
|
|
700
|
+
attrs["data-effect-extent"] = JSON.stringify(a["effectExtent"]);
|
|
680
701
|
if (a["background"])
|
|
681
702
|
attrs["data-background"] = a["background"];
|
|
682
703
|
return ["img", attrs];
|
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;
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/lib/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MA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;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shadow-garden/bapbong-model",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "bapbong — ProseMirror document model / schema",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -55,6 +55,6 @@
|
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"prosemirror-model": "^1.25.7",
|
|
58
|
-
"@shadow-garden/bapbong-contracts": "^0.
|
|
58
|
+
"@shadow-garden/bapbong-contracts": "^0.17.0"
|
|
59
59
|
}
|
|
60
60
|
}
|