Skip to content

Commit

Permalink
Organize View module
Browse files Browse the repository at this point in the history
  • Loading branch information
eliot-akira committed Oct 24, 2024
1 parent 68e5bff commit 56edb18
Show file tree
Hide file tree
Showing 67 changed files with 35 additions and 35 deletions.
4 changes: 2 additions & 2 deletions admin/settings/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@
],

[
'name' => 'builder',
'name' => 'view',
'field_type' => 'checkbox',
'label' => 'Builder: Integrated authoring environment for all template types - See <i>Tangible -> Builder</i>',
'label' => 'View: Integrated authoring environment for all template types - See <i>Tangible -> View</i>',
'default_value' => false,
'beta' => true,
'reload' => true,
Expand Down
8 changes: 0 additions & 8 deletions builder/readme.md

This file was deleted.

2 changes: 1 addition & 1 deletion core.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class template_system {
// Features that depend on above modules

require_once __DIR__ . '/admin/index.php';
require_once __DIR__ . '/builder/index.php';
require_once __DIR__ . '/editor/index.php';
require_once __DIR__ . '/content/index.php';
require_once __DIR__ . '/form/index.php';
require_once __DIR__ . '/view/index.php';
4 changes: 2 additions & 2 deletions elandel/.gitrepo
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
; git-subrepo command. See https://github.com/ingydotnet/git-subrepo#readme
;
[subrepo]
remote = [email protected]:tangibleinc/elandel
branch = master
remote = [email protected]:expreva/elandel
branch = main
commit = 1f5b8641761692258cc46bcfee7b7fb5d6c956cc
method = merge
cmdver = 0.4.6
Expand Down
12 changes: 6 additions & 6 deletions builder/admin.php → view/admin.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace tangible\template_system\builder;
namespace tangible\template_system\view;

use tangible\framework;
use tangible\template_system;
Expand All @@ -8,21 +8,21 @@
* Optional for now
* @see /admin/settings
*/
if (!template_system\get_settings('builder')) return;
if (!template_system\get_settings('view')) return;

// Remove any notifications that disrupt the IDE screen styling
add_action('in_admin_header', function () {
$screen = get_current_screen();
if (!empty($screen) && $screen->base==='tangible_page_tangible-builder') {
if (!empty($screen) && $screen->base==='tangible_page_tangible-view') {
remove_all_actions('admin_notices');
remove_all_actions('all_admin_notices');
}
}, 999);

framework\register_admin_menu([
'name' => 'tangible-builder',
'title' => 'Builder',
'name' => 'tangible-view',
'title' => 'View',
'capability' => 'manage_options',
'callback' => 'tangible\\template_system\\builder\\load',
'callback' => 'tangible\\template_system\\view\\load', // See ./enqueue
'position' => 50, // After template post types
]);
File renamed without changes.
File renamed without changes.
20 changes: 10 additions & 10 deletions builder/enqueue.php → view/enqueue.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?php
namespace tangible\template_system\builder;
namespace tangible\template_system\view;

use tangible\framework;
use tangible\template_system;
use tangible\template_system\editor;
use tangible\template_system\builder;
use tangible\template_system\view;

function load() {

builder\enqueue();
view\enqueue();

?><div id="tangible-template-system-builder"></div><?php
?><div id="tangible-template-system-view"></div><?php

// Remove admin page footer
add_filter('admin_footer_text', '__return_false'); // Left
Expand All @@ -21,12 +21,12 @@ function enqueue() {

editor\enqueue_editor();

$url = builder::$state->url;
$version = builder::$state->version;
$url = view::$state->url;
$version = view::$state->version;

wp_enqueue_script(
'tangible-template-system-builder',
$url . '/build/builder.min.js',
'tangible-template-system-view',
$url . '/build/view.min.js',
[
// 'tangible-ajax', // TODO: Replace with new REST Client module
'tangible-module-loader',
Expand All @@ -38,8 +38,8 @@ function enqueue() {
);

wp_enqueue_style(
'tangible-template-system-builder',
$url . '/build/builder.min.css',
'tangible-template-system-view',
$url . '/build/view.min.css',
[],
$version
);
Expand Down
8 changes: 4 additions & 4 deletions builder/index.php → view/index.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php
/**
* Builder - Unified interface to edit and manage all template types, libraries, assets.
* View - Unified interface to edit and manage all template types, libraries, assets.
*/
namespace tangible\template_system;

use tangible\template_system;
use tangible\template_system\builder;
use tangible\template_system\view;

class builder {
class view {
static $state;
}

builder::$state = (object) [
view::$state = (object) [
'version' => template_system::$state->version,
'url' => untrailingslashit( plugins_url('/', __FILE__) ),
];
Expand Down
8 changes: 8 additions & 0 deletions view/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# View

The View module is an integrated development environment (IDE), a unified interface to edit and manage all template types - layouts, scripts, styles, assets, libraries. It aims to bring together admin features into one place, instead of separate screens.

- React mini-application
- API to manage templates, local and cloud libraries
- Template archive and edit screens
- Support new template type `view` that is stored in a custom database table
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions builder/tangible.config.js → view/tangible.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ export default {
// IDE: Integrated development environment for Template, Style, Script
{
src: 'src/index.tsx',
dest: 'build/builder.min.js',
dest: 'build/view.min.js',
react: 'wp'
},
{
src: 'src/index.scss',
dest: 'build/builder.min.css'
dest: 'build/view.min.css'
},
],
format: ['**/*.{php,js,ts,jsx,tsx,json,scss}', '!build'],
Expand Down

0 comments on commit 56edb18

Please sign in to comment.