Plugin Directory

Changeset 3196946


Ignore:
Timestamp:
11/25/2024 10:50:35 PM (16 months ago)
Author:
EdwardBock
Message:

release 2.5.0

Location:
headless
Files:
2 added
3 deleted
33 edited
61 copied

Legend:

Unmodified
Added
Removed
  • headless/tags/2.5.0/README.txt

    r3072776 r3196946  
    44Tags: gutenberg, block, developer, utils
    55Requires at least: 5.0
    6 Tested up to: 6.5.2
     6Tested up to: 6.6.2
    77Requires PHP: 8.0
    88Stable tag: 2.2.4
     
    2727
    2828== Changelog ==
     29
     30= 2.3.0 =
     31* Feature: Revalidate feature can be deactivated via hook
     32* Feature: Preview feature can be deactivated via hook
     33* Update: NPM Packages
    2934
    3035= 2.2.4 =
  • headless/tags/2.5.0/classes/Ajax.php

    r3060628 r3196946  
    1313    const GET_POST_ID = "post_id";
    1414
    15     public function onCreate() {
     15    public function onCreate(): void {
    1616        parent::onCreate();
    1717        add_action('wp_ajax_'.self::GET_ACTION, [$this, 'revalidate']);
  • headless/tags/2.5.0/classes/Components/Assets.php

    r2766747 r3196946  
    44namespace Palasthotel\WordPress\Headless\Components;
    55
    6 /**
    7  * Class Assets
    8  * @property Plugin plugin
    9  * @version 0.1.2
    10  */
    116class Assets {
    127
    13     public function __construct( Plugin $plugin ) {
     8    private Plugin $plugin;
     9
     10    public function __construct(Plugin $plugin) {
    1411        $this->plugin = $plugin;
    1512    }
    1613
    17     public function registerStyle( string $handle, string $pluginPathToFile, array $dependencies = [], string $media = 'all' ): bool {
     14    public function registerStyle(string $handle, string $pluginPathToFile, array $dependencies = [], string $media = 'all'): bool {
    1815        $filePath = $this->plugin->path . $pluginPathToFile;
    19         $fileUrl  = $this->plugin->url . $pluginPathToFile;
    20         if ( ! file_exists( $filePath ) ) {
    21             error_log( "Style file does not exist: $filePath" );
     16        $fileUrl = $this->plugin->url . $pluginPathToFile;
     17        if (!file_exists($filePath)) {
     18            error_log("Style file does not exist: $filePath");
    2219
    2320            return false;
    2421        }
    2522
    26         return wp_register_style( $handle, $fileUrl, $dependencies, filemtime( $filePath ), $media );
     23        return wp_register_style($handle, $fileUrl, $dependencies, filemtime($filePath), $media);
    2724
    2825    }
    2926
    30     public function registerScript( string $handle, string $pluginPathToFile, array $dependencies = [], bool $footer = true ): bool {
     27    public function registerScript(string $handle, string $pluginPathToFile, array $dependencies = [], bool $footer = true): bool {
    3128        $filePath = $this->plugin->path . $pluginPathToFile;
    32         if ( ! file_exists( $filePath ) ) {
    33             error_log( "Script file does not exist: $filePath" );
     29        if (!file_exists($filePath)) {
     30            error_log("Script file does not exist: $filePath");
    3431
    3532            return false;
    3633        }
    3734        $assetsFilePath = "";
    38         if ( $this->endsWithJS( $filePath ) ) {
    39             $assetsFilePath = str_replace( ".js", ".asset.php", $filePath );
     35        if ($this->endsWithJS($filePath)) {
     36            $assetsFilePath = str_replace(".js", ".asset.php", $filePath);
    4037        }
    41         if ( ! empty( $assetsFilePath ) && file_exists( $assetsFilePath ) ) {
     38        if (!empty($assetsFilePath) && file_exists($assetsFilePath)) {
    4239            $info = include $assetsFilePath;
    4340        } else {
    4441            $info["dependencies"] = [];
    45             $info["version"]      = filemtime( $filePath );
     42            $info["version"] = filemtime($filePath);
    4643        }
    4744
     
    4946            $handle,
    5047            $this->plugin->url . $pluginPathToFile,
    51             array_merge( $info["dependencies"], $dependencies ),
     48            array_merge($info["dependencies"], $dependencies),
    5249            $info["version"],
    5350            $footer
     
    5653    }
    5754
    58     private function endsWithJS( $haystack ): bool {
    59         $length = strlen( ".js" );
    60         if ( ! $length ) {
     55    private function endsWithJS($haystack): bool {
     56        $length = strlen(".js");
     57        if (!$length) {
    6158            return true;
    6259        }
    6360
    64         return substr( $haystack, - $length ) === ".js";
     61        return substr($haystack, -$length) === ".js";
    6562    }
    6663}
  • headless/tags/2.5.0/classes/Components/Component.php

    r2730402 r3196946  
    44namespace Palasthotel\WordPress\Headless\Components;
    55
    6 /**
    7  * Class Component
    8  *
    9  * @property \Palasthotel\WordPress\Headless\Plugin plugin
    10  *
    11  * @package Palasthotel\WordPress
    12  * @version 0.1.2
    13  */
    146abstract class Component {
    15     /**
    16      * _Component constructor.
    17      *
    18      * @param \Palasthotel\WordPress\Headless\Plugin $plugin
    19      */
    20     public function __construct(Plugin $plugin) {
    21         $this->plugin = $plugin;
     7
     8    public function __construct(
     9        public \Palasthotel\WordPress\Headless\Plugin $plugin
     10    ) {
    2211        $this->onCreate();
    2312    }
     
    2615     * overwrite this method in component implementations
    2716     */
    28     public function onCreate(){
     17    public function onCreate(): void {
    2918        // init your hooks and stuff
    3019    }
  • headless/tags/2.5.0/classes/Components/Database.php

    r2766747 r3196946  
    66use wpdb;
    77
    8 /**
    9  * @property wpdb wpdb
    10  * @version 0.1.1
    11  */
    128abstract class Database {
     9
     10    protected wpdb $wpdb;
    1311
    1412    public function __construct() {
     
    2119     * initialize table names and other properties
    2220     */
    23     abstract function init();
    24    
    25     public function createTables(){
     21    abstract function init(): void;
     22
     23    public function createTables(): void {
    2624        require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
    2725    }
  • headless/tags/2.5.0/classes/Components/Plugin.php

    r2730402 r3196946  
    66use ReflectionException;
    77
    8 /**
    9  * @property string path
    10  * @property string url
    11  * @property string basename
    12  * @version 0.1.3
    13  */
    148abstract class Plugin {
    159
     
    1812     */
    1913    private $ref;
    20 
    2114    private $tooLateForTextdomain;
     15    public $path;
     16    public $url;
     17    public $basename;
    2218
    2319    /**
     
    3430        $this->tooLateForTextdomain = true;
    3531
    36         register_activation_hook( $this->ref->getFileName(), array( $this, "onActivation" ) );
    37         register_deactivation_hook( $this->ref->getFileName(), array( $this, "onDeactivation" ) );
     32        register_activation_hook( $this->ref->getFileName(), [$this, "onActivation"]);
     33        register_deactivation_hook( $this->ref->getFileName(), [$this, "onDeactivation"]);
    3834
    3935    }
     
    8076                $domain,
    8177                false,
    82                 dirname( plugin_basename( $this->ref->getFileName() ) ) . "/" . $relativeLanguagesPath
     78                dirname(plugin_basename($this->ref->getFileName())) . "Plugin.php/" . $relativeLanguagesPath
    8379            );
    8480        } );
     
    8884        if ( function_exists( 'is_multisite' ) && is_multisite() ) {
    8985            $network_site = get_network()->site_id;
    90             $args         = array( 'fields' => 'ids' );
     86            $args         = ['fields' => 'ids'];
    9187            $site_ids     = get_sites( $args );
    9288
  • headless/tags/2.5.0/classes/Dashboard.php

    r3060628 r3196946  
    44
    55class Dashboard extends Components\Component {
    6     public function onCreate() {
     6    public function onCreate(): void {
    77        parent::onCreate();
    88        add_action('wp_dashboard_setup', [$this, 'setup']);
     
    1212        if(!current_user_can('edit_posts')) return;
    1313
    14         wp_add_dashboard_widget(
    15             Plugin::DOMAIN,
    16             __("Headless", Plugin::DOMAIN),
    17             array($this, 'render')
    18         );
     14        if($this->plugin->revalidate->isRevalidationActive()){
     15            wp_add_dashboard_widget(
     16                Plugin::DOMAIN,
     17                __("Headless", Plugin::DOMAIN),
     18                array($this, 'render')
     19            );
     20        }
    1921    }
    2022
  • headless/tags/2.5.0/classes/Extensions.php

    r2791162 r3196946  
    3333    private TermRouteExtensions $termRouteExtensions;
    3434
    35     public function onCreate() {
     35    public function onCreate(): void {
    3636        parent::onCreate();
    3737
  • headless/tags/2.5.0/classes/Headers.php

    r2791162 r3196946  
    44
    55class Headers extends Components\Component {
    6     public function onCreate() {
     6    public function onCreate(): void {
    77        parent::onCreate();
    88        add_filter('rest_post_dispatch', [$this, 'rest_post_dispatch']);
  • headless/tags/2.5.0/classes/Log.php

    r2901812 r3196946  
    99    private $log;
    1010
    11     public function onCreate() {
     11    public function onCreate(): void {
    1212        parent::onCreate();
    1313        add_action("cron_logger_init", function(\CronLogger\Plugin $logger){
  • headless/tags/2.5.0/classes/Migration.php

    r2977228 r3196946  
    1414    }
    1515
    16     public function onCreate() {
     16    public function onCreate(): void {
    1717        parent::onCreate();
    1818
     
    2020            // drop every table that was created before version 3
    2121            $tableName = $this->plugin->dbRevalidation->table;
    22             $this->plugin->dbRevalidation->wpdb->query("DROP TABLE IF EXISTS $tableName");
     22            global $wpdb;
     23            $wpdb->query("DROP TABLE IF EXISTS $tableName");
    2324            $this->plugin->dbRevalidation->createTables();
    2425            $this->setSchemaVersion(3);
  • headless/tags/2.5.0/classes/PluginAssets.php

    r2901812 r3196946  
    66use Palasthotel\WordPress\Headless\Components\Component;
    77
    8 /**
    9  * @property Assets $assets
    10  */
    118class PluginAssets extends Component {
    129
     
    1512    const HANDLE_GUTENBERG_STYLE = "headless_gutenberg_styles";
    1613
    17     public function onCreate() {
     14    public Assets $assets;
     15
     16    public function onCreate(): void {
    1817        parent::onCreate();
    1918
     
    6059                "HeadlessAdmin",
    6160                [
     61                    "revalidate_is_active" => $this->plugin->revalidate->isRevalidationActive(),
     62                    "preview_is_active" => $this->plugin->preview->isPreviewActive(),
    6263                    "preview_path" => $this->plugin->preview->getHeadlessPreviewPath(),
    6364                    "frontends" => array_map(function($frontend){
  • headless/tags/2.5.0/classes/Post.php

    r2868064 r3196946  
    88
    99class Post extends Component {
    10     public function onCreate() {
     10    public function onCreate(): void {
    1111        parent::onCreate();
    1212        add_filter( Plugin::FILTER_PREPARE_POST, [ $this, 'prepare_post' ], 10, 2 );
  • headless/tags/2.5.0/classes/Preview.php

    r2901812 r3196946  
    1010    const POST_ID_PLACEHOLDER = "{{post_id}}";
    1111
    12     public function onCreate() {
     12    public function onCreate(): void {
    1313        parent::onCreate();
    1414
     
    1616        add_action( 'wp_ajax_headless_preview', [ $this, 'admin_preview' ] );
    1717        add_action( 'wp_ajax_nopriv_headless_preview', [ $this, 'no_permission' ] );
     18        add_action( 'plugins_loaded', [ $this, 'plugins_loaded' ] );
    1819    }
     20
     21
    1922
    2023    public function getRedirectLink( $id ) {
     
    8184    }
    8285
     86    public function plugins_loaded() {
     87        remove_filter( 'preview_post_link', [ $this, 'preview_post_link' ] );
     88        remove_action( 'wp_ajax_headless_preview', [ $this, 'admin_preview' ] );
     89        remove_action( 'wp_ajax_nopriv_headless_preview', [ $this, 'no_permission' ] );
     90    }
     91
     92    function isPreviewInactive() {
     93        return !$this->isPreviewActive();
     94    }
     95    function isPreviewActive() {
     96        return apply_filters(Plugin::FILTER_PREVIEW_IS_ACTIVE, true);
     97    }
    8398
    8499}
  • headless/tags/2.5.0/classes/Query.php

    r3060647 r3196946  
    1515    const POST_TYPE = "hl_post_type";
    1616
    17     public function onCreate() {
     17    public function onCreate(): void {
    1818        parent::onCreate();
    1919
  • headless/tags/2.5.0/classes/Revalidate.php

    r3060628 r3196946  
    88class Revalidate extends Component {
    99
    10     public function onCreate() {
     10    public function onCreate(): void {
    1111        parent::onCreate();
    1212        add_action('save_post', [$this, 'on_post_change']);
     
    1616
    1717    public function on_post_change($post_id){
     18        if($this->isRevalidationInactive()) return;
    1819        if(wp_is_post_revision($post_id)) return;
    1920        $this->plugin->dbRevalidation->addPost($post_id);
     
    2122
    2223    public function on_comment_change($comment_id){
     24        if($this->isRevalidationInactive()) return;
    2325        $comment = get_comment($comment_id);
    2426        $this->plugin->dbRevalidation->addPost($comment->comment_post_ID);
     
    2729
    2830    function revalidateComments($post_id){
     31
     32        if($this->isRevalidationInactive()) return[];
     33
    2934        $frontends = $this->plugin->headquarter->getFrontends();
    3035        $results = [];
     
    4449     */
    4550    function revalidatePost($post_id) {
     51
     52        if($this->isRevalidationInactive()) return [];
     53
    4654        $frontends = $this->plugin->headquarter->getFrontends();
    4755        $results = [];
     
    5462
    5563    function revalidateByPathByPostId(Frontend $frontend, $post_id) {
     64
     65        if($this->isRevalidationInactive()) return [];
     66
    5667        $permalink = get_permalink($post_id);
    5768        $path = parse_url($permalink, PHP_URL_PATH);
     
    6374
    6475    function revalidateByPath(Frontend $frontend, $path){
     76
     77        if($this->isRevalidationInactive()) return [];
     78
    6579        $baseUrl = $frontend->getBaseUrl();
    6680        $url = untrailingslashit($baseUrl)."/api/revalidate?secret_token=".HEADLESS_SECRET_TOKEN."&path=".urlencode($path);
     
    7185
    7286    function revalidateByTag(Frontend $frontend, string $tag) {
     87
     88        if($this->isRevalidationInactive()) return [];
     89
    7390        $baseUrl = $frontend->getBaseUrl();
    7491        $url = untrailingslashit($baseUrl)."/api/revalidate?secret_token=".HEADLESS_SECRET_TOKEN."&tag=".urlencode($tag);
     
    7996
    8097    private function executeRavalidation($finalUrl){
     98
    8199        $url = add_query_arg('invalidate___cache', time(), $finalUrl);
    82100
     
    94112    }
    95113
     114    function isRevalidationInactive() {
     115        return !$this->isRevalidationActive();
     116    }
     117    function isRevalidationActive() {
     118        return apply_filters(Plugin::FILTER_REVALIDATE_IS_ACTIVE, true);
     119    }
     120
    96121
    97122}
  • headless/tags/2.5.0/classes/Routes.php

    r2730402 r3196946  
    77use Palasthotel\WordPress\Headless\Routes\Settings;
    88
    9 /**
    10  * @property Menus $menus
    11  * @property Settings $settings
    12  */
    139class Routes extends Components\Component {
    1410
    15     public function onCreate() {
     11    public Menus $menus;
     12    public Settings $settings;
     13
     14    public function onCreate(): void {
    1615        parent::onCreate();
    1716        add_action( 'rest_api_init', [ $this, 'rest_api_init' ] );
  • headless/tags/2.5.0/classes/Routes/Menus.php

    r2730402 r3196946  
    88class Menus extends Component {
    99
    10     private $menu;
     10    private array|false $menu;
    1111
    1212    public function init(){
  • headless/tags/2.5.0/classes/Routes/Settings.php

    r2730402 r3196946  
    88class Settings extends Component {
    99
    10     public function init(){
     10    public function init(): void {
    1111        register_rest_route( Plugin::REST_NAMESPACE, '/settings', array(
    1212            'methods'             => \WP_REST_Server::READABLE,
     
    1919    }
    2020
    21     public function get_settings() {
     21    public function get_settings(): array {
    2222        return [
    2323            "front_page" => get_option( 'show_on_front' ),
    24             "page_on_front" => get_option( 'page_on_front' ),
     24            "page_on_front" => intval(get_option( 'page_on_front' )),
    2525            "home_url" => home_url(),
    2626        ];
  • headless/tags/2.5.0/classes/Schedule.php

    r3060628 r3196946  
    77class Schedule extends Component {
    88
    9     public function onCreate() {
     9    public function onCreate(): void {
    1010        parent::onCreate();
    1111
     
    1515
    1616    public function init(){
     17        if($this->plugin->revalidate->isRevalidationInactive()){
     18            $next = $this->getNextSchedule();
     19            if($next){
     20                wp_unschedule_event($next, Plugin::SCHEDULE_REVALIDATE);
     21            }
     22            return;
     23        }
    1724        if(!wp_next_scheduled(Plugin::SCHEDULE_REVALIDATE)){
    1825            wp_schedule_event(time(), 'hourly', Plugin::SCHEDULE_REVALIDATE);
     
    3340
    3441    public function revalidate(){
     42
     43        if($this->plugin->revalidate->isRevalidationInactive()) return;
     44
    3545        $lastRun = $this->getLastRevalidationRun();
    3646        $now = time();
  • headless/tags/2.5.0/classes/Security.php

    r3020918 r3196946  
    77class Security extends Component {
    88
    9     public function onCreate() {
     9    public function onCreate(): void {
    1010        parent::onCreate();
    1111        add_filter('wp_is_application_passwords_available', '__return_true');
  • headless/tags/2.5.0/classes/Store/RevalidationDatabase.php

    r3060628 r3196946  
    77use Palasthotel\WordPress\Headless\Components\Database;
    88
    9 /**
    10  * @property string $table
    11  */
    129class RevalidationDatabase extends Database {
    1310
     
    1512    const TYPE_COMMENT = "comment";
    1613
    17     function init() {
     14    public string $table;
     15
     16    function init(): void {
    1817        $this->table = $this->wpdb->prefix . "headless_revalidate";
    1918    }
     
    104103    }
    105104
    106     public function createTables() {
     105    public function createTables(): void {
    107106        parent::createTables();
    108107        \dbDelta("CREATE TABLE IF NOT EXISTS $this->table
     
    112111             content_type varchar(40) NOT NULL,
    113112             revalidation_state varchar(30),
    114              revalidated_at TIMESTAMP default null,
     113             revalidated_at TIMESTAMP NULL default null,
    115114             primary key (id),
    116115             key (content_id),
  • headless/tags/2.5.0/dist/admin.asset.php

    r3072776 r3196946  
    1 <?php return array('dependencies' => array(), 'version' => 'ecdaf49b7e3ddff3eb2a');
     1<?php return array('dependencies' => array(), 'version' => '8241f02c6df14b01c628');
  • headless/tags/2.5.0/dist/admin.js

    r3072776 r3196946  
    1 !function(){"use strict";window.addEventListener("DOMContentLoaded",(async()=>{await Promise.all(window.HeadlessAdmin.frontends.map((e=>e+window.HeadlessAdmin.preview_path)).map((e=>fetch(e,{credentials:"include"}).then((e=>e.json())))))}))}();
     1(()=>{"use strict";window.addEventListener("DOMContentLoaded",(async()=>{window.HeadlessAdmin.preview_is_active&&await Promise.all(window.HeadlessAdmin.frontends.map((e=>e+window.HeadlessAdmin.preview_path)).map((e=>fetch(e,{credentials:"include"}).then((e=>e.json())))))}))})();
  • headless/tags/2.5.0/dist/gutenberg.asset.php

    r3072776 r3196946  
    1 <?php return array('dependencies' => array('react', 'wp-components', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-plugins'), 'version' => 'a2d2fb477c2bc904a66b');
     1<?php return array('dependencies' => array('react-jsx-runtime', 'wp-components', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-plugins'), 'version' => 'f64387f5a68638e1237e');
  • headless/tags/2.5.0/dist/gutenberg.js

    r3072776 r3196946  
    1 !function(){"use strict";var t=window.wp.plugins,e=window.React,n=window.wp.editPost,s=window.wp.components;var a=window.wp.data,i=window.wp.element;const r=()=>(0,a.useSelect)((t=>t("core/editor").getCurrentPost()),[]),o=({index:t,baseUrl:n,controller:s,onStateChanged:a})=>{const{state:o,reload:l}=(t=>{const[e,n]=(0,i.useState)("idle"),s=r(),a=(0,i.useMemo)((()=>s?.link?new URL(s?.link).pathname:""),[s.link]);return{state:e,reload:()=>{n("loading"),(async()=>{try{const e=await fetch(((t,e)=>window.Headless.ajax+`?action=${window.Headless.actions.revalidate}&frontend=${t}&path=${e}`)(t,a)),s=await e.json();s.success?n("success"):(console.error(s),n("error"))}catch(t){n("error")}})()}}})(t),c=r(),d=(0,i.useMemo)((()=>{const t=c.link,e=new URL(t);return n.replace(/^\/|\/$/g,"")+e.pathname}),[c.link]);return(0,i.useEffect)((()=>{s.add(t,l)}),[t]),(0,i.useEffect)((()=>{a(t,o)}),[o]),(0,e.createElement)("div",{title:d},(0,e.createElement)("a",{href:d,target:"_blank"},"Frontend ",t),"loading"==o&&(0,e.createElement)(e.Fragment,null," 🧹"),"success"==o&&(0,e.createElement)(e.Fragment,null," ✅"),"error"==o&&(0,e.createElement)(e.Fragment,null," 🚨"))};(0,t.registerPlugin)("headless-plugin",{icon:()=>null,render:function(){const t=window.Headless.frontends,a=(0,i.useMemo)((()=>(()=>{const t=new Map;return{add:(e,n)=>{t.set(e,n)},run:()=>{t.forEach((t=>{t()}))}}})()),[]),[l,c]=(0,i.useState)({}),d="publish"==r().status,p=Object.values(l).find((t=>1==t));return(0,e.createElement)(n.PluginDocumentSettingPanel,{title:"Headless"},d?(0,e.createElement)(e.Fragment,null,(0,e.createElement)("ol",null,t.map(((t,n)=>(0,e.createElement)("li",{key:n},(0,e.createElement)(o,{baseUrl:t,index:n,controller:a,onStateChanged:(t,e)=>{c((n=>{const s={...n};return s[t]="loading"==e,s}))}}))))),(0,e.createElement)(s.Button,{variant:"secondary",disabled:p||!d,onClick:()=>{a.run()}},"Revalidate cache")):(0,e.createElement)("p",{className:"description"},"Only published contents can be revalidated."))}}),document.addEventListener("DOMContentLoaded",(function(){const t=(0,a.select)("core/editor"),e=t.getCurrentPostId,n=t.isSavingPost,s=(0,a.dispatch)("core/editor"),i=s.autosave,r=s.savePost,o=document.createElement("a");o.className="components-button",o.addEventListener("click",(e=>{if(e.preventDefault(),n())return;const s=window.open("about:blank",o.target);!function(t){let e="";e+='\n\t\t<style>\n\t\t\tbody {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\theight: 100vh;\n\t\t\t\twidth: 100vw;\n\t\t\t}\n\t\t\t@-webkit-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-moz-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-o-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg {\n\t\t\t\twidth: 192px;\n\t\t\t\theight: 192px;\n\t\t\t\tstroke: #555d66;\n\t\t\t\tstroke-width: 0.75;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg .outer,\n\t\t\t.editor-post-preview-button__interstitial-message svg .inner {\n\t\t\t\tstroke-dasharray: 280;\n\t\t\t\tstroke-dashoffset: 280;\n\t\t\t\t-webkit-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-moz-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-o-animation: paint 1.5s ease infinite alternate;\n\t\t\t\tanimation: paint 1.5s ease infinite alternate;\n\t\t\t}\n\t\t\tp {\n\t\t\t\ttext-align: center;\n\t\t\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;\n\t\t\t}\n\t\t</style>\n\t',e+='\n        <div class="editor-post-preview-button__interstitial-message">\n            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">\n                <path class="outer" d="M48 12c19.9 0 36 16.1 36 36S67.9 84 48 84 12 67.9 12 48s16.1-36 36-36" fill="none" />\n                <path class="inner" d="M69.5 46.4c0-3.9-1.4-6.7-2.6-8.8-1.6-2.6-3.1-4.9-3.1-7.5 0-2.9 2.2-5.7 5.4-5.7h.4C63.9 19.2 56.4 16 48 16c-11.2 0-21 5.7-26.7 14.4h2.1c3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3L40 67.5l7-20.9L42 33c-1.7-.1-3.3-.3-3.3-.3-1.7-.1-1.5-2.7.2-2.6 0 0 5.3.4 8.4.4 3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3l11.5 34.3 3.3-10.4c1.6-4.5 2.4-7.8 2.4-10.5zM16.1 48c0 12.6 7.3 23.5 18 28.7L18.8 35c-1.7 4-2.7 8.4-2.7 13zm32.5 2.8L39 78.6c2.9.8 5.9 1.3 9 1.3 3.7 0 7.3-.6 10.6-1.8-.1-.1-.2-.3-.2-.4l-9.8-26.9zM76.2 36c0 3.2-.6 6.9-2.4 11.4L64 75.6c9.5-5.5 15.9-15.8 15.9-27.6 0-5.5-1.4-10.8-3.9-15.3.1 1 .2 2.1.2 3.3z" fill="none" />\n            </svg>\n            <p>Generating preview…</p>\n        </div>\n    ',t.write('\n\t\t<style>\n\t\t\tbody {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\theight: 100vh;\n\t\t\t\twidth: 100vw;\n\t\t\t}\n\t\t\t@-webkit-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-moz-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-o-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg {\n\t\t\t\twidth: 192px;\n\t\t\t\theight: 192px;\n\t\t\t\tstroke: #555d66;\n\t\t\t\tstroke-width: 0.75;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg .outer,\n\t\t\t.editor-post-preview-button__interstitial-message svg .inner {\n\t\t\t\tstroke-dasharray: 280;\n\t\t\t\tstroke-dashoffset: 280;\n\t\t\t\t-webkit-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-moz-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-o-animation: paint 1.5s ease infinite alternate;\n\t\t\t\tanimation: paint 1.5s ease infinite alternate;\n\t\t\t}\n\t\t\tp {\n\t\t\t\ttext-align: center;\n\t\t\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;\n\t\t\t}\n\t\t</style>\n\t\n        <div class="editor-post-preview-button__interstitial-message">\n            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">\n                <path class="outer" d="M48 12c19.9 0 36 16.1 36 36S67.9 84 48 84 12 67.9 12 48s16.1-36 36-36" fill="none" />\n                <path class="inner" d="M69.5 46.4c0-3.9-1.4-6.7-2.6-8.8-1.6-2.6-3.1-4.9-3.1-7.5 0-2.9 2.2-5.7 5.4-5.7h.4C63.9 19.2 56.4 16 48 16c-11.2 0-21 5.7-26.7 14.4h2.1c3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3L40 67.5l7-20.9L42 33c-1.7-.1-3.3-.3-3.3-.3-1.7-.1-1.5-2.7.2-2.6 0 0 5.3.4 8.4.4 3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3l11.5 34.3 3.3-10.4c1.6-4.5 2.4-7.8 2.4-10.5zM16.1 48c0 12.6 7.3 23.5 18 28.7L18.8 35c-1.7 4-2.7 8.4-2.7 13zm32.5 2.8L39 78.6c2.9.8 5.9 1.3 9 1.3 3.7 0 7.3-.6 10.6-1.8-.1-.1-.2-.3-.2-.4l-9.8-26.9zM76.2 36c0 3.2-.6 6.9-2.4 11.4L64 75.6c9.5-5.5 15.9-15.8 15.9-27.6 0-5.5-1.4-10.8-3.9-15.3.1 1 .2 2.1.2 3.3z" fill="none" />\n            </svg>\n            <p>Generating preview…</p>\n        </div>\n    '),t.close()}(s.document),((()=>{const e=t.getCurrentPost().status;return"draft"==e||"auto-draft"==e})()?r:i)().then((()=>{s.location=o.href}))})),(0,a.subscribe)((()=>{n()?o.classList.add("is-disabled"):o.classList.remove("is-disabled")})),setInterval((function(){const t=e(),n=(t=>window.Headless.preview_url.replace(window.Headless.post_id_placeholder,`${t}`))(t),s=document.querySelectorAll("[target^=wp-preview-]");s&&s.length&&s.forEach((t=>{t.setAttribute("href",n)})),document.querySelectorAll(".components-snackbar-list .components-snackbar__content a.components-button").forEach((e=>{(e.href.includes("?post="+t)||e.href.includes("?page_id="+t)||e.href.includes("?p="+t))&&(e.href=n,e.target="wp-preview-"+t)}));const a=document.querySelectorAll(".components-menu-group");let i=null;if(a.forEach((t=>{t.querySelector(".editor-preview-dropdown__button-external")&&(i=t)})),!i)return;const r="headless-preview-link";if(i.querySelector("#"+r))return;const l=i.querySelector(".editor-preview-dropdown__button-external"),c=l.querySelector("svg"),d=l.getAttribute("target");o.text=l.textContent,o.append(c),o.target=d,o.href=n,o.id=r,l.style.display="none",i.querySelector('[role="group"]').append(o)}),300)}))}();
     1(()=>{"use strict";const t=window.wp.plugins,e=window.wp.editPost,n=window.wp.components,s=window.wp.data,i=window.wp.element,a=()=>(0,s.useSelect)((t=>t("core/editor").getCurrentPost()),[]),r=window.ReactJSXRuntime,o=({index:t,baseUrl:e,controller:n,onStateChanged:s})=>{const{state:o,reload:l}=(t=>{const[e,n]=(0,i.useState)("idle"),s=a(),r=(0,i.useMemo)((()=>s?.link?new URL(s?.link).pathname:""),[s.link]);return{state:e,reload:()=>{n("loading"),(async()=>{try{const e=await fetch(((t,e)=>window.Headless.ajax+`?action=${window.Headless.actions.revalidate}&frontend=${t}&path=${e}`)(t,r)),s=await e.json();s.success?n("success"):(console.error(s),n("error"))}catch(t){n("error")}})()}}})(t),c=a(),d=(0,i.useMemo)((()=>{const t=c.link,n=new URL(t);return e.replace(/^\/|\/$/g,"")+n.pathname}),[c.link]);return(0,i.useEffect)((()=>{n.add(t,l)}),[t]),(0,i.useEffect)((()=>{s(t,o)}),[o]),(0,r.jsxs)("div",{title:d,children:[(0,r.jsxs)("a",{href:d,target:"_blank",children:["Frontend ",t]}),"loading"==o&&(0,r.jsx)(r.Fragment,{children:" 🧹"}),"success"==o&&(0,r.jsx)(r.Fragment,{children:" ✅"}),"error"==o&&(0,r.jsx)(r.Fragment,{children:" 🚨"})]})};window.HeadlessAdmin.revalidate_is_active&&(0,t.registerPlugin)("headless-plugin",{icon:()=>null,render:function(){const t=window.Headless.frontends,s=(0,i.useMemo)((()=>(()=>{const t=new Map;return{add:(e,n)=>{t.set(e,n)},run:()=>{t.forEach((t=>{t()}))}}})()),[]),[l,c]=(0,i.useState)({}),d="publish"==a().status,p=Object.values(l).find((t=>1==t));return(0,r.jsx)(e.PluginDocumentSettingPanel,{title:"Headless",children:d?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("ol",{children:t.map(((t,e)=>(0,r.jsx)("li",{children:(0,r.jsx)(o,{baseUrl:t,index:e,controller:s,onStateChanged:(t,e)=>{c((n=>{const s={...n};return s[t]="loading"==e,s}))}})},e)))}),(0,r.jsx)(n.Button,{variant:"secondary",disabled:p||!d,onClick:()=>{s.run()},children:"Revalidate cache"})]}):(0,r.jsx)("p",{className:"description",children:"Only published contents can be revalidated."})})}}),document.addEventListener("DOMContentLoaded",(function(){if(!window.HeadlessAdmin.preview_is_active)return;const t=(0,s.select)("core/editor"),e=t.getCurrentPostId,n=t.isSavingPost,i=(0,s.dispatch)("core/editor"),a=i.autosave,r=i.savePost,o=document.createElement("a");o.className="components-button",o.addEventListener("click",(e=>{if(e.preventDefault(),n())return;const s=window.open("about:blank",o.target);!function(t){let e="";e+='\n\t\t<style>\n\t\t\tbody {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\theight: 100vh;\n\t\t\t\twidth: 100vw;\n\t\t\t}\n\t\t\t@-webkit-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-moz-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-o-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg {\n\t\t\t\twidth: 192px;\n\t\t\t\theight: 192px;\n\t\t\t\tstroke: #555d66;\n\t\t\t\tstroke-width: 0.75;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg .outer,\n\t\t\t.editor-post-preview-button__interstitial-message svg .inner {\n\t\t\t\tstroke-dasharray: 280;\n\t\t\t\tstroke-dashoffset: 280;\n\t\t\t\t-webkit-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-moz-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-o-animation: paint 1.5s ease infinite alternate;\n\t\t\t\tanimation: paint 1.5s ease infinite alternate;\n\t\t\t}\n\t\t\tp {\n\t\t\t\ttext-align: center;\n\t\t\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;\n\t\t\t}\n\t\t</style>\n\t',e+='\n        <div class="editor-post-preview-button__interstitial-message">\n            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">\n                <path class="outer" d="M48 12c19.9 0 36 16.1 36 36S67.9 84 48 84 12 67.9 12 48s16.1-36 36-36" fill="none" />\n                <path class="inner" d="M69.5 46.4c0-3.9-1.4-6.7-2.6-8.8-1.6-2.6-3.1-4.9-3.1-7.5 0-2.9 2.2-5.7 5.4-5.7h.4C63.9 19.2 56.4 16 48 16c-11.2 0-21 5.7-26.7 14.4h2.1c3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3L40 67.5l7-20.9L42 33c-1.7-.1-3.3-.3-3.3-.3-1.7-.1-1.5-2.7.2-2.6 0 0 5.3.4 8.4.4 3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3l11.5 34.3 3.3-10.4c1.6-4.5 2.4-7.8 2.4-10.5zM16.1 48c0 12.6 7.3 23.5 18 28.7L18.8 35c-1.7 4-2.7 8.4-2.7 13zm32.5 2.8L39 78.6c2.9.8 5.9 1.3 9 1.3 3.7 0 7.3-.6 10.6-1.8-.1-.1-.2-.3-.2-.4l-9.8-26.9zM76.2 36c0 3.2-.6 6.9-2.4 11.4L64 75.6c9.5-5.5 15.9-15.8 15.9-27.6 0-5.5-1.4-10.8-3.9-15.3.1 1 .2 2.1.2 3.3z" fill="none" />\n            </svg>\n            <p>Generating preview…</p>\n        </div>\n    ',t.write('\n\t\t<style>\n\t\t\tbody {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\theight: 100vh;\n\t\t\t\twidth: 100vw;\n\t\t\t}\n\t\t\t@-webkit-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-moz-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-o-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg {\n\t\t\t\twidth: 192px;\n\t\t\t\theight: 192px;\n\t\t\t\tstroke: #555d66;\n\t\t\t\tstroke-width: 0.75;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg .outer,\n\t\t\t.editor-post-preview-button__interstitial-message svg .inner {\n\t\t\t\tstroke-dasharray: 280;\n\t\t\t\tstroke-dashoffset: 280;\n\t\t\t\t-webkit-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-moz-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-o-animation: paint 1.5s ease infinite alternate;\n\t\t\t\tanimation: paint 1.5s ease infinite alternate;\n\t\t\t}\n\t\t\tp {\n\t\t\t\ttext-align: center;\n\t\t\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;\n\t\t\t}\n\t\t</style>\n\t\n        <div class="editor-post-preview-button__interstitial-message">\n            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">\n                <path class="outer" d="M48 12c19.9 0 36 16.1 36 36S67.9 84 48 84 12 67.9 12 48s16.1-36 36-36" fill="none" />\n                <path class="inner" d="M69.5 46.4c0-3.9-1.4-6.7-2.6-8.8-1.6-2.6-3.1-4.9-3.1-7.5 0-2.9 2.2-5.7 5.4-5.7h.4C63.9 19.2 56.4 16 48 16c-11.2 0-21 5.7-26.7 14.4h2.1c3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3L40 67.5l7-20.9L42 33c-1.7-.1-3.3-.3-3.3-.3-1.7-.1-1.5-2.7.2-2.6 0 0 5.3.4 8.4.4 3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3l11.5 34.3 3.3-10.4c1.6-4.5 2.4-7.8 2.4-10.5zM16.1 48c0 12.6 7.3 23.5 18 28.7L18.8 35c-1.7 4-2.7 8.4-2.7 13zm32.5 2.8L39 78.6c2.9.8 5.9 1.3 9 1.3 3.7 0 7.3-.6 10.6-1.8-.1-.1-.2-.3-.2-.4l-9.8-26.9zM76.2 36c0 3.2-.6 6.9-2.4 11.4L64 75.6c9.5-5.5 15.9-15.8 15.9-27.6 0-5.5-1.4-10.8-3.9-15.3.1 1 .2 2.1.2 3.3z" fill="none" />\n            </svg>\n            <p>Generating preview…</p>\n        </div>\n    '),t.close()}(s.document),((()=>{const e=t.getCurrentPost().status;return"draft"==e||"auto-draft"==e})()?r:a)().then((()=>{s.location=o.href}))})),(0,s.subscribe)((()=>{n()?o.classList.add("is-disabled"):o.classList.remove("is-disabled")})),setInterval((function(){const t=e(),n=(t=>window.Headless.preview_url.replace(window.Headless.post_id_placeholder,`${t}`))(t),s=document.querySelectorAll("[target^=wp-preview-]");s&&s.length&&s.forEach((t=>{t.setAttribute("href",n)})),document.querySelectorAll(".components-snackbar-list .components-snackbar__content a.components-button").forEach((e=>{(e.href.includes("?post="+t)||e.href.includes("?page_id="+t)||e.href.includes("?p="+t))&&(e.href=n,e.target="wp-preview-"+t)}));const i=document.querySelectorAll(".components-menu-group");let a=null;if(i.forEach((t=>{t.querySelector(".editor-preview-dropdown__button-external")&&(a=t)})),!a)return;const r="headless-preview-link";if(a.querySelector("#"+r))return;const l=a.querySelector(".editor-preview-dropdown__button-external"),c=l.querySelector("svg"),d=l.getAttribute("target");o.text=l.textContent,o.append(c),o.target=d,o.href=n,o.id=r,l.style.display="none",a.querySelector('[role="group"]').append(o)}),300)}))})();
  • headless/tags/2.5.0/headless.php

    r3072776 r3196946  
    55 * Plugin URI: https://github.com/palasthotel/headless
    66 * Description: Adds features to use WordPress as headless CMS
    7  * Version: 2.2.4
     7 * Version: 2.5.0
    88 * Author: Palasthotel (Edward Bock) <edward.bock@palasthotel.de>
    99 * Author URI: http://www.palasthotel.de
    1010 * Requires at least: 5.0
    11  * Tested up to: 6.5.2
     11 * Tested up to: 6.7.1
    1212 * Requires PHP: 8.0
    1313 * Text Domain: headless
     
    5353require_once __DIR__ . "/vendor/autoload.php";
    5454
    55 /**
    56  * @property Routes $routes
    57  * @property Extensions $extensions
    58  * @property Security $security
    59  * @property Preview $preview
    60  * @property Query $query
    61  * @property Revalidate $revalidate
    62  * @property RevalidationDatabase $dbRevalidation
    63  * @property Schedule $schedule
    64  * @property PluginAssets $gutenberg
    65  * @property Headers $headers
    66  * @property Post $post
    67  * @property Dashboard $dashboard
    68  * @property Headquarter $headquarter
    69  * @property Ajax $ajax
    70  * @property Log $log
    71  */
    7255class Plugin extends Components\Plugin {
    7356
     
    7760    const FILTER_IS_HEADLESS_POST_TYPE = "headless_is_headless_post_type";
    7861
     62    const FILTER_PREVIEW_IS_ACTIVE = "headless_preview_is_active";
     63
    7964    const FILTER_PREVIEW_REDIRECT_URL = "headless_preview_redirect_url";
    8065    const FILTER_PREVIEW_URL = "headless_preview_url";
     66    const FILTER_REVALIDATE_IS_ACTIVE = "headless_revalidate_is_active";
    8167
    8268    const ACTION_REGISTER_BLOCK_PREPARATION_EXTENSIONS = "headless_register_block_preparation_extensions";
     
    10490    const OPTION_SCHEMA_VERSION = "headless_schema_version";
    10591
     92    public Routes $routes;
     93    public Extensions $extensions;
     94    public Security $security;
     95    public Preview $preview;
     96    public Query $query;
     97    public Revalidate $revalidate;
     98    public RevalidationDatabase $dbRevalidation;
     99    public Schedule $schedule;
     100    public PluginAssets $gutenberg;
     101    public Headers $headers;
     102    public Post $post;
     103    public Dashboard $dashboard;
     104    public Headquarter $headquarter;
     105    public Ajax $ajax;
     106    public Log $log;
    106107
    107     function onCreate() {
     108    function onCreate(): void {
    108109
    109110        $this->dbRevalidation = new RevalidationDatabase();
  • headless/tags/2.5.0/vendor/composer/installed.php

    r3072776 r3196946  
    44        'pretty_version' => 'dev-main',
    55        'version' => 'dev-main',
    6         'reference' => '54dd1eeef2a9fb154922d1ca2caee4fa7eaf4491',
     6        'reference' => 'f1c7c9a53894452db42cd6f4ee7b86eb879816f1',
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../../',
     
    1414            'pretty_version' => 'dev-main',
    1515            'version' => 'dev-main',
    16             'reference' => '54dd1eeef2a9fb154922d1ca2caee4fa7eaf4491',
     16            'reference' => 'f1c7c9a53894452db42cd6f4ee7b86eb879816f1',
    1717            'type' => 'library',
    1818            'install_path' => __DIR__ . '/../../',
  • headless/trunk/README.txt

    r3072776 r3196946  
    44Tags: gutenberg, block, developer, utils
    55Requires at least: 5.0
    6 Tested up to: 6.5.2
     6Tested up to: 6.6.2
    77Requires PHP: 8.0
    88Stable tag: 2.2.4
     
    2727
    2828== Changelog ==
     29
     30= 2.3.0 =
     31* Feature: Revalidate feature can be deactivated via hook
     32* Feature: Preview feature can be deactivated via hook
     33* Update: NPM Packages
    2934
    3035= 2.2.4 =
  • headless/trunk/classes/Ajax.php

    r3060628 r3196946  
    1313    const GET_POST_ID = "post_id";
    1414
    15     public function onCreate() {
     15    public function onCreate(): void {
    1616        parent::onCreate();
    1717        add_action('wp_ajax_'.self::GET_ACTION, [$this, 'revalidate']);
  • headless/trunk/classes/Components/Assets.php

    r2766747 r3196946  
    44namespace Palasthotel\WordPress\Headless\Components;
    55
    6 /**
    7  * Class Assets
    8  * @property Plugin plugin
    9  * @version 0.1.2
    10  */
    116class Assets {
    127
    13     public function __construct( Plugin $plugin ) {
     8    private Plugin $plugin;
     9
     10    public function __construct(Plugin $plugin) {
    1411        $this->plugin = $plugin;
    1512    }
    1613
    17     public function registerStyle( string $handle, string $pluginPathToFile, array $dependencies = [], string $media = 'all' ): bool {
     14    public function registerStyle(string $handle, string $pluginPathToFile, array $dependencies = [], string $media = 'all'): bool {
    1815        $filePath = $this->plugin->path . $pluginPathToFile;
    19         $fileUrl  = $this->plugin->url . $pluginPathToFile;
    20         if ( ! file_exists( $filePath ) ) {
    21             error_log( "Style file does not exist: $filePath" );
     16        $fileUrl = $this->plugin->url . $pluginPathToFile;
     17        if (!file_exists($filePath)) {
     18            error_log("Style file does not exist: $filePath");
    2219
    2320            return false;
    2421        }
    2522
    26         return wp_register_style( $handle, $fileUrl, $dependencies, filemtime( $filePath ), $media );
     23        return wp_register_style($handle, $fileUrl, $dependencies, filemtime($filePath), $media);
    2724
    2825    }
    2926
    30     public function registerScript( string $handle, string $pluginPathToFile, array $dependencies = [], bool $footer = true ): bool {
     27    public function registerScript(string $handle, string $pluginPathToFile, array $dependencies = [], bool $footer = true): bool {
    3128        $filePath = $this->plugin->path . $pluginPathToFile;
    32         if ( ! file_exists( $filePath ) ) {
    33             error_log( "Script file does not exist: $filePath" );
     29        if (!file_exists($filePath)) {
     30            error_log("Script file does not exist: $filePath");
    3431
    3532            return false;
    3633        }
    3734        $assetsFilePath = "";
    38         if ( $this->endsWithJS( $filePath ) ) {
    39             $assetsFilePath = str_replace( ".js", ".asset.php", $filePath );
     35        if ($this->endsWithJS($filePath)) {
     36            $assetsFilePath = str_replace(".js", ".asset.php", $filePath);
    4037        }
    41         if ( ! empty( $assetsFilePath ) && file_exists( $assetsFilePath ) ) {
     38        if (!empty($assetsFilePath) && file_exists($assetsFilePath)) {
    4239            $info = include $assetsFilePath;
    4340        } else {
    4441            $info["dependencies"] = [];
    45             $info["version"]      = filemtime( $filePath );
     42            $info["version"] = filemtime($filePath);
    4643        }
    4744
     
    4946            $handle,
    5047            $this->plugin->url . $pluginPathToFile,
    51             array_merge( $info["dependencies"], $dependencies ),
     48            array_merge($info["dependencies"], $dependencies),
    5249            $info["version"],
    5350            $footer
     
    5653    }
    5754
    58     private function endsWithJS( $haystack ): bool {
    59         $length = strlen( ".js" );
    60         if ( ! $length ) {
     55    private function endsWithJS($haystack): bool {
     56        $length = strlen(".js");
     57        if (!$length) {
    6158            return true;
    6259        }
    6360
    64         return substr( $haystack, - $length ) === ".js";
     61        return substr($haystack, -$length) === ".js";
    6562    }
    6663}
  • headless/trunk/classes/Components/Component.php

    r2730402 r3196946  
    44namespace Palasthotel\WordPress\Headless\Components;
    55
    6 /**
    7  * Class Component
    8  *
    9  * @property \Palasthotel\WordPress\Headless\Plugin plugin
    10  *
    11  * @package Palasthotel\WordPress
    12  * @version 0.1.2
    13  */
    146abstract class Component {
    15     /**
    16      * _Component constructor.
    17      *
    18      * @param \Palasthotel\WordPress\Headless\Plugin $plugin
    19      */
    20     public function __construct(Plugin $plugin) {
    21         $this->plugin = $plugin;
     7
     8    public function __construct(
     9        public \Palasthotel\WordPress\Headless\Plugin $plugin
     10    ) {
    2211        $this->onCreate();
    2312    }
     
    2615     * overwrite this method in component implementations
    2716     */
    28     public function onCreate(){
     17    public function onCreate(): void {
    2918        // init your hooks and stuff
    3019    }
  • headless/trunk/classes/Components/Database.php

    r2766747 r3196946  
    66use wpdb;
    77
    8 /**
    9  * @property wpdb wpdb
    10  * @version 0.1.1
    11  */
    128abstract class Database {
     9
     10    protected wpdb $wpdb;
    1311
    1412    public function __construct() {
     
    2119     * initialize table names and other properties
    2220     */
    23     abstract function init();
    24    
    25     public function createTables(){
     21    abstract function init(): void;
     22
     23    public function createTables(): void {
    2624        require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
    2725    }
  • headless/trunk/classes/Components/Plugin.php

    r2730402 r3196946  
    66use ReflectionException;
    77
    8 /**
    9  * @property string path
    10  * @property string url
    11  * @property string basename
    12  * @version 0.1.3
    13  */
    148abstract class Plugin {
    159
     
    1812     */
    1913    private $ref;
    20 
    2114    private $tooLateForTextdomain;
     15    public $path;
     16    public $url;
     17    public $basename;
    2218
    2319    /**
     
    3430        $this->tooLateForTextdomain = true;
    3531
    36         register_activation_hook( $this->ref->getFileName(), array( $this, "onActivation" ) );
    37         register_deactivation_hook( $this->ref->getFileName(), array( $this, "onDeactivation" ) );
     32        register_activation_hook( $this->ref->getFileName(), [$this, "onActivation"]);
     33        register_deactivation_hook( $this->ref->getFileName(), [$this, "onDeactivation"]);
    3834
    3935    }
     
    8076                $domain,
    8177                false,
    82                 dirname( plugin_basename( $this->ref->getFileName() ) ) . "/" . $relativeLanguagesPath
     78                dirname(plugin_basename($this->ref->getFileName())) . "Plugin.php/" . $relativeLanguagesPath
    8379            );
    8480        } );
     
    8884        if ( function_exists( 'is_multisite' ) && is_multisite() ) {
    8985            $network_site = get_network()->site_id;
    90             $args         = array( 'fields' => 'ids' );
     86            $args         = ['fields' => 'ids'];
    9187            $site_ids     = get_sites( $args );
    9288
  • headless/trunk/classes/Dashboard.php

    r3060628 r3196946  
    44
    55class Dashboard extends Components\Component {
    6     public function onCreate() {
     6    public function onCreate(): void {
    77        parent::onCreate();
    88        add_action('wp_dashboard_setup', [$this, 'setup']);
     
    1212        if(!current_user_can('edit_posts')) return;
    1313
    14         wp_add_dashboard_widget(
    15             Plugin::DOMAIN,
    16             __("Headless", Plugin::DOMAIN),
    17             array($this, 'render')
    18         );
     14        if($this->plugin->revalidate->isRevalidationActive()){
     15            wp_add_dashboard_widget(
     16                Plugin::DOMAIN,
     17                __("Headless", Plugin::DOMAIN),
     18                array($this, 'render')
     19            );
     20        }
    1921    }
    2022
  • headless/trunk/classes/Extensions.php

    r2791162 r3196946  
    3333    private TermRouteExtensions $termRouteExtensions;
    3434
    35     public function onCreate() {
     35    public function onCreate(): void {
    3636        parent::onCreate();
    3737
  • headless/trunk/classes/Headers.php

    r2791162 r3196946  
    44
    55class Headers extends Components\Component {
    6     public function onCreate() {
     6    public function onCreate(): void {
    77        parent::onCreate();
    88        add_filter('rest_post_dispatch', [$this, 'rest_post_dispatch']);
  • headless/trunk/classes/Log.php

    r2901812 r3196946  
    99    private $log;
    1010
    11     public function onCreate() {
     11    public function onCreate(): void {
    1212        parent::onCreate();
    1313        add_action("cron_logger_init", function(\CronLogger\Plugin $logger){
  • headless/trunk/classes/Migration.php

    r2977228 r3196946  
    1414    }
    1515
    16     public function onCreate() {
     16    public function onCreate(): void {
    1717        parent::onCreate();
    1818
     
    2020            // drop every table that was created before version 3
    2121            $tableName = $this->plugin->dbRevalidation->table;
    22             $this->plugin->dbRevalidation->wpdb->query("DROP TABLE IF EXISTS $tableName");
     22            global $wpdb;
     23            $wpdb->query("DROP TABLE IF EXISTS $tableName");
    2324            $this->plugin->dbRevalidation->createTables();
    2425            $this->setSchemaVersion(3);
  • headless/trunk/classes/PluginAssets.php

    r2901812 r3196946  
    66use Palasthotel\WordPress\Headless\Components\Component;
    77
    8 /**
    9  * @property Assets $assets
    10  */
    118class PluginAssets extends Component {
    129
     
    1512    const HANDLE_GUTENBERG_STYLE = "headless_gutenberg_styles";
    1613
    17     public function onCreate() {
     14    public Assets $assets;
     15
     16    public function onCreate(): void {
    1817        parent::onCreate();
    1918
     
    6059                "HeadlessAdmin",
    6160                [
     61                    "revalidate_is_active" => $this->plugin->revalidate->isRevalidationActive(),
     62                    "preview_is_active" => $this->plugin->preview->isPreviewActive(),
    6263                    "preview_path" => $this->plugin->preview->getHeadlessPreviewPath(),
    6364                    "frontends" => array_map(function($frontend){
  • headless/trunk/classes/Post.php

    r2868064 r3196946  
    88
    99class Post extends Component {
    10     public function onCreate() {
     10    public function onCreate(): void {
    1111        parent::onCreate();
    1212        add_filter( Plugin::FILTER_PREPARE_POST, [ $this, 'prepare_post' ], 10, 2 );
  • headless/trunk/classes/Preview.php

    r2901812 r3196946  
    1010    const POST_ID_PLACEHOLDER = "{{post_id}}";
    1111
    12     public function onCreate() {
     12    public function onCreate(): void {
    1313        parent::onCreate();
    1414
     
    1616        add_action( 'wp_ajax_headless_preview', [ $this, 'admin_preview' ] );
    1717        add_action( 'wp_ajax_nopriv_headless_preview', [ $this, 'no_permission' ] );
     18        add_action( 'plugins_loaded', [ $this, 'plugins_loaded' ] );
    1819    }
     20
     21
    1922
    2023    public function getRedirectLink( $id ) {
     
    8184    }
    8285
     86    public function plugins_loaded() {
     87        remove_filter( 'preview_post_link', [ $this, 'preview_post_link' ] );
     88        remove_action( 'wp_ajax_headless_preview', [ $this, 'admin_preview' ] );
     89        remove_action( 'wp_ajax_nopriv_headless_preview', [ $this, 'no_permission' ] );
     90    }
     91
     92    function isPreviewInactive() {
     93        return !$this->isPreviewActive();
     94    }
     95    function isPreviewActive() {
     96        return apply_filters(Plugin::FILTER_PREVIEW_IS_ACTIVE, true);
     97    }
    8398
    8499}
  • headless/trunk/classes/Query.php

    r3060647 r3196946  
    1515    const POST_TYPE = "hl_post_type";
    1616
    17     public function onCreate() {
     17    public function onCreate(): void {
    1818        parent::onCreate();
    1919
  • headless/trunk/classes/Revalidate.php

    r3060628 r3196946  
    88class Revalidate extends Component {
    99
    10     public function onCreate() {
     10    public function onCreate(): void {
    1111        parent::onCreate();
    1212        add_action('save_post', [$this, 'on_post_change']);
     
    1616
    1717    public function on_post_change($post_id){
     18        if($this->isRevalidationInactive()) return;
    1819        if(wp_is_post_revision($post_id)) return;
    1920        $this->plugin->dbRevalidation->addPost($post_id);
     
    2122
    2223    public function on_comment_change($comment_id){
     24        if($this->isRevalidationInactive()) return;
    2325        $comment = get_comment($comment_id);
    2426        $this->plugin->dbRevalidation->addPost($comment->comment_post_ID);
     
    2729
    2830    function revalidateComments($post_id){
     31
     32        if($this->isRevalidationInactive()) return[];
     33
    2934        $frontends = $this->plugin->headquarter->getFrontends();
    3035        $results = [];
     
    4449     */
    4550    function revalidatePost($post_id) {
     51
     52        if($this->isRevalidationInactive()) return [];
     53
    4654        $frontends = $this->plugin->headquarter->getFrontends();
    4755        $results = [];
     
    5462
    5563    function revalidateByPathByPostId(Frontend $frontend, $post_id) {
     64
     65        if($this->isRevalidationInactive()) return [];
     66
    5667        $permalink = get_permalink($post_id);
    5768        $path = parse_url($permalink, PHP_URL_PATH);
     
    6374
    6475    function revalidateByPath(Frontend $frontend, $path){
     76
     77        if($this->isRevalidationInactive()) return [];
     78
    6579        $baseUrl = $frontend->getBaseUrl();
    6680        $url = untrailingslashit($baseUrl)."/api/revalidate?secret_token=".HEADLESS_SECRET_TOKEN."&path=".urlencode($path);
     
    7185
    7286    function revalidateByTag(Frontend $frontend, string $tag) {
     87
     88        if($this->isRevalidationInactive()) return [];
     89
    7390        $baseUrl = $frontend->getBaseUrl();
    7491        $url = untrailingslashit($baseUrl)."/api/revalidate?secret_token=".HEADLESS_SECRET_TOKEN."&tag=".urlencode($tag);
     
    7996
    8097    private function executeRavalidation($finalUrl){
     98
    8199        $url = add_query_arg('invalidate___cache', time(), $finalUrl);
    82100
     
    94112    }
    95113
     114    function isRevalidationInactive() {
     115        return !$this->isRevalidationActive();
     116    }
     117    function isRevalidationActive() {
     118        return apply_filters(Plugin::FILTER_REVALIDATE_IS_ACTIVE, true);
     119    }
     120
    96121
    97122}
  • headless/trunk/classes/Routes.php

    r2730402 r3196946  
    77use Palasthotel\WordPress\Headless\Routes\Settings;
    88
    9 /**
    10  * @property Menus $menus
    11  * @property Settings $settings
    12  */
    139class Routes extends Components\Component {
    1410
    15     public function onCreate() {
     11    public Menus $menus;
     12    public Settings $settings;
     13
     14    public function onCreate(): void {
    1615        parent::onCreate();
    1716        add_action( 'rest_api_init', [ $this, 'rest_api_init' ] );
  • headless/trunk/classes/Routes/Menus.php

    r2730402 r3196946  
    88class Menus extends Component {
    99
    10     private $menu;
     10    private array|false $menu;
    1111
    1212    public function init(){
  • headless/trunk/classes/Routes/Settings.php

    r2730402 r3196946  
    88class Settings extends Component {
    99
    10     public function init(){
     10    public function init(): void {
    1111        register_rest_route( Plugin::REST_NAMESPACE, '/settings', array(
    1212            'methods'             => \WP_REST_Server::READABLE,
     
    1919    }
    2020
    21     public function get_settings() {
     21    public function get_settings(): array {
    2222        return [
    2323            "front_page" => get_option( 'show_on_front' ),
    24             "page_on_front" => get_option( 'page_on_front' ),
     24            "page_on_front" => intval(get_option( 'page_on_front' )),
    2525            "home_url" => home_url(),
    2626        ];
  • headless/trunk/classes/Schedule.php

    r3060628 r3196946  
    77class Schedule extends Component {
    88
    9     public function onCreate() {
     9    public function onCreate(): void {
    1010        parent::onCreate();
    1111
     
    1515
    1616    public function init(){
     17        if($this->plugin->revalidate->isRevalidationInactive()){
     18            $next = $this->getNextSchedule();
     19            if($next){
     20                wp_unschedule_event($next, Plugin::SCHEDULE_REVALIDATE);
     21            }
     22            return;
     23        }
    1724        if(!wp_next_scheduled(Plugin::SCHEDULE_REVALIDATE)){
    1825            wp_schedule_event(time(), 'hourly', Plugin::SCHEDULE_REVALIDATE);
     
    3340
    3441    public function revalidate(){
     42
     43        if($this->plugin->revalidate->isRevalidationInactive()) return;
     44
    3545        $lastRun = $this->getLastRevalidationRun();
    3646        $now = time();
  • headless/trunk/classes/Security.php

    r3020918 r3196946  
    77class Security extends Component {
    88
    9     public function onCreate() {
     9    public function onCreate(): void {
    1010        parent::onCreate();
    1111        add_filter('wp_is_application_passwords_available', '__return_true');
  • headless/trunk/classes/Store/RevalidationDatabase.php

    r3060628 r3196946  
    77use Palasthotel\WordPress\Headless\Components\Database;
    88
    9 /**
    10  * @property string $table
    11  */
    129class RevalidationDatabase extends Database {
    1310
     
    1512    const TYPE_COMMENT = "comment";
    1613
    17     function init() {
     14    public string $table;
     15
     16    function init(): void {
    1817        $this->table = $this->wpdb->prefix . "headless_revalidate";
    1918    }
     
    104103    }
    105104
    106     public function createTables() {
     105    public function createTables(): void {
    107106        parent::createTables();
    108107        \dbDelta("CREATE TABLE IF NOT EXISTS $this->table
     
    112111             content_type varchar(40) NOT NULL,
    113112             revalidation_state varchar(30),
    114              revalidated_at TIMESTAMP default null,
     113             revalidated_at TIMESTAMP NULL default null,
    115114             primary key (id),
    116115             key (content_id),
  • headless/trunk/dist/admin.asset.php

    r3072776 r3196946  
    1 <?php return array('dependencies' => array(), 'version' => 'ecdaf49b7e3ddff3eb2a');
     1<?php return array('dependencies' => array(), 'version' => '8241f02c6df14b01c628');
  • headless/trunk/dist/admin.js

    r3072776 r3196946  
    1 !function(){"use strict";window.addEventListener("DOMContentLoaded",(async()=>{await Promise.all(window.HeadlessAdmin.frontends.map((e=>e+window.HeadlessAdmin.preview_path)).map((e=>fetch(e,{credentials:"include"}).then((e=>e.json())))))}))}();
     1(()=>{"use strict";window.addEventListener("DOMContentLoaded",(async()=>{window.HeadlessAdmin.preview_is_active&&await Promise.all(window.HeadlessAdmin.frontends.map((e=>e+window.HeadlessAdmin.preview_path)).map((e=>fetch(e,{credentials:"include"}).then((e=>e.json())))))}))})();
  • headless/trunk/dist/gutenberg.asset.php

    r3072776 r3196946  
    1 <?php return array('dependencies' => array('react', 'wp-components', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-plugins'), 'version' => 'a2d2fb477c2bc904a66b');
     1<?php return array('dependencies' => array('react-jsx-runtime', 'wp-components', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-plugins'), 'version' => 'f64387f5a68638e1237e');
  • headless/trunk/dist/gutenberg.js

    r3072776 r3196946  
    1 !function(){"use strict";var t=window.wp.plugins,e=window.React,n=window.wp.editPost,s=window.wp.components;var a=window.wp.data,i=window.wp.element;const r=()=>(0,a.useSelect)((t=>t("core/editor").getCurrentPost()),[]),o=({index:t,baseUrl:n,controller:s,onStateChanged:a})=>{const{state:o,reload:l}=(t=>{const[e,n]=(0,i.useState)("idle"),s=r(),a=(0,i.useMemo)((()=>s?.link?new URL(s?.link).pathname:""),[s.link]);return{state:e,reload:()=>{n("loading"),(async()=>{try{const e=await fetch(((t,e)=>window.Headless.ajax+`?action=${window.Headless.actions.revalidate}&frontend=${t}&path=${e}`)(t,a)),s=await e.json();s.success?n("success"):(console.error(s),n("error"))}catch(t){n("error")}})()}}})(t),c=r(),d=(0,i.useMemo)((()=>{const t=c.link,e=new URL(t);return n.replace(/^\/|\/$/g,"")+e.pathname}),[c.link]);return(0,i.useEffect)((()=>{s.add(t,l)}),[t]),(0,i.useEffect)((()=>{a(t,o)}),[o]),(0,e.createElement)("div",{title:d},(0,e.createElement)("a",{href:d,target:"_blank"},"Frontend ",t),"loading"==o&&(0,e.createElement)(e.Fragment,null," 🧹"),"success"==o&&(0,e.createElement)(e.Fragment,null," ✅"),"error"==o&&(0,e.createElement)(e.Fragment,null," 🚨"))};(0,t.registerPlugin)("headless-plugin",{icon:()=>null,render:function(){const t=window.Headless.frontends,a=(0,i.useMemo)((()=>(()=>{const t=new Map;return{add:(e,n)=>{t.set(e,n)},run:()=>{t.forEach((t=>{t()}))}}})()),[]),[l,c]=(0,i.useState)({}),d="publish"==r().status,p=Object.values(l).find((t=>1==t));return(0,e.createElement)(n.PluginDocumentSettingPanel,{title:"Headless"},d?(0,e.createElement)(e.Fragment,null,(0,e.createElement)("ol",null,t.map(((t,n)=>(0,e.createElement)("li",{key:n},(0,e.createElement)(o,{baseUrl:t,index:n,controller:a,onStateChanged:(t,e)=>{c((n=>{const s={...n};return s[t]="loading"==e,s}))}}))))),(0,e.createElement)(s.Button,{variant:"secondary",disabled:p||!d,onClick:()=>{a.run()}},"Revalidate cache")):(0,e.createElement)("p",{className:"description"},"Only published contents can be revalidated."))}}),document.addEventListener("DOMContentLoaded",(function(){const t=(0,a.select)("core/editor"),e=t.getCurrentPostId,n=t.isSavingPost,s=(0,a.dispatch)("core/editor"),i=s.autosave,r=s.savePost,o=document.createElement("a");o.className="components-button",o.addEventListener("click",(e=>{if(e.preventDefault(),n())return;const s=window.open("about:blank",o.target);!function(t){let e="";e+='\n\t\t<style>\n\t\t\tbody {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\theight: 100vh;\n\t\t\t\twidth: 100vw;\n\t\t\t}\n\t\t\t@-webkit-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-moz-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-o-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg {\n\t\t\t\twidth: 192px;\n\t\t\t\theight: 192px;\n\t\t\t\tstroke: #555d66;\n\t\t\t\tstroke-width: 0.75;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg .outer,\n\t\t\t.editor-post-preview-button__interstitial-message svg .inner {\n\t\t\t\tstroke-dasharray: 280;\n\t\t\t\tstroke-dashoffset: 280;\n\t\t\t\t-webkit-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-moz-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-o-animation: paint 1.5s ease infinite alternate;\n\t\t\t\tanimation: paint 1.5s ease infinite alternate;\n\t\t\t}\n\t\t\tp {\n\t\t\t\ttext-align: center;\n\t\t\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;\n\t\t\t}\n\t\t</style>\n\t',e+='\n        <div class="editor-post-preview-button__interstitial-message">\n            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">\n                <path class="outer" d="M48 12c19.9 0 36 16.1 36 36S67.9 84 48 84 12 67.9 12 48s16.1-36 36-36" fill="none" />\n                <path class="inner" d="M69.5 46.4c0-3.9-1.4-6.7-2.6-8.8-1.6-2.6-3.1-4.9-3.1-7.5 0-2.9 2.2-5.7 5.4-5.7h.4C63.9 19.2 56.4 16 48 16c-11.2 0-21 5.7-26.7 14.4h2.1c3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3L40 67.5l7-20.9L42 33c-1.7-.1-3.3-.3-3.3-.3-1.7-.1-1.5-2.7.2-2.6 0 0 5.3.4 8.4.4 3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3l11.5 34.3 3.3-10.4c1.6-4.5 2.4-7.8 2.4-10.5zM16.1 48c0 12.6 7.3 23.5 18 28.7L18.8 35c-1.7 4-2.7 8.4-2.7 13zm32.5 2.8L39 78.6c2.9.8 5.9 1.3 9 1.3 3.7 0 7.3-.6 10.6-1.8-.1-.1-.2-.3-.2-.4l-9.8-26.9zM76.2 36c0 3.2-.6 6.9-2.4 11.4L64 75.6c9.5-5.5 15.9-15.8 15.9-27.6 0-5.5-1.4-10.8-3.9-15.3.1 1 .2 2.1.2 3.3z" fill="none" />\n            </svg>\n            <p>Generating preview…</p>\n        </div>\n    ',t.write('\n\t\t<style>\n\t\t\tbody {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\theight: 100vh;\n\t\t\t\twidth: 100vw;\n\t\t\t}\n\t\t\t@-webkit-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-moz-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-o-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg {\n\t\t\t\twidth: 192px;\n\t\t\t\theight: 192px;\n\t\t\t\tstroke: #555d66;\n\t\t\t\tstroke-width: 0.75;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg .outer,\n\t\t\t.editor-post-preview-button__interstitial-message svg .inner {\n\t\t\t\tstroke-dasharray: 280;\n\t\t\t\tstroke-dashoffset: 280;\n\t\t\t\t-webkit-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-moz-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-o-animation: paint 1.5s ease infinite alternate;\n\t\t\t\tanimation: paint 1.5s ease infinite alternate;\n\t\t\t}\n\t\t\tp {\n\t\t\t\ttext-align: center;\n\t\t\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;\n\t\t\t}\n\t\t</style>\n\t\n        <div class="editor-post-preview-button__interstitial-message">\n            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">\n                <path class="outer" d="M48 12c19.9 0 36 16.1 36 36S67.9 84 48 84 12 67.9 12 48s16.1-36 36-36" fill="none" />\n                <path class="inner" d="M69.5 46.4c0-3.9-1.4-6.7-2.6-8.8-1.6-2.6-3.1-4.9-3.1-7.5 0-2.9 2.2-5.7 5.4-5.7h.4C63.9 19.2 56.4 16 48 16c-11.2 0-21 5.7-26.7 14.4h2.1c3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3L40 67.5l7-20.9L42 33c-1.7-.1-3.3-.3-3.3-.3-1.7-.1-1.5-2.7.2-2.6 0 0 5.3.4 8.4.4 3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3l11.5 34.3 3.3-10.4c1.6-4.5 2.4-7.8 2.4-10.5zM16.1 48c0 12.6 7.3 23.5 18 28.7L18.8 35c-1.7 4-2.7 8.4-2.7 13zm32.5 2.8L39 78.6c2.9.8 5.9 1.3 9 1.3 3.7 0 7.3-.6 10.6-1.8-.1-.1-.2-.3-.2-.4l-9.8-26.9zM76.2 36c0 3.2-.6 6.9-2.4 11.4L64 75.6c9.5-5.5 15.9-15.8 15.9-27.6 0-5.5-1.4-10.8-3.9-15.3.1 1 .2 2.1.2 3.3z" fill="none" />\n            </svg>\n            <p>Generating preview…</p>\n        </div>\n    '),t.close()}(s.document),((()=>{const e=t.getCurrentPost().status;return"draft"==e||"auto-draft"==e})()?r:i)().then((()=>{s.location=o.href}))})),(0,a.subscribe)((()=>{n()?o.classList.add("is-disabled"):o.classList.remove("is-disabled")})),setInterval((function(){const t=e(),n=(t=>window.Headless.preview_url.replace(window.Headless.post_id_placeholder,`${t}`))(t),s=document.querySelectorAll("[target^=wp-preview-]");s&&s.length&&s.forEach((t=>{t.setAttribute("href",n)})),document.querySelectorAll(".components-snackbar-list .components-snackbar__content a.components-button").forEach((e=>{(e.href.includes("?post="+t)||e.href.includes("?page_id="+t)||e.href.includes("?p="+t))&&(e.href=n,e.target="wp-preview-"+t)}));const a=document.querySelectorAll(".components-menu-group");let i=null;if(a.forEach((t=>{t.querySelector(".editor-preview-dropdown__button-external")&&(i=t)})),!i)return;const r="headless-preview-link";if(i.querySelector("#"+r))return;const l=i.querySelector(".editor-preview-dropdown__button-external"),c=l.querySelector("svg"),d=l.getAttribute("target");o.text=l.textContent,o.append(c),o.target=d,o.href=n,o.id=r,l.style.display="none",i.querySelector('[role="group"]').append(o)}),300)}))}();
     1(()=>{"use strict";const t=window.wp.plugins,e=window.wp.editPost,n=window.wp.components,s=window.wp.data,i=window.wp.element,a=()=>(0,s.useSelect)((t=>t("core/editor").getCurrentPost()),[]),r=window.ReactJSXRuntime,o=({index:t,baseUrl:e,controller:n,onStateChanged:s})=>{const{state:o,reload:l}=(t=>{const[e,n]=(0,i.useState)("idle"),s=a(),r=(0,i.useMemo)((()=>s?.link?new URL(s?.link).pathname:""),[s.link]);return{state:e,reload:()=>{n("loading"),(async()=>{try{const e=await fetch(((t,e)=>window.Headless.ajax+`?action=${window.Headless.actions.revalidate}&frontend=${t}&path=${e}`)(t,r)),s=await e.json();s.success?n("success"):(console.error(s),n("error"))}catch(t){n("error")}})()}}})(t),c=a(),d=(0,i.useMemo)((()=>{const t=c.link,n=new URL(t);return e.replace(/^\/|\/$/g,"")+n.pathname}),[c.link]);return(0,i.useEffect)((()=>{n.add(t,l)}),[t]),(0,i.useEffect)((()=>{s(t,o)}),[o]),(0,r.jsxs)("div",{title:d,children:[(0,r.jsxs)("a",{href:d,target:"_blank",children:["Frontend ",t]}),"loading"==o&&(0,r.jsx)(r.Fragment,{children:" 🧹"}),"success"==o&&(0,r.jsx)(r.Fragment,{children:" ✅"}),"error"==o&&(0,r.jsx)(r.Fragment,{children:" 🚨"})]})};window.HeadlessAdmin.revalidate_is_active&&(0,t.registerPlugin)("headless-plugin",{icon:()=>null,render:function(){const t=window.Headless.frontends,s=(0,i.useMemo)((()=>(()=>{const t=new Map;return{add:(e,n)=>{t.set(e,n)},run:()=>{t.forEach((t=>{t()}))}}})()),[]),[l,c]=(0,i.useState)({}),d="publish"==a().status,p=Object.values(l).find((t=>1==t));return(0,r.jsx)(e.PluginDocumentSettingPanel,{title:"Headless",children:d?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("ol",{children:t.map(((t,e)=>(0,r.jsx)("li",{children:(0,r.jsx)(o,{baseUrl:t,index:e,controller:s,onStateChanged:(t,e)=>{c((n=>{const s={...n};return s[t]="loading"==e,s}))}})},e)))}),(0,r.jsx)(n.Button,{variant:"secondary",disabled:p||!d,onClick:()=>{s.run()},children:"Revalidate cache"})]}):(0,r.jsx)("p",{className:"description",children:"Only published contents can be revalidated."})})}}),document.addEventListener("DOMContentLoaded",(function(){if(!window.HeadlessAdmin.preview_is_active)return;const t=(0,s.select)("core/editor"),e=t.getCurrentPostId,n=t.isSavingPost,i=(0,s.dispatch)("core/editor"),a=i.autosave,r=i.savePost,o=document.createElement("a");o.className="components-button",o.addEventListener("click",(e=>{if(e.preventDefault(),n())return;const s=window.open("about:blank",o.target);!function(t){let e="";e+='\n\t\t<style>\n\t\t\tbody {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\theight: 100vh;\n\t\t\t\twidth: 100vw;\n\t\t\t}\n\t\t\t@-webkit-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-moz-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-o-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg {\n\t\t\t\twidth: 192px;\n\t\t\t\theight: 192px;\n\t\t\t\tstroke: #555d66;\n\t\t\t\tstroke-width: 0.75;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg .outer,\n\t\t\t.editor-post-preview-button__interstitial-message svg .inner {\n\t\t\t\tstroke-dasharray: 280;\n\t\t\t\tstroke-dashoffset: 280;\n\t\t\t\t-webkit-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-moz-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-o-animation: paint 1.5s ease infinite alternate;\n\t\t\t\tanimation: paint 1.5s ease infinite alternate;\n\t\t\t}\n\t\t\tp {\n\t\t\t\ttext-align: center;\n\t\t\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;\n\t\t\t}\n\t\t</style>\n\t',e+='\n        <div class="editor-post-preview-button__interstitial-message">\n            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">\n                <path class="outer" d="M48 12c19.9 0 36 16.1 36 36S67.9 84 48 84 12 67.9 12 48s16.1-36 36-36" fill="none" />\n                <path class="inner" d="M69.5 46.4c0-3.9-1.4-6.7-2.6-8.8-1.6-2.6-3.1-4.9-3.1-7.5 0-2.9 2.2-5.7 5.4-5.7h.4C63.9 19.2 56.4 16 48 16c-11.2 0-21 5.7-26.7 14.4h2.1c3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3L40 67.5l7-20.9L42 33c-1.7-.1-3.3-.3-3.3-.3-1.7-.1-1.5-2.7.2-2.6 0 0 5.3.4 8.4.4 3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3l11.5 34.3 3.3-10.4c1.6-4.5 2.4-7.8 2.4-10.5zM16.1 48c0 12.6 7.3 23.5 18 28.7L18.8 35c-1.7 4-2.7 8.4-2.7 13zm32.5 2.8L39 78.6c2.9.8 5.9 1.3 9 1.3 3.7 0 7.3-.6 10.6-1.8-.1-.1-.2-.3-.2-.4l-9.8-26.9zM76.2 36c0 3.2-.6 6.9-2.4 11.4L64 75.6c9.5-5.5 15.9-15.8 15.9-27.6 0-5.5-1.4-10.8-3.9-15.3.1 1 .2 2.1.2 3.3z" fill="none" />\n            </svg>\n            <p>Generating preview…</p>\n        </div>\n    ',t.write('\n\t\t<style>\n\t\t\tbody {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\theight: 100vh;\n\t\t\t\twidth: 100vw;\n\t\t\t}\n\t\t\t@-webkit-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-moz-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-o-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg {\n\t\t\t\twidth: 192px;\n\t\t\t\theight: 192px;\n\t\t\t\tstroke: #555d66;\n\t\t\t\tstroke-width: 0.75;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg .outer,\n\t\t\t.editor-post-preview-button__interstitial-message svg .inner {\n\t\t\t\tstroke-dasharray: 280;\n\t\t\t\tstroke-dashoffset: 280;\n\t\t\t\t-webkit-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-moz-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-o-animation: paint 1.5s ease infinite alternate;\n\t\t\t\tanimation: paint 1.5s ease infinite alternate;\n\t\t\t}\n\t\t\tp {\n\t\t\t\ttext-align: center;\n\t\t\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;\n\t\t\t}\n\t\t</style>\n\t\n        <div class="editor-post-preview-button__interstitial-message">\n            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">\n                <path class="outer" d="M48 12c19.9 0 36 16.1 36 36S67.9 84 48 84 12 67.9 12 48s16.1-36 36-36" fill="none" />\n                <path class="inner" d="M69.5 46.4c0-3.9-1.4-6.7-2.6-8.8-1.6-2.6-3.1-4.9-3.1-7.5 0-2.9 2.2-5.7 5.4-5.7h.4C63.9 19.2 56.4 16 48 16c-11.2 0-21 5.7-26.7 14.4h2.1c3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3L40 67.5l7-20.9L42 33c-1.7-.1-3.3-.3-3.3-.3-1.7-.1-1.5-2.7.2-2.6 0 0 5.3.4 8.4.4 3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3l11.5 34.3 3.3-10.4c1.6-4.5 2.4-7.8 2.4-10.5zM16.1 48c0 12.6 7.3 23.5 18 28.7L18.8 35c-1.7 4-2.7 8.4-2.7 13zm32.5 2.8L39 78.6c2.9.8 5.9 1.3 9 1.3 3.7 0 7.3-.6 10.6-1.8-.1-.1-.2-.3-.2-.4l-9.8-26.9zM76.2 36c0 3.2-.6 6.9-2.4 11.4L64 75.6c9.5-5.5 15.9-15.8 15.9-27.6 0-5.5-1.4-10.8-3.9-15.3.1 1 .2 2.1.2 3.3z" fill="none" />\n            </svg>\n            <p>Generating preview…</p>\n        </div>\n    '),t.close()}(s.document),((()=>{const e=t.getCurrentPost().status;return"draft"==e||"auto-draft"==e})()?r:a)().then((()=>{s.location=o.href}))})),(0,s.subscribe)((()=>{n()?o.classList.add("is-disabled"):o.classList.remove("is-disabled")})),setInterval((function(){const t=e(),n=(t=>window.Headless.preview_url.replace(window.Headless.post_id_placeholder,`${t}`))(t),s=document.querySelectorAll("[target^=wp-preview-]");s&&s.length&&s.forEach((t=>{t.setAttribute("href",n)})),document.querySelectorAll(".components-snackbar-list .components-snackbar__content a.components-button").forEach((e=>{(e.href.includes("?post="+t)||e.href.includes("?page_id="+t)||e.href.includes("?p="+t))&&(e.href=n,e.target="wp-preview-"+t)}));const i=document.querySelectorAll(".components-menu-group");let a=null;if(i.forEach((t=>{t.querySelector(".editor-preview-dropdown__button-external")&&(a=t)})),!a)return;const r="headless-preview-link";if(a.querySelector("#"+r))return;const l=a.querySelector(".editor-preview-dropdown__button-external"),c=l.querySelector("svg"),d=l.getAttribute("target");o.text=l.textContent,o.append(c),o.target=d,o.href=n,o.id=r,l.style.display="none",a.querySelector('[role="group"]').append(o)}),300)}))})();
  • headless/trunk/headless.php

    r3072776 r3196946  
    55 * Plugin URI: https://github.com/palasthotel/headless
    66 * Description: Adds features to use WordPress as headless CMS
    7  * Version: 2.2.4
     7 * Version: 2.5.0
    88 * Author: Palasthotel (Edward Bock) <edward.bock@palasthotel.de>
    99 * Author URI: http://www.palasthotel.de
    1010 * Requires at least: 5.0
    11  * Tested up to: 6.5.2
     11 * Tested up to: 6.7.1
    1212 * Requires PHP: 8.0
    1313 * Text Domain: headless
     
    5353require_once __DIR__ . "/vendor/autoload.php";
    5454
    55 /**
    56  * @property Routes $routes
    57  * @property Extensions $extensions
    58  * @property Security $security
    59  * @property Preview $preview
    60  * @property Query $query
    61  * @property Revalidate $revalidate
    62  * @property RevalidationDatabase $dbRevalidation
    63  * @property Schedule $schedule
    64  * @property PluginAssets $gutenberg
    65  * @property Headers $headers
    66  * @property Post $post
    67  * @property Dashboard $dashboard
    68  * @property Headquarter $headquarter
    69  * @property Ajax $ajax
    70  * @property Log $log
    71  */
    7255class Plugin extends Components\Plugin {
    7356
     
    7760    const FILTER_IS_HEADLESS_POST_TYPE = "headless_is_headless_post_type";
    7861
     62    const FILTER_PREVIEW_IS_ACTIVE = "headless_preview_is_active";
     63
    7964    const FILTER_PREVIEW_REDIRECT_URL = "headless_preview_redirect_url";
    8065    const FILTER_PREVIEW_URL = "headless_preview_url";
     66    const FILTER_REVALIDATE_IS_ACTIVE = "headless_revalidate_is_active";
    8167
    8268    const ACTION_REGISTER_BLOCK_PREPARATION_EXTENSIONS = "headless_register_block_preparation_extensions";
     
    10490    const OPTION_SCHEMA_VERSION = "headless_schema_version";
    10591
     92    public Routes $routes;
     93    public Extensions $extensions;
     94    public Security $security;
     95    public Preview $preview;
     96    public Query $query;
     97    public Revalidate $revalidate;
     98    public RevalidationDatabase $dbRevalidation;
     99    public Schedule $schedule;
     100    public PluginAssets $gutenberg;
     101    public Headers $headers;
     102    public Post $post;
     103    public Dashboard $dashboard;
     104    public Headquarter $headquarter;
     105    public Ajax $ajax;
     106    public Log $log;
    106107
    107     function onCreate() {
     108    function onCreate(): void {
    108109
    109110        $this->dbRevalidation = new RevalidationDatabase();
  • headless/trunk/vendor/composer/installed.php

    r3072776 r3196946  
    44        'pretty_version' => 'dev-main',
    55        'version' => 'dev-main',
    6         'reference' => '54dd1eeef2a9fb154922d1ca2caee4fa7eaf4491',
     6        'reference' => 'f1c7c9a53894452db42cd6f4ee7b86eb879816f1',
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../../',
     
    1414            'pretty_version' => 'dev-main',
    1515            'version' => 'dev-main',
    16             'reference' => '54dd1eeef2a9fb154922d1ca2caee4fa7eaf4491',
     16            'reference' => 'f1c7c9a53894452db42cd6f4ee7b86eb879816f1',
    1717            'type' => 'library',
    1818            'install_path' => __DIR__ . '/../../',
Note: See TracChangeset for help on using the changeset viewer.