slice-machine-ui 1.24.1-alpha.feat-disable-push-changes-with-git.1 → 1.24.1-alpha.feat-disable-push-changes-with-git.3
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/App/index.tsx +0 -2
- package/components/Changelog/index.tsx +29 -40
- package/components/Changelog/navigation/index.tsx +27 -23
- package/components/Changelog/versionDetails/{ReleaseNoteDetails.tsx → ReleaseNotesDetails.tsx} +5 -5
- package/components/Changelog/versionDetails/UpdateCommandBox.tsx +15 -11
- package/components/Changelog/versionDetails/VersionKindLabel.tsx +3 -2
- package/components/Changelog/versionDetails/index.tsx +17 -16
- package/components/Navigation/RunningVersion.tsx +14 -0
- package/components/Navigation/UpdateBox.tsx +16 -0
- package/components/Navigation/index.test.tsx +10 -35
- package/components/Navigation/index.tsx +14 -29
- package/components/ScreenshotChangesModal/VariationDropZone.tsx +18 -19
- package/lib/models/common/Environment.ts +0 -2
- package/out/404.html +1 -1
- package/out/_next/static/{xuVUCVxflC0RyiTkq5qed → 3e6nRUAimzMuaz5eEcgXv}/_buildManifest.js +1 -1
- package/out/_next/static/chunks/286-877cd7b96660f95f.js +1 -0
- package/out/_next/static/chunks/{727-c6c0c0d8c72c2676.js → 727-ffb4c69fbb971ed7.js} +1 -1
- package/out/_next/static/chunks/{904-c09e8a519129a3d8.js → 904-d9089efa6d974e3e.js} +1 -1
- package/out/_next/static/chunks/pages/{_app-701b914e9631b4cc.js → _app-4658217e4b01d5ad.js} +26 -26
- package/out/_next/static/chunks/pages/changelog-57289ca6bc99702b.js +1 -0
- package/out/_next/static/chunks/pages/{changes-1ef4fc53dccfdf6f.js → changes-515dc0829e5be3db.js} +1 -1
- package/out/_next/static/chunks/pages/{labs-773e5e6044d04247.js → labs-85d5c752dd5148b6.js} +1 -1
- package/out/_next/static/chunks/pages/settings-6f3e9b82e5b0aa79.js +1 -0
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/{[variation]-4cd51835ba731872.js → [variation]-89c911fd39271b5d.js} +1 -1
- package/out/_next/static/chunks/pages/{slices-e0ce615c38e8338d.js → slices-5dc0c55c386e047a.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/settings.html +1 -1
- 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 +3 -3
- package/src/apiClient.ts +0 -50
- package/src/features/changelog/useSliceMachineLatestNonBreakingVersion.ts +14 -0
- package/src/features/changelog/useSliceMachineReleaseNotes.ts +16 -0
- package/src/features/changelog/useSliceMachineVersions.ts +15 -0
- package/src/features/customTypes/customTypesBuilder/PageSnippetDialog/PageSnippetDialog.tsx +4 -6
- package/src/features/documentation/MarkdownRenderer/index.tsx +4 -6
- package/src/features/settings/git/GitProvider.ts +21 -21
- package/src/features/settings/git/GitProviderConnectButtons.tsx +5 -5
- package/src/hooks/useAdapterName.ts +4 -5
- package/src/hooks/useMarketingContent.ts +0 -3
- package/src/hooks/useSliceMachineRunningVersion.ts +14 -0
- package/src/hooks/useUpdateAvailable.ts +17 -0
- package/src/modules/environment/index.ts +2 -71
- package/src/modules/loading/types.ts +0 -2
- package/src/modules/useSliceMachineActions.ts +2 -11
- package/src/modules/userContext/index.ts +0 -19
- package/src/modules/userContext/types.ts +0 -4
- package/src/redux/saga.ts +0 -2
- package/test/src/modules/__fixtures__/serverState.ts +0 -13
- package/test/src/modules/environment.test.ts +0 -57
- package/test/src/modules/userContext.test.ts +0 -31
- package/lib/models/common/versions.ts +0 -39
- package/out/_next/static/chunks/286-ed90373e9a469944.js +0 -1
- package/out/_next/static/chunks/pages/changelog-cb1df3a70b20f1b8.js +0 -1
- package/out/_next/static/chunks/pages/settings-e404580aee7f138e.js +0 -1
- package/src/hooks/useChangelog.ts +0 -12
- package/test/pages/simulator.test.tsx +0 -332
- /package/out/_next/static/{xuVUCVxflC0RyiTkq5qed → 3e6nRUAimzMuaz5eEcgXv}/_ssgManifest.js +0 -0
|
@@ -17,10 +17,6 @@ const initialState: UserContextStoreType = {
|
|
|
17
17
|
onboarding: false,
|
|
18
18
|
advancedRepository: false,
|
|
19
19
|
},
|
|
20
|
-
updatesViewed: {
|
|
21
|
-
latest: null,
|
|
22
|
-
latestNonBreaking: null,
|
|
23
|
-
},
|
|
24
20
|
hasSeenTutorialsToolTip: false,
|
|
25
21
|
hasSeenSimulatorToolTip: false,
|
|
26
22
|
hasSeenChangesToolTip: false,
|
|
@@ -37,10 +33,6 @@ export const skipReviewCreator = createAction("USER_CONTEXT/SKIP_REVIEW")<{
|
|
|
37
33
|
reviewType: UserReviewType;
|
|
38
34
|
}>();
|
|
39
35
|
|
|
40
|
-
export const updatesViewedCreator = createAction("USER_CONTEXT/VIEWED_UPDATES")<
|
|
41
|
-
UserContextStoreType["updatesViewed"]
|
|
42
|
-
>();
|
|
43
|
-
|
|
44
36
|
export const hasSeenTutorialsToolTipCreator = createAction(
|
|
45
37
|
"USER_CONTEXT/VIEW_TUTORIALS_TOOL_TIP",
|
|
46
38
|
)();
|
|
@@ -60,7 +52,6 @@ export const changesPushSuccess = createAction(
|
|
|
60
52
|
type userContextActions = ActionType<
|
|
61
53
|
| typeof sendAReviewCreator
|
|
62
54
|
| typeof skipReviewCreator
|
|
63
|
-
| typeof updatesViewedCreator
|
|
64
55
|
| typeof hasSeenTutorialsToolTipCreator
|
|
65
56
|
| typeof hasSeenSimulatorToolTipCreator
|
|
66
57
|
| typeof hasSeenChangesToolTipCreator
|
|
@@ -75,10 +66,6 @@ export const getUserReview = (state: SliceMachineStoreType): UserReviewState =>
|
|
|
75
66
|
advancedRepository: false,
|
|
76
67
|
};
|
|
77
68
|
|
|
78
|
-
export const getUpdatesViewed = (
|
|
79
|
-
state: SliceMachineStoreType,
|
|
80
|
-
): UserContextStoreType["updatesViewed"] => state.userContext.updatesViewed;
|
|
81
|
-
|
|
82
69
|
export const userHasSeenTutorialsToolTip = (
|
|
83
70
|
state: SliceMachineStoreType,
|
|
84
71
|
): boolean => state.userContext.hasSeenTutorialsToolTip || false;
|
|
@@ -110,12 +97,6 @@ export const userContextReducer: Reducer<
|
|
|
110
97
|
[action.payload.reviewType]: true,
|
|
111
98
|
},
|
|
112
99
|
};
|
|
113
|
-
case getType(updatesViewedCreator): {
|
|
114
|
-
return {
|
|
115
|
-
...state,
|
|
116
|
-
updatesViewed: action.payload,
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
100
|
case getType(hasSeenTutorialsToolTipCreator): {
|
|
120
101
|
return {
|
|
121
102
|
...state,
|
|
@@ -7,10 +7,6 @@ export enum AuthStatus {
|
|
|
7
7
|
|
|
8
8
|
export type UserContextStoreType = {
|
|
9
9
|
userReview: UserReviewState;
|
|
10
|
-
updatesViewed: {
|
|
11
|
-
latest: string | null;
|
|
12
|
-
latestNonBreaking: string | null;
|
|
13
|
-
};
|
|
14
10
|
hasSeenTutorialsToolTip: boolean;
|
|
15
11
|
hasSeenSimulatorToolTip: boolean;
|
|
16
12
|
hasSeenChangesToolTip: boolean;
|
package/src/redux/saga.ts
CHANGED
|
@@ -2,11 +2,9 @@ import { fork } from "redux-saga/effects";
|
|
|
2
2
|
|
|
3
3
|
import { watchSimulatorSagas } from "@src/modules/simulator";
|
|
4
4
|
import { watchToasterSagas } from "@src/modules/toaster";
|
|
5
|
-
import { watchChangelogSagas } from "@src/modules/environment";
|
|
6
5
|
|
|
7
6
|
// Single entry point to start all Sagas at once
|
|
8
7
|
export default function* rootSaga() {
|
|
9
8
|
yield fork(watchSimulatorSagas);
|
|
10
9
|
yield fork(watchToasterSagas);
|
|
11
|
-
yield fork(watchChangelogSagas);
|
|
12
10
|
}
|
|
@@ -14,19 +14,6 @@ export const dummyServerState: Pick<
|
|
|
14
14
|
localSliceSimulatorURL: "http://localhost:3000/slice-simulator",
|
|
15
15
|
},
|
|
16
16
|
packageManager: "npm",
|
|
17
|
-
changelog: {
|
|
18
|
-
sliceMachine: {
|
|
19
|
-
currentVersion: "0.2.0",
|
|
20
|
-
latestNonBreakingVersion: "0.1.2",
|
|
21
|
-
updateAvailable: false,
|
|
22
|
-
versions: [],
|
|
23
|
-
},
|
|
24
|
-
adapter: {
|
|
25
|
-
name: "test-adapter",
|
|
26
|
-
updateAvailable: false,
|
|
27
|
-
versions: [],
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
17
|
endpoints: {
|
|
31
18
|
PrismicWroom: "https://prismic.io/",
|
|
32
19
|
PrismicAuthentication: "https://auth.prismic.io/",
|
|
@@ -2,13 +2,10 @@ import { describe, expect, it } from "vitest";
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
environmentReducer,
|
|
5
|
-
getChangelog,
|
|
6
|
-
getChangelogCreator,
|
|
7
5
|
refreshStateCreator,
|
|
8
6
|
} from "@src/modules/environment";
|
|
9
7
|
import { EnvironmentStoreType } from "@src/modules/environment/types";
|
|
10
8
|
import { dummyServerState } from "./__fixtures__/serverState";
|
|
11
|
-
import { SliceMachineStoreType } from "@src/redux/type";
|
|
12
9
|
|
|
13
10
|
const dummyEnvironmentState: EnvironmentStoreType = dummyServerState.env;
|
|
14
11
|
|
|
@@ -44,59 +41,5 @@ describe("[Environment module]", () => {
|
|
|
44
41
|
repo: "newUrl",
|
|
45
42
|
});
|
|
46
43
|
});
|
|
47
|
-
|
|
48
|
-
it("should update the environment state given CHANGELOG.RESPONSE action", () => {
|
|
49
|
-
const newChangeLog = {
|
|
50
|
-
sliceMachine: {
|
|
51
|
-
currentVersion: "1.0.0",
|
|
52
|
-
updateAvailable: true,
|
|
53
|
-
latestNonBreakingVersion: "0.1.2",
|
|
54
|
-
versions: [],
|
|
55
|
-
},
|
|
56
|
-
adapter: {
|
|
57
|
-
name: "test-adapter",
|
|
58
|
-
updateAvailable: true,
|
|
59
|
-
versions: [],
|
|
60
|
-
},
|
|
61
|
-
};
|
|
62
|
-
const action = getChangelogCreator.success({
|
|
63
|
-
changelog: newChangeLog,
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
expect(environmentReducer(dummyEnvironmentState, action)).toEqual({
|
|
67
|
-
...dummyEnvironmentState,
|
|
68
|
-
changelog: newChangeLog,
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
describe("[Selector]", () => {
|
|
74
|
-
it("returns the changelog currently in the store", () => {
|
|
75
|
-
const sliceMachineStore = {
|
|
76
|
-
environment: dummyEnvironmentState,
|
|
77
|
-
} as SliceMachineStoreType;
|
|
78
|
-
const result = getChangelog(sliceMachineStore);
|
|
79
|
-
expect(result).toEqual(dummyEnvironmentState.changelog);
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
it("returns the default changelog when there isn't one in the store", () => {
|
|
83
|
-
const sliceMachineStore = {
|
|
84
|
-
environment: {},
|
|
85
|
-
} as SliceMachineStoreType;
|
|
86
|
-
const result = getChangelog(sliceMachineStore);
|
|
87
|
-
expect(result).toEqual({
|
|
88
|
-
sliceMachine: {
|
|
89
|
-
currentVersion: "",
|
|
90
|
-
latestNonBreakingVersion: null,
|
|
91
|
-
updateAvailable: false,
|
|
92
|
-
versions: [],
|
|
93
|
-
},
|
|
94
|
-
adapter: {
|
|
95
|
-
name: "",
|
|
96
|
-
updateAvailable: false,
|
|
97
|
-
versions: [],
|
|
98
|
-
},
|
|
99
|
-
});
|
|
100
|
-
});
|
|
101
44
|
});
|
|
102
45
|
});
|
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
userContextReducer,
|
|
5
5
|
sendAReviewCreator,
|
|
6
6
|
skipReviewCreator,
|
|
7
|
-
updatesViewedCreator,
|
|
8
7
|
} from "@src/modules/userContext";
|
|
9
8
|
import { UserContextStoreType } from "@src/modules/userContext/types";
|
|
10
9
|
|
|
@@ -27,10 +26,6 @@ describe("[UserContext module]", () => {
|
|
|
27
26
|
onboarding: false,
|
|
28
27
|
advancedRepository: false,
|
|
29
28
|
},
|
|
30
|
-
updatesViewed: {
|
|
31
|
-
latest: null,
|
|
32
|
-
latestNonBreaking: null,
|
|
33
|
-
},
|
|
34
29
|
};
|
|
35
30
|
|
|
36
31
|
const action = sendAReviewCreator({
|
|
@@ -55,10 +50,6 @@ describe("[UserContext module]", () => {
|
|
|
55
50
|
onboarding: false,
|
|
56
51
|
advancedRepository: false,
|
|
57
52
|
},
|
|
58
|
-
updatesViewed: {
|
|
59
|
-
latest: null,
|
|
60
|
-
latestNonBreaking: null,
|
|
61
|
-
},
|
|
62
53
|
};
|
|
63
54
|
|
|
64
55
|
const action = skipReviewCreator({
|
|
@@ -75,27 +66,5 @@ describe("[UserContext module]", () => {
|
|
|
75
66
|
|
|
76
67
|
expect(userContextReducer(initialState, action)).toEqual(expectedState);
|
|
77
68
|
});
|
|
78
|
-
|
|
79
|
-
it("should update dismissedUpdate to the value of the update dismissed", () => {
|
|
80
|
-
// @ts-expect-error TS(2739) FIXME: Type '{ hasSendAReview: false;... Remove this comment to see the full error message
|
|
81
|
-
const initialState: UserContextStoreType = {
|
|
82
|
-
hasSendAReview: false,
|
|
83
|
-
updatesViewed: {
|
|
84
|
-
latest: null,
|
|
85
|
-
latestNonBreaking: null,
|
|
86
|
-
},
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
const versions = { latestNonBreaking: "0.1.0", latest: "1.0.0" };
|
|
90
|
-
|
|
91
|
-
const action = updatesViewedCreator(versions);
|
|
92
|
-
|
|
93
|
-
const expectedState = {
|
|
94
|
-
...initialState,
|
|
95
|
-
updatesViewed: versions,
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
expect(userContextReducer(initialState, action)).toEqual(expectedState);
|
|
99
|
-
});
|
|
100
69
|
});
|
|
101
70
|
});
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
export const VersionKind = {
|
|
2
|
-
MAJOR: "MAJOR",
|
|
3
|
-
MINOR: "MINOR",
|
|
4
|
-
PATCH: "PATCH",
|
|
5
|
-
FIRST: "FIRST",
|
|
6
|
-
} as const;
|
|
7
|
-
export type VersionKind = (typeof VersionKind)[keyof typeof VersionKind];
|
|
8
|
-
|
|
9
|
-
// Model built from Npm version number and GitHub release note
|
|
10
|
-
export interface PackageVersion {
|
|
11
|
-
versionNumber: string;
|
|
12
|
-
releaseNote: string | null;
|
|
13
|
-
kind: VersionKind | undefined;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// Release not fetch from GitHub
|
|
17
|
-
export interface ReleaseNote {
|
|
18
|
-
name: string;
|
|
19
|
-
body: string;
|
|
20
|
-
draft: boolean;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
type SliceMachinePackageChangelog = {
|
|
24
|
-
currentVersion: string;
|
|
25
|
-
latestNonBreakingVersion: string | null;
|
|
26
|
-
updateAvailable: boolean;
|
|
27
|
-
versions: PackageVersion[];
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
type AdapterPackageChangelog = {
|
|
31
|
-
name: string;
|
|
32
|
-
updateAvailable: boolean;
|
|
33
|
-
versions: string[];
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export interface PackageChangelog {
|
|
37
|
-
sliceMachine: SliceMachinePackageChangelog;
|
|
38
|
-
adapter: AdapterPackageChangelog;
|
|
39
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[286],{15836:function(e,n,r){"use strict";r.d(n,{Z:function(){return U}});var i,t=r(62230),s=r(85244),o=r(52322),a=r(2784),l=r(56580),c=r(75289),u=r(54132),d=r(951),x=r(75100),p=r(25812),h=r(77174),f=r(24340),v=r(90374),g=r(22710),m=r(99267),j=r(76473),b=r(75329),C=r(40432),y=function(e){var n=e.inputFile,r=e.handleFile,i=e.children,t=e.isDragActive;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(c.__,{htmlFor:"input-file",variant:"buttons.white",sx:{p:2,px:0,display:"flex",justifyContent:"center",width:200,alignItems:"center",flex:1},children:i||"Select file"}),(0,o.jsx)("input",{id:"input-file",type:"file",ref:n,style:{display:"none"},accept:b.nG.map(function(e){return"image/".concat(e)}).join(","),onChange:function(e){var n;r(null===(n=e.target.files)||void 0===n?void 0:n[0],t)}})]})},F=r(32665),E=r(3098),w=r(61931),S=r(67557),I=r(88932),D=r(82770);function k(e){return Z.apply(this,arguments)}function Z(){return(Z=(0,g.Z)(function(e){var n,r,i,o,a,l,c,u,d,x;return(0,m.__generator)(this,function(p){switch(p.label){case 0:n=e.variationId,r=e.slice,i=e.file,o=e.method,p.label=1;case 1:return p.trys.push([1,3,,4]),(a=new FormData).append("file",i),a.append("libraryName",r.from),a.append("sliceName",r.model.name),a.append("variationId",n),[4,(0,D.XQ)({libraryName:r.from,sliceId:r.model.id,variationId:n,file:i})];case 2:if(c=(l=p.sent()).errors,u=l.url,c.length>0)throw c;return D.Xe.track({event:"screenshot-taken",type:"custom",method:o}),[2,(0,s.Z)((0,t.Z)({},r),{screenshots:(0,s.Z)((0,t.Z)({},r.screenshots),(0,S.Z)({},n,{url:u}))})];case 3:return d=p.sent(),x="Screenshot not saved",console.error(x,d),I.Am.error(x),[3,4];case 4:return[2]}})})).apply(this,arguments)}var R,_=function(){return(0,o.jsx)(c.kC,{variant:"boxes.centered",sx:{p:2,position:"absolute",height:"100%",width:"100%",background:"rgba(249, 248, 249, 0.7)",backdropFilter:"blur(5px)",zIndex:"1",pointerEvents:"none"},children:(0,o.jsxs)(c.kC,{variant:"boxes.centered",sx:{border:"1px dashed #6E56CF",height:"100%",width:"100%",borderRadius:"4px"},children:[(0,o.jsx)(M,{isActive:!0}),(0,o.jsx)(c.xv,{sx:{my:2},children:"Drop file here"}),(0,o.jsx)(c.xv,{variant:"secondary",children:"Maximum upload size file: 128Mb"})]})})},M=function(e){var n=e.isActive;return(0,o.jsx)(c.kC,{sx:{p:1,borderRadius:"50%",bg:n?"#F1EEFE":"#EDECEE",alignItems:"center",justifyContent:"center",width:"48px",height:"48px"},children:(0,o.jsx)(d.IEK,{style:{color:n?"#6E56CF":"#6F6E77",fontSize:"34px"}})})},H=function(e){var n=e.variationID,r=e.slice,i=e.imageTypes,u=void 0===i?b.nG:i,d=e.onUploadSuccess,x=r.screenshots[n],p=(0,v.Z)().openToaster,h=(0,a.useState)(!1),f=h[0],S=h[1],I=(0,a.useState)(!1),D=I[0],Z=I[1];(0,j.y1)(["meta+v","ctrl+v"],function(){X()},[n,r,]);var R,H,O,z,A,L,T,N,V=(0,v.Z)().saveSliceCustomScreenshotSuccess,P=(0,l.v9)(function(e){return{isLoadingScreenshot:(0,F.hg)(e,E.z.GENERATE_SLICE_CUSTOM_SCREENSHOT)}}).isLoadingScreenshot,B=(O=(H={onHandleFile:(R=(0,g.Z)(function(e,i){var t,s;return(0,m.__generator)(this,function(o){switch(o.label){case 0:return[4,k({slice:r,file:e,method:i?"dragAndDrop":"upload",variationId:n})];case 1:return t=o.sent(),Z(!1),(s=null==t?void 0:t.screenshots[n])&&(V(n,s,t),d&&d(t)),[2]}})}),function(e,n){return R.apply(this,arguments)})}).onHandleFile,z=(0,a.useRef)(null),A=(0,g.Z)(function(e,n){return(0,m.__generator)(this,function(r){switch(r.label){case 0:if(!e)return[3,2];return[4,O(e,n)];case 1:r.sent(),(null==z?void 0:z.current)&&(z.current.value=""),r.label=2;case 2:return[2]}})}),{handleFile:L=function(e,n){return A.apply(this,arguments)},inputFile:z,FileInputRenderer:y,fileInputProps:{inputFile:z,handleFile:L}}),U=B.FileInputRenderer,W=B.fileInputProps,G=(T=(0,g.Z)(function(e){var i,t;return(0,m.__generator)(this,function(s){switch(s.label){case 0:if(e.size>128e6)return[2,p("File is too big. Max file size: 128Mb.",C.Jf.ERROR)];return[4,k({slice:r,file:e,method:"dragAndDrop",variationId:n})];case 1:return(t=null==(i=s.sent())?void 0:i.screenshots[n])&&(V(n,t,i),d&&d(i)),[2]}})}),function(e){return T.apply(this,arguments)}),q="function"==typeof navigator.clipboard.read,X=(N=(0,g.Z)(function(){var e,n,r,i,t;return(0,m.__generator)(this,function(s){switch(s.label){case 0:if(!q)return[2];s.label=1;case 1:return s.trys.push([1,5,,6]),[4,navigator.clipboard.read()];case 2:if(!(void 0!==(e=s.sent())[0])||!(void 0!==(n=e[0].types.find(function(e){return u.map(function(e){return"image/".concat(e)}).includes(e)}))))return[3,4];return[4,e[0].getType(n)];case 3:return r=s.sent(),i=new File([r],"file"),[2,G(i)];case 4:return[3,6];case 5:return t=s.sent(),console.error("Could not paste file",t),[3,6];case 6:return[2]}})}),function(){return N.apply(this,arguments)}),J=function(e){e.preventDefault(),S(!1);var n,r=null===(n=e.dataTransfer.files)||void 0===n?void 0:n[0];if(void 0!==r)return u.some(function(e){return"image/".concat(e)===r.type})?void G(r):p("Only files of type ".concat(u.join(", ")," are accepted."),C.Jf.ERROR)},K=function(e){return function(n){n.preventDefault(),S(e)}},Y=function(e){return function(n){n.preventDefault(),Z(e)}};return(0,o.jsxs)(c.kC,{as:"form",variant:"boxes.centered",sx:{bg:"#F9F8F9",position:"relative",borderRadius:"6px",height:"320px"},onDragEnter:K(!0),onDragLeave:K(!1),onDragOver:K(!0),onMouseEnter:Y(!0),onMouseLeave:Y(!1),onSubmit:function(e){return e.preventDefault()},onDrop:J,children:[P?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(c.$j,{}),(0,o.jsx)(c.xv,{sx:{my:2},children:"Uploading file ..."})]}):null,P||void 0===x?null:(0,o.jsx)(w.q,{src:x.url,sx:{width:"100%",height:"100%",maxHeight:"100%",backdropFilter:"blur(5px)"}}),P?null:(0,o.jsx)(c.kC,{sx:{p:2,position:"absolute",width:"100%",height:"100%",borderRadius:"6px",background:"#F9F8F9B2",justifyContent:"center",alignItems:"center",visibility:D||void 0===x?"visible":"hidden"},children:(0,o.jsx)(c.kC,{variant:"boxes.centered",sx:{border:"1px dashed #6E56CF",height:"100%",width:"100%",borderRadius:"4px"},children:(0,o.jsxs)(c.kC,{sx:{width:"100%",justifyContent:"center",alignItems:"center",flexDirection:"column"},children:[(0,o.jsx)(M,{isActive:f}),(0,o.jsx)(c.xv,{sx:{my:2},children:q?"Paste, drop or ...":"Drop or ..."}),(0,o.jsx)(U,(0,s.Z)((0,t.Z)({},W),{isDragActive:f})),(0,o.jsx)(c.xv,{sx:{color:"greyIcon",mt:1},children:"Maximum file size: 128Mb"})]})})}),f?(0,o.jsx)(_,{}):null]})},O=function(e){return(0,o.jsxs)("svg",(0,s.Z)((0,t.Z)({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[(0,o.jsxs)("g",{clipPath:"url(#clip0_5065_192538)",children:[(0,o.jsx)("path",{d:"M9.66862 19.9993C11.1406 19.9993 12.3353 18.8047 12.3353 17.3327V14.666H9.66862C8.19662 14.666 7.00195 15.8607 7.00195 17.3327C7.00195 18.8047 8.19662 19.9993 9.66862 19.9993Z",fill:"#0ACF83"}),(0,o.jsx)("path",{d:"M7.00195 12.0007C7.00195 10.5287 8.19662 9.33398 9.66862 9.33398H12.3353V14.6673H9.66862C8.19662 14.6673 7.00195 13.4727 7.00195 12.0007Z",fill:"#A259FF"}),(0,o.jsx)("path",{d:"M7.00195 6.66667C7.00195 5.19467 8.19662 4 9.66862 4H12.3353V9.33333H9.66862C8.19662 9.33333 7.00195 8.13867 7.00195 6.66667Z",fill:"#F24E1E"}),(0,o.jsx)("path",{d:"M12.334 4H15.0007C16.4727 4 17.6673 5.19467 17.6673 6.66667C17.6673 8.13867 16.4727 9.33333 15.0007 9.33333H12.334V4Z",fill:"#FF7262"}),(0,o.jsx)("path",{d:"M17.6673 12.0007C17.6673 13.4727 16.4727 14.6673 15.0007 14.6673C13.5287 14.6673 12.334 13.4727 12.334 12.0007C12.334 10.5287 13.5287 9.33398 15.0007 9.33398C16.4727 9.33398 17.6673 10.5287 17.6673 12.0007Z",fill:"#1ABCFE"})]}),(0,o.jsx)("defs",{children:(0,o.jsx)("clipPath",{id:"clip0_5065_192538",children:(0,o.jsx)("rect",{width:"10.6688",height:"16",fill:"white",transform:"translate(7 4)"})})})]}))};(R=i||(i={})).Mac="Mac",R.Linux="Linux",R.Windows="Windows";var z=function(){var e=navigator.userAgent,n=i.Linux;return Object.values(i).forEach(function(r){e.includes(r)&&(n=r)}),n},A=r(36416),L=r.n(A),T=function(e){var n=e.children;return(0,o.jsx)("kbd",{className:L().root,children:n})},N=function(){var e,n=[i.Windows,i.Linux].includes(z())?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(T,{children:"ctrl"})," + ",(0,o.jsx)(T,{children:"shift"})," + ",(0,o.jsx)(T,{children:"c"})]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(T,{children:"cmd"})," + ",(0,o.jsx)(T,{children:"shift"})," + ",(0,o.jsx)(T,{children:"c"})]});return(0,o.jsxs)(c.kC,{sx:{pl:"4px",alignItems:"center",color:"#000",borderRadius:"6px",fontSize:"12px",lineHeight:"24px",border:"1px solid #E4E2E4",boxShadow:"0px 1px 0px 0px rgba(0, 0, 0, 0.04)",width:"100%",minHeight:"40px"},children:[(0,o.jsx)(O,{}),(0,o.jsxs)("div",{children:["Use\xa0",n," to copy any frame as .png, then just paste it here"]})]})},V=function(e){var n=e.isValid;return(0,o.jsx)(c.kC,{sx:{p:2,border:"1px solid #E4E2E4",borderRadius:"6px",bg:"#FFF"},children:n?(0,o.jsx)(d.Ypm,{style:{fontSize:"16px"}}):(0,o.jsx)(x.j6O,{style:{fontSize:"16px",color:"#ED811C"}})})},P=function(e){var n=e.slice,r=e.onSelectVariation,i=e.variationSelector;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(c.X6,{as:"h4",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n.model.name}),(0,o.jsx)(c.xu,{children:(0,o.jsx)(c.xu,{as:"ul",sx:{pl:0,my:3},children:n.model.variations.map(function(e){var a=i.sliceID,l=i.variationID,u=a===n.model.id&&l===e.id;return(0,o.jsx)(c.xu,{as:"li",sx:(0,s.Z)((0,t.Z)({listStyle:"none",my:2,p:2,cursor:"pointer",borderRadius:"4px"},u&&{bg:"#EDECEE",fontWeight:"500"}),{":hover":{bg:"#EDECEE"}}),onClick:function(){return r({sliceID:n.model.id,variationID:e.id})},children:(0,o.jsxs)(c.kC,{sx:{alignItems:"center"},children:[(0,o.jsx)(V,{isValid:!!n.screenshots[e.id]}),(0,o.jsx)(c.xv,{sx:{ml:2},children:e.name})]})},"".concat(n.model.id,"-").concat(e.id))})})})]})},B=function(e,n){return e||(n.length?{sliceID:n[0].model.id,variationID:n[0].model.variations[0].id}:void 0)},U=function(e){var n=e.slices,r=e.defaultVariationSelector,i=e.onUploadSuccess,t=(0,v.Z)().closeModals,s=(0,l.v9)(function(e){return{isOpen:(0,h.gP)(e,f.q.SCREENSHOTS)}}).isOpen,d=(0,a.useState)(B(r,n)),x=d[0],g=d[1];if((0,a.useEffect)(function(){g(B(r,n))},[null==r?void 0:r.sliceID,null==r?void 0:r.variationID,s,]),0===n.length||!x)return null;var m,j="function"==typeof navigator.clipboard.read;return(0,o.jsx)(p.Z,{isOpen:s,shouldCloseOnOverlayClick:!0,onRequestClose:function(){return t()},children:(0,o.jsx)(u.Z,{radius:"0px",bodySx:{p:0,bg:"#FFF",position:"relative"},sx:{border:"none"},Header:function(e){var n=e.radius;return(0,o.jsxs)(c.kC,{sx:{position:"sticky",top:0,zIndex:1,background:"gray",p:"16px",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:n,borderTopRightRadius:n,borderBottom:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.borders))}},children:[(0,o.jsx)(c.X6,{sx:{fontSize:"20px"},children:"Slice screenshots"}),(0,o.jsx)(c.x8,{type:"button",onClick:function(){return t()}})]})},Footer:null,children:(0,o.jsxs)(c.xu,{sx:{display:"flex",flexWrap:"wrap",height:"100%"},children:[(0,o.jsx)(c.xu,{sx:{p:3,bg:"grey07",flexGrow:1,overflow:"auto",maxHeight:"100%",flexBasis:"sidebar"},children:n.map(function(e,n){return(0,o.jsx)(P,{slice:e,variationSelector:x,onSelectVariation:g},"".concat(e.model.id,"-").concat(n))})}),(0,o.jsxs)(c.kC,{as:"main",sx:{p:3,flexGrow:99999,flexBasis:0,flexDirection:"column",minWidth:320,gap:"8px"},children:[j?(0,o.jsx)(N,{}):void 0,(m=n.find(function(e){return e.model.id===x.sliceID}))?(0,o.jsx)(H,{variationID:x.variationID,slice:m,onUploadSuccess:i}):null]})]})})})}},61931:function(e,n,r){"use strict";r.d(n,{q:function(){return c}});var i=r(62230),t=r(52322),s=r(2784),o=r(75289),a=r(65186),l=(0,s.memo)(function(e){var n=e.src;return(0,t.jsx)(o.Ee,{src:n,alt:"Preview image",sx:{maxHeight:"100%"}})}),c=function(e){var n=e.src,r=e.sx;return(0,t.jsx)(o.kC,{sx:(0,i.Z)({position:"relative",alignItems:"center",justifyContent:"center",overflow:"hidden",backgroundImage:"url(/pattern.png)",backgroundColor:"headSection",backgroundRepeat:"repeat",backgroundSize:"20px",borderRadius:"4px"},r),children:void 0!==n?(0,t.jsx)(l,{src:n}):(0,t.jsxs)(o.xv,{sx:{display:"flex",flexDirection:"column",alignItems:"center"},children:[(0,t.jsx)(a.eJU,{}),"You have no screenshot yet."]})})}},47731:function(e,n,r){"use strict";r.d(n,{H:function(){return s}});var i=r(2784),t=r(90374),s=function(){var e=(0,t.Z)().openScreenshotsModal,n=(0,i.useState)({sliceFilterFn:function(e){return e}}),r=n[0],s=n[1];return{modalPayload:r,onOpenModal:function(n){s(n),e()}}}},36416:function(e){e.exports={root:"Kbd_root__nBos2"}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[477],{37782:function(e,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/changelog",function(){return r(57825)}])},39576:function(e,n,r){"use strict";r.d(n,{Z:function(){return d}});var i=r(62230),s=r(52322);r(2784);var t=r(59326),a=r(75289),o=r(61183),c=function(e){return{subLanguage:"xml",contains:[e.COMMENT("<!--","-->",{relevance:10}),{begin:/^(\s*)(<script(\s*context="module")?>)/gm,end:/^(\s*)(<\/script>)/gm,subLanguage:"javascript",excludeBegin:!0,excludeEnd:!0,contains:[{begin:/^(\s*)(\$:)/gm,end:/(\s*)/gm,className:"keyword"},]},{begin:/^(\s*)(<style.*>)/gm,end:/^(\s*)(<\/style>)/gm,subLanguage:"css",excludeBegin:!0,excludeEnd:!0},{begin:/\{/gm,end:/\}/gm,subLanguage:"javascript",contains:[{begin:/[\{]/,end:/[\}]/,skip:!0},{begin:/([#:\/@])(if|else|each|await|then|catch|debug|html)/gm,className:"keyword",relevance:10},]},]}};o.Z.registerLanguage("svelte",c);var l=["javascript","bash","xml","html","json"],d=function(e){var n,r=e.children,c=e.lang,d=e.sx,g=e.codeStyle,x=e.codeClass,p=e.Header,u=(0,t.B7)().theme,h=c?o.Z.highlight(r,{language:"vue"===c?"html":c}).value:o.Z.highlightAuto(r,l).value;return(0,s.jsxs)(a.kC,{as:"pre",sx:d,children:[p?(0,s.jsx)(p,{}):null,(0,s.jsx)("code",{className:"hljs".concat(x?" ".concat(x):""),style:(0,i.Z)({overflowX:"auto",padding:"3px 5px",borderRadius:"6px",border:"1px solid",borderColor:String(null===(n=u.colors)||void 0===n?void 0:n.textClear)},g),dangerouslySetInnerHTML:{__html:h}})]})}},57825:function(e,n,r){"use strict";r.r(n),r.d(n,{default:function(){return H}});var i,s,t=r(52322),a=r(97729),o=r.n(a),c=r(22715),l=r(65077),d=r(75289),g=r(56580),x=r(39092),p=r(2784),u=r(62230),h=r(12170),v=function(e){var n=e.type,r=e.hasUpToDateVersions;return(0,t.jsx)(d.xv,{sx:(0,u.Z)({padding:"0px 4px",borderRadius:"2px",fontSize:"8px",fontWeight:600,lineHeight:"16px",textTransform:"uppercase"},(n===i.Latest||n===i.LatestNonBreaking)&&{bg:"grey02",color:"code.gray"},n===i.Current&&r&&{bg:"lightGreen",color:"code.green"},n===i.Current&&!r&&{bg:"lightOrange",color:"code.orange"}),children:n})},f=function(e){var n=e.isSelected,r=e.onClick,i=e.versionNumber,s=e.tags,a=e.hasUpToDateVersions;return(0,t.jsxs)(d.kC,{sx:(0,u.Z)({p:1,borderRadius:"4px",cursor:"pointer",transition:"200ms all",justifyContent:"space-between",alignItems:"center"},n?{color:"purple",bg:(0,h.DZ)("purple",.95)}:{"&:hover":{bg:"grey01"}}),onClick:r,children:[(0,t.jsx)(d.xv,{children:i}),(0,t.jsx)(d.kC,{sx:{gap:"8px"},children:s.map(function(e){return(0,t.jsx)(v,{type:e,hasUpToDateVersions:a},e)})})]})};(s=i||(i={})).Latest="LATEST",s.LatestNonBreaking="LATEST-NON-BREAKING",s.Current="CURRENT";var m=function(e){var n,r=e.changelog,s=e.selectedVersion,a=e.selectVersion,o=function(e){var n=[];return e===l?n.push(i.Latest):e===r.sliceMachine.latestNonBreakingVersion&&n.push(i.LatestNonBreaking),e===r.sliceMachine.currentVersion&&n.push(i.Current),n},l=null===(n=r.sliceMachine.versions[0])||void 0===n?void 0:n.versionNumber,g=!r.adapter.updateAvailable&&!r.sliceMachine.updateAvailable;return(0,t.jsxs)(d.kC,{sx:{minWidth:"228px",borderRight:"1px dashed",borderColor:c.TV.color.greyLight6,flexDirection:"column",paddingRight:"48px"},children:[(0,t.jsxs)(d.kC,{sx:{flexDirection:"column",borderBottom:"1px dashed",borderColor:c.TV.color.greyLight6,paddingBottom:"28px"},children:[(0,t.jsx)(d.xv,{sx:{fontSize:"20px",fontWeight:500,lineHeight:"32px"},children:"Changelog"}),(0,t.jsx)(d.xv,{sx:{fontSize:"16px",fontWeight:500,lineHeight:"24px",marginTop:"28px"},children:"All versions"})]}),(0,t.jsx)(d.kC,{sx:{mt:"24px",flexDirection:"column",gap:"4px",overflow:"auto"},children:r.sliceMachine.versions.map(function(e,n){return(0,t.jsx)(f,{isSelected:(null==s?void 0:s.versionNumber)===e.versionNumber,onClick:function(){return a(e)},versionNumber:e.versionNumber,tags:o(e.versionNumber),hasUpToDateVersions:g},"versionBadge-".concat(e.versionNumber,"-").concat(n))})})]})},b={MAJOR:"MAJOR",MINOR:"MINOR",PATCH:"PATCH",FIRST:"FIRST"},j=function(e){var n=e.versionKind,r=(0,u.Z)({fontSize:"14px",padding:"2px 4px",borderRadius:"4px",textTransform:"uppercase"},n===b.MAJOR?{color:"purple",bg:(0,h.DZ)("purple",.85)}:{color:"grey05",bg:"grey02"});return(0,t.jsx)(d.xv,{sx:r,children:n})},k=r(19870),C=function(e){var n=e.releaseNote;return(0,t.jsx)(d.xv,{sx:{"h1, h2, h3":{fontSize:"16px",fontWeight:600,lineHeight:"20px"},p:{fontSize:"14px",fontWeight:400,lineHeight:"20px"},b:{fontSize:"14px",fontWeight:600,lineHeight:"20px"},code:{color:"code.orange"},li:{listStyleType:"disc",marginLeft:"25px",paddingLeft:"5px"}},dangerouslySetInnerHTML:{__html:k.TU.parse(n)}})},N=r(951),y=r(39576),T=function(e){var n,r,i,s,a,o=e.changelog,c=e.selectedVersion,l=e.packageManager,g=c.versionNumber===o.sliceMachine.versions[0].versionNumber,x=(n={sliceMachineVersionToInstall:g?"latest":c.versionNumber,isLatestSliceMachineVersion:g,adapterName:o.adapter.name},r=n.sliceMachineVersionToInstall,i=n.isLatestSliceMachineVersion,s=n.adapterName,a=["slice-machine-ui@".concat(r)],i&&a.push("".concat(s,"@latest")),a),p=function(e,n){var r=n.join(" ");switch(e){case"bun":return"bun add --development ".concat(r);case"npm":return"npm install --save-dev ".concat(r);case"pnpm":case"pnpm@6":return"pnpm add --save-dev ".concat(r);case"yarn":case"yarn@berry":return"yarn add --dev ".concat(r)}}(l,x),u=o.adapter.updateAvailable&&!o.sliceMachine.updateAvailable;return(0,t.jsxs)(t.Fragment,{children:[u&&g&&(0,t.jsxs)(d.kC,{sx:{padding:"16px",bg:"lightOrange",color:"darkOrange",fontSize:"13px",lineHeight:"24px",borderRadius:"4px",gap:"16px"},children:[(0,t.jsx)(N.CSE,{size:"24px"}),"It looks like you are using an outdated version of the adapter. Run this command to update your adapter:"]}),(0,t.jsxs)(d.kC,{sx:{flexDirection:"column",gap:"16px",padding:"16px",bg:"grey01"},children:[(0,t.jsx)(d.xv,{sx:{fontSize:"16px",fontWeight:500,lineHeight:"20px"},children:"How to install"}),(0,t.jsxs)(d.kC,{sx:{gap:"8px"},children:[(0,t.jsx)(y.Z,{codeStyle:{color:"white",flex:1,padding:"8px"},sx:{flex:1},children:p}),(0,t.jsx)(d.zx,{variant:"secondary",onClick:function(){navigator.clipboard.writeText(p)},children:"Copy"})]})]})]})},S=function(){return(0,t.jsxs)("div",{children:["Could not fetch release notes."," ",(0,t.jsx)("a",{href:"https://github.com/prismicio/slice-machine/releases",target:"_blank",rel:"noopener noreferrer",children:"Find out more on GitHub"})]})},M=function(e){var n,r=e.changelog,i=e.selectedVersion,s=e.packageManager;return(0,t.jsxs)(d.kC,{sx:{flexDirection:"column"},children:[(0,t.jsxs)(d.kC,{sx:{padding:"0px 0px 32px 32px",borderBottom:"1px dashed",borderColor:c.TV.color.greyLight6,justifyContent:"space-between",alignItems:"center"},children:[(0,t.jsx)(d.xv,{sx:{fontSize:"24px",fontWeight:600,lineHeight:"32px"},children:"Version ".concat(i.versionNumber)}),!!i.kind&&(0,t.jsx)(j,{versionKind:i.kind})]}),(0,t.jsxs)(d.kC,{sx:{flexDirection:"column",padding:"24px 0px 0px 32px",gap:"24px"},children:[(null===(n=i.releaseNote)||void 0===n?void 0:n.includes("# Breaking Change"))&&(0,t.jsxs)(d.kC,{sx:{padding:"16px",bg:"lightOrange",color:"darkOrange",fontSize:"13px",lineHeight:"24px",borderRadius:"4px",gap:"16px"},"data-testid":"breaking-changes-warning",children:[(0,t.jsx)(N.CSE,{size:"24px"}),"This update includes breaking changes. To update correctly, follow the steps below."]}),(0,t.jsx)(T,{changelog:r,selectedVersion:i,packageManager:s}),(null==i?void 0:i.releaseNote)?(0,t.jsx)(C,{releaseNote:i.releaseNote}):(0,t.jsx)(S,{})]})]})},L=r(32665),V=r(3098),R=r(22840);function w(){var e=(0,g.v9)(function(e){return{changelog:(0,x.Sx)(e),packageManager:(0,x.Ak)(e),isChangelogLoading:(0,L.hg)(e,V.z.CHANGELOG)}}),n=e.changelog,r=e.packageManager,i=e.isChangelogLoading,s=n.sliceMachine.versions[0],a=(0,p.useState)(s||void 0),o=a[0],u=a[1];(0,p.useEffect)(function(){u(s)},[s]);var h=0===n.sliceMachine.versions.length||!o;return(0,t.jsx)(R.LN,{children:(0,t.jsx)(R.RN,{children:(0,t.jsx)(l.xR,{sx:{display:"flex",minWidth:0},children:i?(0,t.jsx)(c._3,{}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(m,{changelog:n,selectedVersion:o,selectVersion:function(e){return u(e)}}),h?(0,t.jsx)(d.kC,{sx:{paddingLeft:"32px"},children:(0,t.jsx)(S,{})}):(0,t.jsx)(M,{changelog:n,selectedVersion:o,packageManager:r})]})})})})}function H(){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o(),{children:(0,t.jsx)("title",{children:"Changelog - Slice Machine"})}),(0,t.jsx)(w,{})]})}}},function(e){e.O(0,[898,183,870,774,888,179],function(){return e(e.s=37782)}),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[662],{24994:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/settings",function(){return t(27236)}])},27236:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return ep}});var r=t(52322),i=t(22715),o=t(97729),c=t.n(o),s=t(5632),l=t(2784),a=t(22840),u=t(37792),d=t(62230),h=t(85244),x=t(98240),f=t(88921),p=t.n(f),_=function(e){return(0,r.jsx)("div",(0,h.Z)((0,d.Z)({},e),{className:p().root}))},m=function(e){var n=e.children,t=(0,x.Z)(e,["children"]);return(0,r.jsx)("div",(0,h.Z)((0,d.Z)({},t),{className:p().legend,children:(0,r.jsx)(i.xv,{color:"grey11",component:"span",noWrap:!0,variant:"smallBold",children:n})}))},g=function(e){return(0,r.jsx)("div",(0,h.Z)((0,d.Z)({},e),{className:p().header}))},j=function(e){return(0,r.jsx)("div",(0,h.Z)((0,d.Z)({},e),{className:p().content}))},v=function(e){return(0,r.jsx)("div",(0,h.Z)((0,d.Z)({},e),{className:p().list}))},w=function(e){var n=e.action,t=e.children,o=(0,x.Z)(e,["action","children"]);return(0,r.jsxs)("div",(0,h.Z)((0,d.Z)({},o),{className:p().listItem,children:[(0,r.jsx)(i.xv,{className:p().listItemText,component:"span",noWrap:!0,variant:"bold",children:t}),n]}))},y=function(e){var n=e.action,t=e.children,o=(0,x.Z)(e,["action","children"]);return(0,r.jsxs)("div",(0,h.Z)((0,d.Z)({},o),{className:p().footer,children:[(0,r.jsx)(i.xv,{className:p().footerText,color:"grey11",component:"span",noWrap:!0,variant:"small",children:t}),n]}))},C=function(e){var n=e.title,t=e.description,o=e.action;return(0,r.jsxs)(i.xu,{flexDirection:"column",padding:{block:72,inline:100},children:[(0,r.jsx)(i.xv,{align:"center",variant:"emphasized",children:n}),(0,r.jsx)(i.xv,{align:"center",color:"grey11",children:t}),Boolean(o)?(0,r.jsx)(i.hE,{sx:{alignSelf:"center",marginTop:8},children:o}):void 0]})},S=t(22710),b=t(99267),k=t(98863),Z=t(88932),F=function(e){return(0,r.jsx)("svg",(0,h.Z)((0,d.Z)({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.77596 5.47599C4.84147 5.44648 4.91265 5.43167 4.9845 5.4326L19.3525 5.43506C19.4243 5.43413 19.4955 5.44894 19.561 5.47845C19.6265 5.50796 19.6848 5.55146 19.7317 5.60588C19.7786 5.6603 19.8131 5.72433 19.8326 5.79348C19.8521 5.86262 19.8563 5.93521 19.8448 6.00614L19.1802 10.0751H9.71803L10.5722 14.6018H11.1162L11.1162 14.6018H13.7846L14.56 10.0751H19.1803L17.7575 18.8357C17.7387 18.9522 17.6786 19.058 17.5882 19.1339C17.4979 19.2098 17.3832 19.2507 17.2652 19.2492H7.23692C7.2134 19.249 7.19001 19.2476 7.16682 19.2449C7.03392 19.2298 6.90803 19.175 6.80603 19.0868C6.68704 18.9851 6.60772 18.8448 6.58203 18.6904L4.49219 6.00367C4.48069 5.93275 4.48485 5.86016 4.50438 5.79102C4.52392 5.72187 4.55835 5.65784 4.60527 5.60342C4.65218 5.54899 4.71044 5.5055 4.77596 5.47599Z",fill:"currentColor"})}))},L=function(e){return(0,r.jsx)("svg",(0,h.Z)((0,d.Z)({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:(0,r.jsx)("path",{d:"M12 4C7.57486 4 4 7.57486 4 12C4 15.5246 6.30057 18.5257 9.47429 19.6C9.87429 19.6754 10.0251 19.4251 10.0251 19.2251V17.8754C7.8 18.3497 7.32457 16.8 7.32457 16.8C6.94971 15.8743 6.42514 15.6251 6.42514 15.6251C5.70057 15.1246 6.47543 15.1497 6.47543 15.1497C7.27543 15.2 7.69943 15.9749 7.69943 15.9749C8.42514 17.2 9.57486 16.8503 10.0251 16.6491C10.1006 16.1246 10.2994 15.7749 10.5246 15.5749C8.74971 15.3749 6.87543 14.6754 6.87543 11.6251C6.87543 10.7497 7.17486 10.0503 7.69943 9.47543C7.62514 9.27543 7.34971 8.45029 7.77486 7.34971C7.77486 7.34971 8.44914 7.12457 9.97486 8.17486C10.6266 7.99627 11.2991 7.90405 11.9749 7.90057C12.6491 7.90057 13.3497 8 13.9749 8.17486C15.5006 7.14971 16.1749 7.34971 16.1749 7.34971C16.6 8.45029 16.3246 9.27543 16.2503 9.47543C16.776 10.024 17.0754 10.7497 17.0754 11.624C17.0754 14.6994 15.2 15.3749 13.4251 15.5749C13.6994 15.8251 13.9749 16.2994 13.9749 17.0491V19.2503C13.9749 19.4754 14.1246 19.7246 14.5246 19.6251C17.7006 18.5246 20 15.5246 20 12C20 7.57486 16.4251 4 12 4Z",fill:"currentColor"})}))},N=function(e){return(0,r.jsx)("svg",(0,h.Z)((0,d.Z)({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.7881 10.5954L16.5431 5.20756C16.6328 4.93081 17.0594 4.93081 17.1492 5.20756L18.9076 10.5954H14.7881ZM6.6192 5.20756L4.86353 10.5954H8.97968L7.22468 5.20756C7.1349 4.93081 6.70898 4.93081 6.6192 5.20756ZM4.0299 13.2981L4.86352 10.5954H4.86353H8.979H14.7881H18.9076L19.7392 13.2981C19.7796 13.4207 19.7802 13.553 19.7408 13.676C19.7014 13.799 19.624 13.9063 19.5198 13.9826L11.893 19.5257L11.8879 19.5319L11.8923 19.5378L11.8865 19.5336L11.8835 19.5371L11.8852 19.5326L4.24927 13.9826C4.0299 13.8246 3.95092 13.5458 4.0299 13.2981Z",fill:"currentColor"})}))},T=t(81038),I={gitHub:{connect:(0,S.Z)(function(){var e,n;return(0,b.__generator)(this,function(t){switch(t.label){case 0:return[4,T.j.git.createGitHubAuthState()];case 1:return e=t.sent(),(n=new URL("https://github.com/apps/".concat("prismic-io","/installations/new"))).searchParams.set("state",e.key),window.open(n,"git-hub-app-installation"),[2]}})}),Icon:L,name:"GitHub",supported:!0},bitbucket:{connect:function(){throw Error("Not implemented.")},Icon:F,name:"Bitbucket",supported:!1},gitLab:{connect:function(){throw Error("Not implemented.")},Icon:N,name:"GitLab",supported:!1}},R=function(){return(0,r.jsx)(i.hE,{children:(0,k.XP)(I).map(function(e){return(0,r.jsx)(P,{provider:e,sx:{flexBasis:0,flexGrow:1}},e)})})},P=function(e){var n=e.provider,t=e.sx,o=I[n],c=o.connect,s=o.Icon,a=o.name,u=o.supported,d=(0,l.useState)(!1),h=d[0],x=d[1];return(0,r.jsxs)(i.zx,{color:"grey",disabled:!u,loading:h,onClick:function(){(0,S.Z)(function(){var e,n;return(0,b.__generator)(this,function(t){switch(t.label){case 0:x(!0),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,c()];case 2:return t.sent(),[3,4];case 3:return e=t.sent(),n="Could not connect to ".concat(a),console.error(n,e),Z.Am.error(n),x(!1),[3,4];case 4:return[2]}})})()},renderStartIcon:function(){return(0,r.jsx)(s,{color:i.TV.color.greyLight11})},sx:t,children:[a,u?void 0:(0,r.jsx)(i.xv,{color:"inherit",variant:"small",children:" (soon)"})]})},q=t(81541),A=function(e){var n=e.date,t=(0,x.Z)(e,["date"]);return(0,r.jsx)(i.xv,(0,h.Z)((0,d.Z)({},t),{color:"inherit",variant:"inherit",children:function(e){var n,t,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Date;return G.format((n=e,t=o,r=H(n),i=H(t),Math.round((+r-+i)/864e5)),"day")}(n)}))},G=new Intl.RelativeTimeFormat("en",{numeric:"auto",style:"narrow"});function H(e){var n=new Date(e);return n.setHours(0,0,0,0),n}var D=t(63397),E=t(17064),M=t(19334),z=t(9979),B=function(e){var n,t,o,c,s=e.linkRepo,l=e.repo,a=e.trigger,u=I[l.provider],d=(n={git:l},t=(0,E.Z)((0,M.f)(),1)[0],{updateToken:(o=(0,S.Z)(function(e){return(0,b.__generator)(this,function(r){switch(r.label){case 0:return[4,T.j.git.updateWriteAPIToken({prismic:{domain:t.repositoryName},git:n.git,token:e})];case 1:return r.sent(),[2]}})}),function(e){return o.apply(this,arguments)})}).updateToken,h=(0,z.U)().repositoryUrl;return(0,r.jsxs)(i.Vq,{size:{width:448,height:"auto"},trigger:a,children:[(0,r.jsx)(i.fK,{title:"Prismic Write API token required"}),(0,r.jsx)(i.cZ,{children:(0,r.jsx)(D.J9,{initialValues:{writeAPIToken:""},validate:function(e){if(0===e.writeAPIToken.length)return{writeAPIToken:"Cannot be empty"}},onSubmit:(c=(0,S.Z)(function(e){var n,t;return(0,b.__generator)(this,function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),[4,s(l)];case 1:return r.sent(),[4,d(e.writeAPIToken)];case 2:return r.sent(),[3,4];case 3:return n=r.sent(),t="Could not connect to ".concat(l.name),console.error(t,n),Z.Am.error(t),[3,4];case 4:return[2]}})}),function(e){return c.apply(this,arguments)}),children:function(e){return(0,r.jsxs)("form",{onSubmit:e.handleSubmit,children:[(0,r.jsxs)(i.xu,{flexDirection:"column",gap:4,padding:16,children:[(0,r.jsx)(i.yt,{disabled:e.isSubmitting,error:"string"==typeof e.errors.writeAPIToken,label:"Paste your Write API token",onValueChange:function(n){e.setFieldValue("writeAPIToken",n)},placeholder:"Write API token",value:e.values.writeAPIToken}),(0,r.jsxs)(i.xv,{color:"grey11",children:["Required to sync models from ",u.name," to Prismic."]})]}),(0,r.jsx)(i.kX,{cancel:{text:"Cancel"},link:(0,r.jsx)(i.hh,{href:new URL("/settings/apps",h).href,children:"Create a Prismic Write API token"}),ok:{disabled:!e.isValid,loading:e.isSubmitting,onClick:function(){e.submitForm()},text:"Save Token"},size:"medium"})]})}})})]})},O=function(e){var n=e.repo,t=e.trigger,o=e.unlinkRepo,c=(0,l.useState)(!1),s=c[0],a=c[1];return(0,r.jsxs)(i.Vq,{size:{width:448,height:"auto"},trigger:t,children:[(0,r.jsx)(i.fK,{title:"Remove Git Connection"}),(0,r.jsx)(i.cZ,{children:(0,r.jsx)(i.xu,{flexDirection:"column",padding:16,children:(0,r.jsx)(i.xv,{children:"You will not be able to push your code alongside your models anymore. Note that you can reconnect your Git repository at any time. Are you sure you want to continue?"})})}),(0,r.jsx)(i.kX,{asFooter:!0,cancel:{text:"Cancel"},ok:{color:"tomato",loading:s,onClick:function(){(0,S.Z)(function(){var e,t;return(0,b.__generator)(this,function(r){switch(r.label){case 0:a(!0),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,o(n)];case 2:return r.sent(),[3,4];case 3:return e=r.sent(),t="Could not disconnect from ".concat(n.name),console.error(t,e),Z.Am.error(t),[3,4];case 4:return a(!1),[2]}})})()},text:"Disconnect"},size:"medium"})]})},V=t(75499),W=function(e){var n=e.mode,t=e.repos,o=(0,V.G)(),c=o.linkRepo,s=o.unlinkRepo;return(0,r.jsx)(v,{children:"link"===n?t.map(function(e){return(0,r.jsxs)(w,{action:(0,r.jsx)(B,{linkRepo:c,repo:e,trigger:(0,r.jsx)(i.zx,{color:"grey",children:"Connect"})}),children:[e.name,(0,r.jsxs)(i.xv,{color:"grey11",children:[" • ",(0,r.jsx)(A,{date:e.pushedAt})]})]},"".concat(e.provider,"@").concat(e.id))}):t.map(function(e){return(0,r.jsx)(w,{action:(0,r.jsx)(O,{repo:e,trigger:(0,r.jsx)(i.zx,{color:"grey",children:"Disconnect"}),unlinkRepo:s}),children:e.name},"".concat(e.provider,"@").concat(e.owner,"/").concat(e.name))})})},Q=function(){return(0,r.jsx)(v,{children:(0,q.Z)([,,,,].keys()).map(function(e){return(0,r.jsx)(w,{action:(0,r.jsx)(i.Od,{height:32,width:67.59}),children:(0,r.jsx)(i.Od,{height:24,sx:{verticalAlign:"middle"},width:129.92})},e)})})},K=function(e){var n=e.disabled,t=e.owners,o=void 0===t?[]:t,c=e.selectedOwner,s=e.onSelectedOwnerChange,l=e.sx;return(0,r.jsx)(i.Ph,{color:"grey",constrainContentWidth:!0,disabled:n,flexContent:!0,onValueChange:function(e){var n,t=(0,E.Z)((n=e,n.split("@")),2),r=t[0],i=t[1],c=o.find(function(e){return e.provider===r&&e.id===i});c&&(null==s||s(c))},placeholder:"Owner",renderStartIcon:function(){return(0,r.jsx)(U,{owner:c})},size:"large",sx:l,value:c?X(c):void 0,children:o.map(function(e){return(0,r.jsx)(i.Ql,{renderStartIcon:function(){return(0,r.jsx)(U,{owner:e})},size:"large",value:X(e),children:e.name},X(e))})})},U=function(e){var n,t=e.owner,o=I[null!==(n=null==t?void 0:t.provider)&&void 0!==n?n:"gitHub"].Icon;return(0,r.jsx)(o,{color:i.TV.color.greyLight11})};function X(e){return"".concat(e.provider,"@").concat(e.id)}var J=t(17329);function Y(e,n,t,r){return $.apply(this,arguments)}function $(){return($=(0,S.Z)(function(e,n,t,r){return(0,b.__generator)(this,function(i){switch(i.label){case 0:return[4,T.j.git.fetchRepos({provider:e,owner:n,query:t,page:r})];case 1:return[2,i.sent()]}})})).apply(this,arguments)}var ee=function(e){var n=e.owners,t=(0,l.useState)(n[0]),i=t[0],o=t[1];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(g,{children:(0,r.jsx)(K,{owners:n,selectedOwner:i,onSelectedOwnerChange:o,sx:{width:"calc(50% - 8px)"}})}),(0,r.jsx)(l.Suspense,{fallback:(0,r.jsx)(et,{gitOwnerSelect:!1}),children:(0,r.jsx)(en,{owner:i})})]})},en=function(e){var n,t=e.owner,i=(n={provider:t.provider,owner:t.name},(0,J.QT)(Y,[n.provider,n.owner,n.query,n.page,]));return i.length>0?(0,r.jsx)(W,{mode:"link",repos:i}):(0,r.jsx)(j,{children:(0,r.jsx)(C,{title:"No Results Found",description:"Try selecting a different Git account or organization on the top left."})})},et=function(e){var n=e.gitOwnerSelect;return(0,r.jsxs)(r.Fragment,{children:[n?(0,r.jsx)(g,{children:(0,r.jsx)(K,{disabled:!0,sx:{width:"calc(50% - 8px)"}})}):void 0,(0,r.jsx)(Q,{})]})};function er(){return ei.apply(this,arguments)}function ei(){return(ei=(0,S.Z)(function(){return(0,b.__generator)(this,function(e){switch(e.label){case 0:return[4,T.j.git.fetchOwners()];case 1:return[2,e.sent()]}})})).apply(this,arguments)}var eo=t(90374),ec=t(8564),es=function(){return(0,r.jsxs)(_,{children:[(0,r.jsx)(m,{children:"Connected Git Repository"}),(0,r.jsx)(ec.S,{renderError:eu,children:(0,r.jsx)(l.Suspense,{fallback:(0,r.jsx)(et,{gitOwnerSelect:!0}),children:(0,r.jsx)(el,{})})}),(0,r.jsx)(y,{action:(0,r.jsx)(i.u,{content:"Documentation is coming soon.",side:"bottom",children:(0,r.jsx)(i.hU,{disabled:!0,icon:"openInNew"})}),children:"Learn more about Prismic for Git"})]})},el=function(){var e=(0,V.G)().linkedGitRepos;return e.length>0?(0,r.jsx)(W,{mode:"unlink",repos:e}):(0,r.jsx)(ea,{})},ea=function(){var e=(0,J.QT)(er,[]);return e.length>0?(0,r.jsx)(ee,{owners:e}):(0,r.jsx)(j,{children:(0,r.jsx)(R,{})})};function eu(e,n){return(0,u.ff)(e)?(0,r.jsx)(ed,{}):(0,u.TW)(e)?(0,r.jsx)(eh,{}):(0,r.jsx)(ex,{reset:n})}var ed=function(){var e=(0,eo.Z)().openLoginModal;return(0,r.jsx)(j,{children:(0,r.jsx)(C,{title:"It seems like you are logged out",description:"Log in to connect a Git repository.",action:(0,r.jsx)(i.zx,{onClick:e,children:"Log in to Prismic"})})})},eh=function(){return(0,r.jsx)(j,{children:(0,r.jsx)(C,{title:"It seems like you do not have permission",description:"An owner or admin is required to connect a Git repository."})})},ex=function(e){var n=e.reset;return(0,r.jsx)(j,{children:(0,r.jsx)(C,{title:"Unable to fetch data",description:"An error occurred while fetching the list of connected Git repositories.",action:(0,r.jsx)(i.zx,{color:"grey",onClick:n,children:"Retry"})})})},ef=t(80299),ep=function(){var e=(0,ef.M)(),n=(0,s.useRouter)();return((0,l.useEffect)(function(){e.eligible||n.replace("/")},[e.eligible,n]),e.eligible)?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c(),{children:(0,r.jsx)("title",{children:"Settings - Slice Machine"})}),(0,r.jsxs)(a.LN,{children:[(0,r.jsx)(a.wd,{children:(0,r.jsx)(a.Cx,{folder:"Settings"})}),(0,r.jsx)(a.RN,{children:(0,r.jsx)(i.xu,{flexDirection:"column",maxWidth:600,children:(0,r.jsx)(es,{})})})]})]}):null}},75499:function(e,n,t){"use strict";t.d(n,{G:function(){return a}});var r=t(22710),i=t(17064),o=t(99267),c=t(17329),s=t(19334),l=t(81038);function a(){var e,n,t=(0,i.Z)((0,s.f)(),1)[0];return{linkedGitRepos:(0,c.QT)(u,[t.repositoryName]),linkRepo:(e=(0,r.Z)(function(e){return(0,o.__generator)(this,function(n){switch(n.label){case 0:return[4,l.j.git.linkRepo({prismic:{domain:t.repositoryName},git:e})];case 1:return n.sent(),[4,(0,c.gw)(u,[t.repositoryName])];case 2:return n.sent(),[2]}})}),function(n){return e.apply(this,arguments)}),unlinkRepo:(n=(0,r.Z)(function(e){return(0,o.__generator)(this,function(n){switch(n.label){case 0:return[4,l.j.git.unlinkRepo({prismic:{domain:t.repositoryName},git:e})];case 1:return n.sent(),[4,(0,c.gw)(u,[t.repositoryName])];case 2:return n.sent(),[2]}})}),function(e){return n.apply(this,arguments)})}}function u(e){return d.apply(this,arguments)}function d(){return(d=(0,r.Z)(function(e){return(0,o.__generator)(this,function(n){switch(n.label){case 0:return[4,l.j.git.fetchLinkedRepos({prismic:{domain:e}})];case 1:return[2,n.sent()]}})})).apply(this,arguments)}},19334:function(e,n,t){"use strict";t.d(n,{f:function(){return s}});var r=t(22710),i=t(99267),o=t(17329),c=t(81038);function s(){var e,n=(0,o.QT)(l,[]),t=(e=(0,r.Z)(function(e){return(0,i.__generator)(this,function(n){switch(n.label){case 0:return[4,c.j.project.writeSliceMachineConfig({config:e})];case 1:return n.sent(),(0,o.VA)(l,[],e),[2]}})}),function(n){return e.apply(this,arguments)});return[n,t]}function l(){return a.apply(this,arguments)}function a(){return(a=(0,r.Z)(function(){return(0,i.__generator)(this,function(e){return[2,c.j.project.getSliceMachineConfig()]})})).apply(this,arguments)}},88921:function(e){e.exports={flex:"FieldSet_flex__qy2tm",column:"FieldSet_column__NS4qQ FieldSet_flex__qy2tm",root:"FieldSet_root__XVbMv FieldSet_column__NS4qQ FieldSet_flex__qy2tm",row:"FieldSet_row__END9k FieldSet_flex__qy2tm",borderBottom:"FieldSet_borderBottom__L01vK",legend:"FieldSet_legend__JjRCM FieldSet_row__END9k FieldSet_flex__qy2tm FieldSet_borderBottom__L01vK",header:"FieldSet_header__0Q7YD FieldSet_row__END9k FieldSet_flex__qy2tm FieldSet_borderBottom__L01vK",content:"FieldSet_content__PDj3t FieldSet_column__NS4qQ FieldSet_flex__qy2tm",list:"FieldSet_list__HoMpl FieldSet_column__NS4qQ FieldSet_flex__qy2tm",listItem:"FieldSet_listItem__P0SKW FieldSet_row__END9k FieldSet_flex__qy2tm FieldSet_borderBottom__L01vK",listItemText:"FieldSet_listItemText__J0_Fr",borderTop:"FieldSet_borderTop__qyC9U",footer:"FieldSet_footer__thBWh FieldSet_row__END9k FieldSet_flex__qy2tm FieldSet_borderTop__qyC9U",footerText:"FieldSet_footerText__mKIv2"}}},function(e){e.O(0,[774,888,179],function(){return e(e.s=24994)}),_N_E=e.O()}]);
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { useEffect } from "react";
|
|
2
|
-
|
|
3
|
-
import useSliceMachineActions from "@src/modules/useSliceMachineActions";
|
|
4
|
-
|
|
5
|
-
export const useChangelog = () => {
|
|
6
|
-
const { getChangelog } = useSliceMachineActions();
|
|
7
|
-
|
|
8
|
-
useEffect(() => {
|
|
9
|
-
getChangelog();
|
|
10
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
11
|
-
}, []);
|
|
12
|
-
};
|