fix: fixed issues after use @aklive2d/module
This commit is contained in:
@@ -9,7 +9,7 @@ import ReturnButton from '@/component/return_button'
|
|||||||
import { Typewriter } from 'react-simple-typewriter'
|
import { Typewriter } from 'react-simple-typewriter'
|
||||||
import { useHeader } from '@/state/header'
|
import { useHeader } from '@/state/header'
|
||||||
import VoiceElement from '@/component/voice'
|
import VoiceElement from '@/component/voice'
|
||||||
import { spine } from '@aklive2d/module'
|
import { Player as SpinePlayer } from '@aklive2d/module'
|
||||||
import useInsight from '@/state/insight'
|
import useInsight from '@/state/insight'
|
||||||
import buildConfig from '!/config.json'
|
import buildConfig from '!/config.json'
|
||||||
|
|
||||||
@@ -91,7 +91,7 @@ export default function Error() {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (spineRef.current?.children.length === 0) {
|
if (spineRef.current?.children.length === 0) {
|
||||||
setSpinePlayer(
|
setSpinePlayer(
|
||||||
new spine.SpinePlayer(spineRef.current, {
|
new SpinePlayer(spineRef.current, {
|
||||||
skelUrl: `./_assets/${filename}.skel`,
|
skelUrl: `./_assets/${filename}.skel`,
|
||||||
atlasUrl: `./_assets/${filename}.atlas`,
|
atlasUrl: `./_assets/${filename}.atlas`,
|
||||||
animation: 'Relax',
|
animation: 'Relax',
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { useHeader } from '@/state/header'
|
|||||||
import { useAppbar } from '@/state/appbar'
|
import { useAppbar } from '@/state/appbar'
|
||||||
import VoiceElement from '@/component/voice'
|
import VoiceElement from '@/component/voice'
|
||||||
import useInsight from '@/state/insight'
|
import useInsight from '@/state/insight'
|
||||||
import { spine } from '@aklive2d/module'
|
import { Player as SpinePlayer } from '@aklive2d/module'
|
||||||
import Border from '@/component/border'
|
import Border from '@/component/border'
|
||||||
import { useI18n } from '@/state/language'
|
import { useI18n } from '@/state/language'
|
||||||
import Switch from '@/component/switch'
|
import Switch from '@/component/switch'
|
||||||
@@ -212,9 +212,7 @@ export default function Operator() {
|
|||||||
} else {
|
} else {
|
||||||
playerConfig.skelUrl = `./${key}/assets/${configRef.current.filename.replace(/#/g, '%23')}.skel`
|
playerConfig.skelUrl = `./${key}/assets/${configRef.current.filename.replace(/#/g, '%23')}.skel`
|
||||||
}
|
}
|
||||||
setSpinePlayer(
|
setSpinePlayer(new SpinePlayer(spineRef.current, playerConfig))
|
||||||
new spine.SpinePlayer(spineRef.current, playerConfig)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}, [spineAnimationName, setSpinePlayer, spinePlayer, key])
|
}, [spineAnimationName, setSpinePlayer, spinePlayer, key])
|
||||||
|
|
||||||
|
|||||||
3
apps/module/.prettierignore
Normal file
3
apps/module/.prettierignore
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
dist
|
||||||
|
data
|
||||||
|
auto_update
|
||||||
30
apps/module/eslint.config.js
Normal file
30
apps/module/eslint.config.js
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
import eslint from '@eslint/js'
|
||||||
|
import tseslint from 'typescript-eslint'
|
||||||
|
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'
|
||||||
|
import globals from 'globals'
|
||||||
|
|
||||||
|
/** @type {import('eslint').Config} */
|
||||||
|
export default tseslint.config(
|
||||||
|
eslint.configs.recommended,
|
||||||
|
tseslint.configs.recommended,
|
||||||
|
eslintPluginPrettierRecommended,
|
||||||
|
{
|
||||||
|
ignores: ['dist', 'spine-ts'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['**/*.{js,jsx}', '**/*.{ts,tsx}'],
|
||||||
|
languageOptions: {
|
||||||
|
ecmaVersion: 2022,
|
||||||
|
globals: {
|
||||||
|
...globals.browser,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
|
||||||
|
'@typescript-eslint/no-unused-vars': [
|
||||||
|
'error',
|
||||||
|
{ argsIgnorePattern: '^_' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
}
|
||||||
|
)
|
||||||
@@ -4,9 +4,15 @@
|
|||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc"
|
"lint": "eslint && prettier --check ."
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"typescript": "~5.7.3"
|
"@aklive2d/postcss-config": "workspace:*",
|
||||||
|
"@aklive2d/prettier-config": "workspace:*",
|
||||||
|
"@aklive2d/stylelint-config": "workspace:*",
|
||||||
|
"eslint-plugin-prettier": "^5.2.6",
|
||||||
|
"globals": "^16.0.0",
|
||||||
|
"typescript": "^5.8.3",
|
||||||
|
"typescript-eslint": "^8.31.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
5
apps/module/postcss.config.js
Normal file
5
apps/module/postcss.config.js
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
import baseConfig from '@aklive2d/postcss-config'
|
||||||
|
/** @type {import('postcss').Config} */
|
||||||
|
export default {
|
||||||
|
...baseConfig,
|
||||||
|
}
|
||||||
11
apps/module/prettier.config.js
Normal file
11
apps/module/prettier.config.js
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import baseConfig from '@aklive2d/prettier-config'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {import("prettier").Config}
|
||||||
|
*/
|
||||||
|
const config = {
|
||||||
|
...baseConfig,
|
||||||
|
semi: false,
|
||||||
|
}
|
||||||
|
|
||||||
|
export default config
|
||||||
@@ -73,10 +73,10 @@ export interface PlayerConfig {
|
|||||||
backgroundColor: string
|
backgroundColor: string
|
||||||
|
|
||||||
/* Optional: callback when the widget and its assets have been successfully loaded. */
|
/* Optional: callback when the widget and its assets have been successfully loaded. */
|
||||||
success: (widget: Player) => void
|
success: (_widget: Player) => void
|
||||||
|
|
||||||
/* Optional: callback when the widget could not be loaded. */
|
/* Optional: callback when the widget could not be loaded. */
|
||||||
error: (widget: Player, msg: string) => void
|
error: (_widget: Player, _msg: string) => void
|
||||||
}
|
}
|
||||||
|
|
||||||
export class Player {
|
export class Player {
|
||||||
@@ -117,7 +117,7 @@ export class Player {
|
|||||||
private eventListeners: {
|
private eventListeners: {
|
||||||
target: HTMLElement | Document | Window
|
target: HTMLElement | Document | Window
|
||||||
event: keyof HTMLElementEventMap
|
event: keyof HTMLElementEventMap
|
||||||
func: (this: HTMLElement, ev: Event) => any
|
func: EventListenerOrEventListenerObject
|
||||||
}[] = []
|
}[] = []
|
||||||
|
|
||||||
constructor(parent: HTMLElement | string, config: Partial<PlayerConfig>) {
|
constructor(parent: HTMLElement | string, config: Partial<PlayerConfig>) {
|
||||||
@@ -227,14 +227,14 @@ export class Player {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private showError(error: string) {
|
private showError(error: string) {
|
||||||
let errorDom = findWithClass(this.dom, 'spine-player-error')[0]
|
const errorDom = findWithClass(this.dom, 'spine-player-error')[0]
|
||||||
errorDom.classList.remove('spine-player-hidden')
|
errorDom.classList.remove('spine-player-hidden')
|
||||||
errorDom.innerHTML = `<p style="text-align: center; align-self: center;">${error}</p>`
|
errorDom.innerHTML = `<p style="text-align: center; align-self: center;">${error}</p>`
|
||||||
this.config.error(this, error)
|
this.config.error(this, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
private render(config: Partial<PlayerConfig>): HTMLElement {
|
private render(config: Partial<PlayerConfig>): HTMLElement {
|
||||||
let dom = (this.dom = createElement(`
|
const dom = (this.dom = createElement(`
|
||||||
<div class="spine-player">
|
<div class="spine-player">
|
||||||
<canvas class="spine-player-canvas"></canvas>
|
<canvas class="spine-player-canvas"></canvas>
|
||||||
<div class="spine-player-error spine-player-hidden"></div>
|
<div class="spine-player-error spine-player-hidden"></div>
|
||||||
@@ -244,8 +244,8 @@ export class Player {
|
|||||||
try {
|
try {
|
||||||
// Validate the configuration
|
// Validate the configuration
|
||||||
this.config = this.validateConfig(config)
|
this.config = this.validateConfig(config)
|
||||||
} catch (e: any) {
|
} catch (e: unknown) {
|
||||||
this.showError(e)
|
this.showError(e as string)
|
||||||
return dom
|
return dom
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -255,7 +255,7 @@ export class Player {
|
|||||||
dom,
|
dom,
|
||||||
'spine-player-canvas'
|
'spine-player-canvas'
|
||||||
)[0] as HTMLCanvasElement
|
)[0] as HTMLCanvasElement
|
||||||
var webglConfig = { alpha: this.config.alpha }
|
const webglConfig = { alpha: this.config.alpha }
|
||||||
this.context = new spine.webgl.ManagedWebGLRenderingContext(
|
this.context = new spine.webgl.ManagedWebGLRenderingContext(
|
||||||
this.canvas,
|
this.canvas,
|
||||||
webglConfig
|
webglConfig
|
||||||
@@ -266,7 +266,7 @@ export class Player {
|
|||||||
this.context,
|
this.context,
|
||||||
true
|
true
|
||||||
)
|
)
|
||||||
} catch (e) {
|
} catch {
|
||||||
this.showError(
|
this.showError(
|
||||||
'Sorry, your browser does not support WebGL.<br><br>Please use the latest version of Firefox, Chrome, Edge, or Safari.'
|
'Sorry, your browser does not support WebGL.<br><br>Please use the latest version of Firefox, Chrome, Edge, or Safari.'
|
||||||
)
|
)
|
||||||
@@ -276,8 +276,8 @@ export class Player {
|
|||||||
// Load the assets
|
// Load the assets
|
||||||
this.assetManager = new spine.webgl.AssetManager(this.context)
|
this.assetManager = new spine.webgl.AssetManager(this.context)
|
||||||
if (this.config.rawDataURIs) {
|
if (this.config.rawDataURIs) {
|
||||||
for (let path in this.config.rawDataURIs) {
|
for (const path in this.config.rawDataURIs) {
|
||||||
let data = this.config.rawDataURIs[path]
|
const data = this.config.rawDataURIs[path]
|
||||||
this.assetManager.setRawDataURI(path, data)
|
this.assetManager.setRawDataURI(path, data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -305,17 +305,18 @@ export class Player {
|
|||||||
this.canvas.height = Math.floor(h * this.devicePixelRatio)
|
this.canvas.height = Math.floor(h * this.devicePixelRatio)
|
||||||
}
|
}
|
||||||
this.context.gl.viewport(0, 0, this.canvas.width, this.canvas.height)
|
this.context.gl.viewport(0, 0, this.canvas.width, this.canvas.height)
|
||||||
|
// eslint-disable-next-line
|
||||||
if (resizeMode === spine.webgl.ResizeMode.Stretch) {
|
if (resizeMode === spine.webgl.ResizeMode.Stretch) {
|
||||||
} else if (resizeMode === spine.webgl.ResizeMode.Expand) {
|
} else if (resizeMode === spine.webgl.ResizeMode.Expand) {
|
||||||
this.sceneRenderer.camera.setViewport(w, h)
|
this.sceneRenderer.camera.setViewport(w, h)
|
||||||
} else if (resizeMode === spine.webgl.ResizeMode.Fit) {
|
} else if (resizeMode === spine.webgl.ResizeMode.Fit) {
|
||||||
var sourceWidth = this.canvas.width,
|
const sourceWidth = this.canvas.width,
|
||||||
sourceHeight = this.canvas.height
|
sourceHeight = this.canvas.height
|
||||||
var targetWidth = this.sceneRenderer.camera.viewportWidth,
|
const targetWidth = this.sceneRenderer.camera.viewportWidth,
|
||||||
targetHeight = this.sceneRenderer.camera.viewportHeight
|
targetHeight = this.sceneRenderer.camera.viewportHeight
|
||||||
var targetRatio = targetHeight / targetWidth
|
const targetRatio = targetHeight / targetWidth
|
||||||
var sourceRatio = sourceHeight / sourceWidth
|
const sourceRatio = sourceHeight / sourceWidth
|
||||||
var scale =
|
const scale =
|
||||||
targetRatio < sourceRatio
|
targetRatio < sourceRatio
|
||||||
? targetWidth / sourceWidth
|
? targetWidth / sourceWidth
|
||||||
: targetHeight / sourceHeight
|
: targetHeight / sourceHeight
|
||||||
@@ -347,11 +348,11 @@ export class Player {
|
|||||||
this.config.animation &&
|
this.config.animation &&
|
||||||
now - this.lastFrameTime > fpsInterval
|
now - this.lastFrameTime > fpsInterval
|
||||||
) {
|
) {
|
||||||
let ctx = this.context
|
const ctx = this.context
|
||||||
let gl = ctx.gl
|
const gl = ctx.gl
|
||||||
|
|
||||||
// Clear the viewport
|
// Clear the viewport
|
||||||
let bg = new spine.Color().setFromString(
|
const bg = new spine.Color().setFromString(
|
||||||
this.config.backgroundColor
|
this.config.backgroundColor
|
||||||
)
|
)
|
||||||
gl.clearColor(bg.r, bg.g, bg.b, bg.a)
|
gl.clearColor(bg.r, bg.g, bg.b, bg.a)
|
||||||
@@ -359,9 +360,9 @@ export class Player {
|
|||||||
|
|
||||||
this.lastFrameTime = now
|
this.lastFrameTime = now
|
||||||
this.time.update()
|
this.time.update()
|
||||||
let delta = this.time.delta * this.speed
|
const delta = this.time.delta * this.speed
|
||||||
|
|
||||||
let animationDuration =
|
const animationDuration =
|
||||||
this.animationState.getCurrent(0).animation.duration
|
this.animationState.getCurrent(0).animation.duration
|
||||||
this.playTime += delta
|
this.playTime += delta
|
||||||
while (
|
while (
|
||||||
@@ -398,12 +399,12 @@ export class Player {
|
|||||||
(this.currentViewport.padTop as number),
|
(this.currentViewport.padTop as number),
|
||||||
}
|
}
|
||||||
|
|
||||||
let transitionAlpha =
|
const transitionAlpha =
|
||||||
(performance.now() - this.viewportTransitionStart) /
|
(performance.now() - this.viewportTransitionStart) /
|
||||||
1000 /
|
1000 /
|
||||||
this.config.viewport.transitionTime
|
this.config.viewport.transitionTime
|
||||||
if (this.previousViewport && transitionAlpha < 1) {
|
if (this.previousViewport && transitionAlpha < 1) {
|
||||||
let oldViewport = {
|
const oldViewport = {
|
||||||
x:
|
x:
|
||||||
this.previousViewport.x -
|
this.previousViewport.x -
|
||||||
(this.previousViewport.padLeft as number),
|
(this.previousViewport.padLeft as number),
|
||||||
@@ -437,7 +438,7 @@ export class Player {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let viewportSize = this.scaleViewport(
|
const viewportSize = this.scaleViewport(
|
||||||
viewport.width,
|
viewport.width,
|
||||||
viewport.height,
|
viewport.height,
|
||||||
this.canvas.width,
|
this.canvas.width,
|
||||||
@@ -472,13 +473,13 @@ export class Player {
|
|||||||
targetWidth: number,
|
targetWidth: number,
|
||||||
targetHeight: number
|
targetHeight: number
|
||||||
): spine.Vector2 {
|
): spine.Vector2 {
|
||||||
let targetRatio = targetHeight / targetWidth
|
const targetRatio = targetHeight / targetWidth
|
||||||
let sourceRatio = sourceHeight / sourceWidth
|
const sourceRatio = sourceHeight / sourceWidth
|
||||||
let scale =
|
const scale =
|
||||||
targetRatio > sourceRatio
|
targetRatio > sourceRatio
|
||||||
? targetWidth / sourceWidth
|
? targetWidth / sourceWidth
|
||||||
: targetHeight / sourceHeight
|
: targetHeight / sourceHeight
|
||||||
let temp = new spine.Vector2()
|
const temp = new spine.Vector2()
|
||||||
temp.x = sourceWidth * scale
|
temp.x = sourceWidth * scale
|
||||||
temp.y = sourceHeight * scale
|
temp.y = sourceHeight * scale
|
||||||
return temp
|
return temp
|
||||||
@@ -495,39 +496,39 @@ export class Player {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
let atlas = this.assetManager.get(this.config.atlasUrl)
|
const atlas = this.assetManager.get(this.config.atlasUrl)
|
||||||
let skeletonData: spine.SkeletonData
|
let skeletonData: spine.SkeletonData
|
||||||
if (this.config.jsonUrl) {
|
if (this.config.jsonUrl) {
|
||||||
let jsonText = this.assetManager.get(this.config.jsonUrl)
|
const jsonText = this.assetManager.get(this.config.jsonUrl)
|
||||||
let json = new spine.SkeletonJson(
|
const json = new spine.SkeletonJson(
|
||||||
new spine.AtlasAttachmentLoader(atlas)
|
new spine.AtlasAttachmentLoader(atlas)
|
||||||
)
|
)
|
||||||
try {
|
try {
|
||||||
skeletonData = json.readSkeletonData(jsonText)
|
skeletonData = json.readSkeletonData(jsonText)
|
||||||
} catch (e: any) {
|
} catch (e: unknown) {
|
||||||
this.showError(
|
this.showError(
|
||||||
'Error: could not load skeleton .json.<br><br>' +
|
'Error: could not load skeleton .json.<br><br>' +
|
||||||
e.toString()
|
(e as Error).toString()
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let binaryData = this.assetManager.get(this.config.skelUrl!)
|
const binaryData = this.assetManager.get(this.config.skelUrl!)
|
||||||
let binary = new spine.SkeletonBinary(
|
const binary = new spine.SkeletonBinary(
|
||||||
new spine.AtlasAttachmentLoader(atlas)
|
new spine.AtlasAttachmentLoader(atlas)
|
||||||
)
|
)
|
||||||
try {
|
try {
|
||||||
skeletonData = binary.readSkeletonData(binaryData)
|
skeletonData = binary.readSkeletonData(binaryData)
|
||||||
} catch (e: any) {
|
} catch (e: unknown) {
|
||||||
this.showError(
|
this.showError(
|
||||||
'Error: could not load skeleton .skel.<br><br>' +
|
'Error: could not load skeleton .skel.<br><br>' +
|
||||||
e.toString()
|
(e as Error).toString()
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.skeleton = new spine.Skeleton(skeletonData)
|
this.skeleton = new spine.Skeleton(skeletonData)
|
||||||
let stateData = new spine.AnimationStateData(skeletonData)
|
const stateData = new spine.AnimationStateData(skeletonData)
|
||||||
stateData.defaultMix = this.config.defaultMix
|
stateData.defaultMix = this.config.defaultMix
|
||||||
this.animationState = new spine.AnimationState(stateData)
|
this.animationState = new spine.AnimationState(stateData)
|
||||||
|
|
||||||
@@ -568,7 +569,7 @@ export class Player {
|
|||||||
// if all animations for which viewports where given
|
// if all animations for which viewports where given
|
||||||
// exist.
|
// exist.
|
||||||
if (!this.config.viewport) {
|
if (!this.config.viewport) {
|
||||||
;(this.config.viewport as any) = {
|
;(this.config.viewport as unknown) = {
|
||||||
animations: {},
|
animations: {},
|
||||||
transitionTime: 0.2,
|
transitionTime: 0.2,
|
||||||
}
|
}
|
||||||
@@ -645,10 +646,10 @@ export class Player {
|
|||||||
public setAnimation(animation: string, loop: boolean = true) {
|
public setAnimation(animation: string, loop: boolean = true) {
|
||||||
// Determine viewport
|
// Determine viewport
|
||||||
this.previousViewport = this.currentViewport
|
this.previousViewport = this.currentViewport
|
||||||
let animViewport = this.calculateAnimationViewport(animation)
|
const animViewport = this.calculateAnimationViewport(animation)
|
||||||
|
|
||||||
// The calculated animation viewport is the base
|
// The calculated animation viewport is the base
|
||||||
let viewport: Viewport = {
|
const viewport: Viewport = {
|
||||||
x: animViewport.x,
|
x: animViewport.x,
|
||||||
y: animViewport.y,
|
y: animViewport.y,
|
||||||
width: animViewport.width,
|
width: animViewport.width,
|
||||||
@@ -660,7 +661,7 @@ export class Player {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Override with global viewport settings if they exist
|
// Override with global viewport settings if they exist
|
||||||
let globalViewport = this.config.viewport
|
const globalViewport = this.config.viewport
|
||||||
if (
|
if (
|
||||||
typeof globalViewport.x !== 'undefined' &&
|
typeof globalViewport.x !== 'undefined' &&
|
||||||
typeof globalViewport.y !== 'undefined' &&
|
typeof globalViewport.y !== 'undefined' &&
|
||||||
@@ -682,7 +683,7 @@ export class Player {
|
|||||||
viewport.padBottom = globalViewport.padBottom
|
viewport.padBottom = globalViewport.padBottom
|
||||||
|
|
||||||
// Override with animation viewport settings given by user for final result.
|
// Override with animation viewport settings given by user for final result.
|
||||||
let userAnimViewport = this.config.viewport.animations[animation]
|
const userAnimViewport = this.config.viewport.animations[animation]
|
||||||
if (userAnimViewport) {
|
if (userAnimViewport) {
|
||||||
if (
|
if (
|
||||||
typeof userAnimViewport.x !== 'undefined' &&
|
typeof userAnimViewport.x !== 'undefined' &&
|
||||||
@@ -753,21 +754,21 @@ export class Player {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private calculateAnimationViewport(animationName: string) {
|
private calculateAnimationViewport(animationName: string) {
|
||||||
let animation = this.skeleton.data.findAnimation(animationName)
|
const animation = this.skeleton.data.findAnimation(animationName)
|
||||||
this.animationState.clearTracks()
|
this.animationState.clearTracks()
|
||||||
this.skeleton.setToSetupPose()
|
this.skeleton.setToSetupPose()
|
||||||
this.animationState.setAnimationWith(0, animation, true)
|
this.animationState.setAnimationWith(0, animation, true)
|
||||||
|
|
||||||
let steps = 100
|
const steps = 100
|
||||||
let stepTime = animation.duration > 0 ? animation.duration / steps : 0
|
const stepTime = animation.duration > 0 ? animation.duration / steps : 0
|
||||||
let minX = 100000000
|
let minX = 100000000
|
||||||
let maxX = -100000000
|
let maxX = -100000000
|
||||||
let minY = 100000000
|
let minY = 100000000
|
||||||
let maxY = -100000000
|
let maxY = -100000000
|
||||||
let offset = new spine.Vector2()
|
const offset = new spine.Vector2()
|
||||||
let size = new spine.Vector2()
|
const size = new spine.Vector2()
|
||||||
|
|
||||||
for (var i = 0; i < steps; i++) {
|
for (let i = 0; i < steps; i++) {
|
||||||
this.animationState.update(stepTime)
|
this.animationState.update(stepTime)
|
||||||
this.animationState.apply(this.skeleton)
|
this.animationState.apply(this.skeleton)
|
||||||
this.skeleton.updateWorldTransform()
|
this.skeleton.updateWorldTransform()
|
||||||
@@ -804,7 +805,7 @@ export class Player {
|
|||||||
private addEventListener(
|
private addEventListener(
|
||||||
target: HTMLElement | Document | Window,
|
target: HTMLElement | Document | Window,
|
||||||
event: keyof HTMLElementEventMap,
|
event: keyof HTMLElementEventMap,
|
||||||
func: (this: HTMLElement, ev: Event) => any
|
func: EventListenerOrEventListenerObject
|
||||||
) {
|
) {
|
||||||
this.eventListeners.push({ target: target, event: event, func: func })
|
this.eventListeners.push({ target: target, event: event, func: func })
|
||||||
target.addEventListener(event, func)
|
target.addEventListener(event, func)
|
||||||
@@ -813,8 +814,8 @@ export class Player {
|
|||||||
public dispose() {
|
public dispose() {
|
||||||
this.sceneRenderer.dispose()
|
this.sceneRenderer.dispose()
|
||||||
this.assetManager.dispose()
|
this.assetManager.dispose()
|
||||||
for (var i = 0; i < this.eventListeners.length; i++) {
|
for (let i = 0; i < this.eventListeners.length; i++) {
|
||||||
var eventListener = this.eventListeners[i]
|
const eventListener = this.eventListeners[i]
|
||||||
eventListener.target.removeEventListener(
|
eventListener.target.removeEventListener(
|
||||||
eventListener.event,
|
eventListener.event,
|
||||||
eventListener.func
|
eventListener.func
|
||||||
@@ -824,7 +825,7 @@ export class Player {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public updateViewport(viewport: Viewport) {
|
public updateViewport(viewport: Viewport) {
|
||||||
var _currentViewport = this.currentViewport
|
const _currentViewport = this.currentViewport
|
||||||
_currentViewport.padLeft = this.percentageToWorldUnit(
|
_currentViewport.padLeft = this.percentageToWorldUnit(
|
||||||
_currentViewport.width,
|
_currentViewport.width,
|
||||||
viewport.padLeft
|
viewport.padLeft
|
||||||
@@ -854,14 +855,14 @@ export class Player {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const findWithClass = (dom: HTMLElement, className: string): HTMLElement[] => {
|
const findWithClass = (dom: HTMLElement, className: string): HTMLElement[] => {
|
||||||
let found = new Array<HTMLElement>()
|
const found = new Array<HTMLElement>()
|
||||||
let findRecursive = (
|
const findRecursive = (
|
||||||
dom: HTMLElement,
|
dom: HTMLElement,
|
||||||
className: string,
|
className: string,
|
||||||
found: HTMLElement[]
|
found: HTMLElement[]
|
||||||
) => {
|
) => {
|
||||||
for (var i = 0; i < dom.children.length; i++) {
|
for (let i = 0; i < dom.children.length; i++) {
|
||||||
let child = dom.children[i] as HTMLElement
|
const child = dom.children[i] as HTMLElement
|
||||||
if (child.classList.contains(className)) found.push(child)
|
if (child.classList.contains(className)) found.push(child)
|
||||||
findRecursive(child, className, found)
|
findRecursive(child, className, found)
|
||||||
}
|
}
|
||||||
@@ -871,7 +872,7 @@ const findWithClass = (dom: HTMLElement, className: string): HTMLElement[] => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const createElement = (html: string): HTMLElement => {
|
const createElement = (html: string): HTMLElement => {
|
||||||
let dom = document.createElement('div')
|
const dom = document.createElement('div')
|
||||||
dom.innerHTML = html
|
dom.innerHTML = html
|
||||||
return dom.children[0] as HTMLElement
|
return dom.children[0] as HTMLElement
|
||||||
}
|
}
|
||||||
|
|||||||
5
apps/module/stylelint.config.js
Normal file
5
apps/module/stylelint.config.js
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
import baseConfig from '@aklive2d/stylelint-config'
|
||||||
|
/** @type {import('stylelint').Config} */
|
||||||
|
export default {
|
||||||
|
...baseConfig,
|
||||||
|
}
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "ES2020",
|
"target": "ES2024",
|
||||||
"useDefineForClassFields": true,
|
"useDefineForClassFields": true,
|
||||||
"module": "ESNext",
|
"module": "ESNext",
|
||||||
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
"lib": ["ES2024", "DOM", "DOM.Iterable"],
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
|
|
||||||
/* Bundler mode */
|
/* Bundler mode */
|
||||||
@@ -20,5 +20,6 @@
|
|||||||
"noFallthroughCasesInSwitch": true,
|
"noFallthroughCasesInSwitch": true,
|
||||||
"noUncheckedSideEffectImports": true
|
"noUncheckedSideEffectImports": true
|
||||||
},
|
},
|
||||||
"include": ["src"]
|
"include": ["**/*"],
|
||||||
|
"exclude": ["spine-ts/**/*"]
|
||||||
}
|
}
|
||||||
|
|||||||
39
bun.lock
39
bun.lock
@@ -50,6 +50,15 @@
|
|||||||
"apps/module": {
|
"apps/module": {
|
||||||
"name": "@aklive2d/module",
|
"name": "@aklive2d/module",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
|
"devDependencies": {
|
||||||
|
"@aklive2d/postcss-config": "workspace:*",
|
||||||
|
"@aklive2d/prettier-config": "workspace:*",
|
||||||
|
"@aklive2d/stylelint-config": "workspace:*",
|
||||||
|
"eslint-plugin-prettier": "^5.2.6",
|
||||||
|
"globals": "^16.0.0",
|
||||||
|
"typescript": "^5.8.3",
|
||||||
|
"typescript-eslint": "^8.31.1",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
"apps/showcase": {
|
"apps/showcase": {
|
||||||
"name": "@aklive2d/showcase",
|
"name": "@aklive2d/showcase",
|
||||||
@@ -596,6 +605,22 @@
|
|||||||
|
|
||||||
"@types/react-dom": ["@types/react-dom@19.1.3", "", { "peerDependencies": { "@types/react": "^19.0.0" } }, "sha512-rJXC08OG0h3W6wDMFxQrZF00Kq6qQvw0djHRdzl3U5DnIERz0MRce3WVc7IS6JYBwtaP/DwYtRRjVlvivNveKg=="],
|
"@types/react-dom": ["@types/react-dom@19.1.3", "", { "peerDependencies": { "@types/react": "^19.0.0" } }, "sha512-rJXC08OG0h3W6wDMFxQrZF00Kq6qQvw0djHRdzl3U5DnIERz0MRce3WVc7IS6JYBwtaP/DwYtRRjVlvivNveKg=="],
|
||||||
|
|
||||||
|
"@typescript-eslint/eslint-plugin": ["@typescript-eslint/eslint-plugin@8.31.1", "", { "dependencies": { "@eslint-community/regexpp": "^4.10.0", "@typescript-eslint/scope-manager": "8.31.1", "@typescript-eslint/type-utils": "8.31.1", "@typescript-eslint/utils": "8.31.1", "@typescript-eslint/visitor-keys": "8.31.1", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", "ts-api-utils": "^2.0.1" }, "peerDependencies": { "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <5.9.0" } }, "sha512-oUlH4h1ABavI4F0Xnl8/fOtML/eu8nI2A1nYd+f+55XI0BLu+RIqKoCiZKNo6DtqZBEQm5aNKA20G3Z5w3R6GQ=="],
|
||||||
|
|
||||||
|
"@typescript-eslint/parser": ["@typescript-eslint/parser@8.31.1", "", { "dependencies": { "@typescript-eslint/scope-manager": "8.31.1", "@typescript-eslint/types": "8.31.1", "@typescript-eslint/typescript-estree": "8.31.1", "@typescript-eslint/visitor-keys": "8.31.1", "debug": "^4.3.4" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <5.9.0" } }, "sha512-oU/OtYVydhXnumd0BobL9rkJg7wFJ9bFFPmSmB/bf/XWN85hlViji59ko6bSKBXyseT9V8l+CN1nwmlbiN0G7Q=="],
|
||||||
|
|
||||||
|
"@typescript-eslint/scope-manager": ["@typescript-eslint/scope-manager@8.31.1", "", { "dependencies": { "@typescript-eslint/types": "8.31.1", "@typescript-eslint/visitor-keys": "8.31.1" } }, "sha512-BMNLOElPxrtNQMIsFHE+3P0Yf1z0dJqV9zLdDxN/xLlWMlXK/ApEsVEKzpizg9oal8bAT5Sc7+ocal7AC1HCVw=="],
|
||||||
|
|
||||||
|
"@typescript-eslint/type-utils": ["@typescript-eslint/type-utils@8.31.1", "", { "dependencies": { "@typescript-eslint/typescript-estree": "8.31.1", "@typescript-eslint/utils": "8.31.1", "debug": "^4.3.4", "ts-api-utils": "^2.0.1" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <5.9.0" } }, "sha512-fNaT/m9n0+dpSp8G/iOQ05GoHYXbxw81x+yvr7TArTuZuCA6VVKbqWYVZrV5dVagpDTtj/O8k5HBEE/p/HM5LA=="],
|
||||||
|
|
||||||
|
"@typescript-eslint/types": ["@typescript-eslint/types@8.31.1", "", {}, "sha512-SfepaEFUDQYRoA70DD9GtytljBePSj17qPxFHA/h3eg6lPTqGJ5mWOtbXCk1YrVU1cTJRd14nhaXWFu0l2troQ=="],
|
||||||
|
|
||||||
|
"@typescript-eslint/typescript-estree": ["@typescript-eslint/typescript-estree@8.31.1", "", { "dependencies": { "@typescript-eslint/types": "8.31.1", "@typescript-eslint/visitor-keys": "8.31.1", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", "minimatch": "^9.0.4", "semver": "^7.6.0", "ts-api-utils": "^2.0.1" }, "peerDependencies": { "typescript": ">=4.8.4 <5.9.0" } }, "sha512-kaA0ueLe2v7KunYOyWYtlf/QhhZb7+qh4Yw6Ni5kgukMIG+iP773tjgBiLWIXYumWCwEq3nLW+TUywEp8uEeag=="],
|
||||||
|
|
||||||
|
"@typescript-eslint/utils": ["@typescript-eslint/utils@8.31.1", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@typescript-eslint/scope-manager": "8.31.1", "@typescript-eslint/types": "8.31.1", "@typescript-eslint/typescript-estree": "8.31.1" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <5.9.0" } }, "sha512-2DSI4SNfF5T4oRveQ4nUrSjUqjMND0nLq9rEkz0gfGr3tg0S5KB6DhwR+WZPCjzkZl3cH+4x2ce3EsL50FubjQ=="],
|
||||||
|
|
||||||
|
"@typescript-eslint/visitor-keys": ["@typescript-eslint/visitor-keys@8.31.1", "", { "dependencies": { "@typescript-eslint/types": "8.31.1", "eslint-visitor-keys": "^4.2.0" } }, "sha512-I+/rgqOVBn6f0o7NDTmAPWWC6NuqhV174lfYvAm9fUaWeiefLdux9/YI3/nLugEn9L8fcSi0XmpKi/r5u0nmpw=="],
|
||||||
|
|
||||||
"@vitejs/plugin-react-swc": ["@vitejs/plugin-react-swc@3.9.0", "", { "dependencies": { "@swc/core": "^1.11.21" }, "peerDependencies": { "vite": "^4 || ^5 || ^6" } }, "sha512-jYFUSXhwMCYsh/aQTgSGLIN3Foz5wMbH9ahb0Zva//UzwZYbMiZd7oT3AU9jHT9DLswYDswsRwPU9jVF3yA48Q=="],
|
"@vitejs/plugin-react-swc": ["@vitejs/plugin-react-swc@3.9.0", "", { "dependencies": { "@swc/core": "^1.11.21" }, "peerDependencies": { "vite": "^4 || ^5 || ^6" } }, "sha512-jYFUSXhwMCYsh/aQTgSGLIN3Foz5wMbH9ahb0Zva//UzwZYbMiZd7oT3AU9jHT9DLswYDswsRwPU9jVF3yA48Q=="],
|
||||||
|
|
||||||
"acorn": ["acorn@8.14.1", "", { "bin": { "acorn": "bin/acorn" } }, "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg=="],
|
"acorn": ["acorn@8.14.1", "", { "bin": { "acorn": "bin/acorn" } }, "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg=="],
|
||||||
@@ -906,6 +931,8 @@
|
|||||||
|
|
||||||
"graceful-fs": ["graceful-fs@4.2.11", "", {}, "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="],
|
"graceful-fs": ["graceful-fs@4.2.11", "", {}, "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="],
|
||||||
|
|
||||||
|
"graphemer": ["graphemer@1.4.0", "", {}, "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag=="],
|
||||||
|
|
||||||
"has-bigints": ["has-bigints@1.1.0", "", {}, "sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg=="],
|
"has-bigints": ["has-bigints@1.1.0", "", {}, "sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg=="],
|
||||||
|
|
||||||
"has-flag": ["has-flag@4.0.0", "", {}, "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="],
|
"has-flag": ["has-flag@4.0.0", "", {}, "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="],
|
||||||
@@ -1384,6 +1411,8 @@
|
|||||||
|
|
||||||
"tr46": ["tr46@5.1.1", "", { "dependencies": { "punycode": "^2.3.1" } }, "sha512-hdF5ZgjTqgAntKkklYw0R03MG2x/bSzTtkxmIRw/sTNV8YXsCJ1tfLAX23lhxhHJlEf3CRCOCGGWw3vI3GaSPw=="],
|
"tr46": ["tr46@5.1.1", "", { "dependencies": { "punycode": "^2.3.1" } }, "sha512-hdF5ZgjTqgAntKkklYw0R03MG2x/bSzTtkxmIRw/sTNV8YXsCJ1tfLAX23lhxhHJlEf3CRCOCGGWw3vI3GaSPw=="],
|
||||||
|
|
||||||
|
"ts-api-utils": ["ts-api-utils@2.1.0", "", { "peerDependencies": { "typescript": ">=4.8.4" } }, "sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ=="],
|
||||||
|
|
||||||
"tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
|
"tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
|
||||||
|
|
||||||
"turbo": ["turbo@2.5.2", "", { "optionalDependencies": { "turbo-darwin-64": "2.5.2", "turbo-darwin-arm64": "2.5.2", "turbo-linux-64": "2.5.2", "turbo-linux-arm64": "2.5.2", "turbo-windows-64": "2.5.2", "turbo-windows-arm64": "2.5.2" }, "bin": { "turbo": "bin/turbo" } }, "sha512-Qo5lfuStr6LQh3sPQl7kIi243bGU4aHGDQJUf6ylAdGwks30jJFloc9NYHP7Y373+gGU9OS0faA4Mb5Sy8X9Xw=="],
|
"turbo": ["turbo@2.5.2", "", { "optionalDependencies": { "turbo-darwin-64": "2.5.2", "turbo-darwin-arm64": "2.5.2", "turbo-linux-64": "2.5.2", "turbo-linux-arm64": "2.5.2", "turbo-windows-64": "2.5.2", "turbo-windows-arm64": "2.5.2" }, "bin": { "turbo": "bin/turbo" } }, "sha512-Qo5lfuStr6LQh3sPQl7kIi243bGU4aHGDQJUf6ylAdGwks30jJFloc9NYHP7Y373+gGU9OS0faA4Mb5Sy8X9Xw=="],
|
||||||
@@ -1416,6 +1445,8 @@
|
|||||||
|
|
||||||
"typescript": ["typescript@5.8.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ=="],
|
"typescript": ["typescript@5.8.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ=="],
|
||||||
|
|
||||||
|
"typescript-eslint": ["typescript-eslint@8.31.1", "", { "dependencies": { "@typescript-eslint/eslint-plugin": "8.31.1", "@typescript-eslint/parser": "8.31.1", "@typescript-eslint/utils": "8.31.1" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <5.9.0" } }, "sha512-j6DsEotD/fH39qKzXTQRwYYWlt7D+0HmfpOK+DVhwJOFLcdmn92hq3mBb7HlKJHbjjI/gTOqEcc9d6JfpFf/VA=="],
|
||||||
|
|
||||||
"unbox-primitive": ["unbox-primitive@1.1.0", "", { "dependencies": { "call-bound": "^1.0.3", "has-bigints": "^1.0.2", "has-symbols": "^1.1.0", "which-boxed-primitive": "^1.1.1" } }, "sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw=="],
|
"unbox-primitive": ["unbox-primitive@1.1.0", "", { "dependencies": { "call-bound": "^1.0.3", "has-bigints": "^1.0.2", "has-symbols": "^1.1.0", "which-boxed-primitive": "^1.1.1" } }, "sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw=="],
|
||||||
|
|
||||||
"undici-types": ["undici-types@6.21.0", "", {}, "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ=="],
|
"undici-types": ["undici-types@6.21.0", "", {}, "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ=="],
|
||||||
@@ -1478,6 +1509,8 @@
|
|||||||
|
|
||||||
"yocto-queue": ["yocto-queue@0.1.0", "", {}, "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q=="],
|
"yocto-queue": ["yocto-queue@0.1.0", "", {}, "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q=="],
|
||||||
|
|
||||||
|
"@aklive2d/module/globals": ["globals@16.0.0", "", {}, "sha512-iInW14XItCXET01CQFqudPOWP2jYMl7T+QRQT+UNcR/iQncN/F0UNpgd76iFkBPgNQb4+X3LV9tLJYzwh+Gl3A=="],
|
||||||
|
|
||||||
"@commitlint/config-validator/ajv": ["ajv@8.17.1", "", { "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", "json-schema-traverse": "^1.0.0", "require-from-string": "^2.0.2" } }, "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g=="],
|
"@commitlint/config-validator/ajv": ["ajv@8.17.1", "", { "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", "json-schema-traverse": "^1.0.0", "require-from-string": "^2.0.2" } }, "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g=="],
|
||||||
|
|
||||||
"@commitlint/load/chalk": ["chalk@5.4.1", "", {}, "sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w=="],
|
"@commitlint/load/chalk": ["chalk@5.4.1", "", {}, "sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w=="],
|
||||||
@@ -1494,6 +1527,8 @@
|
|||||||
|
|
||||||
"@parcel/watcher/detect-libc": ["detect-libc@1.0.3", "", { "bin": { "detect-libc": "./bin/detect-libc.js" } }, "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg=="],
|
"@parcel/watcher/detect-libc": ["detect-libc@1.0.3", "", { "bin": { "detect-libc": "./bin/detect-libc.js" } }, "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg=="],
|
||||||
|
|
||||||
|
"@typescript-eslint/typescript-estree/minimatch": ["minimatch@9.0.5", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow=="],
|
||||||
|
|
||||||
"ansi-styles/color-convert": ["color-convert@1.9.3", "", { "dependencies": { "color-name": "1.1.3" } }, "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg=="],
|
"ansi-styles/color-convert": ["color-convert@1.9.3", "", { "dependencies": { "color-name": "1.1.3" } }, "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg=="],
|
||||||
|
|
||||||
"brace-expansion/balanced-match": ["balanced-match@1.0.2", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="],
|
"brace-expansion/balanced-match": ["balanced-match@1.0.2", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="],
|
||||||
@@ -1562,6 +1597,8 @@
|
|||||||
|
|
||||||
"@commitlint/config-validator/ajv/json-schema-traverse": ["json-schema-traverse@1.0.0", "", {}, "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug=="],
|
"@commitlint/config-validator/ajv/json-schema-traverse": ["json-schema-traverse@1.0.0", "", {}, "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug=="],
|
||||||
|
|
||||||
|
"@typescript-eslint/typescript-estree/minimatch/brace-expansion": ["brace-expansion@2.0.1", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA=="],
|
||||||
|
|
||||||
"ansi-styles/color-convert/color-name": ["color-name@1.1.3", "", {}, "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw=="],
|
"ansi-styles/color-convert/color-name": ["color-name@1.1.3", "", {}, "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw=="],
|
||||||
|
|
||||||
"eslint/chalk/ansi-styles": ["ansi-styles@4.3.0", "", { "dependencies": { "color-convert": "^2.0.1" } }, "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="],
|
"eslint/chalk/ansi-styles": ["ansi-styles@4.3.0", "", { "dependencies": { "color-convert": "^2.0.1" } }, "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="],
|
||||||
@@ -1590,6 +1627,8 @@
|
|||||||
|
|
||||||
"table/ajv/json-schema-traverse": ["json-schema-traverse@1.0.0", "", {}, "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug=="],
|
"table/ajv/json-schema-traverse": ["json-schema-traverse@1.0.0", "", {}, "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug=="],
|
||||||
|
|
||||||
|
"@typescript-eslint/typescript-estree/minimatch/brace-expansion/balanced-match": ["balanced-match@1.0.2", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="],
|
||||||
|
|
||||||
"resolve-dir/global-modules/global-prefix/which": ["which@1.3.1", "", { "dependencies": { "isexe": "^2.0.0" }, "bin": { "which": "./bin/which" } }, "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ=="],
|
"resolve-dir/global-modules/global-prefix/which": ["which@1.3.1", "", { "dependencies": { "isexe": "^2.0.0" }, "bin": { "which": "./bin/which" } }, "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ=="],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,17 @@
|
|||||||
import js from '@eslint/js'
|
import js from '@eslint/js'
|
||||||
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
|
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'
|
||||||
import globals from 'globals'
|
import globals from 'globals'
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
{ ignores: ['dist'] },
|
{ ignores: ['dist'] },
|
||||||
{
|
{
|
||||||
files: ['**/*.{js,jsx}'],
|
files: ['**/*.{js,jsx}', '**/*.{ts,tsx}'],
|
||||||
languageOptions: {
|
languageOptions: {
|
||||||
ecmaVersion: 2020,
|
ecmaVersion: 2020,
|
||||||
globals: globals.browser,
|
globals: {
|
||||||
|
...globals.browser,
|
||||||
|
...globals.node,
|
||||||
|
},
|
||||||
parserOptions: {
|
parserOptions: {
|
||||||
ecmaVersion: 'latest',
|
ecmaVersion: 'latest',
|
||||||
ecmaFeatures: { jsx: true },
|
ecmaFeatures: { jsx: true },
|
||||||
|
|||||||
Reference in New Issue
Block a user