initial
This commit is contained in:
+1
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array('jetpack-connection', 'jetpack-script-data', 'react', 'react-jsx-runtime', 'wp-a11y', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '174f7dde97b3cbbddea5');
|
||||
+1
File diff suppressed because one or more lines are too long
+17
File diff suppressed because one or more lines are too long
+20
@@ -0,0 +1,20 @@
|
||||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
||||
|
||||
/**
|
||||
* filesize
|
||||
*
|
||||
* @copyright 2024 Jason Mulligan <jason.mulligan@avoidwork.com>
|
||||
* @license BSD-3-Clause
|
||||
* @version 10.1.6
|
||||
*/
|
||||
|
||||
/**
|
||||
* react-router v7.15.1
|
||||
*
|
||||
* Copyright (c) Remix Software Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE.md file in the root directory of this source tree.
|
||||
*
|
||||
* @license MIT
|
||||
*/
|
||||
+1
File diff suppressed because one or more lines are too long
+134
@@ -0,0 +1,134 @@
|
||||
{
|
||||
"$schema": "https://schemas.wp.org/trunk/block.json",
|
||||
"apiVersion": 3,
|
||||
"name": "videopress/video",
|
||||
"version": "0.1.0",
|
||||
"title": "VideoPress",
|
||||
"category": "media",
|
||||
"icon": "<svg viewBox='0 0 29 21' width='24' height='24' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='M2.79037 0.59375C4.0363 0.59375 5.13102 1.41658 5.47215 2.60947L8.8452 14.4044C8.8486 14.4164 8.85411 14.4273 8.86124 14.4368L12.8572 0.59375H15.0927H21.2721C25.6033 0.59375 28.5066 3.39892 28.5066 7.64565C28.5066 11.9411 25.5272 14.6196 21.0818 14.6196H18.1499H14.3719L13.6379 16.8813C12.9796 18.9095 11.0827 20.2839 8.94152 20.2839C6.80035 20.2839 4.90341 18.9095 4.24517 16.8813L0.137069 4.22276C-0.444671 2.43022 0.898038 0.59375 2.79037 0.59375ZM15.7374 10.4119H20.0156C21.8718 10.4119 22.9856 9.35018 22.9856 7.64565C22.9856 5.93137 21.8718 4.91839 20.0156 4.91839H17.5202L15.7374 10.4119Z'></path></svg>",
|
||||
"description": "Embed a video from your media library or upload a new one with VideoPress.",
|
||||
"supports": {
|
||||
"html": false,
|
||||
"align": true,
|
||||
"anchor": true,
|
||||
"spacing": {
|
||||
"margin": true,
|
||||
"padding": true
|
||||
}
|
||||
},
|
||||
"attributes": {
|
||||
"autoplay": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"anchor": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"type": "string"
|
||||
},
|
||||
"caption": {
|
||||
"type": "string"
|
||||
},
|
||||
"controls": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
},
|
||||
"loop": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"maxWidth": {
|
||||
"type": "string",
|
||||
"default": "100%"
|
||||
},
|
||||
"muted": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"playsinline": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"preload": {
|
||||
"type": "string",
|
||||
"default": "metadata"
|
||||
},
|
||||
"seekbarPlayedColor": {
|
||||
"type": "string",
|
||||
"default": ""
|
||||
},
|
||||
"seekbarLoadingColor": {
|
||||
"type": "string",
|
||||
"default": ""
|
||||
},
|
||||
"seekbarColor": {
|
||||
"type": "string",
|
||||
"default": ""
|
||||
},
|
||||
"useAverageColor": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
},
|
||||
"id": {
|
||||
"type": "number"
|
||||
},
|
||||
"guid": {
|
||||
"type": "string"
|
||||
},
|
||||
"src": {
|
||||
"type": "string"
|
||||
},
|
||||
"cacheHtml": {
|
||||
"type": "string",
|
||||
"default": ""
|
||||
},
|
||||
"poster": {
|
||||
"type": "string"
|
||||
},
|
||||
"posterData": {
|
||||
"type": "object",
|
||||
"default": {}
|
||||
},
|
||||
"videoRatio": {
|
||||
"type": "number"
|
||||
},
|
||||
"tracks": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object"
|
||||
},
|
||||
"default": []
|
||||
},
|
||||
"privacySetting": {
|
||||
"type": "number",
|
||||
"default": 1
|
||||
},
|
||||
"allowDownload": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
},
|
||||
"displayEmbed": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
},
|
||||
"rating": {
|
||||
"type": "string"
|
||||
},
|
||||
"isPrivate": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"isExample": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"duration": {
|
||||
"type": "number"
|
||||
}
|
||||
},
|
||||
"textdomain": "jetpack-videopress-pkg",
|
||||
"editorScript": "file:./index.js",
|
||||
"editorStyle": "file:./index.css",
|
||||
"style": "file:./style.css",
|
||||
"viewScript": "file:./view.js",
|
||||
"viewStyle": "file:./view.css"
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array('jetpack-connection', 'jetpack-script-data', 'jetpack-shared-stores', 'react', 'react-jsx-runtime', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-dom-ready', 'wp-editor', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => 'a10c36b6c517fb483735');
|
||||
+1
File diff suppressed because one or more lines are too long
+10
File diff suppressed because one or more lines are too long
+9
@@ -0,0 +1,9 @@
|
||||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
||||
|
||||
/**
|
||||
* filesize
|
||||
*
|
||||
* @copyright 2024 Jason Mulligan <jason.mulligan@avoidwork.com>
|
||||
* @license BSD-3-Clause
|
||||
* @version 10.1.6
|
||||
*/
|
||||
+1
File diff suppressed because one or more lines are too long
+1
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array('wp-dom-ready', 'wp-polyfill'), 'version' => 'd00d9230ef0a6910ff95');
|
||||
+1
@@ -0,0 +1 @@
|
||||
.wp-block-jetpack-videopress{position:relative}.wp-block-jetpack-videopress.jetpack-videopress-player.alignleft~.wp-block-jetpack-videopress.jetpack-videopress-player,.wp-block-jetpack-videopress.jetpack-videopress-player.alignright~.wp-block-jetpack-videopress.jetpack-videopress-player{clear:both}.wp-block-jetpack-videopress figcaption{color:#555;font-size:13px;margin-bottom:1em;margin-top:.5em;text-align:center}.is-dark-theme .wp-block-jetpack-videopress figcaption{color:hsla(0,0%,100%,.65)}.wp-block-jetpack-videopress .jetpack-videopress-player__wrapper{line-height:0;position:relative}.wp-block-jetpack-videopress .jetpack-videopress-player__overlay{cursor:pointer;height:100%;left:0;opacity:1;position:absolute;top:0;transition:opacity .3s ease-in-out;width:100%}.wp-block-jetpack-videopress .jetpack-videopress-player__overlay:hover{opacity:0}.wp-block-jetpack-videopress.wp-block-jetpack-videopress--has-max-width{margin:auto}.is-layout-flex .wp-block-jetpack-videopress.wp-block-jetpack-videopress--has-max-width{margin:0}
|
||||
+1
@@ -0,0 +1 @@
|
||||
(()=>{"use strict";var e={7966(){},8490(e){e.exports=window.wp.domReady}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var s=t[r]={exports:{}};return e[r](s,s.exports,o),s.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r=o(8490),n=o.n(r);o(7966);n()(function(){!function(){const e=document.querySelectorAll(".wp-block-jetpack-videopress");0!==e.length&&e.forEach(function(e){const t=e.querySelector("iframe");if(!t)return;if(!window?.VideoPressIframeApi)return;const o=e.querySelector('script[type="application/json"]');if(!o)return;let r;try{r=JSON.parse(o.innerHTML)}catch(e){return void console.error(e)}o.remove();let n=!1;const s=window.VideoPressIframeApi(t,()=>{s.status.onPlayerStatusChanged((e,t)=>{"ready"===e&&"playing"===t&&(s.controls.pause(),s.controls.seek(r.previewAtTime),s.customize?.set({bigPlayButton:!0,playPauseAnimation:!1,controlBar:!1,shareButton:!1,posterImage:!0}))}),s.status.onTimeUpdate(e=>{if(n)return;const t=1e3*e,o=r.previewAtTime,a=o+r.previewLoopDuration;(t<o||t>a)&&s.controls.seek(o)})}),a=e.querySelector(".jetpack-videopress-player__overlay");a&&(r.showControls&&a.addEventListener("click",()=>{n=!0,a.remove(),s.customize?.set({bigPlayButton:!1,playPauseAnimation:!0,controlBar:!0,shareButton:!0}),s.controls.seek(0)}),a.addEventListener("mouseenter",()=>{s.customize?.set({playPauseAnimation:!1,posterImage:!1}),s.controls.play()}),a.addEventListener("mouseleave",()=>{s.customize?.set({playPauseAnimation:!1,posterImage:!0}),s.controls.pause()}))})}()})})();
|
||||
+1
@@ -0,0 +1 @@
|
||||
.wp-block-jetpack-videopress{position:relative}.wp-block-jetpack-videopress.jetpack-videopress-player.alignleft~.wp-block-jetpack-videopress.jetpack-videopress-player,.wp-block-jetpack-videopress.jetpack-videopress-player.alignright~.wp-block-jetpack-videopress.jetpack-videopress-player{clear:both}.wp-block-jetpack-videopress figcaption{color:#555;font-size:13px;margin-bottom:1em;margin-top:.5em;text-align:center}.is-dark-theme .wp-block-jetpack-videopress figcaption{color:hsla(0,0%,100%,.65)}.wp-block-jetpack-videopress .jetpack-videopress-player__wrapper{line-height:0;position:relative}.wp-block-jetpack-videopress .jetpack-videopress-player__overlay{cursor:pointer;height:100%;opacity:1;position:absolute;right:0;top:0;transition:opacity .3s ease-in-out;width:100%}.wp-block-jetpack-videopress .jetpack-videopress-player__overlay:hover{opacity:0}.wp-block-jetpack-videopress.wp-block-jetpack-videopress--has-max-width{margin:auto}.is-layout-flex .wp-block-jetpack-videopress.wp-block-jetpack-videopress--has-max-width{margin:0}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"beta": [ "videopress-video-chapters-plugin", "videopress/video-chapters" ]
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array('react', 'react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-polyfill'), 'version' => '8bbbb4cb229ca3eae260');
|
||||
+1
@@ -0,0 +1 @@
|
||||
.extended-block-warning{margin-bottom:8px}.extended-block-warning .block-editor-warning__message{width:100%}.extended-block-warning .block-editor-warning__actions{flex-wrap:wrap}.wp-extended-block-wrapper{position:relative}.wp-extended-block-wrapper.is-disabled{opacity:.5}.wp-extended-block-wrapper .videoplayer-play{background-color:transparent;background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgZmlsbD0ibm9uZSIgdmlld0JveD0iMCAwIDIyIDIyIj48cGF0aCBmaWxsPSIjZmZmIiBkPSJNNi4yNTcgMS4wNzVhLjQ4LjQ4IDAgMCAwLS41MDMtLjAwNy41My41MyAwIDAgMC0uMjU0LjQ1OHYxOC45NDhjMCAuMTkuMDk3LjM2NC4yNTQuNDU4LjE1Ni4wOTMuMzQ5LjA5LjUwMy0uMDA3bDE1LTkuNDc0QS41My41MyAwIDAgMCAyMS41IDExYS41My41MyAwIDAgMC0uMjQzLS40NTF6Ii8+PC9zdmc+);background-size:cover;border:none;display:block;height:72px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);transition:none;width:72px}.wp-extended-block-wrapper img{display:block;margin:0 auto;max-width:650px;-o-object-fit:cover;object-fit:cover;width:100%}.wp-extended-block-wrapper .extended-block-player__overlay{background-color:transparent;height:100%;left:0;position:absolute;top:0;width:100%;z-index:2}
|
||||
+1
File diff suppressed because one or more lines are too long
+1
@@ -0,0 +1 @@
|
||||
.extended-block-warning{margin-bottom:8px}.extended-block-warning .block-editor-warning__message{width:100%}.extended-block-warning .block-editor-warning__actions{flex-wrap:wrap}.wp-extended-block-wrapper{position:relative}.wp-extended-block-wrapper.is-disabled{opacity:.5}.wp-extended-block-wrapper .videoplayer-play{background-color:transparent;background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgZmlsbD0ibm9uZSIgdmlld0JveD0iMCAwIDIyIDIyIj48cGF0aCBmaWxsPSIjZmZmIiBkPSJNNi4yNTcgMS4wNzVhLjQ4LjQ4IDAgMCAwLS41MDMtLjAwNy41My41MyAwIDAgMC0uMjU0LjQ1OHYxOC45NDhjMCAuMTkuMDk3LjM2NC4yNTQuNDU4LjE1Ni4wOTMuMzQ5LjA5LjUwMy0uMDA3bDE1LTkuNDc0QS41My41MyAwIDAgMCAyMS41IDExYS41My41MyAwIDAgMC0uMjQzLS40NTF6Ii8+PC9zdmc+);background-size:cover;border:none;display:block;height:72px;position:absolute;right:50%;top:50%;transform:translate(50%,-50%);transition:none;width:72px}.wp-extended-block-wrapper img{display:block;margin:0 auto;max-width:650px;-o-object-fit:cover;object-fit:cover;width:100%}.wp-extended-block-wrapper .extended-block-player__overlay{background-color:transparent;height:100%;position:absolute;right:0;top:0;width:100%;z-index:2}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**
|
||||
* Main entry point for auto-generated asset registration.
|
||||
* Do not edit this file manually.
|
||||
*
|
||||
* @package jetpack_videopress
|
||||
*/
|
||||
|
||||
// Load script module registration.
|
||||
$modules_file = __DIR__ . '/modules.php';
|
||||
if ( file_exists( $modules_file ) ) {
|
||||
require_once $modules_file;
|
||||
}
|
||||
|
||||
// Load script registration.
|
||||
$scripts_file = __DIR__ . '/scripts.php';
|
||||
if ( file_exists( $scripts_file ) ) {
|
||||
require_once $scripts_file;
|
||||
}
|
||||
|
||||
// Load style registration.
|
||||
$styles_file = __DIR__ . '/styles.php';
|
||||
if ( file_exists( $styles_file ) ) {
|
||||
require_once $styles_file;
|
||||
}
|
||||
|
||||
// Load routes registration.
|
||||
$routes_file = __DIR__ . '/routes.php';
|
||||
if ( file_exists( $routes_file ) ) {
|
||||
require_once $routes_file;
|
||||
}
|
||||
|
||||
// Load widgets registration.
|
||||
$widgets_file = __DIR__ . '/widgets.php';
|
||||
if ( file_exists( $widgets_file ) ) {
|
||||
require_once $widgets_file;
|
||||
}
|
||||
|
||||
// Load pages registration.
|
||||
$pages_file = __DIR__ . '/pages.php';
|
||||
if ( file_exists( $pages_file ) ) {
|
||||
require_once $pages_file;
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* Plugin constants - Auto-generated by build process.
|
||||
* Do not edit this file manually.
|
||||
*
|
||||
* Returns an array of constants for use in other templates.
|
||||
*
|
||||
* @package jetpack_videopress
|
||||
*/
|
||||
|
||||
return array(
|
||||
'version' => '0.38.2',
|
||||
'build_url' => plugin_dir_url( __FILE__ ),
|
||||
);
|
||||
+1
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array(), 'version' => '282f1be8e4fc8d45ff1b');
|
||||
+1
@@ -0,0 +1 @@
|
||||
body.jetpack_page_jetpack-videopress{--vp-page-bg-canvas:#fcfcfc;--font-headline-medium:48px;--font-headline-small:36px;--font-title-medium:24px;--font-body-small:14px;--font-body-extra-small:14px;--spacing-base:8px}body.jetpack_page_jetpack-videopress #wpcontent{padding-left:0}body.jetpack_page_jetpack-videopress #screen-meta-links,body.jetpack_page_jetpack-videopress #wpfooter{display:none}body.jetpack_page_jetpack-videopress #wpbody-content{bottom:0;box-sizing:border-box;display:flex;flex-direction:column;left:160px;overflow:hidden;padding-bottom:0;position:fixed;right:0;top:32px;width:auto}body.jetpack_page_jetpack-videopress.folded #wpbody-content{left:36px}@media(max-width:960px){body.jetpack_page_jetpack-videopress.auto-fold #wpbody-content{left:36px}}@media(min-width:961px){body.jetpack_page_jetpack-videopress.is-nav-unification:not(.folded) #wpbody-content{left:272px}}body.jetpack_page_jetpack-videopress #wpbody-content :has(.jp-admin-page):not(:has(.boot-layout__stage)){display:flex;flex:1 1 auto;flex-direction:column;min-height:0;min-width:0}body.jetpack_page_jetpack-videopress .jp-admin-page{display:flex;flex:1 1 auto;flex-direction:column;margin-left:0;min-height:0;min-width:0;overflow:visible}body.jetpack_page_jetpack-videopress .jp-admin-page__page{display:flex;flex:1 1 auto;flex-direction:column;min-height:0;min-width:0}body.jetpack_page_jetpack-videopress .jp-admin-page__page>:first-child{flex-shrink:0}body.jetpack_page_jetpack-videopress .jp-admin-page__page:has(.jp-admin-page-tabs)>:first-child{border-bottom:none;padding-bottom:0}body.jetpack_page_jetpack-videopress .jp-admin-page__page>:not(:first-child):not(.jetpack-footer){display:flex;flex:1 1 auto;flex-direction:column;min-height:0;min-width:0;overflow:auto}body.jetpack_page_jetpack-videopress .jp-admin-page__page>:not(:first-child):not(.jetpack-footer)>*{display:flex;flex:1 1 auto;flex-direction:column;min-height:0;min-width:0}body.jetpack_page_jetpack-videopress .jetpack-footer{flex-shrink:0}body.jetpack_page_jetpack-videopress .jp-admin-page-tabs{background:var(--wpds-color-bg-surface-neutral-strong);border-bottom:var(--wpds-border-width-xs) solid var(--wpds-color-stroke-surface-neutral-weak);padding-inline:8px;position:sticky;top:0;z-index:10}body.jetpack_page_jetpack-videopress .jp-admin-page-tabs--minimal{padding-inline:24px}body.jetpack_page_jetpack-videopress .jp-admin-page-tabs [role=tab]{font-size:13px}@media(max-width:782px){body.jetpack_page_jetpack-videopress #wpbody-content,body.jetpack_page_jetpack-videopress.auto-fold #wpbody-content,body.jetpack_page_jetpack-videopress.folded #wpbody-content{left:0;top:46px}body.jetpack_page_jetpack-videopress .jp-admin-page{margin-left:0}}body.jetpack_page_jetpack-videopress nav[aria-label=Breadcrumbs] li{margin:0}body.jetpack_page_jetpack-videopress nav[aria-label=Breadcrumbs] a{text-decoration:none}body.jetpack_page_jetpack-videopress nav[aria-label=Breadcrumbs] a:focus-visible,body.jetpack_page_jetpack-videopress nav[aria-label=Breadcrumbs] a:hover{text-decoration:underline}body.jetpack_page_jetpack-videopress,body.jetpack_page_jetpack-videopress .jp-admin-page,body.jetpack_page_jetpack-videopress .jp-admin-page__page{background-color:var(--vp-page-bg-canvas)}
|
||||
+1
@@ -0,0 +1 @@
|
||||
body.jetpack_page_jetpack-videopress{--vp-page-bg-canvas:#fcfcfc;--font-headline-medium:48px;--font-headline-small:36px;--font-title-medium:24px;--font-body-small:14px;--font-body-extra-small:14px;--spacing-base:8px}body.jetpack_page_jetpack-videopress #wpcontent{padding-right:0}body.jetpack_page_jetpack-videopress #screen-meta-links,body.jetpack_page_jetpack-videopress #wpfooter{display:none}body.jetpack_page_jetpack-videopress #wpbody-content{bottom:0;box-sizing:border-box;display:flex;flex-direction:column;left:0;overflow:hidden;padding-bottom:0;position:fixed;right:160px;top:32px;width:auto}body.jetpack_page_jetpack-videopress.folded #wpbody-content{right:36px}@media(max-width:960px){body.jetpack_page_jetpack-videopress.auto-fold #wpbody-content{right:36px}}@media(min-width:961px){body.jetpack_page_jetpack-videopress.is-nav-unification:not(.folded) #wpbody-content{right:272px}}body.jetpack_page_jetpack-videopress #wpbody-content :has(.jp-admin-page):not(:has(.boot-layout__stage)){display:flex;flex:1 1 auto;flex-direction:column;min-height:0;min-width:0}body.jetpack_page_jetpack-videopress .jp-admin-page{display:flex;flex:1 1 auto;flex-direction:column;margin-right:0;min-height:0;min-width:0;overflow:visible}body.jetpack_page_jetpack-videopress .jp-admin-page__page{display:flex;flex:1 1 auto;flex-direction:column;min-height:0;min-width:0}body.jetpack_page_jetpack-videopress .jp-admin-page__page>:first-child{flex-shrink:0}body.jetpack_page_jetpack-videopress .jp-admin-page__page:has(.jp-admin-page-tabs)>:first-child{border-bottom:none;padding-bottom:0}body.jetpack_page_jetpack-videopress .jp-admin-page__page>:not(:first-child):not(.jetpack-footer){display:flex;flex:1 1 auto;flex-direction:column;min-height:0;min-width:0;overflow:auto}body.jetpack_page_jetpack-videopress .jp-admin-page__page>:not(:first-child):not(.jetpack-footer)>*{display:flex;flex:1 1 auto;flex-direction:column;min-height:0;min-width:0}body.jetpack_page_jetpack-videopress .jetpack-footer{flex-shrink:0}body.jetpack_page_jetpack-videopress .jp-admin-page-tabs{background:var(--wpds-color-bg-surface-neutral-strong);border-bottom:var(--wpds-border-width-xs) solid var(--wpds-color-stroke-surface-neutral-weak);padding-inline:8px;position:sticky;top:0;z-index:10}body.jetpack_page_jetpack-videopress .jp-admin-page-tabs--minimal{padding-inline:24px}body.jetpack_page_jetpack-videopress .jp-admin-page-tabs [role=tab]{font-size:13px}@media(max-width:782px){body.jetpack_page_jetpack-videopress #wpbody-content,body.jetpack_page_jetpack-videopress.auto-fold #wpbody-content,body.jetpack_page_jetpack-videopress.folded #wpbody-content{right:0;top:46px}body.jetpack_page_jetpack-videopress .jp-admin-page{margin-right:0}}body.jetpack_page_jetpack-videopress nav[aria-label=Breadcrumbs] li{margin:0}body.jetpack_page_jetpack-videopress nav[aria-label=Breadcrumbs] a{text-decoration:none}body.jetpack_page_jetpack-videopress nav[aria-label=Breadcrumbs] a:focus-visible,body.jetpack_page_jetpack-videopress nav[aria-label=Breadcrumbs] a:hover{text-decoration:underline}body.jetpack_page_jetpack-videopress,body.jetpack_page_jetpack-videopress .jp-admin-page,body.jetpack_page_jetpack-videopress .jp-admin-page__page{background-color:var(--vp-page-bg-canvas)}
|
||||
+1
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array('divi-vendor-wp-hooks', 'divi-vendor-wp-i18n', 'react', 'react-jsx-runtime'), 'version' => 'fe8c340990d821843340');
|
||||
+2
File diff suppressed because one or more lines are too long
+30
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"advanced": {
|
||||
"admin_label": "module.meta.adminLabel",
|
||||
"animation": "module.decoration.animation",
|
||||
"background": "module.decoration.background",
|
||||
"disabled_on": "module.decoration.disabledOn",
|
||||
"module": "module.advanced.htmlAttributes",
|
||||
"overflow": "module.decoration.overflow",
|
||||
"position_fields": "module.decoration.position",
|
||||
"scroll": "module.decoration.scroll",
|
||||
"sticky": "module.decoration.sticky",
|
||||
"transform": "module.decoration.transform",
|
||||
"transition": "module.decoration.transition",
|
||||
"z_index": "module.decoration.zIndex",
|
||||
"margin_padding": "module.decoration.spacing",
|
||||
"max_width": "module.decoration.sizing",
|
||||
"height": "module.decoration.sizing",
|
||||
"box_shadow": { "default": "module.decoration.boxShadow" },
|
||||
"borders": { "default": "module.decoration.border" },
|
||||
"filters": { "default": "module.decoration.filters" }
|
||||
},
|
||||
"css": {
|
||||
"after": "css.*.after",
|
||||
"before": "css.*.before",
|
||||
"main_element": "css.*.mainElement"
|
||||
},
|
||||
"module": {
|
||||
"guid": "guid.innerContent.*"
|
||||
}
|
||||
}
|
||||
+231
@@ -0,0 +1,231 @@
|
||||
{
|
||||
"name": "jetpack/videopress",
|
||||
"d4Shortcode": "divi_videopress",
|
||||
"title": "VideoPress",
|
||||
"titles": "VideoPress",
|
||||
"moduleIcon": "jetpack/videopress-logo",
|
||||
"moduleClassName": "et_pb_videopress",
|
||||
"moduleOrderClassName": "et_pb_videopress",
|
||||
"category": "module",
|
||||
"attributes": {
|
||||
"module": {
|
||||
"type": "object",
|
||||
"selector": "{{selector}}",
|
||||
"styleProps": {
|
||||
"sizing": {
|
||||
"propertySelectors": {
|
||||
"desktop": {
|
||||
"value": {
|
||||
"margin-left": "{{selector}}.et_pb_module",
|
||||
"margin-right": "{{selector}}.et_pb_module"
|
||||
}
|
||||
}
|
||||
},
|
||||
"important": {
|
||||
"desktop": {
|
||||
"value": {
|
||||
"margin-left": true,
|
||||
"margin-right": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"meta": {
|
||||
"adminLabel": {}
|
||||
},
|
||||
"advanced": {
|
||||
"htmlAttributes": {}
|
||||
},
|
||||
"decoration": {
|
||||
"background": {},
|
||||
"sizing": {},
|
||||
"spacing": {},
|
||||
"border": {},
|
||||
"boxShadow": {},
|
||||
"filters": {},
|
||||
"transform": {},
|
||||
"animation": {},
|
||||
"overflow": {},
|
||||
"disabledOn": {},
|
||||
"transition": {},
|
||||
"position": {},
|
||||
"zIndex": {},
|
||||
"scroll": {},
|
||||
"sticky": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"guid": {
|
||||
"type": "object",
|
||||
"selector": "{{selector}} .vidi-videopress-wrapper",
|
||||
"settings": {
|
||||
"innerContent": {
|
||||
"groupType": "group-item",
|
||||
"item": {
|
||||
"groupName": "mainContent",
|
||||
"attrName": "guid.innerContent",
|
||||
"priority": 10,
|
||||
"render": true,
|
||||
"label": "URL or Video ID",
|
||||
"description": "Paste a VideoPress URL or Video ID.",
|
||||
"features": {
|
||||
"sticky": false,
|
||||
"dynamicContent": false,
|
||||
"responsive": false
|
||||
},
|
||||
"component": {
|
||||
"name": "divi/text",
|
||||
"type": "field"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"autoplay": {
|
||||
"type": "object",
|
||||
"settings": {
|
||||
"innerContent": {
|
||||
"groupType": "group-item",
|
||||
"item": {
|
||||
"groupSlug": "playerOptions",
|
||||
"attrName": "autoplay.innerContent",
|
||||
"priority": 10,
|
||||
"render": true,
|
||||
"label": "Autoplay",
|
||||
"description": "Start playing the video automatically.",
|
||||
"features": {
|
||||
"sticky": false,
|
||||
"responsive": false
|
||||
},
|
||||
"component": {
|
||||
"name": "divi/toggle",
|
||||
"type": "field"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"loop": {
|
||||
"type": "object",
|
||||
"settings": {
|
||||
"innerContent": {
|
||||
"groupType": "group-item",
|
||||
"item": {
|
||||
"groupSlug": "playerOptions",
|
||||
"attrName": "loop.innerContent",
|
||||
"priority": 20,
|
||||
"render": true,
|
||||
"label": "Loop",
|
||||
"description": "Restart the video when it reaches the end.",
|
||||
"features": {
|
||||
"sticky": false,
|
||||
"responsive": false
|
||||
},
|
||||
"component": {
|
||||
"name": "divi/toggle",
|
||||
"type": "field"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"muted": {
|
||||
"type": "object",
|
||||
"settings": {
|
||||
"innerContent": {
|
||||
"groupType": "group-item",
|
||||
"item": {
|
||||
"groupSlug": "playerOptions",
|
||||
"attrName": "muted.innerContent",
|
||||
"priority": 30,
|
||||
"render": true,
|
||||
"label": "Muted",
|
||||
"description": "Start the video without sound.",
|
||||
"features": {
|
||||
"sticky": false,
|
||||
"responsive": false
|
||||
},
|
||||
"component": {
|
||||
"name": "divi/toggle",
|
||||
"type": "field"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"controls": {
|
||||
"type": "object",
|
||||
"settings": {
|
||||
"innerContent": {
|
||||
"groupType": "group-item",
|
||||
"item": {
|
||||
"groupSlug": "playerOptions",
|
||||
"attrName": "controls.innerContent",
|
||||
"priority": 40,
|
||||
"render": true,
|
||||
"label": "Player Controls",
|
||||
"description": "Show the playback controls.",
|
||||
"features": {
|
||||
"sticky": false,
|
||||
"responsive": false
|
||||
},
|
||||
"component": {
|
||||
"name": "divi/toggle",
|
||||
"type": "field"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"playsinline": {
|
||||
"type": "object",
|
||||
"settings": {
|
||||
"innerContent": {
|
||||
"groupType": "group-item",
|
||||
"item": {
|
||||
"groupSlug": "playerOptions",
|
||||
"attrName": "playsinline.innerContent",
|
||||
"priority": 50,
|
||||
"render": true,
|
||||
"label": "Play Inline",
|
||||
"description": "Play the video inline on mobile instead of fullscreen.",
|
||||
"features": {
|
||||
"sticky": false,
|
||||
"responsive": false
|
||||
},
|
||||
"component": {
|
||||
"name": "divi/toggle",
|
||||
"type": "field"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"customCssFields": {
|
||||
"videoPlayer": {
|
||||
"subName": "videoPlayer",
|
||||
"selectorSuffix": " .vidi-videopress-wrapper"
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"content": "auto",
|
||||
"design": "auto",
|
||||
"advanced": "auto",
|
||||
"groups": {
|
||||
"playerOptions": {
|
||||
"panel": "content",
|
||||
"priority": 20,
|
||||
"groupName": "playerOptions",
|
||||
"component": {
|
||||
"name": "divi/composite",
|
||||
"props": {
|
||||
"groupLabel": "Player"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array('jquery', 'react', 'react-jsx-runtime'), 'version' => '2527ba26443b669a5a21');
|
||||
+1
@@ -0,0 +1 @@
|
||||
.vidi-videopress-wrapper{height:0;padding-bottom:56.25%;position:relative;width:100%}.vidi-videopress-wrapper iframe{height:100%;left:0;position:absolute;top:0;width:100%}
|
||||
+1
@@ -0,0 +1 @@
|
||||
(()=>{"use strict";var e={6110(){},2312(e,r,s){s.d(r,{A:()=>t});const t=[s(8933).A]},8933(e,r,s){s.d(r,{A:()=>n});var t=s(1609),o=(s(6110),s(790));const i=/^(?:(?:http(?:s)?:\/\/)?(?:www\.)?video(?:\.word)?press\.com\/(?:v|embed)\/)?([a-zA-Z\d]+)(?:.*)?/i;class d extends t.Component{static slug="divi_videopress";render(){let e=this.props.guid;if(!e)return null;const r=e.match(i);if(!r||!r[1])return null;e=r[1];const s="https://videopress.com/embed/"+e+"?autoPlay=0&permalink=0&loop=0&embedder=divi-builder",t=`VideoPress video ${e}`;return(0,o.jsxs)("div",{className:"vidi-videopress-wrapper",children:[(0,o.jsx)("iframe",{title:t,src:s,width:"100%",height:"100%"}),(0,o.jsx)("script",{src:"https://en.wordpress.com/wp-content/plugins/video/assets/js/next/videopress-iframe.js?m=1658739239"})]})}}const n=d},1609(e){e.exports=window.React},790(e){e.exports=window.ReactJSXRuntime},428(e){e.exports=window.jQuery}},r={};function s(t){var o=r[t];if(void 0!==o)return o.exports;var i=r[t]={exports:{}};return e[t](i,i.exports,s),i.exports}s.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return s.d(r,{a:r}),r},s.d=(e,r)=>{for(var t in r)s.o(r,t)&&!s.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},s.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r);var t=s(428),o=s.n(t),i=s(2312);o()(window).on("et_builder_api_ready",(e,r)=>{r.registerModules(i.A)})})();
|
||||
+1
@@ -0,0 +1 @@
|
||||
.vidi-videopress-wrapper{height:0;padding-bottom:56.25%;position:relative;width:100%}.vidi-videopress-wrapper iframe{height:100%;position:absolute;right:0;top:0;width:100%}
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 38 KiB |
+17
@@ -0,0 +1,17 @@
|
||||
<svg width="380" height="183" viewBox="0 0 380 183" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g opacity="0.75" filter="url(#filter0_f_5953_11924)">
|
||||
<path d="M360 -60C360 7.93102 304.931 63 237 63C169.069 63 114 7.93102 114 -60C114 -127.931 169.069 -183 237 -183C304.931 -183 360 -127.931 360 -60Z" fill="url(#paint0_linear_5953_11924)"/>
|
||||
</g>
|
||||
<defs>
|
||||
<filter id="filter0_f_5953_11924" x="-6" y="-303" width="486" height="486" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
|
||||
<feGaussianBlur stdDeviation="60" result="effect1_foregroundBlur_5953_11924"/>
|
||||
</filter>
|
||||
<linearGradient id="paint0_linear_5953_11924" x1="360" y1="-60" x2="114" y2="-60" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#48FF50"/>
|
||||
<stop offset="0.471846" stop-color="#108642"/>
|
||||
<stop offset="1" stop-color="#2E38FA"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 990 B |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
+1
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array('wp-polyfill'), 'version' => '687ee611e76167057815');
|
||||
+1
File diff suppressed because one or more lines are too long
+1
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array('wp-polyfill'), 'version' => 'd641d321fde6d46173aa');
|
||||
+1
File diff suppressed because one or more lines are too long
+63
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
/**
|
||||
* Script module registration - Auto-generated by build process.
|
||||
* Do not edit this file manually.
|
||||
*
|
||||
* @package jetpack_videopress
|
||||
*/
|
||||
|
||||
/**
|
||||
* Register all script modules.
|
||||
*/
|
||||
function jetpack_videopress_register_script_modules() {
|
||||
// Ensure this only runs once. wp_default_scripts can fire multiple times,
|
||||
// and each wp_deregister_script_module() call also dequeues the module.
|
||||
// If a module was enqueued between calls, repeated deregister/register
|
||||
// cycles would lose the enqueue state.
|
||||
static $already_registered = false;
|
||||
if ( $already_registered ) {
|
||||
return;
|
||||
}
|
||||
$already_registered = true;
|
||||
|
||||
// Load build constants
|
||||
$constants_file = __DIR__ . '/constants.php';
|
||||
if ( ! file_exists( $constants_file ) ) {
|
||||
return;
|
||||
}
|
||||
$build_constants = require $constants_file;
|
||||
$modules_dir = __DIR__ . '/modules';
|
||||
$modules_file = $modules_dir . '/registry.php';
|
||||
|
||||
if ( ! file_exists( $modules_file ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$modules = require $modules_file;
|
||||
$base_url = $build_constants['build_url'] . 'modules/';
|
||||
|
||||
foreach ( $modules as $module ) {
|
||||
// WASM-only modules (e.g., vips worker) only have .min.js; use it even when SCRIPT_DEBUG is `true`.
|
||||
$extension = '.min.js';
|
||||
|
||||
$asset_path = $modules_dir . '/' . $module['asset'];
|
||||
$asset = file_exists( $asset_path ) ? require $asset_path : array();
|
||||
|
||||
// Deregister first to override any previously registered version
|
||||
// (e.g., Core's default modules when running as a plugin).
|
||||
wp_deregister_script_module( $module['id'] );
|
||||
|
||||
wp_register_script_module(
|
||||
$module['id'],
|
||||
$base_url . $module['path'] . $extension,
|
||||
$asset['module_dependencies'] ?? array(),
|
||||
$asset['version'] ?? false,
|
||||
array(
|
||||
'fetchpriority' => 'low',
|
||||
'in_footer' => true,
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
add_action( 'wp_default_scripts', 'jetpack_videopress_register_script_modules' );
|
||||
+1
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-commands', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-editor', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-primitives', 'wp-private-apis', 'wp-theme', 'wp-url'), 'module_dependencies' => array(array('id' => '@wordpress/a11y', 'import' => 'static'), array('id' => '@wordpress/lazy-editor', 'import' => 'dynamic'), array('id' => '@wordpress/route', 'import' => 'static')), 'version' => '188faf6c64fdd1b4');
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* Script module registry - Auto-generated by build process.
|
||||
* Do not edit this file manually.
|
||||
*
|
||||
* @package jetpack_videopress
|
||||
*/
|
||||
|
||||
return array(
|
||||
|
||||
);
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* Pages loader - Auto-generated by build process.
|
||||
* Do not edit this file manually.
|
||||
*
|
||||
* @package jetpack_videopress
|
||||
*/
|
||||
|
||||
foreach ( [
|
||||
__DIR__ . '/pages/jetpack-videopress-dashboard/page.php',
|
||||
__DIR__ . '/pages/jetpack-videopress-dashboard/page-wp-admin.php',
|
||||
] as $file ) {
|
||||
if ( file_exists( $file ) ) {
|
||||
require_once $file;
|
||||
}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
// Empty module loader for page dependencies
|
||||
+317
@@ -0,0 +1,317 @@
|
||||
<?php
|
||||
/**
|
||||
* Page: jetpack-videopress-dashboard (wp-admin integrated)
|
||||
* Auto-generated by build process.
|
||||
* Do not edit this file manually.
|
||||
*
|
||||
* This version integrates with the standard WordPress admin interface,
|
||||
* keeping the wp-admin sidebar and scripts/styles intact.
|
||||
*
|
||||
* @package jetpack_videopress
|
||||
*/
|
||||
|
||||
// Global storage for jetpack-videopress-dashboard routes and menu items
|
||||
global $jetpack_videopress_jetpack_videopress_dashboard_wp_admin_routes, $jetpack_videopress_jetpack_videopress_dashboard_wp_admin_menu_items;
|
||||
$jetpack_videopress_jetpack_videopress_dashboard_wp_admin_routes = array();
|
||||
$jetpack_videopress_jetpack_videopress_dashboard_wp_admin_menu_items = array();
|
||||
|
||||
/**
|
||||
* Register a route for the jetpack-videopress-dashboard-wp-admin page.
|
||||
*
|
||||
* @param string $path Route path (e.g., '/types/$type/edit/$id').
|
||||
* @param string|null $content_module Script module ID for content (stage/inspector).
|
||||
* @param string|null $route_module Script module ID for route lifecycle hooks.
|
||||
*/
|
||||
function jetpack_videopress_register_jetpack_videopress_dashboard_wp_admin_route( $path, $content_module = null, $route_module = null ) {
|
||||
global $jetpack_videopress_jetpack_videopress_dashboard_wp_admin_routes;
|
||||
|
||||
$route = array( 'path' => $path );
|
||||
if ( ! empty( $content_module ) ) {
|
||||
$route['content_module'] = $content_module;
|
||||
}
|
||||
if ( ! empty( $route_module ) ) {
|
||||
$route['route_module'] = $route_module;
|
||||
}
|
||||
|
||||
$jetpack_videopress_jetpack_videopress_dashboard_wp_admin_routes[] = $route;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a menu item for the jetpack-videopress-dashboard-wp-admin page.
|
||||
* Note: Menu items are registered but not displayed in single-page mode.
|
||||
*
|
||||
* @param string $id Menu item ID.
|
||||
* @param string $label Display label.
|
||||
* @param string $to Route path to navigate to.
|
||||
* @param string $parent_id Optional. Parent menu item ID.
|
||||
*/
|
||||
function jetpack_videopress_register_jetpack_videopress_dashboard_wp_admin_menu_item( $id, $label, $to, $parent_id = '' ) {
|
||||
global $jetpack_videopress_jetpack_videopress_dashboard_wp_admin_menu_items;
|
||||
|
||||
$menu_item = array(
|
||||
'id' => $id,
|
||||
'label' => $label,
|
||||
'to' => $to,
|
||||
);
|
||||
|
||||
if ( ! empty( $parent_id ) ) {
|
||||
$menu_item['parent'] = $parent_id;
|
||||
}
|
||||
|
||||
$jetpack_videopress_jetpack_videopress_dashboard_wp_admin_menu_items[] = $menu_item;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all registered routes for the jetpack-videopress-dashboard-wp-admin page.
|
||||
*
|
||||
* @return array Array of route objects.
|
||||
*/
|
||||
function jetpack_videopress_get_jetpack_videopress_dashboard_wp_admin_routes() {
|
||||
global $jetpack_videopress_jetpack_videopress_dashboard_wp_admin_routes;
|
||||
return $jetpack_videopress_jetpack_videopress_dashboard_wp_admin_routes ?? array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all registered menu items for the jetpack-videopress-dashboard-wp-admin page.
|
||||
*
|
||||
* @return array Array of menu item objects.
|
||||
*/
|
||||
function jetpack_videopress_get_jetpack_videopress_dashboard_wp_admin_menu_items() {
|
||||
global $jetpack_videopress_jetpack_videopress_dashboard_wp_admin_menu_items;
|
||||
return $jetpack_videopress_jetpack_videopress_dashboard_wp_admin_menu_items ?? array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Preload REST API data for the jetpack-videopress-dashboard-wp-admin page.
|
||||
* Automatically called during page rendering.
|
||||
*/
|
||||
function jetpack_videopress_jetpack_videopress_dashboard_wp_admin_preload_data() {
|
||||
// Define paths to preload - same for all pages
|
||||
// Please also change packages/core-data/src/entities.js when changing this.
|
||||
$preload_paths = array(
|
||||
'/?_fields=description,gmt_offset,home,image_sizes,image_size_threshold,name,site_icon,site_icon_url,site_logo,timezone_string,url,page_for_posts,page_on_front,show_on_front',
|
||||
array( '/wp/v2/settings', 'OPTIONS' ),
|
||||
);
|
||||
|
||||
// Use rest_preload_api_request to gather the preloaded data
|
||||
$preload_data = array_reduce(
|
||||
$preload_paths,
|
||||
'rest_preload_api_request',
|
||||
array()
|
||||
);
|
||||
|
||||
// Register the preloading middleware with wp-api-fetch
|
||||
wp_add_inline_script(
|
||||
'wp-api-fetch',
|
||||
sprintf(
|
||||
'wp.apiFetch.use( wp.apiFetch.createPreloadingMiddleware( %s ) );',
|
||||
wp_json_encode( $preload_data )
|
||||
),
|
||||
'after'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Enqueue scripts and styles for the jetpack-videopress-dashboard-wp-admin page.
|
||||
* Hooked to admin_enqueue_scripts.
|
||||
*
|
||||
* @param string $hook_suffix The current admin page.
|
||||
*/
|
||||
function jetpack_videopress_jetpack_videopress_dashboard_wp_admin_enqueue_scripts( $hook_suffix ) {
|
||||
// Check all possible ways this page can be accessed:
|
||||
// 1. Menu page via admin.php?page=jetpack-videopress-dashboard-wp-admin (plugin)
|
||||
// 2. Direct file via jetpack-videopress-dashboard.php (Core) - screen ID will be 'jetpack-videopress-dashboard'
|
||||
$current_screen = get_current_screen();
|
||||
$is_our_page = (
|
||||
( isset( $_GET['page'] ) && 'jetpack-videopress-dashboard-wp-admin' === $_GET['page'] ) || // phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
||||
( $current_screen && 'jetpack-videopress-dashboard' === $current_screen->id )
|
||||
);
|
||||
|
||||
if ( ! $is_our_page ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Load build constants
|
||||
$build_constants = require __DIR__ . '/../../constants.php';
|
||||
|
||||
/**
|
||||
* Fires when the jetpack-videopress-dashboard admin page is initialized so extensions can register routes and menu items.
|
||||
*/
|
||||
do_action( 'jetpack-videopress-dashboard-wp-admin_init' );
|
||||
|
||||
// Preload REST API data
|
||||
jetpack_videopress_jetpack_videopress_dashboard_wp_admin_preload_data();
|
||||
|
||||
// Get all registered routes
|
||||
$routes = jetpack_videopress_get_jetpack_videopress_dashboard_wp_admin_routes();
|
||||
|
||||
// Get boot module asset file for dependencies
|
||||
$asset_file = __DIR__ . '/../../modules/boot/index.min.asset.php';
|
||||
if ( file_exists( $asset_file ) ) {
|
||||
$asset = require $asset_file;
|
||||
|
||||
// This script serves two purposes:
|
||||
// 1. It ensures all the globals that are made available to the modules are loaded.
|
||||
// 2. It initializes the boot module as an inline script.
|
||||
wp_register_script( 'jetpack-videopress-dashboard-wp-admin-prerequisites', '', $asset['dependencies'], $asset['version'], true );
|
||||
|
||||
/*
|
||||
* Add inline script to initialize the app using initSinglePage (no menuItems).
|
||||
* The dynamic import is deferred until DOMContentLoaded so that all classic
|
||||
* script dependencies of @wordpress/boot (wp-private-apis, wp-components,
|
||||
* wp-theme, etc.) have finished parsing and executing before the boot module
|
||||
* evaluates. Otherwise, a modulepreloaded @wordpress/boot can win the race
|
||||
* against the classic-script-printing pass on fast CDN-fronted hosts in
|
||||
* Chrome, evaluating before wp.theme.privateApis is defined and throwing
|
||||
* "Cannot unlock an undefined object". See <https://core.trac.wordpress.org/ticket/65103>.
|
||||
*/
|
||||
$init_js_function = <<<'JS'
|
||||
( mountId, routes ) => {
|
||||
const run = async () => {
|
||||
const mod = await import( "@wordpress/boot" );
|
||||
mod.initSinglePage( { mountId, routes } );
|
||||
};
|
||||
if ( document.readyState === "loading" ) {
|
||||
document.addEventListener( "DOMContentLoaded", run );
|
||||
} else {
|
||||
run();
|
||||
}
|
||||
}
|
||||
JS;
|
||||
wp_add_inline_script(
|
||||
'jetpack-videopress-dashboard-wp-admin-prerequisites',
|
||||
sprintf(
|
||||
'( %s )( %s, %s );',
|
||||
$init_js_function,
|
||||
wp_json_encode( 'jetpack-videopress-dashboard-wp-admin-app', JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ),
|
||||
wp_json_encode( $routes, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES )
|
||||
)
|
||||
);
|
||||
|
||||
// Register prerequisites style by filtering script dependencies to find registered styles
|
||||
$style_dependencies = array_filter(
|
||||
$asset['dependencies'],
|
||||
function ( $handle ) {
|
||||
return wp_style_is( $handle, 'registered' );
|
||||
}
|
||||
);
|
||||
wp_register_style( 'jetpack-videopress-dashboard-wp-admin-prerequisites', false, $style_dependencies, $asset['version'] );
|
||||
|
||||
// Build dependencies for jetpack-videopress-dashboard-wp-admin module
|
||||
$boot_dependencies = array(
|
||||
array(
|
||||
'import' => 'static',
|
||||
'id' => '@wordpress/boot',
|
||||
),
|
||||
);
|
||||
|
||||
// Add all registered routes as dependencies
|
||||
foreach ( $routes as $route ) {
|
||||
if ( isset( $route['route_module'] ) ) {
|
||||
$boot_dependencies[] = array(
|
||||
'import' => 'static',
|
||||
'id' => $route['route_module'],
|
||||
);
|
||||
}
|
||||
if ( isset( $route['content_module'] ) ) {
|
||||
$boot_dependencies[] = array(
|
||||
'import' => 'dynamic',
|
||||
'id' => $route['content_module'],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Filters the boot script-module dependencies for the
|
||||
* jetpack-videopress-dashboard-wp-admin page.
|
||||
*
|
||||
* Surfaces extending this page can append entries to the boot
|
||||
* dependency list. Each entry is an array with 'import' (string
|
||||
* 'static' or 'dynamic') and 'id' (script-module handle) keys.
|
||||
*
|
||||
* @param array $boot_dependencies Boot dependencies for the page.
|
||||
*/
|
||||
$boot_dependencies = apply_filters(
|
||||
'jetpack-videopress-dashboard-wp-admin_boot_dependencies',
|
||||
$boot_dependencies
|
||||
);
|
||||
|
||||
// Dummy script module to ensure dependencies are loaded
|
||||
wp_register_script_module(
|
||||
'jetpack-videopress-dashboard-wp-admin',
|
||||
$build_constants['build_url'] . 'pages/jetpack-videopress-dashboard/loader.js',
|
||||
$boot_dependencies
|
||||
);
|
||||
|
||||
// Enqueue the boot scripts and styles
|
||||
wp_enqueue_script( 'jetpack-videopress-dashboard-wp-admin-prerequisites' );
|
||||
wp_enqueue_script_module( 'jetpack-videopress-dashboard-wp-admin' );
|
||||
wp_enqueue_style( 'jetpack-videopress-dashboard-wp-admin-prerequisites' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the jetpack-videopress-dashboard-wp-admin page.
|
||||
* Call this function from add_menu_page or add_submenu_page.
|
||||
* This renders within the normal WordPress admin interface.
|
||||
*/
|
||||
function jetpack_videopress_jetpack_videopress_dashboard_wp_admin_render_page() {
|
||||
?>
|
||||
<style>
|
||||
/* Critical styles to prevent layout shifts - inlined for immediate application */
|
||||
|
||||
#wpwrap {
|
||||
overflow-y: auto;
|
||||
}
|
||||
body {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
/* Reset wp-admin padding */
|
||||
#wpcontent {
|
||||
padding-inline-start: 0;
|
||||
}
|
||||
#wpbody-content {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
/* Hide legacy admin elements */
|
||||
#wpbody-content > div:not(.boot-layout-container):not(#screen-meta) {
|
||||
display: none;
|
||||
}
|
||||
#wpfooter {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Accessibility regions */
|
||||
.a11y-speak-region {
|
||||
inset-inline-start: -1px;
|
||||
top: -1px;
|
||||
}
|
||||
|
||||
/* Admin menu indicators */
|
||||
ul#adminmenu a.wp-has-current-submenu::after,
|
||||
ul#adminmenu > li.current > a.current::after {
|
||||
border-inline-end-color: #fff;
|
||||
}
|
||||
|
||||
/* Media frame fix */
|
||||
.media-frame select.attachment-filters:last-of-type {
|
||||
width: auto;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
/* Responsive overflow fix for #wpwrap */
|
||||
@media (min-width: 782px) {
|
||||
#wpwrap {
|
||||
overflow-y: initial;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<div id="jetpack-videopress-dashboard-wp-admin-app" class="boot-layout-container"></div>
|
||||
<?php
|
||||
}
|
||||
|
||||
// Hook the enqueue function to admin_enqueue_scripts
|
||||
add_action( 'admin_enqueue_scripts', 'jetpack_videopress_jetpack_videopress_dashboard_wp_admin_enqueue_scripts' );
|
||||
|
||||
+318
@@ -0,0 +1,318 @@
|
||||
<?php
|
||||
/**
|
||||
* Page: jetpack-videopress-dashboard
|
||||
* Auto-generated by build process.
|
||||
* Do not edit this file manually.
|
||||
*
|
||||
* @package jetpack_videopress
|
||||
*/
|
||||
|
||||
// Global storage for jetpack-videopress-dashboard routes and menu items
|
||||
global $jetpack_videopress_jetpack_videopress_dashboard_routes, $jetpack_videopress_jetpack_videopress_dashboard_menu_items;
|
||||
$jetpack_videopress_jetpack_videopress_dashboard_routes = array();
|
||||
$jetpack_videopress_jetpack_videopress_dashboard_menu_items = array();
|
||||
|
||||
/**
|
||||
* Register a route for the jetpack-videopress-dashboard page.
|
||||
*
|
||||
* @param string $path Route path (e.g., '/types/$type/edit/$id').
|
||||
* @param string|null $content_module Script module ID for content (stage/inspector).
|
||||
* @param string|null $route_module Script module ID for route lifecycle hooks.
|
||||
*/
|
||||
function jetpack_videopress_register_jetpack_videopress_dashboard_route( $path, $content_module = null, $route_module = null ) {
|
||||
global $jetpack_videopress_jetpack_videopress_dashboard_routes;
|
||||
|
||||
$route = array( 'path' => $path );
|
||||
if ( ! empty( $content_module ) ) {
|
||||
$route['content_module'] = $content_module;
|
||||
}
|
||||
if ( ! empty( $route_module ) ) {
|
||||
$route['route_module'] = $route_module;
|
||||
}
|
||||
|
||||
$jetpack_videopress_jetpack_videopress_dashboard_routes[] = $route;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a menu item for the jetpack-videopress-dashboard page.
|
||||
*
|
||||
* @param string $id Menu item ID.
|
||||
* @param string $label Display label.
|
||||
* @param string $to Route path to navigate to.
|
||||
* @param string $parent_id Optional. Parent menu item ID.
|
||||
* @param string $parent_type Optional. Parent type: 'drilldown' or 'dropdown'.
|
||||
*/
|
||||
function jetpack_videopress_register_jetpack_videopress_dashboard_menu_item( $id, $label, $to, $parent_id = '', $parent_type = '' ) {
|
||||
global $jetpack_videopress_jetpack_videopress_dashboard_menu_items;
|
||||
|
||||
$menu_item = array(
|
||||
'id' => $id,
|
||||
'label' => $label,
|
||||
'to' => $to,
|
||||
);
|
||||
|
||||
if ( ! empty( $parent_id ) ) {
|
||||
$menu_item['parent'] = $parent_id;
|
||||
}
|
||||
|
||||
if ( ! empty( $parent_type ) && in_array( $parent_type, array( 'drilldown', 'dropdown' ), true ) ) {
|
||||
$menu_item['parent_type'] = $parent_type;
|
||||
}
|
||||
|
||||
$jetpack_videopress_jetpack_videopress_dashboard_menu_items[] = $menu_item;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all registered routes for the jetpack-videopress-dashboard page.
|
||||
*
|
||||
* @return array Array of route objects.
|
||||
*/
|
||||
function jetpack_videopress_get_jetpack_videopress_dashboard_routes() {
|
||||
global $jetpack_videopress_jetpack_videopress_dashboard_routes;
|
||||
return $jetpack_videopress_jetpack_videopress_dashboard_routes ?? array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all registered menu items for the jetpack-videopress-dashboard page.
|
||||
*
|
||||
* @return array Array of menu item objects.
|
||||
*/
|
||||
function jetpack_videopress_get_jetpack_videopress_dashboard_menu_items() {
|
||||
global $jetpack_videopress_jetpack_videopress_dashboard_menu_items;
|
||||
return $jetpack_videopress_jetpack_videopress_dashboard_menu_items ?? array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Preload REST API data for the jetpack-videopress-dashboard page.
|
||||
* Automatically called during page rendering.
|
||||
*/
|
||||
function jetpack_videopress_jetpack_videopress_dashboard_preload_data() {
|
||||
// Define paths to preload - same for all pages
|
||||
// Please also change packages/core-data/src/entities.js when changing this.
|
||||
$preload_paths = array(
|
||||
'/?_fields=description,gmt_offset,home,image_sizes,image_size_threshold,name,site_icon,site_icon_url,site_logo,timezone_string,url,page_for_posts,page_on_front,show_on_front',
|
||||
array( '/wp/v2/settings', 'OPTIONS' ),
|
||||
);
|
||||
|
||||
// Use rest_preload_api_request to gather the preloaded data
|
||||
$preload_data = array_reduce(
|
||||
$preload_paths,
|
||||
'rest_preload_api_request',
|
||||
array()
|
||||
);
|
||||
|
||||
// Register the preloading middleware with wp-api-fetch
|
||||
wp_add_inline_script(
|
||||
'wp-api-fetch',
|
||||
sprintf(
|
||||
'wp.apiFetch.use( wp.apiFetch.createPreloadingMiddleware( %s ) );',
|
||||
wp_json_encode( $preload_data )
|
||||
),
|
||||
'after'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the jetpack-videopress-dashboard page.
|
||||
* Call this function from add_menu_page or add_submenu_page.
|
||||
*/
|
||||
function jetpack_videopress_jetpack_videopress_dashboard_render_page() {
|
||||
// Load build constants
|
||||
$build_constants = require __DIR__ . '/../../constants.php';
|
||||
|
||||
// Set current screen
|
||||
set_current_screen();
|
||||
|
||||
// Remove unwanted deprecated handler
|
||||
remove_action( 'admin_head', 'wp_admin_bar_header' );
|
||||
|
||||
// Remove unwanted scripts and styles that were enqueued during `admin_init`
|
||||
foreach ( wp_scripts()->queue as $script ) {
|
||||
wp_dequeue_script( $script );
|
||||
}
|
||||
foreach ( wp_styles()->queue as $style ) {
|
||||
wp_dequeue_style( $style );
|
||||
}
|
||||
|
||||
/**
|
||||
* Fires when the jetpack-videopress-dashboard page is initialized so extensions can register routes and menu items.
|
||||
*/
|
||||
do_action( 'jetpack-videopress-dashboard_init' );
|
||||
|
||||
// Enqueue command palette assets for boot-based pages
|
||||
if ( function_exists( 'wp_enqueue_command_palette_assets' ) ) {
|
||||
wp_enqueue_command_palette_assets();
|
||||
}
|
||||
|
||||
// Preload REST API data
|
||||
jetpack_videopress_jetpack_videopress_dashboard_preload_data();
|
||||
|
||||
// Get all registered routes and menu items
|
||||
$menu_items = jetpack_videopress_get_jetpack_videopress_dashboard_menu_items();
|
||||
$routes = jetpack_videopress_get_jetpack_videopress_dashboard_routes();
|
||||
|
||||
// Get boot module asset file for dependencies
|
||||
$asset_file = __DIR__ . '/../../modules/boot/index.min.asset.php';
|
||||
if ( file_exists( $asset_file ) ) {
|
||||
$asset = require $asset_file;
|
||||
|
||||
// This script serves two purposes:
|
||||
// 1. It ensures all the globals that are made available to the modules are loaded.
|
||||
// 2. It initializes the boot module as an inline script.
|
||||
wp_register_script( 'jetpack-videopress-dashboard-prerequisites', '', $asset['dependencies'], $asset['version'], true );
|
||||
|
||||
// Add inline script to initialize the app
|
||||
$init_modules = [];
|
||||
wp_add_inline_script(
|
||||
'jetpack-videopress-dashboard-prerequisites',
|
||||
sprintf(
|
||||
'import("@wordpress/boot").then(mod => mod.init({mountId: "%s", menuItems: %s, routes: %s, initModules: %s, dashboardLink: "%s"}));',
|
||||
'jetpack-videopress-dashboard-app',
|
||||
wp_json_encode( $menu_items, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ),
|
||||
wp_json_encode( $routes, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ),
|
||||
wp_json_encode( $init_modules, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ),
|
||||
esc_url( admin_url( '/' ) )
|
||||
)
|
||||
);
|
||||
|
||||
// Register prerequisites style by filtering script dependencies to find registered styles
|
||||
$style_dependencies = array_filter(
|
||||
$asset['dependencies'],
|
||||
function ( $handle ) {
|
||||
return wp_style_is( $handle, 'registered' );
|
||||
}
|
||||
);
|
||||
wp_register_style( 'jetpack-videopress-dashboard-prerequisites', false, $style_dependencies, $asset['version'] );
|
||||
|
||||
// Build dependencies for jetpack-videopress-dashboard module
|
||||
$boot_dependencies = array(
|
||||
array(
|
||||
'import' => 'static',
|
||||
'id' => '@wordpress/boot',
|
||||
),
|
||||
);
|
||||
|
||||
// Add init modules as static dependencies
|
||||
// No init modules configured
|
||||
|
||||
// Add all registered routes as dependencies
|
||||
foreach ( $routes as $route ) {
|
||||
if ( isset( $route['route_module'] ) ) {
|
||||
$boot_dependencies[] = array(
|
||||
'import' => 'static',
|
||||
'id' => $route['route_module'],
|
||||
);
|
||||
}
|
||||
if ( isset( $route['content_module'] ) ) {
|
||||
$boot_dependencies[] = array(
|
||||
'import' => 'dynamic',
|
||||
'id' => $route['content_module'],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Filters the boot script-module dependencies for the
|
||||
* jetpack-videopress-dashboard page.
|
||||
*
|
||||
* Surfaces extending this page can append entries to the boot
|
||||
* dependency list. Each entry is an array with 'import' (string
|
||||
* 'static' or 'dynamic') and 'id' (script-module handle) keys.
|
||||
*
|
||||
* @param array $boot_dependencies Boot dependencies for the page.
|
||||
*/
|
||||
$boot_dependencies = apply_filters(
|
||||
'jetpack-videopress-dashboard_boot_dependencies',
|
||||
$boot_dependencies
|
||||
);
|
||||
|
||||
// Dummy script module to ensure dependencies are loaded
|
||||
wp_register_script_module(
|
||||
'jetpack-videopress-dashboard',
|
||||
$build_constants['build_url'] . 'pages/jetpack-videopress-dashboard/loader.js',
|
||||
$boot_dependencies
|
||||
);
|
||||
|
||||
// Enqueue the boot scripts and styles
|
||||
wp_enqueue_script( 'jetpack-videopress-dashboard-prerequisites' );
|
||||
wp_enqueue_script_module( 'jetpack-videopress-dashboard' );
|
||||
wp_enqueue_style( 'jetpack-videopress-dashboard-prerequisites' );
|
||||
}
|
||||
|
||||
// Output the HTML
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html <?php language_attributes(); ?>>
|
||||
<head>
|
||||
<meta charset="<?php bloginfo( 'charset' ); ?>">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title><?php echo esc_html( get_admin_page_title() ); ?></title>
|
||||
<style>
|
||||
html {
|
||||
background: #f1f1f1;
|
||||
color: #444;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
||||
font-size: 13px;
|
||||
line-height: 1.4em;
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
#wpadminbar { display: none; }
|
||||
</style>
|
||||
<?php
|
||||
global $hook_suffix;
|
||||
// phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
|
||||
$hook_suffix = 'jetpack-videopress-dashboard';
|
||||
|
||||
// BEGIN see wp-admin/admin-header.php
|
||||
print_admin_styles();
|
||||
print_head_scripts();
|
||||
|
||||
/** This action is documented in wp-admin/admin-header.php */
|
||||
do_action( "admin_head-{$hook_suffix}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
|
||||
|
||||
/** This action is documented in wp-admin/admin-header.php */
|
||||
do_action( 'admin_head' );
|
||||
// END see wp-admin/admin-header.php
|
||||
?>
|
||||
</head>
|
||||
<body class="jetpack-videopress-dashboard">
|
||||
<div id="jetpack-videopress-dashboard-app" style="height: 100vh; box-sizing: border-box;"></div>
|
||||
<?php
|
||||
// BEGIN see wp-admin/admin-footer.php
|
||||
|
||||
/** This action is documented in wp-admin/admin-footer.php */
|
||||
do_action( 'admin_footer', '' );
|
||||
|
||||
// Print import map first so it's available for inline scripts
|
||||
wp_script_modules()->print_import_map();
|
||||
print_footer_scripts();
|
||||
wp_script_modules()->print_enqueued_script_modules();
|
||||
wp_script_modules()->print_script_module_preloads();
|
||||
wp_script_modules()->print_script_module_data();
|
||||
|
||||
/** This action is documented in wp-admin/admin-footer.php */
|
||||
do_action( "admin_footer-{$hook_suffix}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
|
||||
// END see wp-admin/admin-footer.php
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Intercept admin_init to render the page early.
|
||||
* This bypasses the default WordPress admin template.
|
||||
*/
|
||||
function jetpack_videopress_jetpack_videopress_dashboard_intercept_render() {
|
||||
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
||||
if ( isset( $_GET['page'] ) && 'jetpack-videopress-dashboard' === $_GET['page'] ) {
|
||||
jetpack_videopress_jetpack_videopress_dashboard_render_page();
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
// Hook the interceptor to admin_init
|
||||
add_action( 'admin_init', 'jetpack_videopress_jetpack_videopress_dashboard_intercept_render' );
|
||||
+113
@@ -0,0 +1,113 @@
|
||||
<?php
|
||||
/**
|
||||
* Routes registration - Auto-generated by build process.
|
||||
* Registers all routes on their respective page init hooks.
|
||||
* Do not edit this file manually.
|
||||
*
|
||||
* @package jetpack_videopress
|
||||
*/
|
||||
|
||||
// Load routes registry
|
||||
$routes_file = __DIR__ . '/routes/registry.php';
|
||||
if ( ! file_exists( $routes_file ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$routes = require $routes_file;
|
||||
|
||||
// Group routes by page and store in globals for page-specific functions
|
||||
$routes_by_page = array();
|
||||
foreach ( $routes as $route ) {
|
||||
$page_slug = $route['page'];
|
||||
if ( ! isset( $routes_by_page[ $page_slug ] ) ) {
|
||||
$routes_by_page[ $page_slug ] = array();
|
||||
}
|
||||
$routes_by_page[ $page_slug ][] = $route;
|
||||
}
|
||||
|
||||
// Store routes data in globals for each page
|
||||
foreach ( $routes_by_page as $page_slug => $page_routes ) {
|
||||
$page_slug_underscore = str_replace( '-', '_', $page_slug );
|
||||
$global_name = 'jetpack_videopress_' . $page_slug_underscore . '_routes_data';
|
||||
$GLOBALS[ $global_name ] = $page_routes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generic helper function to register routes for a page.
|
||||
*
|
||||
* @param array $page_routes Array of route data for the page.
|
||||
* @param string $register_function_name Name of the function to call for registering each route.
|
||||
*/
|
||||
function jetpack_videopress_register_page_routes( $page_routes, $register_function_name ) {
|
||||
// Load build constants
|
||||
$build_constants = require __DIR__ . '/constants.php';
|
||||
|
||||
foreach ( $page_routes as $route ) {
|
||||
$content_handle = null;
|
||||
$route_handle = null;
|
||||
|
||||
// Register content module if exists
|
||||
if ( $route['has_content'] ) {
|
||||
$content_asset_path = __DIR__ . "/routes/{$route['name']}/content.min.asset.php";
|
||||
if ( file_exists( $content_asset_path ) ) {
|
||||
$content_asset = require $content_asset_path;
|
||||
$content_handle = 'jetpack-videopress/routes/' . $route['name'] . '/content';
|
||||
$extension = '.min.js';
|
||||
// Deregister first to override any previously registered version
|
||||
// (e.g., Core's default modules when running as a plugin).
|
||||
wp_deregister_script_module( $content_handle );
|
||||
wp_register_script_module(
|
||||
$content_handle,
|
||||
$build_constants['build_url'] . 'routes/' . $route['name'] . '/content' . $extension,
|
||||
$content_asset['module_dependencies'] ?? array(),
|
||||
$content_asset['version'] ?? false
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Register route module if exists
|
||||
if ( $route['has_route'] ) {
|
||||
$route_asset_path = __DIR__ . "/routes/{$route['name']}/route.min.asset.php";
|
||||
if ( file_exists( $route_asset_path ) ) {
|
||||
$route_asset = require $route_asset_path;
|
||||
$route_handle = 'jetpack-videopress/routes/' . $route['name'] . '/route';
|
||||
$extension = '.min.js';
|
||||
// Deregister first to override any previously registered version
|
||||
// (e.g., Core's default modules when running as a plugin).
|
||||
wp_deregister_script_module( $route_handle );
|
||||
wp_register_script_module(
|
||||
$route_handle,
|
||||
$build_constants['build_url'] . 'routes/' . $route['name'] . '/route' . $extension,
|
||||
$route_asset['module_dependencies'] ?? array(),
|
||||
$route_asset['version'] ?? false
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Register route with page
|
||||
if ( function_exists( $register_function_name ) ) {
|
||||
call_user_func( $register_function_name, $route['path'], $content_handle, $route_handle );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Page-specific route registration functions
|
||||
// Page-specific route registration functions for jetpack-videopress-dashboard
|
||||
/**
|
||||
* Register routes for jetpack-videopress-dashboard page (full-page mode).
|
||||
*/
|
||||
function jetpack_videopress_register_jetpack_videopress_dashboard_page_routes() {
|
||||
global $jetpack_videopress_jetpack_videopress_dashboard_routes_data;
|
||||
jetpack_videopress_register_page_routes( $jetpack_videopress_jetpack_videopress_dashboard_routes_data, 'jetpack_videopress_register_jetpack_videopress_dashboard_route' );
|
||||
}
|
||||
add_action( 'jetpack-videopress-dashboard_init', 'jetpack_videopress_register_jetpack_videopress_dashboard_page_routes' );
|
||||
|
||||
/**
|
||||
* Register routes for jetpack-videopress-dashboard page (wp-admin mode).
|
||||
*/
|
||||
function jetpack_videopress_register_jetpack_videopress_dashboard_wp_admin_page_routes() {
|
||||
global $jetpack_videopress_jetpack_videopress_dashboard_routes_data;
|
||||
jetpack_videopress_register_page_routes( $jetpack_videopress_jetpack_videopress_dashboard_routes_data, 'jetpack_videopress_register_jetpack_videopress_dashboard_wp_admin_route' );
|
||||
}
|
||||
add_action( 'jetpack-videopress-dashboard-wp-admin_init', 'jetpack_videopress_register_jetpack_videopress_dashboard_wp_admin_page_routes' );
|
||||
|
||||
+1
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-theme', 'wp-url', 'wp-warning'), 'module_dependencies' => array(array('id' => '@wordpress/a11y', 'import' => 'static'), array('id' => '@wordpress/route', 'import' => 'static')), 'version' => 'c71428f3744206db4e66');
|
||||
+26
File diff suppressed because one or more lines are too long
+1
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array(), 'version' => 'bdca920315a6e5637299');
|
||||
+1
@@ -0,0 +1 @@
|
||||
var o={};export{o as route};
|
||||
+1
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-primitives', 'wp-private-apis', 'wp-theme', 'wp-url'), 'module_dependencies' => array(array('id' => '@wordpress/a11y', 'import' => 'static'), array('id' => '@wordpress/route', 'import' => 'static')), 'version' => '718cbf8b33cd48bfe1fe');
|
||||
+108
File diff suppressed because one or more lines are too long
+1
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array(), 'version' => 'bdca920315a6e5637299');
|
||||
+1
@@ -0,0 +1 @@
|
||||
var o={};export{o as route};
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**
|
||||
* Route registry - Auto-generated by build process.
|
||||
* Do not edit this file manually.
|
||||
*
|
||||
* @package jetpack_videopress
|
||||
*/
|
||||
|
||||
return array(
|
||||
array(
|
||||
'name' => 'library',
|
||||
'path' => '/library',
|
||||
'page' => 'jetpack-videopress-dashboard',
|
||||
'has_route' => true,
|
||||
'has_content' => true,
|
||||
),
|
||||
array(
|
||||
'name' => 'overview',
|
||||
'path' => '/',
|
||||
'page' => 'jetpack-videopress-dashboard',
|
||||
'has_route' => true,
|
||||
'has_content' => true,
|
||||
),
|
||||
array(
|
||||
'name' => 'settings',
|
||||
'path' => '/settings',
|
||||
'page' => 'jetpack-videopress-dashboard',
|
||||
'has_route' => true,
|
||||
'has_content' => true,
|
||||
),
|
||||
array(
|
||||
'name' => 'video',
|
||||
'path' => '/video/$id',
|
||||
'page' => 'jetpack-videopress-dashboard',
|
||||
'has_route' => true,
|
||||
'has_content' => true,
|
||||
)
|
||||
);
|
||||
+1
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-primitives', 'wp-private-apis', 'wp-theme', 'wp-url'), 'module_dependencies' => array(array('id' => '@wordpress/a11y', 'import' => 'static'), array('id' => '@wordpress/route', 'import' => 'static')), 'version' => '91115a6bfcd6cf13775a');
|
||||
+20
File diff suppressed because one or more lines are too long
+1
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array(), 'version' => 'bdca920315a6e5637299');
|
||||
+1
@@ -0,0 +1 @@
|
||||
var o={};export{o as route};
|
||||
+1
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-primitives', 'wp-private-apis', 'wp-theme', 'wp-url'), 'module_dependencies' => array(array('id' => '@wordpress/a11y', 'import' => 'static'), array('id' => '@wordpress/route', 'import' => 'static')), 'version' => '27215135658c663447b6');
|
||||
+32
File diff suppressed because one or more lines are too long
+1
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array(), 'version' => 'bdca920315a6e5637299');
|
||||
+1
@@ -0,0 +1 @@
|
||||
var o={};export{o as route};
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
/**
|
||||
* Script registration - Auto-generated by build process.
|
||||
* Do not edit this file manually.
|
||||
*
|
||||
* @package jetpack_videopress
|
||||
*/
|
||||
|
||||
/**
|
||||
* Registers a script according to `wp_register_script`. Honors this request by
|
||||
* reassigning internal dependency properties of any script handle already
|
||||
* registered by that name. It does not deregister the original script, to
|
||||
* avoid losing inline scripts which may have been attached.
|
||||
*
|
||||
* @param WP_Scripts $scripts WP_Scripts instance.
|
||||
* @param string $handle Name of the script. Should be unique.
|
||||
* @param string $src Full URL of the script, or path of the script relative to the WordPress root directory.
|
||||
* @param array $deps Optional. An array of registered script handles this script depends on. Default empty array.
|
||||
* @param string|bool|null $ver Optional. String specifying script version number, if it has one, which is added to the URL
|
||||
* as a query string for cache busting purposes. If version is set to false, a version
|
||||
* number is automatically added equal to current installed WordPress version.
|
||||
* If set to null, no version is added.
|
||||
* @param bool $in_footer Optional. Whether to enqueue the script before </body> instead of in the <head>.
|
||||
* Default 'false'.
|
||||
*/
|
||||
function jetpack_videopress_override_script( $scripts, $handle, $src, $deps = array(), $ver = false, $in_footer = false ) {
|
||||
$script = $scripts->query( $handle, 'registered' );
|
||||
if ( $script ) {
|
||||
/*
|
||||
* In many ways, this is a reimplementation of `wp_register_script` but
|
||||
* bypassing consideration of whether a script by the given handle had
|
||||
* already been registered.
|
||||
*/
|
||||
|
||||
// See: `_WP_Dependency::__construct` .
|
||||
$script->src = $src;
|
||||
$script->deps = $deps;
|
||||
$script->ver = $ver;
|
||||
$script->args = $in_footer ? 1 : null;
|
||||
} else {
|
||||
$scripts->add( $handle, $src, $deps, $ver, ( $in_footer ? 1 : null ) );
|
||||
}
|
||||
|
||||
if ( in_array( 'wp-i18n', $deps, true ) ) {
|
||||
$scripts->set_translations( $handle );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register all package scripts.
|
||||
*/
|
||||
function jetpack_videopress_register_package_scripts( $scripts ) {
|
||||
// Load build constants
|
||||
$build_constants = require __DIR__ . '/constants.php';
|
||||
$default_version = ! SCRIPT_DEBUG ? $build_constants['version'] : time();
|
||||
$extension = '.min.js';
|
||||
|
||||
$scripts_dir = __DIR__ . '/scripts';
|
||||
$scripts_file = $scripts_dir . '/registry.php';
|
||||
|
||||
if ( ! file_exists( $scripts_file ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$scripts_data = require $scripts_file;
|
||||
$plugin_dir = dirname( __FILE__ );
|
||||
|
||||
foreach ( $scripts_data as $script_data ) {
|
||||
$asset_file = $scripts_dir . '/' . $script_data['asset'];
|
||||
$asset = file_exists( $asset_file ) ? require $asset_file : array();
|
||||
$dependencies = $asset['dependencies'] ?? array();
|
||||
$version = $asset['version'] ?? $default_version;
|
||||
|
||||
jetpack_videopress_override_script(
|
||||
$scripts,
|
||||
$script_data['handle'],
|
||||
$build_constants['build_url'] . 'scripts/' . $script_data['path'] . $extension,
|
||||
$dependencies,
|
||||
$version,
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
add_action( 'wp_default_scripts', 'jetpack_videopress_register_package_scripts' );
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* Script registry - Auto-generated by build process.
|
||||
* Do not edit this file manually.
|
||||
*
|
||||
* @package jetpack_videopress
|
||||
*/
|
||||
|
||||
return array(
|
||||
|
||||
);
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
/**
|
||||
* Style registration - Auto-generated by build process.
|
||||
* Do not edit this file manually.
|
||||
*
|
||||
* Note: These styles can be overridden by calling jetpack_videopress_override_style()
|
||||
* in lib/client-assets.php for complex cases (multiple files, conditional deps, etc.)
|
||||
*
|
||||
* @package jetpack_videopress
|
||||
*/
|
||||
|
||||
/**
|
||||
* Registers a style according to `wp_register_style`. Honors this request by
|
||||
* deregistering any style by the same handler before registration.
|
||||
*
|
||||
* @param WP_Styles $styles WP_Styles instance.
|
||||
* @param string $handle Name of the stylesheet. Should be unique.
|
||||
* @param string $src Full URL of the stylesheet, or path of the stylesheet relative to the WordPress root directory.
|
||||
* @param array $deps Optional. An array of registered stylesheet handles this stylesheet depends on. Default empty array.
|
||||
* @param string|bool|null $ver Optional. String specifying stylesheet version number, if it has one, which is added to the URL
|
||||
* as a query string for cache busting purposes. If version is set to false, a version
|
||||
* number is automatically added equal to current installed WordPress version.
|
||||
* If set to null, no version is added.
|
||||
* @param string $media Optional. The media for which this stylesheet has been defined.
|
||||
* Default 'all'. Accepts media types like 'all', 'print' and 'screen', or media queries like
|
||||
* '(orientation: portrait)' and '(max-width: 640px)'.
|
||||
*/
|
||||
function jetpack_videopress_override_style( $styles, $handle, $src, $deps = array(), $ver = false, $media = 'all' ) {
|
||||
$style = $styles->query( $handle, 'registered' );
|
||||
if ( $style ) {
|
||||
$styles->remove( $handle );
|
||||
}
|
||||
$styles->add( $handle, $src, $deps, $ver, $media );
|
||||
}
|
||||
|
||||
/**
|
||||
* Register all package styles (simple cases only).
|
||||
* Complex cases should be manually registered in lib/client-assets.php.
|
||||
*
|
||||
* @param WP_Styles $styles WP_Styles instance.
|
||||
*/
|
||||
function jetpack_videopress_register_package_styles( $styles ) {
|
||||
// Load build constants
|
||||
$build_constants = require __DIR__ . '/constants.php';
|
||||
$default_version = ! SCRIPT_DEBUG ? $build_constants['version'] : time();
|
||||
$suffix = '.min';
|
||||
|
||||
$styles_dir = __DIR__ . '/styles';
|
||||
$styles_file = $styles_dir . '/registry.php';
|
||||
|
||||
if ( ! file_exists( $styles_file ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$styles_data = require $styles_file;
|
||||
$plugin_dir = dirname( __FILE__ );
|
||||
|
||||
foreach ( $styles_data as $style_data ) {
|
||||
jetpack_videopress_override_style(
|
||||
$styles,
|
||||
$style_data['handle'],
|
||||
$build_constants['build_url'] . 'styles/' . $style_data['path'] . $suffix . '.css',
|
||||
$style_data['dependencies'],
|
||||
$default_version
|
||||
);
|
||||
|
||||
// Enable RTL support (WordPress automatically loads -rtl.css variant)
|
||||
$styles->add_data( $style_data['handle'], 'rtl', 'replace' );
|
||||
$styles->add_data( $style_data['handle'], 'suffix', $suffix );
|
||||
}
|
||||
}
|
||||
|
||||
add_action( 'wp_default_styles', 'jetpack_videopress_register_package_styles' );
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* Style registry - Auto-generated by build process.
|
||||
* Do not edit this file manually.
|
||||
*
|
||||
* @package jetpack_videopress
|
||||
*/
|
||||
|
||||
return array(
|
||||
|
||||
);
|
||||
Reference in New Issue
Block a user