@griddo/ax 12.15.0-beta.1 → 12.15.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/README.md +0 -1
- package/package.json +4 -7
- package/src/GlobalStore.tsx +25 -32
- package/src/__tests__/components/Fields/FileField/FileField.test.tsx +6 -33
- package/src/__tests__/components/FieldsBehavior/FieldsBehavior.test.tsx +3 -5
- package/src/__tests__/modules/GlobalSettings/Llms/Llms.uc.test.tsx +2861 -0
- package/src/__tests__/modules/Redirects/Redirects/Redirects.create.test.tsx +0 -19
- package/src/__tests__/modules/Redirects/Redirects/Redirects.edit.test.tsx +0 -19
- package/src/__tests__/modules/Redirects/Redirects/Redirects.filter.test.tsx +0 -19
- package/src/api/domains.tsx +98 -2
- package/src/api/global.tsx +1 -24
- package/src/api/utils.tsx +12 -22
- package/src/components/FieldsBehavior/index.tsx +1 -3
- package/src/components/Login/LoginForm/index.tsx +2 -7
- package/src/components/Login/index.tsx +1 -13
- package/src/components/index.tsx +7 -11
- package/src/containers/App/actions.tsx +5 -110
- package/src/containers/App/interfaces.tsx +2 -2
- package/src/containers/App/reducer.tsx +0 -9
- package/src/containers/Users/actions.tsx +24 -28
- package/src/{components/CategoryCell/buildCategoryColumns.tsx → helpers/categoryColumns.tsx} +2 -3
- package/src/{components/FieldsBehavior/getFieldByPath.tsx → helpers/fields.tsx} +1 -1
- package/src/helpers/index.tsx +5 -4
- package/src/locales/en-US.ts +0 -7
- package/src/locales/es-ES.ts +0 -7
- package/src/locales/index.ts +0 -10
- package/src/modules/App/Routing/NavMenu/index.tsx +4 -4
- package/src/modules/Content/PageItem/index.tsx +8 -6
- package/src/modules/GlobalSettings/Llms/AutomaticSelection/index.tsx +317 -0
- package/src/modules/GlobalSettings/Llms/DomainList/index.tsx +65 -0
- package/src/modules/GlobalSettings/Llms/IndexModelEditor/index.tsx +325 -0
- package/src/modules/GlobalSettings/Llms/MirrorExample/index.tsx +61 -0
- package/src/modules/GlobalSettings/Llms/MirrorOptions/index.tsx +82 -0
- package/src/modules/GlobalSettings/Llms/Outline/index.tsx +183 -0
- package/src/modules/GlobalSettings/Llms/PagePicker/index.tsx +105 -0
- package/src/modules/GlobalSettings/Llms/Preview/index.tsx +65 -0
- package/src/modules/GlobalSettings/Llms/ResolvedPages/index.tsx +191 -0
- package/src/modules/GlobalSettings/Llms/SectionEditor/index.tsx +262 -0
- package/src/modules/GlobalSettings/Llms/atoms.tsx +37 -0
- package/src/modules/GlobalSettings/Llms/index.tsx +383 -0
- package/src/modules/GlobalSettings/Llms/style.tsx +541 -0
- package/src/modules/GlobalSettings/Llms/utils.tsx +307 -0
- package/src/modules/GlobalSettings/index.tsx +7 -0
- package/src/modules/Login/index.tsx +2 -12
- package/src/modules/StructuredData/StructuredDataList/GlobalPageItem/index.tsx +8 -6
- package/src/modules/StructuredData/StructuredDataList/StructuredDataItem/index.tsx +11 -9
- package/src/routes/multisite.tsx +8 -1
- package/src/routes/publicRoutes.tsx +0 -3
- package/src/schemas/pages/GlobalPage.ts +2 -2
- package/src/schemas/pages/Page.ts +2 -2
- package/src/types/index.tsx +80 -12
- package/src/types/llms.tsx +315 -0
- package/src/__tests__/GlobalStore.session.test.tsx +0 -98
- package/src/__tests__/api/global.test.ts +0 -64
- package/src/__tests__/api/session.test.ts +0 -311
- package/src/__tests__/api/sessionRenewal.test.ts +0 -705
- package/src/__tests__/api/utils.test.ts +0 -373
- package/src/__tests__/components/Login/LoginGriddoId.test.tsx +0 -195
- package/src/__tests__/components/SsoDenied/SsoDenied.test.tsx +0 -86
- package/src/__tests__/containers/App/reducer.griddoId.test.ts +0 -18
- package/src/__tests__/containers/App/session.test.ts +0 -397
- package/src/__tests__/helpers/griddoId.test.ts +0 -56
- package/src/__tests__/locales/loginLocale.test.ts +0 -52
- package/src/__tests__/modules/App/Routing/NavMenu.test.tsx +0 -54
- package/src/__tests__/modules/Login/Login.test.tsx +0 -151
- package/src/__tests__/modules/SsoDenied/SsoDenied.test.tsx +0 -30
- package/src/__tests__/routes/publicRoutes.test.ts +0 -36
- package/src/api/session.tsx +0 -197
- package/src/api/sessionRenewal.tsx +0 -114
- package/src/components/Login/LoginGriddoId/index.tsx +0 -46
- package/src/components/Login/LoginGriddoId/style.tsx +0 -35
- package/src/components/SsoDenied/index.tsx +0 -46
- package/src/components/SsoDenied/style.tsx +0 -37
- package/src/helpers/griddoId.ts +0 -28
- package/src/modules/SsoDenied/index.tsx +0 -9
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
LlmsAutomaticSection,
|
|
3
|
+
LlmsDomain,
|
|
4
|
+
LlmsIndexFooter,
|
|
5
|
+
LlmsIndexModel,
|
|
6
|
+
LlmsIndexSection,
|
|
7
|
+
LlmsIndexText,
|
|
8
|
+
LlmsOptionalSection,
|
|
9
|
+
LlmsSectionFilter,
|
|
10
|
+
LlmsSettings,
|
|
11
|
+
MarkdownMirrorOptions,
|
|
12
|
+
} from "@ax/types";
|
|
13
|
+
|
|
14
|
+
import { config } from "components";
|
|
15
|
+
|
|
16
|
+
/** La selección automática de una sección: todo lo suyo salvo el tipo y el nombre. */
|
|
17
|
+
type LlmsAutomaticSelection = Omit<LlmsAutomaticSection, "type" | "name">;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Una sección tal como la edita la pantalla. Lleva las dos selecciones a la vez para
|
|
21
|
+
* que pasar de manual a automática, o al revés, no pierda nada hasta guardar; solo la
|
|
22
|
+
* activa viaja (`toSettings`).
|
|
23
|
+
*/
|
|
24
|
+
interface LlmsSectionDraft {
|
|
25
|
+
/** Su identidad en la pantalla, para React, el esquema y el arrastre. No viaja. */
|
|
26
|
+
key: string;
|
|
27
|
+
type: LlmsIndexSection["type"];
|
|
28
|
+
name: string;
|
|
29
|
+
/** La selección manual. */
|
|
30
|
+
pages: number[];
|
|
31
|
+
/** La selección automática. */
|
|
32
|
+
automatic: LlmsAutomaticSelection;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* El LLM Index Model tal como lo edita la pantalla: el del contrato, con sus secciones
|
|
37
|
+
* en borrador, la Optional incluida.
|
|
38
|
+
*/
|
|
39
|
+
interface LlmsIndexDraft extends Omit<LlmsIndexModel, "sections" | "optionalSection"> {
|
|
40
|
+
sections: LlmsSectionDraft[];
|
|
41
|
+
/** Se edita como las demás, pero con su nombre fijo y fuera de `sections`: no se mueve ni se quita. */
|
|
42
|
+
optionalSection: LlmsSectionDraft;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** Los ajustes que el editor tiene en pantalla, antes de pasarlos al contrato. */
|
|
46
|
+
interface LlmsSettingsDraft {
|
|
47
|
+
index: LlmsIndexDraft;
|
|
48
|
+
markdown: MarkdownMirrorOptions;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Con qué empieza la selección automática de una sección que no lo ha sido desde que
|
|
53
|
+
* se abrió el modelo: sin filtros, con la relación «todos», de la más reciente a la
|
|
54
|
+
* más antigua y sin límite.
|
|
55
|
+
*/
|
|
56
|
+
const DEFAULT_AUTOMATIC: LlmsAutomaticSelection = {
|
|
57
|
+
filters: [],
|
|
58
|
+
globalOperator: "AND",
|
|
59
|
+
order: "recent",
|
|
60
|
+
orderDirection: "DESC",
|
|
61
|
+
quantity: null,
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
/** El último número dado a una sección; solo crece. */
|
|
65
|
+
let lastSectionKey = 0;
|
|
66
|
+
/** Una identidad nueva para una sección. */
|
|
67
|
+
const newSectionKey = () => `llms-section-${++lastSectionKey}`;
|
|
68
|
+
|
|
69
|
+
/** Una sección nueva: manual y sin páginas ni nombre. */
|
|
70
|
+
const newSectionDraft = (): LlmsSectionDraft => ({
|
|
71
|
+
key: newSectionKey(),
|
|
72
|
+
type: "manual",
|
|
73
|
+
name: "",
|
|
74
|
+
pages: [],
|
|
75
|
+
automatic: DEFAULT_AUTOMATIC,
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* El encabezado de la sección Optional, que no se edita: la convención del `llms.txt`
|
|
80
|
+
* reconoce por este nombre literal la sección que un asistente puede saltarse.
|
|
81
|
+
*/
|
|
82
|
+
const OPTIONAL_SECTION_NAME = "Optional";
|
|
83
|
+
|
|
84
|
+
/** La identidad de la sección Optional en la pantalla: solo hay una. */
|
|
85
|
+
const OPTIONAL_SECTION_KEY = "llms-optional-section";
|
|
86
|
+
|
|
87
|
+
/** La sección que llega de la API, con la otra selección vacía para cuando el editor cambie. */
|
|
88
|
+
const toSectionDraft = (section: LlmsIndexSection): LlmsSectionDraft => {
|
|
89
|
+
if (section.type === "manual") {
|
|
90
|
+
return { ...newSectionDraft(), name: section.name, pages: section.pages };
|
|
91
|
+
}
|
|
92
|
+
const { type: _type, name, ...automatic } = section;
|
|
93
|
+
|
|
94
|
+
return { ...newSectionDraft(), type: "automatic", name, automatic };
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Las opciones del espejo que la pantalla no enseña y siempre envía con el mismo valor:
|
|
99
|
+
* cada imagen una vez y los enlaces internos absolutos.
|
|
100
|
+
*/
|
|
101
|
+
const FIXED_MIRROR_OPTIONS: Pick<MarkdownMirrorOptions, "images" | "absoluteLinks"> = {
|
|
102
|
+
images: "dedupe",
|
|
103
|
+
absoluteLinks: true,
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
/** Las opciones del espejo que llegan de la API, tal como las enseña y las envía la pantalla. */
|
|
107
|
+
const toMirrorDraft = (markdown: MarkdownMirrorOptions): MarkdownMirrorOptions => ({
|
|
108
|
+
...markdown,
|
|
109
|
+
...FIXED_MIRROR_OPTIONS,
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Las opciones del espejo comunes a todos los dominios: todas salvo si el dominio lo
|
|
114
|
+
* escribe, que se decide en cada uno.
|
|
115
|
+
*/
|
|
116
|
+
type MirrorCommonOptions = Omit<MarkdownMirrorOptions, "enabled">;
|
|
117
|
+
|
|
118
|
+
/** Las opciones comunes de unas opciones del espejo guardadas, tal como las enseña la pantalla. */
|
|
119
|
+
const toMirrorCommon = (markdown: MarkdownMirrorOptions): MirrorCommonOptions => {
|
|
120
|
+
const { enabled: _enabled, ...common } = toMirrorDraft(markdown);
|
|
121
|
+
return common;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
/** La sección Optional que llega de la API, en borrador como las demás y con su nombre. */
|
|
125
|
+
const toOptionalDraft = (section: LlmsOptionalSection): LlmsSectionDraft => ({
|
|
126
|
+
...toSectionDraft({ ...section, name: OPTIONAL_SECTION_NAME }),
|
|
127
|
+
key: OPTIONAL_SECTION_KEY,
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
/** Los ajustes que llegan de la API, listos para editarse, con las opciones fijas del espejo. */
|
|
131
|
+
const toDraft = (settings: LlmsSettings): LlmsSettingsDraft => ({
|
|
132
|
+
index: {
|
|
133
|
+
...settings.index,
|
|
134
|
+
sections: settings.index.sections.map(toSectionDraft),
|
|
135
|
+
optionalSection: toOptionalDraft(settings.index.optionalSection),
|
|
136
|
+
},
|
|
137
|
+
markdown: toMirrorDraft(settings.markdown),
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
/** Los filtros que viajan: un filtro sin valores no significa nada, y la API lo rechazaría. */
|
|
141
|
+
const filtersToSend = (filters: LlmsSectionFilter[]): LlmsSectionFilter[] =>
|
|
142
|
+
filters.filter((filter) => filter.values.length > 0);
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Una sección en la forma del contrato: solo con lo de su selección, porque la API
|
|
146
|
+
* rechaza la que trae algo de la otra aunque venga vacío.
|
|
147
|
+
*/
|
|
148
|
+
const toSection = (section: LlmsSectionDraft): LlmsIndexSection =>
|
|
149
|
+
section.type === "manual"
|
|
150
|
+
? { type: "manual", name: section.name, pages: section.pages }
|
|
151
|
+
: {
|
|
152
|
+
type: "automatic",
|
|
153
|
+
name: section.name,
|
|
154
|
+
...section.automatic,
|
|
155
|
+
filters: filtersToSend(section.automatic.filters),
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
/** La sección Optional en la forma del contrato: sin nombre, que no se guarda. */
|
|
159
|
+
const toOptionalSection = (section: LlmsSectionDraft): LlmsOptionalSection => {
|
|
160
|
+
const { name: _name, ...optional } = toSection(section);
|
|
161
|
+
return optional;
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
/** Los ajustes en pantalla en la forma del contrato, que es lo único que se envía. */
|
|
165
|
+
const toSettings = (draft: LlmsSettingsDraft): LlmsSettings => ({
|
|
166
|
+
index: {
|
|
167
|
+
...draft.index,
|
|
168
|
+
sections: draft.index.sections.map(toSection),
|
|
169
|
+
optionalSection: toOptionalSection(draft.index.optionalSection),
|
|
170
|
+
},
|
|
171
|
+
markdown: draft.markdown,
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
/** Escribe un campo del encabezado del modelo. Un campo en blanco no viaja. */
|
|
175
|
+
const setIndexText = <M extends { texts: LlmsIndexText }>(model: M, field: keyof LlmsIndexText, value: string): M => {
|
|
176
|
+
const { [field]: _previous, ...otherFields } = model.texts;
|
|
177
|
+
|
|
178
|
+
return { ...model, texts: value.trim() === "" ? otherFields : { ...otherFields, [field]: value } };
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
/** Escribe el pie del modelo tal como llega. En blanco, el pie viaja sin texto. */
|
|
182
|
+
const setFooterContent = <M extends { footer: LlmsIndexFooter }>(model: M, content: string): M => ({
|
|
183
|
+
...model,
|
|
184
|
+
footer: content.trim() === "" ? {} : { content },
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Si alguna sección del modelo, sin contar la Optional, está sin nombre o solo con
|
|
189
|
+
* espacios. Así no se guarda: el nombre es obligatorio.
|
|
190
|
+
*/
|
|
191
|
+
const hasUnnamedSection = ({ sections }: { sections: LlmsSectionDraft[] }): boolean =>
|
|
192
|
+
sections.some((section) => !section.name.trim());
|
|
193
|
+
|
|
194
|
+
/** Mueve un elemento de una posición a otra sin tocar el array original. */
|
|
195
|
+
const moveItem = <T,>(items: T[], from: number, to: number): T[] => {
|
|
196
|
+
if (to < 0 || to >= items.length || from === to) return items;
|
|
197
|
+
const next = [...items];
|
|
198
|
+
const [item] = next.splice(from, 1);
|
|
199
|
+
next.splice(to, 0, item);
|
|
200
|
+
|
|
201
|
+
return next;
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
/** Sustituye la sección que tiene esa identidad, la Optional incluida. */
|
|
205
|
+
const updateSection = (
|
|
206
|
+
model: LlmsIndexDraft,
|
|
207
|
+
key: string,
|
|
208
|
+
update: (section: LlmsSectionDraft) => LlmsSectionDraft,
|
|
209
|
+
): LlmsIndexDraft =>
|
|
210
|
+
key === model.optionalSection.key
|
|
211
|
+
? { ...model, optionalSection: update(model.optionalSection) }
|
|
212
|
+
: { ...model, sections: model.sections.map((section) => (section.key === key ? update(section) : section)) };
|
|
213
|
+
|
|
214
|
+
/** Añade una página al final de la selección manual, salvo que ya la lleve. */
|
|
215
|
+
const addSectionPage = (section: LlmsSectionDraft, pageId: number): LlmsSectionDraft =>
|
|
216
|
+
section.pages.includes(pageId) ? section : { ...section, pages: [...section.pages, pageId] };
|
|
217
|
+
|
|
218
|
+
/** Cambia la selección automática de una sección. */
|
|
219
|
+
const updateAutomatic = (
|
|
220
|
+
section: LlmsSectionDraft,
|
|
221
|
+
update: (automatic: LlmsAutomaticSelection) => LlmsAutomaticSelection,
|
|
222
|
+
): LlmsSectionDraft => ({ ...section, automatic: update(section.automatic) });
|
|
223
|
+
|
|
224
|
+
/** El filtro vacío de un eje, con el único operador que admite. */
|
|
225
|
+
const emptyFilter = (axis: LlmsSectionFilter["axis"]): LlmsSectionFilter =>
|
|
226
|
+
axis === "branch" ? { axis, operator: "isUnder", values: [] } : { axis, operator: "isAnyOf", values: [] };
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Los ids de todas las páginas que nombran los ajustes, sin repetir: las elegidas a
|
|
230
|
+
* mano y las que abren una rama, también en la sección Optional.
|
|
231
|
+
*/
|
|
232
|
+
const sectionPageIds = (settings: LlmsSettings): number[] => [
|
|
233
|
+
...new Set(
|
|
234
|
+
[...settings.index.sections, settings.index.optionalSection].flatMap((section) =>
|
|
235
|
+
section.type === "manual"
|
|
236
|
+
? section.pages
|
|
237
|
+
: section.filters.flatMap((filter) => (filter.axis === "branch" ? filter.values : [])),
|
|
238
|
+
),
|
|
239
|
+
),
|
|
240
|
+
];
|
|
241
|
+
|
|
242
|
+
/** «1 page», «2 pages». */
|
|
243
|
+
const count = (total: number, one: string, many: string) => `${total} ${total === 1 ? one : many}`;
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* El resumen de una sección en el esquema: cuántas páginas elige a mano o, si es
|
|
247
|
+
* automática, cuántos filtros tiene y, si tiene límite, hasta cuántas páginas coge.
|
|
248
|
+
*/
|
|
249
|
+
const sectionSummary = (section: LlmsSectionDraft): string => {
|
|
250
|
+
if (section.type === "manual") return `Manual · ${count(section.pages.length, "page", "pages")}`;
|
|
251
|
+
const { filters, quantity } = section.automatic;
|
|
252
|
+
const parts = ["Automatic", count(filtersToSend(filters).length, "filter", "filters")];
|
|
253
|
+
if (quantity !== null) parts.push(`up to ${count(quantity, "page", "pages")}`);
|
|
254
|
+
|
|
255
|
+
return parts.join(" · ");
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
/** El nombre con que el esquema enseña una sección: el suyo o, en blanco, que no tiene. */
|
|
259
|
+
const sectionTitle = (section: LlmsSectionDraft): string => section.name.trim() || "Untitled section";
|
|
260
|
+
|
|
261
|
+
/** El nombre con que se enseña un dominio: el suyo, su dirección o, sin ninguno, su id. */
|
|
262
|
+
const domainLabel = (domain: LlmsDomain): string => domain.name || domain.url || `Domain ${domain.id}`;
|
|
263
|
+
|
|
264
|
+
/** Una plantilla de la instancia, por su id y por el nombre con que se muestra. */
|
|
265
|
+
interface ITemplateOption {
|
|
266
|
+
id: string;
|
|
267
|
+
name: string;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Todas las plantillas de la instancia, ordenadas por el nombre con que se muestran,
|
|
272
|
+
* sin mirar qué sitios del dominio las usan.
|
|
273
|
+
*/
|
|
274
|
+
const getTemplateOptions = (): ITemplateOption[] =>
|
|
275
|
+
Object.entries<{ displayName?: string }>(config.schemas.ui.templates ?? {})
|
|
276
|
+
.map(([id, schema]) => ({ id, name: schema.displayName || id }))
|
|
277
|
+
.sort((a, b) => a.name.localeCompare(b.name));
|
|
278
|
+
|
|
279
|
+
export type {
|
|
280
|
+
ITemplateOption,
|
|
281
|
+
LlmsAutomaticSelection,
|
|
282
|
+
LlmsIndexDraft,
|
|
283
|
+
LlmsSectionDraft,
|
|
284
|
+
LlmsSettingsDraft,
|
|
285
|
+
MirrorCommonOptions,
|
|
286
|
+
};
|
|
287
|
+
export {
|
|
288
|
+
addSectionPage,
|
|
289
|
+
count,
|
|
290
|
+
domainLabel,
|
|
291
|
+
emptyFilter,
|
|
292
|
+
getTemplateOptions,
|
|
293
|
+
hasUnnamedSection,
|
|
294
|
+
moveItem,
|
|
295
|
+
newSectionDraft,
|
|
296
|
+
OPTIONAL_SECTION_NAME,
|
|
297
|
+
sectionPageIds,
|
|
298
|
+
sectionSummary,
|
|
299
|
+
sectionTitle,
|
|
300
|
+
setFooterContent,
|
|
301
|
+
setIndexText,
|
|
302
|
+
toDraft,
|
|
303
|
+
toMirrorCommon,
|
|
304
|
+
toSettings,
|
|
305
|
+
updateAutomatic,
|
|
306
|
+
updateSection,
|
|
307
|
+
};
|
|
@@ -2,6 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { Switch, Route } from "react-router-dom";
|
|
3
3
|
|
|
4
4
|
import Redirects from "../Redirects";
|
|
5
|
+
import Llms from "./Llms";
|
|
5
6
|
import Robots from "./Robots";
|
|
6
7
|
|
|
7
8
|
const navItems = [
|
|
@@ -11,6 +12,12 @@ const navItems = [
|
|
|
11
12
|
component: Robots,
|
|
12
13
|
permission: "global.seoAnalytics.editSeoAnalyticsInGlobalPages",
|
|
13
14
|
},
|
|
15
|
+
{
|
|
16
|
+
title: "LLMs.txt Editor",
|
|
17
|
+
path: "/settings/llms",
|
|
18
|
+
component: Llms,
|
|
19
|
+
permission: "global.seoAnalytics.editSeoAnalyticsInGlobalPages",
|
|
20
|
+
},
|
|
14
21
|
{
|
|
15
22
|
title: "URL Redirect Manager",
|
|
16
23
|
path: "/settings/redirects",
|
|
@@ -2,12 +2,10 @@ import { useEffect, useState } from "react";
|
|
|
2
2
|
import { connect } from "react-redux";
|
|
3
3
|
import { useParams } from "react-router-dom";
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import type { IRootState } from "@ax/types";
|
|
6
6
|
import { appActions } from "@ax/containers/App";
|
|
7
|
+
import { Login } from "@ax/components";
|
|
7
8
|
import type { IGlobalSettings } from "@ax/containers/App/reducer";
|
|
8
|
-
import { buildGriddoIdStartUrl } from "@ax/helpers";
|
|
9
|
-
import type { IRootState } from "@ax/types";
|
|
10
|
-
|
|
11
9
|
import { errorText } from "./constants";
|
|
12
10
|
|
|
13
11
|
const LoginModule = (props: IProps) => {
|
|
@@ -74,13 +72,6 @@ const LoginModule = (props: IProps) => {
|
|
|
74
72
|
}
|
|
75
73
|
};
|
|
76
74
|
|
|
77
|
-
// Navegación completa a la API: arranca el flujo OIDC (state, nonce y PKCE los genera la API). Lleva el email
|
|
78
|
-
// escrito como `login_hint`; la contraseña nunca se lee.
|
|
79
|
-
const handleClickGriddoId = () =>
|
|
80
|
-
window.location.assign(
|
|
81
|
-
buildGriddoIdStartUrl(`${process.env.GRIDDO_API_URL || process.env.REACT_APP_API_ENDPOINT}`, state.email),
|
|
82
|
-
);
|
|
83
|
-
|
|
84
75
|
const _handleEmail = (email: string) => {
|
|
85
76
|
resetError();
|
|
86
77
|
setState((prev) => ({ ...prev, email }));
|
|
@@ -112,7 +103,6 @@ const LoginModule = (props: IProps) => {
|
|
|
112
103
|
isLoginSuccess={isSuccess}
|
|
113
104
|
handleLoginSuccess={handleLoginSuccess}
|
|
114
105
|
handleSSO={handleClickSSO}
|
|
115
|
-
handleGriddoId={handleClickGriddoId}
|
|
116
106
|
errorSSO={errorSSO}
|
|
117
107
|
/>
|
|
118
108
|
);
|
|
@@ -2,7 +2,6 @@ import { type MouseEvent as ReactMouseEvent, useState } from "react";
|
|
|
2
2
|
import { connect } from "react-redux";
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
|
-
buildCategoryColumns,
|
|
6
5
|
CheckField,
|
|
7
6
|
ContextMenu,
|
|
8
7
|
ElementsTooltip,
|
|
@@ -16,7 +15,13 @@ import {
|
|
|
16
15
|
import { appActions } from "@ax/containers/App";
|
|
17
16
|
import { pageEditorActions } from "@ax/containers/PageEditor";
|
|
18
17
|
import { type ISetCurrentPageIDAction, pageStatus } from "@ax/containers/PageEditor/interfaces";
|
|
19
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
buildCategoryColumns,
|
|
20
|
+
getHumanLastModifiedDate,
|
|
21
|
+
getScheduleFormatDate,
|
|
22
|
+
getStructuredDataTitle,
|
|
23
|
+
trimText,
|
|
24
|
+
} from "@ax/helpers";
|
|
20
25
|
import { useContextMenu, useModals, usePermissionsForPage } from "@ax/hooks";
|
|
21
26
|
import type {
|
|
22
27
|
IAvailableSites,
|
|
@@ -315,10 +320,7 @@ const GlobalPageItem = (props: IGlobalPageItemProps): JSX.Element => {
|
|
|
315
320
|
|
|
316
321
|
menuOptions = globalPage.haveDraftPage ? [...editOptions, ...menuOptions] : menuOptions;
|
|
317
322
|
|
|
318
|
-
menuOptions =
|
|
319
|
-
globalPage.liveStatus?.status === pageStatus.PUBLISHED
|
|
320
|
-
? [viewOption, newTabOption, ...menuOptions]
|
|
321
|
-
: [newTabOption, ...menuOptions];
|
|
323
|
+
menuOptions = globalPage.liveStatus?.status === pageStatus.PUBLISHED ? [viewOption, newTabOption, ...menuOptions] : [newTabOption, ...menuOptions];
|
|
322
324
|
|
|
323
325
|
const isTranslated = globalPage.pageLanguages.length > 1;
|
|
324
326
|
|
|
@@ -2,7 +2,6 @@ import { type MouseEvent as ReactMouseEvent, useState } from "react";
|
|
|
2
2
|
import { connect } from "react-redux";
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
|
-
buildCategoryColumns,
|
|
6
5
|
CheckField,
|
|
7
6
|
ContextMenu,
|
|
8
7
|
Flag,
|
|
@@ -14,7 +13,12 @@ import {
|
|
|
14
13
|
} from "@ax/components";
|
|
15
14
|
import { appActions } from "@ax/containers/App";
|
|
16
15
|
import { structuredDataActions } from "@ax/containers/StructuredData";
|
|
17
|
-
import {
|
|
16
|
+
import {
|
|
17
|
+
buildCategoryColumns,
|
|
18
|
+
getActivatedDataPacksIds,
|
|
19
|
+
getHumanLastModifiedDate,
|
|
20
|
+
getScheduleFormatDate,
|
|
21
|
+
} from "@ax/helpers";
|
|
18
22
|
import { useContextMenu, useModal, usePermissionsForPage } from "@ax/hooks";
|
|
19
23
|
import type {
|
|
20
24
|
ICheck,
|
|
@@ -216,13 +220,11 @@ const StructuredDataItem = (props: IStructuredDataItemProps): JSX.Element => {
|
|
|
216
220
|
"Not translatable"
|
|
217
221
|
);
|
|
218
222
|
|
|
219
|
-
const menuOptions = [
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
},
|
|
225
|
-
];
|
|
223
|
+
const menuOptions = [{
|
|
224
|
+
label: "Open in new tab",
|
|
225
|
+
icon: "openOutside",
|
|
226
|
+
action: handleOpenInNewTab,
|
|
227
|
+
}];
|
|
226
228
|
|
|
227
229
|
if (!isDisabled && isEditable && isAllowedTo.duplicatePages) {
|
|
228
230
|
menuOptions.push({
|
package/src/routes/multisite.tsx
CHANGED
|
@@ -188,7 +188,7 @@ export default [
|
|
|
188
188
|
{
|
|
189
189
|
path: `/settings/robots`,
|
|
190
190
|
component: GlobalSettings,
|
|
191
|
-
name: "SEO tools",
|
|
191
|
+
name: "SEO & GEO tools",
|
|
192
192
|
permission: "global.seoAnalytics.editSeoAnalyticsInGlobalPages",
|
|
193
193
|
},
|
|
194
194
|
{
|
|
@@ -208,6 +208,13 @@ export default [
|
|
|
208
208
|
showInNav: false,
|
|
209
209
|
permission: "global.seoAnalytics.editSeoAnalyticsInGlobalPages",
|
|
210
210
|
},
|
|
211
|
+
{
|
|
212
|
+
path: `/settings/llms`,
|
|
213
|
+
component: GlobalSettings,
|
|
214
|
+
name: "Settings",
|
|
215
|
+
showInNav: false,
|
|
216
|
+
permission: "global.seoAnalytics.editSeoAnalyticsInGlobalPages",
|
|
217
|
+
},
|
|
211
218
|
{
|
|
212
219
|
path: `/editor/page-preview`,
|
|
213
220
|
component: FramePreview,
|
|
@@ -2,13 +2,10 @@ import CreatePass from "./../modules/CreatePass";
|
|
|
2
2
|
import Login from "./../modules/Login";
|
|
3
3
|
import PublicPreview from "./../modules/PublicPreview";
|
|
4
4
|
import ResetPass from "./../modules/ResetPass";
|
|
5
|
-
import SsoDenied from "./../modules/SsoDenied";
|
|
6
5
|
|
|
7
6
|
const publicRoutes = [
|
|
8
7
|
{ path: "/login/:petitionId", component: Login, name: "Login", hideNav: true },
|
|
9
8
|
{ path: "/login", component: Login, name: "Login", hideNav: true },
|
|
10
|
-
// Fuera de `/login/*`: `/login/:petitionId` capturaría el segmento como uuid y llamaría a `POST /login_check`.
|
|
11
|
-
{ path: "/sso-denied", component: SsoDenied, name: "SSO denied", hideNav: true },
|
|
12
9
|
{ path: "/new-password/:id/:token", component: ResetPass, name: "Reset Password", hideNav: true },
|
|
13
10
|
{ path: "/set-password/:id/:token", component: CreatePass, name: "Create Password", hideNav: true },
|
|
14
11
|
{ path: "/page-preview/:id/:entity/:token?", component: PublicPreview, name: "Preview", hideNav: true },
|
|
@@ -178,8 +178,8 @@ export default {
|
|
|
178
178
|
{
|
|
179
179
|
type: "UniqueCheck",
|
|
180
180
|
key: "isLlmsEnabled",
|
|
181
|
-
options: [{ title: "
|
|
182
|
-
description: "
|
|
181
|
+
options: [{ title: "Allow this page in llms.txt" }],
|
|
182
|
+
description: "Only listed in llms.txt when selected.",
|
|
183
183
|
},
|
|
184
184
|
],
|
|
185
185
|
},
|
|
@@ -244,8 +244,8 @@ export default {
|
|
|
244
244
|
{
|
|
245
245
|
type: "UniqueCheck",
|
|
246
246
|
key: "isLlmsEnabled",
|
|
247
|
-
options: [{ title: "
|
|
248
|
-
description: "
|
|
247
|
+
options: [{ title: "Allow this page in llms.txt" }],
|
|
248
|
+
description: "Only listed in llms.txt when selected.",
|
|
249
249
|
},
|
|
250
250
|
],
|
|
251
251
|
},
|
package/src/types/index.tsx
CHANGED
|
@@ -39,6 +39,41 @@ import type {
|
|
|
39
39
|
PostFormCategoryParams,
|
|
40
40
|
PutFormCategoryParams,
|
|
41
41
|
} from "./forms";
|
|
42
|
+
import type {
|
|
43
|
+
LlmsAutomaticSection,
|
|
44
|
+
LlmsBranchFilter,
|
|
45
|
+
LlmsDomain,
|
|
46
|
+
LlmsDomainPage,
|
|
47
|
+
LlmsGlobalOperator,
|
|
48
|
+
LlmsIndexFooter,
|
|
49
|
+
LlmsIndexModel,
|
|
50
|
+
LlmsIndexModelSectionResolved,
|
|
51
|
+
LlmsIndexOptionalSectionResolved,
|
|
52
|
+
LlmsIndexPage,
|
|
53
|
+
LlmsIndexResolved,
|
|
54
|
+
LlmsIndexResponse,
|
|
55
|
+
LlmsIndexSection,
|
|
56
|
+
LlmsIndexSectionResolved,
|
|
57
|
+
LlmsIndexSite,
|
|
58
|
+
LlmsIndexText,
|
|
59
|
+
LlmsIndexTextResolved,
|
|
60
|
+
LlmsLanguageFilter,
|
|
61
|
+
LlmsManualSection,
|
|
62
|
+
LlmsOptionalSection,
|
|
63
|
+
LlmsOrderDirection,
|
|
64
|
+
LlmsPageReason,
|
|
65
|
+
LlmsPagesQuery,
|
|
66
|
+
LlmsPagesResponse,
|
|
67
|
+
LlmsSectionFilter,
|
|
68
|
+
LlmsSectionOrder,
|
|
69
|
+
LlmsSectionPagesQuery,
|
|
70
|
+
LlmsSectionPagesResponse,
|
|
71
|
+
LlmsSettings,
|
|
72
|
+
LlmsSiteFilter,
|
|
73
|
+
LlmsTemplateFilter,
|
|
74
|
+
MarkdownMirrorImages,
|
|
75
|
+
MarkdownMirrorOptions,
|
|
76
|
+
} from "./llms";
|
|
42
77
|
import type { ILogContent, ILogItemsByDay, ILogItemsByUser } from "./logs";
|
|
43
78
|
|
|
44
79
|
export interface IBreadcrumbItem {
|
|
@@ -1166,26 +1201,59 @@ export type Field =
|
|
|
1166
1201
|
| "Wysiwyg";
|
|
1167
1202
|
|
|
1168
1203
|
export type {
|
|
1169
|
-
GetFormsParams,
|
|
1170
|
-
ListForm,
|
|
1171
|
-
FormContent,
|
|
1172
|
-
FormCategory,
|
|
1173
1204
|
FormCategoriesList,
|
|
1174
|
-
PostFormCategoryParams,
|
|
1175
|
-
PutFormCategoryParams,
|
|
1176
1205
|
FormCategoriesOrderParams,
|
|
1177
|
-
|
|
1206
|
+
FormCategory,
|
|
1207
|
+
FormContent,
|
|
1178
1208
|
FormLanguage,
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
IFilesFolder,
|
|
1209
|
+
FormState,
|
|
1210
|
+
GetFormsParams,
|
|
1182
1211
|
IFile,
|
|
1183
|
-
|
|
1212
|
+
IFilesFolder,
|
|
1184
1213
|
IFileUseItem,
|
|
1214
|
+
IFileUsePages,
|
|
1185
1215
|
IFolder,
|
|
1186
1216
|
IFolderTree,
|
|
1187
1217
|
IGetFolderParams,
|
|
1188
1218
|
IImage,
|
|
1189
1219
|
IImageFolder,
|
|
1220
|
+
ILogContent,
|
|
1221
|
+
ILogItemsByDay,
|
|
1222
|
+
ILogItemsByUser,
|
|
1223
|
+
ListForm,
|
|
1224
|
+
LlmsAutomaticSection,
|
|
1225
|
+
LlmsBranchFilter,
|
|
1226
|
+
LlmsDomain,
|
|
1227
|
+
LlmsDomainPage,
|
|
1228
|
+
LlmsGlobalOperator,
|
|
1229
|
+
LlmsIndexFooter,
|
|
1230
|
+
LlmsIndexModel,
|
|
1231
|
+
LlmsIndexModelSectionResolved,
|
|
1232
|
+
LlmsIndexOptionalSectionResolved,
|
|
1233
|
+
LlmsIndexPage,
|
|
1234
|
+
LlmsIndexResolved,
|
|
1235
|
+
LlmsIndexResponse,
|
|
1236
|
+
LlmsIndexSection,
|
|
1237
|
+
LlmsIndexSectionResolved,
|
|
1238
|
+
LlmsIndexSite,
|
|
1239
|
+
LlmsIndexText,
|
|
1240
|
+
LlmsIndexTextResolved,
|
|
1241
|
+
LlmsLanguageFilter,
|
|
1242
|
+
LlmsManualSection,
|
|
1243
|
+
LlmsOptionalSection,
|
|
1244
|
+
LlmsOrderDirection,
|
|
1245
|
+
LlmsPageReason,
|
|
1246
|
+
LlmsPagesQuery,
|
|
1247
|
+
LlmsPagesResponse,
|
|
1248
|
+
LlmsSectionFilter,
|
|
1249
|
+
LlmsSectionOrder,
|
|
1250
|
+
LlmsSectionPagesQuery,
|
|
1251
|
+
LlmsSectionPagesResponse,
|
|
1252
|
+
LlmsSettings,
|
|
1253
|
+
LlmsSiteFilter,
|
|
1254
|
+
LlmsTemplateFilter,
|
|
1255
|
+
MarkdownMirrorImages,
|
|
1256
|
+
MarkdownMirrorOptions,
|
|
1257
|
+
PostFormCategoryParams,
|
|
1258
|
+
PutFormCategoryParams,
|
|
1190
1259
|
};
|
|
1191
|
-
export type { ILogItemsByDay, ILogItemsByUser, ILogContent };
|