@vocasync/astro 1.0.1 → 2.1.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.
Files changed (148) hide show
  1. package/README.md +735 -93
  2. package/dist/api/client.d.ts.map +1 -1
  3. package/dist/api/client.js.map +1 -1
  4. package/dist/api/index.d.ts +1 -1
  5. package/dist/api/index.d.ts.map +1 -1
  6. package/dist/api/index.js +1 -1
  7. package/dist/api/index.js.map +1 -1
  8. package/dist/cli.js.map +1 -1
  9. package/dist/components/AudioPlayer.astro +305 -1141
  10. package/dist/components/index.d.ts +10 -32
  11. package/dist/components/index.d.ts.map +1 -1
  12. package/dist/components/index.js +1 -3
  13. package/dist/components/index.js.map +1 -1
  14. package/dist/components/types.d.ts +117 -0
  15. package/dist/components/types.d.ts.map +1 -0
  16. package/dist/components/types.js +2 -0
  17. package/dist/components/types.js.map +1 -0
  18. package/dist/config/index.d.ts +3 -2
  19. package/dist/config/index.d.ts.map +1 -1
  20. package/dist/config/index.js +2 -1
  21. package/dist/config/index.js.map +1 -1
  22. package/dist/config/languages.d.ts +33 -0
  23. package/dist/config/languages.d.ts.map +1 -0
  24. package/dist/config/languages.js +167 -0
  25. package/dist/config/languages.js.map +1 -0
  26. package/dist/config/schema.d.ts +225 -172
  27. package/dist/config/schema.d.ts.map +1 -1
  28. package/dist/config/schema.js +45 -24
  29. package/dist/config/schema.js.map +1 -1
  30. package/dist/core/content-loader.js +1 -1
  31. package/dist/core/content-loader.js.map +1 -1
  32. package/dist/core/index.d.ts +2 -2
  33. package/dist/core/index.d.ts.map +1 -1
  34. package/dist/core/index.js +2 -2
  35. package/dist/core/index.js.map +1 -1
  36. package/dist/core/speech-builder.js.map +1 -1
  37. package/dist/index.d.ts +6 -7
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.js +5 -6
  40. package/dist/index.js.map +1 -1
  41. package/dist/integration.d.ts +28 -2
  42. package/dist/integration.d.ts.map +1 -1
  43. package/dist/integration.js +40 -3
  44. package/dist/integration.js.map +1 -1
  45. package/dist/lib/latex-to-speech/index.d.ts.map +1 -1
  46. package/dist/lib/latex-to-speech/index.js.map +1 -1
  47. package/dist/player-core/boot.d.ts +9 -0
  48. package/dist/player-core/boot.d.ts.map +1 -0
  49. package/dist/player-core/boot.js +59 -0
  50. package/dist/player-core/boot.js.map +1 -0
  51. package/dist/player-core/highlighter.d.ts +31 -0
  52. package/dist/player-core/highlighter.d.ts.map +1 -0
  53. package/dist/player-core/highlighter.js +103 -0
  54. package/dist/player-core/highlighter.js.map +1 -0
  55. package/dist/player-core/index.d.ts +17 -0
  56. package/dist/player-core/index.d.ts.map +1 -0
  57. package/dist/player-core/index.js +24 -0
  58. package/dist/player-core/index.js.map +1 -0
  59. package/dist/player-core/media-url.d.ts +18 -0
  60. package/dist/player-core/media-url.d.ts.map +1 -0
  61. package/dist/player-core/media-url.js +33 -0
  62. package/dist/player-core/media-url.js.map +1 -0
  63. package/dist/player-core/player.d.ts +9 -0
  64. package/dist/player-core/player.d.ts.map +1 -0
  65. package/dist/player-core/player.js +622 -0
  66. package/dist/player-core/player.js.map +1 -0
  67. package/dist/player-core/registry.d.ts +20 -0
  68. package/dist/player-core/registry.d.ts.map +1 -0
  69. package/dist/player-core/registry.js +31 -0
  70. package/dist/player-core/registry.js.map +1 -0
  71. package/dist/player-core/seek-delegate.d.ts +24 -0
  72. package/dist/player-core/seek-delegate.d.ts.map +1 -0
  73. package/dist/player-core/seek-delegate.js +64 -0
  74. package/dist/player-core/seek-delegate.js.map +1 -0
  75. package/dist/player-core/storage.d.ts +38 -0
  76. package/dist/player-core/storage.d.ts.map +1 -0
  77. package/dist/player-core/storage.js +107 -0
  78. package/dist/player-core/storage.js.map +1 -0
  79. package/dist/player-core/strings.d.ts +53 -0
  80. package/dist/player-core/strings.d.ts.map +1 -0
  81. package/dist/player-core/strings.js +45 -0
  82. package/dist/player-core/strings.js.map +1 -0
  83. package/dist/player-core/timings.d.ts +56 -0
  84. package/dist/player-core/timings.d.ts.map +1 -0
  85. package/dist/player-core/timings.js +90 -0
  86. package/dist/player-core/timings.js.map +1 -0
  87. package/dist/rehype/audio-words.d.ts +9 -3
  88. package/dist/rehype/audio-words.d.ts.map +1 -1
  89. package/dist/rehype/audio-words.js +17 -9
  90. package/dist/rehype/audio-words.js.map +1 -1
  91. package/dist/rehype/index.d.ts +2 -2
  92. package/dist/rehype/index.d.ts.map +1 -1
  93. package/dist/rehype/index.js.map +1 -1
  94. package/dist/rehype/rehype-math-speech.d.ts.map +1 -1
  95. package/dist/rehype/rehype-math-speech.js +2 -0
  96. package/dist/rehype/rehype-math-speech.js.map +1 -1
  97. package/dist/styles/content.css +41 -0
  98. package/dist/styles/layers.css +13 -0
  99. package/dist/styles/player.css +517 -0
  100. package/dist/styles/preset-shadcn.css +31 -0
  101. package/dist/styles/tokens.css +266 -0
  102. package/dist/styles/vocasync.css +10 -0
  103. package/dist/sync/index.d.ts +1 -1
  104. package/dist/sync/index.d.ts.map +1 -1
  105. package/dist/sync/index.js +1 -1
  106. package/dist/sync/index.js.map +1 -1
  107. package/dist/sync/orchestrator.d.ts.map +1 -1
  108. package/dist/sync/orchestrator.js +101 -47
  109. package/dist/sync/orchestrator.js.map +1 -1
  110. package/dist/types/index.d.ts +19 -5
  111. package/dist/types/index.d.ts.map +1 -1
  112. package/package.json +39 -17
  113. package/src/api/index.ts +4 -4
  114. package/src/components/AudioPlayer.astro +305 -1141
  115. package/src/components/index.ts +19 -34
  116. package/src/components/types.ts +140 -0
  117. package/src/config/index.ts +29 -24
  118. package/src/config/languages.ts +171 -0
  119. package/src/config/schema.ts +47 -24
  120. package/src/core/content-loader.ts +1 -1
  121. package/src/core/index.ts +7 -7
  122. package/src/env.d.ts +2 -0
  123. package/src/index.ts +23 -28
  124. package/src/integration.ts +66 -4
  125. package/src/player-core/boot.ts +62 -0
  126. package/src/player-core/highlighter.ts +159 -0
  127. package/src/player-core/index.ts +45 -0
  128. package/src/player-core/media-url.ts +35 -0
  129. package/src/player-core/player.ts +725 -0
  130. package/src/player-core/registry.ts +40 -0
  131. package/src/player-core/seek-delegate.ts +92 -0
  132. package/src/player-core/storage.ts +112 -0
  133. package/src/player-core/strings.ts +89 -0
  134. package/src/player-core/timings.ts +115 -0
  135. package/src/rehype/audio-words.ts +25 -12
  136. package/src/rehype/index.ts +2 -3
  137. package/src/rehype/rehype-math-speech.ts +3 -1
  138. package/src/styles/content.css +41 -0
  139. package/src/styles/layers.css +13 -0
  140. package/src/styles/player.css +517 -0
  141. package/src/styles/preset-shadcn.css +31 -0
  142. package/src/styles/tokens.css +266 -0
  143. package/src/styles/vocasync.css +10 -0
  144. package/src/sync/index.ts +1 -1
  145. package/src/sync/orchestrator.ts +120 -56
  146. package/src/types/index.ts +19 -5
  147. package/dist/styles/variables.css +0 -164
  148. package/src/styles/variables.css +0 -164
@@ -1,33 +1,11 @@
1
- export interface AudioPlayerProps {
2
- /** Post slug to lookup audio in audio-map */
3
- slug: string;
4
- /** Audio entry data from audio-map.json */
5
- audioEntry?: {
6
- audioUrl: string;
7
- alignmentUrl?: string;
8
- words?: {
9
- word: string;
10
- start: number;
11
- end: number;
12
- }[];
13
- duration?: number;
14
- publishableKey?: string;
15
- };
16
- /** Accessible label for the player */
17
- label?: string;
18
- /** Show placeholder when no audio available */
19
- showPlaceholder?: boolean;
20
- /** Additional CSS classes */
21
- class?: string;
22
- /** Selector for article body (for word highlighting) */
23
- articleSelector?: string;
24
- /** Enable floating mini player when main player scrolls out of view */
25
- enableMiniPlayer?: boolean;
26
- /** Enable word highlighting during playback */
27
- enableHighlighting?: boolean;
28
- /** Enable click on words to seek to that position */
29
- enableClickToSeek?: boolean;
30
- /** Number of trailing highlighted words */
31
- trailLength?: number;
32
- }
1
+ /**
2
+ * Types for the AudioPlayer component.
3
+ *
4
+ * The component itself is an .astro file and cannot be re-exported from JavaScript;
5
+ * import it directly:
6
+ *
7
+ * import AudioPlayer from "@vocasync/astro/components/AudioPlayer.astro";
8
+ */
9
+ export type { AudioEntry, AudioPlayerProps, AutoScrollMode, ControlName, DockOptions, HighlightOptions, PlayerSize, PlayerVariant, } from "./types.js";
10
+ export { DEFAULT_CONTROLS } from "./types.js";
33
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,gBAAgB;IAC/B,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,2CAA2C;IAC3C,UAAU,CAAC,EAAE;QACX,QAAQ,EAAE,MAAM,CAAC;QACjB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,KAAK,CAAC,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAC;YAAC,GAAG,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;QACvD,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;IACF,sCAAsC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+CAA+C;IAC/C,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,6BAA6B;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wDAAwD;IACxD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,uEAAuE;IACvE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,+CAA+C;IAC/C,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,qDAAqD;IACrD,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,2CAA2C;IAC3C,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,YAAY,EACV,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,UAAU,EACV,aAAa,GACd,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC"}
@@ -1,4 +1,2 @@
1
- // Components are re-exported from the main components directory
2
- // Import using: import { AudioPlayer } from "@vocasync/astro/components"
3
- export {};
1
+ export { DEFAULT_CONTROLS } from "./types.js";
4
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,yEAAyE"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,117 @@
1
+ import type { SerializableStrings } from "../player-core/strings.js";
2
+ import type { AlignedWord } from "../types/index.js";
3
+ /**
4
+ * The AudioPlayer's props, defined once.
5
+ *
6
+ * This file previously described a component that did not exist: it declared
7
+ * `publishableKey` and `alignmentUrl` while the component took `synthesisPublishableKey`
8
+ * and had no `alignmentUrl` at all, and it advertised a named `AudioPlayer` export that
9
+ * could not be imported. The .astro now imports this type rather than restating it, so
10
+ * the two cannot drift again.
11
+ */
12
+ /** A control the player can render, in the order you list it. */
13
+ export type ControlName = "play"
14
+ /** Elapsed/total time above the seek bar; grows to fill the row. */
15
+ | "progress"
16
+ /** Elapsed/total time on its own. */
17
+ | "time" | "highlight" | "speed"
18
+ /** Mute button plus volume slider. */
19
+ | "volume"
20
+ /** Jump backwards by `skipSeconds`. */
21
+ | "skip-back"
22
+ /** Jump forwards by `skipSeconds`. */
23
+ | "skip-forward";
24
+ export declare const DEFAULT_CONTROLS: ControlName[];
25
+ /** Shape of the player. `bar` is the default horizontal strip. */
26
+ export type PlayerVariant = "bar" | "minimal" | "card";
27
+ export type PlayerSize = "sm" | "md" | "lg";
28
+ /** What follows the spoken word as it plays. */
29
+ export type AutoScrollMode = "off" | "paragraph";
30
+ export interface AudioEntry {
31
+ audioUrl: string;
32
+ words?: AlignedWord[];
33
+ duration?: number;
34
+ /** Publishable key for the synthesis stream (v3 audio-map). */
35
+ synthesisPublishableKey?: string;
36
+ }
37
+ export interface HighlightOptions {
38
+ /** @default true */
39
+ enabled?: boolean;
40
+ /** Words kept marked behind the active one. @default 4 */
41
+ trailLength?: number;
42
+ /**
43
+ * Clicking a word seeks to it.
44
+ *
45
+ * Independent of `enabled`: it used to live inside the highlighting branch, so
46
+ * turning highlighting off silently disabled click-to-seek too.
47
+ *
48
+ * @default true
49
+ */
50
+ clickToSeek?: boolean;
51
+ }
52
+ export interface DockOptions {
53
+ /** Show a floating player once the main one scrolls out of view. @default true */
54
+ enabled?: boolean;
55
+ }
56
+ export interface AudioPlayerProps {
57
+ /** Post slug, used to look up audio and to key saved playback position. */
58
+ slug: string;
59
+ /** Audio entry from audio-map.json. */
60
+ audioEntry?: AudioEntry;
61
+ /** Shape and scale. */
62
+ variant?: PlayerVariant;
63
+ size?: PlayerSize;
64
+ /** Which controls to render, and in what order. */
65
+ controls?: ControlName[];
66
+ /** Playback rates offered by the speed menu. */
67
+ speeds?: number[];
68
+ /** How far the skip controls and arrow keys jump. @default 15 */
69
+ skipSeconds?: number;
70
+ /** Overrides for any visible text or accessible label. */
71
+ strings?: Partial<SerializableStrings>;
72
+ /** Selector for the element containing the article's word spans. */
73
+ articleSelector?: string;
74
+ highlight?: HighlightOptions;
75
+ dock?: DockOptions;
76
+ /**
77
+ * Follow the spoken word by scrolling its paragraph into view.
78
+ *
79
+ * Defaults to off. It was previously forced on with no way to disable it, which
80
+ * takes over the reader's scroll position while they are reading something else.
81
+ *
82
+ * @default "off"
83
+ */
84
+ autoScroll?: AutoScrollMode;
85
+ /** Pause other players on the page when this one starts. @default true */
86
+ exclusive?: boolean;
87
+ /**
88
+ * Remember speed, volume, mute and highlighting across pages and visits.
89
+ * @default true
90
+ */
91
+ rememberPreferences?: boolean;
92
+ /**
93
+ * Resume where the reader left off, keyed by `slug`.
94
+ *
95
+ * Off by default: it is a pleasant surprise on a long article and a confusing one
96
+ * on a short post that someone expects to start from the beginning.
97
+ *
98
+ * @default false
99
+ */
100
+ rememberPosition?: boolean;
101
+ /**
102
+ * Publish title and artwork to the OS media controls (lock screen, media keys).
103
+ * @default true
104
+ */
105
+ mediaSession?: boolean;
106
+ /** Title for the OS media controls. Falls back to the accessible label. */
107
+ title?: string;
108
+ /** Artwork URL for the OS media controls. */
109
+ artwork?: string;
110
+ /** Show a message when the article has no audio. @default true */
111
+ showPlaceholder?: boolean;
112
+ /** Extra classes on the player root. */
113
+ class?: string;
114
+ /** Overrides the generated element id. */
115
+ id?: string;
116
+ }
117
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/components/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;;;;;;GAQG;AAEH,iEAAiE;AACjE,MAAM,MAAM,WAAW,GACnB,MAAM;AACR,oEAAoE;GAClE,UAAU;AACZ,qCAAqC;GACnC,MAAM,GACN,WAAW,GACX,OAAO;AACT,sCAAsC;GACpC,QAAQ;AACV,uCAAuC;GACrC,WAAW;AACb,sCAAsC;GACpC,cAAc,CAAC;AAEnB,eAAO,MAAM,gBAAgB,EAAE,WAAW,EAAyD,CAAC;AAEpG,kEAAkE;AAClE,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,SAAS,GAAG,MAAM,CAAC;AAEvD,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE5C,gDAAgD;AAChD,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,WAAW,CAAC;AAEjD,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,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B,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,kEAAkE;IAClE,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B,wCAAwC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0CAA0C;IAC1C,EAAE,CAAC,EAAE,MAAM,CAAC;CACb"}
@@ -0,0 +1,2 @@
1
+ export const DEFAULT_CONTROLS = ["play", "progress", "highlight", "speed", "volume"];
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/components/types.ts"],"names":[],"mappings":"AA6BA,MAAM,CAAC,MAAM,gBAAgB,GAAkB,CAAC,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC"}
@@ -1,4 +1,5 @@
1
- export { VocaSyncConfigSchema, CollectionConfigSchema, SynthesisConfigSchema, MathConfigSchema, OutputConfigSchema, ProcessingConfigSchema, VoiceSchema, QualitySchema, FormatSchema, LanguageSchema, MathStyleSchema, validateConfig, defaultConfig, } from "./schema.js";
2
- export type { VocaSyncConfig, VocaSyncUserConfig, CollectionConfig, SynthesisConfig, MathConfig, OutputConfig, ProcessingConfig, Voice, Quality, Format, Language, MathStyle, } from "./schema.js";
1
+ export { ALIGNMENT_LOCALES, canAlign, LANGUAGE_NAMES, SYNTHESIS_LANGUAGES, toAlignmentLocale, } from "./languages.js";
3
2
  export { loadVocaSyncConfig } from "./loader.js";
