PluginProbe
WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards / 5.5.84
WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards v5.5.84
5.5.84 5.5.83 5.5.82 5.5.81 5.5.80 5.5.79 5.5.77 5.5.76 5.5.75 5.5.73 5.5.72 5.5.22 5.5.23 5.5.29 5.5.3 5.5.31 5.5.32 5.5.34 5.5.35 5.5.36 5.5.37 5.5.4 5.5.40 5.5.41 5.5.42 All 160 releases
wp-data-access / assets / gtb / index.js

index.js in WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards 5.5.84, at assets/gtb/index.js

1 lines 5.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 (()=>{"use strict";var e={452(e,a,t){const s=window.wp.i18n,l=window.wp.blockEditor,p=window.wp.components,n=window.wp.blocks,o=window.wp.apiFetch;var r=t.n(o);const i=window.wp.element,d=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"wpda/wp-data-access-app","version":"1.0.0","title":"WP Data Access App","category":"widgets","icon":"database","description":"Add an app to this page.","textdomain":"wp-data-access-app","attributes":{"appid":{"type":"string","default":""},"feedback":{"type":"boolean","default":false},"builders":{"type":"boolean","default":false},"hidetitlebar":{"type":"boolean","default":false},"fullscreen":{"type":"boolean","default":false}},"editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css"}'),c=window.ReactJSXRuntime;(0,n.registerBlockType)(d.name,{...d,edit:({attributes:e,setAttributes:a})=>{const{appid:t,feedback:n,builders:o,hidetitlebar:d,fullscreen:u}=e,[h,b]=(0,i.useState)([{label:(0,s.__)("Loading...","wp-data-access-app"),value:""}]),[f,w]=(0,i.useState)(!0);(0,i.useEffect)(()=>{r()({path:"/wpda/app/list",method:"POST"}).then(e=>{const a=Array.isArray(e?.data)?e.data.map(e=>({label:`${e.app_name} (App ID: ${e.app_id})`,value:String(e.app_id)})):[];b([{label:(0,s.__)("Select an app","wp-data-access-app"),value:""},...a])}).catch(()=>{b([{label:(0,s.__)("Could not load apps","wp-data-access-app"),value:""}])}).finally(()=>{w(!1)})},[]);const g=t?`[wpda_app app_id="${t}"${n?' feedback="true"':""}${o?' builders="false"':""}${d?' hidetitlebar="true"':""}${u?' fullscreen="true"':""}]`:"",_=(0,l.useBlockProps)({className:"wpda-wp-data-access-app"});return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(l.InspectorControls,{children:(0,c.jsxs)(p.PanelBody,{title:(0,s.__)("App Settings","wp-data-access-app"),children:[(0,c.jsx)(p.SelectControl,{label:(0,s.__)("App Name (Id)","wp-data-access-app"),value:t,options:h,onChange:e=>a({appid:e}),disabled:f}),(0,c.jsx)(p.ToggleControl,{label:(0,s.__)("Enable Feedback","wp-data-access-app"),checked:n,onChange:e=>a({feedback:e}),help:(0,s.__)("Authorization and usage errors are hidden by default to prevent displaying them to unauthorized users on front-end pages. Enable feedback to show these errors.","wp-data-access-app")}),(0,c.jsx)(p.ToggleControl,{label:(0,s.__)("Disable Builders","wp-data-access-app"),checked:o,onChange:e=>a({builders:e}),help:(0,s.__)("Builder access is automatically enabled on front-end pages for administrators, allowing them to modify app settings directly. Disabling builder access removes all builder icons.","wp-data-access-app")}),(0,c.jsx)(p.ToggleControl,{label:(0,s.__)("Hide Title Bar","wp-data-access-app"),checked:d,onChange:e=>a({hidetitlebar:e}),help:(0,s.__)("You can hide the title bar for data tables, data administration apps, maps, charts, and registration forms. For data apps, the title bar cannot be hidden, as this would also remove the app's navigation. This also removes all builder icons.","wp-data-access-app")}),(0,c.jsx)(p.ToggleControl,{label:(0,s.__)("Fullscreen","wp-data-access-app"),checked:u,onChange:e=>a({fullscreen:e}),help:(0,s.__)("Apps can be launched in full-screen mode (this feature is not available for maps).","wp-data-access-app")})]})}),(0,c.jsx)("div",{..._,children:(0,c.jsx)(p.Placeholder,{icon:(0,c.jsx)("span",{className:"dashicons dashicons-database","aria-hidden":"true"}),label:"WP Data Access App",children:f?(0,c.jsxs)("p",{className:"wpda-wp-data-access-app__message",children:[(0,c.jsx)(p.Spinner,{}),(0,s.__)("Loading apps...","wp-data-access-app")]}):(0,c.jsx)(p.TextareaControl,{value:g,readOnly:!0,rows:1,className:"wpda-wp-data-access-app__shortcode",placeholder:"No app configured. Use the 'App Settings' panel on the right to select an app and set optional parameters."})})})]})},save:()=>null})}};const a={};function t(s){const l=a[s];if(void 0!==l)return l.exports;const p=a[s]={exports:{}};return e[s](p,p.exports,t),p.exports}t.m=e,(()=>{const e=[];t.O=(a,s,l,p)=>{if(s){p=p||0;for(var n=e.length;n>0&&e[n-1][2]>p;n--)e[n]=e[n-1];return void(e[n]=[s,l,p])}let o=1/0;for(n=0;n<e.length;n++){let[s,l,p]=e[n],i=!0;for(var r=0;r<s.length;r++)(!1&p||o>=p)&&Object.keys(t.O).every(e=>t.O[e](s[r]))?s.splice(r--,1):(i=!1,p<o&&(o=p));if(i){e.splice(n--,1);const t=l();void 0!==t&&(a=t)}}return a}})(),t.n=e=>{const a=e&&e.__esModule?()=>e.default:()=>e;return t.d(a,{a}),a},t.d=(e,a)=>{if(Array.isArray(a))for(var s=0;s<a.length;){var l=a[s++],p=a[s++];t.o(e,l)?0===p&&s++:0===p?Object.defineProperty(e,l,{enumerable:!0,value:a[s++]}):Object.defineProperty(e,l,{enumerable:!0,get:p})}else for(var l in a)t.o(a,l)&&!t.o(e,l)&&Object.defineProperty(e,l,{enumerable:!0,get:a[l]})},t.o=(e,a)=>Object.hasOwn(e,a),(()=>{const e={57:0,350:0};t.O.j=a=>0===e[a];const a=(a,s)=>{let[l,p,n]=s;var o,r,i=0;if(l.some(a=>0!==e[a])){for(o in p)t.o(p,o)&&(t.m[o]=p[o]);if(n)var d=n(t)}for(a&&a(s);i<l.length;i++)r=l[i],t.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return t.O(d)},s=globalThis.webpackChunkwp_data_access_app||=[];s.forEach(a.bind(null,0)),s.push=a.bind(null,s.push.bind(s))})();let s=t.O(void 0,[350],()=>t(452));s=t.O(s)})();