@pie-players/pie-tool-tts-inline 1.0.0-beta.0 → 1.0.0-beta.10
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/LICENSE +21 -0
- package/README.md +14 -2
- package/custom-elements.json +54 -1
- package/dist/THIRD-PARTY-LICENSES.txt +14 -0
- package/dist/element-props.d.ts +16 -0
- package/dist/index.d.ts +13 -8
- package/dist/tool-tts-inline.js +173 -2928
- package/package.json +11 -11
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 PIE Framework contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -38,8 +38,9 @@ content to read. Section players provide both; around a plain item player, the
|
|
|
38
38
|
host writes the toolkit and the scope. The packaged
|
|
39
39
|
`textToSpeech` capability in `@pie-players/pie-default-tool-loaders` creates
|
|
40
40
|
this element in item and passage toolbars, takes `catalog-id` and `size` from
|
|
41
|
-
the toolbar,
|
|
42
|
-
|
|
41
|
+
the toolbar, takes `layout-mode`, `speedOptions` and `showSingleSpeedOption` from
|
|
42
|
+
the toolkit's `textToSpeech` tool configuration, and takes `base-rate`, `pitch`
|
|
43
|
+
and `volume` from the policy's `textToSpeech` tool parameters.
|
|
43
44
|
|
|
44
45
|
```javascript
|
|
45
46
|
import '@pie-players/pie-tool-tts-inline';
|
|
@@ -80,6 +81,17 @@ passageHeader.append(ttsButton);
|
|
|
80
81
|
the first keeps the controls row reserved and the second expands it while the
|
|
81
82
|
panel is open. `'floating-overlay'` and `'left-aligned'` open the panel as an
|
|
82
83
|
overlay to the left of the trigger.
|
|
84
|
+
- `base-rate` - Multiplies every speed option, so a learner's normal speed
|
|
85
|
+
can differ from the provider's (default: `1`). A value that is not a
|
|
86
|
+
positive number means `1`.
|
|
87
|
+
- `pitch` - The pitch this element's reads start at, `0`–`2` with `1` normal,
|
|
88
|
+
clamped to that range (default: the service's).
|
|
89
|
+
- `volume` - The volume this element's reads start at, `0`–`1`, clamped
|
|
90
|
+
(default: the service's).
|
|
91
|
+
|
|
92
|
+
Pitch and volume stay the service's after a read, so a read started
|
|
93
|
+
elsewhere, such as the annotation toolbar's read-selection, uses the last
|
|
94
|
+
values set.
|
|
83
95
|
|
|
84
96
|
### JavaScript Properties
|
|
85
97
|
|
package/custom-elements.json
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"kind": "field",
|
|
26
26
|
"name": "size",
|
|
27
27
|
"type": {
|
|
28
|
-
"text": "
|
|
28
|
+
"text": "TtsInlineSize"
|
|
29
29
|
},
|
|
30
30
|
"default": "'md'",
|
|
31
31
|
"attribute": "size"
|
|
@@ -55,6 +55,34 @@
|
|
|
55
55
|
},
|
|
56
56
|
"default": "'left-aligned'",
|
|
57
57
|
"attribute": "layout-mode"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"kind": "field",
|
|
61
|
+
"name": "baseRate",
|
|
62
|
+
"type": {
|
|
63
|
+
"text": "number"
|
|
64
|
+
},
|
|
65
|
+
"default": "1",
|
|
66
|
+
"description": "Multiplies every speed choice's rate, so 1× reads at this rate.",
|
|
67
|
+
"attribute": "base-rate"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"kind": "field",
|
|
71
|
+
"name": "pitch",
|
|
72
|
+
"type": {
|
|
73
|
+
"text": "number"
|
|
74
|
+
},
|
|
75
|
+
"description": "The pitch each read starts at, 0–2 with 1 normal.",
|
|
76
|
+
"attribute": "pitch"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"kind": "field",
|
|
80
|
+
"name": "volume",
|
|
81
|
+
"type": {
|
|
82
|
+
"text": "number"
|
|
83
|
+
},
|
|
84
|
+
"description": "The volume each read starts at, 0–1.",
|
|
85
|
+
"attribute": "volume"
|
|
58
86
|
}
|
|
59
87
|
],
|
|
60
88
|
"attributes": [
|
|
@@ -96,6 +124,31 @@
|
|
|
96
124
|
},
|
|
97
125
|
"default": "'left-aligned'",
|
|
98
126
|
"fieldName": "layoutMode"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"name": "base-rate",
|
|
130
|
+
"type": {
|
|
131
|
+
"text": "number"
|
|
132
|
+
},
|
|
133
|
+
"default": "1",
|
|
134
|
+
"description": "Multiplies every speed choice's rate, so 1× reads at this rate.",
|
|
135
|
+
"fieldName": "baseRate"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"name": "pitch",
|
|
139
|
+
"type": {
|
|
140
|
+
"text": "number"
|
|
141
|
+
},
|
|
142
|
+
"description": "The pitch each read starts at, 0–2 with 1 normal.",
|
|
143
|
+
"fieldName": "pitch"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"name": "volume",
|
|
147
|
+
"type": {
|
|
148
|
+
"text": "number"
|
|
149
|
+
},
|
|
150
|
+
"description": "The volume each read starts at, 0–1.",
|
|
151
|
+
"fieldName": "volume"
|
|
99
152
|
}
|
|
100
153
|
],
|
|
101
154
|
"events": [
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
Third-party software included in this package's bundles, with the licence each is used under.
|
|
2
|
+
|
|
3
|
+
========================================================================
|
|
4
|
+
|
|
5
|
+
svelte 5.57.3
|
|
6
|
+
License: MIT
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2016-2025 [Svelte Contributors](https://github.com/sveltejs/svelte/graphs/contributors)
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TTSLayoutMode, TTSSpeedOption } from '@pie-players/pie-assessment-toolkit/tools/registration';
|
|
2
|
+
export type TtsInlineSize = "sm" | "md" | "lg";
|
|
3
|
+
/** Inputs shared by the component and its native element declaration. */
|
|
4
|
+
export interface TtsInlineProps {
|
|
5
|
+
catalogId?: string;
|
|
6
|
+
size?: TtsInlineSize;
|
|
7
|
+
speedOptions?: TTSSpeedOption[];
|
|
8
|
+
showSingleSpeedOption?: boolean;
|
|
9
|
+
layoutMode?: TTSLayoutMode;
|
|
10
|
+
/** Multiplies every speed choice's rate, so 1× reads at this rate. */
|
|
11
|
+
baseRate?: number;
|
|
12
|
+
/** The pitch each read starts at, 0–2 with 1 normal. */
|
|
13
|
+
pitch?: number;
|
|
14
|
+
/** The volume each read starts at, 0–1. */
|
|
15
|
+
volume?: number;
|
|
16
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { TTSLayoutMode, TTSSpeedOption } from '@pie-players/pie-assessment-toolkit/tools/registration';
|
|
2
|
+
import { TtsInlineProps, TtsInlineSize } from './element-props.js';
|
|
3
|
+
export type PieToolTtsInlineSize = TtsInlineSize;
|
|
4
|
+
export type PieToolTtsInlineLayoutMode = TTSLayoutMode;
|
|
5
|
+
export type PieToolTtsInlineSpeedOption = TTSSpeedOption;
|
|
6
|
+
/** Native host interface for `<pie-tool-tts-inline>`. Properties may be unset until it mounts. */
|
|
7
|
+
export interface PieToolTtsInlineElement extends HTMLElement, TtsInlineProps {
|
|
8
|
+
}
|
|
9
|
+
declare global {
|
|
10
|
+
interface HTMLElementTagNameMap {
|
|
11
|
+
"pie-tool-tts-inline": PieToolTtsInlineElement;
|
|
12
|
+
}
|
|
13
|
+
}
|