@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
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ExtensionRenderTransientVisualsContext } from '../../../types/context/transient-visuals';
|
|
2
|
-
import { ExtensionUpdateContext } from '../../../types/context/update';
|
|
3
|
-
import { ExtensionRuntimeSurface } from '../../../types/surface/main';
|
|
4
|
-
import { PieceUrls } from '../types/internal';
|
|
1
|
+
import { ExtensionRenderTransientVisualsContext } from '../../../types/context/transient-visuals.js';
|
|
2
|
+
import { ExtensionUpdateContext } from '../../../types/context/update.js';
|
|
3
|
+
import { ExtensionRuntimeSurface } from '../../../types/surface/main.js';
|
|
4
|
+
import { PieceUrls } from '../types/internal.js';
|
|
5
5
|
export interface MainRendererDragInternal {
|
|
6
6
|
readonly config: PieceUrls;
|
|
7
7
|
readonly runtimeSurface: ExtensionRuntimeSurface;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ExtensionUpdateContext } from '../../../types/context/update';
|
|
2
|
-
import { MainRendererDragInternal } from './types';
|
|
1
|
+
import { ExtensionUpdateContext } from '../../../types/context/update.js';
|
|
2
|
+
import { MainRendererDragInternal } from './types.js';
|
|
3
3
|
export declare function rendererDragOnUpdate(state: MainRendererDragInternal, context: ExtensionUpdateContext): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import assert from '@ktarmyshov/assert';
|
|
2
|
-
import { isNonEmptyPieceCode } from '../../../../state/board/check';
|
|
2
|
+
import { isNonEmptyPieceCode } from '../../../../state/board/check.js';
|
|
3
3
|
export function rendererDragOnUpdate(state, context) {
|
|
4
4
|
const isLiftedDragActive = context.currentFrame.state.interaction.dragSession?.type === 'lifted-piece-drag';
|
|
5
5
|
if (isLiftedDragActive) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { MainRendererDefinition, MainRendererInitOptions } from './types/extension';
|
|
1
|
+
import { MainRendererDefinition, MainRendererInitOptions } from './types/extension.js';
|
|
2
2
|
export declare function createMainRenderer(options?: MainRendererInitOptions): MainRendererDefinition;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { toMerged } from 'es-toolkit';
|
|
2
|
-
import { extensionCreateInternalBase, extensionDestroy, extensionMount, extensionUnmount } from '../common/helpers';
|
|
3
|
-
import { createMainRendererAnimation } from './animation/factory';
|
|
4
|
-
import { createMainRendererBoard } from './board/factory';
|
|
5
|
-
import { createMainRendererCoordinates } from './coordinates/factory';
|
|
6
|
-
import { createMainRendererDrag } from './drag/factory';
|
|
7
|
-
import { normalizeMainRendererConfig } from './normalize';
|
|
8
|
-
import { createMainRendererPieces } from './pieces/factory';
|
|
9
|
-
import { EXTENSION_ID, EXTENSION_SLOTS } from './types/extension';
|
|
10
|
-
import { DEFAULT_MAIN_RENDERER_CONFIG } from './types/internal';
|
|
2
|
+
import { extensionCreateInternalBase, extensionDestroy, extensionMount, extensionUnmount } from '../common/helpers.js';
|
|
3
|
+
import { createMainRendererAnimation } from './animation/factory.js';
|
|
4
|
+
import { createMainRendererBoard } from './board/factory.js';
|
|
5
|
+
import { createMainRendererCoordinates } from './coordinates/factory.js';
|
|
6
|
+
import { createMainRendererDrag } from './drag/factory.js';
|
|
7
|
+
import { normalizeMainRendererConfig } from './normalize.js';
|
|
8
|
+
import { createMainRendererPieces } from './pieces/factory.js';
|
|
9
|
+
import { EXTENSION_ID, EXTENSION_SLOTS } from './types/extension.js';
|
|
10
|
+
import { DEFAULT_MAIN_RENDERER_CONFIG } from './types/internal.js';
|
|
11
11
|
export function createMainRenderer(options = {}) {
|
|
12
12
|
const config = toMerged(DEFAULT_MAIN_RENDERER_CONFIG, normalizeMainRendererConfig(options));
|
|
13
13
|
return {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MainRendererConfigInput, PieceUrlsInput } from './types/input';
|
|
2
|
-
import { MainRendererConfig, PieceUrls } from './types/internal';
|
|
1
|
+
import { MainRendererConfigInput, PieceUrlsInput } from './types/input.js';
|
|
2
|
+
import { MainRendererConfig, PieceUrls } from './types/internal.js';
|
|
3
3
|
export declare function normalizePieceUrls(input: PieceUrlsInput): PieceUrls;
|
|
4
4
|
export declare function normalizeMainRendererConfig(input: Partial<MainRendererConfigInput>): MainRendererConfig;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import assert from '@ktarmyshov/assert';
|
|
2
|
-
import { normalizePiece } from '../../../state/board/normalize';
|
|
3
|
-
import { ALL_NON_EMPTY_PIECE_CODES } from '../../../state/board/types/internal';
|
|
4
|
-
import { DEFAULT_MAIN_RENDERER_CONFIG } from './types/internal';
|
|
2
|
+
import { normalizePiece } from '../../../state/board/normalize.js';
|
|
3
|
+
import { ALL_NON_EMPTY_PIECE_CODES } from '../../../state/board/types/internal.js';
|
|
4
|
+
import { DEFAULT_MAIN_RENDERER_CONFIG } from './types/internal.js';
|
|
5
5
|
function assertPieceUrlsComplete(pieceUrls) {
|
|
6
6
|
for (const pieceCode of ALL_NON_EMPTY_PIECE_CODES) {
|
|
7
7
|
assert(pieceCode in pieceUrls, `Missing URL for piece code: ${pieceCode}`);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { PieceUrls } from '../types/internal';
|
|
2
|
-
import { MainRendererPieces } from './types';
|
|
1
|
+
import { PieceUrls } from '../types/internal.js';
|
|
2
|
+
import { MainRendererPieces } from './types.js';
|
|
3
3
|
export declare function createMainRendererPieces(config: PieceUrls): MainRendererPieces;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { rendererPiecesRender } from './render';
|
|
2
|
-
import { rendererPiecesOnUpdate, rendererPiecesRefreshSuppressedSquares } from './update';
|
|
1
|
+
import { rendererPiecesRender } from './render.js';
|
|
2
|
+
import { rendererPiecesOnUpdate, rendererPiecesRefreshSuppressedSquares } from './update.js';
|
|
3
3
|
export function createMainRendererPieces(config) {
|
|
4
4
|
const state = {
|
|
5
5
|
config,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ExtensionRenderContext } from '../../../types/context/render';
|
|
2
|
-
import { MainRendererPiecesInternal } from './types';
|
|
1
|
+
import { ExtensionRenderContext } from '../../../types/context/render.js';
|
|
2
|
+
import { MainRendererPiecesInternal } from './types.js';
|
|
3
3
|
export declare function rendererPiecesRender(state: MainRendererPiecesInternal, context: ExtensionRenderContext, layer: SVGElement): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { createSvgElement, updateElementAttributes } from '../../../../render/svg/helpers';
|
|
2
|
-
import { isNonEmptyPieceCode } from '../../../../state/board/check';
|
|
3
|
-
import { SQUARE_COUNT } from '../../../../state/board/types/internal';
|
|
4
|
-
import { DirtyLayer } from '../types/extension';
|
|
1
|
+
import { createSvgElement, updateElementAttributes } from '../../../../render/svg/helpers.js';
|
|
2
|
+
import { isNonEmptyPieceCode } from '../../../../state/board/check.js';
|
|
3
|
+
import { SQUARE_COUNT } from '../../../../state/board/types/internal.js';
|
|
4
|
+
import { DirtyLayer } from '../types/extension.js';
|
|
5
5
|
export function rendererPiecesRender(state, context, layer) {
|
|
6
6
|
if ((context.invalidation.dirtyLayers & DirtyLayer.Pieces) === 0) {
|
|
7
7
|
return;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Square } from '../../../../state/board/types/internal';
|
|
2
|
-
import { ExtensionCleanAnimationContext } from '../../../types/context/animation';
|
|
3
|
-
import { ExtensionUpdateContext } from '../../../types/context/update';
|
|
4
|
-
import { MainRendererPiecesInternal } from './types';
|
|
1
|
+
import { Square } from '../../../../state/board/types/internal.js';
|
|
2
|
+
import { ExtensionCleanAnimationContext } from '../../../types/context/animation.js';
|
|
3
|
+
import { ExtensionUpdateContext } from '../../../types/context/update.js';
|
|
4
|
+
import { MainRendererPiecesInternal } from './types.js';
|
|
5
5
|
export declare function calculateSuppressedSquares(_state: MainRendererPiecesInternal, context: ExtensionUpdateContext | ExtensionCleanAnimationContext, animationSuppressedSquares: ReadonlySet<Square>): ReadonlySet<Square>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Square } from '../../../../state/board/types/internal';
|
|
2
|
-
import { ExtensionCleanAnimationContext } from '../../../types/context/animation';
|
|
3
|
-
import { ExtensionRenderContext } from '../../../types/context/render';
|
|
4
|
-
import { ExtensionUpdateContext } from '../../../types/context/update';
|
|
5
|
-
import { PieceUrls } from '../types/internal';
|
|
1
|
+
import { Square } from '../../../../state/board/types/internal.js';
|
|
2
|
+
import { ExtensionCleanAnimationContext } from '../../../types/context/animation.js';
|
|
3
|
+
import { ExtensionRenderContext } from '../../../types/context/render.js';
|
|
4
|
+
import { ExtensionUpdateContext } from '../../../types/context/update.js';
|
|
5
|
+
import { PieceUrls } from '../types/internal.js';
|
|
6
6
|
type PieceNodeRecord = {
|
|
7
7
|
root: SVGImageElement;
|
|
8
8
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Square } from '../../../../state/board/types/internal';
|
|
2
|
-
import { ExtensionCleanAnimationContext } from '../../../types/context/animation';
|
|
3
|
-
import { ExtensionUpdateContext } from '../../../types/context/update';
|
|
4
|
-
import { MainRendererPiecesInternal } from './types';
|
|
1
|
+
import { Square } from '../../../../state/board/types/internal.js';
|
|
2
|
+
import { ExtensionCleanAnimationContext } from '../../../types/context/animation.js';
|
|
3
|
+
import { ExtensionUpdateContext } from '../../../types/context/update.js';
|
|
4
|
+
import { MainRendererPiecesInternal } from './types.js';
|
|
5
5
|
export declare function rendererPiecesOnUpdate(state: MainRendererPiecesInternal, context: ExtensionUpdateContext, animationSuppressedSquares: ReadonlySet<Square>): void;
|
|
6
6
|
export declare function rendererPiecesRefreshSuppressedSquares(state: MainRendererPiecesInternal, context: ExtensionCleanAnimationContext, animationSuppressedSquares: ReadonlySet<Square>): void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { setsEqual } from '../../../../helpers/util';
|
|
2
|
-
import { piecePositionsEqual } from '../../../../state/board/check';
|
|
3
|
-
import { isUpdateContextRenderable } from '../../../types/context/update';
|
|
4
|
-
import { DirtyLayer } from '../types/extension';
|
|
5
|
-
import { calculateSuppressedSquares } from './suppress';
|
|
1
|
+
import { setsEqual } from '../../../../helpers/util.js';
|
|
2
|
+
import { piecePositionsEqual } from '../../../../state/board/check.js';
|
|
3
|
+
import { isUpdateContextRenderable } from '../../../types/context/update.js';
|
|
4
|
+
import { DirtyLayer } from '../types/extension.js';
|
|
5
|
+
import { calculateSuppressedSquares } from './suppress.js';
|
|
6
6
|
export function rendererPiecesOnUpdate(state, context, animationSuppressedSquares) {
|
|
7
7
|
if (!isUpdateContextRenderable(context) ||
|
|
8
8
|
!context.mutation.hasMutation({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ExtensionDefinition, ExtensionInstance } from '../../../types/extension';
|
|
2
|
-
import { MainRendererConfigInput } from './input';
|
|
1
|
+
import { ExtensionDefinition, ExtensionInstance } from '../../../types/extension.js';
|
|
2
|
+
import { MainRendererConfigInput } from './input.js';
|
|
3
3
|
export type MainRendererInitOptions = Partial<MainRendererConfigInput>;
|
|
4
4
|
export declare const EXTENSION_SLOTS: readonly ["board", "coordinates", "pieces", "animation", "drag"];
|
|
5
5
|
export type ExtensionSlotsType = typeof EXTENSION_SLOTS;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PieceString } from '../../../../state/board/types/input';
|
|
2
|
-
import { TMainRendererConfig } from './template';
|
|
1
|
+
import { PieceString } from '../../../../state/board/types/input.js';
|
|
2
|
+
import { TMainRendererConfig } from './template.js';
|
|
3
3
|
export type PieceUrlsInput = Record<PieceString, string>;
|
|
4
4
|
export type MainRendererConfigInput = TMainRendererConfig<PieceUrlsInput>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ExtensionRuntimeSurface } from '../../../types/surface/main';
|
|
2
|
-
import { ExtensionInternal } from '../../common/types';
|
|
3
|
-
import { MainRendererAnimation } from '../animation/types';
|
|
4
|
-
import { MainRendererBoard } from '../board/types';
|
|
5
|
-
import { MainRendererCoordinates } from '../coordinates/types';
|
|
6
|
-
import { MainRendererDrag } from '../drag/types';
|
|
7
|
-
import { MainRendererPieces } from '../pieces/types';
|
|
8
|
-
import { ExtensionSlotsType } from './extension';
|
|
1
|
+
import { ExtensionRuntimeSurface } from '../../../types/surface/main.js';
|
|
2
|
+
import { ExtensionInternal } from '../../common/types.js';
|
|
3
|
+
import { MainRendererAnimation } from '../animation/types.js';
|
|
4
|
+
import { MainRendererBoard } from '../board/types.js';
|
|
5
|
+
import { MainRendererCoordinates } from '../coordinates/types.js';
|
|
6
|
+
import { MainRendererDrag } from '../drag/types.js';
|
|
7
|
+
import { MainRendererPieces } from '../pieces/types.js';
|
|
8
|
+
import { ExtensionSlotsType } from './extension.js';
|
|
9
9
|
export interface MainRendererInstanceInternal extends ExtensionInternal<ExtensionSlotsType> {
|
|
10
10
|
readonly board: MainRendererBoard;
|
|
11
11
|
readonly coordinates: MainRendererCoordinates;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NonEmptyPieceCode } from '../../../../state/board/types/internal';
|
|
2
|
-
import { TMainRendererConfig } from './template';
|
|
1
|
+
import { NonEmptyPieceCode } from '../../../../state/board/types/internal.js';
|
|
2
|
+
import { TMainRendererConfig } from './template.js';
|
|
3
3
|
export interface ConfigColorPair {
|
|
4
4
|
light: string;
|
|
5
5
|
dark: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { SelectedSquareDefinition, SelectedSquareInitConfig } from './types';
|
|
1
|
+
import { SelectedSquareDefinition, SelectedSquareInitConfig } from './types.js';
|
|
2
2
|
export declare function createSelectedSquare(config?: SelectedSquareInitConfig): SelectedSquareDefinition;
|
|
@@ -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 createSelectedSquare(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: "selectedSquare";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { createActiveTarget } from './first-party/active-target/factory';
|
|
2
|
-
export { createBoardEvents } from './first-party/board-events/factory';
|
|
3
|
-
export { createLastMove } from './first-party/last-move/factory';
|
|
4
|
-
export { createLegalMoves } from './first-party/legal-moves/factory';
|
|
5
|
-
export { createMainRenderer } from './first-party/main-renderer/factory';
|
|
6
|
-
export { createSelectedSquare } from './first-party/selected-square/factory';
|
|
7
|
-
export type { AnyExtensionDefinition, ExtensionDefinitionId, ExtensionDefinitionPublicApi } from './types/extension';
|
|
8
|
-
export type { BuiltInExtensionId, DefaultBuiltinChessboardExtensions } from './types/wrapper';
|
|
1
|
+
export { createActiveTarget } from './first-party/active-target/factory.js';
|
|
2
|
+
export { createBoardEvents } from './first-party/board-events/factory.js';
|
|
3
|
+
export { createLastMove } from './first-party/last-move/factory.js';
|
|
4
|
+
export { createLegalMoves } from './first-party/legal-moves/factory.js';
|
|
5
|
+
export { createMainRenderer } from './first-party/main-renderer/factory.js';
|
|
6
|
+
export { createSelectedSquare } from './first-party/selected-square/factory.js';
|
|
7
|
+
export type { AnyExtensionDefinition, ExtensionDefinitionId, ExtensionDefinitionPublicApi } from './types/extension.js';
|
|
8
|
+
export type { BuiltInExtensionId, DefaultBuiltinChessboardExtensions } from './types/wrapper.js';
|
package/dist/extensions/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { createActiveTarget } from './first-party/active-target/factory';
|
|
2
|
-
export { createBoardEvents } from './first-party/board-events/factory';
|
|
3
|
-
export { createLastMove } from './first-party/last-move/factory';
|
|
4
|
-
export { createLegalMoves } from './first-party/legal-moves/factory';
|
|
5
|
-
export { createMainRenderer } from './first-party/main-renderer/factory';
|
|
6
|
-
export { createSelectedSquare } from './first-party/selected-square/factory';
|
|
1
|
+
export { createActiveTarget } from './first-party/active-target/factory.js';
|
|
2
|
+
export { createBoardEvents } from './first-party/board-events/factory.js';
|
|
3
|
+
export { createLastMove } from './first-party/last-move/factory.js';
|
|
4
|
+
export { createLegalMoves } from './first-party/legal-moves/factory.js';
|
|
5
|
+
export { createMainRenderer } from './first-party/main-renderer/factory.js';
|
|
6
|
+
export { createSelectedSquare } from './first-party/selected-square/factory.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ExtensionInvalidationState } from './types';
|
|
1
|
+
import type { ExtensionInvalidationState } from './types.js';
|
|
2
2
|
export declare function createExtensionInvalidationState(): ExtensionInvalidationState;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Square } from '../../../state/board/types/internal';
|
|
2
|
-
import { ScenePoint } from '../basic/transient-visuals';
|
|
1
|
+
import { Square } from '../../../state/board/types/internal.js';
|
|
2
|
+
import { ScenePoint } from '../basic/transient-visuals.js';
|
|
3
3
|
interface SceneEventBase {
|
|
4
4
|
readonly defaultPrevented: boolean;
|
|
5
5
|
preventDefault(): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LayoutSnapshot } from '../../../layout/types';
|
|
2
|
-
import { RuntimeStateSnapshot } from '../../../state/types';
|
|
1
|
+
import { LayoutSnapshot } from '../../../layout/types.js';
|
|
2
|
+
import { RuntimeStateSnapshot } from '../../../state/types.js';
|
|
3
3
|
export interface RenderLayoutSnapshot extends LayoutSnapshot {
|
|
4
4
|
readonly geometry: NonNullable<LayoutSnapshot['geometry']>;
|
|
5
5
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { LayoutSnapshot } from '../../../layout/types';
|
|
2
|
-
import { RuntimeStateSnapshot } from '../../../state/types';
|
|
3
|
-
import { RenderFrameSnapshot } from './render';
|
|
1
|
+
import { LayoutSnapshot } from '../../../layout/types.js';
|
|
2
|
+
import { RuntimeStateSnapshot } from '../../../state/types.js';
|
|
3
|
+
import { RenderFrameSnapshot } from './render.js';
|
|
4
4
|
export interface UpdateFrameSnapshotUnmounted {
|
|
5
5
|
readonly isMounted: false;
|
|
6
6
|
readonly state: RuntimeStateSnapshot;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ExtensionInvalidationState } from '../../invalidation/types';
|
|
2
|
-
import { ExtensionAnimationSession } from '../basic/animation';
|
|
3
|
-
import { ExtensionRenderContext } from './render';
|
|
1
|
+
import { ExtensionInvalidationState } from '../../invalidation/types.js';
|
|
2
|
+
import { ExtensionAnimationSession } from '../basic/animation.js';
|
|
3
|
+
import { ExtensionRenderContext } from './render.js';
|
|
4
4
|
export interface ExtensionSubmittedAnimationSession extends ExtensionAnimationSession {
|
|
5
5
|
readonly status: 'submitted';
|
|
6
6
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ExtensionReadonlyInvalidationState } from '../../invalidation/types';
|
|
2
|
-
import { RenderFrameSnapshot } from '../basic/render';
|
|
1
|
+
import { ExtensionReadonlyInvalidationState } from '../../invalidation/types.js';
|
|
2
|
+
import { RenderFrameSnapshot } from '../basic/render.js';
|
|
3
3
|
export interface ExtensionRenderContext {
|
|
4
4
|
readonly currentFrame: RenderFrameSnapshot;
|
|
5
5
|
readonly invalidation: ExtensionReadonlyInvalidationState;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReadonlyDeep } from 'type-fest';
|
|
2
|
-
import { RenderFrameSnapshot } from '../basic/render';
|
|
3
|
-
import { TransientInput } from '../basic/transient-visuals';
|
|
2
|
+
import { RenderFrameSnapshot } from '../basic/render.js';
|
|
3
|
+
import { TransientInput } from '../basic/transient-visuals.js';
|
|
4
4
|
export interface ExtensionRenderTransientVisualsContext {
|
|
5
5
|
readonly currentFrame: RenderFrameSnapshot;
|
|
6
6
|
readonly transientInput: ReadonlyDeep<TransientInput>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MoveRequest, Square } from '../../../state/board/types/internal';
|
|
2
|
-
import { MoveDestinationSnapshot } from '../../../state/interaction/types/internal';
|
|
1
|
+
import { MoveRequest, Square } from '../../../state/board/types/internal.js';
|
|
2
|
+
import { MoveDestinationSnapshot } from '../../../state/interaction/types/internal.js';
|
|
3
3
|
export type ExtensionUIMoveRequestStatus = 'unresolved' | 'deferred' | 'resolved';
|
|
4
4
|
export interface ExtensionUIMoveRequestContextSnapshot {
|
|
5
5
|
readonly status: ExtensionUIMoveRequestStatus;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { RuntimeReadonlyMutationSession } from '../../../runtime/mutation/types';
|
|
2
|
-
import { ExtensionInvalidationState } from '../../invalidation/types';
|
|
3
|
-
import { RenderFrameSnapshot } from '../basic/render';
|
|
4
|
-
import { UpdateFrameSnapshot, UpdateFrameSnapshotMounted, UpdateFrameSnapshotUnmounted } from '../basic/update';
|
|
1
|
+
import { RuntimeReadonlyMutationSession } from '../../../runtime/mutation/types.js';
|
|
2
|
+
import { ExtensionInvalidationState } from '../../invalidation/types.js';
|
|
3
|
+
import { RenderFrameSnapshot } from '../basic/render.js';
|
|
4
|
+
import { UpdateFrameSnapshot, UpdateFrameSnapshotMounted, UpdateFrameSnapshotUnmounted } from '../basic/update.js';
|
|
5
5
|
export interface ExtensionUpdateContextCommon {
|
|
6
6
|
readonly previousFrame: UpdateFrameSnapshot | null;
|
|
7
7
|
readonly mutation: RuntimeReadonlyMutationSession;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { SceneEvent } from './basic/events';
|
|
2
|
-
import { ExtensionInstanceMountOptions, ExtensionSlotName } from './basic/mount';
|
|
3
|
-
import { ExtensionAnimationFinishedContext, ExtensionCleanAnimationContext, ExtensionPrepareAnimationContext, ExtensionRenderAnimationContext } from './context/animation';
|
|
4
|
-
import { ExtensionRenderContext } from './context/render';
|
|
5
|
-
import { ExtensionRenderTransientVisualsContext } from './context/transient-visuals';
|
|
6
|
-
import { ExtensionUIMoveRequestContext } from './context/ui-move';
|
|
7
|
-
import { ExtensionUpdateContext } from './context/update';
|
|
8
|
-
import { ExtensionRuntimeSurface } from './surface/main';
|
|
1
|
+
import { SceneEvent } from './basic/events.js';
|
|
2
|
+
import { ExtensionInstanceMountOptions, ExtensionSlotName } from './basic/mount.js';
|
|
3
|
+
import { ExtensionAnimationFinishedContext, ExtensionCleanAnimationContext, ExtensionPrepareAnimationContext, ExtensionRenderAnimationContext } from './context/animation.js';
|
|
4
|
+
import { ExtensionRenderContext } from './context/render.js';
|
|
5
|
+
import { ExtensionRenderTransientVisualsContext } from './context/transient-visuals.js';
|
|
6
|
+
import { ExtensionUIMoveRequestContext } from './context/ui-move.js';
|
|
7
|
+
import { ExtensionUpdateContext } from './context/update.js';
|
|
8
|
+
import { ExtensionRuntimeSurface } from './surface/main.js';
|
|
9
9
|
interface ExtensionInstanceBase<TId extends string, TSlots extends readonly ExtensionSlotName[]> {
|
|
10
10
|
readonly id: TId;
|
|
11
11
|
mount(env: ExtensionInstanceMountOptions<TSlots>): void;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { RuntimeReadonlyMutationSession } from '../../runtime/mutation/types';
|
|
2
|
-
import { ExtensionInvalidationState } from '../invalidation/types';
|
|
3
|
-
import { ExtensionAnimationControllerInternalSurface } from './basic/animation';
|
|
4
|
-
import { SceneEventType } from './basic/events';
|
|
5
|
-
import { UpdateFrameSnapshot } from './basic/update';
|
|
6
|
-
import { ExtensionUIMoveRequestContext } from './context/ui-move';
|
|
7
|
-
import { AnyExtensionDefinition, AnyExtensionInstance } from './extension';
|
|
8
|
-
import { ExtensionRuntimeSurfaceCommands } from './surface/commands';
|
|
1
|
+
import { RuntimeReadonlyMutationSession } from '../../runtime/mutation/types.js';
|
|
2
|
+
import { ExtensionInvalidationState } from '../invalidation/types.js';
|
|
3
|
+
import { ExtensionAnimationControllerInternalSurface } from './basic/animation.js';
|
|
4
|
+
import { SceneEventType } from './basic/events.js';
|
|
5
|
+
import { UpdateFrameSnapshot } from './basic/update.js';
|
|
6
|
+
import { ExtensionUIMoveRequestContext } from './context/ui-move.js';
|
|
7
|
+
import { AnyExtensionDefinition, AnyExtensionInstance } from './extension.js';
|
|
8
|
+
import { ExtensionRuntimeSurfaceCommands } from './surface/commands.js';
|
|
9
9
|
export interface ExtensionSystemExtensionRecord {
|
|
10
10
|
readonly id: string;
|
|
11
11
|
readonly definition: AnyExtensionDefinition;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { LayoutSnapshot } from '../../../layout/types';
|
|
2
|
-
import { ColorInput, MoveRequestInput, PiecePositionInput, PositionInput, SquareString } from '../../../state/board/types/input';
|
|
3
|
-
import { Move } from '../../../state/board/types/internal';
|
|
4
|
-
import { MovabilityInput } from '../../../state/interaction/types/input';
|
|
5
|
-
import { RuntimeStateSnapshot } from '../../../state/types';
|
|
1
|
+
import { LayoutSnapshot } from '../../../layout/types.js';
|
|
2
|
+
import { ColorInput, MoveRequestInput, PiecePositionInput, PositionInput, SquareString } from '../../../state/board/types/input.js';
|
|
3
|
+
import { Move } from '../../../state/board/types/internal.js';
|
|
4
|
+
import { MovabilityInput } from '../../../state/interaction/types/input.js';
|
|
5
|
+
import { RuntimeStateSnapshot } from '../../../state/types.js';
|
|
6
6
|
export interface ExtensionRuntimeSurfaceCommandsSnapshot {
|
|
7
7
|
readonly state: RuntimeStateSnapshot;
|
|
8
8
|
readonly layout: LayoutSnapshot;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ExtensionAnimationController } from '../basic/animation';
|
|
2
|
-
import { ExtensionRuntimeSurfaceCommands } from './commands';
|
|
3
|
-
import { ExtensionRuntimeSurfaceEvents } from './events';
|
|
4
|
-
import { ExtensionRuntimeSurfaceTransientVisuals } from './transient-visuals';
|
|
1
|
+
import { ExtensionAnimationController } from '../basic/animation.js';
|
|
2
|
+
import { ExtensionRuntimeSurfaceCommands } from './commands.js';
|
|
3
|
+
import { ExtensionRuntimeSurfaceEvents } from './events.js';
|
|
4
|
+
import { ExtensionRuntimeSurfaceTransientVisuals } from './transient-visuals.js';
|
|
5
5
|
export interface ExtensionRuntimeSurface {
|
|
6
6
|
readonly commands: ExtensionRuntimeSurfaceCommands;
|
|
7
7
|
readonly animation: ExtensionAnimationController;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Public built-in extension ids accepted by createBoard({ extensions })
|
|
3
3
|
*/
|
|
4
|
-
import { ActiveTargetDefinition } from '../first-party/active-target/types';
|
|
5
|
-
import { BoardEventsDefinition } from '../first-party/board-events/types';
|
|
6
|
-
import { LastMoveDefinition } from '../first-party/last-move/types';
|
|
7
|
-
import { LegalMovesDefinition } from '../first-party/legal-moves/types';
|
|
8
|
-
import { MainRendererDefinition } from '../first-party/main-renderer/types/extension';
|
|
9
|
-
import { SelectedSquareDefinition } from '../first-party/selected-square/types';
|
|
4
|
+
import { ActiveTargetDefinition } from '../first-party/active-target/types.js';
|
|
5
|
+
import { BoardEventsDefinition } from '../first-party/board-events/types.js';
|
|
6
|
+
import { LastMoveDefinition } from '../first-party/last-move/types.js';
|
|
7
|
+
import { LegalMovesDefinition } from '../first-party/legal-moves/types.js';
|
|
8
|
+
import { MainRendererDefinition } from '../first-party/main-renderer/types/extension.js';
|
|
9
|
+
import { SelectedSquareDefinition } from '../first-party/selected-square/types.js';
|
|
10
10
|
export declare const DefaultBuiltinChessboardExtensions: readonly ["mainRenderer", "events", "selectedSquare", "activeTarget", "legalMoves", "lastMove"];
|
|
11
11
|
export type BuiltInExtensionId = (typeof DefaultBuiltinChessboardExtensions)[number];
|
|
12
12
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExtensionUIMoveRequestContext } from './types/context/ui-move';
|
|
2
|
-
import { ExtensionSystemInternal, ExtensionSystemUpdateRequest } from './types/main';
|
|
1
|
+
import { ExtensionUIMoveRequestContext } from './types/context/ui-move.js';
|
|
2
|
+
import { ExtensionSystemInternal, ExtensionSystemUpdateRequest } from './types/main.js';
|
|
3
3
|
export declare function extensionSystemUpdateState(state: ExtensionSystemInternal, request: ExtensionSystemUpdateRequest): void;
|
|
4
4
|
export declare function extensionSystemUpdateUIMoveRequest(state: ExtensionSystemInternal, context: ExtensionUIMoveRequestContext): void;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { createBoard } from './wrapper/factory';
|
|
2
|
-
export type { Chessboard, ChessboardExtensionInput, ChessboardInitOptions, ChessboardRuntimeSurface } from './wrapper/types';
|
|
3
|
-
export type { MoveRequestInput, PiecePositionRecordString } from './state/board/types/input';
|
|
4
|
-
export type { RuntimeStateInitOptions } from './state/types';
|
|
1
|
+
export { createBoard } from './wrapper/factory.js';
|
|
2
|
+
export type { Chessboard, ChessboardExtensionInput, ChessboardInitOptions, ChessboardRuntimeSurface } from './wrapper/types.js';
|
|
3
|
+
export type { MoveRequestInput, PiecePositionRecordString } from './state/board/types/input.js';
|
|
4
|
+
export type { RuntimeStateInitOptions } from './state/types.js';
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { createBoard } from './wrapper/factory';
|
|
1
|
+
export { createBoard } from './wrapper/factory.js';
|
package/dist/layout/factory.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Layout } from './types';
|
|
1
|
+
import { Layout } from './types.js';
|
|
2
2
|
export declare function createLayout(): Layout;
|
package/dist/layout/factory.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ColorCode } from '../../state/board/types/internal';
|
|
2
|
-
import { RenderGeometry } from './types';
|
|
1
|
+
import { ColorCode } from '../../state/board/types/internal.js';
|
|
2
|
+
import { RenderGeometry } from './types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Create RenderGeometry for a given board size (in px) and orientation.
|
|
5
5
|
* - Geometry uses an SVG-local coordinate system with origin at top-left.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { fileOf, rankOf } from '../../state/board/coords';
|
|
1
|
+
import { fileOf, rankOf } from '../../state/board/coords.js';
|
|
2
2
|
/**
|
|
3
3
|
* Create RenderGeometry for a given board size (in px) and orientation.
|
|
4
4
|
* - Geometry uses an SVG-local coordinate system with origin at top-left.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { LayoutInternal, LayoutRefreshOptions } from './types';
|
|
1
|
+
import { LayoutInternal, LayoutRefreshOptions } from './types.js';
|
|
2
2
|
export declare function layoutRefreshGeometry(state: LayoutInternal, options: LayoutRefreshOptions): boolean;
|
package/dist/layout/reducers.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createRenderGeometry } from './geometry/factory';
|
|
2
|
-
import { measureBoardSize } from './helpers';
|
|
1
|
+
import { createRenderGeometry } from './geometry/factory.js';
|
|
2
|
+
import { measureBoardSize } from './helpers.js';
|
|
3
3
|
export function layoutRefreshGeometry(state, options) {
|
|
4
4
|
const orientation = options.orientation ?? state.orientation;
|
|
5
5
|
if (orientation === null) {
|