File tree Expand file tree Collapse file tree
src/lib/components/contents/details/widgets/list Expand file tree Collapse file tree Original file line number Diff line number Diff line change 479479 < FieldEditor
480480 keyPath= {hasSingleSubField ? itemKeyPath : ` ${ itemKeyPath} .${ subField .name } ` }
481481 typedKeyPath= {hasVariableTypes
482- ? hasSingleSubField
483- ? ` ${ keyPath} .*<${ item[typeKey]} >`
484- : ` ${ keyPath} .*<${ item[typeKey]} >.${ subField .name } `
482+ ? ` ${ keyPath} .*<${ item[typeKey]} >.${ subField .name } `
485483 : ` ${ keyPath} .*.${ subField .name } ` }
486484 {locale}
487485 fieldConfig= {subField}
Original file line number Diff line number Diff line change 1212 import FieldPreview from ' $lib/components/contents/details/preview/field-preview.svelte' ;
1313 import Subsection from ' $lib/components/contents/details/widgets/object/subsection.svelte' ;
1414 import { entryDraft } from ' $lib/services/contents/draft' ;
15+ import { getListFieldInfo } from ' $lib/services/contents/widgets/list/helper' ;
1516
1617 /**
1718 * @import { WidgetPreviewProps } from '$lib/types/private';
4142 types,
4243 typeKey = ' type' ,
4344 } = $derived (fieldConfig);
45+ const { hasSingleSubField , hasVariableTypes } = $derived (getListFieldInfo (fieldConfig));
4446 const keyPathRegex = $derived (new RegExp (` ^${ escapeRegExp (keyPath)} \\ .\\ d+` ));
4547 const items = $derived (
4648 unflatten (
6971 : (fields ?? (field ? [field] : []))}
7072 < Subsection {label}>
7173 {#each subFields as subField (subField .name )}
72- {@const subFieldKeyPath = field ? itemKeyPath : ` ${ itemKeyPath} .${ subField .name } ` }
7374 < VisibilityObserver>
7475 < FieldPreview
75- keyPath= {subFieldKeyPath}
76- typedKeyPath= {subFieldName
77- ? field
78- ? ` ${ keyPath} .*<${ subFieldName} >`
79- : ` ${ keyPath} .*<${ subFieldName} >.${ subField .name } `
80- : subFieldKeyPath}
76+ keyPath= {hasSingleSubField ? itemKeyPath : ` ${ itemKeyPath} .${ subField .name } ` }
77+ typedKeyPath= {hasVariableTypes
78+ ? ` ${ keyPath} .*<${ subFieldName} >.${ subField .name } `
79+ : ` ${ keyPath} .*.${ subField .name } ` }
8180 {locale}
8281 fieldConfig= {subField}
8382 / >
You can’t perform that action at this time.
0 commit comments