@pramen/cms 0.0.59 → 0.0.61
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 +62 -3
- package/dist/blockkit.d.ts +258 -0
- package/dist/blockkit.js +195 -0
- package/dist/index.d.ts +945 -4
- package/dist/index.js +1902 -75
- package/dist/nav.d.ts +30 -0
- package/dist/nav.js +37 -0
- package/package.json +2 -2
- package/src/blockkit.ts +316 -0
- package/src/index.ts +2024 -89
- package/src/nav.ts +38 -0
package/src/nav.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Where each built-in section sits in the CMS editor's primary nav.
|
|
2
|
+
//
|
|
3
|
+
// A LEAF module, like `href.ts`: both `index.ts` (for `CollectionDef.navOrder`) and
|
|
4
|
+
// `blockkit.ts` (for `AdminPageDef.navOrder`) need it, and importing it from `index.ts`
|
|
5
|
+
// would make `blockkit.ts` depend on a module that evaluates `Entity(...)` calls at module
|
|
6
|
+
// scope — a cycle, and one whose evaluation order would decide whether `NAV_ORDER` is
|
|
7
|
+
// defined when `adminPage()` reads it.
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Positions for the editor's built-in nav sections.
|
|
11
|
+
*
|
|
12
|
+
* Spaced 100 apart so anything can be placed BETWEEN two built-ins without renumbering
|
|
13
|
+
* them — `navOrder: 150` puts a section after Pages and before collections. The values
|
|
14
|
+
* themselves are ordinals with no other meaning; only their relative order is contract.
|
|
15
|
+
*
|
|
16
|
+
* Declared server-side, and not only in the editor, because the ordering key travels on
|
|
17
|
+
* `CollectionMeta` and `AdminPageMeta`: a host choosing a position has to be able to name
|
|
18
|
+
* what it is placing against, and it is writing `app.ts`, not editor code. The editor keeps
|
|
19
|
+
* a mirror — it is a standalone browser app that speaks to the CMS purely over HTTP, so it
|
|
20
|
+
* cannot import this.
|
|
21
|
+
*/
|
|
22
|
+
export const NAV_ORDER = {
|
|
23
|
+
pages: 100,
|
|
24
|
+
collections: 200,
|
|
25
|
+
media: 300,
|
|
26
|
+
menus: 400,
|
|
27
|
+
taxonomies: 500,
|
|
28
|
+
widgets: 600,
|
|
29
|
+
redirects: 700,
|
|
30
|
+
/** Custom admin pages (`adminPage()`), which are project surfaces, not CMS furniture. */
|
|
31
|
+
adminPages: 800,
|
|
32
|
+
/** Block/content-type authoring — schema, so it sits with the admin tools, not content. */
|
|
33
|
+
types: 900,
|
|
34
|
+
users: 1000,
|
|
35
|
+
settings: 1100,
|
|
36
|
+
/** Host-configured `extraNav` links, which are still last by default. */
|
|
37
|
+
extra: 1200,
|
|
38
|
+
} as const;
|