







After building the Publisher, I looked again at where the EPUB editor sits. Vector graphics, multi-page layout, data-driven tables and web publishing documents were each working fine as independent editors. But what users make isn't four separate kinds of projects; it's a single book that holds images, tables, typesetting and published results together.
Making them openable from the EPUB editor's menu wasn't enough. It all had to connect in one flow: which book a piece of work started from, which element of the body the graphic being edited is linked to, where the result made in the layout should be sent back, and which workspace to return to after closing a publishing document. What was needed was designing the relationships between editors rather than the features of each editor.
So I didn't turn the EPUB editor into a huge program that performs every function itself. The specialized editors keep owning their own documents and render engines, while the EPUB editor passes along the context of the current book, opens the appropriate workspace, waits until the result is committed, and then integrates it back into the book. From that point, the EPUB editor went beyond being a body-text editor and became an orchestration layer that manages the whole production process.
The criterion for orchestration was simple. The central editor must not own every detailed feature, and the specialized editors must not know each other's internal structure. The center decides which job to hand to whom, passes along the context needed to start, and remembers where to receive the result when the job is done. A specialized editor edits only the documents it handles best and returns the agreed-upon result. This is a division of authority as well as a restriction on the direction of dependencies.
The vector editor becomes the authority on shape space and change over time. The layout editor manages page geometry and text flow. The table editor owns the cell structure and calculations, the multiple views and the render regions. The Publisher manages the reading order, screen layout, public state and the identity of the web document. Since the EPUB editor doesn't hold a duplicate of this state, each engine can evolve independently. There must be exactly one authoritative source.
Conversely, what a result means inside the book is decided by the EPUB editor. A graphic becomes a particular visual component of the body, and a table becomes a publishing visual linked to an editable source. A layout result goes into the book as a chapter or as fixed-layout content, and the Publisher finalizes the current book or graphic document as the web version readers read. This splits the authority of the working engines from the authority over the book's composition.
This separation mattered more than splitting features. Even if one editor's storage format changes, the others don't need to interpret its internals. The central editor only has to maintain the meaning and origin of the result, and when it must be edited again, send it back to the source workspace. Different document models don't get blended into one huge shared state, yet the user can work as if in a single program. It is a design that keeps relationships without merging state spaces.
Each specialized editor creates an independent project, but that project always belongs under the current book. Even if vector documents with the same title exist in several books, they don't get mixed up, and a single book can hold a cover graphic, body illustrations, a main layout, several tables and a publishing document at the same time. The EPUB project the user is looking at becomes the center of this work graph. The book is the root, and the specialized documents are child nodes beneath it.
When a new job starts, I pass along the current book's membership, the kind of document to create, a default title and, when needed, the relationship to the body element being edited. When an existing job is reopened, the source document belonging to the same book is found precisely and restored. Because I separated the entry for new documents from the entry for existing ones, I could prevent cases where making a new table shows the last table I had opened, or where a new publishing document overwrites a previously public one. Creation and restoration are different morphisms.
I also made the parent book's fonts and shared assets available inside the specialized editors. Without registering the same typeface again in each editor, vector text, layout body text, table images and the EPUB body keep the same typography. Each editor manages assets in the way it needs, but they never reach beyond the book's scope to pull in another project's files. Sharing is allowed; references across the boundary are forbidden.
The EPUB editor's source screen uses this relationship to show graphics, layouts, tables and publishing documents separately. When you close a specialized document and come back, the list is re-read and the result you just made shows up immediately. Users don't go find the output in a file explorer and import it again; they pick a working source linked inside the book and continue editing right away.
Which editor to open means more than switching screens. Depending on whether the currently selected element is an ordinary image, an editable vector component or a result linked to a table source, the same activation has to lead to a different workspace. The EPUB editor reads the origin and link state left on the body element and picks the appropriate source editor. A selection event is mapped to different paths depending on type.
When creating a new graphic, the image selected in the body and its display area can serve as the initial context for the job. When opening an existing graphic, the already linked source is restored, and the position and size placed in the current EPUB remain as book-side state. Fixing the inside of a graphic doesn't reset the paragraph flow or outer placement decided in the body. Internal state and placement state are different layers.
Layout and tables follow the same principle. A layout can absorb the current book's content and typeset it into pages, or start as a completely new fixed-layout document. A table either creates a new data document or reopens an existing source linked to a body image. Since the purpose of the job is fixed at entry, there was no need to guess which document to use inside the specialized editor.
The shared AI tool follows this context as well. When editing the EPUB body, it understands the selected structure and style context, and when a vector workspace is open, it passes commands based on the current object and canvas state. In a table it uses the selected cell and active view, and in a layout the context of pages and text flow. A single input box determines the active workspace and connects to each editor's command system. This routing keeps context from leaking into the wrong command space.
I didn't use a method that stacks specialized editors on top of each other at the same time. Only one workspace is active at any moment, and when a switch is needed, the current editor's state is committed first before the next editor opens. That way there is no ambiguity about which editor the focus, selection state, popup layers, autosave and AI context refer to. It is mutual exclusion that limits the size of the active set to one.
A typical case is wanting to redraw an image from the layout as a vector. The user isn't aware of closing the layout and creating a separate file. The system remembers the relationship between the current page and the original image, switches to the vector workspace, and when editing ends, commits the result and reopens the same layout document. The new result keeps the existing frame's position and updates only the content and its ratio. The relationship is kept and only the payload changes.
The flow of making a table from an empty layout frame is the same. The table editor creates a source document with data and views, completes the publishing render, and then returns to the layout. An image result is placed in the layout, but the link to the table project behind it remains. If you later reopen the table and fix a cell, only the result in the same frame is replaced.
When moving from vector or layout to web publishing, I remembered the finished graphic package together with the location of the source workspace. After adjusting the design and reading order in the Publisher and closing it, you return to the vector or layout document you were working on. Since the central EPUB editor manages the movement paths between editors, the child editors don't need to know each other's screen structure. The paths live only in the central graph.
What I was most wary of when connecting the editors was having the same state managed authoritatively in several places at once. Just because a vector graphic has been put into an EPUB doesn't mean the EPUB side duplicates and edits the whole layer data. The book keeps the rendered component and the link to the source, and detailed edits are always performed by going back to the vector source. It's a reference, not a copy.
The same goes for tables. The EPUB contains the table image readers will see, but the source of rows and columns, calculations and views is managed by the table editor. A layout document provides per-page results and how they're used within the book, but the authority over masters and text flow stays with the layout editor. The Publisher likewise manages settings for the public screen and doesn't replace the authoring source of the EPUB body. Each node has exactly one source of truth.
Thanks to this principle, synchronization stopped being a problem of replicating all state in real time. Each editor commits its own source, and the center atomically replaces only the result and the link relationship. Half-finished states in the middle of an edit and unsaved intermediate values never come into the book, and the last completed result always has a source from which it can be regenerated. Only committed results cross the boundary.
When a source is updated, the link identifier is kept as well. Even if a graphic is re-rendered or a table image is replaced, the body element's position, responsive conditions and the surrounding document flow remain as they were. When a publishing document is rebuilt, only the content is updated while the document with its existing design settings and public address is kept. I separated the lifecycles of source and result while making sure the relationship between them never breaks.
I didn't flatten the results of every specialized editor into the same file format. Vector work can return as a graphic component that preserves structure and motion, and when a final image is needed, it comes in as a raster result with its resolution and background fixed. A table becomes an image that displays reliably in the EPUB while keeping the data editable. The result type differs by purpose.
Layout results differ depending on the page structure. When absorbed into the EPUB body, the document's structure and styles, images and fonts are tidied into a self-contained state and handed over, and when a fixed-layout result is needed, it is used as a graphic document that preserves the page geometry. Depending on which result arrives, the central editor registers the book's assets, tidies the paths and inserts it in a form that fits the body structure. These are per-type insertion rules.
In this process I preserved not just the visual look of the result but also its origin and re-editability. A graphic placed in the body keeps a record of which source project it came from, and a table image keeps its relationship to the source data document. When a result is deleted or duplicated, the lifecycle of the linked source and assets can be judged along with it.
When insertion is complete, I update the EPUB editor's various previews and document state so they all read the same result. After changing a single graphic, no per-device preview holds a different stale image, and the document representation being saved and the actual screen use the same asset path. At the last point where a specialized editor's result enters the book, EPUB's consistency rules are applied again. Every observable surface must converge on the same state.
I treated the moment of closing a workspace not as a UI event but as a transaction boundary. If the user is in the middle of typing into a cell or a title, the focus is cleaned up to commit the last value, and the system waits until all scheduled edits and autosaves have finished. For things like graphics or tables that need a render result to send back to the book, closing doesn't finish until that result is generated. Only committed state goes out across the boundary.
Even when a save is in progress, I didn't start a second save in parallel. Saves are serialized so that the latest changes are committed once more after the current save ends, and the workspace is removed only after the specialized editor reports it is done. This prevents cases where the screen closes first and cuts an asynchronous job short, or where the last typed character or the last object move is lost. Termination is a post-condition of completion.
The EPUB editor that receives the result doesn't just swap the screen right away either. It checks that all the necessary assets are registered, decides whether to replace the existing element or create a new one, and updates the various previews and saved documents together. Then it re-reads the work list to reflect the source project's latest title and modification time. Closing and returning behave as one committed state transition.
When a response is delayed or result generation fails, I put the current book's healthy state first. If the new result isn't complete, the existing element isn't deleted, and information about the interrupted transition is cleaned up so it isn't reused by the next job. Only successful jobs are reflected in the book, and failed ones keep the previous complete state. It is fail-closed behavior plus preservation of the previous complete state.
Just because the specialized editors are independent doesn't mean each has to rebuild every foundational feature. The current user and the book's membership, shared fonts, project assets, the AI entry point and returning to a workspace are all provided from the center by the EPUB editor. Child editors take only the services they need and focus on editing features. The shared layer is policy, and the specialized layer is computation.
In particular, the AI entry point stays central while execution is left to each editor's verified command layer. The parent checks which workspace is currently active and what is selected, and builds the context of the request. I structurally blocked cases where a command that handles vector objects enters the EPUB body editing path, or where a table cell command is applied to a layout page. A command's domain and range are bound to a workspace.
Fonts are also shared around the book's asset context. A typeface registered in the EPUB can be used with the same family and weight in graphics, layouts and tables, and when a specialized document adds its own font, the assets needed are bundled together when the result is sent to the book. This reduced the problem of text looking the same on the editing screen but switching to a fallback in the final output.
What I centralized this way isn't feature implementation but context and policy. The actual shape editing, typesetting, cell calculation and publishing render stay in their own engines. The shared layer provides the continuity of knowing you're editing the same book wherever you are, while the specialized layer keeps the depth of each field.
If specialized documents are linked to a book, then when moving the EPUB project to another computer, those sources have to move along with it. If only the finished EPUB body is exported, the table images still show but the cell data is gone, and vector graphics still show but their structure can't be edited again. The web publishing settings and the layout source run into the same problem. It's like keeping the result while losing the function that generated it.
So when making a project into a package for storage, I collected not only the EPUB's body and assets but also the vector, layout, table and Publisher documents belonging to the book. Each editor's document structure is preserved as it is, and images, fonts, structured source data and graphic packages are bundled separately according to their roles. I made sure the central package doesn't crush all the documents into one huge shared document. It serializes the graph while keeping each node's type.
When imported in another environment, existing identifiers aren't trusted as they are; they are reassigned as identifiers of the new storage. The images and fonts a document referenced, its pages and layers, asset references in table cells and the source-package link of a publishing document are all replaced with the new identifiers. If several documents share one asset, it is restored only once and they all point to the same new target. It's a relabeling that preserves the equivalence relation.
Even if some documents fail during restoration, cleanup is done per document so that already created incomplete assets don't linger as orphans. Conversely, files missing from the asset list but actually referenced by a document's content are scanned from the content and restored as well. Export and import became a process of rebuilding the referential integrity of the entire work graph, not a simple file copy.
With this structure complete, the role of the EPUB editor became clear. It isn't an all-purpose canvas that draws or typesets everything itself, but a central production environment that calls specialized editors based on the book's body and assets and converges the results back into a readable document. The editors are separate, but the project's flow is never interrupted.
I repeatedly reviewed new and existing graphics, new tables and linked tables, layouts that absorbed an EPUB and empty layouts, round trips from layout to vector and table, and the flow of moving from vector or layout to the Publisher and returning to the source. I confirmed that the last committed state is preserved even when closing during an autosave, when result generation fails, and during rapid workspace switching and reopening of existing documents.
I also checked exporting the whole project and restoring it on another device, down to vector structure, layout pages and masters, the table's source data and views, and publishing settings and source packages. The newly assigned asset relationships and the source links remaining in the body all matched, and the round trip of re-editing a restored specialized document and updating the EPUB result passed without problems.
The orchestration that connects the EPUB body, graphics, typesetting, data visualization and web publishing into a single project flow was fully implemented and stabilized. Opkle's EPUB editor is now not a tool for making one file but a production system that connects all the specialized work through which a book gets finished.
