poi-plugin-quest-info-2 0.12.3 → 0.12.5

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.
@@ -94,6 +94,7 @@
94
94
  "A90": 195,
95
95
  "A91": 196,
96
96
  "A93": 197,
97
+ "A94": 198,
97
98
  "Bd1": 201,
98
99
  "B1": 202,
99
100
  "B2": 203,
@@ -216,6 +217,7 @@
216
217
  "Cs5": 326,
217
218
  "C25": 327,
218
219
  "C27": 328,
220
+ "2401C1": 329,
219
221
  "Cq1": 330,
220
222
  "C31": 331,
221
223
  "C32": 332,
@@ -285,6 +287,7 @@
285
287
  "Dy4": 438,
286
288
  "Dy5": 439,
287
289
  "Dy6": 440,
290
+ "2401D1": 441,
288
291
  "Dy7": 442,
289
292
  "D39": 443,
290
293
  "Dy8": 444,
@@ -435,7 +438,10 @@
435
438
  "B86": 837,
436
439
  "B87": 838,
437
440
  "B88": 839,
441
+ "2401B5": 840,
442
+ "2401B6": 841,
438
443
  "B89": 842,
444
+ "2401B7": 843,
439
445
  "B90": 844,
440
446
  "Bq12": 845,
441
447
  "B91": 846,
@@ -555,6 +561,9 @@
555
561
  "B191": 997,
556
562
  "B192": 998,
557
563
  "B194": 1001,
564
+ "B195": 1003,
565
+ "B196": 1004,
566
+ "By13": 1005,
558
567
  "F96": 1101,
559
568
  "F97": 1102,
560
569
  "Fy5": 1103,
@@ -581,5 +590,6 @@
581
590
  "F119": 1131,
582
591
  "F120": 1132,
583
592
  "F121": 1133,
584
- "F122": 1134
593
+ "F122": 1134,
594
+ "2312F3": 1135
585
595
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "poi-plugin-quest-info-2",
3
- "version": "0.12.3",
3
+ "version": "0.12.5",
4
4
  "private": false,
5
5
  "description": "show quest info",
6
6
  "homepage": "https://github.com/lawvs/poi-plugin-quest-2/",
package/src/App.tsx CHANGED
@@ -1,11 +1,11 @@
1
- import styled from 'styled-components'
2
- import React, { StrictMode } from 'react'
3
1
  import { Text } from '@blueprintjs/core'
2
+ import React, { StrictMode } from 'react'
3
+ import styled from 'styled-components'
4
4
 
5
5
  import { Toolbar, useFilterQuest } from './Toolbar'
6
- import { StoreProvider } from './store'
7
- import { usePluginTranslation } from './poi/hooks'
8
6
  import { QuestList } from './components/QuestList'
7
+ import { usePluginTranslation } from './poi/hooks'
8
+ import { StoreProvider } from './store'
9
9
 
10
10
  const Container = styled.div`
11
11
  display: flex;
@@ -255,7 +255,7 @@ exports[`should questCategory correct snapshot 1`] = `
255
255
  {
256
256
  "code": "Bq1",
257
257
  "gameId": 822,
258
- "name": "冲之岛海域迎击战!",
258
+ "name": "冲之岛海域迎击战",
259
259
  },
260
260
  {
261
261
  "code": "Bq12",
@@ -393,7 +393,7 @@ exports[`should questCategory correct snapshot 1`] = `
393
393
  {
394
394
  "code": "Fw2",
395
395
  "gameId": 638,
396
- "name": "对空机枪量产!",
396
+ "name": "对空机枪量产",
397
397
  },
398
398
  {
399
399
  "code": "Gw1",
@@ -597,6 +597,11 @@ exports[`should questCategory correct snapshot 1`] = `
597
597
  "gameId": 975,
598
598
  "name": "精锐「第十九驱逐队」,全力出击!",
599
599
  },
