@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
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@griddo/ax",
|
|
3
3
|
"description": "Griddo Author Experience",
|
|
4
|
-
"version": "12.15.0
|
|
4
|
+
"version": "12.15.0",
|
|
5
5
|
"homepage": "https://griddo.io",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
"test:ci": "vitest run --no-file-parallelism",
|
|
23
23
|
"test:coverage": "vitest run --coverage",
|
|
24
24
|
"typecheck": "tsc --noEmit",
|
|
25
|
-
"mutation": "stryker run",
|
|
26
25
|
"lint": "biome check",
|
|
27
26
|
"format:write": "biome format --write"
|
|
28
27
|
},
|
|
@@ -128,9 +127,7 @@
|
|
|
128
127
|
},
|
|
129
128
|
"devDependencies": {
|
|
130
129
|
"@biomejs/biome": "2.5.15",
|
|
131
|
-
"@griddo/core": "12.15.0
|
|
132
|
-
"@stryker-mutator/core": "^10.0.0",
|
|
133
|
-
"@stryker-mutator/vitest-runner": "^10.0.0",
|
|
130
|
+
"@griddo/core": "12.15.0",
|
|
134
131
|
"@types/redux-mock-store": "1.5.0",
|
|
135
132
|
"@vitest/coverage-v8": "4.1.11",
|
|
136
133
|
"axios-mock-adapter": "1.22.0",
|
|
@@ -141,7 +138,7 @@
|
|
|
141
138
|
"vitest-styled-components": "1.0.0"
|
|
142
139
|
},
|
|
143
140
|
"peerDependencies": {
|
|
144
|
-
"@griddo/core": "12.15.0
|
|
141
|
+
"@griddo/core": "12.15.0"
|
|
145
142
|
},
|
|
146
143
|
"babel": {
|
|
147
144
|
"presets": [
|
|
@@ -174,5 +171,5 @@
|
|
|
174
171
|
"publishConfig": {
|
|
175
172
|
"access": "public"
|
|
176
173
|
},
|
|
177
|
-
"gitHead": "
|
|
174
|
+
"gitHead": "dee58968ea076b5d6f0ee92f0a6d4e7a1bf65630"
|
|
178
175
|
}
|
package/src/GlobalStore.tsx
CHANGED
|
@@ -1,34 +1,32 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
1
|
+
import { createStore, type Reducer, combineReducers, applyMiddleware, type Action, type StoreEnhancer } from "redux";
|
|
3
2
|
import { connectRouter, routerMiddleware } from "connected-react-router";
|
|
4
|
-
import {
|
|
5
|
-
import { composeWithDevTools } from "redux-devtools-extension";
|
|
6
|
-
import { type PersistConfig, type Persistor, persistReducer, persistStore } from "redux-persist";
|
|
3
|
+
import { persistReducer, persistStore, type PersistConfig, type Persistor } from "redux-persist";
|
|
7
4
|
import storage from "redux-persist/lib/storage"; // defaults to localStorage for web
|
|
5
|
+
import { setStore } from "./storeRegistry";
|
|
6
|
+
import { composeWithDevTools } from "redux-devtools-extension";
|
|
8
7
|
import thunk from "redux-thunk";
|
|
9
8
|
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
9
|
+
import { appReducer, appInitialState } from "./containers/App/reducer";
|
|
10
|
+
import { sitesReducer, sitesInitialState } from "./containers/Sites/reducer";
|
|
11
|
+
import { pageEditorReducer, pageEditorInitialState } from "./containers/PageEditor/reducer";
|
|
12
|
+
import { menuReducer, menuInitialState } from "./containers/Navigation/Menu/reducer";
|
|
13
|
+
import { navigationReducer, navigationInitialState } from "./containers/Navigation/Defaults/reducer";
|
|
14
|
+
import { structuredDataReducer, structuredDataInitialState } from "./containers/StructuredData/reducer";
|
|
15
|
+
import { languagesReducer, languagesInitialState } from "./containers/Settings/Languages/reducer";
|
|
16
|
+
import { dataPacksReducer, dataPacksInitialState } from "./containers/Settings/DataPacks/reducer";
|
|
17
|
+
import { socialReducer, socialInitialState } from "./containers/Settings/Social/reducer";
|
|
18
|
+
import { usersReducer, usersInitialState } from "./containers/Users/reducer";
|
|
19
|
+
import { galleryReducer, galleryInitialState } from "./containers/Gallery/reducer";
|
|
20
|
+
import { domainsReducer, domainsInitialState } from "./containers/Domains/reducer";
|
|
21
|
+
import { redirectsReducer, redirectsInitialState } from "./containers/Redirects/reducer";
|
|
22
|
+
import { analyticsReducer, analyticsInitialState } from "./containers/Analytics/reducer";
|
|
23
|
+
import { integrationsReducer, integrationsInitialState } from "./containers/Integrations/reducer";
|
|
24
|
+
import { fileDriveReducer, fileDriveInitialState } from "./containers/FileDrive/reducer";
|
|
25
|
+
import { formsReducer, formsInitialState } from "./containers/Forms/reducer";
|
|
26
|
+
import { activityLogReducer, activityLogInitialState } from "./containers/ActivityLog/reducer";
|
|
14
27
|
import { LOGOUT } from "./containers/App/constants";
|
|
15
|
-
|
|
16
|
-
import {
|
|
17
|
-
import { fileDriveInitialState, fileDriveReducer } from "./containers/FileDrive/reducer";
|
|
18
|
-
import { formsInitialState, formsReducer } from "./containers/Forms/reducer";
|
|
19
|
-
import { galleryInitialState, galleryReducer } from "./containers/Gallery/reducer";
|
|
20
|
-
import { integrationsInitialState, integrationsReducer } from "./containers/Integrations/reducer";
|
|
21
|
-
import { navigationInitialState, navigationReducer } from "./containers/Navigation/Defaults/reducer";
|
|
22
|
-
import { menuInitialState, menuReducer } from "./containers/Navigation/Menu/reducer";
|
|
23
|
-
import { pageEditorInitialState, pageEditorReducer } from "./containers/PageEditor/reducer";
|
|
24
|
-
import { redirectsInitialState, redirectsReducer } from "./containers/Redirects/reducer";
|
|
25
|
-
import { dataPacksInitialState, dataPacksReducer } from "./containers/Settings/DataPacks/reducer";
|
|
26
|
-
import { languagesInitialState, languagesReducer } from "./containers/Settings/Languages/reducer";
|
|
27
|
-
import { socialInitialState, socialReducer } from "./containers/Settings/Social/reducer";
|
|
28
|
-
import { sitesInitialState, sitesReducer } from "./containers/Sites/reducer";
|
|
29
|
-
import { structuredDataInitialState, structuredDataReducer } from "./containers/StructuredData/reducer";
|
|
30
|
-
import { usersInitialState, usersReducer } from "./containers/Users/reducer";
|
|
31
|
-
import { setStore } from "./storeRegistry";
|
|
28
|
+
|
|
29
|
+
import type { IRootState } from "@ax/types";
|
|
32
30
|
|
|
33
31
|
const blacklist = ["router", "menu", "app", "languages"];
|
|
34
32
|
export class GlobalStore {
|
|
@@ -36,8 +34,7 @@ export class GlobalStore {
|
|
|
36
34
|
|
|
37
35
|
private authPersistConfig = {
|
|
38
36
|
key: "app",
|
|
39
|
-
|
|
40
|
-
storage: createSessionStorage(storage),
|
|
37
|
+
storage,
|
|
41
38
|
blacklist: ["error", "isLoggingIn", "isRehydrated", "isSaving", "loadingCount", "user"],
|
|
42
39
|
};
|
|
43
40
|
|
|
@@ -99,10 +96,6 @@ export class GlobalStore {
|
|
|
99
96
|
}
|
|
100
97
|
const store = createStore(persistReducer(this.persistConfig, rootReducer), middleware);
|
|
101
98
|
setStore(store);
|
|
102
|
-
registerSessionBridge({
|
|
103
|
-
onRenewed: (session) => store.dispatch(setSessionTokens(session)),
|
|
104
|
-
onExpired: () => store.dispatch(logoutAndNavigate() as any),
|
|
105
|
-
});
|
|
106
99
|
const persistor: Persistor = persistStore(store);
|
|
107
100
|
return { store, persistor };
|
|
108
101
|
}
|
|
@@ -1,43 +1,18 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
3
|
-
import FileField, { type IFileFieldProps } from "@ax/components/Fields/FileField";
|
|
2
|
+
import { ThemeProvider } from "styled-components";
|
|
4
3
|
import { parseTheme } from "@ax/helpers";
|
|
5
4
|
import globalTheme from "@ax/themes/theme.json";
|
|
6
|
-
|
|
5
|
+
import { mock } from "vitest-mock-extended";
|
|
6
|
+
import { render, screen, cleanup } from "../../../../../config/tests/test-utils";
|
|
7
|
+
import FileField, { type IFileFieldProps } from "@ax/components/Fields/FileField";
|
|
7
8
|
import { act } from "react-dom/test-utils";
|
|
8
|
-
import configureStore from "redux-mock-store";
|
|
9
9
|
import thunk from "redux-thunk";
|
|
10
|
-
import
|
|
11
|
-
import { mock } from "vitest-mock-extended";
|
|
10
|
+
import configureStore from "redux-mock-store";
|
|
12
11
|
|
|
13
|
-
import { cleanup, render, screen } from "../../../../../config/tests/test-utils";
|
|
14
12
|
import { defaultStore } from "./../../../../__mocks__/store/GenericStore";
|
|
15
13
|
|
|
16
|
-
// FileGallery pide la carpeta y el árbol al montarse y, al resolver, hace
|
|
17
|
-
// `setIsLoading(false)`. Con la API real esa petición acababa después de que
|
|
18
|
-
// vitest desmontara jsdom y reventaba con "window is not defined" (flaky en CI).
|
|
19
|
-
vi.mock("@ax/api", async (importOriginal) => {
|
|
20
|
-
const actual = (await importOriginal()) as any;
|
|
21
|
-
|
|
22
|
-
return {
|
|
23
|
-
...actual,
|
|
24
|
-
files: {
|
|
25
|
-
...actual.files,
|
|
26
|
-
getFolderContent: () => Promise.resolve({ status: 200, data: { folders: [], files: [] } }),
|
|
27
|
-
getFoldersTree: () => Promise.resolve({ status: 200, data: [] }),
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
});
|
|
31
|
-
|
|
32
14
|
afterEach(cleanup);
|
|
33
15
|
|
|
34
|
-
// Deja que se asienten las peticiones simuladas del FileGallery antes de que
|
|
35
|
-
// acabe el test: un macrotask vacía toda la cadena de promesas ya resueltas.
|
|
36
|
-
const flushRequests = () =>
|
|
37
|
-
act(async () => {
|
|
38
|
-
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
39
|
-
});
|
|
40
|
-
|
|
41
16
|
// Props por test. Antes se compartía un objeto mutable: el segundo test dejaba
|
|
42
17
|
// `value` en undefined y los dos de "onClick events" contaban con eso sin
|
|
43
18
|
// decirlo, así que al reordenarlos se caían.
|
|
@@ -95,7 +70,7 @@ describe("FileField component rendering", () => {
|
|
|
95
70
|
});
|
|
96
71
|
|
|
97
72
|
describe("onClick events", () => {
|
|
98
|
-
it("should open FileDragAndDrop when clicking the file button",
|
|
73
|
+
it("should open FileDragAndDrop when clicking the file button", () => {
|
|
99
74
|
const Component = (
|
|
100
75
|
<ThemeProvider theme={parseTheme(globalTheme)}>
|
|
101
76
|
<FileField {...makeProps({ value: undefined })} />
|
|
@@ -109,8 +84,6 @@ describe("onClick events", () => {
|
|
|
109
84
|
|
|
110
85
|
rerender(Component);
|
|
111
86
|
|
|
112
|
-
await flushRequests();
|
|
113
|
-
|
|
114
87
|
const fileDragAndDropWrapper = screen.queryByTestId("file-drag-and-drop-wrapper");
|
|
115
88
|
expect(fileDragAndDropWrapper).toBeTruthy();
|
|
116
89
|
});
|
|
@@ -3,7 +3,7 @@ import "@testing-library/jest-dom";
|
|
|
3
3
|
|
|
4
4
|
import FieldsBehavior from "@ax/components/FieldsBehavior";
|
|
5
5
|
import { getValidity } from "@ax/forms";
|
|
6
|
-
import { isEmptyContainer, parseTheme, slugify } from "@ax/helpers";
|
|
6
|
+
import { getFieldByPath, isEmptyContainer, parseTheme, slugify } from "@ax/helpers";
|
|
7
7
|
import globalTheme from "@ax/themes/theme.json";
|
|
8
8
|
|
|
9
9
|
import { cleanup, fireEvent, render, screen, waitFor } from "@testing-library/react";
|
|
@@ -15,15 +15,13 @@ vi.mock("@ax/forms", async () => ({
|
|
|
15
15
|
}));
|
|
16
16
|
vi.mock("@ax/helpers", async () => ({
|
|
17
17
|
...(await vi.importActual("@ax/helpers")),
|
|
18
|
+
getFieldByPath: vi.fn(() => () => <div data-testid="mock-field" />),
|
|
18
19
|
isEmptyContainer: vi.fn(() => ({ isEmpty: false })),
|
|
19
20
|
slugify: vi.fn((text: string) => (text || "").toLowerCase().replace(/\s+/g, "-")),
|
|
20
21
|
}));
|
|
21
22
|
|
|
22
|
-
vi.mock("@ax/components/FieldsBehavior/getFieldByPath", () => ({
|
|
23
|
-
getFieldByPath: vi.fn(() => () => <div data-testid="mock-field" />),
|
|
24
|
-
}));
|
|
25
|
-
|
|
26
23
|
const mockGetValidity = getValidity as MockedFunction<typeof getValidity>;
|
|
24
|
+
const _mockGetFieldByPath = getFieldByPath as MockedFunction<typeof getFieldByPath>;
|
|
27
25
|
const mockIsEmptyContainer = isEmptyContainer as MockedFunction<typeof isEmptyContainer>;
|
|
28
26
|
const mockSlugify = slugify as MockedFunction<typeof slugify>;
|
|
29
27
|
|