create-prisma-php-app 1.15.0 → 1.15.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";var eventAttributes=["onclick","ondblclick","onmousedown","onmouseup","onmouseover","onmousemove","onmouseout","onwheel","onkeypress","onkeydown","onkeyup","onfocus","onblur","onchange","oninput","onselect","onsubmit","onreset","onresize","onscroll","onload","onunload","onabort","onerror","onbeforeunload","oncopy","oncut","onpaste","ondrag","ondragstart","ondragend","ondragover","ondragenter","ondragleave","ondrop","oncontextmenu","ontouchstart","ontouchmove","ontouchend","ontouchcancel","onpointerdown","onpointerup","onpointermove","onpointerover","onpointerout","onpointerenter","onpointerleave","onpointercancel"];function attachWireFunctionEvents(){document.querySelectorAll("button, input, select, textarea, a, form, label, div, span").forEach((t=>{t instanceof HTMLAnchorElement&&t.addEventListener("click",handleAnchorTag),eventAttributes.forEach((e=>{const n=t.getAttribute(e),o=e.slice(2);n&&(t.removeAttribute(e),handleDebounce(t,o,n))}))}))}function handleDebounce(t,e,n){const o=t.getAttribute("pp-debounce");if(o){const a=debounce((()=>{invokeHandler(t,n)}),parseInt(o,10));t.addEventListener(e,a)}else t.addEventListener(e,(e=>{e.preventDefault(),invokeHandler(t,n)}))}function invokeHandler(t,e){const{funcName:n,data:o}=parseCallback(t,e);if(n){const t=window[n];if("function"==typeof t)try{t(...o)}catch(t){}else handleUndefinedFunction(n,o)}}async function handleAnchorTag(t){const e=t.currentTarget,n=e.getAttribute("href"),o=e.getAttribute("target");if(!n||"_blank"===o||t.metaKey||t.ctrlKey)return;t.preventDefault();if(/^(https?:)?\/\//i.test(n)&&!n.startsWith(window.location.origin))window.location.href=n;else try{history.pushState(null,"",n),window.dispatchEvent(new PopStateEvent("popstate",{state:null}))}catch(t){}}document.addEventListener("DOMContentLoaded",attachWireFunctionEvents);const state={checkedElements:new Set};function updateDocumentContent(t){if(t.includes("<!DOCTYPE html>")){const e=(new DOMParser).parseFromString(t,"text/html");document.replaceChild(document.adoptNode(e.documentElement),document.documentElement),attachWireFunctionEvents()}else{saveState();const e=saveScrollPositions(),n=(new DOMParser).parseFromString(t,"text/html");updateElementContent(document.body,n.body),restoreState(),restoreScrollPositions(e),attachWireFunctionEvents()}}function saveState(){const t=document.activeElement;state.focusId=t?.id||t?.name,state.focusValue=t?.value,state.focusSelectionStart=t?.selectionStart,state.focusSelectionEnd=t?.selectionEnd,state.checkedElements.clear(),document.querySelectorAll('input[type="checkbox"]:checked').forEach((t=>{state.checkedElements.add(t.id||t.name)}))}function restoreState(){if(state.focusId){const t=document.getElementById(state.focusId)||document.querySelector(`[name="${state.focusId}"]`);t instanceof HTMLInputElement&&(t.focus(),"search"===t.type&&(t.value=state.focusValue||""),void 0!==state.focusSelectionStart&&null!==state.focusSelectionEnd&&t.setSelectionRange(state.focusSelectionStart||null,state.focusSelectionEnd||null))}state.checkedElements.forEach((t=>{const e=document.getElementById(t);e&&(e.checked=!0)}))}function saveScrollPositions(){const t={};return document.querySelectorAll("*").forEach((e=>{(e.scrollTop||e.scrollLeft)&&(t[getElementKey(e)]={scrollTop:e.scrollTop,scrollLeft:e.scrollLeft})})),t}function restoreScrollPositions(t){document.querySelectorAll("*").forEach((e=>{const n=getElementKey(e);t[n]&&(e.scrollTop=t[n].scrollTop,e.scrollLeft=t[n].scrollLeft)}))}function getElementKey(t){return t.id||t.className||t.tagName}function updateElementContent(t,e){t.innerHTML!==e.innerHTML&&(t.innerHTML=e.innerHTML),Array.from(e.attributes).forEach((e=>{t.getAttribute(e.name)!==e.value&&t.setAttribute(e.name,e.value)})),Array.from(t.attributes).forEach((n=>{e.hasAttribute(n.name)||t.removeAttribute(n.name)}))}function parseCallback(t,e){let n={};if(t instanceof HTMLFormElement){const e=new FormData(t);n=Object.fromEntries(e.entries())}else t instanceof HTMLInputElement&&(t.name?"checkbox"===t.type||"radio"===t.type?n[t.name]=t.checked:n[t.name]=t.value:"checkbox"===t.type||"radio"===t.type?n.value=t.checked:n.value=t.value);const o=e.match(/(\w+)\(([^)]*)\)/);if(o){const t=o[1];let e=[];return o[2]&&(e=o[2].split(/,(?=(?:[^'"]*['"][^'"]*['"])*[^'"]*$)/).map((t=>t.trim())),e=e.map((t=>{try{const e=t.replace(/'/g,'"');return JSON.parse(e)}catch{return t}}))),e.forEach((t=>{n="object"==typeof t&&null!==t?{...n,...t}:{...n,args:e}})),{funcName:t,data:n}}return{funcName:e,data:n}}async function handleUndefinedFunction(t,e){const n={callback:t,...e},o={method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest",HTTP_PPHP_WIRE_REQUEST:"true"},body:JSON.stringify(n)},a={method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest",HTTP_PPHP_WIRE_REQUEST:"true"},body:JSON.stringify({secondRequest:!0})},s=async t=>{const e=await fetch(window.location.pathname,t);return await e.text()};try{const t=await s(o),e=await s(a);updateDocumentContent(t+e)}catch(t){}}function debounce(t,e=300,n=!1){let o;return function(...a){const s=this;o&&clearTimeout(o),o=setTimeout((()=>{o=null,n||t.apply(s,a)}),e),n&&!o&&t.apply(s,a)}}function copyCode(t,e,n,o,a=2e3){const s=t.closest(`.${e}`)?.querySelector("pre code"),c=s?.textContent?.trim()||"";c?navigator.clipboard.writeText(c).then((()=>{const e=t.querySelector("i");e&&(e.className=o),setTimeout((()=>{e&&(e.className=n)}),a)}),(()=>{alert("Failed to copy command to clipboard")})):alert("Failed to find the code block to copy")}window.addEventListener("popstate",(async()=>{try{const t=await fetch(window.location.href,{headers:{"X-Requested-With":"XMLHttpRequest"}});updateDocumentContent(await t.text())}catch(t){}}));let api=null;if(void 0===api){class t{static instance=null;baseURL;constructor(t=window.location.origin){this.baseURL=t}static getInstance(e=window.location.origin){return t.instance||(t.instance=new t(e)),t.instance}async request(t,e,n=null,o={}){let a=`${this.baseURL}${e}`;const s={method:t,headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest",...o}};if(n)if("GET"===t){a+=`?${new URLSearchParams(n).toString()}`}else"HEAD"!==t&&"OPTIONS"!==t&&(s.body=JSON.stringify(n));try{const e=await fetch(a,s);if("HEAD"===t)return e.headers;const n=e.headers.get("content-type");return n&&n.includes("application/json")?await e.json():await e.text()}catch(t){throw t}}get(t,e,n){return this.request("GET",t,e,n)}post(t,e,n){return this.request("POST",t,e,n)}put(t,e,n){return this.request("PUT",t,e,n)}delete(t,e,n){return this.request("DELETE",t,e,n)}patch(t,e,n){return this.request("PATCH",t,e,n)}head(t,e){return this.request("HEAD",t,null,e)}options(t,e){return this.request("OPTIONS",t,null,e)}}api=t.getInstance()}let store=null;if(void 0===store){class t{static instance=null;state;listeners;constructor(t={}){this.state=t,this.listeners=[]}static getInstance(e={}){return t.instance||(t.instance=new t(e),t.instance.loadState()),t.instance}setState(t,e=!1){this.state={...this.state,...t},this.listeners.forEach((t=>t(this.state))),e&&this.saveState()}subscribe(t){return this.listeners.push(t),t(this.state),()=>{this.listeners=this.listeners.filter((e=>e!==t))}}saveState(){localStorage.setItem("appState",JSON.stringify(this.state))}loadState(){const t=localStorage.getItem("appState");t&&(this.state=JSON.parse(t),this.listeners.forEach((t=>t(this.state))))}resetState(t=!1){this.state={},this.listeners.forEach((t=>t(this.state))),t&&localStorage.removeItem("appState")}}store=t.getInstance()}
1
+ "use strict";var eventAttributes=["onclick","ondblclick","onmousedown","onmouseup","onmouseover","onmousemove","onmouseout","onwheel","onkeypress","onkeydown","onkeyup","onfocus","onblur","onchange","oninput","onselect","onsubmit","onreset","onresize","onscroll","onload","onunload","onabort","onerror","onbeforeunload","oncopy","oncut","onpaste","ondrag","ondragstart","ondragend","ondragover","ondragenter","ondragleave","ondrop","oncontextmenu","ontouchstart","ontouchmove","ontouchend","ontouchcancel","onpointerdown","onpointerup","onpointermove","onpointerover","onpointerout","onpointerenter","onpointerleave","onpointercancel"];function attachWireFunctionEvents(){document.querySelectorAll("button, input, select, textarea, a, form, label, div, span").forEach((t=>{t instanceof HTMLAnchorElement&&t.addEventListener("click",handleAnchorTag),eventAttributes.forEach((e=>{const n=t.getAttribute(e),o=e.slice(2);n&&(t.removeAttribute(e),handleDebounce(t,o,n))}))}))}async function handleDebounce(t,e,n){const o=t.getAttribute("pp-debounce"),a=t.getAttribute("pp-trigger"),s=async e=>{e.preventDefault(),a&&await invokeHandler(t,a),invokeHandler(t,n)};if(o){const n=debounce(s,parseInt(o,10));t.addEventListener(e,n)}else t.addEventListener(e,s)}async function invokeHandler(t,e){const{funcName:n,data:o}=parseCallback(t,e);if(n){const t=window[n];if("function"==typeof t)try{const e=Array.isArray(o)?o:[];await t(...e)}catch(t){}else await handleUndefinedFunction(n,o)}}async function handleAnchorTag(t){const e=t.currentTarget,n=e.getAttribute("href"),o=e.getAttribute("target");if(!n||"_blank"===o||t.metaKey||t.ctrlKey)return;t.preventDefault();if(/^(https?:)?\/\//i.test(n)&&!n.startsWith(window.location.origin))window.location.href=n;else try{history.pushState(null,"",n),window.dispatchEvent(new PopStateEvent("popstate",{state:null}))}catch(t){}}document.addEventListener("DOMContentLoaded",attachWireFunctionEvents);const state={checkedElements:new Set};function updateDocumentContent(t){if(t.includes("<!DOCTYPE html>")){const e=(new DOMParser).parseFromString(t,"text/html");document.replaceChild(document.adoptNode(e.documentElement),document.documentElement)}else{saveState();const e=saveScrollPositions(),n=(new DOMParser).parseFromString(t,"text/html"),o=Array.from(n.body.querySelectorAll("script")),a=n.body;diffAndPatch(document.body,a),restoreState(),restoreScrollPositions(e),o.forEach((t=>{if(t.src)loadScript(t.src);else{const e=document.createElement("script");e.textContent=t.textContent,document.body.appendChild(e),document.body.removeChild(e)}}))}attachWireFunctionEvents()}function diffAndPatch(t,e){t.nodeType===e.nodeType?t.nodeType!==Node.TEXT_NODE||e.nodeType!==Node.TEXT_NODE?t instanceof HTMLElement&&e instanceof HTMLElement&&t.replaceWith(e):t.textContent!==e.textContent&&(t.textContent=e.textContent):t.parentNode?.replaceChild(e,t)}function updateAttributes(t,e){Array.from(e.attributes).forEach((e=>{t.getAttribute(e.name)!==e.value&&t.setAttribute(e.name,e.value)})),Array.from(t.attributes).forEach((n=>{e.hasAttribute(n.name)||t.removeAttribute(n.name)}))}function updateChildren(t,e){const n=t.childNodes,o=e.childNodes,a=Math.max(n.length,o.length);for(let e=0;e<a;e++){const a=n[e],s=o[e];a?s?diffAndPatch(a,s):t.removeChild(a):t.appendChild(s)}}function loadScript(t){const e=document.createElement("script");e.src=t,document.head.appendChild(e)}function saveState(){const t=document.activeElement;state.focusId=t?.id||t?.name,state.focusValue=t?.value,state.focusSelectionStart=t?.selectionStart,state.focusSelectionEnd=t?.selectionEnd,state.checkedElements.clear(),document.querySelectorAll('input[type="checkbox"]:checked').forEach((t=>{state.checkedElements.add(t.id||t.name)}))}function restoreState(){if(state.focusId){const t=document.getElementById(state.focusId)||document.querySelector(`[name="${state.focusId}"]`);t instanceof HTMLInputElement&&(t.focus(),"search"===t.type&&(t.value=state.focusValue||""),void 0!==state.focusSelectionStart&&null!==state.focusSelectionEnd&&t.setSelectionRange(state.focusSelectionStart||null,state.focusSelectionEnd||null))}state.checkedElements.forEach((t=>{const e=document.getElementById(t);e&&(e.checked=!0)}))}function saveScrollPositions(){const t={};return document.querySelectorAll("*").forEach((e=>{(e.scrollTop||e.scrollLeft)&&(t[getElementKey(e)]={scrollTop:e.scrollTop,scrollLeft:e.scrollLeft})})),t}function restoreScrollPositions(t){document.querySelectorAll("*").forEach((e=>{const n=getElementKey(e);t[n]&&(e.scrollTop=t[n].scrollTop,e.scrollLeft=t[n].scrollLeft)}))}function getElementKey(t){return t.id||t.className||t.tagName}function parseCallback(t,e){let n={};if(t instanceof HTMLFormElement){const e=new FormData(t);n=Object.fromEntries(e.entries())}else t instanceof HTMLInputElement&&(t.name?"checkbox"===t.type||"radio"===t.type?n[t.name]=t.checked:n[t.name]=t.value:"checkbox"===t.type||"radio"===t.type?n.value=t.checked:n.value=t.value);const o=e.match(/(\w+)\((.*)\)/);if(o){const t=o[1];let e=o[2].trim();if(e.startsWith("{")&&e.endsWith("}")){const t=e.replace(/'/g,'"');try{const e=JSON.parse(t);"object"==typeof e&&null!==e&&(n={...n,...e})}catch(t){}}else{const t=e.split(/,(?=(?:[^'"]*['"][^'"]*['"])*[^'"]*$)/).map((t=>t.trim().replace(/^['"]|['"]$/g,"")));n.args=t}return{funcName:t,data:n}}return{funcName:e,data:n}}async function handleUndefinedFunction(t,e){const n={callback:t,...e},o={method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest",HTTP_PPHP_WIRE_REQUEST:"true"},body:JSON.stringify(n)},a={method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest",HTTP_PPHP_WIRE_REQUEST:"true"},body:JSON.stringify({secondRequest:!0})},s=async t=>{const e=await fetch(window.location.pathname,t);return await e.text()};try{const t=await s(o),e=await s(a);updateDocumentContent(t+e)}catch(t){}}function debounce(t,e=300,n=!1){let o;return function(...a){const s=this;o&&clearTimeout(o),o=setTimeout((()=>{o=null,n||t.apply(s,a)}),e),n&&!o&&t.apply(s,a)}}function copyCode(t,e,n,o,a=2e3){const s=t.closest(`.${e}`)?.querySelector("pre code"),c=s?.textContent?.trim()||"";c?navigator.clipboard.writeText(c).then((()=>{const e=t.querySelector("i");e&&(e.className=o),setTimeout((()=>{e&&(e.className=n)}),a)}),(()=>{alert("Failed to copy command to clipboard")})):alert("Failed to find the code block to copy")}window.addEventListener("popstate",(async()=>{try{const t=await fetch(window.location.href,{headers:{"X-Requested-With":"XMLHttpRequest"}});updateDocumentContent(await t.text())}catch(t){}}));let api=null;if(void 0===api){class t{static instance=null;baseURL;constructor(t=window.location.origin){this.baseURL=t}static getInstance(e=window.location.origin){return t.instance||(t.instance=new t(e)),t.instance}async request(t,e,n=null,o={}){let a=`${this.baseURL}${e}`;const s={method:t,headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest",...o}};if(n)if("GET"===t){a+=`?${new URLSearchParams(n).toString()}`}else"HEAD"!==t&&"OPTIONS"!==t&&(s.body=JSON.stringify(n));try{const e=await fetch(a,s);if("HEAD"===t)return e.headers;const n=e.headers.get("content-type");return n&&n.includes("application/json")?await e.json():await e.text()}catch(t){throw t}}get(t,e,n){return this.request("GET",t,e,n)}post(t,e,n){return this.request("POST",t,e,n)}put(t,e,n){return this.request("PUT",t,e,n)}delete(t,e,n){return this.request("DELETE",t,e,n)}patch(t,e,n){return this.request("PATCH",t,e,n)}head(t,e){return this.request("HEAD",t,null,e)}options(t,e){return this.request("OPTIONS",t,null,e)}}api=t.getInstance()}let store=null;if(void 0===store){class t{static instance=null;state;listeners;constructor(t={}){this.state=t,this.listeners=[]}static getInstance(e={}){return t.instance||(t.instance=new t(e),t.instance.loadState()),t.instance}setState(t,e=!1){this.state={...this.state,...t},this.listeners.forEach((t=>t(this.state))),e&&this.saveState()}subscribe(t){return this.listeners.push(t),t(this.state),()=>{this.listeners=this.listeners.filter((e=>e!==t))}}saveState(){localStorage.setItem("appState",JSON.stringify(this.state))}loadState(){const t=localStorage.getItem("appState");t&&(this.state=JSON.parse(t),this.listeners.forEach((t=>t(this.state))))}resetState(t=!1){this.state={},this.listeners.forEach((t=>t(this.state))),t&&localStorage.removeItem("appState")}}store=t.getInstance()}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-prisma-php-app",
3
- "version": "1.15.0",
3
+ "version": "1.15.2",
4
4
  "description": "Prisma-PHP: A Revolutionary Library Bridging PHP with Prisma ORM",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",