@svgrid/enterprise 3.1.45 → 3.1.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/SvGridBoard.svelte +14 -4
- package/dist/cdn/svgrid-enterprise.svelte-external.js +334 -331
- package/dist/designer/assets/{index-BQO-FqUG.js → index-Bu6aNQcY.js} +1 -1
- package/dist/designer/index.html +1 -1
- package/dist/fields/BaseTabs.svelte +26 -6
- package/dist/fields/RecordView.svelte +13 -2
- package/dist/fields/SvBase.svelte +1 -1
- package/dist/fields/barcode-scan.d.ts +15 -4
- package/dist/fields/barcode-scan.js +1 -1
- package/dist/fields/dictation.svelte.d.ts +18 -0
- package/dist/fields/dictation.svelte.js +1 -0
- package/dist/fields/index.d.ts +2 -0
- package/dist/fields/index.js +1 -1
- package/dist/fields/messages/record.d.ts +3 -0
- package/dist/fields/messages/record.js +1 -1
- package/dist/fields/messages/shell.d.ts +2 -0
- package/dist/fields/messages/shell.js +1 -1
- package/dist/fields/messages.svelte.d.ts +5 -0
- package/dist/node/studio.js +1 -1
- package/dist/server/server-row-model.d.ts +10 -0
- package/dist/server/server-row-model.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/wc/board-C2hPY2IP.js +26 -0
- package/dist/wc/server-row-model-aLsfzGo3.js +1 -0
- package/dist/wc/sv-base-element.js +96 -91
- package/package.json +1 -1
- package/dist/wc/board-DS5OxhbF.js +0 -23
- package/dist/wc/server-row-model-C-FV79zV.js +0 -1
|
@@ -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 o2e(a){for(let p of a)O4(p);let i=new Map(a.map(p=>[p.name,p])),l=a.map(p=>{let f=Epr(p,i);return{schema:wpr(p,f),infos:f}});return{entries:l,seed:Apr(l)}}function Jpr(a,i={}){let{entries:l,seed:p}=o2e(a),{file:f,needs:g}=qpr(l,p,i.sources,i.supabaseConn,i.serverMemory),_=[kpr(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(Kpr(g));for(let S of g.sqlRoutes)_.push(Wpr(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(Gpr(g.memoryRoutes));for(let S of g.memoryRoutes)_.push(zpr(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 Ypr="3.1.
|
|
76335
|
+
`}}function o2e(a){for(let p of a)O4(p);let i=new Map(a.map(p=>[p.name,p])),l=a.map(p=>{let f=Epr(p,i);return{schema:wpr(p,f),infos:f}});return{entries:l,seed:Apr(l)}}function Jpr(a,i={}){let{entries:l,seed:p}=o2e(a),{file:f,needs:g}=qpr(l,p,i.sources,i.supabaseConn,i.serverMemory),_=[kpr(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(Kpr(g));for(let S of g.sqlRoutes)_.push(Wpr(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(Gpr(g.memoryRoutes));for(let S of g.memoryRoutes)_.push(zpr(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 Ypr="3.1.47",Zpr="3.0.37",hb=(a,i)=>a.some(l=>l.config.kind===i),Bit=a=>`activeTab_${a.replace(/[^a-zA-Z0-9_$]/g,"_")}`,KZ=(a,i)=>`${a}-${i}`,Uit=a=>`accOpen_${a.replace(/[^a-zA-Z0-9_$]/g,"_")}`,QZ=(a,i)=>`${a}-s${i}`,XZ=a=>`md_${a.replace(/[^a-zA-Z0-9]/g,"_")}_rows`;function eur(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: ${_u(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: ${_u(a.pattern)} }`:`{ type: '${a.type}' }`}}function tur(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(${Qit(g,be.field)}, { value: ctx.getValue() })`):be.format&&Ue.push(`format: ${eur(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 HF(a,i){let l=[`grid-column: span ${iM(a)}`,"min-width: 0"];i&&l.push(i);let p=fit(a.style);return p&&l.push(p),`style="${l.join("; ")}"`}var rur=a=>a&&a.replace(/[^#a-zA-Z0-9(),.%\s_-]/g,"").slice(0,40)||"var(--sg-accent)";function L8(a,i){let l=[i,NH(a)].filter(Boolean).join(" ");return l?` class="${l}"`:""}function rfe(a){let i=LZ(a.className);return i?` ${i}`:""}function nur(a){let i=sR(a);if(i==="grid"){let l=VDe(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=Hue(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?`
|
package/dist/designer/index.html
CHANGED
|
@@ -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-
|
|
7
|
+
<script type="module" crossorigin src="./assets/index-Bu6aNQcY.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,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import{tick}from"svelte";import{keepFocus,menuFocus,SvModal,SvPopover}from"@svgrid/grid";import{linkReaders}from"./base-tables";import BaseSearch from"./BaseSearch.svelte";import{bm,bmCount}from"./messages.svelte";let{tables,activeId,onSwitch,onAdd,onRename,onDuplicate,onDelete,onExportSql,onExportView,excelReady,status=null,undo=null,trashCount=0,onOpenTrash,onImport,readOnly=false,schema=true,importRecords=true,search=null,slot=$bindable(null)}=$props();let stripW=$state(0);const compact=$derived(stripW>0&&stripW<=600);const statusTitle=$derived(status&&status.title&&status.title!==status.text?`${status.text}
|
|
3
3
|
${status.title}`:status?.text);const statusMore=$derived(status?.title&&status.title!==status.text?status.title:"");const statusOpenable=$derived(!!statusMore||status?.tone==="error");const statusKey=$derived(status?`${status.text}
|
|
4
|
-
${statusMore}`:null);let openStatus=$state(null);const statusOpen=$derived(statusOpenable&&openStatus===statusKey);$effect(()=>{if(openStatus!==null&&openStatus!==statusKey)openStatus=null});let searchBox=$state(null);let searchedFrom=null;let escaping=false;export function focusSearch(){const from=document.activeElement;if(from instanceof HTMLElement&&from!==document.body&&!from.closest(".sv-btabs-end"))searchedFrom=from;searchBox?.focus();return!!searchBox}function noteEscape(e){if(e.key!=="Escape")return;escaping=true;setTimeout(()=>escaping=false,0)}function leftSearch(e){if(escaping&&!e.relatedTarget&&searchedFrom?.isConnected)searchedFrom.focus()}let menuOpen=$state(false);let listOpen=$state(false);let excelMissing=$state(false);$effect(()=>{if(listOpen&&onExportView&&excelReady)void excelReady().then(ok=>excelMissing=!ok)});const uid=`sv-btabs-${Math.random().toString(36).slice(2,8)}`;let renaming=$state(null);let draft=$state("");let deleting=$state(null);let confirmOpen=$state(false);let strip=$state(null);const active=$derived(tables.find(t=>t.id===activeId));function linksTo(t){const out=[];for(const o of tables){if(o.id===t.id)continue;for(const d of o.columns){if(d.fieldType!=="link"||d.fieldProps?.table!==t.id)continue;const name=String(d.header??d.field);out.push(`${o.name}: ${name}`);for(const r of linkReaders(o,d))out.push(bm("shell.readsLink",{table:o.name,field:String(r.header??r.field),link:name}))}}return out}async function startRename(id){if(readOnly||!schema)return;menuOpen=false;renaming=id;draft=tables.find(t=>t.id===id)?.name??"";await tick();const input=strip?.querySelector(".sv-btabs-input");input?.focus();input?.select()}function commitRename(){const id=renaming;renaming=null;const name=draft.trim();if(id&&name&&name!==tables.find(t=>t.id===id)?.name)onRename(id,name)}function renameKey(e){if(e.isComposing)return;if(e.key==="Enter")commitRename();else if(e.key==="Escape")renaming=null}function askDelete(){menuOpen=false;deleting=active??null;confirmOpen=!!deleting}function confirmDelete(){const t=deleting;confirmOpen=false;deleting=null;if(t)onDelete(t.id)}function tabKey(e,i){let to=-1;if(e.key==="ArrowRight")to=(i+1)%tables.length;else if(e.key==="ArrowLeft")to=(i-1+tables.length)%tables.length;else if(e.key==="Home")to=0;else if(e.key==="End")to=tables.length-1;else if(e.key==="F2"){e.preventDefault();void startRename(tables[i].id);return}if(to<0)return;e.preventDefault();onSwitch(tables[to].id);void tick().then(()=>strip?.querySelectorAll('[role="tab"]')[to]?.focus())}const inputValue=e=>e.currentTarget.value;
|
|
4
|
+
${statusMore}`:null);let openStatus=$state(null);const statusOpen=$derived(statusOpenable&&openStatus===statusKey);$effect(()=>{if(openStatus!==null&&openStatus!==statusKey)openStatus=null});let searchBox=$state(null);let searchedFrom=null;let escaping=false;export function focusSearch(){const from=document.activeElement;if(from instanceof HTMLElement&&from!==document.body&&!from.closest(".sv-btabs-end"))searchedFrom=from;searchBox?.focus();return!!searchBox}function noteEscape(e){if(e.key!=="Escape")return;escaping=true;setTimeout(()=>escaping=false,0)}function leftSearch(e){if(escaping&&!e.relatedTarget&&searchedFrom?.isConnected)searchedFrom.focus()}let menuOpen=$state(false);let listOpen=$state(false);let addOpen=$state(false);let excelMissing=$state(false);$effect(()=>{if(listOpen&&onExportView&&excelReady)void excelReady().then(ok=>excelMissing=!ok)});const uid=`sv-btabs-${Math.random().toString(36).slice(2,8)}`;let renaming=$state(null);let draft=$state("");let deleting=$state(null);let confirmOpen=$state(false);let strip=$state(null);const active=$derived(tables.find(t=>t.id===activeId));function linksTo(t){const out=[];for(const o of tables){if(o.id===t.id)continue;for(const d of o.columns){if(d.fieldType!=="link"||d.fieldProps?.table!==t.id)continue;const name=String(d.header??d.field);out.push(`${o.name}: ${name}`);for(const r of linkReaders(o,d))out.push(bm("shell.readsLink",{table:o.name,field:String(r.header??r.field),link:name}))}}return out}async function startRename(id){if(readOnly||!schema)return;menuOpen=false;renaming=id;draft=tables.find(t=>t.id===id)?.name??"";await tick();const input=strip?.querySelector(".sv-btabs-input");input?.focus();input?.select()}function commitRename(){const id=renaming;renaming=null;const name=draft.trim();if(id&&name&&name!==tables.find(t=>t.id===id)?.name)onRename(id,name)}function renameKey(e){if(e.isComposing)return;if(e.key==="Enter")commitRename();else if(e.key==="Escape")renaming=null}function askDelete(){menuOpen=false;deleting=active??null;confirmOpen=!!deleting}function confirmDelete(){const t=deleting;confirmOpen=false;deleting=null;if(t)onDelete(t.id)}function tabKey(e,i){let to=-1;if(e.key==="ArrowRight")to=(i+1)%tables.length;else if(e.key==="ArrowLeft")to=(i-1+tables.length)%tables.length;else if(e.key==="Home")to=0;else if(e.key==="End")to=tables.length-1;else if(e.key==="F2"){e.preventDefault();void startRename(tables[i].id);return}if(to<0)return;e.preventDefault();onSwitch(tables[to].id);void tick().then(()=>strip?.querySelectorAll('[role="tab"]')[to]?.focus())}const inputValue=e=>e.currentTarget.value;
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
7
|
<div class="sv-btabs" class:has-open-status={statusOpen} class:is-compact={compact} bind:this={strip} bind:clientWidth={stripW}>
|
|
@@ -147,10 +147,30 @@ ${statusMore}`:null);let openStatus=$state(null);const statusOpen=$derived(statu
|
|
|
147
147
|
</div>
|
|
148
148
|
</SvPopover>
|
|
149
149
|
{#if !readOnly && schema && !compact}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
<
|
|
153
|
-
|
|
150
|
+
|
|
151
|
+
<div class="sv-btabs-split" class:has-more={!!onImport}>
|
|
152
|
+
<button type="button" class="sv-btabs-tool sv-btabs-add" onclick={onAdd}>
|
|
153
|
+
<svg viewBox="0 0 24 24" width="14" height="14" aria-hidden="true"><path d="M12 5v14M5 12h14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" /></svg>
|
|
154
|
+
<span>{bm('shell.addTable')}</span>
|
|
155
|
+
</button>
|
|
156
|
+
{#if onImport}
|
|
157
|
+
<SvPopover bind:open={addOpen} arrow={false} placement="bottom-end" ariaLabel={bm('shell.addTableWays')}>
|
|
158
|
+
{#snippet anchor()}
|
|
159
|
+
<button type="button" class="sv-btabs-tool sv-btabs-addmore" aria-label={bm('shell.addTableWays')} title={bm('shell.addTableWays')} aria-haspopup="menu" aria-expanded={addOpen}>
|
|
160
|
+
<svg viewBox="0 0 24 24" width="12" height="12" aria-hidden="true"><path d="M6 9l6 6 6-6" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" /></svg>
|
|
161
|
+
</button>
|
|
162
|
+
{/snippet}
|
|
163
|
+
<div class="sv-btabs-menu" role="menu" tabindex="-1" aria-label={bm('shell.addTableWays')} use:menuFocus={{ close: () => (addOpen = false) }}>
|
|
164
|
+
<button type="button" role="menuitem" class="sv-btabs-item" onclick={() => { addOpen = false; onAdd() }}>
|
|
165
|
+
<span class="sv-btabs-check" aria-hidden="true">+</span>{bm('shell.blankTable')}
|
|
166
|
+
</button>
|
|
167
|
+
<button type="button" role="menuitem" class="sv-btabs-item" title={bm('shell.importAsTableTitle')} onclick={() => { addOpen = false; onImport('new') }}>
|
|
168
|
+
<span class="sv-btabs-check" aria-hidden="true">↑</span>{bm('shell.importAsTable')}
|
|
169
|
+
</button>
|
|
170
|
+
</div>
|
|
171
|
+
</SvPopover>
|
|
172
|
+
{/if}
|
|
173
|
+
</div>
|
|
154
174
|
{/if}
|
|
155
175
|
</div>
|
|
156
176
|
{#if compact}
|
|
@@ -213,5 +233,5 @@ ${statusMore}`:null);let openStatus=$state(null);const statusOpen=$derived(statu
|
|
|
213
233
|
{/if}
|
|
214
234
|
|
|
215
235
|
<style>
|
|
216
|
-
.sv-btabs{--sv-btabs-h: 33px;flex:none;display:flex;align-items:flex-end;gap:2px;box-sizing:border-box;height:calc(var(--sv-btabs-h) + 7px);padding:0 6px 0 0;font-family:var(--sg-font, inherit);font-size:13px;line-height:1;background:var(--sg-muted-bg, var(--sg-header-bg, #f5f5f4));box-shadow:inset 0 -1px 0 var(--sg-border, #e7e5e4)}.sv-btabs-list{display:flex;align-items:flex-end;min-width:0;height:100%;padding:0 0 0 8px;overflow-x:auto;scrollbar-width:none}.sv-btabs-list::-webkit-scrollbar{display:none}.sv-btabs-tab{position:relative;flex:none;display:flex;align-items:center;gap:2px;box-sizing:border-box;height:var(--sv-btabs-h);padding:0 6px 1px 4px;border:1px solid transparent;border-bottom:0;border-radius:var(--sg-radius, 6px) var(--sg-radius, 6px) 0 0;color:var(--sg-muted, #78716c);transition:color .12s ease,background-color .12s ease}.sv-btabs-tab:not(.is-active)+.sv-btabs-tab:not(.is-active):before{content:"";position:absolute;left:-2px;top:10px;bottom:10px;width:1px;background:var(--sg-border, #e7e5e4)}.sv-btabs-tab:hover:before,.sv-btabs-tab:hover+.sv-btabs-tab:before{opacity:0}.sv-btabs-tab:not(.is-active):hover{color:var(--sg-fg, #1c1917);background:color-mix(in srgb,var(--sg-bg, #fff) 55%,transparent)}.sv-btabs-tab.is-active{z-index:1;height:calc(var(--sv-btabs-h) + 1px);margin-bottom:-1px;padding-bottom:2px;color:var(--sg-fg, #1c1917);background:var(--sg-bg, #fff);border-color:var(--sg-border, #e7e5e4);box-shadow:inset 0 2px 0 var(--sg-accent, #2563eb)}.sv-btabs-name{max-width:220px;height:26px;padding:0 8px;border:0;border-radius:var(--sg-radius, 6px);background:none;color:inherit;font:inherit;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.is-active .sv-btabs-name{font-weight:600;padding-right:2px}.sv-btabs-more{display:grid;place-items:center;width:22px;height:22px;padding:0;border:0;border-radius:var(--sg-radius, 6px);background:none;color:var(--sg-muted, #78716c);cursor:pointer}.sv-btabs-more:hover{background:color-mix(in srgb,var(--sg-fg, #1c1917) 10%,transparent);color:var(--sg-fg, #1c1917)}.sv-btabs-input{width:160px;height:24px;margin:0 2px;padding:0 6px;box-sizing:border-box;font:inherit;font-weight:600;color:var(--sg-fg, #1c1917);background:var(--sg-input-bg, var(--sg-bg, #fff));border:1px solid var(--sg-accent, #2563eb);border-radius:var(--sg-radius, 6px);outline:none}.sv-btabs-tools{flex:none;display:flex;align-items:center;gap:2px;height:var(--sv-btabs-h);margin-left:0}.sv-btabs-end .sv-btabs-tools{display:contents}.sv-btabs-end{flex:none;display:flex;align-items:center;gap:2px;height:var(--sv-btabs-h);margin-left:auto}.sv-btabs-status~.sv-btabs-end{margin-left:0}.sv-btabs-tool:disabled{opacity:.4;cursor:default;background:none}.sv-btabs-tool[aria-busy=true]{cursor:progress}.sv-btabs-trash{gap:4px;padding:0 6px}.sv-btabs-end>:global(.sv-pop__anchor){margin-right:4px}.sv-btabs-badge{display:inline-flex;align-items:center;gap:5px;height:22px;margin:0 2px;padding:0 8px;border-radius:999px;white-space:nowrap;font-size:12px;color:var(--sg-muted, #78716c);background:color-mix(in srgb,var(--sg-fg, #1c1917) 7%,transparent)}.sv-btabs-count{font-size:12px;font-variant-numeric:tabular-nums}.sv-btabs-status{display:inline-grid;grid-auto-flow:column;grid-template-columns:minmax(0,auto);align-items:center;flex:0 1 auto;align-self:center;margin-left:auto;padding:0 12px;white-space:nowrap;font-size:12px;color:var(--sg-muted, #78716c)}.sv-btabs-status-text{overflow:hidden;text-overflow:ellipsis}button.sv-btabs-status-text{display:block;min-width:0;padding:0;border:0;background:none;color:inherit;font:inherit;line-height:inherit;white-space:inherit;text-align:start;cursor:pointer}button.sv-btabs-status-text:focus-visible{outline:2px solid var(--sg-focus-ring, var(--sg-accent, #2563eb));outline-offset:2px}.sv-btabs-status-more{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}.sv-btabs.has-open-status{height:auto;min-height:calc(var(--sv-btabs-h) + 7px)}.sv-btabs-status.is-open{white-space:normal;padding-block:6px;line-height:1.35}.sv-btabs-status.is-open .sv-btabs-status-text{overflow:visible}.sv-btabs-status.is-open .sv-btabs-status-more{position:static;display:block;width:auto;height:auto;margin-top:2px;clip:auto;white-space:normal;overflow-wrap:anywhere}.sv-btabs-status.is-error{color:var(--sg-danger, #dc2626)}.sv-btabs-status-x{margin-inline-start:6px;padding:0 4px;border:0;background:none;color:inherit;font:inherit;cursor:pointer}.sv-btabs-status-stop{margin-inline-start:8px;padding:0 6px;border:1px solid var(--sg-border, #e2e8f0);border-radius:var(--sg-radius, 6px);background:none;color:inherit;font:inherit;cursor:pointer}.sv-btabs-tool{display:inline-flex;align-items:center;gap:6px;height:26px;padding:0 8px;border:0;border-radius:var(--sg-radius, 6px);background:none;color:var(--sg-muted, #78716c);font:inherit;cursor:pointer;white-space:nowrap;transition:color .12s ease,background-color .12s ease}.sv-btabs-icon{width:26px;padding:0;justify-content:center}.sv-btabs-tool:hover{color:var(--sg-fg, #1c1917);background:color-mix(in srgb,var(--sg-bg, #fff) 55%,transparent)}@media(forced-colors:active){.sv-btabs-tab.is-active{border:1px solid Highlight;border-bottom-color:Canvas;box-shadow:none}.sv-btabs-tab.is-active .sv-btabs-name{color:Highlight;forced-color-adjust:none;text-decoration:underline}}@media print{.sv-btabs{display:none}}.sv-btabs-name:focus-visible,.sv-btabs-more:focus-visible,.sv-btabs-tool:focus-visible{outline:2px solid var(--sg-focus-ring, var(--sg-accent, #2563eb));outline-offset:-2px}@media(prefers-reduced-motion:reduce){.sv-btabs-tab,.sv-btabs-tool{transition:none}}.sv-btabs.is-compact{align-items:center;padding-right:0}.sv-btabs.is-compact .sv-btabs-list{flex:none;max-width:42%}.sv-btabs.is-compact .sv-btabs-tab:not(.is-active){display:none}.sv-btabs.is-compact .sv-btabs-list{padding-left:4px;align-items:center}.sv-btabs.is-compact .sv-btabs-tab.is-active{height:30px;margin:0;padding:0;border:0;border-radius:var(--sg-radius, 6px);background:none;box-shadow:none}.sv-btabs.is-compact .sv-btabs-tab.is-active .sv-btabs-name{height:30px;padding:0 2px 0 8px;font-size:14px}.sv-btabs.is-compact .sv-btabs-tools{margin-left:-2px}.sv-btabs.is-compact .sv-btabs-tools .sv-btabs-icon{height:30px;color:var(--sg-fg, #1c1917)}.sv-btabs.is-compact .sv-btabs-tab.is-active:hover,.sv-btabs.is-compact .sv-btabs-tools .sv-btabs-icon:hover{background:color-mix(in srgb,var(--sg-fg, #1c1917) 6%,transparent)}.sv-btabs.is-compact .sv-btabs-end{display:none}.sv-btabs.is-compact .sv-btabs-status:not(.has-stop){display:none}.sv-btabs-slot{flex:1 1 auto;min-width:0;align-self:stretch;display:flex;align-items:center}.sv-btabs-slot>:global(.sv-fvb){flex:1 1 auto;min-width:0;min-height:0;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;padding:0 4px;border-bottom:0;background:transparent;scroll-padding-inline:6px}.sv-btabs-slot>:global(.sv-fvb::-webkit-scrollbar){display:none}.sv-btabs-slot>:global(.sv-fvb>*){flex:none}.sv-btabs-slot>:global(.sv-fvb>.sv-fvb-spacer){flex:1 0 0}@container (max-width: 600px){.sv-btabs-add span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}.sv-btabs-add{flex:none;width:26px;padding:0;justify-content:center}.sv-btabs-badge span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}.sv-btabs-badge{padding:0 6px}.sv-btabs-status:not(.has-stop){display:none}.sv-btabs-name{max-width:130px}}.sv-btabs-menu{display:flex;flex-direction:column;min-width:190px;max-height:320px;overflow-y:auto;padding:4px;font-size:13px}.sv-btabs-sep{flex:none;height:1px;margin:4px 6px;background:var(--sg-border, #e2e8f0)}.sv-btabs-item{flex:none;display:flex;align-items:center;gap:6px;height:32px;padding:0 10px;text-align:start;border:0;border-radius:6px;background:none;color:var(--sg-fg, #0f172a);font:inherit;cursor:pointer}.sv-btabs-item:hover:not(:disabled),.sv-btabs-item:focus-visible{background:color-mix(in srgb,var(--sg-fg, #0f172a) 6%,transparent);outline:none}@media(forced-colors:active){.sv-btabs-item:focus-visible{outline:2px solid Highlight;outline-offset:-2px}}.sv-btabs-item[aria-disabled=true]{color:var(--sg-muted, #64748b);cursor:default}.sv-btabs-item.is-why{height:auto;min-height:32px;padding-block:6px;align-items:flex-start;color:var(--sg-muted, #64748b);cursor:default}.sv-btabs-why{display:block;max-width:260px;font-size:12px;line-height:1.4;white-space:normal}.sv-btabs-item.is-danger:not(:disabled){color:var(--sg-danger, #dc2626)}.sv-btabs-item.is-current{font-weight:600}.sv-btabs-check{width:14px;flex:none;color:var(--sg-muted, #64748b)}.sv-btabs-warn{margin:0 0 8px;font-size:14px;color:var(--sg-fg, #0f172a)}.sv-btabs-links{margin:0 0 4px;padding-left:18px;font-size:13px;color:var(--sg-muted, #64748b)}.sv-btabs-foot{display:flex;justify-content:flex-end;gap:8px;width:100%}.sv-btabs-btn{height:32px;padding:0 14px;font:inherit;font-size:13px;cursor:pointer;border-radius:var(--sg-radius, 6px);background:transparent;color:var(--sg-fg, #0f172a);border:1px solid var(--sg-border, #e2e8f0)}.sv-btabs-btn.is-danger{background:var(--sg-danger, #dc2626);border-color:var(--sg-danger, #dc2626);color:#fff}
|
|
236
|
+
.sv-btabs{--sv-btabs-h: 33px;flex:none;display:flex;align-items:flex-end;gap:2px;box-sizing:border-box;height:calc(var(--sv-btabs-h) + 7px);padding:0 6px 0 0;font-family:var(--sg-font, inherit);font-size:13px;line-height:1;background:var(--sg-muted-bg, var(--sg-header-bg, #f5f5f4));box-shadow:inset 0 -1px 0 var(--sg-border, #e7e5e4)}.sv-btabs-list{display:flex;align-items:flex-end;min-width:0;height:100%;padding:0 0 0 8px;overflow-x:auto;scrollbar-width:none}.sv-btabs-list::-webkit-scrollbar{display:none}.sv-btabs-tab{position:relative;flex:none;display:flex;align-items:center;gap:2px;box-sizing:border-box;height:var(--sv-btabs-h);padding:0 6px 1px 4px;border:1px solid transparent;border-bottom:0;border-radius:var(--sg-radius, 6px) var(--sg-radius, 6px) 0 0;color:var(--sg-muted, #78716c);transition:color .12s ease,background-color .12s ease}.sv-btabs-tab:not(.is-active)+.sv-btabs-tab:not(.is-active):before{content:"";position:absolute;left:-2px;top:10px;bottom:10px;width:1px;background:var(--sg-border, #e7e5e4)}.sv-btabs-tab:hover:before,.sv-btabs-tab:hover+.sv-btabs-tab:before{opacity:0}.sv-btabs-tab:not(.is-active):hover{color:var(--sg-fg, #1c1917);background:color-mix(in srgb,var(--sg-bg, #fff) 55%,transparent)}.sv-btabs-tab.is-active{z-index:1;height:calc(var(--sv-btabs-h) + 1px);margin-bottom:-1px;padding-bottom:2px;color:var(--sg-fg, #1c1917);background:var(--sg-bg, #fff);border-color:var(--sg-border, #e7e5e4);box-shadow:inset 0 2px 0 var(--sg-accent, #2563eb)}.sv-btabs-name{max-width:220px;height:26px;padding:0 8px;border:0;border-radius:var(--sg-radius, 6px);background:none;color:inherit;font:inherit;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.is-active .sv-btabs-name{font-weight:600;padding-right:2px}.sv-btabs-more{display:grid;place-items:center;width:22px;height:22px;padding:0;border:0;border-radius:var(--sg-radius, 6px);background:none;color:var(--sg-muted, #78716c);cursor:pointer}.sv-btabs-more:hover{background:color-mix(in srgb,var(--sg-fg, #1c1917) 10%,transparent);color:var(--sg-fg, #1c1917)}.sv-btabs-input{width:160px;height:24px;margin:0 2px;padding:0 6px;box-sizing:border-box;font:inherit;font-weight:600;color:var(--sg-fg, #1c1917);background:var(--sg-input-bg, var(--sg-bg, #fff));border:1px solid var(--sg-accent, #2563eb);border-radius:var(--sg-radius, 6px);outline:none}.sv-btabs-tools{flex:none;display:flex;align-items:center;gap:2px;height:var(--sv-btabs-h);margin-left:0}.sv-btabs-end .sv-btabs-tools{display:contents}.sv-btabs-end{flex:none;display:flex;align-items:center;gap:2px;height:var(--sv-btabs-h);margin-left:auto}.sv-btabs-status~.sv-btabs-end{margin-left:0}.sv-btabs-tool:disabled{opacity:.4;cursor:default;background:none}.sv-btabs-tool[aria-busy=true]{cursor:progress}.sv-btabs-trash{gap:4px;padding:0 6px}.sv-btabs-end>:global(.sv-pop__anchor){margin-right:4px}.sv-btabs-badge{display:inline-flex;align-items:center;gap:5px;height:22px;margin:0 2px;padding:0 8px;border-radius:999px;white-space:nowrap;font-size:12px;color:var(--sg-muted, #78716c);background:color-mix(in srgb,var(--sg-fg, #1c1917) 7%,transparent)}.sv-btabs-count{font-size:12px;font-variant-numeric:tabular-nums}.sv-btabs-status{display:inline-grid;grid-auto-flow:column;grid-template-columns:minmax(0,auto);align-items:center;flex:0 1 auto;align-self:center;margin-left:auto;padding:0 12px;white-space:nowrap;font-size:12px;color:var(--sg-muted, #78716c)}.sv-btabs-status-text{overflow:hidden;text-overflow:ellipsis}button.sv-btabs-status-text{display:block;min-width:0;padding:0;border:0;background:none;color:inherit;font:inherit;line-height:inherit;white-space:inherit;text-align:start;cursor:pointer}button.sv-btabs-status-text:focus-visible{outline:2px solid var(--sg-focus-ring, var(--sg-accent, #2563eb));outline-offset:2px}.sv-btabs-status-more{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}.sv-btabs.has-open-status{height:auto;min-height:calc(var(--sv-btabs-h) + 7px)}.sv-btabs-status.is-open{white-space:normal;padding-block:6px;line-height:1.35}.sv-btabs-status.is-open .sv-btabs-status-text{overflow:visible}.sv-btabs-status.is-open .sv-btabs-status-more{position:static;display:block;width:auto;height:auto;margin-top:2px;clip:auto;white-space:normal;overflow-wrap:anywhere}.sv-btabs-status.is-error{color:var(--sg-danger, #dc2626)}.sv-btabs-status-x{margin-inline-start:6px;padding:0 4px;border:0;background:none;color:inherit;font:inherit;cursor:pointer}.sv-btabs-status-stop{margin-inline-start:8px;padding:0 6px;border:1px solid var(--sg-border, #e2e8f0);border-radius:var(--sg-radius, 6px);background:none;color:inherit;font:inherit;cursor:pointer}.sv-btabs-tool{display:inline-flex;align-items:center;gap:6px;height:26px;padding:0 8px;border:0;border-radius:var(--sg-radius, 6px);background:none;color:var(--sg-muted, #78716c);font:inherit;cursor:pointer;white-space:nowrap;transition:color .12s ease,background-color .12s ease}.sv-btabs-icon{width:26px;padding:0;justify-content:center}.sv-btabs-split{display:inline-flex;align-items:center;flex:none;border-radius:var(--sg-radius, 6px)}.sv-btabs-split.has-more .sv-btabs-add{border-start-end-radius:0;border-end-end-radius:0;padding-inline-end:6px}.sv-btabs-addmore{width:24px;padding:0;justify-content:center;border-start-start-radius:0;border-end-start-radius:0}.sv-btabs-split:hover .sv-btabs-addmore,.sv-btabs-addmore[aria-expanded=true]{box-shadow:inset 1px 0 0 var(--sg-border, #e2e8f0)}.sv-btabs-addmore[aria-expanded=true],.sv-btabs-tool:hover{color:var(--sg-fg, #1c1917);background:color-mix(in srgb,var(--sg-bg, #fff) 55%,transparent)}@media(forced-colors:active){.sv-btabs-tab.is-active{border:1px solid Highlight;border-bottom-color:Canvas;box-shadow:none}.sv-btabs-tab.is-active .sv-btabs-name{color:Highlight;forced-color-adjust:none;text-decoration:underline}}@media print{.sv-btabs{display:none}}.sv-btabs-name:focus-visible,.sv-btabs-more:focus-visible,.sv-btabs-tool:focus-visible{outline:2px solid var(--sg-focus-ring, var(--sg-accent, #2563eb));outline-offset:-2px}@media(prefers-reduced-motion:reduce){.sv-btabs-tab,.sv-btabs-tool{transition:none}}.sv-btabs.is-compact{align-items:center;padding-right:0}.sv-btabs.is-compact .sv-btabs-list{flex:none;max-width:42%}.sv-btabs.is-compact .sv-btabs-tab:not(.is-active){display:none}.sv-btabs.is-compact .sv-btabs-list{padding-left:4px;align-items:center}.sv-btabs.is-compact .sv-btabs-tab.is-active{height:30px;margin:0;padding:0;border:0;border-radius:var(--sg-radius, 6px);background:none;box-shadow:none}.sv-btabs.is-compact .sv-btabs-tab.is-active .sv-btabs-name{height:30px;padding:0 2px 0 8px;font-size:14px}.sv-btabs.is-compact .sv-btabs-tools{margin-left:-2px}.sv-btabs.is-compact .sv-btabs-tools .sv-btabs-icon{height:30px;color:var(--sg-fg, #1c1917)}.sv-btabs.is-compact .sv-btabs-tab.is-active:hover,.sv-btabs.is-compact .sv-btabs-tools .sv-btabs-icon:hover{background:color-mix(in srgb,var(--sg-fg, #1c1917) 6%,transparent)}.sv-btabs.is-compact .sv-btabs-end{display:none}.sv-btabs.is-compact .sv-btabs-status:not(.has-stop){display:none}.sv-btabs-slot{flex:1 1 auto;min-width:0;align-self:stretch;display:flex;align-items:center}.sv-btabs-slot>:global(.sv-fvb){flex:1 1 auto;min-width:0;min-height:0;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;padding:0 4px;border-bottom:0;background:transparent;scroll-padding-inline:6px}.sv-btabs-slot>:global(.sv-fvb::-webkit-scrollbar){display:none}.sv-btabs-slot>:global(.sv-fvb>*){flex:none}.sv-btabs-slot>:global(.sv-fvb>.sv-fvb-spacer){flex:1 0 0}@container (max-width: 600px){.sv-btabs-add span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}.sv-btabs-add{flex:none;width:26px;padding:0;justify-content:center}.sv-btabs-badge span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}.sv-btabs-badge{padding:0 6px}.sv-btabs-status:not(.has-stop){display:none}.sv-btabs-name{max-width:130px}}.sv-btabs-menu{display:flex;flex-direction:column;min-width:190px;max-height:320px;overflow-y:auto;padding:4px;font-size:13px}.sv-btabs-sep{flex:none;height:1px;margin:4px 6px;background:var(--sg-border, #e2e8f0)}.sv-btabs-item{flex:none;display:flex;align-items:center;gap:6px;height:32px;padding:0 10px;text-align:start;border:0;border-radius:6px;background:none;color:var(--sg-fg, #0f172a);font:inherit;cursor:pointer}.sv-btabs-item:hover:not(:disabled),.sv-btabs-item:focus-visible{background:color-mix(in srgb,var(--sg-fg, #0f172a) 6%,transparent);outline:none}@media(forced-colors:active){.sv-btabs-item:focus-visible{outline:2px solid Highlight;outline-offset:-2px}}.sv-btabs-item[aria-disabled=true]{color:var(--sg-muted, #64748b);cursor:default}.sv-btabs-item.is-why{height:auto;min-height:32px;padding-block:6px;align-items:flex-start;color:var(--sg-muted, #64748b);cursor:default}.sv-btabs-why{display:block;max-width:260px;font-size:12px;line-height:1.4;white-space:normal}.sv-btabs-item.is-danger:not(:disabled){color:var(--sg-danger, #dc2626)}.sv-btabs-item.is-current{font-weight:600}.sv-btabs-check{width:14px;flex:none;color:var(--sg-muted, #64748b)}.sv-btabs-warn{margin:0 0 8px;font-size:14px;color:var(--sg-fg, #0f172a)}.sv-btabs-links{margin:0 0 4px;padding-left:18px;font-size:13px;color:var(--sg-muted, #64748b)}.sv-btabs-foot{display:flex;justify-content:flex-end;gap:8px;width:100%}.sv-btabs-btn{height:32px;padding:0 14px;font:inherit;font-size:13px;cursor:pointer;border-radius:var(--sg-radius, 6px);background:transparent;color:var(--sg-fg, #0f172a);border:1px solid var(--sg-border, #e2e8f0)}.sv-btabs-btn.is-danger{background:var(--sg-danger, #dc2626);border-color:var(--sg-danger, #dc2626);color:#fff}
|
|
217
237
|
</style>
|
|
@@ -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}from"./registry.svelte";import{protectionText}from"./field-access.svelte";import{isReadOnlyGrid}from"./base-share";import{canCommentIn,canDeleteIn}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,commentsOf,deleteComment,editComment,historyOf,historyState,loadHistory,markSeen,ownsComment,timeAgo,unseenOf}from"./activity.svelte";import{uploadAttachment}from"./attachments";import{findFieldUser}from"./sources.svelte";import{encodeMentions,mentionText,parseMentions}from"./mentions";import MentionInput from"./MentionInput.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))):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())})});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")};
|
|
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}from"./registry.svelte";import{protectionText}from"./field-access.svelte";import{isReadOnlyGrid}from"./base-share";import{canCommentIn,canDeleteIn}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,commentsOf,deleteComment,editComment,historyOf,historyState,loadHistory,markSeen,ownsComment,timeAgo,unseenOf}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))):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")};
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
5
|
{#snippet field(c: Col, canEdit: boolean)}
|
|
@@ -12,6 +12,11 @@ import{recordActionsFor}from"./record-actions";import{commentSnippets}from"./com
|
|
|
12
12
|
{@const locked = protectionOf(c)}
|
|
13
13
|
<span class="sv-frv-ro" title={locked ?? undefined}>{locked ? bm('record.protected') : columns.includes(c) ? bm('record.readOnly') : bm('record.hiddenInGrid')}</span>
|
|
14
14
|
{/if}
|
|
15
|
+
{#if canEdit && speakable(c)}
|
|
16
|
+
<button type="button" class="sv-frv-mic" class:is-on={listening === c.id} disabled={!!listening} aria-label={listening === c.id ? bm('record.listening') : bm('record.dictateField', { field: label(c) })} title={bm('record.dictateField', { field: label(c) })} onclick={() => void speakInto(c)}>
|
|
17
|
+
<svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><path d="M8 1.5a2 2 0 0 0-2 2v4a2 2 0 0 0 4 0v-4a2 2 0 0 0-2-2zM3.5 7a4.5 4.5 0 0 0 9 0M8 11.5v3" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" /></svg>
|
|
18
|
+
</button>
|
|
19
|
+
{/if}
|
|
15
20
|
</div>
|
|
16
21
|
<FieldInput
|
|
17
22
|
{ctrl}
|
|
@@ -198,6 +203,12 @@ import{recordActionsFor}from"./record-actions";import{commentSnippets}from"./com
|
|
|
198
203
|
</div>
|
|
199
204
|
{/if}
|
|
200
205
|
<div class="sv-frv-send">
|
|
206
|
+
{#if dictationSupported()}
|
|
207
|
+
<button type="button" class="sv-frv-link sv-frv-mic-comment" class:is-on={listening === ':comment'} disabled={!!listening} onclick={() => void speakComment()}>
|
|
208
|
+
<svg viewBox="0 0 16 16" width="14" height="14" aria-hidden="true"><path d="M8 1.5a2 2 0 0 0-2 2v4a2 2 0 0 0 4 0v-4a2 2 0 0 0-2-2zM3.5 7a4.5 4.5 0 0 0 9 0M8 11.5v3" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" /></svg>
|
|
209
|
+
{listening === ':comment' ? bm('record.listening') : bm('record.dictateComment')}
|
|
210
|
+
</button>
|
|
211
|
+
{/if}
|
|
201
212
|
{#if snippets}
|
|
202
213
|
<button type="button" class="sv-frv-link sv-frv-replies-open" aria-expanded={repliesOpen} onclick={() => void openReplies()}>
|
|
203
214
|
<svg viewBox="0 0 16 16" width="13" height="13" aria-hidden="true"><path d="M2.5 3.5h11v7h-6l-3 2.5v-2.5h-2z M5 6h6 M5 8h4" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" /></svg>
|
|
@@ -260,5 +271,5 @@ import{recordActionsFor}from"./record-actions";import{commentSnippets}from"./com
|
|
|
260
271
|
</SvModal>
|
|
261
272
|
|
|
262
273
|
<style>
|
|
263
|
-
.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-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-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}
|
|
274
|
+
.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-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}
|
|
264
275
|
</style>
|