@nocode-factory/sanity-kit 2.15.0 → 2.17.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/dist/index.d.ts +1 -1
- package/dist/index.js +184 -72
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/lib/pages.ts +2 -1
- package/src/lib/undo.ts +91 -0
- package/src/tools/history/DiffPanel.tsx +87 -37
- package/src/tools/pages/PagesTool.tsx +35 -4
- package/src/tools/pages/PagesToolbar.tsx +5 -5
- package/src/version.ts +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1303,7 +1303,7 @@ export declare function ActorName(props: {
|
|
|
1303
1303
|
* quelle version. Recopiée de `package.json` par `npm version` (scripts/sync-version.mjs) ; un test
|
|
1304
1304
|
* le vérifie.
|
|
1305
1305
|
*/
|
|
1306
|
-
export declare const KIT_VERSION = "2.
|
|
1306
|
+
export declare const KIT_VERSION = "2.17.0";
|
|
1307
1307
|
/**
|
|
1308
1308
|
* Données de la page proposées comme colonnes.
|
|
1309
1309
|
*
|
package/dist/index.js
CHANGED
|
@@ -34,6 +34,7 @@ import "@xyflow/react/dist/style.css";
|
|
|
34
34
|
import { TrashIcon } from "@sanity/icons/Trash";
|
|
35
35
|
import { RefreshIcon } from "@sanity/icons/Refresh";
|
|
36
36
|
import { RestoreIcon } from "@sanity/icons/Restore";
|
|
37
|
+
import { UndoIcon } from "@sanity/icons/Undo";
|
|
37
38
|
import { Tooltip } from "@sanity/ui/tooltip";
|
|
38
39
|
const DEFAULT_PAGE_BUILDER_FIELD = "sections", DEFAULT_SLUG_FIELD = "slug", DEFAULT_TITLE_FIELD = "title", DEFAULT_NOINDEX_FIELDS = ["seo.noindex", "noindex"], DEFAULT_I18N = {
|
|
39
40
|
field: "language",
|
|
@@ -1361,7 +1362,7 @@ function explainGrantError(error) {
|
|
|
1361
1362
|
* quelle version. Recopiée de `package.json` par `npm version` (scripts/sync-version.mjs) ; un test
|
|
1362
1363
|
* le vérifie.
|
|
1363
1364
|
*/
|
|
1364
|
-
const KIT_VERSION = "2.
|
|
1365
|
+
const KIT_VERSION = "2.17.0";
|
|
1365
1366
|
/**
|
|
1366
1367
|
* Signale ce Studio au service du kit, une fois par montage.
|
|
1367
1368
|
*
|
|
@@ -1688,7 +1689,7 @@ function useKitUpdate() {
|
|
|
1688
1689
|
!controller.signal.aborted && body?.version && setLatest(body.version);
|
|
1689
1690
|
}).catch(() => {}), () => controller.abort();
|
|
1690
1691
|
}, []);
|
|
1691
|
-
let available = !!(latest && !isPrerelease(latest) && compareVersions(latest, "2.
|
|
1692
|
+
let available = !!(latest && !isPrerelease(latest) && compareVersions(latest, "2.17.0") > 0);
|
|
1692
1693
|
return {
|
|
1693
1694
|
current: KIT_VERSION,
|
|
1694
1695
|
latest,
|
|
@@ -2228,7 +2229,7 @@ function sortRows(rows, key, direction, options = {}) {
|
|
|
2228
2229
|
const normalize = (value) => value.toLocaleLowerCase("fr").normalize("NFD").replace(/\p{Diacritic}/gu, "");
|
|
2229
2230
|
function filterRows(rows, filters) {
|
|
2230
2231
|
let search = filters.search?.trim() ? normalize(filters.search.trim()) : null;
|
|
2231
|
-
return rows.filter((row) => !(filters.types?.length && !filters.types.includes(row.type) || filters.statuses?.length && !filters.statuses.includes(row.status) || filters.locales?.length && !filters.locales.includes(row.locale
|
|
2232
|
+
return rows.filter((row) => !(filters.types?.length && !filters.types.includes(row.type) || filters.statuses?.length && !filters.statuses.includes(row.status) || filters.locales?.length && row.locale && !filters.locales.includes(row.locale) || search && !`${normalize(row.title)} ${normalize(row.path ?? "")}`.includes(search)));
|
|
2232
2233
|
}
|
|
2233
2234
|
/** Langues réellement présentes, pour ne proposer que des filtres utiles. */
|
|
2234
2235
|
function localesInRows(rows) {
|
|
@@ -4094,12 +4095,12 @@ function PagesTable(props) {
|
|
|
4094
4095
|
});
|
|
4095
4096
|
}
|
|
4096
4097
|
/**
|
|
4097
|
-
* Recherche et rafraîchissement
|
|
4098
|
+
* Recherche et rafraîchissement.
|
|
4098
4099
|
*
|
|
4099
|
-
* Les filtres par type
|
|
4100
|
-
*
|
|
4101
|
-
*
|
|
4102
|
-
*
|
|
4100
|
+
* Les filtres par type et statut restent absents : le regroupement rend ces
|
|
4101
|
+
* distinctions visibles sans rien masquer. La langue, elle, a son propre
|
|
4102
|
+
* sélecteur (PagesTool) : sur un site multilingue, l'éditeur travaille une
|
|
4103
|
+
* langue à la fois et le regroupement ne suffit pas à alléger la liste.
|
|
4103
4104
|
*/
|
|
4104
4105
|
function PagesToolbar(props) {
|
|
4105
4106
|
return /* @__PURE__ */ jsxs(Flex, {
|
|
@@ -5412,14 +5413,18 @@ function BoardView(props) {
|
|
|
5412
5413
|
return /* @__PURE__ */ jsx(ReactFlowProvider, { children: /* @__PURE__ */ jsx(Board, { ...props }) });
|
|
5413
5414
|
}
|
|
5414
5415
|
function PagesTool() {
|
|
5415
|
-
let config = useKitConfig(), router = useRouter(), { byId, saveColumns, patchNode, patchField } = useBoardLayout(), columnOptions = useColumnOptions(), preview = usePreviewTarget(), columns = useInternalColumns(), [view, setView] = useState("list"), [search, setSearch] = useState(""), [groupBy, setGroupBy] = useState("none"), [rawColorBy, setColorBy] = useState("tag"), [sortKey, setSortKey] = useState("structure"), [sortDirection, setSortDirection] = useState("asc"), [page, setPage] = useState(0), [hidden, setHidden] = useState(/* @__PURE__ */ new Set()), [shownData, setShownData] = useState(/* @__PURE__ */ new Set()), toggleData = useCallback((key) => {
|
|
5416
|
+
let config = useKitConfig(), router = useRouter(), { byId, saveColumns, patchNode, patchField } = useBoardLayout(), columnOptions = useColumnOptions(), preview = usePreviewTarget(), columns = useInternalColumns(), [view, setView] = useState("list"), [search, setSearch] = useState(""), [locale, setLocale] = useState(""), [groupBy, setGroupBy] = useState("none"), [rawColorBy, setColorBy] = useState("tag"), [sortKey, setSortKey] = useState("structure"), [sortDirection, setSortDirection] = useState("asc"), [page, setPage] = useState(0), [hidden, setHidden] = useState(/* @__PURE__ */ new Set()), [shownData, setShownData] = useState(/* @__PURE__ */ new Set()), toggleData = useCallback((key) => {
|
|
5416
5417
|
setShownData((current) => {
|
|
5417
5418
|
let next = new Set(current);
|
|
5418
5419
|
return next.has(key) ? next.delete(key) : next.add(key), next;
|
|
5419
5420
|
});
|
|
5420
|
-
}, []), documentColumns = useDocumentColumns(), visibleDataColumns = useMemo(() => documentColumns.filter((column) => shownData.has(column.key)), [documentColumns, shownData]), { rows, loading, error, refresh } = usePages(visibleDataColumns), colorBy = resolveColorBy(rawColorBy, columns),
|
|
5421
|
+
}, []), documentColumns = useDocumentColumns(), visibleDataColumns = useMemo(() => documentColumns.filter((column) => shownData.has(column.key)), [documentColumns, shownData]), { rows, loading, error, refresh } = usePages(visibleDataColumns), colorBy = resolveColorBy(rawColorBy, columns), locales = useMemo(() => config.i18n?.locales.length ? config.i18n.locales : localesInRows(rows), [config.i18n, rows]), visible = useMemo(() => sortRows(filterRows(rows, {
|
|
5422
|
+
search,
|
|
5423
|
+
locales: locale ? [locale] : void 0
|
|
5424
|
+
}), sortKey, sortDirection, { typeOrder: config.pageTypeNames }), [
|
|
5421
5425
|
rows,
|
|
5422
5426
|
search,
|
|
5427
|
+
locale,
|
|
5423
5428
|
sortKey,
|
|
5424
5429
|
sortDirection,
|
|
5425
5430
|
config.pageTypeNames
|
|
@@ -5519,6 +5524,27 @@ function PagesTool() {
|
|
|
5519
5524
|
onToggleData: toggleData
|
|
5520
5525
|
})
|
|
5521
5526
|
}),
|
|
5527
|
+
locales.length > 1 && /* @__PURE__ */ jsxs(Box, {
|
|
5528
|
+
style: {
|
|
5529
|
+
width: 120,
|
|
5530
|
+
flex: "none"
|
|
5531
|
+
},
|
|
5532
|
+
children: [/* @__PURE__ */ jsx(FieldLabel, { children: "Langue" }), /* @__PURE__ */ jsxs(Select, {
|
|
5533
|
+
fontSize: 1,
|
|
5534
|
+
radius: 2,
|
|
5535
|
+
value: locale,
|
|
5536
|
+
onChange: (event) => {
|
|
5537
|
+
setLocale(event.currentTarget.value), setPage(0);
|
|
5538
|
+
},
|
|
5539
|
+
children: [/* @__PURE__ */ jsx("option", {
|
|
5540
|
+
value: "",
|
|
5541
|
+
children: "Toutes"
|
|
5542
|
+
}), locales.map((code) => /* @__PURE__ */ jsx("option", {
|
|
5543
|
+
value: code,
|
|
5544
|
+
children: code.toUpperCase()
|
|
5545
|
+
}, code))]
|
|
5546
|
+
})]
|
|
5547
|
+
}),
|
|
5522
5548
|
view === "list" && /* @__PURE__ */ jsxs(Box, {
|
|
5523
5549
|
style: {
|
|
5524
5550
|
width: 168,
|
|
@@ -5603,7 +5629,7 @@ function PagesTool() {
|
|
|
5603
5629
|
size: 1,
|
|
5604
5630
|
muted: !0,
|
|
5605
5631
|
align: "center",
|
|
5606
|
-
children: rows.length === 0 ? `Le kit suit les types ${config.pageTypeNames.join(", ")}.` : "Essaie un autre terme, ou vide la recherche."
|
|
5632
|
+
children: rows.length === 0 ? `Le kit suit les types ${config.pageTypeNames.join(", ")}.` : "Essaie un autre terme ou une autre langue, ou vide la recherche."
|
|
5607
5633
|
})]
|
|
5608
5634
|
})
|
|
5609
5635
|
}) : /* @__PURE__ */ jsx(PagesTable, {
|
|
@@ -6671,13 +6697,13 @@ function useHistory(documentId) {
|
|
|
6671
6697
|
* noierait les vraies modifications sous du bruit. `_id` et `_type` ne
|
|
6672
6698
|
* changent pas sans que ce soit un autre document.
|
|
6673
6699
|
*/
|
|
6674
|
-
const SYSTEM_KEYS = /* @__PURE__ */ new Set([
|
|
6700
|
+
const SYSTEM_KEYS$1 = /* @__PURE__ */ new Set([
|
|
6675
6701
|
"_rev",
|
|
6676
6702
|
"_updatedAt",
|
|
6677
6703
|
"_createdAt",
|
|
6678
6704
|
"_id",
|
|
6679
6705
|
"_type"
|
|
6680
|
-
]), NOISE_KEYS = /* @__PURE__ */ new Set(["_key"]), isObject = (value) => typeof value == "object" && !!value && !Array.isArray(value);
|
|
6706
|
+
]), NOISE_KEYS = /* @__PURE__ */ new Set(["_key"]), isObject$1 = (value) => typeof value == "object" && !!value && !Array.isArray(value);
|
|
6681
6707
|
/**
|
|
6682
6708
|
* Aplatit un document en chemins terminaux.
|
|
6683
6709
|
*
|
|
@@ -6687,9 +6713,9 @@ const SYSTEM_KEYS = /* @__PURE__ */ new Set([
|
|
|
6687
6713
|
*/
|
|
6688
6714
|
function flatten(value, prefix = "", out = /* @__PURE__ */ new Map()) {
|
|
6689
6715
|
if (Array.isArray(value)) return value.forEach((item, index) => {
|
|
6690
|
-
flatten(item, `${prefix}[${isObject(item) && typeof item._key == "string" ? item._key : String(index)}]`, out);
|
|
6716
|
+
flatten(item, `${prefix}[${isObject$1(item) && typeof item._key == "string" ? item._key : String(index)}]`, out);
|
|
6691
6717
|
}), out;
|
|
6692
|
-
if (isObject(value)) {
|
|
6718
|
+
if (isObject$1(value)) {
|
|
6693
6719
|
let keys = Object.keys(value).filter((key) => !NOISE_KEYS.has(key));
|
|
6694
6720
|
keys.length === 0 && prefix && out.set(prefix, {});
|
|
6695
6721
|
for (let key of keys) flatten(value[key], prefix ? `${prefix}.${key}` : key, out);
|
|
@@ -6697,7 +6723,7 @@ function flatten(value, prefix = "", out = /* @__PURE__ */ new Map()) {
|
|
|
6697
6723
|
}
|
|
6698
6724
|
return prefix && out.set(prefix, value), out;
|
|
6699
6725
|
}
|
|
6700
|
-
const same = (a, b) => a === b || Number.isNaN(a) && Number.isNaN(b) || JSON.stringify(a) === JSON.stringify(b);
|
|
6726
|
+
const same$1 = (a, b) => a === b || Number.isNaN(a) && Number.isNaN(b) || JSON.stringify(a) === JSON.stringify(b);
|
|
6701
6727
|
/**
|
|
6702
6728
|
* Modifications entre deux états, triées par chemin.
|
|
6703
6729
|
*
|
|
@@ -6710,7 +6736,7 @@ function diffDocuments(before, after) {
|
|
|
6710
6736
|
for (let path of paths) {
|
|
6711
6737
|
let had = left.has(path), has = right.has(path), valueBefore = left.get(path), valueAfter = right.get(path);
|
|
6712
6738
|
if (had && has) {
|
|
6713
|
-
same(valueBefore, valueAfter) || changes.push({
|
|
6739
|
+
same$1(valueBefore, valueAfter) || changes.push({
|
|
6714
6740
|
path,
|
|
6715
6741
|
kind: "changed",
|
|
6716
6742
|
before: valueBefore,
|
|
@@ -6735,7 +6761,7 @@ function diffDocuments(before, after) {
|
|
|
6735
6761
|
/** Un chemin système, à la racine comme au fond d'un tableau. */
|
|
6736
6762
|
function isSystemPath(path) {
|
|
6737
6763
|
let last = path.split(".").pop() ?? "";
|
|
6738
|
-
return SYSTEM_KEYS.has(last);
|
|
6764
|
+
return SYSTEM_KEYS$1.has(last);
|
|
6739
6765
|
}
|
|
6740
6766
|
/**
|
|
6741
6767
|
* Résumé d'un changement en une ligne.
|
|
@@ -6787,7 +6813,55 @@ function diffWords(before, after, limit = 400) {
|
|
|
6787
6813
|
return segments;
|
|
6788
6814
|
}
|
|
6789
6815
|
/** Une comparaison mot à mot n'a de sens qu'entre deux textes. */
|
|
6790
|
-
const isTextChange = (before, after) => typeof before == "string" && typeof after == "string",
|
|
6816
|
+
const isTextChange = (before, after) => typeof before == "string" && typeof after == "string", SYSTEM_KEYS = /* @__PURE__ */ new Set([
|
|
6817
|
+
"_rev",
|
|
6818
|
+
"_updatedAt",
|
|
6819
|
+
"_createdAt",
|
|
6820
|
+
"_id",
|
|
6821
|
+
"_type"
|
|
6822
|
+
]), isObject = (v) => typeof v == "object" && !!v && !Array.isArray(v), same = (a, b) => JSON.stringify(a) === JSON.stringify(b), keyed = (v) => Array.isArray(v) && v.every((item) => isObject(item) && typeof item._key == "string"), ABSENT = Symbol("absent");
|
|
6823
|
+
function revert(current, before, after, path, out) {
|
|
6824
|
+
if (same(before, after)) return current;
|
|
6825
|
+
if (same(current, after)) return out.reverted++, before;
|
|
6826
|
+
if (isObject(current) && isObject(before) && isObject(after)) {
|
|
6827
|
+
let result = { ...current };
|
|
6828
|
+
for (let key of /* @__PURE__ */ new Set([...Object.keys(before), ...Object.keys(after)])) {
|
|
6829
|
+
if (SYSTEM_KEYS.has(key)) continue;
|
|
6830
|
+
let v = revert(key in current ? current[key] : ABSENT, key in before ? before[key] : ABSENT, key in after ? after[key] : ABSENT, path ? `${path}.${key}` : key, out);
|
|
6831
|
+
v === ABSENT ? delete result[key] : result[key] = v;
|
|
6832
|
+
}
|
|
6833
|
+
return result;
|
|
6834
|
+
}
|
|
6835
|
+
if (keyed(current) && keyed(before) && keyed(after)) {
|
|
6836
|
+
let result = [...current], at = (list, key) => list.findIndex((item) => item._key === key);
|
|
6837
|
+
for (let key of /* @__PURE__ */ new Set([...before.map((i) => i._key), ...after.map((i) => i._key)])) {
|
|
6838
|
+
let b = before[at(before, key)], a = after[at(after, key)], index = at(result, key), label = `${path}[${key}]`;
|
|
6839
|
+
if (index >= 0) {
|
|
6840
|
+
let v = revert(result[index], b ?? ABSENT, a ?? ABSENT, label, out);
|
|
6841
|
+
v === ABSENT ? result.splice(index, 1) : result[index] = v;
|
|
6842
|
+
} else b && !a ? (result.splice(Math.min(at(before, key), result.length), 0, b), out.reverted++) : b && a && !same(a, b) && out.conflicts.push(label);
|
|
6843
|
+
}
|
|
6844
|
+
return result;
|
|
6845
|
+
}
|
|
6846
|
+
return out.conflicts.push(path || "(document)"), current;
|
|
6847
|
+
}
|
|
6848
|
+
/**
|
|
6849
|
+
* Annule l'événement `before` → `after` dans `current` (brouillon ou version
|
|
6850
|
+
* publiée actuelle). `current` absent (document supprimé depuis) : l'état
|
|
6851
|
+
* d'avant l'événement.
|
|
6852
|
+
*/
|
|
6853
|
+
function undoChange(current, before, after) {
|
|
6854
|
+
let out = {
|
|
6855
|
+
conflicts: [],
|
|
6856
|
+
reverted: 0
|
|
6857
|
+
}, document = revert(current ?? after ?? {}, before ?? {}, after ?? {}, "", out);
|
|
6858
|
+
return {
|
|
6859
|
+
document: isObject(document) ? document : {},
|
|
6860
|
+
conflicts: out.conflicts,
|
|
6861
|
+
reverted: out.reverted
|
|
6862
|
+
};
|
|
6863
|
+
}
|
|
6864
|
+
const MARK = {
|
|
6791
6865
|
removed: {
|
|
6792
6866
|
sign: "−",
|
|
6793
6867
|
line: DIFF.removedLine,
|
|
@@ -6904,11 +6978,11 @@ function ActorName(props) {
|
|
|
6904
6978
|
* client, et une restauration reste attribuée à qui l'a demandée.
|
|
6905
6979
|
*/
|
|
6906
6980
|
function DiffPanel(props) {
|
|
6907
|
-
let { event, onClose } = props, config = useKitConfig(), client = useKitClient(), [detail, setDetail] = useState(null), [loading, setLoading] = useState(!0), [error, setError] = useState(null), [restoring, setRestoring] = useState(!1), [restored, setRestored] = useState(null);
|
|
6981
|
+
let { event, onClose } = props, config = useKitConfig(), client = useKitClient(), [detail, setDetail] = useState(null), [loading, setLoading] = useState(!0), [error, setError] = useState(null), [restoring, setRestoring] = useState(!1), [restored, setRestored] = useState(null), [conflicts, setConflicts] = useState([]);
|
|
6908
6982
|
useEffect(() => {
|
|
6909
6983
|
if (!config.history) return;
|
|
6910
6984
|
let controller = new AbortController();
|
|
6911
|
-
return setLoading(!0), setError(null), setRestored(null), fetchDetail(config.history.endpoint, config.history.projectKey, event.id, controller.signal).then((result) => {
|
|
6985
|
+
return setLoading(!0), setError(null), setRestored(null), setConflicts([]), fetchDetail(config.history.endpoint, config.history.projectKey, event.id, controller.signal).then((result) => {
|
|
6912
6986
|
controller.signal.aborted || setDetail(result);
|
|
6913
6987
|
}).catch(() => {
|
|
6914
6988
|
controller.signal.aborted || setError("Ce détail n'a pas pu être chargé.");
|
|
@@ -6916,23 +6990,29 @@ function DiffPanel(props) {
|
|
|
6916
6990
|
controller.signal.aborted || setLoading(!1);
|
|
6917
6991
|
}), () => controller.abort();
|
|
6918
6992
|
}, [config.history, event.id]);
|
|
6919
|
-
let snapshot = detail?.current.snapshot ?? null, changes = detail ? diffDocuments(detail.previous?.snapshot ?? null, snapshot) : [],
|
|
6920
|
-
|
|
6921
|
-
|
|
6922
|
-
|
|
6923
|
-
|
|
6924
|
-
|
|
6925
|
-
|
|
6926
|
-
|
|
6927
|
-
|
|
6928
|
-
|
|
6929
|
-
|
|
6930
|
-
|
|
6931
|
-
|
|
6932
|
-
|
|
6933
|
-
|
|
6993
|
+
let snapshot = detail?.current.snapshot ?? null, changes = detail ? diffDocuments(detail.previous?.snapshot ?? null, snapshot) : [], base = event.document_id.replace(/^drafts\./, ""), writeDraft = async (content) => {
|
|
6994
|
+
let { _rev, _createdAt, _updatedAt, ...rest } = content;
|
|
6995
|
+
await client.createOrReplace({
|
|
6996
|
+
...rest,
|
|
6997
|
+
_id: `drafts.${base}`,
|
|
6998
|
+
_type: event.document_type
|
|
6999
|
+
}), setRestored(base);
|
|
7000
|
+
}, run = async (action) => {
|
|
7001
|
+
setRestoring(!0), setError(null), setConflicts([]);
|
|
7002
|
+
try {
|
|
7003
|
+
await action();
|
|
7004
|
+
} catch (cause) {
|
|
7005
|
+
setError(explainRestore(cause));
|
|
7006
|
+
} finally {
|
|
7007
|
+
setRestoring(!1);
|
|
6934
7008
|
}
|
|
6935
|
-
}
|
|
7009
|
+
}, undo = () => run(async () => {
|
|
7010
|
+
if (!detail) return;
|
|
7011
|
+
let result = undoChange(await client.getDocument(`drafts.${base}`) ?? await client.getDocument(base) ?? null, detail.previous?.snapshot ?? null, snapshot ?? null);
|
|
7012
|
+
await writeDraft(result.document), setConflicts(result.conflicts);
|
|
7013
|
+
}), restore = () => run(async () => {
|
|
7014
|
+
snapshot && await writeDraft(snapshot);
|
|
7015
|
+
});
|
|
6936
7016
|
return /* @__PURE__ */ jsx(Card, {
|
|
6937
7017
|
radius: 3,
|
|
6938
7018
|
shadow: 1,
|
|
@@ -7004,28 +7084,41 @@ function DiffPanel(props) {
|
|
|
7004
7084
|
tone: "positive",
|
|
7005
7085
|
children: /* @__PURE__ */ jsxs(Stack, {
|
|
7006
7086
|
gap: 3,
|
|
7007
|
-
children: [
|
|
7008
|
-
|
|
7009
|
-
|
|
7010
|
-
|
|
7011
|
-
|
|
7012
|
-
|
|
7013
|
-
|
|
7014
|
-
|
|
7015
|
-
|
|
7016
|
-
|
|
7017
|
-
|
|
7018
|
-
|
|
7019
|
-
|
|
7020
|
-
|
|
7021
|
-
|
|
7022
|
-
|
|
7023
|
-
|
|
7024
|
-
|
|
7025
|
-
|
|
7026
|
-
|
|
7087
|
+
children: [
|
|
7088
|
+
/* @__PURE__ */ jsxs(Text, {
|
|
7089
|
+
size: 1,
|
|
7090
|
+
children: [
|
|
7091
|
+
"Fait ",
|
|
7092
|
+
/* @__PURE__ */ jsx("b", { children: "en brouillon" }),
|
|
7093
|
+
". Rien n'est encore en ligne : ouvrez le document, vérifiez, puis ",
|
|
7094
|
+
/* @__PURE__ */ jsx("b", { children: "publiez" }),
|
|
7095
|
+
"."
|
|
7096
|
+
]
|
|
7097
|
+
}),
|
|
7098
|
+
conflicts.length > 0 && /* @__PURE__ */ jsxs(Text, {
|
|
7099
|
+
size: 1,
|
|
7100
|
+
children: [
|
|
7101
|
+
"Non annulé, car modifié depuis : ",
|
|
7102
|
+
conflicts.join(", "),
|
|
7103
|
+
"."
|
|
7104
|
+
]
|
|
7105
|
+
}),
|
|
7106
|
+
/* @__PURE__ */ jsx(IntentLink, {
|
|
7107
|
+
intent: "edit",
|
|
7108
|
+
params: {
|
|
7109
|
+
id: restored,
|
|
7110
|
+
type: event.document_type
|
|
7111
|
+
},
|
|
7112
|
+
style: { textDecoration: "none" },
|
|
7113
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
7114
|
+
mode: "ghost",
|
|
7115
|
+
fontSize: 1,
|
|
7116
|
+
padding: 2,
|
|
7117
|
+
text: "Ouvrir le brouillon",
|
|
7118
|
+
as: "span"
|
|
7119
|
+
})
|
|
7027
7120
|
})
|
|
7028
|
-
|
|
7121
|
+
]
|
|
7029
7122
|
})
|
|
7030
7123
|
}),
|
|
7031
7124
|
!loading && detail && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -7065,20 +7158,39 @@ function DiffPanel(props) {
|
|
|
7065
7158
|
paddingTop: 12
|
|
7066
7159
|
},
|
|
7067
7160
|
children: /* @__PURE__ */ jsxs(Stack, {
|
|
7068
|
-
gap:
|
|
7069
|
-
children: [/* @__PURE__ */
|
|
7070
|
-
|
|
7071
|
-
|
|
7072
|
-
|
|
7073
|
-
|
|
7074
|
-
|
|
7075
|
-
|
|
7076
|
-
|
|
7077
|
-
|
|
7078
|
-
|
|
7079
|
-
|
|
7080
|
-
|
|
7081
|
-
|
|
7161
|
+
gap: 3,
|
|
7162
|
+
children: [detail.previous && changes.length > 0 && /* @__PURE__ */ jsxs(Stack, {
|
|
7163
|
+
gap: 2,
|
|
7164
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
7165
|
+
mode: "default",
|
|
7166
|
+
tone: "primary",
|
|
7167
|
+
fontSize: 1,
|
|
7168
|
+
padding: 3,
|
|
7169
|
+
icon: UndoIcon,
|
|
7170
|
+
text: restoring ? "Annulation…" : "Annuler cette modification",
|
|
7171
|
+
disabled: restoring,
|
|
7172
|
+
onClick: undo
|
|
7173
|
+
}), /* @__PURE__ */ jsx(Text, {
|
|
7174
|
+
size: 0,
|
|
7175
|
+
muted: !0,
|
|
7176
|
+
children: "Remet les valeurs d'avant cette modification, et seulement elles : ce qui a été modifié ensuite est conservé. Le résultat va dans le brouillon : publiez-le pour le mettre en ligne."
|
|
7177
|
+
})]
|
|
7178
|
+
}), /* @__PURE__ */ jsxs(Stack, {
|
|
7179
|
+
gap: 2,
|
|
7180
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
7181
|
+
mode: "ghost",
|
|
7182
|
+
tone: "caution",
|
|
7183
|
+
fontSize: 1,
|
|
7184
|
+
padding: 3,
|
|
7185
|
+
icon: RestoreIcon,
|
|
7186
|
+
text: restoring ? "Restauration…" : "Restaurer le document tel qu’après cette modification",
|
|
7187
|
+
disabled: restoring,
|
|
7188
|
+
onClick: restore
|
|
7189
|
+
}), /* @__PURE__ */ jsx(Text, {
|
|
7190
|
+
size: 0,
|
|
7191
|
+
muted: !0,
|
|
7192
|
+
children: "Remet le document ENTIER dans l'état qui a suivi cette modification (les modifications plus récentes sont perdues), dans le brouillon. La version en ligne n'est pas touchée tant que vous ne publiez pas."
|
|
7193
|
+
})]
|
|
7082
7194
|
})]
|
|
7083
7195
|
})
|
|
7084
7196
|
})
|