@svgrid/enterprise 3.1.63 → 3.1.64

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.
@@ -1527,7 +1527,7 @@ ${O}
1527
1527
  @keyframes st-home-spin { to { transform: rotate(360deg); } }
1528
1528
  </style>
1529
1529
  `}}function $S(t){for(let a of t)ss(a);let r=new Map(t.map(a=>[a.name,a])),n=t.map(a=>{let l=xse(a,r);return{schema:kse(a,l),infos:l}});return{entries:n,seed:_se(n)}}function ED(t,r={}){let{entries:n,seed:a}=$S(t),{file:l,needs:i}=Vse(n,a,r.sources,r.supabaseConn,r.serverMemory),o=[Cse(n),l];(i.supabase||r.supabaseAuth)&&!i.supabaseUrl&&(r.supabaseConn?.url||r.supabaseConn?.key)&&(i.supabaseUrl=r.supabaseConn.url,i.supabaseKey=r.supabaseConn.key),(i.supabase||r.supabaseAuth)&&o.push(Hse(i));for(let s of i.sqlRoutes)o.push(Fse(s.schema,s.table,s.dialect,{access:r.accessEnabled,audit:r.auditEnabled,screenIds:r.screensByEntity?.get(s.schema.name)??[],triggers:r.triggers?.[s.schema.name],dbSchema:s.dbSchema,tenantField:r.tenantField&&r.tenantScoped?.(s.schema.name)!==!1?r.tenantField:void 0}));if(i.memoryRoutes.length){o.push(Lse(i.memoryRoutes));for(let s of i.memoryRoutes)o.push(Ose(s.schema,{access:r.accessEnabled,audit:r.auditEnabled,screenIds:r.screensByEntity?.get(s.schema.name)??[],triggers:r.triggers?.[s.schema.name],tenantField:r.tenantField&&r.tenantScoped?.(s.schema.name)!==!1?r.tenantField:void 0}))}return{files:o,prepared:n.map(s=>s.schema)}}function Kse(t){if(t.length===0)throw Error("emitStudioApp: no schemas to emit");let{files:r,prepared:n}=ED(t),a=n.map(i=>{let o=Oa(i);return{href:`/${o.route}`,label:o.label}}),l={path:"src/custom.css",description:"Your custom styles (imported after app.css so it overrides).",userOwned:!0,contents:`/* Your custom styles. Imported after app.css, so these rules override the defaults. */
1530
- `};return[...r,...n.map(i=>Wse(i)),AD(a),MD(a),l]}var Gse="3.1.63",Yse="3.0.39",hl=(t,r)=>t.some(n=>n.config.kind===r),RD=t=>`activeTab_${t.replace(/[^a-zA-Z0-9_$]/g,"_")}`,Zm=(t,r)=>`${t}-${r}`,ID=t=>`accOpen_${t.replace(/[^a-zA-Z0-9_$]/g,"_")}`,Qm=(t,r)=>`${t}-s${r}`,ev=t=>`md_${t.replace(/[^a-zA-Z0-9]/g,"_")}_rows`;function Xse(t){switch(t.type){case"number":{let r=t.decimals;return r==null?"{ type: 'number' }":`{ type: 'number', options: { minimumFractionDigits: ${r}, maximumFractionDigits: ${r} } }`}case"currency":return`{ type: 'currency', currency: ${en(t.currency||"USD")} }`;case"percent":{let r=["type: 'percent'"];return t.valueIsPercentPoints&&r.push("valueIsPercentPoints: true"),t.decimals!=null&&r.push(`options: { minimumFractionDigits: ${t.decimals}, maximumFractionDigits: ${t.decimals} }`),`{ ${r.join(", ")} }`}case"date":case"datetime":return t.pattern?`{ type: '${t.type}', pattern: ${en(t.pattern)} }`:`{ type: '${t.type}' }`}}function Jse(t,r,n,a){if(r.config.kind!=="grid")return`schemaToColumns(${t})`;let l=r.config,i=r.id.replace(/-/g,"_"),o=l.columns.filter(b=>b.show),s=new Set(o.map(b=>b.field)),c=new Set,d=o.map(b=>{let w=a?.get(b.field);return{c:b,col:w&&!s.has(w)?w:b.field}}).filter(b=>!c.has(b.col)&&!!c.add(b.col)),u=l.editing==="inline"?"":", editable: false";if(d.length===0)return u?`schemaToColumns(${t}).map((c) => ({ ...c${u} }))`:`schemaToColumns(${t})`;let p=d.map(b=>`'${b.col}'`),f=d.map(({c:b,col:w})=>{let v=[];return b.header&&v.push(`header: ${JSON.stringify(b.header)}`),b.width!=null&&v.push(`width: ${b.width}`),b.align&&v.push(`align: '${b.align}'`),b.aggregate&&v.push(`aggregate: '${b.aggregate}'`),l.treeData&&b.field===l.treeData.labelField&&n?v.push(`cell: (ctx: CellContext<${n}>) => renderSnippet(treeCell_${i}, { value: ctx.getValue(), row: ctx.row.original })`):b.cellType&&n?v.push(`cell: (ctx: CellContext<${n}>) => renderSnippet(${zD(i,b.field)}, { value: ctx.getValue() })`):b.format&&v.push(`format: ${Xse(b.format)}`),v.length?`'${w}': { ${v.join(", ")} }`:null}).filter(b=>!!b),y=f.length?` const ov: Record<string, Partial<(typeof all)[number]>> = { ${f.join(", ")} };`:"",h=f.length?", ...(ov[String(c.field)] ?? {})":"",_=`[${p.join(", ")}].map((f) => all.find((c) => c.field === f)).filter((c): c is (typeof all)[number] => !!c)`;return`(() => { const all = schemaToColumns(${t});${y} return ${u||h?`${_}.map((c) => ({ ...c${u}${h} }))`:_} })()`}function tc(t,r){let n=[`grid-column: span ${Xie(t)}`,"min-width: 0"];r&&n.push(r);let a=Zie(t.style);return a&&n.push(a),`style="${n.join("; ")}"`}var Zse=t=>t&&t.replace(/[^#a-zA-Z0-9(),.%\s_-]/g,"").slice(0,40)||"var(--sg-accent)";function Nu(t,r){let n=[r,Yie(t)].filter(Boolean).join(" ");return n?` class="${n}"`:""}function n1(t){let r=cS(t.className);return r?` ${r}`:""}function Qse(t){let r=Af(t);if(r==="grid"){let n=goe(t),a=n.maxWidth?` max-width: ${n.maxWidth}px; margin-inline: auto;`:"";return` .st-screen { grid-template-columns: repeat(12, 1fr); gap: ${n.rowGap}px ${n.colGap}px; align-items: ${n.align};${a} }
1530
+ `};return[...r,...n.map(i=>Wse(i)),AD(a),MD(a),l]}var Gse="3.1.64",Yse="3.0.39",hl=(t,r)=>t.some(n=>n.config.kind===r),RD=t=>`activeTab_${t.replace(/[^a-zA-Z0-9_$]/g,"_")}`,Zm=(t,r)=>`${t}-${r}`,ID=t=>`accOpen_${t.replace(/[^a-zA-Z0-9_$]/g,"_")}`,Qm=(t,r)=>`${t}-s${r}`,ev=t=>`md_${t.replace(/[^a-zA-Z0-9]/g,"_")}_rows`;function Xse(t){switch(t.type){case"number":{let r=t.decimals;return r==null?"{ type: 'number' }":`{ type: 'number', options: { minimumFractionDigits: ${r}, maximumFractionDigits: ${r} } }`}case"currency":return`{ type: 'currency', currency: ${en(t.currency||"USD")} }`;case"percent":{let r=["type: 'percent'"];return t.valueIsPercentPoints&&r.push("valueIsPercentPoints: true"),t.decimals!=null&&r.push(`options: { minimumFractionDigits: ${t.decimals}, maximumFractionDigits: ${t.decimals} }`),`{ ${r.join(", ")} }`}case"date":case"datetime":return t.pattern?`{ type: '${t.type}', pattern: ${en(t.pattern)} }`:`{ type: '${t.type}' }`}}function Jse(t,r,n,a){if(r.config.kind!=="grid")return`schemaToColumns(${t})`;let l=r.config,i=r.id.replace(/-/g,"_"),o=l.columns.filter(b=>b.show),s=new Set(o.map(b=>b.field)),c=new Set,d=o.map(b=>{let w=a?.get(b.field);return{c:b,col:w&&!s.has(w)?w:b.field}}).filter(b=>!c.has(b.col)&&!!c.add(b.col)),u=l.editing==="inline"?"":", editable: false";if(d.length===0)return u?`schemaToColumns(${t}).map((c) => ({ ...c${u} }))`:`schemaToColumns(${t})`;let p=d.map(b=>`'${b.col}'`),f=d.map(({c:b,col:w})=>{let v=[];return b.header&&v.push(`header: ${JSON.stringify(b.header)}`),b.width!=null&&v.push(`width: ${b.width}`),b.align&&v.push(`align: '${b.align}'`),b.aggregate&&v.push(`aggregate: '${b.aggregate}'`),l.treeData&&b.field===l.treeData.labelField&&n?v.push(`cell: (ctx: CellContext<${n}>) => renderSnippet(treeCell_${i}, { value: ctx.getValue(), row: ctx.row.original })`):b.cellType&&n?v.push(`cell: (ctx: CellContext<${n}>) => renderSnippet(${zD(i,b.field)}, { value: ctx.getValue() })`):b.format&&v.push(`format: ${Xse(b.format)}`),v.length?`'${w}': { ${v.join(", ")} }`:null}).filter(b=>!!b),y=f.length?` const ov: Record<string, Partial<(typeof all)[number]>> = { ${f.join(", ")} };`:"",h=f.length?", ...(ov[String(c.field)] ?? {})":"",_=`[${p.join(", ")}].map((f) => all.find((c) => c.field === f)).filter((c): c is (typeof all)[number] => !!c)`;return`(() => { const all = schemaToColumns(${t});${y} return ${u||h?`${_}.map((c) => ({ ...c${u}${h} }))`:_} })()`}function tc(t,r){let n=[`grid-column: span ${Xie(t)}`,"min-width: 0"];r&&n.push(r);let a=Zie(t.style);return a&&n.push(a),`style="${n.join("; ")}"`}var Zse=t=>t&&t.replace(/[^#a-zA-Z0-9(),.%\s_-]/g,"").slice(0,40)||"var(--sg-accent)";function Nu(t,r){let n=[r,Yie(t)].filter(Boolean).join(" ");return n?` class="${n}"`:""}function n1(t){let r=cS(t.className);return r?` ${r}`:""}function Qse(t){let r=Af(t);if(r==="grid"){let n=goe(t),a=n.maxWidth?` max-width: ${n.maxWidth}px; margin-inline: auto;`:"";return` .st-screen { grid-template-columns: repeat(12, 1fr); gap: ${n.rowGap}px ${n.colGap}px; align-items: ${n.align};${a} }
1531
1531
  @media (max-width: ${n.mobileBreakpoint}px) { .st-screen { grid-template-columns: 1fr; gap: 12px; } }
1532
1532
  `}if(r==="stack"){let n=foe(t),a=n.maxWidth?` max-width: ${n.maxWidth}px;${n.align==="center"?" margin-inline: auto;":""}`:"",l=n.minHeight?`
1533
1533
  .st-stack > * { min-height: ${n.minHeight}px; }`:"",i=n.dividers?`
@@ -76332,7 +76332,7 @@ ${st}
76332
76332
  .st-home a { color: var(--sg-accent, #6366f1); font-weight: 600; }
76333
76333
  @keyframes st-home-spin { to { transform: rotate(360deg); } }
76334
76334
  </style>
76335
- `}}function s2e(a){for(let p of a)G4(p);let i=new Map(a.map(p=>[p.name,p])),l=a.map(p=>{let f=kpr(p,i);return{schema:Ppr(p,f),infos:f}});return{entries:l,seed:Cpr(l)}}function rur(a,i={}){let{entries:l,seed:p}=s2e(a),{file:f,needs:g}=Ypr(l,p,i.sources,i.supabaseConn,i.serverMemory),_=[Opr(l),f];(g.supabase||i.supabaseAuth)&&!g.supabaseUrl&&(i.supabaseConn?.url||i.supabaseConn?.key)&&(g.supabaseUrl=i.supabaseConn.url,g.supabaseKey=i.supabaseConn.key),(g.supabase||i.supabaseAuth)&&_.push(Zpr(g));for(let S of g.sqlRoutes)_.push(Upr(S.schema,S.table,S.dialect,{access:i.accessEnabled,audit:i.auditEnabled,screenIds:i.screensByEntity?.get(S.schema.name)??[],triggers:i.triggers?.[S.schema.name],dbSchema:S.dbSchema,tenantField:i.tenantField&&i.tenantScoped?.(S.schema.name)!==!1?i.tenantField:void 0}));if(g.memoryRoutes.length){_.push(Hpr(g.memoryRoutes));for(let S of g.memoryRoutes)_.push(Vpr(S.schema,{access:i.accessEnabled,audit:i.auditEnabled,screenIds:i.screensByEntity?.get(S.schema.name)??[],triggers:i.triggers?.[S.schema.name],tenantField:i.tenantField&&i.tenantScoped?.(S.schema.name)!==!1?i.tenantField:void 0}))}return{files:_,prepared:l.map(S=>S.schema)}}var nur="3.1.63",our="3.0.39",sb=(a,i)=>a.some(l=>l.config.kind===i),qit=a=>`activeTab_${a.replace(/[^a-zA-Z0-9_$]/g,"_")}`,XZ=(a,i)=>`${a}-${i}`,Kit=a=>`accOpen_${a.replace(/[^a-zA-Z0-9_$]/g,"_")}`,JZ=(a,i)=>`${a}-s${i}`,YZ=a=>`md_${a.replace(/[^a-zA-Z0-9]/g,"_")}_rows`;function aur(a){switch(a.type){case"number":{let i=a.decimals;return i==null?"{ type: 'number' }":`{ type: 'number', options: { minimumFractionDigits: ${i}, maximumFractionDigits: ${i} } }`}case"currency":return`{ type: 'currency', currency: ${cu(a.currency||"USD")} }`;case"percent":{let i=["type: 'percent'"];return a.valueIsPercentPoints&&i.push("valueIsPercentPoints: true"),a.decimals!=null&&i.push(`options: { minimumFractionDigits: ${a.decimals}, maximumFractionDigits: ${a.decimals} }`),`{ ${i.join(", ")} }`}case"date":case"datetime":return a.pattern?`{ type: '${a.type}', pattern: ${cu(a.pattern)} }`:`{ type: '${a.type}' }`}}function iur(a,i,l,p){if(i.config.kind!=="grid")return`schemaToColumns(${a})`;let f=i.config,g=i.id.replace(/-/g,"_"),_=f.columns.filter(be=>be.show),S=new Set(_.map(be=>be.field)),A=new Set,k=_.map(be=>{let Be=p?.get(be.field);return{c:be,col:Be&&!S.has(Be)?Be:be.field}}).filter(be=>!A.has(be.col)&&!!A.add(be.col)),L=f.editing==="inline"?"":", editable: false";if(k.length===0)return L?`schemaToColumns(${a}).map((c) => ({ ...c${L} }))`:`schemaToColumns(${a})`;let F=k.map(be=>`'${be.col}'`),ee=k.map(({c:be,col:Be})=>{let Ue=[];return be.header&&Ue.push(`header: ${JSON.stringify(be.header)}`),be.width!=null&&Ue.push(`width: ${be.width}`),be.align&&Ue.push(`align: '${be.align}'`),be.aggregate&&Ue.push(`aggregate: '${be.aggregate}'`),f.treeData&&be.field===f.treeData.labelField&&l?Ue.push(`cell: (ctx: CellContext<${l}>) => renderSnippet(treeCell_${g}, { value: ctx.getValue(), row: ctx.row.original })`):be.cellType&&l?Ue.push(`cell: (ctx: CellContext<${l}>) => renderSnippet(${est(g,be.field)}, { value: ctx.getValue() })`):be.format&&Ue.push(`format: ${aur(be.format)}`),Ue.length?`'${Be}': { ${Ue.join(", ")} }`:null}).filter(be=>!!be),J=ee.length?` const ov: Record<string, Partial<(typeof all)[number]>> = { ${ee.join(", ")} };`:"",te=ee.length?", ...(ov[String(c.field)] ?? {})":"",Ie=`[${F.join(", ")}].map((f) => all.find((c) => c.field === f)).filter((c): c is (typeof all)[number] => !!c)`;return`(() => { const all = schemaToColumns(${a});${J} return ${L||te?`${Ie}.map((c) => ({ ...c${L}${te} }))`:Ie} })()`}function eW(a,i){let l=[`grid-column: span ${yM(a)}`,"min-width: 0"];i&&l.push(i);let p=vit(a.style);return p&&l.push(p),`style="${l.join("; ")}"`}var sur=a=>a&&a.replace(/[^#a-zA-Z0-9(),.%\s_-]/g,"").slice(0,40)||"var(--sg-accent)";function z8(a,i){let l=[i,LH(a)].filter(Boolean).join(" ");return l?` class="${l}"`:""}function ofe(a){let i=WZ(a.className);return i?` ${i}`:""}function lur(a){let i=iR(a);if(i==="grid"){let l=qDe(a),p=l.maxWidth?` max-width: ${l.maxWidth}px; margin-inline: auto;`:"";return` .st-screen { grid-template-columns: repeat(12, 1fr); gap: ${l.rowGap}px ${l.colGap}px; align-items: ${l.align};${p} }
76335
+ `}}function s2e(a){for(let p of a)G4(p);let i=new Map(a.map(p=>[p.name,p])),l=a.map(p=>{let f=kpr(p,i);return{schema:Ppr(p,f),infos:f}});return{entries:l,seed:Cpr(l)}}function rur(a,i={}){let{entries:l,seed:p}=s2e(a),{file:f,needs:g}=Ypr(l,p,i.sources,i.supabaseConn,i.serverMemory),_=[Opr(l),f];(g.supabase||i.supabaseAuth)&&!g.supabaseUrl&&(i.supabaseConn?.url||i.supabaseConn?.key)&&(g.supabaseUrl=i.supabaseConn.url,g.supabaseKey=i.supabaseConn.key),(g.supabase||i.supabaseAuth)&&_.push(Zpr(g));for(let S of g.sqlRoutes)_.push(Upr(S.schema,S.table,S.dialect,{access:i.accessEnabled,audit:i.auditEnabled,screenIds:i.screensByEntity?.get(S.schema.name)??[],triggers:i.triggers?.[S.schema.name],dbSchema:S.dbSchema,tenantField:i.tenantField&&i.tenantScoped?.(S.schema.name)!==!1?i.tenantField:void 0}));if(g.memoryRoutes.length){_.push(Hpr(g.memoryRoutes));for(let S of g.memoryRoutes)_.push(Vpr(S.schema,{access:i.accessEnabled,audit:i.auditEnabled,screenIds:i.screensByEntity?.get(S.schema.name)??[],triggers:i.triggers?.[S.schema.name],tenantField:i.tenantField&&i.tenantScoped?.(S.schema.name)!==!1?i.tenantField:void 0}))}return{files:_,prepared:l.map(S=>S.schema)}}var nur="3.1.64",our="3.0.39",sb=(a,i)=>a.some(l=>l.config.kind===i),qit=a=>`activeTab_${a.replace(/[^a-zA-Z0-9_$]/g,"_")}`,XZ=(a,i)=>`${a}-${i}`,Kit=a=>`accOpen_${a.replace(/[^a-zA-Z0-9_$]/g,"_")}`,JZ=(a,i)=>`${a}-s${i}`,YZ=a=>`md_${a.replace(/[^a-zA-Z0-9]/g,"_")}_rows`;function aur(a){switch(a.type){case"number":{let i=a.decimals;return i==null?"{ type: 'number' }":`{ type: 'number', options: { minimumFractionDigits: ${i}, maximumFractionDigits: ${i} } }`}case"currency":return`{ type: 'currency', currency: ${cu(a.currency||"USD")} }`;case"percent":{let i=["type: 'percent'"];return a.valueIsPercentPoints&&i.push("valueIsPercentPoints: true"),a.decimals!=null&&i.push(`options: { minimumFractionDigits: ${a.decimals}, maximumFractionDigits: ${a.decimals} }`),`{ ${i.join(", ")} }`}case"date":case"datetime":return a.pattern?`{ type: '${a.type}', pattern: ${cu(a.pattern)} }`:`{ type: '${a.type}' }`}}function iur(a,i,l,p){if(i.config.kind!=="grid")return`schemaToColumns(${a})`;let f=i.config,g=i.id.replace(/-/g,"_"),_=f.columns.filter(be=>be.show),S=new Set(_.map(be=>be.field)),A=new Set,k=_.map(be=>{let Be=p?.get(be.field);return{c:be,col:Be&&!S.has(Be)?Be:be.field}}).filter(be=>!A.has(be.col)&&!!A.add(be.col)),L=f.editing==="inline"?"":", editable: false";if(k.length===0)return L?`schemaToColumns(${a}).map((c) => ({ ...c${L} }))`:`schemaToColumns(${a})`;let F=k.map(be=>`'${be.col}'`),ee=k.map(({c:be,col:Be})=>{let Ue=[];return be.header&&Ue.push(`header: ${JSON.stringify(be.header)}`),be.width!=null&&Ue.push(`width: ${be.width}`),be.align&&Ue.push(`align: '${be.align}'`),be.aggregate&&Ue.push(`aggregate: '${be.aggregate}'`),f.treeData&&be.field===f.treeData.labelField&&l?Ue.push(`cell: (ctx: CellContext<${l}>) => renderSnippet(treeCell_${g}, { value: ctx.getValue(), row: ctx.row.original })`):be.cellType&&l?Ue.push(`cell: (ctx: CellContext<${l}>) => renderSnippet(${est(g,be.field)}, { value: ctx.getValue() })`):be.format&&Ue.push(`format: ${aur(be.format)}`),Ue.length?`'${Be}': { ${Ue.join(", ")} }`:null}).filter(be=>!!be),J=ee.length?` const ov: Record<string, Partial<(typeof all)[number]>> = { ${ee.join(", ")} };`:"",te=ee.length?", ...(ov[String(c.field)] ?? {})":"",Ie=`[${F.join(", ")}].map((f) => all.find((c) => c.field === f)).filter((c): c is (typeof all)[number] => !!c)`;return`(() => { const all = schemaToColumns(${a});${J} return ${L||te?`${Ie}.map((c) => ({ ...c${L}${te} }))`:Ie} })()`}function eW(a,i){let l=[`grid-column: span ${yM(a)}`,"min-width: 0"];i&&l.push(i);let p=vit(a.style);return p&&l.push(p),`style="${l.join("; ")}"`}var sur=a=>a&&a.replace(/[^#a-zA-Z0-9(),.%\s_-]/g,"").slice(0,40)||"var(--sg-accent)";function z8(a,i){let l=[i,LH(a)].filter(Boolean).join(" ");return l?` class="${l}"`:""}function ofe(a){let i=WZ(a.className);return i?` ${i}`:""}function lur(a){let i=iR(a);if(i==="grid"){let l=qDe(a),p=l.maxWidth?` max-width: ${l.maxWidth}px; margin-inline: auto;`:"";return` .st-screen { grid-template-columns: repeat(12, 1fr); gap: ${l.rowGap}px ${l.colGap}px; align-items: ${l.align};${p} }
76336
76336
  @media (max-width: ${l.mobileBreakpoint}px) { .st-screen { grid-template-columns: 1fr; gap: 12px; } }
76337
76337
  `}if(i==="stack"){let l=que(a),p=l.maxWidth?` max-width: ${l.maxWidth}px;${l.align==="center"?" margin-inline: auto;":""}`:"",f=l.minHeight?`
76338
76338
  .st-stack > * { min-height: ${l.minHeight}px; }`:"",g=l.dividers?`
@@ -4,7 +4,7 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>SvGrid Studio - Designer</title>
7
- <script type="module" crossorigin src="./assets/index-BxlgvZk3.js"></script>
7
+ <script type="module" crossorigin src="./assets/index-C1IclnOu.js"></script>
8
8
  <link rel="modulepreload" crossorigin href="./assets/rolldown-runtime-Dd_uD5pT.js">
9
9
  <link rel="modulepreload" crossorigin href="./assets/index-client-CwjHmKgT.js">
10
10
  <link rel="modulepreload" crossorigin href="./assets/disclose-version-xihTtKlq.js">
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import{recordActionsFor}from"./record-actions";import{commentSnippets}from"./comment-snippets.svelte";import{onDestroy,onMount,tick,untrack}from"svelte";import{commentDraftsOf,getRecordRequest,holdForRecordEditor}from"./editor-request.svelte";import{SvModal,announce,toast}from"@svgrid/grid";import FieldInput from"./FieldInput.svelte";import{fieldPropsOf,getFieldType,originalColumn,ruleFieldNames}from"./registry.svelte";import{protectionText}from"./field-access.svelte";import{isReadOnlyGrid}from"./base-share";import{canCommentIn,canDeleteRecord}from"./base-permissions";import{askDeleteRecord}from"./record-delete.svelte";import{cellText,dataRows,fieldColumns,leafFilter,primaryIdOf}from"./grid-access";import{recordWalkOf}from"./record-walk";import{addComment,commentStoreTakes,commentVotes,commentsOf,commentsTakeVotes,deleteComment,editComment,historyOf,historyState,loadHistory,markSeen,mayVoteComment,myCommentVote,ownsComment,timeAgo,unseenOf,voteComment}from"./activity.svelte";import{uploadAttachment}from"./attachments";import{findFieldUser}from"./sources.svelte";import{encodeMentions,mentionText,parseMentions}from"./mentions";import MentionInput from"./MentionInput.svelte";import{dictationSupported,dictate,withSaid}from"./dictation.svelte";import UserFace from"./UserFace.svelte";import{recordProposalsFor}from"../review/card-marks.svelte";import{bm,bmCount}from"./messages.svelte";let{ctrl,rowId,editPrimary=false,focus,onClose}=$props();let current=$state(rowId);let open=$state(true);let editing=$state(null);let showHidden=$state(false);let comment=$state("");let picked=$state([]);const rows=$derived(ctrl.allRows??[]);let lastAt=-1;function rowIndexOf(list,id){if(id==null)return-1;for(const near of[lastAt,untrack(()=>ctrl.activeCell?.rowIndex??-1)]){if(near<0)continue;for(let d=0;d<=200;d++){if(list[near+d]?.id===id)return lastAt=near+d;if(d&&near-d>=0&&list[near-d]?.id===id)return lastAt=near-d}}return lastAt=list.findIndex(r=>r.id===id)}const index=$derived(rowIndexOf(rows,current));const row=$derived(index>=0?rows[index]:null);const isDraft=$derived(!!ctrl.props?.baseIsDraft?.(current));let lastIndex=0;const at=$derived.by(()=>{if(index>=0)lastIndex=index;return lastIndex});const walk=$derived(recordWalkOf(ctrl));const model=$derived(ctrl.props?.rowModel);const grouped=$derived((ctrl.groupingColumns??[]).length>0);const notRead=r=>String(r.id).startsWith("sv-ph:");function isRecord(r){const kind=r.original?.__group?.kind;return kind?kind==="leaf":r.__treeRow||!(typeof r.getCanExpand==="function"&&r.getCanExpand())}function rowFrom(from,by){for(let i=from+by;i>=0&&i<rows.length;i+=by){const r=rows[i];if(notRead(r)||isRecord(r))return i}return-1}function rowBeside(by){const seen=at;return rowFrom(index>=0?index:by>0?seen-1:seen,by)}let located=$state(0);const walkPlace=$derived(walk&&!isDraft?(void located,walk.place(current)):null);let lastPlace=-1;const walkAt=$derived.by(()=>{if(walkPlace!=null)lastPlace=walkPlace;return lastPlace});const walkFrom=by=>walkPlace!=null?walkAt:by>0?walkAt-1:walkAt;const canPrev=$derived(walk?walkAt>=0&&walk.has(walkFrom(-1),-1):rowBeside(-1)>=0);const canNext=$derived(walk?walkAt>=0&&walk.has(walkFrom(1),1):rowBeside(1)>=0);const records=$derived(!model&&grouped?dataRows(ctrl):null);const total=$derived(walk?walk.total():model?.getState?model.recordCount?.()??model.getState().rowCount??rows.length:(records??rows).length);const locale=$derived(ctrl.props?.localization?.locale);const place=$derived.by(()=>{if(isDraft)return null;if(walk)return walkPlace;if(index<0)return null;if(model)return grouped||model.isPinned?.(current)?null:index-Math.max(0,rows.length-total);return records?records.findIndex(r=>r.id===current):index});const positionText=$derived.by(()=>{if(isDraft)return bm("record.newRecord");if(!walk&&index<0)return bmCount("record.notInView",total,{count:total.toLocaleString(locale)});if(place==null)return bmCount("viewbar.records",total);return bm("record.position",{index:(place+1).toLocaleString(locale),total:total.toLocaleString(locale)})});const filteredOut=$derived.by(()=>{if(!row)return false;const keep=leafFilter(ctrl);return!!keep&&!keep(row)});const columns=$derived((ctrl.allColumns??[]).filter(c=>!c.id.startsWith("__")&&(c.columnDef.field!=null||c.columnDef.fieldFn!=null)));const hidden=$derived.by(()=>{const shownIds=new Set(columns.map(c=>c.id));return fieldColumns(ctrl).filter(c=>!shownIds.has(c.id)).map(c=>({id:c.id,columnDef:c.def}))});function valueOf(c){if(!row)return void 0;const base=c.columnDef.fieldFn?c.columnDef.fieldFn(row.original):row.original?.[c.columnDef.field];return ctrl.getCellDisplayValue(row.id,c.id,columns.includes(c)?row.getCellValueByColumnId(c.id):base)}const asField=c=>({id:c.id,field:String(c.columnDef.field??c.id),header:label(c),fieldType:c.columnDef.fieldType,def:c.columnDef,visible:true});const primaryId=$derived(primaryIdOf(ctrl));const primary=$derived(columns.find(c=>c.id===primaryId)??columns.find(c=>c.columnDef.fieldType==="text"||!c.columnDef.fieldType&&c.columnDef.editorType==null)??columns[0]);const title=$derived(row&&primary?cellText(asField(primary),valueOf(primary),row)||bm("record.untitled"):bm("record.record"));function label(c){return typeof c.columnDef.header==="string"?c.columnDef.header:c.id}const protectionOf=c=>c.columnDef.fieldType?protectionText(originalColumn(c.columnDef),fieldPropsOf(originalColumn(c.columnDef)),ruleFieldNames(c.columnDef)):null;const iconOf=c=>c.columnDef.fieldType?getFieldType(c.columnDef.fieldType)?.icon:void 0;function editable(c){if(!row||!ctrl.editingEnabled)return false;const ci=ctrl.allColumns.findIndex(x=>x.id===c.id);if(ci<0)return false;return ctrl.isCellEditableAt?!!ctrl.isCellEditableAt(index,ci):c.columnDef.editable!==false}const editorOpen=$derived(editing!=null);$effect(()=>{if(editorOpen)return untrack(holdForRecordEditor)});onMount(()=>{if(editPrimary&&primary&&editable(primary))editing=primary.id});let settled=$state(false);const settling=setTimeout(()=>settled=true,400);onDestroy(()=>{clearTimeout(settling);walk?.stop?.()});let locating=null;$effect(()=>{const w=walk;const r=row;if(!w?.locate||!r||isDraft||walkPlace!=null||locating===r.id)return;locating=r.id;untrack(()=>void w.locate(r.id,r.original).finally(()=>located+=1))});let commentBox=$state(null);const commentFocusFor=r=>r?.focus==="comment"&&r.ctrl===ctrl;const initialFocus=()=>focus==="comment"||commentFocusFor(getRecordRequest())?commentBox:null;$effect(()=>{const r=getRecordRequest();if(!commentFocusFor(r))return;untrack(()=>{if(r.rowId!==current)current=r.rowId;queueMicrotask(()=>commentBox?.focus())})});let listening=$state(null);const speakable=c=>dictationSupported()&&(c.columnDef.fieldType==="text"||c.columnDef.fieldType==="longText");async function speakInto(c){if(listening)return;listening=c.id;try{const said=await dictate();if(said)commit(c,withSaid(row?.getCellValueByColumnId?.(c.id),said,c.columnDef.fieldType==="longText"))}finally{listening=null}}async function speakComment(){if(listening)return;listening=":comment";try{const said=await dictate();if(said)comment=withSaid(comment,said,false)}finally{listening=null}}function commit(c,v){editing=null;if(!row||v===void 0)return;const none=x=>x==null||x===""||Array.isArray(x)&&!x.length;if(none(v)&&none(row.getCellValueByColumnId?.(c.id)))return;const at2=rowIndexOf(ctrl.allRows,current);if(at2<0||!ctrl.startEditing(at2,c.id))return;ctrl.updateEditingCellValue(v);ctrl.saveEditingCell()}let fieldsBox=$state(null);const focusField=id=>[...fieldsBox?.querySelectorAll("[data-frv-field]")??[]].find(el=>el.dataset.frvField===id)?.querySelector(".sv-frv-open")?.focus();function stopEditing(c){editing=null;setTimeout(()=>{const now=document.activeElement;if(editing==null&&(!now||now===document.body||now.getAttribute("role")==="dialog"))focusField(c.id)},0)}const typedInto=c=>["text","number","textarea","fieldNumber","fieldTime",void 0].includes(c.columnDef.editorType);function escapeBox(e){if(e.key!=="Escape"||e.isComposing)return;if((unsaved||deletingNote!=null)&&editing==null)return escapeComment(e);const c=editing!=null?columns.find(x=>x.id===editing):void 0;if(!c||!(typedInto(c)||c.columnDef.editorType==="fieldRating"))return;e.stopPropagation();stopEditing(c)}function editBeside(c,dir){const at2=columns.findIndex(x=>x.id===c.id);for(let i=at2+dir;i>=0&&i<columns.length;i+=dir){const next=columns[i];if(!editable(next)||next.columnDef.editorType==="checkbox")continue;if(typedInto(next))editing=next.id;else{editing=null;void tick().then(()=>focusField(next.id))}return}}let awaited=$state(null);let awaitedRow=$state(null);let stepping=false;let pressed=0;function arrived(){stepping=false;if(!pressed)return;const by=pressed>0?1:-1;pressed-=by;queueMicrotask(()=>void go(by))}$effect(()=>{const id=awaited;if(id!=null&&rowIndexOf(rows,id)>=0)untrack(()=>{current=id;awaited=null;arrived()})});$effect(()=>{const at2=awaitedRow;const r=at2==null?void 0:rows[at2];if(r&&!notRead(r))untrack(()=>{awaitedRow=null;lastAt=at2;if(isRecord(r))current=r.id;arrived()})});let swipeAt=null;function swipeStart(e){const t=e.touches[0];const from=e.target;const busy=!!from?.closest?.('input, textarea, select, [contenteditable="true"], .sv-frv-files, [data-no-swipe]');swipeAt=e.touches.length===1&&t&&!busy?{x:t.clientX,y:t.clientY,t:Date.now()}:null}function swipeEnd(e){const s0=swipeAt;swipeAt=null;const t=e.changedTouches[0];if(!s0||!t||editing!=null)return;const dx=t.clientX-s0.x;const dy=t.clientY-s0.y;if(Math.abs(dx)<70||Math.abs(dx)<Math.abs(dy)*1.8||Date.now()-s0.t>700)return;if(dx<0&&canNext)void go(1);else if(dx>0&&canPrev)void go(-1)}function keepInSight(e){const el=e.target;if(!el?.matches?.('input, textarea, [contenteditable="true"]')||typeof window==="undefined"||window.innerWidth>600)return;setTimeout(()=>el.scrollIntoView?.({block:"center",behavior:"smooth"}),320)}async function go(by){if(stepping){pressed+=by;return}if(editingNote!=null){stepHeld=true;announce(bm("record.commentHoldsStep"));editBox?.focus();return}editing=null;if(walk){stepping=true;const id=await walk.step(walkFrom(by),by);if(id==null){stepping=false;pressed=0;return}awaited=id;setTimeout(()=>{if(awaited!==id)return;awaited=null;stepping=false;pressed=0},3e3);return}const to=rowBeside(by);if(to<0)return;const next=rows[to];if(!notRead(next)){lastAt=to;current=next.id;return}stepping=true;awaitedRow=to;ctrl.buildApi?.().scrollToRow?.(to)}const allCols=$derived([...columns,...hidden]);const feed=$derived.by(()=>{if(!row)return[];const edits=historyOf(ctrl,row.id).map((ch,i)=>{if(ch.added)return{key:`a${ch.at}-${i}`,at:ch.at,by:ch.by,remote:true,kind:"added",field:"",text:""};const c=allCols.find(x=>x.id===ch.columnId);const show=v=>c?cellText(asField(c),v,row):String(v??"");return{key:`e${ch.at}${ch.columnId}-${i}`,at:ch.at,by:ch.by,automation:ch.automation,via:ch.via,through:ch.through,remote:ch.remote,undone:ch.undone,redone:ch.redone,kind:"edit",field:c?label(c):ch.columnId,text:show(ch.value),..."from"in ch&&show(ch.from)?{from:show(ch.from)}:{}}});const notes=commentsOf(ctrl,row.id).map(n=>({key:n.id,at:n.at,by:n.by,kind:"comment",field:"",text:n.text,parts:parseMentions(n.text),note:n}));return[...edits,...notes].sort((a,b)=>a.at-b.at)});const person=item=>item.by?findFieldUser(item.by)?.name??bm("record.someone"):item.remote?bm("record.someoneElse"):bm("record.you");const who=item=>item.automation?bm("record.byAutomation",{name:item.automation}):item.via?bm("record.acceptedBy",{source:item.via,person:person(item)}):item.through?bm("record.through",{person:person(item),source:item.through}):person(item);const shownId=$derived(row?.id);$effect(()=>{const id=shownId;if(id!=null)untrack(()=>loadHistory(ctrl,id))});const history=$derived(row?historyState(ctrl,row.id):{loading:false});$effect(()=>{const id=row?.id;if(id!=null&&unseenOf(ctrl,id))untrack(()=>markSeen(ctrl,id))});const proposals=$derived(row?recordProposalsFor(ctrl.props?.getRowId,row.original,row.id):null);const proposalOf=c=>proposals?.list.find(p=>p.field===String(c.columnDef.field??c.id));const proposedText=(c,p)=>cellText(asField(c),p.after,row)||proposals?.messages.empty||"";let deciding=$state(false);async function decide(ids,how){if(!proposals||deciding||!ids.length)return;deciding=true;try{await(how==="accept"?proposals.accept(ids):proposals.reject(ids))}finally{deciding=false}}const readOnly=$derived(isReadOnlyGrid(ctrl));const canComment=$derived(canCommentIn(ctrl));const takesFiles=$derived(commentStoreTakes("files"));const takesInternal=$derived(commentStoreTakes("internal"));let commentFiles=$state([]);let uploading=$state(0);let internalNote=$state(false);let fileInput=$state(null);const canSend=$derived((!!comment.trim()||commentFiles.length>0)&&uploading===0);async function attach(list){if(!list||!row)return;const forRow=row.id;for(const file of Array.from(list)){uploading+=1;try{const done=await uploadAttachment(file,{},{row:row?.original,columnId:"",signal:new AbortController().signal,onProgress:()=>{}});if(row?.id===forRow)commentFiles=[...commentFiles,done]}catch(e){toast.error(bm("record.commentUploadFailed",{name:file.name,error:e instanceof Error?e.message:String(e)}))}finally{uploading-=1}}if(fileInput)fileInput.value=""}const snippets=$derived(commentSnippets());let repliesOpen=$state(false);let replies=$state(null);let repliesError=$state("");let replyQuery=$state("");let replyName=$state("");let naming=$state(false);const shownReplies=$derived((replies??[]).filter(r=>!replyQuery.trim()||(r.title+" "+r.text).toLowerCase().includes(replyQuery.trim().toLowerCase())));const recordRef=()=>({rowId:String(row?.original?.id??row?.id??""),row:row?.original??{}});async function openReplies(){if(repliesOpen){repliesOpen=false;return}const list=snippets;if(!list||!row)return;repliesOpen=true;replies=null;repliesError="";replyQuery="";naming=false;const forRow=row.id;try{const got=await list.list(ctrl?.props?.baseTableId,recordRef());if(row?.id===forRow)replies=Array.isArray(got)?got:[]}catch(e){repliesError=e instanceof Error?e.message:String(e);replies=[]}}function pickReply(reply){comment=comment.trim()?comment.replace(/\s+$/,"")+"\n\n"+reply.text:reply.text;if(reply.files?.length)commentFiles=[...commentFiles,...reply.files.filter(f=>!commentFiles.some(x=>x.id===f.id))];repliesOpen=false;void tick().then(()=>commentBox?.focus())}async function saveReply(){const keep=snippets?.save;const title2=replyName.trim();if(!keep||!title2||!comment.trim())return;try{await keep(ctrl?.props?.baseTableId,{title:title2,text:comment});toast.success(bm("record.replySaved"));naming=false;replyName="";replies=null;repliesOpen=false}catch(e){toast.error(bm("record.replyNotSaved",{error:e instanceof Error?e.message:String(e)}))}}$effect(()=>{void current;repliesOpen=false});function send(){if(!row||!canSend||!canComment||isDraft)return;addComment(ctrl,row.id,encodeMentions(comment,picked),{files:commentFiles,internal:internalNote});comment="";picked=[];commentFiles=[];internalNote=false;announce(bm("record.commentAddedSay"))}const fileSize=n=>n==null?"":n<1024?`${n} B`:n<1048576?`${Math.round(n/1024)} KB`:`${(n/1048576).toFixed(1)} MB`;let editingNote=$state(null);let editText=$state("");let editPicked=$state([]);let deletingNote=$state(null);let editBox=$state(null);let sendButton=$state(null);const unsaved=$derived(!!row&&(!!comment.trim()||editingNote!=null));$effect(()=>{const id=current;const drafts=commentDraftsOf(ctrl);const kept=drafts.get(id);comment=kept?.text??"";picked=kept?.picked??[];editingNote=null;deletingNote=null});$effect(()=>{const drafts=commentDraftsOf(ctrl);if(comment.trim())drafts.set(current,{text:comment,picked});else drafts.delete(current)});function closing(){if(comment.trim())toast.info(bm("record.commentKept"));onClose()}let escapeHeld=$state(false);let stepHeld=$state(false);$effect(()=>{void comment;void editText;escapeHeld=false;stepHeld=false});$effect(()=>{if(!unsaved)return;const onDown=e=>{if(!e.target?.classList?.contains("sv-modal__backdrop"))return;escapeHeld=true;announce(bm(editingNote!=null?"record.commentNotSaved":"record.commentNotSent"))};window.addEventListener("pointerdown",onDown,true);return()=>window.removeEventListener("pointerdown",onDown,true)});function escapeComment(e){const at2=e.target;if(!fieldsBox?.closest('[role="dialog"]')?.contains(at2))return;if(at2.getAttribute("aria-controls"))return;e.stopPropagation();if(deletingNote!=null)return keepNote();if(editingNote!=null&&at2.closest("form")?.contains(editBox))return cancelEdit();if(at2===commentBox)sendButton?.focus();escapeHeld=true;announce(bm(editingNote!=null?"record.commentNotSaved":"record.commentNotSent"))}let feedBox=$state(null);const focusNote=id=>void tick().then(()=>[...feedBox?.querySelectorAll("[data-note]")??[]].find(n=>n.dataset.note===id)?.querySelector("button")?.focus());function keepNote(){const id=deletingNote;deletingNote=null;if(id)focusNote(id)}const takeFocus=node=>node.focus();function startEdit(n){deletingNote=null;editingNote=n.id;editText=mentionText(n.text,id=>findFieldUser(id)?.name);editPicked=parseMentions(n.text).flatMap(p=>"mention"in p?[mentioned(p.mention,p.name)]:[]);void tick().then(()=>{editBox?.focus();editBox?.setSelectionRange(editText.length,editText.length)})}function saveEdit(){const id=editingNote;if(row&&id&&editText.trim()){editComment(ctrl,row.id,id,encodeMentions(editText,editPicked));announce(bm("record.commentSavedSay"))}editingNote=null;if(id)focusNote(id)}function cancelEdit(){const id=editingNote;editingNote=null;if(id)focusNote(id)}const mentioned=(id,name)=>findFieldUser(id)??{id,name:name||bm("record.someone")};function voteTitle(dir,ids){if(!ids.length)return bm(dir==="up"?"record.voteUp":"record.voteDown");const names=ids.map(id=>findFieldUser(id)?.name??bm("record.someone"));const list=names.join(", ");return bm(dir==="up"?"record.votedUpBy":"record.votedDownBy",{names:list})}
2
+ import{recordActionsFor}from"./record-actions";import{commentSnippets}from"./comment-snippets.svelte";import{onDestroy,onMount,tick,untrack}from"svelte";import{commentDraftsOf,getRecordRequest,holdForRecordEditor}from"./editor-request.svelte";import{SvModal,announce,toast}from"@svgrid/grid";import FieldInput from"./FieldInput.svelte";import{fieldPropsOf,getFieldType,originalColumn,ruleFieldNames}from"./registry.svelte";import{protectionText}from"./field-access.svelte";import{isReadOnlyGrid}from"./base-share";import{canCommentIn,canDeleteRecord}from"./base-permissions";import{askDeleteRecord}from"./record-delete.svelte";import{cellText,dataRows,fieldColumns,leafFilter,primaryIdOf}from"./grid-access";import{recordWalkOf}from"./record-walk";import{addComment,commentStoreTakes,commentVotes,commentsOf,commentsTakeVotes,deleteComment,editComment,historyOf,historyState,loadHistory,markSeen,mayVoteComment,myCommentVote,ownsComment,timeAgo,unseenOf,voteComment}from"./activity.svelte";import{uploadAttachment}from"./attachments";import{findFieldUser}from"./sources.svelte";import{encodeMentions,mentionText,parseMentions}from"./mentions";import MentionInput from"./MentionInput.svelte";import{dictationSupported,dictate,withSaid}from"./dictation.svelte";import UserFace from"./UserFace.svelte";import{recordProposalsFor}from"../review/card-marks.svelte";import{bm,bmCount}from"./messages.svelte";let{ctrl,rowId,editPrimary=false,focus,onClose}=$props();let current=$state(rowId);let open=$state(true);let editing=$state(null);let showHidden=$state(false);let comment=$state("");let picked=$state([]);const rows=$derived(ctrl.allRows??[]);let lastAt=-1;function rowIndexOf(list,id){if(id==null)return-1;for(const near of[lastAt,untrack(()=>ctrl.activeCell?.rowIndex??-1)]){if(near<0)continue;for(let d=0;d<=200;d++){if(list[near+d]?.id===id)return lastAt=near+d;if(d&&near-d>=0&&list[near-d]?.id===id)return lastAt=near-d}}return lastAt=list.findIndex(r=>r.id===id)}const index=$derived(rowIndexOf(rows,current));const row=$derived(index>=0?rows[index]:null);const isDraft=$derived(!!ctrl.props?.baseIsDraft?.(current));let lastIndex=0;const at=$derived.by(()=>{if(index>=0)lastIndex=index;return lastIndex});const walk=$derived(recordWalkOf(ctrl));const model=$derived(ctrl.props?.rowModel);const grouped=$derived((ctrl.groupingColumns??[]).length>0);const notRead=r=>String(r.id).startsWith("sv-ph:");function isRecord(r){const kind=r.original?.__group?.kind;return kind?kind==="leaf":r.__treeRow||!(typeof r.getCanExpand==="function"&&r.getCanExpand())}function rowFrom(from,by){for(let i=from+by;i>=0&&i<rows.length;i+=by){const r=rows[i];if(notRead(r)||isRecord(r))return i}return-1}function rowBeside(by){const seen=at;return rowFrom(index>=0?index:by>0?seen-1:seen,by)}let located=$state(0);const walkPlace=$derived(walk&&!isDraft?(void located,walk.place(current)):null);let lastPlace=-1;const walkAt=$derived.by(()=>{if(walkPlace!=null)lastPlace=walkPlace;return lastPlace});const walkFrom=by=>walkPlace!=null?walkAt:by>0?walkAt-1:walkAt;const canPrev=$derived(walk?walkAt>=0&&walk.has(walkFrom(-1),-1):rowBeside(-1)>=0);const canNext=$derived(walk?walkAt>=0&&walk.has(walkFrom(1),1):rowBeside(1)>=0);const records=$derived(!model&&grouped?dataRows(ctrl):null);const total=$derived(walk?walk.total():model?.getState?model.recordCount?.()??model.getState().rowCount??rows.length:(records??rows).length);const locale=$derived(ctrl.props?.localization?.locale);const place=$derived.by(()=>{if(isDraft)return null;if(walk)return walkPlace;if(index<0)return null;if(model)return grouped||model.isPinned?.(current)?null:index-Math.max(0,rows.length-total);return records?records.findIndex(r=>r.id===current):index});const positionText=$derived.by(()=>{if(isDraft)return bm("record.newRecord");if(!walk&&index<0)return bmCount("record.notInView",total,{count:total.toLocaleString(locale)});if(place==null)return bmCount("viewbar.records",total);return bm("record.position",{index:(place+1).toLocaleString(locale),total:total.toLocaleString(locale)})});const filteredOut=$derived.by(()=>{if(!row)return false;const keep=leafFilter(ctrl);return!!keep&&!keep(row)});const columns=$derived((ctrl.allColumns??[]).filter(c=>!c.id.startsWith("__")&&(c.columnDef.field!=null||c.columnDef.fieldFn!=null)));const hidden=$derived.by(()=>{const shownIds=new Set(columns.map(c=>c.id));return fieldColumns(ctrl).filter(c=>!shownIds.has(c.id)).map(c=>({id:c.id,columnDef:c.def}))});function valueOf(c){if(!row)return void 0;const base=c.columnDef.fieldFn?c.columnDef.fieldFn(row.original):row.original?.[c.columnDef.field];return ctrl.getCellDisplayValue(row.id,c.id,columns.includes(c)?row.getCellValueByColumnId(c.id):base)}const asField=c=>({id:c.id,field:String(c.columnDef.field??c.id),header:label(c),fieldType:c.columnDef.fieldType,def:c.columnDef,visible:true});const primaryId=$derived(primaryIdOf(ctrl));const primary=$derived(columns.find(c=>c.id===primaryId)??columns.find(c=>c.columnDef.fieldType==="text"||!c.columnDef.fieldType&&c.columnDef.editorType==null)??columns[0]);const title=$derived(row&&primary?cellText(asField(primary),valueOf(primary),row)||bm("record.untitled"):bm("record.record"));function label(c){return typeof c.columnDef.header==="string"?c.columnDef.header:c.id}const protectionOf=c=>c.columnDef.fieldType?protectionText(originalColumn(c.columnDef),fieldPropsOf(originalColumn(c.columnDef)),ruleFieldNames(c.columnDef)):null;const iconOf=c=>c.columnDef.fieldType?getFieldType(c.columnDef.fieldType)?.icon:void 0;function editable(c){if(!row||!ctrl.editingEnabled)return false;const ci=ctrl.allColumns.findIndex(x=>x.id===c.id);if(ci<0)return false;return ctrl.isCellEditableAt?!!ctrl.isCellEditableAt(index,ci):c.columnDef.editable!==false}const editorOpen=$derived(editing!=null);$effect(()=>{if(editorOpen)return untrack(holdForRecordEditor)});onMount(()=>{if(editPrimary&&primary&&editable(primary))editing=primary.id});let settled=$state(false);const settling=setTimeout(()=>settled=true,400);onDestroy(()=>{clearTimeout(settling);walk?.stop?.()});let locating=null;$effect(()=>{const w=walk;const r=row;if(!w?.locate||!r||isDraft||walkPlace!=null||locating===r.id)return;locating=r.id;untrack(()=>void w.locate(r.id,r.original).finally(()=>located+=1))});let commentBox=$state(null);const commentFocusFor=r=>r?.focus==="comment"&&r.ctrl===ctrl;const initialFocus=()=>focus==="comment"||commentFocusFor(getRecordRequest())?commentBox:null;$effect(()=>{const r=getRecordRequest();if(!commentFocusFor(r))return;untrack(()=>{if(r.rowId!==current)current=r.rowId;queueMicrotask(()=>commentBox?.focus())})});let listening=$state(null);const speakable=c=>dictationSupported()&&(c.columnDef.fieldType==="text"||c.columnDef.fieldType==="longText");async function speakInto(c){if(listening)return;listening=c.id;try{const said=await dictate();if(said)commit(c,withSaid(row?.getCellValueByColumnId?.(c.id),said,c.columnDef.fieldType==="longText"))}finally{listening=null}}async function speakComment(){if(listening)return;listening=":comment";try{const said=await dictate();if(said)comment=withSaid(comment,said,false)}finally{listening=null}}function sameValue(a,b){const none=x=>x==null||x===""||Array.isArray(x)&&!x.length;if(none(a)&&none(b))return true;return typeof a==="object"||typeof b==="object"?JSON.stringify(a)===JSON.stringify(b):String(a)===String(b)}function commit(c,v){editing=null;if(!row||v===void 0)return;const none=x=>x==null||x===""||Array.isArray(x)&&!x.length;if(none(v)&&none(row.getCellValueByColumnId?.(c.id)))return;const at2=rowIndexOf(ctrl.allRows,current);if(at2<0||!ctrl.startEditing(at2,c.id))return;ctrl.updateEditingCellValue(v);ctrl.saveEditingCell()}let fieldsBox=$state(null);const focusField=id=>[...fieldsBox?.querySelectorAll("[data-frv-field]")??[]].find(el=>el.dataset.frvField===id)?.querySelector(".sv-frv-open")?.focus();function stopEditing(c){editing=null;setTimeout(()=>{const now=document.activeElement;if(editing==null&&(!now||now===document.body||now.getAttribute("role")==="dialog"))focusField(c.id)},0)}const typedInto=c=>["text","number","textarea","fieldNumber","fieldTime",void 0].includes(c.columnDef.editorType);function escapeBox(e){if(e.key!=="Escape"||e.isComposing)return;if((unsaved||deletingNote!=null)&&editing==null)return escapeComment(e);const c=editing!=null?columns.find(x=>x.id===editing):void 0;if(!c||!(typedInto(c)||c.columnDef.editorType==="fieldRating"))return;e.stopPropagation();stopEditing(c)}function editBeside(c,dir){const at2=columns.findIndex(x=>x.id===c.id);for(let i=at2+dir;i>=0&&i<columns.length;i+=dir){const next=columns[i];if(!editable(next)||next.columnDef.editorType==="checkbox")continue;if(typedInto(next))editing=next.id;else{editing=null;void tick().then(()=>focusField(next.id))}return}}let awaited=$state(null);let awaitedRow=$state(null);let stepping=false;let pressed=0;function arrived(){stepping=false;if(!pressed)return;const by=pressed>0?1:-1;pressed-=by;queueMicrotask(()=>void go(by))}$effect(()=>{const id=awaited;if(id!=null&&rowIndexOf(rows,id)>=0)untrack(()=>{current=id;awaited=null;arrived()})});$effect(()=>{const at2=awaitedRow;const r=at2==null?void 0:rows[at2];if(r&&!notRead(r))untrack(()=>{awaitedRow=null;lastAt=at2;if(isRecord(r))current=r.id;arrived()})});let swipeAt=null;function swipeStart(e){const t=e.touches[0];const from=e.target;const busy=!!from?.closest?.('input, textarea, select, [contenteditable="true"], .sv-frv-files, [data-no-swipe]');swipeAt=e.touches.length===1&&t&&!busy?{x:t.clientX,y:t.clientY,t:Date.now()}:null}function swipeEnd(e){const s0=swipeAt;swipeAt=null;const t=e.changedTouches[0];if(!s0||!t||editing!=null)return;const dx=t.clientX-s0.x;const dy=t.clientY-s0.y;if(Math.abs(dx)<70||Math.abs(dx)<Math.abs(dy)*1.8||Date.now()-s0.t>700)return;if(dx<0&&canNext)void go(1);else if(dx>0&&canPrev)void go(-1)}function keepInSight(e){const el=e.target;if(!el?.matches?.('input, textarea, [contenteditable="true"]')||typeof window==="undefined"||window.innerWidth>600)return;setTimeout(()=>el.scrollIntoView?.({block:"center",behavior:"smooth"}),320)}async function go(by){if(stepping){pressed+=by;return}if(editingNote!=null){stepHeld=true;announce(bm("record.commentHoldsStep"));editBox?.focus();return}editing=null;if(walk){stepping=true;const id=await walk.step(walkFrom(by),by);if(id==null){stepping=false;pressed=0;return}awaited=id;setTimeout(()=>{if(awaited!==id)return;awaited=null;stepping=false;pressed=0},3e3);return}const to=rowBeside(by);if(to<0)return;const next=rows[to];if(!notRead(next)){lastAt=to;current=next.id;return}stepping=true;awaitedRow=to;ctrl.buildApi?.().scrollToRow?.(to)}const allCols=$derived([...columns,...hidden]);const restorable=c=>!!c&&c.columnDef.editorType!=="attachment"&&c.columnDef.editorType!=="fieldLink";const feed=$derived.by(()=>{if(!row)return[];const edits=historyOf(ctrl,row.id).map((ch,i)=>{if(ch.added)return{key:`a${ch.at}-${i}`,at:ch.at,by:ch.by,remote:true,kind:"added",field:"",text:""};const c=allCols.find(x=>x.id===ch.columnId);const show=v=>c?cellText(asField(c),v,row):String(v??"");return{key:`e${ch.at}${ch.columnId}-${i}`,at:ch.at,by:ch.by,automation:ch.automation,via:ch.via,through:ch.through,remote:ch.remote,undone:ch.undone,redone:ch.redone,kind:"edit",field:c?label(c):ch.columnId,text:show(ch.value),..."from"in ch&&show(ch.from)?{from:show(ch.from)}:{},..."from"in ch&&restorable(c)?{restore:{col:c,value:ch.from??null}}:{}}});const notes=commentsOf(ctrl,row.id).map(n=>({key:n.id,at:n.at,by:n.by,kind:"comment",field:"",text:n.text,parts:parseMentions(n.text),note:n}));return[...edits,...notes].sort((a,b)=>a.at-b.at)});const person=item=>item.by?findFieldUser(item.by)?.name??bm("record.someone"):item.remote?bm("record.someoneElse"):bm("record.you");const who=item=>item.automation?bm("record.byAutomation",{name:item.automation}):item.via?bm("record.acceptedBy",{source:item.via,person:person(item)}):item.through?bm("record.through",{person:person(item),source:item.through}):person(item);const shownId=$derived(row?.id);$effect(()=>{const id=shownId;if(id!=null)untrack(()=>loadHistory(ctrl,id))});const history=$derived(row?historyState(ctrl,row.id):{loading:false});$effect(()=>{const id=row?.id;if(id!=null&&unseenOf(ctrl,id))untrack(()=>markSeen(ctrl,id))});const proposals=$derived(row?recordProposalsFor(ctrl.props?.getRowId,row.original,row.id):null);const proposalOf=c=>proposals?.list.find(p=>p.field===String(c.columnDef.field??c.id));const proposedText=(c,p)=>cellText(asField(c),p.after,row)||proposals?.messages.empty||"";let deciding=$state(false);async function decide(ids,how){if(!proposals||deciding||!ids.length)return;deciding=true;try{await(how==="accept"?proposals.accept(ids):proposals.reject(ids))}finally{deciding=false}}const readOnly=$derived(isReadOnlyGrid(ctrl));const canComment=$derived(canCommentIn(ctrl));const takesFiles=$derived(commentStoreTakes("files"));const takesInternal=$derived(commentStoreTakes("internal"));let commentFiles=$state([]);let uploading=$state(0);let internalNote=$state(false);let fileInput=$state(null);const canSend=$derived((!!comment.trim()||commentFiles.length>0)&&uploading===0);async function attach(list){if(!list||!row)return;const forRow=row.id;for(const file of Array.from(list)){uploading+=1;try{const done=await uploadAttachment(file,{},{row:row?.original,columnId:"",signal:new AbortController().signal,onProgress:()=>{}});if(row?.id===forRow)commentFiles=[...commentFiles,done]}catch(e){toast.error(bm("record.commentUploadFailed",{name:file.name,error:e instanceof Error?e.message:String(e)}))}finally{uploading-=1}}if(fileInput)fileInput.value=""}const snippets=$derived(commentSnippets());let repliesOpen=$state(false);let replies=$state(null);let repliesError=$state("");let replyQuery=$state("");let replyName=$state("");let naming=$state(false);const shownReplies=$derived((replies??[]).filter(r=>!replyQuery.trim()||(r.title+" "+r.text).toLowerCase().includes(replyQuery.trim().toLowerCase())));const recordRef=()=>({rowId:String(row?.original?.id??row?.id??""),row:row?.original??{}});async function openReplies(){if(repliesOpen){repliesOpen=false;return}const list=snippets;if(!list||!row)return;repliesOpen=true;replies=null;repliesError="";replyQuery="";naming=false;const forRow=row.id;try{const got=await list.list(ctrl?.props?.baseTableId,recordRef());if(row?.id===forRow)replies=Array.isArray(got)?got:[]}catch(e){repliesError=e instanceof Error?e.message:String(e);replies=[]}}function pickReply(reply){comment=comment.trim()?comment.replace(/\s+$/,"")+"\n\n"+reply.text:reply.text;if(reply.files?.length)commentFiles=[...commentFiles,...reply.files.filter(f=>!commentFiles.some(x=>x.id===f.id))];repliesOpen=false;void tick().then(()=>commentBox?.focus())}async function saveReply(){const keep=snippets?.save;const title2=replyName.trim();if(!keep||!title2||!comment.trim())return;try{await keep(ctrl?.props?.baseTableId,{title:title2,text:comment});toast.success(bm("record.replySaved"));naming=false;replyName="";replies=null;repliesOpen=false}catch(e){toast.error(bm("record.replyNotSaved",{error:e instanceof Error?e.message:String(e)}))}}$effect(()=>{void current;repliesOpen=false});function send(){if(!row||!canSend||!canComment||isDraft)return;addComment(ctrl,row.id,encodeMentions(comment,picked),{files:commentFiles,internal:internalNote});comment="";picked=[];commentFiles=[];internalNote=false;announce(bm("record.commentAddedSay"))}const fileSize=n=>n==null?"":n<1024?`${n} B`:n<1048576?`${Math.round(n/1024)} KB`:`${(n/1048576).toFixed(1)} MB`;let editingNote=$state(null);let editText=$state("");let editPicked=$state([]);let deletingNote=$state(null);let editBox=$state(null);let sendButton=$state(null);const unsaved=$derived(!!row&&(!!comment.trim()||editingNote!=null));$effect(()=>{const id=current;const drafts=commentDraftsOf(ctrl);const kept=drafts.get(id);comment=kept?.text??"";picked=kept?.picked??[];editingNote=null;deletingNote=null});$effect(()=>{const drafts=commentDraftsOf(ctrl);if(comment.trim())drafts.set(current,{text:comment,picked});else drafts.delete(current)});function closing(){if(comment.trim())toast.info(bm("record.commentKept"));onClose()}let escapeHeld=$state(false);let stepHeld=$state(false);$effect(()=>{void comment;void editText;escapeHeld=false;stepHeld=false});$effect(()=>{if(!unsaved)return;const onDown=e=>{if(!e.target?.classList?.contains("sv-modal__backdrop"))return;escapeHeld=true;announce(bm(editingNote!=null?"record.commentNotSaved":"record.commentNotSent"))};window.addEventListener("pointerdown",onDown,true);return()=>window.removeEventListener("pointerdown",onDown,true)});function escapeComment(e){const at2=e.target;if(!fieldsBox?.closest('[role="dialog"]')?.contains(at2))return;if(at2.getAttribute("aria-controls"))return;e.stopPropagation();if(deletingNote!=null)return keepNote();if(editingNote!=null&&at2.closest("form")?.contains(editBox))return cancelEdit();if(at2===commentBox)sendButton?.focus();escapeHeld=true;announce(bm(editingNote!=null?"record.commentNotSaved":"record.commentNotSent"))}let feedBox=$state(null);const focusNote=id=>void tick().then(()=>[...feedBox?.querySelectorAll("[data-note]")??[]].find(n=>n.dataset.note===id)?.querySelector("button")?.focus());function keepNote(){const id=deletingNote;deletingNote=null;if(id)focusNote(id)}const takeFocus=node=>node.focus();function startEdit(n){deletingNote=null;editingNote=n.id;editText=mentionText(n.text,id=>findFieldUser(id)?.name);editPicked=parseMentions(n.text).flatMap(p=>"mention"in p?[mentioned(p.mention,p.name)]:[]);void tick().then(()=>{editBox?.focus();editBox?.setSelectionRange(editText.length,editText.length)})}function saveEdit(){const id=editingNote;if(row&&id&&editText.trim()){editComment(ctrl,row.id,id,encodeMentions(editText,editPicked));announce(bm("record.commentSavedSay"))}editingNote=null;if(id)focusNote(id)}function cancelEdit(){const id=editingNote;editingNote=null;if(id)focusNote(id)}const mentioned=(id,name)=>findFieldUser(id)??{id,name:name||bm("record.someone")};function voteTitle(dir,ids){if(!ids.length)return bm(dir==="up"?"record.voteUp":"record.voteDown");const names=ids.map(id=>findFieldUser(id)?.name??bm("record.someone"));const list=names.join(", ");return bm(dir==="up"?"record.votedUpBy":"record.votedDownBy",{names:list})}
3
3
  </script>
4
4
 
5
5
  {#snippet field(c: Col, canEdit: boolean)}
@@ -126,7 +126,11 @@ import{recordActionsFor}from"./record-actions";import{commentSnippets}from"./com
126
126
  {/each}
127
127
  </ul>
128
128
  {/if}
129
- </div>
129
+ </div>
130
+ {#if item.restore && !readOnly && editable(item.restore.col) && !sameValue(row?.getCellValueByColumnId?.(item.restore.col.id), item.restore.value)}
131
+ {@const back = item.restore}
132
+ <button type="button" class="sv-frv-link sv-frv-restore" title={bm('record.restoreHint', { field: item.field })} onclick={() => commit(back.col, back.value)}>{bm('record.restoreValue')}</button>
133
+ {/if}
130
134
  {#if item.note}
131
135
  {@const note = item.note}
132
136
  {@const votes = commentVotes(note)}
@@ -289,5 +293,5 @@ import{recordActionsFor}from"./record-actions";import{commentSnippets}from"./com
289
293
  </SvModal>
290
294
 
291
295
  <style>
292
- .sv-frv-proposals{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 12px;padding:8px 12px;border-radius:var(--sg-radius, 6px);font-size:13px;background:color-mix(in srgb,var(--sg-accent, #2563eb) 8%,var(--sg-bg, #fff));border:1px solid color-mix(in srgb,var(--sg-accent, #2563eb) 30%,var(--sg-border, #e2e8f0))}.sv-frv-proposal{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;margin-top:6px;padding:6px 8px;font-size:13px;border-inline-start:3px solid var(--sg-accent, #2563eb);border-radius:0 var(--sg-radius, 6px) var(--sg-radius, 6px) 0;background:color-mix(in srgb,var(--sg-accent, #2563eb) 6%,var(--sg-bg, #fff))}.sv-frv-proposal-by{color:var(--sg-muted, #64748b);font-size:12px}.sv-frv-filtered{display:flex;align-items:center;gap:6px;margin:0 0 12px;font-size:12px;color:var(--sg-muted, #64748b)}.sv-frv-filtered svg{flex:none}.sv-frv-proposal-value{font-weight:600;overflow-wrap:anywhere}.sv-frv-proposal-acts{display:inline-flex;gap:6px;margin-inline-start:auto}.sv-frv-proposal-acts .sv-frv-btn{height:26px;padding:0 10px}.sv-frv-btn.is-accept{background:var(--sg-accent, #2563eb);border-color:var(--sg-accent, #2563eb);color:var(--sg-on-accent, #fff)}.sv-frv-proposal-why{flex-basis:100%;color:var(--sg-muted, #64748b);font-size:12px}.sv-frv-layout{display:grid;grid-template-columns:minmax(0,1fr) 280px;gap:20px;align-items:start}.sv-frv-fields{display:flex;flex-direction:column;gap:14px;min-width:0}.sv-frv-field{display:flex;flex-direction:column;gap:6px}.sv-frv-label{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:600;color:var(--sg-muted, #64748b)}.sv-frv-mic{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;margin:-8px -6px -8px auto;padding:0;border:0;border-radius:50%;background:transparent;color:var(--sg-accent, #2563eb);cursor:pointer}.sv-frv-mic:hover:not(:disabled){background:color-mix(in srgb,var(--sg-accent, #2563eb) 12%,transparent)}.sv-frv-mic:disabled:not(.is-on){opacity:.4;cursor:default}.sv-frv-mic.is-on,.sv-frv-mic-comment.is-on{color:var(--sg-danger, #dc2626);animation:sv-frv-listen 1s ease-in-out infinite}.sv-frv-mic-comment{display:inline-flex;align-items:center;gap:4px}@keyframes sv-frv-listen{50%{opacity:.45}}@media(prefers-reduced-motion:reduce){.sv-frv-mic.is-on,.sv-frv-mic-comment.is-on{animation:none}}.sv-frv-ro{font-weight:400;font-size:11px;opacity:.8}.sv-frv-hidden-toggle{align-self:flex-start;border:0;padding:2px 0;background:none;font:inherit;font-size:13px;color:var(--sg-fg, #0f172a);text-decoration:underline;cursor:pointer}.sv-frv-activity{position:sticky;top:0;display:flex;flex-direction:column;gap:8px;max-height:70vh;padding-inline-start:16px;border-inline-start:1px solid var(--sg-border, #e2e8f0)}.sv-frv-activity-title{margin:0;font-size:13px;font-weight:600}.sv-frv-feed{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px;overflow:auto;min-height:60px}.sv-frv-item{font-size:12px}.sv-frv-item-head{color:var(--sg-muted, #64748b)}.sv-frv-item-head strong{color:var(--sg-fg, #0f172a);font-weight:600}.sv-frv-from{color:var(--sg-muted, #64748b);text-decoration:line-through}.sv-frv-arrow{margin:0 5px;color:var(--sg-muted, #64748b)}.sv-frv-when{margin-inline-start:6px;color:var(--sg-fg, #0f172a)}.sv-frv-note-acts{display:flex;align-items:center;justify-content:flex-end;gap:10px;margin-top:4px;font-size:12px;color:var(--sg-muted, #64748b)}.sv-frv-link{padding:0;border:0;background:none;font:inherit;font-size:12px;color:var(--sg-muted, #64748b);cursor:pointer}.sv-frv-link:hover{color:var(--sg-fg, #0f172a);text-decoration:underline}.sv-frv-votes{display:inline-flex;gap:4px;margin-right:auto}.sv-frv-vote{display:inline-flex;align-items:center;gap:4px;min-height:24px;padding:2px 8px;border:1px solid var(--sg-border, #e2e8f0);border-radius:999px;background:var(--sg-bg, #fff);font:inherit;font-size:12px;color:var(--sg-muted, #64748b);cursor:pointer}.sv-frv-vote:hover:not(:disabled){color:var(--sg-fg, #0f172a);border-color:color-mix(in srgb,var(--sg-fg, #0f172a) 30%,transparent)}.sv-frv-vote:focus-visible{outline:2px solid var(--sg-accent, #2563eb);outline-offset:2px}.sv-frv-vote:disabled{cursor:default}.sv-frv-vote.is-mine{color:var(--sg-accent, #2563eb);border-color:var(--sg-accent, #2563eb);background:color-mix(in srgb,var(--sg-accent, #2563eb) 10%,transparent)}.sv-frv-vote.is-down.is-mine{color:#b42318;border-color:#b42318;background:color-mix(in srgb,#b42318 10%,transparent)}.sv-frv-link:focus-visible{outline:2px solid var(--sg-accent, #2563eb);outline-offset:2px}.sv-frv-item-body{margin-top:2px;white-space:pre-wrap;word-break:break-word}.sv-frv-item.is-comment .sv-frv-item-body{padding:6px 8px;border-radius:8px;background:color-mix(in srgb,var(--sg-fg, #0f172a) 5%,transparent)}.sv-frv-none{color:var(--sg-muted, #64748b);font-size:12px}.sv-frv-comment{display:grid;gap:6px}.sv-frv-held{margin:0;font-size:12px;color:var(--sg-fg, #0f172a)}.sv-frv-mention{display:inline-flex;align-items:center;gap:3px;padding:0 5px 0 2px;border-radius:999px;vertical-align:baseline;font-weight:600;color:var(--sg-accent, #2563eb);background:color-mix(in srgb,var(--sg-accent, #2563eb) 12%,transparent)}.sv-frv-comment .sv-frv-btn{justify-self:end}.sv-frv-send{display:flex;align-items:center;justify-content:flex-end;gap:12px;flex-wrap:wrap}.sv-frv-attach{display:inline-flex;align-items:center;gap:4px;margin-inline-end:auto}.sv-frv-internal{display:inline-flex;align-items:center;gap:4px;font-size:12px;color:var(--sg-muted, #64748b);cursor:pointer}.sv-frv-files{list-style:none;margin:6px 0 0;padding:0;display:flex;flex-direction:column;gap:3px}.sv-frv-replies-open{display:inline-flex;align-items:center;gap:4px}.sv-frv-replies{display:flex;flex-direction:column;gap:6px;padding:8px;border:1px solid var(--sg-border, #e2e8f0);border-radius:8px;background:var(--sg-bg, #fff)}.sv-frv-replies-search,.sv-frv-replies-save input{font:inherit;font-size:13px;padding:5px 8px;border:1px solid var(--sg-border, #e2e8f0);border-radius:6px;background:var(--sg-bg, #fff);color:var(--sg-fg, #0f172a);min-width:0}.sv-frv-replies-list{list-style:none;margin:0;padding:0;max-height:220px;overflow:auto;display:flex;flex-direction:column;gap:2px}.sv-frv-reply{display:flex;flex-direction:column;gap:2px;width:100%;text-align:start;padding:6px 8px;border:0;border-radius:6px;background:none;font:inherit;font-size:13px;color:inherit;cursor:pointer}.sv-frv-reply:hover,.sv-frv-reply:focus-visible{background:var(--sg-hover, #f1f5f9)}.sv-frv-reply span{color:var(--sg-muted, #64748b);font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sv-frv-replies-save{display:flex;gap:6px}.sv-frv-replies-save input{flex:1}.sv-frv-files li{display:flex;align-items:baseline;gap:6px;min-width:0;overflow-wrap:anywhere}.sv-frv-files a{color:var(--sg-accent, #2563eb)}.sv-frv-files.is-draft{margin:0;font-size:12px}.sv-frv-internal-tag{margin-inline-start:6px;padding:0 6px;border-radius:999px;font-size:11px;font-weight:600;color:#92400e;background:#fef3c7}.sv-frv-item.is-comment.is-internal .sv-frv-item-body{background:color-mix(in srgb,#f59e0b 12%,transparent)}.sv-frv-gone{color:var(--sg-muted, #64748b)}.sv-frv-footer{display:flex;align-items:center;gap:6px;width:100%}.sv-frv-pos{flex:1;font-size:13px;color:var(--sg-muted, #64748b)}.sv-frv-btn{display:inline-flex;align-items:center;justify-content:center;height:32px;min-width:32px;padding:0 12px;font:inherit;font-size:13px;cursor:pointer;border:1px solid var(--sg-border, #e2e8f0);border-radius:var(--sg-radius, 6px);background:var(--sg-bg, #fff);color:var(--sg-fg, #0f172a)}.sv-frv-btn:disabled{opacity:.4;cursor:default}.sv-frv-btn.is-primary{background:var(--sg-fg, #0f172a);color:var(--sg-bg, #fff);border-color:var(--sg-fg, #0f172a)}.sv-frv-btn.is-danger{color:var(--sg-danger, #b91c1c)}@media(max-width:760px){.sv-frv-layout{grid-template-columns:minmax(0,1fr)}.sv-frv-activity{position:static;padding-inline-start:0;border-inline-start:0;border-top:1px solid var(--sg-border, #e2e8f0);padding-top:12px}}@media(max-width:600px){:global(.sv-modal:has(.sv-frv-layout)){width:100vw!important;max-width:100vw;height:100dvh;max-height:100dvh;border-radius:0}}.sv-frv-apps{display:flex;flex-wrap:wrap;gap:14px;justify-content:flex-end;margin:0 0 8px}.sv-frv-app{display:inline-flex;align-items:center;gap:5px}
296
+ .sv-frv-proposals{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 12px;padding:8px 12px;border-radius:var(--sg-radius, 6px);font-size:13px;background:color-mix(in srgb,var(--sg-accent, #2563eb) 8%,var(--sg-bg, #fff));border:1px solid color-mix(in srgb,var(--sg-accent, #2563eb) 30%,var(--sg-border, #e2e8f0))}.sv-frv-proposal{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;margin-top:6px;padding:6px 8px;font-size:13px;border-inline-start:3px solid var(--sg-accent, #2563eb);border-radius:0 var(--sg-radius, 6px) var(--sg-radius, 6px) 0;background:color-mix(in srgb,var(--sg-accent, #2563eb) 6%,var(--sg-bg, #fff))}.sv-frv-proposal-by{color:var(--sg-muted, #64748b);font-size:12px}.sv-frv-filtered{display:flex;align-items:center;gap:6px;margin:0 0 12px;font-size:12px;color:var(--sg-muted, #64748b)}.sv-frv-filtered svg{flex:none}.sv-frv-proposal-value{font-weight:600;overflow-wrap:anywhere}.sv-frv-proposal-acts{display:inline-flex;gap:6px;margin-inline-start:auto}.sv-frv-proposal-acts .sv-frv-btn{height:26px;padding:0 10px}.sv-frv-btn.is-accept{background:var(--sg-accent, #2563eb);border-color:var(--sg-accent, #2563eb);color:var(--sg-on-accent, #fff)}.sv-frv-proposal-why{flex-basis:100%;color:var(--sg-muted, #64748b);font-size:12px}.sv-frv-layout{display:grid;grid-template-columns:minmax(0,1fr) 280px;gap:20px;align-items:start}.sv-frv-fields{display:flex;flex-direction:column;gap:14px;min-width:0}.sv-frv-field{display:flex;flex-direction:column;gap:6px}.sv-frv-label{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:600;color:var(--sg-muted, #64748b)}.sv-frv-mic{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;margin:-8px -6px -8px auto;padding:0;border:0;border-radius:50%;background:transparent;color:var(--sg-accent, #2563eb);cursor:pointer}.sv-frv-mic:hover:not(:disabled){background:color-mix(in srgb,var(--sg-accent, #2563eb) 12%,transparent)}.sv-frv-mic:disabled:not(.is-on){opacity:.4;cursor:default}.sv-frv-mic.is-on,.sv-frv-mic-comment.is-on{color:var(--sg-danger, #dc2626);animation:sv-frv-listen 1s ease-in-out infinite}.sv-frv-mic-comment{display:inline-flex;align-items:center;gap:4px}@keyframes sv-frv-listen{50%{opacity:.45}}@media(prefers-reduced-motion:reduce){.sv-frv-mic.is-on,.sv-frv-mic-comment.is-on{animation:none}}.sv-frv-ro{font-weight:400;font-size:11px;opacity:.8}.sv-frv-hidden-toggle{align-self:flex-start;border:0;padding:2px 0;background:none;font:inherit;font-size:13px;color:var(--sg-fg, #0f172a);text-decoration:underline;cursor:pointer}.sv-frv-activity{position:sticky;top:0;display:flex;flex-direction:column;gap:8px;max-height:70vh;padding-inline-start:16px;border-inline-start:1px solid var(--sg-border, #e2e8f0)}.sv-frv-activity-title{margin:0;font-size:13px;font-weight:600}.sv-frv-feed{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px;overflow:auto;min-height:60px}.sv-frv-item{font-size:12px}.sv-frv-item-head{color:var(--sg-muted, #64748b)}.sv-frv-item-head strong{color:var(--sg-fg, #0f172a);font-weight:600}.sv-frv-from{color:var(--sg-muted, #64748b);text-decoration:line-through}.sv-frv-arrow{margin:0 5px;color:var(--sg-muted, #64748b)}.sv-frv-when{margin-inline-start:6px;color:var(--sg-fg, #0f172a)}.sv-frv-note-acts{display:flex;align-items:center;justify-content:flex-end;gap:10px;margin-top:4px;font-size:12px;color:var(--sg-muted, #64748b)}.sv-frv-link{padding:0;border:0;background:none;font:inherit;font-size:12px;color:var(--sg-muted, #64748b);cursor:pointer}.sv-frv-link:hover{color:var(--sg-fg, #0f172a);text-decoration:underline}.sv-frv-restore{margin-top:2px}.sv-frv-votes{display:inline-flex;gap:4px;margin-right:auto}.sv-frv-vote{display:inline-flex;align-items:center;gap:4px;min-height:24px;padding:2px 8px;border:1px solid var(--sg-border, #e2e8f0);border-radius:999px;background:var(--sg-bg, #fff);font:inherit;font-size:12px;color:var(--sg-muted, #64748b);cursor:pointer}.sv-frv-vote:hover:not(:disabled){color:var(--sg-fg, #0f172a);border-color:color-mix(in srgb,var(--sg-fg, #0f172a) 30%,transparent)}.sv-frv-vote:focus-visible{outline:2px solid var(--sg-accent, #2563eb);outline-offset:2px}.sv-frv-vote:disabled{cursor:default}.sv-frv-vote.is-mine{color:var(--sg-accent, #2563eb);border-color:var(--sg-accent, #2563eb);background:color-mix(in srgb,var(--sg-accent, #2563eb) 10%,transparent)}.sv-frv-vote.is-down.is-mine{color:#b42318;border-color:#b42318;background:color-mix(in srgb,#b42318 10%,transparent)}.sv-frv-link:focus-visible{outline:2px solid var(--sg-accent, #2563eb);outline-offset:2px}.sv-frv-item-body{margin-top:2px;white-space:pre-wrap;word-break:break-word}.sv-frv-item.is-comment .sv-frv-item-body{padding:6px 8px;border-radius:8px;background:color-mix(in srgb,var(--sg-fg, #0f172a) 5%,transparent)}.sv-frv-none{color:var(--sg-muted, #64748b);font-size:12px}.sv-frv-comment{display:grid;gap:6px}.sv-frv-held{margin:0;font-size:12px;color:var(--sg-fg, #0f172a)}.sv-frv-mention{display:inline-flex;align-items:center;gap:3px;padding:0 5px 0 2px;border-radius:999px;vertical-align:baseline;font-weight:600;color:var(--sg-accent, #2563eb);background:color-mix(in srgb,var(--sg-accent, #2563eb) 12%,transparent)}.sv-frv-comment .sv-frv-btn{justify-self:end}.sv-frv-send{display:flex;align-items:center;justify-content:flex-end;gap:12px;flex-wrap:wrap}.sv-frv-attach{display:inline-flex;align-items:center;gap:4px;margin-inline-end:auto}.sv-frv-internal{display:inline-flex;align-items:center;gap:4px;font-size:12px;color:var(--sg-muted, #64748b);cursor:pointer}.sv-frv-files{list-style:none;margin:6px 0 0;padding:0;display:flex;flex-direction:column;gap:3px}.sv-frv-replies-open{display:inline-flex;align-items:center;gap:4px}.sv-frv-replies{display:flex;flex-direction:column;gap:6px;padding:8px;border:1px solid var(--sg-border, #e2e8f0);border-radius:8px;background:var(--sg-bg, #fff)}.sv-frv-replies-search,.sv-frv-replies-save input{font:inherit;font-size:13px;padding:5px 8px;border:1px solid var(--sg-border, #e2e8f0);border-radius:6px;background:var(--sg-bg, #fff);color:var(--sg-fg, #0f172a);min-width:0}.sv-frv-replies-list{list-style:none;margin:0;padding:0;max-height:220px;overflow:auto;display:flex;flex-direction:column;gap:2px}.sv-frv-reply{display:flex;flex-direction:column;gap:2px;width:100%;text-align:start;padding:6px 8px;border:0;border-radius:6px;background:none;font:inherit;font-size:13px;color:inherit;cursor:pointer}.sv-frv-reply:hover,.sv-frv-reply:focus-visible{background:var(--sg-hover, #f1f5f9)}.sv-frv-reply span{color:var(--sg-muted, #64748b);font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sv-frv-replies-save{display:flex;gap:6px}.sv-frv-replies-save input{flex:1}.sv-frv-files li{display:flex;align-items:baseline;gap:6px;min-width:0;overflow-wrap:anywhere}.sv-frv-files a{color:var(--sg-accent, #2563eb)}.sv-frv-files.is-draft{margin:0;font-size:12px}.sv-frv-internal-tag{margin-inline-start:6px;padding:0 6px;border-radius:999px;font-size:11px;font-weight:600;color:#92400e;background:#fef3c7}.sv-frv-item.is-comment.is-internal .sv-frv-item-body{background:color-mix(in srgb,#f59e0b 12%,transparent)}.sv-frv-gone{color:var(--sg-muted, #64748b)}.sv-frv-footer{display:flex;align-items:center;gap:6px;width:100%}.sv-frv-pos{flex:1;font-size:13px;color:var(--sg-muted, #64748b)}.sv-frv-btn{display:inline-flex;align-items:center;justify-content:center;height:32px;min-width:32px;padding:0 12px;font:inherit;font-size:13px;cursor:pointer;border:1px solid var(--sg-border, #e2e8f0);border-radius:var(--sg-radius, 6px);background:var(--sg-bg, #fff);color:var(--sg-fg, #0f172a)}.sv-frv-btn:disabled{opacity:.4;cursor:default}.sv-frv-btn.is-primary{background:var(--sg-fg, #0f172a);color:var(--sg-bg, #fff);border-color:var(--sg-fg, #0f172a)}.sv-frv-btn.is-danger{color:var(--sg-danger, #b91c1c)}@media(max-width:760px){.sv-frv-layout{grid-template-columns:minmax(0,1fr)}.sv-frv-activity{position:static;padding-inline-start:0;border-inline-start:0;border-top:1px solid var(--sg-border, #e2e8f0);padding-top:12px}}@media(max-width:600px){:global(.sv-modal:has(.sv-frv-layout)){width:100vw!important;max-width:100vw;height:100dvh;max-height:100dvh;border-radius:0}}.sv-frv-apps{display:flex;flex-wrap:wrap;gap:14px;justify-content:flex-end;margin:0 0 8px}.sv-frv-app{display:inline-flex;align-items:center;gap:5px}
293
297
  </style>
@@ -28,6 +28,8 @@ export declare const RECORD_MESSAGES: {
28
28
  readonly 'record.addedRecord': "added this record";
29
29
  readonly 'record.changedTo': "to";
30
30
  readonly 'record.cleared': "(cleared)";
31
+ readonly 'record.restoreValue': "Restore";
32
+ readonly 'record.restoreHint': "Put back what {field} held before this change";
31
33
  readonly 'record.noActivity': "No changes or comments yet.";
32
34
  readonly 'record.loadingHistory': "Loading the history...";
33
35
  readonly 'record.historyError': "The history could not be read: {error}";
@@ -1 +1 @@
1
- export const RECORD_MESSAGES={"record.untitled":"Untitled","record.record":"Record","record.protected":"protected","record.readOnly":"read-only","record.hiddenInGrid":"hidden in the grid","record.notInGridView":"This row is not in the grid's view any more.","record.showHiddenFields.one":"Show {count} hidden field","record.showHiddenFields.other":"Show {count} hidden fields","record.hideHiddenFields.one":"Hide {count} hidden field","record.hideHiddenFields.other":"Hide {count} hidden fields","record.activity":"Activity","record.someone":"Someone","record.someoneElse":"Someone else","record.you":"You","record.byAutomation":"Automation: {name}","record.acceptedBy":"{source} (accepted by {person})","record.through":"{person} via {source}","record.changedField":"changed {field}","record.undidField":"undid a change to {field}","record.redidField":"redid a change to {field}","record.addedRecord":"added this record","record.changedTo":"to","record.cleared":"(cleared)","record.noActivity":"No changes or comments yet.","record.loadingHistory":"Loading the history...","record.historyError":"The history could not be read: {error}","record.comment":"Comment","record.attachFiles":"Attach files","record.commentFiles":"Files","record.commentUploadFailed":"{name} was not uploaded: {error}","record.internalNote":"Internal note","record.internalNoteHint":"Only your team sees it, never a client.","record.internalTag":"Internal","record.savedReplies":"Saved replies","record.formSuggestTitle":"These may already answer it","record.formSolved":"This solved it","record.formSolvedTitle":"Glad it helped","record.formSolvedNote":"Nothing was sent.","record.formAskAnother":"Ask something else","record.searchReplies":"Search the saved replies","record.noReplies":"No saved replies yet.","record.noRepliesFound":"No saved reply matches.","record.loadingReplies":"Loading the saved replies...","record.repliesFailed":"The saved replies could not be read: {error}","record.saveAsReply":"Save this text as a reply","record.replyName":"Name of the reply","record.replySaved":"Saved as a reply.","record.replyNotSaved":"The reply was not saved: {error}","record.editComment":"Edit","record.deleteComment":"Delete","record.deleteCommentAsk":"Delete this comment?","record.commentNotSent":"This comment is not sent. Send it, or clear the box, and Esc closes the record.","record.commentNotSaved":"This change is not saved. Save or cancel it, and Esc closes the record.","record.commentHoldsStep":"This change is not saved. Save or cancel it, then move to another record.","record.fileRemoved":"{file} removed.","record.commentAddedSay":"Comment added.","record.commentKept":"Your comment was not sent. It is still in this record, ready to send.","record.commentSavedSay":"Comment saved.","record.commentDeletedSay":"Comment deleted.","record.commentEdited":"(edited)","record.saveComment":"Save","record.cancelComment":"Cancel","record.commentVotes":"Votes","record.voteUp":"Vote up","record.voteDown":"Vote down","record.voteUpCount":"Vote up ({count})","record.voteDownCount":"Vote down ({count})","record.votedUpBy":"Voted up by {names}","record.votedDownBy":"Voted down by {names}","record.previousRecord":"Previous record","record.nextRecord":"Next record","record.position":"{index} of {total}","record.newRecord":"New record","record.linkedOf":"{table} of {owner} ({count})","record.filteredOut":"This record is filtered out of this view.","record.notInView.one":"Not in view ({count} record)","record.notInView.other":"Not in view ({count} records)","record.close":"Close","record.justNow":"just now","record.minutesAgo.one":"{count} minute ago","record.minutesAgo.other":"{count} minutes ago","record.hoursAgo.one":"{count} hour ago","record.hoursAgo.other":"{count} hours ago","record.leaveComment":"Leave a comment","record.commentPlaceholder":"Leave a comment, @ to mention","record.peopleToMention":"People to mention","record.empty":"Empty","record.emptyValue":"empty","record.fieldValue":"{label}: {value}","record.fieldValueEdit":"{label}: {value}, edit","record.formProblems.one":"{count} field needs attention","record.formProblems.other":"{count} fields need attention","record.formTitle":"New record","record.formSubmit":"Submit","record.formChoose":"Choose","record.formPickDate":"Pick a date","record.formAddFiles":"Add files","record.formLinkRecords":"Link records","record.formTypeHere":"Type here","record.formRequired":"required","record.formInvalidEmail":"Not a valid email address","record.formInvalidUrl":"Not a valid web address","record.formInvalidPhone":"Not a valid phone number","record.formFieldRequired":"{field} is required","record.formFieldInvalid":"{field} is not valid","record.formSendFailed":"The record could not be sent. Try again.","record.formEmpty":"Fill in at least one field before you send this.","record.formThanks":"Thank you","record.formAdded":"The record was added.","record.formSubmitAnother":"Submit another","record.formNext":"Next","record.formBack":"Back","record.formStepOf":"Question {n} of {count}","record.formPressEnter":"or press Enter","record.unnamed":"Untitled","record.linkedGone":"This record is not in its table any more.","record.openIn":"Open in {table}","record.linkTo":"Link to {table}","record.linkToRecords":"Link to records","record.linkTableMissing":"The table this field links to is not available.","record.searchTable":"Search {table}","record.pickingFromView":'Records of the view "{view}"',"record.noRecordsMatch":"No records match.","record.createRecord":"Create “{name}”","record.showingOf":"Showing {shown} of {total}. Type to narrow.","record.linkedCount":"{count} linked","record.cancel":"Cancel","record.done":"Done","record.attachments":"Attachments","record.fileBadge":"FILE","record.uploadFailed":"Upload failed","record.uploadsFailed.one":"Upload failed","record.uploadsFailed.other":"{count} uploads failed","record.noUrlFound":"No http(s) URL found","record.noFilesYet":"No files yet. Drop files here, paste them, or use Add files.","record.files":"Files","record.fileTile":"{file}. Enter to preview, Delete to remove, Alt+Arrow to move.","record.removeFile":"Remove {name}","record.uploadingFile":"Uploading {name}","record.cancelUpload":"Cancel {name}","record.retry":"Retry","record.remove":"Remove","record.addFiles":"Add files","record.takePhoto":"Take a photo","record.scanCode":"Scan a code","record.dictateField":"Speak into {field}","record.dictateComment":"Speak a comment","record.listening":"Listening...","record.scanHint":"Point the camera at a barcode or a QR code.","record.scanUnsupported":"This browser cannot read codes from the camera.","record.scanNoCamera":"The camera is not available: allow it for this site, or close another app using it.","record.pasteUrl":"or paste a URL","record.addByUrl":"Add a file by URL","record.addFrom":"Add files from","record.sourceDevice":"Your device","record.sourceLink":"Link (URL)","record.dropHere":"Drop files here","record.dropOr":"or","record.chooseFiles":"Choose files","record.pasteHint":"You can also paste files or pictures here.","record.linkHint":"Paste the address of a file or a picture on the web.","record.addLink":"Add","record.photoHint":"Take a picture with the camera.","record.openSource":"Open {source}","record.sourceHint":"Choose files in {source}. They are added here.","record.sourceWaiting":"Waiting for {source}...","record.backToFiles":"Back to the files","record.gettingFile":"Getting {name}","record.uploadingCount":"Uploading {count}...","record.download":"Download","record.previous":"Previous","record.next":"Next","record.previousFile":"Previous file","record.nextFile":"Next file","record.filePosition":"{index} of {total}","record.noAttachments":"No attachments","record.attachmentList.one":"{count} attachment: {names}","record.attachmentList.other":"{count} attachments: {names}","record.notAdded":"Not added","record.uploading":"Uploading","record.keyMove":"move","record.keySave":"save","record.keyCancel":"cancel","record.checklist":"Checklist","record.checklistDone":"{done} of {total} done","record.noItemsYet":"No items yet","record.noItems":"No items","record.items":"Items","record.item":"item","record.itemNumber":"Item {n}","record.itemDone":"Done: {item}","record.moveItem":"Move {item}","record.deleteItem":"Delete {item}","record.addItem":"Add an item","record.color":"Color","record.hexCode":"Hex code","record.clear":"Clear","record.notAColor":"Not a color: use #rrggbb, #rgb, rgb() or a color name","record.colors":"Colors","record.notATime":"Not a time (9:30 am, 14:05, 2pm)","record.notADate":"Not a date (12/24/2026, 2026-12-24, Dec 24, 2026)","record.dateLabel":"Date","record.dateAndTimeLabel":"Date and time","record.calendarTab":"Date","record.timeTab":"Time","record.openCalendar":"Open the calendar","record.timeOfDay":"Time of day","record.longText":"Long text","record.markupHint":"**bold** *italic* `code` [link](https://...) - list","record.richText":"Rich text","record.removeValue":"Remove {name}","record.findPerson":"Find a person","record.findOption":"Find an option","record.addPerson":"Add a person","record.choosePerson":"Choose a person","record.addOption":"Add an option","record.chooseOption":"Choose an option","record.addNewOption":"Add option","record.everyoneChosen":"Everyone is chosen","record.nobodyMatches":"Nobody matches","record.noPeople":"No people (setFieldUsers)","record.everyOptionChosen":"Every option is chosen","record.noOptionMatches":"No option matches","record.noOptions":"No options","record.notADuration":"Not a duration (1:30, 1h 30m)","record.notANumber":"Not a number","record.formulaInNumber":"This field holds numbers. Press Enter to see how a formula field works this out.","record.noNegative":"Negative numbers are not allowed","record.durationLabel":"Duration ({format})","record.amountIn":"Amount in {symbol}","record.money":"money","record.percent":"Percent","record.number":"Number","record.increaseBy":"Increase by {step}","record.decreaseBy":"Decrease by {step}","record.ratingLabel":"Rating, {value} of {max}","record.aiNeedsPrompt":"Write a prompt for this field first (Edit field).","record.aiGenerating":"Generating...","record.aiWaiting":"Waiting...","record.aiGenerate":"Generate","record.aiGenerateAgain":"Generate again","record.aiNoProvider":"No AI provider","record.aiNoPrompt":"No prompt","record.voted":"{names} voted","record.noVotes":"No votes yet","record.votes.one":"{count} vote","record.votes.other":"{count} votes","record.timerStart":"Start the timer","record.timerStop":"Stop the timer","record.votesMine.one":"{count} vote, including yours","record.votesMine.other":"{count} votes, including yours","record.buttonOpen":"Open","record.nobody":"Nobody"};
1
+ export const RECORD_MESSAGES={"record.untitled":"Untitled","record.record":"Record","record.protected":"protected","record.readOnly":"read-only","record.hiddenInGrid":"hidden in the grid","record.notInGridView":"This row is not in the grid's view any more.","record.showHiddenFields.one":"Show {count} hidden field","record.showHiddenFields.other":"Show {count} hidden fields","record.hideHiddenFields.one":"Hide {count} hidden field","record.hideHiddenFields.other":"Hide {count} hidden fields","record.activity":"Activity","record.someone":"Someone","record.someoneElse":"Someone else","record.you":"You","record.byAutomation":"Automation: {name}","record.acceptedBy":"{source} (accepted by {person})","record.through":"{person} via {source}","record.changedField":"changed {field}","record.undidField":"undid a change to {field}","record.redidField":"redid a change to {field}","record.addedRecord":"added this record","record.changedTo":"to","record.cleared":"(cleared)","record.restoreValue":"Restore","record.restoreHint":"Put back what {field} held before this change","record.noActivity":"No changes or comments yet.","record.loadingHistory":"Loading the history...","record.historyError":"The history could not be read: {error}","record.comment":"Comment","record.attachFiles":"Attach files","record.commentFiles":"Files","record.commentUploadFailed":"{name} was not uploaded: {error}","record.internalNote":"Internal note","record.internalNoteHint":"Only your team sees it, never a client.","record.internalTag":"Internal","record.savedReplies":"Saved replies","record.formSuggestTitle":"These may already answer it","record.formSolved":"This solved it","record.formSolvedTitle":"Glad it helped","record.formSolvedNote":"Nothing was sent.","record.formAskAnother":"Ask something else","record.searchReplies":"Search the saved replies","record.noReplies":"No saved replies yet.","record.noRepliesFound":"No saved reply matches.","record.loadingReplies":"Loading the saved replies...","record.repliesFailed":"The saved replies could not be read: {error}","record.saveAsReply":"Save this text as a reply","record.replyName":"Name of the reply","record.replySaved":"Saved as a reply.","record.replyNotSaved":"The reply was not saved: {error}","record.editComment":"Edit","record.deleteComment":"Delete","record.deleteCommentAsk":"Delete this comment?","record.commentNotSent":"This comment is not sent. Send it, or clear the box, and Esc closes the record.","record.commentNotSaved":"This change is not saved. Save or cancel it, and Esc closes the record.","record.commentHoldsStep":"This change is not saved. Save or cancel it, then move to another record.","record.fileRemoved":"{file} removed.","record.commentAddedSay":"Comment added.","record.commentKept":"Your comment was not sent. It is still in this record, ready to send.","record.commentSavedSay":"Comment saved.","record.commentDeletedSay":"Comment deleted.","record.commentEdited":"(edited)","record.saveComment":"Save","record.cancelComment":"Cancel","record.commentVotes":"Votes","record.voteUp":"Vote up","record.voteDown":"Vote down","record.voteUpCount":"Vote up ({count})","record.voteDownCount":"Vote down ({count})","record.votedUpBy":"Voted up by {names}","record.votedDownBy":"Voted down by {names}","record.previousRecord":"Previous record","record.nextRecord":"Next record","record.position":"{index} of {total}","record.newRecord":"New record","record.linkedOf":"{table} of {owner} ({count})","record.filteredOut":"This record is filtered out of this view.","record.notInView.one":"Not in view ({count} record)","record.notInView.other":"Not in view ({count} records)","record.close":"Close","record.justNow":"just now","record.minutesAgo.one":"{count} minute ago","record.minutesAgo.other":"{count} minutes ago","record.hoursAgo.one":"{count} hour ago","record.hoursAgo.other":"{count} hours ago","record.leaveComment":"Leave a comment","record.commentPlaceholder":"Leave a comment, @ to mention","record.peopleToMention":"People to mention","record.empty":"Empty","record.emptyValue":"empty","record.fieldValue":"{label}: {value}","record.fieldValueEdit":"{label}: {value}, edit","record.formProblems.one":"{count} field needs attention","record.formProblems.other":"{count} fields need attention","record.formTitle":"New record","record.formSubmit":"Submit","record.formChoose":"Choose","record.formPickDate":"Pick a date","record.formAddFiles":"Add files","record.formLinkRecords":"Link records","record.formTypeHere":"Type here","record.formRequired":"required","record.formInvalidEmail":"Not a valid email address","record.formInvalidUrl":"Not a valid web address","record.formInvalidPhone":"Not a valid phone number","record.formFieldRequired":"{field} is required","record.formFieldInvalid":"{field} is not valid","record.formSendFailed":"The record could not be sent. Try again.","record.formEmpty":"Fill in at least one field before you send this.","record.formThanks":"Thank you","record.formAdded":"The record was added.","record.formSubmitAnother":"Submit another","record.formNext":"Next","record.formBack":"Back","record.formStepOf":"Question {n} of {count}","record.formPressEnter":"or press Enter","record.unnamed":"Untitled","record.linkedGone":"This record is not in its table any more.","record.openIn":"Open in {table}","record.linkTo":"Link to {table}","record.linkToRecords":"Link to records","record.linkTableMissing":"The table this field links to is not available.","record.searchTable":"Search {table}","record.pickingFromView":'Records of the view "{view}"',"record.noRecordsMatch":"No records match.","record.createRecord":"Create “{name}”","record.showingOf":"Showing {shown} of {total}. Type to narrow.","record.linkedCount":"{count} linked","record.cancel":"Cancel","record.done":"Done","record.attachments":"Attachments","record.fileBadge":"FILE","record.uploadFailed":"Upload failed","record.uploadsFailed.one":"Upload failed","record.uploadsFailed.other":"{count} uploads failed","record.noUrlFound":"No http(s) URL found","record.noFilesYet":"No files yet. Drop files here, paste them, or use Add files.","record.files":"Files","record.fileTile":"{file}. Enter to preview, Delete to remove, Alt+Arrow to move.","record.removeFile":"Remove {name}","record.uploadingFile":"Uploading {name}","record.cancelUpload":"Cancel {name}","record.retry":"Retry","record.remove":"Remove","record.addFiles":"Add files","record.takePhoto":"Take a photo","record.scanCode":"Scan a code","record.dictateField":"Speak into {field}","record.dictateComment":"Speak a comment","record.listening":"Listening...","record.scanHint":"Point the camera at a barcode or a QR code.","record.scanUnsupported":"This browser cannot read codes from the camera.","record.scanNoCamera":"The camera is not available: allow it for this site, or close another app using it.","record.pasteUrl":"or paste a URL","record.addByUrl":"Add a file by URL","record.addFrom":"Add files from","record.sourceDevice":"Your device","record.sourceLink":"Link (URL)","record.dropHere":"Drop files here","record.dropOr":"or","record.chooseFiles":"Choose files","record.pasteHint":"You can also paste files or pictures here.","record.linkHint":"Paste the address of a file or a picture on the web.","record.addLink":"Add","record.photoHint":"Take a picture with the camera.","record.openSource":"Open {source}","record.sourceHint":"Choose files in {source}. They are added here.","record.sourceWaiting":"Waiting for {source}...","record.backToFiles":"Back to the files","record.gettingFile":"Getting {name}","record.uploadingCount":"Uploading {count}...","record.download":"Download","record.previous":"Previous","record.next":"Next","record.previousFile":"Previous file","record.nextFile":"Next file","record.filePosition":"{index} of {total}","record.noAttachments":"No attachments","record.attachmentList.one":"{count} attachment: {names}","record.attachmentList.other":"{count} attachments: {names}","record.notAdded":"Not added","record.uploading":"Uploading","record.keyMove":"move","record.keySave":"save","record.keyCancel":"cancel","record.checklist":"Checklist","record.checklistDone":"{done} of {total} done","record.noItemsYet":"No items yet","record.noItems":"No items","record.items":"Items","record.item":"item","record.itemNumber":"Item {n}","record.itemDone":"Done: {item}","record.moveItem":"Move {item}","record.deleteItem":"Delete {item}","record.addItem":"Add an item","record.color":"Color","record.hexCode":"Hex code","record.clear":"Clear","record.notAColor":"Not a color: use #rrggbb, #rgb, rgb() or a color name","record.colors":"Colors","record.notATime":"Not a time (9:30 am, 14:05, 2pm)","record.notADate":"Not a date (12/24/2026, 2026-12-24, Dec 24, 2026)","record.dateLabel":"Date","record.dateAndTimeLabel":"Date and time","record.calendarTab":"Date","record.timeTab":"Time","record.openCalendar":"Open the calendar","record.timeOfDay":"Time of day","record.longText":"Long text","record.markupHint":"**bold** *italic* `code` [link](https://...) - list","record.richText":"Rich text","record.removeValue":"Remove {name}","record.findPerson":"Find a person","record.findOption":"Find an option","record.addPerson":"Add a person","record.choosePerson":"Choose a person","record.addOption":"Add an option","record.chooseOption":"Choose an option","record.addNewOption":"Add option","record.everyoneChosen":"Everyone is chosen","record.nobodyMatches":"Nobody matches","record.noPeople":"No people (setFieldUsers)","record.everyOptionChosen":"Every option is chosen","record.noOptionMatches":"No option matches","record.noOptions":"No options","record.notADuration":"Not a duration (1:30, 1h 30m)","record.notANumber":"Not a number","record.formulaInNumber":"This field holds numbers. Press Enter to see how a formula field works this out.","record.noNegative":"Negative numbers are not allowed","record.durationLabel":"Duration ({format})","record.amountIn":"Amount in {symbol}","record.money":"money","record.percent":"Percent","record.number":"Number","record.increaseBy":"Increase by {step}","record.decreaseBy":"Decrease by {step}","record.ratingLabel":"Rating, {value} of {max}","record.aiNeedsPrompt":"Write a prompt for this field first (Edit field).","record.aiGenerating":"Generating...","record.aiWaiting":"Waiting...","record.aiGenerate":"Generate","record.aiGenerateAgain":"Generate again","record.aiNoProvider":"No AI provider","record.aiNoPrompt":"No prompt","record.voted":"{names} voted","record.noVotes":"No votes yet","record.votes.one":"{count} vote","record.votes.other":"{count} votes","record.timerStart":"Start the timer","record.timerStop":"Stop the timer","record.votesMine.one":"{count} vote, including yours","record.votesMine.other":"{count} votes, including yours","record.buttonOpen":"Open","record.nobody":"Nobody"};
@@ -862,6 +862,8 @@ export declare const BASE_MESSAGES: {
862
862
  readonly 'record.addedRecord': "added this record";
863
863
  readonly 'record.changedTo': "to";
864
864
  readonly 'record.cleared': "(cleared)";
865
+ readonly 'record.restoreValue': "Restore";
866
+ readonly 'record.restoreHint': "Put back what {field} held before this change";
865
867
  readonly 'record.noActivity': "No changes or comments yet.";
866
868
  readonly 'record.loadingHistory': "Loading the history...";
867
869
  readonly 'record.historyError': "The history could not be read: {error}";
@@ -913,7 +913,7 @@ ${E}
913
913
  @keyframes st-home-spin { to { transform: rotate(360deg); } }
914
914
  </style>
915
915
  `}}function Ka(e){for(const r of e)je(r);const t=new Map(e.map(r=>[r.name,r])),a=e.map(r=>{const o=Eu(r,t);return{schema:Fu(r,o),infos:o}});return{entries:a,seed:Du(a)}}function fo(e,t={}){const{entries:a,seed:r}=Ka(e),{file:o,needs:n}=em(a,r,t.sources,t.supabaseConn,t.serverMemory),i=[Lu(a),o];(n.supabase||t.supabaseAuth)&&!n.supabaseUrl&&(t.supabaseConn?.url||t.supabaseConn?.key)&&(n.supabaseUrl=t.supabaseConn.url,n.supabaseKey=t.supabaseConn.key),(n.supabase||t.supabaseAuth)&&i.push(tm(n));for(const s of n.sqlRoutes)i.push(Hu(s.schema,s.table,s.dialect,{access:t.accessEnabled,audit:t.auditEnabled,screenIds:t.screensByEntity?.get(s.schema.name)??[],triggers:t.triggers?.[s.schema.name],dbSchema:s.dbSchema,tenantField:t.tenantField&&t.tenantScoped?.(s.schema.name)!==!1?t.tenantField:void 0}));if(n.memoryRoutes.length){i.push(Gu(n.memoryRoutes));for(const s of n.memoryRoutes)i.push(Vu(s.schema,{access:t.accessEnabled,audit:t.auditEnabled,screenIds:t.screensByEntity?.get(s.schema.name)??[],triggers:t.triggers?.[s.schema.name],tenantField:t.tenantField&&t.tenantScoped?.(s.schema.name)!==!1?t.tenantField:void 0}))}return{files:i,prepared:a.map(s=>s.schema)}}function am(e){if(e.length===0)throw new Error("emitStudioApp: no schemas to emit");const{files:t,prepared:a}=fo(e),r=a.map(n=>{const i=z(n);return{href:`/${i.route}`,label:i.label}}),o={path:"src/custom.css",description:"Your custom styles (imported after app.css so it overrides).",userOwned:!0,contents:`/* Your custom styles. Imported after app.css, so these rules override the defaults. */
916
- `};return[...t,...a.map(n=>Ni(n)),Mi(r),ji(r),o]}function rm(e){return e.fields.some(t=>!!t.when&&(!!t.when.visible||!!t.when.disabled||!!t.when.required))}var om="3.1.63",nm="3.0.39",V=(e,t)=>e.some(a=>a.config.kind===t),qi=e=>`activeTab_${e.replace(/[^a-zA-Z0-9_$]/g,"_")}`,aa=(e,t)=>`${e}-${t}`,zi=e=>`accOpen_${e.replace(/[^a-zA-Z0-9_$]/g,"_")}`,ra=(e,t)=>`${e}-s${t}`,oa=e=>`md_${e.replace(/[^a-zA-Z0-9]/g,"_")}_rows`;function im(e){switch(e.type){case"number":{const t=e.decimals;return t!=null?`{ type: 'number', options: { minimumFractionDigits: ${t}, maximumFractionDigits: ${t} } }`:"{ type: 'number' }"}case"currency":return`{ type: 'currency', currency: ${S(e.currency||"USD")} }`;case"percent":{const t=["type: 'percent'"];return e.valueIsPercentPoints&&t.push("valueIsPercentPoints: true"),e.decimals!=null&&t.push(`options: { minimumFractionDigits: ${e.decimals}, maximumFractionDigits: ${e.decimals} }`),`{ ${t.join(", ")} }`}case"date":case"datetime":return e.pattern?`{ type: '${e.type}', pattern: ${S(e.pattern)} }`:`{ type: '${e.type}' }`}}function sm(e,t,a,r){if(t.config.kind!=="grid")return`schemaToColumns(${e})`;const o=t.config,n=t.id.replace(/-/g,"_"),i=o.columns.filter(b=>b.show),s=new Set(i.map(b=>b.field)),d=new Set,l=i.map(b=>{const y=r?.get(b.field);return{c:b,col:y&&!s.has(y)?y:b.field}}).filter(b=>!d.has(b.col)&&!!d.add(b.col)),c=o.editing==="inline"?"":", editable: false";if(l.length===0)return c?`schemaToColumns(${e}).map((c) => ({ ...c${c} }))`:`schemaToColumns(${e})`;const p=l.map(b=>`'${b.col}'`),u=l.map(({c:b,col:y})=>{const w=[];return b.header&&w.push(`header: ${JSON.stringify(b.header)}`),b.width!=null&&w.push(`width: ${b.width}`),b.align&&w.push(`align: '${b.align}'`),b.aggregate&&w.push(`aggregate: '${b.aggregate}'`),o.treeData&&b.field===o.treeData.labelField&&a?w.push(`cell: (ctx: CellContext<${a}>) => renderSnippet(treeCell_${n}, { value: ctx.getValue(), row: ctx.row.original })`):b.cellType&&a?w.push(`cell: (ctx: CellContext<${a}>) => renderSnippet(${Gi(n,b.field)}, { value: ctx.getValue() })`):b.format&&w.push(`format: ${im(b.format)}`),w.length?`'${y}': { ${w.join(", ")} }`:null}).filter(b=>!!b),m=u.length?` const ov: Record<string, Partial<(typeof all)[number]>> = { ${u.join(", ")} };`:"",g=u.length?", ...(ov[String(c.field)] ?? {})":"",h=`[${p.join(", ")}].map((f) => all.find((c) => c.field === f)).filter((c): c is (typeof all)[number] => !!c)`;return`(() => { const all = schemaToColumns(${e});${m} return ${c||g?`${h}.map((c) => ({ ...c${c}${g} }))`:h} })()`}function Ae(e,t){const a=[`grid-column: span ${ei(e)}`,"min-width: 0"];t&&a.push(t);const r=ti(e.style);return r&&a.push(r),`style="${a.join("; ")}"`}var lm=e=>e&&e.replace(/[^#a-zA-Z0-9(),.%\s_-]/g,"").slice(0,40)||"var(--sg-accent)";function Ue(e,t){const a=[t,Xn(e)].filter(Boolean).join(" ");return a?` class="${a}"`:""}function Ha(e){const t=Ta(e.className);return t?` ${t}`:""}function dm(e){const t=Fe(e);if(t==="grid"){const a=ui(e),r=a.maxWidth?` max-width: ${a.maxWidth}px; margin-inline: auto;`:"";return` .st-screen { grid-template-columns: repeat(12, 1fr); gap: ${a.rowGap}px ${a.colGap}px; align-items: ${a.align};${r} }
916
+ `};return[...t,...a.map(n=>Ni(n)),Mi(r),ji(r),o]}function rm(e){return e.fields.some(t=>!!t.when&&(!!t.when.visible||!!t.when.disabled||!!t.when.required))}var om="3.1.64",nm="3.0.39",V=(e,t)=>e.some(a=>a.config.kind===t),qi=e=>`activeTab_${e.replace(/[^a-zA-Z0-9_$]/g,"_")}`,aa=(e,t)=>`${e}-${t}`,zi=e=>`accOpen_${e.replace(/[^a-zA-Z0-9_$]/g,"_")}`,ra=(e,t)=>`${e}-s${t}`,oa=e=>`md_${e.replace(/[^a-zA-Z0-9]/g,"_")}_rows`;function im(e){switch(e.type){case"number":{const t=e.decimals;return t!=null?`{ type: 'number', options: { minimumFractionDigits: ${t}, maximumFractionDigits: ${t} } }`:"{ type: 'number' }"}case"currency":return`{ type: 'currency', currency: ${S(e.currency||"USD")} }`;case"percent":{const t=["type: 'percent'"];return e.valueIsPercentPoints&&t.push("valueIsPercentPoints: true"),e.decimals!=null&&t.push(`options: { minimumFractionDigits: ${e.decimals}, maximumFractionDigits: ${e.decimals} }`),`{ ${t.join(", ")} }`}case"date":case"datetime":return e.pattern?`{ type: '${e.type}', pattern: ${S(e.pattern)} }`:`{ type: '${e.type}' }`}}function sm(e,t,a,r){if(t.config.kind!=="grid")return`schemaToColumns(${e})`;const o=t.config,n=t.id.replace(/-/g,"_"),i=o.columns.filter(b=>b.show),s=new Set(i.map(b=>b.field)),d=new Set,l=i.map(b=>{const y=r?.get(b.field);return{c:b,col:y&&!s.has(y)?y:b.field}}).filter(b=>!d.has(b.col)&&!!d.add(b.col)),c=o.editing==="inline"?"":", editable: false";if(l.length===0)return c?`schemaToColumns(${e}).map((c) => ({ ...c${c} }))`:`schemaToColumns(${e})`;const p=l.map(b=>`'${b.col}'`),u=l.map(({c:b,col:y})=>{const w=[];return b.header&&w.push(`header: ${JSON.stringify(b.header)}`),b.width!=null&&w.push(`width: ${b.width}`),b.align&&w.push(`align: '${b.align}'`),b.aggregate&&w.push(`aggregate: '${b.aggregate}'`),o.treeData&&b.field===o.treeData.labelField&&a?w.push(`cell: (ctx: CellContext<${a}>) => renderSnippet(treeCell_${n}, { value: ctx.getValue(), row: ctx.row.original })`):b.cellType&&a?w.push(`cell: (ctx: CellContext<${a}>) => renderSnippet(${Gi(n,b.field)}, { value: ctx.getValue() })`):b.format&&w.push(`format: ${im(b.format)}`),w.length?`'${y}': { ${w.join(", ")} }`:null}).filter(b=>!!b),m=u.length?` const ov: Record<string, Partial<(typeof all)[number]>> = { ${u.join(", ")} };`:"",g=u.length?", ...(ov[String(c.field)] ?? {})":"",h=`[${p.join(", ")}].map((f) => all.find((c) => c.field === f)).filter((c): c is (typeof all)[number] => !!c)`;return`(() => { const all = schemaToColumns(${e});${m} return ${c||g?`${h}.map((c) => ({ ...c${c}${g} }))`:h} })()`}function Ae(e,t){const a=[`grid-column: span ${ei(e)}`,"min-width: 0"];t&&a.push(t);const r=ti(e.style);return r&&a.push(r),`style="${a.join("; ")}"`}var lm=e=>e&&e.replace(/[^#a-zA-Z0-9(),.%\s_-]/g,"").slice(0,40)||"var(--sg-accent)";function Ue(e,t){const a=[t,Xn(e)].filter(Boolean).join(" ");return a?` class="${a}"`:""}function Ha(e){const t=Ta(e.className);return t?` ${t}`:""}function dm(e){const t=Fe(e);if(t==="grid"){const a=ui(e),r=a.maxWidth?` max-width: ${a.maxWidth}px; margin-inline: auto;`:"";return` .st-screen { grid-template-columns: repeat(12, 1fr); gap: ${a.rowGap}px ${a.colGap}px; align-items: ${a.align};${r} }
917
917
  @media (max-width: ${a.mobileBreakpoint}px) { .st-screen { grid-template-columns: 1fr; gap: 12px; } }
918
918
  `}if(t==="stack"){const a=mi(e),r=a.maxWidth?` max-width: ${a.maxWidth}px;${a.align==="center"?" margin-inline: auto;":""}`:"",o=a.minHeight?`
919
919
  .st-stack > * { min-height: ${a.minHeight}px; }`:"",n=a.dividers?`
package/dist/version.d.ts CHANGED
@@ -10,7 +10,7 @@
10
10
  *
11
11
  * `version.test.ts` asserts this matches `package.json`, so the two cannot drift.
12
12
  */
13
- export declare const SVGRID_VERSION = "3.1.63";
13
+ export declare const SVGRID_VERSION = "3.1.64";
14
14
  /**
15
15
  * The version of `@svgrid/grid`, which releases on its own line: enterprise is
16
16
  * on 3.1.x while the grid is on 3.0.x.
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const SVGRID_VERSION="3.1.63",GRID_VERSION="3.0.39";
1
+ export const SVGRID_VERSION="3.1.64",GRID_VERSION="3.0.39";