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

Apply Settings to export #51

Merged
merged 4 commits into from
Aug 28, 2024
Merged

Apply Settings to export #51

merged 4 commits into from
Aug 28, 2024

Conversation

zkharit
Copy link
Contributor

@zkharit zkharit commented Aug 27, 2024

Add support for adding css to the export iframe

@zkharit zkharit requested a review from andrewkmin August 27, 2024 22:56
Copy link
Contributor

@andrewkmin andrewkmin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

non blocking comments. looks good overall 🚀🚀🚀

let's run prettier here npm run prettier:write

const validStyles = {};

const cssValidationRegex = {
padding: "^(\\d+(px|em|%|rem) ?){1,4}$",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might make sense to put these valid, modifiable css properties in a doc somewhere

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea, can add something to the UI customization page

);
}

// Validate, sanitize, and apply the styles to the "key-div" textarea.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The key-div element is just a simple div, which later gets its innerText set

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed this

@@ -709,6 +836,11 @@ <h2>Message log</h2>
document.addEventListener(
"DOMContentLoaded",
async () => {
// If styles are saved in local storage, sanitize and apply them.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may have already done this, and nothing indicates the contrary, but would be nice to do a sanity check to make sure these loaded settings can be overridden if the user calls applySettings again

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this works as exepected!

@zkharit zkharit merged commit d298782 into main Aug 28, 2024
6 checks passed
@zkharit zkharit deleted the zane/apply-settings-export branch August 28, 2024 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants