Skip to content

Commit

Permalink
docs: improvement flux's
Browse files Browse the repository at this point in the history
  • Loading branch information
Novout committed Nov 11, 2022
1 parent 97f7a6c commit a1b705b
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 2 deletions.
Binary file added .github/absolutestore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/contextandproject.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/pngcanvas.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions docs/APPLICATION_FLOW.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,38 @@ The main application is in its own vue flow: after the packages are compiled, th

Below are listed some specific solutions for the application flow:

### Stores-Based

Each and every flow passes through the reactive stores. This dynamic allows the immediate response of actions (except the loading of projects) and the independence of a possible back-end.

```txt
├── src/store
├──── absolute.ts # Window's Controller
├──── addons.ts # Internal Tools
├──── auth.ts # Auth (Supabase)
├──── context.ts # Loaded Chapter
├──── docx.ts # DOCX Configuration
├──── editor.ts # Customization Settings
├──── externals.ts # External Tools
├──── global.ts # Global Controller
├──── history.ts # Redo-Undo AST Controller
├──── pdf.ts # PDF Configuration
├──── project.ts # Loaded Project
├──── tutorial.ts # Tutorial Settings
```

#### Context and Project

Always what is being mutable and is part of the main editor will be loaded in the Context while Project will only update in specific cases (for better performance in large amounts of rendered blocks).

![Context and Project](../.github/contextandproject.png)

#### Absolute

This store controls all interfaces that are not their own route and are attached to the edit route. So it is possible to load resources without having to destroy and reload the project at all costs.

![Absolute Store Flux](../.github/absolutestore.png)

### PWA instead of Electron

Better Write stopped using `Electron` (since v0.9.0-beta.6) for the `PWA` approach. Because of the proposal to have an application that is web, desktop and mobile, PWA can supply all three types of platforms with the same code.
Expand Down
10 changes: 9 additions & 1 deletion docs/GENERATOR_FLOW.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,17 @@ The flow of generators in the text part consists of converting them to a new lis
![Generator Flow Text](../.github/generatorastflow.png)

## Images

All images go through a conversion process, whether used in documents or for use in the editor. Certain image extensions that are not supported by some tools (.svg, for example) are converted to .png via an html canvas trick. The main purpose of this balcony is to treat the images as a single item.

> The drawing block type defaults to an svg-xml export, which is also converted to an image.
![PNG Canvas](../.github/pngcanvas.png)

## Other Types

Other types that are not directly related to text processing (images and drawings, for example), depend on how the extension handles that data and whether it is possible to convert the block into the document.
Custom types that are not traditionally text or images depend on whether the document type could handle the item or not.

> The TXT text generator fails to convert the vast majority of blocks, discarding all non-text entity types.
Expand Down
21 changes: 20 additions & 1 deletion docs/PROJECT_FLOW.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,23 @@ The extension consists of a main .zip file, and inside it a `data.json` which is

> The compressed save is discarded and the local object is loaded again to avoid unnecessary loading times and to facilitate script and derivative manipulations.
> It is possible to access `data.json` without much difficulty given the simplistic nature of the extension, where the documentation of the items can be found in the typing code itself, by [clicking here](https://github.com/Novout/betterwrite/blob/main/packages/better-write-types/src/types/project.ts) and [here](https://github.com/Novout/betterwrite/blob/main/packages/better-write-types/src/types/context.ts).
> It is possible to access `data.json` without much difficulty given the simplistic nature of the extension, where the documentation of the items can be found in the typing code itself, by [clicking here](https://github.com/Novout/betterwrite/blob/main/packages/better-write-types/src/types/project.ts) and [here](https://github.com/Novout/betterwrite/blob/main/packages/better-write-types/src/types/context.ts).
## Project Type

Initially, the editor had the audience perspective for professional writers only. However, we now want to reach other audiences, such as casual users. To circumvent this dynamic, the project has a predetermined type that defines which tools will be available to the user.

### Creative Type

- Chapter Layout
- External Notes
- Standard Tools

### Blank Type

- Side Graph Removed
- Standard Tools

> A blank project is a single chapter and treated as such by the application.
> Other project types are expected in the future as new features.

0 comments on commit a1b705b

Please sign in to comment.