@ssml-builder-js/ssml-editor-react 2.8.1 → 2.9.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/CHANGELOG.md +11 -0
- package/dist/index.d.mts +13 -2
- package/dist/index.d.ts +13 -2
- package/dist/index.js +414 -62
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +412 -58
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/SsmlEditor.tsx +153 -57
- package/src/components/VisualSsmlEditor.tsx +240 -0
- package/src/constants/ssmlPresets.ts +5 -0
- package/src/index.tsx +3 -0
- package/src/ssmlCompletion.ts +16 -0
- package/src/ssmlHover.ts +57 -0
- package/src/styles/editorStyles.ts +8 -0
- package/test/ui-components.test.tsx +13 -0
|
@@ -571,6 +571,19 @@ describe("SsmlEditor toolbar menus", () => {
|
|
|
571
571
|
});
|
|
572
572
|
|
|
573
573
|
describe("SsmlEditor props", () => {
|
|
574
|
+
it("renders the structured visual editor and exposes formatting controls", async () => {
|
|
575
|
+
const user = userEvent.setup();
|
|
576
|
+
const onChange = vi.fn();
|
|
577
|
+
renderEditor({ editMode: "visual", onChange });
|
|
578
|
+
|
|
579
|
+
expect(screen.getByRole("navigation", { name: "SSML structure tree" })).toBeTruthy();
|
|
580
|
+
expect(screen.getByRole("textbox", { name: "Text" })).toBeTruthy();
|
|
581
|
+
await user.click(
|
|
582
|
+
within(screen.getByRole("group", { name: "Apply SSML formatting" })).getByRole("button", { name: "Rate" }),
|
|
583
|
+
);
|
|
584
|
+
expect(onChange).toHaveBeenCalledWith(expect.objectContaining({ version: "1.0" }));
|
|
585
|
+
});
|
|
586
|
+
|
|
574
587
|
it("updates toolbar and popover text when the locale changes", async () => {
|
|
575
588
|
const user = userEvent.setup();
|
|
576
589
|
const { rerender } = renderEditor({ locale: "ja", showToolbarLabels: true });
|