1+ import { TrustedResourceUrlPipe } from "./trusted-resource-url-pipe" ;
12import { Component , ViewChild , ElementRef , Input } from "@angular/core" ;
23import { CommonModule } from "@angular/common" ;
34
@@ -18,7 +19,8 @@ export type EmbedUpdateDocumentProps = {
1819 allowConfigureTimezone ?: boolean ;
1920 allowConfigureRedirectUrl ?: boolean ;
2021 allowConfigureCommunication ?: boolean ;
21- } ; // Additional props to be passed to the iframe, used for testing out features
22+ } ;
23+ onlyEditFields ?: boolean | undefined ; // Additional props to be passed to the iframe, used for testing out features
2224 // prior to being added to the main props
2325
2426 additionalProps ?: Record < string , string | number | boolean > | undefined ;
@@ -33,7 +35,7 @@ import { CssVars } from "./css-vars";
3335@Component ( {
3436 selector : "embed-update-document, EmbedUpdateDocument" ,
3537 template : `
36- <iframe #__iframe [class]="className" [attr.src]="src"></iframe>
38+ <iframe #__iframe [class]="className" [attr.src]="src | trustedResourceUrl "></iframe>
3739 ` ,
3840 styles : [
3941 `
@@ -43,7 +45,7 @@ import { CssVars } from "./css-vars";
4345 ` ,
4446 ] ,
4547 standalone : true ,
46- imports : [ CommonModule ] ,
48+ imports : [ CommonModule , TrustedResourceUrlPipe ] ,
4749} )
4850export default class EmbedUpdateDocument {
4951 @Input ( ) host ! : EmbedUpdateDocumentProps [ "host" ] ;
@@ -53,6 +55,7 @@ export default class EmbedUpdateDocument {
5355 @Input ( ) css ! : EmbedUpdateDocumentProps [ "css" ] ;
5456 @Input ( ) cssVars ! : EmbedUpdateDocumentProps [ "cssVars" ] ;
5557 @Input ( ) darkModeDisabled ! : EmbedUpdateDocumentProps [ "darkModeDisabled" ] ;
58+ @Input ( ) onlyEditFields ! : EmbedUpdateDocumentProps [ "onlyEditFields" ] ;
5659 @Input ( ) additionalProps ! : EmbedUpdateDocumentProps [ "additionalProps" ] ;
5760 @Input ( ) documentId ! : EmbedUpdateDocumentProps [ "documentId" ] ;
5861 @Input ( ) onDocumentUpdated ! : EmbedUpdateDocumentProps [ "onDocumentUpdated" ] ;
@@ -71,6 +74,7 @@ export default class EmbedUpdateDocument {
7174 css : this . css ,
7275 cssVars : this . cssVars ,
7376 darkModeDisabled : this . darkModeDisabled ,
77+ onlyEditFields : this . onlyEditFields ,
7478 ...this . additionalProps ,
7579 } )
7680 )
0 commit comments