Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export { LMLayer } from '../lmlayer.js';
export { DefaultWorker as Worker } from './worker.js'; // TODO: eliminate rename
export { Worker } from './worker.js';
export { SourcemappedWorker } from './sourcemappedWorker.js';

export interface WorkerFactory {
Expand Down
4 changes: 2 additions & 2 deletions web/src/engine/predictive-text/worker-main/src/web/worker.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { unwrap } from '../unwrap.js';
import { LMLayerWorkerCode, LMLayerWorkerSourcemapComment } from "@keymanapp/lm-worker/worker-main.wrapped.min.js";

export class DefaultWorker {
export class Worker {
static constructInstance(): Worker {
return new Worker(this.asBlobURI(LMLayerWorkerCode));
return new globalThis.Worker(this.asBlobURI(LMLayerWorkerCode));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a little problematic. Worker is a generic and semi-reserved name that we should not be stepping on. This should be LMWorker or PredictiveTextWorker, throughout.

(DefaultWorker is also kinda weird)

}

/**
Expand Down
2 changes: 1 addition & 1 deletion web/src/engine/src/osk/buttonClassNames.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Maps 'sp' properties on a touch-layout spec to their corresponding CSS class names.
*/
export const BUTTON_CLASSES = [
export const buttonClassNames = [
'default',
'shift',
'shift-on',
Expand Down
9 changes: 4 additions & 5 deletions web/src/engine/src/osk/keyboard-layout/oskKey.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { ActiveKey, ActiveSubKey, ButtonClass, ButtonClasses, DeviceSpec } from 'keyman/engine/keyboard';

// At present, we don't use @keymanapp/keyman. Just `keyman`. (Refer to <root>/web/package.json.)
import { specialCharacters as specialChars } from '../specialCharacters.js'; // TODO: eliminate 'as specialChars'
import { BUTTON_CLASSES as buttonClassNames } from '../buttonClassNames.js'; // TODO: eliminate 'as buttonClasNames'

import { specialCharacters } from '../specialCharacters.js';
import { buttonClassNames } from '../buttonClassNames.js';
import { KeyElement } from '../keyElement.js';
import { VisualKeyboard } from '../visualKeyboard.js';
import { getTextMetrics } from './getTextMetrics.js';
Expand Down Expand Up @@ -42,7 +41,7 @@ export function renameSpecialKey(oldText: string, vkbd: VisualKeyboard): string
// do nothing.
}

const specialCode = specialChars[oldText as keyof typeof specialChars];
const specialCode = specialCharacters[oldText as keyof typeof specialCharacters];
const specialCodePUA = 0XE000 + specialCode;

return specialCode ?
Expand All @@ -52,7 +51,7 @@ export function renameSpecialKey(oldText: string, vkbd: VisualKeyboard): string

export abstract class OSKKey {
// Only set here to act as an alias for code built against legacy versions.
static readonly specialCharacters = specialChars;
static readonly specialCharacters = specialCharacters;

static readonly BUTTON_CLASSES = buttonClassNames;

Expand Down