mirror of
https://github.com/keymanapp/keyman.git
synced 2026-09-29 11:07:41 +00:00
feat(web): remove 'export default' to eliminate more aliases
Fixes: #15292 Test-bot: skip
This commit is contained in:
parent
d0c7810348
commit
f9f804c190
101 changed files with 264 additions and 258 deletions
|
|
@ -8,7 +8,7 @@ import {
|
|||
|
||||
import { ContextManager } from './contextManager.js';
|
||||
|
||||
export default class DefaultBrowserRules extends DefaultRules {
|
||||
export class DefaultBrowserRules extends DefaultRules {
|
||||
private contextManager: ContextManager;
|
||||
|
||||
constructor(contextManager: ContextManager) {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import KeyboardObject = KeymanWebKeyboard.KeyboardObject;
|
|||
import * as views from './viewsAnchorpoint.js';
|
||||
import { BrowserConfiguration, BrowserInitOptionDefaults, BrowserInitOptionSpec } from './configuration.js';
|
||||
import { ContextManager } from './contextManager.js';
|
||||
import DefaultBrowserRules from './defaultBrowserRules.js';
|
||||
import { DefaultBrowserRules } from './defaultBrowserRules.js';
|
||||
import { HardwareEventKeyboard } from './hardwareEventKeyboard.js';
|
||||
import { FocusStateAPIObject } from './context/focusAssistant.js';
|
||||
import { PageIntegrationHandlers } from './context/pageIntegrationHandlers.js';
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { toPrefixedKeyboardId, toUnprefixedKeyboardId } from 'keyman/engine/keyb
|
|||
|
||||
import { WebviewConfiguration, WebviewInitOptionDefaults, WebviewInitOptionSpec } from './configuration.js';
|
||||
import { ContextManager, HostTextStore } from './contextManager.js';
|
||||
import PassthroughKeyboard from './passthroughKeyboard.js';
|
||||
import { PassthroughKeyboard } from './passthroughKeyboard.js';
|
||||
import { buildEmbeddedGestureConfig, setupEmbeddedListeners } from './oskConfiguration.js';
|
||||
import { WorkerFactory } from '@keymanapp/lexical-model-layer';
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { DeviceSpec, Keyboard, KeyEvent, ManagedPromise } from 'keyman/engine/ke
|
|||
|
||||
import { HardKeyboardBase, processForMnemonicsAndLegacy } from 'keyman/engine/main';
|
||||
|
||||
export default class PassthroughKeyboard extends HardKeyboardBase {
|
||||
export class PassthroughKeyboard extends HardKeyboardBase {
|
||||
readonly baseDevice: DeviceSpec;
|
||||
public activeKeyboard: Keyboard;
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
* Description Makes an actual copy (not a reference) of an object, copying simple members,
|
||||
* arrays and member objects but not functions, so use with care!
|
||||
*/
|
||||
export default function deepCopy<T extends ({[key: string | number | symbol]: any} | Array<any>)>(p:T): T {
|
||||
export function deepCopy<T extends ({[key: string | number | symbol]: any} | Array<any>)>(p:T): T {
|
||||
// typeof undefined == 'undefined', ![] == false, !{} == false
|
||||
if(typeof p != 'object' || !p) {
|
||||
return p;
|
||||
|
|
|
|||
|
|
@ -80,5 +80,3 @@ export namespace DeviceSpec {
|
|||
export function physicalKeyDeviceAlias(device: DeviceSpec) {
|
||||
return new DeviceSpec(device.browser, DeviceSpec.FormFactor.Desktop, device.OS, false);
|
||||
}
|
||||
|
||||
export default DeviceSpec;
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
* - In WebWorkers, returns `self`.
|
||||
* - In Node, returns `global`.
|
||||
*/
|
||||
export default function getGlobalObject(): typeof globalThis {
|
||||
export function globalObject(): typeof globalThis {
|
||||
// Evergreen browsers have started defining 'globalThis'.
|
||||
// Refer to https://devblogs.microsoft.com/typescript/announcing-typescript-3-4/#type-checking-for-globalthis
|
||||
// and its referenced polyfill. Said polyfill is very complex, so we opt for this far leaner variant.
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
// References all utility includes from a single file, making import/export simple.
|
||||
|
||||
export { default as deepCopy } from "./deepCopy.js";
|
||||
export { deepCopy } from "./deepCopy.js";
|
||||
|
||||
export { default as DeviceSpec, physicalKeyDeviceAlias } from "./deviceSpec.js";
|
||||
export { DeviceSpec, physicalKeyDeviceAlias } from "./deviceSpec.js";
|
||||
|
||||
/*
|
||||
// An example valid use, post-import:
|
||||
|
|
@ -12,16 +12,16 @@ export { default as DeviceSpec, physicalKeyDeviceAlias } from "./deviceSpec.js";
|
|||
true);
|
||||
*/
|
||||
|
||||
export { default as Version } from "./version.js";
|
||||
export { Version } from "./version.js";
|
||||
|
||||
export { default as globalObject } from "./globalObject.js";
|
||||
export { globalObject } from "./globalObject.js";
|
||||
|
||||
export * as KMWString from './kmwstring.js';
|
||||
|
||||
export { default as ManagedPromise } from "./managedPromise.js";
|
||||
export { default as TimeoutPromise, timedPromise } from "./timeoutPromise.js";
|
||||
export { ManagedPromise } from "./managedPromise.js";
|
||||
export { TimeoutPromise, timedPromise } from "./timeoutPromise.js";
|
||||
|
||||
export { default as PriorityQueue, QueueComparator } from "./priority-queue.js"
|
||||
export { PriorityQueue, QueueComparator } from "./priority-queue.js"
|
||||
|
||||
export { isEmptyTransform } from './isEmptyTransform.js';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
type ResolveSignature<Type> = (value: Type | PromiseLike<Type>) => void;
|
||||
type RejectSignature = (reason?: any) => void;
|
||||
|
||||
export default class ManagedPromise<Type = void> {
|
||||
export class ManagedPromise<Type = void> {
|
||||
/**
|
||||
* Calling this function will fulfill the Promise represented by this class.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
*/
|
||||
export type QueueComparator<Type> = (a: Type, b: Type) => number;
|
||||
|
||||
export default class PriorityQueue<Type> {
|
||||
export class PriorityQueue<Type> {
|
||||
|
||||
private comparator: QueueComparator<Type>;
|
||||
private heap: Type[];
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import ManagedPromise from "./managedPromise.js";
|
||||
import { ManagedPromise } from "./managedPromise.js";
|
||||
|
||||
/**
|
||||
* This class represents a cancelable timeout, wrapped in Promise form.
|
||||
|
|
@ -7,7 +7,7 @@ import ManagedPromise from "./managedPromise.js";
|
|||
* `reject` is called earlier. Call `.resolve(false)` for early cancellation
|
||||
* or `.resolve(true)` to cancel the timer while resolving the Promise early.
|
||||
*/
|
||||
export default class TimeoutPromise extends ManagedPromise<Boolean> {
|
||||
export class TimeoutPromise extends ManagedPromise<Boolean> {
|
||||
private timerHandle: number | NodeJS.Timeout;
|
||||
constructor(timeoutInMillis: number) {
|
||||
// Helps marshal the internal timer handle to its member field despite being
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import KEYMAN_VERSION from "@keymanapp/keyman-version";
|
||||
|
||||
// Dotted-decimal version
|
||||
export default class Version {
|
||||
export class Version {
|
||||
public static readonly CURRENT = new Version(KEYMAN_VERSION.VERSION_RELEASE);
|
||||
|
||||
// Represents a default version value for keyboards compiled before this was compiled into keyboards.
|
||||
|
|
|
|||
|
|
@ -2,6 +2,6 @@ export {
|
|||
SENTINEL_CODE_UNIT, applyTransform, buildMergedTransform, isHighSurrogate, isLowSurrogate, isSentinel,
|
||||
transformToSuggestion, defaultApplyCasing
|
||||
} from "./common.js";
|
||||
export { default as QuoteBehavior } from "./quote-behavior.js";
|
||||
export { QuoteBehavior } from "./quote-behavior.js";
|
||||
export { getLastPreCaretToken, Token, Tokenization, tokenize, wordbreak } from "./tokenization.js";
|
||||
export { default as TrieModel, TrieModelOptions } from "./trie-model.js";
|
||||
export { TrieModel, TrieModelOptions } from "./trie-model.js";
|
||||
|
|
@ -36,5 +36,3 @@ export namespace QuoteBehavior {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default QuoteBehavior;
|
||||
|
|
|
|||
|
|
@ -269,7 +269,7 @@ export class Traversal implements LexiconTraversal {
|
|||
* prefix searches within words, however they are not very good
|
||||
* at predicting the next word.
|
||||
*/
|
||||
export default class TrieModel implements LexicalModel {
|
||||
export class TrieModel implements LexicalModel {
|
||||
configuration?: Configuration;
|
||||
private _trie: Trie;
|
||||
readonly breakWords: WordBreakingFunction;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { LexicalModelTypes } from '@keymanapp/common-types';
|
|||
*
|
||||
* @param phrase
|
||||
*/
|
||||
export default function ascii(phrase: string): LexicalModelTypes.Span[] {
|
||||
export function ascii(phrase: string): LexicalModelTypes.Span[] {
|
||||
let matchWord = /[A-Za-z0-9']+/g;
|
||||
let words: LexicalModelTypes.Span[] = [];
|
||||
let match: RegExpExecArray | null;
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ export interface DefaultWordBreakerOptions {
|
|||
* @see http://unicode.org/reports/tr29/#Word_Boundaries
|
||||
* @see https://github.com/eddieantonio/unicode-default-word-boundary/tree/v12.0.0
|
||||
*/
|
||||
export default function default_(text: string, options?: DefaultWordBreakerOptions): LexicalModelTypes.Span[] {
|
||||
export function default_(text: string, options?: DefaultWordBreakerOptions): LexicalModelTypes.Span[] {
|
||||
let boundaries = findBoundaries(text, options);
|
||||
if (boundaries.length == 0) {
|
||||
return [];
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import placeholder from "./placeholder.js";
|
||||
import ascii from "./ascii.js";
|
||||
import default_ from "./default/index.js";
|
||||
import { placeholder } from "./placeholder.js";
|
||||
import { ascii } from "./ascii.js";
|
||||
import { default_ } from "./default/index.js";
|
||||
|
||||
export { placeholder, ascii, default_ as default, default_ as defaultWordbreaker };
|
||||
export { type BreakerContext } from "./default/index.js";
|
||||
|
|
@ -7,7 +7,7 @@ import { LexicalModelTypes } from '@keymanapp/common-types';
|
|||
* @param phrase The phrase in which to break words.
|
||||
* @deprecated Use a word breaker tailored to your language instead!
|
||||
*/
|
||||
export default function placeholder(phrase: string): LexicalModelTypes.Span[] {
|
||||
export function placeholder(phrase: string): LexicalModelTypes.Span[] {
|
||||
let nextStart = 0;
|
||||
return phrase.split(/\s+/).map(utterance => {
|
||||
// XXX: The indices are NOT accurate to the original phrase!
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ import Distribution = LexicalModelTypes.Distribution;
|
|||
import Reversion = LexicalModelTypes.Reversion;
|
||||
import Suggestion = LexicalModelTypes.Suggestion;
|
||||
import Transform = LexicalModelTypes.Transform;
|
||||
import PromiseStore from "./promise-store.js";
|
||||
import { PromiseStore } from "./promise-store.js";
|
||||
import { OutgoingMessage } from '@keymanapp/lm-message-types';
|
||||
|
||||
/// <reference types="worker-interface.d.ts" />
|
||||
|
|
@ -53,7 +53,7 @@ import { OutgoingMessage } from '@keymanapp/lm-message-types';
|
|||
* The top-level LMLayer will automatically starts up its own Web Worker.
|
||||
*/
|
||||
|
||||
export default class LMLayer {
|
||||
export class LMLayer {
|
||||
/**
|
||||
* The underlying worker instance. By default, this is the LMLayerWorker.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
export { default as LMLayer } from '../lmlayer.js';
|
||||
export { default as Worker } from './worker.js';
|
||||
export { default as SourcemappedWorker } from './sourcemappedWorker.js';
|
||||
export { LMLayer } from '../lmlayer.js';
|
||||
export { Worker } from './worker.js';
|
||||
export { SourcemappedWorker } from './sourcemappedWorker.js';
|
||||
|
||||
export interface WorkerFactory {
|
||||
constructInstance(): Worker
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ self.importScripts = importScripts;
|
|||
* cross-platform Worker support in the future, it may be wise to swap to use of
|
||||
* that package.
|
||||
*/
|
||||
export default class MappedWorker extends worker.Worker implements Worker {
|
||||
export class MappedWorker extends worker.Worker implements Worker {
|
||||
constructor(scriptStr: string) {
|
||||
const concatenatedScript = `
|
||||
${nodeWorkerToWebWorkerMappingSource}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import MappedWorker from "./mappedWorker.js";
|
||||
import unwrap from '../unwrap.js';
|
||||
import { MappedWorker } from "./mappedWorker.js";
|
||||
import { unwrap } from '../unwrap.js';
|
||||
|
||||
import { LMLayerWorkerCode, LMLayerWorkerSourcemapComment } from "@keymanapp/lm-worker/worker-main.wrapped.js";
|
||||
|
||||
export default class SourcemappedWorker {
|
||||
export class SourcemappedWorker {
|
||||
static constructInstance(): Worker {
|
||||
let scriptStr = unwrap(LMLayerWorkerCode);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import MappedWorker from "./mappedWorker.js";
|
||||
import unwrap from '../unwrap.js';
|
||||
import { MappedWorker } from "./mappedWorker.js";
|
||||
import { unwrap } from '../unwrap.js';
|
||||
|
||||
import { LMLayerWorkerCode, LMLayerWorkerSourcemapComment } from "@keymanapp/lm-worker/worker-main.wrapped.min.js";
|
||||
|
||||
export default class Worker {
|
||||
export class Worker {
|
||||
static constructInstance(): Worker {
|
||||
let scriptStr = unwrap(LMLayerWorkerCode);
|
||||
const srcMapUrlIndex = scriptStr.indexOf("//# sourceMappingURL")
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ interface PromiseCallbacks<T> {
|
|||
*
|
||||
* <T> is the type of resolved value (value yielded successfully by promise).
|
||||
*/
|
||||
export default class PromiseStore<T> {
|
||||
export class PromiseStore<T> {
|
||||
// IE11 offers partial support for new Map().
|
||||
// Assume only .get(), .set(), .has(), .delete(), and .size work.
|
||||
// See: http://kangax.github.io/compat-table/es6/#test-Map
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*
|
||||
* @param fn The function whose body will be returned.
|
||||
*/
|
||||
export default function unwrap(encodedSrc: string): string {
|
||||
export function unwrap(encodedSrc: string): string {
|
||||
// There used to be more to this, but now it's a pretty simple passthrough!
|
||||
return encodedSrc;
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
export { default as LMLayer } from '../lmlayer.js';
|
||||
export { default as Worker } from './worker.js';
|
||||
export { default as SourcemappedWorker } from './sourcemappedWorker.js';
|
||||
export { LMLayer } from '../lmlayer.js';
|
||||
export { DefaultWorker as Worker } from './worker.js';
|
||||
export { SourcemappedWorker } from './sourcemappedWorker.js';
|
||||
|
||||
export interface WorkerFactory {
|
||||
constructInstance(): Worker
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import unwrap from '../unwrap.js';
|
||||
import { unwrap } from '../unwrap.js';
|
||||
import { LMLayerWorkerCode, LMLayerWorkerSourcemapComment } from "@keymanapp/lm-worker/worker-main.wrapped.js";
|
||||
|
||||
export default class SourcemappedWorker {
|
||||
export class SourcemappedWorker {
|
||||
// the only difference to DefaultWorker is that this class uses
|
||||
// the unminified LM* blobs
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import unwrap from '../unwrap.js';
|
||||
import { unwrap } from '../unwrap.js';
|
||||
import { LMLayerWorkerCode, LMLayerWorkerSourcemapComment } from "@keymanapp/lm-worker/worker-main.wrapped.min.js";
|
||||
|
||||
export default class DefaultWorker {
|
||||
export class DefaultWorker {
|
||||
static constructInstance(): Worker {
|
||||
return new Worker(this.asBlobURI(LMLayerWorkerCode));
|
||||
}
|
||||
|
|
@ -28,7 +28,7 @@ export default class DefaultWorker {
|
|||
// if(false) {
|
||||
code += '\n' + LMLayerWorkerSourcemapComment;
|
||||
// }
|
||||
let blob = new Blob([code], { type: 'text/javascript' });
|
||||
const blob = new Blob([code], { type: 'text/javascript' });
|
||||
return URL.createObjectURL(blob);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import { assert } from 'chai';
|
||||
import sinon from 'sinon';
|
||||
|
||||
import PromiseStore from '#./promise-store.js';
|
||||
import { PromiseStore } from '#./promise-store.js';
|
||||
import { randomToken } from '@keymanapp/common-test-resources/model-helpers.mjs';
|
||||
|
||||
describe('PromiseStore', function () {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { KMWString } from 'keyman/common/web-utils';
|
|||
|
||||
import { ClassicalDistanceCalculation, EditOperation } from './classical-calculation.js';
|
||||
import { SearchSpace } from './distance-modeler.js';
|
||||
import TransformUtils from '../transformUtils.js';
|
||||
import { TransformUtils } from '../transformUtils.js';
|
||||
import { determineModelTokenizer } from '../model-helpers.js';
|
||||
import { tokenizeTransform, tokenizeTransformDistribution } from './transform-tokenization.js';
|
||||
import { LexicalModelTypes } from '@keymanapp/common-types';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,14 @@
|
|||
export * from './classical-calculation.js';
|
||||
export * from './context-tracker.js';
|
||||
export * from './distance-modeler.js';
|
||||
export * from './execution-timer.js';
|
||||
export * from './transform-tokenization.js';
|
||||
export { type EditOperation, ClassicalDistanceCalculation } from './classical-calculation.js';
|
||||
export {
|
||||
getEditPathLastMatch, TrackedContextSuggestion,
|
||||
TrackedContextToken, TrackedContextState, ContextTracker
|
||||
} from './context-tracker.js';
|
||||
export {
|
||||
type TraversableToken, QUEUE_NODE_COMPARATOR, PartialSearchEdge,
|
||||
SearchNode, SearchResult, SearchSpace
|
||||
} from './distance-modeler.js';
|
||||
export {
|
||||
STANDARD_TIME_BETWEEN_DEFERS, ExecutionBucket,
|
||||
ExecutionSpan, ExecutionTimer
|
||||
} from './execution-timer.js';
|
||||
export { tokenizeTransform, tokenizeTransformDistribution } from './transform-tokenization.js';
|
||||
|
|
@ -36,7 +36,7 @@ import * as correction from './correction/index.js';
|
|||
import * as wordBreakers from '@keymanapp/models-wordbreakers';
|
||||
import { KMWString } from "keyman/common/web-utils";
|
||||
|
||||
import ModelCompositor from './model-compositor.js';
|
||||
import { ModelCompositor } from './model-compositor.js';
|
||||
import { ImportScripts, IncomingMessage, LMLayerWorkerState, LoadMessage, ModelEval, ModelFile, ModelSourceSpec, PostMessage } from './worker-interfaces.js';
|
||||
import { LexicalModelTypes } from '@keymanapp/common-types';
|
||||
import Capabilities = LexicalModelTypes.Capabilities;
|
||||
|
|
@ -66,7 +66,7 @@ import { OutgoingMessageKind } from '@keymanapp/lm-message-types';
|
|||
* The model and the configuration are ONLY relevant in the `ready` state;
|
||||
* as such, they are NOT direct properties of the LMLayerWorker.
|
||||
*/
|
||||
export default class LMLayerWorker {
|
||||
export class LMLayerWorker {
|
||||
/**
|
||||
* State pattern. This object handles onMessage().
|
||||
* handleMessage() can transition to a different state, if
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { KMWString } from 'keyman/common/web-utils';
|
|||
import { LexicalModelTypes } from '@keymanapp/common-types';
|
||||
|
||||
import * as correction from './correction/index.js'
|
||||
import TransformUtils from './transformUtils.js';
|
||||
import { TransformUtils } from './transformUtils.js';
|
||||
import { applySuggestionCasing, correctAndEnumerate, dedupeSuggestions, finalizeSuggestions, predictionAutoSelect, processSimilarity, toAnnotatedSuggestion, tupleDisplayOrderSort } from './predict-helpers.js';
|
||||
import { detectCurrentCasing, determineModelTokenizer, determineModelWordbreaker, determinePunctuationFromModel } from './model-helpers.js';
|
||||
|
||||
|
|
@ -355,5 +355,3 @@ export class ModelCompositor {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default ModelCompositor;
|
||||
|
|
@ -119,5 +119,3 @@ export class DummyModel implements LexicalModel {
|
|||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default DummyModel;
|
||||
|
|
@ -1,2 +1,2 @@
|
|||
export * from '@keymanapp/models-templates';
|
||||
export { default as DummyModel, DummyOptions } from './dummy-model.js';
|
||||
export { DummyModel, DummyOptions } from './dummy-model.js';
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@ import * as models from '@keymanapp/models-templates';
|
|||
import { KMWString } from 'keyman/common/web-utils';
|
||||
import { LexicalModelTypes } from '@keymanapp/common-types';
|
||||
|
||||
import TransformUtils from './transformUtils.js';
|
||||
import { TransformUtils } from './transformUtils.js';
|
||||
import { determineModelTokenizer, determineModelWordbreaker, determinePunctuationFromModel } from './model-helpers.js';
|
||||
import { ContextTracker, TrackedContextState } from './correction/context-tracker.js';
|
||||
import { ExecutionTimer } from './correction/execution-timer.js';
|
||||
import ModelCompositor from './model-compositor.js';
|
||||
import { ModelCompositor } from './model-compositor.js';
|
||||
import CasingForm = LexicalModelTypes.CasingForm;
|
||||
import Context = LexicalModelTypes.Context;
|
||||
import Distribution = LexicalModelTypes.Distribution;
|
||||
|
|
|
|||
|
|
@ -1,11 +1,20 @@
|
|||
export { ClassicalDistanceCalculation } from './correction/classical-calculation.js';
|
||||
export { ContextTracker } from './correction/context-tracker.js';
|
||||
export * as correction from './correction/index.js';
|
||||
export * from './model-helpers.js';
|
||||
export {
|
||||
determinePunctuationFromModel, determineModelWordbreaker,
|
||||
determineModelTokenizer, detectCurrentCasing
|
||||
} from './model-helpers.js';
|
||||
export * as models from './models/index.js';
|
||||
export { ModelCompositor } from './model-compositor.js';
|
||||
export { tokenizeTransform, tokenizeTransformDistribution } from './correction/transform-tokenization.js';
|
||||
export * from './predict-helpers.js';
|
||||
export { default as TransformUtils } from './transformUtils.js'
|
||||
export { default as LMLayerWorker } from './index.js'
|
||||
export * from './transform-subsets.js';
|
||||
export {
|
||||
AUTOSELECT_PROPORTION_THRESHOLD, CORRECTION_SEARCH_THRESHOLDS,
|
||||
CorrectionPredictionTuple, SuggestionSimilarity, tupleDisplayOrderSort,
|
||||
correctAndEnumerate, shouldStopSearchingEarly, predictFromCorrections,
|
||||
applySuggestionCasing, toAnnotatedSuggestion, predictionAutoSelect,
|
||||
dedupeSuggestions, finalizeSuggestions, processSimilarity
|
||||
} from './predict-helpers.js';
|
||||
export { TransformUtils } from './transformUtils.js'
|
||||
export { LMLayerWorker } from './index.js'
|
||||
export { TransformSubset, subsetByInterval, subsetByChar, mergeSubset } from './transform-subsets.js';
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import { LexicalModelTypes } from '@keymanapp/common-types';
|
||||
|
||||
export default class TransformUtils {
|
||||
export class TransformUtils {
|
||||
static isWhitespace(transform: LexicalModelTypes.Transform): boolean {
|
||||
// Matches a string that is entirely one or more characters with Unicode general property Z* or the following: CR, LF, and Tab.
|
||||
const whitespaceRemover = /^[\u0009\u000A\u000D\u0020\u00a0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u202f\u205f\u3000]+$/i;
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ import LexicalModel = LexicalModelTypes.LexicalModel;
|
|||
import Reversion = LexicalModelTypes.Reversion;
|
||||
import Suggestion = LexicalModelTypes.Suggestion;
|
||||
import Transform = LexicalModelTypes.Transform;
|
||||
import type ModelCompositor from './model-compositor.js';
|
||||
import { type ModelCompositor } from './model-compositor.js';
|
||||
import { Token } from '@keymanapp/models-templates';
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
import LMLayerWorker from './index.js';
|
||||
import { LMLayerWorker } from './index.js';
|
||||
|
||||
// Let LMLayerWorker be available both in the browser and in Node.
|
||||
if (typeof self !== 'undefined' && 'postMessage' in self && 'importScripts' in self) {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ type DecodedCookieFieldValue = string | number | boolean;
|
|||
type FilteredRecordEncoder = (value: DecodedCookieFieldValue, key: string) => string;
|
||||
type FilteredRecordDecoder = (value: string, key: string) => DecodedCookieFieldValue;
|
||||
|
||||
export default class CookieSerializer<Type extends Record<keyof Type, DecodedCookieFieldValue>> {
|
||||
export class CookieSerializer<Type extends Record<keyof Type, DecodedCookieFieldValue>> {
|
||||
readonly name: string;
|
||||
|
||||
constructor(name: string) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// Found a bit of magic formatting that allows dynamic return typing for a specified element tag!
|
||||
export default function createUnselectableElement<E extends "p"|"style"|"script"|"div"|"canvas"|"span">(nodeName:E) {
|
||||
export function createUnselectableElement<E extends "p"|"style"|"script"|"div"|"canvas"|"span">(nodeName:E) {
|
||||
const e = document.createElement<E>(nodeName);
|
||||
|
||||
e.style.userSelect="none";
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
export { arrayFromNodeList } from './arrayFromNodeList.js';
|
||||
export { default as createUnselectableElement } from './createUnselectableElement.js';
|
||||
export { createUnselectableElement } from './createUnselectableElement.js';
|
||||
export { createStyleSheet, StylesheetManager } from './stylesheets.js';
|
||||
export { default as landscapeView } from './landscapeView.js';
|
||||
export { default as CookieSerializer } from './cookieSerializer.js';
|
||||
export { landscapeView } from './landscapeView.js';
|
||||
export { CookieSerializer } from './cookieSerializer.js';
|
||||
export { getAbsoluteX, getAbsoluteY } from './getAbsolute.js';
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* @return {boolean}
|
||||
*/
|
||||
export default function landscapeView(): boolean { // new for I3363 (Build 301)
|
||||
export function landscapeView(): boolean { // new for I3363 (Build 301)
|
||||
let orientation: number;
|
||||
|
||||
// Assume portrait mode if orientation undefined
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
export { default as PathConfiguration } from './pathConfiguration.js';
|
||||
export { PathConfiguration } from './pathConfiguration.js';
|
||||
export { PathOptionDefaults, PathOptionSpec } from './optionSpec.interface.js';
|
||||
export { ModelSpec } from './modelSpec.js';
|
||||
export { default as PredictionContext } from './prediction/predictionContext.js';
|
||||
export { PredictionContext } from './prediction/predictionContext.js';
|
||||
export { LanguageProcessorEventMap, StateChangeEnum, ReadySuggestions } from './prediction/languageProcessor.interface.js';
|
||||
export { OSKResourcePathConfiguration } from './oskResourcePathConfiguration.interface.js';
|
||||
|
|
@ -10,7 +10,7 @@ const addDelimiter = (p: string) => {
|
|||
}
|
||||
}
|
||||
|
||||
export default class PathConfiguration implements OSKResourcePathConfiguration {
|
||||
export class PathConfiguration implements OSKResourcePathConfiguration {
|
||||
private readonly sourcePath: string;
|
||||
private _root: string;
|
||||
private _resources: string;
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ interface PredictionContextEventMap {
|
|||
/**
|
||||
* Maintains predictive-text state information corresponding to the current context.
|
||||
*/
|
||||
export default class PredictionContext extends EventEmitter<PredictionContextEventMap> {
|
||||
export class PredictionContext extends EventEmitter<PredictionContextEventMap> {
|
||||
// Historical note: before 17.0, this code was intertwined with /web/source/osk/banner.ts's
|
||||
// SuggestionBanner class. This class serves as the main implementation of the banner's core logic.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
// TODO-web-core: remove 'export default' to eliminate more aliases (#15292)
|
||||
export {
|
||||
ErrorStub,
|
||||
type KeyboardAPISpec,
|
||||
|
|
|
|||
|
|
@ -14,13 +14,13 @@ export {
|
|||
KeyboardAPIPropertyMultilangSpec,
|
||||
KeyboardAPIPropertySpec,
|
||||
KeyboardInternalPropertySpec,
|
||||
default as KeyboardProperties,
|
||||
KeyboardProperties,
|
||||
KeyboardFont,
|
||||
MetadataObj as RawKeyboardMetadata,
|
||||
LanguageAPIPropertySpec
|
||||
} from "./keyboards/keyboardProperties.js";
|
||||
export { ProcessorAction as ProcessorAction } from "./keyboards/processorAction.js";
|
||||
export { default as SpacebarText } from "./keyboards/spacebarText.js";
|
||||
export { SpacebarText } from "./keyboards/spacebarText.js";
|
||||
export { StateKeyMap } from "./keyboards/stateKeyMap.js";
|
||||
export { type Alternate, TextTransform } from "./keyboards/textTransform.js";
|
||||
export { Transcription } from "./keyboards/transcription.js";
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { KM_Core, KM_CORE_STATUS } from 'keyman/engine/core-adapter';
|
|||
import { JSKeyboard } from "./jsKeyboard.js";
|
||||
import { KMXKeyboard } from './kmxKeyboard.js';
|
||||
import { KeyboardHarness } from "./keyboardHarness.js";
|
||||
import KeyboardProperties from "./keyboardProperties.js";
|
||||
import { KeyboardProperties } from "./keyboardProperties.js";
|
||||
import { KeyboardLoadErrorBuilder, StubBasedErrorBuilder, UriBasedErrorBuilder } from './keyboardLoadError.js';
|
||||
import { Codes } from '../codes.js';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import SpacebarText from './spacebarText.js';
|
||||
import { SpacebarText } from './spacebarText.js';
|
||||
|
||||
export interface InternalKeyboardFont {
|
||||
family: string;
|
||||
|
|
@ -109,7 +109,7 @@ export type KeyboardAPIPropertyMultilangSpec = {
|
|||
|
||||
export type MetadataObj = KeyboardInternalPropertySpec | KeyboardAPIPropertySpec | KeyboardAPIPropertyMultilangSpec;
|
||||
|
||||
export default class KeyboardProperties implements KeyboardInternalPropertySpec {
|
||||
export class KeyboardProperties implements KeyboardInternalPropertySpec {
|
||||
KI: string;
|
||||
KN: string;
|
||||
KL: string;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
// Compiles completely out if `const enum`, making it unavailable in JS-based unit tests.
|
||||
enum SpacebarText {
|
||||
export enum SpacebarText {
|
||||
KEYBOARD = 'keyboard',
|
||||
LANGUAGE = 'language',
|
||||
LANGUAGE_KEYBOARD = 'languageKeyboard',
|
||||
BLANK = 'blank'
|
||||
};
|
||||
|
||||
export default SpacebarText;
|
||||
|
|
@ -2,7 +2,7 @@ import { LexicalModelTypes } from '@keymanapp/common-types';
|
|||
import { SyntheticTextStore } from "keyman/engine/keyboard";
|
||||
import { KMWString } from 'keyman/common/web-utils';
|
||||
|
||||
export default class ContextWindow implements LexicalModelTypes.Context {
|
||||
export class ContextWindow implements LexicalModelTypes.Context {
|
||||
// Used to limit the range of context replicated for use of keyboard rules within
|
||||
// the engine, as used for fat-finger prep / `Alternate` generation.
|
||||
public static readonly ENGINE_RULE_WINDOW: LexicalModelTypes.Configuration = {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Detect the user's device.
|
||||
*/
|
||||
import StyleConstants from './utils/styleConstants.js';
|
||||
import { StyleConstants } from './utils/styleConstants.js';
|
||||
import { DeviceSpec, Version } from "keyman/common/web-utils";
|
||||
|
||||
export class DeviceDetector {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// Defines a 'polyfill' of sorts for NPM's events module
|
||||
|
||||
import ContextWindow from "./contextWindow.js";
|
||||
import { ContextWindow } from "./contextWindow.js";
|
||||
import { LanguageProcessor } from "./languageProcessor.js";
|
||||
import type { ModelSpec, PathConfiguration } from "keyman/engine/interfaces";
|
||||
import { globalObject, DeviceSpec, isEmptyTransform } from "keyman/common/web-utils";
|
||||
|
|
@ -172,9 +172,9 @@ export class InputProcessor {
|
|||
// The default OSK layout for desktop devices does not include nextlayer info, relying on
|
||||
// modifier detection here.
|
||||
// It's the OSK equivalent to doModifierPress on 'desktop' form factors.
|
||||
if ((formFactor == DeviceSpec.FormFactor.Desktop || !this.activeKeyboard ||
|
||||
(this.activeKeyboard instanceof JSKeyboard &&
|
||||
this.activeKeyboard.usesDesktopLayoutOnDevice(keyEvent.device))) &&
|
||||
if ((formFactor == DeviceSpec.FormFactor.Desktop || !this.activeKeyboard ||
|
||||
(this.activeKeyboard instanceof JSKeyboard &&
|
||||
this.activeKeyboard.usesDesktopLayoutOnDevice(keyEvent.device))) &&
|
||||
keyEvent.isSynthetic
|
||||
) {
|
||||
// If it's a desktop OSK style and this triggers a layer change,
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { EventEmitter } from "eventemitter3";
|
|||
import { LMLayer, WorkerFactory } from "@keymanapp/lexical-model-layer/web";
|
||||
import { Transcription, TextStoreLanguageProcessorInterface, SyntheticTextStore } from 'keyman/engine/keyboard';
|
||||
import { LanguageProcessorEventMap, ModelSpec, StateChangeEnum, ReadySuggestions } from 'keyman/engine/interfaces';
|
||||
import ContextWindow from "./contextWindow.js";
|
||||
import { ContextWindow } from "./contextWindow.js";
|
||||
import { TranscriptionCache } from "./transcriptionCache.js";
|
||||
import { LexicalModelTypes } from '@keymanapp/common-types';
|
||||
import Capabilities = LexicalModelTypes.Capabilities;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import { DeviceSpec } from "keyman/common/web-utils";
|
|||
/**
|
||||
* Defines device-level constants used for CSS styling.
|
||||
*/
|
||||
export default class StyleConstants {
|
||||
export class StyleConstants {
|
||||
constructor(device: DeviceSpec) {
|
||||
// popupCanvasBackgroundColor
|
||||
if(device.OS == DeviceSpec.OperatingSystem.Android) {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { EventEmitter } from 'eventemitter3';
|
|||
import { createUnselectableElement } from 'keyman/engine/dom-utils';
|
||||
|
||||
import { Banner } from './banner.js';
|
||||
import OSKViewComponent from '../components/oskViewComponent.interface.js';
|
||||
import { OSKViewComponent } from '../components/oskViewComponent.interface.js';
|
||||
import { ParsedLengthStyle } from '../lengthStyle.js';
|
||||
import { BlankBanner } from './blankBanner.js';
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Maps 'sp' properties on a touch-layout spec to their corresponding CSS class names.
|
||||
*/
|
||||
const BUTTON_CLASSES = [
|
||||
export const BUTTON_CLASSES = [
|
||||
'default',
|
||||
'shift',
|
||||
'shift-on',
|
||||
|
|
@ -15,5 +15,3 @@ const BUTTON_CLASSES = [
|
|||
'blank',
|
||||
'hidden'
|
||||
];
|
||||
|
||||
export default BUTTON_CLASSES;
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import KeyboardView from "./keyboardView.interface.js";
|
||||
import { KeyboardView } from "./keyboardView.interface.js";
|
||||
import { ParsedLengthStyle } from "../lengthStyle.js";
|
||||
|
||||
export default class EmptyView implements KeyboardView {
|
||||
export class EmptyView implements KeyboardView {
|
||||
readonly element: HTMLDivElement;
|
||||
|
||||
constructor() {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { JSKeyboard } from 'keyman/engine/keyboard';
|
||||
|
||||
import KeyboardView from './keyboardView.interface.js';
|
||||
import { KeyboardView } from './keyboardView.interface.js';
|
||||
import { ParsedLengthStyle } from "../lengthStyle.js";
|
||||
|
||||
export default class HelpPageView implements KeyboardView {
|
||||
export class HelpPageView implements KeyboardView {
|
||||
private readonly kbd: JSKeyboard;
|
||||
public readonly element: HTMLDivElement;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import OSKViewComponent from "./oskViewComponent.interface.js";
|
||||
import { OSKViewComponent } from "./oskViewComponent.interface.js";
|
||||
|
||||
/**
|
||||
* An abstract representation for visualizations of the active keyboard within an
|
||||
* OSKManager / OSKView. Most keyboards will default to use of a VisualKeyboard,
|
||||
* though some will use HelpPage for certain form factors.
|
||||
*/
|
||||
export default interface KeyboardView extends OSKViewComponent {
|
||||
export interface KeyboardView extends OSKViewComponent {
|
||||
readonly element: HTMLDivElement;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import type { ParsedLengthStyle } from "../lengthStyle.js";
|
||||
|
||||
export default interface OSKViewComponent {
|
||||
export interface OSKViewComponent {
|
||||
readonly element: HTMLElement;
|
||||
readonly layoutHeight: ParsedLengthStyle;
|
||||
refreshLayout(): void;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { EventEmitter } from 'eventemitter3';
|
||||
|
||||
import OSKViewComponent from './oskViewComponent.interface.js';
|
||||
import { OSKViewComponent } from './oskViewComponent.interface.js';
|
||||
import { ParsedLengthStyle } from '../lengthStyle.js';
|
||||
import MouseDragOperation from '../input/mouseDragOperation.js';
|
||||
import { MouseDragOperation } from '../input/mouseDragOperation.js';
|
||||
|
||||
import { createUnselectableElement } from 'keyman/engine/dom-utils';
|
||||
|
||||
|
|
@ -13,7 +13,7 @@ interface EventMap {
|
|||
showbuild: () => void;
|
||||
}
|
||||
|
||||
export default class ResizeBar extends EventEmitter<EventMap, ResizeBar> implements OSKViewComponent {
|
||||
export class ResizeBar extends EventEmitter<EventMap, ResizeBar> implements OSKViewComponent {
|
||||
private _element: HTMLDivElement;
|
||||
private _resizeHandle: HTMLDivElement;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@ import { EventEmitter } from 'eventemitter3';
|
|||
|
||||
import { JSKeyboard } from 'keyman/engine/keyboard';
|
||||
|
||||
import OSKViewComponent from './oskViewComponent.interface.js';
|
||||
import { OSKViewComponent } from './oskViewComponent.interface.js';
|
||||
import { ParsedLengthStyle } from '../lengthStyle.js';
|
||||
import MouseDragOperation from '../input/mouseDragOperation.js';
|
||||
import { MouseDragOperation } from '../input/mouseDragOperation.js';
|
||||
|
||||
import { createUnselectableElement } from 'keyman/engine/dom-utils';
|
||||
|
||||
|
|
@ -30,7 +30,7 @@ interface EventMap {
|
|||
unpin: () => void
|
||||
}
|
||||
|
||||
export default class TitleBar extends EventEmitter<EventMap, TitleBar> implements OSKViewComponent {
|
||||
export class TitleBar extends EventEmitter<EventMap, TitleBar> implements OSKViewComponent {
|
||||
private _element: HTMLDivElement;
|
||||
private _unpinButton: HTMLDivElement;
|
||||
private _closeButton: HTMLDivElement;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import { DeviceSpec } from "keyman/common/web-utils";
|
||||
|
||||
import EmbeddedGestureConfig from './embeddedGestureConfig.js';
|
||||
import { EmbeddedGestureConfig } from './embeddedGestureConfig.js';
|
||||
import { OSKResourcePathConfiguration } from "keyman/engine/interfaces";
|
||||
import { GestureParams } from "../input/gestures/specsForLayout.js";
|
||||
|
||||
export default interface CommonConfiguration {
|
||||
export interface CommonConfiguration {
|
||||
/**
|
||||
* Metadata for the type of device to emulate and target with the on-screen keyboard.
|
||||
* When not specified, the metadata specified for `hostDevice` will be used by default.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import GlobeHint from "../globehint.interface.js";
|
||||
import VisualKeyboard from "../visualKeyboard.js";
|
||||
import { GlobeHint } from "../globehint.interface.js";
|
||||
import { VisualKeyboard } from "../visualKeyboard.js";
|
||||
|
||||
export default interface EmbeddedGestureConfig {
|
||||
export interface EmbeddedGestureConfig {
|
||||
createGlobeHint?: (vkbd: VisualKeyboard) => GlobeHint;
|
||||
}
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
import { type PredictionContext } from 'keyman/engine/interfaces';
|
||||
import type Activator from "../views/activator.js";
|
||||
import CommonConfiguration from "./commonConfiguration.js";
|
||||
import { type Activator } from "../views/activator.js";
|
||||
import { CommonConfiguration } from "./commonConfiguration.js";
|
||||
|
||||
export default interface Configuration extends CommonConfiguration {
|
||||
export interface ViewConfiguration extends CommonConfiguration {
|
||||
/**
|
||||
* If set, the value returned by the function set here will be used instead of any automatic
|
||||
* width detection functionality.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { type KeyElement } from "./keyElement.js";
|
||||
|
||||
export default interface GlobeHint {
|
||||
export interface GlobeHint {
|
||||
text: string;
|
||||
state: boolean;
|
||||
element?: HTMLDivElement;
|
||||
|
|
|
|||
|
|
@ -1,34 +1,37 @@
|
|||
export { Codes, DeviceSpec, JSKeyboard, KeyboardProperties, SpacebarText } from 'keyman/engine/keyboard';
|
||||
|
||||
export { default as OSKView, JSKeyboardData } from './views/oskView.js';
|
||||
export { default as FloatingOSKView, FloatingOSKViewConfiguration } from './views/floatingOskView.js';
|
||||
export { default as AnchoredOSKView } from './views/anchoredOskView.js';
|
||||
export { default as InlinedOSKView } from './views/inlinedOskView.js';
|
||||
export { OSKView, JSKeyboardData } from './views/oskView.js';
|
||||
export { FloatingOSKView, FloatingOSKViewConfiguration } from './views/floatingOskView.js';
|
||||
export { AnchoredOSKView } from './views/anchoredOskView.js';
|
||||
export { InlinedOSKView } from './views/inlinedOskView.js';
|
||||
export { type KeyEventResultCallback, type KeyEventHandler, KeyEventSourceInterface } from './views/keyEventSource.interface.js';
|
||||
export { BannerController } from './banner/bannerController.js';
|
||||
// Is referenced by at least one desktop UI module.
|
||||
export { FloatingOSKCookie as FloatingOSKViewCookie } from './views/floatingOskCookie.js';
|
||||
export { default as VisualKeyboard } from './visualKeyboard.js';
|
||||
export { type default as ViewConfiguration } from './config/viewConfiguration.js';
|
||||
export { VisualKeyboard } from './visualKeyboard.js';
|
||||
export { type ViewConfiguration } from './config/viewConfiguration.js';
|
||||
export { type KeyElement } from './keyElement.js';
|
||||
export { type default as OSKBaseKey } from './keyboard-layout/oskBaseKey.js';
|
||||
export { type default as GlobeHint } from './globehint.interface.js';
|
||||
export { type default as KeyTip } from './keytip.interface.js';
|
||||
export { type default as EmbeddedGestureConfig } from './config/embeddedGestureConfig.js';
|
||||
export { type OSKBaseKey } from './keyboard-layout/oskBaseKey.js';
|
||||
export { type GlobeHint } from './globehint.interface.js';
|
||||
export { type KeyTip } from './keytip.interface.js';
|
||||
export { type EmbeddedGestureConfig } from './config/embeddedGestureConfig.js';
|
||||
|
||||
export { getViewportScale } from './screenUtils.js';
|
||||
|
||||
export { default as Activator, StaticActivator } from './views/activator.js';
|
||||
export { default as SimpleActivator } from './views/simpleActivator.js';
|
||||
export { default as TwoStateActivator } from './views/twoStateActivator.js';
|
||||
export { Activator, StaticActivator } from './views/activator.js';
|
||||
export { SimpleActivator } from './views/simpleActivator.js';
|
||||
export { TwoStateActivator } from './views/twoStateActivator.js';
|
||||
export { ParsedLengthStyle } from './lengthStyle.js';
|
||||
|
||||
export { gestureSetForLayout, DEFAULT_GESTURE_PARAMS } from './input/gestures/specsForLayout.js'
|
||||
|
||||
export { PredictionContext } from 'keyman/engine/interfaces';
|
||||
|
||||
export * from './corrections.js';
|
||||
export * from './correctionLayout.js';
|
||||
export { keyTouchDistances, distributionFromDistanceMaps } from './corrections.js';
|
||||
export {
|
||||
CorrectionLayoutEntry, CorrectionLayout, CorrectiveBaseKeyLayout,
|
||||
correctionKeyFilter, buildCorrectiveLayout
|
||||
} from './correctionLayout.js';
|
||||
|
||||
// TODO-web-core: use a unitTestEndpoints pattern here (#15292)
|
||||
export * as testIndex from './test-index.js';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { type KeyElement } from '../../../keyElement.js';
|
||||
import VisualKeyboard from '../../../visualKeyboard.js';
|
||||
import { VisualKeyboard } from '../../../visualKeyboard.js';
|
||||
|
||||
import { ActiveKey, ActiveKeyBase, ActiveSubKey, KeyDistribution, KeyEvent } from 'keyman/engine/keyboard';
|
||||
import { ConfigChangeClosure, CumulativePathStats, GestureRecognizerConfiguration, GestureSequence, GestureSource, GestureSourceSubview, InputSample, RecognitionZoneSource } from 'keyman/engine/gesture-processor';
|
||||
|
|
@ -85,7 +85,7 @@ export const MAX_TOLERANCE_ANGLE_SKEW = Math.PI / 3;
|
|||
* Represents a flick gesture's implementation within KeymanWeb, including
|
||||
* its predictive-text correction aspects.
|
||||
*/
|
||||
export default class Flick implements GestureHandler {
|
||||
export class Flick implements GestureHandler {
|
||||
readonly directlyEmitsKeys = true;
|
||||
|
||||
private readonly sequence: GestureSequence<KeyElement, string>;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { type KeyElement } from '../../../keyElement.js';
|
||||
import VisualKeyboard from '../../../visualKeyboard.js';
|
||||
import { VisualKeyboard } from '../../../visualKeyboard.js';
|
||||
|
||||
import { KeyDistribution, ActiveKeyBase } from 'keyman/engine/keyboard';
|
||||
import { GestureSequence } from 'keyman/engine/gesture-processor';
|
||||
|
|
@ -11,7 +11,7 @@ import { GestureHandler } from '../gestureHandler.js';
|
|||
*
|
||||
* This involves "locking" the current layer in place until the modipress is complete.
|
||||
*/
|
||||
export default class Modipress implements GestureHandler {
|
||||
export class Modipress implements GestureHandler {
|
||||
readonly directlyEmitsKeys = true;
|
||||
|
||||
private completionCallback: () => void;
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import { type KeyElement } from '../../../keyElement.js';
|
||||
import VisualKeyboard from '../../../visualKeyboard.js';
|
||||
import { VisualKeyboard } from '../../../visualKeyboard.js';
|
||||
|
||||
import { ActiveSubKey, ActiveKey, KeyDistribution, ActiveKeyBase } from 'keyman/engine/keyboard';
|
||||
import { GestureSequence, GestureStageReport } from 'keyman/engine/gesture-processor';
|
||||
import { GestureHandler } from '../gestureHandler.js';
|
||||
import { distributionFromDistanceMaps } from '../../../corrections.js';
|
||||
import Modipress from './modipress.js';
|
||||
import { Modipress } from './modipress.js';
|
||||
import { keySupportsModipress } from '../specsForLayout.js';
|
||||
import { GesturePreviewHost } from '../../../keyboard-layout/gesturePreviewHost.js';
|
||||
import { correctionKeyFilter } from '../../../correctionLayout.js';
|
||||
|
|
@ -18,7 +18,7 @@ import { correctionKeyFilter } from '../../../correctionLayout.js';
|
|||
* * UI feedback regarding the state of the ongoing multitap, as appropriate
|
||||
* * Proper selection of the appropriate multitap key for subsequent taps.
|
||||
*/
|
||||
export default class Multitap implements GestureHandler {
|
||||
export class Multitap implements GestureHandler {
|
||||
readonly directlyEmitsKeys = true;
|
||||
|
||||
public readonly baseKey: KeyElement;
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
import { ActiveSubKey } from 'keyman/engine/keyboard';
|
||||
import OSKKey from '../../../keyboard-layout/oskKey.js';
|
||||
import { OSKKey } from '../../../keyboard-layout/oskKey.js';
|
||||
import { KeyData, KeyElement, link } from '../../../keyElement.js';
|
||||
import VisualKeyboard from '../../../visualKeyboard.js';
|
||||
import { VisualKeyboard } from '../../../visualKeyboard.js';
|
||||
|
||||
// Typing is to ensure that the keys specified below actually are on the type...
|
||||
// and to gain Intellisense if more need to be added.
|
||||
|
||||
export default class OSKSubKey extends OSKKey {
|
||||
export class OSKSubKey extends OSKKey {
|
||||
constructor(spec: ActiveSubKey, layer: string) {
|
||||
if(typeof(layer) != 'string' || layer == '') {
|
||||
throw "The 'layer' parameter for subkey construction must be properly defined.";
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import OSKBaseKey from '../../../keyboard-layout/oskBaseKey.js';
|
||||
import { OSKBaseKey } from '../../../keyboard-layout/oskBaseKey.js';
|
||||
import { KeyElement } from '../../../keyElement.js';
|
||||
import KeyTipInterface from '../../../keytip.interface.js';
|
||||
import VisualKeyboard from '../../../visualKeyboard.js';
|
||||
import { KeyTip } from '../../../keytip.interface.js';
|
||||
import { VisualKeyboard } from '../../../visualKeyboard.js';
|
||||
import { GesturePreviewHost } from '../../../keyboard-layout/gesturePreviewHost.js';
|
||||
import { ParsedLengthStyle } from '../../../lengthStyle.js';
|
||||
|
||||
|
|
@ -10,7 +10,7 @@ const DEFAULT_TIP_ORIENTATION: PhoneKeyTipOrientation = 'top';
|
|||
|
||||
export type PhoneKeyTipOrientation = 'top' | 'bottom';
|
||||
|
||||
export default class KeyTip implements KeyTipInterface {
|
||||
export class PhoneKeyTip implements KeyTip {
|
||||
public readonly element: HTMLDivElement;
|
||||
public key: KeyElement;
|
||||
public state: boolean = false;
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import OSKSubKey from './oskSubKey.js';
|
||||
import { OSKSubKey } from './oskSubKey.js';
|
||||
import { type KeyElement } from '../../../keyElement.js';
|
||||
import OSKBaseKey from '../../../keyboard-layout/oskBaseKey.js';
|
||||
import VisualKeyboard from '../../../visualKeyboard.js';
|
||||
import { OSKBaseKey } from '../../../keyboard-layout/oskBaseKey.js';
|
||||
import { VisualKeyboard } from '../../../visualKeyboard.js';
|
||||
|
||||
import { DeviceSpec, ActiveSubKey, KeyDistribution, ActiveKeyBase } from 'keyman/engine/keyboard';
|
||||
import { ConfigChangeClosure, GestureRecognizerConfiguration, GestureSequence, PaddedZoneSource, RecognitionZoneSource } from 'keyman/engine/gesture-processor';
|
||||
|
|
@ -51,7 +51,7 @@ const CALLOUT_BASE_HEIGHT = 6 + SUBKEY_MENU_VERT_OFFSET;
|
|||
* As selection of the subkey occurs after the subkey popup is
|
||||
* displayed, selection of the subkey is inherently asynchronous.
|
||||
*/
|
||||
export default class SubkeyPopup implements GestureHandler {
|
||||
export class SubkeyPopup implements GestureHandler {
|
||||
readonly directlyEmitsKeys = true;
|
||||
|
||||
public readonly element: HTMLDivElement;
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import { KeyElement } from '../../../keyElement.js';
|
||||
import KeyTipInterface from '../../../keytip.interface.js';
|
||||
import VisualKeyboard from '../../../visualKeyboard.js';
|
||||
import { KeyTip } from '../../../keytip.interface.js';
|
||||
import { VisualKeyboard } from '../../../visualKeyboard.js';
|
||||
import { GesturePreviewHost } from '../../../keyboard-layout/gesturePreviewHost.js';
|
||||
|
||||
const BASE_CLASS = 'kmw-keypreview';
|
||||
const OVERLAY_CLASS = 'kmw-preview-overlay';
|
||||
const BASE_ID = 'kmw-keytip';
|
||||
|
||||
export class TabletKeyTip implements KeyTipInterface {
|
||||
export class TabletKeyTip implements KeyTip {
|
||||
public readonly element: HTMLDivElement;
|
||||
public key: KeyElement;
|
||||
public state: boolean = false;
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ class MouseStartSnapshot {
|
|||
}
|
||||
}
|
||||
|
||||
export default abstract class MouseDragOperation {
|
||||
export abstract class MouseDragOperation {
|
||||
private _enabled: boolean;
|
||||
private _startCoord: InputEventCoordinate;
|
||||
private _mouseStartSnapshot: MouseStartSnapshot;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { ActiveSubKey } from 'keyman/engine/keyboard';
|
||||
import OSKKey from "./keyboard-layout/oskKey.js";
|
||||
import { OSKKey } from "./keyboard-layout/oskKey.js";
|
||||
|
||||
export class KeyData {
|
||||
['key']: OSKKey;
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ import { EventEmitter } from "eventemitter3";
|
|||
|
||||
import { KeyElement } from "../keyElement.js";
|
||||
import { FlickNameCoordMap, OrderedFlickDirections } from "../input/gestures/browser/flick.js";
|
||||
import { PhoneKeyTipOrientation } from "../input/gestures/browser/keytip.js";
|
||||
import { default as VisualKeyboard } from "../visualKeyboard.js";
|
||||
import { PhoneKeyTipOrientation } from "../input/gestures/browser/phoneKeytip.js";
|
||||
import { VisualKeyboard } from "../visualKeyboard.js";
|
||||
import { renameSpecialKey } from "./oskKey.js";
|
||||
|
||||
/**With edge lengths of 1, to keep flick-text invisible at the start, the
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import { ActiveKey, Codes } from 'keyman/engine/keyboard';
|
||||
|
||||
import OSKKey, { KeyLayoutParams, renameSpecialKey } from './oskKey.js';
|
||||
import { OSKKey, KeyLayoutParams, renameSpecialKey } from './oskKey.js';
|
||||
import { KeyData, KeyElement, link } from '../keyElement.js';
|
||||
import OSKRow from './oskRow.js';
|
||||
import VisualKeyboard from '../visualKeyboard.js';
|
||||
import { OSKRow } from './oskRow.js';
|
||||
import { VisualKeyboard } from '../visualKeyboard.js';
|
||||
import { ParsedLengthStyle } from '../lengthStyle.js';
|
||||
import { GesturePreviewHost } from './gesturePreviewHost.js';
|
||||
|
||||
export default class OSKBaseKey extends OSKKey {
|
||||
export class OSKBaseKey extends OSKKey {
|
||||
private capLabel: HTMLDivElement;
|
||||
private previewHost: GesturePreviewHost;
|
||||
private preview: HTMLDivElement;
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
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 specialChars from '../specialCharacters.js';
|
||||
import buttonClassNames from '../buttonClassNames.js';
|
||||
import { specialCharacters as specialChars } from '../specialCharacters.js';
|
||||
import { BUTTON_CLASSES as buttonClassNames } from '../buttonClassNames.js';
|
||||
|
||||
import { KeyElement } from '../keyElement.js';
|
||||
import VisualKeyboard from '../visualKeyboard.js';
|
||||
import { VisualKeyboard } from '../visualKeyboard.js';
|
||||
import { getTextMetrics } from './getTextMetrics.js';
|
||||
import { ParsedLengthStyle } from '../lengthStyle.js';
|
||||
|
||||
|
|
@ -50,7 +50,7 @@ export function renameSpecialKey(oldText: string, vkbd: VisualKeyboard): string
|
|||
oldText;
|
||||
}
|
||||
|
||||
export default abstract class OSKKey {
|
||||
export abstract class OSKKey {
|
||||
// Only set here to act as an alias for code built against legacy versions.
|
||||
static readonly specialCharacters = specialChars;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { ActiveLayer, ActiveLayout } from 'keyman/engine/keyboard';
|
||||
|
||||
import OSKRow from './oskRow.js';
|
||||
import OSKBaseKey from './oskBaseKey.js';
|
||||
import VisualKeyboard from '../visualKeyboard.js';
|
||||
import { OSKRow } from './oskRow.js';
|
||||
import { OSKBaseKey } from './oskBaseKey.js';
|
||||
import { VisualKeyboard } from '../visualKeyboard.js';
|
||||
import { ParsedLengthStyle } from '../lengthStyle.js';
|
||||
|
||||
export interface LayerLayoutParams {
|
||||
|
|
@ -14,7 +14,7 @@ export interface LayerLayoutParams {
|
|||
layoutFontSize: ParsedLengthStyle;
|
||||
spacebarText: string;
|
||||
}
|
||||
export default class OSKLayer {
|
||||
export class OSKLayer {
|
||||
public readonly element: HTMLDivElement;
|
||||
public readonly rows: OSKRow[];
|
||||
public readonly spec: ActiveLayer;
|
||||
|
|
|
|||
|
|
@ -3,13 +3,13 @@ import { type DeviceSpec, JSKeyboard, ActiveLayout, ButtonClasses } from 'keyman
|
|||
import { InputSample } from 'keyman/engine/gesture-processor';
|
||||
|
||||
import { KeyElement } from '../keyElement.js';
|
||||
import OSKLayer, { LayerLayoutParams } from './oskLayer.js';
|
||||
import VisualKeyboard from '../visualKeyboard.js';
|
||||
import OSKBaseKey from './oskBaseKey.js';
|
||||
import { OSKLayer, LayerLayoutParams } from './oskLayer.js';
|
||||
import { VisualKeyboard } from '../visualKeyboard.js';
|
||||
import { OSKBaseKey } from './oskBaseKey.js';
|
||||
|
||||
const NEAREST_KEY_TOUCH_MARGIN_PERCENT = 0.06;
|
||||
|
||||
export default class OSKLayerGroup {
|
||||
export class OSKLayerGroup {
|
||||
public readonly element: HTMLDivElement;
|
||||
private readonly _layers: {[layerID: string]: OSKLayer} = {};
|
||||
public readonly spec: ActiveLayout;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { ActiveKey, ActiveLayer, ActiveRow } from 'keyman/engine/keyboard';
|
||||
|
||||
import OSKBaseKey from './oskBaseKey.js';
|
||||
import { OSKBaseKey } from './oskBaseKey.js';
|
||||
import { ParsedLengthStyle } from '../lengthStyle.js';
|
||||
import VisualKeyboard from '../visualKeyboard.js';
|
||||
import OSKKey, { KeyLayoutParams } from './oskKey.js';
|
||||
import { VisualKeyboard } from '../visualKeyboard.js';
|
||||
import { OSKKey, KeyLayoutParams } from './oskKey.js';
|
||||
import { LayerLayoutParams } from './oskLayer.js';
|
||||
|
||||
/*
|
||||
|
|
@ -16,7 +16,7 @@ export const KEY_BTN_Y_PAD_RATIO = 0.15;
|
|||
/**
|
||||
* Models one row of one layer of the OSK (`VisualKeyboard`) for a keyboard.
|
||||
*/
|
||||
export default class OSKRow {
|
||||
export class OSKRow {
|
||||
public readonly element: HTMLDivElement;
|
||||
public readonly keys: OSKBaseKey[];
|
||||
public readonly heightFraction: number;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { GesturePreviewHost } from "./keyboard-layout/gesturePreviewHost.js";
|
||||
import { KeyElement } from "./keyElement.js";
|
||||
|
||||
export default interface KeyTip {
|
||||
export interface KeyTip {
|
||||
key: KeyElement;
|
||||
state: boolean;
|
||||
element?: HTMLDivElement;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// Defines the PUA code mapping for the various 'special' modifier/control/non-printing keys on keyboards.
|
||||
// `specialCharacters` must be kept in sync with the same variable in constants.js. See also CompileKeymanWeb.pas: CSpecialText10
|
||||
const specialCharacters = {
|
||||
export const specialCharacters = {
|
||||
'*Shift*': 8,
|
||||
'*Enter*': 5,
|
||||
'*Tab*': 6,
|
||||
|
|
@ -68,5 +68,3 @@ const specialCharacters = {
|
|||
// TODO: Skipping size references
|
||||
|
||||
};
|
||||
|
||||
export default specialCharacters;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
export { default as OSKBaseKey } from './keyboard-layout/oskBaseKey.js';
|
||||
export { default as OSKRow } from './keyboard-layout/oskRow.js';
|
||||
export { default as SubkeyPopup } from './input/gestures/browser/subkeyPopup.js'
|
||||
export { OSKBaseKey } from './keyboard-layout/oskBaseKey.js';
|
||||
export { OSKRow } from './keyboard-layout/oskRow.js';
|
||||
export { SubkeyPopup } from './input/gestures/browser/subkeyPopup.js'
|
||||
export { link } from './keyElement.js'
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ interface EventMap {
|
|||
* Used to encapsulate activation logic for the on-screen keyboadr, conditionally activating
|
||||
* and deactivating it based on specified conditions.
|
||||
*/
|
||||
export default abstract class Activator<ExtraEvents = void> extends EventEmitter<EventMap & ExtraEvents, Activator> {
|
||||
export abstract class Activator<ExtraEvents = void> extends EventEmitter<EventMap & ExtraEvents, Activator> {
|
||||
/**
|
||||
* For certain sub-types, this may be set to `false` to "turn activation off", putting
|
||||
* the `Activator` in a state that ignores changes to any other conditions.
|
||||
|
|
|
|||
|
|
@ -1,18 +1,18 @@
|
|||
import { DeviceSpec } from 'keyman/engine/keyboard';
|
||||
import { landscapeView } from 'keyman/engine/dom-utils';
|
||||
|
||||
import OSKView, { OSKPos, OSKRect } from './oskView.js';
|
||||
import { OSKView, OSKPos, OSKRect } from './oskView.js';
|
||||
import { getViewportScale } from '../screenUtils.js';
|
||||
import Configuration from '../config/viewConfiguration.js';
|
||||
import { ViewConfiguration } from '../config/viewConfiguration.js';
|
||||
import { StaticActivator } from './activator.js';
|
||||
import TwoStateActivator from './twoStateActivator.js';
|
||||
import { TwoStateActivator } from './twoStateActivator.js';
|
||||
|
||||
/***
|
||||
KeymanWeb 10.0
|
||||
Copyright 2017 SIL International
|
||||
***/
|
||||
|
||||
export default class AnchoredOSKView extends OSKView {
|
||||
export class AnchoredOSKView extends OSKView {
|
||||
|
||||
// OSK positioning fields
|
||||
x: number;
|
||||
|
|
@ -20,7 +20,7 @@ export default class AnchoredOSKView extends OSKView {
|
|||
|
||||
private isResizing: boolean = false;
|
||||
|
||||
public constructor(config: Configuration) {
|
||||
public constructor(config: ViewConfiguration) {
|
||||
if(config.isEmbedded) {
|
||||
config.activator = config.activator || new StaticActivator();
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -2,14 +2,14 @@ import { DeviceSpec, ManagedPromise, Version } from 'keyman/engine/keyboard';
|
|||
import { getAbsoluteX, getAbsoluteY, landscapeView } from 'keyman/engine/dom-utils';
|
||||
import { EmitterListenerSpy } from 'keyman/engine/events';
|
||||
|
||||
import OSKView, { EventMap, type LegacyOSKEventMap, OSKPos, OSKRect } from './oskView.js';
|
||||
import TitleBar from '../components/titleBar.js';
|
||||
import ResizeBar from '../components/resizeBar.js';
|
||||
import { OSKView, EventMap, type LegacyOSKEventMap, OSKPos, OSKRect } from './oskView.js';
|
||||
import { TitleBar } from '../components/titleBar.js';
|
||||
import { ResizeBar } from '../components/resizeBar.js';
|
||||
|
||||
import MouseDragOperation from '../input/mouseDragOperation.js';
|
||||
import { MouseDragOperation } from '../input/mouseDragOperation.js';
|
||||
import { getViewportScale } from '../screenUtils.js';
|
||||
import Configuration from '../config/viewConfiguration.js';
|
||||
import TwoStateActivator from './twoStateActivator.js';
|
||||
import { ViewConfiguration } from '../config/viewConfiguration.js';
|
||||
import { TwoStateActivator } from './twoStateActivator.js';
|
||||
import { FloatingOSKCookie, FloatingOSKCookieSerializer } from './floatingOskCookie.js';
|
||||
|
||||
/***
|
||||
|
|
@ -17,11 +17,11 @@ import { FloatingOSKCookie, FloatingOSKCookieSerializer } from './floatingOskCoo
|
|||
Copyright 2017 SIL International
|
||||
***/
|
||||
|
||||
export interface FloatingOSKViewConfiguration extends Configuration {
|
||||
export interface FloatingOSKViewConfiguration extends ViewConfiguration {
|
||||
activator?: TwoStateActivator<HTMLElement>;
|
||||
}
|
||||
|
||||
export default class FloatingOSKView extends OSKView {
|
||||
export class FloatingOSKView extends OSKView {
|
||||
// OSK positioning fields
|
||||
userPositioned: boolean = false;
|
||||
specifiedPosition: boolean = false;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { DeviceSpec } from 'keyman/engine/keyboard';
|
||||
|
||||
import OSKView, { OSKPos, OSKRect } from './oskView.js';
|
||||
import VisualKeyboard from '../visualKeyboard.js';
|
||||
import Configuration from '../config/viewConfiguration.js';
|
||||
import SimpleActivator from './simpleActivator.js';
|
||||
import { OSKView, OSKPos, OSKRect } from './oskView.js';
|
||||
import { VisualKeyboard } from '../visualKeyboard.js';
|
||||
import { ViewConfiguration } from '../config/viewConfiguration.js';
|
||||
import { SimpleActivator } from './simpleActivator.js';
|
||||
|
||||
/*
|
||||
* Keyman is copyright (c) SIL International. MIT License.
|
||||
|
|
@ -14,8 +14,8 @@ import SimpleActivator from './simpleActivator.js';
|
|||
* insertion into the DOM. Rather than "floating" over the page, this version is inlined
|
||||
* as part of the host page's layout.
|
||||
*/
|
||||
export default class InlinedOSKView extends OSKView {
|
||||
public constructor(config: Configuration) {
|
||||
export class InlinedOSKView extends OSKView {
|
||||
public constructor(config: ViewConfiguration) {
|
||||
config.activator = config.activator || new SimpleActivator();
|
||||
super(config);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@ import { EventEmitter } from 'eventemitter3';
|
|||
|
||||
import { BannerView } from '../banner/bannerView.js';
|
||||
import { BannerController } from '../banner/bannerController.js';
|
||||
import OSKViewComponent from '../components/oskViewComponent.interface.js';
|
||||
import EmptyView from '../components/emptyView.js';
|
||||
import HelpPageView from '../components/helpPageView.js';
|
||||
import KeyboardView from '../components/keyboardView.interface.js';
|
||||
import VisualKeyboard from '../visualKeyboard.js';
|
||||
import { OSKViewComponent } from '../components/oskViewComponent.interface.js';
|
||||
import { EmptyView } from '../components/emptyView.js';
|
||||
import { HelpPageView } from '../components/helpPageView.js';
|
||||
import { KeyboardView } from '../components/keyboardView.interface.js';
|
||||
import { VisualKeyboard } from '../visualKeyboard.js';
|
||||
import { LengthStyle, ParsedLengthStyle } from '../lengthStyle.js';
|
||||
import { type KeyElement } from '../keyElement.js';
|
||||
|
||||
|
|
@ -22,9 +22,9 @@ import {
|
|||
import { createUnselectableElement, getAbsoluteX, getAbsoluteY, StylesheetManager } from 'keyman/engine/dom-utils';
|
||||
import { EventListener, LegacyEventEmitter } from 'keyman/engine/events';
|
||||
|
||||
import Configuration from '../config/viewConfiguration.js';
|
||||
import Activator, { StaticActivator } from './activator.js';
|
||||
import TouchEventPromiseMap from './touchEventPromiseMap.js';
|
||||
import { ViewConfiguration } from '../config/viewConfiguration.js';
|
||||
import { Activator, StaticActivator } from './activator.js';
|
||||
import { TouchEventPromiseMap } from './touchEventPromiseMap.js';
|
||||
import { KeyEventHandler, KeyEventSourceInterface } from './keyEventSource.interface.js';
|
||||
import { DEFAULT_GESTURE_PARAMS, GestureParams } from '../input/gestures/specsForLayout.js';
|
||||
|
||||
|
|
@ -125,7 +125,7 @@ export interface EventMap {
|
|||
pointerinteraction: (promise: Promise<void>) => void;
|
||||
}
|
||||
|
||||
export function getResourcePath(config: Configuration) {
|
||||
export function getResourcePath(config: ViewConfiguration) {
|
||||
let resourcePathExt = 'osk/';
|
||||
if(config.isEmbedded) {
|
||||
resourcePathExt = '';
|
||||
|
|
@ -133,7 +133,7 @@ export function getResourcePath(config: Configuration) {
|
|||
return `${config.pathConfig.resources}/${resourcePathExt}`
|
||||
}
|
||||
|
||||
export default abstract class OSKView
|
||||
export abstract class OSKView
|
||||
extends EventEmitter<EventMap>
|
||||
implements MinimalCodesInterface, KeyEventSourceInterface<EventMap> {
|
||||
_Box: HTMLDivElement;
|
||||
|
|
@ -167,7 +167,7 @@ export default abstract class OSKView
|
|||
private kbdStyleSheetManager: StylesheetManager;
|
||||
private uiStyleSheetManager: StylesheetManager;
|
||||
|
||||
private config: Configuration;
|
||||
private config: ViewConfiguration;
|
||||
private deferLayout: boolean;
|
||||
|
||||
private _boxBaseTouchStart: (e: TouchEvent) => boolean;
|
||||
|
|
@ -226,7 +226,7 @@ export default abstract class OSKView
|
|||
|
||||
static readonly STYLESHEET_FILES = ['kmwosk.css', 'globe-hint.css'];
|
||||
|
||||
constructor(configuration: Configuration) {
|
||||
constructor(configuration: ViewConfiguration) {
|
||||
super();
|
||||
|
||||
// Clone the config; do not allow object references to be altered later.
|
||||
|
|
@ -278,7 +278,7 @@ export default abstract class OSKView
|
|||
this._Box.style.display = 'none';
|
||||
}
|
||||
|
||||
protected get configuration(): Configuration {
|
||||
protected get configuration(): ViewConfiguration {
|
||||
return this.config;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import Activator from './activator.js';
|
||||
import { Activator } from './activator.js';
|
||||
|
||||
export default class SimpleActivator extends Activator {
|
||||
export class SimpleActivator extends Activator {
|
||||
private flag: boolean = true;
|
||||
|
||||
get enabled(): boolean {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { ManagedPromise } from "keyman/common/web-utils";
|
||||
|
||||
export default class TouchEventPromiseMap {
|
||||
export class TouchEventPromiseMap {
|
||||
private map: Map<number, ManagedPromise<void>> = new Map();
|
||||
|
||||
// Used to
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import Activator from './activator.js';
|
||||
import { Activator } from './activator.js';
|
||||
|
||||
interface TriggerEventMap<Type> {
|
||||
triggerchange: (trigger: Type) => void;
|
||||
}
|
||||
|
||||
export default class TwoStateActivator<Type> extends Activator<TriggerEventMap<Type>> {
|
||||
export class TwoStateActivator<Type> extends Activator<TriggerEventMap<Type>> {
|
||||
private _enabled: boolean = true;
|
||||
private actValue: Type = null;
|
||||
|
||||
|
|
|
|||
|
|
@ -33,31 +33,31 @@ import { createStyleSheet, StylesheetManager } from 'keyman/engine/dom-utils';
|
|||
|
||||
import { KeyEventHandler, KeyEventResultCallback } from './views/keyEventSource.interface.js';
|
||||
|
||||
import GlobeHint from './globehint.interface.js';
|
||||
import KeyboardView from './components/keyboardView.interface.js';
|
||||
import { GlobeHint } from './globehint.interface.js';
|
||||
import { KeyboardView } from './components/keyboardView.interface.js';
|
||||
import { type KeyElement } from './keyElement.js';
|
||||
import KeyTip from './keytip.interface.js';
|
||||
import OSKKey from './keyboard-layout/oskKey.js';
|
||||
import OSKLayer, { LayerLayoutParams } from './keyboard-layout/oskLayer.js';
|
||||
import OSKLayerGroup from './keyboard-layout/oskLayerGroup.js';
|
||||
import OSKView from './views/oskView.js';
|
||||
import { KeyTip } from './keytip.interface.js';
|
||||
import { OSKKey } from './keyboard-layout/oskKey.js';
|
||||
import { OSKLayer, LayerLayoutParams } from './keyboard-layout/oskLayer.js';
|
||||
import { OSKLayerGroup } from './keyboard-layout/oskLayerGroup.js';
|
||||
import { OSKView } from './views/oskView.js';
|
||||
import { ParsedLengthStyle } from './lengthStyle.js';
|
||||
import { defaultFontSize } from './fontSizeUtils.js';
|
||||
import PhoneKeyTip from './input/gestures/browser/keytip.js';
|
||||
import { PhoneKeyTip } from './input/gestures/browser/phoneKeytip.js';
|
||||
import { TabletKeyTip } from './input/gestures/browser/tabletPreview.js';
|
||||
import CommonConfiguration from './config/commonConfiguration.js';
|
||||
import { CommonConfiguration } from './config/commonConfiguration.js';
|
||||
|
||||
import { DEFAULT_GESTURE_PARAMS, GestureParams, gestureSetForLayout } from './input/gestures/specsForLayout.js';
|
||||
|
||||
import { getViewportScale } from './screenUtils.js';
|
||||
import { HeldRepeater } from './input/gestures/heldRepeater.js';
|
||||
import SubkeyPopup from './input/gestures/browser/subkeyPopup.js';
|
||||
import Multitap from './input/gestures/browser/multitap.js';
|
||||
import { SubkeyPopup } from './input/gestures/browser/subkeyPopup.js';
|
||||
import { Multitap } from './input/gestures/browser/multitap.js';
|
||||
import { GestureHandler } from './input/gestures/gestureHandler.js';
|
||||
import Modipress from './input/gestures/browser/modipress.js';
|
||||
import Flick from './input/gestures/browser/flick.js';
|
||||
import { Modipress } from './input/gestures/browser/modipress.js';
|
||||
import { Flick } from './input/gestures/browser/flick.js';
|
||||
import { GesturePreviewHost } from './keyboard-layout/gesturePreviewHost.js';
|
||||
import OSKBaseKey from './keyboard-layout/oskBaseKey.js';
|
||||
import { OSKBaseKey } from './keyboard-layout/oskBaseKey.js';
|
||||
import { OSKResourcePathConfiguration } from 'keyman/engine/interfaces';
|
||||
import KEYMAN_VERSION from '@keymanapp/keyman-version';
|
||||
|
||||
|
|
@ -139,7 +139,7 @@ interface EventMap {
|
|||
}
|
||||
|
||||
// #region VisualKeyboard
|
||||
export default class VisualKeyboard extends EventEmitter<EventMap> implements KeyboardView {
|
||||
export class VisualKeyboard extends EventEmitter<EventMap> implements KeyboardView {
|
||||
/**
|
||||
* The gesture-engine used to support user interaction with this keyboard.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { KeyDistribution, KeyEvent, type TextStore, SyntheticTextStore } from "keyman/engine/keyboard";
|
||||
|
||||
import Proctor from "./proctor.js";
|
||||
import { Proctor } from "./proctor.js";
|
||||
|
||||
export { default as Proctor } from "./proctor.js";
|
||||
export { default as NodeProctor } from "./nodeProctor.js";
|
||||
export { Proctor } from "./proctor.js";
|
||||
export { NodeProctor } from "./nodeProctor.js";
|
||||
|
||||
import * as utils from "keyman/common/web-utils";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import Proctor, { AssertCallback } from "./proctor.js";
|
||||
import { Proctor, AssertCallback } from "./proctor.js";
|
||||
import {
|
||||
KeyboardTest,
|
||||
TestSet,
|
||||
|
|
@ -12,7 +12,7 @@ import { KeyEvent, KeyEventSpec, KeyboardHarness, SyntheticTextStore, TextStore
|
|||
import { DeviceSpec } from "keyman/common/web-utils";
|
||||
import { JSKeyboardInterface, JSKeyboardProcessor } from 'keyman/engine/js-processor';
|
||||
|
||||
export default class NodeProctor extends Proctor {
|
||||
export class NodeProctor extends Proctor {
|
||||
private keyboardWithHarness: KeyboardHarness;
|
||||
public __debug = false;
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue