Commit 8bb26a9a authored by julien's avatar julien
Browse files

bump to master

parents a1aa7e56 01ee33ee
Pipeline #530 failed with stage
in 32 seconds
......@@ -4,7 +4,7 @@ root = true
end_of_line = lf
insert_final_newline = true
[*.js]
[*.{js,html}]
charset = utf-8
indent_style = tab
indent_size = 2
......@@ -117,6 +117,7 @@ afterPreview(pages)
// Chunker
beforeParsed(content)
filter(content)
afterParsed(parsed)
beforePageLayout(page)
afterPageLayout(pageElement, page, breakToken)
......
This diff is collapsed.
{
"name": "pagedjs",
"version": "0.1.40",
"version": "0.1.41",
"description": "Chunks up a document into paged media flows and applies print styles",
"author": "Fred Chasen",
"license": "MIT",
......@@ -9,29 +9,30 @@
"module": "src/index.js",
"browser": "dist/paged.js",
"dependencies": {
"@babel/polyfill": "^7.8.7",
"@babel/runtime": "^7.9.2",
"@babel/polyfill": "^7.10.1",
"@babel/runtime": "^7.10.2",
"clear-cut": "^2.0.2",
"css-tree": "1.0.0-alpha.39",
"event-emitter": "^0.3.5"
},
"devDependencies": {
"@babel/cli": "^7.8.4",
"@babel/core": "^7.9.0",
"@babel/plugin-proposal-async-generator-functions": "^7.8.3",
"@babel/plugin-transform-runtime": "^7.9.0",
"@babel/preset-env": "^7.9.0",
"chalk": "^3.0.0",
"eslint": "^6.8.0",
"@babel/cli": "^7.10.1",
"@babel/core": "^7.10.2",
"@babel/plugin-proposal-async-generator-functions": "^7.10.1",
"@babel/plugin-transform-runtime": "^7.10.1",
"@babel/preset-env": "^7.10.2",
"chalk": "^4.0.0",
"eslint": "^7.1.0",
"express": "^4.17.1",
"ghostscript4js": "^3.2.1",
"jest": "^25.2.3",
"jest-image-snapshot": "^3.0.1",
"puppeteer": "^2.1.1",
"puppeteer": "^3.3.0",
"rimraf": "^3.0.2",
"rollup": "^2.2.0",
"rollup": "^2.13.1",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-livereload": "^1.1.0",
"rollup-plugin-livereload": "^1.3.0",
"rollup-plugin-node-builtins": "^2.1.2",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-serve": "^1.0.1"
......
......@@ -30,16 +30,6 @@ const plugins = [
];
export default [
{
input: pkg.module,
output: {
name: 'Paged',
file: pkg.browser,
format: 'umd'
},
plugins: plugins
},
{
input: "./src/polyfill/polyfill.js",
output: {
......
......@@ -8,7 +8,7 @@
Break before Avoid
</title>
<script src="../../../../../dist/paged.polyfill.js"></script>
<script src="../../../../dist/paged.polyfill.js"></script>
<style>
......
......@@ -8,7 +8,7 @@
Break before right
</title>
<script src="../../../../../dist/paged.polyfill.js"></script>
<script src="../../../../dist/paged.polyfill.js"></script>
<style>
:root {
......
......@@ -76,8 +76,7 @@
<section>
<p>Nam eros tellus, hendrerit ut rhoncus sed, aliquet et felis. Cras a ex malesuada, fringilla magna elementum, cursus purus. Etiam fringilla leo non diam congue tempor. Ut laoreet, est eget blandit congue, mauris magna cursus sapien, dictum tempus sapien diam et dolor. Vestibulum vel egestas velit. Pellentesque vel consectetur urna, eu consequat odio. Sed ac pretium magna, ut ultrices tortor.</p>
<p>Nam eros tellus, hendrerit ut rhoncus sed, aliquet et felis. Cras a ex malesuada, fringilla magna elementum, cursus purus. Etiam fringilla leo non diam congue tempor. Ut laoreet, est eget blandit congue, mauris magna cursus sapien, dictum tempus sapien diam et dolor. Vestibulum vel egestas velit. Pellentesque vel consectetur urna, eu consequat odio. Sed ac pretium magna, ut ultrices tortor.</p>
<h1>Cras ut augue condimentum, egestas nisi in, dictum erat. Nullam tincidunt tincidunt tempor. Sed in eleifend nibh, sit amet feugiat nisi. Cras at ante ut urna sagittis dictum ut nec elit. In feugiat euismod massa sagittis dictum. Nullam eu nisl eu elit laoreet tincidunt id sed ligula. Praesent vulputate faucibus nibh, ut ultrices nunc aliquam nec. Mauris et condimentum ligula. Vestibulum nec tortor quis urna dictum luctus. Cras quis suscipit metus. Ut dignissim ullamcorper aliquam. Donec condimentum eu tellus at interdum.</h1>
<p>Morbi a lacus eget augue sagittis euismod. Aliquam non leo quis dui bibendum viverra eu vel erat. Fusce iaculis vulputate leo, sit amet laoreet eros aliquam a. Sed id tellus at ligula porttitor pharetra. Morbi non fringilla augue. Cras sodales egestas mi, et porta orci ultricies sed. Sed et nulla a ligula aliquet accumsan non eleifend quam. Aliquam pellentesque, justo vel interdum accumsan, purus ipsum porttitor lectus, ac luctus risus lectus nec lectus. Cras ut augue condimentum, egestas nisi in, dictum erat. Nullam tincidunt tincidunt tempor. Sed in eleifend nibh, sit amet feugiat nisi. Cras at ante ut urna sagittis dictum ut nec elit. In feugiat euismod massa sagittis dictum. Nullam eu nisl eu elit laoreet tincidunt id sed ligula. Praesent vulputate faucibus nibh, ut ultrices nunc aliquam nec. Mauris et condimentum ligula. Vestibulum nec tortor quis urna dictum luctus. Cras quis suscipit metus. Ut dignissim ullamcorper aliquam. Donec condimentum eu tellus at interdum.</p>
<p>Pellentesque pulvinar, justo eget tincidunt semper, augue massa placerat enim, non tempus quam erat eu orci. Suspendisse auctor consectetur lectus, a mattis odio. Pellentesque id sem sit amet justo fringilla bibendum id sit amet quam. Vivamus ex est, ultrices non pharetra eu, facilisis nec quam. Etiam molestie sed orci sed suscipit. Donec ipsum est, venenatis ut nisl ut, viverra auctor diam. Cras vestibulum lacus vel nunc dapibus aliquam. Aliquam accumsan lorem rhoncus tortor rhoncus, ut euismod sapien ullamcorper. Vivamus et dictum lacus, eu pellentesque dolor. Suspendisse potenti. Mauris vitae volutpat odio. Duis vitae purus nec enim posuere efficitur at vitae nisl. Etiam enim nisl, rutrum in vestibulum nec, dapibus ut dui. Pellentesque imperdiet molestie ante quis feugiat. Sed nec felis congue, cursus ligula eget, bibendum est. Proin mattis, tortor non lobortis lobortis, nibh quam aliquam neque, sed tristique nibh ex aliquet felis. Phasellus non augue ac ante efficitur consectetur at at est. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nullam dui enim, iaculis et felis ac, porta ullamcorper justo. Suspendisse potenti.</p>
......
......@@ -37,6 +37,12 @@
font-size: 24px;
margin-top: 0;
}
.start {
counter-reset: page;
}
</style>
......@@ -48,7 +54,7 @@
<section>
<h1>Lorem ipsum dolor sit amet</h1>
<h1 class="start">Lorem ipsum dolor sit amet</h1>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi non suscipit odio. Aenean ut ligula id mauris efficitur tincidunt vitae non leo. In convallis convallis leo, eget molestie metus imperdiet eu. Praesent pharetra, leo a laoreet mattis, ligula nisl commodo ante, non vestibulum nisi lacus eget magna. Maecenas scelerisque nibh ac felis egestas, egestas elementum risus pellentesque. Nulla iaculis ut leo a iaculis. Donec vel sodales dolor, vel fringilla elit. Vivamus aliquam diam eu maximus elementum. Integer eu urna at felis fermentum hendrerit.
</p>
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Script elements should be ignored</title>
<style>
#cover {
display: flex;
flex-direction: column;
justify-content: center;
height: 100%;
break-after: page;
align-items: flex-end;
}
</style>
</head>
<body>
<div id="cover" class="title-page">
<h1>Title</h1>
</div>
<script id="pagedScript" src="../../../dist/paged.polyfill.js"></script>
</body>
</html>
const TIMEOUT = 10000; // Some book might take longer than this to renderer
describe("undisplayed", () => {
let page;
beforeAll(async () => {
page = await loadPage("filters/script-elements/script-elements.html");
return page.rendered;
}, TIMEOUT);
afterAll(async () => {
if (!DEBUG) {
await page.close();
}
});
it("script elements should not be appended in the layout", async () => {
let el = await page.$("#pagedScript");
expect(el).toBe(null);
});
});
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>display: none elements should be ignored</title>
<style>
/* interface */
@media screen {
body {
background: whitesmoke;
}
.pagedjs_page {
background: white;
margin-bottom: 10px;
box-shadow: 0 0 0 1px rgba(0, 0,0,0.2);
}
.pagedjs_pages {
width: calc(var(--pagedjs-width) * 2);
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: flex-start;
margin: 0 auto;
}
.pagedjs_first_page {
margin-left: 50%;
}
}
@page {
size: A5;
margin: 20mm 20mm;
@bottom-left{
content: counter(page);
}
@top-left {
content: element(chapter-title);
}
}
#cover {
display: flex;
flex-direction: column;
justify-content: center;
height: 100%;
break-after: page;
align-items: flex-end;
}
#displayNoneStyle {
display: flex;
}
div#displayNoneStyle {
display: none;
}
#content {
break-after: page;
}
</style>
</head>
<body>
<div id="cover" class="title-page">
<h1>Title</h1>
</div>
<div id="displayNoneInlineStyle" style="display: none;"></div>
<div id="content">Content</div>
<div id="displayNoneStyle"></div>
<script src="../../../dist/paged.polyfill.js"></script>
</body>
</html>
const TIMEOUT = 10000; // Some book might take longer than this to renderer
describe("undisplayed", () => {
let page;
beforeAll(async () => {
page = await loadPage("filters/undisplayed/undisplayed.html");
return page.rendered;
}, TIMEOUT);
afterAll(async () => {
if (!DEBUG) {
await page.close();
}
});
it("should not break display: none elements to new page", async () => {
let pages = await page.$$eval(".pagedjs_page", (r) => r.length);
expect(pages).toBe(2);
let el = await page.$("#displayNoneStyle");
expect(el).not.toBe(null);
});
});
<!DOCTYPE html PUBLIC>
<html lang="en" lang="en">
<head>
<style>
@page {
size: 2cm 2cm;
margin: 0px;
}
.big {
font-size: 150px;
margin: 0px;
}
@media screen {
.pagedjs_page {
box-shadow: 0 0 0 1px rgba(0, 0,0,0.2);
}
}
</style>
<script src="../../dist/paged.polyfill.js"></script>
</head>
<body>
<p class="big">Big</p>
</body>
</html>
const TIMEOUT = 10000; // Some book might take longer than this to renderer
describe("infinite-loop", () => {
let page;
beforeAll(async () => {
page = await loadPage("infinite-loop/infinite-loop.html");
return page.rendered;
}, TIMEOUT);
afterAll(async () => {
if (!DEBUG) {
await page.close();
}
});
it("should render 1 page", async () => {
let pages = await page.$$eval(".pagedjs_page", (r) => r.length);
expect(pages).toBe(1);
});
if (!DEBUG) {
it("should create a pdf", async () => {
let pdf = await page.pdf(PDF_SETTINGS);
expect(pdf).toMatchPDFSnapshot(1);
});
}
});
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment