@squeditor/squeditor-framework 1.0.0

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.
Files changed (77) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +106 -0
  3. package/package.json +36 -0
  4. package/php/functions.php +92 -0
  5. package/project-template/package.json +29 -0
  6. package/project-template/postcss.config.js +6 -0
  7. package/project-template/squeditor.config.js +81 -0
  8. package/project-template/src/404.php +21 -0
  9. package/project-template/src/assets/css/squeditor-icons.css +4719 -0
  10. package/project-template/src/assets/css/tailwind.css +3 -0
  11. package/project-template/src/assets/css/uikit-components.css +14586 -0
  12. package/project-template/src/assets/js/gsap-advanced.js +26 -0
  13. package/project-template/src/assets/js/gsap-init.js +672 -0
  14. package/project-template/src/assets/js/gsap-modules/cursor-preview.js +132 -0
  15. package/project-template/src/assets/js/gsap-modules/cursor.js +456 -0
  16. package/project-template/src/assets/js/gsap-modules/loop-panels.js +78 -0
  17. package/project-template/src/assets/js/gsap-modules/marquee.js +106 -0
  18. package/project-template/src/assets/js/gsap-modules/pinned-panels.js +105 -0
  19. package/project-template/src/assets/js/gsap-modules/scroll-to.js +54 -0
  20. package/project-template/src/assets/js/gsap-modules/swipe-slider.js +121 -0
  21. package/project-template/src/assets/js/gsap-modules/text-mask.js +93 -0
  22. package/project-template/src/assets/js/gsap-modules/tilt.js +70 -0
  23. package/project-template/src/assets/js/main.js +302 -0
  24. package/project-template/src/assets/js/uikit-components.js +18171 -0
  25. package/project-template/src/assets/scss/_base.scss +140 -0
  26. package/project-template/src/assets/scss/_components.scss +165 -0
  27. package/project-template/src/assets/scss/_config.scss +13 -0
  28. package/project-template/src/assets/scss/_functions.scss +81 -0
  29. package/project-template/src/assets/scss/_tokens.scss +229 -0
  30. package/project-template/src/assets/scss/_transitions.scss +36 -0
  31. package/project-template/src/assets/scss/_uikit-overrides.scss +187 -0
  32. package/project-template/src/assets/scss/_uikit_dynamic.scss +43 -0
  33. package/project-template/src/assets/scss/_utilities.scss +31 -0
  34. package/project-template/src/assets/scss/custom.scss +10 -0
  35. package/project-template/src/assets/scss/main.scss +11 -0
  36. package/project-template/src/assets/static/fonts/squeditor-icons/squeditor-icons.eot +0 -0
  37. package/project-template/src/assets/static/fonts/squeditor-icons/squeditor-icons.svg +1183 -0
  38. package/project-template/src/assets/static/fonts/squeditor-icons/squeditor-icons.ttf +0 -0
  39. package/project-template/src/assets/static/fonts/squeditor-icons/squeditor-icons.woff +0 -0
  40. package/project-template/src/config/site-config.php +34 -0
  41. package/project-template/src/data/blog.php +21 -0
  42. package/project-template/src/data/portfolio.php +23 -0
  43. package/project-template/src/data/team.php +23 -0
  44. package/project-template/src/index.php +57 -0
  45. package/project-template/src/init.php +19 -0
  46. package/project-template/src/page-templates/base.php +39 -0
  47. package/project-template/src/page-templates/body-scripts.php +26 -0
  48. package/project-template/src/page-templates/head.php +47 -0
  49. package/project-template/src/page-templates/transition.php +45 -0
  50. package/project-template/src/sections/cards/cards-grid.php +34 -0
  51. package/project-template/src/sections/cards/cards-horizontal.php +28 -0
  52. package/project-template/src/sections/cta/cta-banner.php +34 -0
  53. package/project-template/src/sections/cta/cta-newsletter.php +19 -0
  54. package/project-template/src/sections/footer/layout-01.php +35 -0
  55. package/project-template/src/sections/header/layout-01.php +36 -0
  56. package/project-template/src/sections/hero/hero-centered.php +44 -0
  57. package/project-template/src/sections/hero/hero-split.php +132 -0
  58. package/project-template/src/sections/hero/hero-video.php +22 -0
  59. package/project-template/src/sections/sidebar/sidebar-right.php +11 -0
  60. package/project-template/src/template-parts/breadcrumbs.php +17 -0
  61. package/project-template/src/template-parts/footer.php +74 -0
  62. package/project-template/src/template-parts/header.php +120 -0
  63. package/project-template/src/template-parts/mega-menu.php +7 -0
  64. package/project-template/src/template-parts/nav.php +16 -0
  65. package/project-template/src/template-parts/page-title-bar.php +14 -0
  66. package/project-template/tailwind.config.js +26 -0
  67. package/project-template/vite.config.js +67 -0
  68. package/scripts/build-components.js +109 -0
  69. package/scripts/copy-static.js +150 -0
  70. package/scripts/dev-router.php +23 -0
  71. package/scripts/dev.js +55 -0
  72. package/scripts/get-port.js +27 -0
  73. package/scripts/package-customer.js +278 -0
  74. package/scripts/package-dist.js +54 -0
  75. package/scripts/scaffold.js +72 -0
  76. package/scripts/snapshot.js +74 -0
  77. package/uikit-manifest.json +248 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 UniStudio
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,106 @@
1
+ # ⚡️ Squeditor Framework
2
+
3
+ **Squeditor Framework** is a high-performance, developer-first framework for building lightning-fast, static websites. It combines the power of **PHP-style templating** with the modern performance of **Tailwind CSS**, the interactivity of **UIKit 3**, and the speed of **Vite**.
4
+
5
+ > [!IMPORTANT]
6
+ > Squeditor Framework is NOT a WordPress theme framework or a CMS. It is a build-time framework that uses PHP for development and outputs 100% flat, portable HTML/CSS/JS for production and compatible with Squeditor, Elementor, Gutenberg, and other page builders.
7
+
8
+ ## 🚀 Key Features
9
+
10
+ ### 🛠 Zero-Runtime PHP Templating
11
+ Develop using familiar WordPress-style functions like `get_template_part()` and `get_section()`, use PHP arrays as your data layer, and leverage loops to build complex layouts. The production build "snaps" everything into pure HTML, requiring zero server-side processing.
12
+
13
+ ### 🧩 Selective UIKit 3 Integration
14
+ Stop loading massive component libraries. Squeditor Framework uses a **Component Manifest System** (via `uikit-manifest.json`) to tree-shake UIKit. Use only what you need (like a Slider or Modal) and Squeditor Framework will automatically bundle just the necessary SCSS and JS.
15
+
16
+ ### 🎨 Token-Based Styling Architecture
17
+ Fully themeable via a centralized Design Token system (`_tokens.scss`). Every component and layout utility consumes CSS Custom Properties (`--sq-*`), allowing you to swap entire visual identities or color schemas (Light/Dark) instantly across the site.
18
+
19
+ ### 🌓 Built-in Light/Dark Mode
20
+ Native support for `sq-theme-dark` classes and Tailwind's `dark:` utilities. The framework detects schema settings from the environment (or URL) and applies them globally to the body, ensuring a seamless and premium dark mode experience.
21
+
22
+ ### 📚 Section-Based Workflow
23
+ Build pages in minutes using a library of pre-built, token-aware section variants:
24
+ - **Hero**: Video, Split, Centered
25
+ - **Cards**: Grids, Horizontal, Feature lists
26
+ - **CTA**: Split, Banner, In-line
27
+ - **Global**: Responsive Header, Deep-linked Footer
28
+
29
+ ### 📖 Automatic Style Guide
30
+ Every project includes an automatically generated `style-guide.php` page that renders every active component and its variants, serving as your project's living documentation.
31
+
32
+ ---
33
+
34
+ ## 🏗 Project Architecture
35
+
36
+ ```bash
37
+ [workspace-root]/
38
+ ├── php/ # 🏗 CORE - PHP framework helpers
39
+ ├── scripts/ # 🏗 CORE - Build and dev scripts
40
+ ├── project-template/ # 🚀 STARTER - Blank project generator
41
+ └── showcase/ # 💎 DEMO - Full-featured example project
42
+ ```
43
+
44
+ ---
45
+
46
+ ## 🏁 Getting Started
47
+
48
+ ### 1. Installation
49
+ Clone the repository into your desired workspace folder. This folder will house both the framework and your generated projects:
50
+ ```bash
51
+ git clone https://github.com/unistudioco/squeditor-framework.git
52
+ ```
53
+
54
+ ### 2. Scaffold a New Project
55
+ Squeditor includes a robust CLI scaffolding tool. It generates a completely clean, minimalist `project-template/` instance next to the core framework, fully pre-configured to utilize the advanced GSAP and UIKit engines without demo bloat.
56
+
57
+ To scaffold your new project as a sibling to the framework directory, run the following command from your workspace root (outside `squeditor-framework`):
58
+ ```bash
59
+ npx squeditor-framework your-project-name
60
+ ```
61
+
62
+ ### 3. Development
63
+ Navigate into your newly generated project folder, install its dependencies, and start the development server:
64
+ ```bash
65
+ cd your-project-name
66
+ npm install
67
+ npm run dev
68
+ ```
69
+
70
+ > [!CAUTION]
71
+ > **Use Port 3001 for Development**
72
+ > Vite will show a link to `http://127.0.0.1:5173/` in your terminal. **Do not use that link.**
73
+ > Instead, always visit the PHP Server address: **`http://127.0.0.1:3001`**. This is because Squeditor Framework uses PHP for template rendering, and Vite only serves the static assets.
74
+
75
+ ### 4. Build for Production
76
+ Generate the static `dist/` folder and a distributable ZIP archive:
77
+ ```bash
78
+ npm run build
79
+ ```
80
+
81
+ ---
82
+
83
+ ## 🛠 Technology Stack
84
+
85
+ - **Dev Engine**: PHP 8.2+ (as a templating pre-processor)
86
+ - **CSS Architecture**: Tailwind CSS + SCSS (Layered Overrides)
87
+ - **JS Interactivity**: UIKit 3 (Selective Component Bundling)
88
+ - **Bundler**: Vite 5
89
+ - **Static Generation**: Custom Snapshot Engine
90
+ - **Deployment**: Integrated Netlify/Vercel support
91
+
92
+ ---
93
+
94
+ ## 🤝 Contributing
95
+
96
+ We welcome contributions! Whether it's adding new section variants, improving the build pipeline, or refining the token system, feel free to open a PR.
97
+
98
+ ---
99
+
100
+ ## 📄 License
101
+
102
+ Squeditor Framework is released under the [MIT License](LICENSE).
103
+
104
+ ---
105
+
106
+ Built with ❤️ by **Expert Developers** for the modern web.
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@squeditor/squeditor-framework",
3
+ "version": "1.0.0",
4
+ "description": "Squeditor Framework is a high-performance, developer-first framework for building lightning-fast, static websites. It combines the power of PHP-style templating with the modern performance of Tailwind CSS, the interactivity of UIKit 3, and the speed of Vite.",
5
+ "main": "index.js",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "scripts": {
10
+ "test": "echo \"Error: no test specified\" && exit 1"
11
+ },
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/unistudioco/squeditor-framework.git"
15
+ },
16
+ "keywords": [
17
+ "squeditor",
18
+ "framework",
19
+ "static",
20
+ "php",
21
+ "tailwind",
22
+ "uikit",
23
+ "vite",
24
+ "gsap"
25
+ ],
26
+ "author": "unistudio.co",
27
+ "license": "MIT",
28
+ "type": "commonjs",
29
+ "bugs": {
30
+ "url": "https://github.com/unistudioco/squeditor-framework/issues"
31
+ },
32
+ "homepage": "https://github.com/unistudioco/squeditor-framework#readme",
33
+ "bin": {
34
+ "squeditor": "./scripts/scaffold.js"
35
+ }
36
+ }
@@ -0,0 +1,92 @@
1
+ <?php
2
+ // php/functions.php
3
+
4
+ /**
5
+ * Include a template part from the template-parts/ directory.
6
+ * Equivalent to WordPress get_template_part().
7
+ *
8
+ * @param string $slug Folder/file slug, e.g. 'header', 'nav', 'sections/hero/hero-centered'
9
+ * @param array $args Optional associative array passed as $args inside the partial
10
+ */
11
+ function get_template_part(string $slug, array $args = []): void {
12
+ $path = SRC_PATH . '/template-parts/' . $slug . '.php';
13
+ if (!file_exists($path)) {
14
+ trigger_error("Template part not found: {$path}", E_USER_WARNING);
15
+ return;
16
+ }
17
+ extract($GLOBALS, EXTR_SKIP);
18
+ global $site;
19
+ if (!empty($args)) {
20
+ extract($args, EXTR_SKIP);
21
+ }
22
+ include $path;
23
+ }
24
+
25
+ /**
26
+ * Include a UIKit3 component partial from the components/ directory.
27
+ *
28
+ * @param string $component Component name, e.g. 'accordion', 'modal'
29
+ * @param array $args Data to pass into the component
30
+ */
31
+ function get_component(string $component, array $args = []): void {
32
+ $path = SRC_PATH . '/components/' . $component . '.php';
33
+ if (!file_exists($path)) {
34
+ trigger_error("Component not found: {$path}", E_USER_WARNING);
35
+ return;
36
+ }
37
+ extract($GLOBALS, EXTR_SKIP);
38
+ if (!empty($args)) {
39
+ extract($args, EXTR_SKIP);
40
+ }
41
+ include $path;
42
+ }
43
+
44
+ /**
45
+ * Include a section variant.
46
+ *
47
+ * @param string $section Path within sections/, e.g. 'hero/hero-centered'
48
+ * @param array $args
49
+ */
50
+ function get_section(string $section, array $args = []): void {
51
+ $path = SRC_PATH . '/sections/' . $section . '.php';
52
+ if (!file_exists($path)) {
53
+ trigger_error("Section not found: {$path}", E_USER_WARNING);
54
+ return;
55
+ }
56
+ extract($GLOBALS, EXTR_SKIP);
57
+ if (!empty($args)) {
58
+ extract($args, EXTR_SKIP);
59
+ }
60
+ include $path;
61
+ }
62
+
63
+ /**
64
+ * Parse frontmatter from a PHP page file.
65
+ * Frontmatter is a PHP comment block at the very top of a page file.
66
+ *
67
+ * Format inside page files:
68
+ * <?php
69
+ * /*|
70
+ * title: About Us
71
+ * description: Learn about our team
72
+ * og_image: /assets/static/images/og-about.jpg
73
+ * |*\/
74
+ *
75
+ * @param string $file Absolute path to the PHP page file
76
+ * @return array Associative array of frontmatter values
77
+ */
78
+ function parse_frontmatter(string $file): array {
79
+ $content = file_get_contents($file);
80
+ if (preg_match('/\/\*\|(.*?)\|\*\//s', $content, $matches)) {
81
+ $lines = explode("\n", trim($matches[1]));
82
+ $data = [];
83
+ foreach ($lines as $line) {
84
+ if (str_contains($line, ':')) {
85
+ [$key, $value] = explode(':', $line, 2);
86
+ $data[trim($key)] = trim($value);
87
+ }
88
+ }
89
+ return $data;
90
+ }
91
+ return [];
92
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "my-project-name",
3
+ "private": true,
4
+ "scripts": {
5
+ "dev": "node ../squeditor-framework/scripts/dev.js",
6
+ "build:css": "node ../squeditor-framework/scripts/build-components.js && vite build && node ../squeditor-framework/scripts/copy-static.js",
7
+ "build:snap": "node ../squeditor-framework/scripts/snapshot.js",
8
+ "build:zip": "node ../squeditor-framework/scripts/package-dist.js && node ../squeditor-framework/scripts/package-customer.js",
9
+ "build": "npm run build:css && npm run build:snap && npm run build:zip",
10
+ "preview:netlify": "netlify deploy --dir=dist",
11
+ "preview:vercel": "vercel dist --yes"
12
+ },
13
+ "dependencies": {
14
+ "gsap": "^3.13.0",
15
+ "uikit": "^3.21.0"
16
+ },
17
+ "devDependencies": {
18
+ "archiver": "^6.0.0",
19
+ "autoprefixer": "^10.4.0",
20
+ "concurrently": "^8.0.0",
21
+ "fluent-ffmpeg": "^2.1.3",
22
+ "micromatch": "^4.0.8",
23
+ "prettier": "^3.8.1",
24
+ "sass": "^1.70.0",
25
+ "sharp": "^0.34.5",
26
+ "tailwindcss": "^3.4.0",
27
+ "vite": "^5.0.0"
28
+ }
29
+ }
@@ -0,0 +1,6 @@
1
+ module.exports = {
2
+ plugins: {
3
+ tailwindcss: {},
4
+ autoprefixer: {},
5
+ }
6
+ }
@@ -0,0 +1,81 @@
1
+ // showcase/squeditor.config.js
2
+ module.exports = {
3
+ framework: '../squeditor-framework',
4
+ name: 'my-project-name',
5
+ version: '1.0.0',
6
+ components: [
7
+ 'sticky',
8
+ 'utility',
9
+ 'grid',
10
+ 'nav',
11
+ 'navbar',
12
+ 'icon',
13
+ 'slidenav',
14
+ 'modal',
15
+ 'close',
16
+ 'accordion',
17
+ 'tabs',
18
+ 'switcher',
19
+ 'offcanvas',
20
+ 'drop',
21
+ 'dropbar',
22
+ 'dropnav',
23
+ 'dropdown',
24
+ 'tooltip',
25
+ 'notification',
26
+ 'pagination',
27
+ 'dotnav',
28
+ 'slideshow',
29
+ 'slider',
30
+ 'lightbox',
31
+ 'animation',
32
+ 'visibility',
33
+ 'width',
34
+ 'height',
35
+ 'position',
36
+ 'cover',
37
+ 'parallax',
38
+ 'scrollspy',
39
+ 'transition',
40
+ 'spinner',
41
+ 'inverse',
42
+ 'svg',
43
+ 'video',
44
+ 'iframe',
45
+ ],
46
+ gsap: {
47
+ plugins: ['ScrollTrigger', 'SplitText', 'Flip', 'Observer'],
48
+ initScript: 'src/assets/js/gsap-init.js',
49
+ advancedScript: 'src/assets/js/gsap-advanced.js',
50
+ },
51
+ output: {
52
+ css: 'src/assets/css',
53
+ js: 'src/assets/js',
54
+ },
55
+ devServer: { port: 3001, root: 'src' },
56
+ snapshot: {
57
+ baseUrl: 'http://127.0.0.1:3001',
58
+ pages: ['/', '/404.php'],
59
+ outputDir: 'dist',
60
+ rewriteExtension: true,
61
+ },
62
+ media: {
63
+ optimize: {
64
+ enabled: true,
65
+ imageQuality: 80,
66
+ videoQuality: 28, // CRF (Lower is better, 23-28 is standard)
67
+ include: ['**/*.{jpg,jpeg,png,webp,gif,mp4,webm}'],
68
+ exclude: []
69
+ },
70
+ blur: {
71
+ enabled: true,
72
+ amount: 20,
73
+ include: ['**/*.{jpg,jpeg,png,webp}', '**/*.{mp4,webm}'],
74
+ exclude: ['**/logos/**', '**/icons/**', '**/placeholder.png']
75
+ }
76
+ },
77
+ dist: {
78
+ zipName: 'my-project-name.zip',
79
+ previewPlatform: 'netlify',
80
+ },
81
+ };
@@ -0,0 +1,21 @@
1
+ <?php
2
+ require_once __DIR__ . '/init.php';
3
+ /*|
4
+ title: Page Not Found
5
+ |*/
6
+ $page_title = '404 - Not Found';
7
+ $body_class = 'page-404';
8
+
9
+ ob_start();
10
+ ?>
11
+ <section class="h-[75vh] flex items-center justify-center text-center">
12
+ <div>
13
+ <h1 class="text-9xl font-bold mb-4 opacity-20">404</h1>
14
+ <h2 class="text-3xl font-bold mb-6">Page Not Found</h2>
15
+ <p class="mb-8">The page you are looking for does not exist.</p>
16
+ <a href="index.html" class="btn btn-secondary !h-10 px-10 rounded-full">Return Home</a>
17
+ </div>
18
+ </section>
19
+ <?php
20
+ $content = ob_get_clean();
21
+ require __DIR__ . '/page-templates/base.php';