@mirasen/chessboard 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/animation/planner.d.ts +3 -3
- package/dist/animation/planner.js +4 -4
- package/dist/animation/render/fade.d.ts +4 -4
- package/dist/animation/render/fade.js +1 -1
- package/dist/animation/render/move.d.ts +4 -4
- package/dist/animation/render/move.js +1 -1
- package/dist/animation/render/plan.d.ts +4 -4
- package/dist/animation/render/plan.js +3 -3
- package/dist/animation/render/static.d.ts +4 -4
- package/dist/animation/render/static.js +1 -1
- package/dist/animation/render/types.d.ts +1 -1
- package/dist/animation/types.d.ts +1 -1
- package/dist/extensions/animation/factory.d.ts +1 -1
- package/dist/extensions/animation/factory.js +1 -1
- package/dist/extensions/animation/types.d.ts +1 -1
- package/dist/extensions/factory/main.d.ts +1 -1
- package/dist/extensions/factory/main.js +4 -4
- package/dist/extensions/factory/runtime.d.ts +4 -4
- package/dist/extensions/first-party/active-target/factory.d.ts +1 -1
- package/dist/extensions/first-party/active-target/factory.js +4 -4
- package/dist/extensions/first-party/active-target/types.d.ts +2 -2
- package/dist/extensions/first-party/board-events/factory.d.ts +1 -1
- package/dist/extensions/first-party/board-events/factory.js +6 -4
- package/dist/extensions/first-party/board-events/types.d.ts +6 -6
- package/dist/extensions/first-party/common/helpers.d.ts +2 -2
- package/dist/extensions/first-party/common/helpers.js +1 -1
- package/dist/extensions/first-party/common/types.d.ts +1 -1
- package/dist/extensions/first-party/last-move/factory.d.ts +1 -1
- package/dist/extensions/first-party/last-move/factory.js +4 -4
- package/dist/extensions/first-party/last-move/types.d.ts +2 -2
- package/dist/extensions/first-party/legal-moves/factory.d.ts +1 -1
- package/dist/extensions/first-party/legal-moves/factory.js +6 -6
- package/dist/extensions/first-party/legal-moves/types.d.ts +2 -2
- package/dist/extensions/first-party/main-renderer/animation/factory.d.ts +3 -3
- package/dist/extensions/first-party/main-renderer/animation/factory.js +3 -3
- package/dist/extensions/first-party/main-renderer/animation/render.d.ts +3 -3
- package/dist/extensions/first-party/main-renderer/animation/render.js +2 -2
- package/dist/extensions/first-party/main-renderer/animation/types.d.ts +7 -7
- package/dist/extensions/first-party/main-renderer/animation/update.d.ts +2 -2
- package/dist/extensions/first-party/main-renderer/animation/update.js +3 -3
- package/dist/extensions/first-party/main-renderer/board/factory.d.ts +2 -2
- package/dist/extensions/first-party/main-renderer/board/factory.js +2 -2
- package/dist/extensions/first-party/main-renderer/board/render.d.ts +2 -2
- package/dist/extensions/first-party/main-renderer/board/render.js +3 -3
- package/dist/extensions/first-party/main-renderer/board/types.d.ts +3 -3
- package/dist/extensions/first-party/main-renderer/board/update.d.ts +2 -2
- package/dist/extensions/first-party/main-renderer/board/update.js +3 -3
- package/dist/extensions/first-party/main-renderer/coordinates/factory.d.ts +2 -2
- package/dist/extensions/first-party/main-renderer/coordinates/factory.js +1 -1
- package/dist/extensions/first-party/main-renderer/coordinates/render.d.ts +2 -2
- package/dist/extensions/first-party/main-renderer/coordinates/render.js +3 -3
- package/dist/extensions/first-party/main-renderer/coordinates/types.d.ts +2 -2
- package/dist/extensions/first-party/main-renderer/drag/factory.d.ts +3 -3
- package/dist/extensions/first-party/main-renderer/drag/factory.js +2 -2
- package/dist/extensions/first-party/main-renderer/drag/render.d.ts +2 -2
- package/dist/extensions/first-party/main-renderer/drag/render.js +1 -1
- package/dist/extensions/first-party/main-renderer/drag/types.d.ts +4 -4
- package/dist/extensions/first-party/main-renderer/drag/update.d.ts +2 -2
- package/dist/extensions/first-party/main-renderer/drag/update.js +1 -1
- package/dist/extensions/first-party/main-renderer/factory.d.ts +1 -1
- package/dist/extensions/first-party/main-renderer/factory.js +9 -9
- package/dist/extensions/first-party/main-renderer/normalize.d.ts +2 -2
- package/dist/extensions/first-party/main-renderer/normalize.js +3 -3
- package/dist/extensions/first-party/main-renderer/pieces/factory.d.ts +2 -2
- package/dist/extensions/first-party/main-renderer/pieces/factory.js +2 -2
- package/dist/extensions/first-party/main-renderer/pieces/render.d.ts +2 -2
- package/dist/extensions/first-party/main-renderer/pieces/render.js +4 -4
- package/dist/extensions/first-party/main-renderer/pieces/suppress.d.ts +4 -4
- package/dist/extensions/first-party/main-renderer/pieces/types.d.ts +5 -5
- package/dist/extensions/first-party/main-renderer/pieces/update.d.ts +4 -4
- package/dist/extensions/first-party/main-renderer/pieces/update.js +5 -5
- package/dist/extensions/first-party/main-renderer/types/extension.d.ts +2 -2
- package/dist/extensions/first-party/main-renderer/types/input.d.ts +2 -2
- package/dist/extensions/first-party/main-renderer/types/instance.d.ts +8 -8
- package/dist/extensions/first-party/main-renderer/types/internal.d.ts +2 -2
- package/dist/extensions/first-party/main-renderer/types/template.d.ts +1 -1
- package/dist/extensions/first-party/selected-square/factory.d.ts +1 -1
- package/dist/extensions/first-party/selected-square/factory.js +4 -4
- package/dist/extensions/first-party/selected-square/types.d.ts +2 -2
- package/dist/extensions/index.d.ts +8 -8
- package/dist/extensions/index.js +6 -6
- package/dist/extensions/invalidation/factory.d.ts +1 -1
- package/dist/extensions/types/basic/events.d.ts +2 -2
- package/dist/extensions/types/basic/render.d.ts +2 -2
- package/dist/extensions/types/basic/transient-visuals.d.ts +1 -1
- package/dist/extensions/types/basic/update.d.ts +3 -3
- package/dist/extensions/types/context/animation.d.ts +3 -3
- package/dist/extensions/types/context/render.d.ts +2 -2
- package/dist/extensions/types/context/transient-visuals.d.ts +2 -2
- package/dist/extensions/types/context/ui-move.d.ts +2 -2
- package/dist/extensions/types/context/update.d.ts +4 -4
- package/dist/extensions/types/context/update.js +1 -1
- package/dist/extensions/types/extension.d.ts +8 -8
- package/dist/extensions/types/main.d.ts +8 -8
- package/dist/extensions/types/surface/commands.d.ts +5 -5
- package/dist/extensions/types/surface/events.d.ts +1 -1
- package/dist/extensions/types/surface/main.d.ts +4 -4
- package/dist/extensions/types/wrapper.d.ts +6 -6
- package/dist/extensions/update.d.ts +2 -2
- package/dist/extensions/update.js +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1 -1
- package/dist/layout/factory.d.ts +1 -1
- package/dist/layout/factory.js +1 -1
- package/dist/layout/geometry/factory.d.ts +2 -2
- package/dist/layout/geometry/factory.js +1 -1
- package/dist/layout/geometry/types.d.ts +1 -1
- package/dist/layout/mutation.d.ts +1 -1
- package/dist/layout/reducers.d.ts +1 -1
- package/dist/layout/reducers.js +2 -2
- package/dist/layout/types.d.ts +3 -3
- package/dist/mutation/pipeline.d.ts +1 -1
- package/dist/mutation/pipeline.js +1 -1
- package/dist/mutation/session.d.ts +1 -1
- package/dist/render/factory.d.ts +1 -1
- package/dist/render/factory.js +7 -7
- package/dist/render/mount.d.ts +1 -1
- package/dist/render/mount.js +2 -2
- package/dist/render/rendering/animation.d.ts +1 -1
- package/dist/render/rendering/animation.js +1 -1
- package/dist/render/rendering/helpers.d.ts +1 -1
- package/dist/render/rendering/state.d.ts +2 -2
- package/dist/render/rendering/state.js +2 -2
- package/dist/render/rendering/visuals.d.ts +2 -2
- package/dist/render/rendering/visuals.js +1 -1
- package/dist/render/scheduler/scheduler.d.ts +1 -1
- package/dist/render/svg/factory.d.ts +2 -2
- package/dist/render/svg/factory.js +1 -1
- package/dist/render/svg/helpers.d.ts +1 -1
- package/dist/render/svg/helpers.js +1 -1
- package/dist/render/types.d.ts +5 -5
- package/dist/runtime/factory/helpers.d.ts +2 -2
- package/dist/runtime/factory/helpers.js +3 -3
- package/dist/runtime/factory/input.d.ts +2 -2
- package/dist/runtime/factory/input.js +3 -3
- package/dist/runtime/factory/main.d.ts +1 -1
- package/dist/runtime/factory/main.js +12 -12
- package/dist/runtime/factory/ui-move.d.ts +3 -3
- package/dist/runtime/input/adapter/factory.d.ts +1 -1
- package/dist/runtime/input/adapter/factory.js +1 -1
- package/dist/runtime/input/adapter/helpers.d.ts +3 -3
- package/dist/runtime/input/adapter/pointer.d.ts +2 -2
- package/dist/runtime/input/adapter/pointer.js +2 -2
- package/dist/runtime/input/adapter/types.d.ts +2 -2
- package/dist/runtime/input/controller/factory.d.ts +1 -1
- package/dist/runtime/input/controller/factory.js +2 -2
- package/dist/runtime/input/controller/helpers.d.ts +2 -2
- package/dist/runtime/input/controller/pointer.d.ts +2 -2
- package/dist/runtime/input/controller/pointer.js +3 -3
- package/dist/runtime/input/controller/transient-visuals.d.ts +2 -2
- package/dist/runtime/input/controller/types.d.ts +4 -4
- package/dist/runtime/layout.d.ts +1 -1
- package/dist/runtime/layout.js +2 -2
- package/dist/runtime/lifecycle.d.ts +2 -2
- package/dist/runtime/lifecycle.js +2 -2
- package/dist/runtime/mutation/extension-update.d.ts +1 -1
- package/dist/runtime/mutation/factory.d.ts +1 -1
- package/dist/runtime/mutation/factory.js +6 -6
- package/dist/runtime/mutation/interaction.d.ts +1 -1
- package/dist/runtime/mutation/interaction.js +2 -2
- package/dist/runtime/mutation/invalidation.d.ts +1 -0
- package/dist/runtime/mutation/invalidation.js +1 -1
- package/dist/runtime/mutation/last-move.d.ts +1 -1
- package/dist/runtime/mutation/layout.d.ts +1 -1
- package/dist/runtime/mutation/pipeline.d.ts +6 -6
- package/dist/runtime/mutation/request-render.d.ts +1 -1
- package/dist/runtime/mutation/request-render.js +1 -1
- package/dist/runtime/mutation/run.d.ts +1 -1
- package/dist/runtime/mutation/types.d.ts +6 -6
- package/dist/runtime/types/main.d.ts +6 -6
- package/dist/runtime/types/ui-move.d.ts +3 -3
- package/dist/state/board/check.d.ts +3 -3
- package/dist/state/board/check.js +1 -1
- package/dist/state/board/coords.d.ts +1 -1
- package/dist/state/board/denormalize.d.ts +3 -3
- package/dist/state/board/denormalize.js +4 -4
- package/dist/state/board/factory.d.ts +2 -2
- package/dist/state/board/factory.js +4 -4
- package/dist/state/board/mutation.d.ts +2 -2
- package/dist/state/board/normalize.d.ts +2 -2
- package/dist/state/board/normalize.js +2 -2
- package/dist/state/board/piece.d.ts +1 -1
- package/dist/state/board/position.d.ts +2 -2
- package/dist/state/board/position.js +2 -2
- package/dist/state/board/reducers.d.ts +2 -2
- package/dist/state/board/reducers.js +3 -3
- package/dist/state/board/types/input.d.ts +1 -1
- package/dist/state/board/types/internal.d.ts +1 -1
- package/dist/state/board/types/main.d.ts +3 -3
- package/dist/state/board/types/output.d.ts +2 -2
- package/dist/state/change/factory.d.ts +1 -1
- package/dist/state/change/factory.js +1 -1
- package/dist/state/change/helpers.d.ts +3 -3
- package/dist/state/change/helpers.js +1 -1
- package/dist/state/change/mutation.d.ts +1 -1
- package/dist/state/change/reducers.d.ts +3 -3
- package/dist/state/change/reducers.js +1 -1
- package/dist/state/change/types.d.ts +3 -3
- package/dist/state/factory.d.ts +1 -1
- package/dist/state/factory.js +4 -4
- package/dist/state/interaction/factory.d.ts +1 -1
- package/dist/state/interaction/factory.js +3 -3
- package/dist/state/interaction/helpers.d.ts +2 -2
- package/dist/state/interaction/helpers.js +2 -2
- package/dist/state/interaction/movability.d.ts +3 -3
- package/dist/state/interaction/movability.js +2 -2
- package/dist/state/interaction/mutation.d.ts +1 -1
- package/dist/state/interaction/normalize.d.ts +2 -2
- package/dist/state/interaction/normalize.js +2 -2
- package/dist/state/interaction/reducers.d.ts +3 -3
- package/dist/state/interaction/reducers.js +3 -3
- package/dist/state/interaction/types/input.d.ts +1 -1
- package/dist/state/interaction/types/internal.d.ts +1 -1
- package/dist/state/interaction/types/main.d.ts +4 -4
- package/dist/state/types.d.ts +6 -6
- package/dist/state/view/factory.d.ts +1 -1
- package/dist/state/view/factory.js +2 -2
- package/dist/state/view/mutation.d.ts +1 -1
- package/dist/state/view/reducers.d.ts +2 -2
- package/dist/state/view/types/internal.d.ts +1 -1
- package/dist/state/view/types/main.d.ts +4 -4
- package/dist/wrapper/factory.d.ts +2 -2
- package/dist/wrapper/factory.js +8 -8
- package/dist/wrapper/types.d.ts +4 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Square } from '../state/board/types/internal';
|
|
2
|
-
import { BoardStateSnapshot } from '../state/board/types/main';
|
|
3
|
-
import { AnimationPlan, AnimationTrack, CalculateAnimationTracksOptions } from './types';
|
|
1
|
+
import { Square } from '../state/board/types/internal.js';
|
|
2
|
+
import { BoardStateSnapshot } from '../state/board/types/main.js';
|
|
3
|
+
import { AnimationPlan, AnimationTrack, CalculateAnimationTracksOptions } from './types.js';
|
|
4
4
|
export declare function collectSuppressedSquares(tracks: AnimationTrack[]): ReadonlySet<Square>;
|
|
5
5
|
export declare function calculateAnimationTracks(pos1: BoardStateSnapshot, pos2: BoardStateSnapshot, options?: CalculateAnimationTracksOptions): AnimationTrack[];
|
|
6
6
|
export declare function calculateAnimationPlan(pos1: BoardStateSnapshot, pos2: BoardStateSnapshot, sessionId: number, options?: CalculateAnimationTracksOptions): AnimationPlan;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { isNonEmptyPieceCode } from '../state/board/check';
|
|
2
|
-
import { fileOf, rankOf } from '../state/board/coords';
|
|
3
|
-
import { SQUARE_COUNT } from '../state/board/types/internal';
|
|
4
|
-
import { isMoveExclude, isSquareExclude } from './types';
|
|
1
|
+
import { isNonEmptyPieceCode } from '../state/board/check.js';
|
|
2
|
+
import { fileOf, rankOf } from '../state/board/coords.js';
|
|
3
|
+
import { SQUARE_COUNT } from '../state/board/types/internal.js';
|
|
4
|
+
import { isMoveExclude, isSquareExclude } from './types.js';
|
|
5
5
|
// Precomputed squared distance: (dFile² + dRank²) for all square pairs.
|
|
6
6
|
// Max value = 7² + 7² = 98, fits in Uint8. Index: a * 64 + b.
|
|
7
7
|
const SQUARE_DIST = new Uint8Array(SQUARE_COUNT * SQUARE_COUNT);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { PieceUrls } from '../../extensions/first-party/main-renderer/types/internal';
|
|
2
|
-
import type { RenderGeometry } from '../../layout/geometry/types';
|
|
3
|
-
import type { AnimationTrackFade } from '../types';
|
|
4
|
-
import type { PreparedFadeNode } from './types';
|
|
1
|
+
import type { PieceUrls } from '../../extensions/first-party/main-renderer/types/internal.js';
|
|
2
|
+
import type { RenderGeometry } from '../../layout/geometry/types.js';
|
|
3
|
+
import type { AnimationTrackFade } from '../types.js';
|
|
4
|
+
import type { PreparedFadeNode } from './types.js';
|
|
5
5
|
export declare function prepareFadeTrack(track: AnimationTrackFade, geometry: RenderGeometry, pieceUrls: PieceUrls, layer: SVGElement): PreparedFadeNode;
|
|
6
6
|
export declare function renderFadeTrack(node: PreparedFadeNode, progress: number): void;
|
|
7
7
|
export declare function cleanFadeTrack(node: PreparedFadeNode): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createSvgElement, updateElementAttributes } from '../../render/svg/helpers';
|
|
1
|
+
import { createSvgElement, updateElementAttributes } from '../../render/svg/helpers.js';
|
|
2
2
|
export function prepareFadeTrack(track, geometry, pieceUrls, layer) {
|
|
3
3
|
const r = geometry.squareRect(track.sq);
|
|
4
4
|
const url = pieceUrls[track.pieceCode];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { PieceUrls } from '../../extensions/first-party/main-renderer/types/internal';
|
|
2
|
-
import type { RenderGeometry } from '../../layout/geometry/types';
|
|
3
|
-
import type { AnimationTrackMove } from '../types';
|
|
4
|
-
import type { PreparedMoveNode } from './types';
|
|
1
|
+
import type { PieceUrls } from '../../extensions/first-party/main-renderer/types/internal.js';
|
|
2
|
+
import type { RenderGeometry } from '../../layout/geometry/types.js';
|
|
3
|
+
import type { AnimationTrackMove } from '../types.js';
|
|
4
|
+
import type { PreparedMoveNode } from './types.js';
|
|
5
5
|
export declare function prepareMoveTrack(track: AnimationTrackMove, geometry: RenderGeometry, pieceUrls: PieceUrls, layer: SVGElement): PreparedMoveNode;
|
|
6
6
|
export declare function renderMoveTrack(node: PreparedMoveNode, geometry: RenderGeometry, progress: number): void;
|
|
7
7
|
export declare function cleanMoveTrack(node: PreparedMoveNode): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createSvgElement, updateElementAttributes } from '../../render/svg/helpers';
|
|
1
|
+
import { createSvgElement, updateElementAttributes } from '../../render/svg/helpers.js';
|
|
2
2
|
export function prepareMoveTrack(track, geometry, pieceUrls, layer) {
|
|
3
3
|
const r = geometry.squareRect(track.fromSq);
|
|
4
4
|
const url = pieceUrls[track.pieceCode];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { PieceUrls } from '../../extensions/first-party/main-renderer/types/internal';
|
|
2
|
-
import type { RenderGeometry } from '../../layout/geometry/types';
|
|
3
|
-
import type { AnimationPlan } from '../types';
|
|
4
|
-
import type { PreparedNodeMap } from './types';
|
|
1
|
+
import type { PieceUrls } from '../../extensions/first-party/main-renderer/types/internal.js';
|
|
2
|
+
import type { RenderGeometry } from '../../layout/geometry/types.js';
|
|
3
|
+
import type { AnimationPlan } from '../types.js';
|
|
4
|
+
import type { PreparedNodeMap } from './types.js';
|
|
5
5
|
/**
|
|
6
6
|
* Prepare all tracks in the plan — creates SVG nodes in `layer` for each track.
|
|
7
7
|
* Returns a map keyed by track id for use in render/clean passes.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { cleanFadeTrack, prepareFadeTrack, renderFadeTrack } from './fade';
|
|
2
|
-
import { cleanMoveTrack, prepareMoveTrack, renderMoveTrack } from './move';
|
|
3
|
-
import { cleanStaticTrack, prepareStaticTrack, renderStaticTrack } from './static';
|
|
1
|
+
import { cleanFadeTrack, prepareFadeTrack, renderFadeTrack } from './fade.js';
|
|
2
|
+
import { cleanMoveTrack, prepareMoveTrack, renderMoveTrack } from './move.js';
|
|
3
|
+
import { cleanStaticTrack, prepareStaticTrack, renderStaticTrack } from './static.js';
|
|
4
4
|
/**
|
|
5
5
|
* Prepare all tracks in the plan — creates SVG nodes in `layer` for each track.
|
|
6
6
|
* Returns a map keyed by track id for use in render/clean passes.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { PieceUrls } from '../../extensions/first-party/main-renderer/types/internal';
|
|
2
|
-
import type { RenderGeometry } from '../../layout/geometry/types';
|
|
3
|
-
import type { AnimationTrackStatic } from '../types';
|
|
4
|
-
import type { PreparedStaticNode } from './types';
|
|
1
|
+
import type { PieceUrls } from '../../extensions/first-party/main-renderer/types/internal.js';
|
|
2
|
+
import type { RenderGeometry } from '../../layout/geometry/types.js';
|
|
3
|
+
import type { AnimationTrackStatic } from '../types.js';
|
|
4
|
+
import type { PreparedStaticNode } from './types.js';
|
|
5
5
|
export declare function prepareStaticTrack(track: AnimationTrackStatic, geometry: RenderGeometry, pieceUrls: PieceUrls, layer: SVGElement): PreparedStaticNode;
|
|
6
6
|
export declare function renderStaticTrack(_node: PreparedStaticNode): void;
|
|
7
7
|
export declare function cleanStaticTrack(node: PreparedStaticNode): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createSvgElement } from '../../render/svg/helpers';
|
|
1
|
+
import { createSvgElement } from '../../render/svg/helpers.js';
|
|
2
2
|
export function prepareStaticTrack(track, geometry, pieceUrls, layer) {
|
|
3
3
|
const r = geometry.squareRect(track.sq);
|
|
4
4
|
const url = pieceUrls[track.pieceCode];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AnimationTrack, AnimationTrackFade, AnimationTrackMove, AnimationTrackStatic } from '../types';
|
|
1
|
+
import type { AnimationTrack, AnimationTrackFade, AnimationTrackMove, AnimationTrackStatic } from '../types.js';
|
|
2
2
|
/** Prepared node for a move track — holds the SVG image and its track. */
|
|
3
3
|
export interface PreparedMoveNode extends AnimationTrackMove {
|
|
4
4
|
root: SVGImageElement;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReadonlyDeep } from 'type-fest';
|
|
2
|
-
import type { NonEmptyPieceCode, Square } from '../state/board/types/internal';
|
|
2
|
+
import type { NonEmptyPieceCode, Square } from '../state/board/types/internal.js';
|
|
3
3
|
export interface AnimationTrackMove {
|
|
4
4
|
id: number;
|
|
5
5
|
pieceCode: NonEmptyPieceCode;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ExtensionAnimationControllerInternalSurface, ExtensionAnimationSessionInternalSurface, ExtensionAnimationSessionSubmitOptions } from '../types/basic/animation';
|
|
1
|
+
import { ExtensionAnimationControllerInternalSurface, ExtensionAnimationSessionInternalSurface, ExtensionAnimationSessionSubmitOptions } from '../types/basic/animation.js';
|
|
2
2
|
export declare function createExtensionAnimationSession(id: number, options: ExtensionAnimationSessionSubmitOptions): ExtensionAnimationSessionInternalSurface;
|
|
3
3
|
export declare function createExtensionAnimationController(): ExtensionAnimationControllerInternalSurface;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExtensionAnimationSessionInternalSurface, ExtensionAnimationSessionStatus } from '../types/basic/animation';
|
|
1
|
+
import { ExtensionAnimationSessionInternalSurface, ExtensionAnimationSessionStatus } from '../types/basic/animation.js';
|
|
2
2
|
export interface ExtensionAnimationSessionInternal {
|
|
3
3
|
readonly id: number;
|
|
4
4
|
readonly startTime: DOMHighResTimeStamp;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ExtensionSystem, ExtensionSystemInitOptions } from '../types/main';
|
|
1
|
+
import { ExtensionSystem, ExtensionSystemInitOptions } from '../types/main.js';
|
|
2
2
|
export declare function createExtensionSystem(options: ExtensionSystemInitOptions): ExtensionSystem;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { createExtensionAnimationController } from '../animation/factory';
|
|
2
|
-
import { createExtensionInvalidationState } from '../invalidation/factory';
|
|
3
|
-
import { extensionSystemUpdateState, extensionSystemUpdateUIMoveRequest } from '../update';
|
|
4
|
-
import { createExtensionRuntimeSurface } from './runtime';
|
|
1
|
+
import { createExtensionAnimationController } from '../animation/factory.js';
|
|
2
|
+
import { createExtensionInvalidationState } from '../invalidation/factory.js';
|
|
3
|
+
import { extensionSystemUpdateState, extensionSystemUpdateUIMoveRequest } from '../update.js';
|
|
4
|
+
import { createExtensionRuntimeSurface } from './runtime.js';
|
|
5
5
|
function createExtensionSystemInternal(getInternalState, options) {
|
|
6
6
|
const extensions = new Map();
|
|
7
7
|
const extensionsArray = options.extensions ?? [];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AnyExtensionDefinition } from '../types/extension';
|
|
2
|
-
import type { GetInternalState } from '../types/main';
|
|
3
|
-
import type { ExtensionRuntimeSurfaceCommands } from '../types/surface/commands';
|
|
4
|
-
import type { ExtensionRuntimeSurface } from '../types/surface/main';
|
|
1
|
+
import type { AnyExtensionDefinition } from '../types/extension.js';
|
|
2
|
+
import type { GetInternalState } from '../types/main.js';
|
|
3
|
+
import type { ExtensionRuntimeSurfaceCommands } from '../types/surface/commands.js';
|
|
4
|
+
import type { ExtensionRuntimeSurface } from '../types/surface/main.js';
|
|
5
5
|
export declare function createExtensionRuntimeSurface(getInternalState: GetInternalState, commands: ExtensionRuntimeSurfaceCommands, extensionDef: AnyExtensionDefinition): ExtensionRuntimeSurface;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ActiveTargetDefinition, ActiveTargetInitConfig } from './types';
|
|
1
|
+
import { ActiveTargetDefinition, ActiveTargetInitConfig } from './types.js';
|
|
2
2
|
export declare function createActiveTarget(config?: ActiveTargetInitConfig): ActiveTargetDefinition;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import assert from '@ktarmyshov/assert';
|
|
2
2
|
import { toMerged } from 'es-toolkit';
|
|
3
|
-
import { createSvgElement, updateElementAttributes } from '../../../render/svg/helpers';
|
|
4
|
-
import { isUpdateContextRenderable } from '../../types/context/update';
|
|
5
|
-
import { extensionCreateInternalBase, extensionDestroy, extensionMount, extensionUnmount } from '../common/helpers';
|
|
6
|
-
import { DEFAULT_CONFIG, EXTENSION_ID, EXTENSION_SLOTS } from './types';
|
|
3
|
+
import { createSvgElement, updateElementAttributes } from '../../../render/svg/helpers.js';
|
|
4
|
+
import { isUpdateContextRenderable } from '../../types/context/update.js';
|
|
5
|
+
import { extensionCreateInternalBase, extensionDestroy, extensionMount, extensionUnmount } from '../common/helpers.js';
|
|
6
|
+
import { DEFAULT_CONFIG, EXTENSION_ID, EXTENSION_SLOTS } from './types.js';
|
|
7
7
|
export function createActiveTarget(config = {}) {
|
|
8
8
|
const mergedConfig = toMerged(DEFAULT_CONFIG, config);
|
|
9
9
|
return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PartialDeep } from 'type-fest';
|
|
2
|
-
import { ExtensionDefinition, ExtensionInstance } from '../../types/extension';
|
|
3
|
-
import { ExtensionInternal, OpaqueColor } from '../common/types';
|
|
2
|
+
import { ExtensionDefinition, ExtensionInstance } from '../../types/extension.js';
|
|
3
|
+
import { ExtensionInternal, OpaqueColor } from '../common/types.js';
|
|
4
4
|
export declare const EXTENSION_SLOTS: readonly ["underPieces", "overPieces"];
|
|
5
5
|
export type ExtensionSlotsType = typeof EXTENSION_SLOTS;
|
|
6
6
|
export declare const EXTENSION_ID: "activeTarget";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { BoardEventsDefinition } from './types';
|
|
1
|
+
import { BoardEventsDefinition } from './types.js';
|
|
2
2
|
export declare function createBoardEvents(): BoardEventsDefinition;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { denormalizeMove } from '../../../state/board/denormalize';
|
|
2
|
-
import { extensionCreateInternalBase, extensionDestroy, extensionUnmount } from '../common/helpers';
|
|
3
|
-
import { EXTENSION_ID, EXTENSION_SLOTS } from './types';
|
|
1
|
+
import { denormalizeMove } from '../../../state/board/denormalize.js';
|
|
2
|
+
import { extensionCreateInternalBase, extensionDestroy, extensionMount, extensionUnmount } from '../common/helpers.js';
|
|
3
|
+
import { EXTENSION_ID, EXTENSION_SLOTS } from './types.js';
|
|
4
4
|
export function createBoardEvents() {
|
|
5
5
|
return {
|
|
6
6
|
id: EXTENSION_ID,
|
|
@@ -36,7 +36,9 @@ function createBoardEventsInstance() {
|
|
|
36
36
|
const publicInterface = createBoardEventsInstancePublic(internalState);
|
|
37
37
|
return {
|
|
38
38
|
id: EXTENSION_ID,
|
|
39
|
-
mount() {
|
|
39
|
+
mount(env) {
|
|
40
|
+
extensionMount(internalState, env.slotRoots);
|
|
41
|
+
},
|
|
40
42
|
onUpdate(context) {
|
|
41
43
|
if (internalState.onRawUpdate) {
|
|
42
44
|
internalState.onRawUpdate({
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { RuntimeReadonlyMutationSession } from '../../../runtime/mutation/types';
|
|
2
|
-
import { MoveOutput } from '../../../state/board/types/output';
|
|
3
|
-
import { ExtensionSlotSvgRoots } from '../../types/basic/mount';
|
|
4
|
-
import { UpdateFrameSnapshot } from '../../types/basic/update';
|
|
5
|
-
import { ExtensionDefinition, ExtensionInstance } from '../../types/extension';
|
|
6
|
-
import { ExtensionInternal } from '../common/types';
|
|
1
|
+
import { RuntimeReadonlyMutationSession } from '../../../runtime/mutation/types.js';
|
|
2
|
+
import { MoveOutput } from '../../../state/board/types/output.js';
|
|
3
|
+
import { ExtensionSlotSvgRoots } from '../../types/basic/mount.js';
|
|
4
|
+
import { UpdateFrameSnapshot } from '../../types/basic/update.js';
|
|
5
|
+
import { ExtensionDefinition, ExtensionInstance } from '../../types/extension.js';
|
|
6
|
+
import { ExtensionInternal } from '../common/types.js';
|
|
7
7
|
export declare const EXTENSION_SLOTS: readonly [];
|
|
8
8
|
export type ExtensionSlotsType = typeof EXTENSION_SLOTS;
|
|
9
9
|
export declare const EXTENSION_ID: "events";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ExtensionSlotName } from '../../types/basic/mount';
|
|
2
|
-
import { ExtensionInternal } from './types';
|
|
1
|
+
import { ExtensionSlotName } from '../../types/basic/mount.js';
|
|
2
|
+
import { ExtensionInternal } from './types.js';
|
|
3
3
|
export declare function extensionCreateInternalBase<TSlots extends readonly ExtensionSlotName[]>(): ExtensionInternal<TSlots>;
|
|
4
4
|
export declare function extensionIsMounted<TSlots extends readonly ExtensionSlotName[]>(state: ExtensionInternal<TSlots>): boolean;
|
|
5
5
|
export declare function extensionIsDestroyed<TSlots extends readonly ExtensionSlotName[]>(state: ExtensionInternal<TSlots>): boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExtensionSlotName, ExtensionSlotSvgRoots } from '../../types/basic/mount';
|
|
1
|
+
import { ExtensionSlotName, ExtensionSlotSvgRoots } from '../../types/basic/mount.js';
|
|
2
2
|
export interface ExtensionInternal<TSlots extends readonly ExtensionSlotName[]> {
|
|
3
3
|
slotRoots: ExtensionSlotSvgRoots<TSlots> | null;
|
|
4
4
|
destroyed: boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { LastMoveDefinition, LastMoveInitConfig } from './types';
|
|
1
|
+
import { LastMoveDefinition, LastMoveInitConfig } from './types.js';
|
|
2
2
|
export declare function createLastMove(config?: LastMoveInitConfig): LastMoveDefinition;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import assert from '@ktarmyshov/assert';
|
|
2
2
|
import { toMerged } from 'es-toolkit';
|
|
3
|
-
import { createSvgElement, updateElementAttributes } from '../../../render/svg/helpers';
|
|
4
|
-
import { isUpdateContextRenderable } from '../../types/context/update';
|
|
5
|
-
import { extensionCreateInternalBase, extensionDestroy, extensionMount, extensionUnmount } from '../common/helpers';
|
|
6
|
-
import { DEFAULT_CONFIG, EXTENSION_ID, EXTENSION_SLOTS } from './types';
|
|
3
|
+
import { createSvgElement, updateElementAttributes } from '../../../render/svg/helpers.js';
|
|
4
|
+
import { isUpdateContextRenderable } from '../../types/context/update.js';
|
|
5
|
+
import { extensionCreateInternalBase, extensionDestroy, extensionMount, extensionUnmount } from '../common/helpers.js';
|
|
6
|
+
import { DEFAULT_CONFIG, EXTENSION_ID, EXTENSION_SLOTS } from './types.js';
|
|
7
7
|
export function createLastMove(config = {}) {
|
|
8
8
|
const mergedConfig = toMerged(DEFAULT_CONFIG, config);
|
|
9
9
|
return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PartialDeep } from 'type-fest';
|
|
2
|
-
import { ExtensionDefinition, ExtensionInstance } from '../../types/extension';
|
|
3
|
-
import { ExtensionInternal, OpaqueColor } from '../common/types';
|
|
2
|
+
import { ExtensionDefinition, ExtensionInstance } from '../../types/extension.js';
|
|
3
|
+
import { ExtensionInternal, OpaqueColor } from '../common/types.js';
|
|
4
4
|
export declare const EXTENSION_SLOTS: readonly ["underPieces"];
|
|
5
5
|
export type ExtensionSlotsType = typeof EXTENSION_SLOTS;
|
|
6
6
|
export declare const EXTENSION_ID: "lastMove";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { LegalMovesDefinition, LegalMovesInitConfig } from './types';
|
|
1
|
+
import { LegalMovesDefinition, LegalMovesInitConfig } from './types.js';
|
|
2
2
|
export declare function createLegalMoves(config?: LegalMovesInitConfig): LegalMovesDefinition;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import assert from '@ktarmyshov/assert';
|
|
2
2
|
import { toMerged } from 'es-toolkit';
|
|
3
|
-
import { clearElementChildren, createSvgElement } from '../../../render/svg/helpers';
|
|
4
|
-
import { isNonEmptyPieceCode } from '../../../state/board/check';
|
|
5
|
-
import { fromPieceCode } from '../../../state/board/piece';
|
|
6
|
-
import { isUpdateContextRenderable } from '../../types/context/update';
|
|
7
|
-
import { extensionCreateInternalBase, extensionDestroy, extensionMount, extensionUnmount } from '../common/helpers';
|
|
8
|
-
import { DEFAULT_CONFIG, EXTENSION_ID, EXTENSION_SLOTS } from './types';
|
|
3
|
+
import { clearElementChildren, createSvgElement } from '../../../render/svg/helpers.js';
|
|
4
|
+
import { isNonEmptyPieceCode } from '../../../state/board/check.js';
|
|
5
|
+
import { fromPieceCode } from '../../../state/board/piece.js';
|
|
6
|
+
import { isUpdateContextRenderable } from '../../types/context/update.js';
|
|
7
|
+
import { extensionCreateInternalBase, extensionDestroy, extensionMount, extensionUnmount } from '../common/helpers.js';
|
|
8
|
+
import { DEFAULT_CONFIG, EXTENSION_ID, EXTENSION_SLOTS } from './types.js';
|
|
9
9
|
export function createLegalMoves(config = {}) {
|
|
10
10
|
const mergedConfig = toMerged(DEFAULT_CONFIG, config);
|
|
11
11
|
return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PartialDeep } from 'type-fest';
|
|
2
|
-
import { ExtensionDefinition, ExtensionInstance } from '../../types/extension';
|
|
3
|
-
import { ExtensionInternal, OpaqueColor } from '../common/types';
|
|
2
|
+
import { ExtensionDefinition, ExtensionInstance } from '../../types/extension.js';
|
|
3
|
+
import { ExtensionInternal, OpaqueColor } from '../common/types.js';
|
|
4
4
|
export declare const EXTENSION_SLOTS: readonly ["overPieces"];
|
|
5
5
|
export type ExtensionSlotsType = typeof EXTENSION_SLOTS;
|
|
6
6
|
export declare const EXTENSION_ID: "legalMoves";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ExtensionRuntimeSurface } from '../../../types/surface/main';
|
|
2
|
-
import type { PieceUrls } from '../types/internal';
|
|
3
|
-
import type { MainRendererAnimation } from './types';
|
|
1
|
+
import type { ExtensionRuntimeSurface } from '../../../types/surface/main.js';
|
|
2
|
+
import type { PieceUrls } from '../types/internal.js';
|
|
3
|
+
import type { MainRendererAnimation } from './types.js';
|
|
4
4
|
export declare function createMainRendererAnimation(config: PieceUrls, runtimeSurface: ExtensionRuntimeSurface): MainRendererAnimation;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { cleanAnimationPlan } from '../../../../animation/render/plan';
|
|
2
|
-
import { getAnimationSuppressedSquares, rendererAnimationClean, rendererAnimationPrepare, rendererAnimationRender } from './render';
|
|
3
|
-
import { rendererAnimationOnUpdate } from './update';
|
|
1
|
+
import { cleanAnimationPlan } from '../../../../animation/render/plan.js';
|
|
2
|
+
import { getAnimationSuppressedSquares, rendererAnimationClean, rendererAnimationPrepare, rendererAnimationRender } from './render.js';
|
|
3
|
+
import { rendererAnimationOnUpdate } from './update.js';
|
|
4
4
|
export function createMainRendererAnimation(config, runtimeSurface) {
|
|
5
5
|
const state = {
|
|
6
6
|
config,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Square } from '../../../../state/board/types/internal';
|
|
2
|
-
import type { ExtensionCleanAnimationContext, ExtensionPrepareAnimationContext, ExtensionRenderAnimationContext } from '../../../types/context/animation';
|
|
3
|
-
import type { MainRendererAnimationInternal } from './types';
|
|
1
|
+
import type { Square } from '../../../../state/board/types/internal.js';
|
|
2
|
+
import type { ExtensionCleanAnimationContext, ExtensionPrepareAnimationContext, ExtensionRenderAnimationContext } from '../../../types/context/animation.js';
|
|
3
|
+
import type { MainRendererAnimationInternal } from './types.js';
|
|
4
4
|
export declare function rendererAnimationPrepare(state: MainRendererAnimationInternal, context: ExtensionPrepareAnimationContext, layer: SVGElement): void;
|
|
5
5
|
export declare function rendererAnimationRender(state: MainRendererAnimationInternal, context: ExtensionRenderAnimationContext): void;
|
|
6
6
|
export declare function rendererAnimationClean(state: MainRendererAnimationInternal, context: ExtensionCleanAnimationContext): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { collectSuppressedSquares } from '../../../../animation/planner';
|
|
2
|
-
import { cleanAnimationPlan, prepareAnimationPlan, renderAnimationPlan } from '../../../../animation/render/plan';
|
|
1
|
+
import { collectSuppressedSquares } from '../../../../animation/planner.js';
|
|
2
|
+
import { cleanAnimationPlan, prepareAnimationPlan, renderAnimationPlan } from '../../../../animation/render/plan.js';
|
|
3
3
|
const EMPTY_SQUARES = new Set();
|
|
4
4
|
export function rendererAnimationPrepare(state, context, layer) {
|
|
5
5
|
for (const session of context.submittedSessions) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { PreparedNodeMap } from '../../../../animation/render/types';
|
|
2
|
-
import { AnimationPlan } from '../../../../animation/types';
|
|
3
|
-
import { Square } from '../../../../state/board/types/internal';
|
|
4
|
-
import { ExtensionCleanAnimationContext, ExtensionPrepareAnimationContext, ExtensionRenderAnimationContext } from '../../../types/context/animation';
|
|
5
|
-
import { ExtensionUpdateContext } from '../../../types/context/update';
|
|
6
|
-
import { ExtensionRuntimeSurface } from '../../../types/surface/main';
|
|
7
|
-
import type { PieceUrls } from '../types/internal';
|
|
1
|
+
import { PreparedNodeMap } from '../../../../animation/render/types.js';
|
|
2
|
+
import { AnimationPlan } from '../../../../animation/types.js';
|
|
3
|
+
import { Square } from '../../../../state/board/types/internal.js';
|
|
4
|
+
import { ExtensionCleanAnimationContext, ExtensionPrepareAnimationContext, ExtensionRenderAnimationContext } from '../../../types/context/animation.js';
|
|
5
|
+
import { ExtensionUpdateContext } from '../../../types/context/update.js';
|
|
6
|
+
import { ExtensionRuntimeSurface } from '../../../types/surface/main.js';
|
|
7
|
+
import type { PieceUrls } from '../types/internal.js';
|
|
8
8
|
export interface MainRendererAnimationEntry {
|
|
9
9
|
plan: AnimationPlan;
|
|
10
10
|
nodes: PreparedNodeMap | null;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ExtensionUpdateContext } from '../../../types/context/update';
|
|
2
|
-
import type { MainRendererAnimationInternal } from './types';
|
|
1
|
+
import { ExtensionUpdateContext } from '../../../types/context/update.js';
|
|
2
|
+
import type { MainRendererAnimationInternal } from './types.js';
|
|
3
3
|
export declare function rendererAnimationOnUpdate(state: MainRendererAnimationInternal, context: ExtensionUpdateContext): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { calculateAnimationPlan } from '../../../../animation/planner';
|
|
2
|
-
import { piecePositionsEqual } from '../../../../state/board/check';
|
|
3
|
-
import { isUpdateContextRenderable } from '../../../types/context/update';
|
|
1
|
+
import { calculateAnimationPlan } from '../../../../animation/planner.js';
|
|
2
|
+
import { piecePositionsEqual } from '../../../../state/board/check.js';
|
|
3
|
+
import { isUpdateContextRenderable } from '../../../types/context/update.js';
|
|
4
4
|
const DEFAULT_ANIMATION_DURATION_MS = 180;
|
|
5
5
|
export function rendererAnimationOnUpdate(state, context) {
|
|
6
6
|
if (!isUpdateContextRenderable(context) ||
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ConfigColorPair } from '../types/internal';
|
|
2
|
-
import { MainRendererBoard } from './types';
|
|
1
|
+
import { ConfigColorPair } from '../types/internal.js';
|
|
2
|
+
import { MainRendererBoard } from './types.js';
|
|
3
3
|
export declare function createMainRendererBoard(config: ConfigColorPair): MainRendererBoard;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { rendererBoardRender } from './render';
|
|
2
|
-
import { rendererBoardOnUpdate } from './update';
|
|
1
|
+
import { rendererBoardRender } from './render.js';
|
|
2
|
+
import { rendererBoardOnUpdate } from './update.js';
|
|
3
3
|
function createMainRendererBoardInternal(config) {
|
|
4
4
|
return { config };
|
|
5
5
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ExtensionRenderContext } from '../../../types/context/render';
|
|
2
|
-
import { MainRendererBoardInternal } from './types';
|
|
1
|
+
import { ExtensionRenderContext } from '../../../types/context/render.js';
|
|
2
|
+
import { MainRendererBoardInternal } from './types.js';
|
|
3
3
|
export declare function rendererBoardRender(state: MainRendererBoardInternal, context: ExtensionRenderContext, layer: SVGElement): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { clearElementChildren, createSvgElement, isLightSquare } from '../../../../render/svg/helpers';
|
|
2
|
-
import { SQUARE_COUNT } from '../../../../state/board/types/internal';
|
|
3
|
-
import { DirtyLayer } from '../types/extension';
|
|
1
|
+
import { clearElementChildren, createSvgElement, isLightSquare } from '../../../../render/svg/helpers.js';
|
|
2
|
+
import { SQUARE_COUNT } from '../../../../state/board/types/internal.js';
|
|
3
|
+
import { DirtyLayer } from '../types/extension.js';
|
|
4
4
|
export function rendererBoardRender(state, context, layer) {
|
|
5
5
|
// Check if we need to render
|
|
6
6
|
if ((context.invalidation.dirtyLayers & DirtyLayer.Board) === 0) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ExtensionRenderContext } from '../../../types/context/render';
|
|
2
|
-
import { ExtensionUpdateContext } from '../../../types/context/update';
|
|
3
|
-
import { ConfigColorPair } from '../types/internal';
|
|
1
|
+
import { ExtensionRenderContext } from '../../../types/context/render.js';
|
|
2
|
+
import { ExtensionUpdateContext } from '../../../types/context/update.js';
|
|
3
|
+
import { ConfigColorPair } from '../types/internal.js';
|
|
4
4
|
export interface MainRendererBoardInternal {
|
|
5
5
|
readonly config: ConfigColorPair;
|
|
6
6
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ExtensionUpdateContext } from '../../../types/context/update';
|
|
2
|
-
import { MainRendererBoardInternal } from './types';
|
|
1
|
+
import { ExtensionUpdateContext } from '../../../types/context/update.js';
|
|
2
|
+
import { MainRendererBoardInternal } from './types.js';
|
|
3
3
|
export declare function rendererBoardOnUpdate(_state: MainRendererBoardInternal, context: ExtensionUpdateContext): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { isFrameRenderable } from '../../../types/basic/update';
|
|
2
|
-
import { isUpdateContextRenderable } from '../../../types/context/update';
|
|
3
|
-
import { DirtyLayer } from '../types/extension';
|
|
1
|
+
import { isFrameRenderable } from '../../../types/basic/update.js';
|
|
2
|
+
import { isUpdateContextRenderable } from '../../../types/context/update.js';
|
|
3
|
+
import { DirtyLayer } from '../types/extension.js';
|
|
4
4
|
export function rendererBoardOnUpdate(_state, context) {
|
|
5
5
|
// Check if geometry changed
|
|
6
6
|
const mutationSession = context.mutation;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ConfigColorPair } from '../types/internal';
|
|
2
|
-
import { MainRendererCoordinates } from './types';
|
|
1
|
+
import { ConfigColorPair } from '../types/internal.js';
|
|
2
|
+
import { MainRendererCoordinates } from './types.js';
|
|
3
3
|
export declare function createMainRendererCoordinates(config: ConfigColorPair): MainRendererCoordinates;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ExtensionRenderContext } from '../../../types/context/render';
|
|
2
|
-
import { MainRendererCoordinatesInternal } from './types';
|
|
1
|
+
import { ExtensionRenderContext } from '../../../types/context/render.js';
|
|
2
|
+
import { MainRendererCoordinatesInternal } from './types.js';
|
|
3
3
|
export declare function rendererCoordinatesRender(state: MainRendererCoordinatesInternal, context: ExtensionRenderContext, layer: SVGElement): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { clearElementChildren, createSvgElement, isLightSquare } from '../../../../render/svg/helpers';
|
|
2
|
-
import { squareOf } from '../../../../state/board/coords';
|
|
3
|
-
import { DirtyLayer } from '../types/extension';
|
|
1
|
+
import { clearElementChildren, createSvgElement, isLightSquare } from '../../../../render/svg/helpers.js';
|
|
2
|
+
import { squareOf } from '../../../../state/board/coords.js';
|
|
3
|
+
import { DirtyLayer } from '../types/extension.js';
|
|
4
4
|
function labelColorForSquare(sq, coordColors) {
|
|
5
5
|
return isLightSquare(sq) ? coordColors.dark : coordColors.light;
|
|
6
6
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ExtensionRenderContext } from '../../../types/context/render';
|
|
2
|
-
import { ConfigColorPair } from '../types/internal';
|
|
1
|
+
import { ExtensionRenderContext } from '../../../types/context/render.js';
|
|
2
|
+
import { ConfigColorPair } from '../types/internal.js';
|
|
3
3
|
export interface MainRendererCoordinatesInternal {
|
|
4
4
|
readonly config: ConfigColorPair;
|
|
5
5
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExtensionRuntimeSurface } from '../../../types/surface/main';
|
|
2
|
-
import { PieceUrls } from '../types/internal';
|
|
3
|
-
import { MainRendererDrag } from './types';
|
|
1
|
+
import { ExtensionRuntimeSurface } from '../../../types/surface/main.js';
|
|
2
|
+
import { PieceUrls } from '../types/internal.js';
|
|
3
|
+
import { MainRendererDrag } from './types.js';
|
|
4
4
|
export declare function createMainRendererDrag(config: PieceUrls, runtimeSurface: ExtensionRuntimeSurface): MainRendererDrag;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { rendererDragRenderTransientVisuals } from './render';
|
|
2
|
-
import { rendererDragOnUpdate } from './update';
|
|
1
|
+
import { rendererDragRenderTransientVisuals } from './render.js';
|
|
2
|
+
import { rendererDragOnUpdate } from './update.js';
|
|
3
3
|
function createMainRendererDragInternal(config, runtimeSurface) {
|
|
4
4
|
return { config, runtimeSurface, isDragActive: false, pieceUrl: null, pieceNode: null };
|
|
5
5
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ExtensionRenderTransientVisualsContext } from '../../../types/context/transient-visuals';
|
|
2
|
-
import { MainRendererDragInternal } from './types';
|
|
1
|
+
import { ExtensionRenderTransientVisualsContext } from '../../../types/context/transient-visuals.js';
|
|
2
|
+
import { MainRendererDragInternal } from './types.js';
|
|
3
3
|
export declare function rendererDragRenderTransientVisuals(state: MainRendererDragInternal, context: ExtensionRenderTransientVisualsContext, layer: SVGElement): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createSvgElement, updateElementAttributes } from '../../../../render/svg/helpers';
|
|
1
|
+
import { createSvgElement, updateElementAttributes } from '../../../../render/svg/helpers.js';
|
|
2
2
|
export function rendererDragRenderTransientVisuals(state, context, layer) {
|
|
3
3
|
const geometry = context.currentFrame.layout.geometry;
|
|
4
4
|
const point = context.transientInput.clampedPoint;
|