Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Merge develop to main #268

Merged
merged 42 commits into from
Jun 11, 2024
Merged

chore: Merge develop to main #268

merged 42 commits into from
Jun 11, 2024

Conversation

maharshivpatel
Copy link
Collaborator

No description provided.

maharshivpatel and others added 30 commits April 8, 2024 17:20
Instead of computing layout and then checking for overlaps, we can check for overlaps while computing layout.
also, fixed bug in auto header / footer height calculation causing overlapping error.
added 1px on both sides ( top/bottom ) of the table element.
moved computeRowElementDimensions & computeColumnLayout function calls inside computeRowLayout.

this is cleaner code and will be better design to allow recursive layout parsing.
- Current Logic for dynamic containers is not recursive.
    It loops through the elements and compute possible rows then it loops again and compute possible columns.

- This was less efficient, less flexible, and not recursive.
    Impact will be more apparent when we have multi pages and 100s to Elements.

- Now, I have added recursive logic to handle nested dynamic containers.
    current implementation have 2 functions computeRowLayout and computeColumnLayout.
    this functions that call each other to create a recursive layout until it's not possible.
    first, we compute main layout where we split it into 3 sections ( header, body, footer).
    then we run these functions on each of these sections and save the layout.

    In theory, we can set dynamicHeight for any element as long as it's not overlapping.
if rectangle is only ( basically no element is overlapping with it) or last element inside row or column, row and column layout is computed for children.
- if rectangle is overlapping with other element and we make it relative placement of other element will be broken so for now it is set to compute layout as per above condition

created patch that will convert isDynamicHeight Boolean to heightType with value "fixed" or "auto".

updated default objects and  control in Properties Panel.

changed schema version number to 1.2.0 as schema is changed and is incompatible with old formats (1.1.0)  we need to handle old formats.

updated jinja render template
- modified relative_containers to be recursive
- updated all templates to use heightType properties
- updated logic to include min-height
- added logic for backwards compatibility.
- also introduced dynamic height for static text if it has parseJinja enabled.
- updated rectangle template to be dynamic height

misc:
    is_older_schema now handles really old formats which don't have schema_version
    reverted styles for relative column
added logic to run patches on output print_formats that are used by jinja when required
when patch was modified to also run on print_designer_print_formats field.
i accidentally messed up lines and spacing, this commit fixes it.
went unnoticed because the patch was already applied locally in the first run.
now that i am sorting elements by starting x and y position.
it messes up the overlapping designs that people are creating.
this will allow people to set the zIndex of the element.
instead of rendering template directly call the framework pdf_body_html function to render the html.
fixed html that was broken on modern browsers due to changes made by recursive containers PR.
well 0 is false in JS, so hurray.
updated logic to check for int field type and return the value 0 if present instead of going to parent properties
* fix: patch utils for old patches

As patch utils are used by all patches there isn't print_designer_print_format field when old patches are running and there is no need to try and update it.

* chore: fix typo in patch utils

* chore: added custom_field_patch in pre_model_sync

* chore: moved introduce_dynamic_containers to pre_model_sync
we need to remove specific comparison of elements array in the code as now we are planning to create multi page structure.
In recent change we added 3 types of height fixed, auto, auto (min-height) so we converted property to string from boolean.
check in dynamic text was for boolean so changed it to string comparison
Moved header / footer to separate doctype.
- added patch to convert all json to match new format with pages.
- updated jinja formats to loop over pages and render them.
- modified code to design multiple headers and footers.
- added option to add new pages.
- updated drag, resize, drop to work with multiple pages.
- updated marquee tool.
- added options to select headers / footers for first / last / odd /even pages
- Changed Canvas to render multiple pages.
- Header / footer now needs to designed separately.
element parent references causes circular import issue when we stringify with json.
maharshivpatel and others added 12 commits June 11, 2024 16:22
old schema had isDynamicHeight so if heightType is not available we can use isDynamicHeight
there are times when DOM Reference is not available, so we need to check if it exists before accessing it
previously, we set the property in element but it is better to just check it in realtime.
- fix: commented out debugging code
- fix: footer element positional values were incorrect
- fix: overlapping elements were causing layout breaks
- updated elementOverlapping code to only allow consider if element is directly overlapping (x,y axis) another element
- update print_designer_print_format to use the new object syntax
it still have some breaking issues so it's better to have a copy of the original format.
@maharshivpatel maharshivpatel merged commit fa05aaf into main Jun 11, 2024
2 checks passed
@maharshivpatel
Copy link
Collaborator Author

🎉 This PR is included in version 1.3.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant