@alepha/ui 0.35.0 → 0.36.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.
- package/README.md +54 -1
- package/dist/account/AccountBrand.d.ts +10 -3
- package/dist/account/AccountBrand.d.ts.map +1 -1
- package/dist/account/AccountBrand.js +12 -6
- package/dist/account/AccountBrand.js.map +1 -1
- package/dist/account/AccountLayout.d.ts.map +1 -1
- package/dist/account/AccountLayout.js +1 -1
- package/dist/account/AccountLayout.js.map +1 -1
- package/dist/admin/AdminUserDetail.d.ts +3 -3
- package/dist/admin/AdminUserDetail.js +3 -3
- package/dist/admin/AdminUserDetail.js.map +1 -1
- package/dist/ai/AiChat.d.ts +36 -6
- package/dist/ai/AiChat.d.ts.map +1 -1
- package/dist/ai/AiChat.js +101 -63
- package/dist/ai/AiChat.js.map +1 -1
- package/dist/ai/AiChatComposer.d.ts +22 -0
- package/dist/ai/AiChatComposer.d.ts.map +1 -0
- package/dist/ai/AiChatComposer.js +75 -0
- package/dist/ai/AiChatComposer.js.map +1 -0
- package/dist/ai/AiChatConfirmCard.d.ts +5 -2
- package/dist/ai/AiChatConfirmCard.d.ts.map +1 -1
- package/dist/ai/AiChatConfirmCard.js +7 -6
- package/dist/ai/AiChatConfirmCard.js.map +1 -1
- package/dist/ai/AiChatConfirmFields.d.ts +9 -0
- package/dist/ai/AiChatConfirmFields.d.ts.map +1 -0
- package/dist/ai/AiChatConfirmFields.js +45 -0
- package/dist/ai/AiChatConfirmFields.js.map +1 -0
- package/dist/ai/AiChatEmpty.d.ts +26 -0
- package/dist/ai/AiChatEmpty.d.ts.map +1 -0
- package/dist/ai/AiChatEmpty.js +47 -0
- package/dist/ai/AiChatEmpty.js.map +1 -0
- package/dist/ai/AiChatHistory.d.ts +3 -2
- package/dist/ai/AiChatHistory.d.ts.map +1 -1
- package/dist/ai/AiChatHistory.js +51 -22
- package/dist/ai/AiChatHistory.js.map +1 -1
- package/dist/ai/AiChatMessage.d.ts +14 -0
- package/dist/ai/AiChatMessage.d.ts.map +1 -1
- package/dist/ai/AiChatMessage.js +24 -12
- package/dist/ai/AiChatMessage.js.map +1 -1
- package/dist/ai/index.d.ts +3 -0
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js +4 -1
- package/dist/ai/useAiChat.d.ts +9 -0
- package/dist/ai/useAiChat.d.ts.map +1 -1
- package/dist/ai/useAiChat.js +21 -3
- package/dist/ai/useAiChat.js.map +1 -1
- package/dist/core/Sidebar.js +2 -2
- package/dist/core/Sidebar.js.map +1 -1
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +2 -1
- package/dist/core/useToast.d.ts +22 -1
- package/dist/core/useToast.d.ts.map +1 -1
- package/dist/core/useToast.js +4 -1
- package/dist/core/useToast.js.map +1 -1
- package/dist/core/useUndoable.d.ts +93 -0
- package/dist/core/useUndoable.d.ts.map +1 -0
- package/dist/core/useUndoable.js +172 -0
- package/dist/core/useUndoable.js.map +1 -0
- package/dist/i18n/fr/uiFr.d.ts.map +1 -1
- package/dist/i18n/fr/uiFr.js +51 -1
- package/dist/i18n/fr/uiFr.js.map +1 -1
- package/dist/markdown/MarkdownView.d.ts +15 -0
- package/dist/markdown/MarkdownView.d.ts.map +1 -1
- package/dist/markdown/MarkdownView.js +4 -1
- package/dist/markdown/MarkdownView.js.map +1 -1
- package/dist/organizations/useInviteOrganizationMember.d.ts +2 -2
- package/dist/organizations/useInviteOrganizationMember.js.map +1 -1
- package/dist/shell/AppShellSidebarNavItem.d.ts.map +1 -1
- package/dist/shell/AppShellSidebarNavItem.js +25 -2
- package/dist/shell/AppShellSidebarNavItem.js.map +1 -1
- package/dist/shell/PlateTabBar.d.ts.map +1 -1
- package/dist/shell/PlateTabBar.js +2 -2
- package/dist/shell/PlateTabBar.js.map +1 -1
- package/dist/shell/SidebarBackHeader.d.ts +35 -0
- package/dist/shell/SidebarBackHeader.d.ts.map +1 -0
- package/dist/shell/SidebarBackHeader.js +34 -0
- package/dist/shell/SidebarBackHeader.js.map +1 -0
- package/dist/shell/appShellNav.d.ts +30 -0
- package/dist/shell/appShellNav.d.ts.map +1 -1
- package/dist/shell/appShellNav.js.map +1 -1
- package/dist/shell/index.d.ts +2 -1
- package/dist/shell/index.d.ts.map +1 -1
- package/dist/shell/index.js +2 -1
- package/dist/swagger/$uiSwagger.d.ts +75 -0
- package/dist/swagger/$uiSwagger.d.ts.map +1 -0
- package/dist/swagger/$uiSwagger.js +51 -0
- package/dist/swagger/$uiSwagger.js.map +1 -0
- package/dist/swagger/OpenApiSpec.d.ts +113 -0
- package/dist/swagger/OpenApiSpec.d.ts.map +1 -0
- package/dist/swagger/OpenApiSpec.js +186 -0
- package/dist/swagger/OpenApiSpec.js.map +1 -0
- package/dist/swagger/SwaggerAccessBadge.d.ts +16 -0
- package/dist/swagger/SwaggerAccessBadge.d.ts.map +1 -0
- package/dist/swagger/SwaggerAccessBadge.js +40 -0
- package/dist/swagger/SwaggerAccessBadge.js.map +1 -0
- package/dist/swagger/SwaggerAlephaMeta.d.ts +11 -0
- package/dist/swagger/SwaggerAlephaMeta.d.ts.map +1 -0
- package/dist/swagger/SwaggerAlephaMeta.js +103 -0
- package/dist/swagger/SwaggerAlephaMeta.js.map +1 -0
- package/dist/swagger/SwaggerCredentials.d.ts +11 -0
- package/dist/swagger/SwaggerCredentials.d.ts.map +1 -0
- package/dist/swagger/SwaggerCredentials.js +35 -0
- package/dist/swagger/SwaggerCredentials.js.map +1 -0
- package/dist/swagger/SwaggerExplorer.d.ts +31 -0
- package/dist/swagger/SwaggerExplorer.d.ts.map +1 -0
- package/dist/swagger/SwaggerExplorer.js +156 -0
- package/dist/swagger/SwaggerExplorer.js.map +1 -0
- package/dist/swagger/SwaggerMethodBadge.d.ts +10 -0
- package/dist/swagger/SwaggerMethodBadge.d.ts.map +1 -0
- package/dist/swagger/SwaggerMethodBadge.js +27 -0
- package/dist/swagger/SwaggerMethodBadge.js.map +1 -0
- package/dist/swagger/SwaggerNav.d.ts +16 -0
- package/dist/swagger/SwaggerNav.d.ts.map +1 -0
- package/dist/swagger/SwaggerNav.js +63 -0
- package/dist/swagger/SwaggerNav.js.map +1 -0
- package/dist/swagger/SwaggerOperationView.d.ts +22 -0
- package/dist/swagger/SwaggerOperationView.d.ts.map +1 -0
- package/dist/swagger/SwaggerOperationView.js +89 -0
- package/dist/swagger/SwaggerOperationView.js.map +1 -0
- package/dist/swagger/SwaggerParameters.d.ts +11 -0
- package/dist/swagger/SwaggerParameters.d.ts.map +1 -0
- package/dist/swagger/SwaggerParameters.js +80 -0
- package/dist/swagger/SwaggerParameters.js.map +1 -0
- package/dist/swagger/SwaggerRequestBuilder.d.ts +83 -0
- package/dist/swagger/SwaggerRequestBuilder.d.ts.map +1 -0
- package/dist/swagger/SwaggerRequestBuilder.js +231 -0
- package/dist/swagger/SwaggerRequestBuilder.js.map +1 -0
- package/dist/swagger/SwaggerResponseView.d.ts +25 -0
- package/dist/swagger/SwaggerResponseView.d.ts.map +1 -0
- package/dist/swagger/SwaggerResponseView.js +94 -0
- package/dist/swagger/SwaggerResponseView.js.map +1 -0
- package/dist/swagger/SwaggerResponses.d.ts +12 -0
- package/dist/swagger/SwaggerResponses.d.ts.map +1 -0
- package/dist/swagger/SwaggerResponses.js +75 -0
- package/dist/swagger/SwaggerResponses.js.map +1 -0
- package/dist/swagger/SwaggerSchemaView.d.ts +19 -0
- package/dist/swagger/SwaggerSchemaView.d.ts.map +1 -0
- package/dist/swagger/SwaggerSchemaView.js +98 -0
- package/dist/swagger/SwaggerSchemaView.js.map +1 -0
- package/dist/swagger/SwaggerSection.d.ts +14 -0
- package/dist/swagger/SwaggerSection.d.ts.map +1 -0
- package/dist/swagger/SwaggerSection.js +23 -0
- package/dist/swagger/SwaggerSection.js.map +1 -0
- package/dist/swagger/SwaggerTryIt.d.ts +31 -0
- package/dist/swagger/SwaggerTryIt.d.ts.map +1 -0
- package/dist/swagger/SwaggerTryIt.js +68 -0
- package/dist/swagger/SwaggerTryIt.js.map +1 -0
- package/dist/swagger/SwaggerTryItForm.d.ts +20 -0
- package/dist/swagger/SwaggerTryItForm.d.ts.map +1 -0
- package/dist/swagger/SwaggerTryItForm.js +52 -0
- package/dist/swagger/SwaggerTryItForm.js.map +1 -0
- package/dist/swagger/index.d.ts +29 -0
- package/dist/swagger/index.d.ts.map +1 -0
- package/dist/swagger/index.js +18 -0
- package/dist/swagger/useSwaggerAccess.d.ts +24 -0
- package/dist/swagger/useSwaggerAccess.d.ts.map +1 -0
- package/dist/swagger/useSwaggerAccess.js +33 -0
- package/dist/swagger/useSwaggerAccess.js.map +1 -0
- package/dist/table/DataTable.d.ts.map +1 -1
- package/dist/table/DataTable.js +50 -13
- package/dist/table/DataTable.js.map +1 -1
- package/dist/table/DataTableBody.d.ts +18 -1
- package/dist/table/DataTableBody.d.ts.map +1 -1
- package/dist/table/DataTableBody.js +83 -58
- package/dist/table/DataTableBody.js.map +1 -1
- package/dist/table/DataTableRowActionsInline.d.ts +17 -0
- package/dist/table/DataTableRowActionsInline.d.ts.map +1 -0
- package/dist/table/DataTableRowActionsInline.js +45 -0
- package/dist/table/DataTableRowActionsInline.js.map +1 -0
- package/dist/table/PermissionMatrix.d.ts +4 -4
- package/dist/table/PermissionMatrix.js +2 -2
- package/dist/table/PermissionMatrix.js.map +1 -1
- package/dist/table/dataTableBaseProps.d.ts +31 -0
- package/dist/table/dataTableBaseProps.d.ts.map +1 -1
- package/dist/table/dataTableTypes.d.ts +16 -2
- package/dist/table/dataTableTypes.d.ts.map +1 -1
- package/dist/table/useDataTableData.d.ts +3 -0
- package/dist/table/useDataTableData.d.ts.map +1 -1
- package/dist/table/useDataTableData.js +9 -2
- package/dist/table/useDataTableData.js.map +1 -1
- package/dist/table/useDataTableRefresh.d.ts +1 -0
- package/dist/table/useDataTableRefresh.d.ts.map +1 -1
- package/dist/table/useDataTableRefresh.js +13 -1
- package/dist/table/useDataTableRefresh.js.map +1 -1
- package/dist/table/useOptimisticRows.d.ts +64 -0
- package/dist/table/useOptimisticRows.d.ts.map +1 -0
- package/dist/table/useOptimisticRows.js +185 -0
- package/dist/table/useOptimisticRows.js.map +1 -0
- package/dist/table/useRowMotion.d.ts +27 -0
- package/dist/table/useRowMotion.d.ts.map +1 -0
- package/dist/table/useRowMotion.js +112 -0
- package/dist/table/useRowMotion.js.map +1 -0
- package/docs/packages-alepha-ui-core.md +1 -0
- package/docs/packages-alepha-ui-overview.md +53 -1
- package/docs/packages-alepha-ui-swagger.md +35 -0
- package/package.json +11 -3
- package/src/account/AccountBrand.tsx +25 -6
- package/src/account/AccountLayout.tsx +5 -1
- package/src/admin/AdminUserDetail.tsx +3 -3
- package/src/admin/__tests__/AdminUserDetail.spec.ts +2 -2
- package/src/ai/AiChat.tsx +160 -82
- package/src/ai/AiChatComposer.tsx +117 -0
- package/src/ai/AiChatConfirmCard.tsx +7 -5
- package/src/ai/AiChatConfirmFields.tsx +65 -0
- package/src/ai/AiChatEmpty.tsx +73 -0
- package/src/ai/AiChatHistory.tsx +64 -28
- package/src/ai/AiChatMessage.tsx +47 -15
- package/src/ai/__tests__/AiChat.browser.spec.tsx +156 -5
- package/src/ai/index.ts +3 -0
- package/src/ai/useAiChat.ts +35 -0
- package/src/core/Sidebar.tsx +2 -2
- package/src/core/__tests__/useUndoable.browser.spec.tsx +201 -0
- package/src/core/index.ts +7 -0
- package/src/core/useToast.tsx +30 -2
- package/src/core/useUndoable.tsx +285 -0
- package/src/form/__tests__/ControlChoices.browser.spec.tsx +2 -1
- package/src/i18n/fr/uiFr.ts +53 -0
- package/src/markdown/MarkdownView.tsx +27 -9
- package/src/organizations/useInviteOrganizationMember.ts +2 -2
- package/src/shell/AppShellSidebarNavItem.tsx +51 -1
- package/src/shell/PlateTabBar.tsx +8 -2
- package/src/shell/SidebarBackHeader.tsx +58 -0
- package/src/shell/appShellNav.tsx +31 -0
- package/src/shell/index.ts +5 -1
- package/src/swagger/$uiSwagger.tsx +95 -0
- package/src/swagger/OpenApiSpec.ts +300 -0
- package/src/swagger/SwaggerAccessBadge.tsx +64 -0
- package/src/swagger/SwaggerAlephaMeta.tsx +141 -0
- package/src/swagger/SwaggerCredentials.tsx +44 -0
- package/src/swagger/SwaggerExplorer.tsx +208 -0
- package/src/swagger/SwaggerMethodBadge.tsx +32 -0
- package/src/swagger/SwaggerNav.tsx +92 -0
- package/src/swagger/SwaggerOperationView.tsx +102 -0
- package/src/swagger/SwaggerParameters.tsx +74 -0
- package/src/swagger/SwaggerRequestBuilder.ts +331 -0
- package/src/swagger/SwaggerResponseView.tsx +107 -0
- package/src/swagger/SwaggerResponses.tsx +83 -0
- package/src/swagger/SwaggerSchemaView.tsx +134 -0
- package/src/swagger/SwaggerSection.tsx +29 -0
- package/src/swagger/SwaggerTryIt.tsx +95 -0
- package/src/swagger/SwaggerTryItForm.tsx +87 -0
- package/src/swagger/__tests__/$uiSwagger.spec.ts +52 -0
- package/src/swagger/__tests__/OpenApiSpec.spec.ts +139 -0
- package/src/swagger/__tests__/SwaggerAccess.browser.spec.tsx +124 -0
- package/src/swagger/__tests__/SwaggerOperationView.browser.spec.tsx +194 -0
- package/src/swagger/__tests__/SwaggerRequestBuilder.spec.ts +250 -0
- package/src/swagger/index.ts +75 -0
- package/src/swagger/useSwaggerAccess.ts +59 -0
- package/src/table/DataTable.tsx +85 -34
- package/src/table/DataTableBody.tsx +51 -7
- package/src/table/DataTableRowActionsInline.tsx +80 -0
- package/src/table/PermissionMatrix.tsx +4 -4
- package/src/table/__tests__/DataTableEmptyState.browser.spec.tsx +1 -1
- package/src/table/__tests__/DataTableListMode.browser.spec.tsx +174 -0
- package/src/table/__tests__/DataTableOptimistic.browser.spec.tsx +173 -0
- package/src/table/__tests__/PermissionMatrix.browser.spec.tsx +2 -2
- package/src/table/__tests__/queryFilters.spec.ts +10 -12
- package/src/table/dataTableBaseProps.ts +31 -0
- package/src/table/dataTableTypes.ts +16 -2
- package/src/table/useDataTableData.ts +18 -2
- package/src/table/useDataTableRefresh.ts +26 -2
- package/src/table/useOptimisticRows.ts +265 -0
- package/src/table/useRowMotion.ts +152 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { act, fireEvent, render, waitFor } from "@testing-library/react";
|
|
2
|
+
import { Alepha } from "alepha";
|
|
3
|
+
import { AlephaContext } from "alepha/react";
|
|
4
|
+
import { AlephaReactI18n } from "alepha/react/i18n";
|
|
5
|
+
import { setupJsdomMocks } from "alepha/testing/react";
|
|
6
|
+
import { useEffect } from "react";
|
|
7
|
+
import { toast } from "sonner";
|
|
8
|
+
import { afterEach, beforeAll, describe, expect, it } from "vitest";
|
|
9
|
+
|
|
10
|
+
import { Toaster } from "../Toaster.tsx";
|
|
11
|
+
import {
|
|
12
|
+
type Undoable,
|
|
13
|
+
type UndoableOptions,
|
|
14
|
+
useUndoable,
|
|
15
|
+
} from "../useUndoable.tsx";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* `useUndoable` in both of its modes, against the real toaster.
|
|
19
|
+
*
|
|
20
|
+
* Each test names its toast uniquely: sonner's store is module-level, so a
|
|
21
|
+
* toast one test raised can still be on screen in the next.
|
|
22
|
+
*/
|
|
23
|
+
describe("useUndoable", () => {
|
|
24
|
+
let alepha: Alepha | undefined;
|
|
25
|
+
let undoable: Undoable | undefined;
|
|
26
|
+
|
|
27
|
+
beforeAll(() => {
|
|
28
|
+
setupJsdomMocks();
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
afterEach(async () => {
|
|
32
|
+
// A toast's auto-close timer (6 s) outlives the test: closed here, with
|
|
33
|
+
// its exit animation, so none fires after jsdom is torn down.
|
|
34
|
+
act(() => {
|
|
35
|
+
toast.dismiss();
|
|
36
|
+
});
|
|
37
|
+
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
38
|
+
await alepha?.stop();
|
|
39
|
+
alepha = undefined;
|
|
40
|
+
undoable = undefined;
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Hands the hook out from an effect: a render must not write outside
|
|
45
|
+
* itself.
|
|
46
|
+
*/
|
|
47
|
+
const Probe = (props: { onReady: (value: Undoable) => void }) => {
|
|
48
|
+
const value = useUndoable();
|
|
49
|
+
useEffect(() => props.onReady(value), [value]);
|
|
50
|
+
return null;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const mount = async () => {
|
|
54
|
+
alepha = Alepha.create().with(AlephaReactI18n);
|
|
55
|
+
await alepha.start();
|
|
56
|
+
render(
|
|
57
|
+
<AlephaContext.Provider value={alepha}>
|
|
58
|
+
<Toaster visibleToasts={20} />
|
|
59
|
+
<Probe
|
|
60
|
+
onReady={(value) => {
|
|
61
|
+
undoable = value;
|
|
62
|
+
}}
|
|
63
|
+
/>
|
|
64
|
+
</AlephaContext.Provider>,
|
|
65
|
+
);
|
|
66
|
+
await waitFor(() => expect(undoable).toBeDefined());
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const toastWith = (text: string) =>
|
|
70
|
+
[...document.querySelectorAll<HTMLElement>("[data-sonner-toast]")].find(
|
|
71
|
+
(it) => it.textContent?.includes(text),
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
const buttonIn = (text: string, name: RegExp) =>
|
|
75
|
+
[...(toastWith(text)?.querySelectorAll("button") ?? [])].find(
|
|
76
|
+
(button) =>
|
|
77
|
+
name.test(button.textContent ?? "") ||
|
|
78
|
+
name.test(button.getAttribute("aria-label") ?? ""),
|
|
79
|
+
) as HTMLElement;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* A local "screen" the apply writes, and a log of what reached the server.
|
|
83
|
+
*/
|
|
84
|
+
const harness = () => {
|
|
85
|
+
const state = { screen: "before", sent: [] as string[] };
|
|
86
|
+
const options: Omit<UndoableOptions, "message"> = {
|
|
87
|
+
apply: () => {
|
|
88
|
+
state.screen = "after";
|
|
89
|
+
return () => {
|
|
90
|
+
state.screen = "before";
|
|
91
|
+
};
|
|
92
|
+
},
|
|
93
|
+
commit: async () => {
|
|
94
|
+
state.sent.push("commit");
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
return { state, options };
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
it("sends an invertible write at once, and Undo sends its inverse", async () => {
|
|
101
|
+
await mount();
|
|
102
|
+
const { state, options } = harness();
|
|
103
|
+
|
|
104
|
+
let result: unknown;
|
|
105
|
+
await act(async () => {
|
|
106
|
+
result = await undoable!.run({
|
|
107
|
+
...options,
|
|
108
|
+
message: "Immediate one",
|
|
109
|
+
undo: async () => {
|
|
110
|
+
state.sent.push("undo");
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
expect(result).toEqual({ ok: true });
|
|
115
|
+
expect(state.screen).toBe("after");
|
|
116
|
+
expect(state.sent).toEqual(["commit"]);
|
|
117
|
+
|
|
118
|
+
await waitFor(() => expect(toastWith("Immediate one")).toBeTruthy());
|
|
119
|
+
fireEvent.click(buttonIn("Immediate one", /undo/i));
|
|
120
|
+
|
|
121
|
+
await waitFor(() => expect(state.sent).toEqual(["commit", "undo"]));
|
|
122
|
+
expect(state.screen).toBe("before");
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
it("holds a write with no inverse until the toast closes", async () => {
|
|
126
|
+
await mount();
|
|
127
|
+
const { state, options } = harness();
|
|
128
|
+
|
|
129
|
+
await act(async () => {
|
|
130
|
+
await undoable!.run({ ...options, message: "Held one" });
|
|
131
|
+
});
|
|
132
|
+
// On screen at once, on the server not yet.
|
|
133
|
+
expect(state.screen).toBe("after");
|
|
134
|
+
expect(state.sent).toEqual([]);
|
|
135
|
+
|
|
136
|
+
await waitFor(() => expect(toastWith("Held one")).toBeTruthy());
|
|
137
|
+
fireEvent.click(buttonIn("Held one", /close/i));
|
|
138
|
+
|
|
139
|
+
await waitFor(() => expect(state.sent).toEqual(["commit"]));
|
|
140
|
+
expect(state.screen).toBe("after");
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
it("never sends a held write that was undone", async () => {
|
|
144
|
+
await mount();
|
|
145
|
+
const { state, options } = harness();
|
|
146
|
+
|
|
147
|
+
await act(async () => {
|
|
148
|
+
await undoable!.run({ ...options, message: "Undone one" });
|
|
149
|
+
});
|
|
150
|
+
await waitFor(() => expect(toastWith("Undone one")).toBeTruthy());
|
|
151
|
+
fireEvent.click(buttonIn("Undone one", /undo/i));
|
|
152
|
+
|
|
153
|
+
await waitFor(() => expect(state.screen).toBe("before"));
|
|
154
|
+
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
155
|
+
expect(state.sent).toEqual([]);
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
it("rolls back a refused write and reports it once, without rejecting", async () => {
|
|
159
|
+
await mount();
|
|
160
|
+
const { state, options } = harness();
|
|
161
|
+
const reported: string[] = [];
|
|
162
|
+
alepha!.events.on("react:action:error", (event) => {
|
|
163
|
+
reported.push(event.error.message);
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
let result: Awaited<ReturnType<Undoable["run"]>> | undefined;
|
|
167
|
+
await act(async () => {
|
|
168
|
+
result = await undoable!.run({
|
|
169
|
+
...options,
|
|
170
|
+
message: "Refused one",
|
|
171
|
+
commit: async () => {
|
|
172
|
+
throw new Error("refused by the server (spec)");
|
|
173
|
+
},
|
|
174
|
+
undo: async () => {},
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
expect(result?.ok).toBe(false);
|
|
179
|
+
expect(state.screen).toBe("before");
|
|
180
|
+
expect(reported).toEqual(["refused by the server (spec)"]);
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
it("undoes the newest window on Ctrl+Z, and leaves a text field's own undo alone", async () => {
|
|
184
|
+
await mount();
|
|
185
|
+
const { state, options } = harness();
|
|
186
|
+
|
|
187
|
+
await act(async () => {
|
|
188
|
+
await undoable!.run({ ...options, message: "Keyboard one" });
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
const input = document.createElement("input");
|
|
192
|
+
document.body.appendChild(input);
|
|
193
|
+
fireEvent.keyDown(input, { key: "z", ctrlKey: true });
|
|
194
|
+
expect(state.screen).toBe("after");
|
|
195
|
+
input.remove();
|
|
196
|
+
|
|
197
|
+
fireEvent.keyDown(document.body, { key: "z", ctrlKey: true });
|
|
198
|
+
await waitFor(() => expect(state.screen).toBe("before"));
|
|
199
|
+
expect(state.sent).toEqual([]);
|
|
200
|
+
});
|
|
201
|
+
});
|
package/src/core/index.ts
CHANGED
|
@@ -520,4 +520,11 @@ export {
|
|
|
520
520
|
type ToastOptions,
|
|
521
521
|
useToast,
|
|
522
522
|
} from "./useToast.tsx";
|
|
523
|
+
export {
|
|
524
|
+
type Undoable,
|
|
525
|
+
type UndoableApplied,
|
|
526
|
+
type UndoableOptions,
|
|
527
|
+
type UndoableResult,
|
|
528
|
+
useUndoable,
|
|
529
|
+
} from "./useUndoable.tsx";
|
|
523
530
|
export { cn, formatBytes } from "./utils.ts";
|
package/src/core/useToast.tsx
CHANGED
|
@@ -30,6 +30,20 @@ export interface ToastOptions {
|
|
|
30
30
|
* Secondary description line under the main message.
|
|
31
31
|
*/
|
|
32
32
|
description?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Reuse an id to replace a toast in place rather than stacking a second
|
|
35
|
+
* one: a "Shelving..." toast that becomes "Shelved" keeps its slot.
|
|
36
|
+
*/
|
|
37
|
+
id?: string | number;
|
|
38
|
+
/**
|
|
39
|
+
* Called when the reader closes the toast (the close button, a swipe).
|
|
40
|
+
* Not called on an action click or a timeout.
|
|
41
|
+
*/
|
|
42
|
+
onDismiss?: () => void;
|
|
43
|
+
/**
|
|
44
|
+
* Called when the toast times out on its own.
|
|
45
|
+
*/
|
|
46
|
+
onAutoClose?: () => void;
|
|
33
47
|
}
|
|
34
48
|
|
|
35
49
|
/**
|
|
@@ -38,11 +52,22 @@ export interface ToastOptions {
|
|
|
38
52
|
* for code that picks the intent dynamically.
|
|
39
53
|
*/
|
|
40
54
|
export interface Toast {
|
|
41
|
-
|
|
55
|
+
/**
|
|
56
|
+
* Returns the toast's id, for `dismiss` or to replace it with `id`.
|
|
57
|
+
*/
|
|
58
|
+
show(
|
|
59
|
+
message: string,
|
|
60
|
+
intent?: ToastIntent,
|
|
61
|
+
options?: ToastOptions,
|
|
62
|
+
): string | number;
|
|
42
63
|
success(message: string, options?: ToastOptions): void;
|
|
43
64
|
error(message: string, options?: ToastOptions): void;
|
|
44
65
|
warning(message: string, options?: ToastOptions): void;
|
|
45
66
|
info(message: string, options?: ToastOptions): void;
|
|
67
|
+
/**
|
|
68
|
+
* Close one toast by the id a call above returned, or every toast.
|
|
69
|
+
*/
|
|
70
|
+
dismiss(id?: string | number): void;
|
|
46
71
|
}
|
|
47
72
|
|
|
48
73
|
/**
|
|
@@ -80,7 +105,7 @@ const toast: Toast = {
|
|
|
80
105
|
if (intent === "warning") return sonner.warning(message, opts);
|
|
81
106
|
if (intent === "info") return sonner.info(message, opts);
|
|
82
107
|
// Neutral "primary" — sonner exposes `.message` for the unflavoured toast.
|
|
83
|
-
sonner.message(message, opts);
|
|
108
|
+
return sonner.message(message, opts);
|
|
84
109
|
},
|
|
85
110
|
success(message, options) {
|
|
86
111
|
sonner.success(message, toSonner(options));
|
|
@@ -94,6 +119,9 @@ const toast: Toast = {
|
|
|
94
119
|
info(message, options) {
|
|
95
120
|
sonner.info(message, toSonner(options));
|
|
96
121
|
},
|
|
122
|
+
dismiss(id) {
|
|
123
|
+
sonner.dismiss(id);
|
|
124
|
+
},
|
|
97
125
|
};
|
|
98
126
|
|
|
99
127
|
export function useToast(): Toast {
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import { ActionErrorPolicy, useAlepha } from "alepha/react";
|
|
2
|
+
import { useI18n } from "alepha/react/i18n";
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
|
|
5
|
+
import { type ToastIntent, useToast } from "./useToast.tsx";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* What `apply` hands back: how to put the screen back, and optionally how to
|
|
9
|
+
* say the server agreed. A `DataTable` row handle (`ctx.optimistic.remove`)
|
|
10
|
+
* has this shape, so it can be returned as is.
|
|
11
|
+
*/
|
|
12
|
+
export type UndoableApplied =
|
|
13
|
+
| void
|
|
14
|
+
| (() => void)
|
|
15
|
+
| { rollback: () => void; settle?: () => void };
|
|
16
|
+
|
|
17
|
+
export interface UndoableOptions {
|
|
18
|
+
/**
|
|
19
|
+
* The toast's message, in the past tense: the change has happened as far
|
|
20
|
+
* as the reader can see ("Task archived").
|
|
21
|
+
*/
|
|
22
|
+
message: string;
|
|
23
|
+
description?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Defaults to "success".
|
|
26
|
+
*/
|
|
27
|
+
intent?: ToastIntent;
|
|
28
|
+
/**
|
|
29
|
+
* Defaults to the translated "Undo".
|
|
30
|
+
*/
|
|
31
|
+
undoLabel?: string;
|
|
32
|
+
/**
|
|
33
|
+
* How long the toast, and with it the undo window, stays. Defaults to
|
|
34
|
+
* 6000 ms.
|
|
35
|
+
*/
|
|
36
|
+
duration?: number;
|
|
37
|
+
/**
|
|
38
|
+
* The local change, made at once, before any request: hide a row, patch a
|
|
39
|
+
* status chip, move a counter. Returns how to roll it back.
|
|
40
|
+
*/
|
|
41
|
+
apply?: () => UndoableApplied;
|
|
42
|
+
/**
|
|
43
|
+
* The server write.
|
|
44
|
+
*/
|
|
45
|
+
commit: () => Promise<unknown>;
|
|
46
|
+
/**
|
|
47
|
+
* The server write that cancels `commit`, when there is one (unarchive for
|
|
48
|
+
* archive). Its presence picks the mode:
|
|
49
|
+
*
|
|
50
|
+
* - **with `undo`**: `commit` is sent now, and Undo sends `undo`. The
|
|
51
|
+
* server is the truth from the first second, other tabs and agents see
|
|
52
|
+
* it, and closing the tab loses nothing.
|
|
53
|
+
* - **without**: `commit` is held until the toast closes, and Undo simply
|
|
54
|
+
* never sends it. The mode for a write with no inverse (a hard delete).
|
|
55
|
+
* A held write is flushed when the page is hidden, so leaving does not
|
|
56
|
+
* cancel it.
|
|
57
|
+
*/
|
|
58
|
+
undo?: () => Promise<unknown>;
|
|
59
|
+
/**
|
|
60
|
+
* After the server accepted `commit` (immediately, or once the window
|
|
61
|
+
* closed). Refresh what depends on it here: a badge, a sibling list.
|
|
62
|
+
*/
|
|
63
|
+
onCommitted?: () => void;
|
|
64
|
+
/**
|
|
65
|
+
* After the change was undone, locally and (with `undo`) on the server.
|
|
66
|
+
*/
|
|
67
|
+
onUndone?: () => void;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Optimistic writes with an Undo toast.
|
|
72
|
+
*
|
|
73
|
+
* `run` applies the local change at once, shows a toast with an Undo button,
|
|
74
|
+
* and either commits now (`undo` given) or when the window closes. It
|
|
75
|
+
* resolves once the change is visible and, in immediate mode, accepted.
|
|
76
|
+
*
|
|
77
|
+
* Call it straight from the click, not from inside a `useAction`: the
|
|
78
|
+
* change must reach the screen in the click's own frame, and `useAction`
|
|
79
|
+
* awaits its `react:action:begin` listeners before the handler starts. `run`
|
|
80
|
+
* reports its own failures (rolled back, then `react:action:error`, which
|
|
81
|
+
* the root `ActionErrorToaster` shows). `Ctrl+Z` / `Cmd+Z` undoes the newest
|
|
82
|
+
* open toast.
|
|
83
|
+
*/
|
|
84
|
+
export const useUndoable = (): Undoable => {
|
|
85
|
+
const alepha = useAlepha();
|
|
86
|
+
const toast = useToast();
|
|
87
|
+
const { tr } = useI18n();
|
|
88
|
+
|
|
89
|
+
return useMemo(() => {
|
|
90
|
+
const report = (error: unknown) => {
|
|
91
|
+
void alepha.events.emit("react:action:error", {
|
|
92
|
+
type: "custom",
|
|
93
|
+
id: "undoable",
|
|
94
|
+
error: error as Error,
|
|
95
|
+
handled: ActionErrorPolicy.isHandled(error),
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
const run = async (options: UndoableOptions): Promise<UndoableResult> => {
|
|
100
|
+
const applied = options.apply?.();
|
|
101
|
+
const rollback = () => {
|
|
102
|
+
if (typeof applied === "function") applied();
|
|
103
|
+
else applied?.rollback();
|
|
104
|
+
};
|
|
105
|
+
const settle = () => {
|
|
106
|
+
if (applied && typeof applied === "object") applied.settle?.();
|
|
107
|
+
};
|
|
108
|
+
const immediate = Boolean(options.undo);
|
|
109
|
+
|
|
110
|
+
// Immediate mode: the write leaves now. Undo waits for it, so an Undo
|
|
111
|
+
// clicked while it is in flight sends the inverse after, never before.
|
|
112
|
+
let committing: Promise<boolean> | undefined;
|
|
113
|
+
|
|
114
|
+
const entry = UNDO_QUEUE.open({
|
|
115
|
+
undo: async () => {
|
|
116
|
+
if (committing && !(await committing)) return;
|
|
117
|
+
rollback();
|
|
118
|
+
if (immediate) {
|
|
119
|
+
try {
|
|
120
|
+
await options.undo!();
|
|
121
|
+
} catch (error) {
|
|
122
|
+
// The server kept the change: the screen must say so too.
|
|
123
|
+
options.apply?.();
|
|
124
|
+
report(error);
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
settle();
|
|
128
|
+
}
|
|
129
|
+
options.onUndone?.();
|
|
130
|
+
},
|
|
131
|
+
commit: immediate
|
|
132
|
+
? undefined
|
|
133
|
+
: async () => {
|
|
134
|
+
try {
|
|
135
|
+
await options.commit();
|
|
136
|
+
} catch (error) {
|
|
137
|
+
rollback();
|
|
138
|
+
report(error);
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
settle();
|
|
142
|
+
options.onCommitted?.();
|
|
143
|
+
},
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
// The toast goes up with the change, not after the server: it is the
|
|
147
|
+
// acknowledgement of the click.
|
|
148
|
+
const id = toast.show(options.message, options.intent ?? "success", {
|
|
149
|
+
description: options.description,
|
|
150
|
+
duration: options.duration ?? 6000,
|
|
151
|
+
action: {
|
|
152
|
+
label: options.undoLabel ?? tr("undoable.undo", { default: "Undo" }),
|
|
153
|
+
onClick: () => void UNDO_QUEUE.undo(entry),
|
|
154
|
+
},
|
|
155
|
+
onAutoClose: () => void UNDO_QUEUE.close(entry),
|
|
156
|
+
onDismiss: () => void UNDO_QUEUE.close(entry),
|
|
157
|
+
});
|
|
158
|
+
entry.dismiss = () => toast.dismiss(id);
|
|
159
|
+
|
|
160
|
+
if (!immediate) return { ok: true };
|
|
161
|
+
|
|
162
|
+
let failure: unknown;
|
|
163
|
+
committing = options.commit().then(
|
|
164
|
+
() => true,
|
|
165
|
+
(error: unknown) => {
|
|
166
|
+
failure = error;
|
|
167
|
+
return false;
|
|
168
|
+
},
|
|
169
|
+
);
|
|
170
|
+
if (!(await committing)) {
|
|
171
|
+
UNDO_QUEUE.cancel(entry);
|
|
172
|
+
rollback();
|
|
173
|
+
report(failure);
|
|
174
|
+
return { ok: false, reason: "error", error: failure };
|
|
175
|
+
}
|
|
176
|
+
settle();
|
|
177
|
+
options.onCommitted?.();
|
|
178
|
+
return { ok: true };
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
return { run };
|
|
182
|
+
}, [alepha, toast, tr]);
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
export interface Undoable {
|
|
186
|
+
/**
|
|
187
|
+
* Never rejects: a failure is rolled back and reported on
|
|
188
|
+
* `react:action:error` (the root `ActionErrorToaster` shows it), and the
|
|
189
|
+
* result says so for a caller that has a follow-up.
|
|
190
|
+
*/
|
|
191
|
+
run: (options: UndoableOptions) => Promise<UndoableResult>;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export type UndoableResult =
|
|
195
|
+
| { ok: true }
|
|
196
|
+
| { ok: false; reason: "error"; error: unknown };
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* One open undo window.
|
|
200
|
+
*/
|
|
201
|
+
interface UndoEntry {
|
|
202
|
+
undo: () => Promise<void>;
|
|
203
|
+
/**
|
|
204
|
+
* The held write, in deferred mode.
|
|
205
|
+
*/
|
|
206
|
+
commit?: () => Promise<void>;
|
|
207
|
+
dismiss?: () => void;
|
|
208
|
+
done: boolean;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* The open undo windows, outside React: a held commit must still go out when
|
|
213
|
+
* the component that started it unmounts (the reader navigated away), and
|
|
214
|
+
* the page-hide flush and the keyboard shortcut are document-wide.
|
|
215
|
+
*/
|
|
216
|
+
class UndoQueue {
|
|
217
|
+
protected entries: UndoEntry[] = [];
|
|
218
|
+
protected listening = false;
|
|
219
|
+
|
|
220
|
+
open(entry: Omit<UndoEntry, "done">): UndoEntry {
|
|
221
|
+
const full: UndoEntry = { ...entry, done: false };
|
|
222
|
+
this.entries.push(full);
|
|
223
|
+
this.listen();
|
|
224
|
+
return full;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
async undo(entry: UndoEntry): Promise<void> {
|
|
228
|
+
if (entry.done) return;
|
|
229
|
+
entry.done = true;
|
|
230
|
+
this.drop(entry);
|
|
231
|
+
// The action click closes the toast already; the shortcut does not.
|
|
232
|
+
entry.dismiss?.();
|
|
233
|
+
await entry.undo();
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* The write failed: the window closes with nothing to commit or undo.
|
|
238
|
+
*/
|
|
239
|
+
cancel(entry: UndoEntry): void {
|
|
240
|
+
if (entry.done) return;
|
|
241
|
+
entry.done = true;
|
|
242
|
+
this.drop(entry);
|
|
243
|
+
entry.dismiss?.();
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
async close(entry: UndoEntry): Promise<void> {
|
|
247
|
+
if (entry.done) return;
|
|
248
|
+
entry.done = true;
|
|
249
|
+
this.drop(entry);
|
|
250
|
+
await entry.commit?.();
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
protected drop(entry: UndoEntry) {
|
|
254
|
+
this.entries = this.entries.filter((e) => e !== entry);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
protected listen() {
|
|
258
|
+
if (this.listening || typeof window === "undefined") return;
|
|
259
|
+
this.listening = true;
|
|
260
|
+
// A held write goes out when the page is hidden: closing the tab inside
|
|
261
|
+
// the window is "I meant it", not "undo".
|
|
262
|
+
window.addEventListener("pagehide", () => {
|
|
263
|
+
// No copy needed: `drop` replaces `entries` rather than splicing it,
|
|
264
|
+
// so this loop walks the list as it was when the page went away.
|
|
265
|
+
for (const entry of this.entries) void this.close(entry);
|
|
266
|
+
});
|
|
267
|
+
window.addEventListener("keydown", (event) => {
|
|
268
|
+
if (event.key !== "z" || !(event.metaKey || event.ctrlKey)) return;
|
|
269
|
+
if (event.shiftKey || event.altKey) return;
|
|
270
|
+
const target = event.target as HTMLElement | null;
|
|
271
|
+
// Text fields keep their own undo.
|
|
272
|
+
if (
|
|
273
|
+
target?.closest("input, textarea, select, [contenteditable='true']")
|
|
274
|
+
) {
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
const last = this.entries.at(-1);
|
|
278
|
+
if (!last) return;
|
|
279
|
+
event.preventDefault();
|
|
280
|
+
void this.undo(last);
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
const UNDO_QUEUE = new UndoQueue();
|
|
@@ -11,7 +11,8 @@ import { beforeAll, describe, expect, it } from "vitest";
|
|
|
11
11
|
import { Control } from "../Control.tsx";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* The field shapes
|
|
14
|
+
* The field shapes a downstream app reached for and the kit did not have
|
|
15
|
+
* (#Q2760):
|
|
15
16
|
*
|
|
16
17
|
* - a boolean switch draws no required marker: it always holds a value;
|
|
17
18
|
* - `checkboxes` renders a multi-choice as one checkbox per option, every
|
package/src/i18n/fr/uiFr.ts
CHANGED
|
@@ -45,23 +45,33 @@
|
|
|
45
45
|
export const uiFr: Record<string, string> = {
|
|
46
46
|
// The assistant drawer (`@alepha/ui/ai`).
|
|
47
47
|
"ai.chat.approve": "Approuver",
|
|
48
|
+
"ai.chat.close": "Fermer",
|
|
48
49
|
"ai.chat.confirmTitle": "Exécuter $1 ?",
|
|
49
50
|
"ai.chat.deny": "Refuser",
|
|
50
51
|
"ai.chat.empty": "Posez une question sur cette page.",
|
|
52
|
+
"ai.chat.emptyTitle": "Que voulez-vous faire ?",
|
|
53
|
+
"ai.chat.hint": "Entrée pour envoyer, Maj+Entrée pour aller à la ligne",
|
|
54
|
+
"ai.chat.history": "Historique",
|
|
51
55
|
"ai.chat.message": "Message",
|
|
52
56
|
"ai.chat.new": "Nouvelle conversation",
|
|
57
|
+
"ai.chat.noHistory": "Aucune conversation pour l'instant",
|
|
53
58
|
"ai.chat.placeholder": "Demandez à l'assistant",
|
|
54
59
|
"ai.chat.running": "Exécution de $1",
|
|
55
60
|
"ai.chat.send": "Envoyer",
|
|
61
|
+
"ai.chat.stop": "Arrêter",
|
|
62
|
+
"ai.chat.thinking": "Réflexion…",
|
|
56
63
|
"ai.chat.title": "Assistant",
|
|
64
|
+
"ai.chat.toolDenied": "$1 annulé",
|
|
57
65
|
"ai.chat.toolDone": "$1 exécuté",
|
|
58
66
|
"ai.chat.toolFailed": "Échec de $1",
|
|
59
67
|
"ai.chat.untitled": "Conversation sans titre",
|
|
68
|
+
"ai.chat.waiting": "Confirmez ou annulez la carte pour continuer",
|
|
60
69
|
|
|
61
70
|
// The imperative confirm / alert / prompt.
|
|
62
71
|
"useDialog.cancel": "Annuler",
|
|
63
72
|
"useDialog.confirm": "Confirmer",
|
|
64
73
|
"useDialog.ok": "OK",
|
|
74
|
+
"undoable.undo": "Annuler",
|
|
65
75
|
|
|
66
76
|
// The data table: toolbar, selection, empty state.
|
|
67
77
|
"dataTable.bulkMenu.empty": "Rien à choisir",
|
|
@@ -1281,4 +1291,47 @@ export const uiFr: Record<string, string> = {
|
|
|
1281
1291
|
"organizations.transfer.done": "Propriété transférée à $1",
|
|
1282
1292
|
"organizations.transfer.title": "Transférer la propriété",
|
|
1283
1293
|
"organizations.transfer.yourRank": "Votre nouveau rang",
|
|
1294
|
+
|
|
1295
|
+
// The API explorer (`@alepha/ui/swagger`).
|
|
1296
|
+
"swagger.access.allowed": "Vous pouvez l'appeler",
|
|
1297
|
+
"swagger.access.denied": "Vos permissions ne le permettent pas",
|
|
1298
|
+
"swagger.access.signIn": "Connectez-vous pour l'appeler",
|
|
1299
|
+
"swagger.access.unknown": "Connecté ; accès vérifié à l'appel",
|
|
1300
|
+
"swagger.credentials.description":
|
|
1301
|
+
"Envoyé à la place de votre session. Conservé jusqu'au rechargement.",
|
|
1302
|
+
"swagger.credentials.label": "Jeton porteur ou clé d'API",
|
|
1303
|
+
"swagger.credentials.set": "Appels avec un jeton",
|
|
1304
|
+
"swagger.credentials.title": "Identifiants",
|
|
1305
|
+
"swagger.deprecated": "obsolète",
|
|
1306
|
+
"swagger.emptyDocument": "Ce document ne contient aucune opération.",
|
|
1307
|
+
"swagger.error": "Le document OpenAPI n'a pas pu être lu",
|
|
1308
|
+
"swagger.meta.access": "Accès",
|
|
1309
|
+
"swagger.meta.action": "Action",
|
|
1310
|
+
"swagger.meta.errors": "Erreurs déclarées",
|
|
1311
|
+
"swagger.meta.middlewares": "Middlewares",
|
|
1312
|
+
"swagger.meta.signedIn": "Tout utilisateur connecté",
|
|
1313
|
+
"swagger.meta.timeout": "Délai maximal",
|
|
1314
|
+
"swagger.parameters.description": "Description",
|
|
1315
|
+
"swagger.parameters.example": "Exemple",
|
|
1316
|
+
"swagger.parameters.in": "Emplacement",
|
|
1317
|
+
"swagger.parameters.name": "Nom",
|
|
1318
|
+
"swagger.parameters.type": "Type",
|
|
1319
|
+
"swagger.raw": "JSON OpenAPI",
|
|
1320
|
+
"swagger.response": "Réponse",
|
|
1321
|
+
"swagger.response.empty": "Pas de corps.",
|
|
1322
|
+
"swagger.response.headers": "En-têtes",
|
|
1323
|
+
"swagger.response.waiting": "En attente de données...",
|
|
1324
|
+
"swagger.schema.required": "requis",
|
|
1325
|
+
"swagger.search": "Rechercher une opération",
|
|
1326
|
+
"swagger.search.empty": "Aucune opération ne correspond.",
|
|
1327
|
+
"swagger.section.body": "Corps de la requête",
|
|
1328
|
+
"swagger.section.parameters": "Paramètres",
|
|
1329
|
+
"swagger.section.responses": "Réponses",
|
|
1330
|
+
"swagger.secured": "Connexion requise",
|
|
1331
|
+
"swagger.title": "API",
|
|
1332
|
+
"swagger.tryIt.body": "Corps",
|
|
1333
|
+
"swagger.tryIt.form": "Formulaire",
|
|
1334
|
+
"swagger.tryIt.json": "JSON",
|
|
1335
|
+
"swagger.tryIt.send": "Envoyer",
|
|
1336
|
+
"swagger.tryIt.title": "Essayer",
|
|
1284
1337
|
};
|