-
-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8458 from keymanapp/change/web/engine-configuration
change(web): facilitates differentiated configuration objects for KMW variants 🧩
- Loading branch information
Showing
26 changed files
with
308 additions
and
258 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { EngineConfiguration, InitOptionSpec, InitOptionDefaults } from "keyman/engine/main"; | ||
|
||
export class BrowserConfiguration extends EngineConfiguration { | ||
private _ui: string; | ||
private _attachType: string; | ||
|
||
initialize(options: Required<BrowserInitOptionSpec>) { | ||
this.initialize(options); | ||
|
||
this._ui = options.ui; | ||
this._attachType = options.attachType; | ||
} | ||
|
||
get attachType() { | ||
return this._attachType; | ||
} | ||
|
||
debugReport(): Record<string, any> { | ||
const baseReport = super.debugReport(); | ||
baseReport.attachType = this.attachType; | ||
baseReport.ui = this._ui; | ||
baseReport.keymanEngine = 'app/browser'; | ||
|
||
return baseReport; | ||
} | ||
} | ||
|
||
export interface BrowserInitOptionSpec extends InitOptionSpec { | ||
ui?: string; | ||
attachType?: 'auto' | 'manual' | ''; // If blank or undefined, attachType will be assigned to "auto" or "manual" | ||
} | ||
|
||
export const BrowserInitOptionDefaults: Required<BrowserInitOptionSpec> = { | ||
ui: '', | ||
attachType: '', | ||
...InitOptionDefaults | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { EngineConfiguration, InitOptionSpec, InitOptionDefaults } from "keyman/engine/main"; | ||
|
||
export class WebviewConfiguration extends EngineConfiguration { | ||
private _embeddingApp: string; | ||
|
||
initialize(options: Required<WebviewInitOptionSpec>) { | ||
this.initialize(options); | ||
|
||
this._embeddingApp = options.embeddingApp; | ||
} | ||
|
||
get embeddingApp() { | ||
return this._embeddingApp; | ||
} | ||
|
||
debugReport(): Record<string, any> { | ||
const baseReport = super.debugReport(); | ||
baseReport.embeddingApp = this.embeddingApp; | ||
baseReport.keymanEngine = 'app/webview'; | ||
|
||
return baseReport; | ||
} | ||
} | ||
|
||
export interface WebviewInitOptionSpec extends InitOptionSpec { | ||
/** | ||
* May be used to denote the name of the embedding application | ||
*/ | ||
embeddingApp?: string; | ||
} | ||
|
||
export const WebviewInitOptionDefaults: Required<WebviewInitOptionSpec> = { | ||
embeddingApp: '', | ||
...InitOptionDefaults | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.