diff --git a/includes/datasets/build/dataset-atp-legal-acceptance-block/index.asset.php b/includes/datasets/build/dataset-atp-legal-acceptance-block/index.asset.php index 34dc0fd..0e865ed 100644 --- a/includes/datasets/build/dataset-atp-legal-acceptance-block/index.asset.php +++ b/includes/datasets/build/dataset-atp-legal-acceptance-block/index.asset.php @@ -1 +1 @@ - array('react', 'wp-block-editor', 'wp-blocks', 'wp-polyfill', 'wp-primitives'), 'version' => '5758e586d447e574695b'); + array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-polyfill', 'wp-primitives'), 'version' => '13684d6aca4d52ce33f6'); diff --git a/includes/datasets/build/dataset-atp-legal-acceptance-block/index.js b/includes/datasets/build/dataset-atp-legal-acceptance-block/index.js index 8195bfa..ade5a31 100644 --- a/includes/datasets/build/dataset-atp-legal-acceptance-block/index.js +++ b/includes/datasets/build/dataset-atp-legal-acceptance-block/index.js @@ -1,2 +1,2 @@ -(()=>{"use strict";var e,r={608:(e,r,t)=>{const o=window.wp.blocks,a=window.wp.primitives;var s=t(893);const n=(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,s.jsx)(a.Path,{d:"M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z"})});var i=t(196);const p=window.wp.blockEditor,c=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"prc-platform/dataset-atp-legal-acceptance","version":"0.1.0","title":"Dataset ATP Legal Acceptance","category":"theme","description":"Provides an ATP Legal Acceptance form for users.","attributes":{"datasetId":{"type":"string"},"nonce":{"type":"string"}},"supports":{"interactivity":true},"textdomain":"dataset-atp-legal-acceptance","editorScript":"file:./index.js","render":"file:./render.php","style":"file:./style-index.css","viewScriptModule":"file:./view.js"}'),{name:l}=c,f={icon:n,edit:function({attributes:e,setAttributes:r}){const t=(0,p.useBlockProps)();return(0,i.createElement)("div",{...t})}};(0,o.registerBlockType)(l,{...c,...f})},251:(e,r,t)=>{var o=t(196),a=Symbol.for("react.element"),s=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),n=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};r.jsx=function(e,r,t){var o,p={},c=null,l=null;for(o in void 0!==t&&(c=""+t),void 0!==r.key&&(c=""+r.key),void 0!==r.ref&&(l=r.ref),r)s.call(r,o)&&!i.hasOwnProperty(o)&&(p[o]=r[o]);if(e&&e.defaultProps)for(o in r=e.defaultProps)void 0===p[o]&&(p[o]=r[o]);return{$$typeof:a,type:e,key:c,ref:l,props:p,_owner:n.current}}},893:(e,r,t)=>{e.exports=t(251)},196:e=>{e.exports=window.React}},t={};function o(e){var a=t[e];if(void 0!==a)return a.exports;var s=t[e]={exports:{}};return r[e](s,s.exports,o),s.exports}o.m=r,e=[],o.O=(r,t,a,s)=>{if(!t){var n=1/0;for(l=0;l=s)&&Object.keys(o.O).every((e=>o.O[e](t[p])))?t.splice(p--,1):(i=!1,s0&&e[l-1][2]>s;l--)e[l]=e[l-1];e[l]=[t,a,s]},o.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),(()=>{var e={958:0,293:0};o.O.j=r=>0===e[r];var r=(r,t)=>{var a,s,[n,i,p]=t,c=0;if(n.some((r=>0!==e[r]))){for(a in i)o.o(i,a)&&(o.m[a]=i[a]);if(p)var l=p(o)}for(r&&r(t);co(608)));a=o.O(a)})(); +(()=>{"use strict";var e,t={786:()=>{const e=window.wp.blocks,t=window.wp.primitives,r=window.ReactJSXRuntime,s=(0,r.jsx)(t.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(t.Path,{d:"M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z"})}),a=window.wp.blockEditor,i=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"prc-platform/dataset-atp-legal-acceptance","version":"0.1.0","title":"Dataset ATP Legal Acceptance","category":"theme","description":"Provides an ATP Legal Acceptance form for users.","attributes":{"datasetId":{"type":"string"},"nonce":{"type":"string"}},"supports":{"interactivity":true},"textdomain":"dataset-atp-legal-acceptance","editorScript":"file:./index.js","render":"file:./render.php","style":"file:./style-index.css","viewScriptModule":"file:./view.js"}'),{name:o}=i,n={icon:s,edit:function({attributes:e,setAttributes:t}){const s=(0,a.useBlockProps)();return(0,r.jsx)("div",{...s})}};(0,e.registerBlockType)(o,{...i,...n})}},r={};function s(e){var a=r[e];if(void 0!==a)return a.exports;var i=r[e]={exports:{}};return t[e](i,i.exports,s),i.exports}s.m=t,e=[],s.O=(t,r,a,i)=>{if(!r){var o=1/0;for(l=0;l=i)&&Object.keys(s.O).every((e=>s.O[e](r[c])))?r.splice(c--,1):(n=!1,i0&&e[l-1][2]>i;l--)e[l]=e[l-1];e[l]=[r,a,i]},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={958:0,293:0};s.O.j=t=>0===e[t];var t=(t,r)=>{var a,i,o=r[0],n=r[1],c=r[2],p=0;if(o.some((t=>0!==e[t]))){for(a in n)s.o(n,a)&&(s.m[a]=n[a]);if(c)var l=c(s)}for(t&&t(r);ps(786)));a=s.O(a)})(); //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/includes/datasets/build/dataset-atp-legal-acceptance-block/index.js.map b/includes/datasets/build/dataset-atp-legal-acceptance-block/index.js.map index 7327fba..8232a7c 100644 --- a/includes/datasets/build/dataset-atp-legal-acceptance-block/index.js.map +++ b/includes/datasets/build/dataset-atp-legal-acceptance-block/index.js.map @@ -1 +1 @@ -{"version":3,"file":"dataset-atp-legal-acceptance-block/index.js","mappings":"uBAAIA,E,iBCAJ,MAAM,EAA+BC,OAAW,GAAU,O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IAA7BD,EAAgBC,GAGxD,IAAIC,EAAuB,CAACC,EAA4BC,KACvD,IAGI1B,EAAUuB,GAHTjB,EAAUqB,EAAaC,GAAWF,EAGhBf,EAAI,EAC3B,GAAGL,EAASuB,MAAMC,GAAgC,IAAxBR,EAAgBQ,KAAa,CACtD,IAAI9B,KAAY2B,EACZ5B,EAAoBoB,EAAEQ,EAAa3B,KACrCD,EAAoB7B,EAAE8B,GAAY2B,EAAY3B,IAGhD,GAAG4B,EAAS,IAAIvB,EAASuB,EAAQ7B,EAClC,CAEA,IADG0B,GAA4BA,EAA2BC,GACrDf,EAAIL,EAASM,OAAQD,IACzBY,EAAUjB,EAASK,GAChBZ,EAAoBoB,EAAEG,EAAiBC,IAAYD,EAAgBC,IACrED,EAAgBC,GAAS,KAE1BD,EAAgBC,GAAW,EAE5B,OAAOxB,EAAoBK,EAAEC,EAAO,EAGjC0B,EAAqBC,WAA2D,+CAAIA,WAA2D,gDAAK,GACxJD,EAAmBE,QAAQT,EAAqBU,KAAK,KAAM,IAC3DH,EAAmBI,KAAOX,EAAqBU,KAAK,KAAMH,EAAmBI,KAAKD,KAAKH,G,KC9CvF,IAAIK,EAAsBrC,EAAoBK,OAAEF,EAAW,CAAC,MAAM,IAAOH,EAAoB,OAC7FqC,EAAsBrC,EAAoBK,EAAEgC,E","sources":["webpack://@pewresearch/prc-platform-datasets/webpack/runtime/chunk loaded","webpack://@pewresearch/prc-platform-datasets/external window [\"wp\",\"blocks\"]","webpack://@pewresearch/prc-platform-datasets/external window [\"wp\",\"primitives\"]","webpack://@pewresearch/prc-platform-datasets/./node_modules/@wordpress/icons/build-module/library/download.js","webpack://@pewresearch/prc-platform-datasets/external window [\"wp\",\"blockEditor\"]","webpack://@pewresearch/prc-platform-datasets/./src/dataset-atp-legal-acceptance-block/index.js","webpack://@pewresearch/prc-platform-datasets/./src/dataset-atp-legal-acceptance-block/edit.jsx","webpack://@pewresearch/prc-platform-datasets/./node_modules/react/cjs/react-jsx-runtime.production.min.js","webpack://@pewresearch/prc-platform-datasets/./node_modules/react/jsx-runtime.js","webpack://@pewresearch/prc-platform-datasets/external window \"React\"","webpack://@pewresearch/prc-platform-datasets/webpack/bootstrap","webpack://@pewresearch/prc-platform-datasets/webpack/runtime/hasOwnProperty shorthand","webpack://@pewresearch/prc-platform-datasets/webpack/runtime/jsonp chunk loading","webpack://@pewresearch/prc-platform-datasets/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blocks\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"primitives\"];","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst download = /*#__PURE__*/_jsx(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n children: /*#__PURE__*/_jsx(Path, {\n d: \"M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z\"\n })\n});\nexport default download;\n//# sourceMappingURL=download.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blockEditor\"];","/**\n * Registers a new block provided a unique name and an object defining its behavior.\n *\n * @see https://developer.wordpress.org/block-editor/developers/block-api/#registering-a-block\n */\n\n/**\n * External Dependencies\n */\n\n/**\n * WordPress Dependencies\n */\nimport { registerBlockType } from '@wordpress/blocks';\nimport { download as icon } from '@wordpress/icons';\n\n/**\n * Internal Dependencies\n */\n\n/**\n * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files.\n * All files containing `style` keyword are bundled together. The code used\n * gets applied both to the front of your site and to the editor. All other files\n * get applied to the editor only.\n *\n * @see https://www.npmjs.com/package/@wordpress/scripts#using-css\n */\nimport edit from './edit';\nimport metadata from './block.json';\nimport './style.scss';\n\nconst { name } = metadata;\n\nconst settings = {\n\ticon,\n\tedit,\n};\n\n/**\n * Every block starts by registering a new block type definition.\n *\n * @see https://developer.wordpress.org/block-editor/developers/block-api/#registering-a-block\n */\nregisterBlockType(name, { ...metadata, ...settings });\n","/**\n * External Dependencies\n */\n/**\n * WordPress Dependencies\n */\nimport { useBlockProps } from '@wordpress/block-editor';\n\n/**\n * The edit function describes the structure of your block in the context of the\n * editor. This represents what the editor will render when the block is used.\n *\n * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#edit\n *\n * @param {Object} props Properties passed to the function.\n * @param {Object} props.attributes Available block attributes.\n * @param {Function} props.setAttributes Function that updates individual attributes.\n *\n * @return {WPElement} Element to render.\n */\nexport default function Edit({ attributes, setAttributes }) {\n\tconst blockProps = useBlockProps();\n\n\treturn
;\n}\n","/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","module.exports = window[\"React\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t958: 0,\n\t293: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = globalThis[\"webpackChunk_pewresearch_prc_platform_datasets\"] = globalThis[\"webpackChunk_pewresearch_prc_platform_datasets\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [293], () => (__webpack_require__(608)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","window","SVG","xmlns","viewBox","children","Path","d","name","metadata","settings","icon","edit","attributes","setAttributes","blockProps","useBlockProps","createElement","registerBlockType","f","k","Symbol","for","m","Object","prototype","hasOwnProperty","n","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","ReactCurrentOwner","p","key","ref","__self","__source","exports","jsx","c","a","g","b","e","h","call","defaultProps","$$typeof","type","props","_owner","current","module","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","O","result","chunkIds","fn","priority","notFulfilled","Infinity","i","length","fulfilled","j","keys","every","splice","r","o","obj","prop","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","data","moreModules","runtime","some","id","chunkLoadingGlobal","globalThis","forEach","bind","push","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"dataset-atp-legal-acceptance-block/index.js","mappings":"uBAAIA,E,YCAJ,MAAM,EAA+BC,OAAW,GAAU,OCApD,EAA+BA,OAAW,GAAc,WCAxD,EAA+BA,OAAwB,gBCY7D,GAP8B,SAAK,EAAAC,IAAK,CACtCC,MAAO,6BACPC,QAAS,YACTC,UAAuB,SAAK,EAAAC,KAAM,CAChCC,EAAG,uGCTD,EAA+BN,OAAW,GAAe,Y,8iBCgCvDO,KAAIA,GAAKC,EAEXC,EAAW,CAChBC,KAAI,EACJC,KChBc,UAAc,WAAEC,EAAU,cAAEC,IAC1C,MAAMC,GAAaC,EAAAA,EAAAA,iBAEnB,OAAOC,EAAAA,EAAAA,KAAA,UAASF,GACjB,IDoBAG,EAAAA,EAAAA,mBAAkBV,EAAM,IAAKC,KAAaC,G,GE3CtCS,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaE,QAGrB,IAAIC,EAASN,EAAyBE,GAAY,CAGjDG,QAAS,CAAC,GAOX,OAHAE,EAAoBL,GAAUI,EAAQA,EAAOD,QAASJ,GAG/CK,EAAOD,OACf,CAGAJ,EAAoBO,EAAID,ERzBpB1B,EAAW,GACfoB,EAAoBQ,EAAI,CAACC,EAAQC,EAAUC,EA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C,IAGhD,GAAGoC,EAAS,IAAI5B,EAAS4B,EAAQrC,EAClC,CAEA,IADGkC,GAA4BA,EAA2BC,GACrDpB,EAAIL,EAASM,OAAQD,IACzBiB,EAAUtB,EAASK,GAChBf,EAAoByB,EAAEM,EAAiBC,IAAYD,EAAgBC,IACrED,EAAgBC,GAAS,KAE1BD,EAAgBC,GAAW,EAE5B,OAAOhC,EAAoBQ,EAAEC,EAAO,EAGjC+B,EAAqBC,KAAqD,+CAAIA,KAAqD,gDAAK,GAC5ID,EAAmBE,QAAQT,EAAqBU,KAAK,KAAM,IAC3DH,EAAmBI,KAAOX,EAAqBU,KAAK,KAAMH,EAAmBI,KAAKD,KAAKH,G,KChDvF,IAAIK,EAAsB7C,EAAoBQ,OAAEL,EAAW,CAAC,MAAM,IAAOH,EAAoB,OAC7F6C,EAAsB7C,EAAoBQ,EAAEqC,E","sources":["webpack://@pewresearch/prc-platform-datasets/webpack/runtime/chunk loaded","webpack://@pewresearch/prc-platform-datasets/external window [\"wp\",\"blocks\"]","webpack://@pewresearch/prc-platform-datasets/external window [\"wp\",\"primitives\"]","webpack://@pewresearch/prc-platform-datasets/external window \"ReactJSXRuntime\"","webpack://@pewresearch/prc-platform-datasets/./node_modules/@wordpress/icons/build-module/library/download.js","webpack://@pewresearch/prc-platform-datasets/external window [\"wp\",\"blockEditor\"]","webpack://@pewresearch/prc-platform-datasets/./src/dataset-atp-legal-acceptance-block/index.js","webpack://@pewresearch/prc-platform-datasets/./src/dataset-atp-legal-acceptance-block/edit.jsx","webpack://@pewresearch/prc-platform-datasets/webpack/bootstrap","webpack://@pewresearch/prc-platform-datasets/webpack/runtime/hasOwnProperty shorthand","webpack://@pewresearch/prc-platform-datasets/webpack/runtime/jsonp chunk loading","webpack://@pewresearch/prc-platform-datasets/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blocks\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"primitives\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"ReactJSXRuntime\"];","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst download = /*#__PURE__*/_jsx(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n children: /*#__PURE__*/_jsx(Path, {\n d: \"M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z\"\n })\n});\nexport default download;\n//# sourceMappingURL=download.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blockEditor\"];","/**\n * Registers a new block provided a unique name and an object defining its behavior.\n *\n * @see https://developer.wordpress.org/block-editor/developers/block-api/#registering-a-block\n */\n\n/**\n * External Dependencies\n */\n\n/**\n * WordPress Dependencies\n */\nimport { registerBlockType } from '@wordpress/blocks';\nimport { download as icon } from '@wordpress/icons';\n\n/**\n * Internal Dependencies\n */\n\n/**\n * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files.\n * All files containing `style` keyword are bundled together. The code used\n * gets applied both to the front of your site and to the editor. All other files\n * get applied to the editor only.\n *\n * @see https://www.npmjs.com/package/@wordpress/scripts#using-css\n */\nimport edit from './edit';\nimport metadata from './block.json';\nimport './style.scss';\n\nconst { name } = metadata;\n\nconst settings = {\n\ticon,\n\tedit,\n};\n\n/**\n * Every block starts by registering a new block type definition.\n *\n * @see https://developer.wordpress.org/block-editor/developers/block-api/#registering-a-block\n */\nregisterBlockType(name, { ...metadata, ...settings });\n","/**\n * External Dependencies\n */\n/**\n * WordPress Dependencies\n */\nimport { useBlockProps } from '@wordpress/block-editor';\n\n/**\n * The edit function describes the structure of your block in the context of the\n * editor. This represents what the editor will render when the block is used.\n *\n * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#edit\n *\n * @param {Object} props Properties passed to the function.\n * @param {Object} props.attributes Available block attributes.\n * @param {Function} props.setAttributes Function that updates individual attributes.\n *\n * @return {WPElement} Element to render.\n */\nexport default function Edit({ attributes, setAttributes }) {\n\tconst blockProps = useBlockProps();\n\n\treturn
;\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t958: 0,\n\t293: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunk_pewresearch_prc_platform_datasets\"] = self[\"webpackChunk_pewresearch_prc_platform_datasets\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [293], () => (__webpack_require__(786)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","window","SVG","xmlns","viewBox","children","Path","d","name","metadata","settings","icon","edit","attributes","setAttributes","blockProps","useBlockProps","_jsx","registerBlockType","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","m","O","result","chunkIds","fn","priority","notFulfilled","Infinity","i","length","fulfilled","j","Object","keys","every","key","splice","r","o","obj","prop","prototype","hasOwnProperty","call","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","data","moreModules","runtime","some","id","chunkLoadingGlobal","self","forEach","bind","push","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file diff --git a/includes/datasets/build/dataset-atp-legal-acceptance-block/style-index-rtl.css b/includes/datasets/build/dataset-atp-legal-acceptance-block/style-index-rtl.css new file mode 100644 index 0000000..32f4f4c --- /dev/null +++ b/includes/datasets/build/dataset-atp-legal-acceptance-block/style-index-rtl.css @@ -0,0 +1 @@ +.wp-block-prc-platform-dataset-atp-legal-acceptance{--gap:1em;display:flex;flex-direction:column;gap:var(--gap)}.wp-block-prc-platform-dataset-atp-legal-acceptance__buttons{display:flex;flex-direction:row;font-size:12px;gap:var(--gap);justify-content:flex-start;line-height:1.5;margin-bottom:1rem}.wp-block-prc-platform-dataset-atp-legal-acceptance__textarea{appearance:none;background:none;border:1px solid var(--wp--preset--color--ui-gray-light);height:400px;width:100%} diff --git a/includes/datasets/build/dataset-atp-legal-acceptance-block/style-index.css b/includes/datasets/build/dataset-atp-legal-acceptance-block/style-index.css index 9aa5457..32f4f4c 100644 --- a/includes/datasets/build/dataset-atp-legal-acceptance-block/style-index.css +++ b/includes/datasets/build/dataset-atp-legal-acceptance-block/style-index.css @@ -1 +1 @@ -.wp-block-prc-platform-dataset-atp-legal-acceptance{--gap:1em;display:flex;flex-direction:column;gap:var(--gap)}.wp-block-prc-platform-dataset-atp-legal-acceptance__buttons{display:flex;flex-direction:row;font-size:12px;gap:var(--gap);justify-content:flex-start;line-height:1.5;margin-bottom:1rem}.wp-block-prc-platform-dataset-atp-legal-acceptance__textarea{-webkit-appearance:none;appearance:none;background:none;border:1px solid var(--wp--preset--color--ui-gray-light);height:400px;width:100%} +.wp-block-prc-platform-dataset-atp-legal-acceptance{--gap:1em;display:flex;flex-direction:column;gap:var(--gap)}.wp-block-prc-platform-dataset-atp-legal-acceptance__buttons{display:flex;flex-direction:row;font-size:12px;gap:var(--gap);justify-content:flex-start;line-height:1.5;margin-bottom:1rem}.wp-block-prc-platform-dataset-atp-legal-acceptance__textarea{appearance:none;background:none;border:1px solid var(--wp--preset--color--ui-gray-light);height:400px;width:100%} diff --git a/includes/datasets/build/dataset-atp-legal-acceptance-block/view.js.map b/includes/datasets/build/dataset-atp-legal-acceptance-block/view.js.map index 3ec1757..f2be890 100644 --- a/includes/datasets/build/dataset-atp-legal-acceptance-block/view.js.map +++ b/includes/datasets/build/dataset-atp-legal-acceptance-block/view.js.map @@ -1 +1 @@ -{"version":3,"file":"dataset-atp-legal-acceptance-block/view.js","mappings":"2CACA,IAAIA,EAAsB,CCA1BA,EAAwB,CAACC,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDH,EAAwB,CAACS,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,ICIlF,MAAM,GAJGI,EAI8B,CAAE,WAAgB,IAAOC,EAAwE,WAAG,MAAW,IAAOA,EAAmE,OAH3NC,EAAI,CAAC,EAAGhB,EAAoBiB,EAAED,EAAGF,GAAWE,ICI3C,SAAEE,GAAaC,OAAOC,IAgCtB,QAAEC,IAAYC,EAAAA,EAAAA,OAAM,gCAAiC,CAC1DC,MAAO,CACNC,aAhCgB,qpPAkCjBH,QAAS,CACR,WAACI,GACA,MAAMC,QAAwBJ,EAAAA,EAAAA,OAAM,+BAC5BD,QAASM,GAAiBD,EAClCC,EAAaC,UACd,EACA,OAACC,GACA,MAAMC,GAAUC,EAAAA,EAAAA,eACV,UAAEC,EAAS,MAAEC,GAAUH,EAGvBI,GADmBZ,EAAAA,EAAAA,OAAM,kCACWC,OAEpC,MAAEY,EAAK,IAAEC,GAAQF,QACjBhB,EAAS,CACdmB,KAAO,kCACPC,OAAQ,OACRC,KAAM,CACLH,MACAI,UAAWL,EACXF,WAGAQ,MAAMC,IACNrB,EAAQsB,gBAAgBX,EAAWI,EAAKD,EAAOF,GAE/CZ,EAAQI,YAAY,IAEpBmB,OAAOC,IAEPxB,EAAQI,YAAY,GAEvB,EACA,OAACqB,GACAzB,EAAQI,YACT,KD5EM,IAACX,EACJE","sources":["webpack://@pewresearch/prc-platform-datasets/webpack/bootstrap","webpack://@pewresearch/prc-platform-datasets/webpack/runtime/define property getters","webpack://@pewresearch/prc-platform-datasets/webpack/runtime/hasOwnProperty shorthand","webpack://@pewresearch/prc-platform-datasets/external module \"@wordpress/interactivity\"","webpack://@pewresearch/prc-platform-datasets/./src/dataset-atp-legal-acceptance-block/view.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\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))","var x = (y) => {\n\tvar x = {}; __webpack_require__.d(x, y); return x\n} \nvar y = (x) => (() => (x))\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"getContext\"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getContext), [\"store\"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.store) });","/**\n * WordPress Dependencies\n */\nimport { store, getContext, getElement } from '@wordpress/interactivity';\n\nconst { apiFetch } = window.wp;\n\nconst ATP_TEXT = `\nThis is a legal agreement (this “Agreement”) between you, the end user (“you” or “User”), and Pew Research Center (the “Center”). By downloading the American Trends Panel survey data made available on this web site (“Data”) you are agreeing to be bound by the terms and conditions of this Agreement. If you do not agree to be bound by these terms, do not download or use the Data.\n\nI.\tLicense.\nA.\t The Center hereby grants User a non-exclusive, revocable, limited, non-sublicensable, non-transferable, worldwide, royalty-free license to use the Data solely for (1) research, scholarly or academic purposes, or (2) User’s own personal, non-commercial use. The foregoing license is personal to User, and you may not share (or otherwise permit access to) the Data to any other individual or entity, including those within your business or organization. Further, you may not reproduce, sell, rent, lease, loan, distribute or sublicense, or otherwise transfer any Data, in whole or in part, to any other party, or use the Data to create any derivative work or product for resale, lease or license. Notwithstanding the foregoing, you may incorporate limited portions of the Data in scholarly, research or academic publications or for the purposes of news reporting provided that you:\n1.\t acknowledge the source of the Data with express reference to the Center in accordance with the following citation:\n\n“Pew Research Center’s American Trends Panel”\n\n2.\tdo not use the Data in any manner that implies, suggests, or could otherwise be perceived as attributing a particular policy or lobbying objective or opinion to the Center, and\n3.\tinclude the following disclaimer: “The opinions expressed herein, including any implications for policy, are those of the author and not of Pew Research Center.”\nB.\tUser acknowledges that, as between the parties, the Center is the sole and exclusive owner of all right, title and interest in the Data. Except for the limited license granted herein, this Agreement does not give User any right, title or interest in the Data.\n\nII.\tDisclaimers and Limitations of Liability. THE DATA IS PROVIDED “AS IS” WITHOUT ANY WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, ARISING BY LAW OR OTHERWISE, INCLUDING BUT NOT LIMITED TO WARRANTIES OF COMPLETENESS, NON-INFRINGEMENT, ACCURACY, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. THE CENTER EXPRESSLY DISCLAIMS, AND SHALL HAVE NO LIABILITY FOR, ANY ERRORS, OMISSIONS, INACCURACIES, OR INTERRUPTIONS IN THE DATA. USER ASSUMES ALL RISK ASSOCIATED WITH USE OF THE DATA AND AGREES THAT IN NO EVENT SHALL THE CENTER OR ITS AFFILIATES BE LIABLE TO YOU OR ANY THIRD PARTY FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES INCLUDING, BUT NOT LIMITED TO, DAMAGES FOR THE INABILITY TO USE EQUIPMENT OR ACCESS DATA, LOSS OF BUSINESS, LOSS OF REVENUE OR PROFITS, BUSINESS INTERRUPTIONS, LOSS OF INFORMATION OR DATA, OR OTHER FINANCIAL LOSS, ARISING OUT OF THE USE OF, OR INABILITY TO USE, THE DATA BASED ON ANY THEORY OF LIABILITY INCLUDING, BUT NOT LIMITED TO, BREACH OF CONTRACT, BREACH OF WARRANTY, TORT (INCLUDING NEGLIGENCE), OR OTHERWISE, EVEN IF USER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\n\nIII.\tPrivacy, Confidentiality and Security.\nA.\tThe Center respects the privacy of individuals. The Center has taken measures to ensure that the Data is devoid of information that could be used to identify individuals (including, but not limited to, names, telephone numbers and email addresses) who participated in or who were the subject of any research surveys or studies used to collect the Data (“Personally Identifying Information”). However, in the event that you discover any such Personally Identifying Information in the Data, you shall immediately notify the Center and refrain from using any such Personally Identifying Information. User further agrees not to (and will not allow other to) attempt to ascertain the identity of or derive information about individual survey respondents nor link the individual survey records contained in the Data with other data sets for the purpose of identifying individuals.\nB.\tUser shall maintain the Data as confidential, and will not use it, in any way nor disclose it to any third party, except as expressly permitted under this Agreement. User agrees, at its sole expense, to take reasonable precautions to protect the confidentiality of Data, at least as stringent as User takes to protect User’s own confidential information, but in no case less than reasonable care. The foregoing confidentiality obligations shall not apply to any information which: (a) is known to User prior to receipt from the Center other than as a result of User’s breach of any legal obligation; (b) becomes known (independently of disclosure by the Center) to User directly or indirectly from a source having the legal right to disclose such information; (c) is or becomes publicly known, except through a breach of this Agreement by User; or (d) is required to be disclosed by User to comply with applicable laws or governmental regulations, provided that User gives the Center, to the extent practicable, reasonable prior written notice of such disclosure sufficient to permit the Center to contest such disclosure and User takes reasonable and lawful actions to avoid and/or minimize the extent of such disclosure. The parties agree that any breach of the confidentiality obligations of this Agreement by User will result in irreparable damage to the Center for which it will have no adequate remedy at law. Therefore, it is agreed that the Center shall be entitled to equitable relief, including an injunction enjoining any such breach by any court of competent jurisdiction. Such injunction shall be without prejudice to any other right or remedy to which the Center may be entitled, including but not limited to any damages resulting from User’s breach of the confidentiality obligations under this Agreement. Any failure or delay in exercising any right, power or privilege hereunder shall not operate as a waiver thereof, nor shall any single or partial exercise thereof preclude any other or further exercise thereof or the exercise of any right, power or privilege hereunder.\nC.\tUser will immediately notify the Center and cooperate with investigations, and provide any information reasonably requested by the Center if User knows of or suspects any breach of security or potential vulnerability of the Data and will promptly remedy such breach.\n\nIV.\tIndemnification. User shall indemnify and hold harmless the Center, its affiliates and related organizations, and each of their respective officers, directors, employees, legal representatives, agents, successors and assigns, from and against any damages, liabilities, costs and expenses (including reasonable attorneys’ and professionals’ fees and court costs arising out of any third-party claims based on (a) User’s access or use of the Data; (b) any changes made by User to the Data in accordance with this Agreement; or (c) any breach by User of any of the terms and conditions of this Agreement.\n\nV.\tTermination. This license will terminate (1) automatically without notice from the Center if you fail to comply with the provisions of this Agreement or (2) immediately upon written notice (by e-mail or otherwise) from the Center. Upon termination of this Agreement, you agree to destroy all copies of any Data, in whole or in part and in any and all media, in your custody and control.\n\nVI.\tGoverning law. This Agreement shall be governed by, construed and interpreted in accordance with the laws of the District of Columbia. You further agree to submit to the jurisdiction and venue of the courts of the District of Columbia for any dispute relating to this Agreement.\n`;\n\n/**\n * This block is an addon to the dataset download block, as such it adds functionality on to the prc-platform/dataset-download store.\n */\nconst { actions } = store('prc-platform/dataset-download', {\n\tstate: {\n\t\tatpLegalText: ATP_TEXT,\n\t},\n\tactions: {\n\t\t*closeModal() {\n\t\t\tconst popupController = yield store('prc-block/popup-controller');\n\t\t\tconst { actions: popupActions } = popupController;\n\t\t\tpopupActions.closeAll();\n\t\t},\n\t\t*accept() {\n\t\t\tconst context = getContext();\n\t\t\tconst { datasetId, NONCE } = context;\n\n\t\t\tconst contentGateStore = store('prc-user-accounts/content-gate');\n\t\t\tconst contentGateState = contentGateStore.state;\n\n\t\t\tconst { token, uid } = contentGateState;\n\t\t\tyield apiFetch({\n\t\t\t\tpath: `/prc-api/v3/datasets/accept-atp`,\n\t\t\t\tmethod: 'POST',\n\t\t\t\tdata: {\n\t\t\t\t\tuid,\n\t\t\t\t\tuserToken: token,\n\t\t\t\t\tNONCE,\n\t\t\t\t},\n\t\t\t})\n\t\t\t\t.then((response) => {\n\t\t\t\t\tactions.downloadDataset(datasetId, uid, token, NONCE);\n\n\t\t\t\t\tactions.closeModal();\n\t\t\t\t})\n\t\t\t\t.catch((error) => {\n\n\t\t\t\t\tactions.closeModal();\n\t\t\t\t});\n\t\t},\n\t\t*cancel() {\n\t\t\tactions.closeModal();\n\t\t},\n\t},\n});\n"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","y","__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__","x","d","apiFetch","window","wp","actions","store","state","atpLegalText","closeModal","popupController","popupActions","closeAll","accept","context","getContext","datasetId","NONCE","contentGateState","token","uid","path","method","data","userToken","then","response","downloadDataset","catch","error","cancel"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"dataset-atp-legal-acceptance-block/view.js","mappings":"2CACA,IAAIA,EAAsB,CCA1BA,EAAwB,CAACC,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDH,EAAwB,CAACS,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,ICIlF,MAAM,GAJGI,EAI8B,CAAE,WAAgB,IAAOC,EAAwE,WAAG,MAAW,IAAOA,EAAmE,OAH3NC,EAAI,CAAC,EAAGhB,EAAoBiB,EAAED,EAAGF,GAAWE,ICI3C,SAAEE,GAAaC,OAAOC,IAgCtB,QAAEC,IAAYC,EAAAA,EAAAA,OAAM,gCAAiC,CAC1DC,MAAO,CACNC,aAhCe,qpPAkChBH,QAAS,CACR,WAACI,GACA,MAAMC,QAAwBJ,EAAAA,EAAAA,OAAM,+BAC5BD,QAASM,GAAiBD,EAClCC,EAAaC,UACd,EACA,OAACC,GACA,MAAMC,GAAUC,EAAAA,EAAAA,eACV,UAAEC,EAAS,MAAEC,GAAUH,EAGvBI,GADmBZ,EAAAA,EAAAA,OAAM,kCACWC,OAEpC,MAAEY,EAAK,IAAEC,GAAQF,QACjBhB,EAAS,CACdmB,KAAM,kCACNC,OAAQ,OACRC,KAAM,CACLH,MACAI,UAAWL,EACXF,WAGAQ,MAAMC,IACNrB,EAAQsB,gBAAgBX,EAAWI,EAAKD,EAAOF,GAE/CZ,EAAQI,YAAY,IAEpBmB,OAAOC,IAEPxB,EAAQI,YAAY,GAEvB,EACA,OAACqB,GACAzB,EAAQI,YACT,KD5EM,IAACX,EACJE","sources":["webpack://@pewresearch/prc-platform-datasets/webpack/bootstrap","webpack://@pewresearch/prc-platform-datasets/webpack/runtime/define property getters","webpack://@pewresearch/prc-platform-datasets/webpack/runtime/hasOwnProperty shorthand","webpack://@pewresearch/prc-platform-datasets/external module \"@wordpress/interactivity\"","webpack://@pewresearch/prc-platform-datasets/./src/dataset-atp-legal-acceptance-block/view.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\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))","var x = (y) => {\n\tvar x = {}; __webpack_require__.d(x, y); return x\n} \nvar y = (x) => (() => (x))\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"getContext\"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getContext), [\"store\"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.store) });","/**\n * WordPress Dependencies\n */\nimport { store, getContext, getElement } from '@wordpress/interactivity';\n\nconst { apiFetch } = window.wp;\n\nconst ATP_TEXT = `\nThis is a legal agreement (this “Agreement”) between you, the end user (“you” or “User”), and Pew Research Center (the “Center”). By downloading the American Trends Panel survey data made available on this web site (“Data”) you are agreeing to be bound by the terms and conditions of this Agreement. If you do not agree to be bound by these terms, do not download or use the Data.\n\nI.\tLicense.\nA.\t The Center hereby grants User a non-exclusive, revocable, limited, non-sublicensable, non-transferable, worldwide, royalty-free license to use the Data solely for (1) research, scholarly or academic purposes, or (2) User’s own personal, non-commercial use. The foregoing license is personal to User, and you may not share (or otherwise permit access to) the Data to any other individual or entity, including those within your business or organization. Further, you may not reproduce, sell, rent, lease, loan, distribute or sublicense, or otherwise transfer any Data, in whole or in part, to any other party, or use the Data to create any derivative work or product for resale, lease or license. Notwithstanding the foregoing, you may incorporate limited portions of the Data in scholarly, research or academic publications or for the purposes of news reporting provided that you:\n1.\t acknowledge the source of the Data with express reference to the Center in accordance with the following citation:\n\n“Pew Research Center’s American Trends Panel”\n\n2.\tdo not use the Data in any manner that implies, suggests, or could otherwise be perceived as attributing a particular policy or lobbying objective or opinion to the Center, and\n3.\tinclude the following disclaimer: “The opinions expressed herein, including any implications for policy, are those of the author and not of Pew Research Center.”\nB.\tUser acknowledges that, as between the parties, the Center is the sole and exclusive owner of all right, title and interest in the Data. Except for the limited license granted herein, this Agreement does not give User any right, title or interest in the Data.\n\nII.\tDisclaimers and Limitations of Liability. THE DATA IS PROVIDED “AS IS” WITHOUT ANY WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, ARISING BY LAW OR OTHERWISE, INCLUDING BUT NOT LIMITED TO WARRANTIES OF COMPLETENESS, NON-INFRINGEMENT, ACCURACY, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. THE CENTER EXPRESSLY DISCLAIMS, AND SHALL HAVE NO LIABILITY FOR, ANY ERRORS, OMISSIONS, INACCURACIES, OR INTERRUPTIONS IN THE DATA. USER ASSUMES ALL RISK ASSOCIATED WITH USE OF THE DATA AND AGREES THAT IN NO EVENT SHALL THE CENTER OR ITS AFFILIATES BE LIABLE TO YOU OR ANY THIRD PARTY FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES INCLUDING, BUT NOT LIMITED TO, DAMAGES FOR THE INABILITY TO USE EQUIPMENT OR ACCESS DATA, LOSS OF BUSINESS, LOSS OF REVENUE OR PROFITS, BUSINESS INTERRUPTIONS, LOSS OF INFORMATION OR DATA, OR OTHER FINANCIAL LOSS, ARISING OUT OF THE USE OF, OR INABILITY TO USE, THE DATA BASED ON ANY THEORY OF LIABILITY INCLUDING, BUT NOT LIMITED TO, BREACH OF CONTRACT, BREACH OF WARRANTY, TORT (INCLUDING NEGLIGENCE), OR OTHERWISE, EVEN IF USER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\n\nIII.\tPrivacy, Confidentiality and Security.\nA.\tThe Center respects the privacy of individuals. The Center has taken measures to ensure that the Data is devoid of information that could be used to identify individuals (including, but not limited to, names, telephone numbers and email addresses) who participated in or who were the subject of any research surveys or studies used to collect the Data (“Personally Identifying Information”). However, in the event that you discover any such Personally Identifying Information in the Data, you shall immediately notify the Center and refrain from using any such Personally Identifying Information. User further agrees not to (and will not allow other to) attempt to ascertain the identity of or derive information about individual survey respondents nor link the individual survey records contained in the Data with other data sets for the purpose of identifying individuals.\nB.\tUser shall maintain the Data as confidential, and will not use it, in any way nor disclose it to any third party, except as expressly permitted under this Agreement. User agrees, at its sole expense, to take reasonable precautions to protect the confidentiality of Data, at least as stringent as User takes to protect User’s own confidential information, but in no case less than reasonable care. The foregoing confidentiality obligations shall not apply to any information which: (a) is known to User prior to receipt from the Center other than as a result of User’s breach of any legal obligation; (b) becomes known (independently of disclosure by the Center) to User directly or indirectly from a source having the legal right to disclose such information; (c) is or becomes publicly known, except through a breach of this Agreement by User; or (d) is required to be disclosed by User to comply with applicable laws or governmental regulations, provided that User gives the Center, to the extent practicable, reasonable prior written notice of such disclosure sufficient to permit the Center to contest such disclosure and User takes reasonable and lawful actions to avoid and/or minimize the extent of such disclosure. The parties agree that any breach of the confidentiality obligations of this Agreement by User will result in irreparable damage to the Center for which it will have no adequate remedy at law. Therefore, it is agreed that the Center shall be entitled to equitable relief, including an injunction enjoining any such breach by any court of competent jurisdiction. Such injunction shall be without prejudice to any other right or remedy to which the Center may be entitled, including but not limited to any damages resulting from User’s breach of the confidentiality obligations under this Agreement. Any failure or delay in exercising any right, power or privilege hereunder shall not operate as a waiver thereof, nor shall any single or partial exercise thereof preclude any other or further exercise thereof or the exercise of any right, power or privilege hereunder.\nC.\tUser will immediately notify the Center and cooperate with investigations, and provide any information reasonably requested by the Center if User knows of or suspects any breach of security or potential vulnerability of the Data and will promptly remedy such breach.\n\nIV.\tIndemnification. User shall indemnify and hold harmless the Center, its affiliates and related organizations, and each of their respective officers, directors, employees, legal representatives, agents, successors and assigns, from and against any damages, liabilities, costs and expenses (including reasonable attorneys’ and professionals’ fees and court costs arising out of any third-party claims based on (a) User’s access or use of the Data; (b) any changes made by User to the Data in accordance with this Agreement; or (c) any breach by User of any of the terms and conditions of this Agreement.\n\nV.\tTermination. This license will terminate (1) automatically without notice from the Center if you fail to comply with the provisions of this Agreement or (2) immediately upon written notice (by e-mail or otherwise) from the Center. Upon termination of this Agreement, you agree to destroy all copies of any Data, in whole or in part and in any and all media, in your custody and control.\n\nVI.\tGoverning law. This Agreement shall be governed by, construed and interpreted in accordance with the laws of the District of Columbia. You further agree to submit to the jurisdiction and venue of the courts of the District of Columbia for any dispute relating to this Agreement.\n`;\n\n/**\n * This block is an addon to the dataset download block, as such it adds functionality on to the prc-platform/dataset-download store.\n */\nconst { actions } = store('prc-platform/dataset-download', {\n\tstate: {\n\t\tatpLegalText: ATP_TEXT,\n\t},\n\tactions: {\n\t\t*closeModal() {\n\t\t\tconst popupController = yield store('prc-block/popup-controller');\n\t\t\tconst { actions: popupActions } = popupController;\n\t\t\tpopupActions.closeAll();\n\t\t},\n\t\t*accept() {\n\t\t\tconst context = getContext();\n\t\t\tconst { datasetId, NONCE } = context;\n\n\t\t\tconst contentGateStore = store('prc-user-accounts/content-gate');\n\t\t\tconst contentGateState = contentGateStore.state;\n\n\t\t\tconst { token, uid } = contentGateState;\n\t\t\tyield apiFetch({\n\t\t\t\tpath: `/prc-api/v3/datasets/accept-atp`,\n\t\t\t\tmethod: 'POST',\n\t\t\t\tdata: {\n\t\t\t\t\tuid,\n\t\t\t\t\tuserToken: token,\n\t\t\t\t\tNONCE,\n\t\t\t\t},\n\t\t\t})\n\t\t\t\t.then((response) => {\n\t\t\t\t\tactions.downloadDataset(datasetId, uid, token, NONCE);\n\n\t\t\t\t\tactions.closeModal();\n\t\t\t\t})\n\t\t\t\t.catch((error) => {\n\n\t\t\t\t\tactions.closeModal();\n\t\t\t\t});\n\t\t},\n\t\t*cancel() {\n\t\t\tactions.closeModal();\n\t\t},\n\t},\n});\n"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","y","__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__","x","d","apiFetch","window","wp","actions","store","state","atpLegalText","closeModal","popupController","popupActions","closeAll","accept","context","getContext","datasetId","NONCE","contentGateState","token","uid","path","method","data","userToken","then","response","downloadDataset","catch","error","cancel"],"sourceRoot":""} \ No newline at end of file diff --git a/includes/datasets/build/download-block/index.asset.php b/includes/datasets/build/download-block/index.asset.php index 3564247..5e6ac22 100644 --- a/includes/datasets/build/download-block/index.asset.php +++ b/includes/datasets/build/download-block/index.asset.php @@ -1 +1 @@ - array('classnames', 'prc-block-utils', 'react', 'wp-block-editor', 'wp-blocks', 'wp-polyfill', 'wp-primitives'), 'version' => '2a71586e5aaac44c9c0c'); + array('classnames', 'prc-block-utils', 'react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-polyfill', 'wp-primitives'), 'version' => '03153f5bffd3f601dacd'); diff --git a/includes/datasets/build/download-block/index.js b/includes/datasets/build/download-block/index.js index ce9c4d4..5143cf4 100644 --- a/includes/datasets/build/download-block/index.js +++ b/includes/datasets/build/download-block/index.js @@ -1,2 +1,2 @@ -(()=>{"use strict";var e,t={669:(e,t,r)=>{const o=window.wp.blocks,n=window.wp.primitives;var a=r(893);const s=(0,a.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,a.jsx)(n.Path,{d:"M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z"})});var i=r(196);window.classnames,window.prcBlockUtils;const l=window.wp.blockEditor,c=["core/button","core/group"],p=[["core/button",{}]],d=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"prc-platform/dataset-download","version":"0.1.0","title":"Dataset Download","category":"theme","description":"This block allows you to download the specified dataset. First it checks for user accounts credentials and then it provides a download button.","attributes":{},"supports":{"anchor":true,"html":false,"spacing":{"blockGap":true,"margin":true,"padding":true,"__experimentalDefaultControls":{"padding":true,"margin":true}},"interactivity":true},"textdomain":"dataset-download","editorScript":"file:./index.js","style":"file:./style-index.css","render":"file:./render.php","viewScriptModule":"file:./view.js"}'),{name:u}=d,f={icon:s,edit:function({attributes:e,setAttributes:t}){const{allowedBlocks:r}=e,o=(0,l.useBlockProps)(),n=(0,l.useInnerBlocksProps)({},{allowedBlocks:r||c,templateLock:!1,template:p});return(0,i.createElement)("div",{...o},(0,i.createElement)("div",{...n}))},save:function(){return(0,i.createElement)(l.InnerBlocks.Content,null)}};(0,o.registerBlockType)(u,{...d,...f})},251:(e,t,r)=>{var o=r(196),n=Symbol.for("react.element"),a=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),s=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};t.jsx=function(e,t,r){var o,l={},c=null,p=null;for(o in void 0!==r&&(c=""+r),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(p=t.ref),t)a.call(t,o)&&!i.hasOwnProperty(o)&&(l[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps)void 0===l[o]&&(l[o]=t[o]);return{$$typeof:n,type:e,key:c,ref:p,props:l,_owner:s.current}}},893:(e,t,r)=>{e.exports=r(251)},196:e=>{e.exports=window.React}},r={};function o(e){var n=r[e];if(void 0!==n)return n.exports;var a=r[e]={exports:{}};return t[e](a,a.exports,o),a.exports}o.m=t,e=[],o.O=(t,r,n,a)=>{if(!r){var s=1/0;for(p=0;p=a)&&Object.keys(o.O).every((e=>o.O[e](r[l])))?r.splice(l--,1):(i=!1,a0&&e[p-1][2]>a;p--)e[p]=e[p-1];e[p]=[r,n,a]},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={528:0,361:0};o.O.j=t=>0===e[t];var t=(t,r)=>{var n,a,[s,i,l]=r,c=0;if(s.some((t=>0!==e[t]))){for(n in i)o.o(i,n)&&(o.m[n]=i[n]);if(l)var p=l(o)}for(t&&t(r);co(669)));n=o.O(n)})(); +(()=>{"use strict";var e,t={495:()=>{const e=window.wp.blocks,t=window.wp.primitives,r=window.ReactJSXRuntime,o=(0,r.jsx)(t.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(t.Path,{d:"M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z"})}),s=(window.classnames,window.prcBlockUtils,window.wp.blockEditor),n=["core/button","core/group"],i=[["core/button",{}]],a=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"prc-platform/dataset-download","version":"0.1.0","title":"Dataset Download","category":"theme","description":"This block allows you to download the specified dataset. First it checks for user accounts credentials and then it provides a download button.","attributes":{},"supports":{"anchor":true,"html":false,"spacing":{"blockGap":true,"margin":true,"padding":true,"__experimentalDefaultControls":{"padding":true,"margin":true}},"interactivity":true},"textdomain":"dataset-download","editorScript":"file:./index.js","style":"file:./style-index.css","render":"file:./render.php","viewScriptModule":"file:./view.js"}'),{name:l}=a,c={icon:o,edit:function({attributes:e,setAttributes:t}){const{allowedBlocks:o}=e,a=(0,s.useBlockProps)(),l=(0,s.useInnerBlocksProps)({},{allowedBlocks:o||n,templateLock:!1,template:i});return(0,r.jsx)("div",{...a,children:(0,r.jsx)("div",{...l})})},save:function(){return(0,r.jsx)(s.InnerBlocks.Content,{})}};(0,e.registerBlockType)(l,{...a,...c})}},r={};function o(e){var s=r[e];if(void 0!==s)return s.exports;var n=r[e]={exports:{}};return t[e](n,n.exports,o),n.exports}o.m=t,e=[],o.O=(t,r,s,n)=>{if(!r){var i=1/0;for(d=0;d=n)&&Object.keys(o.O).every((e=>o.O[e](r[l])))?r.splice(l--,1):(a=!1,n0&&e[d-1][2]>n;d--)e[d]=e[d-1];e[d]=[r,s,n]},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={528:0,361:0};o.O.j=t=>0===e[t];var t=(t,r)=>{var s,n,i=r[0],a=r[1],l=r[2],c=0;if(i.some((t=>0!==e[t]))){for(s in a)o.o(a,s)&&(o.m[s]=a[s]);if(l)var d=l(o)}for(t&&t(r);co(495)));s=o.O(s)})(); //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/includes/datasets/build/download-block/index.js.map b/includes/datasets/build/download-block/index.js.map index 269fc1a..091e5e7 100644 --- a/includes/datasets/build/download-block/index.js.map +++ b/includes/datasets/build/download-block/index.js.map @@ -1 +1 @@ -{"version":3,"file":"download-block/index.js","mappings":"uBAAIA,E,iBCAJ,MAAM,EAA+BC,OAAW,GAAU,OCApD,EAA+BA,OAAW,GAAc,W,aCK9D,MAOA,GAP8B,SAAK,EAAAC,IAAK,CACtCC,MAAO,6BACPC,QAAS,YACTC,UAAuB,SAAK,EAAAC,KAAM,CAChCC,EAAG,uG,aCT8BN,OAAmB,WCAnBA,OAAsB,cDA3D,MEAM,EAA+BA,OAAW,GAAe,YCczDO,EAAiB,CAAC,cAAe,cAEjCC,EAAW,CAAC,CAAC,cAAe,CAAC,I,osBCiB3BC,KAAIA,GAAKC,EAEXC,EAAW,CAChBC,KAAI,EACJC,KDPc,UAAc,WAAEC,EAAU,cAAEC,IAC1C,MAAM,cAAEC,GAAkBF,EAEpBG,GAAaC,EAAAA,EAAAA,iBAEbC,GAAmBC,EAAAA,EAAAA,qBACxB,CAAC,EACD,CACCJ,cAAeA,GAAiBT,EAChCc,cAAc,EACdC,SAAUd,IAIZ,OACCe,EAAAA,EAAAA,eAAA,UAASN,IACRM,EAAAA,EAAAA,eAAA,UAASJ,IAGZ,ECXCK,KCXc,WACd,OAAOD,EAAAA,EAAAA,eAACE,EAAAA,YAAYC,QAAO,KAC5B,IDiBAC,EAAAA,EAAAA,mBAAmBlB,EAAM,IAAKC,KAAaC,G,oBErC1BiB,EAAE,EAAQ,KAASC,EAAEC,OAAOC,IAAI,iBAAgDC,GAA7BF,OAAOC,IAAI,kBAAoBE,OAAOC,UAAUC,gBAAeC,EAAER,EAAES,mDAAmDC,kBAAkBC,EAAE,CAACC,KAAI,EAAGC,KAAI,EAAGC,QAAO,EAAGC,UAAS,GAC+FC,EAAQC,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AqBU,KAAK,KAAM,IAC3DH,EAAmBI,KAAOX,EAAqBU,KAAK,KAAMH,EAAmBI,KAAKD,KAAKH,G,KC9CvF,IAAIK,EAAsBrC,EAAoBK,OAAEF,EAAW,CAAC,MAAM,IAAOH,EAAoB,OAC7FqC,EAAsBrC,EAAoBK,EAAEgC,E","sources":["webpack://@pewresearch/prc-platform-datasets/webpack/runtime/chunk loaded","webpack://@pewresearch/prc-platform-datasets/external window [\"wp\",\"blocks\"]","webpack://@pewresearch/prc-platform-datasets/external window [\"wp\",\"primitives\"]","webpack://@pewresearch/prc-platform-datasets/./node_modules/@wordpress/icons/build-module/library/download.js","webpack://@pewresearch/prc-platform-datasets/external window \"classnames\"","webpack://@pewresearch/prc-platform-datasets/external window \"prcBlockUtils\"","webpack://@pewresearch/prc-platform-datasets/external window [\"wp\",\"blockEditor\"]","webpack://@pewresearch/prc-platform-datasets/./src/download-block/edit.jsx","webpack://@pewresearch/prc-platform-datasets/./src/download-block/index.js","webpack://@pewresearch/prc-platform-datasets/./src/download-block/save.jsx","webpack://@pewresearch/prc-platform-datasets/./node_modules/react/cjs/react-jsx-runtime.production.min.js","webpack://@pewresearch/prc-platform-datasets/./node_modules/react/jsx-runtime.js","webpack://@pewresearch/prc-platform-datasets/external window \"React\"","webpack://@pewresearch/prc-platform-datasets/webpack/bootstrap","webpack://@pewresearch/prc-platform-datasets/webpack/runtime/hasOwnProperty shorthand","webpack://@pewresearch/prc-platform-datasets/webpack/runtime/jsonp chunk loading","webpack://@pewresearch/prc-platform-datasets/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blocks\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"primitives\"];","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst download = /*#__PURE__*/_jsx(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n children: /*#__PURE__*/_jsx(Path, {\n d: \"M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z\"\n })\n});\nexport default download;\n//# sourceMappingURL=download.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"classnames\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"prcBlockUtils\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blockEditor\"];","/**\n * External Dependencies\n */\nimport classNames from 'classnames';\nimport { getBlockGapSupportValue } from '@prc/block-utils';\n\n/**\n * WordPress Dependencies\n */\nimport { useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor';\n\n/**\n * Internal Dependencies\n */\nconst ALLOWED_BLOCKS = ['core/button', 'core/group'];\n\nconst TEMPLATE = [['core/button', {}]];\n\n/**\n * The edit function describes the structure of your block in the context of the\n * editor. This represents what the editor will render when the block is used.\n *\n * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#edit\n *\n * @param {Object} props Properties passed to the function.\n * @param {Object} props.attributes Available block attributes.\n * @param {Function} props.setAttributes Function that updates individual attributes.\n *\n * @return {WPElement} Element to render.\n */\nexport default function Edit({ attributes, setAttributes }) {\n\tconst { allowedBlocks } = attributes;\n\n\tconst blockProps = useBlockProps();\n\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{},\n\t\t{\n\t\t\tallowedBlocks: allowedBlocks || ALLOWED_BLOCKS,\n\t\t\ttemplateLock: false,\n\t\t\ttemplate: TEMPLATE,\n\t\t}\n\t);\n\n\treturn (\n\t\t
\n\t\t\t
\n\t\t
\n\t);\n}\n","/**\n * Registers a new block provided a unique name and an object defining its behavior.\n *\n * @see https://developer.wordpress.org/block-editor/developers/block-api/#registering-a-block\n */\n\n/**\n * External Dependencies\n */\n\n/**\n * WordPress Dependencies\n */\nimport { registerBlockType } from '@wordpress/blocks';\nimport { download as icon } from '@wordpress/icons';\n\n/**\n * Internal Dependencies\n */\n\n/**\n * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files.\n * All files containing `style` keyword are bundled together. The code used\n * gets applied both to the front of your site and to the editor. All other files\n * get applied to the editor only.\n *\n * @see https://www.npmjs.com/package/@wordpress/scripts#using-css\n */\nimport edit from './edit';\nimport save from './save';\nimport metadata from './block.json';\nimport './style.scss';\n\nconst { name } = metadata;\n\nconst settings = {\n\ticon,\n\tedit,\n\tsave,\n};\n\n/**\n * Every block starts by registering a new block type definition.\n *\n * @see https://developer.wordpress.org/block-editor/developers/block-api/#registering-a-block\n */\nregisterBlockType( name, { ...metadata, ...settings } );\n","/**\n * External Dependencies\n */\n\n/**\n * WordPress Dependencies\n */\n\n/**\n * React hook that is used to mark the block wrapper element.\n * It provides all the necessary props like the class name.\n *\n * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops\n */\nimport { InnerBlocks } from '@wordpress/block-editor';\n\n/**\n * The save function defines the way in which the different attributes should\n * be combined into the final markup, which is then serialized by the block\n * editor into `post_content`.\n *\n * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#save\n *\n * @param {Object} props Properties passed to the function.\n * @param {Object} props.attributes Available block attributes.\n * @return {WPElement} Element to render.\n */\nexport default function Save() {\n\treturn ;\n}\n","/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","module.exports = window[\"React\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t528: 0,\n\t361: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = globalThis[\"webpackChunk_pewresearch_prc_platform_datasets\"] = globalThis[\"webpackChunk_pewresearch_prc_platform_datasets\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [361], () => (__webpack_require__(669)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","window","SVG","xmlns","viewBox","children","Path","d","ALLOWED_BLOCKS","TEMPLATE","name","metadata","settings","icon","edit","attributes","setAttributes","allowedBlocks","blockProps","useBlockProps","innerBlocksProps","useInnerBlocksProps","templateLock","template","createElement","save","InnerBlocks","Content","registerBlockType","f","k","Symbol","for","m","Object","prototype","hasOwnProperty","n","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","ReactCurrentOwner","p","key","ref","__self","__source","exports","jsx","c","a","g","b","e","h","call","defaultProps","$$typeof","type","props","_owner","current","module","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","O","result","chunkIds","fn","priority","notFulfilled","Infinity","i","length","fulfilled","j","keys","every","splice","r","o","obj","prop","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","data","moreModules","runtime","some","id","chunkLoadingGlobal","globalThis","forEach","bind","push","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"download-block/index.js","mappings":"uBAAIA,E,YCAJ,MAAM,EAA+BC,OAAW,GAAU,OCApD,EAA+BA,OAAW,GAAc,WCAxD,EAA+BA,OAAwB,gBCY7D,GAP8B,SAAK,EAAAC,IAAK,CACtCC,MAAO,6BACPC,QAAS,YACTC,UAAuB,SAAK,EAAAC,KAAM,CAChCC,EAAG,uGCTD,GCA+BN,OAAmB,WCAnBA,OAAsB,cFAtBA,OAAW,GAAe,aGczDO,EAAiB,CAAC,cAAe,cAEjCC,EAAW,CAAC,CAAC,cAAe,CAAC,I,osBCiB3BC,KAAIA,GAAKC,E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sB7C,EAAoBQ,OAAEL,EAAW,CAAC,MAAM,IAAOH,EAAoB,OAC7F6C,EAAsB7C,EAAoBQ,EAAEqC,E","sources":["webpack://@pewresearch/prc-platform-datasets/webpack/runtime/chunk loaded","webpack://@pewresearch/prc-platform-datasets/external window [\"wp\",\"blocks\"]","webpack://@pewresearch/prc-platform-datasets/external window [\"wp\",\"primitives\"]","webpack://@pewresearch/prc-platform-datasets/external window \"ReactJSXRuntime\"","webpack://@pewresearch/prc-platform-datasets/./node_modules/@wordpress/icons/build-module/library/download.js","webpack://@pewresearch/prc-platform-datasets/external window [\"wp\",\"blockEditor\"]","webpack://@pewresearch/prc-platform-datasets/external window \"classnames\"","webpack://@pewresearch/prc-platform-datasets/external window \"prcBlockUtils\"","webpack://@pewresearch/prc-platform-datasets/./src/download-block/edit.jsx","webpack://@pewresearch/prc-platform-datasets/./src/download-block/index.js","webpack://@pewresearch/prc-platform-datasets/./src/download-block/save.jsx","webpack://@pewresearch/prc-platform-datasets/webpack/bootstrap","webpack://@pewresearch/prc-platform-datasets/webpack/runtime/hasOwnProperty shorthand","webpack://@pewresearch/prc-platform-datasets/webpack/runtime/jsonp chunk loading","webpack://@pewresearch/prc-platform-datasets/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blocks\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"primitives\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"ReactJSXRuntime\"];","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst download = /*#__PURE__*/_jsx(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n children: /*#__PURE__*/_jsx(Path, {\n d: \"M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z\"\n })\n});\nexport default download;\n//# sourceMappingURL=download.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blockEditor\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"classnames\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"prcBlockUtils\"];","/**\n * External Dependencies\n */\nimport classNames from 'classnames';\nimport { getBlockGapSupportValue } from '@prc/block-utils';\n\n/**\n * WordPress Dependencies\n */\nimport { useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor';\n\n/**\n * Internal Dependencies\n */\nconst ALLOWED_BLOCKS = ['core/button', 'core/group'];\n\nconst TEMPLATE = [['core/button', {}]];\n\n/**\n * The edit function describes the structure of your block in the context of the\n * editor. This represents what the editor will render when the block is used.\n *\n * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#edit\n *\n * @param {Object} props Properties passed to the function.\n * @param {Object} props.attributes Available block attributes.\n * @param {Function} props.setAttributes Function that updates individual attributes.\n *\n * @return {WPElement} Element to render.\n */\nexport default function Edit({ attributes, setAttributes }) {\n\tconst { allowedBlocks } = attributes;\n\n\tconst blockProps = useBlockProps();\n\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{},\n\t\t{\n\t\t\tallowedBlocks: allowedBlocks || ALLOWED_BLOCKS,\n\t\t\ttemplateLock: false,\n\t\t\ttemplate: TEMPLATE,\n\t\t}\n\t);\n\n\treturn (\n\t\t
\n\t\t\t
\n\t\t
\n\t);\n}\n","/**\n * Registers a new block provided a unique name and an object defining its behavior.\n *\n * @see https://developer.wordpress.org/block-editor/developers/block-api/#registering-a-block\n */\n\n/**\n * External Dependencies\n */\n\n/**\n * WordPress Dependencies\n */\nimport { registerBlockType } from '@wordpress/blocks';\nimport { download as icon } from '@wordpress/icons';\n\n/**\n * Internal Dependencies\n */\n\n/**\n * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files.\n * All files containing `style` keyword are bundled together. The code used\n * gets applied both to the front of your site and to the editor. All other files\n * get applied to the editor only.\n *\n * @see https://www.npmjs.com/package/@wordpress/scripts#using-css\n */\nimport edit from './edit';\nimport save from './save';\nimport metadata from './block.json';\nimport './style.scss';\n\nconst { name } = metadata;\n\nconst settings = {\n\ticon,\n\tedit,\n\tsave,\n};\n\n/**\n * Every block starts by registering a new block type definition.\n *\n * @see https://developer.wordpress.org/block-editor/developers/block-api/#registering-a-block\n */\nregisterBlockType( name, { ...metadata, ...settings } );\n","/**\n * External Dependencies\n */\n\n/**\n * WordPress Dependencies\n */\n\n/**\n * React hook that is used to mark the block wrapper element.\n * It provides all the necessary props like the class name.\n *\n * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops\n */\nimport { InnerBlocks } from '@wordpress/block-editor';\n\n/**\n * The save function defines the way in which the different attributes should\n * be combined into the final markup, which is then serialized by the block\n * editor into `post_content`.\n *\n * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#save\n *\n * @param {Object} props Properties passed to the function.\n * @param {Object} props.attributes Available block attributes.\n * @return {WPElement} Element to render.\n */\nexport default function Save() {\n\treturn ;\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t528: 0,\n\t361: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunk_pewresearch_prc_platform_datasets\"] = self[\"webpackChunk_pewresearch_prc_platform_datasets\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [361], () => (__webpack_require__(495)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","window","SVG","xmlns","viewBox","children","Path","d","ALLOWED_BLOCKS","TEMPLATE","name","metadata","settings","icon","edit","attributes","setAttributes","allowedBlocks","blockProps","useBlockProps","innerBlocksProps","useInnerBlocksProps","templateLock","template","_jsx","save","InnerBlocks","Content","registerBlockType","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","m","O","result","chunkIds","fn","priority","notFulfilled","Infinity","i","length","fulfilled","j","Object","keys","every","key","splice","r","o","obj","prop","prototype","hasOwnProperty","call","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","data","moreModules","runtime","some","id","chunkLoadingGlobal","self","forEach","bind","push","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file diff --git a/includes/datasets/build/download-block/render.php b/includes/datasets/build/download-block/render.php index 444c5a2..fda9066 100644 --- a/includes/datasets/build/download-block/render.php +++ b/includes/datasets/build/download-block/render.php @@ -18,7 +18,7 @@ // If this dataset is in the ATP then it needs a modal to accept the ATP legal terms. Here we're manually adding the content from the download block... usually a core/button into the trigger of the poopup. Now, the button is still wired to the download block but the download block can handle opening the modal by accessing the modals' action store when running core/button::onButtonClick. if ( $is_atp ) { $modal = \PRC\Platform\Blocks\Popup_Controller\create_modal([ - 'title' => 'Accept ATP', + 'title' => 'Accept ATP Legal Terms and Conditions to Download', 'content' => '', 'backgroundColor' => 'ui-white', 'trigger' => $content, diff --git a/includes/datasets/build/download-block/style-index-rtl.css b/includes/datasets/build/download-block/style-index-rtl.css new file mode 100644 index 0000000..896dd04 --- /dev/null +++ b/includes/datasets/build/download-block/style-index-rtl.css @@ -0,0 +1 @@ +.wp-block-prc-platform-dataset-download{padding:0}.is-logged-in .wp-block-prc-platform-dataset-download,.wp-block.wp-block-prc-platform-dataset-download{padding-right:1em;padding-top:1em} diff --git a/includes/datasets/build/download-block/view.js.map b/includes/datasets/build/download-block/view.js.map index a5a5028..f8307da 100644 --- a/includes/datasets/build/download-block/view.js.map +++ b/includes/datasets/build/download-block/view.js.map @@ -1 +1 @@ -{"version":3,"file":"download-block/view.js","mappings":"2CACA,IAAIA,EAAsB,CCA1BA,EAAwB,CAACC,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDH,EAAwB,CAACS,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,ICIlF,MAAM,GAJGI,EAI8B,CAAE,WAAgB,IAAOC,EAAwE,WAAG,WAAgB,IAAOA,EAAwE,WAAG,MAAW,IAAOA,EAAmE,OAH7TC,EAAI,CAAC,EAAGhB,EAAoBiB,EAAED,EAAGF,GAAWE,ICK3C,QAAEE,IAAYC,EAAAA,EAAAA,OAAM,gCAAiC,CAC1DD,QAAS,CACRE,gBAAiBA,CAACC,EAAWC,EAAKC,EAAOC,KACxCC,QAAQC,IACLC,SAAS,CACVC,KAAO,iDAAgDP,IACvDQ,OAAQ,OACRC,KAAM,CACLR,MACAS,UAAWR,EACXC,WAGDQ,MAAMC,IACFA,GAAUC,UACbT,OAAOU,KAAKF,EAASC,SAAU,SAChC,IAEAE,OAAOC,IACPC,QAAQD,MAAMA,EAAM,GACnB,EAEJ,cAAME,CAASjB,EAAKC,EAAOF,EAAWG,GACrC,MAAM,IAAEgB,IAAQC,EAAAA,EAAAA,cAEVR,QAAiBR,QAAQC,IAAIC,SAAS,CAC3CC,KAAO,kCACPC,OAAQ,OACRC,KAAM,CACLR,MACAS,UAAWR,EACXC,YAOF,IAHI,IAASS,GACZf,EAAQE,gBAAgBC,EAAWC,EAAKC,EAAOC,IAE5C,IAAUS,EAAU,CACvB,MAAMS,EACLF,EAAIG,cAAcA,cAAcA,cAAcC,aAC7C,OAEM1B,QAAS2B,EAAcC,MAAOC,IAAe5B,EAAAA,EAAAA,OACpD,8BAED0B,EAAaV,KAAK,KAAMO,EACzB,CACD,EACAM,cAAgBC,IACfA,EAAMC,iBACN,MAAMC,GAAUC,EAAAA,EAAAA,eACV,UAAE/B,EAAS,MAAEgC,EAAK,MAAE7B,GAAU2B,GAE9B,MAAEL,IAAU3B,EAAAA,EAAAA,OAAM,mCAClB,MAAEI,EAAK,IAAED,GAAQwB,EAEnBO,EACHnC,EAAQqB,SAASjB,EAAKC,EAAOF,EAAWG,GAExCN,EAAQE,gBAAgBC,EAAWC,EAAKC,EAAOC,EAChD,KDnEK,IAACV,EACJE","sources":["webpack://@pewresearch/prc-platform-datasets/webpack/bootstrap","webpack://@pewresearch/prc-platform-datasets/webpack/runtime/define property getters","webpack://@pewresearch/prc-platform-datasets/webpack/runtime/hasOwnProperty shorthand","webpack://@pewresearch/prc-platform-datasets/external module \"@wordpress/interactivity\"","webpack://@pewresearch/prc-platform-datasets/./src/download-block/view.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\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))","var x = (y) => {\n\tvar x = {}; __webpack_require__.d(x, y); return x\n} \nvar y = (x) => (() => (x))\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"getContext\"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getContext), [\"getElement\"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getElement), [\"store\"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.store) });","/**\n * WordPress Dependencies\n */\n\nimport { store, getContext, getElement } from '@wordpress/interactivity';\n\nconst { actions } = store('prc-platform/dataset-download', {\n\tactions: {\n\t\tdownloadDataset: (datasetId, uid, token, NONCE) => {\n\t\t\twindow?.wp\n\t\t\t\t?.apiFetch({\n\t\t\t\t\tpath: `/prc-api/v3/datasets/get-download/?dataset_id=${datasetId}`,\n\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\tdata: {\n\t\t\t\t\t\tuid,\n\t\t\t\t\t\tuserToken: token,\n\t\t\t\t\t\tNONCE,\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t\t.then((response) => {\n\t\t\t\t\tif (response?.file_url) {\n\t\t\t\t\t\twindow.open(response.file_url, '_blank');\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.catch((error) => {\n\t\t\t\t\tconsole.error(error);\n\t\t\t\t});\n\t\t},\n\t\tasync checkATP(uid, token, datasetId, NONCE) {\n\t\t\tconst { ref } = getElement();\n\n\t\t\tconst response = await window?.wp?.apiFetch({\n\t\t\t\tpath: `/prc-api/v3/datasets/check-atp/`,\n\t\t\t\tmethod: 'POST',\n\t\t\t\tdata: {\n\t\t\t\t\tuid,\n\t\t\t\t\tuserToken: token,\n\t\t\t\t\tNONCE,\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tif (true === response) {\n\t\t\t\tactions.downloadDataset(datasetId, uid, token, NONCE);\n\t\t\t}\n\t\t\tif (false === response) {\n\t\t\t\tconst popupID =\n\t\t\t\t\tref.parentElement.parentElement.parentElement.getAttribute(\n\t\t\t\t\t\t'id'\n\t\t\t\t\t);\n\t\t\t\tconst { actions: popupActions, state: popupState } = store(\n\t\t\t\t\t'prc-block/popup-controller'\n\t\t\t\t);\n\t\t\t\tpopupActions.open(null, popupID);\n\t\t\t}\n\t\t},\n\t\tonButtonClick: (event) => {\n\t\t\tevent.preventDefault();\n\t\t\tconst context = getContext();\n\t\t\tconst { datasetId, isATP, NONCE } = context;\n\n\t\t\tconst { state } = store('prc-user-accounts/content-gate');\n\t\t\tconst { token, uid } = state;\n\n\t\t\tif (isATP) {\n\t\t\t\tactions.checkATP(uid, token, datasetId, NONCE);\n\t\t\t} else {\n\t\t\t\tactions.downloadDataset(datasetId, uid, token, NONCE);\n\t\t\t}\n\t\t},\n\t},\n});\n"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","y","__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__","x","d","actions","store","downloadDataset","datasetId","uid","token","NONCE","window","wp","apiFetch","path","method","data","userToken","then","response","file_url","open","catch","error","console","checkATP","ref","getElement","popupID","parentElement","getAttribute","popupActions","state","popupState","onButtonClick","event","preventDefault","context","getContext","isATP"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"download-block/view.js","mappings":"2CACA,IAAIA,EAAsB,CCA1BA,EAAwB,CAACC,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE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EnBO,EACHnC,EAAQqB,SAASjB,EAAKC,EAAOF,EAAWG,GAExCN,EAAQE,gBAAgBC,EAAWC,EAAKC,EAAOC,EAChD,KDnEK,IAACV,EACJE","sources":["webpack://@pewresearch/prc-platform-datasets/webpack/bootstrap","webpack://@pewresearch/prc-platform-datasets/webpack/runtime/define property getters","webpack://@pewresearch/prc-platform-datasets/webpack/runtime/hasOwnProperty shorthand","webpack://@pewresearch/prc-platform-datasets/external module \"@wordpress/interactivity\"","webpack://@pewresearch/prc-platform-datasets/./src/download-block/view.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\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))","var x = (y) => {\n\tvar x = {}; __webpack_require__.d(x, y); return x\n} \nvar y = (x) => (() => (x))\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"getContext\"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getContext), [\"getElement\"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getElement), [\"store\"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.store) });","/**\n * WordPress Dependencies\n */\n\nimport { store, getContext, getElement } from '@wordpress/interactivity';\n\nconst { actions } = store('prc-platform/dataset-download', {\n\tactions: {\n\t\tdownloadDataset: (datasetId, uid, token, NONCE) => {\n\t\t\twindow?.wp\n\t\t\t\t?.apiFetch({\n\t\t\t\t\tpath: `/prc-api/v3/datasets/get-download/?dataset_id=${datasetId}`,\n\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\tdata: {\n\t\t\t\t\t\tuid,\n\t\t\t\t\t\tuserToken: token,\n\t\t\t\t\t\tNONCE,\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t\t.then((response) => {\n\t\t\t\t\tif (response?.file_url) {\n\t\t\t\t\t\twindow.open(response.file_url, '_blank');\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.catch((error) => {\n\t\t\t\t\tconsole.error(error);\n\t\t\t\t});\n\t\t},\n\t\tasync checkATP(uid, token, datasetId, NONCE) {\n\t\t\tconst { ref } = getElement();\n\n\t\t\tconst response = await window?.wp?.apiFetch({\n\t\t\t\tpath: `/prc-api/v3/datasets/check-atp/`,\n\t\t\t\tmethod: 'POST',\n\t\t\t\tdata: {\n\t\t\t\t\tuid,\n\t\t\t\t\tuserToken: token,\n\t\t\t\t\tNONCE,\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tif (true === response) {\n\t\t\t\tactions.downloadDataset(datasetId, uid, token, NONCE);\n\t\t\t}\n\t\t\tif (false === response) {\n\t\t\t\tconst popupID =\n\t\t\t\t\tref.parentElement.parentElement.parentElement.getAttribute(\n\t\t\t\t\t\t'id'\n\t\t\t\t\t);\n\t\t\t\tconst { actions: popupActions, state: popupState } = store(\n\t\t\t\t\t'prc-block/popup-controller'\n\t\t\t\t);\n\t\t\t\tpopupActions.open(null, popupID);\n\t\t\t}\n\t\t},\n\t\tonButtonClick: (event) => {\n\t\t\tevent.preventDefault();\n\t\t\tconst context = getContext();\n\t\t\tconst { datasetId, isATP, NONCE } = context;\n\n\t\t\tconst { state } = store('prc-user-accounts/content-gate');\n\t\t\tconst { token, uid } = state;\n\n\t\t\tif (isATP) {\n\t\t\t\tactions.checkATP(uid, token, datasetId, NONCE);\n\t\t\t} else {\n\t\t\t\tactions.downloadDataset(datasetId, uid, token, NONCE);\n\t\t\t}\n\t\t},\n\t},\n});\n"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","y","__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__","x","d","actions","store","downloadDataset","datasetId","uid","token","NONCE","window","wp","apiFetch","path","method","data","userToken","then","response","file_url","open","catch","error","console","checkATP","ref","getElement","popupID","parentElement","getAttribute","popupActions","state","popupState","onButtonClick","event","preventDefault","context","getContext","isATP"],"sourceRoot":""} \ No newline at end of file diff --git a/includes/datasets/build/panel/index.asset.php b/includes/datasets/build/panel/index.asset.php index 94dfc76..1c8feb0 100644 --- a/includes/datasets/build/panel/index.asset.php +++ b/includes/datasets/build/panel/index.asset.php @@ -1 +1 @@ - array('prc-components', 'react', 'wp-components', 'wp-core-data', 'wp-data', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-polyfill', 'wp-primitives'), 'version' => 'e87bca26f6a8cda053aa'); + array('prc-components', 'react', 'react-jsx-runtime', 'wp-components', 'wp-core-data', 'wp-data', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-polyfill', 'wp-primitives'), 'version' => '33622cb763f01b800cd1'); diff --git a/includes/datasets/build/panel/index.js b/includes/datasets/build/panel/index.js index d20e21b..d21cec0 100644 --- a/includes/datasets/build/panel/index.js +++ b/includes/datasets/build/panel/index.js @@ -1,2 +1,2 @@ -(()=>{"use strict";var e={251:(e,t,a)=>{var n=a(196),o=Symbol.for("react.element"),r=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),l=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};t.jsx=function(e,t,a){var n,s={},d=null,p=null;for(n in void 0!==a&&(d=""+a),void 0!==t.key&&(d=""+t.key),void 0!==t.ref&&(p=t.ref),t)r.call(t,n)&&!i.hasOwnProperty(n)&&(s[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===s[n]&&(s[n]=t[n]);return{$$typeof:o,type:e,key:d,ref:p,props:s,_owner:l.current}}},893:(e,t,a)=>{e.exports=a(251)},196:e=>{e.exports=window.React}},t={};function a(n){var o=t[n];if(void 0!==o)return o.exports;var r=t[n]={exports:{}};return e[n](r,r.exports,a),r.exports}(()=>{var e=a(196);const t=window.wp.element,n=(0,t.forwardRef)((function({icon:e,size:a=24,...n},o){return(0,t.cloneElement)(e,{width:a,height:a,...n,ref:o})})),o=window.wp.primitives;var r=a(893);const l=(0,r.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(o.Path,{d:"M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z"})}),i=window.prcComponents,s=window.wp.i18n,d=window.wp.plugins,p=window.wp.editPost,c=window.wp.editor,w=window.wp.data,m=window.wp.coreData,_=window.wp.components,u="prc-platform-datasets-panel",h=["application/zip","application/pdf"];(0,d.registerPlugin)(u,{render:function(){const{postType:t,postId:a}=(0,w.useSelect)((e=>({postType:e(c.store).getCurrentPostType(),postId:e(c.store).getCurrentPostId()})),[]),[o,r]=(0,m.useEntityProp)("postType",t,"meta",a),{attachmentId:d,isAtp:f,datasetSchema:v}=(0,e.useMemo)((()=>(console.log("meta",o),{attachmentId:o._download_attachment_id||!1,isAtp:o.is_atp||!1,datasetSchema:o.dataset_schema||""})),[o]);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(p.PluginSidebar,{name:u,title:"Dataset Options",icon:(0,e.createElement)(n,{icon:l,size:16})},(0,e.createElement)(_.PanelBody,{title:"Dataset File"},(0,e.createElement)(i.MediaDropZone,{attachmentId:d,disabled:!1,onUpdate:e=>{r({...o,_download_attachment_id:e.id})},editButtonLabel:(0,s.__)("Edit Dataset File"),onClear:!1,allowedTypes:h,label:(0,s.__)("Upload Dataset File (zip or pdf)"),singularLabel:(0,s.__)("dataset")}),(0,e.createElement)(_.CardDivider,null),(0,e.createElement)(_.ToggleControl,{label:"ATP Dataset",help:"ATP datasets are bound by an opt-in to the ATP Terms of Service.",checked:f,onChange:e=>{r({...o,is_atp:e})}})),(0,e.createElement)(_.PanelBody,{title:"Dataset Schema"},(0,e.createElement)(_.TextareaControl,{label:"Dataset Schema",value:v,onChange:e=>{r({...o,dataset_schema:e})}}))),(0,e.createElement)(p.PluginPrePublishPanel,null,(0,e.createElement)(_.PanelBody,{title:"Review Dataset Options"},(0,e.createElement)(i.MediaDropZone,{attachmentId:d,disabled:!1,onUpdate:e=>{r({...o,_download_attachment_id:e.id})},editButtonLabel:(0,s.__)("Edit Dataset File"),onClear:!1,allowedTypes:h,label:(0,s.__)("Upload Dataset File (zip or pdf)"),singularLabel:(0,s.__)("dataset")}),(0,e.createElement)(_.CardDivider,null),(0,e.createElement)(_.ToggleControl,{label:"ATP Dataset",help:"ATP datasets are bound by an opt-in to the ATP Terms of Service.",checked:f,onChange:e=>{r({...o,is_atp:e})}}))))}})})()})(); +(()=>{"use strict";const e=window.wp.element,t=(0,e.forwardRef)((function({icon:t,size:a=24,...n},o){return(0,e.cloneElement)(t,{width:a,height:a,...n,ref:o})})),a=window.wp.primitives,n=window.ReactJSXRuntime,o=(0,n.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,n.jsx)(a.Path,{d:"M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z"})}),i=window.prcComponents,s=window.wp.i18n,d=window.React,l=window.wp.plugins,r=window.wp.editPost,p=window.wp.editor,w=window.wp.data,c=window.wp.coreData,h=window.wp.components,m="prc-platform-datasets-panel",_=["application/zip","application/pdf"];(0,l.registerPlugin)(m,{render:function(){const{postType:e,postId:a}=(0,w.useSelect)((e=>({postType:e(p.store).getCurrentPostType(),postId:e(p.store).getCurrentPostId()})),[]),[l,u]=(0,c.useEntityProp)("postType",e,"meta",a),{attachmentId:g,isAtp:P,datasetSchema:x}=(0,d.useMemo)((()=>(console.log("meta",l),{attachmentId:l._download_attachment_id||!1,isAtp:l.is_atp||!1,datasetSchema:l.dataset_schema||""})),[l]);return(0,n.jsxs)(d.Fragment,{children:[(0,n.jsxs)(r.PluginSidebar,{name:m,title:"Dataset Options",icon:(0,n.jsx)(t,{icon:o,size:16}),children:[(0,n.jsxs)(h.PanelBody,{title:"Dataset File",children:[(0,n.jsx)(i.MediaDropZone,{attachmentId:g,disabled:!1,onUpdate:e=>{u({...l,_download_attachment_id:e.id})},editButtonLabel:(0,s.__)("Edit Dataset File"),onClear:!1,allowedTypes:_,label:(0,s.__)("Upload Dataset File (zip or pdf)"),singularLabel:(0,s.__)("dataset")}),(0,n.jsx)(h.CardDivider,{}),(0,n.jsx)(h.ToggleControl,{label:"ATP Dataset",help:"ATP datasets are bound by an opt-in to the ATP Terms of Service.",checked:P,onChange:e=>{u({...l,is_atp:e})}})]}),(0,n.jsx)(h.PanelBody,{title:"Dataset Schema",children:(0,n.jsx)(h.TextareaControl,{label:"Dataset Schema",value:x,onChange:e=>{u({...l,dataset_schema:e})}})})]}),(0,n.jsx)(r.PluginPrePublishPanel,{children:(0,n.jsxs)(h.PanelBody,{title:"Review Dataset Options",children:[(0,n.jsx)(i.MediaDropZone,{attachmentId:g,disabled:!1,onUpdate:e=>{u({...l,_download_attachment_id:e.id})},editButtonLabel:(0,s.__)("Edit Dataset File"),onClear:!1,allowedTypes:_,label:(0,s.__)("Upload Dataset File (zip or pdf)"),singularLabel:(0,s.__)("dataset")}),(0,n.jsx)(h.CardDivider,{}),(0,n.jsx)(h.ToggleControl,{label:"ATP Dataset",help:"ATP datasets are bound by an opt-in to the ATP Terms of Service.",checked:P,onChange:e=>{u({...l,is_atp:e})}})]})})]})}})})(); //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/includes/datasets/build/panel/index.js.map b/includes/datasets/build/panel/index.js.map index ad3e086..533a060 100644 --- a/includes/datasets/build/panel/index.js.map +++ b/includes/datasets/build/panel/index.js.map @@ -1 +1 @@ -{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hB,eACAiB,UAAU,EACVC,SAAWC,IACVrB,EAAQ,IACJD,EACHS,wBAAyBa,EAAWC,IACnC,EAEHC,iBAAiBC,EAAAA,EAAAA,IAAG,qBACpBC,SAAS,EACTC,aAAcrC,EACdsC,OAAOH,EAAAA,EAAAA,IAAG,oCACVI,eAAeJ,EAAAA,EAAAA,IAAG,cAGpBb,EAAAA,EAAAA,eAACkB,EAAAA,YAAW,OACZlB,EAAAA,EAAAA,eAACmB,EAAAA,cAAa,CACbH,MAAM,cACNI,KAAK,mEACLC,QAAS7B,EACT8B,SAAWC,IACVlC,EAAQ,IACJD,EACHU,OAAQyB,GACP,MAILvB,EAAAA,EAAAA,eAACM,EAAAA,UAAS,CAACF,MAAM,mBAChBJ,EAAAA,EAAAA,eAACwB,EAAAA,gBAAe,CACfR,MAAM,iBACNO,MAAO9B,EACP6B,SAAWC,IACVlC,EAAQ,IACJD,EACHW,eAAgBwB,GACf,OAQNvB,EAAAA,EAAAA,eAACyB,EAAAA,sBAAqB,MACrBzB,EAAAA,EAAAA,eAACM,EAAAA,UAAS,CAACF,MAAM,2BAChBJ,EAAAA,EAAAA,eAACO,EAAAA,cAAa,CAEZhB,eACAiB,UAAU,EACVC,SAAWC,IACVrB,EAAQ,IACJD,EACHS,wBAAyBa,EAAWC,IACnC,EAEHC,iBAAiBC,EAAAA,EAAAA,IAAG,qBACpBC,SAAS,EACTC,aAAcrC,EACdsC,OAAOH,EAAAA,EAAAA,IAAG,oCACVI,eAAeJ,EAAAA,EAAAA,IAAG,cAGpBb,EAAAA,EAAAA,eAACkB,EAAAA,YAAW,OACZlB,EAAAA,EAAAA,eAACmB,EAAAA,cAAa,CACbH,MAAM,cACNI,KAAK,mEACLC,QAAS7B,EACT8B,SAAWC,IACVlC,EAAQ,IACJD,EACHU,OAAQyB,GACP,MAOT,G","sources":["webpack://@pewresearch/prc-platform-datasets/./node_modules/react/cjs/react-jsx-runtime.production.min.js","webpack://@pewresearch/prc-platform-datasets/./node_modules/react/jsx-runtime.js","webpack://@pewresearch/prc-platform-datasets/external window \"React\"","webpack://@pewresearch/prc-platform-datasets/webpack/bootstrap","webpack://@pewresearch/prc-platform-datasets/external window [\"wp\",\"element\"]","webpack://@pewresearch/prc-platform-datasets/./node_modules/@wordpress/icons/build-module/icon/index.js","webpack://@pewresearch/prc-platform-datasets/external window [\"wp\",\"primitives\"]","webpack://@pewresearch/prc-platform-datasets/./node_modules/@wordpress/icons/build-module/library/download.js","webpack://@pewresearch/prc-platform-datasets/external window \"prcComponents\"","webpack://@pewresearch/prc-platform-datasets/external window [\"wp\",\"i18n\"]","webpack://@pewresearch/prc-platform-datasets/external window [\"wp\",\"plugins\"]","webpack://@pewresearch/prc-platform-datasets/external window [\"wp\",\"editPost\"]","webpack://@pewresearch/prc-platform-datasets/external window [\"wp\",\"editor\"]","webpack://@pewresearch/prc-platform-datasets/external window [\"wp\",\"data\"]","webpack://@pewresearch/prc-platform-datasets/external window [\"wp\",\"coreData\"]","webpack://@pewresearch/prc-platform-datasets/external window [\"wp\",\"components\"]","webpack://@pewresearch/prc-platform-datasets/./src/panel/index.js"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","module.exports = window[\"React\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"element\"];","/**\n * WordPress dependencies\n */\nimport { cloneElement, forwardRef } from '@wordpress/element';\n\n/** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */\n\n/**\n * Return an SVG icon.\n *\n * @param {IconProps} props icon is the SVG component to render\n * size is a number specifiying the icon size in pixels\n * Other props will be passed to wrapped SVG component\n * @param {import('react').ForwardedRef} ref The forwarded ref to the SVG element.\n *\n * @return {JSX.Element} Icon component\n */\nfunction Icon({\n icon,\n size = 24,\n ...props\n}, ref) {\n return cloneElement(icon, {\n width: size,\n height: size,\n ...props,\n ref\n });\n}\nexport default forwardRef(Icon);\n//# sourceMappingURL=index.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"primitives\"];","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst download = /*#__PURE__*/_jsx(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n children: /*#__PURE__*/_jsx(Path, {\n d: \"M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z\"\n })\n});\nexport default download;\n//# sourceMappingURL=download.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"prcComponents\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"i18n\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"plugins\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"editPost\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"editor\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"data\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"coreData\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"components\"];","/**\n * External Dependencies\n */\nimport { Icon, download as icon } from '@wordpress/icons';\nimport { MediaDropZone } from '@prc/components';\n\n/**\n * WordPress Dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Fragment, useMemo } from 'react';\nimport { registerPlugin } from '@wordpress/plugins';\nimport { PluginSidebar, PluginPrePublishPanel } from '@wordpress/edit-post';\nimport { store as editorStore } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\nimport { useEntityProp } from '@wordpress/core-data';\nimport {\n\tButton,\n\tCardDivider,\n\tPanelBody,\n\tTextareaControl,\n\tToggleControl,\n} from '@wordpress/components';\n\n/**\n * Internal Dependencies\n */\n\nconst PLUGIN_NAME = 'prc-platform-datasets-panel';\nconst ALLOWED_TYPES = ['application/zip', 'application/pdf'];\n\nfunction DatasetOptionsPanel() {\n\tconst { postType, postId } = useSelect((select) => {\n\t\tconst currentPostType = select(editorStore).getCurrentPostType();\n\t\tconst currentPostId = select(editorStore).getCurrentPostId();\n\t\treturn {\n\t\t\tpostType: currentPostType,\n\t\t\tpostId: currentPostId,\n\t\t};\n\t}, []);\n\n\tconst [meta, setMeta] = useEntityProp('postType', postType, 'meta', postId);\n\n\tconst { attachmentId, isAtp, datasetSchema } = useMemo(() => {\n\t\tconsole.log('meta', meta);\n\t\treturn {\n\t\t\tattachmentId: meta._download_attachment_id || false,\n\t\t\tisAtp: meta.is_atp || false,\n\t\t\tdatasetSchema: meta.dataset_schema || '',\n\t\t};\n\t}, [meta]);\n\n\treturn (\n\t\t\n\t\t\t}\n\t\t\t>\n\t\t\t\t\n\t\t\t\t\t {\n\t\t\t\t\t\t\t\tsetMeta({\n\t\t\t\t\t\t\t\t\t...meta,\n\t\t\t\t\t\t\t\t\t_download_attachment_id: attachment.id,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\teditButtonLabel: __('Edit Dataset File'),\n\t\t\t\t\t\t\tonClear: false,\n\t\t\t\t\t\t\tallowedTypes: ALLOWED_TYPES,\n\t\t\t\t\t\t\tlabel: __('Upload Dataset File (zip or pdf)'),\n\t\t\t\t\t\t\tsingularLabel: __('dataset'),\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t\t\n\t\t\t\t\t {\n\t\t\t\t\t\t\tsetMeta({\n\t\t\t\t\t\t\t\t...meta,\n\t\t\t\t\t\t\t\tis_atp: value,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t {\n\t\t\t\t\t\t\tsetMeta({\n\t\t\t\t\t\t\t\t...meta,\n\t\t\t\t\t\t\t\tdataset_schema: value,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t\n\t\t\t\t{/* @TODO: WIP, Eventually I'd like to get all entities that reference this dataset, but we'll wait for the Supra-Block-Data-Store \n\t\t\t\t\t

A list of posts that are calling this dataset...

\n\t\t\t\t
*/}\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t {\n\t\t\t\t\t\t\t\tsetMeta({\n\t\t\t\t\t\t\t\t\t...meta,\n\t\t\t\t\t\t\t\t\t_download_attachment_id: attachment.id,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\teditButtonLabel: __('Edit Dataset File'),\n\t\t\t\t\t\t\tonClear: false,\n\t\t\t\t\t\t\tallowedTypes: ALLOWED_TYPES,\n\t\t\t\t\t\t\tlabel: __('Upload Dataset File (zip or pdf)'),\n\t\t\t\t\t\t\tsingularLabel: __('dataset'),\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t\t\n\t\t\t\t\t {\n\t\t\t\t\t\t\tsetMeta({\n\t\t\t\t\t\t\t\t...meta,\n\t\t\t\t\t\t\t\tis_atp: value,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t\n\t\t\t\n\t\t
\n\t);\n}\n\nregisterPlugin(PLUGIN_NAME, {\n\trender: DatasetOptionsPanel,\n});\n"],"names":["f","k","Symbol","for","m","Object","prototype","hasOwnProperty","n","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","ReactCurrentOwner","p","key","ref","__self","__source","exports","jsx","c","a","g","b","d","e","h","call","defaultProps","$$typeof","type","props","_owner","current","module","window","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","forwardRef","icon","size","cloneElement","width","height","SVG","xmlns","viewBox","children","Path","PLUGIN_NAME","ALLOWED_TYPES","registerPlugin","render","postType","postId","useSelect","select","editorStore","getCurrentPostType","getCurrentPostId","meta","setMeta","useEntityProp","attachmentId","isAtp","datasetSchema","useMemo","console","log","_download_attachment_id","is_atp","dataset_schema","createElement","Fragment","PluginSidebar","name","title","Icon","PanelBody","MediaDropZone","disabled","onUpdate","attachment","id","editButtonLabel","__","onClear","allowedTypes","label","singularLabel","CardDivider","ToggleControl","help","checked","onChange","value","T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IAAG,cAGpBT,EAAAA,EAAAA,KAACc,EAAAA,YAAW,KACZd,EAAAA,EAAAA,KAACe,EAAAA,cAAa,CACbH,MAAM,cACNI,KAAK,mEACLC,QAAS9B,EACT+B,SAAWC,IACVnC,EAAQ,IACJD,EACHU,OAAQ0B,GACP,WAOT,G","sources":["webpack://@pewresearch/prc-platform-datasets/external window [\"wp\",\"element\"]","webpack://@pewresearch/prc-platform-datasets/./node_modules/@wordpress/icons/build-module/icon/index.js","webpack://@pewresearch/prc-platform-datasets/external window [\"wp\",\"primitives\"]","webpack://@pewresearch/prc-platform-datasets/external window \"ReactJSXRuntime\"","webpack://@pewresearch/prc-platform-datasets/./node_modules/@wordpress/icons/build-module/library/download.js","webpack://@pewresearch/prc-platform-datasets/external window \"prcComponents\"","webpack://@pewresearch/prc-platform-datasets/external window [\"wp\",\"i18n\"]","webpack://@pewresearch/prc-platform-datasets/external window \"React\"","webpack://@pewresearch/prc-platform-datasets/external window [\"wp\",\"plugins\"]","webpack://@pewresearch/prc-platform-datasets/external window [\"wp\",\"editPost\"]","webpack://@pewresearch/prc-platform-datasets/external window [\"wp\",\"editor\"]","webpack://@pewresearch/prc-platform-datasets/external window [\"wp\",\"data\"]","webpack://@pewresearch/prc-platform-datasets/external window [\"wp\",\"coreData\"]","webpack://@pewresearch/prc-platform-datasets/external window [\"wp\",\"components\"]","webpack://@pewresearch/prc-platform-datasets/./src/panel/index.js"],"sourcesContent":["const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"element\"];","/**\n * WordPress dependencies\n */\nimport { cloneElement, forwardRef } from '@wordpress/element';\n\n/** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */\n\n/**\n * Return an SVG icon.\n *\n * @param {IconProps} props icon is the SVG component to render\n * size is a number specifiying the icon size in pixels\n * Other props will be passed to wrapped SVG component\n * @param {import('react').ForwardedRef} ref The forwarded ref to the SVG element.\n *\n * @return {JSX.Element} Icon component\n */\nfunction Icon({\n icon,\n size = 24,\n ...props\n}, ref) {\n return cloneElement(icon, {\n width: size,\n height: size,\n ...props,\n ref\n });\n}\nexport default forwardRef(Icon);\n//# sourceMappingURL=index.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"primitives\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"ReactJSXRuntime\"];","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst download = /*#__PURE__*/_jsx(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n children: /*#__PURE__*/_jsx(Path, {\n d: \"M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z\"\n })\n});\nexport default download;\n//# sourceMappingURL=download.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"prcComponents\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"i18n\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"React\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"plugins\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"editPost\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"editor\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"data\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"coreData\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"components\"];","/**\n * External Dependencies\n */\nimport { Icon, download as icon } from '@wordpress/icons';\nimport { MediaDropZone } from '@prc/components';\n\n/**\n * WordPress Dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Fragment, useMemo } from 'react';\nimport { registerPlugin } from '@wordpress/plugins';\nimport { PluginSidebar, PluginPrePublishPanel } from '@wordpress/edit-post';\nimport { store as editorStore } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\nimport { useEntityProp } from '@wordpress/core-data';\nimport {\n\tButton,\n\tCardDivider,\n\tPanelBody,\n\tTextareaControl,\n\tToggleControl,\n} from '@wordpress/components';\n\n/**\n * Internal Dependencies\n */\n\nconst PLUGIN_NAME = 'prc-platform-datasets-panel';\nconst ALLOWED_TYPES = ['application/zip', 'application/pdf'];\n\nfunction DatasetOptionsPanel() {\n\tconst { postType, postId } = useSelect((select) => {\n\t\tconst currentPostType = select(editorStore).getCurrentPostType();\n\t\tconst currentPostId = select(editorStore).getCurrentPostId();\n\t\treturn {\n\t\t\tpostType: currentPostType,\n\t\t\tpostId: currentPostId,\n\t\t};\n\t}, []);\n\n\tconst [meta, setMeta] = useEntityProp('postType', postType, 'meta', postId);\n\n\tconst { attachmentId, isAtp, datasetSchema } = useMemo(() => {\n\t\tconsole.log('meta', meta);\n\t\treturn {\n\t\t\tattachmentId: meta._download_attachment_id || false,\n\t\t\tisAtp: meta.is_atp || false,\n\t\t\tdatasetSchema: meta.dataset_schema || '',\n\t\t};\n\t}, [meta]);\n\n\treturn (\n\t\t\n\t\t\t}\n\t\t\t>\n\t\t\t\t\n\t\t\t\t\t {\n\t\t\t\t\t\t\t\tsetMeta({\n\t\t\t\t\t\t\t\t\t...meta,\n\t\t\t\t\t\t\t\t\t_download_attachment_id: attachment.id,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\teditButtonLabel: __('Edit Dataset File'),\n\t\t\t\t\t\t\tonClear: false,\n\t\t\t\t\t\t\tallowedTypes: ALLOWED_TYPES,\n\t\t\t\t\t\t\tlabel: __('Upload Dataset File (zip or pdf)'),\n\t\t\t\t\t\t\tsingularLabel: __('dataset'),\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t\t\n\t\t\t\t\t {\n\t\t\t\t\t\t\tsetMeta({\n\t\t\t\t\t\t\t\t...meta,\n\t\t\t\t\t\t\t\tis_atp: value,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t {\n\t\t\t\t\t\t\tsetMeta({\n\t\t\t\t\t\t\t\t...meta,\n\t\t\t\t\t\t\t\tdataset_schema: value,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t\n\t\t\t\t{/* @TODO: WIP, Eventually I'd like to get all entities that reference this dataset, but we'll wait for the Supra-Block-Data-Store \n\t\t\t\t\t

A list of posts that are calling this dataset...

\n\t\t\t\t
*/}\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t {\n\t\t\t\t\t\t\t\tsetMeta({\n\t\t\t\t\t\t\t\t\t...meta,\n\t\t\t\t\t\t\t\t\t_download_attachment_id: attachment.id,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\teditButtonLabel: __('Edit Dataset File'),\n\t\t\t\t\t\t\tonClear: false,\n\t\t\t\t\t\t\tallowedTypes: ALLOWED_TYPES,\n\t\t\t\t\t\t\tlabel: __('Upload Dataset File (zip or pdf)'),\n\t\t\t\t\t\t\tsingularLabel: __('dataset'),\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t\t\n\t\t\t\t\t {\n\t\t\t\t\t\t\tsetMeta({\n\t\t\t\t\t\t\t\t...meta,\n\t\t\t\t\t\t\t\tis_atp: value,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t\n\t\t\t\n\t\t
\n\t);\n}\n\nregisterPlugin(PLUGIN_NAME, {\n\trender: DatasetOptionsPanel,\n});\n"],"names":["window","forwardRef","icon","size","props","ref","cloneElement","width","height","SVG","xmlns","viewBox","children","Path","d","PLUGIN_NAME","ALLOWED_TYPES","registerPlugin","render","postType","postId","useSelect","select","editorStore","getCurrentPostType","getCurrentPostId","meta","setMeta","useEntityProp","attachmentId","isAtp","datasetSchema","useMemo","console","log","_download_attachment_id","is_atp","dataset_schema","_jsxs","Fragment","PluginSidebar","name","title","_jsx","Icon","PanelBody","MediaDropZone","disabled","onUpdate","attachment","id","editButtonLabel","__","onClear","allowedTypes","label","singularLabel","CardDivider","ToggleControl","help","checked","onChange","value","TextareaControl","PluginPrePublishPanel"],"sourceRoot":""} \ No newline at end of file diff --git a/includes/datasets/class-cli-missing-files.php b/includes/datasets/class-cli-missing-files.php new file mode 100644 index 0000000..4b7cefe --- /dev/null +++ b/includes/datasets/class-cli-missing-files.php @@ -0,0 +1,96 @@ +start_bulk_operation(); + + if ( isset( $assoc_args['dry-run'] ) ) { + // Passing `--dry-run=false` to the command leads to the `false` value being set to string `'false'`, but casting `'false'` to bool produces `true`. Thus the special handling. + if ( 'false' === $assoc_args['dry-run'] ) { + $dry_run = false; + } else { + $dry_run = (bool) $assoc_args['dry-run']; + } + } else { + $dry_run = true; + } + + if ( false === $dry_run ) { + WP_CLI::line( '👤 🔴 Callback armed and ready' ); + } else { + WP_CLI::line( '👤 🛟 Running in dry-run mode, callback is disarmed.' ); + } + + $posts_per_page = 100; + $paged = 1; + $count = 0; + + do { + + $args = [ + 'post_type' => 'dataset', + 'posts_per_page' => $posts_per_page, + 'paged' => $paged, + 'suppress_filters' => false, + 'meta_query' => [ + [ + 'key' => '_download_attachment_id', + 'compare' => 'NOT EXISTS', + ], + ], + ]; + + $posts = get_posts($args); + + foreach ( $posts as $post ) { + if ( ! $dry_run ) { + update_post_meta( $post->ID, '_dataset_file_missing', true ); + } + $count++; + } + + // Pause. + WP_CLI::line( 'Pausing for a breath...' ); + sleep( 3 ); + + // Free up memory. + $this->vip_inmemory_cleanup(); + + /* At this point, we have to decide whether to increase the value of $paged. In case a value which is being used for querying the posts (like post_status in our example) is being changed via the command, we should keep the WP_Query starting from the beginning in every iteration. + * If the any value used for querying the posts is not being changed, then we need to update the value in order to walk through all the posts. */ + $paged++; + } while ( count( $posts ) ); + + if ( false === $dry_run ) { + WP_CLI::success( sprintf( '%d datasets have successfully been identified as having missing files and had their metakeys updated.', $count ) ); + } else { + WP_CLI::success( sprintf( '%d datasets will be identified as having missing files and have their metakeys updated.', $count ) ); + } + + // Trigger a term count as well as trigger bulk indexing of Elasticsearch site. + $this->end_bulk_operation(); + } + } + + WP_CLI::add_command( 'prc datasets missing-files', '\PRC\Platform\Dataset_Missing_Files' ); +} diff --git a/includes/datasets/class-datasets.php b/includes/datasets/class-datasets.php index 764b949..1dce85d 100644 --- a/includes/datasets/class-datasets.php +++ b/includes/datasets/class-datasets.php @@ -125,6 +125,7 @@ class Datasets { public function __construct( $version, $loader ) { $this->version = $version; require_once plugin_dir_path( __FILE__ ) . '/downloads-log/index.php'; + require_once plugin_dir_path( __FILE__ ) . '/class-cli-missing-files.php'; $this->init($loader); } diff --git a/includes/datasets/src/download-block/render.php b/includes/datasets/src/download-block/render.php index 444c5a2..44c85c4 100644 --- a/includes/datasets/src/download-block/render.php +++ b/includes/datasets/src/download-block/render.php @@ -18,7 +18,7 @@ // If this dataset is in the ATP then it needs a modal to accept the ATP legal terms. Here we're manually adding the content from the download block... usually a core/button into the trigger of the poopup. Now, the button is still wired to the download block but the download block can handle opening the modal by accessing the modals' action store when running core/button::onButtonClick. if ( $is_atp ) { $modal = \PRC\Platform\Blocks\Popup_Controller\create_modal([ - 'title' => 'Accept ATP', + 'title' => 'Accept ATP Legal Terms and Conditions to download', 'content' => '', 'backgroundColor' => 'ui-white', 'trigger' => $content, diff --git a/includes/wp-admin/admin-columns/config/66477056087a4.php b/includes/wp-admin/admin-columns/config/66477056087a4.php index 63935a1..b3d4ad0 100644 --- a/includes/wp-admin/admin-columns/config/66477056087a4.php +++ b/includes/wp-admin/admin-columns/config/66477056087a4.php @@ -1,13 +1,13 @@ '6.4.6', + 'version' => '6.4.10', 'list_screen' => array ( 'title' => '', 'type' => 'dataset', 'id' => '66477056087a4', - 'updated' => 1715957846, + 'updated' => 1730128809, 'columns' => array ( 'title' => @@ -40,22 +40,6 @@ 'filter_label' => '', 'name' => '32aeb9c9ca7efa', ), - 'taxonomy-formats' => - array ( - 'type' => 'taxonomy-formats', - 'label' => 'Formats', - 'width' => '', - 'width_unit' => '%', - 'edit' => 'on', - 'enable_term_creation' => 'off', - 'export' => 'on', - 'sort' => 'on', - 'bulk_edit' => 'on', - 'search' => 'on', - 'filter' => 'off', - 'filter_label' => '', - 'name' => 'taxonomy-formats', - ), 'taxonomy-research-teams' => array ( 'type' => 'taxonomy-research-teams', @@ -88,6 +72,45 @@ 'search' => 'on', 'name' => 'date', ), + '5814836bd4fdf4' => + array ( + 'type' => 'column-meta', + 'label' => 'File', + 'width' => '', + 'width_unit' => '%', + 'field' => '_download_attachment_id', + 'field_type' => 'library_id', + 'image_size' => 'full', + 'image_size_w' => '60', + 'image_size_h' => '60', + 'media_link_to' => 'view', + 'number_of_items' => '10', + 'before' => '', + 'after' => '', + 'edit' => 'on', + 'export' => 'on', + 'sort' => 'on', + 'bulk_edit' => 'on', + 'search' => 'on', + 'filter' => 'off', + 'filter_label' => '', + 'name' => '5814836bd4fdf4', + ), + '54b17e2c828f5c' => + array ( + 'type' => 'column-postid', + 'label' => 'ID', + 'width' => '100', + 'width_unit' => 'px', + 'before' => '', + 'after' => '', + 'export' => 'on', + 'sort' => 'on', + 'search' => 'on', + 'filter' => 'off', + 'filter_label' => '', + 'name' => '54b17e2c828f5c', + ), 'wpseo-score' => array ( 'type' => 'wpseo-score', @@ -152,25 +175,6 @@ 'filter_label' => '', 'name' => 'wpseo-focuskw', ), - 'wpseo-links' => - array ( - 'type' => 'wpseo-links', - 'label' => 'Outgoing internal links', - 'width' => '', - 'width_unit' => '%', - 'sort' => 'on', - 'name' => 'wpseo-links', - ), - 'wpseo-cornerstone' => - array ( - 'type' => 'wpseo-cornerstone', - 'label' => 'Cornerstone content', - 'width' => '', - 'width_unit' => '%', - 'export' => 'on', - 'sort' => 'on', - 'name' => 'wpseo-cornerstone', - ), ), 'settings' => array (