600
+ {
601
+ "code": "By13",
602
+ "gameId": 1005,
603
+ "name": "精强 “第七驱逐队” 紧急出动!",
604
+ },
600
605
  {
601
606
  "code": "Fy5",
602
607
  "gameId": 1103,
@@ -3,6 +3,8 @@
3
3
  exports[`questHelper should 101 locked quests match snapshot 1`] = `
4
4
  {
5
5
  "1001": true,
6
+ "1003": true,
7
+ "1005": true,
6
8
  "102": true,
7
9
  "103": true,
8
10
  "104": true,
@@ -37,6 +39,7 @@ exports[`questHelper should 101 locked quests match snapshot 1`] = `
37
39
  "1132": true,
38
40
  "1133": true,
39
41
  "1134": true,
42
+ "1135": true,
40
43
  "114": true,
41
44
  "115": true,
42
45
  "116": true,
@@ -119,6 +122,7 @@ exports[`questHelper should 101 locked quests match snapshot 1`] = `
119
122
  "195": true,
120
123
  "196": true,
121
124
  "197": true,
125
+ "198": true,
122
126
  "215": true,
123
127
  "217": true,
124
128
  "219": true,
@@ -1,7 +1,7 @@
1
1
  import { version, QuestData } from '../../build/kcanotifyGamedata'
2
2
 
3
3
  test('should Kcanotify Game data version correct', () => {
4
- expect(version).toMatchInlineSnapshot(`"2023122801"`)
4
+ expect(version).toMatchInlineSnapshot(`"2024020301"`)
5
5
  })
6
6
 
7
7
  test('should Kcanotify Game data keys correct', () => {
@@ -4,7 +4,7 @@ import newQuestData from '../../build/kcQuestsData/quests-scn-new.json'
4
4
  describe('should version correct', () => {
5
5
  test('should KcwikiQuestData Game data version correct', () => {
6
6
  expect(version).toMatchInlineSnapshot(
7
- `"0a92ed4afb302d984c4456fa2878ab64942f2cad"`,
7
+ `"7b0205e11577b3d69fc0a22608bf71a1218af1cd"`,
8
8
  )
9
9
  })
10
10
 
@@ -8,8 +8,8 @@ describe('should questCategory correct', () => {
8
8
  expect(questCategory.weeklyQuest.length).toMatchInlineSnapshot(`17`)
9
9
  expect(questCategory.monthlyQuest.length).toMatchInlineSnapshot(`11`)
10
10
  expect(questCategory.quarterlyQuest.length).toMatchInlineSnapshot(`27`)
11
- expect(questCategory.yearlyQuest.length).toMatchInlineSnapshot(`45`)
12
- expect(questCategory.singleQuest.length).toMatchInlineSnapshot(`468`)
11
+ expect(questCategory.yearlyQuest.length).toMatchInlineSnapshot(`46`)
12
+ expect(questCategory.singleQuest.length).toMatchInlineSnapshot(`470`)
13
13
  })
14
14
 
15
15
  test('snapshot', () => {
package/src/patch.ts CHANGED
@@ -19,7 +19,7 @@ const isLegacyQuestPluginEnabled = async () => {
19
19
  const poiStore = await getPoiStore()
20
20
  const legacyQuestPlugin = poiStore
21
21
  .getState()
22
- .plugins.find((i) => i.id === LEGACY_QUEST_PLUGIN_ID)
22
+ .plugins?.find((i) => i.id === LEGACY_QUEST_PLUGIN_ID)
23
23
  if (legacyQuestPlugin && legacyQuestPlugin.enabled) {
24
24
  return true
25
25
  }
@@ -40,13 +40,21 @@ const getQuestState = (maybeLanguage: string) => {
40
40
  : QuestData[maybeLanguage]
41
41
 
42
42
  return Object.fromEntries(
43
- Object.entries(data).map(([apiNo, data]) => [
44
- apiNo,
45
- {
46
- wiki_id: data.code,
47
- condition: [(data as any).memo2, data.desc].filter(Boolean).join(' | '),
48
- },
49
- ]),
43
+ Object.entries(data).map(([apiNo, d]) => {
44
+ const typedData = d as (typeof data)[keyof typeof data]
45
+ return [
46
+ apiNo,
47
+ {
48
+ wiki_id: typedData.code,
49
+ condition: [
50
+ 'memo2' in typedData ? typedData.memo2 : undefined,
51
+ typedData.desc,
52
+ ]
53
+ .filter(Boolean)
54
+ .join(' | '),
55
+ },
56
+ ]
57
+ }),
50
58
  )
51
59
  }
52
60
 
@@ -57,13 +65,17 @@ const getQuestState = (maybeLanguage: string) => {
57
65
  */
58
66
  export const patchLegacyQuestPluginReducer = async () => {
59
67
  if (await isLegacyQuestPluginEnabled()) {
60
- // no clear if legacy quest plugin enabled
68
+ // skip patch if legacy quest plugin enabled
61
69
  return
62
70
  }
63
71
 
64
72
  try {
65
- const i18next: i18n = await importFromPoi('views/env-parts/i18next')
66
- const language = i18next.language
73
+ const i18next: i18n | { default: i18n; __esModule: true } =
74
+ await importFromPoi('views/env-parts/i18next')
75
+ // Fix https://github.com/poooi/poi/issues/2539
76
+ const language =
77
+ '__esModule' in i18next ? i18next.default.language : i18next.language
78
+
67
79
  const initState = {
68
80
  [HACK_KEY]: true,
69
81
  quests: getQuestState(language),
@@ -102,13 +114,13 @@ export const patchLegacyQuestPluginReducer = async () => {
102
114
  */
103
115
  export const clearPatchLegacyQuestPluginReducer = async () => {
104
116
  if (await isLegacyQuestPluginEnabled()) {
105
- // no clear if legacy quest plugin enabled
117
+ // skip clear if legacy quest plugin enabled
106
118
  return
107
119
  }
108
120
  try {
109
121
  const { extendReducer } = await importFromPoi('views/create-store')
110
122
  const clearReducer = undefined
111
- extendReducer('poi-plugin-quest-info', clearReducer)
123
+ extendReducer(LEGACY_QUEST_PLUGIN_ID, clearReducer)
112
124
  } catch (e) {
113
125
  console.error('Clear hack quest plugin reducer error', e)
114
126
  }