@nocode-factory/sanity-kit 2.47.0 → 2.48.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.
Files changed (36) hide show
  1. package/README.md +2 -1
  2. package/dist/CodeEmbedInput-CobMRQ5s.d.ts +46 -0
  3. package/dist/aiJsonLd-DiYeDzou.js +170 -0
  4. package/dist/aiJsonLd-DiYeDzou.js.map +1 -0
  5. package/dist/code-embed.d.ts +2 -0
  6. package/dist/code-embed.js +2 -0
  7. package/dist/codeEmbedType-1bEOTxBT.js +160 -0
  8. package/dist/codeEmbedType-1bEOTxBT.js.map +1 -0
  9. package/dist/finalUrl-C1kzYMzQ.js +273 -0
  10. package/dist/finalUrl-C1kzYMzQ.js.map +1 -0
  11. package/dist/{fixCrossLanguageReferences-CQGzpNii.js → fixCrossLanguageReferences-BZk9CkdI.js} +3 -271
  12. package/dist/fixCrossLanguageReferences-BZk9CkdI.js.map +1 -0
  13. package/dist/{fixCrossLanguageReferences-CFZax-Nb.d.ts → fixCrossLanguageReferences-CjL_Xy0U.d.ts} +23 -1
  14. package/dist/index.d.ts +5 -47
  15. package/dist/index.js +70 -237
  16. package/dist/index.js.map +1 -1
  17. package/dist/jsonld.d.ts +79 -0
  18. package/dist/jsonld.js +225 -0
  19. package/dist/jsonld.js.map +1 -0
  20. package/dist/schema.d.ts +1 -1
  21. package/dist/schema.js +2 -1
  22. package/dist/schema.js.map +1 -1
  23. package/package.json +12 -2
  24. package/src/actions/JsonLdPublish.tsx +69 -0
  25. package/src/code-embed.ts +19 -0
  26. package/src/config/resolve.ts +6 -0
  27. package/src/config/types.ts +24 -0
  28. package/src/form/JsonLdInput.tsx +191 -0
  29. package/src/form/codeEmbedType.ts +0 -2
  30. package/src/form/jsonLdType.ts +61 -0
  31. package/src/index.ts +8 -2
  32. package/src/jsonld.ts +19 -0
  33. package/src/lib/aiJsonLd.ts +53 -0
  34. package/src/lib/jsonLdContent.ts +91 -0
  35. package/src/version.ts +1 -1
  36. package/dist/fixCrossLanguageReferences-CQGzpNii.js.map +0 -1
package/README.md CHANGED
@@ -106,7 +106,8 @@ Les outils de schéma sont aussi dans l'entrée `@nocode-factory/sanity-kit/sche
106
106
  | `defineComponentDefaults({sections})` | `@nocode-factory/sanity-kit/schema` | type du document des valeurs par défaut |
107
107
  | `requiredUnlessDefault` | `@nocode-factory/sanity-kit/schema` | obligatoire sauf valeur par défaut |
108
108
  | `componentDefaultsMainDocument({language})` | `@nocode-factory/sanity-kit/schema` | Presentation : page de rendu = valeurs par défaut |
109
- | `defineCodeEmbedType()` | `@nocode-factory/sanity-kit` | type « Code embed » (HTML/CSS/JS, éditeur sombre, iframe sandboxée) |
109
+ | `defineCodeEmbedType()` | `@nocode-factory/sanity-kit/code-embed` | type « Code embed » (HTML/CSS/JS, éditeur sombre, iframe sandboxée) |
110
+ | `defineJsonLdType()` | `@nocode-factory/sanity-kit/jsonld` | champ « Données structurées (JSON-LD) » IA, mode auto/manuel (option `jsonLd` du plugin) |
110
111
  | `NcfCodeEmbed` | `@nocode-factory/sanity-kit/web` | rendu site d'un bloc « Code embed » |
111
112
  | `applyDefaults`, `inherit` | `@nocode-factory/sanity-kit/web/defaults` | héritage côté site |
112
113
  | `componentDefaultsQuery` | `@nocode-factory/sanity-kit/web/defaults` | requête des valeurs par défaut |
