v0.5.2
This commit is contained in:
commit
f2e6586969
134 files changed
+9705
No files matched your search
@@ -0,0 +1,39 @@
|
||||
# Integrating iriks-it/laravel-manager (guide for AI agents)
|
||||
|
||||
Goal: the manager runs in this Laravel app and `php artisan manager:doctor --json` says `"ok": true`. Do the steps in
|
||||
order and never edit files inside `vendor/`.
|
||||
|
||||
1. `composer require iriks-it/laravel-manager`
|
||||
(A version that is not on Packagist yet: first `composer config repositories.manager --json '{"type":"path","url":"/path/to/laravel-manager","options":{"symlink":false}}'`, then require `@dev`.)
|
||||
2. Pick the modules. `users` and `media` are on; `pages` and `posts` are on by default; `reviews`, `audit` and `statistics` are off
|
||||
(audit and statistics store visitor data: only switch them on when the owner says so).
|
||||
3. `php artisan manager:install --modules=users,media,posts --user-model="App\Models\User"`
|
||||
It writes the `MANAGER_*` switches to `.env` and publishes `config/manager.php`. Add `--path=admin` to move the URL.
|
||||
It does not run the check itself (this process still has the old config): that is step 7.
|
||||
4. Add the trait to the user model: `use \IriksIT\Manager\Concerns\HasManagerAccess;`. Never put `is_super_admin` in `$fillable`.
|
||||
5. `php artisan config:clear && php artisan migrate && php artisan storage:link` (a new process, so it sees the switches of step 3).
|
||||
6. Create the first super admin: `php artisan manager:create-user --name="..." --email="..." --password="<12+ chars>"`.
|
||||
7. `php artisan manager:doctor --json`. Every check must be `ok` or an understood `warn`; each `fail` and `warn` has a `fix`.
|
||||
Repeat until `"ok": true`.
|
||||
|
||||
Facts that matter:
|
||||
- A site that already has `manager.*` route names, `manager_*` tables or its own posts and pages: `manager:doctor` has a `names` check that says
|
||||
so. Set `route_name`, `table_prefix` or `tables` in `config/manager.php` before the first `migrate`, then copy what exists with
|
||||
`php artisan manager:import posts|pages|reviews --table=<table> --map=<package_column>=<column> --dry-run` (the source is only read).
|
||||
- What the site's own content looks like is configuration, not code: `manager.pages.definitions` (texts with keys, read with `Page::contentFor('slug')`),
|
||||
`manager.resources` (lists such as services or testimonials, in a model of the site or the package's table) and `manager.menu` (order, sections,
|
||||
icons, own links). A screen that needs code is a JavaScript module in `manager.extensions`; it registers with `IriksManager.register`.
|
||||
- Who may do what: the groups of the package, or the roles of the site (`manager.permissions`); more on the login: `manager.login.checks`, Turnstile
|
||||
with two env keys. The public pages count visits with `<x-manager::pulse />` when `statistics` is on.
|
||||
- The screens are part of the package (`MANAGER_UI=package`, the default): open `/manager` in a browser. The app does not need a
|
||||
login of its own: when it has no route named `login`, the manager's own login at `/manager/login` is used. With
|
||||
`MANAGER_UI=none` there are only the JSON routes.
|
||||
- A browser address gets the screens, a request with `Accept: application/json` gets the data. To call the JSON routes from a
|
||||
script: `GET /manager/login` once for the `XSRF-TOKEN` cookie, then `POST /manager/login` with header `X-XSRF-TOKEN` (the cookie
|
||||
value, URL-decoded), `Accept: application/json` and body `{"email": "...", "password": "..."}`; the answer is `{"redirect": "/manager"}`.
|
||||
- The look: `MANAGER_THEME=dark|light` or your own (`php artisan manager:make-theme acme --brand=#e4002b --name="Acme" --logo=/img/logo.svg`,
|
||||
then `MANAGER_THEME=acme`). Each account can pick its own in its profile (`MANAGER_USER_THEMES=false` stops that).
|
||||
- Anything that is off has no routes, tables or permissions. A module that needs another one fails at boot when that one is off.
|
||||
- Do not add site-specific code to the package: a site's own part is its own module class (`Contracts\Module`, extend
|
||||
`Modules\BaseModule`, add it to `manager.available`).
|
||||
- Behind a proxy set trusted proxies before switching `audit` on.
|
||||
@@ -0,0 +1,10 @@
|
||||
## iriks-it/laravel-manager
|
||||
|
||||
A modular backend (users, media, pages, posts, reviews, audit, statistics, resources, revisions) installed as a package.
|
||||
|
||||
- To integrate it, follow `vendor/iriks-it/laravel-manager/resources/ai/INTEGRATION.md` step by step.
|
||||
- Set it up with `php artisan manager:install --modules=... --user-model=...`, then `config:clear`, `migrate`, `storage:link`; verify in a new process with `php artisan manager:doctor --json` (non-zero exit on failure, every problem has a `fix`).
|
||||
- The screens come with the package (`MANAGER_UI`), including a login when the app has none; themes: `php artisan manager:make-theme`, `MANAGER_THEME`.
|
||||
- The user model needs the `HasManagerAccess` trait; `is_super_admin` is never mass assignable. The first super admin comes from `php artisan manager:create-user`.
|
||||
- The site's content is configuration: `manager.pages.definitions`, `manager.resources`, `manager.menu`, `manager.permissions`, `manager.login.checks`; code only as a JavaScript module in `manager.extensions`. Existing data comes in with `php artisan manager:import`.
|
||||
- Switch parts with `MANAGER_<MODULE>=true|false`; never edit `vendor/`. Site-specific parts are your own `Module` class.
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
|
||||
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:block))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}@layer theme{:root,:host{--font-sans:var(--m-font,ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif);--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-500:oklch(63.7% .237 25.331);--color-emerald-500:oklch(69.6% .17 162.48);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-xl:36rem;--container-2xl:42rem;--container-3xl:48rem;--container-5xl:64rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wide:.025em;--radius-sm:.25rem;--radius-lg:.5rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--m-font,ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-fiLine truncated
|
||||
/*$vite$:1*/
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
var e=Object.defineProperty,t=(t,n)=>{let r=Object.setPrototypeOf({},null);for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n&1||e(r,Symbol.toStringTag,{value:`Module`}),n&2?r:Object.preventExtensions(r)};function n(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var r={},i=[],a=()=>{},o=()=>!1,s=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),c=e=>e.startsWith(`onUpdate:`),l=Object.assign,u=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},d=Object.prototype.hasOwnProperty,f=(e,t)=>d.call(e,t),p=Array.isArray,m=e=>C(e)===`[object Map]`,h=e=>C(e)===`[object Set]`,g=e=>C(e)===`[object Date]`,_=e=>C(e)===`[object RegExp]`,v=e=>typeof e==`function`,y=e=>typeof e==`string`,b=e=>typeof e==`symbol`,x=e=>typeof e==`object`&&!!e,S=e=>(x(e)||v(e))&&v(e.then)&&v(e.catch),ee=Object.prototype.toString,C=e=>ee.call(e),te=e=>C(e).slice(8,-1),w=e=>C(e)===`[object Object]`,T=e=>y(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,ne=n(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),re=1e4,ie=e=>{let t=Object.create(null),n=0;return(r=>{let i=t[r];return i===void 0?(++n>re&&(t=Object.create(null),n=1),t[r]=e(r)):i})},ae=/-\w/g,E=ie(e=>e.replace(ae,e=>e.slice(1).toUpperCase())),oe=/\B([A-Z])/g,se=ie(e=>e.replace(oe,`-$1`).toLowerCase()),ce=ie(e=>e.charAt(0).toUpperCase()+e.slice(1)),le=ie(e=>e?`on${ce(e)}`:``),D=(e,t)=>!Object.is(e,t),ue=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},de=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},fe=e=>{let t=parseFloat(e);return isNaN(t)?e:t},pe=e=>{let t=y(e)?Number(e):NaN;return isNaN(t)?e:t},me,he=()=>me||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{},ge=n(`Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol`);function _e(e){if(p(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=y(r)?xe(r):_e(r);if(i)for(let e in i)t[e]=i[e]}return t}if(y(e)||x(e))return e}var ve=/;(?![^(]*\))/g,ye=/:([^]+)/,be=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function xe(e){let t={};return e.replace(be,e=>e.startsWith(`/*`)?``:e).split(ve).forEach(e=>{if(e){let n=e.split(ye);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function O(e){let t=``;if(y(e))t=e;else if(p(e))for(let n=0;n<e.length;n++){let r=O(e[n]);r&&(t+=r+` `)}else if(x(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}function Se(e){if(!e)return null;let{class:t,style:n}=e;return t&&!y(t)&&(e.class=O(t)),n&&(e.style=_e(n)),e}var Ce=`itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`,we=n(Ce);Ce+``;function Te(e){return!!e||e===``}function Ee(e,t,n){if(e.length!==t.length)return!1;let r=!0;for(let i=0;r&&i<e.length;i++)r=Ae(e[i],t[i],n);return r}function De(e,t,n){if(e.size!==t.size)return!1;let r=Array.from(t),i=new Uint8Array(r.length);for(let t of e){let e=-1;for(let a=0;a<r.length;a++)if(!i[a]&&Ae(t,r[a],n)){e=a;break}if(e<0)return!1;i[e]=1}return!0}function Oe(e,t,n){let r=m(e),i=m(t);if(r||i||(r=h(e),i=h(t),r||i))return r&&i?De(e,t,n):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e){let i=f(e,r),a=f(t,r);if(i&&!a||!i&&a||!Ae(e[r],t[r],n))return!1}return Me(e)===Me(t)}function ke(e,t,n,r){n||=[new Map,new Map];let[i,a]=n;if(i.has(e)||a.has(t))return i.get(e)===t&&a.get(t)===e;i.set(e,t),a.set(t,e);let o=r(e,t,n);return i.delete(e),a.delete(t),o}function Ae(e,t,n){if(e===t)return!0;let r=g(e),i=g(t);return r||i?r&&i?e.getTime()===t.getTime():!1:(r=b(e),i=b(t),r||i?e===t:(r=p(e),i=p(t),r||i?r&&i?ke(e,t,n,Ee):!1:(r=x(e),i=x(t),r||i?!r||!i?!1:ke(e,t,n,Oe):String(e)===String(t))))}function je(e,t){return e.findIndex(e=>Ae(e,t))}function Me(e){return Object.getPrototypeOf(e)===null&&e[Symbol.toPrimitive]==null&&typeof e.toString!=`function`&&typeof e.valueOf!=`function`?C(e):String(e)}var Ne=e=>!!(e&&e.__v_isRef===!0),k=e=>y(e)?e:e==null?``:p(e)||x(e)&&(e.toString===ee||!v(e.toString))?Ne(e)?k(e.value):JSON.stringify(e,Pe,2):String(e),Pe=(e,t)=>Ne(t)?Pe(e,t.value):m(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[Fe(t,r)+` =>`]=n,e),{})}:h(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Fe(e))}:b(t)?Fe(t):x(t)&&!p(t)&&!w(t)?String(t):t,Fe=(e,t=``)=>b(e)?`Symbol(${e.description??t})`:e;function Ie(e){return e==null?`initial`:typeof e==`string`?e===``?` `:e:String(e)}var Le,Re=class{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&Le&&(Le.active?(this.parent=Le,this.index=(Le.scopes||(Le.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return thLine truncated
|
||||
`&&(e.tagName===`PRE`||e.tagName===`TEXTAREA`)&&(n=n.slice(1));let{textContent:r}=e;r!==n&&r!==n.replace(/\r\n|\r/g,`
|
||||
`)&&(Ai(e,0)||bi(),e.textContent=t.children)}if(d){if(_||b||!o||f&48){let t=e.tagName.includes(`-`),i=e.namespaceURI.includes(`svg`)?`svg`:e.namespaceURI.includes(`MathML`)?`mathml`:void 0;for(let a in d)if(_&&(a.endsWith(`value`)||a===`indeterminate`)||s(a)&&!ne(a)||a[0]===`.`||t&&!ne(a)||u&&u.includes(a)){if(Di(e,a,d[a]))continue;r(e,a,null,d[a],i,n)}}else if(d.onClick)r(e,`onClick`,null,d.onClick,void 0,n);else if(f&4&&ln(d.style))for(let e in d.style)d.style[e]}let x;(x=d&&d.onVnodeBeforeMount)&&Rs(x,n,t),h&&wr(t,null,n,`beforeMount`),((x=d&&d.onVnodeMounted)||h||l)&&ms(()=>{x&&Rs(x,n,t),l&&g.enter(e),h&&wr(t,null,n,`mounted`)},i)}return e.nextSibling},m=(e,t,r,o,s,c,u,d)=>{u||=!!t.dynamicChildren;let p=t.children,m=p.length,h=t.type===B,g=!1;for(let t=0;t<m;t++){let _=u?p[t]:p[t]=Ps(p[t]),v=_.type===_s;h&&e&&wi(e)&&e.data===`]`&&(d=e),e&&e!==d?(v&&!u&&t+1<m&&Ps(p[t+1]).type===_s&&(l(i(e.data.slice(_.children.length)),r,a(e)),e.data=_.children),e=f(e,_,o,s,c,u)):v&&!_.children?l(_.el=i(``),r,d):(g||(g=!0,Ai(r,1)||bi()),n(null,_,r,d,o,s,Ci(r),c))}return e},h=(e,t,n,r,i,s)=>{let{slotScopeIds:c}=t;c&&(i=i?i.concat(c):c);let d=o(e),f=m(a(e),t,d,n,r,i,s);return f&&wi(f)&&f.data===`]`?a(t.anchor=f):(bi(),l(t.anchor=u(`]`),d,f),f)},g=(e,t,r,i,s,l)=>{if(Mi(e,t)||bi(),t.el=null,l){let t=_(e);for(;;){let n=a(e);if(n&&n!==t)c(n);else break}}let u=a(e),d=o(e);return c(e),n(null,t,d,u,r,i,Ci(d),s),r&&r.vnode.el===e&&(r.vnode.el=t.el,wo(r,t.el)),u},_=(e,t=`[`,n=`]`)=>{let r=0;for(;e;)if(e=a(e),e&&wi(e)&&(e.data===t&&r++,e.data===n)){if(r===0)return a(e);r--}return e},v=(e,t,n)=>{let r=t.parentNode;r&&r.replaceChild(e,t);let i=n;for(;i;)i.vnode.el===t&&(i.vnode.el=i.subTree.el=e),i=i.parent},y=e=>e.nodeType===1&&e.tagName===`TEMPLATE`;return[d,f]}var Ei=new Set([`src`,`srcset`,`href`,`poster`]);function Di(e,t,n){return Ei.has(t)?e.getAttribute(t)===(n==null?null:`${n}`):!1}var Oi=`data-allow-mismatch`,ki={0:`text`,1:`children`,2:`class`,3:`style`,4:`attribute`};function Ai(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(Oi);)e=e.parentElement;return ji(e&&e.getAttribute(Oi),t)}function ji(e,t){if(e==null)return!1;if(e===``)return!0;{let n=e.split(`,`);return t===0&&n.includes(`children`)?!0:n.includes(ki[t])}}function Mi(e,t){return Ai(e.parentElement,1)||Ni(e)||Pi(t)}function Ni(e){return e.nodeType===1&&ji(e.getAttribute(Oi),1)}function Pi({props:e}){let t=e&&e[Oi];return typeof t==`string`&&ji(t,1)}var Fi=he().requestIdleCallback||(e=>setTimeout(e,1)),Ii=he().cancelIdleCallback||(e=>clearTimeout(e)),Li=(e=1e4)=>t=>{let n=Fi(t,{timeout:e});return()=>Ii(n)};function Ri(e){let{top:t,left:n,bottom:r,right:i}=e.getBoundingClientRect(),{innerHeight:a,innerWidth:o}=window;return(t>0&&t<a||r>0&&r<a)&&(n>0&&n<o||i>0&&i<o)}var zi=e=>(t,n)=>{let r=new IntersectionObserver(e=>{for(let n of e)if(n.isIntersecting){r.disconnect(),t();break}},e),i=e=>{if(Ri(e))return t(),r.disconnect(),!1;if(getComputedStyle(e).display===`contents`){for(let t=0;t<e.children.length;t++)if(i(e.children[t])===!1)return!1}r.observe(e)};return n(e=>{if(e instanceof Element)return i(e)}),()=>r.disconnect()},Bi=e=>t=>{if(e){let n=matchMedia(e);if(n.matches)t();else return n.addEventListener(`change`,t,{once:!0}),()=>n.removeEventListener(`change`,t)}},Vi=(e=[])=>(t,n)=>{y(e)&&(e=[e]);let r=!1,i=e=>{r||(r=!0,a(),t(),e.target.dispatchEvent(new e.constructor(e.type,e)))},a=()=>{n(t=>{for(let n of e)t.removeEventListener(n,i)})};return n(t=>{for(let n of e)t.addEventListener(n,i,{once:!0})}),a};function Hi(e,t){if(wi(e)&&e.data===`[`){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(wi(r)){if(r.data===`]`){if(--n===0)break}else r.data===`[`&&n++}r=r.nextSibling}}else t(e)}var Ui=e=>!!e.type.__asyncLoader;function Wi(e){v(e)&&(e={loader:e});let{loader:t,loadingComponent:n,errorComponent:r,delay:i=200,hydrate:a,timeout:o,suspensible:s=!0,onError:c}=e,l=null,u,d=0,f=()=>(d++,l=null,p()),p=()=>{let e;return l||(e=l=t().catch(e=>{if(e=e instanceof Error?e:Error(String(e)),c)return new Promise((t,n)=>{c(e,()=>t(f()),()=>n(e),d+1)});throw e}).then(t=>e!==l&&l?l:(t&&(t.__esModule||t[Symbol.toStringTag]===`Module`)&&(t=t.default),u=t,t)))};return L({name:`AsyncComponentWrapper`,__asyncLoader:p,__asyncHydrate(e,t,n){let r=e.isConnected,i=!1;(t.bu||=[]).push(()=>i=!0);let o=()=>{i||!e.parentNode||r&&!e.isConnected||n()},s=a?()=>{let n=a(o,t=>Hi(e,t));n&&(t.bum||=[]).push(n)}:o;u?s():p().then(()=>!t.isUnmounted&&s())},get __asyncResolved(){return u},setup(){let e=Us;if(pi(e),u)return()=>Gi(u,e);let t=t=>{l=null,Yn(t,e,13,!r,!0)};if(s&&e.suspense||Xs)return p().then(t=>()=>Gi(t,e)).catch(e=>(t(e),()=>r?K(r,{error:e}):null));let a=N(!1),c=N(),d=N(!!i),f,m;return Ve(()=>{f!=null&&clearTimeout(f),m!=null&&clearTimeout(m)}),i&&(m=setTimeout(()=>{e.isUnmounted||(d.value=!1)},i)),o!=null&&(f=setTimeout(()=>{if(!e.isUnmounted&&!a.value&&!c.value){let e=Error(`Async component timed out after ${o}ms.`);t(e),c.value=e}},o)),p().then(()=>{e.isUnmounted|
Line truncated
|
||||
`))),e[cu]=au(i);let a=r||i.props&&i.props.type===`number`;xl(e,t?`change`:`input`,t=>{t.target.composing||e[cu](uu(e.value,n,a))}),(n||a)&&xl(e,`change`,()=>{e.value=uu(e.value,n,a)}),t||(xl(e,`compositionstart`,ou),xl(e,`compositionend`,su),xl(e,`change`,su))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[lu];delete e[lu],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[cu](uu(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[cu]=au(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?fe(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},du={deep:!0,created(e,t,n){e[cu]=au(n),xl(e,`change`,()=>{let t=e._modelValue,n=_u(e),r=e.checked,i=e[cu];if(p(t)){let e=je(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(h(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(vu(e,r))})},mounted:fu,beforeUpdate(e,t,n){e[cu]=au(n),fu(e,t,n)}};function fu(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(p(t))i=je(t,r.props.value)>-1;else if(h(t))i=t.has(r.props.value);else{if(t===n)return;i=Ae(t,vu(e,!0))}e.checked!==i&&(e.checked=i)}var pu={created(e,{value:t},n){e.checked=Ae(t,n.props.value),e[cu]=au(n),xl(e,`change`,()=>{e[cu](_u(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[cu]=au(r),t!==n&&(e.checked=Ae(t,r.props.value))}},mu={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,xl(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?fe(_u(e)):_u(e)),r=e.multiple,i=r?h(e._modelValue)?new Set(t):t:t[0],a=e._pendingValue=[r,r?p(i)?t.slice():t:i];try{e[cu](i)}finally{ir(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[cu]=au(r)},mounted(e,{value:t,modifiers:{number:n}}){gu(e,t,n)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[cu]=au(n)},updated(e,{value:t,modifiers:{number:n}}){let r=e._pendingValue;e._pendingValue=void 0,r&&r[0]===e.multiple&&hu(t,r[1],r[0])||gu(e,t,n)}};function hu(e,t,n){if(!n||p(e))return Ae(e,t);if(h(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function gu(e,t,n=!1){let r=e.multiple,i=p(t);if(!r||i||h(t)){for(let a=0,o=e.options.length;a<o;a++){let o=e.options[a],s=_u(o);if(r){if(i){let e=typeof s;o.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(s)):je(t,s)>-1}else o.selected=t.has(s)||n&&typeof s==`string`&&t.has(fe(s))}else if(Ae(_u(o),t)){e.selectedIndex!==a&&(e.selectedIndex=a);return}}!r&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function _u(e){return`_value`in e?e._value:e.value}function vu(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var yu={created(e,t,n){xu(e,t,n,null,`created`)},mounted(e,t,n){xu(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){xu(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){xu(e,t,n,r,`updated`)}};function bu(e,t){switch(e){case`SELECT`:return mu;case`TEXTAREA`:return Y;default:switch(t){case`checkbox`:return du;case`radio`:return pu;default:return Y}}}function xu(e,t,n,r,i){let a=bu(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function Su(){Y.getSSRProps=({value:e})=>({value:e}),pu.getSSRProps=({value:e},t)=>{if(t.props&&Ae(t.props.value,e))return{checked:!0}},du.getSSRProps=({value:e},t)=>{if(p(e)){if(t.props&&je(e,t.props.value)>-1)return{checked:!0}}else if(h(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},yu.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=bu(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var Cu=[`ctrl`,`shift`,`alt`,`meta`],wu={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>Cu.some(n=>e[`${n}Key`]&&!t.includes(n))},Tu=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=wu[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},Eu={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},Du=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`),i=n[r];if(i)return i;let a=t.some(e=>e===`left`||e===`right`);return n[r]=(n=>{if(!(`key`in n))return a?e(n):void 0;let r=se(n.key);if(t.some(e=>e===r||Eu[e]===r))return e(n)})},Ou=l({patchProp:Nl},kc),ku,Au=!1;function ju(){return ku||=Uo(Ou)}function Mu(){return ku=Au?ku:Wo(Ou),Au=!0,ku}var Nu=((...e)=>{ju().render(...e)}),Pu=((...e)=>{Mu().hydrate(...e)}),Fu=((...e)=>{let t=ju().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=Ru(e);if(!r)return;let i=t._component;v(i)||i.render||i.template||(i.template=r.innerHTML),r.nodeType===
Line truncated
|
||||
`,t.selectionStart-1)+1,o=t.selectionEnd,s=n.modelValue.slice(a,o).split(`
|
||||
`).map(t=>e+t).join(`
|
||||
`);r(`update:modelValue`,n.modelValue.slice(0,a)+s+n.modelValue.slice(o)),requestAnimationFrame(()=>t.focus())}function f(e,t){c.value=!1;let a=(t?.alt||t?.name||``).replace(/[[\]]/g,``),o=i.value,s=o.selectionStart,l=``;r(`update:modelValue`,n.modelValue.slice(0,s)+l+n.modelValue.slice(o.selectionEnd)),requestAnimationFrame(()=>{o.focus(),o.setSelectionRange(s+l.length,s+l.length)})}async function p(e){if(a.value=e,e===`preview`){s.value=!0;try{o.value=(await qu.post(`${X.base}/markdown`,{text:n.modelValue})).html}finally{s.value=!1}}}return(t,n)=>(H(),U(`div`,null,[G(`div`,{class:`mb-2 flex flex-wrap items-center gap-1`,role:`toolbar`,"aria-label":P(Z)(`Formatting`)},[G(`button`,{type:`button`,class:`m-btn m-btn-secondary !px-2 !py-1 font-bold`,disabled:a.value===`preview`,title:P(Z)(`Bold`),onClick:n[0]||=e=>u(`**`,`**`,P(Z)(`bold`))},`B`,8,Ld),G(`button`,{type:`button`,class:`m-btn m-btn-secondary !px-2 !py-1 italic`,disabled:a.value===`preview`,title:P(Z)(`Italic`),onClick:n[1]||=e=>u(`*`,`*`,P(Z)(`italic`))},`I`,8,Rd),G(`button`,{type:`button`,class:`m-btn m-btn-secondary !px-2 !py-1`,disabled:a.value===`preview`,title:P(Z)(`Heading`),onClick:n[2]||=e=>d(`## `)},`H`,8,zd),G(`button`,{type:`button`,class:`m-btn m-btn-secondary !px-2 !py-1`,disabled:a.value===`preview`,title:P(Z)(`List`),onClick:n[3]||=e=>d(`- `)},`•`,8,Bd),G(`button`,{type:`button`,class:`m-btn m-btn-secondary !px-2 !py-1`,disabled:a.value===`preview`,title:P(Z)(`Quote`),onClick:n[4]||=e=>d(`> `)},`”`,8,Vd),G(`button`,{type:`button`,class:`m-btn m-btn-secondary !px-2 !py-1`,disabled:a.value===`preview`,title:P(Z)(`Link`),onClick:n[5]||=e=>u(`[`,`](https://)`,P(Z)(`text`))},`🔗`,8,Hd),P(l)?(H(),U(`button`,{key:0,type:`button`,class:`m-btn m-btn-secondary !px-2 !py-1`,disabled:a.value===`preview`,onClick:n[6]||=e=>c.value=!0},k(P(Z)(`Photo`)),9,Ud)):J(``,!0),G(`span`,Wd,[G(`button`,{type:`button`,class:O([`m-btn !px-3 !py-1`,a.value===`write`?`m-btn-primary`:`m-btn-secondary`]),onClick:n[7]||=e=>p(`write`)},k(P(Z)(`Write`)),3),G(`button`,{type:`button`,class:O([`m-btn !px-3 !py-1`,a.value===`preview`?`m-btn-primary`:`m-btn-secondary`]),onClick:n[8]||=e=>p(`preview`)},k(P(Z)(`Preview`)),3)])],8,Id),I(G(`textarea`,{id:e.id,ref_key:`area`,ref:i,value:e.modelValue,rows:e.rows??14,required:e.required,maxlength:e.maxlength,class:`m-input font-mono`,onInput:n[9]||=e=>r(`update:modelValue`,e.target.value)},null,40,Gd),[[$c,a.value===`write`]]),a.value===`preview`?(H(),U(`div`,Kd,[s.value?(H(),U(`p`,qd,k(P(Z)(`Loading…`)),1)):(H(),U(`div`,{key:1,class:`m-prose`,innerHTML:o.value},null,8,Jd))])):J(``,!0),c.value?(H(),W(Fd,{key:1,onPick:f,onClose:n[10]||=e=>c.value=!1})):J(``,!0)]))}}),Xd={class:`m-card mt-6 max-w-3xl p-5`},Zd={class:`font-display text-lg font-bold`},Qd={key:0,class:`mt-2 text-sm text-muted`},$d={key:1,class:`mt-2 text-sm text-muted`},ef={key:2,class:`mt-3 divide-y divide-line`},tf={class:`flex flex-wrap items-center justify-between gap-2`},nf=[`aria-expanded`,`onClick`],rf={class:`font-semibold`},af={key:0,class:`text-muted`},of={key:1,class:`m-badge ml-2`},sf={class:`block text-xs text-muted`},cf=[`onClick`],lf={key:0,class:`mt-2 space-y-2 text-sm`},uf={class:`text-xs font-semibold uppercase tracking-wide text-muted`},df={class:`whitespace-pre-wrap break-words`},ff=L({__name:`RevisionsPanel`,props:{type:{},id:{}},setup(e){let t=e,n=N([]),r=N(!1),i=N(null),a=N(!0),o=`${X.base}/revisions/${t.type}/${t.id}`;ia(async()=>{try{let e=await qu.get(o);n.value=e.revisions,r.value=e.can_restore}finally{a.value=!1}});async function s(e){window.confirm(Z(`Put this version back? The text now is kept in the history.`))&&(await qu.post(`${o}/${e.id}/restore`),$(Z(`The earlier version is back.`)),await x1())}let c=e=>new Date(e).toLocaleString(X.locale||void 0);return(e,t)=>(H(),U(`section`,Xd,[G(`h2`,Zd,k(P(Z)(`History`)),1),a.value?(H(),U(`p`,Qd,k(P(Z)(`Loading…`)),1)):n.value.length?(H(),U(`ul`,ef,[(H(!0),U(B,null,R(n.value,e=>(H(),U(`li`,{key:e.id,class:`py-3`},[G(`div`,tf,[G(`button`,{type:`button`,class:`text-left text-sm`,"aria-expanded":i.value===e.id,onClick:t=>i.value=i.value===e.id?null:e.id},[G(`span`,rf,k(c(e.created_at)),1),e.user?(H(),U(`span`,af,` · `+k(e.user),1)):J(``,!0),e.current?(H(),U(`span`,of,k(P(Z)(`Now`)),1)):J(``,!0),G(`span`,sf,k(e.changed.join(`, `)),1)],8,nf),r.value&&!e.current?(H(),U(`button`,{key:0,type:`button`,class:`m-btn m-btn-secondary`,onClick:t=>s(e)},k(P(Z)(`Put back`)),9,cf)):J(``,!0)]),i.value===e.id?(H(),U(`dl`,lf,[(H(!0),U(B,null,R(e.values,(e,t)=>(H(),U(`div`,{key:t},[G(`dt`,uf,k(t),1),G(`dd`,df,k(e),1)]))),128))])):J(``,!0)]))),128))])):(H(),U(`p`,$d,k(P(Z)(`Nothing here yet.`)),1))]))}}),pf={class:`mb-6 flex items-center justify-between gap-3`},mf={class:`font-display text-2xl font-bold`},hf={for:`title`,class:`m-label`},gf={key:0,class:`m-error`},_f={class:`grid gap-5 sm:grid-cols-2`},vf={for:`slug`,class:`m-label`},yf={key:0,class:`m-error`},bf={for:`category`,class:`m-lab
Line truncated
|
||||
Vendored
+174
@@ -0,0 +1,174 @@
|
||||
const Vue = window.IriksManager.Vue;
|
||||
export const BaseTransition = Vue.BaseTransition;
|
||||
export const BaseTransitionPropsValidators = Vue.BaseTransitionPropsValidators;
|
||||
export const Comment = Vue.Comment;
|
||||
export const DeprecationTypes = Vue.DeprecationTypes;
|
||||
export const EffectScope = Vue.EffectScope;
|
||||
export const ErrorCodes = Vue.ErrorCodes;
|
||||
export const ErrorTypeStrings = Vue.ErrorTypeStrings;
|
||||
export const Fragment = Vue.Fragment;
|
||||
export const KeepAlive = Vue.KeepAlive;
|
||||
export const ReactiveEffect = Vue.ReactiveEffect;
|
||||
export const Static = Vue.Static;
|
||||
export const Suspense = Vue.Suspense;
|
||||
export const Teleport = Vue.Teleport;
|
||||
export const Text = Vue.Text;
|
||||
export const TrackOpTypes = Vue.TrackOpTypes;
|
||||
export const Transition = Vue.Transition;
|
||||
export const TransitionGroup = Vue.TransitionGroup;
|
||||
export const TriggerOpTypes = Vue.TriggerOpTypes;
|
||||
export const VueElement = Vue.VueElement;
|
||||
export const __esModule = Vue.__esModule;
|
||||
export const assertNumber = Vue.assertNumber;
|
||||
export const callWithAsyncErrorHandling = Vue.callWithAsyncErrorHandling;
|
||||
export const callWithErrorHandling = Vue.callWithErrorHandling;
|
||||
export const camelize = Vue.camelize;
|
||||
export const capitalize = Vue.capitalize;
|
||||
export const cloneVNode = Vue.cloneVNode;
|
||||
export const compatUtils = Vue.compatUtils;
|
||||
export const compile = Vue.compile;
|
||||
export const computed = Vue.computed;
|
||||
export const createApp = Vue.createApp;
|
||||
export const createBlock = Vue.createBlock;
|
||||
export const createCommentVNode = Vue.createCommentVNode;
|
||||
export const createElementBlock = Vue.createElementBlock;
|
||||
export const createElementVNode = Vue.createElementVNode;
|
||||
export const createHydrationRenderer = Vue.createHydrationRenderer;
|
||||
export const createPropsRestProxy = Vue.createPropsRestProxy;
|
||||
export const createRenderer = Vue.createRenderer;
|
||||
export const createSSRApp = Vue.createSSRApp;
|
||||
export const createSlots = Vue.createSlots;
|
||||
export const createStaticVNode = Vue.createStaticVNode;
|
||||
export const createTextVNode = Vue.createTextVNode;
|
||||
export const createVNode = Vue.createVNode;
|
||||
export const customRef = Vue.customRef;
|
||||
export const defineAsyncComponent = Vue.defineAsyncComponent;
|
||||
export const defineComponent = Vue.defineComponent;
|
||||
export const defineCustomElement = Vue.defineCustomElement;
|
||||
export const defineEmits = Vue.defineEmits;
|
||||
export const defineExpose = Vue.defineExpose;
|
||||
export const defineModel = Vue.defineModel;
|
||||
export const defineOptions = Vue.defineOptions;
|
||||
export const defineProps = Vue.defineProps;
|
||||
export const defineSSRCustomElement = Vue.defineSSRCustomElement;
|
||||
export const defineSlots = Vue.defineSlots;
|
||||
export const devtools = Vue.devtools;
|
||||
export const effect = Vue.effect;
|
||||
export const effectScope = Vue.effectScope;
|
||||
export const getCurrentInstance = Vue.getCurrentInstance;
|
||||
export const getCurrentScope = Vue.getCurrentScope;
|
||||
export const getCurrentWatcher = Vue.getCurrentWatcher;
|
||||
export const getTransitionRawChildren = Vue.getTransitionRawChildren;
|
||||
export const guardReactiveProps = Vue.guardReactiveProps;
|
||||
export const h = Vue.h;
|
||||
export const handleError = Vue.handleError;
|
||||
export const hasInjectionContext = Vue.hasInjectionContext;
|
||||
export const hydrate = Vue.hydrate;
|
||||
export const hydrateOnIdle = Vue.hydrateOnIdle;
|
||||
export const hydrateOnInteraction = Vue.hydrateOnInteraction;
|
||||
export const hydrateOnMediaQuery = Vue.hydrateOnMediaQuery;
|
||||
export const hydrateOnVisible = Vue.hydrateOnVisible;
|
||||
export const initCustomFormatter = Vue.initCustomFormatter;
|
||||
export const initDirectivesForSSR = Vue.initDirectivesForSSR;
|
||||
export const inject = Vue.inject;
|
||||
export const isMemoSame = Vue.isMemoSame;
|
||||
export const isProxy = Vue.isProxy;
|
||||
export const isReactive = Vue.isReactive;
|
||||
export const isReadonly = Vue.isReadonly;
|
||||
export const isRef = Vue.isRef;
|
||||
export const isRuntimeOnly = Vue.isRuntimeOnly;
|
||||
export const isShallow = Vue.isShallow;
|
||||
export const isVNode = Vue.isVNode;
|
||||
export const markRaw = Vue.markRaw;
|
||||
export const mergeDefaults = Vue.mergeDefaults;
|
||||
export const mergeModels = Vue.mergeModels;
|
||||
export const mergeProps = Vue.mergeProps;
|
||||
export const nextTick = Vue.nextTick;
|
||||
export const nodeOps = Vue.nodeOps;
|
||||
export const normalizeClass = Vue.normalizeClass;
|
||||
export const normalizeProps = Vue.normalizeProps;
|
||||
export const normalizeStyle = Vue.normalizeStyle;
|
||||
export const onActivated = Vue.onActivated;
|
||||
export const onBeforeMount = Vue.onBeforeMount;
|
||||
export const onBeforeUnmount = Vue.onBeforeUnmount;
|
||||
export const onBeforeUpdate = Vue.onBeforeUpdate;
|
||||
export const onDeactivated = Vue.onDeactivated;
|
||||
export const onErrorCaptured = Vue.onErrorCaptured;
|
||||
export const onMounted = Vue.onMounted;
|
||||
export const onRenderTracked = Vue.onRenderTracked;
|
||||
export const onRenderTriggered = Vue.onRenderTriggered;
|
||||
export const onScopeDispose = Vue.onScopeDispose;
|
||||
export const onServerPrefetch = Vue.onServerPrefetch;
|
||||
export const onUnmounted = Vue.onUnmounted;
|
||||
export const onUpdated = Vue.onUpdated;
|
||||
export const onWatcherCleanup = Vue.onWatcherCleanup;
|
||||
export const openBlock = Vue.openBlock;
|
||||
export const patchProp = Vue.patchProp;
|
||||
export const popScopeId = Vue.popScopeId;
|
||||
export const provide = Vue.provide;
|
||||
export const proxyRefs = Vue.proxyRefs;
|
||||
export const pushScopeId = Vue.pushScopeId;
|
||||
export const queuePostFlushCb = Vue.queuePostFlushCb;
|
||||
export const reactive = Vue.reactive;
|
||||
export const readonly = Vue.readonly;
|
||||
export const ref = Vue.ref;
|
||||
export const registerRuntimeCompiler = Vue.registerRuntimeCompiler;
|
||||
export const render = Vue.render;
|
||||
export const renderList = Vue.renderList;
|
||||
export const renderSlot = Vue.renderSlot;
|
||||
export const resolveComponent = Vue.resolveComponent;
|
||||
export const resolveDirective = Vue.resolveDirective;
|
||||
export const resolveDynamicComponent = Vue.resolveDynamicComponent;
|
||||
export const resolveFilter = Vue.resolveFilter;
|
||||
export const resolveTransitionHooks = Vue.resolveTransitionHooks;
|
||||
export const setBlockTracking = Vue.setBlockTracking;
|
||||
export const setDevtoolsHook = Vue.setDevtoolsHook;
|
||||
export const setTransitionHooks = Vue.setTransitionHooks;
|
||||
export const shallowReactive = Vue.shallowReactive;
|
||||
export const shallowReadonly = Vue.shallowReadonly;
|
||||
export const shallowRef = Vue.shallowRef;
|
||||
export const ssrContextKey = Vue.ssrContextKey;
|
||||
export const ssrUtils = Vue.ssrUtils;
|
||||
export const stop = Vue.stop;
|
||||
export const toDisplayString = Vue.toDisplayString;
|
||||
export const toHandlerKey = Vue.toHandlerKey;
|
||||
export const toHandlers = Vue.toHandlers;
|
||||
export const toRaw = Vue.toRaw;
|
||||
export const toRef = Vue.toRef;
|
||||
export const toRefs = Vue.toRefs;
|
||||
export const toValue = Vue.toValue;
|
||||
export const transformVNodeArgs = Vue.transformVNodeArgs;
|
||||
export const triggerRef = Vue.triggerRef;
|
||||
export const unref = Vue.unref;
|
||||
export const useAttrs = Vue.useAttrs;
|
||||
export const useCssModule = Vue.useCssModule;
|
||||
export const useCssVars = Vue.useCssVars;
|
||||
export const useHost = Vue.useHost;
|
||||
export const useId = Vue.useId;
|
||||
export const useModel = Vue.useModel;
|
||||
export const useSSRContext = Vue.useSSRContext;
|
||||
export const useShadowRoot = Vue.useShadowRoot;
|
||||
export const useSlots = Vue.useSlots;
|
||||
export const useTemplateRef = Vue.useTemplateRef;
|
||||
export const useTransitionState = Vue.useTransitionState;
|
||||
export const vModelCheckbox = Vue.vModelCheckbox;
|
||||
export const vModelDynamic = Vue.vModelDynamic;
|
||||
export const vModelRadio = Vue.vModelRadio;
|
||||
export const vModelSelect = Vue.vModelSelect;
|
||||
export const vModelText = Vue.vModelText;
|
||||
export const vShow = Vue.vShow;
|
||||
export const version = Vue.version;
|
||||
export const warn = Vue.warn;
|
||||
export const watch = Vue.watch;
|
||||
export const watchEffect = Vue.watchEffect;
|
||||
export const watchPostEffect = Vue.watchPostEffect;
|
||||
export const watchSyncEffect = Vue.watchSyncEffect;
|
||||
export const withAsyncContext = Vue.withAsyncContext;
|
||||
export const withCtx = Vue.withCtx;
|
||||
export const withDefaults = Vue.withDefaults;
|
||||
export const withDirectives = Vue.withDirectives;
|
||||
export const withKeys = Vue.withKeys;
|
||||
export const withMemo = Vue.withMemo;
|
||||
export const withModifiers = Vue.withModifiers;
|
||||
export const withScopeId = Vue.withScopeId;
|
||||
export default Vue;
|
||||
@@ -0,0 +1,105 @@
|
||||
/*
|
||||
* Reports a page view of the public site to the statistics of the manager, and how long the page was in view.
|
||||
* No cookies, no storage, nothing about the visitor: the server decides what it keeps (see the README). A browser that
|
||||
* asks not to be followed (Do Not Track, Global Privacy Control) is not counted, here and on the server.
|
||||
*
|
||||
* <x-manager::pulse />
|
||||
*
|
||||
* `data-spa` on the script tag: also report the pages a client-side router moves to (history.pushState).
|
||||
*/
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
var script = document.currentScript;
|
||||
var base = script && script.src ? script.src.replace(/\/pulse\.js(\?.*)?$/, '') : '/pulse';
|
||||
|
||||
if (navigator.doNotTrack === '1' || navigator.globalPrivacyControl === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
var token = null;
|
||||
var visible = 0;
|
||||
var shownAt = document.visibilityState === 'visible' ? Date.now() : null;
|
||||
var sent = false;
|
||||
|
||||
function params() {
|
||||
return new URLSearchParams(location.search);
|
||||
}
|
||||
|
||||
function other(referrer) {
|
||||
try {
|
||||
return new URL(referrer).host !== location.host ? referrer : '';
|
||||
} catch (e) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
function report(path, referrer) {
|
||||
var query = params();
|
||||
|
||||
fetch(base + '/view', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json', Accept: 'application/json' },
|
||||
credentials: 'omit',
|
||||
keepalive: true,
|
||||
body: JSON.stringify({
|
||||
path: path,
|
||||
referrer: referrer,
|
||||
via: query.get('via') || query.get('utm_source') || '',
|
||||
campaign: query.get('utm_campaign') || '',
|
||||
}),
|
||||
})
|
||||
.then(function (response) { return response.ok ? response.json() : null; })
|
||||
.then(function (data) { token = data && data.token ? data.token : null; })
|
||||
.catch(function () {});
|
||||
}
|
||||
|
||||
function leave() {
|
||||
if (shownAt !== null) {
|
||||
visible += Date.now() - shownAt;
|
||||
shownAt = null;
|
||||
}
|
||||
|
||||
if (token && !sent && visible > 0) {
|
||||
sent = true;
|
||||
var body = JSON.stringify({ token: token, seconds: Math.min(Math.round(visible / 1000), 7200) });
|
||||
|
||||
if (!(navigator.sendBeacon && navigator.sendBeacon(base + '/leave', new Blob([body], { type: 'application/json' })))) {
|
||||
fetch(base + '/leave', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: body, keepalive: true, credentials: 'omit' }).catch(function () {});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function resume() {
|
||||
shownAt = shownAt === null && document.visibilityState === 'visible' ? Date.now() : shownAt;
|
||||
sent = false;
|
||||
}
|
||||
|
||||
document.addEventListener('visibilitychange', function () {
|
||||
document.visibilityState === 'hidden' ? leave() : resume();
|
||||
});
|
||||
window.addEventListener('pagehide', leave);
|
||||
|
||||
report(location.pathname, other(document.referrer));
|
||||
|
||||
if (script && script.hasAttribute('data-spa')) {
|
||||
var previous = location.pathname;
|
||||
var push = history.pushState;
|
||||
|
||||
history.pushState = function () {
|
||||
var result = push.apply(this, arguments);
|
||||
|
||||
if (location.pathname !== previous) {
|
||||
leave();
|
||||
visible = 0;
|
||||
token = null;
|
||||
shownAt = Date.now();
|
||||
sent = false;
|
||||
report(location.pathname, location.origin + previous);
|
||||
previous = location.pathname;
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
}
|
||||
})();
|
||||
@@ -0,0 +1,116 @@
|
||||
{
|
||||
"Audit log": "Auditlog",
|
||||
"Banned an address": "Een adres geblokkeerd",
|
||||
"Lifted the ban of an address": "De blokkade van een adres opgeheven",
|
||||
"Banned the addresses of a group": "De adressen van een groep geblokkeerd",
|
||||
"Lifted the bans of a group": "De blokkades van een groep opgeheven",
|
||||
"Wrote or removed the note about an address": "Een notitie over een adres geschreven of verwijderd",
|
||||
"Changed the rules of the audit log": "De regels van de auditlog gewijzigd",
|
||||
"Opened the audit log": "De auditlog geopend",
|
||||
"See the audit log: who logged in and what was done, with addresses and browsers": "De auditlog zien: wie er inlogde en wat er gedaan is, met adressen en browsers",
|
||||
"Ban addresses and lift bans, write notes about addresses, and set the rules of the audit log": "Adressen blokkeren en weer vrijgeven, notities over adressen schrijven en de regels van de auditlog instellen",
|
||||
"Media": "Media",
|
||||
"Uploaded a file": "Een bestand geüpload",
|
||||
"Changed a file": "Een bestand gewijzigd",
|
||||
"Deleted a file": "Een bestand verwijderd",
|
||||
"Opened the media library": "De mediabibliotheek geopend",
|
||||
"See the media library and pick files from it": "De mediabibliotheek zien en er bestanden uit kiezen",
|
||||
"Upload files": "Bestanden uploaden",
|
||||
"Change the name, description and focus point of a file": "De naam, omschrijving en het scherpstelpunt van een bestand wijzigen",
|
||||
"Delete files": "Bestanden verwijderen",
|
||||
"Pages": "Pagina's",
|
||||
"Opened the pages": "De pagina's geopend",
|
||||
"Change the texts of the pages": "De teksten van de pagina's wijzigen",
|
||||
"Site content": "Inhoud van de site",
|
||||
"Posts": "Berichten",
|
||||
"Categories and tags": "Categorieën en tags",
|
||||
"Created a post": "Een bericht gemaakt",
|
||||
"Changed a post": "Een bericht gewijzigd",
|
||||
"Put a post on the site, or took it off": "Een bericht online gezet of offline gehaald",
|
||||
"Deleted a post": "Een bericht verwijderd",
|
||||
"Made a category or tag": "Een categorie of tag gemaakt",
|
||||
"Renamed a category or tag": "Een categorie of tag hernoemd",
|
||||
"Removed a category or tag": "Een categorie of tag verwijderd",
|
||||
"Opened the posts": "De berichten geopend",
|
||||
"Opened the form for a new post": "Het formulier voor een nieuw bericht geopend",
|
||||
"Opened a post": "Een bericht geopend",
|
||||
"Opened the preview of a post": "De voorvertoning van een bericht geopend",
|
||||
"Opened the categories and tags": "De categorieën en tags geopend",
|
||||
"See the posts, drafts included": "De berichten zien, concepten inbegrepen",
|
||||
"Write posts: create drafts and change them": "Berichten schrijven: concepten maken en wijzigen",
|
||||
"Publish, schedule and unpublish posts, and change posts that are live": "Berichten publiceren, plannen en offline halen, en berichten wijzigen die online staan",
|
||||
"Delete posts (one that is live only together with publishing)": "Berichten verwijderen (een online bericht alleen samen met publiceren)",
|
||||
"Manage the categories and tags: make them, and rename, merge and remove them on all posts": "De categorieën en tags beheren: maken, hernoemen, samenvoegen en verwijderen op alle berichten",
|
||||
"Reviews": "Reviews",
|
||||
"Opened the reviews": "De reviews geopend",
|
||||
"Manage the reviews": "De reviews beheren",
|
||||
"Statistics": "Statistieken",
|
||||
"Exported the statistics": "De statistieken geëxporteerd",
|
||||
"Opened the statistics": "De statistieken geopend",
|
||||
"See the visitor statistics and download them": "De bezoekersstatistieken zien en downloaden",
|
||||
"Accounts": "Accounts",
|
||||
"Groups": "Groepen",
|
||||
"Created an account": "Een account aangemaakt",
|
||||
"Changed an account": "Een account gewijzigd",
|
||||
"Deleted an account": "Een account verwijderd",
|
||||
"Created a group": "Een groep aangemaakt",
|
||||
"Changed a group": "Een groep gewijzigd",
|
||||
"Deleted a group": "Een groep verwijderd",
|
||||
"Opened the accounts": "De accounts geopend",
|
||||
"Opened the groups": "De groepen geopend",
|
||||
"Create, change and delete accounts, and put them in groups": "Accounts maken, wijzigen en verwijderen, en in groepen zetten",
|
||||
"Users": "Gebruikers",
|
||||
"Changed own account": "Eigen account gewijzigd",
|
||||
"Logged in": "Ingelogd",
|
||||
"Logged out": "Uitgelogd",
|
||||
"Asked for :request": ":request opgevraagd",
|
||||
"Was not allowed: :what": "Mocht dit niet: :what",
|
||||
"The address was banned after too many failed logins": "Het adres is geblokkeerd na te veel mislukte inlogpogingen",
|
||||
"Dark": "Donker",
|
||||
"Light": "Licht",
|
||||
"category": "categorie",
|
||||
"tag": "tag",
|
||||
"The :type \":name\" already exists.": "De :type \":name\" bestaat al.",
|
||||
"You cannot delete your own account.": "Je kunt je eigen account niet verwijderen.",
|
||||
"Another account already uses this email address.": "Een ander account gebruikt dit e-mailadres al.",
|
||||
"You can only choose groups that allow nothing more than your own account.": "Je kunt alleen groepen kiezen die niet meer toestaan dan je eigen account.",
|
||||
"The current password is not right.": "Het huidige wachtwoord klopt niet.",
|
||||
"The media library is full: this file does not fit in the room that is left. Remove files that are no longer used, or raise manager.media.max_total_gb.": "De mediabibliotheek is vol: dit bestand past niet in de ruimte die over is. Verwijder bestanden die niet meer gebruikt worden, of verhoog manager.media.max_total_gb.",
|
||||
"The file storage is not available right now. Try again in a moment.": "De bestandsopslag is nu niet beschikbaar. Probeer het zo opnieuw.",
|
||||
":ip is banned from the whole site.": ":ip is geblokkeerd voor de hele site.",
|
||||
":ip is banned from the manager.": ":ip is geblokkeerd voor de manager.",
|
||||
"The ban of :ip is lifted.": "De blokkade van :ip is opgeheven.",
|
||||
"The note about :ip is removed.": "De notitie over :ip is verwijderd.",
|
||||
"The note about :ip is saved.": "De notitie over :ip is opgeslagen.",
|
||||
"Rules saved.": "Regels opgeslagen.",
|
||||
"That is the address you are on yourself.": "Dat is het adres waar je zelf op zit.",
|
||||
"This address is on the list that is never banned.": "Dit adres staat op de lijst die nooit geblokkeerd wordt.",
|
||||
"this site": "deze site",
|
||||
"the manager": "de manager",
|
||||
"This address is blocked from :where.": "Dit adres is geblokkeerd voor :where.",
|
||||
"This address is blocked from :where until :when.": "Dit adres is geblokkeerd voor :where tot :when.",
|
||||
"Switched between the simple and the whole manager": "Gewisseld tussen de simpele en de hele manager",
|
||||
"See the whole manager, not only the simple screens": "De hele manager zien, niet alleen de simpele schermen",
|
||||
"Switch between the simple and the whole manager": "Wisselen tussen de simpele en de hele manager",
|
||||
"Manager": "Manager",
|
||||
"Created a page": "Een pagina gemaakt",
|
||||
"Changed a page": "Een pagina gewijzigd",
|
||||
"Removed a page": "Een pagina verwijderd",
|
||||
"Opened a page": "Een pagina geopend",
|
||||
"A page with fields of its own cannot be removed.": "Een pagina met eigen velden kan niet verwijderd worden.",
|
||||
"Resources": "Lijsten",
|
||||
"Added a record": "Een item toegevoegd",
|
||||
"Changed a record": "Een item gewijzigd",
|
||||
"Removed a record": "Een item verwijderd",
|
||||
"Opened a list": "Een lijst geopend",
|
||||
"Opened the form for a new record": "Het formulier voor een nieuw item geopend",
|
||||
"Opened a record": "Een item geopend",
|
||||
"See :label": ":label bekijken",
|
||||
"Add, change and delete :label": ":label toevoegen, wijzigen en verwijderen",
|
||||
"History": "Geschiedenis",
|
||||
"See the history of posts and pages": "De geschiedenis van berichten en pagina's zien",
|
||||
"Put an earlier version of a post or page back": "Een eerdere versie van een bericht of pagina terugzetten",
|
||||
"Put an earlier version back": "Een eerdere versie teruggezet",
|
||||
"Opened the history of a text": "De geschiedenis van een tekst geopend",
|
||||
"Prove you are not a program, then log in again.": "Laat zien dat je geen programma bent en log dan opnieuw in."
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="robots" content="noindex">
|
||||
<title>{{ $status === 429 ? 'Too many attempts' : 'Blocked' }}</title>
|
||||
</head>
|
||||
<body style="font-family: system-ui, sans-serif; max-width: 32rem; margin: 4rem auto; padding: 0 1rem;">
|
||||
<h1>{{ $status === 429 ? 'Too many attempts' : 'Blocked' }}</h1>
|
||||
<p>{{ $message }}</p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,5 @@
|
||||
{{-- Counts the page in the statistics of the manager (module `statistics`). Put it once in the layout of the public site. --}}
|
||||
@props(['spa' => false])
|
||||
@if (\Illuminate\Support\Facades\Route::has(\IriksIT\Manager\Support\Names::route('pulse.script')))
|
||||
<script src="{{ route(\IriksIT\Manager\Support\Names::route('pulse.script'), [], false) }}" defer @if ($spa) data-spa @endif></script>
|
||||
@endif
|
||||
@@ -0,0 +1,16 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ app()->getLocale() }}">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Manager</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Manager</h1>
|
||||
<ul>
|
||||
@foreach ($navigation as $item)
|
||||
<li><a href="{{ $item['href'] }}">{{ $item['label'] }}</a></li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,21 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<title>{{ $title }}</title>
|
||||
{{-- The theme: values were checked by IriksIT\Manager\Support\Themes, nothing else goes in here. --}}
|
||||
<style>{!! $css !!}</style>
|
||||
<link rel="stylesheet" href="{{ route(\IriksIT\Manager\Support\Names::route('assets'), ['file' => 'manager.css'], false) }}?v={{ $version }}">
|
||||
</head>
|
||||
<body>
|
||||
@if ($extensions !== [])
|
||||
{{-- A bundle of the site imports `vue`: this makes it the Vue of the screens. Before any module script. --}}
|
||||
<script type="importmap">{!! json_encode(['imports' => ['vue' => route(\IriksIT\Manager\Support\Names::route('assets'), ['file' => 'vue.js'], false).'?v='.$version]], JSON_UNESCAPED_SLASHES | JSON_HEX_TAG | JSON_HEX_AMP) !!}</script>
|
||||
@endif
|
||||
<div id="manager"></div>
|
||||
<script type="application/json" id="manager-boot">{!! json_encode($boot, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_HEX_TAG | JSON_HEX_AMP) !!}</script>
|
||||
<script type="module" src="{{ route(\IriksIT\Manager\Support\Names::route('assets'), ['file' => 'manager.js'], false) }}?v={{ $version }}"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user