slice-machine-ui 1.25.1-beta.1 → 1.25.1-beta.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.
Files changed (46) hide show
  1. package/components/Simulator/components/FailedConnect/index.tsx +1 -1
  2. package/components/Simulator/index.tsx +17 -57
  3. package/lib/builders/SliceBuilder/SimulatorButton/index.tsx +4 -26
  4. package/lib/builders/SliceBuilder/index.tsx +1 -11
  5. package/lib/models/common/Environment.ts +0 -1
  6. package/out/404.html +1 -1
  7. package/out/_next/static/UH_nSG8k25NO9SYLlVW9n/_buildManifest.js +1 -0
  8. package/out/_next/static/chunks/{474-5a072e6fac61f703.js → 210-aee6116139329803.js} +2 -2
  9. package/out/_next/static/chunks/46-d22d7a121254e31d.js +8 -0
  10. package/out/_next/static/chunks/{696-b12edad30a3617e5.js → 696-b992b9e1ce75777e.js} +1 -1
  11. package/out/_next/static/chunks/{904-bed9c8dade39dc27.js → 904-1a755ebb0f5ee4ac.js} +1 -1
  12. package/out/_next/static/chunks/pages/{_app-e32e7f8142e6cde0.js → _app-dd7fea6283b73c4e.js} +23 -23
  13. package/out/_next/static/chunks/pages/custom-types/{[customTypeId]-97ab3b90b85d645d.js → [customTypeId]-d1a4a07e6b600fa6.js} +1 -1
  14. package/out/_next/static/chunks/pages/page-types/{[pageTypeId]-84a22c5e480d3fa9.js → [pageTypeId]-a724ff12ef322020.js} +1 -1
  15. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-3eb0fdce3228d389.js +1 -0
  16. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-ba6c3e2624f32fcd.js +1 -0
  17. package/out/changelog.html +1 -1
  18. package/out/changes.html +1 -1
  19. package/out/custom-types/[customTypeId].html +1 -1
  20. package/out/custom-types.html +1 -1
  21. package/out/index.html +1 -1
  22. package/out/labs.html +1 -1
  23. package/out/page-types/[pageTypeId].html +1 -1
  24. package/out/settings.html +1 -1
  25. package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
  26. package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
  27. package/out/slices.html +1 -1
  28. package/package.json +3 -5
  29. package/src/apiClient.ts +0 -6
  30. package/src/modules/environment/index.ts +0 -6
  31. package/src/modules/modal/types.ts +0 -1
  32. package/src/modules/simulator/index.ts +5 -133
  33. package/src/modules/simulator/types.ts +0 -6
  34. package/src/modules/useSliceMachineActions.ts +1 -11
  35. package/test/__testutils__/createTestPlugin.ts +0 -1
  36. package/test/src/modules/__fixtures__/serverState.ts +0 -1
  37. package/test/src/modules/simulator.test.ts +0 -196
  38. package/components/CodeSpan/index.tsx +0 -23
  39. package/components/HTMLRenderer/index.tsx +0 -137
  40. package/components/Simulator/components/SetupModal/TextWithInlineCode.tsx +0 -21
  41. package/components/Simulator/components/SetupModal/index.tsx +0 -165
  42. package/out/_next/static/PAJQyEuW0rRHPSn18wYrk/_buildManifest.js +0 -1
  43. package/out/_next/static/chunks/777-7bc4ca95c82802e5.js +0 -8
  44. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-a8213af71b0a99c9.js +0 -1
  45. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-60858a3cead6dc81.js +0 -1
  46. /package/out/_next/static/{PAJQyEuW0rRHPSn18wYrk → UH_nSG8k25NO9SYLlVW9n}/_ssgManifest.js +0 -0
