Skip to content

Commit e503cf2

Browse files
fix: add testing secret to webcomponent api again to avoid breaking change
1 parent def4aee commit e503cf2

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

packages/editor-web-component/src/editor-web-component.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ export class EditorWebComponent extends HTMLElement {
3636
private _initialState: InitialState = exampleInitialState
3737
private _currentState: unknown
3838

39+
// Deprecated and ignored
40+
private _testingSecret: string | null = null
41+
3942
private _editorVariant: EditorVariant = 'unknown'
4043

4144
private _plugins = defaultPlugins
@@ -93,6 +96,8 @@ export class EditorWebComponent extends HTMLElement {
9396
} else if (name === 'disable-media-upload') {
9497
this.disableMediaUpload =
9598
newValue === 'true' ? true : newValue === 'false' ? false : null
99+
} else if (name === 'testing-secret') {
100+
this.testingSecret = newValue
96101
} else if (name === 'language') {
97102
// Validates the language attribute. Will need to keep this in sync with
98103
// the SupportedLanguage type, if we add more language support!
@@ -101,6 +106,21 @@ export class EditorWebComponent extends HTMLElement {
101106
}
102107
}
103108

109+
get testingSecret(): string | null {
110+
return this._testingSecret
111+
}
112+
113+
// Deprecated and ignored
114+
set testingSecret(value) {
115+
this._testingSecret = value
116+
if (value === null) {
117+
this.removeAttribute('testing-secret')
118+
} else {
119+
this.setAttribute('testing-secret', String(value))
120+
}
121+
this.mountReactComponent()
122+
}
123+
104124
get initialState() {
105125
return this._initialState
106126
}

0 commit comments

Comments
 (0)