<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[13944] sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024: Learn: Sync with git WordPress/learn@36bd656</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://meta.trac.wordpress.org/changeset/13944">13944</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://meta.trac.wordpress.org/changeset/13944","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>adamwood</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2024-08-02 00:26:40 +0000 (Fri, 02 Aug 2024)</dd>
</dl>

<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Learn: Sync with git WordPress/learn@36bd656</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporglearn2024functionsphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/functions.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporglearn2024incblockconfigphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/inc/block-config.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporglearn2024incqueryphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/inc/query.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporglearn2024packagejson">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/package.json</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporglearn2024stylecss">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/style.css</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/build/lesson-standalone/</li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporglearn2024buildlessonstandaloneblockjson">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/build/lesson-standalone/block.json</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporglearn2024buildlessonstandaloneviewassetphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/build/lesson-standalone/view.asset.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporglearn2024buildlessonstandaloneviewjs">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/build/lesson-standalone/view.js</a></li>
<li>sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/src/lesson-standalone/</li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporglearn2024srclessonstandaloneblockjson">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/src/lesson-standalone/block.json</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporglearn2024srclessonstandaloneindexphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/src/lesson-standalone/index.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporglearn2024srclessonstandaloneviewjs">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/src/lesson-standalone/view.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporglearn2024buildlessonstandaloneblockjson"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/build/lesson-standalone/block.json</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/build/lesson-standalone/block.json                           (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/build/lesson-standalone/block.json     2024-08-02 00:26:40 UTC (rev 13944)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,4 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+{
+  "name": "wporg-learn/lesson-standalone",
+  "viewScript": "file:./view.js"
+}
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporglearn2024buildlessonstandaloneviewassetphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/build/lesson-standalone/view.asset.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/build/lesson-standalone/view.asset.php                               (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/build/lesson-standalone/view.asset.php 2024-08-02 00:26:40 UTC (rev 13944)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php return array('dependencies' => array(), 'version' => '4f1d53351b15abf6a9e7');
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/build/lesson-standalone/view.asset.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporglearn2024buildlessonstandaloneviewjs"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/build/lesson-standalone/view.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/build/lesson-standalone/view.js                              (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/build/lesson-standalone/view.js        2024-08-02 00:26:40 UTC (rev 13944)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+(()=>{var t={432:(t,e,r)=>{var n=r(36).Symbol;t.exports=n},77:(t,e,r)=>{var n=r(432),o=r(444),i=r(371),u=n?n.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":u&&u in Object(t)?o(t):i(t)}},625:(t,e,r)=>{var n=r(531),o=/^\s+/;t.exports=function(t){return t?t.slice(0,n(t)+1).replace(o,""):t}},565:(t,e,r)=>{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;t.exports=n},444:(t,e,r)=>{var n=r(432),o=Object.prototype,i=o.hasOwnProperty,u=o.toString,a=n?n.toStringTag:void 0;t.exports=function(t){var e=i.call(t,a),r=t[a];try{t[a]=void 0;var n=!0}catch(t){}var o=u.call(t);return n&&(e?t[a]=r:delete t[a]),o}},371:t=>{var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},36:(t,e,r)=>{var n=r(565),o="object"
 ==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();t.exports=i},531:t=>{var e=/\s/;t.exports=function(t){for(var r=t.length;r--&&e.test(t.charAt(r)););return r}},738:(t,e,r)=>{var n=r(130),o=r(593),i=r(909),u=Math.max,a=Math.min;t.exports=function(t,e,r){var c,f,s,l,p,v,d=0,b=!1,y=!1,x=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function g(e){var r=c,n=f;return c=f=void 0,d=e,l=t.apply(n,r)}function m(t){var r=t-v;return void 0===v||r>=e||r<0||y&&t-d>=s}function h(){var t=o();if(m(t))return j(t);p=setTimeout(h,function(t){var r=e-(t-v);return y?a(r,s-(t-d)):r}(t))}function j(t){return p=void 0,x&&c?g(t):(c=f=void 0,l)}function w(){var t=o(),r=m(t);if(c=arguments,f=this,v=t,r){if(void 0===p)return function(t){return d=t,p=setTimeout(h,e),b?g(t):l}(v);if(y)return clearTimeout(p),p=setTimeout(h,e),g(v)}return void 0===p&&(p=setTim
 eout(h,e)),l}return e=i(e)||0,n(r)&&(b=!!r.leading,s=(y="maxWait"in r)?u(i(r.maxWait)||0,e):s,x="trailing"in r?!!r.trailing:x),w.cancel=function(){void 0!==p&&clearTimeout(p),d=0,c=v=f=p=void 0},w.flush=function(){return void 0===p?l:j(o())},w}},130:t=>{t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},189:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},733:(t,e,r)=>{var n=r(77),o=r(189);t.exports=function(t){return"symbol"==typeof t||o(t)&&"[object Symbol]"==n(t)}},593:(t,e,r)=>{var n=r(36);t.exports=function(){return n.Date.now()}},909:(t,e,r)=>{var n=r(625),o=r(130),i=r(733),u=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,c=/^0o[0-7]+$/i,f=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(i(t))return NaN;if(o(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=o(e)?e+"":e
 }if("string"!=typeof t)return 0===t?t:+t;t=n(t);var r=a.test(t);return r||c.test(t)?f(t.slice(2),r?2:8):u.test(t)?NaN:+t}}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=r(738),e=r.n(t);window.addEventListener("DOMContentLoaded",(()=>{const t=document.querySelector("#wpadminbar");function r(){if(!t)return;const{top:e,height:r}=t.getBoundingClientRect(),n=Math.max(0,r+e);document.documen
 tElement.style.setProperty("--sensei-wpadminbar-offset",n+"px")}t&&(r(),window.addEventListener("scroll",r,{capture:!1,passive:!0}),window.addEventListener("resize",e()(r,500)))}))})()})();
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporglearn2024functionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/functions.php        2024-08-01 22:25:26 UTC (rev 13943)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/functions.php  2024-08-02 00:26:40 UTC (rev 13944)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -13,6 +13,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> require_once __DIR__ . '/src/learning-pathway-cards/index.php';
</span><span class="cx" style="display: block; padding: 0 10px"> require_once __DIR__ . '/src/learning-pathway-header/index.php';
</span><span class="cx" style="display: block; padding: 0 10px"> require_once __DIR__ . '/src/lesson-grid/index.php';
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+require_once __DIR__ . '/src/lesson-standalone/index.php';
</ins><span class="cx" style="display: block; padding: 0 10px"> require_once __DIR__ . '/src/search-results-context/index.php';
</span><span class="cx" style="display: block; padding: 0 10px"> require_once __DIR__ . '/src/sensei-progress-bar/index.php';
</span><span class="cx" style="display: block; padding: 0 10px"> require_once __DIR__ . '/src/sidebar-meta-list/index.php';
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporglearn2024incblockconfigphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/inc/block-config.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/inc/block-config.php 2024-08-01 22:25:26 UTC (rev 13943)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/inc/block-config.php   2024-08-02 00:26:40 UTC (rev 13944)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -54,7 +54,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">                'lesson' => __( 'Lesson', 'wporg-learn' ),
</span><span class="cx" style="display: block; padding: 0 10px">        );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $selected_slug = $wp_query->get( 'post_type' ) ? $wp_query->get( 'post_type' ) : 'any';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_type = $wp_query->get( 'post_type' );
+       $selected_slug = is_string( $post_type ) ? $post_type : 'any';
</ins><span class="cx" style="display: block; padding: 0 10px">         $label = $options[ $selected_slug ] ?? $options['any'];
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        return array(
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporglearn2024incqueryphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/inc/query.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/inc/query.php        2024-08-01 22:25:26 UTC (rev 13943)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/inc/query.php  2024-08-02 00:26:40 UTC (rev 13944)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7,6 +7,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'pre_get_posts', __NAMESPACE__ . '\add_language_to_archive_queries' );
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'pre_get_posts', __NAMESPACE__ . '\add_excluded_to_lesson_archive_query' );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+add_action( 'pre_get_posts', __NAMESPACE__ . '\filter_search_queries_by_post_type' );
</ins><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'request', __NAMESPACE__ . '\handle_all_level_query' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -81,6 +82,23 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Filter search queries by post type.
+ * Only include courses and lessons in search results unless post_type is set, eg. for an archive search.
+ *
+ * @param WP_Query $query The query object.
+ * @return WP_Query The modified query object.
+ */
+function filter_search_queries_by_post_type( $query ) {
+       if ( ! is_admin() && $query->is_search() && $query->is_main_query() ) {
+               if ( ! $query->get( 'post_type' ) ) {
+                       $query->set( 'post_type', array( 'course', 'lesson' ) );
+               }
+       }
+
+       return $query;
+}
+
+/**
</ins><span class="cx" style="display: block; padding: 0 10px">  * Modify the request.
</span><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * Update the query_vars to reset 'all' to an empty string.
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporglearn2024packagejson"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/package.json</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/package.json 2024-08-01 22:25:26 UTC (rev 13943)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/package.json   2024-08-02 00:26:40 UTC (rev 13944)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,15 +1,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-    "name": "wporg-learn-2024",
-    "version": "1.0.0",
-    "description": "Theme for learn.wordpress.org",
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "name": "wporg-learn-2024",
+       "version": "1.0.0",
+       "description": "Theme for learn.wordpress.org",
</ins><span class="cx" style="display: block; padding: 0 10px">         "author": "WordPress.org",
</span><span class="cx" style="display: block; padding: 0 10px">        "license": "GPL-2.0-or-later",
</span><span class="cx" style="display: block; padding: 0 10px">        "private": true,
</span><span class="cx" style="display: block; padding: 0 10px">        "devDependencies": {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                "@wordpress/icons": "^10.2.0",
</ins><span class="cx" style="display: block; padding: 0 10px">                 "@wordpress/scripts": "27.2.0",
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                "rtlcss-webpack-plugin": "4.0.7",
-               "@wordpress/icons": "^10.2.0",
-               "react-dom": "^18.3.1"
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         "react-dom": "^18.3.1",
+               "rtlcss-webpack-plugin": "4.0.7"
</ins><span class="cx" style="display: block; padding: 0 10px">         },
</span><span class="cx" style="display: block; padding: 0 10px">        "eslintConfig": {
</span><span class="cx" style="display: block; padding: 0 10px">                "extends": "../../../../.eslintrc.js"
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -27,5 +27,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">                "lint:js": "wp-scripts lint-js src",
</span><span class="cx" style="display: block; padding: 0 10px">                "lint:css": "wp-scripts lint-style src/**/*.scss",
</span><span class="cx" style="display: block; padding: 0 10px">                "format": "wp-scripts format src -- --config=../../../../.prettierrc.js"
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        },
+       "dependencies": {
+               "lodash": "^4.17.21"
</ins><span class="cx" style="display: block; padding: 0 10px">         }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporglearn2024srclessonstandaloneblockjson"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/src/lesson-standalone/block.json</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/src/lesson-standalone/block.json                             (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/src/lesson-standalone/block.json       2024-08-02 00:26:40 UTC (rev 13944)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,4 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+{
+       "name": "wporg-learn/lesson-standalone",
+       "viewScript": "file:./view.js"
+}
</ins></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporglearn2024srclessonstandaloneindexphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/src/lesson-standalone/index.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/src/lesson-standalone/index.php                              (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/src/lesson-standalone/index.php        2024-08-02 00:26:40 UTC (rev 13944)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,40 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * Adds scripts for lesson-standalone pattern.
+ */
+
+namespace WordPressdotorg\Theme\Learn_2024\Lesson_Standalone;
+
+defined( 'WPINC' ) || die();
+
+/**
+ * Actions and filters.
+ */
+add_action( 'init', __NAMESPACE__ . '\init' );
+
+/**
+ * Add a script to update the --sensei-wpadminbar-offset dynamically to make the standalone lesson layout correct.
+ *
+ * The dependencies are autogenerated in block.json, and can be read with
+ * `wp_json_file_decode` & `register_block_script_handle.
+ */
+function init() {
+       $metadata_file = dirname( dirname( __DIR__ ) ) . '/build/lesson-standalone/block.json';
+       $metadata = wp_json_file_decode( $metadata_file, array( 'associative' => true ) );
+       $metadata['file'] = $metadata_file;
+
+       $script_handle = register_block_script_handle( $metadata, 'viewScript', 0 );
+
+       // Enqueue the assets when the sensei lesson standalone pattern is on the page.
+       add_action(
+               'render_block_core/pattern',
+               function( $block_content, $block ) use ( $script_handle ) {
+                       if ( isset( $block['attrs']['slug'] ) && 'wporg-learn-2024/sensei-lesson-standalone' === $block['attrs']['slug'] ) {
+                               wp_enqueue_script( $script_handle );
+                       }
+                       return $block_content;
+               },
+               10,
+               2
+       );
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/src/lesson-standalone/index.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporglearn2024srclessonstandaloneviewjs"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/src/lesson-standalone/view.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/src/lesson-standalone/view.js                                (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/src/lesson-standalone/view.js  2024-08-02 00:26:40 UTC (rev 13944)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,41 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// Original source: https://github.com/Automattic/sensei/blob/trunk/assets/course-theme/adminbar-layout.ts
+/**
+ * External dependencies
+ */
+import debounce from 'lodash/debounce';
+
+/**
+ * Track how much space the WordPress admin bar takes up at the top of the screen.
+ * Updates a CSS variable with the value.
+ */
+const trackAdminbarOffset = () => {
+       const adminbar = document.querySelector( '#wpadminbar' );
+       if ( ! adminbar ) {
+               return;
+       }
+
+       updateAdminbarOffset();
+       window.addEventListener( 'scroll', updateAdminbarOffset, {
+               capture: false,
+               passive: true,
+       } );
+
+       /**
+        * The debounce has 2 reasons here:
+        * 1. Reduce the number of times we call the function in a resize.
+        * 2. The admin bar contains an animated transition, so this transition
+        *    needs to be completed in order to make the correct calc.
+        */
+       window.addEventListener( 'resize', debounce( updateAdminbarOffset, 500 ) );
+
+       function updateAdminbarOffset() {
+               if ( ! adminbar ) {
+                       return;
+               }
+               const { top, height } = adminbar.getBoundingClientRect();
+               const offset = Math.max( 0, height + top );
+               document.documentElement.style.setProperty( '--sensei-wpadminbar-offset', offset + 'px' );
+       }
+};
+
+window.addEventListener( 'DOMContentLoaded', trackAdminbarOffset );
</ins></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporglearn2024stylecss"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/style.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/style.css    2024-08-01 22:25:26 UTC (rev 13943)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/style.css      2024-08-02 00:26:40 UTC (rev 13944)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4,7 +4,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">  * Author: WordPress.org
</span><span class="cx" style="display: block; padding: 0 10px">  * Author URI: http://wordpress.org/
</span><span class="cx" style="display: block; padding: 0 10px">  * Description: A theme for learn.wordpress.org, built in 2024.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Version: 1.0.0-6f3ee52
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Version: 1.0.0-f7d8461
</ins><span class="cx" style="display: block; padding: 0 10px">  * License: GNU General Public License v2 or later
</span><span class="cx" style="display: block; padding: 0 10px">  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
</span><span class="cx" style="display: block; padding: 0 10px">  * Text Domain: wporg-learn
</span></span></pre>
</div>
</div>

</body>
</html>