@nextmoe/edit-ui-catalog 0.3.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/dist/index.cjs ADDED
@@ -0,0 +1,896 @@
1
+ 'use strict';
2
+
3
+ var editUiCore = require('@nextmoe/edit-ui-core');
4
+
5
+ // src/vocab.ts
6
+ var option = (value, label) => ({ value, label });
7
+ var LANG_LABEL = {
8
+ "": "\u672A\u77E5",
9
+ ar: "\u963F\u62C9\u4F2F\u8BED",
10
+ be: "\u767D\u4FC4\u7F57\u65AF\u8BED",
11
+ bg: "\u4FDD\u52A0\u5229\u4E9A\u8BED",
12
+ ca: "\u52A0\u6CF0\u7F57\u5C3C\u4E9A\u8BED",
13
+ // Not a language: MapWikiOLang groups "ck" with "" and "others" and maps all
14
+ // three to the default, so it is a legacy marker carried in from the wiki
15
+ // import. Releases still accept it, which is why it is in the list at all.
16
+ ck: "\u5176\u4ED6\uFF08\u5386\u53F2\u503C\uFF09",
17
+ cs: "\u6377\u514B\u8BED",
18
+ da: "\u4E39\u9EA6\u8BED",
19
+ de: "\u5FB7\u8BED",
20
+ el: "\u5E0C\u814A\u8BED",
21
+ en: "\u82F1\u8BED",
22
+ eo: "\u4E16\u754C\u8BED",
23
+ es: "\u897F\u73ED\u7259\u8BED",
24
+ et: "\u7231\u6C99\u5C3C\u4E9A\u8BED",
25
+ eu: "\u5DF4\u65AF\u514B\u8BED",
26
+ fa: "\u6CE2\u65AF\u8BED",
27
+ fi: "\u82AC\u5170\u8BED",
28
+ fr: "\u6CD5\u8BED",
29
+ ga: "\u7231\u5C14\u5170\u8BED",
30
+ gd: "\u82CF\u683C\u5170\u76D6\u5C14\u8BED",
31
+ gl: "\u52A0\u5229\u897F\u4E9A\u8BED",
32
+ he: "\u5E0C\u4F2F\u6765\u8BED",
33
+ hi: "\u5370\u5730\u8BED",
34
+ hr: "\u514B\u7F57\u5730\u4E9A\u8BED",
35
+ hu: "\u5308\u7259\u5229\u8BED",
36
+ id: "\u5370\u5EA6\u5C3C\u897F\u4E9A\u8BED",
37
+ it: "\u610F\u5927\u5229\u8BED",
38
+ iu: "\u56E0\u7EBD\u7279\u8BED",
39
+ ja: "\u65E5\u8BED",
40
+ kk: "\u54C8\u8428\u514B\u8BED",
41
+ ko: "\u97E9\u8BED",
42
+ la: "\u62C9\u4E01\u8BED",
43
+ lt: "\u7ACB\u9676\u5B9B\u8BED",
44
+ lv: "\u62C9\u8131\u7EF4\u4E9A\u8BED",
45
+ mk: "\u9A6C\u5176\u987F\u8BED",
46
+ ms: "\u9A6C\u6765\u8BED",
47
+ nl: "\u8377\u5170\u8BED",
48
+ no: "\u632A\u5A01\u8BED",
49
+ pl: "\u6CE2\u5170\u8BED",
50
+ "pt-br": "\u8461\u8404\u7259\u8BED\uFF08\u5DF4\u897F\uFF09",
51
+ "pt-pt": "\u8461\u8404\u7259\u8BED\uFF08\u8461\u8404\u7259\uFF09",
52
+ ro: "\u7F57\u9A6C\u5C3C\u4E9A\u8BED",
53
+ ru: "\u4FC4\u8BED",
54
+ sk: "\u65AF\u6D1B\u4F10\u514B\u8BED",
55
+ sl: "\u65AF\u6D1B\u6587\u5C3C\u4E9A\u8BED",
56
+ sr: "\u585E\u5C14\u7EF4\u4E9A\u8BED",
57
+ sv: "\u745E\u5178\u8BED",
58
+ ta: "\u6CF0\u7C73\u5C14\u8BED",
59
+ th: "\u6CF0\u8BED",
60
+ tr: "\u571F\u8033\u5176\u8BED",
61
+ uk: "\u4E4C\u514B\u5170\u8BED",
62
+ ur: "\u4E4C\u5C14\u90FD\u8BED",
63
+ vi: "\u8D8A\u5357\u8BED",
64
+ zh: "\u4E2D\u6587",
65
+ "zh-Hans": "\u7B80\u4F53\u4E2D\u6587",
66
+ "zh-Hant": "\u7E41\u4F53\u4E2D\u6587"
67
+ };
68
+ var langOptions = (codes) => codes.map((code) => option(code, LANG_LABEL[code] ?? code));
69
+ var OLANG_CODES = [
70
+ "ar",
71
+ "be",
72
+ "bg",
73
+ "ca",
74
+ "cs",
75
+ "da",
76
+ "de",
77
+ "el",
78
+ "en",
79
+ "eo",
80
+ "es",
81
+ "fi",
82
+ "fr",
83
+ "ga",
84
+ "gd",
85
+ "he",
86
+ "hi",
87
+ "hr",
88
+ "hu",
89
+ "id",
90
+ "it",
91
+ "iu",
92
+ "ja",
93
+ "ko",
94
+ "la",
95
+ "lt",
96
+ "lv",
97
+ "mk",
98
+ "ms",
99
+ "nl",
100
+ "no",
101
+ "pl",
102
+ "pt-br",
103
+ "pt-pt",
104
+ "ro",
105
+ "ru",
106
+ "sk",
107
+ "sl",
108
+ "sr",
109
+ "sv",
110
+ "ta",
111
+ "th",
112
+ "tr",
113
+ "uk",
114
+ "ur",
115
+ "vi",
116
+ "zh",
117
+ "zh-Hans",
118
+ "zh-Hant"
119
+ ];
120
+ var RELEASE_LANG_CODES = [
121
+ "ar",
122
+ "be",
123
+ "bg",
124
+ "ca",
125
+ "ck",
126
+ "cs",
127
+ "da",
128
+ "de",
129
+ "el",
130
+ "en",
131
+ "eo",
132
+ "es",
133
+ "et",
134
+ "eu",
135
+ "fa",
136
+ "fi",
137
+ "fr",
138
+ "ga",
139
+ "gd",
140
+ "gl",
141
+ "he",
142
+ "hi",
143
+ "hr",
144
+ "hu",
145
+ "id",
146
+ "it",
147
+ "iu",
148
+ "ja",
149
+ "kk",
150
+ "ko",
151
+ "la",
152
+ "lt",
153
+ "lv",
154
+ "mk",
155
+ "ms",
156
+ "nl",
157
+ "no",
158
+ "pl",
159
+ "pt-br",
160
+ "pt-pt",
161
+ "ro",
162
+ "ru",
163
+ "sk",
164
+ "sl",
165
+ "sr",
166
+ "sv",
167
+ "ta",
168
+ "th",
169
+ "tr",
170
+ "uk",
171
+ "ur",
172
+ "vi",
173
+ "zh",
174
+ "zh-Hans",
175
+ "zh-Hant"
176
+ ];
177
+ var PLATFORM_LABEL = {
178
+ and: "Android",
179
+ bdp: "Blu-ray Player",
180
+ dos: "DOS",
181
+ drc: "Dreamcast",
182
+ dvd: "DVD Player",
183
+ fm7: "FM-7",
184
+ fmt: "FM Towns",
185
+ gba: "Game Boy Advance",
186
+ gbc: "Game Boy Color",
187
+ ios: "iOS",
188
+ lin: "Linux",
189
+ mac: "macOS",
190
+ mob: "\u529F\u80FD\u673A",
191
+ msx: "MSX",
192
+ n3d: "Nintendo 3DS",
193
+ nds: "Nintendo DS",
194
+ nes: "Famicom",
195
+ oth: "\u5176\u4ED6",
196
+ p88: "PC-88",
197
+ p98: "PC-98",
198
+ pce: "PC Engine",
199
+ pcf: "PC-FX",
200
+ ps1: "PlayStation",
201
+ ps2: "PlayStation 2",
202
+ ps3: "PlayStation 3",
203
+ ps4: "PlayStation 4",
204
+ ps5: "PlayStation 5",
205
+ psp: "PlayStation Portable",
206
+ psv: "PlayStation Vita",
207
+ sat: "Sega Saturn",
208
+ scd: "Sega Mega-CD",
209
+ sfc: "Super Famicom",
210
+ smd: "Mega Drive",
211
+ sw2: "Nintendo Switch 2",
212
+ swi: "Nintendo Switch",
213
+ tdo: "3DO",
214
+ vnd: "VNDS",
215
+ web: "\u7F51\u9875",
216
+ wii: "Wii",
217
+ win: "Windows",
218
+ wiu: "Wii U",
219
+ x1s: "Sharp X1",
220
+ x68: "Sharp X68000",
221
+ xb1: "Xbox",
222
+ xb3: "Xbox 360",
223
+ xbo: "Xbox One",
224
+ xxs: "Xbox Series X/S"
225
+ };
226
+ var PLATFORM_CODES = [
227
+ "and",
228
+ "bdp",
229
+ "dos",
230
+ "drc",
231
+ "dvd",
232
+ "fm7",
233
+ "fmt",
234
+ "gba",
235
+ "gbc",
236
+ "ios",
237
+ "lin",
238
+ "mac",
239
+ "mob",
240
+ "msx",
241
+ "n3d",
242
+ "nds",
243
+ "nes",
244
+ "oth",
245
+ "p88",
246
+ "p98",
247
+ "pce",
248
+ "pcf",
249
+ "ps1",
250
+ "ps2",
251
+ "ps3",
252
+ "ps4",
253
+ "ps5",
254
+ "psp",
255
+ "psv",
256
+ "sat",
257
+ "scd",
258
+ "sfc",
259
+ "smd",
260
+ "sw2",
261
+ "swi",
262
+ "tdo",
263
+ "vnd",
264
+ "web",
265
+ "wii",
266
+ "wiu",
267
+ "win",
268
+ "x1s",
269
+ "x68",
270
+ "xb1",
271
+ "xb3",
272
+ "xbo",
273
+ "xxs"
274
+ ];
275
+ var OLANG_OPTIONS = langOptions(OLANG_CODES);
276
+ var CHARACTER_LANG_OPTIONS = langOptions([
277
+ "",
278
+ ...OLANG_CODES
279
+ ]);
280
+ var TITLE_LANG_OPTIONS = [
281
+ option("", "\u4E0D\u9650\u5B9A\u8BED\u8A00\uFF08\u4EC5\u522B\u540D\uFF09"),
282
+ ...OLANG_OPTIONS
283
+ ];
284
+ var RELEASE_LANG_OPTIONS = langOptions(RELEASE_LANG_CODES);
285
+ var INTRO_LANG_OPTIONS = langOptions([
286
+ "en",
287
+ "ja",
288
+ "zh-Hans",
289
+ "zh-Hant"
290
+ ]);
291
+ var CONTENT_RATING_OPTIONS = [
292
+ option(0, "\u5168\u5E74\u9F84"),
293
+ option(1, "\u654F\u611F"),
294
+ option(2, "R18")
295
+ ];
296
+ var GENDER_OPTIONS = [
297
+ option(1, "\u7537\u6027"),
298
+ option(2, "\u5973\u6027"),
299
+ option(3, "\u5176\u4ED6")
300
+ ];
301
+ var BLOOD_TYPE_OPTIONS = [
302
+ option(1, "A \u578B"),
303
+ option(2, "B \u578B"),
304
+ option(3, "AB \u578B"),
305
+ option(4, "O \u578B")
306
+ ];
307
+ var TITLE_KIND_OPTIONS = [
308
+ option(0, "\u5B98\u65B9"),
309
+ option(1, "\u522B\u540D"),
310
+ option(2, "\u7B80\u79F0")
311
+ ];
312
+ var ALIAS_KIND_OPTIONS = [
313
+ option(0, "\u8BD1\u540D"),
314
+ option(1, "\u62FC\u5199\u53D8\u4F53")
315
+ ];
316
+ var ROSTER_KIND_OPTIONS = [
317
+ option(0, "\u672A\u77E5"),
318
+ option(1, "\u4E3B\u89D2"),
319
+ option(2, "\u914D\u89D2"),
320
+ option(3, "\u51FA\u573A")
321
+ ];
322
+ var SPOILER_OPTIONS = [
323
+ option(0, "\u65E0\u5267\u900F"),
324
+ option(1, "\u8F7B\u5FAE\u5267\u900F"),
325
+ option(2, "\u4E25\u91CD\u5267\u900F")
326
+ ];
327
+ var LABEL_KIND_OPTIONS = [
328
+ option(0, "\u793E\u56E2"),
329
+ option(1, "\u53D1\u884C\u5546"),
330
+ option(2, "\u5F00\u53D1\u5546"),
331
+ option(3, "\u54C1\u724C")
332
+ ];
333
+ var RELEASE_KIND_OPTIONS = [
334
+ option(0, "\u9ED8\u8BA4"),
335
+ option(1, "\u6570\u5B57\u7248"),
336
+ option(2, "\u5B9E\u4F53\u7248"),
337
+ option(3, "\u4F53\u9A8C\u7248"),
338
+ option(4, "\u8865\u4E01")
339
+ ];
340
+ var RELEASE_PLATFORM_OPTIONS = PLATFORM_CODES.map(
341
+ (code) => option(code, PLATFORM_LABEL[code] ?? code)
342
+ );
343
+ var SEXUAL_OPTIONS = [
344
+ option(0, "\u5B89\u5168"),
345
+ option(1, "\u6027\u6697\u793A"),
346
+ option(2, "\u9732\u9AA8")
347
+ ];
348
+ var VIOLENCE_OPTIONS = [
349
+ option(0, "\u5E73\u548C"),
350
+ option(1, "\u66B4\u529B"),
351
+ option(2, "\u8840\u8165")
352
+ ];
353
+
354
+ // src/helpers.ts
355
+ var GROUP = {
356
+ basic: "\u57FA\u672C",
357
+ name: "\u540D\u79F0",
358
+ desc: "\u63CF\u8FF0",
359
+ rel: "\u5173\u7CFB",
360
+ media: "\u5A92\u4F53",
361
+ release: "\u53D1\u884C"
362
+ };
363
+ var suppressed = (parentLabel, group) => ({
364
+ label: `${parentLabel}\uFF08\u5DF2\u9690\u85CF\uFF09`,
365
+ group,
366
+ control: "readonly"
367
+ });
368
+ var selectColumn = (key, label, type, required, options, width) => ({
369
+ key,
370
+ label,
371
+ type,
372
+ required,
373
+ options,
374
+ control: "select",
375
+ ...width ? { width } : {}
376
+ });
377
+ var switchColumn = (key, label, required, width = "w-24") => ({
378
+ key,
379
+ label,
380
+ type: "boolean",
381
+ required,
382
+ control: "switch",
383
+ width
384
+ });
385
+ var textColumn = (key, label, required, extra) => ({
386
+ key,
387
+ label,
388
+ type: "string",
389
+ required,
390
+ ...extra
391
+ });
392
+ var idColumn = (key, label, required, refs) => {
393
+ const column = {
394
+ key,
395
+ label,
396
+ type: "integer",
397
+ required
398
+ };
399
+ if (refs?.search) {
400
+ column.control = "entity-picker";
401
+ column.searchEntities = refs.search;
402
+ if (refs.resolve) {
403
+ column.resolveEntities = refs.resolve;
404
+ }
405
+ }
406
+ if (refs?.width) {
407
+ column.width = refs.width;
408
+ }
409
+ return column;
410
+ };
411
+ var introColumns = () => [
412
+ selectColumn("lang", "\u8BED\u8A00", "string", true, INTRO_LANG_OPTIONS, "w-32"),
413
+ textColumn("intro", "\u4ECB\u7ECD", true, { control: "textarea" })
414
+ ];
415
+ var introList = (label = "\u4ECB\u7ECD") => ({
416
+ label,
417
+ group: GROUP.desc,
418
+ description: "\u6BCF\u79CD\u8BED\u8A00\u4E00\u6761\uFF0C\u8BED\u8A00\u4EC5\u9650\u82F1\u8BED\u3001\u65E5\u8BED\u3001\u7B80\u4F53\u4E2D\u6587\u3001\u7E41\u4F53\u4E2D\u6587\u3002\u4ECB\u7ECD\u6700\u591A 50000 \u5B57\uFF0C\u6700\u591A 200 \u6761\u3002",
419
+ columns: introColumns()
420
+ });
421
+ var urlList = (label = "\u94FE\u63A5") => ({
422
+ label,
423
+ group: GROUP.media,
424
+ control: "string-list",
425
+ description: "\u987B\u4E3A http(s) URL\uFF0C\u6700\u591A 200 \u6761\uFF0C\u6BCF\u6761\u6700\u591A 2000 \u5B57\u3002"
426
+ });
427
+ var nameField = (maxRunes, label = "\u540D\u79F0") => ({
428
+ label,
429
+ group: GROUP.name,
430
+ description: `\u4E0D\u80FD\u4E3A\u7A7A\uFF0C\u6700\u591A ${maxRunes} \u5B57\u3002`
431
+ });
432
+ var asObject = (item) => item !== null && typeof item === "object" && !Array.isArray(item) ? item : null;
433
+ var asInteger = (value) => typeof value === "number" && Number.isInteger(value) ? value : null;
434
+ var workTitleIdentityKey = (item) => {
435
+ const row = asObject(item);
436
+ if (!row) {
437
+ return null;
438
+ }
439
+ const kind = asInteger(row.kind);
440
+ if (kind === null) {
441
+ return null;
442
+ }
443
+ const lang = row.lang === void 0 ? "" : row.lang;
444
+ if (typeof lang !== "string") {
445
+ return null;
446
+ }
447
+ if (typeof row.title !== "string") {
448
+ return null;
449
+ }
450
+ const text = editUiCore.cleanEditText(row.title);
451
+ if (text === "") {
452
+ return null;
453
+ }
454
+ return `title:${kind}:${lang}:${text}`;
455
+ };
456
+ var characterAliasIdentityKey = (item) => {
457
+ const row = asObject(item);
458
+ if (!row) {
459
+ return null;
460
+ }
461
+ const kind = asInteger(row.kind);
462
+ if (kind === null) {
463
+ return null;
464
+ }
465
+ if (typeof row.lang !== "string") {
466
+ return null;
467
+ }
468
+ if (typeof row.name !== "string") {
469
+ return null;
470
+ }
471
+ const text = editUiCore.cleanEditText(row.name);
472
+ if (text === "") {
473
+ return null;
474
+ }
475
+ return `alias:${kind}:${row.lang}:${text}`;
476
+ };
477
+ var workRosterIdentityKey = (item) => {
478
+ const row = asObject(item);
479
+ if (!row) {
480
+ return null;
481
+ }
482
+ const characterId = asInteger(row.character_id);
483
+ if (characterId === null || characterId <= 0) {
484
+ return null;
485
+ }
486
+ return `roster:${characterId}`;
487
+ };
488
+ var workCreditIdentityKey = (item) => {
489
+ const row = asObject(item);
490
+ if (!row) {
491
+ return null;
492
+ }
493
+ const roleId = asInteger(row.role_id);
494
+ const creditNameId = asInteger(row.credit_name_id);
495
+ if (roleId === null || roleId <= 0) {
496
+ return null;
497
+ }
498
+ if (creditNameId === null || creditNameId <= 0) {
499
+ return null;
500
+ }
501
+ if (!("character_id" in row) || row.character_id === void 0) {
502
+ return `credit:${roleId}:${creditNameId}:0`;
503
+ }
504
+ const characterId = asInteger(row.character_id);
505
+ if (characterId === null || characterId < 0) {
506
+ return null;
507
+ }
508
+ return `credit:${roleId}:${creditNameId}:${characterId}`;
509
+ };
510
+
511
+ // src/character.ts
512
+ var measure = (label, min, max) => ({
513
+ label,
514
+ group: GROUP.basic,
515
+ nullable: true,
516
+ description: `${min}\u2013${max}\uFF0C\u53EF\u7A7A\u3002`
517
+ });
518
+ var characterPreset = (_options) => ({
519
+ "catalog.character.aliases": {
520
+ label: "\u522B\u540D",
521
+ group: GROUP.name,
522
+ description: "\u6700\u591A 200 \u6761\u3002\u540D\u79F0\u6700\u591A 300 \u5B57\u3002\u540C\u4E00 (\u540D\u79F0, \u8BED\u8A00) \u4E0D\u80FD\u91CD\u590D\u3002\u68C0\u7D22\u63D0\u793A\uFF08kind 2\uFF09\u4E0D\u53EF\u7F16\u8F91\u3002",
523
+ identityKey: characterAliasIdentityKey,
524
+ columns: [
525
+ textColumn("name", "\u540D\u79F0", true),
526
+ selectColumn("lang", "\u8BED\u8A00", "string", true, OLANG_OPTIONS, "w-32"),
527
+ selectColumn("kind", "\u7C7B\u578B", "integer", true, ALIAS_KIND_OPTIONS, "w-28"),
528
+ textColumn("latin", "\u62C9\u4E01\u8F6C\u5199", false, { width: "w-32" }),
529
+ switchColumn("primary", "\u8BE5\u8BED\u8A00\u4E3B\u540D", false)
530
+ ]
531
+ },
532
+ "catalog.character.aliases.suppressed": suppressed("\u522B\u540D", GROUP.name),
533
+ "catalog.character.birthday_day": {
534
+ label: "\u751F\u65E5\uFF08\u65E5\uFF09",
535
+ group: GROUP.basic,
536
+ nullable: true,
537
+ description: "1\u201331\uFF0C\u53EF\u7A7A\u3002"
538
+ },
539
+ "catalog.character.birthday_month": {
540
+ label: "\u751F\u65E5\uFF08\u6708\uFF09",
541
+ group: GROUP.basic,
542
+ nullable: true,
543
+ description: "1\u201312\uFF0C\u53EF\u7A7A\u3002"
544
+ },
545
+ "catalog.character.blood_type": {
546
+ label: "\u8840\u578B",
547
+ group: GROUP.basic,
548
+ nullable: true,
549
+ options: BLOOD_TYPE_OPTIONS
550
+ },
551
+ "catalog.character.bust_cm": measure("\u80F8\u56F4", 1, 500),
552
+ "catalog.character.cup": {
553
+ label: "\u7F69\u676F",
554
+ group: GROUP.basic,
555
+ nullable: true,
556
+ description: "\u6700\u591A 8 \u5B57\uFF0C\u53EF\u7A7A\u3002"
557
+ },
558
+ "catalog.character.description": {
559
+ label: "\u63CF\u8FF0",
560
+ group: GROUP.desc,
561
+ description: "\u6700\u591A 50000 \u5B57\u3002"
562
+ },
563
+ "catalog.character.display_name": {
564
+ label: "\u663E\u793A\u540D",
565
+ group: GROUP.name,
566
+ description: "\u4E0D\u80FD\u4E3A\u7A7A\uFF0C\u6700\u591A 300 \u5B57\u3002"
567
+ },
568
+ "catalog.character.gender": {
569
+ label: "\u6027\u522B",
570
+ group: GROUP.basic,
571
+ nullable: true,
572
+ options: GENDER_OPTIONS
573
+ },
574
+ "catalog.character.height_cm": measure("\u8EAB\u9AD8", 1, 1e3),
575
+ "catalog.character.hip_cm": measure("\u81C0\u56F4", 1, 500),
576
+ "catalog.character.intros": introList(),
577
+ "catalog.character.lang": {
578
+ label: "\u8BED\u8A00",
579
+ group: GROUP.basic,
580
+ options: CHARACTER_LANG_OPTIONS,
581
+ description: "\u7A7A\u5B57\u7B26\u4E32\u8868\u793A\u672A\u77E5\u3002"
582
+ },
583
+ "catalog.character.latin": {
584
+ label: "\u62C9\u4E01\u8F6C\u5199",
585
+ group: GROUP.name,
586
+ nullable: true,
587
+ description: "\u6700\u591A 300 \u5B57\uFF0C\u53EF\u7A7A\u3002"
588
+ },
589
+ "catalog.character.waist_cm": measure("\u8170\u56F4", 1, 500),
590
+ "catalog.character.weight_kg": measure("\u4F53\u91CD", 1, 1e3)
591
+ });
592
+
593
+ // src/release.ts
594
+ var releasePreset = (_options) => ({
595
+ "catalog.release.hidden": {
596
+ label: "\u9690\u85CF",
597
+ group: GROUP.basic,
598
+ control: "switch"
599
+ },
600
+ "catalog.release.kind": {
601
+ label: "\u53D1\u884C\u7C7B\u578B",
602
+ group: GROUP.release,
603
+ options: RELEASE_KIND_OPTIONS
604
+ },
605
+ "catalog.release.lang": {
606
+ label: "\u8BED\u8A00",
607
+ group: GROUP.release,
608
+ nullable: true,
609
+ options: RELEASE_LANG_OPTIONS
610
+ },
611
+ "catalog.release.platform": {
612
+ label: "\u5E73\u53F0",
613
+ group: GROUP.release,
614
+ nullable: true,
615
+ options: RELEASE_PLATFORM_OPTIONS
616
+ },
617
+ "catalog.release.released": {
618
+ label: "\u53D1\u884C\u65E5\u671F",
619
+ group: GROUP.release,
620
+ nullable: true,
621
+ description: "\u5E74\u4EFD\u987B\u5728 1950\u20132200\u3002\u586B\u65E5\u5FC5\u987B\u5148\u586B\u6708\u3002\u53EF\u7A7A\u3002"
622
+ },
623
+ "catalog.release.title": {
624
+ label: "\u6807\u9898",
625
+ group: GROUP.name,
626
+ nullable: true,
627
+ description: "\u6700\u591A 300 \u5B57\uFF0C\u53EF\u7A7A\u3002"
628
+ }
629
+ });
630
+
631
+ // src/taxonomy.ts
632
+ var labelPreset = (_options) => ({
633
+ "catalog.label.intros": introList(),
634
+ "catalog.label.links": urlList(),
635
+ "catalog.label.name": nameField(300)
636
+ });
637
+ var enginePreset = (_options) => ({
638
+ "catalog.engine.aliases": {
639
+ label: "\u522B\u540D",
640
+ group: GROUP.name,
641
+ control: "string-list",
642
+ description: "\u6700\u591A 200 \u6761\uFF0C\u6BCF\u6761\u53BB\u91CD\u540E\u6700\u591A 300 \u5B57\uFF0C\u4E0D\u80FD\u4E3A\u7A7A\u3002"
643
+ },
644
+ "catalog.engine.intro": {
645
+ label: "\u4ECB\u7ECD",
646
+ group: GROUP.desc,
647
+ description: "\u6700\u591A 50000 \u5B57\u3002"
648
+ },
649
+ "catalog.engine.name": nameField(300)
650
+ });
651
+ var seriesPreset = (_options) => ({
652
+ "catalog.series.intros": introList(),
653
+ "catalog.series.name": {
654
+ label: "\u540D\u79F0",
655
+ group: GROUP.name,
656
+ description: "\u4E0D\u80FD\u4E3A\u7A7A\uFF0C\u6700\u591A 300 \u5B57\u3002\u4EC5\u81EA\u5EFA\u7CFB\u5217\u53EF\u6539\u540D\u3002"
657
+ }
658
+ });
659
+ var tagPreset = (_options) => ({
660
+ "catalog.tag.intros": introList()
661
+ });
662
+
663
+ // src/work_media.ts
664
+ var withImageFns = (options) => ({
665
+ ...options.uploadImage ? { uploadImage: options.uploadImage } : {},
666
+ ...options.resolveImage ? { resolveImage: options.resolveImage } : {}
667
+ });
668
+ var workCoverConfig = (options) => ({
669
+ label: "\u5C01\u9762",
670
+ group: GROUP.media,
671
+ description: "\u6700\u591A 200 \u5F20\u3002\u79CD\u7C7B\u4E3A\u5F00\u653E\u8BCD\u8868\uFF0C\u6700\u591A 64 \u5B57\u3002\u7AD6\u7248\u5C01\u9762\u901A\u8FC7\u9489\u9009\u8BBE\u7F6E\uFF0C\u540C\u4E00\u65F6\u523B\u53EA\u80FD\u9489\u4E00\u5F20\u3002",
672
+ control: "image-list",
673
+ pinItemFlag: { key: "portrait_pinned", label: "\u7AD6\u7248\u5C01\u9762" },
674
+ itemColumns: [
675
+ textColumn("kind", "\u79CD\u7C7B", false, { width: "w-32" }),
676
+ selectColumn("sexual", "\u6027\u76F8\u5173", "integer", false, SEXUAL_OPTIONS, "w-28"),
677
+ selectColumn("violence", "\u66B4\u529B", "integer", false, VIOLENCE_OPTIONS, "w-28")
678
+ ],
679
+ ...withImageFns(options)
680
+ });
681
+ var workScreenshotConfig = (options) => ({
682
+ label: "\u622A\u56FE",
683
+ group: GROUP.media,
684
+ description: "\u6700\u591A 200 \u5F20\u3002\u8BF4\u660E\u6700\u591A 500 \u5B57\u3002",
685
+ control: "image-list",
686
+ itemColumns: [
687
+ textColumn("caption", "\u8BF4\u660E", false, { control: "textarea" }),
688
+ selectColumn("sexual", "\u6027\u76F8\u5173", "integer", false, SEXUAL_OPTIONS, "w-28"),
689
+ selectColumn("violence", "\u66B4\u529B", "integer", false, VIOLENCE_OPTIONS, "w-28")
690
+ ],
691
+ ...withImageFns(options)
692
+ });
693
+
694
+ // src/work.ts
695
+ var idList = (options, ref, label, description, fallbackDescription = description) => {
696
+ const search = options.searchEntities?.[ref];
697
+ const resolve = options.resolveEntities?.[ref];
698
+ if (search) {
699
+ return {
700
+ label,
701
+ group: GROUP.rel,
702
+ description,
703
+ control: "entity-picker",
704
+ multiple: true,
705
+ searchEntities: search,
706
+ ...resolve ? { resolveEntities: resolve } : {}
707
+ };
708
+ }
709
+ return {
710
+ label,
711
+ group: GROUP.rel,
712
+ description: fallbackDescription,
713
+ control: "number-list"
714
+ };
715
+ };
716
+ var titles = () => ({
717
+ label: "\u6807\u9898",
718
+ group: GROUP.name,
719
+ description: "\u81F3\u5C11\u4E00\u6761\u5B98\u65B9\u6807\u9898\uFF0C\u6700\u591A 100 \u6761\u3002\u6807\u9898\u6700\u591A 500 \u5B57\u3002\u53EA\u6709\u522B\u540D\u53EF\u4EE5\u4E0D\u586B\u8BED\u8A00\u3002",
720
+ identityKey: workTitleIdentityKey,
721
+ columns: [
722
+ selectColumn(
723
+ "lang",
724
+ "\u8BED\u8A00",
725
+ "string",
726
+ true,
727
+ TITLE_LANG_OPTIONS,
728
+ "w-32"
729
+ ),
730
+ textColumn("title", "\u6807\u9898", true),
731
+ textColumn("latin", "\u62C9\u4E01\u8F6C\u5199", false, { width: "w-32" }),
732
+ selectColumn("kind", "\u7C7B\u578B", "integer", true, TITLE_KIND_OPTIONS, "w-28")
733
+ ]
734
+ });
735
+ var credits = (options) => ({
736
+ label: "\u5236\u4F5C\u4EBA\u5458",
737
+ group: GROUP.rel,
738
+ description: options.searchEntities?.role ? "\u6700\u591A 500 \u6761\u3002\u4E0D\u5173\u8054\u89D2\u8272\u65F6\u4E0D\u8981\u586B\u5199\u89D2\u8272\u3002" : "\u6700\u591A 500 \u6761\u3002\u804C\u8D23\u8BF7\u586B\u5199 catalog_role \u7684\u6B63\u6574\u6570 id\u3002\u4E0D\u5173\u8054\u89D2\u8272\u65F6\u4E0D\u8981\u586B\u5199\u89D2\u8272\u3002",
739
+ identityKey: workCreditIdentityKey,
740
+ columns: [
741
+ idColumn("role_id", "\u804C\u8D23", true, {
742
+ search: options.searchEntities?.role,
743
+ resolve: options.resolveEntities?.role,
744
+ width: "w-40"
745
+ }),
746
+ idColumn("credit_name_id", "\u804C\u4EBA", true, {
747
+ search: options.searchEntities?.credit_name,
748
+ resolve: options.resolveEntities?.credit_name
749
+ }),
750
+ idColumn("character_id", "\u89D2\u8272", false, {
751
+ search: options.searchEntities?.character,
752
+ resolve: options.resolveEntities?.character
753
+ }),
754
+ textColumn("note", "\u5907\u6CE8", false, { control: "textarea" })
755
+ ]
756
+ });
757
+ var roster = (options) => ({
758
+ label: "\u767B\u573A\u89D2\u8272",
759
+ group: GROUP.rel,
760
+ description: "\u4E0D\u80FD\u65B0\u589E\u6216\u5220\u9664\u884C\uFF0C\u53EA\u80FD\u6539\u5DF2\u6709\u767B\u573A\u89D2\u8272\u7684\u5B9A\u4F4D\u548C\u5267\u900F\u3002\u65B0\u589E\u7684\u884C\u4F1A\u5728\u5408\u5E76\u65F6\u88AB\u62D2\u7EDD\u3002\u6700\u591A 500 \u6761\u3002",
761
+ identityKey: workRosterIdentityKey,
762
+ allowAdd: false,
763
+ allowRemove: false,
764
+ columns: [
765
+ idColumn("character_id", "\u89D2\u8272", true, {
766
+ search: options.searchEntities?.character,
767
+ resolve: options.resolveEntities?.character
768
+ }),
769
+ selectColumn("kind", "\u5B9A\u4F4D", "integer", true, ROSTER_KIND_OPTIONS, "w-28"),
770
+ selectColumn("spoiler", "\u5267\u900F", "integer", true, SPOILER_OPTIONS, "w-28")
771
+ ]
772
+ });
773
+ var labels = (options) => ({
774
+ label: "\u5382\u5546",
775
+ group: GROUP.rel,
776
+ description: "\u6700\u591A 200 \u6761\u3002\u540C\u4E00\u5382\u5546\u53EF\u4EE5\u6302\u591A\u79CD\u8EAB\u4EFD\u3002",
777
+ columns: [
778
+ idColumn("label_id", "\u5382\u5546", true, {
779
+ search: options.searchEntities?.label,
780
+ resolve: options.resolveEntities?.label
781
+ }),
782
+ selectColumn("kind", "\u8EAB\u4EFD", "integer", true, LABEL_KIND_OPTIONS, "w-28")
783
+ ]
784
+ });
785
+ var workPreset = (options) => ({
786
+ "catalog.work.content_rating": {
787
+ label: "\u5185\u5BB9\u5206\u7EA7",
788
+ group: GROUP.basic,
789
+ options: CONTENT_RATING_OPTIONS
790
+ },
791
+ "catalog.work.covers": workCoverConfig(options),
792
+ "catalog.work.credits": credits(options),
793
+ "catalog.work.credits.suppressed": suppressed("\u5236\u4F5C\u4EBA\u5458", GROUP.rel),
794
+ "catalog.work.display_name": {
795
+ label: "\u663E\u793A\u540D",
796
+ group: GROUP.name,
797
+ description: "\u4E0D\u80FD\u4E3A\u7A7A\uFF0C\u6700\u591A 500 \u5B57\u3002"
798
+ },
799
+ "catalog.work.display_nsfw": {
800
+ label: "\u663E\u793A\u4E3A\u9650\u5236\u7EA7",
801
+ group: GROUP.basic,
802
+ control: "switch"
803
+ },
804
+ "catalog.work.engine_ids": idList(
805
+ options,
806
+ "engine",
807
+ "\u5F15\u64CE",
808
+ "\u6700\u591A 200 \u4E2A\u3002",
809
+ "\u8BF7\u586B\u5199\u5F15\u64CE id\u3002\u6700\u591A 200 \u4E2A\u3002"
810
+ ),
811
+ "catalog.work.intros": introList(),
812
+ "catalog.work.labels": labels(options),
813
+ "catalog.work.links": urlList(),
814
+ "catalog.work.olang": {
815
+ label: "\u539F\u8BED\u8A00",
816
+ group: GROUP.basic,
817
+ options: OLANG_OPTIONS
818
+ },
819
+ "catalog.work.roster": roster(options),
820
+ "catalog.work.roster.suppressed": suppressed("\u767B\u573A\u89D2\u8272", GROUP.rel),
821
+ "catalog.work.screenshots": workScreenshotConfig(options),
822
+ "catalog.work.series_ids": idList(
823
+ options,
824
+ "series",
825
+ "\u7CFB\u5217",
826
+ "\u4EC5\u53EF\u5173\u8054\u81EA\u5EFA\u7CFB\u5217\uFF0C\u6700\u591A 200 \u4E2A\u3002",
827
+ "\u4EC5\u53EF\u586B\u5199\u81EA\u5EFA\u7CFB\u5217\u7684 id\uFF0C\u6700\u591A 200 \u4E2A\u3002"
828
+ ),
829
+ "catalog.work.tag_ids": idList(options, "tag", "\u6807\u7B7E", "\u6700\u591A 200 \u4E2A\u3002"),
830
+ "catalog.work.titles": titles(),
831
+ "catalog.work.titles.suppressed": suppressed("\u6807\u9898", GROUP.name)
832
+ });
833
+
834
+ // src/index.ts
835
+ var CATALOG_ENTITY_TYPES = [
836
+ "catalog.work",
837
+ "catalog.character",
838
+ "catalog.release",
839
+ "catalog.label",
840
+ "catalog.engine",
841
+ "catalog.series",
842
+ "catalog.tag"
843
+ ];
844
+ var catalogConfig = (type, options = {}) => {
845
+ switch (type) {
846
+ case "catalog.work":
847
+ return workPreset(options);
848
+ case "catalog.character":
849
+ return characterPreset();
850
+ case "catalog.release":
851
+ return releasePreset();
852
+ case "catalog.label":
853
+ return labelPreset();
854
+ case "catalog.engine":
855
+ return enginePreset();
856
+ case "catalog.series":
857
+ return seriesPreset();
858
+ case "catalog.tag":
859
+ return tagPreset();
860
+ default:
861
+ return {};
862
+ }
863
+ };
864
+
865
+ exports.ALIAS_KIND_OPTIONS = ALIAS_KIND_OPTIONS;
866
+ exports.BLOOD_TYPE_OPTIONS = BLOOD_TYPE_OPTIONS;
867
+ exports.CATALOG_ENTITY_TYPES = CATALOG_ENTITY_TYPES;
868
+ exports.CHARACTER_LANG_OPTIONS = CHARACTER_LANG_OPTIONS;
869
+ exports.CONTENT_RATING_OPTIONS = CONTENT_RATING_OPTIONS;
870
+ exports.GENDER_OPTIONS = GENDER_OPTIONS;
871
+ exports.INTRO_LANG_OPTIONS = INTRO_LANG_OPTIONS;
872
+ exports.LABEL_KIND_OPTIONS = LABEL_KIND_OPTIONS;
873
+ exports.OLANG_OPTIONS = OLANG_OPTIONS;
874
+ exports.RELEASE_KIND_OPTIONS = RELEASE_KIND_OPTIONS;
875
+ exports.RELEASE_LANG_OPTIONS = RELEASE_LANG_OPTIONS;
876
+ exports.RELEASE_PLATFORM_OPTIONS = RELEASE_PLATFORM_OPTIONS;
877
+ exports.ROSTER_KIND_OPTIONS = ROSTER_KIND_OPTIONS;
878
+ exports.SEXUAL_OPTIONS = SEXUAL_OPTIONS;
879
+ exports.SPOILER_OPTIONS = SPOILER_OPTIONS;
880
+ exports.TITLE_KIND_OPTIONS = TITLE_KIND_OPTIONS;
881
+ exports.TITLE_LANG_OPTIONS = TITLE_LANG_OPTIONS;
882
+ exports.VIOLENCE_OPTIONS = VIOLENCE_OPTIONS;
883
+ exports.catalogConfig = catalogConfig;
884
+ exports.characterAliasIdentityKey = characterAliasIdentityKey;
885
+ exports.characterPreset = characterPreset;
886
+ exports.enginePreset = enginePreset;
887
+ exports.labelPreset = labelPreset;
888
+ exports.releasePreset = releasePreset;
889
+ exports.seriesPreset = seriesPreset;
890
+ exports.tagPreset = tagPreset;
891
+ exports.workCreditIdentityKey = workCreditIdentityKey;
892
+ exports.workPreset = workPreset;
893
+ exports.workRosterIdentityKey = workRosterIdentityKey;
894
+ exports.workTitleIdentityKey = workTitleIdentityKey;
895
+ //# sourceMappingURL=index.cjs.map
896
+ //# sourceMappingURL=index.cjs.map