3
+ export type { CollectionConfig, Format, Language, MathConfig, MathStyle, OutputConfig, ProcessingConfig, Quality, SynthesisConfig, VocaSyncConfig, VocaSyncUserConfig, Voice, } from "./schema.js";
4
+ export { CollectionConfigSchema, defaultConfig, FormatSchema, LanguageSchema, MathConfigSchema, MathStyleSchema, OutputConfigSchema, ProcessingConfigSchema, QualitySchema, SynthesisConfigSchema, VocaSyncConfigSchema, VoiceSchema, validateConfig, } from "./schema.js";
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,gBAAgB,EAChB,kBAAkB,EAClB,sBAAsB,EACtB,WAAW,EACX,aAAa,EACb,YAAY,EACZ,cAAc,EACd,eAAe,EACf,cAAc,EACd,aAAa,GACd,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,KAAK,EACL,OAAO,EACP,MAAM,EACN,QAAQ,EACR,SAAS,GACV,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,QAAQ,EACR,cAAc,EACd,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,YAAY,EACV,gBAAgB,EAChB,MAAM,EACN,QAAQ,EACR,UAAU,EACV,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,OAAO,EACP,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,KAAK,GACN,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,sBAAsB,EACtB,aAAa,EACb,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,sBAAsB,EACtB,aAAa,EACb,qBAAqB,EACrB,oBAAoB,EACpB,WAAW,EACX,cAAc,GACf,MAAM,aAAa,CAAC"}
@@ -1,3 +1,4 @@
1
- export { VocaSyncConfigSchema, CollectionConfigSchema, SynthesisConfigSchema, MathConfigSchema, OutputConfigSchema, ProcessingConfigSchema, VoiceSchema, QualitySchema, FormatSchema, LanguageSchema, MathStyleSchema, validateConfig, defaultConfig, } from "./schema.js";
1
+ export { ALIGNMENT_LOCALES, canAlign, LANGUAGE_NAMES, SYNTHESIS_LANGUAGES, toAlignmentLocale, } from "./languages.js";
2
2
  export { loadVocaSyncConfig } from "./loader.js";