@@ -1,165 +0,0 @@
1
- import Card from "@components/Card";
2
- import SliceMachineModal from "@components/SliceMachineModal";
3
- import { Box, Flex, Heading, Text } from "theme-ui";
4
-
5
- import { useEffect } from "react";
6
- import { Tab, Tabs, TabList, TabPanel } from "react-tabs";
7
- import { useSelector } from "react-redux";
8
- import { SliceMachineStoreType } from "@src/redux/type";
9
- import { selectIsSimulatorAvailableForFramework } from "@src/modules/environment";
10
- import { selectSetupSteps } from "@src/modules/simulator";
11
- import { telemetry } from "@src/apiClient";
12
-
13
- import HTMLRenderer from "@components/HTMLRenderer";
14
-
15
- import TextWithInlineCode from "./TextWithInlineCode";
16
-
17
- const TitleCard: React.FC<{
18
- number: number;
19
- title: string;
20
- excerpt?: string;
21
- }> & { tabsRole: string } = ({ number, title, excerpt, ...rest }) => (
22
- <Tab
23
- className="react-tabs__vertical__tab"
24
- selectedClassName="react-tabs__vertical__tab--selected"
25
- {...rest}
26
- >
27
- <Flex
28
- sx={{
29
- alignItems: "flex-start",
30
- }}
31
- >
32
- <NumberBox number={number} />
33
- <Box sx={{ ml: 3, alignSelf: "center" }}>
34
- <Heading
35
- as="h4"
36
- sx={{ color: "whiteButtonText", fontSize: "14px", fontWeight: "600" }}
37
- >
38
- <TextWithInlineCode>{title}</TextWithInlineCode>
39
- </Heading>
40
- {/* eslint-disable-next-line @typescript-eslint/strict-boolean-expressions */}
41
- {excerpt && (
42
- <Text
43
- as="p"
44
- sx={{
45
- mt: 2,
46
- color: "textClear",
47
- fontSize: "13px",
48
- lineHeight: "24px",
49
- }}
50
- >
51
- <TextWithInlineCode>{excerpt}</TextWithInlineCode>
52
- </Text>
53
- )}
54
- </Box>
55
- </Flex>
56
- </Tab>
57
- );
58
-
59
- TitleCard.tabsRole = "Tab";
60
-
61
- const NumberBox: React.FC<{ number: number }> = ({ number }) => (
62
- <Flex
63
- sx={{
64
- height: "32px",
65
- width: "32px",
66
- alignItems: "center",
67
- justifyContent: "center",
68
- border: "1px solid #E4E2E4",
69
- borderRadius: "6px",
70
- bg: "grey07",
71
- color: "textClear",
72
- flexShrink: "0",
73
- fontSize: "13px",
74
- }}
75
- >
76
- {number}
77
- </Flex>
78
- );
79
-
80
- const SetupModal: React.FC<{ isOpen: boolean }> = ({ isOpen }) => {
81
- const { isSimulatorAvailableForFramework, setupSteps } = useSelector(
82
- (state: SliceMachineStoreType) => ({
83
- isSimulatorAvailableForFramework:
84
- selectIsSimulatorAvailableForFramework(state),
85
- setupSteps: selectSetupSteps(state),
86
- }),
87
- );
88
-
89
- // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
90
- const steps = setupSteps || [];
91
-
92
- useEffect(() => {
93
- if (isOpen) void telemetry.track({ event: "slice-simulator:setup" });
94
- }, [isOpen]);
95
-
96
- return (
97
- <SliceMachineModal isOpen={isOpen}>
98
- <Card
99
- bodySx={{
100
- p: 0,
101
- bg: "grey07",
102
- height: steps.length === 4 ? "640px" : "480px",
103
- }}
104
- Header={({ radius }: { radius: string | number }) => (
105
- <Flex
106
- sx={{
107
- position: "sticky",
108
- top: 0,
109
- zIndex: 1,
110
- p: "16px",
111
- pl: 4,
112
- bg: "grey07",
113
- alignItems: "center",
114
- justifyContent: "space-between",
115
- borderTopLeftRadius: radius,
116
- borderTopRightRadius: radius,
117
- borderBottom: (t) => `1px solid ${String(t.colors?.borders)}`,
118
- }}
119
- >
120
- <Heading sx={{ fontSize: "14px", fontWeight: "600" }} as="h5">
121
- Set up the simulator
122
- </Heading>
123
- </Flex>
124
- )}
125
- >
126
- <Tabs defaultFocus className="react-tabs__vertical">
127
- <TabList className="react-tabs__vertical__tab-list">
128
- {steps.map((step, i) => (
129
- <TitleCard
130
- number={i + 1}
131
- key={step.title}
132
- title={step.title}
133
- excerpt={step.description}
134
- />
135
- ))}
136
- </TabList>
137
- {isSimulatorAvailableForFramework ? (
138
- <>
139
- {steps.map((step) => {
140
- return (
141
- <TabPanel
142
- key={step.title}
143
- selectedClassName="react-tabs__vertical__tab-panel--selected"
144
- className="react-tabs__vertical__tab-panel"
145
- >
146
- <HTMLRenderer html={step.body} />
147
- </TabPanel>
148
- );
149
- })}
150
- </>
151
- ) : (
152
- <TabPanel
153
- selectedClassName="react-tabs__vertical__tab-panel--selected"
154
- className="react-tabs__vertical__tab-panel"
155
- >
156
- Framework not supported.
157
- </TabPanel>
158
- )}
159
- </Tabs>
160
- </Card>
161
- </SliceMachineModal>
162
- );
163
- };
164
-
165
- export default SetupModal;
@@ -1 +0,0 @@
1
- self.__BUILD_MANIFEST=function(s,c,a,e,t,i,b,d,n,u,f,h,l,k,j,p,g,o,r){return{__rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},"/":[a,j,p,"static/chunks/pages/index-cf93d16e9c63b6db.js"],"/_error":["static/chunks/pages/_error-69b4f498bafdd188.js"],"/changelog":[s,e,"static/chunks/870-0c7a8a9622de78b7.js","static/chunks/pages/changelog-57289ca6bc99702b.js"],"/changes":[s,t,"static/chunks/8eec4907-b712959d9f984b68.js",i,"static/chunks/918-5bb55fb464e34768.js",c,d,"static/css/838fd8bb5a7c32b0.css","static/chunks/pages/changes-23829ddb11cac992.js"],"/custom-types":[a,j,p,"static/chunks/pages/custom-types-3c8e721ec6802127.js"],"/custom-types/[customTypeId]":[s,n,u,f,h,e,b,i,l,g,c,a,k,o,r,"static/chunks/pages/custom-types/[customTypeId]-97ab3b90b85d645d.js"],"/labs":["static/chunks/pages/labs-49bed0a08da3772c.js"],"/page-types/[pageTypeId]":[s,n,u,f,h,e,b,i,l,g,c,a,k,o,r,"static/chunks/pages/page-types/[pageTypeId]-84a22c5e480d3fa9.js"],"/settings":["static/css/ca32882a5d2d8d88.css","static/chunks/pages/settings-12f209f1d5d42b1c.js"],"/slices":[s,t,b,c,d,"static/css/f8eb526e10bc2441.css","static/chunks/pages/slices-c33645b1828857c4.js"],"/slices/[lib]/[sliceName]/[variation]":[s,t,n,u,f,h,e,b,i,l,c,k,d,"static/css/b22c0750c14cc089.css","static/chunks/pages/slices/[lib]/[sliceName]/[variation]-60858a3cead6dc81.js"],"/slices/[lib]/[sliceName]/[variation]/simulator":[t,"static/chunks/72585f70-28b4d7d5384b3703.js","static/chunks/18539003-a5a5d48f20a7b261.js","static/chunks/777-7bc4ca95c82802e5.js","static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-a8213af71b0a99c9.js"],sortedPages:["/","/_app","/_error","/changelog","/changes","/custom-types","/custom-types/[customTypeId]","/labs","/page-types/[pageTypeId]","/settings","/slices","/slices/[lib]/[sliceName]/[variation]","/slices/[lib]/[sliceName]/[variation]/simulator"]}}("static/chunks/59b4e022-7a3b5554b806349f.js","static/chunks/25-792af14760d9df34.js","static/chunks/799-9bea9069969f5fe0.js","static/chunks/183-4feb6bb3eddbc768.js","static/chunks/c8eae200-966ce352f7b5d2b9.js","static/chunks/543-f8766685f7f451e2.js","static/chunks/50-cfc2514205b86001.js","static/chunks/286-e0950c3083c672e8.js","static/chunks/f36c6662-03bb5e9d9aa0b0aa.js","static/chunks/4c744e84-e3161d754618373f.js","static/chunks/065a3ddb-9a38ca0d60f0bf2f.js","static/chunks/1cc2734a-2c5b6c0367fcde86.js","static/chunks/696-b12edad30a3617e5.js","static/chunks/318-2426f74a0d6c3b89.js","static/chunks/727-df23c133f7cbf952.js","static/css/be1f49e49a5aa7eb.css","static/chunks/474-5a072e6fac61f703.js","static/chunks/904-bed9c8dade39dc27.js","static/css/72465cc1225f28a2.css"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();