@@ -0,0 +1,46 @@
1
+ import { ObjectDefinition, ObjectInputProps, TextInputProps } from "sanity";
2
+ interface CodeEmbedTypeOptions {
3
+ /** Nom du type (défaut `codeEmbed`). */
4
+ name?: string;
5
+ /** Titre affiché (défaut `Code embed`). */
6
+ title?: string;
7
+ }
8
+ /**
9
+ * Type d'objet « Code embed » : HTML, CSS et JS libres, éditables dans une
10
+ * interface sombre à coloration syntaxique, rendus dans une iframe sandboxée
11
+ * (aperçu live dans le Studio, même rendu sur le site via {@link NcfCodeEmbed}).
12
+ *
13
+ * Réutilisable partout où un objet est accepté : section de page, article de
14
+ * blog (`articleContent`), texte riche (`blockContent`).
15
+ *
16
+ * ```ts
17
+ * import {defineCodeEmbedType} from '@nocode-factory/sanity-kit'
18
+ * export const codeEmbed = defineCodeEmbedType()
19
+ * ```
20
+ */
21
+ declare function defineCodeEmbedType(options?: CodeEmbedTypeOptions): ObjectDefinition;
22
+ /** Langage de coloration ; lu dans `options.language` du champ. */
23
+ type CodeLanguage = 'html' | 'css' | 'js';
24
+ /**
25
+ * Fabrique l'input d'un champ de code pour un langage donné. À poser sur un
26
+ * champ `text` : `components: {input: codeEditorInput('css')}`.
27
+ */
28
+ declare function codeEditorInput(language: CodeLanguage): {
29
+ (props: TextInputProps): React.JSX.Element;
30
+ displayName: string;
31
+ };
32
+ /** Input HTML prêt à l'emploi (le plus courant). */
33
+ declare const CodeEditorInput: {
34
+ (props: TextInputProps): React.JSX.Element;
35
+ displayName: string;
36
+ };
37
+ /**
38
+ * Formulaire d'un bloc « Code embed » : les trois éditeurs de code, suivis d'un
39
+ * **aperçu live** rendu dans la même iframe sandboxée que le site.
40
+ *
41
+ * Le marketing voit immédiatement le résultat (une `div` stylée en CSS
42
+ * s'affiche vraiment), sans quitter le Studio ni publier.
43
+ */
44
+ declare function CodeEmbedInput(props: ObjectInputProps): React.JSX.Element;
45
+ export { CodeEmbedTypeOptions as a, codeEditorInput as i, CodeEditorInput as n, defineCodeEmbedType as o, CodeLanguage as r, CodeEmbedInput as t };
46
+ //# sourceMappingURL=CodeEmbedInput-CobMRQ5s.d.ts.map
@@ -0,0 +1,170 @@
1
+ import { createContext, useContext, useMemo } from "react";
2
+ import { jsx } from "react/jsx-runtime";
3
+ const KitContext = createContext(null);
4
+ function KitProvider(props) {
5
+ let { config, issues, children } = props, value = useMemo(() => ({
6
+ config,
7
+ issues
8
+ }), [config, issues]);
9
+ return /* @__PURE__ */ jsx(KitContext.Provider, {
10
+ value,
11
+ children
12
+ });
13
+ }
14
+ /**
15
+ * Configuration résolue du kit. Erreur explicite hors contexte : une
16
+ * dépendance oubliée se voit tout de suite au développement.
17
+ */
18
+ function useKitContext() {
19
+ let value = useContext(KitContext);
20
+ if (!value) throw Error("useKitContext must be called inside a tool of the @nocode-factory/sanity-kit plugin.");
21
+ return value;
22
+ }
23
+ const useKitConfig = () => useKitContext().config, isObj$1 = (v) => typeof v == "object" && !!v && !Array.isArray(v);
24
+ /** Textes d'une valeur, dans l'ordre. */
25
+ function collectTexts(value) {
26
+ if (typeof value == "string") return [value];
27
+ if (!Array.isArray(value)) return [];
28
+ let out = [];
29
+ for (let item of value) if (typeof item == "string") out.push(item);
30
+ else if (isObj$1(item) && Array.isArray(item.children)) for (let child of item.children) isObj$1(child) && typeof child.text == "string" && out.push(child.text);
31
+ return out;
32
+ }
33
+ /** La même valeur avec ses textes remplacés (dans l'ordre de `collectTexts`). */
34
+ function replaceTexts(value, texts) {
35
+ let i = 0, next = () => texts[i++] ?? "";
36
+ return typeof value == "string" ? next() : Array.isArray(value) ? value.map((item) => typeof item == "string" ? next() : isObj$1(item) && Array.isArray(item.children) ? {
37
+ ...item,
38
+ children: item.children.map((child) => isObj$1(child) && typeof child.text == "string" ? {
39
+ ...child,
40
+ text: next()
41
+ } : child)
42
+ } : item) : value;
43
+ }
44
+ /** `sections[a].title` → segments (`[x]` : clé d'élément de liste, ou rang). */
45
+ function parsePathKey(path) {
46
+ let out = [];
47
+ for (let m of path.matchAll(/([^.[\]]+)|\[([^\]]+)\]/g)) out.push(m[1] === void 0 ? { item: m[2] } : { field: m[1] });
48
+ return out;
49
+ }
50
+ function itemOf(list, key) {
51
+ return list.find((i) => isObj$1(i) && i._key === key) ?? (/^\d+$/.test(key) ? list[Number(key)] : void 0);
52
+ }
53
+ /** Valeur d'un document au chemin `sections[a].title`. */
54
+ function valueAtKey(doc, path) {
55
+ let cur = doc;
56
+ for (let seg of parsePathKey(path)) {
57
+ if (cur == null) return;
58
+ cur = "field" in seg ? isObj$1(cur) ? cur[seg.field] : void 0 : Array.isArray(cur) ? itemOf(cur, seg.item) : void 0;
59
+ }
60
+ return cur;
61
+ }
62
+ /** Écrit `value` au chemin dans `doc` (modifié sur place). Faux si le chemin n'existe pas. */
63
+ function setAtKey(doc, path, value) {
64
+ let segs = parsePathKey(path), cur = doc;
65
+ for (let n = 0; n < segs.length - 1; n++) {
66
+ let seg = segs[n];
67
+ if (cur = "field" in seg ? isObj$1(cur) ? cur[seg.field] : void 0 : Array.isArray(cur) ? itemOf(cur, seg.item) : void 0, cur == null) return !1;
68
+ }
69
+ let last = segs[segs.length - 1];
70
+ return !last || !("field" in last) || !isObj$1(cur) ? !1 : (cur[last.field] = value, !0);
71
+ }
72
+ const isObj = (v) => typeof v == "object" && !!v && !Array.isArray(v), SKIP_KEYS = /* @__PURE__ */ new Set([
73
+ "_type",
74
+ "_id",
75
+ "_rev",
76
+ "_key",
77
+ "_ref",
78
+ "_weak",
79
+ "_createdAt",
80
+ "_updatedAt",
81
+ "_originalId",
82
+ "slug",
83
+ "language",
84
+ "hotspot",
85
+ "crop",
86
+ "asset",
87
+ "marks",
88
+ "markDefs",
89
+ "style",
90
+ "listItem",
91
+ "level",
92
+ "href",
93
+ "noindex"
94
+ ]), DEFAULT_JSONLD_FIELD = "jsonLd";
95
+ function walk(value, out, skip, depth) {
96
+ if (!(depth > 12)) {
97
+ if (typeof value == "string") {
98
+ let text = value.trim();
99
+ text && out.push(text);
100
+ return;
101
+ }
102
+ if (Array.isArray(value)) {
103
+ for (let item of value) walk(item, out, skip, depth + 1);
104
+ return;
105
+ }
106
+ if (isObj(value)) for (let [key, val] of Object.entries(value)) skip.has(key) || walk(val, out, skip, depth + 1);
107
+ }
108
+ }
109
+ /**
110
+ * Texte lisible d'un document, dans l'ordre, prêt à être envoyé à l'IA.
111
+ * `extraSkip` : champs supplémentaires à ignorer (au moins le champ JSON-LD
112
+ * lui-même, pour ne pas renvoyer l'ancien JSON-LD au modèle).
113
+ */
114
+ function collectDocumentText(doc, extraSkip = [DEFAULT_JSONLD_FIELD]) {
115
+ let skip = new Set(SKIP_KEYS);
116
+ for (let field of extraSkip) skip.add(field);
117
+ let out = [];
118
+ walk(doc, out, skip, 0);
119
+ let seen = /* @__PURE__ */ new Set(), lines = [], size = 0;
120
+ for (let text of out) if (!seen.has(text)) {
121
+ if (seen.add(text), size + text.length > 3e4) break;
122
+ lines.push(text), size += text.length;
123
+ }
124
+ return lines.join("\n");
125
+ }
126
+ /** Titre probable d'un document (pour aider le modèle), sinon chaîne vide. */
127
+ function guessDocumentTitle(doc) {
128
+ if (!isObj(doc)) return "";
129
+ let seo = isObj(doc.seo) ? doc.seo : void 0, candidates = [
130
+ doc.title,
131
+ doc.name,
132
+ doc.heading,
133
+ seo?.metaTitle
134
+ ];
135
+ for (let candidate of candidates) if (typeof candidate == "string" && candidate.trim()) return candidate.trim();
136
+ return "";
137
+ }
138
+ const MESSAGES = {
139
+ daily_limit: "Limite IA quotidienne atteinte pour ce projet.",
140
+ project_inactive: "Ce projet n'est pas actif dans le kit NCF.",
141
+ bad_key: "Ce projet n'est pas enregistré dans le kit NCF (npx ncf-kit setup).",
142
+ not_configured: "L'IA n'est pas configurée sur le service du kit NCF.",
143
+ too_long: "Contenu trop long pour générer le JSON-LD en une fois.",
144
+ empty_content: "Aucun contenu à décrire sur cette page.",
145
+ missing_url: "L'URL de la page est introuvable (slug ou URL du site manquant)."
146
+ };
147
+ /**
148
+ * Demande à l'IA le JSON-LD d'une page, à partir de son contenu. Renvoie l'objet
149
+ * JSON-LD (jamais une chaîne). L'appel passe par l'Edge Function `jsonld` du kit,
150
+ * qui détient la clé Anthropic : le Studio ne transmet que sa clé de projet.
151
+ */
152
+ async function generateJsonLd(service, input) {
153
+ let response = await fetch(`${service.endpoint}/jsonld`, {
154
+ method: "POST",
155
+ headers: { "content-type": "application/json" },
156
+ body: JSON.stringify({
157
+ key: service.projectKey,
158
+ url: input.url,
159
+ locale: input.locale ?? "",
160
+ type: input.type ?? "",
161
+ title: input.title ?? "",
162
+ content: input.content
163
+ })
164
+ }), body = await response.json().catch(() => ({}));
165
+ if (!response.ok || !body.jsonld || typeof body.jsonld != "object") throw Error(MESSAGES[body.error ?? ""] ?? `Génération JSON-LD échouée (${body.error ?? response.status}).`);
166
+ return body.jsonld;
167
+ }
168
+ export { collectTexts as a, valueAtKey as c, useKitContext as d, guessDocumentTitle as i, KitProvider as l, DEFAULT_JSONLD_FIELD as n, replaceTexts as o, collectDocumentText as r, setAtKey as s, generateJsonLd as t, useKitConfig as u };
169
+
170
+ //# sourceMappingURL=aiJsonLd-DiYeDzou.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aiJsonLd-DiYeDzou.js","names":["isObj"],"sources":["../src/context/KitContext.tsx","../src/lib/aiTexts.ts","../src/lib/jsonLdContent.ts","../src/lib/aiJsonLd.ts"],"sourcesContent":["import {createContext, useContext, useMemo, type ReactNode} from 'react'\nimport type {KitContextValue, ResolvedKitConfig, ConfigIssue} from '../config/types'\n\nconst KitContext = createContext<KitContextValue | null>(null)\n\nexport interface KitProviderProps {\n config: ResolvedKitConfig\n issues: ConfigIssue[]\n children: ReactNode\n}\n\nexport function KitProvider(props: KitProviderProps) {\n const {config, issues, children} = props\n const value = useMemo<KitContextValue>(() => ({config, issues}), [config, issues])\n return <KitContext.Provider value={value}>{children}</KitContext.Provider>\n}\n\n/**\n * Configuration résolue du kit. Erreur explicite hors contexte : une\n * dépendance oubliée se voit tout de suite au développement.\n */\nexport function useKitContext(): KitContextValue {\n const value = useContext(KitContext)\n if (!value) {\n throw new Error('useKitContext must be called inside a tool of the @nocode-factory/sanity-kit plugin.')\n }\n return value\n}\n\nexport const useKitConfig = (): ResolvedKitConfig => useKitContext().config\n","/**\n * Textes d'une valeur de champ, pour la traduction par IA : une chaîne, ou les\n * morceaux de texte (spans) d'un texte riche. La structure (styles, liens, marques,\n * _key) n'est jamais envoyée ni modifiée : seuls les textes sont remplacés.\n */\n\ntype Rec = Record<string, unknown>\nconst isObj = (v: unknown): v is Rec => typeof v === 'object' && v !== null && !Array.isArray(v)\n\n/** Textes d'une valeur, dans l'ordre. */\nexport function collectTexts(value: unknown): string[] {\n if (typeof value === 'string') return [value]\n if (!Array.isArray(value)) return []\n const out: string[] = []\n for (const item of value) {\n if (typeof item === 'string') out.push(item)\n else if (isObj(item) && Array.isArray(item.children))\n for (const child of item.children) if (isObj(child) && typeof child.text === 'string') out.push(child.text)\n }\n return out\n}\n\n/** La même valeur avec ses textes remplacés (dans l'ordre de `collectTexts`). */\nexport function replaceTexts(value: unknown, texts: readonly string[]): unknown {\n let i = 0\n const next = () => texts[i++] ?? ''\n if (typeof value === 'string') return next()\n if (!Array.isArray(value)) return value\n return value.map((item) => {\n if (typeof item === 'string') return next()\n if (isObj(item) && Array.isArray(item.children))\n return {...item, children: item.children.map((child) => (isObj(child) && typeof child.text === 'string' ? {...child, text: next()} : child))}\n return item\n })\n}\n\n/** `sections[a].title` → segments (`[x]` : clé d'élément de liste, ou rang). */\nexport function parsePathKey(path: string): ({field: string} | {item: string})[] {\n const out: ({field: string} | {item: string})[] = []\n for (const m of path.matchAll(/([^.[\\]]+)|\\[([^\\]]+)\\]/g)) out.push(m[1] !== undefined ? {field: m[1]} : {item: m[2]!})\n return out\n}\n\nfunction itemOf(list: unknown[], key: string): unknown {\n return list.find((i) => isObj(i) && i._key === key) ?? (/^\\d+$/.test(key) ? list[Number(key)] : undefined)\n}\n\n/** Valeur d'un document au chemin `sections[a].title`. */\nexport function valueAtKey(doc: unknown, path: string): unknown {\n let cur: unknown = doc\n for (const seg of parsePathKey(path)) {\n if (cur == null) return undefined\n if ('field' in seg) cur = isObj(cur) ? cur[seg.field] : undefined\n else cur = Array.isArray(cur) ? itemOf(cur, seg.item) : undefined\n }\n return cur\n}\n\n/** Écrit `value` au chemin dans `doc` (modifié sur place). Faux si le chemin n'existe pas. */\nexport function setAtKey(doc: Rec, path: string, value: unknown): boolean {\n const segs = parsePathKey(path)\n let cur: unknown = doc\n for (let n = 0; n < segs.length - 1; n++) {\n const seg = segs[n]!\n cur = 'field' in seg ? (isObj(cur) ? cur[seg.field] : undefined) : Array.isArray(cur) ? itemOf(cur, seg.item) : undefined\n if (cur == null) return false\n }\n const last = segs[segs.length - 1]\n if (!last || !('field' in last) || !isObj(cur)) return false\n cur[last.field] = value\n return true\n}\n","/**\n * Assemble le TEXTE d'un document Sanity pour la génération de JSON-LD par IA :\n * titres, descriptions, corps (texte riche compris). On parcourt le document en\n * profondeur et on ne garde que les chaînes lisibles, en écartant la plomberie\n * (identifiants, slugs, styles de texte, références d'images...).\n */\n\ntype Rec = Record<string, unknown>\nconst isObj = (v: unknown): v is Rec => typeof v === 'object' && v !== null && !Array.isArray(v)\n\n/** Clés dont la valeur n'apporte pas de contenu lisible (bruit ou plomberie). */\nconst SKIP_KEYS = new Set([\n '_type',\n '_id',\n '_rev',\n '_key',\n '_ref',\n '_weak',\n '_createdAt',\n '_updatedAt',\n '_originalId',\n 'slug',\n 'language',\n 'hotspot',\n 'crop',\n 'asset',\n 'marks',\n 'markDefs',\n 'style',\n 'listItem',\n 'level',\n 'href',\n 'noindex',\n])\n\nconst MAX_CHARS = 30_000\n\n/** Nom du champ JSON-LD par défaut (écarté du contenu envoyé, pour ne pas boucler). */\nexport const DEFAULT_JSONLD_FIELD = 'jsonLd'\n\nfunction walk(value: unknown, out: string[], skip: Set<string>, depth: number): void {\n if (depth > 12) return\n if (typeof value === 'string') {\n const text = value.trim()\n if (text) out.push(text)\n return\n }\n if (Array.isArray(value)) {\n for (const item of value) walk(item, out, skip, depth + 1)\n return\n }\n if (isObj(value)) {\n for (const [key, val] of Object.entries(value)) {\n if (skip.has(key)) continue\n walk(val, out, skip, depth + 1)\n }\n }\n}\n\n/**\n * Texte lisible d'un document, dans l'ordre, prêt à être envoyé à l'IA.\n * `extraSkip` : champs supplémentaires à ignorer (au moins le champ JSON-LD\n * lui-même, pour ne pas renvoyer l'ancien JSON-LD au modèle).\n */\nexport function collectDocumentText(doc: unknown, extraSkip: readonly string[] = [DEFAULT_JSONLD_FIELD]): string {\n const skip = new Set(SKIP_KEYS)\n for (const field of extraSkip) skip.add(field)\n const out: string[] = []\n walk(doc, out, skip, 0)\n // Dédoublonne en gardant l'ordre : un même libellé répété n'aide pas le modèle.\n const seen = new Set<string>()\n const lines: string[] = []\n let size = 0\n for (const text of out) {\n if (seen.has(text)) continue\n seen.add(text)\n if (size + text.length > MAX_CHARS) break\n lines.push(text)\n size += text.length\n }\n return lines.join('\\n')\n}\n\n/** Titre probable d'un document (pour aider le modèle), sinon chaîne vide. */\nexport function guessDocumentTitle(doc: unknown): string {\n if (!isObj(doc)) return ''\n const seo = isObj(doc.seo) ? doc.seo : undefined\n const candidates = [doc.title, doc.name, doc.heading, seo?.metaTitle]\n for (const candidate of candidates) if (typeof candidate === 'string' && candidate.trim()) return candidate.trim()\n return ''\n}\n","/** Service du kit (même clé de projet et même adresse que l'historique et la traduction). */\nexport interface JsonLdService {\n endpoint: string\n projectKey: string\n}\n\n/** Ce que le Studio envoie pour décrire la page à l'IA. */\nexport interface JsonLdRequest {\n /** URL absolue de la page en ligne (sert d'`url`/`@id`). */\n url: string\n /** Langue de la page (BCP 47), devient `inLanguage`. */\n locale?: string\n /** Indice sur la nature de la page (type Sanity, ou « article »...). */\n type?: string\n /** Titre de la page. */\n title?: string\n /** Texte de la page (titres, descriptions, corps), assemblé par le Studio. */\n content: string\n}\n\nconst MESSAGES: Record<string, string> = {\n daily_limit: 'Limite IA quotidienne atteinte pour ce projet.',\n project_inactive: \"Ce projet n'est pas actif dans le kit NCF.\",\n bad_key: \"Ce projet n'est pas enregistré dans le kit NCF (npx ncf-kit setup).\",\n not_configured: \"L'IA n'est pas configurée sur le service du kit NCF.\",\n too_long: 'Contenu trop long pour générer le JSON-LD en une fois.',\n empty_content: 'Aucun contenu à décrire sur cette page.',\n missing_url: \"L'URL de la page est introuvable (slug ou URL du site manquant).\",\n}\n\n/**\n * Demande à l'IA le JSON-LD d'une page, à partir de son contenu. Renvoie l'objet\n * JSON-LD (jamais une chaîne). L'appel passe par l'Edge Function `jsonld` du kit,\n * qui détient la clé Anthropic : le Studio ne transmet que sa clé de projet.\n */\nexport async function generateJsonLd(service: JsonLdService, input: JsonLdRequest): Promise<Record<string, unknown>> {\n const response = await fetch(`${service.endpoint}/jsonld`, {\n method: 'POST',\n headers: {'content-type': 'application/json'},\n body: JSON.stringify({\n key: service.projectKey,\n url: input.url,\n locale: input.locale ?? '',\n type: input.type ?? '',\n title: input.title ?? '',\n content: input.content,\n }),\n })\n const body = (await response.json().catch(() => ({}))) as {jsonld?: Record<string, unknown>; error?: string}\n if (!response.ok || !body.jsonld || typeof body.jsonld !== 'object')\n throw new Error(MESSAGES[body.error ?? ''] ?? `Génération JSON-LD échouée (${body.error ?? response.status}).`)\n return body.jsonld\n}\n"],"mappings":";;AAGA,MAAM,aAAa,cAAsC,IAAI;AAQ7D,SAAgB,YAAY,OAAyB;CACnD,IAAM,EAAC,QAAQ,QAAQ,aAAY,OAC7B,QAAQ,eAAgC;EAAC;EAAQ;CAAM,IAAI,CAAC,QAAQ,MAAM,CAAC;CACjF,OAAO,oBAAC,WAAW,UAAZ;EAA4B;EAAQ;CAA8B,CAAA;AAC3E;;;;;AAMA,SAAgB,gBAAiC;CAC/C,IAAM,QAAQ,WAAW,UAAU;CACnC,IAAI,CAAC,OACH,MAAU,MAAM,sFAAsF;CAExG,OAAO;AACT;AAEA,MAAa,qBAAwC,cAAc,CAAC,CAAC,QCtB/DA,WAAS,MAAyB,OAAO,KAAM,cAAY,KAAc,CAAC,MAAM,QAAQ,CAAC;;AAG/F,SAAgB,aAAa,OAA0B;CACrD,IAAI,OAAO,SAAU,UAAU,OAAO,CAAC,KAAK;CAC5C,IAAI,CAAC,MAAM,QAAQ,KAAK,GAAG,OAAO,CAAC;CACnC,IAAM,MAAgB,CAAC;CACvB,KAAK,IAAM,QAAQ,OACjB,IAAI,OAAO,QAAS,UAAU,IAAI,KAAK,IAAI;MACtC,IAAIA,QAAM,IAAI,KAAK,MAAM,QAAQ,KAAK,QAAQ,GAC5C,KAAA,IAAM,SAAS,KAAK,UAAU,AA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AAO,+BAA+B,KAAK,SAAS,SAAS,OAAO,GAAG;CAChH,OAAO,KAAK;AACd"}
@@ -0,0 +1,2 @@
1
+ import { a as CodeEmbedTypeOptions, i as codeEditorInput, n as CodeEditorInput, o as defineCodeEmbedType, r as CodeLanguage, t as CodeEmbedInput } from "./CodeEmbedInput-CobMRQ5s.js";
2
+ export { CodeEditorInput, CodeEmbedInput, type CodeEmbedTypeOptions, type CodeLanguage, codeEditorInput, defineCodeEmbedType };
@@ -0,0 +1,2 @@
1
+ import { i as codeEditorInput, n as CodeEmbedInput, r as CodeEditorInput, t as defineCodeEmbedType } from "./codeEmbedType-1bEOTxBT.js";
2
+ export { CodeEditorInput, CodeEmbedInput, codeEditorInput, defineCodeEmbedType };
@@ -0,0 +1,160 @@
1
+ import { t as NcfCodeEmbed } from "./CodeEmbedFrame-DWsj6Z8T.js";
2
+ import { useCallback } from "react";
3
+ import { defineField, defineType, set, unset } from "sanity";
4
+ import { Card, Stack, Text } from "@sanity/ui";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import CodeMirror from "@uiw/react-codemirror";
7
+ import { oneDark } from "@codemirror/theme-one-dark";
8
+ import { html } from "@codemirror/lang-html";
9
+ import { css } from "@codemirror/lang-css";
10
+ import { javascript } from "@codemirror/lang-javascript";
11
+ function extensionsFor(language) {
12
+ return language === "css" ? [css()] : language === "js" ? [javascript()] : [html()];
13
+ }
14
+ /**
15
+ * Éditeur de code sombre (CodeMirror, thème One Dark) pour un champ texte.
16
+ *
17
+ * Interface « type éditeur de code » demandée par le marketing : coloration
18
+ * syntaxique, numéros de ligne, fond sombre. Le langage est figé par
19
+ * {@link codeEditorInput} au moment de câbler le champ.
20
+ */
21
+ function CodeEditor(props, language) {
22
+ let { value = "", onChange, readOnly, elementProps } = props, handleChange = useCallback((next) => {
23
+ onChange(next ? set(next) : unset());
24
+ }, [onChange]);
25
+ return /* @__PURE__ */ jsx(Card, {
26
+ radius: 2,
27
+ overflow: "hidden",
28
+ border: !0,
29
+ id: elementProps.id,
30
+ children: /* @__PURE__ */ jsx(CodeMirror, {
31
+ value,
32
+ theme: oneDark,
33
+ editable: !readOnly,
34
+ readOnly,
35
+ extensions: extensionsFor(language),
36
+ onChange: handleChange,
37
+ onFocus: elementProps.onFocus,
38
+ onBlur: elementProps.onBlur,
39
+ basicSetup: {
40
+ lineNumbers: !0,
41
+ foldGutter: !1,
42
+ highlightActiveLine: !readOnly,
43
+ autocompletion: !1
44
+ },
45
+ minHeight: "140px",
46
+ maxHeight: "520px",
47
+ style: { fontSize: 13 }
48
+ })
49
+ });
50
+ }
51
+ /**
52
+ * Fabrique l'input d'un champ de code pour un langage donné. À poser sur un
53
+ * champ `text` : `components: {input: codeEditorInput('css')}`.
54
+ */
55
+ function codeEditorInput(language) {
56
+ function CodeEditorInput(props) {
57
+ return CodeEditor(props, language);
58
+ }
59
+ return CodeEditorInput.displayName = `CodeEditorInput(${language})`, CodeEditorInput;
60
+ }
61
+ /** Input HTML prêt à l'emploi (le plus courant). */
62
+ const CodeEditorInput = codeEditorInput("html");
63
+ /**
64
+ * Formulaire d'un bloc « Code embed » : les trois éditeurs de code, suivis d'un
65
+ * **aperçu live** rendu dans la même iframe sandboxée que le site.
66
+ *
67
+ * Le marketing voit immédiatement le résultat (une `div` stylée en CSS
68
+ * s'affiche vraiment), sans quitter le Studio ni publier.
69
+ */
70
+ function CodeEmbedInput(props) {
71
+ let value = props.value ?? {}, hasContent = !!(value.html || value.css || value.js);
72
+ return /* @__PURE__ */ jsxs(Stack, {
73
+ gap: 4,
74
+ children: [props.renderDefault(props), hasContent ? /* @__PURE__ */ jsxs(Stack, {
75
+ gap: 2,
76
+ children: [/* @__PURE__ */ jsx(Text, {
77
+ size: 1,
78
+ muted: !0,
79
+ weight: "semibold",
80
+ children: "Aperçu"
81
+ }), /* @__PURE__ */ jsx(Card, {
82
+ border: !0,
83
+ radius: 2,
84
+ overflow: "hidden",
85
+ tone: "transparent",
86
+ children: /* @__PURE__ */ jsx(NcfCodeEmbed, {
87
+ html: value.html,
88
+ css: value.css,
89
+ js: value.js,
90
+ minHeight: 60
91
+ })
92
+ })]
93
+ }) : null]
94
+ });
95
+ }
96
+ /**
97
+ * Type d'objet « Code embed » : HTML, CSS et JS libres, éditables dans une
98
+ * interface sombre à coloration syntaxique, rendus dans une iframe sandboxée
99
+ * (aperçu live dans le Studio, même rendu sur le site via {@link NcfCodeEmbed}).
100
+ *
101
+ * Réutilisable partout où un objet est accepté : section de page, article de
102
+ * blog (`articleContent`), texte riche (`blockContent`).
103
+ *
104
+ * ```ts
105
+ * import {defineCodeEmbedType} from '@nocode-factory/sanity-kit'
106
+ * export const codeEmbed = defineCodeEmbedType()
107
+ * ```
108
+ */
109
+ function defineCodeEmbedType(options = {}) {
110
+ let { name = "codeEmbed", title = "Code embed" } = options;
111
+ return defineType({
112
+ name,
113
+ title,
114
+ type: "object",
115
+ components: { input: CodeEmbedInput },
116
+ fields: [
117
+ defineField({
118
+ name: "html",
119
+ title: "HTML",
120
+ type: "text",
121
+ rows: 8,
122
+ components: { input: codeEditorInput("html") }
123
+ }),
124
+ defineField({
125
+ name: "css",
126
+ title: "CSS",
127
+ type: "text",
128
+ rows: 6,
129
+ components: { input: codeEditorInput("css") }
130
+ }),
131
+ defineField({
132
+ name: "js",
133
+ title: "JavaScript",
134
+ type: "text",
135
+ rows: 6,
136
+ components: { input: codeEditorInput("js") }
137
+ })
138
+ ],
139
+ preview: {
140
+ select: {
141
+ html: "html",
142
+ css: "css",
143
+ js: "js"
144
+ },
145
+ prepare({ html, css, js }) {
146
+ return {
147
+ title: "Code embed",
148
+ subtitle: [
149
+ html && "HTML",
150
+ css && "CSS",
151
+ js && "JS"
152
+ ].filter(Boolean).join(" · ") || "Vide"
153
+ };
154
+ }
155
+ }
156
+ });
157
+ }
158
+ export { codeEditorInput as i, CodeEmbedInput as n, CodeEditorInput as r, defineCodeEmbedType as t };
159
+
160
+ //# sourceMappingURL=codeEmbedType-1bEOTxBT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codeEmbedType-1bEOTxBT.js","names":["cssLang","jsLang","htmlLang"],"sources":["../src/form/CodeEditorInput.tsx","../src/form/CodeEmbedInput.tsx","../src/form/codeEmbedType.ts"],"sourcesContent":["import {useCallback} from 'react'\nimport {set, unset, type TextInputProps} from 'sanity'\nimport {Card} from '@sanity/ui'\nimport CodeMirror from '@uiw/react-codemirror'\nimport {oneDark} from '@codemirror/theme-one-dark'\nimport {html as htmlLang} from '@codemirror/lang-html'\nimport {css as cssLang} from '@codemirror/lang-css'\nimport {javascript as jsLang} from '@codemirror/lang-javascript'\n\n/** Langage de coloration ; lu dans `options.language` du champ. */\nexport type CodeLanguage = 'html' | 'css' | 'js'\n\nfunction extensionsFor(language: CodeLanguage | undefined) {\n if (language === 'css') return [cssLang()]\n if (language === 'js') return [jsLang()]\n // HTML par défaut : le plus courant, et il colore aussi le `<style>`/`<script>` inline.\n return [htmlLang()]\n}\n\n/**\n * Éditeur de code sombre (CodeMirror, thème One Dark) pour un champ texte.\n *\n * Interface « type éditeur de code » demandée par le marketing : coloration\n * syntaxique, numéros de ligne, fond sombre. Le langage est figé par\n * {@link codeEditorInput} au moment de câbler le champ.\n */\nfunction CodeEditor(props: TextInputProps, language: CodeLanguage): React.JSX.Element {\n const {value = '', onChange, readOnly, elementProps} = props\n\n const handleChange = useCallback(\n (next: string) => {\n onChange(next ? set(next) : unset())\n },\n [onChange],\n )\n\n return (\n <Card radius={2} overflow=\"hidden\" border id={elementProps.id}>\n <CodeMirror\n value={value}\n theme={oneDark}\n editable={!readOnly}\n readOnly={readOnly}\n extensions={extensionsFor(language)}\n onChange={handleChange}\n onFocus={elementProps.onFocus}\n onBlur={elementProps.onBlur}\n basicSetup={{\n lineNumbers: true,\n foldGutter: false,\n highlightActiveLine: !readOnly,\n autocompletion: false,\n }}\n minHeight=\"140px\"\n maxHeight=\"520px\"\n style={{fontSize: 13}}\n />\n </Card>\n )\n}\n\n/**\n * Fabrique l'input d'un champ de code pour un langage donné. À poser sur un\n * champ `text` : `components: {input: codeEditorInput('css')}`.\n */\nexport function codeEditorInput(language: CodeLanguage) {\n function CodeEditorInput(props: TextInputProps): React.JSX.Element {\n return CodeEditor(props, language)\n }\n CodeEditorInput.displayName = `CodeEditorInput(${language})`\n return CodeEditorInput\n}\n\n/** Input HTML prêt à l'emploi (le plus courant). */\nexport const CodeEditorInput = codeEditorInput('html')\n","import {type ObjectInputProps} from 'sanity'\nimport {Card, Stack, Text} from '@sanity/ui'\nimport {NcfCodeEmbed, type CodeEmbedValue} from '../web/CodeEmbedFrame'\n\n/**\n * Formulaire d'un bloc « Code embed » : les trois éditeurs de code, suivis d'un\n * **aperçu live** rendu dans la même iframe sandboxée que le site.\n *\n * Le marketing voit immédiatement le résultat (une `div` stylée en CSS\n * s'affiche vraiment), sans quitter le Studio ni publier.\n */\nexport function CodeEmbedInput(props: ObjectInputProps): React.JSX.Element {\n const value = (props.value ?? {}) as CodeEmbedValue\n const hasContent = Boolean(value.html || value.css || value.js)\n\n return (\n <Stack gap={4}>\n {props.renderDefault(props)}\n {hasContent ? (\n <Stack gap={2}>\n <Text size={1} muted weight=\"semibold\">\n Aperçu\n </Text>\n <Card border radius={2} overflow=\"hidden\" tone=\"transparent\">\n <NcfCodeEmbed html={value.html} css={value.css} js={value.js} minHeight={60} />\n </Card>\n </Stack>\n ) : null}\n </Stack>\n )\n}\n","import {defineField, defineType, type ObjectDefinition} from 'sanity'\nimport {codeEditorInput} from './CodeEditorInput'\nimport {CodeEmbedInput} from './CodeEmbedInput'\n\nexport interface CodeEmbedTypeOptions {\n /** Nom du type (défaut `codeEmbed`). */\n name?: string\n /** Titre affiché (défaut `Code embed`). */\n title?: string\n}\n\n/**\n * Type d'objet « Code embed » : HTML, CSS et JS libres, éditables dans une\n * interface sombre à coloration syntaxique, rendus dans une iframe sandboxée\n * (aperçu live dans le Studio, même rendu sur le site via {@link NcfCodeEmbed}).\n *\n * Réutilisable partout où un objet est accepté : section de page, article de\n * blog (`articleContent`), texte riche (`blockContent`).\n *\n * ```ts\n * import {defineCodeEmbedType} from '@nocode-factory/sanity-kit'\n * export const codeEmbed = defineCodeEmbedType()\n * ```\n */\nexport function defineCodeEmbedType(options: CodeEmbedTypeOptions = {}): ObjectDefinition {\n const {name = 'codeEmbed', title = 'Code embed'} = options\n\n return defineType({\n name,\n title,\n type: 'object',\n components: {input: CodeEmbedInput},\n fields: [\n defineField({\n name: 'html',\n title: 'HTML',\n type: 'text',\n rows: 8,\n components: {input: codeEditorInput('html')},\n }),\n defineField({\n name: 'css',\n title: 'CSS',\n type: 'text',\n rows: 6,\n components: {input: codeEditorInput('css')},\n }),\n defineField({\n name: 'js',\n title: 'JavaScript',\n type: 'text',\n rows: 6,\n components: {input: codeEditorInput('js')},\n }),\n ],\n preview: {\n select: {html: 'html', css: 'css', js: 'js'},\n prepare({html, css, js}) {\n const langs = [html && 'HTML', css && 'CSS', js && 'JS'].filter(Boolean).join(' · ')\n return {title: 'Code embed', subtitle: langs || 'Vide'}\n },\n },\n }) as ObjectDefinition\n}\n"],"mappings":";;;;;;;;;;AAYA,SAAS,cAAc,UAAoC;CAIzD,OAHI,aAAa,QAAc,CAACA,IAAQ,CAAC,IACrC,aAAa,OAAa,CAACC,WAAO,CAAC,IAEhC,CAACC,KAAS,CAAC;AACpB;;;;;;;;AASA,SAAS,WAAW,OAAuB,UAA2C;CACpF,IAAM,EAAC,QAAQ,IAAI,UAAU,UAAU,iBAAgB,OAEjD,eAAe,aAClB,SAAiB;EAChB,SAAS,OAAO,IAAI,IAAI,IAAI,MAAM,CAAC;CACrC,GACA,CAAC,QAAQ,CACX;CAEA,OACE,oBAAC,MAAD;EAAM,QAAQ;EAAG,UAAS;EAAS,QAAA;EAAO,IAAI,aAAa;EACzD,UAAA,oBAAC,YAAD;GACS;GACP,OAAO;GACP,UAAU,CAAC;GACD;GACV,YAAY,cAAc,QAAQ;GAClC,UAAU;GACV,SAAS,aAAa;GACtB,QAAQ,aAAa;GACrB,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