slice-machine-ui 1.18.1-dev-next-release.3 → 1.18.1-dev-next-release.5

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 (210) hide show
  1. package/components/Button/index.tsx +2 -2
  2. package/components/Changelog/index.tsx +1 -1
  3. package/components/Changelog/versionDetails/UpdateCommandBox.tsx +1 -1
  4. package/components/ChangesItems/ChangesItems.tsx +2 -2
  5. package/components/CustomTypeTable/changesPage.tsx +1 -1
  6. package/components/DeleteDocumentsDrawer/HardDeleteDocumentsDrawer.tsx +3 -3
  7. package/components/DeleteDocumentsDrawer/ReferencesErrorDrawer.tsx +3 -3
  8. package/components/DeleteDocumentsDrawer/SoftDeleteDocumentsDrawer.tsx +3 -3
  9. package/components/DeleteSliceModal/index.tsx +1 -1
  10. package/components/FormFields/CheckboxControl.jsx +1 -1
  11. package/components/Forms/CreateCustomTypeModal/CreateCustomTypeModal.tsx +5 -5
  12. package/components/Forms/CreateSliceModal/CreateSliceModal.tsx +1 -1
  13. package/components/Forms/RenameSliceModal/RenameSliceModal.tsx +1 -1
  14. package/components/Forms/formsValidator.ts +2 -2
  15. package/components/Grid/index.tsx +1 -1
  16. package/components/Li/index.tsx +2 -2
  17. package/components/ListItem/index.tsx +2 -2
  18. package/components/ListItem/utils.js +1 -1
  19. package/components/LoginModal/index.tsx +2 -2
  20. package/components/ModalFormCard/index.tsx +2 -2
  21. package/components/Navigation/VideoItem.tsx +2 -2
  22. package/components/Navigation/index.test.tsx +8 -8
  23. package/components/Navigation/index.tsx +2 -2
  24. package/components/ReviewModal/ReviewForm.tsx +1 -1
  25. package/components/ReviewModal/ReviewModal.tsx +4 -4
  26. package/components/ScreenshotChangesModal/VariationDropZone.tsx +6 -6
  27. package/components/ScreenshotChangesModal/index.tsx +3 -3
  28. package/components/ScreenshotPreviewModal/index.tsx +2 -2
  29. package/components/Simulator/components/Header/index.tsx +1 -1
  30. package/components/Simulator/components/IframeRenderer/index.tsx +2 -2
  31. package/components/Simulator/components/SetupModal/index.tsx +1 -1
  32. package/components/Simulator/components/Toolbar/index.tsx +2 -2
  33. package/components/Simulator/index.tsx +5 -5
  34. package/components/Tooltip/TextWithTooltip.tsx +1 -1
  35. package/lib/builders/CustomTypeBuilder/SliceZone/List.tsx +2 -2
  36. package/lib/builders/CustomTypeBuilder/SliceZone/SlicesTemplatesModal.tsx +4 -4
  37. package/lib/builders/CustomTypeBuilder/SliceZone/UpdateSliceZoneModal.tsx +1 -1
  38. package/lib/builders/CustomTypeBuilder/SliceZone/index.tsx +12 -12
  39. package/lib/builders/CustomTypeBuilder/TabZone/index.tsx +1 -1
  40. package/lib/builders/CustomTypeBuilder/index.tsx +1 -1
  41. package/lib/builders/SliceBuilder/FieldZones/index.tsx +4 -4
  42. package/lib/builders/SliceBuilder/Header/SimulatorButton/index.tsx +1 -1
  43. package/lib/builders/SliceBuilder/Header/VariationsPopover/index.tsx +1 -1
  44. package/lib/builders/SliceBuilder/Header/index.tsx +2 -2
  45. package/lib/builders/SliceBuilder/index.tsx +2 -2
  46. package/lib/builders/common/EditModal/Form.jsx +1 -1
  47. package/lib/builders/common/EditModal/index.jsx +3 -3
  48. package/lib/builders/common/Zone/Card/components/NewField.tsx +7 -7
  49. package/lib/builders/common/Zone/index.jsx +2 -2
  50. package/lib/builders/utils/index.ts +1 -1
  51. package/lib/forms/defaults.ts +3 -3
  52. package/lib/forms/fields.ts +3 -3
  53. package/lib/forms/index.ts +3 -3
  54. package/lib/models/common/ComponentUI.ts +3 -3
  55. package/lib/models/common/CustomType/group.ts +2 -2
  56. package/lib/models/common/CustomType/index.ts +4 -4
  57. package/lib/models/common/CustomType/tab.ts +7 -7
  58. package/lib/models/common/ErrorWithStatus.ts +4 -1
  59. package/lib/models/common/Fields.ts +1 -1
  60. package/lib/models/common/Group.ts +5 -5
  61. package/lib/models/common/Library.ts +1 -1
  62. package/lib/models/common/Manifest.ts +4 -4
  63. package/lib/models/common/ModelData.ts +6 -6
  64. package/lib/models/common/ModelStatus/compareCustomTypeModels.ts +1 -1
  65. package/lib/models/common/ModelStatus/compareSliceModels.ts +4 -4
  66. package/lib/models/common/ModelStatus/index.ts +5 -5
  67. package/lib/models/common/Screenshots.ts +1 -1
  68. package/lib/models/common/Slice.ts +7 -7
  69. package/lib/models/common/Slices.ts +5 -5
  70. package/lib/models/common/UserProfile.ts +1 -1
  71. package/lib/models/common/Variation.ts +6 -6
  72. package/lib/models/common/normalizers/customType.ts +3 -3
  73. package/lib/models/common/normalizers/slices.ts +2 -2
  74. package/lib/models/common/widgets/Boolean/index.ts +2 -2
  75. package/lib/models/common/widgets/ContentRelationship/Form.tsx +2 -2
  76. package/lib/models/common/widgets/ContentRelationship/index.ts +2 -2
  77. package/lib/models/common/widgets/Group/ListItem/index.jsx +3 -3
  78. package/lib/models/common/widgets/Image/Form.tsx +3 -3
  79. package/lib/models/common/widgets/StructuredText/Form.tsx +2 -2
  80. package/lib/models/common/widgets/StructuredText/index.ts +2 -2
  81. package/lib/utils/index.ts +1 -1
  82. package/lib/utils/poll.ts +3 -3
  83. package/lib/utils/shared/customTypes.ts +1 -1
  84. package/next.config.mjs +3 -3
  85. package/out/404.html +1 -1
  86. package/out/_next/static/chunks/125-e3857af2068bbedf.js +11 -0
  87. package/out/_next/static/chunks/pages/{_app-24537d01d860293a.js → _app-b04ec71c46729221.js} +12 -12
  88. package/out/_next/static/{cjz0yUXdEAw1xeqGTjS8s → j0GKKng3reAX2Jcp0Dw_g}/_buildManifest.js +1 -1
  89. package/out/changelog.html +1 -1
  90. package/out/changes.html +1 -1
  91. package/out/custom-types/[customTypeId].html +1 -1
  92. package/out/custom-types.html +1 -1
  93. package/out/index.html +1 -1
  94. package/out/labs.html +1 -1
  95. package/out/page-types/[pageTypeId].html +1 -1
  96. package/out/slices/[lib]/[sliceName]/[variation]/screenshot.html +1 -1
  97. package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
  98. package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
  99. package/out/slices.html +1 -1
  100. package/package.json +5 -5
  101. package/pages/_app.tsx +1 -1
  102. package/pages/api/embed.js +1 -1
  103. package/pages/slices.tsx +4 -4
  104. package/src/apiClient.ts +11 -11
  105. package/src/components/BaseHoverCard/BaseHoverCard.test.tsx +1 -1
  106. package/src/components/HoverCard/HoverCard.tsx +1 -1
  107. package/src/components/SideNav/SideNav.tsx +2 -2
  108. package/src/components/Table/Table.test.tsx +1 -1
  109. package/src/components/TextLink/TextLink.tsx +1 -1
  110. package/src/domain/__tests__/CustomTypeModel.test.ts +19 -19
  111. package/src/domain/customType.ts +10 -10
  112. package/src/domain/slice.ts +5 -5
  113. package/src/features/changes/StatusBadge.tsx +1 -1
  114. package/src/features/customTypes/EditDropdown.tsx +1 -1
  115. package/src/features/customTypes/PageTypeOnboarding.tsx +2 -2
  116. package/src/features/customTypes/__tests__/CustomTypeBuilderPage.test.tsx +7 -7
  117. package/src/features/customTypes/__tests__/CustomTypesTablePage.test.tsx +24 -22
  118. package/src/features/customTypes/actions/convertCustomToPageType.ts +3 -3
  119. package/src/features/customTypes/actions/deleteCustomType.ts +1 -1
  120. package/src/features/customTypes/actions/renameCustomType.ts +1 -1
  121. package/src/features/customTypes/customTypesBuilder/CustomTypesBuilderPage.tsx +3 -3
  122. package/src/features/customTypes/customTypesConfig.ts +3 -3
  123. package/src/features/customTypes/customTypesTable/CustomTypesTable.tsx +2 -2
  124. package/src/features/customTypes/customTypesTable/CustomTypesTablePage.tsx +3 -3
  125. package/src/features/customTypes/customTypesTable/createCustomType.ts +2 -2
  126. package/src/features/customTypes/customTypesTable/useCustomTypes.ts +7 -7
  127. package/src/features/labs/labsList/LabsList.tsx +3 -3
  128. package/src/features/labs/labsList/useLab.tsx +1 -1
  129. package/src/features/slices/actions/addSlicesToSliceZone.ts +1 -1
  130. package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewSliceDialog.tsx +2 -2
  131. package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewVariationDialog.tsx +5 -5
  132. package/src/features/slices/convertLegacySlice/ConvertLegacySliceButton.tsx +11 -11
  133. package/src/features/slicesTemplates/useSlicesTemplates.ts +1 -1
  134. package/src/hooks/useCurrentSlice.tsx +2 -2
  135. package/src/hooks/useElementSize.ts +1 -1
  136. package/src/hooks/useModelStatus.ts +13 -10
  137. package/src/hooks/useRouteChange.tsx +1 -1
  138. package/src/hooks/useSMTracker.ts +2 -2
  139. package/src/hooks/useSliceMachineConfig.ts +1 -1
  140. package/src/hooks/useThrottle.ts +10 -7
  141. package/src/hooks/useUnSyncChanges.ts +5 -5
  142. package/src/hooks/useWindowDimensions.ts +1 -1
  143. package/src/modules/availableCustomTypes/index.ts +19 -19
  144. package/src/modules/environment/index.ts +6 -6
  145. package/src/modules/loading/index.ts +3 -3
  146. package/src/modules/modal/index.ts +2 -2
  147. package/src/modules/pushChangesSaga/index.ts +7 -7
  148. package/src/modules/pushChangesSaga/trackPushChangesSuccess.ts +3 -3
  149. package/src/modules/screenshots/actions.ts +2 -2
  150. package/src/modules/screenshots/sagas.ts +9 -9
  151. package/src/modules/selectedCustomType/actions.ts +10 -10
  152. package/src/modules/selectedCustomType/reducer.ts +26 -26
  153. package/src/modules/selectedCustomType/sagas.ts +5 -5
  154. package/src/modules/selectedCustomType/selectors.ts +4 -4
  155. package/src/modules/selectedCustomType/stateHelpers.ts +1 -1
  156. package/src/modules/selectedSlice/actions.ts +4 -4
  157. package/src/modules/selectedSlice/reducer.ts +7 -7
  158. package/src/modules/selectedSlice/sagas.ts +4 -4
  159. package/src/modules/selectedSlice/selectors.ts +5 -5
  160. package/src/modules/simulator/index.ts +20 -17
  161. package/src/modules/slices/index.ts +18 -18
  162. package/src/modules/toaster/index.tsx +3 -3
  163. package/src/modules/toaster/utils.tsx +1 -1
  164. package/src/modules/useSliceMachineActions.ts +43 -41
  165. package/src/modules/userContext/index.ts +9 -9
  166. package/src/redux/store.ts +2 -2
  167. package/src/theme.ts +1 -1
  168. package/src/utils/editor.ts +1 -1
  169. package/src/utils/fieldNameCreator.ts +2 -2
  170. package/test/__setup__.ts +18 -7
  171. package/test/__testutils__/createPrismicAuthLoginResponse.ts +1 -1
  172. package/test/__testutils__/createTestPlugin.ts +1 -1
  173. package/test/__testutils__/createTestProject.ts +3 -3
  174. package/test/__testutils__/index.tsx +1 -1
  175. package/test/__testutils__/mockAWSACLAPI.ts +9 -9
  176. package/test/__testutils__/mockCustomTypesAPI.ts +16 -16
  177. package/test/__testutils__/mockPrismicAuthAPI.ts +3 -3
  178. package/test/__testutils__/mockPrismicUserAPI.ts +4 -4
  179. package/test/__testutils__/readMSWFormData.ts +3 -3
  180. package/test/components/CreateCustomTypeModal.test.tsx +1 -1
  181. package/test/components/LoginModal.test.tsx +2 -2
  182. package/test/lib/builders/EditModal.test.tsx +5 -5
  183. package/test/lib/builders/buildersUtils.test.ts +13 -13
  184. package/test/lib/models/common/CustomType/sliceZone.test.ts +2 -2
  185. package/test/lib/models/common/ModelStatus.test.ts +1 -1
  186. package/test/lib/models/common/widgets/index.test.ts +6 -6
  187. package/test/lib/utils/shared/customTypes.test.ts +1 -1
  188. package/test/pages/custom-types.test.tsx +7 -7
  189. package/test/pages/simulator.test.tsx +5 -5
  190. package/test/pages/slices.test.tsx +4 -4
  191. package/test/src/hooks/useModelStatus.test.ts +2 -3
  192. package/test/src/modules/__fixtures__/sliceUtilsFactory.ts +2 -2
  193. package/test/src/modules/availableCustomTypes/index.test.ts +20 -18
  194. package/test/src/modules/environment.test.ts +2 -2
  195. package/test/src/modules/loading.test.ts +1 -1
  196. package/test/src/modules/modal.test.ts +1 -1
  197. package/test/src/modules/pushChangesSaga.test.ts +10 -10
  198. package/test/src/modules/screenshots/sagas.test.ts +5 -5
  199. package/test/src/modules/selectedCustomType/reducer.test.ts +25 -25
  200. package/test/src/modules/selectedCustomType/sagas.test.ts +3 -3
  201. package/test/src/modules/selectedSlice/__testutils__/getRefreshStateCreatorPayloadData.ts +1 -1
  202. package/test/src/modules/selectedSlice/reducer.test.ts +12 -12
  203. package/test/src/modules/selectedSlice/sagas.test.ts +6 -6
  204. package/test/src/modules/simulator.test.ts +10 -10
  205. package/test/src/modules/slices.test.ts +5 -5
  206. package/test/src/modules/toaster/utils.test.ts +3 -3
  207. package/test/src/normalizers/customType.test.ts +5 -5
  208. package/test/src/utils/fieldNameCreator.test.ts +1 -1
  209. package/out/_next/static/chunks/125-84464edfe25651eb.js +0 -19
  210. /package/out/_next/static/{cjz0yUXdEAw1xeqGTjS8s → j0GKKng3reAX2Jcp0Dw_g}/_ssgManifest.js +0 -0
