@nocode-factory/sanity-kit 2.0.0 → 2.1.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/dist/index.d.ts +41 -2
- package/dist/index.js +227 -6
- package/dist/index.js.map +1 -1
- package/dist/web-server.d.ts +40 -1
- package/dist/web-server.js +84 -2
- package/dist/web-server.js.map +1 -1
- package/package.json +1 -1
- package/src/hooks/usePreviewTarget.ts +12 -0
- package/src/index.ts +3 -0
- package/src/lib/service.ts +36 -0
- package/src/tools/pages/PagesTool.tsx +6 -0
- package/src/tools/pages/PreviewTarget.tsx +8 -2
- package/src/tools/pages/SharePreview.tsx +220 -0
- package/src/version.ts +1 -1
- package/src/web/previewGrant.ts +134 -0
- package/src/web/server.ts +2 -0
package/dist/index.d.ts
CHANGED
|
@@ -1030,6 +1030,13 @@ interface PreviewTargetState {
|
|
|
1030
1030
|
pathFor: (url: string | null) => string | null;
|
|
1031
1031
|
/** URL de la page sur l'environnement choisi, pour l'ouvrir hors du Studio. */
|
|
1032
1032
|
siteUrlFor: (url: string | null) => string | null;
|
|
1033
|
+
/**
|
|
1034
|
+
* L'environnement choisi est-il le site public ?
|
|
1035
|
+
*
|
|
1036
|
+
* Il n'y a rien à y prévisualiser : le bandeau s'y masque et le mode
|
|
1037
|
+
* brouillon y est refusé. Partager un lien vers lui ne montrerait rien.
|
|
1038
|
+
*/
|
|
1039
|
+
isProduction: boolean;
|
|
1033
1040
|
}
|
|
1034
1041
|
export declare function usePreviewTarget(): PreviewTargetState;
|
|
1035
1042
|
/**
|
|
@@ -1056,6 +1063,17 @@ export declare function ncfPreviewComponents(): {
|
|
|
1056
1063
|
component: typeof NcfPreviewHeader;
|
|
1057
1064
|
};
|
|
1058
1065
|
};
|
|
1066
|
+
/**
|
|
1067
|
+
* Délivre un lien de préversion à partager.
|
|
1068
|
+
*
|
|
1069
|
+
* Le lien **est** l'autorisation : celui qui le reçoit voit le site de
|
|
1070
|
+
* préproduction et peut y basculer entre brouillons et contenu en ligne, sans
|
|
1071
|
+
* compte ni connexion. C'est tout l'intérêt pour faire relire un client.
|
|
1072
|
+
*
|
|
1073
|
+
* Il n'est délivré qu'à qui a déjà accès au projet Sanity — le service le
|
|
1074
|
+
* vérifie auprès de Sanity, il ne croit pas le Studio sur parole.
|
|
1075
|
+
*/
|
|
1076
|
+
export declare function SharePreview(): import("react").JSX.Element | null;
|
|
1059
1077
|
/**
|
|
1060
1078
|
* Appels au service du kit.
|
|
1061
1079
|
*
|
|
@@ -1114,6 +1132,27 @@ export declare function fetchTimeline(endpoint: string, key: string, options?: {
|
|
|
1114
1132
|
retentionDays: number;
|
|
1115
1133
|
}>;
|
|
1116
1134
|
export declare function fetchDetail(endpoint: string, key: string, eventId: number, signal?: AbortSignal): Promise<HistoryDetail>;
|
|
1135
|
+
interface PreviewGrant {
|
|
1136
|
+
token: string;
|
|
1137
|
+
expiresAt: string;
|
|
1138
|
+
issuedBy: string;
|
|
1139
|
+
}
|
|
1140
|
+
/**
|
|
1141
|
+
* Demande un laissez-passer au service.
|
|
1142
|
+
*
|
|
1143
|
+
* Le jeton Sanity de l'éditeur accompagne la demande : c'est lui, et rien
|
|
1144
|
+
* d'autre, qui prouve au service qu'on a accès au projet. Sans lui la demande
|
|
1145
|
+
* est refusée — le kit étant public, un identifiant de projet ne prouve rien.
|
|
1146
|
+
*/
|
|
1147
|
+
export declare function requestPreviewGrant(endpoint: string, payload: {
|
|
1148
|
+
projectId: string;
|
|
1149
|
+
dataset: string;
|
|
1150
|
+
sanityToken: string;
|
|
1151
|
+
label?: string;
|
|
1152
|
+
days?: number;
|
|
1153
|
+
}, signal?: AbortSignal): Promise<PreviewGrant>;
|
|
1154
|
+
/** Messages du service, rendus lisibles pour un éditeur. */
|
|
1155
|
+
export declare function explainGrantError(error: unknown): string;
|
|
1117
1156
|
interface HistoryState {
|
|
1118
1157
|
events: HistoryEvent[];
|
|
1119
1158
|
loading: boolean;
|
|
@@ -1159,7 +1198,7 @@ export declare function ActorName(props: {
|
|
|
1159
1198
|
* Version du kit, rapportée au service pour savoir quels projets tournent sur
|
|
1160
1199
|
* quelle version. Tenue à jour avec `package.json`.
|
|
1161
1200
|
*/
|
|
1162
|
-
export declare const KIT_VERSION = "2.
|
|
1201
|
+
export declare const KIT_VERSION = "2.1.1";
|
|
1163
1202
|
/**
|
|
1164
1203
|
* Données de la page proposées comme colonnes.
|
|
1165
1204
|
*
|
|
@@ -1639,5 +1678,5 @@ export declare const NCF_TOOL_NAMES: readonly ["ncf-pages", "ncf-components", "n
|
|
|
1639
1678
|
* pas le Studio de démarrer : l'onglet concerné affiche le détail à corriger.
|
|
1640
1679
|
*/
|
|
1641
1680
|
export declare const ncfKit: import("sanity").Plugin<NcfKitConfig>;
|
|
1642
|
-
export { type AddColumnInput, type Annotation, type AnnotationsState, type BlockOccurrence, type BlockTypeInfo, type BoardEdge, type BoardGraph, type BoardLayoutState, type BoardNode, CONTENT_SCAN_LIMIT as OCCURRENCE_SCAN_LIMIT, type Change, type ChangeKind, type CollectedLinks, type ColorBy, type ColorOptions, type ConfigIssue, type DeriveOptions, type GroupBy, type GroupOptions, type HistoryDetail, type HistoryEvent, type IssueLevel, type KitContextValue, type LayoutMode, type MergedDoc, type NcfBoardTag, type NcfComponentPreviewConfig, type NcfDocumentColumn, type NcfEnvironment, type NcfHistoryConfig, type NcfI18nConfig, type NcfInternalField, type NcfInternalFieldOption, type NcfKitConfig, type NcfPageTypeConfig, type NcfPageTypeInput, type NcfToolName, type NcfToolsConfig, type NodeLayout, type NodePosition, type OccurrenceInput, type OccurrencePage, type OccurrencesState, type PageContent, type PageContentsState, type PageDoc, type PageFilters, type PageRow, type PageStatus, type PagesState, type PathInput, type Positioned, type PresentationOptions, type PreviewPerspective, type PreviewTargetState, type ProjectStatus, type Registration, type ResolvedComponentPreview, type ResolvedDocumentColumn, type ResolvedHistory, type ResolvedI18n, type ResolvedKitConfig, type ResolvedPageType, type RowColor, type RowGroup, type SchemaFieldLike, type SchemaTypeLike, type SectionLayout, type SectionMapNode, type SectionOrder, type SectionsMapOptions, type Segment, type SiteRoutesRegistry, type SortDirection, type SortKey, type ThumbnailInput, type VersionedDoc };
|
|
1681
|
+
export { type AddColumnInput, type Annotation, type AnnotationsState, type BlockOccurrence, type BlockTypeInfo, type BoardEdge, type BoardGraph, type BoardLayoutState, type BoardNode, CONTENT_SCAN_LIMIT as OCCURRENCE_SCAN_LIMIT, type Change, type ChangeKind, type CollectedLinks, type ColorBy, type ColorOptions, type ConfigIssue, type DeriveOptions, type GroupBy, type GroupOptions, type HistoryDetail, type HistoryEvent, type IssueLevel, type KitContextValue, type LayoutMode, type MergedDoc, type NcfBoardTag, type NcfComponentPreviewConfig, type NcfDocumentColumn, type NcfEnvironment, type NcfHistoryConfig, type NcfI18nConfig, type NcfInternalField, type NcfInternalFieldOption, type NcfKitConfig, type NcfPageTypeConfig, type NcfPageTypeInput, type NcfToolName, type NcfToolsConfig, type NodeLayout, type NodePosition, type OccurrenceInput, type OccurrencePage, type OccurrencesState, type PageContent, type PageContentsState, type PageDoc, type PageFilters, type PageRow, type PageStatus, type PagesState, type PathInput, type Positioned, type PresentationOptions, type PreviewGrant, type PreviewPerspective, type PreviewTargetState, type ProjectStatus, type Registration, type ResolvedComponentPreview, type ResolvedDocumentColumn, type ResolvedHistory, type ResolvedI18n, type ResolvedKitConfig, type ResolvedPageType, type RowColor, type RowGroup, type SchemaFieldLike, type SchemaTypeLike, type SectionLayout, type SectionMapNode, type SectionOrder, type SectionsMapOptions, type Segment, type SiteRoutesRegistry, type SortDirection, type SortKey, type ThumbnailInput, type VersionedDoc };
|
|
1643
1682
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -11,6 +11,7 @@ import { CloseIcon } from "@sanity/icons/Close";
|
|
|
11
11
|
import { EarthGlobeIcon } from "@sanity/icons/EarthGlobe";
|
|
12
12
|
import { ProjectsIcon } from "@sanity/icons/Projects";
|
|
13
13
|
import { CircleIcon } from "@sanity/icons/Circle";
|
|
14
|
+
import { ShareIcon } from "@sanity/icons/Share";
|
|
14
15
|
import { ChevronDownIcon } from "@sanity/icons/ChevronDown";
|
|
15
16
|
import { ChevronRightIcon } from "@sanity/icons/ChevronRight";
|
|
16
17
|
import { ChevronUpIcon } from "@sanity/icons/ChevronUp";
|
|
@@ -1080,6 +1081,7 @@ function usePreviewTargetState() {
|
|
|
1080
1081
|
}
|
|
1081
1082
|
}, [environment]);
|
|
1082
1083
|
return {
|
|
1084
|
+
isProduction: !!(environment && config.previewUrl && environment.url === config.previewUrl),
|
|
1083
1085
|
environments: allEnvironments,
|
|
1084
1086
|
customUrl,
|
|
1085
1087
|
setCustomUrl,
|
|
@@ -1220,10 +1222,25 @@ async function fetchDetail(endpoint, key, eventId, signal) {
|
|
|
1220
1222
|
}, signal);
|
|
1221
1223
|
}
|
|
1222
1224
|
/**
|
|
1225
|
+
* Demande un laissez-passer au service.
|
|
1226
|
+
*
|
|
1227
|
+
* Le jeton Sanity de l'éditeur accompagne la demande : c'est lui, et rien
|
|
1228
|
+
* d'autre, qui prouve au service qu'on a accès au projet. Sans lui la demande
|
|
1229
|
+
* est refusée — le kit étant public, un identifiant de projet ne prouve rien.
|
|
1230
|
+
*/
|
|
1231
|
+
async function requestPreviewGrant(endpoint, payload, signal) {
|
|
1232
|
+
return post(`${endpoint}/preview-link`, payload, signal);
|
|
1233
|
+
}
|
|
1234
|
+
/** Messages du service, rendus lisibles pour un éditeur. */
|
|
1235
|
+
function explainGrantError(error) {
|
|
1236
|
+
let code = error instanceof Error ? error.message : String(error);
|
|
1237
|
+
return code === "missing_sanity_token" ? "Votre session Sanity n'expose pas de jeton : impossible de prouver votre accès au projet." : code === "no_project_access" ? "Votre compte n'a pas accès à ce projet Sanity." : code === "project_inactive" ? "Ce projet n'est pas actif chez NoCode Factory." : code === "unknown_project" ? "Ce projet n'est pas enregistré chez NoCode Factory." : "Le lien n'a pas pu être créé.";
|
|
1238
|
+
}
|
|
1239
|
+
/**
|
|
1223
1240
|
* Version du kit, rapportée au service pour savoir quels projets tournent sur
|
|
1224
1241
|
* quelle version. Tenue à jour avec `package.json`.
|
|
1225
1242
|
*/
|
|
1226
|
-
const KIT_VERSION = "2.
|
|
1243
|
+
const KIT_VERSION = "2.1.1";
|
|
1227
1244
|
/**
|
|
1228
1245
|
* Signale ce Studio au service du kit, une fois par montage.
|
|
1229
1246
|
*
|
|
@@ -1892,7 +1909,7 @@ const TABULAR = { fontVariantNumeric: "tabular-nums" }, MONO = {
|
|
|
1892
1909
|
* menu à une entrée occupe la place sans rien offrir.
|
|
1893
1910
|
*/
|
|
1894
1911
|
function PreviewTarget(props) {
|
|
1895
|
-
let { environments, environmentId, perspective, onEnvironment, onPerspective } = props, { onCustomUrl, customUrl } = props, current = environments.find((environment) => environment.id === environmentId);
|
|
1912
|
+
let { environments, environmentId, perspective, onEnvironment, onPerspective } = props, { onCustomUrl, customUrl, productionUrl } = props, current = environments.find((environment) => environment.id === environmentId);
|
|
1896
1913
|
return /* @__PURE__ */ jsxs(Box, {
|
|
1897
1914
|
style: { flex: "none" },
|
|
1898
1915
|
children: [/* @__PURE__ */ jsx(FieldLabel, { children: "Aperçu" }), /* @__PURE__ */ jsxs(Flex, {
|
|
@@ -1937,6 +1954,7 @@ function PreviewTarget(props) {
|
|
|
1937
1954
|
environments.map((environment) => /* @__PURE__ */ jsx(EnvironmentRow, {
|
|
1938
1955
|
environment,
|
|
1939
1956
|
selected: environment.id === environmentId,
|
|
1957
|
+
isProduction: !!productionUrl && environment.url === productionUrl,
|
|
1940
1958
|
onSelect: () => {
|
|
1941
1959
|
onEnvironment(environment.id), close();
|
|
1942
1960
|
},
|
|
@@ -1995,7 +2013,7 @@ function EnvironmentRow(props) {
|
|
|
1995
2013
|
size: 0,
|
|
1996
2014
|
muted: !0,
|
|
1997
2015
|
textOverflow: "ellipsis",
|
|
1998
|
-
children: hostOf(props.environment.url)
|
|
2016
|
+
children: props.isProduction ? "site public — pas de préversion" : hostOf(props.environment.url)
|
|
1999
2017
|
})]
|
|
2000
2018
|
}),
|
|
2001
2019
|
props.onForget && /* @__PURE__ */ jsx(Button, {
|
|
@@ -2064,7 +2082,202 @@ const hostOf = (url) => {
|
|
|
2064
2082
|
} catch {
|
|
2065
2083
|
return url;
|
|
2066
2084
|
}
|
|
2067
|
-
},
|
|
2085
|
+
}, DURATIONS = [
|
|
2086
|
+
{
|
|
2087
|
+
days: 1,
|
|
2088
|
+
label: "1 jour"
|
|
2089
|
+
},
|
|
2090
|
+
{
|
|
2091
|
+
days: 7,
|
|
2092
|
+
label: "7 jours"
|
|
2093
|
+
},
|
|
2094
|
+
{
|
|
2095
|
+
days: 30,
|
|
2096
|
+
label: "30 jours"
|
|
2097
|
+
}
|
|
2098
|
+
];
|
|
2099
|
+
/**
|
|
2100
|
+
* Délivre un lien de préversion à partager.
|
|
2101
|
+
*
|
|
2102
|
+
* Le lien **est** l'autorisation : celui qui le reçoit voit le site de
|
|
2103
|
+
* préproduction et peut y basculer entre brouillons et contenu en ligne, sans
|
|
2104
|
+
* compte ni connexion. C'est tout l'intérêt pour faire relire un client.
|
|
2105
|
+
*
|
|
2106
|
+
* Il n'est délivré qu'à qui a déjà accès au projet Sanity — le service le
|
|
2107
|
+
* vérifie auprès de Sanity, il ne croit pas le Studio sur parole.
|
|
2108
|
+
*/
|
|
2109
|
+
function SharePreview() {
|
|
2110
|
+
let config = useKitConfig(), client = useKitClient(), { environment, isProduction } = usePreviewTarget(), [link, setLink] = useState(null), [expiresAt, setExpiresAt] = useState(null), [busy, setBusy] = useState(!1), [error, setError] = useState(null), [copied, setCopied] = useState(!1), [label, setLabel] = useState(""), endpoint = config.serviceEndpoint, { projectId, dataset, token } = client.config(), issue = useCallback(async (days) => {
|
|
2111
|
+
if (endpoint && projectId && dataset && environment) {
|
|
2112
|
+
setBusy(!0), setError(null), setCopied(!1);
|
|
2113
|
+
try {
|
|
2114
|
+
let grant = await requestPreviewGrant(endpoint, {
|
|
2115
|
+
projectId,
|
|
2116
|
+
dataset,
|
|
2117
|
+
sanityToken: token ?? "",
|
|
2118
|
+
label: label.trim() || void 0,
|
|
2119
|
+
days
|
|
2120
|
+
}), url = new URL(environment.url);
|
|
2121
|
+
url.searchParams.set("ncf_preview", grant.token), setLink(url.toString()), setExpiresAt(grant.expiresAt);
|
|
2122
|
+
} catch (cause) {
|
|
2123
|
+
setError(explainGrantError(cause));
|
|
2124
|
+
} finally {
|
|
2125
|
+
setBusy(!1);
|
|
2126
|
+
}
|
|
2127
|
+
}
|
|
2128
|
+
}, [
|
|
2129
|
+
endpoint,
|
|
2130
|
+
projectId,
|
|
2131
|
+
dataset,
|
|
2132
|
+
environment,
|
|
2133
|
+
token,
|
|
2134
|
+
label
|
|
2135
|
+
]), copy = async () => {
|
|
2136
|
+
if (link) try {
|
|
2137
|
+
await navigator.clipboard.writeText(link), setCopied(!0);
|
|
2138
|
+
} catch {
|
|
2139
|
+
setCopied(!1);
|
|
2140
|
+
}
|
|
2141
|
+
};
|
|
2142
|
+
return endpoint ? /* @__PURE__ */ jsx(InlinePopover, {
|
|
2143
|
+
width: 320,
|
|
2144
|
+
trigger: ({ toggle }) => /* @__PURE__ */ jsx(Button, {
|
|
2145
|
+
mode: "bleed",
|
|
2146
|
+
fontSize: 1,
|
|
2147
|
+
padding: 2,
|
|
2148
|
+
icon: ShareIcon,
|
|
2149
|
+
text: "Partager la préversion",
|
|
2150
|
+
title: "Créer un lien que n'importe qui peut ouvrir, sans compte",
|
|
2151
|
+
onClick: toggle
|
|
2152
|
+
}),
|
|
2153
|
+
children: () => /* @__PURE__ */ jsx(Stack, {
|
|
2154
|
+
gap: 3,
|
|
2155
|
+
padding: 2,
|
|
2156
|
+
children: isProduction ? /* @__PURE__ */ jsxs(Stack, {
|
|
2157
|
+
gap: 3,
|
|
2158
|
+
children: [
|
|
2159
|
+
/* @__PURE__ */ jsx(Text, {
|
|
2160
|
+
size: 1,
|
|
2161
|
+
weight: "semibold",
|
|
2162
|
+
children: "Rien à partager sur le site public"
|
|
2163
|
+
}),
|
|
2164
|
+
/* @__PURE__ */ jsx(Text, {
|
|
2165
|
+
size: 0,
|
|
2166
|
+
muted: !0,
|
|
2167
|
+
children: "La production n'affiche jamais les brouillons — c'est ce qui protège votre contenu non publié. Un lien vers elle ne montrerait rien de plus qu'une visite ordinaire."
|
|
2168
|
+
}),
|
|
2169
|
+
/* @__PURE__ */ jsxs(Text, {
|
|
2170
|
+
size: 0,
|
|
2171
|
+
muted: !0,
|
|
2172
|
+
children: [
|
|
2173
|
+
"Choisissez d'abord une ",
|
|
2174
|
+
/* @__PURE__ */ jsx("b", { children: "préversion" }),
|
|
2175
|
+
" dans le sélecteur d'environnement, à gauche : une préproduction déclarée, ou l'adresse d'un déploiement de branche que vous y collez."
|
|
2176
|
+
]
|
|
2177
|
+
})
|
|
2178
|
+
]
|
|
2179
|
+
}) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2180
|
+
/* @__PURE__ */ jsxs(Text, {
|
|
2181
|
+
size: 0,
|
|
2182
|
+
muted: !0,
|
|
2183
|
+
children: [
|
|
2184
|
+
"Un lien qui ouvre ",
|
|
2185
|
+
/* @__PURE__ */ jsx("b", { children: environment?.label ?? "le site" }),
|
|
2186
|
+
" et permet d'y basculer entre brouillons et contenu en ligne. Celui qui l'a n'a besoin d'aucun compte."
|
|
2187
|
+
]
|
|
2188
|
+
}),
|
|
2189
|
+
!link && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(TextInput, {
|
|
2190
|
+
fontSize: 1,
|
|
2191
|
+
padding: 2,
|
|
2192
|
+
radius: 2,
|
|
2193
|
+
placeholder: "À quoi sert ce lien ? (facultatif)",
|
|
2194
|
+
value: label,
|
|
2195
|
+
onChange: (event) => setLabel(event.currentTarget.value)
|
|
2196
|
+
}), /* @__PURE__ */ jsx(Flex, {
|
|
2197
|
+
gap: 1,
|
|
2198
|
+
children: DURATIONS.map((duration) => /* @__PURE__ */ jsx(Button, {
|
|
2199
|
+
mode: "ghost",
|
|
2200
|
+
fontSize: 1,
|
|
2201
|
+
padding: 2,
|
|
2202
|
+
text: duration.label,
|
|
2203
|
+
disabled: busy,
|
|
2204
|
+
onClick: () => issue(duration.days)
|
|
2205
|
+
}, duration.days))
|
|
2206
|
+
})] }),
|
|
2207
|
+
busy && /* @__PURE__ */ jsxs(Flex, {
|
|
2208
|
+
align: "center",
|
|
2209
|
+
gap: 2,
|
|
2210
|
+
children: [/* @__PURE__ */ jsx(Spinner, { muted: !0 }), /* @__PURE__ */ jsx(Text, {
|
|
2211
|
+
size: 1,
|
|
2212
|
+
muted: !0,
|
|
2213
|
+
children: "Création…"
|
|
2214
|
+
})]
|
|
2215
|
+
}),
|
|
2216
|
+
error && /* @__PURE__ */ jsx(Card, {
|
|
2217
|
+
padding: 3,
|
|
2218
|
+
radius: 2,
|
|
2219
|
+
tone: "critical",
|
|
2220
|
+
children: /* @__PURE__ */ jsx(Text, {
|
|
2221
|
+
size: 1,
|
|
2222
|
+
children: error
|
|
2223
|
+
})
|
|
2224
|
+
}),
|
|
2225
|
+
link && /* @__PURE__ */ jsxs(Stack, {
|
|
2226
|
+
gap: 2,
|
|
2227
|
+
children: [
|
|
2228
|
+
/* @__PURE__ */ jsx(Box, {
|
|
2229
|
+
padding: 2,
|
|
2230
|
+
style: {
|
|
2231
|
+
border: "1px solid var(--card-border-color, rgba(127,127,127,0.22))",
|
|
2232
|
+
borderRadius: 3,
|
|
2233
|
+
maxHeight: 72,
|
|
2234
|
+
overflow: "auto"
|
|
2235
|
+
},
|
|
2236
|
+
children: /* @__PURE__ */ jsx(Text, {
|
|
2237
|
+
size: 0,
|
|
2238
|
+
style: {
|
|
2239
|
+
...MONO,
|
|
2240
|
+
wordBreak: "break-all"
|
|
2241
|
+
},
|
|
2242
|
+
children: link
|
|
2243
|
+
})
|
|
2244
|
+
}),
|
|
2245
|
+
/* @__PURE__ */ jsxs(Flex, {
|
|
2246
|
+
gap: 2,
|
|
2247
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
2248
|
+
mode: "default",
|
|
2249
|
+
tone: "primary",
|
|
2250
|
+
fontSize: 1,
|
|
2251
|
+
padding: 2,
|
|
2252
|
+
icon: copied ? CheckmarkIcon : ShareIcon,
|
|
2253
|
+
text: copied ? "Copié" : "Copier le lien",
|
|
2254
|
+
onClick: copy
|
|
2255
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
2256
|
+
mode: "bleed",
|
|
2257
|
+
fontSize: 1,
|
|
2258
|
+
padding: 2,
|
|
2259
|
+
text: "Un autre",
|
|
2260
|
+
onClick: () => {
|
|
2261
|
+
setLink(null), setCopied(!1);
|
|
2262
|
+
}
|
|
2263
|
+
})]
|
|
2264
|
+
}),
|
|
2265
|
+
expiresAt && /* @__PURE__ */ jsxs(Text, {
|
|
2266
|
+
size: 0,
|
|
2267
|
+
muted: !0,
|
|
2268
|
+
children: [
|
|
2269
|
+
"Valable jusqu'au ",
|
|
2270
|
+
new Date(expiresAt).toLocaleDateString("fr-FR"),
|
|
2271
|
+
". Révocable à tout moment par NoCode Factory."
|
|
2272
|
+
]
|
|
2273
|
+
})
|
|
2274
|
+
]
|
|
2275
|
+
})
|
|
2276
|
+
] })
|
|
2277
|
+
})
|
|
2278
|
+
}) : null;
|
|
2279
|
+
}
|
|
2280
|
+
const UNSET_LABEL = "Non renseigné", fieldIdOf = (groupBy) => groupBy.startsWith("field:") ? groupBy.slice(6) : null;
|
|
2068
2281
|
/** Valeur du critère pour une ligne. Chaîne vide = non renseigné. */
|
|
2069
2282
|
function groupValue(row, groupBy, options) {
|
|
2070
2283
|
if (groupBy === "type") return row.type;
|
|
@@ -4655,7 +4868,15 @@ function PagesTool() {
|
|
|
4655
4868
|
onEnvironment: preview.setEnvironment,
|
|
4656
4869
|
onPerspective: preview.setPerspective,
|
|
4657
4870
|
onCustomUrl: preview.setCustomUrl,
|
|
4658
|
-
customUrl: preview.customUrl
|
|
4871
|
+
customUrl: preview.customUrl,
|
|
4872
|
+
productionUrl: config.previewUrl
|
|
4873
|
+
}),
|
|
4874
|
+
/* @__PURE__ */ jsx(Box, {
|
|
4875
|
+
style: {
|
|
4876
|
+
flex: "none",
|
|
4877
|
+
paddingBottom: 2
|
|
4878
|
+
},
|
|
4879
|
+
children: /* @__PURE__ */ jsx(SharePreview, {})
|
|
4659
4880
|
}),
|
|
4660
4881
|
view === "list" && /* @__PURE__ */ jsx(Box, {
|
|
4661
4882
|
style: {
|
|
@@ -6627,6 +6848,6 @@ const NCF_PAGES_TOOL = "ncf-pages", NCF_COMPONENTS_TOOL = "ncf-components", NCF_
|
|
|
6627
6848
|
document: { newDocumentOptions: (prev) => prev.filter((option) => option.templateId !== BOARD_LAYOUT_TYPE) }
|
|
6628
6849
|
};
|
|
6629
6850
|
});
|
|
6630
|
-
export { ANNOTATION_TYPE, ActorName, BOARD_LAYOUT_ID, BOARD_LAYOUT_TYPE, BRAIN_NODE_SIZE, BoardLayoutProvider, COLUMN_TYPE, CONTENT_SCAN_LIMIT, CONTENT_SCAN_LIMIT as OCCURRENCE_SCAN_LIMIT, CUSTOM_ENVIRONMENT_ID, DATA_PREFIX, DEFAULT_BOARD_TAGS, DEFAULT_COMPONENT_PREVIEW, DEFAULT_I18N, DEFAULT_INTERNAL_FIELDS, DEFAULT_MORE_TOOLS, DEFAULT_PAGE_BUILDER_FIELD, DEFAULT_SLUG_FIELD, DEFAULT_TITLE_FIELD, KIT_API_VERSION, KIT_VERSION, NCF_COMPONENTS_TOOL, NCF_HIDDEN_TYPES, NCF_HISTORY_TOOL, NCF_MORE_TOOL, NCF_PAGES_TOOL, NCF_TOOL_NAMES, NODE_FIELD_TYPE, NODE_HEIGHT, NODE_WIDTH, NcfPreviewHeader, PERSPECTIVES, PROJECTION, SECTION_NODE_TYPE, STATUS_COLORS, STATUS_LABELS, UNSET_LABEL, addColumn, addColumnOption, announce, applySavedPositions, baseId, blockName, blockTypesFromSchema, buildContentsQuery, buildLinkGraph, buildPageRows, buildPagesQuery, collectLinks, collectOccurrences, colorForRow, colorFromString, columnId, customEnvironment, defaultNodeSize, depth, deriveDocumentColumns, diffDocuments, diffWords, editIntentPath, fallbackLayout, fetchDetail, fetchTimeline, fillTemplate, filterRows, flatten, formatDocumentValue, groupPageRows, groupValue, hasBlockingIssue, humanizeBlockName, isDraftId, isKitType, isSafeColumnKey, isSafeFieldPath, isTextChange, isVersionId, issuesForTool, keyForPath, kitSchemaTypes, layoutGraph, layoutSectionsMap, localesInRows, mergeVersions, missingPageTypes, moveColumn, ncfAllowedOrigins, ncfKit, ncfPreviewComponents, normalizeInternalPath, normalizePath, occurrencesForTypes, pageThumbnailUrl, pageTypeFor, pageTypesFromSiteRoutes, pageTypesWithoutBuilder, parentPath, presentationPath, pruneSavedPositions, releaseId, removeColumn, renameColumn, resolveColorBy, resolveConfig, segments, slugKey, sortRows, summarize, toKebabCase, toPath, toUrl, topLevelBlockCount, uniqueColumnId, upsertLayout, urlOn, useAnnotations, useBoardLayout, useDocumentColumns, useHistory, useInternalColumns, useKitClient, useKitConfig, useKitContext, useOccurrences, usePageContents, usePages, usePreviewTarget, useRegistration, validateConfig, withAlpha, withMoreTool };
|
|
6851
|
+
export { ANNOTATION_TYPE, ActorName, BOARD_LAYOUT_ID, BOARD_LAYOUT_TYPE, BRAIN_NODE_SIZE, BoardLayoutProvider, COLUMN_TYPE, CONTENT_SCAN_LIMIT, CONTENT_SCAN_LIMIT as OCCURRENCE_SCAN_LIMIT, CUSTOM_ENVIRONMENT_ID, DATA_PREFIX, DEFAULT_BOARD_TAGS, DEFAULT_COMPONENT_PREVIEW, DEFAULT_I18N, DEFAULT_INTERNAL_FIELDS, DEFAULT_MORE_TOOLS, DEFAULT_PAGE_BUILDER_FIELD, DEFAULT_SLUG_FIELD, DEFAULT_TITLE_FIELD, KIT_API_VERSION, KIT_VERSION, NCF_COMPONENTS_TOOL, NCF_HIDDEN_TYPES, NCF_HISTORY_TOOL, NCF_MORE_TOOL, NCF_PAGES_TOOL, NCF_TOOL_NAMES, NODE_FIELD_TYPE, NODE_HEIGHT, NODE_WIDTH, NcfPreviewHeader, PERSPECTIVES, PROJECTION, SECTION_NODE_TYPE, STATUS_COLORS, STATUS_LABELS, SharePreview, UNSET_LABEL, addColumn, addColumnOption, announce, applySavedPositions, baseId, blockName, blockTypesFromSchema, buildContentsQuery, buildLinkGraph, buildPageRows, buildPagesQuery, collectLinks, collectOccurrences, colorForRow, colorFromString, columnId, customEnvironment, defaultNodeSize, depth, deriveDocumentColumns, diffDocuments, diffWords, editIntentPath, explainGrantError, fallbackLayout, fetchDetail, fetchTimeline, fillTemplate, filterRows, flatten, formatDocumentValue, groupPageRows, groupValue, hasBlockingIssue, humanizeBlockName, isDraftId, isKitType, isSafeColumnKey, isSafeFieldPath, isTextChange, isVersionId, issuesForTool, keyForPath, kitSchemaTypes, layoutGraph, layoutSectionsMap, localesInRows, mergeVersions, missingPageTypes, moveColumn, ncfAllowedOrigins, ncfKit, ncfPreviewComponents, normalizeInternalPath, normalizePath, occurrencesForTypes, pageThumbnailUrl, pageTypeFor, pageTypesFromSiteRoutes, pageTypesWithoutBuilder, parentPath, presentationPath, pruneSavedPositions, releaseId, removeColumn, renameColumn, requestPreviewGrant, resolveColorBy, resolveConfig, segments, slugKey, sortRows, summarize, toKebabCase, toPath, toUrl, topLevelBlockCount, uniqueColumnId, upsertLayout, urlOn, useAnnotations, useBoardLayout, useDocumentColumns, useHistory, useInternalColumns, useKitClient, useKitConfig, useKitContext, useOccurrences, usePageContents, usePages, usePreviewTarget, useRegistration, validateConfig, withAlpha, withMoreTool };
|
|
6631
6852
|
|
|
6632
6853
|
//# sourceMappingURL=index.js.map
|