@mooncellwiki/prts-design-vue 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.
@@ -1,8 +1,12 @@
1
- /** 一条语音:播放钮 + 标题行(语种徽标 / 解锁条件 / 编号)+ 台词。一般放在 AkVoiceList 里,跟列表的语种走 */
1
+ /**
2
+ * 一条语音:播放钮(+ 下载钮)+ 标题行(语种徽标 / 解锁条件 / 编号)+ 台词。一般放在 AkVoiceList 里,跟列表的语种走。
3
+ * 播放钮标 data-no-toggle:皮肤脚本会在 document 上替模板输出的纯 CSS 播放钮翻 is-playing(演示用),这里的 is-playing 跟真实播放状态走,
4
+ * 不退出那层委托就会两边各翻一次(点一下在放但图标还是播放,再点停了图标却变成暂停)。
5
+ */
2
6
  type __VLS_Props = {
3
7
  /** 语音标题(任命助理 / 交谈1 …) */
4
8
  title: string;
5
- /** 台词:一个串,或按语种的对象 { cn, jp, en, kr, yue }(取当前语种,缺了退回第一项) */
9
+ /** 台词:一个串;或按语种的对象 { cn, jp, en, kr, yue }(取当前语种,缺了退回第一项);列表给了 texts 时按文本键的对象(选中的几种一种一行) */
6
10
  text: string | Record<string, string>;
7
11
  /** 音频地址:一个串,或按语种的对象(同 text);取不到时播放钮禁用 */
8
12
  src?: string | Record<string, string>;
@@ -12,12 +16,18 @@ type __VLS_Props = {
12
16
  unlock?: string;
13
17
  /** 语种键:不在 AkVoiceList 里时用它取 text / src、显示徽标;在列表里时跟列表的 v-model */
14
18
  lang?: string;
19
+ /** 下载地址(现网是 torappu 的 wav):一个串,或按语种的对象(同 src);给了就在播放钮旁出一枚同款下载钮 */
20
+ download?: string | Record<string, string>;
21
+ /** 下载存成的文件名(<a download> 的值,任命助理.wav);不写由浏览器按地址定 */
22
+ downloadName?: string;
15
23
  };
16
24
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
25
+ download: string | Record<string, string>;
17
26
  lang: string;
18
27
  code: string;
19
28
  src: string | Record<string, string>;
20
29
  unlock: string;
30
+ downloadName: string;
21
31
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
32
  declare const _default: typeof __VLS_export;
23
33
  export default _default;
@@ -1,30 +1,42 @@
1
- import { type VoiceLanguage } from "./context";
1
+ import { type VoiceLanguage, type VoiceText } from "./context";
2
2
  /**
3
3
  * 语音列表(= 现网 {{:xx/语音记录}} 的 VoiceTable):若干 AkVoice,外框 + 悬停行底色。
4
- * 给了 languages 就在上方出一排语种切换(普通话 / 方言 / 日 / 英 / 韩,带 CV 名);切语种只换台词、徽标和音频地址。
5
- * 当前语种经 provide 给子项;播放全页只有一条(见 player.ts)。
4
+ * 上方最多两排切换条(.ak-voice-toolbar 里排一行,放不下时后一排整组换行):
5
+ * - texts:文本(台词的语言),多选、可以一个都不选,v-model:shown-texts;AkVoice 的 text 按文本键给对象,选中的几种一种一行
6
+ * - languages:语种(音频差分,普通话 / 方言 / 日 / 英 / 韩,带 CV 名),单选,v-model;AkVoice 的 src 按语种键给对象,徽标跟它
7
+ * 只给 languages 时 AkVoice 的 text 也按语种给,切语种同时换台词、徽标和音频地址。
8
+ * 当前语种 / 选中的文本经 provide 给子项;播放全页只有一条(见 player.ts)。
9
+ * 切换条标 data-no-toggle:皮肤脚本会在 document 上替模板输出的纯 CSS 芯片翻 is-active / aria-pressed,这里的状态归 Vue 管,
10
+ * 不退出那层委托就会两边各翻一次(点第二下反而取消选中)。
6
11
  */
7
12
  type __VLS_Props = {
8
- /** 语种选项 { value, label, badge?, cv? }(同 Naive 的 options);不给就不出切换条 */
13
+ /** 语种选项 { value, label, badge?, cv? }(同 Naive 的 options);不给就没有语种切换条 */
9
14
  languages?: VoiceLanguage[];
15
+ /** 文本语言选项 { value, label };不给就没有文本切换条,台词跟语种走 */
16
+ texts?: VoiceText[];
10
17
  };
11
18
  type __VLS_Slots = {
12
19
  /** 若干 AkVoice */
13
20
  default?: () => unknown;
14
- /** 切换条末尾的附注(「共 38 条 · 灰标 = 游戏内解锁条件」) */
21
+ /** 语种切换条末尾的附注(「灰标 = 游戏内解锁条件」) */
15
22
  "header-extra"?: () => unknown;
16
23
  };
17
24
  type __VLS_ModelProps = {
18
25
  /** 当前语种(languages 里的 value);不绑定时是第一个 */
19
26
  modelValue?: string;
27
+ /** 选中的文本语言(texts 里的 value,可多个、可为空);不绑定时默认第一个 */
28
+ "shownTexts"?: string[];
20
29
  };
21
30
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
22
31
  declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
23
32
  "update:modelValue": (value: string | undefined) => any;
33
+ "update:shownTexts": (value: string[] | undefined) => any;
24
34
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
25
35
  "onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
36
+ "onUpdate:shownTexts"?: ((value: string[] | undefined) => any) | undefined;
26
37
  }>, {
27
38
  languages: VoiceLanguage[];
39
+ texts: VoiceText[];
28
40
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
29
41
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
30
42
  declare const _default: typeof __VLS_export;
@@ -10,10 +10,19 @@ export interface VoiceLanguage {
10
10
  /** 配音演员(切换条上名字后的小字) */
11
11
  cv?: string;
12
12
  }
13
- /** AkVoiceList 给 AkVoice 的当前语种(及其徽标) */
13
+ /** 文本语言选项(台词的语言:中文 / 日文 / 繁体中文 / 中文-方言 …) */
14
+ export interface VoiceText {
15
+ /** 文本键,= AkVoice 的 text 对象里的键 */
16
+ value: string;
17
+ /** 切换条上的名字 */
18
+ label: string;
19
+ }
20
+ /** AkVoiceList 给 AkVoice 的:当前语种(及其徽标)、文本语言选项与选中的几种 */
14
21
  export declare const voiceListKey: InjectionKey<ComputedRef<{
15
22
  lang?: string;
16
23
  languages: readonly VoiceLanguage[];
24
+ texts: readonly VoiceText[];
25
+ shownTexts: readonly string[];
17
26
  }>>;
18
27
  /** 游戏语种键 → HTML lang(读屏按语种发音);不认识的键不写 lang */
19
28
  export declare const HTML_LANG: Record<string, string>;
package/dist/icons.d.ts CHANGED
@@ -23,6 +23,7 @@ export declare const icons: {
23
23
  readonly list: "<path fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" d=\"M4 7h16M4 12h16M4 17h10\"/>";
24
24
  readonly print: "<path fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" d=\"M7 8V3h10v5M5 8h14a2 2 0 0 1 2 2v6h-4v-3H7v3H3v-6a2 2 0 0 1 2-2zm2 8v5h10v-5\"/>";
25
25
  readonly upload: "<path fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" d=\"M12 16V4m-5 5 5-5 5 5M4 20h16\"/>";
26
+ readonly download: "<path fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" d=\"M12 4v12m-5-5 5 5 5-5M4 20h16\"/>";
26
27
  readonly grid: "<path fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" d=\"M4 4h6v6H4zm10 0h6v6h-6zM4 14h6v6H4zm10 0h6v6h-6z\"/>";
27
28
  readonly refresh: "<path fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" d=\"M20 12a8 8 0 1 1-2.3-5.7M20 4v5h-5\"/>";
28
29
  readonly quote: "<path fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" d=\"M6 16h3l2-4V7H5v5h3zm9 0h3l2-4V7h-6v5h3z\"/>";
package/dist/index.d.ts CHANGED
@@ -116,7 +116,7 @@ export { default as AkModuleStage } from "./components/Module/AkModuleStage.vue"
116
116
  export { default as AkModuleUnlock } from "./components/Module/AkModuleUnlock.vue";
117
117
  export { default as AkVoiceList } from "./components/Voice/AkVoiceList.vue";
118
118
  export { default as AkVoice } from "./components/Voice/AkVoice.vue";
119
- export type { VoiceLanguage } from "./components/Voice/context";
119
+ export type { VoiceLanguage, VoiceText } from "./components/Voice/context";
120
120
  export { default as AkDossier } from "./components/Dossier/AkDossier.vue";
121
121
  export { default as AkRedacted } from "./components/Dossier/AkRedacted.vue";
122
122
  export { default as AkArchive } from "./components/Archive/AkArchive.vue";