@prenta/admin 1.10.0 → 1.10.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @actuate-media/cms-admin
2
2
 
3
+ ## 1.10.1
4
+
5
+ ### Patch Changes
6
+
7
+ - de9086f: Let a custom section type declare `addable: false` so it stays registered and editable on existing documents but is omitted from Add Section and rejected by `createSection` / POST add. MCP `list_section_types` and `add_page_section` now say that flag is schema-only.
8
+
3
9
  ## 1.10.0
4
10
 
5
11
  ### Minor Changes
@@ -1 +1 @@
1
- {"version":3,"file":"AddSectionModal.d.ts","sourceRoot":"","sources":["../../../src/views/page-editor/AddSectionModal.tsx"],"names":[],"mappings":"AAGA,OAAO,EAA2B,KAAK,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAGnG,UAAU,oBAAoB;IAC5B,IAAI,EAAE,OAAO,CAAA;IACb,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,KAAK,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAA;IACpC,6EAA6E;IAC7E,KAAK,CAAC,EAAE,YAAY,CAAA;CACrB;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,KAAc,EAAE,EAAE,oBAAoB,2CAgC7F"}
1
+ {"version":3,"file":"AddSectionModal.d.ts","sourceRoot":"","sources":["../../../src/views/page-editor/AddSectionModal.tsx"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,aAAa,EACnB,MAAM,oBAAoB,CAAA;AAG3B,UAAU,oBAAoB;IAC5B,IAAI,EAAE,OAAO,CAAA;IACb,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,KAAK,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAA;IACpC,6EAA6E;IAC7E,KAAK,CAAC,EAAE,YAAY,CAAA;CACrB;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,KAAc,EAAE,EAAE,oBAAoB,2CAgC7F"}
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { Modal } from '../../components/ui/Modal.js';
4
- import { getSectionTypesForScope } from './section-types.js';
4
+ import { getAddableSectionTypesForScope, } from './section-types.js';
5
5
  import { sectionIconFor } from './section-icons.js';
6
6
  /**
7
7
  * Predefined section gallery. Only types that have a working renderer +
@@ -13,7 +13,7 @@ import { sectionIconFor } from './section-icons.js';
13
13
  * model; see the page-editor changeset.)
14
14
  */
15
15
  export function AddSectionModal({ open, onClose, onAdd, scope = 'page' }) {
16
- const types = getSectionTypesForScope(scope);
16
+ const types = getAddableSectionTypesForScope(scope);
17
17
  return (_jsxs(Modal, { open: open, onClose: onClose, title: "Add a section", children: [_jsx("p", { className: "text-muted-foreground mb-4 text-sm", children: "Choose a section type. It will be added to the bottom and selected for editing." }), _jsx("div", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: types.map((type) => {
18
18
  const Icon = sectionIconFor(type.id);
19
19
  return (_jsxs("button", { type: "button", onClick: () => onAdd(type.id), className: "border-border hover:border-primary hover:bg-accent/50 focus-visible:ring-ring flex items-start gap-3 rounded-lg border p-3 text-left transition-colors focus-visible:ring-2 focus-visible:outline-none", children: [_jsx("span", { className: "bg-muted text-foreground flex h-9 w-9 shrink-0 items-center justify-center rounded-md", children: _jsx(Icon, { className: "h-5 w-5", "aria-hidden": true }) }), _jsxs("span", { className: "min-w-0", children: [_jsx("span", { className: "text-foreground block text-sm font-medium", children: type.name }), _jsx("span", { className: "text-muted-foreground mt-0.5 block text-xs leading-snug", children: type.description })] })] }, type.id));
@@ -1 +1 @@
1
- {"version":3,"file":"AddSectionModal.js","sourceRoot":"","sources":["../../../src/views/page-editor/AddSectionModal.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AACpD,OAAO,EAAE,uBAAuB,EAAyC,MAAM,oBAAoB,CAAA;AACnG,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAUnD;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG,MAAM,EAAwB;IAC5F,MAAM,KAAK,GAAG,uBAAuB,CAAC,KAAK,CAAC,CAAA;IAC5C,OAAO,CACL,MAAC,KAAK,IAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAC,eAAe,aACxD,YAAG,SAAS,EAAC,oCAAoC,gGAE7C,EACJ,cAAK,SAAS,EAAC,uCAAuC,YACnD,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;oBAClB,MAAM,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;oBACpC,OAAO,CACL,kBAEE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,EAC7B,SAAS,EAAC,wMAAwM,aAElN,eAAM,SAAS,EAAC,uFAAuF,YACrG,KAAC,IAAI,IAAC,SAAS,EAAC,SAAS,wBAAe,GACnC,EACP,gBAAM,SAAS,EAAC,SAAS,aACvB,eAAM,SAAS,EAAC,2CAA2C,YAAE,IAAI,CAAC,IAAI,GAAQ,EAC9E,eAAM,SAAS,EAAC,yDAAyD,YACtE,IAAI,CAAC,WAAW,GACZ,IACF,KAbF,IAAI,CAAC,EAAE,CAcL,CACV,CAAA;gBACH,CAAC,CAAC,GACE,IACA,CACT,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"AddSectionModal.js","sourceRoot":"","sources":["../../../src/views/page-editor/AddSectionModal.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AACpD,OAAO,EACL,8BAA8B,GAG/B,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAUnD;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG,MAAM,EAAwB;IAC5F,MAAM,KAAK,GAAG,8BAA8B,CAAC,KAAK,CAAC,CAAA;IACnD,OAAO,CACL,MAAC,KAAK,IAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAC,eAAe,aACxD,YAAG,SAAS,EAAC,oCAAoC,gGAE7C,EACJ,cAAK,SAAS,EAAC,uCAAuC,YACnD,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;oBAClB,MAAM,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;oBACpC,OAAO,CACL,kBAEE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,EAC7B,SAAS,EAAC,wMAAwM,aAElN,eAAM,SAAS,EAAC,uFAAuF,YACrG,KAAC,IAAI,IAAC,SAAS,EAAC,SAAS,wBAAe,GACnC,EACP,gBAAM,SAAS,EAAC,SAAS,aACvB,eAAM,SAAS,EAAC,2CAA2C,YAAE,IAAI,CAAC,IAAI,GAAQ,EAC9E,eAAM,SAAS,EAAC,yDAAyD,YACtE,IAAI,CAAC,WAAW,GACZ,IACF,KAbF,IAAI,CAAC,EAAE,CAcL,CACV,CAAA;gBACH,CAAC,CAAC,GACE,IACA,CACT,CAAA;AACH,CAAC"}
@@ -6,6 +6,6 @@
6
6
  * of truth. This module re-exports them to preserve the historical import
7
7
  * path (`../views/page-editor/section-types.js`) used across the editor.
8
8
  */
9
- export { SECTION_TYPES, SECTION_TYPE_LIST, getSectionType, getSectionTypesForScope, sectionTypeLabel, isKnownSectionType, resolveRepeaterField, isRepeaterField, blankRepeaterRow, } from '@prenta/core/page-sections';
9
+ export { SECTION_TYPES, SECTION_TYPE_LIST, getSectionType, getSectionTypesForScope, getAddableSectionTypesForScope, isSectionTypeAddable, sectionTypeLabel, isKnownSectionType, resolveRepeaterField, isRepeaterField, blankRepeaterRow, } from '@prenta/core/page-sections';
10
10
  export type { SectionTypeId, SectionScope, SectionFieldType, SectionFieldDef, SectionSettings, SectionTypeDef, ResolvedRepeater, RepeaterRow, PostHeaderConfig, PostTemplate, } from '@prenta/core/page-sections';
11
11
  //# sourceMappingURL=section-types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"section-types.d.ts","sourceRoot":"","sources":["../../../src/views/page-editor/section-types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,uBAAuB,EACvB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,eAAe,EACf,gBAAgB,GACjB,MAAM,4BAA4B,CAAA;AAEnC,YAAY,EACV,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,YAAY,GACb,MAAM,4BAA4B,CAAA"}
1
+ {"version":3,"file":"section-types.d.ts","sourceRoot":"","sources":["../../../src/views/page-editor/section-types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,uBAAuB,EACvB,8BAA8B,EAC9B,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,eAAe,EACf,gBAAgB,GACjB,MAAM,4BAA4B,CAAA;AAEnC,YAAY,EACV,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,YAAY,GACb,MAAM,4BAA4B,CAAA"}
@@ -6,5 +6,5 @@
6
6
  * of truth. This module re-exports them to preserve the historical import
7
7
  * path (`../views/page-editor/section-types.js`) used across the editor.
8
8
  */
9
- export { SECTION_TYPES, SECTION_TYPE_LIST, getSectionType, getSectionTypesForScope, sectionTypeLabel, isKnownSectionType, resolveRepeaterField, isRepeaterField, blankRepeaterRow, } from '@prenta/core/page-sections';
9
+ export { SECTION_TYPES, SECTION_TYPE_LIST, getSectionType, getSectionTypesForScope, getAddableSectionTypesForScope, isSectionTypeAddable, sectionTypeLabel, isKnownSectionType, resolveRepeaterField, isRepeaterField, blankRepeaterRow, } from '@prenta/core/page-sections';
10
10
  //# sourceMappingURL=section-types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"section-types.js","sourceRoot":"","sources":["../../../src/views/page-editor/section-types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,uBAAuB,EACvB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,eAAe,EACf,gBAAgB,GACjB,MAAM,4BAA4B,CAAA"}
1
+ {"version":3,"file":"section-types.js","sourceRoot":"","sources":["../../../src/views/page-editor/section-types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,uBAAuB,EACvB,8BAA8B,EAC9B,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,eAAe,EACf,gBAAgB,GACjB,MAAM,4BAA4B,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prenta/admin",
3
- "version": "1.10.0",
3
+ "version": "1.10.1",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -99,7 +99,7 @@
99
99
  "typescript": "^5.7.0",
100
100
  "vitest": "^4.1.0",
101
101
  "@prenta/component-blocks": "0.3.1",
102
- "@prenta/core": "5.0.3",
102
+ "@prenta/core": "5.1.0",
103
103
  "@prenta/plugin-ai": "1.0.0",
104
104
  "@prenta/plugin-blocks": "0.2.0",
105
105
  "@prenta/plugin-commerce": "0.2.1",
@@ -107,7 +107,7 @@
107
107
  "@prenta/plugin-media": "0.2.0",
108
108
  "@prenta/plugin-navigation": "0.3.0",
109
109
  "@prenta/plugin-seo": "0.1.2",
110
- "@prenta/sections-react": "0.17.27"
110
+ "@prenta/sections-react": "0.17.28"
111
111
  },
112
112
  "scripts": {
113
113
  "build": "tsc --project tsconfig.json && npx @tailwindcss/cli -i src/styles/build-input.css -o dist/prenta-admin.css --minify",
@@ -1,7 +1,11 @@
1
1
  'use client'
2
2
 
3
3
  import { Modal } from '../../components/ui/Modal.js'
4
- import { getSectionTypesForScope, type SectionScope, type SectionTypeId } from './section-types.js'
4
+ import {
5
+ getAddableSectionTypesForScope,
6
+ type SectionScope,
7
+ type SectionTypeId,
8
+ } from './section-types.js'
5
9
  import { sectionIconFor } from './section-icons.js'
6
10
 
7
11
  interface AddSectionModalProps {
@@ -22,7 +26,7 @@ interface AddSectionModalProps {
22
26
  * model; see the page-editor changeset.)
23
27
  */
24
28
  export function AddSectionModal({ open, onClose, onAdd, scope = 'page' }: AddSectionModalProps) {
25
- const types = getSectionTypesForScope(scope)
29
+ const types = getAddableSectionTypesForScope(scope)
26
30
  return (
27
31
  <Modal open={open} onClose={onClose} title="Add a section">
28
32
  <p className="text-muted-foreground mb-4 text-sm">
@@ -11,6 +11,8 @@ export {
11
11
  SECTION_TYPE_LIST,
12
12
  getSectionType,
13
13
  getSectionTypesForScope,
14
+ getAddableSectionTypesForScope,
15
+ isSectionTypeAddable,
14
16
  sectionTypeLabel,
15
17
  isKnownSectionType,
16
18
  resolveRepeaterField,