3
+ export { CollectionConfigSchema, defaultConfig, FormatSchema, LanguageSchema, MathConfigSchema, MathStyleSchema, OutputConfigSchema, ProcessingConfigSchema, QualitySchema, SynthesisConfigSchema, VocaSyncConfigSchema, VoiceSchema, validateConfig, } from "./schema.js";
3
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,gBAAgB,EAChB,kBAAkB,EAClB,sBAAsB,EACtB,WAAW,EACX,aAAa,EACb,YAAY,EACZ,cAAc,EACd,eAAe,EACf,cAAc,EACd,aAAa,GACd,MAAM,aAAa,CAAC;AAiBrB,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,QAAQ,EACR,cAAc,EACd,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAejD,OAAO,EACL,sBAAsB,EACtB,aAAa,EACb,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,sBAAsB,EACtB,aAAa,EACb,qBAAqB,EACrB,oBAAoB,EACpB,WAAW,EACX,cAAc,GACf,MAAM,aAAa,CAAC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Language support, which is not one list but two.
3
+ *
4
+ * Speech synthesis covers 57 languages. Forced alignment -- the word-level timing
5
+ * that drives highlighting and click-to-seek -- covers far fewer. A post that needs
6
+ * highlighting is therefore limited to the intersection; a post synthesised without
7
+ * alignment is limited only by the voice.
8
+ *
9
+ * Both lists mirror the enums published in the VocaSync OpenAPI document. Korean was
10
+ * withdrawn from alignment in September 2026 and remains available for synthesis.
11
+ */
12
+ /** Every language the synthesis voices can speak, ISO 639-1. */
13
+ export declare const SYNTHESIS_LANGUAGES: readonly ["af", "ar", "hy", "az", "be", "bs", "bg", "ca", "zh", "hr", "cs", "da", "nl", "en", "et", "fi", "fr", "gl", "de", "el", "he", "hi", "hu", "is", "id", "it", "ja", "kn", "kk", "ko", "lv", "lt", "mk", "ms", "mr", "mi", "ne", "no", "fa", "pl", "pt", "ro", "ru", "sr", "sk", "sl", "es", "sw", "sv", "tl", "ta", "th", "tr", "uk", "ur", "vi", "cy"];
14
+ /**
15
+ * Synthesis languages that can also be force-aligned, mapped to the locale the
16
+ * alignment API expects. A language absent from here can still be synthesised --
17
+ * it simply cannot carry word timings.
18
+ */
19
+ export declare const ALIGNMENT_LOCALES: Readonly<Record<string, string>>;
20
+ /** Human-readable names, for error messages and docs. */
21
+ export declare const LANGUAGE_NAMES: Readonly<Record<string, string>>;
22
+ /** True when a language can carry word-level timings. */
23
+ export declare function canAlign(language: string): boolean;
24
+ /**
25
+ * The locale the alignment API expects, or null when the language cannot align.
26
+ *
27
+ * Returning null rather than defaulting matters: the previous implementation fell
28
+ * back to `en-US` for anything unrecognised, so a language outside the aligned set
29
+ * would have been aligned against an English acoustic model -- producing timings
30
+ * that are confidently wrong rather than an error.
31
+ */
32
+ export declare function toAlignmentLocale(language: string): string | null;
33
+ //# sourceMappingURL=languages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"languages.d.ts","sourceRoot":"","sources":["../../src/config/languages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,gEAAgE;AAChE,eAAO,MAAM,mBAAmB,YAC9B,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,CACI,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAc9D,CAAC;AAEF,yDAAyD;AACzD,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA0D3D,CAAC;AAEF,yDAAyD;AACzD,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAElD;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAEjE"}
@@ -0,0 +1,167 @@
1
+ /**
2
+ * Language support, which is not one list but two.
3
+ *
4
+ * Speech synthesis covers 57 languages. Forced alignment -- the word-level timing
5
+ * that drives highlighting and click-to-seek -- covers far fewer. A post that needs
6
+ * highlighting is therefore limited to the intersection; a post synthesised without
7
+ * alignment is limited only by the voice.
8
+ *
9
+ * Both lists mirror the enums published in the VocaSync OpenAPI document. Korean was
10
+ * withdrawn from alignment in September 2026 and remains available for synthesis.
11
+ */
12
+ /** Every language the synthesis voices can speak, ISO 639-1. */
13
+ export const SYNTHESIS_LANGUAGES = [
14
+ "af", // Afrikaans
15
+ "ar", // Arabic
16
+ "hy", // Armenian
17
+ "az", // Azerbaijani
18
+ "be", // Belarusian
19
+ "bs", // Bosnian
20
+ "bg", // Bulgarian
21
+ "ca", // Catalan
22
+ "zh", // Chinese
23
+ "hr", // Croatian
24
+ "cs", // Czech
25
+ "da", // Danish
26
+ "nl", // Dutch
27
+ "en", // English
28
+ "et", // Estonian
29
+ "fi", // Finnish
30
+ "fr", // French
31
+ "gl", // Galician
32
+ "de", // German
33
+ "el", // Greek
34
+ "he", // Hebrew
35
+ "hi", // Hindi
36
+ "hu", // Hungarian
37
+ "is", // Icelandic
38
+ "id", // Indonesian
39
+ "it", // Italian
40
+ "ja", // Japanese
41
+ "kn", // Kannada
42
+ "kk", // Kazakh
43
+ "ko", // Korean
44
+ "lv", // Latvian
45
+ "lt", // Lithuanian
46
+ "mk", // Macedonian
47
+ "ms", // Malay
48
+ "mr", // Marathi
49
+ "mi", // Maori
50
+ "ne", // Nepali
51
+ "no", // Norwegian
52
+ "fa", // Persian
53
+ "pl", // Polish
54
+ "pt", // Portuguese
55
+ "ro", // Romanian
56
+ "ru", // Russian
57
+ "sr", // Serbian
58
+ "sk", // Slovak
59
+ "sl", // Slovenian
60
+ "es", // Spanish
61
+ "sw", // Swahili
62
+ "sv", // Swedish
63
+ "tl", // Tagalog
64
+ "ta", // Tamil
65
+ "th", // Thai
66
+ "tr", // Turkish
67
+ "uk", // Ukrainian
68
+ "ur", // Urdu
69
+ "vi", // Vietnamese
70
+ "cy", // Welsh
71
+ ];
72
+ /**
73
+ * Synthesis languages that can also be force-aligned, mapped to the locale the
74
+ * alignment API expects. A language absent from here can still be synthesised --
75
+ * it simply cannot carry word timings.
76
+ */
77
+ export const ALIGNMENT_LOCALES = {
78
+ en: "en-US", // English
79
+ fr: "fr", // French
80
+ de: "de", // German
81
+ es: "es", // Spanish
82
+ pt: "pt-PT", // Portuguese
83
+ sv: "sv", // Swedish
84
+ cs: "cs", // Czech
85
+ pl: "pl", // Polish
86
+ tr: "tr", // Turkish
87
+ ru: "ru", // Russian
88
+ uk: "uk", // Ukrainian
89
+ ja: "ja", // Japanese
90
+ zh: "zh-CN", // Chinese
91
+ };
92
+ /** Human-readable names, for error messages and docs. */
93
+ export const LANGUAGE_NAMES = {
94
+ af: "Afrikaans",
95
+ ar: "Arabic",
96
+ hy: "Armenian",
97
+ az: "Azerbaijani",
98
+ be: "Belarusian",
99
+ bs: "Bosnian",
100
+ bg: "Bulgarian",
101
+ ca: "Catalan",
102
+ zh: "Chinese",
103
+ hr: "Croatian",
104
+ cs: "Czech",
105
+ da: "Danish",
106
+ nl: "Dutch",
107
+ en: "English",
108
+ et: "Estonian",
109
+ fi: "Finnish",
110
+ fr: "French",
111
+ gl: "Galician",
112
+ de: "German",
113
+ el: "Greek",
114
+ he: "Hebrew",
115
+ hi: "Hindi",
116
+ hu: "Hungarian",
117
+ is: "Icelandic",
118
+ id: "Indonesian",
119
+ it: "Italian",
120
+ ja: "Japanese",
121
+ kn: "Kannada",
122
+ kk: "Kazakh",
123
+ ko: "Korean",
124
+ lv: "Latvian",
125
+ lt: "Lithuanian",
126
+ mk: "Macedonian",
127
+ ms: "Malay",
128
+ mr: "Marathi",
129
+ mi: "Maori",
130
+ ne: "Nepali",
131
+ no: "Norwegian",
132
+ fa: "Persian",
133
+ pl: "Polish",
134
+ pt: "Portuguese",
135
+ ro: "Romanian",
136
+ ru: "Russian",
137
+ sr: "Serbian",
138
+ sk: "Slovak",
139
+ sl: "Slovenian",
140
+ es: "Spanish",
141
+ sw: "Swahili",
142
+ sv: "Swedish",
143
+ tl: "Tagalog",
144
+ ta: "Tamil",
145
+ th: "Thai",
146
+ tr: "Turkish",
147
+ uk: "Ukrainian",
148
+ ur: "Urdu",
149
+ vi: "Vietnamese",
150
+ cy: "Welsh",
151
+ };
152
+ /** True when a language can carry word-level timings. */
153
+ export function canAlign(language) {
154
+ return Object.hasOwn(ALIGNMENT_LOCALES, language);
155
+ }
156
+ /**
157
+ * The locale the alignment API expects, or null when the language cannot align.
158
+ *
159
+ * Returning null rather than defaulting matters: the previous implementation fell
160
+ * back to `en-US` for anything unrecognised, so a language outside the aligned set
161
+ * would have been aligned against an English acoustic model -- producing timings
162
+ * that are confidently wrong rather than an error.
163
+ */
164
+ export function toAlignmentLocale(language) {
165
+ return ALIGNMENT_LOCALES[language] ?? null;
166
+ }
167
+ //# sourceMappingURL=languages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"languages.js","sourceRoot":"","sources":["../../src/config/languages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,gEAAgE;AAChE,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,cAAc;IACpB,IAAI,EAAE,aAAa;IACnB,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,YAAY;IAClB,IA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