@coffer-org/web 6.0.0 → 7.0.0
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.
- package/dist/assets/{ChatWidget-qpAe26bF.js → ChatWidget-YZqj6v6F.js} +9 -9
- package/dist/assets/{DiagnosticsPage-7qim0xtf.js → DiagnosticsPage-C_lLM_Hw.js} +1 -1
- package/dist/assets/{NewRecordView-X6Bro17s.js → NewRecordView-CC_fERty.js} +1 -1
- package/dist/assets/{PluginSettingsPage-C3iGqJEb.js → PluginSettingsPage-BkMqmqxo.js} +1 -1
- package/dist/assets/{SettingsForm-BAjKJ1MR.js → SettingsForm-DW1KCYe4.js} +1 -1
- package/dist/assets/{SettingsPage-DbAk9URh.js → SettingsPage-DuP06DkM.js} +3 -3
- package/dist/assets/{ThemeSwitcher-CADoC9xw.js → ThemeSwitcher-CR6oJXQD.js} +1 -1
- package/dist/assets/index-i___vlpd.css +2 -0
- package/dist/assets/index-zcINFUZQ.js +28 -0
- package/dist/assets/{list-cache-D1eUf-Pp.js → list-cache-D-BfHI9X.js} +1 -1
- package/dist/assets/{src-DiE6pP9S.js → src-BDmFR0_v.js} +1 -1
- package/dist/assets/{src-DsNlLMpF.js → src-BJF2nMuG.js} +1 -1
- package/dist/assets/src-BqhS-0sX.js +1 -0
- package/dist/assets/{src-B_YWtyQn.js → src-BxLhm2cd.js} +1 -1
- package/dist/assets/src-C2zqLDpV.js +1 -0
- package/dist/assets/src-C9WAFG8V.js +4 -0
- package/dist/assets/{src-DVO-Ghnz.js → src-D2hi5jAO.js} +1 -1
- package/dist/assets/{src-BYHuqMQ7.js → src-DB2N_cct.js} +1 -1
- package/dist/assets/{src-C4BNu6EC.js → src-DpPV1q-1.js} +1 -1
- package/dist/assets/{src-CustHESR.js → src-DwXka-KQ.js} +1 -1
- package/dist/assets/{ui-BgqTuhxj2.js → ui-A-A-cO8j2.js} +2 -2
- package/dist/assets/ui-CAxfAaN9.js +2 -0
- package/dist/assets/{ui-CImMNxCk.js → ui-D7QZRcxZ.js} +1 -1
- package/dist/index.html +6 -6
- package/dist-vendor/web-ui.js +9676 -9600
- package/package.json +1 -1
- package/dist/assets/index-CHlM3CU9.js +0 -28
- package/dist/assets/index-KdG4mu3z.css +0 -2
- package/dist/assets/src-54Qdjl2W.js +0 -4
- package/dist/assets/src-BTv3nocd.js +0 -1
- package/dist/assets/src-CO3npa8j.js +0 -1
- package/dist/assets/ui-Cy5oShj4.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Jr as e,rn as t}from"./src-54Qdjl2W.js";import{C as n,O as r,_ as i,d as a,g as o,h as s,i as c,m as l,p as u,u as d}from"./fields-BtCN_frr.js";import{D as f,E as p,a as m,c as h,m as g,u as _,v,w as y}from"./shelf-CRUDKiTz.js";import{n as b}from"./extend-BTkr7oJ8.js";import{t as ee}from"./plugin-CFEkHH3f.js";var x=(()=>{try{return Intl.supportedValuesOf(`currency`)}catch{return[`USD`,`EUR`,`UAH`,`GBP`,`PLN`]}})();new Set(x);function S(e,t){try{return new Intl.NumberFormat(t,{style:`currency`,currency:e,currencyDisplay:`narrowSymbol`}).formatToParts(0).find(e=>e.type===`currency`)?.value??e}catch{return e}}function C(e,t=`en`){try{return new Intl.DisplayNames([t],{type:`currency`}).of(e)??e}catch{return e}}var te=[{name:`countries`,options:t.map(e=>({value:e.code,title:`core.countries.${e.code}`,icon:{kind:`icon`,value:`flag:${e.code}`},subtitle:e.code.toUpperCase()}))},{name:`colors`,options:e.map(e=>({value:e.name,title:`core.colors.${e.name}`,icon:{kind:`swatch`,value:e.hex},subtitle:e.hex}))},{name:`sex`,options:[...o]},{name:`weekdays`,options:[...i]},{name:`languages`,options:s.map(e=>({value:e.code,title:e.name}))},{name:`currencies`,options:x.map(e=>({value:e,title:C(e),subtitle:S(e)}))}],w=class extends Error{};function T(e,t){let n=e.split(`.`);for(let e of n)if(e===``)throw new w(`[mutate-path] '${t}': empty segment — a path may not contain '..', a leading '.' beyond the first character, or a trailing '.'`);return n}function E(e){if(typeof e!=`string`||e.trim()===``)throw new w(`[mutate-path] a target path must be a non-empty string`);let t=e.startsWith(`.`),n=t?e.slice(1):e;if(n===``)throw new w(`[mutate-path] '${e}': nothing after the leading '.'`);let r=n.split(`/`);if(r.some(e=>e===``))throw new w(`[mutate-path] '${e}': empty side of a '/' — both a relation path and a target path are required`);let i=T(r[r.length-1],e);return{hops:r.slice(0,-1).map(t=>T(t,e)),path:i,relative:t}}function D(e,t){if(!e.relative)return e;let n=[...t];return e.hops.length>0?{hops:[[...n,...e.hops[0]],...e.hops.slice(1)],path:e.path,relative:!1}:{hops:[],path:[...n,...e.path],relative:!1}}var O=class extends Error{};function k(e,t){return`${e}#${t.join(`.`)}`}function A(e,t){return M(e,t,0)}function j(e,t,n,r){let i=n[r],a=r===n.length-1,o=e.parts?.find(e=>e.key===i)??e.parts?.find(e=>e.role===i);return o?a?{relation:o.meta.relation,desc:`part '${i}' of composite '${t}' (kind '${o.meta.kind}')`}:o.meta.parts?j(o.meta,`${t}.${i}`,n,r+1):null:e.columns&&i in e.columns&&a?{desc:`sub-column '${i}' of composite '${t}'`}:null}function M(e,t,n){let r=t[n],i=n===t.length-1;for(let o of e){if(a(o)){if(o.key!==r)continue;return i?{relation:o.type.relation,desc:`field '${r}' (kind '${o.type.kind}')`}:j(o.type,r,t,n+1)}if(c(o)){if(!u(o)){let e=M(o.fields,t,n);if(e)return e;continue}if(o.key===r){if(i)return o.compute===void 0?null:{desc:`group '${r}' (a container)`};let e=M(o.fields,t,n+1);if(e)return e;continue}}}return null}function N(e,t){if(t.startsWith(`extend:`)){let n=t.slice(7);return e.extends_.find(e=>e.id===n).fields}let n=t.indexOf(`/`);return e.getShelf(t.slice(0,n),t.slice(n+1)).fields}function P(e,t,n,r,i){let a=`[mutate] ${t}.${n.join(`.`)}: target '${r}'`,o=t,s=N(e,o);for(let t of i.hops){let n=A(s,t);if(!n)throw new O(`${a} — unknown segment in relation hop '${t.join(`.`)}'`);if(!n.relation)throw new O(`${a} — '${t.join(`.`)}' is not a relation — it is ${n.desc}`);o=`${n.relation.library}/${n.relation.shelf}`,s=N(e,o)}if(!A(s,i.path))throw new O(`${a} — unknown segment in path '${i.path.join(`.`)}' (looked up in ${o})`);return o}function F(e,t,n){for(let r of e)if(a(r)){let e=[...t,r.key];r.type.mutate?.length&&n.push({path:e,scope:t,meta:r.type});for(let i of r.type.parts??[])i.meta.mutate?.length&&n.push({path:[...e,i.key],scope:t,meta:i.meta})}else c(r)&&F(r.fields,u(r)?[...t,r.key]:t,n)}function I(e){for(let t of e)if(c(t)){if(u(t)&&t.compute!==void 0){for(let e of t.fields)if(a(e)&&e.type.compute!==void 0)throw new O(`[mutate] group '${t.key}': child '${e.key}' carries its own value while the group already carries value — two writers for one column, drop one of the two computations.`)}I(t.fields)}}function L(e){let t=new Map;for(let[n,r]of e)for(let e of r){let r=k(n,e.from),i=k(e.toShelf,e.to.path),a=t.get(r);a?a.push(i):t.set(r,[i])}let n=new Map,r=[],i=e=>{n.set(e,1),r.push(e);for(let a of t.get(e)??[]){let e=n.get(a)??0;if(e===0){let e=i(a);if(e)return e}else if(e===1){let e=r.indexOf(a);return[...r.slice(e),a]}}return r.pop(),n.set(e,2),null};for(let e of t.keys())if((n.get(e)??0)===0){let t=i(e);if(t)return t}return null}function R(e,t,n,r){for(let i of e)if(a(i)){let e=[...n,i.key],a=i.type;a.compute!==void 0&&r.push({scope:t,path:e,cache:a.cache});for(let n of a.parts??[])n.mode===`computedStored`&&r.push({scope:t,path:[...e,n.key],cache:n.meta?.cache})}else if(c(i)){let e=u(i)?[...n,i.key]:n;u(i)&&i.compute!==void 0&&r.push({scope:t,path:e,cache:void 0}),R(i.fields,t,e,r)}}function z(e,t){let n=new Set;for(let e of t.values())for(let t of e)n.add(k(t.toShelf,t.to.path));let r=[...(e.shelves??[]).map(e=>({scope:`${e.library}/${e.shelf}`,fields:e.fields})),...(e.extends_??[]).map(e=>({scope:`extend:${e.id}`,fields:e.fields}))];for(let{scope:e,fields:t}of r){let r=[];R(t,e,[],r);for(let t of r)t.cache===void 0&&(n.has(k(t.scope,t.path))||console.warn(`[mutate-graph] ${e}: '${t.path.join(`.`)}' is a computed-and-stored unit with no incoming mutate edge and no cache — nothing will ever trigger its recompute after it is first written.`))}}function B(e){let t=new Map,n=[...(e.shelves??[]).map(e=>({scope:`${e.library}/${e.shelf}`,fields:e.fields})),...(e.extends_??[]).map(e=>({scope:`extend:${e.id}`,fields:e.fields}))];for(let{fields:e}of n)I(e);for(let{scope:r,fields:i}of n){let n=[];if(F(i,[],n),!n.length)continue;let a=[];for(let t of n)for(let n of t.meta.mutate??[]){let i=D(E(n),t.scope),o=P(e,r,t.path,n,i);a.push({from:t.path,to:i,toShelf:o})}t.set(r,a)}let r=L(t);if(r)throw new O(`[mutate] cycle: ${r.join(` -> `)}`);return z(e,t),t}var V=63,H=`__cachedAt`;V-10;var U=`_parent_id_index`;V-16;function W(e,t){for(let n of t){let t=`key`in n?n.key:void 0;if(t?.includes(`__`))throw Error(`[storage] ${e}: key '${t}' contains '__', the storage path separator — two different paths would spell one column name. Rename the key; an enclosing group's prefix supplies the '__'.`);c(n)&&W(e,n.fields)}}function G(e,t,n){if(t.length>47)throw Error(`[storage] ${e}: table name '${t}' is ${t.length} characters, over the 47-character budget (${V} minus '${U}', the identifier the ORM derives from it). PostgreSQL truncates a longer one silently. Shorten the library, the shelf, or a collection key along the path.`);let r=new Map;for(let[t,i]of h(n)){if(i.columns){if(!i.parts)throw Error(`[storage] ${e}.${t}: sets \`columns\` without \`parts\` — build a composite's columns from roles via resolveParts (see f.measured), or store the value whole with \`json: true\``);if(i.json)throw Error(`[storage] ${e}.${t}: is both a composite (\`columns\`) and JSON-stored (\`json\`) — a field persists one way or the other`)}for(let[n]of v(t,i)){let i=r.get(n);if(i!==void 0&&i!==t)throw Error(`[storage] ${e}: fields '${i}' and '${t}' both generate the column '${n}' — one value would overwrite the other and the second field would vanish from every response. Rename one.`);if(r.set(n,t),n.length>53)throw Error(`[storage] ${e}.${t}: generated column '${n}' is ${n.length} characters, over the 53-character budget (${V} minus '${H}'). PostgreSQL truncates a longer one silently. Shorten a key along the path.`)}}W(e,n);for(let r of m(n))G(`${e}/${r.key}`,`${t}__${r.key}`,r.group.fields)}function K(e,t={}){let i=t.disabled??new Set,o=e.filter(e=>!i.has(e.id)),s=new Map;for(let e of o){for(let t of e.libraries??[])for(let n of t.shelves)s.set(`${n.library}/${n.shelf}`,e.id);for(let t of e.libraryShelves??[])s.set(`${t.library}/${t.shelf}`,e.id)}let u=(e,t)=>s.get(`${e}/${t}`);for(let e of o)for(let t of e.dependsOn)if(i.has(t))throw Error(`[plugin] '${e.id}' is enabled, but its dependency '${t}' is disabled`);let m=ee(o),{order:v,libraries:x}=m,S=m.shelves.map(n),C=m.extends_.map(n),w=new Map(o.filter(e=>e.settings).map(e=>[e.id,n(e.settings).fields]));for(let e of t.settingsGroups??[])if(w.has(e.id))throw Error(`[settings] group '${e.id}' is declared by a plugin and passed in by the caller — pick one owner`);let T=[...[...w].map(([e,t])=>({id:e,fields:t})),...t.settingsGroups??[]],E=new Map;for(let e of o)for(let t of e.fieldContribs??[]){let e=`${t.library}/${t.shelf}/${t.field}`,n=E.get(e)??{options:[],suggestions:[]};t.options&&n.options.push(...t.options),t.suggestions&&n.suggestions.push(...t.suggestions),E.set(e,n)}let D=(e,t)=>{if(t.options.length){let n=new Set((e.options??[]).map(e=>e.value));e.options=[...e.options??[],...t.options.filter(e=>!n.has(e.value))]}if(t.suggestions.length){let n=e.hints.suggestions??[],r=new Set(n);e.hints.suggestions=[...n,...t.suggestions.filter(e=>!r.has(e))]}},O=new Map;for(let e of te)O.set(e.name,e.options);for(let e of o)for(let t of e.optionLists??[])O.set(t.name,t.options);let k=e=>O.get(e)??[];for(let[e,t,n]of[...S.map(e=>[`${e.library}/${e.shelf}`,`${e.library}__${e.shelf}`,e.fields]),...T.map(e=>[`_settings/${e.id}`,`_settings__${e.id}`,e.fields]),...C.map(e=>[`extend/${e.id}`,`extend__${e.id}`,e.fields])])G(e,t,n);for(let e of S)for(let[t,n]of h(e.fields)){let r=E.get(`${e.library}/${e.shelf}/${t}`);r&&D(n,r)}for(let e of T)for(let[t,n]of h(e.fields)){let i=E.get(`_settings/${e.id}/${t}`);i&&(D(n,i),l(n)&&n.options?.length&&r(n,n.options.map(e=>e.value)))}let A=new Map;for(let e of S)for(let[t,n]of h(e.fields)){let i=n.hints.source,a=n.options??[],o=i?O.get(i)??[]:[],s=new Set(a.map(e=>e.value)),c=[...a,...o.filter(e=>!s.has(e.value))];l(n)&&c.length&&r(n,c.map(e=>e.value)),c.length&&(n.options=c,A.set(`${e.library}/${e.shelf}/${t}`,c))}let j=e=>{let t=[];for(let n of e)a(n)?t.push(n.type):c(n)&&t.push(...j(n.fields));return t};for(let e of C)for(let t of j(e.fields)){if(!l(t))continue;let e=t.hints.source;if(!e)continue;let n=O.get(e)??[],i=t.options??[],a=new Set(i.map(e=>e.value)),o=[...i,...n.filter(e=>!a.has(e.value))];o.length&&r(t,o.map(e=>e.value))}let M=(e,t,n)=>{let r=e[t];if(!r)throw Error(n);return r},N=[];for(let e of o)for(let t of e.showcases??[]){let e=S.find(e=>e.library===t.source.library&&e.shelf===t.source.shelf);if(!e)throw Error(`[showcase] ${t.library}/${t.id}: unknown source shelf ${t.source.library}/${t.source.shelf}`);let n=Object.fromEntries(h(e.fields));for(let e of p(t.filter)){let r=M(n,e,`[showcase] ${t.library}/${t.id}: filter field '${e}' is not in ${t.source.library}/${t.source.shelf}`),i=f(t.filter,e),a=i.filter(e=>y.has(e));if(a.length&&!r.hints.multiple)throw Error(`[showcase] ${t.library}/${t.id}: operator '${a[0]}' on '${e}' needs a multiple field, but ${t.source.library}/${t.source.shelf}.${e} stores a single value`);if(d(r)&&a.length!==i.length)throw Error(`[showcase] ${t.library}/${t.id}: filter field '${e}' is stored as JSON — only ${[...y].join(`/`)} applies`);if(r.columns)throw Error(`[showcase] ${t.library}/${t.id}: filter field '${e}' is a composite scalar stored across sub-columns`)}let r=g(e);for(let e of t.columns){if(!n[e])throw Error(`[showcase] ${t.library}/${t.id}: column '${e}' is not in ${t.source.library}/${t.source.shelf}`);if(!r.includes(e))throw Error(`[showcase] ${t.library}/${t.id}: column '${e}' is outside ${t.source.library}/${t.source.shelf}'s list projection (views.list/groupBy/inline) and would render blank`)}if(t.defaultGroupBy!==void 0){if(!n[t.defaultGroupBy])throw Error(`[showcase] ${t.library}/${t.id}: defaultGroupBy '${t.defaultGroupBy}' is not in ${t.source.library}/${t.source.shelf}`);if(!_(e).includes(t.defaultGroupBy))throw Error(`[showcase] ${t.library}/${t.id}: defaultGroupBy '${t.defaultGroupBy}' is not a grouping candidate of ${t.source.library}/${t.source.shelf} (views.groupBy)`)}if(N.some(e=>e.library===t.library&&e.id===t.id))throw Error(`[showcase] duplicate ${t.library}/${t.id}`);N.push(t)}let P=[...S.map(e=>({label:`${e.library}/${e.shelf}`,fields:e.fields})),...C.map(e=>({label:`extend '${e.id}'`,fields:e.fields}))];for(let{label:e,fields:t}of P)for(let[n,r]of h(t)){let t=r.relation;if(!t)continue;let i=S.find(e=>e.library===t.library&&e.shelf===t.shelf);if(!i)throw Error(`[relation] ${e}.${n}: unknown target shelf ${t.library}/${t.shelf}`);if(!t.filter)continue;let a=Object.fromEntries(h(i.fields));for(let r of p(t.filter))M(a,r,`[relation] ${e}.${n}: filter key '${r}' is not in ${t.library}/${t.shelf}`)}let F={order:v,libraries:x,shelves:S,extends_:C,showcases:N,getShowcase:(e,t)=>N.find(n=>n.library===e&&n.id===t),getShowcasesFor:e=>N.filter(t=>t.library===e),getShelf:(e,t)=>S.find(n=>n.library===e&&n.shelf===t),getLibrary:e=>x.find(t=>t.meta.id===e),getExtendsFor:(e,t)=>C.filter(n=>b(n,e,t)),getFieldOptions:(e,t,n)=>A.get(`${e}/${t}/${n}`)??[],getOptionList:k,getShelfOwner:u,mutateGraph:new Map};return F.mutateGraph=B(F),F}var q=null;function J(e){q=K(e)}function Y(){if(!q)throw Error(`[registry] not initialized — call initRegistry() in the boot loader`);return q}var X=(e,t)=>Y().getShelf(e,t),Z=(e,t)=>Y().getExtendsFor(e,t),ne=e=>Y().getOptionList(e),re=(e,t)=>Y().getShowcase(e,t),ie=e=>Y().getShowcasesFor(e),ae=()=>Y().libraries,oe=()=>Y().shelves,se=()=>Y().extends_,Q=20,$=new Map;function ce(e){let t=$.get(e);if(t)return $.delete(e),$.set(e,t),t}function le(e,t){for($.delete(e),$.set(e,{rows:t,ts:Date.now()});$.size>Q;){let e=$.keys().next();if(e.done)break;$.delete(e.value)}}function ue(e){for(let t of[...$.keys()])(t===e||t.startsWith(`${e}?`))&&$.delete(t)}function de(e,t){let n=String(t.id??``);if(n)for(let[r,i]of $){if(r!==e&&!r.startsWith(`${e}?`))continue;let a=!1,o=i.rows.map(e=>{if(String(e.id)!==n)return e;a=!0;let r={...e};for(let n of Object.keys(e))n in t&&(r[n]=t[n]);return r});a&&$.set(r,{rows:o,ts:i.ts})}}export{se as a,ne as c,re as d,ie as f,le as i,X as l,S as m,de as n,Z as o,J as p,ce as r,ae as s,ue as t,oe as u};
|
|
1
|
+
import{Qr as e,on as t}from"./src-C9WAFG8V.js";import{C as n,O as r,_ as i,d as a,g as o,h as s,i as c,m as l,p as u,u as d}from"./fields-BtCN_frr.js";import{D as f,E as p,a as m,c as h,m as g,u as _,v,w as y}from"./shelf-CRUDKiTz.js";import{n as b}from"./extend-BTkr7oJ8.js";import{t as ee}from"./plugin-CFEkHH3f.js";var x=(()=>{try{return Intl.supportedValuesOf(`currency`)}catch{return[`USD`,`EUR`,`UAH`,`GBP`,`PLN`]}})();new Set(x);function S(e,t){try{return new Intl.NumberFormat(t,{style:`currency`,currency:e,currencyDisplay:`narrowSymbol`}).formatToParts(0).find(e=>e.type===`currency`)?.value??e}catch{return e}}function C(e,t=`en`){try{return new Intl.DisplayNames([t],{type:`currency`}).of(e)??e}catch{return e}}var te=[{name:`countries`,options:t.map(e=>({value:e.code,title:`core.countries.${e.code}`,icon:{kind:`icon`,value:`flag:${e.code}`},subtitle:e.code.toUpperCase()}))},{name:`colors`,options:e.map(e=>({value:e.name,title:`core.colors.${e.name}`,icon:{kind:`swatch`,value:e.hex},subtitle:e.hex}))},{name:`sex`,options:[...o]},{name:`weekdays`,options:[...i]},{name:`languages`,options:s.map(e=>({value:e.code,title:e.name}))},{name:`currencies`,options:x.map(e=>({value:e,title:C(e),subtitle:S(e)}))}],w=class extends Error{};function T(e,t){let n=e.split(`.`);for(let e of n)if(e===``)throw new w(`[mutate-path] '${t}': empty segment — a path may not contain '..', a leading '.' beyond the first character, or a trailing '.'`);return n}function E(e){if(typeof e!=`string`||e.trim()===``)throw new w(`[mutate-path] a target path must be a non-empty string`);let t=e.startsWith(`.`),n=t?e.slice(1):e;if(n===``)throw new w(`[mutate-path] '${e}': nothing after the leading '.'`);let r=n.split(`/`);if(r.some(e=>e===``))throw new w(`[mutate-path] '${e}': empty side of a '/' — both a relation path and a target path are required`);let i=T(r[r.length-1],e);return{hops:r.slice(0,-1).map(t=>T(t,e)),path:i,relative:t}}function D(e,t){if(!e.relative)return e;let n=[...t];return e.hops.length>0?{hops:[[...n,...e.hops[0]],...e.hops.slice(1)],path:e.path,relative:!1}:{hops:[],path:[...n,...e.path],relative:!1}}var O=class extends Error{};function k(e,t){return`${e}#${t.join(`.`)}`}function A(e,t){return M(e,t,0)}function j(e,t,n,r){let i=n[r],a=r===n.length-1,o=e.parts?.find(e=>e.key===i)??e.parts?.find(e=>e.role===i);return o?a?{relation:o.meta.relation,desc:`part '${i}' of composite '${t}' (kind '${o.meta.kind}')`}:o.meta.parts?j(o.meta,`${t}.${i}`,n,r+1):null:e.columns&&i in e.columns&&a?{desc:`sub-column '${i}' of composite '${t}'`}:null}function M(e,t,n){let r=t[n],i=n===t.length-1;for(let o of e){if(a(o)){if(o.key!==r)continue;return i?{relation:o.type.relation,desc:`field '${r}' (kind '${o.type.kind}')`}:j(o.type,r,t,n+1)}if(c(o)){if(!u(o)){let e=M(o.fields,t,n);if(e)return e;continue}if(o.key===r){if(i)return o.compute===void 0?null:{desc:`group '${r}' (a container)`};let e=M(o.fields,t,n+1);if(e)return e;continue}}}return null}function N(e,t){if(t.startsWith(`extend:`)){let n=t.slice(7);return e.extends_.find(e=>e.id===n).fields}let n=t.indexOf(`/`);return e.getShelf(t.slice(0,n),t.slice(n+1)).fields}function P(e,t,n,r,i){let a=`[mutate] ${t}.${n.join(`.`)}: target '${r}'`,o=t,s=N(e,o);for(let t of i.hops){let n=A(s,t);if(!n)throw new O(`${a} — unknown segment in relation hop '${t.join(`.`)}'`);if(!n.relation)throw new O(`${a} — '${t.join(`.`)}' is not a relation — it is ${n.desc}`);o=`${n.relation.library}/${n.relation.shelf}`,s=N(e,o)}if(!A(s,i.path))throw new O(`${a} — unknown segment in path '${i.path.join(`.`)}' (looked up in ${o})`);return o}function F(e,t,n){for(let r of e)if(a(r)){let e=[...t,r.key];r.type.mutate?.length&&n.push({path:e,scope:t,meta:r.type});for(let i of r.type.parts??[])i.meta.mutate?.length&&n.push({path:[...e,i.key],scope:t,meta:i.meta})}else c(r)&&F(r.fields,u(r)?[...t,r.key]:t,n)}function I(e){for(let t of e)if(c(t)){if(u(t)&&t.compute!==void 0){for(let e of t.fields)if(a(e)&&e.type.compute!==void 0)throw new O(`[mutate] group '${t.key}': child '${e.key}' carries its own value while the group already carries value — two writers for one column, drop one of the two computations.`)}I(t.fields)}}function L(e){let t=new Map;for(let[n,r]of e)for(let e of r){let r=k(n,e.from),i=k(e.toShelf,e.to.path),a=t.get(r);a?a.push(i):t.set(r,[i])}let n=new Map,r=[],i=e=>{n.set(e,1),r.push(e);for(let a of t.get(e)??[]){let e=n.get(a)??0;if(e===0){let e=i(a);if(e)return e}else if(e===1){let e=r.indexOf(a);return[...r.slice(e),a]}}return r.pop(),n.set(e,2),null};for(let e of t.keys())if((n.get(e)??0)===0){let t=i(e);if(t)return t}return null}function R(e,t,n,r){for(let i of e)if(a(i)){let e=[...n,i.key],a=i.type;a.compute!==void 0&&r.push({scope:t,path:e,cache:a.cache});for(let n of a.parts??[])n.mode===`computedStored`&&r.push({scope:t,path:[...e,n.key],cache:n.meta?.cache})}else if(c(i)){let e=u(i)?[...n,i.key]:n;u(i)&&i.compute!==void 0&&r.push({scope:t,path:e,cache:void 0}),R(i.fields,t,e,r)}}function z(e,t){let n=new Set;for(let e of t.values())for(let t of e)n.add(k(t.toShelf,t.to.path));let r=[...(e.shelves??[]).map(e=>({scope:`${e.library}/${e.shelf}`,fields:e.fields})),...(e.extends_??[]).map(e=>({scope:`extend:${e.id}`,fields:e.fields}))];for(let{scope:e,fields:t}of r){let r=[];R(t,e,[],r);for(let t of r)t.cache===void 0&&(n.has(k(t.scope,t.path))||console.warn(`[mutate-graph] ${e}: '${t.path.join(`.`)}' is a computed-and-stored unit with no incoming mutate edge and no cache — nothing will ever trigger its recompute after it is first written.`))}}function B(e){let t=new Map,n=[...(e.shelves??[]).map(e=>({scope:`${e.library}/${e.shelf}`,fields:e.fields})),...(e.extends_??[]).map(e=>({scope:`extend:${e.id}`,fields:e.fields}))];for(let{fields:e}of n)I(e);for(let{scope:r,fields:i}of n){let n=[];if(F(i,[],n),!n.length)continue;let a=[];for(let t of n)for(let n of t.meta.mutate??[]){let i=D(E(n),t.scope),o=P(e,r,t.path,n,i);a.push({from:t.path,to:i,toShelf:o})}t.set(r,a)}let r=L(t);if(r)throw new O(`[mutate] cycle: ${r.join(` -> `)}`);return z(e,t),t}var V=63,H=`__cachedAt`;V-10;var U=`_parent_id_index`;V-16;function W(e,t){for(let n of t){let t=`key`in n?n.key:void 0;if(t?.includes(`__`))throw Error(`[storage] ${e}: key '${t}' contains '__', the storage path separator — two different paths would spell one column name. Rename the key; an enclosing group's prefix supplies the '__'.`);c(n)&&W(e,n.fields)}}function G(e,t,n){if(t.length>47)throw Error(`[storage] ${e}: table name '${t}' is ${t.length} characters, over the 47-character budget (${V} minus '${U}', the identifier the ORM derives from it). PostgreSQL truncates a longer one silently. Shorten the library, the shelf, or a collection key along the path.`);let r=new Map;for(let[t,i]of h(n)){if(i.columns){if(!i.parts)throw Error(`[storage] ${e}.${t}: sets \`columns\` without \`parts\` — build a composite's columns from roles via resolveParts (see f.measured), or store the value whole with \`json: true\``);if(i.json)throw Error(`[storage] ${e}.${t}: is both a composite (\`columns\`) and JSON-stored (\`json\`) — a field persists one way or the other`)}for(let[n]of v(t,i)){let i=r.get(n);if(i!==void 0&&i!==t)throw Error(`[storage] ${e}: fields '${i}' and '${t}' both generate the column '${n}' — one value would overwrite the other and the second field would vanish from every response. Rename one.`);if(r.set(n,t),n.length>53)throw Error(`[storage] ${e}.${t}: generated column '${n}' is ${n.length} characters, over the 53-character budget (${V} minus '${H}'). PostgreSQL truncates a longer one silently. Shorten a key along the path.`)}}W(e,n);for(let r of m(n))G(`${e}/${r.key}`,`${t}__${r.key}`,r.group.fields)}function K(e,t={}){let i=t.disabled??new Set,o=e.filter(e=>!i.has(e.id)),s=new Map;for(let e of o){for(let t of e.libraries??[])for(let n of t.shelves)s.set(`${n.library}/${n.shelf}`,e.id);for(let t of e.libraryShelves??[])s.set(`${t.library}/${t.shelf}`,e.id)}let u=(e,t)=>s.get(`${e}/${t}`);for(let e of o)for(let t of e.dependsOn)if(i.has(t))throw Error(`[plugin] '${e.id}' is enabled, but its dependency '${t}' is disabled`);let m=ee(o),{order:v,libraries:x}=m,S=m.shelves.map(n),C=m.extends_.map(n),w=new Map(o.filter(e=>e.settings).map(e=>[e.id,n(e.settings).fields]));for(let e of t.settingsGroups??[])if(w.has(e.id))throw Error(`[settings] group '${e.id}' is declared by a plugin and passed in by the caller — pick one owner`);let T=[...[...w].map(([e,t])=>({id:e,fields:t})),...t.settingsGroups??[]],E=new Map;for(let e of o)for(let t of e.fieldContribs??[]){let e=`${t.library}/${t.shelf}/${t.field}`,n=E.get(e)??{options:[],suggestions:[]};t.options&&n.options.push(...t.options),t.suggestions&&n.suggestions.push(...t.suggestions),E.set(e,n)}let D=(e,t)=>{if(t.options.length){let n=new Set((e.options??[]).map(e=>e.value));e.options=[...e.options??[],...t.options.filter(e=>!n.has(e.value))]}if(t.suggestions.length){let n=e.hints.suggestions??[],r=new Set(n);e.hints.suggestions=[...n,...t.suggestions.filter(e=>!r.has(e))]}},O=new Map;for(let e of te)O.set(e.name,e.options);for(let e of o)for(let t of e.optionLists??[])O.set(t.name,t.options);let k=e=>O.get(e)??[];for(let[e,t,n]of[...S.map(e=>[`${e.library}/${e.shelf}`,`${e.library}__${e.shelf}`,e.fields]),...T.map(e=>[`_settings/${e.id}`,`_settings__${e.id}`,e.fields]),...C.map(e=>[`extend/${e.id}`,`extend__${e.id}`,e.fields])])G(e,t,n);for(let e of S)for(let[t,n]of h(e.fields)){let r=E.get(`${e.library}/${e.shelf}/${t}`);r&&D(n,r)}for(let e of T)for(let[t,n]of h(e.fields)){let i=E.get(`_settings/${e.id}/${t}`);i&&(D(n,i),l(n)&&n.options?.length&&r(n,n.options.map(e=>e.value)))}let A=new Map;for(let e of S)for(let[t,n]of h(e.fields)){let i=n.hints.source,a=n.options??[],o=i?O.get(i)??[]:[],s=new Set(a.map(e=>e.value)),c=[...a,...o.filter(e=>!s.has(e.value))];l(n)&&c.length&&r(n,c.map(e=>e.value)),c.length&&(n.options=c,A.set(`${e.library}/${e.shelf}/${t}`,c))}let j=e=>{let t=[];for(let n of e)a(n)?t.push(n.type):c(n)&&t.push(...j(n.fields));return t};for(let e of C)for(let t of j(e.fields)){if(!l(t))continue;let e=t.hints.source;if(!e)continue;let n=O.get(e)??[],i=t.options??[],a=new Set(i.map(e=>e.value)),o=[...i,...n.filter(e=>!a.has(e.value))];o.length&&r(t,o.map(e=>e.value))}let M=(e,t,n)=>{let r=e[t];if(!r)throw Error(n);return r},N=[];for(let e of o)for(let t of e.showcases??[]){let e=S.find(e=>e.library===t.source.library&&e.shelf===t.source.shelf);if(!e)throw Error(`[showcase] ${t.library}/${t.id}: unknown source shelf ${t.source.library}/${t.source.shelf}`);let n=Object.fromEntries(h(e.fields));for(let e of p(t.filter)){let r=M(n,e,`[showcase] ${t.library}/${t.id}: filter field '${e}' is not in ${t.source.library}/${t.source.shelf}`),i=f(t.filter,e),a=i.filter(e=>y.has(e));if(a.length&&!r.hints.multiple)throw Error(`[showcase] ${t.library}/${t.id}: operator '${a[0]}' on '${e}' needs a multiple field, but ${t.source.library}/${t.source.shelf}.${e} stores a single value`);if(d(r)&&a.length!==i.length)throw Error(`[showcase] ${t.library}/${t.id}: filter field '${e}' is stored as JSON — only ${[...y].join(`/`)} applies`);if(r.columns)throw Error(`[showcase] ${t.library}/${t.id}: filter field '${e}' is a composite scalar stored across sub-columns`)}let r=g(e);for(let e of t.columns){if(!n[e])throw Error(`[showcase] ${t.library}/${t.id}: column '${e}' is not in ${t.source.library}/${t.source.shelf}`);if(!r.includes(e))throw Error(`[showcase] ${t.library}/${t.id}: column '${e}' is outside ${t.source.library}/${t.source.shelf}'s list projection (views.list/groupBy/inline) and would render blank`)}if(t.defaultGroupBy!==void 0){if(!n[t.defaultGroupBy])throw Error(`[showcase] ${t.library}/${t.id}: defaultGroupBy '${t.defaultGroupBy}' is not in ${t.source.library}/${t.source.shelf}`);if(!_(e).includes(t.defaultGroupBy))throw Error(`[showcase] ${t.library}/${t.id}: defaultGroupBy '${t.defaultGroupBy}' is not a grouping candidate of ${t.source.library}/${t.source.shelf} (views.groupBy)`)}if(N.some(e=>e.library===t.library&&e.id===t.id))throw Error(`[showcase] duplicate ${t.library}/${t.id}`);N.push(t)}let P=[...S.map(e=>({label:`${e.library}/${e.shelf}`,fields:e.fields})),...C.map(e=>({label:`extend '${e.id}'`,fields:e.fields}))];for(let{label:e,fields:t}of P)for(let[n,r]of h(t)){let t=r.relation;if(!t)continue;let i=S.find(e=>e.library===t.library&&e.shelf===t.shelf);if(!i)throw Error(`[relation] ${e}.${n}: unknown target shelf ${t.library}/${t.shelf}`);if(!t.filter)continue;let a=Object.fromEntries(h(i.fields));for(let r of p(t.filter))M(a,r,`[relation] ${e}.${n}: filter key '${r}' is not in ${t.library}/${t.shelf}`)}let F={order:v,libraries:x,shelves:S,extends_:C,showcases:N,getShowcase:(e,t)=>N.find(n=>n.library===e&&n.id===t),getShowcasesFor:e=>N.filter(t=>t.library===e),getShelf:(e,t)=>S.find(n=>n.library===e&&n.shelf===t),getLibrary:e=>x.find(t=>t.meta.id===e),getExtendsFor:(e,t)=>C.filter(n=>b(n,e,t)),getFieldOptions:(e,t,n)=>A.get(`${e}/${t}/${n}`)??[],getOptionList:k,getShelfOwner:u,mutateGraph:new Map};return F.mutateGraph=B(F),F}var q=null;function J(e){q=K(e)}function Y(){if(!q)throw Error(`[registry] not initialized — call initRegistry() in the boot loader`);return q}var X=(e,t)=>Y().getShelf(e,t),Z=(e,t)=>Y().getExtendsFor(e,t),ne=e=>Y().getOptionList(e),re=(e,t)=>Y().getShowcase(e,t),ie=e=>Y().getShowcasesFor(e),ae=()=>Y().libraries,oe=()=>Y().shelves,se=()=>Y().extends_,Q=20,$=new Map;function ce(e){let t=$.get(e);if(t)return $.delete(e),$.set(e,t),t}function le(e,t){for($.delete(e),$.set(e,{rows:t,ts:Date.now()});$.size>Q;){let e=$.keys().next();if(e.done)break;$.delete(e.value)}}function ue(e){for(let t of[...$.keys()])(t===e||t.startsWith(`${e}?`))&&$.delete(t)}function de(e,t){let n=String(t.id??``);if(n)for(let[r,i]of $){if(r!==e&&!r.startsWith(`${e}?`))continue;let a=!1,o=i.rows.map(e=>{if(String(e.id)!==n)return e;a=!0;let r={...e};for(let n of Object.keys(e))n in t&&(r[n]=t[n]);return r});a&&$.set(r,{rows:o,ts:i.ts})}}export{se as a,ne as c,re as d,ie as f,le as i,X as l,S as m,de as n,Z as o,J as p,ce as r,ae as s,ue as t,oe as u};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{n as e,r as t}from"./fields-BtCN_frr.js";import{s as n}from"./shelf-CRUDKiTz.js";import{t as r}from"./extend-BTkr7oJ8.js";import{n as i,r as a}from"./plugin-CFEkHH3f.js";var o=n({shelf:`personal_document`,library:`documents`,label:`documents.personal_document.label`,icon:`lucide:id-card`,views:{list:[`owner`,`type`,`surname`,`expires`]},fields:{name:e.title({label:`core.fields.name`}),about:e.illustrated({label:`documents.personal_document.fields.about`,fields:{image:e.avatar({ui:{role:`avatar`}}),text:e.text({rules:{max:1e3}})}}),idcard:e.idcard({number:{number:e.string({label:`documents.personal_document.fields.number`,rules:{max:50}})},meta:{issued:e.date({label:`documents.personal_document.fields.issued`}),authority:e.string({label:`documents.personal_document.fields.authority`,rules:{max:200}})}}),countdown:e.countdown({source:{expires:e.reminder({label:`documents.personal_document.fields.expires`,rules:{lead:60}})}}),surname:e.string({label:`documents.personal_document.fields.surname`,rules:{max:100},ui:{span:6}}),given_names:e.string({label:`documents.personal_document.fields.given_names`,rules:{max:200},ui:{span:6}}),birth_date:e.date({label:`documents.personal_document.fields.birth_date`,ui:{span:4}}),sex:e.string({label:`documents.personal_document.fields.sex`,strict:!0,noSearch:!0,options:[{value:`M`,title:`documents.personal_document.options.sex.M`},{value:`F`,title:`documents.personal_document.options.sex.F`}],ui:{span:4}}),nationality:e.string({label:`documents.personal_document.fields.nationality`,options:`countries`,strict:!0,noSearch:!0,ui:{span:4}}),owner:e.relation({label:`documents.personal_document.fields.owner`,options:t({library:`people`,shelf:`person`}),ui:{span:6}}),storage:e.relation({label:`documents.personal_document.fields.storage`,options:t({library:`things`,shelf:`storage_location`}),ui:{span:6}}),record_no:e.string({label:`documents.personal_document.fields.record_no`,rules:{max:50},ui:{span:6}}),mrz:e.string({label:`documents.personal_document.fields.mrz`,rules:{max:200},ui:{span:6}}),photos:e.image({label:`documents.personal_document.fields.photos`,multiple:!0}),type:e.string({label:`core.fields.type`,required:!0,strict:!0,noSearch:!0,options:[{value:`P`,title:`documents.personal_document.options.type.P`},{value:`PA`,title:`documents.personal_document.options.type.PA`},{value:`TP`,title:`documents.personal_document.options.type.TP`},{value:`ID`,title:`documents.personal_document.options.type.ID`},{value:`DL`,title:`documents.personal_document.options.type.DL`},{value:`BR`,title:`documents.personal_document.options.type.BR`},{value:`MC`,title:`documents.personal_document.options.type.MC`},{value:`OT`,title:`documents.personal_document.options.type.OT`}]}),tags:e.tags({label:`documents.personal_document.fields.tags`}),notes:e.text({label:`documents.personal_document.fields.notes`,rules:{max:1e3}})}}),s=r({id:`person_identity`,label:`documents.person_identity.label`,icon:`lucide:globe`,attachTo:[{library:`people`,shelf:`person`}],agent:`Canonical person identity (not tied to a physical document).
|
|
2
|
-
nationality — ISO alpha-2. variants — given/family name per language (field.keyed by lang: name+surname).`,fields:{nationality:e.string({label:`documents.person_identity.fields.nationality`,options:`countries`,strict:!0,noSearch:!0}),variants:e.keyed({label:`documents.person_identity.fields.variants`,icon:`lucide:languages`,fields:{lang:e.string({label:`documents.person_identity.variants.lang`,options:`languages`,strict:!0,noSearch:!0}),name:e.string({label:`documents.person_identity.variants.name`}),surname:e.string({label:`documents.person_identity.variants.surname`})},by:`lang`})}}),c=i({id:`documents`,version:`1.0.0`,dependsOn:[`people`,`things`],libraries:[{meta:a({id:`documents`,label:`documents.library.label`,icon:`lucide:id-card`,agent:`Personal documents — IDs, passports, licences (personal_document); tracks expiry
|
|
2
|
+
nationality — ISO alpha-2. variants — given/family name per language (field.keyed by lang: name+surname).`,fields:{nationality:e.string({label:`documents.person_identity.fields.nationality`,options:`countries`,strict:!0,noSearch:!0}),variants:e.keyed({label:`documents.person_identity.fields.variants`,icon:`lucide:languages`,fields:{lang:e.string({label:`documents.person_identity.variants.lang`,options:`languages`,strict:!0,noSearch:!0}),name:e.string({label:`documents.person_identity.variants.name`}),surname:e.string({label:`documents.person_identity.variants.surname`})},by:`lang`})}}),c=i({id:`documents`,version:`1.0.0`,dependsOn:[`people`,`things`],libraries:[{meta:a({id:`documents`,label:`documents.library.label`,icon:`lucide:id-card`,agent:`Personal documents — IDs, passports, licences (personal_document); tracks expiry.`,starterHint:`documents that are about to expire`}),shelves:[o]}],extends_:[s]});export{c as default};
|
|
@@ -3,4 +3,4 @@ wateringDays — watering interval (days). lastWatered — date of last watering
|
|
|
3
3
|
fertilizerDays — fertilizing interval. lastFertilized — last date.
|
|
4
4
|
planted — date planted/acquired.
|
|
5
5
|
nextWatering/nextFertilizing are COMPUTED by the server (last date + interval) and rejected on write:
|
|
6
|
-
to move them, write lastWatered/lastFertilized.`,views:{list:[`variety`,`location`,`wateringDays`,`lastWatered`]},fields:{name:e.title({label:`core.fields.name`}),about:e.illustrated({label:`garden.plant.fields.about`,fields:{image:e.avatar({ui:{role:`avatar`}}),text:e.text({rules:{max:1e3}})}}),photos:e.image({label:`garden.plant.fields.photos`,multiple:!0}),specimen:e.specimen({title:{variety:e.string({label:`garden.plant.fields.variety`,rules:{max:100}})},subtitle:{location:e.string({label:`garden.plant.fields.location`,strict:!0,noSearch:!0,options:[{value:`windowsill`,title:`garden.plant.options.location.windowsill`},{value:`balcony`,title:`garden.plant.options.location.balcony`},{value:`hanging`,title:`garden.plant.options.location.hanging`},{value:`floor`,title:`garden.plant.options.location.floor`},{value:`other`,title:`garden.plant.options.location.other`}]})},conditions:{sunlight:e.string({label:`garden.plant.fields.sunlight`,strict:!0,noSearch:!0,options:[{value:`shade`,title:`garden.plant.options.sunlight.shade`},{value:`partial`,title:`garden.plant.options.sunlight.partial`},{value:`indirect`,title:`garden.plant.options.sunlight.indirect`},{value:`direct`,title:`garden.plant.options.sunlight.direct`}]}),pot:e.string({label:`garden.plant.fields.pot`,rules:{max:100}})}}),planted:e.date({label:`garden.plant.fields.planted`,rules:{min:`2000-01-01`,max:`today`}}),wateringDays:e.int({label:`garden.plant.fields.wateringDays`,rules:{min:1,max:365},mutate:[`nextWatering`]}),lastWatered:e.date({label:`garden.plant.fields.lastWatered`,rules:{max:`today`},mutate:[`nextWatering`]}),countdown:e.countdown({source:{nextWatering:e.reminder({label:`garden.plant.fields.nextWatering`,rules:{lead:3},value:a(`lastWatered`,`wateringDays`)})}}),fertilizerDays:e.int({label:`garden.plant.fields.fertilizerDays`,rules:{min:1,max:365},mutate:[`nextFertilizing`]}),lastFertilized:e.date({label:`garden.plant.fields.lastFertilized`,rules:{max:`today`},mutate:[`nextFertilizing`]}),nextFertilizing:e.reminder({label:`garden.plant.fields.nextFertilizing`,rules:{lead:7},value:a(`lastFertilized`,`fertilizerDays`)}),button:e.button({label:`garden.plant.actions.watered`,value:`garden.watered`,icon:`lucide:droplet`}),button2:e.button({label:`garden.plant.actions.fertilized`,value:`garden.fertilized`,icon:`lucide:flask-conical`}),tags:e.tags({label:`garden.plant.fields.tags`}),notes:e.text({label:`garden.plant.fields.notes`,rules:{max:500}})}}),s=n({id:`garden`,version:`1.0.0`,dependsOn:[`things`],libraries:[{meta:r({id:`garden`,label:`garden.library.label`,icon:`lucide:sprout`,agent:`Garden plants (plant) — watering and fertilizing schedule
|
|
6
|
+
to move them, write lastWatered/lastFertilized.`,views:{list:[`variety`,`location`,`wateringDays`,`lastWatered`]},fields:{name:e.title({label:`core.fields.name`}),about:e.illustrated({label:`garden.plant.fields.about`,fields:{image:e.avatar({ui:{role:`avatar`}}),text:e.text({rules:{max:1e3}})}}),photos:e.image({label:`garden.plant.fields.photos`,multiple:!0}),specimen:e.specimen({title:{variety:e.string({label:`garden.plant.fields.variety`,rules:{max:100}})},subtitle:{location:e.string({label:`garden.plant.fields.location`,strict:!0,noSearch:!0,options:[{value:`windowsill`,title:`garden.plant.options.location.windowsill`},{value:`balcony`,title:`garden.plant.options.location.balcony`},{value:`hanging`,title:`garden.plant.options.location.hanging`},{value:`floor`,title:`garden.plant.options.location.floor`},{value:`other`,title:`garden.plant.options.location.other`}]})},conditions:{sunlight:e.string({label:`garden.plant.fields.sunlight`,strict:!0,noSearch:!0,options:[{value:`shade`,title:`garden.plant.options.sunlight.shade`},{value:`partial`,title:`garden.plant.options.sunlight.partial`},{value:`indirect`,title:`garden.plant.options.sunlight.indirect`},{value:`direct`,title:`garden.plant.options.sunlight.direct`}]}),pot:e.string({label:`garden.plant.fields.pot`,rules:{max:100}})}}),planted:e.date({label:`garden.plant.fields.planted`,rules:{min:`2000-01-01`,max:`today`}}),wateringDays:e.int({label:`garden.plant.fields.wateringDays`,rules:{min:1,max:365},mutate:[`nextWatering`]}),lastWatered:e.date({label:`garden.plant.fields.lastWatered`,rules:{max:`today`},mutate:[`nextWatering`]}),countdown:e.countdown({source:{nextWatering:e.reminder({label:`garden.plant.fields.nextWatering`,rules:{lead:3},value:a(`lastWatered`,`wateringDays`)})}}),fertilizerDays:e.int({label:`garden.plant.fields.fertilizerDays`,rules:{min:1,max:365},mutate:[`nextFertilizing`]}),lastFertilized:e.date({label:`garden.plant.fields.lastFertilized`,rules:{max:`today`},mutate:[`nextFertilizing`]}),nextFertilizing:e.reminder({label:`garden.plant.fields.nextFertilizing`,rules:{lead:7},value:a(`lastFertilized`,`fertilizerDays`)}),button:e.button({label:`garden.plant.actions.watered`,value:`garden.watered`,icon:`lucide:droplet`}),button2:e.button({label:`garden.plant.actions.fertilized`,value:`garden.fertilized`,icon:`lucide:flask-conical`}),tags:e.tags({label:`garden.plant.fields.tags`}),notes:e.text({label:`garden.plant.fields.notes`,rules:{max:500}})}}),s=n({id:`garden`,version:`1.0.0`,dependsOn:[`things`],libraries:[{meta:r({id:`garden`,label:`garden.library.label`,icon:`lucide:sprout`,agent:`Garden plants (plant) — watering and fertilizing schedule.`,starterHint:`plants due for watering or fertilizing`}),shelves:[o]}],fieldContribs:[{library:`things`,shelf:`item`,field:`type`,options:[{value:`garden`,title:`garden.contrib.type.garden`}]}]});export{s as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./fields-BtCN_frr.js";import{n as t}from"./plugin-CFEkHH3f.js";import{t as n}from"./settings-BfEurOH1.js";var r=1800,i={vision:!0,documents:!0,tools:!0,reasoning:!0},a={vision:!0,documents:!0,tools:!0,reasoning:!1};function o(e){return{labelKey:`claude-agent.models.${e}.label`,titleKey:`claude-agent.models.${e}.title`,hintKey:`claude-agent.models.${e}.hint`}}var s=[{value:`haiku`,id:`claude-haiku-4-5`,effort:``,quality:1,time:1,...o(`haiku`),capabilities:a},{value:`sonnet-medium`,id:`claude-sonnet-5`,effort:`medium`,quality:2,time:2,...o(`sonnet-medium`),capabilities:i},{value:`sonnet-high`,id:`claude-sonnet-5`,effort:`high`,quality:3,time:3,...o(`sonnet-high`),capabilities:i},{value:`opus-medium`,id:`claude-opus-5`,effort:`medium`,quality:4,time:4,...o(`opus-medium`),capabilities:i},{value:`opus-high`,id:`claude-opus-5`,effort:`high`,quality:5,time:5,...o(`opus-high`),capabilities:i}],c=t({id:`claude-agent`,version:`1.0.0`,dependsOn:[],fieldContribs:[{library:`_settings`,shelf:`system`,field:`agent_id`,options:[{value:`claude-agent`,title:`claude-agent.plugin.label`}]}],settings:n({label:`claude-agent.settings.label`,fields:{group:e.group({label:`claude-agent.settings.groups.runtime`,icon:`lucide:bot`,scope:`hoist`,fields:{auth_mode:e.string({label:`claude-agent.settings.auth_mode`,default:`subscription`,strict:!0,noSearch:!0,options:[{value:`subscription`,title:`claude-agent.settings.auth_mode_subscription`},{value:`api_key`,title:`claude-agent.settings.auth_mode_api_key`}]}),anthropic_api_key:e.password({label:`claude-agent.settings.anthropic_api_key`,ui:{hidden:{auth_mode:{$ne:`api_key`}}}}),claude_model:e.string({label:`claude-agent.settings.claude_model`,default:`haiku`,strict:!0,noSearch:!0,options:s.map(e=>({value:e.value,title:e.labelKey}))}),thinking_enabled:e.boolean({label:`claude-agent.settings.thinking_enabled`,default:!1}),skip_permissions:e.boolean({label:`claude-agent.settings.skip_permissions`,default:!0}),response_timeout:e.int({label:`claude-agent.settings.response_timeout`,default:r})}}),group2:e.group({label:`claude-agent.settings.groups.rag`,icon:`lucide:search`,scope:`hoist`,fields:{rag_enabled:e.boolean({label:`claude-agent.settings.rag_enabled`,default:!0}),openai_api_key:e.password({label:`claude-agent.settings.openai_api_key`})}}),group3:e.group({label:`claude-agent.settings.groups.langfuse`,icon:`lucide:activity`,scope:`hoist`,fields:{tracing_enabled:e.boolean({label:`claude-agent.settings.tracing_enabled`}),langfuse_base_url:e.string({label:`claude-agent.settings.langfuse_base_url`}),langfuse_public_key:e.password({label:`claude-agent.settings.langfuse_public_key`}),langfuse_secret_key:e.password({label:`claude-agent.settings.langfuse_secret_key`})}})}})});export{c as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import{n as e,r as t}from"./fields-BtCN_frr.js";import{s as n}from"./shelf-CRUDKiTz.js";import{n as r,r as i}from"./plugin-CFEkHH3f.js";var a=n({shelf:`meter_reading`,library:`home`,label:`home.meter_reading.label`,icon:`lucide:gauge`,agent:`Utility meter readings for a date. name — reading period, e.g. "2026-05".
|
|
2
2
|
date — reading date. cold_water/hot_water — water meter readings (m³).
|
|
3
3
|
electricity — electricity meter reading (kWh). gas — gas meter reading (m³).
|
|
4
|
-
Stores RAW cumulative readings, not consumption (the difference is a derived calculation).`,views:{title:`date`,inline:[`date`],list:[`cold_water`,`hot_water`,`electricity`,`gas`]},fields:{date:e.date({label:`home.meter_reading.fields.date`,required:!0,rules:{min:`2000-01-01`,max:`today`},ui:{span:12}}),cold_water:e.real({label:`home.meter_reading.fields.cold_water`,rules:{min:0},ui:{span:3}}),hot_water:e.real({label:`home.meter_reading.fields.hot_water`,rules:{min:0},ui:{span:3}}),electricity:e.real({label:`home.meter_reading.fields.electricity`,rules:{min:0},ui:{span:3}}),gas:e.real({label:`home.meter_reading.fields.gas`,rules:{min:0},ui:{span:3}}),notes:e.text({label:`home.meter_reading.fields.notes`,rules:{max:500}})}}),o=n({shelf:`room`,library:`home`,label:`home.room.label`,icon:`lucide:door-open`,agent:`A room/space in the apartment. name — name (Bedroom, Kitchen). area — area (m²). This is a reference list of places: a target for relations from material (where a material was used). Does not store the materials themselves.`,views:{inline:[`name`],list:[`area`]},fields:{name:e.title({label:`core.fields.name`,required:!0}),description:e.text({label:`home.room.fields.description`,rules:{max:1e3}}),area:e.measured({label:`home.room.fields.area`,units:`area`,rules:{min:0}}),notes:e.text({label:`home.room.fields.notes`,rules:{max:500}})}}),s=n({shelf:`material`,library:`home`,label:`home.material.label`,icon:`lucide:paint-roller`,agent:`A material/paint used in renovation. One record = a specific product (e.g. "Dulux Easycare, RAL 9010"). name — name, type — category, brand — manufacturer, color/color_code — color and tint code. rooms — relation to home/room (where used, can be several). price/quantity/store/bought_date/link — purchase data. photo/rating/notes — photos and impressions. Does NOT store a work log/timeline — only a catalog of "what was bought and where it is used".`,views:{inline:[`name`,`color`],list:[`type`,`color`,`brand`,`rooms`]},fields:{name:e.title({label:`core.fields.name`,required:!0}),description:e.text({label:`home.material.fields.description`,rules:{max:1e3}}),group:e.group({label:`home.material.group.identity`,icon:`lucide:tag`,scope:`hoist`,fields:{type:e.string({label:`core.fields.type`,strict:!0,noSearch:!0,options:[{value:`paint`,title:`home.material.options.type.paint`},{value:`primer`,title:`home.material.options.type.primer`},{value:`lacquer`,title:`home.material.options.type.lacquer`},{value:`enamel`,title:`home.material.options.type.enamel`},{value:`plaster`,title:`home.material.options.type.plaster`},{value:`tile`,title:`home.material.options.type.tile`},{value:`laminate`,title:`home.material.options.type.laminate`},{value:`wallpaper`,title:`home.material.options.type.wallpaper`},{value:`skirting`,title:`home.material.options.type.skirting`},{value:`panel`,title:`home.material.options.type.panel`},{value:`putty`,title:`home.material.options.type.putty`},{value:`glue`,title:`home.material.options.type.glue`},{value:`cement`,title:`home.material.options.type.cement`},{value:`drywall`,title:`home.material.options.type.drywall`},{value:`insulation`,title:`home.material.options.type.insulation`},{value:`fixture`,title:`home.material.options.type.fixture`},{value:`plumbing`,title:`home.material.options.type.plumbing`},{value:`other`,title:`home.material.options.type.other`}]}),brand:e.string({label:`home.material.fields.brand`,rules:{max:120}}),color:e.color({label:`home.material.fields.color`}),color_code:e.string({label:`home.material.fields.color_code`,rules:{max:60}}),rooms:e.relation({label:`home.material.fields.rooms`,options:t({library:`home`,shelf:`room`}),multiple:!0})}}),ledger:e.ledger({label:`home.material.group.purchase`,icon:`lucide:shopping-cart`,fields:{price:e.money({label:`home.material.fields.price`,rules:{min:0}}),currency:e.currency({label:`core.fields.currency`,default:`UAH`}),quantity:e.measured({label:`home.material.fields.quantity`,units:[{value:`l`,label:`core.units.l`},{value:`kg`,label:`core.units.kg`},{value:`m2`,label:`core.units.m2`},{value:`pcs`,label:`core.units.pcs`}],rules:{min:0}}),store:e.string({label:`home.material.fields.store`,rules:{max:120}}),bought_date:e.date({label:`home.material.fields.bought_date`,rules:{max:`today`}}),link:e.link({label:`home.material.fields.link`})}}),group2:e.group({label:`home.material.group.media`,icon:`lucide:image`,scope:`hoist`,fields:{photo:e.image({label:`home.material.fields.photo`,multiple:!0}),rating:e.rating({label:`home.material.fields.rating`,rules:{max:5}})}}),notes:e.text({label:`home.material.fields.notes`,rules:{max:2e3}})}}),c=r({id:`home`,version:`1.0.0`,dependsOn:[],libraries:[{meta:i({id:`home`,label:`home.library.label`,icon:`lucide:house`,agent:`The home itself — renovation materials, utility meter readings, rooms
|
|
4
|
+
Stores RAW cumulative readings, not consumption (the difference is a derived calculation).`,views:{title:`date`,inline:[`date`],list:[`cold_water`,`hot_water`,`electricity`,`gas`]},fields:{date:e.date({label:`home.meter_reading.fields.date`,required:!0,rules:{min:`2000-01-01`,max:`today`},ui:{span:12}}),cold_water:e.real({label:`home.meter_reading.fields.cold_water`,rules:{min:0},ui:{span:3}}),hot_water:e.real({label:`home.meter_reading.fields.hot_water`,rules:{min:0},ui:{span:3}}),electricity:e.real({label:`home.meter_reading.fields.electricity`,rules:{min:0},ui:{span:3}}),gas:e.real({label:`home.meter_reading.fields.gas`,rules:{min:0},ui:{span:3}}),notes:e.text({label:`home.meter_reading.fields.notes`,rules:{max:500}})}}),o=n({shelf:`room`,library:`home`,label:`home.room.label`,icon:`lucide:door-open`,agent:`A room/space in the apartment. name — name (Bedroom, Kitchen). area — area (m²). This is a reference list of places: a target for relations from material (where a material was used). Does not store the materials themselves.`,views:{inline:[`name`],list:[`area`]},fields:{name:e.title({label:`core.fields.name`,required:!0}),description:e.text({label:`home.room.fields.description`,rules:{max:1e3}}),area:e.measured({label:`home.room.fields.area`,units:`area`,rules:{min:0}}),notes:e.text({label:`home.room.fields.notes`,rules:{max:500}})}}),s=n({shelf:`material`,library:`home`,label:`home.material.label`,icon:`lucide:paint-roller`,agent:`A material/paint used in renovation. One record = a specific product (e.g. "Dulux Easycare, RAL 9010"). name — name, type — category, brand — manufacturer, color/color_code — color and tint code. rooms — relation to home/room (where used, can be several). price/quantity/store/bought_date/link — purchase data. photo/rating/notes — photos and impressions. Does NOT store a work log/timeline — only a catalog of "what was bought and where it is used".`,views:{inline:[`name`,`color`],list:[`type`,`color`,`brand`,`rooms`]},fields:{name:e.title({label:`core.fields.name`,required:!0}),description:e.text({label:`home.material.fields.description`,rules:{max:1e3}}),group:e.group({label:`home.material.group.identity`,icon:`lucide:tag`,scope:`hoist`,fields:{type:e.string({label:`core.fields.type`,strict:!0,noSearch:!0,options:[{value:`paint`,title:`home.material.options.type.paint`},{value:`primer`,title:`home.material.options.type.primer`},{value:`lacquer`,title:`home.material.options.type.lacquer`},{value:`enamel`,title:`home.material.options.type.enamel`},{value:`plaster`,title:`home.material.options.type.plaster`},{value:`tile`,title:`home.material.options.type.tile`},{value:`laminate`,title:`home.material.options.type.laminate`},{value:`wallpaper`,title:`home.material.options.type.wallpaper`},{value:`skirting`,title:`home.material.options.type.skirting`},{value:`panel`,title:`home.material.options.type.panel`},{value:`putty`,title:`home.material.options.type.putty`},{value:`glue`,title:`home.material.options.type.glue`},{value:`cement`,title:`home.material.options.type.cement`},{value:`drywall`,title:`home.material.options.type.drywall`},{value:`insulation`,title:`home.material.options.type.insulation`},{value:`fixture`,title:`home.material.options.type.fixture`},{value:`plumbing`,title:`home.material.options.type.plumbing`},{value:`other`,title:`home.material.options.type.other`}]}),brand:e.string({label:`home.material.fields.brand`,rules:{max:120}}),color:e.color({label:`home.material.fields.color`}),color_code:e.string({label:`home.material.fields.color_code`,rules:{max:60}}),rooms:e.relation({label:`home.material.fields.rooms`,options:t({library:`home`,shelf:`room`}),multiple:!0})}}),ledger:e.ledger({label:`home.material.group.purchase`,icon:`lucide:shopping-cart`,fields:{price:e.money({label:`home.material.fields.price`,rules:{min:0}}),currency:e.currency({label:`core.fields.currency`,default:`UAH`}),quantity:e.measured({label:`home.material.fields.quantity`,units:[{value:`l`,label:`core.units.l`},{value:`kg`,label:`core.units.kg`},{value:`m2`,label:`core.units.m2`},{value:`pcs`,label:`core.units.pcs`}],rules:{min:0}}),store:e.string({label:`home.material.fields.store`,rules:{max:120}}),bought_date:e.date({label:`home.material.fields.bought_date`,rules:{max:`today`}}),link:e.link({label:`home.material.fields.link`})}}),group2:e.group({label:`home.material.group.media`,icon:`lucide:image`,scope:`hoist`,fields:{photo:e.image({label:`home.material.fields.photo`,multiple:!0}),rating:e.rating({label:`home.material.fields.rating`,rules:{max:5}})}}),notes:e.text({label:`home.material.fields.notes`,rules:{max:2e3}})}}),c=r({id:`home`,version:`1.0.0`,dependsOn:[],libraries:[{meta:i({id:`home`,label:`home.library.label`,icon:`lucide:house`,agent:`The home itself — renovation materials, utility meter readings, rooms.`,starterHint:`meter readings that are overdue, or renovation materials running low`}),shelves:[a,o,s]}]});export{c as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,r as t,t as n}from"./src-DB2N_cct.js";export{e as default,n as fin,t as iban};
|