slice-machine-ui 1.19.2-dev-next-release.2 → 1.19.2-dev-next-release.4
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/components/Navigation/ChangesListItem.tsx +0 -4
- package/components/Navigation/VideoItem.tsx +82 -76
- package/components/Navigation/index.test.tsx +2 -13
- package/components/Simulator/components/IframeRenderer/index.tsx +0 -3
- package/components/Simulator/components/Toolbar/index.tsx +0 -42
- package/components/Simulator/index.tsx +0 -2
- package/lib/builders/SliceBuilder/SimulatorButton/index.tsx +5 -20
- package/lib/consts.ts +0 -7
- package/lib/models/common/Screenshots.ts +1 -10
- package/out/404.html +1 -1
- package/out/_next/static/4sLbpIu3gX8jUmr0j0Shc/_buildManifest.js +1 -0
- package/out/_next/static/chunks/585-f3dca093db4b3792.js +10 -0
- package/out/_next/static/chunks/{80-4cd4c6f95d162ef7.js → 80-c513d12da6156fb7.js} +1 -1
- package/out/_next/static/chunks/{840-4e395e66a2b2f394.js → 840-c317c8ff8de0f202.js} +1 -1
- package/out/_next/static/chunks/{904-b2d5235c13e62ee8.js → 904-d5dfccdb4d9ab010.js} +1 -1
- package/out/_next/static/chunks/pages/{_app-ec1f14f2d3ddb69d.js → _app-ee40681cde62eb80.js} +3 -3
- package/out/_next/static/chunks/pages/{changelog-11c9e241f5a8a4cb.js → changelog-75b0bf58d1f3045d.js} +1 -1
- package/out/_next/static/chunks/pages/{changes-768c9cb6fef169d1.js → changes-9dcb1cdaa8b10560.js} +1 -1
- package/out/_next/static/chunks/pages/{labs-395232bcec99d42a.js → labs-2349c21fbac1bd23.js} +1 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-5e441f8b049cf91b.js +1 -0
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-c9b5ff7076d2b19b.js +1 -0
- package/out/_next/static/chunks/pages/{slices-f77df402117379c6.js → slices-247c480530e98426.js} +1 -1
- package/out/changelog.html +1 -1
- package/out/changes.html +1 -1
- package/out/custom-types/[customTypeId].html +1 -1
- package/out/custom-types.html +1 -1
- package/out/index.html +1 -1
- package/out/labs.html +1 -1
- package/out/page-types/[pageTypeId].html +1 -1
- package/out/prismic-academy-101.png +0 -0
- package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
- package/out/slices.html +1 -1
- package/package.json +4 -4
- package/public/prismic-academy-101.png +0 -0
- package/src/apiClient.ts +1 -40
- package/src/components/HoverCard/HoverCard.stories.tsx +1 -1
- package/src/hooks/useMarketingContent.ts +65 -0
- package/src/modules/loading/types.ts +0 -1
- package/src/modules/screenshots/actions.ts +4 -25
- package/src/modules/screenshots/sagas.ts +1 -63
- package/src/modules/selectedSlice/actions.ts +1 -5
- package/src/modules/selectedSlice/reducer.ts +1 -5
- package/src/modules/slices/index.ts +1 -6
- package/src/modules/toaster/index.tsx +6 -22
- package/src/modules/useSliceMachineActions.ts +2 -25
- package/components/ScreenshotToaster/index.tsx +0 -53
- package/out/_next/static/DcicAqW9Z1wJ8X-Tue3N3/_buildManifest.js +0 -1
- package/out/_next/static/chunks/746-2ca4784811bde7c1.js +0 -8
- package/out/_next/static/chunks/770-c75d8245a822c5d9.js +0 -3
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/screenshot-76d40513025fd76d.js +0 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-39efc79412072ae1.js +0 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-4dfda949290eb037.js +0 -1
- package/out/phil.png +0 -0
- package/out/slices/[lib]/[sliceName]/[variation]/screenshot.html +0 -1
- package/pages/slices/[lib]/[sliceName]/[variation]/screenshot.tsx +0 -61
- package/public/phil.png +0 -0
- package/test/src/modules/screenshots/__fixtures__/mocks.json +0 -41
- package/test/src/modules/screenshots/__fixtures__/model.json +0 -35
- package/test/src/modules/screenshots/__testutils__/getSelectedSliceDummyData.ts +0 -29
- package/test/src/modules/screenshots/sagas.test.ts +0 -82
- /package/out/_next/static/{DcicAqW9Z1wJ8X-Tue3N3 → 4sLbpIu3gX8jUmr0j0Shc}/_ssgManifest.js +0 -0
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import jsonModel from "../__fixtures__/model.json";
|
|
2
|
-
import mocks from "../__fixtures__/mocks.json";
|
|
3
|
-
import { Slices } from "@lib/models/common/Slice";
|
|
4
|
-
import { SharedSlice } from "@prismicio/types-internal/lib/customtypes";
|
|
5
|
-
import { ComponentUI } from "@lib/models/common/ComponentUI";
|
|
6
|
-
import { SharedSliceContent } from "@prismicio/types-internal/lib/content";
|
|
7
|
-
|
|
8
|
-
export const getSelectedSliceDummyData = () => {
|
|
9
|
-
const dummyModel = Slices.toSM(jsonModel as unknown as SharedSlice);
|
|
10
|
-
|
|
11
|
-
const dummyModelVariationID = "default-slice";
|
|
12
|
-
|
|
13
|
-
const dummySliceState: ComponentUI = {
|
|
14
|
-
from: "slices/libName",
|
|
15
|
-
href: "slices--libName",
|
|
16
|
-
pathToSlice: "./slices/libName",
|
|
17
|
-
fileName: "index",
|
|
18
|
-
extension: "js",
|
|
19
|
-
model: dummyModel,
|
|
20
|
-
screenshots: {},
|
|
21
|
-
mocks: mocks as unknown as SharedSliceContent[],
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
return {
|
|
25
|
-
dummyModel,
|
|
26
|
-
dummyModelVariationID,
|
|
27
|
-
dummySliceState,
|
|
28
|
-
};
|
|
29
|
-
};
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { describe, it } from "vitest";
|
|
2
|
-
import { testSaga } from "redux-saga-test-plan";
|
|
3
|
-
import { generateSliceScreenshotSaga } from "@src/modules/screenshots/sagas";
|
|
4
|
-
import { generateSliceScreenshotCreator } from "@src/modules/screenshots/actions";
|
|
5
|
-
import { generateSliceScreenshotApiClient } from "@src/apiClient";
|
|
6
|
-
import { openToasterCreator, ToasterType } from "@src/modules/toaster";
|
|
7
|
-
import SegmentClient from "analytics-node";
|
|
8
|
-
|
|
9
|
-
import { getSelectedSliceDummyData } from "./__testutils__/getSelectedSliceDummyData";
|
|
10
|
-
|
|
11
|
-
const { dummySliceState, dummyModelVariationID } = getSelectedSliceDummyData();
|
|
12
|
-
|
|
13
|
-
describe("[Selected Slice sagas]", () => {
|
|
14
|
-
describe("[generateSliceScreenshotSaga]", () => {
|
|
15
|
-
it("should call the api and dispatch the success action", async () => {
|
|
16
|
-
const screenDimensions = { width: 1200, height: 600 };
|
|
17
|
-
const saga = testSaga(
|
|
18
|
-
generateSliceScreenshotSaga,
|
|
19
|
-
generateSliceScreenshotCreator.request({
|
|
20
|
-
variationId: dummyModelVariationID,
|
|
21
|
-
component: dummySliceState,
|
|
22
|
-
screenDimensions,
|
|
23
|
-
method: "fromSimulator",
|
|
24
|
-
}),
|
|
25
|
-
);
|
|
26
|
-
|
|
27
|
-
saga.next().call(generateSliceScreenshotApiClient, {
|
|
28
|
-
libraryName: dummySliceState.from,
|
|
29
|
-
sliceId: dummySliceState.model.id,
|
|
30
|
-
variationId: dummyModelVariationID,
|
|
31
|
-
screenDimensions,
|
|
32
|
-
});
|
|
33
|
-
const response = {
|
|
34
|
-
url: "testScreenshotUrl",
|
|
35
|
-
errors: [],
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
saga.next(response).put(
|
|
39
|
-
openToasterCreator({
|
|
40
|
-
url: "testScreenshotUrl",
|
|
41
|
-
type: ToasterType.SCREENSHOT_CAPTURED,
|
|
42
|
-
}),
|
|
43
|
-
);
|
|
44
|
-
|
|
45
|
-
saga.next().put(
|
|
46
|
-
generateSliceScreenshotCreator.success({
|
|
47
|
-
screenshot: {
|
|
48
|
-
url: response.url,
|
|
49
|
-
},
|
|
50
|
-
component: dummySliceState,
|
|
51
|
-
variationId: dummyModelVariationID,
|
|
52
|
-
}),
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
saga.next().isDone();
|
|
56
|
-
|
|
57
|
-
// Wait for network request to be performed
|
|
58
|
-
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
59
|
-
expect(SegmentClient.prototype.track).toHaveBeenCalledOnce();
|
|
60
|
-
});
|
|
61
|
-
it("should open a error toaster on internal error", () => {
|
|
62
|
-
const screenDimensions = { width: 1200, height: 600 };
|
|
63
|
-
const saga = testSaga(
|
|
64
|
-
generateSliceScreenshotSaga,
|
|
65
|
-
generateSliceScreenshotCreator.request({
|
|
66
|
-
variationId: dummyModelVariationID,
|
|
67
|
-
component: dummySliceState,
|
|
68
|
-
screenDimensions,
|
|
69
|
-
method: "fromSimulator",
|
|
70
|
-
}),
|
|
71
|
-
).next();
|
|
72
|
-
|
|
73
|
-
saga.throw(new Error()).put(
|
|
74
|
-
openToasterCreator({
|
|
75
|
-
content: "Internal Error: Screenshot not saved",
|
|
76
|
-
type: ToasterType.ERROR,
|
|
77
|
-
}),
|
|
78
|
-
);
|
|
79
|
-
saga.next().isDone();
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
});
|
|
File without changes
|