diff --git a/plugi-core/.DS_Store b/plugi-core/.DS_Store
new file mode 100644
index 0000000..56d996e
Binary files /dev/null and b/plugi-core/.DS_Store differ
diff --git a/plugi-core/.gitignore b/plugi-core/.gitignore
new file mode 100644
index 0000000..3c3629e
--- /dev/null
+++ b/plugi-core/.gitignore
@@ -0,0 +1 @@
+node_modules
diff --git a/plugi-core/LICENSE b/plugi-core/LICENSE
new file mode 100644
index 0000000..b4ef163
--- /dev/null
+++ b/plugi-core/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2023 Paul Spenke
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/plugi-core/README.md b/plugi-core/README.md
new file mode 100644
index 0000000..9a9ab4e
--- /dev/null
+++ b/plugi-core/README.md
@@ -0,0 +1,192 @@
+
+
+
+# PHPagebuilder
+> PHPagebuilder is a drag and drop pagebuilder to manage pages in any PHP project.
+
+PHPagebuilder can be used as an ultra lightweight CMS to quickly spin up new websites, or can be integrated into existing projects or your favorite frameworks (such as [this version](https://github.com/HansSchouten/Laravel-Pagebuilder) for Laravel). The server-side code does not depend on any other libraries and is blazing fast. It includes an optional website manager with a [Bootstrap UI](https://getbootstrap.com) and integrates the most popular open source drag and drop pagebuilder: [GrapesJS](https://grapesjs.com/). This package is made with customization in mind, allowing you to configure, disable or replace any of its modules.
+
+## Table of Contents
+- [How does it help me?](#how-does-it-help-me)
+- [Features](#features)
+- [Installation](#installation)
+- [Customization](#customization)
+
+## How does it help me?
+Whether you are a novice or an experienced web developer, PHPagebuilder can make your life easier if you find yourself in any of the following:
+
+- You just want to create a basic website that you can easily manage from any device.
+- You get lost installing, configuring, updating or simply using feature abundant CMS systems like Wordpress, Drupal.
+- You don't like the limited page editors in CMSs you've tried.
+- You want to build a custom website for a client within a few hours.
+- Your clients get lost in feature abundant admin panels like Drupal.
+- You hate to rely on messy plugins for features you can write in no-time in plain PHP yourself, but still want to have some admin functionality to allow other people to manage the websites you create.
+- You would like to have advanced functionality (search functionality, views displaying data of remote sources, etc.) easily manageable by your clients.
+
+## Features
+
+### Page Builder
+PHPagebuilder features a page builder built on [GrapesJS](https://grapesjs.com/).
+
+
+### Website Manager
+A basic website manager is included with a [Bootstrap](https://getbootstrap.com/) UI. This website manager offers basic functionality to add or remove pages and to edit page settings like page title or URL. Clicking the edit button will open the page builder.
+
+
+You don't want to use the website manager? No worries, it is included for people who want to use PHPagebuilder directly out of the box. Read [here](#customize-the-website-manager) how to disable or replace the website manager.
+
+## Installation
+
+To install PHPagebuilder you either follow the quick start path, for quickly spinning up a new website, or you integrate it in your own framework or favorite project structure.
+
+### Requirements
+
+- PHP version >= 7
+- A cool project
+
+### Quick start :rocket:
+
+If you want to quickly start a new project with drag and drop page management functionality, you can download the [boilerplate](https://github.com/HansSchouten/PHPagebuilder-boilerplate) project structure and follow the steps over there.
+
+### Integrate into existing project or framework
+
+#### Add code with Composer
+If you are using Composer for managing PHP dependencies, you can simply run:
+```
+composer require hansschouten/phpagebuilder
+```
+
+Next, the PHPagebuilder can be initialised using the following PHP code:
+```PHP
+require_once __DIR__ . '/vendor/autoload.php';
+
+$config = require __DIR__ . '/config.php';
+
+$builder = new PHPageBuilder\PHPageBuilder($config);
+$builder->handleRequest();
+```
+
+`config.php` should contain a copy of `config/config.example.php`, filled with your settings.
+
+#### Add code without Composer
+Are you not using Composer? No worries, this project is written in plain PHP without any dependencies, so it can be directly included in any PHP project!
+
+Just download the latest release into a separate folder inside your project (we named the folder: `phpagebuilder`).
+
+Next, you simply include the following code in the PHP file that should launch the page builder:
+
+```PHP
+$installationFolder = __DIR__ . '/phpagebuilder';
+require_once $installationFolder . '/src/Core/helpers.php';
+spl_autoload_register('phpb_autoload');
+
+$config = require __DIR__ . '/config.php';
+
+$builder = new PHPageBuilder\PHPageBuilder($config);
+$builder->handleRequest();
+```
+
+`config.php` should contain a copy of `config/config.example.php`, filled with your settings.
+
+### Configure a database
+If you use PHPagebuilder out of the box, it requires a database for storing your pages. Just create a database and run the queries from `config/create-tables.sql`. Next, add the database credentials to your config file.
+
+## Create a theme
+The `config.php` contains a config key `theme` in which a `themes_folder` and `active_theme` are specified. To create a new theme, add a new folder to the configured themes folder. The name of this folder will be the identifier of the theme, which can be used to select the theme in the `theme > active_theme` configuration.
+
+A theme should have the following folder structure:
+
+- **/blocks**
+The blocks folder contains a sub folder for each block that can be used in the page builder. The folder of a single block contains a `view.php` or a `view.html`. If a `view.html` is used, the block content (the html elements) are fully editable inside the page builder. If `view.php` is used, the block can be rendered with server-side logic (PHP) and hence the html content itself cannot be changed from within the page builder.
+- **/layouts**
+The layouts folder contains a sub folder for each page layout. A page layout contains a `view.php` file which defines the base html structure with all stylesheets and scripts needed for the blocks dragged on this type of page. Each layout requires the string: `= $body ?>` on the location at which the html blocks need to be added in the page layout.
+- **/public**
+The public folder contains all assets (css, javascript, images, etc) that should be publicly accessible. The `[theme-url]` shortcode can be used to point to a file in the public folder of the currently active theme. For instance the file `public/css/style.css` can be loaded via ``.
+
+### Blocks inside blocks
+#### Include a block into a block or layout file
+A shortcode can be used to include a block inside another block or into a layout file. For instance, adding the shortcode: `[block slug="header"]` to `layouts/master/view.php` includes the block: `blocks/header/view.php` inside each page that uses the `master` layout.
+
+#### Nested blocks in the page builder
+To allow dropping blocks into a block in the page builder, a blocks container should be added. To add a blocks container, simply add `[blocks-container]` at the desired location in a block view file. The following html syntax allows dropping blocks inside a bootstrap container element:
+```html
+
+ [blocks-container]
+
+```
+An alternative method is adding the `phpb-blocks-container` attribute to a html element, as shown in this example:
+```html
+
+
+
+
+
+
+```
+
+## Extending PHPageBuilder
+
+PHPageBuilder allows you to create new blocks and layouts for your theme very easily. This is great for building specific websites & templates, however if you use PHPageBuilder in a CMS environment, you probably want to provide Plugins / Modules the ability to create their own blocks without modifying your theme's pre-existing components.
+
+PHPageBuilder allows you to register blocks, layouts and assets (CSS, JS) from Plugins, Composer Packages or through any other environment.
+
+### Adding a New Block
+
+```php
+/**
+ * @param string $slug - A Unique identifier for the block. Prefix author to avoid conflict.
+ * @param string $directoryPath - Path to the directory of the Block.
+ */
+\PHPageBuilder\Extensions::registerBlock($slug, $directoryPath);
+
+// Registering an example block:
+
+\PHPageBuilder\Extensions::registerBlock('foo-navbar', MY_PLUGIN_DIRECTORY . '/blocks/foo-navbar');
+```
+
+### Adding a New Layout
+
+```php
+/**
+ * @param string $slug - A Unique identifier for the layout. Prefix author to avoid conflict.
+ * @param string $directoryPath - Path to the directory of the Layout.
+ */
+\PHPageBuilder\Extensions::registerLayout($slug, $directoryPath);
+
+// Registering an example layout:
+
+\PHPageBuilder\Extensions::registerLayout('foo-master', MY_PLUGIN_DIRECTORY . '/layouts/foo-master');
+```
+
+### Adding Assets (CSS & JS)
+```php
+/**
+ * @param string $src - URL of the Asset file.
+ * @param string $type - 'style' or 'script'
+ * @param string $location - 'header' or 'footer'
+ * @param array['$key' => '$value'] $attributes - Array of attributes to add to the tag.
+ */
+\PHPageBuilder\Extensions::registerAsset($src, $type, $location, $attributes = []);
+
+// Registering assets:
+
+\PHPageBuilder\Extensions::registerAsset('/assets/bootstrap.css', 'style', 'header');
+\PHPageBuilder\Extensions::registerAsset('/assets/alpine.min.js', 'script', 'header', [
+ 'defer' => true
+]);
+```
+
+Blocks & Layouts are created in the same manner as described in [Create A Theme](#create-a-theme), but they aren't limited to any theme directory.
+
+## Customize PHPageBuilder
+
+PHPagebuilder is build with customization in mind. It comes with an extensive example config file in wich you can easily adapt the pagebuilder to your needs.
+
+PHPagebuilder consists of four modules (Auth, Website Manager, Pagebuilder, Routing) each of which you can disable or replace with your own implementation. To replace a module with your own implementation, implement the corresponding Contract and replace the default class by your own class in the config file.
+
+### Customize the Website Manager
+#### Disable the module
+Do you already have admin login functionality in your project? Then you can disable the website manager module by setting `use_website_manager` to `false` in your config. Next, you use or implement the page create/edit/remove functionality in your project and then directly launch the pagebuilder. You can render the pagebuilder from your project by using the `PHPageBuilder\Modules\GrapesJS\PageBuilder` class.
+
+#### Replace the module
+If you want to use the CMS routing functionality of PHPagebuilder, but you want to have a different website manager, you can replace the website manager for your own implementation. Make sure leave `use_website_manager` to `true` in your config, implement the WebsiteManagerContract and add your own class to your config file.
diff --git a/plugi-core/build.js b/plugi-core/build.js
new file mode 100644
index 0000000..db66585
--- /dev/null
+++ b/plugi-core/build.js
@@ -0,0 +1,39 @@
+import { build } from 'vite';
+
+// libraries
+const libraries = [
+ {
+ entry: './src/Modules/WebsiteManager/resources/assets/entry.js',
+ name: 'WebsiteManager',
+ fileName: 'WebsiteManager',
+ },
+ {
+ entry: './src/Modules/GrapesJS/resources/assets/entryHead.js',
+ name: 'PageBuilderHead',
+ fileName: 'PageBuilderHead',
+ },
+ {
+ entry: './src/Modules/GrapesJS/resources/assets/entryBody.js',
+ name: 'PageBuilderBody',
+ fileName: 'PageBuilderBody',
+ },
+];
+
+// build
+libraries.forEach(async (libItem) => {
+ await build({
+ configFile: false,
+ build: {
+ lib: libItem,
+ emptyOutDir: false,
+ rollupOptions: {
+ output: {
+ assetFileNames: (assetInfo) => {
+ if (assetInfo.name === 'style.css') return `${libItem.fileName}.css`;
+ return assetInfo.name;
+ },
+ },
+ },
+ },
+ });
+});
diff --git a/plugi-core/composer.json b/plugi-core/composer.json
new file mode 100644
index 0000000..b3d9046
--- /dev/null
+++ b/plugi-core/composer.json
@@ -0,0 +1,31 @@
+{
+ "name": "deepDiverPaul/plugi-core",
+ "description": "A drag and drop pagebuilder to manage pages in any PHP project.",
+ "keywords": [
+ "pagebuilder"
+ ],
+ "homepage": "https://github.com/deepDiverPaul/plugi-core",
+ "type": "library",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Paul Spenke",
+ "email": "info@onlineer.de"
+ },
+ {
+ "name": "Hans Schouten",
+ "email": "hans@falcosolutions.nl"
+ }
+ ],
+ "require": {
+ "php": ">=8.2"
+ },
+ "autoload": {
+ "psr-4": {
+ "Plugi\\": "src/"
+ },
+ "files": [
+ "src/Core/helpers.php"
+ ]
+ }
+}
diff --git a/plugi-core/config/.DS_Store b/plugi-core/config/.DS_Store
new file mode 100644
index 0000000..316544d
Binary files /dev/null and b/plugi-core/config/.DS_Store differ
diff --git a/plugi-core/config/config.example.php b/plugi-core/config/config.example.php
new file mode 100644
index 0000000..029d79d
--- /dev/null
+++ b/plugi-core/config/config.example.php
@@ -0,0 +1,180 @@
+ '/vendor/hansschouten/plugi/dist',
+ |
+ */
+ 'general' => [
+ 'base_url' => 'http://localhost',
+ 'language' => 'en',
+ 'assets_url' => '/assets',
+ 'uploads_url' => '/uploads'
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | Storage settings
+ |--------------------------------------------------------------------------
+ |
+ | Database and file storage settings.
+ |
+ */
+ 'storage' => [
+ 'use_database' => true,
+ 'database' => [
+ 'driver' => 'mysql',
+ 'host' => 'localhost',
+ 'database' => '',
+ 'username' => '',
+ 'password' => '',
+ 'charset' => 'utf8',
+ 'collation' => 'utf8_unicode_ci',
+ 'prefix' => '',
+ ],
+ 'uploads_folder' => __DIR__ . '/uploads'
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | Auth settings
+ |--------------------------------------------------------------------------
+ |
+ | By default an authentication class is provided which checks for the
+ | credentials configured in this setting block.
+ |
+ */
+ 'auth' => [
+ 'use_login' => true,
+ 'class' => Plugi\Modules\Auth\Auth::class,
+ 'url' => '/admin/auth',
+ 'username' => 'admin',
+ 'password' => 'changethispassword'
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | WebsiteManager settings
+ |--------------------------------------------------------------------------
+ |
+ | By default a basic WebsiteManager is provided for creating/editing pages.
+ |
+ */
+ 'website_manager' => [
+ 'use_website_manager' => true,
+ 'class' => Plugi\Modules\WebsiteManager\WebsiteManager::class,
+ 'url' => '/admin'
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | Website settings
+ |--------------------------------------------------------------------------
+ |
+ | By default a setting class is provided for accessing website settings.
+ |
+ */
+ 'setting' => [
+ 'class' => Plugi\Setting::class
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | PageBuilder settings
+ |--------------------------------------------------------------------------
+ |
+ | By default a PageBuilder is provided based on GrapesJS.
+ |
+ */
+ 'pagebuilder' => [
+ 'class' => Plugi\Modules\GrapesJS\PageBuilder::class,
+ 'url' => '/admin/pagebuilder',
+ 'actions' => [
+ 'back' => '/admin'
+ ]
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | Page settings
+ |--------------------------------------------------------------------------
+ |
+ | By default a Page class is provided with knowledge about its layout and URL.
+ |
+ */
+ 'page' => [
+ 'class' => Plugi\Page::class,
+ 'table' => 'pages',
+ 'translation' => [
+ 'class' => Plugi\PageTranslation::class,
+ 'table' => 'page_translations',
+ 'foreign_key' => 'page_id',
+ ]
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | Cache settings
+ |--------------------------------------------------------------------------
+ |
+ | Faster load time by skipping block parsing if the page has been requested before.
+ | A page will be cached, except if it contains a block with caching set to false.
+ | This can be used to prevent caching pages with content that varies per page load.
+ | The cached html is removed if the page is saved again in the page builder.
+ |
+ */
+ 'cache' => [
+ 'enabled' => false,
+ 'folder' => __DIR__ . '/cache',
+ 'class' => Plugi\Cache::class
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | Theme settings
+ |--------------------------------------------------------------------------
+ |
+ | PageBuilder requires a themes folder in which for each theme the individual
+ | theme blocks are defined. A theme block is a sub folder in the themes folder
+ | containing a view, model (optional) and controller (optional).
+ |
+ */
+ 'theme' => [
+ 'class' => Plugi\Theme::class,
+ 'folder' => __DIR__ . '/themes',
+ 'folder_url' => '/themes',
+ 'active_theme' => 'demo'
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | Routing settings
+ |--------------------------------------------------------------------------
+ |
+ | Settings for resolving pages based on the current URI.
+ |
+ */
+ 'router' => [
+ 'class' => Plugi\Modules\Router\DatabasePageRouter::class
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | Class replacements
+ |--------------------------------------------------------------------------
+ |
+ | Allows mapping a class namespace to an alternative namespace,
+ | useful for replacing implementations of specific pagebuilder classes.
+ | Example: Plugi\UploadedFile::class => Alternative\UploadedFile::class
+ | Important: when overriding a class always extend the original class.
+ |
+ */
+ 'class_replacements' => [
+ ],
+];
diff --git a/plugi-core/config/create-tables.sql b/plugi-core/config/create-tables.sql
new file mode 100644
index 0000000..22febfe
--- /dev/null
+++ b/plugi-core/config/create-tables.sql
@@ -0,0 +1,208 @@
+-- phpMyAdmin SQL Dump
+-- version 5.2.1
+-- https://www.phpmyadmin.net/
+--
+-- Host: mysql
+-- Erstellungszeit: 05. Jun 2023 um 09:11
+-- Server-Version: 8.0.31
+-- PHP-Version: 8.2.6
+
+SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
+START TRANSACTION;
+SET time_zone = "+00:00";
+
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8mb4 */;
+
+--
+-- Datenbank: `plugi`
+--
+
+-- --------------------------------------------------------
+
+--
+-- Tabellenstruktur für Tabelle `menus`
+--
+
+CREATE TABLE `menus` (
+ `id` int NOT NULL,
+ `name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
+ `pages` mediumtext CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
+
+--
+-- Daten für Tabelle `menus`
+--
+
+INSERT INTO `menus` (`id`, `name`, `pages`) VALUES
+(1, 'Main', '1,3'),
+(2, 'Footer', '1');
+
+-- --------------------------------------------------------
+
+--
+-- Tabellenstruktur für Tabelle `pages`
+--
+
+CREATE TABLE `pages` (
+ `id` int NOT NULL,
+ `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
+ `layout` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
+ `data` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
+ `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
+
+--
+-- Daten für Tabelle `pages`
+--
+
+INSERT INTO `pages` (`id`, `name`, `layout`, `data`, `updated_at`, `created_at`) VALUES
+(1, 'Home', 'master', NULL, '2023-06-05 07:10:09', '2023-06-05 07:10:09'),
+(2, 'Sitemap', 'sitemap', NULL, '2023-06-05 07:11:15', '2023-06-05 07:10:41'),
+(3, 'About', 'master', NULL, '2023-06-05 07:10:57', '2023-06-05 07:10:57');
+
+-- --------------------------------------------------------
+
+--
+-- Tabellenstruktur für Tabelle `page_translations`
+--
+
+CREATE TABLE `page_translations` (
+ `id` int NOT NULL,
+ `page_id` int NOT NULL,
+ `locale` varchar(50) NOT NULL,
+ `title` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
+ `meta_title` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
+ `meta_description` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
+ `route` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
+ `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
+
+--
+-- Daten für Tabelle `page_translations`
+--
+
+INSERT INTO `page_translations` (`id`, `page_id`, `locale`, `title`, `meta_title`, `meta_description`, `route`, `updated_at`, `created_at`) VALUES
+(1, 1, 'de', 'Home', 'Home', 'Home', '/', '2023-06-05 07:10:09', '2023-06-05 07:10:09'),
+(2, 2, 'de', 'Sitemap', '', '', '/sitemap.xml', '2023-06-05 07:10:41', '2023-06-05 07:10:41'),
+(3, 3, 'de', 'About', 'About', 'Description', '/about', '2023-06-05 07:10:57', '2023-06-05 07:10:57');
+
+-- --------------------------------------------------------
+
+--
+-- Tabellenstruktur für Tabelle `settings`
+--
+
+CREATE TABLE `settings` (
+ `id` int NOT NULL,
+ `setting` varchar(50) NOT NULL,
+ `value` mediumtext NOT NULL,
+ `is_array` tinyint(1) NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
+
+-- --------------------------------------------------------
+
+--
+-- Tabellenstruktur für Tabelle `uploads`
+--
+
+CREATE TABLE `uploads` (
+ `id` int NOT NULL,
+ `public_id` varchar(50) NOT NULL,
+ `original_file` varchar(512) NOT NULL,
+ `mime_type` varchar(50) NOT NULL,
+ `server_file` varchar(512) NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
+
+--
+-- Indizes der exportierten Tabellen
+--
+
+--
+-- Indizes für die Tabelle `menus`
+--
+ALTER TABLE `menus`
+ ADD PRIMARY KEY (`id`),
+ ADD UNIQUE KEY `menu` (`name`);
+
+--
+-- Indizes für die Tabelle `pages`
+--
+ALTER TABLE `pages`
+ ADD PRIMARY KEY (`id`);
+
+--
+-- Indizes für die Tabelle `page_translations`
+--
+ALTER TABLE `page_translations`
+ ADD PRIMARY KEY (`id`),
+ ADD UNIQUE KEY `page_id` (`page_id`,`locale`);
+
+--
+-- Indizes für die Tabelle `settings`
+--
+ALTER TABLE `settings`
+ ADD PRIMARY KEY (`id`),
+ ADD UNIQUE KEY `setting` (`setting`);
+
+--
+-- Indizes für die Tabelle `uploads`
+--
+ALTER TABLE `uploads`
+ ADD PRIMARY KEY (`id`),
+ ADD UNIQUE KEY `public_id` (`public_id`),
+ ADD UNIQUE KEY `server_file` (`server_file`);
+
+--
+-- AUTO_INCREMENT für exportierte Tabellen
+--
+
+--
+-- AUTO_INCREMENT für Tabelle `menus`
+--
+ALTER TABLE `menus`
+ MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
+
+--
+-- AUTO_INCREMENT für Tabelle `pages`
+--
+ALTER TABLE `pages`
+ MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
+
+--
+-- AUTO_INCREMENT für Tabelle `page_translations`
+--
+ALTER TABLE `page_translations`
+ MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
+
+--
+-- AUTO_INCREMENT für Tabelle `settings`
+--
+ALTER TABLE `settings`
+ MODIFY `id` int NOT NULL AUTO_INCREMENT;
+
+--
+-- AUTO_INCREMENT für Tabelle `uploads`
+--
+ALTER TABLE `uploads`
+ MODIFY `id` int NOT NULL AUTO_INCREMENT;
+
+--
+-- Constraints der exportierten Tabellen
+--
+
+--
+-- Constraints der Tabelle `page_translations`
+--
+ALTER TABLE `page_translations`
+ ADD CONSTRAINT `page_translations_ibfk_1` FOREIGN KEY (`page_id`) REFERENCES `pages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
+COMMIT;
+
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
diff --git a/plugi-core/dist/PageBuilderBody.css b/plugi-core/dist/PageBuilderBody.css
new file mode 100644
index 0000000..00edc56
--- /dev/null
+++ b/plugi-core/dist/PageBuilderBody.css
@@ -0,0 +1 @@
+html,body,#gjs{height:100%!important;margin:0;overflow:hidden}*{box-shadow:none!important}.form-control,.form-control:focus{color:#e1e1e1}.cursor-pointer{cursor:pointer}.gjs-editor{font-size:.9rem}.toast{opacity:1!important;border:none;right:15px;box-shadow:none}.toast.toast-success{background:#2dc837}#phpb-loading{position:absolute;height:100%;width:100%;background-color:#fff;z-index:10000;transition:opacity .3s,visibility .3s}#phpb-loading.loaded{visibility:hidden;opacity:0}#phpb-loading .circle{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:150px;height:150px}#phpb-loading .circle .text{font-size:20px;margin:20px -30px 0;text-align:center;color:#0091d1}#phpb-loading .loader{width:calc(100% + -0px);height:calc(100% + -0px);border:8px solid #0091d1;border-top:8px solid #004a6c;border-radius:50%;animation:rotate 5s linear infinite}@keyframes rotate{to{transform:rotate(360deg)}}.btn.focus,.btn:focus{box-shadow:none}.gjs-cv-canvas{height:100%;top:0;width:calc(100% - 325px)}.gjs-toolbar{z-index:100!important}.gjs-pn-panel{padding:0}.gjs-pn-panel .gjs-pn-buttons{justify-content:center}.gjs-pn-commands,.gjs-pn-options,.gjs-pn-devices-c{display:none}.gjs-devices-c{padding:0}.gjs-one-bg{background-color:#313844;border-bottom:none;color:#c4c7ce}.gjs-two-color,.gjs-four-color,.gjs-four-color-h:hover{color:#e1e1e1}.gjs-pn-commands{width:100%;box-shadow:none}::-webkit-scrollbar{width:7px;height:7px}::-webkit-scrollbar-track{background:#313844!important}::-webkit-scrollbar-thumb{background-color:#a5acb9!important;border-radius:3px}::-webkit-scrollbar-thumb:hover{background-color:#0091d1!important}.gjs-pn-views{top:40px}.gjs-pn-views .gjs-pn-btn{width:33.33%;margin-right:0;padding:16px 15px;border-radius:0;background:#3a3f4a;color:#e3e3e3;border-bottom:1px solid #3a3f4a;font-size:16px}.gjs-pn-views .gjs-pn-btn.gjs-pn-active{padding:15px;background-color:#515664;border-bottom-left-radius:unset;border-bottom-right-radius:unset;box-shadow:none;color:#fff;border-bottom:3px solid #0091d1}.gjs-pn-options{right:0}.gjs-pn-views,.gjs-pn-views-container{left:0;box-shadow:none;width:325px;padding-bottom:0;margin-bottom:0;margin-left:0;margin-right:0;padding-left:0;padding-right:0}.gjs-pn-views-container{padding-top:89px;background:#22272e;height:calc(100% - 40px);overflow:hidden}.gjs-pn-views-container>div:first-of-type{margin-top:44px}.gjs-pn-views-container>div{height:100%;overflow-y:auto}.gjs-pn-views-container>div>div{background:#22272e;border:none}.gjs-cv-canvas,.gjs-pn-devices-c{left:325px}.gjs-pn-panel #gjs-sm-caret{padding-right:0!important}.gjs-pn-panel .fa-caret-down{margin-right:5px!important}.gjs-pn-panel .fa-caret-right{margin-right:8px!important}.gjs-three-bg{background-color:#0091d1}.gjs-clm-tags #gjs-clm-close,.gjs-clm-tags #gjs-clm-checkbox{color:#fff}.gjs-field{background-color:#22272e;border-radius:0;padding:2px}.gjs-field input,.gjs-field select,.gjs-field textarea{padding:5px}.gjs-field .gjs-d-s-arrow{border-top:4px solid rgb(100,100,100)}#sidebar-header{position:absolute;box-shadow:none;width:325px;padding-bottom:0;margin-bottom:0;margin-left:0;margin-right:0;padding-left:0;padding-right:0;background:#22272e;height:40px;z-index:100}#sidebar-header #language-selector{float:right}#sidebar-header #language-selector .dropdown-item.active,#sidebar-header #language-selector .dropdown-item:active{background:#22272e!important}#sidebar-header #language-selector .dropdown-menu.show{padding:0}#sidebar-header #language-selector .dropdown-toggle{margin-top:2px;color:#fff!important;background:none!important;border:none;box-shadow:none;outline:none!important}#sidebar-header #language-selector .flag-icon{background-size:contain;background-position:50%;background-repeat:no-repeat;position:relative;display:inline-block;width:1.33333333em;height:12px;line-height:1em}#toggle-sidebar{position:absolute;left:0;top:0;z-index:100;color:#c4c7ce;background:#22272e;border-radius:0;transition-duration:unset}#block-search{position:fixed;background:#22272e;border-color:#3a3f4a;border-radius:0;width:325px;margin-top:-44px}#block-search i.fa-search{position:absolute;top:14px;left:9px;font-size:15px;color:#515664}#block-search input{background:#181b1e;padding:22px 20px 22px 30px;border-radius:0;border:none}#block-search input::-moz-placeholder{color:#515664}#block-search input::placeholder{color:#515664}.gjs-block{border:none;box-shadow:none;padding-bottom:8px;margin:5px;width:calc(50% - 10px)}.gjs-block.fa{padding:8px}.gjs-block:hover{color:#0091d1!important}.gjs-block .block-thumb{height:70px;overflow:hidden;margin-bottom:5px;opacity:.8}.gjs-block .block-thumb img{width:100%}.gjs-blocks-c{background:#22272e;padding:4px}.gjs-block-categories{background:#22272e;padding-bottom:45px}.gjs-block-label{font-size:.8rem;height:100%;display:grid}.gjs-block-label b{display:contents;font-weight:800}.gjs-block-category{background:#5a6371}.gjs-block-category.gjs-open{border-bottom:none!important;margin-bottom:10px}.gjs-blocks-cs{border-bottom:none!important}.gjs-layer .gjs-layer-title{background:#5a6371!important}.gjs-layer.gjs-selected .gjs-layer-title{background-color:#0091d1!important}.gjs-layer.gjs-hovered .gjs-layer-title{background-color:#0091d170!important}.gjs-category-title,.gjs-sm-sector .gjs-sm-title,.gjs-clm-tags .gjs-sm-title,.gjs-block-category .gjs-title,.gjs-layer-title{background:#424853!important;border-bottom:2px solid #363d48!important;letter-spacing:0;font-size:16px;font-weight:400}.gjs-sm-sector.gjs-sm-open .gjs-sm-title,.gjs-clm-tags.gjs-open .gjs-sm-title,.gjs-block-category.gjs-open .gjs-title{background:#545d6c!important}.gjs-layer-name{padding-top:2px;padding-bottom:13px}.gjs-layer-count{display:none}.gjs-layer-vis{padding-top:11px}.gjs-sm-sector.gjs-sm-open{border-bottom:1px solid rgba(0,0,0,.1)}.gjs-trt-trait{display:block}.gjs-trt-header{font-weight:400}.gjs-trt-trait .gjs-label,.gjs-trt-trait .gjs-field{width:100%}.gjs-field-checkbox{height:17px!important;width:17px!important}.gjs-traits-label{font-weight:400;font-size:16px;border-bottom:none}.gjs-sm-sector #gjs-sm-caret,.gjs-clm-tags #gjs-sm-caret{font-size:initial}.gjs-trt-traits .gjs-label-wrp{width:100%}.gjs-trt-traits p.no-settings{padding-top:10px;padding-bottom:10px}.gjs-trt-trait__wrp:first-of-type{padding-top:8px}.gjs-trt-trait__wrp:last-of-type{padding-bottom:8px}.gjs-trt-trait{padding-bottom:10px}.gjs-trt-trait .gjs-field-image{background:none;padding:0}.gjs-trt-trait .gjs-field-image .image__preview-container{text-align:center}.gjs-trt-trait .gjs-field-image .image__preview-container .image__remove-button{position:absolute;right:0;top:0;border-radius:0;background-color:#e9eef2;border-color:#e9eef2;color:#515664;padding:2px 6px}.gjs-trt-trait .gjs-field-image .image__preview-container img{max-width:100%;max-height:150px}#sidebar-bottom-buttons{position:absolute;left:0;bottom:0;height:40px;width:325px;margin:0;padding:0;box-shadow:none;background:#474c57;border-top:none}#sidebar-bottom-buttons button,#sidebar-bottom-buttons a{float:right;height:100%;width:33.33%;border-left:1px solid #343944;border-radius:0;color:#e3e3e3;font-size:15px;padding:8px 0}#sidebar-bottom-buttons button:hover,#sidebar-bottom-buttons a:hover{background:#017eb5;color:#fff}#sidebar-bottom-buttons button:last-child,#sidebar-bottom-buttons a:last-child{border-left:none}#sidebar-bottom-buttons button.waiting{background:#0091d1;color:#fff!important}#sidebar-bottom-buttons button.waiting i.fa{display:none}#sidebar-bottom-buttons #go-back:hover{background:#b03541}#sidebar-bottom-buttons #save-page:hover{background:#419147}.gjs-field{background-color:#22272e}.gjs-field select option{background-color:#fff;color:#000}.gjs-input-unit,.gjs-field-arrows,.gjs-sm-field select.gjs-input-unit{color:#e1e1e1}.gjs-sm-field select.gjs-input-unit option{background-color:#22272e;color:#fff}.gjs-field-arrow-d{border-top:4px solid #e1e1e1}.gjs-field-arrow-u{border-bottom:4px solid #e1e1e1}.gjs-field-radio{padding:0!important}.gjs-radio-item .gjs-radio-item-label{padding-top:10px;margin-bottom:0;padding-bottom:10px;width:100%}.gjs-radio-item input:checked+.gjs-radio-item-label{background-color:#545d6c}.gjs-sm-header,.gjs-trt-header{font-weight:400;color:#8c909d}.gjs-clm-tags{width:100%;padding-top:0;padding-bottom:0}.gjs-clm-tags #gjs-clm-status-c,.gjs-clm-tags #gjs-clm-sel-help{display:none}.gjs-clm-tags #gjs-clm-new{color:#e1e1e1}.gjs-clm-tags #gjs-clm-add-tag{background-color:#0091d1;border:none;box-shadow:1px 1px #fff3 inset;color:#fff}.gjs-clm-tags #gjs-clm-add-tag:hover{background-color:#004a6c}.gjs-sm-sectors .gjs-four-color,.gjs-sm-sectors .gjs-color-warn{color:#e1e1e1}.gjs-sm-sectors .gjs-sm-field.gjs-sm-composite{background-color:#c3e2ec24;border:1px solid rgba(121,147,155,.14)}.gjs-sm-sectors .gjs-sm-layers{background-color:#3a3f4a}.gjs-sm-sectors .gjs-sm-layers .gjs-sm-btn{background:#fff;color:#000;text-shadow:none}.gjs-sm-sectors .gjs-sm-layers .gjs-field{padding:0;background-color:#3a3f4a}.gjs-sm-sectors .gjs-sm-layers .gjs-field select{color:#fff;background:#424853}.gjs-sm-sectors .gjs-sm-stack #gjs-sm-add{color:#fff}.gjs-sm-sectors .gjs-sm-stack #gjs-sm-add:hover{color:#aaa}.gjs-am-assets-header{display:none}.gjs-am-assets-cont{background:none;padding-top:0}.gjs-am-assets{height:325px}.gjs-am-asset{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.gjs-btn-prim{display:inline-block;margin-top:10px;padding:.375rem .75rem;font-weight:400;text-align:center;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;user-select:none;font-size:1rem;line-height:1.5;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;color:#fff;border:1px solid #0091d1;background-color:#0091d1}.gjs-am-add-asset button{float:left;width:auto}.gjs-am-add-asset .gjs-am-add-field{width:100%}.gjs-am-file-uploader>form{background-color:#c3e2ec24;border:2px dashed rgb(189,194,200)}.gjs-am-file-uploader #gjs-am-title{color:#7e8793;text-shadow:none}.cke_dialog_body .cke_dialog_ui_vbox_child{padding:0}.cke_dialog_body input.cke_dialog_ui_input_text,.cke_dialog_body input.cke_dialog_ui_input_password,.cke_dialog_body input.cke_dialog_ui_input_tel,.cke_dialog_body textarea.cke_dialog_ui_input_textarea,.cke_dialog_body div.cke_dialog_ui_input_select{margin-bottom:10px}.cke_dialog_body .cke_dialog_ui_input_select{width:100%!important}.sidebar-collapsed .gjs-cv-canvas{width:calc(100% + -0px)}.sidebar-collapsed .gjs-pn-panels{display:none}.sidebar-collapsed .gjs-cv-canvas,.sidebar-collapsed .gjs-pn-devices-c{left:0}.sidebar-collapsed #toggle-sidebar{padding:14px 18px;font-size:18px;box-shadow:2px 3px 10px 2px #0000004d;border-bottom-right-radius:4px}html,body{overflow-x:initial!important}form{-webkit-margin-after:0;margin-block-end:0}[data-cursor=default]{cursor:default}[data-cursor=text]{cursor:text}span[draggable=true]{display:inline-flex}[phpb-hide-if-not-editable]{background:rgba(253,227,193,.4901960784);border:1px dashed rgba(185,142,87,.4901960784);padding:7px;font-size:1.1rem;font-style:italic;font-weight:400;text-align:center;color:#5e5e5e}[phpb-hide-if-not-editable]:not(.editable){display:none}[data-gjs-type].gjs-comp-selected{outline:1px solid #0091d1!important;outline-offset:0!important}div[data-gjs-type].gjs-comp-selected{outline:1px solid #0091d1!important;outline-offset:-1px!important}[phpb-content-container],[phpb-blocks-container]{min-height:50px;width:100%}[phpb-blocks-container]{border:1px dashed #0091d1}html ::-webkit-scrollbar,body ::-webkit-scrollbar{width:11px;height:11px}html ::-webkit-scrollbar-track,body ::-webkit-scrollbar-track{background:#f5f5f5}html ::-webkit-scrollbar-thumb,body ::-webkit-scrollbar-thumb{background-color:#ccc}html ::-webkit-scrollbar-thumb:hover,body ::-webkit-scrollbar-thumb:hover{background-color:#bbb}.gjs-waiting{opacity:.5;pointer-events:none}
diff --git a/plugi-core/dist/PageBuilderBody.js b/plugi-core/dist/PageBuilderBody.js
new file mode 100644
index 0000000..a206864
--- /dev/null
+++ b/plugi-core/dist/PageBuilderBody.js
@@ -0,0 +1,708 @@
+$(".gjs-editor").append($("#toggle-sidebar"));
+$(".gjs-pn-panels").prepend($("#sidebar-header"));
+$(".gjs-pn-panels").append($("#sidebar-bottom-buttons"));
+$("#toggle-sidebar").click(function() {
+ $("#gjs").toggleClass("sidebar-collapsed"), S();
+});
+y();
+window.editor.on("run:open-sm", function(t) {
+ $(".gjs-trt-traits").parent().parent().css("display", "none"), $(".gjs-sm-sectors").parent().parent().css("display", "block"), $("#gjs-sm-advanced .gjs-sm-properties").append($(".gjs-clm-tags"));
+});
+window.editor.on("run:open-tm", function(t) {
+ $(".gjs-sm-sectors").parent().parent().css("display", "none"), $(".gjs-trt-traits").parent().parent().css("display", "block");
+});
+window.editor.on("block:drag:start", function(t) {
+ y();
+});
+window.editor.on("rteToolbarPosUpdate", function(t) {
+ !window.editor || !window.editor.getSelected() || !window.editor.getSelected().getEl() || setTimeout(function() {
+ let i = $(".gjs-rte-toolbar").first();
+ if (i.offset().top < t.elementTop + 0.5 * t.elementHeight) {
+ let a = t.elementTop - i.height();
+ a > 0 && i.css("top", a + "px");
+ }
+ }, 0);
+});
+function y() {
+ $(window).width() < 1e3 && ($("#gjs").addClass("sidebar-collapsed"), S());
+}
+function S() {
+ window.editor.trigger("change:canvasOffset canvasScroll");
+}
+let b = !1;
+$(document).keydown(function(t) {
+ t.which === 8 && (b = !0);
+}).keyup(function(t) {
+ t.which === 8 && (b = !1);
+});
+$(window).on("beforeunload", function(t) {
+ b && t.preventDefault();
+});
+function A() {
+ $(".gjs-blocks-cs").prepend($("#block-search"));
+}
+window.addEventListener("message", V, !1);
+function V(t) {
+ t.data === "page-loaded" ? ($("#phpb-loading").addClass("loaded"), A(), window.isLoaded = !0, $(window).trigger("pagebuilder-page-loaded")) : t.data === "touch-start" && window.touchStart();
+}
+$(document).on("input", "#block-search input", function() {
+ let t = $(this).val().toLowerCase();
+ $(".gjs-block-category").each(function() {
+ let e = !1;
+ $(this).find(".gjs-block").each(function() {
+ $(this).data("original-html") || $(this).data("original-html", $(this).html());
+ let i = $(this).text();
+ if (i.toLowerCase().includes(t)) {
+ $(this).removeClass("d-none"), e = !0;
+ let n = new RegExp("(" + t + ")", "gi"), a = i.replace(n, "$1");
+ $(this).find(".gjs-block-label").html(
+ $(this).data("original-html").replace(i.trim(), a)
+ );
+ } else
+ $(this).addClass("d-none");
+ }), $(this).removeClass("d-none"), e || $(this).addClass("d-none");
+ });
+});
+window.customBuilderScripts = {};
+window.editor.on("component:create", (t) => {
+ if (t.components().length) {
+ let e = t.components().models[t.components().length - 1];
+ if (e.attributes.type === "script") {
+ let i = t.attributes.attributes["block-id"];
+ i === void 0 && (i = t.attributes.attributes.id);
+ let n = e, a = !1;
+ for (; n.parent(); )
+ if (n = n.parent(), n.attributes.attributes["phpb-content-container"]) {
+ a = !0;
+ break;
+ }
+ a && (window.customBuilderScripts[i] = e.toHTML(), e.remove());
+ }
+ }
+});
+window.editor.on("component:add", function(t) {
+ if (t.attributes["run-builder-script"] !== void 0) {
+ let e = customBuilderScripts;
+ window.customBuilderScripts[t.attributes["block-id"]] = customBuilderScripts[t.attributes["run-builder-script"]], runScriptsOfComponentAndChildren(t), window.customBuilderScripts = e, delete t.attributes["run-builder-script"];
+ }
+});
+window.editor.on("sorter:drag:end", function(t) {
+ let e = t.modelToDrop;
+ e && e.attributes && (e.attributes["block-id"] || e.attributes.id) && window.runScriptsOfComponentAndChildren(e);
+ for (let i in CKEDITOR.instances)
+ CKEDITOR.instances[i].destroy(!0);
+});
+window.runScriptsOfComponentAndChildren = function(t) {
+ H(t), t.components().each(function(e) {
+ runScriptsOfComponentAndChildren(e);
+ });
+};
+function H(t) {
+ let e = t.attributes["block-id"];
+ if (e === void 0 && (e = t.attributes.attributes.id), e && window.customBuilderScripts[e] !== void 0) {
+ let i = t.attributes["style-identifier"], n = $("").append(window.customBuilderScripts[e]);
+ n.find("script").prepend("let inPageBuilder = true;"), n.find("script").prepend('let blockSelector = ".' + i + '";'), n.find("script").prepend('let block = document.getElementsByClassName("' + i + '")[0];'), n.find("script").prepend("(function(){"), n.find("script").append("})();");
+ let a = document.createElement("script");
+ a.type = "text/javascript", a.innerHTML = n.find("script").html(), window.editor.Canvas.getDocument().body.appendChild(a);
+ }
+}
+function R() {
+ x();
+ let t = document.createElement("script");
+ t.type = "text/javascript", t.src = window.injectionScriptUrl;
+ let e = t.outerHTML + "