vobi_document 1.1.1 → 1.1.2
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/{chunk-ERKU5FDV.cjs → chunk-2VZW2MGO.cjs} +20 -2
- package/dist/chunk-2VZW2MGO.cjs.map +1 -0
- package/dist/{chunk-RO3Y2MSU.cjs → chunk-A427FKMP.cjs} +16 -16
- package/dist/{chunk-RO3Y2MSU.cjs.map → chunk-A427FKMP.cjs.map} +1 -1
- package/dist/{chunk-M6FQVH76.js → chunk-BEG6KN5X.js} +3 -3
- package/dist/{chunk-M6FQVH76.js.map → chunk-BEG6KN5X.js.map} +1 -1
- package/dist/{chunk-3FTKM37U.cjs → chunk-KALUNX3C.cjs} +14 -14
- package/dist/{chunk-3FTKM37U.cjs.map → chunk-KALUNX3C.cjs.map} +1 -1
- package/dist/{chunk-PLQNNXS2.js → chunk-QEWDIL2H.js} +20 -3
- package/dist/chunk-QEWDIL2H.js.map +1 -0
- package/dist/{chunk-JYSA6IM5.js → chunk-QRVQXVZC.js} +3 -3
- package/dist/{chunk-JYSA6IM5.js.map → chunk-QRVQXVZC.js.map} +1 -1
- package/dist/{chunk-W52ULJCW.js → chunk-QU6XF6OQ.js} +3 -3
- package/dist/{chunk-W52ULJCW.js.map → chunk-QU6XF6OQ.js.map} +1 -1
- package/dist/{chunk-26DSIOEY.cjs → chunk-SFKH6QYD.cjs} +8 -8
- package/dist/{chunk-26DSIOEY.cjs.map → chunk-SFKH6QYD.cjs.map} +1 -1
- package/dist/editor.cjs +14 -14
- package/dist/editor.js +2 -2
- package/dist/index.cjs +58 -58
- package/dist/index.js +5 -5
- package/dist/print.cjs +48 -16
- package/dist/print.cjs.map +1 -1
- package/dist/print.js +35 -3
- package/dist/print.js.map +1 -1
- package/dist/render.cjs +18 -18
- package/dist/render.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-ERKU5FDV.cjs.map +0 -1
- package/dist/chunk-PLQNNXS2.js.map +0 -1
package/dist/print.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { devWarn } from './chunk-ZOJBDFKU.js';
|
|
2
|
-
import { DG_MESSAGE_SOURCE, DG_READY, DG_ERROR, DocumentRenderer, CoverPage, HeaderBar, FooterBar } from './chunk-
|
|
3
|
-
export { DG_ERROR, DG_MESSAGE_SOURCE, DG_READY } from './chunk-
|
|
4
|
-
import { DEFAULT_PAGE_MARGINS, DEFAULT_DOCUMENT_COLORS, gfontHref } from './chunk-
|
|
2
|
+
import { DG_MESSAGE_SOURCE, DG_READY, DG_ERROR, DocumentRenderer, CoverPage, HeaderBar, FooterBar } from './chunk-BEG6KN5X.js';
|
|
3
|
+
export { DG_ERROR, DG_MESSAGE_SOURCE, DG_READY } from './chunk-BEG6KN5X.js';
|
|
4
|
+
import { DEFAULT_PAGE_MARGINS, DEFAULT_DOCUMENT_COLORS, pageWidthPx, pageHeightPx, gfontHref } from './chunk-QEWDIL2H.js';
|
|
5
5
|
import './chunk-CZB7F2LA.js';
|
|
6
6
|
import './chunk-SOIYSSU3.js';
|
|
7
7
|
import { createElement, Fragment } from 'react';
|
|
@@ -116,6 +116,8 @@ function buildPageCss(theme = {}, opts = {}) {
|
|
|
116
116
|
padding: 0;
|
|
117
117
|
}`);
|
|
118
118
|
parts.push(`${noCutBlocks.map((key) => `[data-docgen-block="${key}"]`).join(",\n")} { break-inside: avoid; }`);
|
|
119
|
+
const pageH = theme.page?.orientation === "landscape" ? pageWidthPx(format) : pageHeightPx(format);
|
|
120
|
+
parts.push(`:where([data-docgen-block]) img { max-height: ${pageH - top - bottom}px; object-fit: contain; }`);
|
|
119
121
|
parts.push(`[data-docgen-block="PageBreak"] { break-after: page; }
|
|
120
122
|
[data-docgen-block] { orphans: 2; widows: 2; }
|
|
121
123
|
.dg-no-break { break-inside: avoid; }
|
|
@@ -198,6 +200,35 @@ var REPEAT_TABLE_HEADERS = `(function () {
|
|
|
198
200
|
window.Paged.registerHandlers(RepeatingTableHeaders);
|
|
199
201
|
})();`;
|
|
200
202
|
|
|
203
|
+
// src/render/undisplayedFix.ts
|
|
204
|
+
var UNDISPLAYED_FIX = `(function () {
|
|
205
|
+
var handlers = window.Paged && window.Paged.registeredHandlers;
|
|
206
|
+
if (!handlers) return;
|
|
207
|
+
|
|
208
|
+
handlers.forEach(function (Handler) {
|
|
209
|
+
var proto = Handler && Handler.prototype;
|
|
210
|
+
if (!proto || typeof proto.filter !== 'function' || typeof proto.sortDisplayedSelectors !== 'function') return;
|
|
211
|
+
|
|
212
|
+
proto.filter = function (content) {
|
|
213
|
+
var sorted = this.sortDisplayedSelectors(content, this.displayRules);
|
|
214
|
+
var matches = sorted.matches;
|
|
215
|
+
var selectors = sorted.selectors;
|
|
216
|
+
|
|
217
|
+
for (var i = 0; i < matches.length; i++) {
|
|
218
|
+
var selector = selectors[i];
|
|
219
|
+
if (this.removable(matches[i]) && selector[selector.length - 1].value === 'none') {
|
|
220
|
+
matches[i].dataset.undisplayed = 'undisplayed';
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
var styled = content.querySelectorAll('[style]');
|
|
225
|
+
for (var j = 0; j < styled.length; j++) {
|
|
226
|
+
if (styled[j].style.display === 'none') styled[j].dataset.undisplayed = 'undisplayed';
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
});
|
|
230
|
+
})();`;
|
|
231
|
+
|
|
201
232
|
// src/render/previewBootstrap.ts
|
|
202
233
|
var ASSET_TIMEOUT_MS = 5e3;
|
|
203
234
|
var PREVIEW_BOOTSTRAP = `(function () {
|
|
@@ -323,6 +354,7 @@ function buildDocumentHtml(opts) {
|
|
|
323
354
|
"<style>body { margin: 0; background: #E8E9EB; } .pagedjs_page { box-shadow: 0 1px 4px rgba(15, 23, 42, 0.18); margin: 16px auto; }</style>",
|
|
324
355
|
"<script>window.PagedConfig = { auto: false };</script>",
|
|
325
356
|
`<script>${PAGEDJS_SOURCE}</script>`,
|
|
357
|
+
`<script>${UNDISPLAYED_FIX}</script>`,
|
|
326
358
|
`<script>${REPEAT_TABLE_HEADERS}</script>`,
|
|
327
359
|
`<script>${PREVIEW_BOOTSTRAP}</script>`,
|
|
328
360
|
"</head>",
|