pagedjs merge requestshttps://gitlab.coko.foundation/pagedjs/pagedjs/-/merge_requests2023-07-03T17:07:00Zhttps://gitlab.coko.foundation/pagedjs/pagedjs/-/merge_requests/191Draft: Clear columns2023-07-03T17:07:00ZFred ChasenDraft: Clear columns- Add `onLayout(wrapper, breakToken, layout)` hook.
- Remove the columns after laying out the page and removing overflow.- Add `onLayout(wrapper, breakToken, layout)` hook.
- Remove the columns after laying out the page and removing overflow.https://gitlab.coko.foundation/pagedjs/pagedjs/-/merge_requests/150Display: Flex Prototype2022-12-19T19:21:16ZBoris Budiniboris@cloud68.coDisplay: Flex PrototypeCreating a merge request just to showcase the ideas + prototype. So you'll see stretches of comments I've left myself as I tried to familiarize myself with the library, commented out code, things of that nature.
Visual step by step of i...Creating a merge request just to showcase the ideas + prototype. So you'll see stretches of comments I've left myself as I tried to familiarize myself with the library, commented out code, things of that nature.
Visual step by step of ideal algorithm with these changes - [Public_for_Paged_-_Step_by_step__2_.pdf](/uploads/8b2736b2161e17c7179bf9c37af09377/Public_for_Paged_-_Step_by_step__2_.pdf)
*To summarize:* Enhancing breakTokens to understand 'why' overflow occurred, and use that information in rebuildAncestors(), as well as refactoring to work with an array of breaktokens as opposed to just one.
**Modifications showcased**
* When searching for overflow, we additionally track flex boundaries. When flex begins, and each of its flex columns
* Then, when overflow is located, that information is tacked on too (to the breakToken). We also continue searching for more overflows, adding to a list
* During this, when we hit ‘leaf nodes,’ we mark them as done rendering on the source DOM
* When build a page, we have multiple overflows and thus, multiple breakTokens. RebuildAncestors() should rebuild differently based on “why” the overflow occurred
* If it’s because of flex, then we also must rebuild the flexSiblings, and the flexSiblings ancestors
* RenderTo() starts at the first breakToken, but we must 1) not reappend elements already present on the page and 2) not append elements that are ‘done’ on previous pages.
**Issues known and Ideas**
* Very flex focused, but similar idea can be leveraged for table. E.g. detect that a table has begun, and track elements that would need to be rebuilt (tr th, previous tds) in the breakToken for rebuildAncestors()
* Only works for simple example, and 'context' can nest (table in flex, flex in flex, etc). An idea I had for that was tracking nesting contexts in the breakToken as a queue. Then when it comes to rebuilding ancestors, you would start at the top/first, rebuild what’s necessary for that context, and then dequeue, continuing until all contexts have been dealt with
* renderTo() walks the original DOM, even if there’s content way off the page. Could we also check the wrapper here, and try to intelligently stop?https://gitlab.coko.foundation/pagedjs/pagedjs/-/merge_requests/137resolves #245 ignore impractical break-inside: avoid rules2022-03-30T19:44:50ZBoris Budiniboris@cloud68.coresolves #245 ignore impractical break-inside: avoid rulesThe logic is implemented in the chunker.
The idea is to:
- create a *temporary* page,
- add the remaining content,
- check if the content contains an element with the rule `break-inside: avoid`
- check if this element will overflow
If t...The logic is implemented in the chunker.
The idea is to:
- create a *temporary* page,
- add the remaining content,
- check if the content contains an element with the rule `break-inside: avoid`
- check if this element will overflow
If that's the case, then we remove the rule `break-inside: avoid` and ask Paged.js to "reflow" the previous/current page.
In all cases, we remove the temporary page.
resolves #245https://gitlab.coko.foundation/pagedjs/pagedjs/-/merge_requests/133WIP: Adjust the preBreakToken if there are elements already rendered2022-03-30T19:45:02ZBoris Budiniboris@cloud68.coWIP: Adjust the preBreakToken if there are elements already renderedhttps://gitlab.coko.foundation/pagedjs/pagedjs/-/merge_requests/117Allow renderNode hooks to be async2022-03-30T19:45:17ZBoris Budiniboris@cloud68.coAllow renderNode hooks to be asyncThis allows the `renderNode` hook to be async. Tests have been added for the `renderNode` hook for both sync and async style of calls.This allows the `renderNode` hook to be async. Tests have been added for the `renderNode` hook for both sync and async style of calls.