Add save/load FrontEditor Pack (.fep files) #17
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This proposal adds the ability to save and load files with Fronteditor data in an encrypted (more secure) package to be distributed or kept.
This ensures that data is preserved even if the browser crashes or is deleted. It also facilitates the distribution of codes, for example among students of tutorials or online courses.
Usage
Click on the gear icon and choose "save or load Fepack", enter the password (required) and that's it.
When loading a file, there is also the option of replacing the data for the current path (url/path) or creating a new path from the loaded Fepack configuration. Each saved Fepack file records the current path in its settings. With that, you can open this file in any browser and continue using the same path as the original project.
Fepack file
In this initial version, the file is created as a JSON as described below:
Transformed into a string (JSON.stringify), it is encrypted with AES (256) and saved as a base64 string.
The ".fep" extension is used to indicate the type of [F]ront[E]ditor [P]ack file. The file name is exactly the pathname of the project added with the date and time and with the extension ".fep".
Examples:
Project/other
To Do
No significant changes were made to the design layer of the original project. In this version, I preferred to use native browser tools (alert, prompt, confirm), leaving it up to the person responsible for the project's design to add these necessary functions (modals, notifications, etc).
Attached I am sending a sample file (zipped by Github requirement) to be uploaded and serve as a test base for this feature. Data on code authorship and original repository can be found in the "MD" (markdown) tab.
Future:
Well, I think this addition will come in handy!
Enjoy, friends!
Samples
samples.zip
Comtent
Test the implementations working at this link: https://quickeditor.vercel.app
Upgrades in last commit