@uniweb/press 0.4.5 → 0.4.6
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/package.json +1 -1
- package/src/adapters/docx.js +3 -0
- package/src/ir/attributes.js +10 -0
package/package.json
CHANGED
package/src/adapters/docx.js
CHANGED
|
@@ -444,8 +444,11 @@ function irToParagraph(node) {
|
|
|
444
444
|
options.spacing = {}
|
|
445
445
|
const before = toInt(node.spacing.before)
|
|
446
446
|
const after = toInt(node.spacing.after)
|
|
447
|
+
const line = toInt(node.spacing.line)
|
|
447
448
|
if (before != null) options.spacing.before = before
|
|
448
449
|
if (after != null) options.spacing.after = after
|
|
450
|
+
if (line != null) options.spacing.line = line
|
|
451
|
+
if (node.spacing.lineRule) options.spacing.lineRule = node.spacing.lineRule
|
|
449
452
|
}
|
|
450
453
|
if (node.bullet) {
|
|
451
454
|
options.bullet = { level: toInt(node.bullet.level) ?? 0 }
|
package/src/ir/attributes.js
CHANGED
|
@@ -76,6 +76,8 @@ export const attributeMap = {
|
|
|
76
76
|
|
|
77
77
|
'data-spacing-before': { path: ['spacing', 'before'] },
|
|
78
78
|
'data-spacing-after': { path: ['spacing', 'after'] },
|
|
79
|
+
'data-spacing-line': { path: ['spacing', 'line'] },
|
|
80
|
+
'data-spacing-line-rule': { path: ['spacing', 'lineRule'] },
|
|
79
81
|
|
|
80
82
|
'data-transformation-width': { path: ['transformation', 'width'] },
|
|
81
83
|
'data-transformation-height': { path: ['transformation', 'height'] },
|
|
@@ -159,6 +161,14 @@ export const attributeMap = {
|
|
|
159
161
|
// emits `<w:rStyle>`.
|
|
160
162
|
'data-paragraph-style': { path: ['paragraphStyle'] },
|
|
161
163
|
|
|
164
|
+
// Paragraph bookmark target: when set, the docx adapter wraps the
|
|
165
|
+
// paragraph's inline children in a Word Bookmark with this id, so
|
|
166
|
+
// <Link href="..."> (InternalHyperlink) elsewhere in the document
|
|
167
|
+
// can jump here. The adapter already handles `node.bookmark` (see
|
|
168
|
+
// src/adapters/docx.js, irToParagraph); this entry is the missing
|
|
169
|
+
// IR attribute mapping that wires React-side props through to it.
|
|
170
|
+
'data-bookmark': { path: ['bookmark'] },
|
|
171
|
+
|
|
162
172
|
'data-tab-stops': {
|
|
163
173
|
path: ['tabStops'],
|
|
164
174
|
transform: (v) => {
|