poi-plugin-quest-info-2 0.7.2 → 0.8.0
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/.eslintrc.js +1 -2
- package/build/kcQuestsData/DATA_VERSION +1 -1
- package/build/kcQuestsData/index.ts +1 -1
- package/build/kcQuestsData/quests-scn-new.json +1 -3
- package/build/kcQuestsData/quests-scn.json +72 -72
- package/build/kcanotifyGamedata/DATA_VERSION +1 -1
- package/build/kcanotifyGamedata/index.ts +1 -1
- package/build/kcanotifyGamedata/quests-en.json +12 -0
- package/build/kcanotifyGamedata/quests-jp.json +12 -0
- package/build/kcanotifyGamedata/quests-ko.json +12 -5
- package/build/kcanotifyGamedata/quests-scn.json +12 -0
- package/build/kcanotifyGamedata/quests-tcn.json +12 -0
- package/build/prePostQuest.json +4498 -0
- package/build/questCategory.json +590 -588
- package/build/questCodeMap.json +575 -0
- package/i18n/en-US.json +1 -0
- package/i18n/ja-JP.json +1 -0
- package/i18n/ko-KR.json +1 -0
- package/i18n/zh-CN.json +1 -0
- package/i18n/zh-TW.json +1 -0
- package/package.json +15 -15
- package/src/__tests__/__snapshots__/questCategory.spec.ts.snap +113 -113
- package/src/__tests__/kcanotifyData.spec.ts +14 -1
- package/src/__tests__/kcwikiData.spec.ts +11 -1
- package/src/__tests__/questCategory.spec.ts +4 -4
- package/src/components/QuestCard/MinimalQuestCard.tsx +14 -14
- package/src/components/QuestCard/index.tsx +90 -55
- package/src/components/QuestCard/styles.ts +17 -0
- package/src/components/QuestList.tsx +5 -8
- package/src/components/QuestTag.tsx +104 -0
- package/src/poi/hooks.ts +8 -5
- package/src/questHelper.ts +25 -4
- package/src/store/kcwiki.ts +7 -3
- package/src/store/quest.ts +91 -10
- package/src/tags.tsx +2 -2
- package/scripts/convertAssets.ts +0 -57
- package/scripts/downloadKcQuestsData.ts +0 -136
- package/scripts/downloadKcanotifyGamedata.ts +0 -132
- package/scripts/downloadSprites.ts +0 -126
- package/scripts/genQuestCategory.ts +0 -58
- package/scripts/proxyFetch.ts +0 -42
- package/scripts/utils.ts +0 -8
- package/src/components/PreTaskTag.tsx +0 -40
package/scripts/proxyFetch.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-console */
|
|
2
|
-
import nodeFetch from 'node-fetch'
|
|
3
|
-
import type { Request, RequestInfo } from 'node-fetch'
|
|
4
|
-
import type { Agent } from 'http'
|
|
5
|
-
import { HttpsProxyAgent } from 'https-proxy-agent'
|
|
6
|
-
|
|
7
|
-
const withAgent =
|
|
8
|
-
(agent: Agent) =>
|
|
9
|
-
(fetch: typeof nodeFetch): typeof nodeFetch => {
|
|
10
|
-
const isRequest = (input: RequestInfo): input is Request => {
|
|
11
|
-
return typeof input === 'object' && !('href' in input)
|
|
12
|
-
}
|
|
13
|
-
return new Proxy(fetch, {
|
|
14
|
-
apply(target, thisArg: unknown, argArray: Parameters<typeof nodeFetch>) {
|
|
15
|
-
if (isRequest(argArray[0])) {
|
|
16
|
-
// Request
|
|
17
|
-
if (!argArray[0].agent) {
|
|
18
|
-
argArray[0].agent = agent
|
|
19
|
-
}
|
|
20
|
-
} else {
|
|
21
|
-
// URL or URLLike + ?RequestInit
|
|
22
|
-
if (!argArray[1]) {
|
|
23
|
-
argArray[1] = {}
|
|
24
|
-
}
|
|
25
|
-
if (!argArray[1].agent) {
|
|
26
|
-
argArray[1].agent = agent
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
return target.apply(thisArg, argArray)
|
|
30
|
-
},
|
|
31
|
-
})
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
let fetch = nodeFetch
|
|
35
|
-
// HTTP/HTTPS proxy to connect to
|
|
36
|
-
const proxy = process.env.https_proxy || process.env.http_proxy
|
|
37
|
-
if (proxy) {
|
|
38
|
-
console.log('using proxy server %j', proxy)
|
|
39
|
-
fetch = withAgent(new HttpsProxyAgent(proxy))(nodeFetch)
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export { fetch }
|
package/scripts/utils.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { Tag } from '@blueprintjs/core'
|
|
2
|
-
import React, { useCallback } from 'react'
|
|
3
|
-
import styled from 'styled-components'
|
|
4
|
-
import { guessQuestCategory } from '../questHelper'
|
|
5
|
-
import { useFilterTags } from '../store/filterTags'
|
|
6
|
-
import { useSearchInput } from '../store/search'
|
|
7
|
-
|
|
8
|
-
const TagWrapper = styled(Tag)`
|
|
9
|
-
margin: 0 4px;
|
|
10
|
-
user-select: none;
|
|
11
|
-
|
|
12
|
-
& > span {
|
|
13
|
-
cursor: pointer;
|
|
14
|
-
}
|
|
15
|
-
`
|
|
16
|
-
|
|
17
|
-
export const PreTaskTag = ({ code }: { code: string }) => {
|
|
18
|
-
const { setSearchInput } = useSearchInput()
|
|
19
|
-
const { setCategoryTagsAll, setTypeTagsAll } = useFilterTags()
|
|
20
|
-
|
|
21
|
-
const handleClick = useCallback(() => {
|
|
22
|
-
setSearchInput(code)
|
|
23
|
-
setCategoryTagsAll()
|
|
24
|
-
setTypeTagsAll()
|
|
25
|
-
}, [code, setCategoryTagsAll, setSearchInput, setTypeTagsAll])
|
|
26
|
-
const indicatorColor = guessQuestCategory(code).color
|
|
27
|
-
const fontColor =
|
|
28
|
-
indicatorColor === '#fff' || indicatorColor === '#87da61'
|
|
29
|
-
? 'black'
|
|
30
|
-
: 'white'
|
|
31
|
-
return (
|
|
32
|
-
<TagWrapper
|
|
33
|
-
onClick={handleClick}
|
|
34
|
-
interactive
|
|
35
|
-
style={{ color: fontColor, background: indicatorColor }}
|
|
36
|
-
>
|
|
37
|
-
{code}
|
|
38
|
-
</TagWrapper>
|
|
39
|
-
)
|
|
40
|
-
}
|