@@ -48,7 +48,7 @@ export const Button = forwardRef<HTMLButtonElement, SmButtonProps>(
48
48
  variant = "primary",
49
49
  ...rest
50
50
  },
51
- ref
51
+ ref,
52
52
  ) => (
53
53
  <ThemeUIButton
54
54
  ref={ref}
@@ -89,5 +89,5 @@ export const Button = forwardRef<HTMLButtonElement, SmButtonProps>(
89
89
  </>
90
90
  )}
91
91
  </ThemeUIButton>
92
- )
92
+ ),
93
93
  );
@@ -17,7 +17,7 @@ export default function Changelog() {
17
17
  changelog: getChangelog(store),
18
18
  packageManager: getPackageManager(store),
19
19
  isChangelogLoading: isLoading(store, LoadingKeysEnum.CHANGELOG),
20
- })
20
+ }),
21
21
  );
22
22
 
23
23
  const latestVersion = changelog.sliceMachine.versions[0];
@@ -94,7 +94,7 @@ export const UpdateCommandBox: React.FC<UpdateCommandBoxProps> = ({
94
94
 
95
95
  function getInstallCommand(
96
96
  packageManager: PackageManager,
97
- packagesSpecs: string[]
97
+ packagesSpecs: string[],
98
98
  ): string {
99
99
  const packagesSpecsStr = packagesSpecs.join(" ");
100
100
 
@@ -33,7 +33,7 @@ export const ChangesItems: React.FC<ChangesItemsProps> = ({
33
33
  const { sliceFilterFn, defaultVariationSelector } = modalPayload;
34
34
 
35
35
  const screenshotChangesSlices = unSyncedSlices.filter(
36
- (s) => modelsStatuses.slices[s.model.id] !== ModelStatus.Deleted
36
+ (s) => modelsStatuses.slices[s.model.id] !== ModelStatus.Deleted,
37
37
  );
38
38
 
39
39
  return (
@@ -71,7 +71,7 @@ export const ChangesItems: React.FC<ChangesItemsProps> = ({
71
71
  (slice) =>
72
72
  countMissingScreenshots(slice) > 0 &&
73
73
  modelsStatuses.slices[slice.model.id] !==
74
- ModelStatus.Deleted
74
+ ModelStatus.Deleted,
75
75
  ) && (
76
76
  <Text
77
77
  sx={{
@@ -96,7 +96,7 @@ export const CustomTypeTable: React.FC<CustomTypeTableProps> = ({
96
96
  key={customType.remote.id}
97
97
  />
98
98
  </tr>
99
- )
99
+ ),
100
100
  )}
101
101
  </tbody>
102
102
  </Box>
@@ -21,7 +21,7 @@ export const HardDeleteDocumentsDrawer: React.FunctionComponent<{
21
21
  useSelector((store: SliceMachineStoreType) => ({
22
22
  isDeleteDocumentsDrawerOpen: isModalOpen(
23
23
  store,
24
- ModalKeysEnum.HARD_DELETE_DOCUMENTS_DRAWER
24
+ ModalKeysEnum.HARD_DELETE_DOCUMENTS_DRAWER,
25
25
  ),
26
26
  remoteOnlyCustomTypes: selectAllCustomTypes(store).filter(isRemoteOnly),
27
27
  modalData: store.pushChanges,
@@ -39,7 +39,7 @@ export const HardDeleteDocumentsDrawer: React.FunctionComponent<{
39
39
  const associatedDocumentsCards = modalData.details.customTypes.map(
40
40
  (customTypeDetail) => {
41
41
  const customType = remoteOnlyCustomTypes.find(
42
- (customType) => getModelId(customType) === customTypeDetail.id
42
+ (customType) => getModelId(customType) === customTypeDetail.id,
43
43
  );
44
44
  if (customType === undefined) return null;
45
45
 
@@ -52,7 +52,7 @@ export const HardDeleteDocumentsDrawer: React.FunctionComponent<{
52
52
  numberOfDocuments={customTypeDetail.numberOfDocuments}
53
53
  />
54
54
  );
55
- }
55
+ },
56
56
  );
57
57
 
58
58
  return (
@@ -20,7 +20,7 @@ export const ReferencesErrorDrawer: React.FunctionComponent<{
20
20
  isOpen: isModalOpen(store, ModalKeysEnum.REFERENCES_MISSING_DRAWER),
21
21
  localCustomTypes: selectAllCustomTypes(store).filter(hasLocal),
22
22
  modalData: store.pushChanges,
23
- })
23
+ }),
24
24
  );
25
25
  const { closeModals, openToaster } = useSliceMachineActions();
26
26
 
@@ -36,7 +36,7 @@ export const ReferencesErrorDrawer: React.FunctionComponent<{
36
36
  const associatedDocumentsCards = modalData.details.customTypes.map(
37
37
  (customTypeDetail) => {
38
38
  const customType = localCustomTypes.find(
39
- (customType) => getModelId(customType) === customTypeDetail.id
39
+ (customType) => getModelId(customType) === customTypeDetail.id,
40
40
  );
41
41
  if (customType === undefined) return null;
42
42
 
@@ -47,7 +47,7 @@ export const ReferencesErrorDrawer: React.FunctionComponent<{
47
47
  name={customType.local.label ?? customType.local.id}
48
48
  />
49
49
  );
50
- }
50
+ },
51
51
  );
52
52
 
53
53
  return (
@@ -50,7 +50,7 @@ export const SoftDeleteDocumentsDrawer: React.FunctionComponent<{
50
50
  useSelector((store: SliceMachineStoreType) => ({
51
51
  isDeleteDocumentsDrawerOpen: isModalOpen(
52
52
  store,
53
- ModalKeysEnum.SOFT_DELETE_DOCUMENTS_DRAWER
53
+ ModalKeysEnum.SOFT_DELETE_DOCUMENTS_DRAWER,
54
54
  ),
55
55
  remoteOnlyCustomTypes: selectAllCustomTypes(store).filter(isRemoteOnly),
56
56
  modalData: store.pushChanges,
@@ -68,7 +68,7 @@ export const SoftDeleteDocumentsDrawer: React.FunctionComponent<{
68
68
  const associatedDocumentsCards = modalData.details.customTypes.map(
69
69
  (customTypeDetail) => {
70
70
  const customType = remoteOnlyCustomTypes.find(
71
- (customType) => getModelId(customType) === customTypeDetail.id
71
+ (customType) => getModelId(customType) === customTypeDetail.id,
72
72
  );
73
73
  if (customType === undefined) return null;
74
74
 
@@ -81,7 +81,7 @@ export const SoftDeleteDocumentsDrawer: React.FunctionComponent<{
81
81
  numberOfDocuments={customTypeDetail.numberOfDocuments}
82
82
  />
83
83
  );
84
- }
84
+ },
85
85
  );
86
86
 
87
87
  return (
@@ -24,7 +24,7 @@ export const DeleteSliceModal: React.FunctionComponent<
24
24
  (store: SliceMachineStoreType) => ({
25
25
  isSliceModalOpen: isModalOpen(store, ModalKeysEnum.DELETE_SLICE),
26
26
  isDeletingSlice: isLoading(store, LoadingKeysEnum.DELETE_SLICE),
27
- })
27
+ }),
28
28
  );
29
29
 
30
30
  const { closeModals, deleteSlice } = useSliceMachineActions();
@@ -27,7 +27,7 @@ const CheckboxControl = ({
27
27
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-assignment
28
28
  const [isChecked, setCheck] = useState(
29
29
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/strict-boolean-expressions
30
- defaultValue || field.defaultValue || false
30
+ defaultValue || field.defaultValue || false,
31
31
  );
32
32
 
33
33
  useEffect(() => {
@@ -49,7 +49,7 @@ export const CreateCustomTypeModal: React.FC<CreateCustomTypeModalProps> = ({
49
49
  customTypeLabels: selectAllCustomTypeLabels(store),
50
50
  isCreateCustomTypeModalOpen: isModalOpen(
51
51
  store,
52
- ModalKeysEnum.CREATE_CUSTOM_TYPE
52
+ ModalKeysEnum.CREATE_CUSTOM_TYPE,
53
53
  ),
54
54
  isCreatingCustomType: isLoading(store, LoadingKeysEnum.CREATE_CUSTOM_TYPE),
55
55
  }));
@@ -77,8 +77,8 @@ export const CreateCustomTypeModal: React.FC<CreateCustomTypeModalProps> = ({
77
77
  values: FormValues,
78
78
  setValues: (
79
79
  values: SetStateAction<FormValues>,
80
- shouldValidate?: boolean
81
- ) => void
80
+ shouldValidate?: boolean,
81
+ ) => void,
82
82
  ) => {
83
83
  if (isIdFieldPristine) {
84
84
  setValues({
@@ -96,8 +96,8 @@ export const CreateCustomTypeModal: React.FC<CreateCustomTypeModalProps> = ({
96
96
  setFieldValue: (
97
97
  field: string,
98
98
  value: string,
99
- shouldValidate?: boolean
100
- ) => Promise<unknown>
99
+ shouldValidate?: boolean,
100
+ ) => Promise<unknown>,
101
101
  ) => {
102
102
  void setFieldValue("id", e.target.value);
103
103
  setIsIdFieldPristine(false);
@@ -17,7 +17,7 @@ type CreateSliceModalProps = {
17
17
  onClose: () => void;
18
18
  onSuccess: (
19
19
  newSlice: SharedSlice,
20
- libraryName: string
20
+ libraryName: string,
21
21
  ) => Promise<void> | void;
22
22
  localLibraries: readonly LibraryUI[];
23
23
  remoteSlices: ReadonlyArray<SliceSM>;
@@ -27,7 +27,7 @@ export const RenameSliceModal: React.FC<RenameSliceModalProps> = ({
27
27
  isRenameSliceModalOpen: isModalOpen(store, ModalKeysEnum.RENAME_SLICE),
28
28
  localLibs: getLibraries(store),
29
29
  remoteLibs: getRemoteSlices(store),
30
- })
30
+ }),
31
31
  );
32
32
 
33
33
  const handleOnSubmit = (values: SliceModalValues) => {
@@ -14,7 +14,7 @@ type SliceModalValuesValidity =
14
14
  export function validateSliceModalValues(
15
15
  { sliceName }: SliceModalValues,
16
16
  localLibs: ReadonlyArray<LibraryUI>,
17
- remoteLibs: ReadonlyArray<SliceSM>
17
+ remoteLibs: ReadonlyArray<SliceSM>,
18
18
  ): SliceModalValuesValidity {
19
19
  if (!sliceName) {
20
20
  return { sliceName: "Cannot be empty" };
@@ -37,7 +37,7 @@ export function validateSliceModalValues(
37
37
  }
38
38
 
39
39
  const localNames = localLibs.flatMap((lib) =>
40
- lib.components.map((slice) => slice.model.name)
40
+ lib.components.map((slice) => slice.model.name),
41
41
  );
42
42
  const remoteNames = remoteLibs.map((slice) => slice.name);
43
43
  const usedNames = [...localNames, ...remoteNames];
@@ -34,7 +34,7 @@ function Grid<T>({
34
34
  <span key={`${defineElementKey(elem)}-${i + 1}`}>
35
35
  {renderElem(elem, i)}
36
36
  </span>
37
- ) : null
37
+ ) : null,
38
38
  )}
39
39
  </Box>
40
40
  );
@@ -10,7 +10,7 @@ interface LiProps {
10
10
  const Li = forwardRef(
11
11
  (
12
12
  { children, Component = Flex, sx = {}, ...rest }: LiProps,
13
- ref: React.ForwardedRef<HTMLDivElement>
13
+ ref: React.ForwardedRef<HTMLDivElement>,
14
14
  ) => (
15
15
  <Component
16
16
  as="li"
@@ -26,7 +26,7 @@ const Li = forwardRef(
26
26
  >
27
27
  {children}
28
28
  </Component>
29
- )
29
+ ),
30
30
  );
31
31
 
32
32
  export default Li;
@@ -25,7 +25,7 @@ interface ListItemProps<F extends TabField, S extends AnyObjectSchema> {
25
25
  enterEditMode: (
26
26
  itemInfo: [string, F],
27
27
  modelFieldName: string | undefined,
28
- index: number
28
+ index: number,
29
29
  ) => void;
30
30
  modelFieldName?: string;
31
31
  renderFieldAccessor?: (key: string) => string;
@@ -123,7 +123,7 @@ function ListItem<F extends TabField, S extends AnyObjectSchema>({
123
123
  enterEditMode(
124
124
  [key, item.value],
125
125
  modelFieldName,
126
- index
126
+ index,
127
127
  )
128
128
  }
129
129
  />
@@ -35,7 +35,7 @@ export const getDraggedDomPosition = (event) => {
35
35
  clientWidth,
36
36
  clientY,
37
37
  clientX: parseFloat(
38
- window.getComputedStyle(draggedDOM.parentNode).paddingLeft
38
+ window.getComputedStyle(draggedDOM.parentNode).paddingLeft,
39
39
  ),
40
40
  };
41
41
  };
@@ -40,7 +40,7 @@ const LoginModal: React.FunctionComponent = () => {
40
40
  isOpen: isModalOpen(store, ModalKeysEnum.LOGIN),
41
41
  isLoginLoading: isLoading(store, LoadingKeysEnum.LOGIN),
42
42
  env: getEnvironment(store),
43
- })
43
+ }),
44
44
  );
45
45
 
46
46
  const { closeModals, startLoadingLogin, stopLoadingLogin, openToaster } =
@@ -66,7 +66,7 @@ const LoginModal: React.FunctionComponent = () => {
66
66
  Boolean(status.shortId) &&
67
67
  Boolean(status.intercomHash),
68
68
  3000,
69
- 60
69
+ 60,
70
70
  );
71
71
 
72
72
  openToaster("Logged in", ToasterType.SUCCESS);
@@ -24,12 +24,12 @@ type ModalCardProps<T extends FormikValues> = {
24
24
  field: string,
25
25
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
26
26
  value: any,
27
- shouldValidate?: boolean | undefined
27
+ shouldValidate?: boolean | undefined,
28
28
  ) => Promise<void | FormikErrors<FormikValues>>;
29
29
  values: T;
30
30
  setValues: (
31
31
  values: SetStateAction<T>,
32
- shouldValidate?: boolean | undefined
32
+ shouldValidate?: boolean | undefined,
33
33
  ) => void;
34
34
  }) => JSX.Element;
35
35
  close: () => void;
@@ -59,7 +59,7 @@ export const VideoItem = forwardRef<HTMLLIElement, VideoItemProps>(
59
59
  </SideNavListItem>
60
60
  </MaybeVideoTooltipWrapper>
61
61
  );
62
- }
62
+ },
63
63
  );
64
64
 
65
65
  type MaybeVideoTooltipWrapperProps = VideoItemProps & {
@@ -131,7 +131,7 @@ const OldVideoItem: FC<OldVideoItemProps> = ({
131
131
  }
132
132
  ref.current = node;
133
133
  },
134
- [hasSeenTutorialsToolTip]
134
+ [hasSeenTutorialsToolTip],
135
135
  );
136
136
 
137
137
  return (
@@ -153,7 +153,7 @@ describe("Side Navigation", () => {
153
153
  await user.click(link);
154
154
 
155
155
  expect(mockRouter.asPath).toBe(path);
156
- }
156
+ },
157
157
  );
158
158
 
159
159
  test("should display the number of changes on the 'Changes' item", async () => {
@@ -177,7 +177,7 @@ describe("Side Navigation", () => {
177
177
 
178
178
  expect(within(changesItem).queryByText("1")).not.toBeInTheDocument();
179
179
  expect(
180
- within(changesItem).queryByText("Logged out")
180
+ within(changesItem).queryByText("Logged out"),
181
181
  ).not.toBeInTheDocument();
182
182
  });
183
183
 
@@ -241,7 +241,7 @@ describe("Side Navigation", () => {
241
241
  .closest("a") as HTMLAnchorElement;
242
242
 
243
243
  expect(
244
- within(changesItem).queryByText("Logged out")
244
+ within(changesItem).queryByText("Logged out"),
245
245
  ).not.toBeInTheDocument();
246
246
  });
247
247
 
@@ -265,7 +265,7 @@ describe("Side Navigation", () => {
265
265
  createSliceMachineManagerMSWHandler({
266
266
  url: "http://localhost:3000/_manager",
267
267
  sliceMachineManager: manager,
268
- })
268
+ }),
269
269
  );
270
270
 
271
271
  renderSideNavigation({ canUpdate: true });
@@ -276,8 +276,8 @@ describe("Side Navigation", () => {
276
276
  await waitFor(() =>
277
277
  expect(link).toHaveAttribute(
278
278
  "href",
279
- "https://prismic.io/academy/prismic-and-nextjs"
280
- )
279
+ "https://prismic.io/academy/prismic-and-nextjs",
280
+ ),
281
281
  );
282
282
 
283
283
  expect(link).toHaveAttribute("target", "_blank");
@@ -290,7 +290,7 @@ describe("Side Navigation", () => {
290
290
  ?.parentElement as HTMLElement;
291
291
  expect(link).toHaveAttribute(
292
292
  "href",
293
- "https://youtube.com/playlist?list=PLUVZjQltoA3wnaQudcqQ3qdZNZ6hyfyhH"
293
+ "https://youtube.com/playlist?list=PLUVZjQltoA3wnaQudcqQ3qdZNZ6hyfyhH",
294
294
  );
295
295
  expect(link).toHaveAttribute("target", "_blank");
296
296
 
@@ -299,7 +299,7 @@ describe("Side Navigation", () => {
299
299
  const tooltip = await screen.findByRole("tooltip");
300
300
  expect(tooltip).toBeVisible();
301
301
  const closeButton = await within(tooltip).findByTestId(
302
- "video-tooltip-close-button"
302
+ "video-tooltip-close-button",
303
303
  );
304
304
  await user.click(closeButton);
305
305
 
@@ -66,7 +66,7 @@ const Navigation: FC = () => {
66
66
  })}
67
67
  href={CUSTOM_TYPES_CONFIG["page"].tablePagePathname}
68
68
  active={CUSTOM_TYPES_CONFIG["page"].matchesTablePagePathname(
69
- router.asPath
69
+ router.asPath,
70
70
  )}
71
71
  component={Link}
72
72
  Icon={CUSTOM_TYPES_CONFIG.page.Icon}
@@ -81,7 +81,7 @@ const Navigation: FC = () => {
81
81
  })}
82
82
  href={CUSTOM_TYPES_CONFIG["custom"].tablePagePathname}
83
83
  active={CUSTOM_TYPES_CONFIG["custom"].matchesTablePagePathname(
84
- router.asPath
84
+ router.asPath,
85
85
  )}
86
86
  component={Link}
87
87
  Icon={CUSTOM_TYPES_CONFIG.custom.Icon}
@@ -37,7 +37,7 @@ export const ReviewForm: FC<ReviewFormProps> = (props) => {
37
37
  (store: SliceMachineStoreType) => ({
38
38
  isReviewLoading: isLoading(store, LoadingKeysEnum.REVIEW),
39
39
  isLoginModalOpen: isModalOpen(store, ModalKeysEnum.LOGIN),
40
- })
40
+ }),
41
41
  );
42
42
  const { skipReview, sendAReview, startLoadingReview, stopLoadingReview } =
43
43
  useSliceMachineActions();
@@ -16,7 +16,7 @@ export const ReviewModal: FC = () => {
16
16
  customTypes: selectAllCustomTypes(store),
17
17
  libraries: getLibraries(store),
18
18
  lastSyncChange: getLastSyncChange(store),
19
- })
19
+ }),
20
20
  );
21
21
 
22
22
  const sliceCount =
@@ -33,13 +33,13 @@ export const ReviewModal: FC = () => {
33
33
  (customType) =>
34
34
  hasLocal(customType) &&
35
35
  customType.local.tabs.some(
36
- (tab) => tab.sliceZone && tab.sliceZone?.value.length > 0
37
- )
36
+ (tab) => tab.sliceZone && tab.sliceZone?.value.length > 0,
37
+ ),
38
38
  );
39
39
 
40
40
  const hasPushedAnHourAgo = Boolean(
41
41
  // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
42
- lastSyncChange && Date.now() - lastSyncChange >= 3600000
42
+ lastSyncChange && Date.now() - lastSyncChange >= 3600000,
43
43
  );
44
44
 
45
45
  const isAdvancedRepository =
@@ -96,9 +96,9 @@ const DropZone: React.FC<DropZoneProps> = ({
96
96
  (state: SliceMachineStoreType) => ({
97
97
  isLoadingScreenshot: isLoading(
98
98
  state,
99
- LoadingKeysEnum.GENERATE_SLICE_CUSTOM_SCREENSHOT
99
+ LoadingKeysEnum.GENERATE_SLICE_CUSTOM_SCREENSHOT,
100
100
  ),
101
- })
101
+ }),
102
102
  );
103
103
 
104
104
  const { FileInputRenderer, fileInputProps } = useCustomScreenshot({
@@ -107,7 +107,7 @@ const DropZone: React.FC<DropZoneProps> = ({
107
107
  variationID,
108
108
  slice,
109
109
  file,
110
- isDragActive ? "dragAndDrop" : "upload"
110
+ isDragActive ? "dragAndDrop" : "upload",
111
111
  );
112
112
  setIsHover(false);
113
113
  },
@@ -117,7 +117,7 @@ const DropZone: React.FC<DropZoneProps> = ({
117
117
  if (file.size > 128000000) {
118
118
  return openToaster(
119
119
  "File is too big. Max file size: 128Mb.",
120
- ToasterType.ERROR
120
+ ToasterType.ERROR,
121
121
  );
122
122
  }
123
123
  generateSliceCustomScreenshot(variationID, slice, file, "dragAndDrop");
@@ -131,7 +131,7 @@ const DropZone: React.FC<DropZoneProps> = ({
131
131
  const clipboardItems = await navigator.clipboard.read();
132
132
  if (clipboardItems[0] !== undefined) {
133
133
  const maybeType = clipboardItems[0].types.find((type) =>
134
- imageTypes.map((t) => `image/${t}`).includes(type)
134
+ imageTypes.map((t) => `image/${t}`).includes(type),
135
135
  );
136
136
  if (maybeType !== undefined) {
137
137
  const blob = await clipboardItems[0].getType(maybeType);
@@ -153,7 +153,7 @@ const DropZone: React.FC<DropZoneProps> = ({
153
153
  }
154
154
  return openToaster(
155
155
  `Only files of type ${imageTypes.join(", ")} are accepted.`,
156
- ToasterType.ERROR
156
+ ToasterType.ERROR,
157
157
  );
158
158
  }
159
159
  };
@@ -157,7 +157,7 @@ const VariationsList = ({
157
157
 
158
158
  const variationSetter = (
159
159
  defaultVariationSelector: SliceVariationSelector | undefined,
160
- slices: ComponentUI[]
160
+ slices: ComponentUI[],
161
161
  ) =>
162
162
  // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
163
163
  defaultVariationSelector ||
@@ -182,7 +182,7 @@ const ScreenshotChangesModal = ({
182
182
  }));
183
183
 
184
184
  const [variationSelector, setVariationSelector] = useState(
185
- variationSetter(defaultVariationSelector, slices)
185
+ variationSetter(defaultVariationSelector, slices),
186
186
  );
187
187
 
188
188
  useEffect(() => {
@@ -269,7 +269,7 @@ const ScreenshotChangesModal = ({
269
269
  {supportsClipboardRead ? <FigmaTip /> : undefined}
270
270
  {(() => {
271
271
  const slice = slices.find(
272
- (s) => s.model.id === variationSelector.sliceID
272
+ (s) => s.model.id === variationSelector.sliceID,
273
273
  );
274
274
  return slice ? (
275
275
  <VariationDropZone
@@ -22,9 +22,9 @@ const ScreenshotPreviewModal: React.FunctionComponent<ScreenshotModalProps> = ({
22
22
  (store: SliceMachineStoreType) => ({
23
23
  isScreenshotModalOpen: isModalOpen(
24
24
  store,
25
- ModalKeysEnum.SCREENSHOT_PREVIEW
25
+ ModalKeysEnum.SCREENSHOT_PREVIEW,
26
26
  ),
27
- })
27
+ }),
28
28
  );
29
29
 
30
30
  const { closeModals } = useSliceMachineActions();
@@ -16,7 +16,7 @@ import { VariationSM } from "@lib/models/common/Slice";
16
16
  const redirect = (
17
17
  model: ComponentUI,
18
18
  variation: { id: string } | undefined,
19
- isSimulator?: boolean
19
+ isSimulator?: boolean,
20
20
  ): void => {
21
21
  if (!variation) {
22
22
  void router.push(`/${model.href}/${model.model.name}`);
@@ -9,7 +9,7 @@ import { ScreenDimensions } from "@lib/models/common/Screenshots";
9
9
 
10
10
  function useSimulatorClient(): readonly [
11
11
  SimulatorClient | undefined,
12
- RefCallback<HTMLIFrameElement>
12
+ RefCallback<HTMLIFrameElement>,
13
13
  ] {
14
14
  const [client, setClient] = useState<SimulatorClient | undefined>();
15
15
  const clientRef = useRef<SimulatorClient>();
@@ -149,7 +149,7 @@ const IframeRenderer: React.FunctionComponent<IframeRendererProps> = ({
149
149
 
150
150
  export function getScaling(
151
151
  { height: iframeHeight, width: iframeWidth }: ScreenDimensions,
152
- { height: viewportHeight, width: viewportWidth }: ScreenDimensions
152
+ { height: viewportHeight, width: viewportWidth }: ScreenDimensions,
153
153
  ): number {
154
154
  if (iframeWidth > viewportWidth || iframeHeight > viewportHeight) {
155
155
  return iframeWidth - viewportWidth > iframeHeight - viewportHeight
@@ -83,7 +83,7 @@ const SetupModal: React.FC<{ isOpen: boolean }> = ({ isOpen }) => {
83
83
  isSimulatorAvailableForFramework:
84
84
  selectIsSimulatorAvailableForFramework(state),
85
85
  setupSteps: selectSetupSteps(state),
86
- })
86
+ }),
87
87
  );
88
88
 
89
89
  // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
@@ -30,7 +30,7 @@ export const Toolbar: React.FC<ToolbarProps> = ({
30
30
  actionsDisabled,
31
31
  }) => {
32
32
  const [selectedDropdown, setSelectedDropdown] = useState<string>(
33
- ScreenSizeOptions.DESKTOP
33
+ ScreenSizeOptions.DESKTOP,
34
34
  );
35
35
 
36
36
  const dropDownChangeHandler = (selected: string) => {
@@ -45,7 +45,7 @@ export const Toolbar: React.FC<ToolbarProps> = ({
45
45
  const screenSizeChangeHandler = (newScreenDimensions: ScreenDimensions) => {
46
46
  const matchingIndex = Object.values(ScreenSizes).findIndex(
47
47
  (dimension) =>
48
- JSON.stringify(dimension) === JSON.stringify(newScreenDimensions)
48
+ JSON.stringify(dimension) === JSON.stringify(newScreenDimensions),
49
49
  );
50
50
 
51
51
  const newDropDownState =
@@ -77,7 +77,7 @@ const Simulator: ComponentWithSliceProps = ({ slice, variation }) => {
77
77
  env: "prod",
78
78
  unsplashUrl: endpoints.PrismicUnsplash,
79
79
  }),
80
- [endpoints.PrismicOembed, endpoints.PrismicUnsplash]
80
+ [endpoints.PrismicOembed, endpoints.PrismicUnsplash],
81
81
  );
82
82
 
83
83
  const setupIntervalId = useRef<NodeJS.Timeout | null>(null);
@@ -156,14 +156,14 @@ const Simulator: ComponentWithSliceProps = ({ slice, variation }) => {
156
156
  };
157
157
 
158
158
  const [screenDimensions, setScreenDimensions] = useState<ScreenDimensions>(
159
- ScreenSizes[ScreenSizeOptions.DESKTOP]
159
+ ScreenSizes[ScreenSizeOptions.DESKTOP],
160
160
  );
161
161
 
162
162
  const sharedSlice = useMemo(() => Slices.fromSM(slice.model), [slice.model]);
163
163
 
164
164
  // state used only to store updates coming from the editor
165
165
  const [editorState, setEditorState] = useState<SharedSliceContent | null>(
166
- null
166
+ null,
167
167
  );
168
168
 
169
169
  // computed state that takes the editorState if any change
@@ -190,7 +190,7 @@ const Simulator: ComponentWithSliceProps = ({ slice, variation }) => {
190
190
  }
191
191
  ).id,
192
192
  // eslint-disable-next-line react-hooks/exhaustive-deps
193
- []
193
+ [],
194
194
  );
195
195
 
196
196
  // When the content change, we re-render the content but overwrite the newly
@@ -202,7 +202,7 @@ const Simulator: ComponentWithSliceProps = ({ slice, variation }) => {
202
202
  id: renderedSliceId,
203
203
  }),
204
204
  // eslint-disable-next-line react-hooks/exhaustive-deps
205
- [sharedSlice, editorContent]
205
+ [sharedSlice, editorContent],
206
206
  );
207
207
 
208
208
  const apiContent = useThrottle(renderSliceMockCb, 800, [