@@ -258,10 +258,9 @@ export class Preview {
258258 const entryId = element . getAttribute ( 'data-hygraph-entry-id' ) ;
259259 const fieldApiId = element . getAttribute ( 'data-hygraph-field-api-id' ) ;
260260 const format = element . getAttribute ( 'data-hygraph-rich-text-format' ) as RichTextFormatType ;
261- const locale = element . getAttribute ( 'data-hygraph-field-locale' ) || '' ;
262261
263262 if ( entryId && fieldApiId && format && [ 'html' , 'markdown' , 'text' ] . includes ( format ) ) {
264- const fieldKey = `${ entryId } :${ fieldApiId } : ${ locale } ` ;
263+ const fieldKey = `${ entryId } :${ fieldApiId } ` ;
265264
266265 // Check for duplicate field usage (UNSUPPORTED)
267266 if ( formatPreferences [ fieldKey ] ) {
@@ -373,29 +372,26 @@ export class Preview {
373372 entryId : message . entryId ,
374373 fieldApiId : message . fieldApiId ,
375374 componentChain : message . componentChain ,
376- locale : message . locale ,
377375 } ) ;
378376
379377 // Emit event for listeners
380378 this . emitEvent ( 'preview:field-focus' , {
381379 entryId : message . entryId ,
382380 fieldApiId : message . fieldApiId ,
383- locale : message . locale ,
384381 } ) ;
385382
386383 // Use custom handler if provided
387384 if ( this . config . onFieldFocus ) {
388385 console . log ( '[Preview] Using custom onFieldFocus handler' ) ;
389- this . config . onFieldFocus ( message . fieldApiId , message . locale ) ;
386+ this . config . onFieldFocus ( message . fieldApiId ) ;
390387 return ;
391388 }
392389
393390 // Default behavior: Find and focus the specific field element for this entry
394391 console . log ( '[Preview] Searching for field in registry...' ) ;
395392 let elements = this . fieldRegistry . getElementsForEntryField (
396393 message . entryId ,
397- message . fieldApiId ,
398- undefined // locale not supported yet
394+ message . fieldApiId
399395 ) ;
400396
401397 console . log ( '[Preview] Initial registry search result:' , {
@@ -462,7 +458,6 @@ export class Preview {
462458 entryId : message . entryId ,
463459 fieldApiId : message . fieldApiId ,
464460 componentChain : message . componentChain ,
465- locale : message . locale ,
466461 } ) ;
467462
468463 // Debug: Log all registered elements
@@ -529,7 +524,6 @@ export class Preview {
529524 private handleIframeEditClick ( element : HTMLElement ) : void {
530525 const entryId = element . getAttribute ( 'data-hygraph-entry-id' ) ;
531526 const fieldApiId = element . getAttribute ( 'data-hygraph-field-api-id' ) || undefined ;
532- const locale = element . getAttribute ( 'data-hygraph-field-locale' ) || undefined ;
533527 const componentChain = this . parseComponentChain (
534528 element . getAttribute ( 'data-hygraph-component-chain' ) || undefined
535529 ) ;
@@ -542,7 +536,6 @@ export class Preview {
542536 type : 'field-click' ,
543537 entryId,
544538 fieldApiId,
545- locale,
546539 componentChain,
547540 timestamp : Date . now ( ) ,
548541 } ;
@@ -562,16 +555,14 @@ export class Preview {
562555 this . emitEvent ( 'preview:field-click' , {
563556 entryId,
564557 fieldApiId,
565- locale,
566- componentChain,
558+ componentChain,
567559 mode : this . mode
568560 } ) ;
569561 }
570562
571563 private handleStandaloneEditClick ( element : HTMLElement ) : void {
572564 const entryId = element . getAttribute ( 'data-hygraph-entry-id' ) ;
573565 const fieldApiId = element . getAttribute ( 'data-hygraph-field-api-id' ) || undefined ;
574- const locale = element . getAttribute ( 'data-hygraph-field-locale' ) || undefined ;
575566 const componentChain = this . parseComponentChain (
576567 element . getAttribute ( 'data-hygraph-component-chain' ) || undefined
577568 ) ;
@@ -584,7 +575,7 @@ export class Preview {
584575 }
585576
586577 // Construct Studio resource route URL
587- const studioUrl = this . buildStudioUrl ( entryId , fieldApiId , locale , componentChain ) ;
578+ const studioUrl = this . buildStudioUrl ( entryId , fieldApiId , componentChain ) ;
588579
589580 // Open in new tab
590581 window . open ( studioUrl , '_blank' , 'noopener,noreferrer' ) ;
@@ -597,21 +588,19 @@ export class Preview {
597588 this . emitEvent ( 'preview:field-click' , {
598589 entryId,
599590 fieldApiId,
600- locale,
601591 componentChain,
602592 mode : this . mode
603593 } ) ;
604594 }
605595
606- private buildStudioUrl ( entryId : string , fieldApiId ?: string , locale ?: string , componentChain ?: ComponentChainLink [ ] ) : string {
596+ private buildStudioUrl ( entryId : string , fieldApiId ?: string , componentChain ?: ComponentChainLink [ ] ) : string {
607597 const baseUrl = ( this . config . studioUrl || 'https://app.hygraph.com' ) . replace ( / \/ + $ / , '' ) ;
608598 const params = new URLSearchParams ( {
609599 endpoint : this . config . endpoint ,
610600 entryId,
611601 } ) ;
612602
613603 if ( fieldApiId ) params . set ( 'fieldApiId' , fieldApiId ) ;
614- if ( locale ) params . set ( 'locale' , locale ) ;
615604 if ( componentChain && componentChain . length > 0 ) {
616605 params . set ( 'componentChain' , JSON . stringify ( componentChain ) ) ;
617606 }
0 commit comments