slice-machine-ui 1.26.1-beta.9 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (520) hide show
  1. package/.eslintrc.js +6 -1
  2. package/.storybook/preview.tsx +2 -1
  3. package/out/404.html +1 -1
  4. package/out/_next/static/QWi-WrYk9EtyMIs1RfQ3_/_buildManifest.js +1 -0
  5. package/out/_next/static/chunks/{183-ebd633fed7c74545.js → 183-6ad1d7303abecd2b.js} +1 -1
  6. package/out/_next/static/chunks/18539003-32a73014bab3a789.js +22 -0
  7. package/out/_next/static/chunks/188-2e42d5ebef697946.js +1 -0
  8. package/out/_next/static/chunks/569-2ae3e9666f3bf991.js +1 -0
  9. package/out/_next/static/chunks/614-5130fbdbcfab2d35.js +1 -0
  10. package/out/_next/static/chunks/661-78c8c89d258133b8.js +1 -0
  11. package/out/_next/static/chunks/756-b11a3060cdc2f2d3.js +10 -0
  12. package/out/_next/static/chunks/90-2d4bdae13d031364.js +1 -0
  13. package/out/_next/static/chunks/91-67c244a4a034c8de.js +1 -0
  14. package/out/_next/static/chunks/pages/_app-0fe871bb1059a05c.js +532 -0
  15. package/out/_next/static/chunks/pages/changelog-3f04a3d8747ae383.js +1 -0
  16. package/out/_next/static/chunks/pages/changes-ec62e7eb50d6f2be.js +1 -0
  17. package/out/_next/static/chunks/pages/custom-types/[customTypeId]-982ecf1d799b6bcf.js +1 -0
  18. package/out/_next/static/chunks/pages/{custom-types-3c8e721ec6802127.js → custom-types-900b40b54b74e6d6.js} +1 -1
  19. package/out/_next/static/chunks/pages/{index-cf93d16e9c63b6db.js → index-ccd2975faba412f6.js} +1 -1
  20. package/out/_next/static/chunks/pages/labs-830dde0b85d6dd01.js +1 -0
  21. package/out/_next/static/chunks/pages/page-types/[pageTypeId]-886fc28240831dae.js +1 -0
  22. package/out/_next/static/chunks/pages/settings-f61144a9387fd6f1.js +1 -0
  23. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-9bdb355306fca592.js +1 -0
  24. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-ad66e6c755798ce7.js +1 -0
  25. package/out/_next/static/chunks/pages/slices-d65be4ca817a766d.js +1 -0
  26. package/out/_next/static/css/037ba37d121d4afe.css +1 -0
  27. package/out/_next/static/css/22f264c93bd9d85f.css +1 -0
  28. package/out/_next/static/css/6279e95f6aff22d5.css +1 -0
  29. package/out/_next/static/css/824d6e761aed01d2.css +1 -0
  30. package/out/_next/static/css/e3ffbc7931a47375.css +1 -0
  31. package/out/_next/static/css/f01f60095c76c7fb.css +1 -0
  32. package/out/changelog.html +1 -1
  33. package/out/changes.html +1 -1
  34. package/out/custom-types/[customTypeId].html +1 -1
  35. package/out/custom-types.html +1 -1
  36. package/out/index.html +1 -1
  37. package/out/labs.html +1 -1
  38. package/out/page-types/[pageTypeId].html +1 -1
  39. package/out/settings.html +1 -1
  40. package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
  41. package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
  42. package/out/slices.html +1 -1
  43. package/package.json +10 -11
  44. package/sentry.client.config.ts +2 -1
  45. package/src/ErrorBoundary.tsx +1 -1
  46. package/src/apiClient.ts +13 -9
  47. package/src/components/BaseHoverCard/BaseHoverCard.module.css +18 -0
  48. package/src/components/BaseHoverCard/BaseHoverCard.module.css.d.ts +7 -0
  49. package/src/components/BaseHoverCard/BaseHoverCard.stories.tsx +1 -1
  50. package/src/components/BaseHoverCard/BaseHoverCard.test.tsx +1 -1
  51. package/src/components/BaseHoverCard/BaseHoverCard.tsx +2 -2
  52. package/src/components/BlankSlate/BlankSlate.module.css +74 -0
  53. package/src/components/BlankSlate/BlankSlate.module.css.d.ts +13 -0
  54. package/src/components/BlankSlate/BlankSlate.stories.tsx +1 -1
  55. package/src/components/BlankSlate/BlankSlate.tsx +1 -1
  56. package/src/components/BlankSlate/index.ts +1 -1
  57. package/src/components/Breadcrumb/Breadcrumb.tsx +1 -1
  58. package/src/components/Card/Card.module.css +202 -0
  59. package/src/components/Card/Card.module.css.d.ts +22 -0
  60. package/src/components/Card/Card.stories.tsx +3 -3
  61. package/src/components/Card/Card.tsx +8 -8
  62. package/src/components/CodeBlock/CodeBlock.module.css +46 -0
  63. package/src/components/CodeBlock/CodeBlock.module.css.d.ts +10 -0
  64. package/src/components/CodeBlock/CodeBlock.tsx +7 -7
  65. package/src/components/ContentTabs/ContentTabs.tsx +1 -1
  66. package/src/components/Count/Count.tsx +1 -1
  67. package/src/components/Divider/Divider.module.css +23 -0
  68. package/src/components/Divider/Divider.module.css.d.ts +7 -0
  69. package/src/components/Divider/Divider.stories.tsx +3 -4
  70. package/src/components/Divider/Divider.tsx +5 -8
  71. package/src/components/HoverCard/HoverCard.stories.tsx +3 -2
  72. package/src/components/HoverCard/HoverCard.test.tsx +2 -2
  73. package/src/components/HoverCard/HoverCard.tsx +2 -2
  74. package/src/components/HoverCard/index.ts +3 -3
  75. package/src/components/List/List.css.ts +4 -2
  76. package/src/components/PageLayout/PageLayout.module.css +1 -1
  77. package/src/components/SideNav/SideNav.module.css +1 -1
  78. package/src/components/SideNav/SideNav.stories.tsx +6 -6
  79. package/src/components/SideNav/SideNav.tsx +8 -8
  80. package/src/components/SideNav/SideNavEnvironmentSelector.tsx +10 -12
  81. package/src/components/Table/Table.stories.tsx +2 -2
  82. package/src/components/Table/Table.test.tsx +2 -2
  83. package/src/components/Table/Table.tsx +2 -2
  84. package/src/components/Table/index.ts +1 -1
  85. package/src/components/TextLink/TextLink.stories.tsx +1 -1
  86. package/src/components/TextLink/TextLink.tsx +1 -1
  87. package/src/domain/__tests__/customType.test.ts +1 -186
  88. package/src/domain/__tests__/group.test.ts +161 -0
  89. package/src/domain/__tests__/slice.test.ts +3 -3
  90. package/src/domain/customType.ts +1 -193
  91. package/src/domain/group.ts +89 -0
  92. package/src/domain/slice.ts +28 -12
  93. package/src/features/autoSave/AutoSaveStatusIndicator.tsx +2 -2
  94. package/src/features/changelog/useSliceMachineLatestNonBreakingVersion.ts +1 -1
  95. package/src/features/changelog/useSliceMachineReleaseNotes.ts +1 -1
  96. package/src/features/changelog/useSliceMachineVersions.ts +2 -2
  97. package/src/features/changes/BlankSlates/NoChangesBlankSlate.tsx +11 -14
  98. package/src/features/changes/PushChangesButton.tsx +5 -5
  99. package/src/features/changes/StatusBadge.tsx +2 -2
  100. package/src/features/customTypes/EditDropdown.tsx +6 -9
  101. package/src/features/customTypes/PageTypeOnboarding.tsx +5 -5
  102. package/src/features/customTypes/__tests__/CustomTypeBuilderPage.test.tsx +11 -12
  103. package/src/features/customTypes/__tests__/CustomTypesTablePage.test.tsx +11 -10
  104. package/src/features/customTypes/actions/convertCustomToPageType.ts +4 -4
  105. package/src/features/customTypes/actions/createCustomType.ts +5 -5
  106. package/src/features/customTypes/actions/deleteCustomType.ts +3 -3
  107. package/src/features/customTypes/actions/renameCustomType.ts +3 -3
  108. package/src/features/customTypes/customTypesBuilder/CustomTypeProvider.tsx +8 -8
  109. package/src/features/customTypes/customTypesBuilder/CustomTypesBuilderPage.tsx +17 -12
  110. package/src/features/customTypes/customTypesBuilder/PageSnippetDialog/PageSnippetDialog.module.css +8 -0
  111. package/src/features/customTypes/customTypesBuilder/PageSnippetDialog/PageSnippetDialog.module.css.d.ts +5 -0
  112. package/src/features/customTypes/customTypesBuilder/PageSnippetDialog/PageSnippetDialog.tsx +8 -8
  113. package/src/features/customTypes/customTypesBuilder/SliceZoneBlankSlate.tsx +3 -3
  114. package/src/features/customTypes/customTypesBuilder/useCustomType.ts +1 -1
  115. package/src/features/customTypes/customTypesConfig.ts +2 -2
  116. package/src/features/customTypes/customTypesTable/CustomTypesTable.tsx +16 -16
  117. package/src/features/customTypes/customTypesTable/CustomTypesTablePage.tsx +9 -9
  118. package/src/features/customTypes/customTypesTable/useCustomTypes.ts +8 -8
  119. package/src/features/documentation/MarkdownRenderer/MarkdownRenderer.module.css +11 -0
  120. package/src/features/documentation/MarkdownRenderer/MarkdownRenderer.module.css.d.ts +6 -0
  121. package/src/features/documentation/MarkdownRenderer/index.tsx +6 -7
  122. package/src/features/documentation/useDocumentation.ts +1 -1
  123. package/src/features/environments/actions/getActiveEnvironment.ts +1 -1
  124. package/src/features/environments/actions/getEnvironments.ts +1 -1
  125. package/src/features/environments/actions/setEnvironment.ts +3 -3
  126. package/src/features/inAppGuide/InAppGuideContext.tsx +2 -2
  127. package/src/features/inAppGuide/InAppGuideDialog.tsx +4 -4
  128. package/src/features/inAppGuide/inAppGuideContent.tsx +4 -4
  129. package/src/features/labs/labsList/LabsList.tsx +2 -2
  130. package/src/features/labs/labsList/LabsListItem.tsx +1 -1
  131. package/src/features/labs/labsList/LabsPage.tsx +5 -5
  132. package/src/features/labs/labsList/useLab.tsx +1 -1
  133. package/src/features/settings/SettingsPage.tsx +4 -4
  134. package/src/features/settings/git/ConnectGitRepository.tsx +9 -9
  135. package/src/features/settings/git/GitOwnerSelect.tsx +1 -1
  136. package/src/features/settings/git/GitProvider.ts +4 -4
  137. package/src/features/settings/git/GitProviderConnectButtons.tsx +1 -1
  138. package/src/features/settings/git/GitRepositoriesList.tsx +5 -5
  139. package/src/features/settings/git/GitRepositoriesSearch.tsx +5 -5
  140. package/src/features/settings/git/GitRepositoryConnectDialog.tsx +5 -8
  141. package/src/features/settings/git/useGitIntegrationExperiment.ts +1 -1
  142. package/src/features/settings/git/useGitOwners.ts +1 -1
  143. package/src/features/settings/git/useGitRepos.ts +1 -1
  144. package/src/features/settings/git/useLinkedGitRepos.ts +2 -2
  145. package/src/features/settings/git/useWriteAPIToken.ts +2 -2
  146. package/src/features/slices/actions/addSlicesToSliceZone.ts +2 -2
  147. package/src/features/slices/actions/createSlice.ts +5 -5
  148. package/src/features/slices/actions/deleteSlice.ts +1 -1
  149. package/src/features/slices/actions/renameSlice.ts +4 -4
  150. package/src/features/slices/actions/uploadSliceScreenshot.ts +2 -2
  151. package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewSliceDialog.tsx +9 -9
  152. package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewVariationDialog.tsx +6 -6
  153. package/src/features/slices/convertLegacySlice/ConvertLegacySliceButton.tsx +12 -12
  154. package/src/features/slices/convertLegacySlice/ConvertLegacySliceMergeWithIdenticalDialog.tsx +3 -3
  155. package/src/features/slices/convertLegacySlice/types.ts +2 -2
  156. package/src/features/slices/sliceBuilder/FloatingBackButton.tsx +6 -6
  157. package/src/features/slices/sliceBuilder/SliceBuilderProvider.tsx +9 -9
  158. package/src/features/slices/sliceBuilder/actions/deleteVariation.ts +4 -4
  159. package/src/features/slices/sliceBuilder/actions/renameVariation.ts +3 -3
  160. package/src/features/slices/sliceCards/NonSharedSliceCard.tsx +4 -4
  161. package/src/features/slices/sliceCards/SharedSliceCard.tsx +7 -7
  162. package/src/features/slicesTemplates/actions/createSlicesTemplates.ts +2 -2
  163. package/src/features/slicesTemplates/useSlicesTemplates.ts +2 -1
  164. package/src/features/sync/AutoSyncProvider.tsx +17 -17
  165. package/src/features/sync/actions/pushChanges.ts +4 -3
  166. package/src/features/sync/actions/trackPushChangesSuccess.ts +3 -3
  167. package/src/features/sync/components/AutoSyncStatusIndicator.module.css +1 -1
  168. package/src/features/sync/components/AutoSyncStatusIndicator.tsx +4 -4
  169. package/src/features/sync/fetchUnSyncChanges.ts +5 -5
  170. package/src/features/sync/getUnSyncChanges.ts +9 -9
  171. package/src/features/sync/useUnSyncChanges.ts +5 -5
  172. package/src/hooks/useActionQueue.tsx +5 -5
  173. package/src/hooks/useAdapterName.ts +1 -1
  174. package/src/hooks/useAuthStatus.ts +2 -2
  175. package/src/hooks/useCurrentSlice.tsx +4 -4
  176. package/src/hooks/useEditorContent.ts +5 -4
  177. package/src/hooks/useExperimentVariant.ts +2 -2
  178. package/src/hooks/useIsEmptyProject.ts +1 -1
  179. package/src/hooks/useRepositoryInformation.ts +2 -2
  180. package/src/hooks/useRouteChange.tsx +1 -1
  181. package/src/hooks/useSMTracker.ts +6 -6
  182. package/src/hooks/useScreenshotChangesModal.ts +5 -4
  183. package/src/hooks/useServerState.ts +4 -4
  184. package/src/hooks/useSliceMachineConfig.ts +2 -2
  185. package/src/hooks/useSliceMachineRunningVersion.ts +1 -1
  186. package/src/hooks/useThrottle.ts +1 -1
  187. package/src/hooks/useUpdateAvailable.ts +1 -1
  188. package/src/hooks/useWindowDimensions.ts +1 -1
  189. package/src/hooks/useWindowSize.ts +2 -1
  190. package/{components → src/legacy/components}/App/index.tsx +8 -8
  191. package/{components → src/legacy/components}/AppLayout/index.tsx +5 -6
  192. package/{components → src/legacy/components}/AuthInstructions/index.jsx +1 -1
  193. package/{components → src/legacy/components}/Button/index.tsx +1 -2
  194. package/{components → src/legacy/components}/Card/Default.jsx +2 -1
  195. package/{components → src/legacy/components}/Card/Preview.jsx +1 -1
  196. package/{components → src/legacy/components}/Card/WithTabs/index.jsx +4 -3
  197. package/{components → src/legacy/components}/Card/index.tsx +1 -0
  198. package/{components → src/legacy/components}/Changelog/index.tsx +8 -8
  199. package/{components → src/legacy/components}/Changelog/navigation/VersionBadge.tsx +2 -1
  200. package/{components → src/legacy/components}/Changelog/navigation/VersionTag.tsx +1 -0
  201. package/{components → src/legacy/components}/Changelog/navigation/index.tsx +6 -6
  202. package/{components → src/legacy/components}/Changelog/versionDetails/UpdateCommandBox.tsx +6 -6
  203. package/{components → src/legacy/components}/Changelog/versionDetails/VersionKindLabel.tsx +3 -4
  204. package/{components → src/legacy/components}/Changelog/versionDetails/index.tsx +5 -5
  205. package/{components → src/legacy/components}/ChangesEmptyState/AuthErrorPage.tsx +5 -5
  206. package/{components → src/legacy/components}/ChangesItems/ChangesItems.tsx +14 -14
  207. package/{components → src/legacy/components}/ChangesItems/DevCollaborationExperiment.tsx +3 -3
  208. package/{components → src/legacy/components}/CodeBlock/index.tsx +3 -3
  209. package/{components → src/legacy/components}/ConfigErrors/index.jsx +4 -3
  210. package/{components → src/legacy/components}/CustomTypeTable/changesPage.tsx +9 -8
  211. package/{components → src/legacy/components}/DeleteCTModal/index.tsx +9 -9
  212. package/{components → src/legacy/components}/DeleteDocumentsDrawer/AssociatedDocumentsCard.tsx +4 -4
  213. package/{components → src/legacy/components}/DeleteDocumentsDrawer/HardDeleteDocumentsDrawer.tsx +9 -9
  214. package/{components → src/legacy/components}/DeleteDocumentsDrawer/SoftDeleteDocumentsDrawer.tsx +9 -8
  215. package/{components → src/legacy/components}/DeleteSliceModal/index.tsx +6 -6
  216. package/{components → src/legacy/components}/DeleteVariationModal/index.tsx +6 -6
  217. package/{components → src/legacy/components}/DropDownSelector/index.tsx +2 -4
  218. package/{components → src/legacy/components}/EmptyState/index.tsx +3 -3
  219. package/{components → src/legacy/components}/FormFields/Array.jsx +2 -4
  220. package/{components → src/legacy/components}/FormFields/Checkbox.jsx +1 -1
  221. package/{components → src/legacy/components}/FormFields/CheckboxControl.jsx +1 -1
  222. package/{components → src/legacy/components}/FormFields/Input.tsx +3 -2
  223. package/{components → src/legacy/components}/FormFields/SelectDefaultValue.jsx +1 -1
  224. package/{components → src/legacy/components}/Forms/CreateCustomTypeModal/CreateCustomTypeModal.tsx +18 -18
  225. package/{components → src/legacy/components}/Forms/CreateSliceModal/CreateSliceModal.tsx +10 -10
  226. package/{components → src/legacy/components}/Forms/RenameCustomTypeModal/RenameCustomTypeModal.tsx +12 -12
  227. package/{components → src/legacy/components}/Forms/RenameSliceModal/RenameSliceModal.tsx +8 -8
  228. package/src/legacy/components/Forms/RenameVariationModal/RenameVariationModal.module.css.d.ts +5 -0
  229. package/{components → src/legacy/components}/Forms/RenameVariationModal/RenameVariationModal.tsx +6 -6
  230. package/{components → src/legacy/components}/Forms/components/InputBox.tsx +2 -2
  231. package/{components → src/legacy/components}/Forms/components/SelectRepeatable.tsx +4 -3
  232. package/{components → src/legacy/components}/Forms/formsValidator.ts +6 -4
  233. package/{components → src/legacy/components}/FullPage/index.tsx +1 -1
  234. package/{components → src/legacy/components}/ListItem/Header.tsx +3 -2
  235. package/{components → src/legacy/components}/ListItem/index.tsx +8 -10
  236. package/{components → src/legacy/components}/LoadingPage/index.tsx +1 -0
  237. package/{components → src/legacy/components}/LoginModal/index.tsx +22 -22
  238. package/{components → src/legacy/components}/ModalFormCard/index.tsx +7 -6
  239. package/{components → src/legacy/components}/Navigation/ChangesItem.tsx +18 -16
  240. package/{components → src/legacy/components}/Navigation/Environment.tsx +13 -13
  241. package/{components → src/legacy/components}/Navigation/RunningVersion.tsx +2 -2
  242. package/{components → src/legacy/components}/Navigation/UpdateBox.tsx +3 -3
  243. package/src/legacy/components/Navigation/VideoItem.module.css.d.ts +5 -0
  244. package/{components → src/legacy/components}/Navigation/VideoItem.tsx +14 -13
  245. package/src/legacy/components/Navigation/index.module.css.d.ts +5 -0
  246. package/{components → src/legacy/components}/Navigation/index.test.tsx +12 -12
  247. package/{components → src/legacy/components}/Navigation/index.tsx +20 -21
  248. package/{components → src/legacy/components}/ReviewModal/ReviewForm.tsx +12 -12
  249. package/{components → src/legacy/components}/ReviewModal/ReviewModal.tsx +6 -6
  250. package/{components → src/legacy/components}/ScreenshotChangesModal/VariationDropZone.tsx +7 -7
  251. package/{components → src/legacy/components}/ScreenshotChangesModal/index.tsx +12 -15
  252. package/{components → src/legacy/components}/ScreenshotChangesModal/useCustomScreenshot.tsx +1 -1
  253. package/{components → src/legacy/components}/ScreenshotPreviewModal/index.tsx +8 -7
  254. package/{components → src/legacy/components}/Simulator/components/FailedConnect/index.tsx +3 -3
  255. package/{components → src/legacy/components}/Simulator/components/Header/VariationsPopover/MenuList.tsx +2 -1
  256. package/{components → src/legacy/components}/Simulator/components/Header/VariationsPopover/index.tsx +4 -5
  257. package/{components → src/legacy/components}/Simulator/components/Header/index.tsx +7 -7
  258. package/{components → src/legacy/components}/Simulator/components/IframeRenderer/index.tsx +3 -4
  259. package/{components → src/legacy/components}/Simulator/components/Toolbar/ScreensizeInput/index.tsx +2 -1
  260. package/{components → src/legacy/components}/Simulator/components/Toolbar/index.tsx +4 -5
  261. package/{components → src/legacy/components}/Simulator/index.tsx +25 -30
  262. package/{components → src/legacy/components}/SliceMachineDrawer/index.tsx +3 -2
  263. package/{components → src/legacy/components}/ToasterContainer/index.tsx +3 -5
  264. package/{components → src/legacy/components}/Tooltip/TextWithTooltip.tsx +2 -2
  265. package/{components → src/legacy/components}/Tooltip/index.jsx +2 -2
  266. package/{components → src/legacy/components}/Warnings/index.jsx +1 -1
  267. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/DeleteSliceZoneModal.tsx +4 -4
  268. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/List.tsx +8 -8
  269. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/SlicesTemplatesModal.tsx +11 -11
  270. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/UpdateSliceZoneModal.tsx +3 -3
  271. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/UpdateSliceZoneModalList.tsx +4 -3
  272. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/index.tsx +26 -23
  273. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/sliceTemplatesComingSoon.ts +1 -1
  274. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabModal/InputBox.tsx +1 -1
  275. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabModal/create.tsx +2 -1
  276. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabModal/delete.tsx +2 -2
  277. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabModal/update.tsx +3 -2
  278. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabZone/index.tsx +34 -32
  279. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/index.tsx +5 -5
  280. package/{lib → src/legacy/lib}/builders/SliceBuilder/FieldZones/index.tsx +43 -52
  281. package/{lib → src/legacy/lib}/builders/SliceBuilder/SimulatorButton/index.tsx +12 -11
  282. package/{lib/builders/SliceBuilder/Sidebar → src/legacy/lib/builders/SliceBuilder/VariationsList}/AddVariationModal.tsx +7 -7
  283. package/src/legacy/lib/builders/SliceBuilder/VariationsList/VariationsList.module.css +10 -0
  284. package/src/legacy/lib/builders/SliceBuilder/VariationsList/VariationsList.module.css.d.ts +5 -0
  285. package/src/legacy/lib/builders/SliceBuilder/VariationsList/index.tsx +253 -0
  286. package/{lib → src/legacy/lib}/builders/SliceBuilder/index.tsx +18 -13
  287. package/{lib → src/legacy/lib}/builders/common/EditModal/Field.jsx +3 -5
  288. package/{lib → src/legacy/lib}/builders/common/EditModal/Form.jsx +1 -1
  289. package/{lib → src/legacy/lib}/builders/common/EditModal/index.jsx +14 -16
  290. package/{lib → src/legacy/lib}/builders/common/SelectFieldTypeModal/index.jsx +3 -4
  291. package/{lib → src/legacy/lib}/builders/common/Zone/Card/components/ErrorTooltip.tsx +2 -2
  292. package/{lib → src/legacy/lib}/builders/common/Zone/Card/components/Hints/CodeBlock.tsx +4 -5
  293. package/{lib → src/legacy/lib}/builders/common/Zone/Card/components/Hints/index.tsx +2 -1
  294. package/{lib → src/legacy/lib}/builders/common/Zone/Card/components/NewField.tsx +16 -13
  295. package/{lib → src/legacy/lib}/builders/common/Zone/Card/index.jsx +15 -9
  296. package/src/legacy/lib/builders/common/Zone/components/ZoneEmptyState/ZoneEmptyState.module.css +12 -0
  297. package/src/legacy/lib/builders/common/Zone/components/ZoneEmptyState/ZoneEmptyState.module.css.d.ts +5 -0
  298. package/src/legacy/lib/builders/common/Zone/components/ZoneEmptyState/ZoneEmptyState.tsx +39 -0
  299. package/src/legacy/lib/builders/common/Zone/components/ZoneEmptyState/index.tsx +1 -0
  300. package/{lib → src/legacy/lib}/builders/common/Zone/index.jsx +37 -19
  301. package/{lib → src/legacy/lib}/builders/utils/index.ts +1 -1
  302. package/{lib → src/legacy/lib}/forms/fields.ts +1 -2
  303. package/{lib → src/legacy/lib}/forms/index.ts +1 -0
  304. package/{lib → src/legacy/lib}/models/common/CustomType/index.ts +5 -4
  305. package/{lib → src/legacy/lib}/models/common/CustomType/sliceZone.ts +2 -1
  306. package/{lib → src/legacy/lib}/models/common/DeprecatedMockConfigMessage.tsx +3 -2
  307. package/{lib → src/legacy/lib}/models/common/Environment.ts +2 -2
  308. package/{lib → src/legacy/lib}/models/common/Group.ts +3 -2
  309. package/{lib → src/legacy/lib}/models/common/Library.ts +2 -1
  310. package/{lib → src/legacy/lib}/models/common/LibraryUI.ts +1 -1
  311. package/{lib → src/legacy/lib}/models/common/ModelData.ts +3 -3
  312. package/{lib → src/legacy/lib}/models/common/ModelStatus/compareCustomTypeModels.ts +2 -1
  313. package/{lib → src/legacy/lib}/models/common/ModelStatus/compareSliceModels.ts +2 -1
  314. package/{lib → src/legacy/lib}/models/common/ModelStatus/index.ts +10 -9
  315. package/{lib → src/legacy/lib}/models/common/Slice.ts +19 -5
  316. package/{lib → src/legacy/lib}/models/common/normalizers/customType.ts +2 -2
  317. package/{lib → src/legacy/lib}/models/common/normalizers/slices.ts +3 -2
  318. package/{lib → src/legacy/lib}/models/common/widgets/Boolean/index.ts +5 -7
  319. package/{lib → src/legacy/lib}/models/common/widgets/Color/index.ts +2 -3
  320. package/{lib → src/legacy/lib}/models/common/widgets/ContentRelationship/Form.tsx +9 -10
  321. package/{lib → src/legacy/lib}/models/common/widgets/ContentRelationship/index.ts +7 -7
  322. package/{lib → src/legacy/lib}/models/common/widgets/GeoPoint/index.ts +2 -3
  323. package/{lib → src/legacy/lib}/models/common/widgets/Group/Form.jsx +6 -6
  324. package/{lib → src/legacy/lib}/models/common/widgets/Group/ListItem/index.jsx +63 -76
  325. package/{lib → src/legacy/lib}/models/common/widgets/Group/index.ts +6 -4
  326. package/{lib → src/legacy/lib}/models/common/widgets/Image/Form.tsx +9 -11
  327. package/{lib → src/legacy/lib}/models/common/widgets/Image/components.tsx +6 -5
  328. package/{lib → src/legacy/lib}/models/common/widgets/Image/index.ts +3 -5
  329. package/{lib → src/legacy/lib}/models/common/widgets/Link/Form.jsx +5 -7
  330. package/{lib → src/legacy/lib}/models/common/widgets/LinkToMedia/Form.jsx +4 -6
  331. package/{lib → src/legacy/lib}/models/common/widgets/LinkToMedia/index.ts +4 -4
  332. package/{lib → src/legacy/lib}/models/common/widgets/Select/FormFields.jsx +7 -7
  333. package/{lib → src/legacy/lib}/models/common/widgets/Select/index.ts +3 -6
  334. package/{lib → src/legacy/lib}/models/common/widgets/StructuredText/Form.tsx +12 -11
  335. package/{lib → src/legacy/lib}/models/common/widgets/StructuredText/index.ts +3 -6
  336. package/{lib → src/legacy/lib}/models/common/widgets/StructuredText/options.tsx +2 -2
  337. package/{lib → src/legacy/lib}/models/common/widgets/Timestamp/index.ts +4 -5
  338. package/{lib → src/legacy/lib}/models/common/widgets/UID/index.ts +4 -5
  339. package/{lib → src/legacy/lib}/models/common/widgets/Widget.ts +3 -1
  340. package/src/legacy/lib/models/common/widgets/groupBuilderArray.ts +18 -0
  341. package/src/legacy/lib/models/common/widgets/sliceBuilderArray.ts +19 -0
  342. package/src/legacy/lib/models/common/widgets/withGroup.ts +2 -0
  343. package/{lib → src/legacy/lib}/models/server/ServerState.ts +4 -3
  344. package/{lib → src/legacy/lib}/utils/index.ts +4 -5
  345. package/{lib → src/legacy/lib}/utils/shared/customTypes.ts +1 -1
  346. package/src/modules/availableCustomTypes/index.ts +15 -13
  347. package/src/modules/availableCustomTypes/types.ts +2 -2
  348. package/src/modules/environment/index.ts +10 -8
  349. package/src/modules/environment/types.ts +1 -1
  350. package/src/modules/loading/index.ts +3 -2
  351. package/src/modules/modal/index.ts +4 -2
  352. package/src/modules/slices/index.ts +13 -9
  353. package/src/modules/slices/selector.ts +1 -1
  354. package/src/modules/slices/types.ts +2 -2
  355. package/src/modules/useSliceMachineActions.ts +25 -20
  356. package/src/modules/userContext/index.ts +5 -3
  357. package/{pages → src/pages}/_app.tsx +23 -25
  358. package/{pages → src/pages}/changelog.tsx +1 -1
  359. package/{pages → src/pages}/changes.tsx +22 -19
  360. package/src/pages/custom-types/[customTypeId].tsx +1 -0
  361. package/{pages → src/pages}/custom-types.tsx +1 -1
  362. package/{pages → src/pages}/index.tsx +3 -3
  363. package/src/pages/labs.tsx +1 -0
  364. package/src/pages/page-types/[pageTypeId].tsx +1 -0
  365. package/src/pages/settings.tsx +1 -0
  366. package/{pages → src/pages}/slices/[lib]/[sliceName]/[variation]/index.tsx +3 -3
  367. package/{pages → src/pages}/slices/[lib]/[sliceName]/[variation]/simulator.tsx +2 -2
  368. package/{pages → src/pages}/slices.tsx +21 -21
  369. package/src/redux/reducer.ts +8 -7
  370. package/src/redux/store.ts +8 -6
  371. package/src/redux/type.ts +7 -6
  372. package/src/theme.ts +1 -2
  373. package/src/utils/getContentTypeForTracking.ts +21 -0
  374. package/test/__setup__.ts +10 -8
  375. package/test/__testutils__/createTestPlugin.ts +3 -2
  376. package/test/__testutils__/createTestProject.ts +5 -4
  377. package/test/__testutils__/index.tsx +6 -5
  378. package/test/__testutils__/mockAWSACLAPI.ts +1 -1
  379. package/test/__testutils__/mockCustomTypesAPI.ts +1 -1
  380. package/test/__testutils__/mockPrismicAuthAPI.ts +1 -1
  381. package/test/__testutils__/mockPrismicUserAPI.ts +2 -3
  382. package/test/__testutils__/readMSWFormData.ts +1 -1
  383. package/test/components/IframeRenderer.test.ts +3 -2
  384. package/test/lib/builders/EditModal.test.tsx +5 -3
  385. package/test/lib/builders/buildersUtils.test.ts +3 -3
  386. package/test/lib/consts.test.ts +6 -2
  387. package/test/lib/models/common/CustomType.test.ts +6 -2
  388. package/test/lib/models/common/ModelStatus.test.ts +6 -4
  389. package/test/lib/models/common/Slice.test.ts +3 -2
  390. package/test/lib/models/common/widgets/index.test.ts +8 -4
  391. package/test/lib/utils/index.test.ts +3 -2
  392. package/test/lib/utils/preferWroomBase.test.ts +3 -2
  393. package/test/lib/utils/shared/customTypes.test.ts +2 -1
  394. package/test/pages/slices.test.tsx +10 -10
  395. package/test/src/modules/__fixtures__/serverState.ts +3 -3
  396. package/test/src/modules/__fixtures__/sliceUtilsFactory.ts +3 -3
  397. package/test/src/modules/availableCustomTypes/index.test.ts +3 -3
  398. package/test/src/modules/environment.test.ts +3 -5
  399. package/test/src/modules/loading.test.ts +3 -3
  400. package/test/src/modules/modal.test.ts +5 -5
  401. package/test/src/modules/slices.test.ts +3 -2
  402. package/test/src/modules/userContext.test.ts +3 -3
  403. package/test/src/normalizers/customType.test.ts +16 -3
  404. package/test/src/utils/fieldNameCreator.test.ts +1 -1
  405. package/tsconfig.json +1 -6
  406. package/vite.config.ts +5 -10
  407. package/lib/builders/SliceBuilder/Sidebar/index.tsx +0 -157
  408. package/lib/builders/common/Zone/components/EmptyState/index.tsx +0 -33
  409. package/lib/models/common/widgets/sliceBuilderArray.ts +0 -31
  410. package/lib/models/common/widgets/withGroup.ts +0 -20
  411. package/out/_next/static/chunks/18539003-a5a5d48f20a7b261.js +0 -97
  412. package/out/_next/static/chunks/25-792af14760d9df34.js +0 -1
  413. package/out/_next/static/chunks/286-e0950c3083c672e8.js +0 -1
  414. package/out/_next/static/chunks/318-77a29f41c3a027e3.js +0 -1
  415. package/out/_next/static/chunks/46-d22d7a121254e31d.js +0 -8
  416. package/out/_next/static/chunks/727-d0d6a29f0793bde2.js +0 -1
  417. package/out/_next/static/chunks/799-7b910b896ff60ebe.js +0 -1
  418. package/out/_next/static/chunks/869-868567cc5e32452f.js +0 -1
  419. package/out/_next/static/chunks/pages/_app-59bc66a6d9d39383.js +0 -436
  420. package/out/_next/static/chunks/pages/changelog-055db8139a22a592.js +0 -1
  421. package/out/_next/static/chunks/pages/changes-f43ad4ab5e00f9b9.js +0 -1
  422. package/out/_next/static/chunks/pages/custom-types/[customTypeId]-ad5936d95fafff44.js +0 -1
  423. package/out/_next/static/chunks/pages/labs-73a12d2fe0233fb9.js +0 -1
  424. package/out/_next/static/chunks/pages/page-types/[pageTypeId]-5ccb44e013a3b002.js +0 -1
  425. package/out/_next/static/chunks/pages/settings-417f1d5c1e558c88.js +0 -1
  426. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-01d67e97cb901e46.js +0 -1
  427. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-a8933b0ef10806cd.js +0 -1
  428. package/out/_next/static/chunks/pages/slices-3c9b08adf578b020.js +0 -1
  429. package/out/_next/static/css/0e0d6c4ec6bf7373.css +0 -1
  430. package/out/_next/static/css/27f2b9b9c9f65885.css +0 -1
  431. package/out/_next/static/css/57a7e5eb58b45860.css +0 -1
  432. package/out/_next/static/css/be1f49e49a5aa7eb.css +0 -1
  433. package/out/_next/static/css/f8eb526e10bc2441.css +0 -1
  434. package/out/_next/static/css/fa4e416634515cbb.css +0 -1
  435. package/out/_next/static/p-7eJUu7gNSRAriJWjZOw/_buildManifest.js +0 -1
  436. package/pages/custom-types/[customTypeId].tsx +0 -1
  437. package/pages/labs.tsx +0 -1
  438. package/pages/page-types/[pageTypeId].tsx +0 -1
  439. package/pages/settings.tsx +0 -1
  440. package/src/components/BaseHoverCard/BaseHoverCard.css.ts +0 -25
  441. package/src/components/BlankSlate/BlankSlate.css.ts +0 -96
  442. package/src/components/Card/Card.css.ts +0 -188
  443. package/src/components/CodeBlock/CodeBlock.css.ts +0 -37
  444. package/src/components/Divider/Divider.css.ts +0 -31
  445. package/src/features/customTypes/customTypesBuilder/PageSnippetDialog/PageSnippetDialog.css.ts +0 -12
  446. package/src/features/documentation/MarkdownRenderer/MarkdownRenderer.css.ts +0 -13
  447. package/src/features/slices/sliceBuilder/useGroupsInSlicesExperiment.ts +0 -8
  448. package/out/_next/static/{p-7eJUu7gNSRAriJWjZOw → QWi-WrYk9EtyMIs1RfQ3_}/_ssgManifest.js +0 -0
  449. package/{components → src/legacy/components}/Card/CardBox.tsx +0 -0
  450. package/{components → src/legacy/components}/Card/WithTabs/components.jsx +1 -1
  451. package/{components → src/legacy/components}/Changelog/versionDetails/ReleaseNotesDetails.tsx +1 -1
  452. package/{components → src/legacy/components}/ChangesEmptyState/OfflinePage.tsx +1 -1
  453. package/{components → src/legacy/components}/ChangesEmptyState/index.ts +1 -1
  454. package/{components → src/legacy/components}/ChangesItems/ErrorBanner.tsx +1 -1
  455. package/{components → src/legacy/components}/ChangesItems/index.ts +0 -0
  456. package/{components → src/legacy/components}/ChangesSectionHeader/ChangesSectionHeader.tsx +0 -0
  457. package/{components → src/legacy/components}/ChangesSectionHeader/index.ts +0 -0
  458. package/{components → src/legacy/components}/DeleteDocumentsDrawer/index.tsx +1 -1
  459. package/{components → src/legacy/components}/DropDownSelector/MenuList.tsx +0 -0
  460. package/{components → src/legacy/components}/Flex/index.tsx +0 -0
  461. package/{components → src/legacy/components}/FormFields/index.ts +0 -0
  462. package/{components → src/legacy/components}/Forms/CreateCustomTypeModal/index.tsx +0 -0
  463. package/{components → src/legacy/components}/Forms/CreateSliceModal/index.tsx +0 -0
  464. package/{components → src/legacy/components}/Forms/RenameCustomTypeModal/index.ts +0 -0
  465. package/{components → src/legacy/components}/Forms/RenameSliceModal/index.ts +0 -0
  466. package/{components → src/legacy/components}/Forms/RenameVariationModal/RenameVariationModal.module.css +0 -0
  467. package/{components → src/legacy/components}/Forms/RenameVariationModal/index.ts +0 -0
  468. package/{components → src/legacy/components}/Forms/components/FlexCard.tsx +0 -0
  469. package/{components → src/legacy/components}/Forms/formsTypes.ts +0 -0
  470. package/{components → src/legacy/components}/Grid/index.tsx +0 -0
  471. package/{components → src/legacy/components}/InputDeleteIcon/index.jsx +1 -1
  472. package/{components → src/legacy/components}/ItemHeader/index.tsx +1 -1
  473. package/{components → src/legacy/components}/Li/index.tsx +0 -0
  474. package/{components → src/legacy/components}/ListItem/utils.js +0 -0
  475. package/{components → src/legacy/components}/MissingLibraries/index.tsx +0 -0
  476. package/{components → src/legacy/components}/Navigation/VideoItem.module.css +0 -0
  477. package/{components → src/legacy/components}/Navigation/index.module.css +0 -0
  478. package/{components → src/legacy/components}/ReactTooltipPortal/index.tsx +0 -0
  479. package/{components → src/legacy/components}/ReviewModal/ReviewFormSelect.tsx +1 -1
  480. package/{components → src/legacy/components}/ReviewModal/index.ts +0 -0
  481. package/{components → src/legacy/components}/ScreenshotPreview/index.tsx +1 -1
  482. package/{components → src/legacy/components}/Simulator/components/FullPage/index.tsx +0 -0
  483. package/{components → src/legacy/components}/Simulator/components/Header/links.ts +0 -0
  484. package/{components → src/legacy/components}/SliceMachineIconButton/index.tsx +1 -1
  485. package/{components → src/legacy/components}/SliceMachineModal/index.tsx +1 -1
  486. package/{components → src/legacy/components}/WindowPortal/index.js +0 -0
  487. package/{components → src/legacy/components}/YoutubeEmbed/index.tsx +0 -0
  488. package/{lib → src/legacy/lib}/builders/common/SelectFieldTypeModal/FieldTypeCard.jsx +0 -0
  489. package/{lib → src/legacy/lib}/builders/common/Zone/Card/components/EditItem.jsx +0 -0
  490. package/{lib → src/legacy/lib}/consts.ts +0 -0
  491. package/{lib → src/legacy/lib}/env/sentry.ts +0 -0
  492. package/{lib → src/legacy/lib}/forms/defaults.ts +1 -1
  493. package/{lib → src/legacy/lib}/forms/types.ts +0 -0
  494. package/{lib → src/legacy/lib}/hljs/svelte.ts +0 -0
  495. package/{lib → src/legacy/lib}/models/common/Auth.ts +0 -0
  496. package/{lib → src/legacy/lib}/models/common/ComponentUI.ts +1 -1
  497. package/{lib → src/legacy/lib}/models/common/CustomType/tab.ts +4 -4
  498. package/{lib → src/legacy/lib}/models/common/ErrorWithStatus.ts +0 -0
  499. package/{lib → src/legacy/lib}/models/common/Fields.ts +1 -1
  500. package/{lib → src/legacy/lib}/models/common/Manifest.ts +0 -0
  501. package/{lib → src/legacy/lib}/models/common/PrismicData.ts +0 -0
  502. package/{lib → src/legacy/lib}/models/common/PrismicFile.ts +0 -0
  503. package/{lib → src/legacy/lib}/models/common/Screenshots.ts +0 -0
  504. package/{lib → src/legacy/lib}/models/common/Simulator.ts +0 -0
  505. package/{lib → src/legacy/lib}/models/common/Slices.ts +2 -2
  506. package/{lib → src/legacy/lib}/models/common/UserProfile.ts +0 -0
  507. package/{lib → src/legacy/lib}/models/common/Warning.ts +0 -0
  508. package/{lib → src/legacy/lib}/models/common/widgets/Date/index.ts +2 -2
  509. package/{lib → src/legacy/lib}/models/common/widgets/Embed/index.ts +2 -2
  510. package/{lib → src/legacy/lib}/models/common/widgets/Link/index.ts +3 -3
  511. package/{lib → src/legacy/lib}/models/common/widgets/Number/index.ts +2 -2
  512. package/{lib → src/legacy/lib}/models/common/widgets/Text/index.ts +5 -5
  513. package/{lib → src/legacy/lib}/models/common/widgets/ctBuilderArray.ts +0 -0
  514. package/{lib → src/legacy/lib}/models/common/widgets/index.ts +1 -1
  515. /package/{lib → src/legacy/lib}/prismic/endpoints.ts +0 -0
  516. /package/{lib → src/legacy/lib}/utils/poll.ts +0 -0
  517. /package/{lib → src/legacy/lib}/utils/preferWroomBase.ts +0 -0
  518. /package/{lib → src/legacy/lib}/utils/repo.ts +0 -0
  519. /package/{lib → src/legacy/lib}/utils/str.ts +0 -0
  520. /package/{pages → src/pages}/api/embed.js +0 -0
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[90],{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()}}}},12773:function(e,n,r){"use strict";r.d(n,{Z:function(){return L}});var i,t,s=r(62230),o=r(85244),a=r(52322),l=r(2784),c=r(951),u=r(75100),d=r(56580),x=r(75289),p=r(36416),h=r.n(p),f=function(e){var n=e.children;return(0,a.jsx)("kbd",{className:h().root,children:n})},v=function(e){return(0,a.jsxs)("svg",(0,o.Z)((0,s.Z)({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[(0,a.jsxs)("g",{clipPath:"url(#clip0_5065_192538)",children:[(0,a.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,a.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,a.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,a.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,a.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,a.jsx)("defs",{children:(0,a.jsx)("clipPath",{id:"clip0_5065_192538",children:(0,a.jsx)("rect",{width:"10.6688",height:"16",fill:"white",transform:"translate(7 4)"})})})]}))},g=r(98898),m=r(83399),j=r(77174),b=r(24340),y=r(90374);(t=i||(i={})).Mac="Mac",t.Linux="Linux",t.Windows="Windows";var C=function(){var e=navigator.userAgent,n=i.Linux;return Object.values(i).forEach(function(r){e.includes(r)&&(n=r)}),n},F=r(22710),w=r(99267),E=r(76473),I=r(88932),S=r(67557),D=r(82770);function k(e){return Z.apply(this,arguments)}function Z(){return(Z=(0,F.Z)(function(e){var n,r,i,t,a,l,c,u,d,x;return(0,w.__generator)(this,function(p){switch(p.label){case 0:n=e.variationId,r=e.slice,i=e.file,t=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:t}),[2,(0,o.Z)((0,s.Z)({},r),{screenshots:(0,o.Z)((0,s.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(47010),M=r(63094),R=function(e){var n=e.inputFile,r=e.handleFile,i=e.children,t=e.isDragActive;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(x.__,{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,a.jsx)("input",{id:"input-file",type:"file",ref:n,style:{display:"none"},accept:M.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)}})]})},H=function(){return(0,a.jsx)(x.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,a.jsxs)(x.kC,{variant:"boxes.centered",sx:{border:"1px dashed #6E56CF",height:"100%",width:"100%",borderRadius:"4px"},children:[(0,a.jsx)(A,{isActive:!0}),(0,a.jsx)(x.xv,{sx:{my:2},children:"Drop file here"}),(0,a.jsx)(x.xv,{variant:"secondary",children:"Maximum upload size file: 128Mb"})]})})},A=function(e){var n=e.isActive;return(0,a.jsx)(x.kC,{sx:{p:1,borderRadius:"50%",bg:n?"#F1EEFE":"#EDECEE",alignItems:"center",justifyContent:"center",width:"48px",height:"48px"},children:(0,a.jsx)(c.IEK,{style:{color:n?"#6E56CF":"#6F6E77",fontSize:"34px"}})})},z=function(e){var n,r,i,t,c,u,d=e.variationID,p=e.slice,h=e.imageTypes,f=void 0===h?M.nG:h,v=e.onUploadSuccess,g=p.screenshots[d],m=(0,y.Z)().saveSliceCustomScreenshotSuccess,j=(0,l.useState)(!1),b=j[0],C=j[1],S=(0,l.useState)(!1),D=S[0],Z=S[1],z=(0,l.useState)(!1),O=z[0],V=z[1];(0,E.y1)(["meta+v","ctrl+v"],function(){q()},[d,p,]);var P,B,L=(i=(r={onHandleFile:(n=(0,F.Z)(function(e,n){var r,i;return(0,w.__generator)(this,function(t){switch(t.label){case 0:return V(!0),[4,k({slice:p,file:e,method:n?"dragAndDrop":"upload",variationId:d})];case 1:return r=t.sent(),Z(!1),(i=null==r?void 0:r.screenshots[d])&&(m(d,i,r),v&&v(r)),V(!1),[2]}})}),function(e,r){return n.apply(this,arguments)})}).onHandleFile,t=(0,l.useRef)(null),c=(0,F.Z)(function(e,n){return(0,w.__generator)(this,function(r){switch(r.label){case 0:if(!e)return[3,2];return[4,i(e,n)];case 1:r.sent(),(null==t?void 0:t.current)&&(t.current.value=""),r.label=2;case 2:return[2]}})}),{handleFile:u=function(e,n){return c.apply(this,arguments)},inputFile:t,FileInputRenderer:R,fileInputProps:{inputFile:t,handleFile:u}}),N=L.FileInputRenderer,T=L.fileInputProps,U=(P=(0,F.Z)(function(e){var n,r;return(0,w.__generator)(this,function(i){switch(i.label){case 0:if(e.size>128e6)return[2,I.Am.error("File is too big. Max file size: 128Mb.")];return V(!0),[4,k({slice:p,file:e,method:"dragAndDrop",variationId:d})];case 1:return(r=null==(n=i.sent())?void 0:n.screenshots[d])&&(m(d,r,n),v&&v(n)),V(!1),[2]}})}),function(e){return P.apply(this,arguments)}),W="function"==typeof navigator.clipboard.read,q=(B=(0,F.Z)(function(){var e,n,r,i,t;return(0,w.__generator)(this,function(s){switch(s.label){case 0:if(!W)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 f.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,U(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 B.apply(this,arguments)}),G=function(e){e.preventDefault(),C(!1);var n,r=null===(n=e.dataTransfer.files)||void 0===n?void 0:n[0];if(void 0!==r)return f.some(function(e){return"image/".concat(e)===r.type})?void U(r):I.Am.error("Only files of type ".concat(f.join(", ")," are accepted."))},X=function(e){return function(n){n.preventDefault(),C(e)}},K=function(e){return function(n){n.preventDefault(),Z(e)}};return(0,a.jsxs)(x.kC,{as:"form",variant:"boxes.centered",sx:{bg:"#F9F8F9",position:"relative",borderRadius:"6px",height:"320px"},onDragEnter:X(!0),onDragLeave:X(!1),onDragOver:X(!0),onMouseEnter:K(!0),onMouseLeave:K(!1),onSubmit:function(e){return e.preventDefault()},onDrop:G,children:[O?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(x.$j,{}),(0,a.jsx)(x.xv,{sx:{my:2},children:"Uploading file ..."})]}):null,O||void 0===g?null:(0,a.jsx)(_.q,{src:g.url,sx:{width:"100%",height:"100%",maxHeight:"100%",backdropFilter:"blur(5px)"}}),O?null:(0,a.jsx)(x.kC,{sx:{p:2,position:"absolute",width:"100%",height:"100%",borderRadius:"6px",background:"#F9F8F9B2",justifyContent:"center",alignItems:"center",visibility:D||void 0===g?"visible":"hidden"},children:(0,a.jsx)(x.kC,{variant:"boxes.centered",sx:{border:"1px dashed #6E56CF",height:"100%",width:"100%",borderRadius:"4px"},children:(0,a.jsxs)(x.kC,{sx:{width:"100%",justifyContent:"center",alignItems:"center",flexDirection:"column"},children:[(0,a.jsx)(A,{isActive:b}),(0,a.jsx)(x.xv,{sx:{my:2},children:W?"Paste, drop or ...":"Drop or ..."}),(0,a.jsx)(N,(0,o.Z)((0,s.Z)({},T),{isDragActive:b})),(0,a.jsx)(x.xv,{sx:{color:"greyIcon",mt:1},children:"Maximum file size: 128Mb"})]})})}),b?(0,a.jsx)(H,{}):null]})},O=function(){var e,n=[i.Windows,i.Linux].includes(C())?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(f,{children:"ctrl"})," + ",(0,a.jsx)(f,{children:"shift"})," + ",(0,a.jsx)(f,{children:"c"})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(f,{children:"cmd"})," + ",(0,a.jsx)(f,{children:"shift"})," + ",(0,a.jsx)(f,{children:"c"})]});return(0,a.jsxs)(x.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,a.jsx)(v,{}),(0,a.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,a.jsx)(x.kC,{sx:{p:2,border:"1px solid #E4E2E4",borderRadius:"6px",bg:"#FFF"},children:n?(0,a.jsx)(c.Ypm,{style:{fontSize:"16px"}}):(0,a.jsx)(u.j6O,{style:{fontSize:"16px",color:"#ED811C"}})})},P=function(e){var n=e.slice,r=e.onSelectVariation,i=e.variationSelector;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(x.X6,{as:"h4",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n.model.name}),(0,a.jsx)(x.xu,{children:(0,a.jsx)(x.xu,{as:"ul",sx:{pl:0,my:3},children:n.model.variations.map(function(e){var t=i.sliceID,l=i.variationID,c=t===n.model.id&&l===e.id;return(0,a.jsx)(x.xu,{as:"li",sx:(0,o.Z)((0,s.Z)({listStyle:"none",my:2,p:2,cursor:"pointer",borderRadius:"4px"},c&&{bg:"#EDECEE",fontWeight:"500"}),{":hover":{bg:"#EDECEE"}}),onClick:function(){return r({sliceID:n.model.id,variationID:e.id})},children:(0,a.jsxs)(x.kC,{sx:{alignItems:"center"},children:[(0,a.jsx)(V,{isValid:!!n.screenshots[e.id]}),(0,a.jsx)(x.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)},L=function(e){var n=e.slices,r=e.defaultVariationSelector,i=e.onUploadSuccess,t=(0,y.Z)().closeModals,s=(0,d.v9)(function(e){return{isOpen:(0,j.gP)(e,b.q.SCREENSHOTS)}}).isOpen,o=(0,l.useState)(B(r,n)),c=o[0],u=o[1];if((0,l.useEffect)(function(){u(B(r,n))},[null==r?void 0:r.sliceID,null==r?void 0:r.variationID,s,]),0===n.length||!c)return null;var p,h="function"==typeof navigator.clipboard.read;return(0,a.jsx)(m.Z,{isOpen:s,shouldCloseOnOverlayClick:!0,onRequestClose:function(){return t()},children:(0,a.jsx)(g.Z,{radius:"0px",bodySx:{p:0,bg:"#FFF",position:"relative"},sx:{border:"none"},Header:function(e){var n=e.radius;return(0,a.jsxs)(x.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,a.jsx)(x.X6,{sx:{fontSize:"20px"},children:"Slice screenshots"}),(0,a.jsx)(x.x8,{type:"button",onClick:function(){return t()}})]})},Footer:null,children:(0,a.jsxs)(x.xu,{sx:{display:"flex",flexWrap:"wrap",height:"100%"},children:[(0,a.jsx)(x.xu,{sx:{p:3,bg:"grey07",flexGrow:1,overflow:"auto",maxHeight:"100%",flexBasis:"sidebar"},children:n.map(function(e,n){return(0,a.jsx)(P,{slice:e,variationSelector:c,onSelectVariation:u},"".concat(e.model.id,"-").concat(n))})}),(0,a.jsxs)(x.kC,{as:"main",sx:{p:3,flexGrow:99999,flexBasis:0,flexDirection:"column",minWidth:320,gap:"8px"},children:[h?(0,a.jsx)(O,{}):void 0,(p=n.find(function(e){return e.model.id===c.sliceID}))?(0,a.jsx)(z,{variationID:c.variationID,slice:p,onUploadSuccess:i}):null]})]})})})}},47010: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(65186),a=r(75289),l=(0,s.memo)(function(e){var n=e.src;return(0,t.jsx)(a.Ee,{src:n,alt:"Preview image",sx:{maxHeight:"100%"}})}),c=function(e){var n=e.src,r=e.sx;return(0,t.jsx)(a.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)(a.xv,{sx:{display:"flex",flexDirection:"column",alignItems:"center"},children:[(0,t.jsx)(o.eJU,{}),"You have no screenshot yet."]})})}},36416:function(e){e.exports={root:"Kbd_root__nBos2"}}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[91],{840:function(e,n,r){"use strict";r.d(n,{F:function(){return A}});var t=r(52322),s=r(22715),a=r(97729),i=r.n(a),l=r(2784),c=r(41730),o=r(8564),d=r(78656),u=r(38562),f=r(24448),h=r(5632),x=r(82032),p=r(67557),m=r(50002),j=r(6277);r(36332);var g=function(e){var n=e.children;return(0,t.jsx)("div",{className:"_1ecs97dffi _1ecs97dffn _1ecs97d3j4 _1ecs97d3qh _1ecs97dfh9 _1ecs97dfil _1ecs97dfiz _1ecs97dfg9",children:(0,t.jsx)("table",{className:"gdfsm51 _1ecs97dffi _1ecs97dffn _1ecs97dfk8 _1ecs97dfle",children:n})})},C=(0,l.createContext)("body");function v(){return(0,l.useContext)(C)}var b=function(e){var n=e.children;return(0,t.jsx)(C.Provider,{value:"head",children:(0,t.jsx)("thead",{className:"gdfsm52 _1ecs97dffi _1ecs97dffn _1ecs97d18 _1ecs97d8l",children:n})})},_=function(e){var n=e.children;return(0,t.jsx)(C.Provider,{value:"body",children:(0,t.jsx)("tbody",{className:"gdfsm53 _1ecs97dffi _1ecs97dffn",children:n})})},y=function(e){var n,r=e.children,s=e.onClick,a=v();return(0,t.jsx)("tr",{className:(0,j.W)("_1ecs97dffi _1ecs97dffn _1ecs97dfnk",(n={},(0,p.Z)(n,"_1ecs97dfkk",!!s),(0,p.Z)(n,"_1ecs97dm _1ecs97d7z _1ecs97d3c _1ecs97dap _1ecs97d2w _1ecs97da9 _1ecs97dfnn _1ecs97dfzr _1ecs97dfgv _1ecs97dfzu","body"===a),n)),onClick:function(e){var n,r=e.target;if(s&&e.currentTarget.contains(r)){var t=(0,m.JY)(r);(null===(n=null==t?void 0:t.contains(e.currentTarget))||void 0===n||n)&&s(e)}},children:r})},S=function(e){var n=e.children,r=v();return(0,t.jsx)("head"===r?"th":"td",{className:"gdfsm55 _1ecs97dffi _1ecs97dffn _1ecs97d3j4 _1ecs97d3qh _1ecs97dfiz _1ecs97dffj _1ecs97dah2 _1ecs97daof _1ecs97dfko _1ecs97dfy1",children:(0,t.jsx)("div",{className:"gdfsm56 _1ecs97dffi _1ecs97dffk",children:n})})},w=function(){return(0,t.jsxs)("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("path",{d:"M8 28H24C25.1046 28 26 27.1046 26 26V9L21 4H8C6.89543 4 6 4.89543 6 6V26C6 27.1046 6.89543 28 8 28Z",fill:"#6E56CF"}),(0,t.jsx)("path",{d:"M23 9H26L21 4V7C21 8.10457 21.8954 9 23 9Z",fill:"#9E8CFC"}),(0,t.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.0912 12C13.2794 12 11 14.2794 11 17.0912C11 19.903 13.2794 22.1824 16.0912 22.1824C17.9763 22.1824 19.6215 21.1577 20.501 19.6372C20.6563 19.3688 20.7878 19.0849 20.8926 18.7883C20.9846 18.5279 20.8482 18.2422 20.5878 18.1502C20.3275 18.0582 20.0418 18.1947 19.9498 18.455C19.8657 18.693 19.7601 18.9209 19.6354 19.1365C18.9273 20.3606 17.6049 21.1824 16.0912 21.1824C13.8317 21.1824 12 19.3507 12 17.0912C12 14.8317 13.8317 13 16.0912 13C17.4478 13 18.6507 13.66 19.3955 14.6782H17.6216C17.3455 14.6782 17.1216 14.9021 17.1216 15.1782C17.1216 15.4544 17.3455 15.6782 17.6216 15.6782H20.2998C20.576 15.6782 20.7998 15.4544 20.7998 15.1782V12.5C20.7998 12.2239 20.576 12 20.2998 12C20.0237 12 19.7998 12.2239 19.7998 12.5V13.6032C18.8717 12.6167 17.5536 12 16.0912 12Z",fill:"white"})]})},k=function(){return(0,t.jsxs)("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("path",{d:"M8 28H24C25.1046 28 26 27.1046 26 26V9L21 4H8C6.89543 4 6 4.89543 6 6V26C6 27.1046 6.89543 28 8 28Z",fill:"#6E56CF"}),(0,t.jsx)("path",{d:"M23 9H26L21 4V7C21 8.10457 21.8954 9 23 9Z",fill:"#9E8CFC"}),(0,t.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.0869 14.6818L14.6627 12.3787C14.7183 12.1561 14.9183 12 15.1477 12C15.473 12 15.7117 12.3057 15.6328 12.6213L15.1177 14.6818H17.7232L18.299 12.3787C18.3547 12.1561 18.5547 12 18.7841 12C19.1094 12 19.3481 12.3057 19.2692 12.6213L18.754 14.6818H21C21.2761 14.6818 21.5 14.9057 21.5 15.1818C21.5 15.458 21.2761 15.6818 21 15.6818H18.504L17.8449 18.3182H20C20.2761 18.3182 20.5 18.542 20.5 18.8182C20.5 19.0943 20.2761 19.3182 20 19.3182H17.5949L17.0192 21.6213C16.9635 21.8439 16.7635 22 16.5341 22C16.2088 22 15.9701 21.6943 16.049 21.3787L16.5642 19.3182H13.9586L13.3828 21.6213C13.3272 21.8439 13.1272 22 12.8977 22C12.5724 22 12.3338 21.6943 12.4127 21.3787L12.9278 19.3182H11C10.7239 19.3182 10.5 19.0943 10.5 18.8182C10.5 18.542 10.7239 18.3182 11 18.3182H13.1778L13.8369 15.6818H12C11.7239 15.6818 11.5 15.458 11.5 15.1818C11.5 14.9057 11.7239 14.6818 12 14.6818H14.0869ZM16.8142 18.3182L17.4732 15.6818H14.8677L14.2086 18.3182H16.8142Z",fill:"white"})]})},L=r(67445),Z=r(54845),T=r(22710),H=r(99267),I=r(18566),R=r(56580),N=r(15354),V=r(52312),z=r(81038),M=r(28849);function E(e){return F.apply(this,arguments)}function F(){return(F=(0,T.Z)(function(e){var n,r,t;return(0,H.__generator)(this,function(s){switch(s.label){case 0:return[4,z.j.customTypes.readAllCustomTypes({format:e})];case 1:if(r=(n=s.sent()).errors,t=n.models,r.length>0)throw r;return[2,t.map(function(e){return e.model})]}})})).apply(this,arguments)}var P=function(e){var n,r,a,i,c,o,u=e.format,f=e.isCreatingCustomType,p=e.openCreateCustomTypeModal,m=(0,h.useRouter)(),j=(r=(0,l.useCallback)(function(e){return(0,I.VA)(E,[u],e)},[u]),{customTypes:(0,I.QT)(E,[u]),updateCustomTypes:r}),C=j.customTypes,v=j.updateCustomTypes,T=C.sort(function(e,n){return e.id.localeCompare(n.id)}),H=L.cd[u],z=d.$[u];return(o=(0,R.v9)(function(e){return{storeCustomTypes:(0,M.Ch)(e).filter(V.TG)}}).storeCustomTypes,(0,l.useEffect)(function(){var e=o.filter(function(e){return e.local.format===u});(e.length!==C.length||e.some(function(e){var n=C.find(function(n){return n.id===e.local.id});return!n||JSON.stringify(N.Dc.fromSM(e.local))!==JSON.stringify(n)}))&&v(e.map(function(e){var n=e.local;return N.Dc.fromSM(n)}))},[u,v,C,o]),0===T.length)?(0,t.jsxs)(x.R$,{"data-testid":"blank-slate",style:{alignSelf:"center",marginTop:s.TV.size[72]},children:[(0,t.jsx)(x.u2,{children:(0,t.jsx)(s.Ee,{src:H.blankSlateImage,sizing:"cover"})}),(0,t.jsxs)(x.T9,{children:[(0,t.jsx)(x._T,{children:z.name({start:!0,plural:!0})}),(0,t.jsx)(x.nf,{children:z.blankSlateDescription}),(0,t.jsx)(x.Qj,{children:(0,t.jsx)(s.zx,{onClick:p,loading:f,children:"Create"})})]})]}):(0,t.jsxs)(g,{children:[(0,t.jsx)(b,{children:(0,t.jsxs)(y,{children:[(0,t.jsx)(S,{children:(0,t.jsx)(s.I5,{name:"notes",size:"medium"})}),(0,t.jsx)(S,{children:"Label"}),(0,t.jsx)(S,{children:"API ID"}),(0,t.jsx)(S,{children:"Limit"}),(0,t.jsx)(S,{})]})}),(0,t.jsx)(_,{children:T.map(function(e){var n=e.repeatable,r=e.label,s=e.id;return(0,t.jsxs)(y,{onClick:function(){m.push(L.cd[u].getBuilderPagePathname(s))},children:[(0,t.jsx)(S,{children:n?(0,t.jsx)(w,{}):(0,t.jsx)(k,{})}),(0,t.jsx)(S,{children:r}),(0,t.jsx)(S,{children:s}),(0,t.jsx)(S,{children:n?"Reusable":"Single"}),(0,t.jsx)(S,{children:(0,t.jsx)(Z._,{isChangesLocal:!1,format:u,customType:e})})]},s)})})]})},A=function(e){var n=e.format,r=d.$[n],a=(0,l.useState)(!1),h=a[0],x=a[1],p=(0,l.useState)(!1),m=p[0],j=p[1];return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i(),{children:(0,t.jsxs)("title",{children:[r.name({start:!0,plural:!0})," - Slice Machine"]})}),(0,t.jsx)(o.S,{renderError:function(){return(0,t.jsx)(u.LN,{children:(0,t.jsx)(u.RN,{children:(0,t.jsx)(s.xu,{alignItems:"center",justifyContent:"center",children:(0,t.jsx)(s.Iq,{title:"Request failed",description:"An error occurred while fetching your ".concat(r.name({start:!1,plural:!0}),".")})})})})},children:(0,t.jsx)(l.Suspense,{fallback:(0,t.jsxs)(u.LN,{children:[(0,t.jsxs)(u.wd,{children:[(0,t.jsx)(u.Cx,{children:(0,t.jsx)(c.g,{children:r.name({start:!0,plural:!0})})}),(0,t.jsx)(u.K2,{children:(0,t.jsx)(s.zx,{disabled:!0,startIcon:"add",children:"Create"})})]}),(0,t.jsx)(u.RN,{children:(0,t.jsx)(s._3,{})})]}),children:(0,t.jsxs)(u.LN,{children:[(0,t.jsxs)(u.wd,{children:[(0,t.jsx)(u.Cx,{children:(0,t.jsx)(c.g,{children:r.name({start:!0,plural:!0})})}),(0,t.jsx)(u.K2,{children:(0,t.jsx)(s.zx,{"data-testid":"create-ct",loading:h,onClick:function(){j(!0)},startIcon:"add",children:"Create"})})]}),(0,t.jsx)(u.RN,{children:(0,t.jsxs)(s.xu,{flexDirection:"column",children:[(0,t.jsx)(P,{format:n,isCreatingCustomType:h,openCreateCustomTypeModal:function(){j(!0)}}),(0,t.jsx)(f.M,{format:n,isCreating:h,isOpen:m,onCreateChange:x,onOpenChange:j})]})})]})})})]})}},98898:function(e,n,r){"use strict";r.d(n,{Z:function(){return o}});var t=r(62230),s=r(85244),a=r(98240),i=r(52322);r(2784);var l=r(75289),c=function(e){var n=e.bg,r=e.background,s=e.sx,a=e.withRadius,c=e.radius,o=e.children;return(0,i.jsx)(l.xu,{sx:(0,t.Z)({p:4,bg:n||r},a?{borderBottomLeftRadius:c,borderBottomRightRadius:c}:null,s),children:o})},o=function(e){var n=e.Header,r=void 0===n?null:n,o=e.SubHeader,d=void 0===o?null:o,u=e.Body,f=void 0===u?null:u,h=e.Footer,x=void 0===h?null:h,p=e.borderFooter,m=e.radius,j=void 0===m?"6px":m,g=e.bodySx,C=e.footerSx,v=e.sx,b=e.bg,_=e.background,y=e.children,S=(0,a.Z)(e,["Header","SubHeader","Body","Footer","borderFooter","radius","bodySx","footerSx","sx","bg","background","children"]);return(0,i.jsxs)(l.Zb,(0,s.Z)((0,t.Z)({sx:(0,t.Z)({border:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.borders))},borderRadius:j},void 0===v?null:v)},S),{children:[r?(0,i.jsx)(r,{radius:j}):null,d?(0,i.jsx)(d,{radius:j}):null,(0,i.jsxs)(c,{bg:b,background:_,sx:void 0===g?{}:g,withRadius:!x,children:[f?(0,i.jsx)(f,{}):null,y||null]}),x?(0,i.jsx)(c,{bg:b,background:_,sx:(0,t.Z)({},void 0!==p&&p?{borderTop:function(e){var n=e.colors;return"1px solid ".concat(String(null==n?void 0:n.borders))}}:null,void 0===C?{}:C),radius:j,withRadius:!0,children:"object"==typeof x?x:(0,i.jsx)(x,{})}):null]}))}},24448:function(e,n,r){"use strict";r.d(n,{M:function(){return I}});var t=r(22710),s=r(62230),a=r(85244),i=r(99267),l=r(52322),c=r(5632),o=r(2784),d=r(56580),u=r(75289),f=r(91061),h=r(88932),x=r(82770),p=r(6777),m=r(78656);function j(){return(j=(0,t.Z)(function(e){var n,r,t,s,a,l,c,o,d,u;return(0,i.__generator)(this,function(i){switch(i.label){case 0:n=e.id,r=e.label,t=e.repeatable,s=e.format,a=e.onSuccess,l=m.$[s],c=(0,f.Ue)({id:n,label:r,repeatable:t,format:s}),i.label=1;case 1:return i.trys.push([1,4,,5]),[4,(0,x.KA)(c)];case 2:if((o=i.sent().errors).length>0)throw o;return x.Xe.track({event:"custom-type:created",id:c.id,name:r,format:s,type:t?"repeatable":"single",origin:"table"}),[4,a(c)];case 3:return i.sent(),h.Am.success((0,p.GX)({message:"".concat(l.name({start:!0,plural:!1})," saved successfully at "),path:"./customtypes/".concat(c.id,"/index.json")})),[3,5];case 4:return d=i.sent(),u="Internal Error: ".concat(l.name({start:!0,plural:!1})," not saved"),console.error(u,d),h.Am.error(u),[3,5];case 5:return[2]}})})).apply(this,arguments)}var g=r(67445),C=r(50950),v=r(6134),b=r(63094),_=r(17384),y=r(28849),S=r(90374),w=r(36960),k=r(17064),L=r(63397),Z=r(98240),T=function(e){var n=e.selected,r=(0,Z.Z)(e,["selected"]);return(0,l.jsx)(u.kC,(0,s.Z)({sx:{p:"24px",mb:3,alignItems:"top",cursor:"pointer",borderRadius:"6px",backgroundColor:"grayLight",boxShadow:n?function(e){var n;return"0 0 0 2px ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.primary))}:"none","&:hover":{boxShadow:function(e){var n;return"0 0 0 2px ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.primary))}}}},r))},H=function(e){var n=e.format,r=(0,k.Z)((0,L.U$)("repeatable"),3),t=r[0],s=r[2],a=m.$[n];return(0,l.jsxs)(u.xu,{mb:2,children:[(0,l.jsxs)(T,{selected:t.value,onClick:function(){return s.setValue(!0)},children:[(0,l.jsx)(u.Y8,{checked:t.value,onChange:function(){},"data-testid":"repeatable-type-radio-btn"}),(0,l.jsxs)(u.xu,{sx:{marginLeft:2},children:["Reusable type",(0,l.jsx)(u.xu,{as:"p",sx:{fontSize:"12px",color:"textClear",mt:1},children:a.hintRepeatable})]})]}),(0,l.jsxs)(T,{selected:!t.value,onClick:function(){return s.setValue(!1)},children:[(0,l.jsx)(u.Y8,{checked:!t.value,onChange:function(){},"data-testid":"single-type-radio-btn"}),(0,l.jsxs)(u.xu,{sx:{marginLeft:2},children:["Single type",(0,l.jsx)(u.xu,{as:"p",sx:{fontSize:"12px",color:"textClear",mt:1},children:a.hintSingle})]})]})]})},I=function(e){var n,r=e.format,h=e.isCreating,x=e.isOpen,p=e.origin,k=void 0===p?"table":p,L=e.onCreateChange,Z=e.onOpenChange,T=(0,S.Z)().createCustomTypeSuccess,I=(0,d.v9)(function(e){return{customTypeIds:(0,y.W6)(e),customTypeLabels:(0,y.YS)(e)}}),R=I.customTypeIds,N=I.customTypeLabels,V=m.$[r],z=(0,o.useState)(!0),M=z[0],E=z[1],F=(0,C.g)().syncChanges,P=(0,c.useRouter)(),A=(n=(0,t.Z)(function(e){var n,s,a;return(0,i.__generator)(this,function(l){switch(l.label){case 0:var c;return n=e.id,s=e.label,a=e.repeatable,L(!0),[4,function(e){return j.apply(this,arguments)}({format:r,id:n,label:s,origin:k,repeatable:a,onSuccess:(c=(0,t.Z)(function(e){var r,t;return(0,i.__generator)(this,function(s){switch(s.label){case 0:return T(e),r=(0,f.y6)(e),t=g.cd[r],E(!0),[4,P.push({pathname:t.getBuilderPagePathname(n),query:"page"===e.format?{newPageType:!0}:void 0})];case 1:return s.sent(),F(),[2]}})}),function(e){return c.apply(this,arguments)})})];case 1:return l.sent(),L(!1),Z(!1),[2]}})}),function(e){return n.apply(this,arguments)}),D=function(e,n,r){r(M?(0,a.Z)((0,s.Z)({},n),{label:e.target.value,id:(0,_.lV)(e.target.value)}):(0,a.Z)((0,s.Z)({},n),{label:e.target.value}))},O=function(e,n){n("id",e.target.value),E(!1)};return(0,l.jsx)(v.Z,{testId:"create-ct-modal",isOpen:x,widthInPx:"530px",formId:"create-custom-type",buttonLabel:"Create",close:function(){Z(!1),E(!0)},onSubmit:function(e){A(e)},isLoading:h,initialValues:{repeatable:!0,id:"",label:""},validate:function(e){var n=e.id,r=e.label,t={};return r&&r.length||(t.label="Cannot be empty."),!t.label&&N.includes(r)&&(t.label="".concat(V.name({start:!0,plural:!1})," name is already taken.")),n&&n.length||(t.id="ID cannot be empty."),t.id||!n||b.xo.exec(n)||(t.id="Invalid id: No special characters allowed."),!t.id&&n&&R.map(function(e){return e.toLowerCase()}).includes(n)&&(t.id='ID "'.concat(n,'" exists already.')),Object.keys(t).length>0?t:void 0},content:{title:"Create a new ".concat(V.name({start:!1,plural:!1}))},children:function(e){var n=e.errors,t=e.setValues,s=e.setFieldValue,a=e.values,i=e.touched;return(0,l.jsxs)(u.xu,{children:[(0,l.jsx)(H,{format:r}),(0,l.jsx)(w.W,{name:"label",label:"".concat(V.name({start:!0,plural:!1})," Name"),testId:"ct-name-input",placeholder:"A display name for the ".concat(V.name({start:!1,plural:!1})),error:i.label?n.label:void 0,onChange:function(e){return D(e,a,t)}}),(0,l.jsx)(w.W,{name:"id",testId:"ct-id-input",label:"".concat(V.name({start:!0,plural:!1})," ID"),placeholder:V.inputPlaceholder,error:i.id?n.id:void 0,onChange:function(e){return O(e,s)}})]})}})}},63094:function(e,n,r){"use strict";r.d(n,{Sn:function(){return l},lS:function(){return t},nG:function(){return s},pq:function(){return c},rd:function(){return i},xo:function(){return a}});var t=["components"],s=["png","jpg","jpeg"],a=/^[A-Za-z0-9]+(?:_[A-Za-z0-9]+)*$/,i="placeholders/What_are_Slices_mrvome",l="SM_HELP_VIDEOS/mock_data",c="slice-machine-simulator"},36332:function(){}}]);