PluginProbe
TablePress – Tables in WordPress made easy / 3.4
TablePress – Tables in WordPress made easy v3.4
3.4 3.3.4 3.3.3 3.3.2 3.3.1 trunk 1.12 1.14 1.9.2 2.0.4 2.1.7 2.1.8 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.3 2.3.1 2.3.2 2.4 2.4.1 2.4.2 2.4.3 All 45 releases
← All changes | admin/js/build/list.js +1 -1 3.3.1 → 3.4 View file →
@@ -1 +1 @@
1 -(()=>{"use strict";var e={n:t=>{var s=t&&t.__esModule?()=>t.default:()=>t;return e.d(s,{a:s}),s},d:(t,s)=>{for(var l in s)e.o(s,l)&&!e.o(t,l)&&Object.defineProperty(t,l,{enumerable:!0,get:s[l]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.i18n,s=e=>"#"===e[0]?document.getElementById(e.slice(1)):document.querySelectorAll(e),l=window.React,o=window.ReactDOM,r=window.wp.domReady;var n=e.n(r);window.wp.hooks;const a=window.ReactJSXRuntime,i=window.wp.components,c=window.wp.compose,h=window.wp.data,d=window.wp.primitives;var p=(0,a.jsx)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,a.jsx)(d.Path,{d:"M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"})}),v=(0,a.jsx)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,a.jsx)(d.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.625 5.5h9.75c.069 0 .125.056.125.125v9.75a.125.125 0 0 1-.125.125h-9.75a.125.125 0 0 1-.125-.125v-9.75c0-.069.056-.125.125-.125ZM4 5.625C4 4.728 4.728 4 5.625 4h9.75C16.273 4 17 4.728 17 5.625v9.75c0 .898-.727 1.625-1.625 1.625h-9.75A1.625 1.625 0 0 1 4 15.375v-9.75Zm14.5 11.656v-9H20v9C20 18.8 18.77 20 17.251 20H6.25v-1.5h11.001c.69 0 1.249-.528 1.249-1.219Z"})});const u=window.wp.notices,w=(0,a.jsxs)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"100",height:"100",viewBox:"-50 -50 100 100",fill:"#fff",children:[(0,a.jsx)(d.Circle,{r:"42",fill:"#16a34a"}),(0,a.jsx)(d.Path,{d:"M0-25.854h-25.854v51.708h51.708V0H21v21h-42v-42H0Z"}),(0,a.jsx)(d.Path,{d:"M-18-18h10v10h-10zM-18-5h10V5h-10zM-5-5H5V5H-5zM-18 8h10v10h-10zM-5 8H5v10H-5zM8 8h10v10H8zM5-31h6.18v6.18H5zM19-25h6.18v6.18H19zM0-15h3.82v3.82H0zM10-20h3.82v3.82H10zM25-12h3.82v3.82H25zM8-13h10v10H8z"})]}),m=(0,a.jsxs)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"-32 -32 64 64",fill:"#fff",children:[(0,a.jsx)(d.Path,{d:"M0-25.854h-25.854v51.708h51.708V0H21v21h-42v-42H0Z"}),(0,a.jsx)(d.Path,{d:"M-18-18h10v10h-10zM-18-5h10V5h-10zM-5-5H5V5H-5zM-18 8h10v10h-10zM-5 8H5v10H-5zM8 8h10v10H8zM5-31h6.18v6.18H5zM19-25h6.18v6.18H19zM0-15h3.82v3.82H0zM10-20h3.82v3.82H10zM25-12h3.82v3.82H25zM8-13h10v10H8z"})]}),x=()=>{const{removeNotice:e}=(0,h.useDispatch)(u.store),t=(0,h.useSelect)(e=>e(u.store).getNotices(),[]).filter(({type:e})=>"snackbar"===e);return 0===t.length?null:(0,a.jsx)(i.SnackbarList,{notices:t,onRemove:e})},f=({title:e,url:s,onRequestClose:l})=>(0,a.jsx)(i.Modal,{icon:(0,a.jsx)(i.Icon,{icon:w,size:"36",style:{display:"flex",marginRight:"1rem"}}),title:e,className:"table-preview-modal",onRequestClose:l,size:"fill",headerActions:(0,a.jsx)(i.Button,{icon:p,size:"compact",label:(0,t.__)("Open the preview in a new tab","tablepress"),href:s,target:"_blank"}),children:(0,a.jsx)("iframe",{title:e,src:s})}),b=({shortcode:e,onRequestClose:s})=>{const{createSuccessNotice:l}=(0,h.useDispatch)(u.store),o=(0,c.useCopyToClipboard)(e,()=>{s(),l((0,t.__)("Copied Shortcode to clipboard.","tablepress"),{type:"snackbar",icon:(0,a.jsx)(i.Icon,{icon:m})})});return(0,a.jsx)(i.Modal,{icon:(0,a.jsx)(i.Icon,{icon:w,size:"36",style:{display:"flex",marginRight:"1rem"}}),title:(0,t.__)("Table Shortcode","tablepress"),onRequestClose:s,children:(0,a.jsxs)(i.__experimentalVStack,{children:[(0,a.jsx)("span",{children:(0,t.__)("To embed this table into a post or page, use this Shortcode:","tablepress")}),(0,a.jsx)(i.__experimentalInputControl,{__next40pxDefaultSize:!0,type:"text",id:"table-information-shortcode",value:e,onFocus:e=>e.target.select(),readOnly:!0,suffix:(0,a.jsx)(i.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,a.jsx)(i.Button,{icon:v,ref:o,size:"small",label:(0,t.__)("Copy Shortcode to clipboard","tablepress")})})})]})})},g=({title:e,deleteUrl:s,closeConfirmDeleteModal:o})=>{const r=(0,l.useRef)(),n=(0,l.useRef)(),c=(0,l.useCallback)(e=>{e.target===r.current||e.target===n.current||"Enter"!==e.key||n.current.click()},[]);return(0,a.jsx)(i.Modal,{size:"medium",icon:(0,a.jsx)(i.Icon,{icon:w,size:"36",style:{display:"flex",marginRight:"1rem"}}),title:e,isDismissible:!1,onKeyDown:c,onRequestClose:o,children:(0,a.jsxs)(i.__experimentalVStack,{spacing:8,children:[(0,a.jsxs)("span",{children:[(0,t._n)("Do you really want to delete this table?","Do you really want to delete these tables?",1,"tablepress"),(0,a.jsx)("br",{}),(0,t.__)("Deleting a table is permanent and can not be undone!","tablepress")]}),(0,a.jsxs)(i.__experimentalHStack,{alignment:"right",children:[(0,a.jsx)(i.Button,{ref:r,variant:"tertiary",text:(0,t.__)("Cancel","tablepress"),onClick:o}),(0,a.jsx)(i.Button,{ref:n,variant:"primary",isDestructive:!0,href:s,text:(0,t.__)("Delete","tablepress"),onClick:o})]})]})})},M=()=>{const[e,t]=(0,l.useState)({previewIsOpen:!1,previewUrl:"",previewTitle:"",shortcode:"",shortcodeModalIsOpen:!1}),s=e=>{t(t=>({...t,...e}))};return(0,l.useEffect)(()=>{const e=e=>{if(e.target)return e.target.matches(".table-preview a")&&!(e.ctrlKey||e.metaKey||e.shiftKey)?(s({previewIsOpen:!0,previewUrl:e.target.href,previewTitle:e.target.title}),void e.preventDefault()):e.target.matches(".shortcode a")?(s({shortcode:e.target.title,shortcodeModalIsOpen:!0}),void e.preventDefault()):e.target.matches(".delete a")?(s({confirmDeleteUrl:e.target.href,confirmDeleteTitle:e.target.title,confirmDeleteModalIsOpen:!0}),void e.preventDefault()):void 0};return document.querySelector(".tablepress-all-tables").addEventListener("click",e),()=>{document.querySelector(".tablepress-all-tables").removeEventListener("click",e)}},[]),(0,a.jsxs)(a.Fragment,{children:[e.previewIsOpen&&(0,a.jsx)(f,{title:e.previewTitle,url:e.previewUrl,onRequestClose:()=>s({previewIsOpen:!1})}),e.shortcodeModalIsOpen&&(0,a.jsx)(b,{shortcode:e.shortcode,onRequestClose:()=>s({shortcodeModalIsOpen:!1})}),e.confirmDeleteModalIsOpen&&(0,a.jsx)(g,{title:e.confirmDeleteTitle,deleteUrl:e.confirmDeleteUrl,closeConfirmDeleteModal:()=>s({confirmDeleteModalIsOpen:!1})}),(0,a.jsx)(x,{})]})};document.querySelectorAll("#tablepress-page .ajax-link").forEach(e=>{e.addEventListener("click",e=>{fetch(`${ajaxurl}?${e.target.href.split("?")[1]}`).then(e=>e.text()).then(t=>{"1"===t&&"hide_message"===e.target.dataset.action&&e.target.closest(".notice").remove()}),e.preventDefault()})});const j=s("#doaction");var y;j&&j.addEventListener("click",e=>{window.bulkActionObserverIds.bulk_action="bulk-action-selector-top";const l=s("#bulk-action-selector-top").value,o=s(".tablepress-all-tables tbody input:checked").length;"delete"!==l||confirm((0,t._n)("Do you really want to delete this table?","Do you really want to delete these tables?",o,"tablepress"))||e.preventDefault()}),y=(0,a.jsx)(M,{}),n()(()=>{const e=document.getElementById("tablepress-list-screen");e&&(0,o.createRoot)(e).render(y)})})();
1 +(()=>{"use strict";const e={n:t=>{const s=t&&t.__esModule?()=>t.default:()=>t;return e.d(s,{a:s}),s},d:(t,s)=>{for(var o in s)e.o(s,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:s[o]})},o:(e,t)=>Object.hasOwn(e,t)},t=window.wp.i18n,s=e=>"#"===e[0]?document.getElementById(e.slice(1)):document.querySelectorAll(e),o=window.React,r=window.ReactDOM,l=window.wp.domReady;var n=e.n(l);window.wp.hooks;const i=window.ReactJSXRuntime,a=window.wp.components,c=window.wp.compose,d=window.wp.data,h=window.wp.primitives;var p=(0,i.jsx)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,i.jsx)(h.Path,{d:"M9.5 6.25H6.5C5.80964 6.25 5.25 6.80964 5.25 7.5V17.5C5.25 18.1904 5.80964 18.75 6.5 18.75H16.5C17.1904 18.75 17.75 18.1904 17.75 17.5V14.5M11.5 12.5L18.75 5.25M12.5 5.25H18.75V11.5",vectorEffect:"non-scaling-stroke"})}),v=(0,i.jsxs)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,i.jsx)(h.Rect,{x:"4.75",y:"4.75",width:"11.5",height:"11.5",rx:"0.875",vectorEffect:"non-scaling-stroke"}),(0,i.jsx)(h.Path,{d:"M19.25 8.281V17.281C19.25 18.3692 18.3546 19.25 17.251 19.25H6.25",vectorEffect:"non-scaling-stroke"})]});const u=window.wp.notices,w=(0,i.jsxs)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"100",height:"100",viewBox:"-50 -50 100 100",fill:"#fff",children:[(0,i.jsx)(h.Circle,{r:"42",fill:"#16a34a"}),(0,i.jsx)(h.Path,{d:"M0-25.854h-25.854v51.708h51.708V0H21v21h-42v-42H0Z"}),(0,i.jsx)(h.Path,{d:"M-18-18h10v10h-10zM-18-5h10V5h-10zM-5-5H5V5H-5zM-18 8h10v10h-10zM-5 8H5v10H-5zM8 8h10v10H8zM5-31h6.18v6.18H5zM19-25h6.18v6.18H19zM0-15h3.82v3.82H0zM10-20h3.82v3.82H10zM25-12h3.82v3.82H25zM8-13h10v10H8z"})]}),x=(0,i.jsxs)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"-32 -32 64 64",fill:"#fff",children:[(0,i.jsx)(h.Path,{d:"M0-25.854h-25.854v51.708h51.708V0H21v21h-42v-42H0Z"}),(0,i.jsx)(h.Path,{d:"M-18-18h10v10h-10zM-18-5h10V5h-10zM-5-5H5V5H-5zM-18 8h10v10h-10zM-5 8H5v10H-5zM8 8h10v10H8zM5-31h6.18v6.18H5zM19-25h6.18v6.18H19zM0-15h3.82v3.82H0zM10-20h3.82v3.82H10zM25-12h3.82v3.82H25zM8-13h10v10H8z"})]}),f=()=>{const{removeNotice:e}=(0,d.useDispatch)(u.store),t=(0,d.useSelect)(e=>e(u.store).getNotices(),[]).filter(({type:e})=>"snackbar"===e);return 0===t.length?null:(0,i.jsx)(a.SnackbarList,{notices:t,onRemove:e})},m=({title:e,url:s,onRequestClose:o})=>(0,i.jsx)(a.Modal,{icon:(0,i.jsx)(a.Icon,{icon:w,size:"36",style:{display:"flex",marginRight:"1rem"}}),title:e,className:"table-preview-modal",onRequestClose:o,size:"fill",headerActions:(0,i.jsx)(a.Button,{icon:p,size:"compact",label:(0,t.__)("Open the preview in a new tab","tablepress"),href:s,target:"_blank"}),children:(0,i.jsx)("iframe",{title:e,src:s})}),b=({shortcode:e,onRequestClose:s})=>{const{createSuccessNotice:o}=(0,d.useDispatch)(u.store),r=(0,c.useCopyToClipboard)(e,()=>{s(),o((0,t.__)("Copied Shortcode to clipboard.","tablepress"),{type:"snackbar",icon:(0,i.jsx)(a.Icon,{icon:x})})});return(0,i.jsx)(a.Modal,{icon:(0,i.jsx)(a.Icon,{icon:w,size:"36",style:{display:"flex",marginRight:"1rem"}}),title:(0,t.__)("Table Shortcode","tablepress"),onRequestClose:s,children:(0,i.jsxs)(a.__experimentalVStack,{children:[(0,i.jsx)("span",{children:(0,t.__)("To embed this table into a post or page, use this Shortcode:","tablepress")}),(0,i.jsx)(a.__experimentalInputControl,{__next40pxDefaultSize:!0,type:"text",id:"table-information-shortcode",value:e,onFocus:e=>e.target.select(),readOnly:!0,suffix:(0,i.jsx)(a.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,i.jsx)(a.Button,{icon:v,ref:r,size:"small",label:(0,t.__)("Copy Shortcode to clipboard","tablepress")})})})]})})},g=({title:e,deleteUrl:s,closeConfirmDeleteModal:r})=>{const l=(0,o.useRef)(),n=(0,o.useRef)(),c=(0,o.useCallback)(e=>{e.target===l.current||e.target===n.current||"Enter"!==e.key||n.current.click()},[]);return(0,i.jsx)(a.Modal,{size:"medium",icon:(0,i.jsx)(a.Icon,{icon:w,size:"36",style:{display:"flex",marginRight:"1rem"}}),title:e,isDismissible:!1,onKeyDown:c,onRequestClose:r,children:(0,i.jsxs)(a.__experimentalVStack,{spacing:8,children:[(0,i.jsxs)("span",{children:[(0,t._n)("Do you really want to delete this table?","Do you really want to delete these tables?",1,"tablepress"),(0,i.jsx)("br",{}),(0,t.__)("Deleting a table is permanent and can not be undone!","tablepress")]}),(0,i.jsxs)(a.__experimentalHStack,{alignment:"right",children:[(0,i.jsx)(a.Button,{ref:l,variant:"tertiary",text:(0,t.__)("Cancel","tablepress"),onClick:r}),(0,i.jsx)(a.Button,{ref:n,variant:"primary",isDestructive:!0,href:s,text:(0,t.__)("Delete","tablepress"),onClick:r})]})]})})},M=()=>{const[e,t]=(0,o.useState)({previewIsOpen:!1,previewUrl:"",previewTitle:"",shortcode:"",shortcodeModalIsOpen:!1}),s=e=>{t(t=>({...t,...e}))};return(0,o.useEffect)(()=>{const e=e=>{if(e.target)return e.target.matches(".table-preview a")&&!(e.ctrlKey||e.metaKey||e.shiftKey)?(s({previewIsOpen:!0,previewUrl:e.target.href,previewTitle:e.target.title}),void e.preventDefault()):e.target.matches(".shortcode a")?(s({shortcode:e.target.title,shortcodeModalIsOpen:!0}),void e.preventDefault()):e.target.matches(".delete a")?(s({confirmDeleteUrl:e.target.href,confirmDeleteTitle:e.target.title,confirmDeleteModalIsOpen:!0}),void e.preventDefault()):void 0};return document.querySelector(".tablepress-all-tables").addEventListener("click",e),()=>{document.querySelector(".tablepress-all-tables").removeEventListener("click",e)}},[]),(0,i.jsxs)(i.Fragment,{children:[e.previewIsOpen&&(0,i.jsx)(m,{title:e.previewTitle,url:e.previewUrl,onRequestClose:()=>s({previewIsOpen:!1})}),e.shortcodeModalIsOpen&&(0,i.jsx)(b,{shortcode:e.shortcode,onRequestClose:()=>s({shortcodeModalIsOpen:!1})}),e.confirmDeleteModalIsOpen&&(0,i.jsx)(g,{title:e.confirmDeleteTitle,deleteUrl:e.confirmDeleteUrl,closeConfirmDeleteModal:()=>s({confirmDeleteModalIsOpen:!1})}),(0,i.jsx)(f,{})]})};document.querySelectorAll("#tablepress-page .ajax-link").forEach(e=>{e.addEventListener("click",e=>{fetch(`${ajaxurl}?${e.target.href.split("?")[1]}`).then(e=>e.text()).then(t=>{"1"===t&&"hide_message"===e.target.dataset.action&&e.target.closest(".notice").remove()}),e.preventDefault()})});const j=s("#doaction");var y;j&&j.addEventListener("click",e=>{window.bulkActionObserverIds.bulk_action="bulk-action-selector-top";const o=s("#bulk-action-selector-top").value,r=s(".tablepress-all-tables tbody input:checked").length;"delete"!==o||confirm((0,t._n)("Do you really want to delete this table?","Do you really want to delete these tables?",r,"tablepress"))||e.preventDefault()}),y=(0,i.jsx)(M,{}),n()(()=>{const e=document.getElementById("tablepress-list-screen");e&&(0,r.createRoot)(e).render(y)})})();