@pramen/cms-editor 0.0.53 → 0.0.54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -84,10 +84,26 @@ admin: {
84
84
  brand: { name: "Acme", suffix: "cms" }, // the wordmark — see below
85
85
  // signInUrl: "/signin/", // ONLY once that page exists — see the warning
86
86
  // hidePages: true, // collections-only deployments
87
- // extraNav: [{ label: "Curation", href: "/curate" }],
87
+ // extraNav: [{ label: "Curation", href: "/curate", target: "_self" }],
88
88
  }
89
89
  ```
90
90
 
91
+ `extraNav` links open in a **new tab** by default, because the editor's catch-all route
92
+ matches every same-origin path — a same-tab click would land on the editor's own 404 instead
93
+ of your tool. Add `target: "_self"` to ask for a same-tab navigation; it is honoured only
94
+ where the router provably will not claim the url:
95
+
96
+ | Link | Editor mounted under a prefix | Editor at the origin root |
97
+ | --- | --- | --- |
98
+ | Another origin (`https://tools.acme.com/x`) | same tab | same tab |
99
+ | Same origin, outside the mount (`/curate`) | same tab | new tab |
100
+ | Same origin, inside the mount | new tab | new tab |
101
+
102
+ Anything else — a relative href that resolves back inside the mount, a `javascript:` url, an
103
+ unparseable one — degrades to a new tab rather than stranding the editor on its 404. A
104
+ same-tab link runs the unsaved-changes guard first, so it cannot silently discard an edit in
105
+ progress.
106
+
91
107
  > **`signInUrl` must be a page that exists.** An unauthenticated load calls it after
92
108
  > clearing the stored session, so a path that 404s into this SPA's own catch-all leaves the
93
109
  > editor bouncing between the redirect and itself with no session to recover from. Point it