• CMSnpm version

    • Overview
    • ContentBuilder
    • InviteUserForm
    • LoginForm
    • RenewPasswordForm
    • WysiwygInput
  • UInpm version

    • Overview
    • Accordion
    • AlertBubble
    • AnnouncementBar
    • Avatar
    • AvatarFileInput
    • Badge
    • Button
    • ButtonGroup
    • ButtonList
    • Calendar
    • Checkbox
    • CheckboxButton
    • CheckboxInput
    • CheckboxList
    • Chip
    • ColorRadio
    • ColorRadioGroup
    • Combobox
    • DatePicker
    • DatePickerInput
    • DateRangePicker
    • DateRangePickerInput
    • DatetimePicker
    • DatetimePickerInput
    • Dialog
    • Dropdown
    • Dropzone
    • ErrorMessage
    • FileInput
    • FlashMessages
    • FormComponent
    • Icon
    • IconButton
    • ImageGallery
    • InfoBox
    • Input
    • Label
    • Layout
    • Lightbox
    • ListItem
    • Loader
    • Lozenge
    • Menu
    • Message
    • Modal
    • ✅ ModalDialog
    • ✅ ModalHeader
    • MultiCombobox
    • MultiSelect
    • Pagination
    • Paper
    • Popover
    • Radio
    • RadioGroup
    • RasterImage
    • Select
    • Switch
    • ✅ Tabs
    • TextInput
    • TextLink
    • Textarea
    • TimePicker
    • TimePickerInput
    • Toggle
    • Tooltip
    • Typography
  • Formnpm version

    • Overview
    • AvatarFileInput
    • CheckboxButton
    • CheckboxInput
    • CheckboxList
    • ColorRadioGroup
    • Combobox
    • DatePickerInput
    • DateRangePickerInput
    • DatetimePickerInput
    • Dropzone
    • FileInput
    • Form
    • FormRenderer
    • GpsInput
    • MoneyInput
    • MultiCombobox
    • MultiSelect
    • NumberInput
    • PasswordInput
    • RadioGroup
    • Select
    • TextInput
    • Textarea
    • TimePickerInput
    • Toggle
  • DataGridnpm version

    • Overview
    • DataGrid
    • DataGridCustomExample
    • ExportButton
    • FilterList
    • Filters
    • FiltersButton
    • FulltextInput
    • HiddenColumns
    • HiddenColumnsButton
    • Pagination
    • RowCounts
    • RowsPerPageSelect
    • SelectedRowsToolbar
    • TableV2
    • ToolbarControl
    • ToolbarCustoms
    • ToolbarTabs
  • Wysiwygnpm version

    • Overview
  • Resizernpm version

    • Overview
  • Routernpm version

    • Overview
  • Corenpm version

    • Overview
  • Core-Reactnpm version

    • Overview
  • DnDnpm version

    • Overview
  • Page-Buildernpm version

    • Overview
  • Page-Builder-CMSnpm version

    • Overview
  • Page-Builder-Webnpm version

    • Overview
  • Sentrynpm version

    • Overview
  • Stylesnpm version

    • Overview
  • Localizenpm version

    • Overview
  • Analyticsnpm version

    • Overview
  • Datepickernpm version

    • Overview
  • Icons-generatornpm version

    • Overview
  • Smart-addressnpm version

    • Overview
  • E2Enpm version

    • Overview
  • E2E-Playwrightnpm version

    • Overview

@uxf/page-builder

The contract of the UXF Page Builder, shared by the backoffice editors (@uxf/page-builder-cms), the web renderer (@uxf/page-builder-web) and the project:

  • protocol – messages between the visual editor (backoffice) and the editor iframe (web);
  • registry – defineRegistry and the types of the project's registry (layouts, groups, section types, languages). A section type's example is valid content in every language: the visual editor adds a new section with it at once and the add section drawer shows it rendered by the web;
  • section-schema – section field schemas generated from the PHP section requests (uxf:page-builder:schema-gen) and the validation rules shared with the API;
  • api-types – data types of the page builder REST API;
  • routes – the web routes the editors open (edit and preview pages).

test-cases/section-validation.json holds the validation cases both the PHP bundle (uxf/page-builder) and the backoffice forms run, so the two sides validate a section the same way. test-cases/api-routes.json lists the bundle's routes the packages call (method and path); the backoffice API client and the web's render fetchers check every call against it, and the bundle checks it against its router, so a route renamed on one side fails a test.

No runtime dependencies.

Generated registry and section schemas

uxf:page-builder:schema-gen of the PHP bundle writes registry.json and section-schemas.json into each app (like the grid and form schemas). The package's uxf-page-builder-generator turns them into the modules the apps import:

"page-builder:gen": "uxf-page-builder-generator -s src/generated/page-builder-schema -o src/generated/page-builder"

Add it to the app's gen script. It writes registry.ts (registry, ProjectSectionType: the registry as a literal passed to defineRegistry, so a layout group naming an unknown section type fails the type check) and section-schemas.ts (sectionSchemas).

Install in a project

yarn add @uxf/page-builder

@uxf/page-builder-cms and @uxf/page-builder-web take it as a peer dependency. The validation cases and the route list in test-cases/ ship with the package.

Compatibility with the PHP bundle

The npm packages talk to the API of the composer bundle uxf/page-builder (fan monorepo), which is released separately. The routes the packages call and the section validation cases are pinned in test-cases/ and tested on both sides.

@uxf/page-builder* (npm)uxf/page-builder (composer)
14.x^3.88

License

MIT