summaryrefslogtreecommitdiffstats
path: root/wp-includes/blocks/query
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 07:56:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 07:56:49 +0000
commita415c29efee45520ae252d2aa28f1083a521cd7b (patch)
treef4ade4b6668ecc0765de7e1424f7c1427ad433ff /wp-includes/blocks/query
parentInitial commit. (diff)
downloadwordpress-a415c29efee45520ae252d2aa28f1083a521cd7b.tar.xz
wordpress-a415c29efee45520ae252d2aa28f1083a521cd7b.zip
Adding upstream version 6.4.3+dfsg1.upstream/6.4.3+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'wp-includes/blocks/query')
-rw-r--r--wp-includes/blocks/query/block.json57
-rw-r--r--wp-includes/blocks/query/editor-rtl.css57
-rw-r--r--wp-includes/blocks/query/editor-rtl.min.css1
-rw-r--r--wp-includes/blocks/query/editor.css57
-rw-r--r--wp-includes/blocks/query/editor.min.css1
-rw-r--r--wp-includes/blocks/query/style-rtl.css42
-rw-r--r--wp-includes/blocks/query/style-rtl.min.css1
-rw-r--r--wp-includes/blocks/query/style.css42
-rw-r--r--wp-includes/blocks/query/style.min.css1
-rw-r--r--wp-includes/blocks/query/view.asset.php1
-rw-r--r--wp-includes/blocks/query/view.js104
-rw-r--r--wp-includes/blocks/query/view.min.asset.php1
-rw-r--r--wp-includes/blocks/query/view.min.js1
13 files changed, 366 insertions, 0 deletions
diff --git a/wp-includes/blocks/query/block.json b/wp-includes/blocks/query/block.json
new file mode 100644
index 0000000..d30eccf
--- /dev/null
+++ b/wp-includes/blocks/query/block.json
@@ -0,0 +1,57 @@
+{
+ "$schema": "https://schemas.wp.org/trunk/block.json",
+ "apiVersion": 3,
+ "name": "core/query",
+ "title": "Query Loop",
+ "category": "theme",
+ "description": "An advanced block that allows displaying post types based on different query parameters and visual configurations.",
+ "textdomain": "default",
+ "attributes": {
+ "queryId": {
+ "type": "number"
+ },
+ "query": {
+ "type": "object",
+ "default": {
+ "perPage": null,
+ "pages": 0,
+ "offset": 0,
+ "postType": "post",
+ "order": "desc",
+ "orderBy": "date",
+ "author": "",
+ "search": "",
+ "exclude": [],
+ "sticky": "",
+ "inherit": true,
+ "taxQuery": null,
+ "parents": []
+ }
+ },
+ "tagName": {
+ "type": "string",
+ "default": "div"
+ },
+ "namespace": {
+ "type": "string"
+ },
+ "enhancedPagination": {
+ "type": "boolean",
+ "default": false
+ }
+ },
+ "providesContext": {
+ "queryId": "queryId",
+ "query": "query",
+ "displayLayout": "displayLayout",
+ "enhancedPagination": "enhancedPagination"
+ },
+ "supports": {
+ "align": [ "wide", "full" ],
+ "html": false,
+ "layout": true
+ },
+ "editorStyle": "wp-block-query-editor",
+ "style": "wp-block-query",
+ "viewScript": "file:./view.min.js"
+}
diff --git a/wp-includes/blocks/query/editor-rtl.css b/wp-includes/blocks/query/editor-rtl.css
new file mode 100644
index 0000000..bf715b2
--- /dev/null
+++ b/wp-includes/blocks/query/editor-rtl.css
@@ -0,0 +1,57 @@
+.block-library-query-toolbar__popover .components-popover__content{
+ min-width:230px;
+}
+
+.wp-block-query__create-new-link{
+ padding:0 52px 16px 16px;
+}
+
+.block-library-query__pattern-selection-content .block-editor-block-patterns-list{
+ grid-gap:8px;
+ display:grid;
+ grid-template-columns:1fr 1fr 1fr;
+}
+.block-library-query__pattern-selection-content .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item{
+ margin-bottom:0;
+}
+.block-library-query__pattern-selection-content .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item .block-editor-block-preview__container{
+ max-height:250px;
+}
+
+.block-library-query-pattern__selection-modal .block-editor-block-patterns-list{
+ column-count:2;
+ column-gap:24px;
+}
+@media (min-width:1280px){
+ .block-library-query-pattern__selection-modal .block-editor-block-patterns-list{
+ column-count:3;
+ }
+}
+.block-library-query-pattern__selection-modal .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item{
+ break-inside:avoid-column;
+}
+.block-library-query-pattern__selection-modal .block-library-query-pattern__selection-search{
+ background:#fff;
+ margin-bottom:2px;
+ padding:16px 0;
+ position:sticky;
+ top:0;
+ z-index:2;
+}
+
+.block-library-query-toolspanel__filters .components-form-token-field__help{
+ margin-bottom:0;
+}
+.block-library-query-toolspanel__filters .block-library-query-inspector__taxonomy-control:not(:last-child){
+ margin-bottom:24px;
+}
+
+@media (min-width:600px){
+ .wp-block-query__enhanced-pagination-modal{
+ max-width:480px;
+ }
+}
+
+.wp-block-query__enhanced-pagination-notice{
+ margin:0;
+} \ No newline at end of file
diff --git a/wp-includes/blocks/query/editor-rtl.min.css b/wp-includes/blocks/query/editor-rtl.min.css
new file mode 100644
index 0000000..7c01abd
--- /dev/null
+++ b/wp-includes/blocks/query/editor-rtl.min.css
@@ -0,0 +1 @@
+.block-library-query-toolbar__popover .components-popover__content{min-width:230px}.wp-block-query__create-new-link{padding:0 52px 16px 16px}.block-library-query__pattern-selection-content .block-editor-block-patterns-list{grid-gap:8px;display:grid;grid-template-columns:1fr 1fr 1fr}.block-library-query__pattern-selection-content .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item{margin-bottom:0}.block-library-query__pattern-selection-content .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item .block-editor-block-preview__container{max-height:250px}.block-library-query-pattern__selection-modal .block-editor-block-patterns-list{column-count:2;column-gap:24px}@media (min-width:1280px){.block-library-query-pattern__selection-modal .block-editor-block-patterns-list{column-count:3}}.block-library-query-pattern__selection-modal .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item{break-inside:avoid-column}.block-library-query-pattern__selection-modal .block-library-query-pattern__selection-search{background:#fff;margin-bottom:2px;padding:16px 0;position:sticky;top:0;z-index:2}.block-library-query-toolspanel__filters .components-form-token-field__help{margin-bottom:0}.block-library-query-toolspanel__filters .block-library-query-inspector__taxonomy-control:not(:last-child){margin-bottom:24px}@media (min-width:600px){.wp-block-query__enhanced-pagination-modal{max-width:480px}}.wp-block-query__enhanced-pagination-notice{margin:0} \ No newline at end of file
diff --git a/wp-includes/blocks/query/editor.css b/wp-includes/blocks/query/editor.css
new file mode 100644
index 0000000..61dc7f7
--- /dev/null
+++ b/wp-includes/blocks/query/editor.css
@@ -0,0 +1,57 @@
+.block-library-query-toolbar__popover .components-popover__content{
+ min-width:230px;
+}
+
+.wp-block-query__create-new-link{
+ padding:0 16px 16px 52px;
+}
+
+.block-library-query__pattern-selection-content .block-editor-block-patterns-list{
+ grid-gap:8px;
+ display:grid;
+ grid-template-columns:1fr 1fr 1fr;
+}
+.block-library-query__pattern-selection-content .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item{
+ margin-bottom:0;
+}
+.block-library-query__pattern-selection-content .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item .block-editor-block-preview__container{
+ max-height:250px;
+}
+
+.block-library-query-pattern__selection-modal .block-editor-block-patterns-list{
+ column-count:2;
+ column-gap:24px;
+}
+@media (min-width:1280px){
+ .block-library-query-pattern__selection-modal .block-editor-block-patterns-list{
+ column-count:3;
+ }
+}
+.block-library-query-pattern__selection-modal .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item{
+ break-inside:avoid-column;
+}
+.block-library-query-pattern__selection-modal .block-library-query-pattern__selection-search{
+ background:#fff;
+ margin-bottom:2px;
+ padding:16px 0;
+ position:sticky;
+ top:0;
+ z-index:2;
+}
+
+.block-library-query-toolspanel__filters .components-form-token-field__help{
+ margin-bottom:0;
+}
+.block-library-query-toolspanel__filters .block-library-query-inspector__taxonomy-control:not(:last-child){
+ margin-bottom:24px;
+}
+
+@media (min-width:600px){
+ .wp-block-query__enhanced-pagination-modal{
+ max-width:480px;
+ }
+}
+
+.wp-block-query__enhanced-pagination-notice{
+ margin:0;
+} \ No newline at end of file
diff --git a/wp-includes/blocks/query/editor.min.css b/wp-includes/blocks/query/editor.min.css
new file mode 100644
index 0000000..c36952d
--- /dev/null
+++ b/wp-includes/blocks/query/editor.min.css
@@ -0,0 +1 @@
+.block-library-query-toolbar__popover .components-popover__content{min-width:230px}.wp-block-query__create-new-link{padding:0 16px 16px 52px}.block-library-query__pattern-selection-content .block-editor-block-patterns-list{grid-gap:8px;display:grid;grid-template-columns:1fr 1fr 1fr}.block-library-query__pattern-selection-content .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item{margin-bottom:0}.block-library-query__pattern-selection-content .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item .block-editor-block-preview__container{max-height:250px}.block-library-query-pattern__selection-modal .block-editor-block-patterns-list{column-count:2;column-gap:24px}@media (min-width:1280px){.block-library-query-pattern__selection-modal .block-editor-block-patterns-list{column-count:3}}.block-library-query-pattern__selection-modal .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item{break-inside:avoid-column}.block-library-query-pattern__selection-modal .block-library-query-pattern__selection-search{background:#fff;margin-bottom:2px;padding:16px 0;position:sticky;top:0;z-index:2}.block-library-query-toolspanel__filters .components-form-token-field__help{margin-bottom:0}.block-library-query-toolspanel__filters .block-library-query-inspector__taxonomy-control:not(:last-child){margin-bottom:24px}@media (min-width:600px){.wp-block-query__enhanced-pagination-modal{max-width:480px}}.wp-block-query__enhanced-pagination-notice{margin:0} \ No newline at end of file
diff --git a/wp-includes/blocks/query/style-rtl.css b/wp-includes/blocks/query/style-rtl.css
new file mode 100644
index 0000000..cfd727e
--- /dev/null
+++ b/wp-includes/blocks/query/style-rtl.css
@@ -0,0 +1,42 @@
+.wp-block-query__enhanced-pagination-animation{
+ background-color:var(--wp--preset--color--primary, #000);
+ height:4px;
+ margin:0;
+ max-width:100vw !important;
+ opacity:0;
+ padding:0;
+ position:fixed;
+ right:0;
+ top:0;
+ width:100vw;
+}
+.wp-block-query__enhanced-pagination-animation.start-animation{
+ animation:wp-block-query__enhanced-pagination-start-animation 30s cubic-bezier(.03, .5, 0, 1) forwards;
+}
+.wp-block-query__enhanced-pagination-animation.finish-animation{
+ animation:wp-block-query__enhanced-pagination-finish-animation .3s ease-in;
+}
+
+@keyframes wp-block-query__enhanced-pagination-start-animation{
+ 0%{
+ opacity:1;
+ transform:scaleX(0);
+ transform-origin:100% 0;
+ }
+ to{
+ opacity:1;
+ transform:scaleX(1);
+ transform-origin:100% 0;
+ }
+}
+@keyframes wp-block-query__enhanced-pagination-finish-animation{
+ 0%{
+ opacity:1;
+ }
+ 50%{
+ opacity:1;
+ }
+ to{
+ opacity:0;
+ }
+} \ No newline at end of file
diff --git a/wp-includes/blocks/query/style-rtl.min.css b/wp-includes/blocks/query/style-rtl.min.css
new file mode 100644
index 0000000..6849acf
--- /dev/null
+++ b/wp-includes/blocks/query/style-rtl.min.css
@@ -0,0 +1 @@
+.wp-block-query__enhanced-pagination-animation{background-color:var(--wp--preset--color--primary,#000);height:4px;margin:0;max-width:100vw!important;opacity:0;padding:0;position:fixed;right:0;top:0;width:100vw}.wp-block-query__enhanced-pagination-animation.start-animation{animation:wp-block-query__enhanced-pagination-start-animation 30s cubic-bezier(.03,.5,0,1) forwards}.wp-block-query__enhanced-pagination-animation.finish-animation{animation:wp-block-query__enhanced-pagination-finish-animation .3s ease-in}@keyframes wp-block-query__enhanced-pagination-start-animation{0%{opacity:1;transform:scaleX(0);transform-origin:100% 0}to{opacity:1;transform:scaleX(1);transform-origin:100% 0}}@keyframes wp-block-query__enhanced-pagination-finish-animation{0%{opacity:1}50%{opacity:1}to{opacity:0}} \ No newline at end of file
diff --git a/wp-includes/blocks/query/style.css b/wp-includes/blocks/query/style.css
new file mode 100644
index 0000000..241cdc8
--- /dev/null
+++ b/wp-includes/blocks/query/style.css
@@ -0,0 +1,42 @@
+.wp-block-query__enhanced-pagination-animation{
+ background-color:var(--wp--preset--color--primary, #000);
+ height:4px;
+ left:0;
+ margin:0;
+ max-width:100vw !important;
+ opacity:0;
+ padding:0;
+ position:fixed;
+ top:0;
+ width:100vw;
+}
+.wp-block-query__enhanced-pagination-animation.start-animation{
+ animation:wp-block-query__enhanced-pagination-start-animation 30s cubic-bezier(.03, .5, 0, 1) forwards;
+}
+.wp-block-query__enhanced-pagination-animation.finish-animation{
+ animation:wp-block-query__enhanced-pagination-finish-animation .3s ease-in;
+}
+
+@keyframes wp-block-query__enhanced-pagination-start-animation{
+ 0%{
+ opacity:1;
+ transform:scaleX(0);
+ transform-origin:0 0;
+ }
+ to{
+ opacity:1;
+ transform:scaleX(1);
+ transform-origin:0 0;
+ }
+}
+@keyframes wp-block-query__enhanced-pagination-finish-animation{
+ 0%{
+ opacity:1;
+ }
+ 50%{
+ opacity:1;
+ }
+ to{
+ opacity:0;
+ }
+} \ No newline at end of file
diff --git a/wp-includes/blocks/query/style.min.css b/wp-includes/blocks/query/style.min.css
new file mode 100644
index 0000000..7627634
--- /dev/null
+++ b/wp-includes/blocks/query/style.min.css
@@ -0,0 +1 @@
+.wp-block-query__enhanced-pagination-animation{background-color:var(--wp--preset--color--primary,#000);height:4px;left:0;margin:0;max-width:100vw!important;opacity:0;padding:0;position:fixed;top:0;width:100vw}.wp-block-query__enhanced-pagination-animation.start-animation{animation:wp-block-query__enhanced-pagination-start-animation 30s cubic-bezier(.03,.5,0,1) forwards}.wp-block-query__enhanced-pagination-animation.finish-animation{animation:wp-block-query__enhanced-pagination-finish-animation .3s ease-in}@keyframes wp-block-query__enhanced-pagination-start-animation{0%{opacity:1;transform:scaleX(0);transform-origin:0 0}to{opacity:1;transform:scaleX(1);transform-origin:0 0}}@keyframes wp-block-query__enhanced-pagination-finish-animation{0%{opacity:1}50%{opacity:1}to{opacity:0}} \ No newline at end of file
diff --git a/wp-includes/blocks/query/view.asset.php b/wp-includes/blocks/query/view.asset.php
new file mode 100644
index 0000000..09db564
--- /dev/null
+++ b/wp-includes/blocks/query/view.asset.php
@@ -0,0 +1 @@
+<?php return array('dependencies' => array(), 'version' => 'f932eea8999458215fe1');
diff --git a/wp-includes/blocks/query/view.js b/wp-includes/blocks/query/view.js
new file mode 100644
index 0000000..55083bf
--- /dev/null
+++ b/wp-includes/blocks/query/view.js
@@ -0,0 +1,104 @@
+"use strict";
+(self["__WordPressPrivateInteractivityAPI__"] = self["__WordPressPrivateInteractivityAPI__"] || []).push([[155],{
+
+/***/ 890:
+/***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
+
+/* harmony import */ var _wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(754);
+/**
+ * WordPress dependencies
+ */
+
+const isValidLink = ref => ref && ref instanceof window.HTMLAnchorElement && ref.href && (!ref.target || ref.target === '_self') && ref.origin === window.location.origin;
+const isValidEvent = event => event.button === 0 &&
+// left clicks only
+!event.metaKey &&
+// open in new tab (mac)
+!event.ctrlKey &&
+// open in new tab (windows)
+!event.altKey &&
+// download
+!event.shiftKey && !event.defaultPrevented;
+(0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__/* .store */ .h)({
+ selectors: {
+ core: {
+ query: {
+ startAnimation: ({
+ context
+ }) => context.core.query.animation === 'start',
+ finishAnimation: ({
+ context
+ }) => context.core.query.animation === 'finish'
+ }
+ }
+ },
+ actions: {
+ core: {
+ query: {
+ navigate: async ({
+ event,
+ ref,
+ context
+ }) => {
+ const isDisabled = ref.closest('[data-wp-navigation-id]')?.dataset.wpNavigationDisabled;
+ if (isValidLink(ref) && isValidEvent(event) && !isDisabled) {
+ event.preventDefault();
+ const id = ref.closest('[data-wp-navigation-id]').dataset.wpNavigationId;
+
+ // Don't announce the navigation immediately, wait 300 ms.
+ const timeout = setTimeout(() => {
+ context.core.query.message = context.core.query.loadingText;
+ context.core.query.animation = 'start';
+ }, 400);
+ await (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__/* .navigate */ .c4)(ref.href);
+
+ // Dismiss loading message if it hasn't been added yet.
+ clearTimeout(timeout);
+
+ // Announce that the page has been loaded. If the message is the
+ // same, we use a no-break space similar to the @wordpress/a11y
+ // package: https://github.com/WordPress/gutenberg/blob/c395242b8e6ee20f8b06c199e4fc2920d7018af1/packages/a11y/src/filter-message.js#L20-L26
+ context.core.query.message = context.core.query.loadedText + (context.core.query.message === context.core.query.loadedText ? '\u00A0' : '');
+ context.core.query.animation = 'finish';
+ context.core.query.url = ref.href;
+
+ // Focus the first anchor of the Query block.
+ const firstAnchor = `[data-wp-navigation-id=${id}] .wp-block-post-template a[href]`;
+ document.querySelector(firstAnchor)?.focus();
+ }
+ },
+ prefetch: async ({
+ ref
+ }) => {
+ const isDisabled = ref.closest('[data-wp-navigation-id]')?.dataset.wpNavigationDisabled;
+ if (isValidLink(ref) && !isDisabled) {
+ await (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__/* .prefetch */ .tL)(ref.href);
+ }
+ }
+ }
+ }
+ },
+ effects: {
+ core: {
+ query: {
+ prefetch: async ({
+ ref,
+ context
+ }) => {
+ if (context.core.query.url && isValidLink(ref)) {
+ await (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__/* .prefetch */ .tL)(ref.href);
+ }
+ }
+ }
+ }
+ }
+});
+
+/***/ })
+
+},
+/******/ function(__webpack_require__) { // webpackRuntimeModules
+/******/ var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); }
+/******/ var __webpack_exports__ = (__webpack_exec__(890));
+/******/ }
+]); \ No newline at end of file
diff --git a/wp-includes/blocks/query/view.min.asset.php b/wp-includes/blocks/query/view.min.asset.php
new file mode 100644
index 0000000..c028c0e
--- /dev/null
+++ b/wp-includes/blocks/query/view.min.asset.php
@@ -0,0 +1 @@
+<?php return array('dependencies' => array(), 'version' => 'ecab5647d5d9321e0101');
diff --git a/wp-includes/blocks/query/view.min.js b/wp-includes/blocks/query/view.min.js
new file mode 100644
index 0000000..be86dbf
--- /dev/null
+++ b/wp-includes/blocks/query/view.min.js
@@ -0,0 +1 @@
+"use strict";(self.__WordPressPrivateInteractivityAPI__=self.__WordPressPrivateInteractivityAPI__||[]).push([[155],{890:function(e,t,a){var r=a(754);const i=e=>e&&e instanceof window.HTMLAnchorElement&&e.href&&(!e.target||"_self"===e.target)&&e.origin===window.location.origin;(0,r.h)({selectors:{core:{query:{startAnimation:({context:e})=>"start"===e.core.query.animation,finishAnimation:({context:e})=>"finish"===e.core.query.animation}}},actions:{core:{query:{navigate:async({event:e,ref:t,context:a})=>{const o=t.closest("[data-wp-navigation-id]")?.dataset.wpNavigationDisabled;if(i(t)&&(e=>!(0!==e.button||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||e.defaultPrevented))(e)&&!o){e.preventDefault();const i=t.closest("[data-wp-navigation-id]").dataset.wpNavigationId,o=setTimeout((()=>{a.core.query.message=a.core.query.loadingText,a.core.query.animation="start"}),400);await(0,r.c4)(t.href),clearTimeout(o),a.core.query.message=a.core.query.loadedText+(a.core.query.message===a.core.query.loadedText?" ":""),a.core.query.animation="finish",a.core.query.url=t.href;const n=`[data-wp-navigation-id=${i}] .wp-block-post-template a[href]`;document.querySelector(n)?.focus()}},prefetch:async({ref:e})=>{const t=e.closest("[data-wp-navigation-id]")?.dataset.wpNavigationDisabled;i(e)&&!t&&await(0,r.tL)(e.href)}}}},effects:{core:{query:{prefetch:async({ref:e,context:t})=>{t.core.query.url&&i(e)&&await(0,r.tL)(e.href)}}}}})}},function(e){var t;t=890,e(e.s=t)}]); \ No newline at end of file