From 5e278d5693b5a3f4ec258521f6c99861d10c9d77 Mon Sep 17 00:00:00 2001 From: prcdevgitbot Date: Mon, 24 Jun 2024 19:23:28 +0000 Subject: [PATCH] See https://github.com/pewresearch/pewresearch-org/commit/03ca72c0c969e5e398f18d74e2621ac18cb9bff8 from refs/heads/main --- includes/block-editor/build/index.asset.php | 2 +- includes/block-editor/build/index.js | 2 +- includes/block-editor/build/index.js.map | 2 +- includes/block-editor/src/regenerate-toc-action.js | 2 +- includes/embeds/class-embeds.php | 5 +++-- includes/permalink-rewrites/class-url-helper.php | 2 ++ .../table-of-contents/class-table-of-contents.php | 4 ++-- includes/utils.php | 13 ++----------- 8 files changed, 13 insertions(+), 19 deletions(-) diff --git a/includes/block-editor/build/index.asset.php b/includes/block-editor/build/index.asset.php index a5baf109..f86950f1 100644 --- a/includes/block-editor/build/index.asset.php +++ b/includes/block-editor/build/index.asset.php @@ -1 +1 @@ - array('react', 'wp-api-fetch', 'wp-blocks', 'wp-data', 'wp-dom-ready', 'wp-hooks', 'wp-polyfill', 'wp-url'), 'version' => '7624559795b41e9b8f11'); + array('react', 'wp-api-fetch', 'wp-blocks', 'wp-data', 'wp-dom-ready', 'wp-hooks', 'wp-polyfill', 'wp-url'), 'version' => 'af4d6373bf9cb5cdd4b6'); diff --git a/includes/block-editor/build/index.js b/includes/block-editor/build/index.js index 178409c4..4c4ce06c 100644 --- a/includes/block-editor/build/index.js +++ b/includes/block-editor/build/index.js @@ -1,2 +1,2 @@ -(()=>{"use strict";var e={n:o=>{var t=o&&o.__esModule?()=>o.default:()=>o;return e.d(t,{a:t}),t},d:(o,t)=>{for(var r in t)e.o(t,r)&&!e.o(o,r)&&Object.defineProperty(o,r,{enumerable:!0,get:t[r]})},o:(e,o)=>Object.prototype.hasOwnProperty.call(e,o)};const o=window.React,t=window.wp.domReady;var r=e.n(t);const a=window.wp.data,n=window.wp.blocks,s=window.wp.hooks,i=window.wp.apiFetch;var l=e.n(i);const c=window.wp.url;function d(e){const o=(0,c.addQueryArgs)("/prc-api/v3/report-package/regenerate-toc",{postId:e});return new Promise(((e,t)=>{l()({path:o,method:"POST"}).then((o=>{console.log("Regenerate TOC response",o),e(o)})).catch((e=>{console.error("Regenerate TOC error",e),t(e)}))}))}const p={post:{preview:{start:[d],end:[]},publish:{start:[d],end:[]}},"fact-sheet":{preview:{start:[d],end:[]},publish:{start:[d],end:[]}}};r()((()=>{null!==(0,a.select)("core/editor")&&((0,a.dispatch)("core/editor").removeEditorPanel("taxonomy-panel-post_tag"),(0,a.dispatch)("core/editor").removeEditorPanel("discussion-panel"),function(){console.log("prc-platform/post-preview-publish-hook: watcher activating");const e=()=>(0,a.select)("core/editor").isPreviewingPost(),o=()=>(0,a.select)("core/editor").isPublishingPost(),t=()=>(0,a.select)("core/editor").isAutosavingPost();let r=e(),n=o(),s=t();(0,a.subscribe)((()=>{const i=(0,a.select)("core/editor").getCurrentPostId(),l=(0,a.select)("core/editor").getCurrentPostType(),c=e(),d=o(),h=t();r!==c&&(console.log("start preview",i,l),function(e,o){p[o]&&p[o].preview.start&&p[o].preview.start.length&&p[o].preview.start.forEach((o=>{o(e)}))}(i,l)),n!==d&&(console.log("start publish",i,l),function(e,o){p[o]&&p[o].publish.start&&p[o].publish.start.length&&p[o].publish.start.forEach((o=>{o(e)}))}(i,l)),s!==h&&console.log("autosave",i,l),r&&!c&&(console.log("end preview",i,l),function(e,o){p[o]&&p[o].preview.end&&p[o].preview.end.length&&p[o].preview.end.forEach((o=>{o(e)}))}(i,l)),n&&!d&&(console.log("end publish",i,l),function(e,o){p[o]&&p[o].publish.end&&p[o].publish.end.length&&p[o].publish.end.forEach((o=>{o(e)}))}(i,l)),r=c,n=d,s=h}))}()),(0,n.registerBlockCollection)("prc-block",{title:"Pew Research Center Block Library",icon:()=>(0,o.createElement)("svg",{id:"tiny-logo","data-name":"Tiny PRC Logo",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 198 198",height:"20"},(0,o.createElement)("path",{d:"M142.83,131.63,174,162.77a98.58,98.58,0,0,0,12.74-19l-66.08-27.37a27.49,27.49,0,0,0,6-14.44l66.05,27.36a97.65,97.65,0,0,0,4.47-22.46h-44a56.14,56.14,0,0,0,.62-7.83,54.79,54.79,0,0,0-.63-7.84s0,0,0,0h44a97.65,97.65,0,0,0-4.47-22.46L126.63,96.08a27.43,27.43,0,0,0-6-14.44l66.09-27.37a98.58,98.58,0,0,0-12.74-19L142.83,66.38a54.89,54.89,0,0,0-11.05-11.06l31.14-31.14a98.08,98.08,0,0,0-19-12.73L116.52,77.52a27.57,27.57,0,0,0-14.45-6l27.36-66A98,98,0,0,0,107,1V45h0a53.41,53.41,0,0,0-7.85-.63,54.6,54.6,0,0,0-7.81.62V1A97.65,97.65,0,0,0,68.87,5.47L96.24,71.52a27.54,27.54,0,0,0-14.45,6L54.43,11.44a98.27,98.27,0,0,0-19,12.74L66.53,55.32A54.52,54.52,0,0,0,55.46,66.39s0,0,0,0L24.32,35.23a98.53,98.53,0,0,0-12.73,19L77.66,81.64a27.49,27.49,0,0,0-6,14.44l-66-27.36A97.65,97.65,0,0,0,1.15,91.18h44v0A56.28,56.28,0,0,0,44.57,99a56.14,56.14,0,0,0,.62,7.83h-44a97.65,97.65,0,0,0,4.47,22.46l66.05-27.36a27.49,27.49,0,0,0,6,14.44L11.59,143.73a98.53,98.53,0,0,0,12.73,19l31.15-31.14a54.94,54.94,0,0,0,11.06,11.06h0L35.39,173.83a98.23,98.23,0,0,0,19,12.73l27.36-66.08a27.46,27.46,0,0,0,14.45,6L68.87,192.54A98.18,98.18,0,0,0,91.33,197V153A49.75,49.75,0,0,0,107,153h0v44a97.46,97.46,0,0,0,22.45-4.47l-27.36-66a27.49,27.49,0,0,0,14.45-6l27.36,66.08a98.53,98.53,0,0,0,19-12.73l-31.14-31.14h0a54.68,54.68,0,0,0,11.06-11.06Z"}))}),["core/archives","core/calendar","core/latest-comments","core/tag-cloud","core/verse"].forEach((e=>{(0,n.unregisterBlockType)(e)})),["animoto","spotify","flickr","cloudup","collegehumor","issuu","kickstarter","mixcloud","reverbnation","smugmug","amazon-kindle","pinterest","loom","smartframe","descript"].forEach((e=>{(0,n.unregisterBlockVariation)("core/embed",e)})),(0,s.removeFilter)("editor.MediaUpload","external-media/replace-media-upload")}))})(); +(()=>{"use strict";var e={n:o=>{var t=o&&o.__esModule?()=>o.default:()=>o;return e.d(t,{a:t}),t},d:(o,t)=>{for(var r in t)e.o(t,r)&&!e.o(o,r)&&Object.defineProperty(o,r,{enumerable:!0,get:t[r]})},o:(e,o)=>Object.prototype.hasOwnProperty.call(e,o)};const o=window.React,t=window.wp.domReady;var r=e.n(t);const a=window.wp.data,n=window.wp.blocks,s=window.wp.hooks,i=window.wp.apiFetch;var l=e.n(i);const c=window.wp.url;function d(e){const o=(0,c.addQueryArgs)("/prc-api/v3/report-package/regenerate-toc",{post_id:e});return new Promise(((e,t)=>{l()({path:o,method:"POST"}).then((o=>{console.log("Regenerate TOC response",o),e(o)})).catch((e=>{console.error("Regenerate TOC error",e),t(e)}))}))}const p={post:{preview:{start:[d],end:[]},publish:{start:[d],end:[]}},"fact-sheet":{preview:{start:[d],end:[]},publish:{start:[d],end:[]}}};r()((()=>{null!==(0,a.select)("core/editor")&&((0,a.dispatch)("core/editor").removeEditorPanel("taxonomy-panel-post_tag"),(0,a.dispatch)("core/editor").removeEditorPanel("discussion-panel"),function(){console.log("prc-platform/post-preview-publish-hook: watcher activating");const e=()=>(0,a.select)("core/editor").isPreviewingPost(),o=()=>(0,a.select)("core/editor").isPublishingPost(),t=()=>(0,a.select)("core/editor").isAutosavingPost();let r=e(),n=o(),s=t();(0,a.subscribe)((()=>{const i=(0,a.select)("core/editor").getCurrentPostId(),l=(0,a.select)("core/editor").getCurrentPostType(),c=e(),d=o(),h=t();r!==c&&(console.log("start preview",i,l),function(e,o){p[o]&&p[o].preview.start&&p[o].preview.start.length&&p[o].preview.start.forEach((o=>{o(e)}))}(i,l)),n!==d&&(console.log("start publish",i,l),function(e,o){p[o]&&p[o].publish.start&&p[o].publish.start.length&&p[o].publish.start.forEach((o=>{o(e)}))}(i,l)),s!==h&&console.log("autosave",i,l),r&&!c&&(console.log("end preview",i,l),function(e,o){p[o]&&p[o].preview.end&&p[o].preview.end.length&&p[o].preview.end.forEach((o=>{o(e)}))}(i,l)),n&&!d&&(console.log("end publish",i,l),function(e,o){p[o]&&p[o].publish.end&&p[o].publish.end.length&&p[o].publish.end.forEach((o=>{o(e)}))}(i,l)),r=c,n=d,s=h}))}()),(0,n.registerBlockCollection)("prc-block",{title:"Pew Research Center Block Library",icon:()=>(0,o.createElement)("svg",{id:"tiny-logo","data-name":"Tiny PRC Logo",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 198 198",height:"20"},(0,o.createElement)("path",{d:"M142.83,131.63,174,162.77a98.58,98.58,0,0,0,12.74-19l-66.08-27.37a27.49,27.49,0,0,0,6-14.44l66.05,27.36a97.65,97.65,0,0,0,4.47-22.46h-44a56.14,56.14,0,0,0,.62-7.83,54.79,54.79,0,0,0-.63-7.84s0,0,0,0h44a97.65,97.65,0,0,0-4.47-22.46L126.63,96.08a27.43,27.43,0,0,0-6-14.44l66.09-27.37a98.58,98.58,0,0,0-12.74-19L142.83,66.38a54.89,54.89,0,0,0-11.05-11.06l31.14-31.14a98.08,98.08,0,0,0-19-12.73L116.52,77.52a27.57,27.57,0,0,0-14.45-6l27.36-66A98,98,0,0,0,107,1V45h0a53.41,53.41,0,0,0-7.85-.63,54.6,54.6,0,0,0-7.81.62V1A97.65,97.65,0,0,0,68.87,5.47L96.24,71.52a27.54,27.54,0,0,0-14.45,6L54.43,11.44a98.27,98.27,0,0,0-19,12.74L66.53,55.32A54.52,54.52,0,0,0,55.46,66.39s0,0,0,0L24.32,35.23a98.53,98.53,0,0,0-12.73,19L77.66,81.64a27.49,27.49,0,0,0-6,14.44l-66-27.36A97.65,97.65,0,0,0,1.15,91.18h44v0A56.28,56.28,0,0,0,44.57,99a56.14,56.14,0,0,0,.62,7.83h-44a97.65,97.65,0,0,0,4.47,22.46l66.05-27.36a27.49,27.49,0,0,0,6,14.44L11.59,143.73a98.53,98.53,0,0,0,12.73,19l31.15-31.14a54.94,54.94,0,0,0,11.06,11.06h0L35.39,173.83a98.23,98.23,0,0,0,19,12.73l27.36-66.08a27.46,27.46,0,0,0,14.45,6L68.87,192.54A98.18,98.18,0,0,0,91.33,197V153A49.75,49.75,0,0,0,107,153h0v44a97.46,97.46,0,0,0,22.45-4.47l-27.36-66a27.49,27.49,0,0,0,14.45-6l27.36,66.08a98.53,98.53,0,0,0,19-12.73l-31.14-31.14h0a54.68,54.68,0,0,0,11.06-11.06Z"}))}),["core/archives","core/calendar","core/latest-comments","core/tag-cloud","core/verse"].forEach((e=>{(0,n.unregisterBlockType)(e)})),["animoto","spotify","flickr","cloudup","collegehumor","issuu","kickstarter","mixcloud","reverbnation","smugmug","amazon-kindle","pinterest","loom","smartframe","descript"].forEach((e=>{(0,n.unregisterBlockVariation)("core/embed",e)})),(0,s.removeFilter)("editor.MediaUpload","external-media/replace-media-upload")}))})(); //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/includes/block-editor/build/index.js.map b/includes/block-editor/build/index.js.map index 7f259920..41eef2c2 100644 --- a/includes/block-editor/build/index.js.map +++ b/includes/block-editor/build/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","mappings":"mBACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,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BL,EAAgBO,EAChBN,EAAgBO,EAChBN,EAAiBO,CAAqB,GAExC,CAGCQ,KCnHAC,EAAAA,EAAAA,yBAAwB,YAAa,CACpCC,MAAO,oCACPC,KAAMA,KACLC,EAAAA,EAAAA,eAAA,OACCC,GAAG,YACH,YAAU,gBACVC,MAAM,6BACNC,QAAQ,cACRC,OAAO,OAEPJ,EAAAA,EAAAA,eAAA,QAAMpE,EAAE,gyCAaM,CAChB,gBACA,gBACA,uBACA,iBACA,cAEQ0D,SAASe,KACjBC,EAAAA,EAAAA,qBAAoBD,EAAU,IAGA,CAC9B,UACA,UACA,SACA,UACA,eACA,QACA,cACA,WACA,eACA,UACA,gBACA,YACA,OACA,aACA,YAEsBf,SAASiB,KAC/BC,EAAAA,EAAAA,0BAAyB,aAAcD,EAAK,KA0B7CE,EAAAA,EAAAA,cAAa,qBAAsB,sCAAsC,G","sources":["webpack://@pewresearch/prc-platform-block-editor/webpack/bootstrap","webpack://@pewresearch/prc-platform-block-editor/webpack/runtime/compat get default export","webpack://@pewresearch/prc-platform-block-editor/webpack/runtime/define property getters","webpack://@pewresearch/prc-platform-block-editor/webpack/runtime/hasOwnProperty shorthand","webpack://@pewresearch/prc-platform-block-editor/external window \"React\"","webpack://@pewresearch/prc-platform-block-editor/external window [\"wp\",\"domReady\"]","webpack://@pewresearch/prc-platform-block-editor/external window [\"wp\",\"data\"]","webpack://@pewresearch/prc-platform-block-editor/external window [\"wp\",\"blocks\"]","webpack://@pewresearch/prc-platform-block-editor/external window [\"wp\",\"hooks\"]","webpack://@pewresearch/prc-platform-block-editor/external window [\"wp\",\"apiFetch\"]","webpack://@pewresearch/prc-platform-block-editor/external window [\"wp\",\"url\"]","webpack://@pewresearch/prc-platform-block-editor/./src/regenerate-toc-action.js","webpack://@pewresearch/prc-platform-block-editor/./src/post-preview-publish-hook.js","webpack://@pewresearch/prc-platform-block-editor/./src/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"React\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"domReady\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"data\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blocks\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"hooks\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"apiFetch\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"url\"];","/**\n * WordPress Dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\nimport { addQueryArgs } from '@wordpress/url';\n\nexport default function regenerateToc(postId) {\n\tconst path = addQueryArgs('/prc-api/v3/report-package/regenerate-toc', {\n\t\tpostId,\n\t});\n\treturn new Promise((resolve, reject) => {\n\t\tapiFetch({\n\t\t\tpath,\n\t\t\tmethod: 'POST',\n\t\t})\n\t\t\t.then((response) => {\n\t\t\t\tconsole.log('Regenerate TOC response', response);\n\t\t\t\tresolve(response);\n\t\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\tconsole.error('Regenerate TOC error', error);\n\t\t\t\treject(error);\n\t\t\t});\n\t});\n}\n","/**\n * WordPress Dependencies\n */\nimport { select, subscribe } from '@wordpress/data';\n\n/**\n * Internal Dependencies\n */\n// Actions:\nimport regenerateToc from './regenerate-toc-action';\n\nconst actions = {\n\tpost: {\n\t\tpreview: {\n\t\t\tstart: [regenerateToc],\n\t\t\tend: [],\n\t\t},\n\t\tpublish: {\n\t\t\tstart: [regenerateToc],\n\t\t\tend: [],\n\t\t},\n\t},\n\t'fact-sheet': {\n\t\tpreview: {\n\t\t\tstart: [regenerateToc],\n\t\t\tend: [],\n\t\t},\n\t\tpublish: {\n\t\t\tstart: [regenerateToc],\n\t\t\tend: [],\n\t\t},\n\t},\n};\n\nfunction startPreview(postId, postType) {\n\tif (!actions[postType]) {\n\t\treturn;\n\t}\n\tif (\n\t\tactions[postType].preview.start &&\n\t\tactions[postType].preview.start.length\n\t) {\n\t\tactions[postType].preview.start.forEach((action) => {\n\t\t\taction(postId);\n\t\t});\n\t}\n}\n\nfunction endPreview(postId, postType) {\n\tif (!actions[postType]) {\n\t\treturn;\n\t}\n\tif (actions[postType].preview.end && actions[postType].preview.end.length) {\n\t\tactions[postType].preview.end.forEach((action) => {\n\t\t\taction(postId);\n\t\t});\n\t}\n}\n\nfunction startPublish(postId, postType) {\n\tif (!actions[postType]) {\n\t\treturn;\n\t}\n\tif (\n\t\tactions[postType].publish.start &&\n\t\tactions[postType].publish.start.length\n\t) {\n\t\tactions[postType].publish.start.forEach((action) => {\n\t\t\taction(postId);\n\t\t});\n\t}\n}\n\nfunction endPublish(postId, postType) {\n\tif (!actions[postType]) {\n\t\treturn;\n\t}\n\tif (actions[postType].publish.end && actions[postType].publish.end.length) {\n\t\tactions[postType].publish.end.forEach((action) => {\n\t\t\taction(postId);\n\t\t});\n\t}\n}\n\nfunction watcher() {\n\tconsole.log('prc-platform/post-preview-publish-hook: watcher activating');\n\t// Setup simple functions to get the current status of the post:\n\tconst getPostPreviewStatus = () => select('core/editor').isPreviewingPost();\n\tconst getPostPublishStatus = () => select('core/editor').isPublishingPost();\n\tconst getPostAutosaveStatus = () =>\n\t\tselect('core/editor').isAutosavingPost();\n\n\t// Set initial values to compare against:\n\tlet previewStatus = getPostPreviewStatus();\n\tlet publishStatus = getPostPublishStatus();\n\tlet autosaveStatus = getPostAutosaveStatus();\n\n\tsubscribe(() => {\n\t\t// Get current values:\n\t\tconst postId = select('core/editor').getCurrentPostId();\n\t\tconst postType = select('core/editor').getCurrentPostType();\n\t\tconst newPostPreviewStatus = getPostPreviewStatus();\n\t\tconst newPostPublishStatus = getPostPublishStatus();\n\t\tconst newPostAutosaveStatus = getPostAutosaveStatus();\n\n\t\tif (previewStatus !== newPostPreviewStatus) {\n\t\t\tconsole.log('start preview', postId, postType);\n\t\t\tstartPreview(postId, postType);\n\t\t}\n\t\tif (publishStatus !== newPostPublishStatus) {\n\t\t\tconsole.log('start publish', postId, postType);\n\t\t\tstartPublish(postId, postType);\n\t\t}\n\t\tif (autosaveStatus !== newPostAutosaveStatus) {\n\t\t\tconsole.log('autosave', postId, postType);\n\t\t}\n\t\tif (previewStatus && !newPostPreviewStatus) {\n\t\t\tconsole.log('end preview', postId, postType);\n\t\t\tendPreview(postId, postType);\n\t\t}\n\t\tif (publishStatus && !newPostPublishStatus) {\n\t\t\tconsole.log('end publish', postId, postType);\n\t\t\tendPublish(postId, postType);\n\t\t}\n\n\t\t// Store new values back:\n\t\tpreviewStatus = newPostPreviewStatus;\n\t\tpublishStatus = newPostPublishStatus;\n\t\tautosaveStatus = newPostAutosaveStatus;\n\t});\n}\n\nexport default function postPreviewPublishHook() {\n\twatcher();\n}\n","/**\n * WordPress Dependencies:\n */\nimport domReady from '@wordpress/dom-ready';\nimport { select, subscribe, dispatch } from '@wordpress/data';\nimport {\n\tunregisterBlockType,\n\tunregisterBlockVariation,\n\tregisterBlockCollection,\n} from '@wordpress/blocks';\nimport { removeFilter } from '@wordpress/hooks';\n\n/**\n * Internal Dependencies:\n */\nimport postPreviewPublishHook from './post-preview-publish-hook';\n\nfunction registerPRCBlockCollection() {\n\tregisterBlockCollection('prc-block', {\n\t\ttitle: 'Pew Research Center Block Library',\n\t\ticon: () => (\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t),\n\t});\n}\n\nfunction removeEditorPanels() {\n\t// We do not use Tags or Comments at Pew Research Center.\n\tdispatch('core/editor').removeEditorPanel('taxonomy-panel-post_tag');\n\tdispatch('core/editor').removeEditorPanel('discussion-panel');\n}\n\nfunction unregisterBlocks() {\n\tconst toRemove = [\n\t\t'core/archives',\n\t\t'core/calendar',\n\t\t'core/latest-comments',\n\t\t'core/tag-cloud',\n\t\t'core/verse',\n\t];\n\ttoRemove.forEach((blockType) => {\n\t\tunregisterBlockType(blockType);\n\t});\n\n\tconst embedVariationToRemove = [\n\t\t'animoto',\n\t\t'spotify',\n\t\t'flickr',\n\t\t'cloudup',\n\t\t'collegehumor',\n\t\t'issuu',\n\t\t'kickstarter',\n\t\t'mixcloud',\n\t\t'reverbnation',\n\t\t'smugmug',\n\t\t'amazon-kindle',\n\t\t'pinterest',\n\t\t'loom',\n\t\t'smartframe',\n\t\t'descript',\n\t];\n\tembedVariationToRemove.forEach((name) => {\n\t\tunregisterBlockVariation('core/embed', name);\n\t});\n}\n\ndomReady(() => {\n\tif (null !== select('core/editor')) {\n\t\t/**\n\t\t * Remove editor panels that we do not use.\n\t\t */\n\t\tremoveEditorPanels();\n\t\t/**\n\t\t * Register custom hooks.\n\t\t */\n\t\tpostPreviewPublishHook();\n\t}\n\t/**\n\t * Register the \"Pew Research Center\" block collection.\n\t */\n\tregisterPRCBlockCollection();\n\t/**\n\t * Unregister blocks that we do not use.\n\t */\n\tunregisterBlocks();\n\t/**\n\t * Removes the external media button that Jetpack so rudely adds everywhere.\n\t */\n\tremoveFilter('editor.MediaUpload', 'external-media/replace-media-upload');\n});\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","window","regenerateToc","postId","path","addQueryArgs","Promise","resolve","reject","apiFetch","method","then","response","console","log","catch","error","actions","post","preview","start","end","publish","domReady","select","dispatch","removeEditorPanel","getPostPreviewStatus","isPreviewingPost","getPostPublishStatus","isPublishingPost","getPostAutosaveStatus","isAutosavingPost","previewStatus","publishStatus","autosaveStatus","subscribe","getCurrentPostId","postType","getCurrentPostType","newPostPreviewStatus","newPostPublishStatus","newPostAutosaveStatus","length","forEach","action","startPreview","startPublish","endPreview","endPublish","watcher","registerBlockCollection","title","icon","createElement","id","xmlns","viewBox","height","blockType","unregisterBlockType","name","unregisterBlockVariation","removeFilter"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"index.js","mappings":"mBACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,ICAlF,MAAM,EAA+BI,OAAc,MCA7C,EAA+BA,OAAW,GAAY,S,aCA5D,MAAM,EAA+BA,OAAW,GAAQ,KCAlD,EAA+BA,OAAW,GAAU,OCApD,EAA+BA,OAAW,GAAS,MCAnD,EAA+BA,OAAW,GAAY,S,aCA5D,MAAM,EAA+BA,OAAW,GAAO,ICMxC,SAASC,EAAcC,GACrC,MAAMC,GAAOC,EAAAA,EAAAA,cAAa,4CAA6C,CACtEC,QAASH,IAEV,OAAO,IAAII,SAAQ,CAACC,EAASC,KAC5BC,IAAS,CACRN,OACAO,OAAQ,SAEPC,MAAMC,IACNC,QAAQC,IAAI,0BAA2BF,GACvCL,EAAQK,EAAS,IAEjBG,OAAOC,IACPH,QAAQG,MAAM,uBAAwBA,GACtCR,EAAOQ,EAAM,GACZ,GAEL,CCbA,MAA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sCAAsC,G","sources":["webpack://@pewresearch/prc-platform-block-editor/webpack/bootstrap","webpack://@pewresearch/prc-platform-block-editor/webpack/runtime/compat get default export","webpack://@pewresearch/prc-platform-block-editor/webpack/runtime/define property getters","webpack://@pewresearch/prc-platform-block-editor/webpack/runtime/hasOwnProperty shorthand","webpack://@pewresearch/prc-platform-block-editor/external window \"React\"","webpack://@pewresearch/prc-platform-block-editor/external window [\"wp\",\"domReady\"]","webpack://@pewresearch/prc-platform-block-editor/external window [\"wp\",\"data\"]","webpack://@pewresearch/prc-platform-block-editor/external window [\"wp\",\"blocks\"]","webpack://@pewresearch/prc-platform-block-editor/external window [\"wp\",\"hooks\"]","webpack://@pewresearch/prc-platform-block-editor/external window [\"wp\",\"apiFetch\"]","webpack://@pewresearch/prc-platform-block-editor/external window [\"wp\",\"url\"]","webpack://@pewresearch/prc-platform-block-editor/./src/regenerate-toc-action.js","webpack://@pewresearch/prc-platform-block-editor/./src/post-preview-publish-hook.js","webpack://@pewresearch/prc-platform-block-editor/./src/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"React\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"domReady\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"data\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blocks\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"hooks\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"apiFetch\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"url\"];","/**\n * WordPress Dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\nimport { addQueryArgs } from '@wordpress/url';\n\nexport default function regenerateToc(postId) {\n\tconst path = addQueryArgs('/prc-api/v3/report-package/regenerate-toc', {\n\t\tpost_id: postId,\n\t});\n\treturn new Promise((resolve, reject) => {\n\t\tapiFetch({\n\t\t\tpath,\n\t\t\tmethod: 'POST',\n\t\t})\n\t\t\t.then((response) => {\n\t\t\t\tconsole.log('Regenerate TOC response', response);\n\t\t\t\tresolve(response);\n\t\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\tconsole.error('Regenerate TOC error', error);\n\t\t\t\treject(error);\n\t\t\t});\n\t});\n}\n","/**\n * WordPress Dependencies\n */\nimport { select, subscribe } from '@wordpress/data';\n\n/**\n * Internal Dependencies\n */\n// Actions:\nimport regenerateToc from './regenerate-toc-action';\n\nconst actions = {\n\tpost: {\n\t\tpreview: {\n\t\t\tstart: [regenerateToc],\n\t\t\tend: [],\n\t\t},\n\t\tpublish: {\n\t\t\tstart: [regenerateToc],\n\t\t\tend: [],\n\t\t},\n\t},\n\t'fact-sheet': {\n\t\tpreview: {\n\t\t\tstart: [regenerateToc],\n\t\t\tend: [],\n\t\t},\n\t\tpublish: {\n\t\t\tstart: [regenerateToc],\n\t\t\tend: [],\n\t\t},\n\t},\n};\n\nfunction startPreview(postId, postType) {\n\tif (!actions[postType]) {\n\t\treturn;\n\t}\n\tif (\n\t\tactions[postType].preview.start &&\n\t\tactions[postType].preview.start.length\n\t) {\n\t\tactions[postType].preview.start.forEach((action) => {\n\t\t\taction(postId);\n\t\t});\n\t}\n}\n\nfunction endPreview(postId, postType) {\n\tif (!actions[postType]) {\n\t\treturn;\n\t}\n\tif (actions[postType].preview.end && actions[postType].preview.end.length) {\n\t\tactions[postType].preview.end.forEach((action) => {\n\t\t\taction(postId);\n\t\t});\n\t}\n}\n\nfunction startPublish(postId, postType) {\n\tif (!actions[postType]) {\n\t\treturn;\n\t}\n\tif (\n\t\tactions[postType].publish.start &&\n\t\tactions[postType].publish.start.length\n\t) {\n\t\tactions[postType].publish.start.forEach((action) => {\n\t\t\taction(postId);\n\t\t});\n\t}\n}\n\nfunction endPublish(postId, postType) {\n\tif (!actions[postType]) {\n\t\treturn;\n\t}\n\tif (actions[postType].publish.end && actions[postType].publish.end.length) {\n\t\tactions[postType].publish.end.forEach((action) => {\n\t\t\taction(postId);\n\t\t});\n\t}\n}\n\nfunction watcher() {\n\tconsole.log('prc-platform/post-preview-publish-hook: watcher activating');\n\t// Setup simple functions to get the current status of the post:\n\tconst getPostPreviewStatus = () => select('core/editor').isPreviewingPost();\n\tconst getPostPublishStatus = () => select('core/editor').isPublishingPost();\n\tconst getPostAutosaveStatus = () =>\n\t\tselect('core/editor').isAutosavingPost();\n\n\t// Set initial values to compare against:\n\tlet previewStatus = getPostPreviewStatus();\n\tlet publishStatus = getPostPublishStatus();\n\tlet autosaveStatus = getPostAutosaveStatus();\n\n\tsubscribe(() => {\n\t\t// Get current values:\n\t\tconst postId = select('core/editor').getCurrentPostId();\n\t\tconst postType = select('core/editor').getCurrentPostType();\n\t\tconst newPostPreviewStatus = getPostPreviewStatus();\n\t\tconst newPostPublishStatus = getPostPublishStatus();\n\t\tconst newPostAutosaveStatus = getPostAutosaveStatus();\n\n\t\tif (previewStatus !== newPostPreviewStatus) {\n\t\t\tconsole.log('start preview', postId, postType);\n\t\t\tstartPreview(postId, postType);\n\t\t}\n\t\tif (publishStatus !== newPostPublishStatus) {\n\t\t\tconsole.log('start publish', postId, postType);\n\t\t\tstartPublish(postId, postType);\n\t\t}\n\t\tif (autosaveStatus !== newPostAutosaveStatus) {\n\t\t\tconsole.log('autosave', postId, postType);\n\t\t}\n\t\tif (previewStatus && !newPostPreviewStatus) {\n\t\t\tconsole.log('end preview', postId, postType);\n\t\t\tendPreview(postId, postType);\n\t\t}\n\t\tif (publishStatus && !newPostPublishStatus) {\n\t\t\tconsole.log('end publish', postId, postType);\n\t\t\tendPublish(postId, postType);\n\t\t}\n\n\t\t// Store new values back:\n\t\tpreviewStatus = newPostPreviewStatus;\n\t\tpublishStatus = newPostPublishStatus;\n\t\tautosaveStatus = newPostAutosaveStatus;\n\t});\n}\n\nexport default function postPreviewPublishHook() {\n\twatcher();\n}\n","/**\n * WordPress Dependencies:\n */\nimport domReady from '@wordpress/dom-ready';\nimport { select, subscribe, dispatch } from '@wordpress/data';\nimport {\n\tunregisterBlockType,\n\tunregisterBlockVariation,\n\tregisterBlockCollection,\n} from '@wordpress/blocks';\nimport { removeFilter } from '@wordpress/hooks';\n\n/**\n * Internal Dependencies:\n */\nimport postPreviewPublishHook from './post-preview-publish-hook';\n\nfunction registerPRCBlockCollection() {\n\tregisterBlockCollection('prc-block', {\n\t\ttitle: 'Pew Research Center Block Library',\n\t\ticon: () => (\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t),\n\t});\n}\n\nfunction removeEditorPanels() {\n\t// We do not use Tags or Comments at Pew Research Center.\n\tdispatch('core/editor').removeEditorPanel('taxonomy-panel-post_tag');\n\tdispatch('core/editor').removeEditorPanel('discussion-panel');\n}\n\nfunction unregisterBlocks() {\n\tconst toRemove = [\n\t\t'core/archives',\n\t\t'core/calendar',\n\t\t'core/latest-comments',\n\t\t'core/tag-cloud',\n\t\t'core/verse',\n\t];\n\ttoRemove.forEach((blockType) => {\n\t\tunregisterBlockType(blockType);\n\t});\n\n\tconst embedVariationToRemove = [\n\t\t'animoto',\n\t\t'spotify',\n\t\t'flickr',\n\t\t'cloudup',\n\t\t'collegehumor',\n\t\t'issuu',\n\t\t'kickstarter',\n\t\t'mixcloud',\n\t\t'reverbnation',\n\t\t'smugmug',\n\t\t'amazon-kindle',\n\t\t'pinterest',\n\t\t'loom',\n\t\t'smartframe',\n\t\t'descript',\n\t];\n\tembedVariationToRemove.forEach((name) => {\n\t\tunregisterBlockVariation('core/embed', name);\n\t});\n}\n\ndomReady(() => {\n\tif (null !== select('core/editor')) {\n\t\t/**\n\t\t * Remove editor panels that we do not use.\n\t\t */\n\t\tremoveEditorPanels();\n\t\t/**\n\t\t * Register custom hooks.\n\t\t */\n\t\tpostPreviewPublishHook();\n\t}\n\t/**\n\t * Register the \"Pew Research Center\" block collection.\n\t */\n\tregisterPRCBlockCollection();\n\t/**\n\t * Unregister blocks that we do not use.\n\t */\n\tunregisterBlocks();\n\t/**\n\t * Removes the external media button that Jetpack so rudely adds everywhere.\n\t */\n\tremoveFilter('editor.MediaUpload', 'external-media/replace-media-upload');\n});\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","window","regenerateToc","postId","path","addQueryArgs","post_id","Promise","resolve","reject","apiFetch","method","then","response","console","log","catch","error","actions","post","preview","start","end","publish","domReady","select","dispatch","removeEditorPanel","getPostPreviewStatus","isPreviewingPost","getPostPublishStatus","isPublishingPost","getPostAutosaveStatus","isAutosavingPost","previewStatus","publishStatus","autosaveStatus","subscribe","getCurrentPostId","postType","getCurrentPostType","newPostPreviewStatus","newPostPublishStatus","newPostAutosaveStatus","length","forEach","action","startPreview","startPublish","endPreview","endPublish","watcher","registerBlockCollection","title","icon","createElement","id","xmlns","viewBox","height","blockType","unregisterBlockType","name","unregisterBlockVariation","removeFilter"],"sourceRoot":""} \ No newline at end of file diff --git a/includes/block-editor/src/regenerate-toc-action.js b/includes/block-editor/src/regenerate-toc-action.js index 66cc8d54..2faf5599 100644 --- a/includes/block-editor/src/regenerate-toc-action.js +++ b/includes/block-editor/src/regenerate-toc-action.js @@ -6,7 +6,7 @@ import { addQueryArgs } from '@wordpress/url'; export default function regenerateToc(postId) { const path = addQueryArgs('/prc-api/v3/report-package/regenerate-toc', { - postId, + post_id: postId, }); return new Promise((resolve, reject) => { apiFetch({ diff --git a/includes/embeds/class-embeds.php b/includes/embeds/class-embeds.php index e6042db1..32665c53 100644 --- a/includes/embeds/class-embeds.php +++ b/includes/embeds/class-embeds.php @@ -143,7 +143,8 @@ public function register_embed_footer_style() { } /** - * This is being served on THEIR pages, outside the iframe. We copy this script src in the embed code on our pages. + * This is being served on THEIR pages, outside the iframe. + * We copy this script src in the embed code on our pages. * @return WP_Error|true */ public function register_resizer_asset() { @@ -167,7 +168,7 @@ public function register_resizer_asset() { } /** - * This is being served on our pages, inside an /iframe. + * This is being served on our pages, inside of an /iframe. * @return WP_Error|true */ public function register_resizer_window_asset() { diff --git a/includes/permalink-rewrites/class-url-helper.php b/includes/permalink-rewrites/class-url-helper.php index dce0baab..e14cb235 100644 --- a/includes/permalink-rewrites/class-url-helper.php +++ b/includes/permalink-rewrites/class-url-helper.php @@ -15,6 +15,8 @@ class URL_Helper { 'beta.pewresearch.org', 'prc-platform.vipdev.lndo.site', // To Deprecate: + 'pewresearch-org-alpha.go-vip.net', + 'pewresearch-org-alpha.go-vip.co', 'pewresearch-org-beta.go-vip.co', 'pewresearch-org-beta.go-vip.net', 'prc-local.vipdev.lndo.site', diff --git a/includes/table-of-contents/class-table-of-contents.php b/includes/table-of-contents/class-table-of-contents.php index f84e4414..1786a07d 100644 --- a/includes/table-of-contents/class-table-of-contents.php +++ b/includes/table-of-contents/class-table-of-contents.php @@ -385,7 +385,7 @@ public function register_rest_endpoint($endpoints) { 'methods' => 'POST', 'callback' => array($this, 'restfully_regenerate_toc'), 'args' => array( - 'postId' => array( + 'post_id' => array( 'required' => true, 'type' => 'integer', ), @@ -398,7 +398,7 @@ public function register_rest_endpoint($endpoints) { } public function restfully_regenerate_toc(\WP_REST_Request $request) { - $post_id = $request->get_param('postId'); + $post_id = $request->get_param('post_id'); if ( empty($post_id) ) { return new WP_Error('400', 'Missing post_id parameter.'); } diff --git a/includes/utils.php b/includes/utils.php index 2647d612..107b2bf9 100644 --- a/includes/utils.php +++ b/includes/utils.php @@ -103,16 +103,7 @@ function log_error($error) { 'code' => $code, ], true)); - if ( function_exists( 'wp_sentry_safe' ) ) { - wp_sentry_safe( function ( \Sentry\State\HubInterface $client ) use ( $error, $message, $code ) { - // If the original error was an exception pass it along, otherwise let's create a new one with the message and code (if set) - if ( $error instanceof \Exception ) { - $client->captureException($error); - } else { - $client->captureMessage($message, \Sentry\Severity::error() ); - } - } ); - } elseif ( extension_loaded('newrelic') && function_exists('newrelic_notice_error') ) { + if ( extension_loaded('newrelic') && function_exists('newrelic_notice_error') ) { // If the original error was an exception pass it along, otherwise let's create a new one with the message and code (if set) if ( $error instanceof \Throwable ) { \newrelic_notice_error($error); @@ -217,4 +208,4 @@ function get_list_of($list_of = null) { // Return an empty array return []; } -} \ No newline at end of file +}