slice-machine-ui 1.26.1-beta.1 → 1.26.1-beta.11

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 (391) hide show
  1. package/.eslintrc.js +6 -1
  2. package/.storybook/preview.tsx +2 -1
  3. package/components/App/index.tsx +6 -7
  4. package/components/AppLayout/index.tsx +6 -8
  5. package/components/AuthInstructions/index.jsx +1 -1
  6. package/components/Button/index.tsx +1 -2
  7. package/components/Card/Default.jsx +2 -1
  8. package/components/Card/Preview.jsx +1 -1
  9. package/components/Card/WithTabs/components.jsx +1 -1
  10. package/components/Card/WithTabs/index.jsx +4 -3
  11. package/components/Card/index.tsx +1 -0
  12. package/components/Changelog/index.tsx +6 -7
  13. package/components/Changelog/navigation/VersionBadge.tsx +2 -1
  14. package/components/Changelog/navigation/VersionTag.tsx +1 -0
  15. package/components/Changelog/navigation/index.tsx +3 -4
  16. package/components/Changelog/versionDetails/ReleaseNotesDetails.tsx +1 -1
  17. package/components/Changelog/versionDetails/UpdateCommandBox.tsx +4 -5
  18. package/components/Changelog/versionDetails/VersionKindLabel.tsx +3 -4
  19. package/components/Changelog/versionDetails/index.tsx +4 -5
  20. package/components/ChangesEmptyState/AuthErrorPage.tsx +2 -3
  21. package/components/ChangesEmptyState/OfflinePage.tsx +1 -1
  22. package/components/ChangesEmptyState/index.ts +1 -1
  23. package/components/ChangesItems/ChangesItems.tsx +9 -10
  24. package/components/ChangesItems/DevCollaborationExperiment.tsx +2 -3
  25. package/components/ChangesItems/ErrorBanner.tsx +1 -1
  26. package/components/CodeBlock/index.tsx +3 -4
  27. package/components/ConfigErrors/index.jsx +1 -1
  28. package/components/CustomTypeTable/changesPage.tsx +6 -6
  29. package/components/DeleteCTModal/index.tsx +6 -7
  30. package/components/DeleteDocumentsDrawer/AssociatedDocumentsCard.tsx +2 -3
  31. package/components/DeleteDocumentsDrawer/HardDeleteDocumentsDrawer.tsx +8 -9
  32. package/components/DeleteDocumentsDrawer/SoftDeleteDocumentsDrawer.tsx +8 -8
  33. package/components/DeleteDocumentsDrawer/index.tsx +1 -1
  34. package/components/DeleteSliceModal/index.tsx +6 -7
  35. package/components/DeleteVariationModal/index.tsx +5 -6
  36. package/components/DropDownSelector/index.tsx +2 -4
  37. package/components/EmptyState/index.tsx +3 -4
  38. package/components/FormFields/Array.jsx +2 -4
  39. package/components/FormFields/Checkbox.jsx +1 -1
  40. package/components/FormFields/CheckboxControl.jsx +1 -1
  41. package/components/FormFields/Input.tsx +1 -1
  42. package/components/FormFields/SelectDefaultValue.jsx +1 -1
  43. package/components/Forms/CreateCustomTypeModal/CreateCustomTypeModal.tsx +15 -16
  44. package/components/Forms/CreateSliceModal/CreateSliceModal.tsx +9 -10
  45. package/components/Forms/RenameCustomTypeModal/RenameCustomTypeModal.tsx +11 -12
  46. package/components/Forms/RenameSliceModal/RenameSliceModal.tsx +6 -7
  47. package/components/Forms/RenameVariationModal/RenameVariationModal.module.css +5 -0
  48. package/components/Forms/RenameVariationModal/RenameVariationModal.tsx +6 -7
  49. package/components/Forms/components/InputBox.tsx +2 -2
  50. package/components/Forms/components/SelectRepeatable.tsx +3 -3
  51. package/components/Forms/formsValidator.ts +3 -2
  52. package/components/FullPage/index.tsx +1 -1
  53. package/components/InputDeleteIcon/index.jsx +1 -1
  54. package/components/ItemHeader/index.tsx +1 -1
  55. package/components/ListItem/Header.tsx +1 -1
  56. package/components/ListItem/index.tsx +7 -10
  57. package/components/LoadingPage/index.tsx +1 -0
  58. package/components/LoginModal/index.tsx +22 -23
  59. package/components/ModalFormCard/index.tsx +5 -5
  60. package/components/Navigation/ChangesItem.tsx +8 -9
  61. package/components/Navigation/Environment.tsx +7 -8
  62. package/components/Navigation/RunningVersion.tsx +1 -2
  63. package/components/Navigation/UpdateBox.tsx +3 -4
  64. package/components/Navigation/VideoItem.tsx +16 -16
  65. package/components/Navigation/index.module.css +3 -0
  66. package/components/Navigation/index.test.tsx +14 -12
  67. package/components/Navigation/index.tsx +18 -20
  68. package/components/ReviewModal/ReviewForm.tsx +12 -13
  69. package/components/ReviewModal/ReviewFormSelect.tsx +1 -1
  70. package/components/ReviewModal/ReviewModal.tsx +6 -7
  71. package/components/ScreenshotChangesModal/VariationDropZone.tsx +7 -8
  72. package/components/ScreenshotChangesModal/index.tsx +10 -14
  73. package/components/ScreenshotChangesModal/useCustomScreenshot.tsx +1 -2
  74. package/components/ScreenshotPreview/index.tsx +1 -1
  75. package/components/ScreenshotPreviewModal/index.tsx +4 -4
  76. package/components/Simulator/components/FailedConnect/index.tsx +3 -4
  77. package/components/Simulator/components/Header/VariationsPopover/index.tsx +3 -5
  78. package/components/Simulator/components/Header/index.tsx +4 -5
  79. package/components/Simulator/components/IframeRenderer/index.tsx +3 -5
  80. package/components/Simulator/components/Toolbar/index.tsx +2 -4
  81. package/components/Simulator/index.tsx +19 -26
  82. package/components/SliceMachineDrawer/index.tsx +2 -2
  83. package/components/SliceMachineIconButton/index.tsx +1 -1
  84. package/components/SliceMachineModal/index.tsx +1 -1
  85. package/components/ToasterContainer/index.tsx +3 -5
  86. package/components/Tooltip/TextWithTooltip.tsx +2 -3
  87. package/components/Tooltip/index.jsx +2 -3
  88. package/components/Warnings/index.jsx +1 -1
  89. package/lib/builders/CustomTypeBuilder/SliceZone/DeleteSliceZoneModal.tsx +2 -3
  90. package/lib/builders/CustomTypeBuilder/SliceZone/List.tsx +4 -5
  91. package/lib/builders/CustomTypeBuilder/SliceZone/SlicesTemplatesModal.tsx +8 -9
  92. package/lib/builders/CustomTypeBuilder/SliceZone/UpdateSliceZoneModal.tsx +2 -3
  93. package/lib/builders/CustomTypeBuilder/SliceZone/UpdateSliceZoneModalList.tsx +3 -3
  94. package/lib/builders/CustomTypeBuilder/SliceZone/index.tsx +21 -22
  95. package/lib/builders/CustomTypeBuilder/TabModal/InputBox.tsx +1 -1
  96. package/lib/builders/CustomTypeBuilder/TabModal/delete.tsx +1 -1
  97. package/lib/builders/CustomTypeBuilder/TabModal/update.tsx +1 -1
  98. package/lib/builders/CustomTypeBuilder/TabZone/index.tsx +20 -21
  99. package/lib/builders/CustomTypeBuilder/index.tsx +4 -5
  100. package/lib/builders/SliceBuilder/FieldZones/index.tsx +105 -41
  101. package/lib/builders/SliceBuilder/Sidebar/AddVariationModal.tsx +7 -8
  102. package/lib/builders/SliceBuilder/Sidebar/index.tsx +7 -8
  103. package/lib/builders/SliceBuilder/SimulatorButton/index.tsx +9 -12
  104. package/lib/builders/SliceBuilder/index.tsx +11 -8
  105. package/lib/builders/common/EditModal/Field.jsx +2 -5
  106. package/lib/builders/common/EditModal/Form.jsx +1 -1
  107. package/lib/builders/common/EditModal/index.jsx +11 -17
  108. package/lib/builders/common/SelectFieldTypeModal/index.jsx +3 -5
  109. package/lib/builders/common/Zone/Card/components/ErrorTooltip.tsx +2 -3
  110. package/lib/builders/common/Zone/Card/components/Hints/CodeBlock.tsx +4 -6
  111. package/lib/builders/common/Zone/Card/components/Hints/index.tsx +1 -1
  112. package/lib/builders/common/Zone/Card/components/NewField.tsx +13 -14
  113. package/lib/builders/common/Zone/Card/index.jsx +2 -3
  114. package/lib/builders/common/Zone/components/EmptyState/index.tsx +2 -2
  115. package/lib/builders/common/Zone/index.jsx +3 -4
  116. package/lib/forms/defaults.ts +1 -1
  117. package/lib/forms/fields.ts +1 -2
  118. package/lib/forms/index.ts +1 -0
  119. package/lib/models/common/ComponentUI.ts +1 -1
  120. package/lib/models/common/CustomType/index.ts +5 -4
  121. package/lib/models/common/CustomType/sliceZone.ts +2 -1
  122. package/lib/models/common/CustomType/tab.ts +4 -4
  123. package/lib/models/common/DeprecatedMockConfigMessage.tsx +2 -2
  124. package/lib/models/common/Environment.ts +2 -2
  125. package/lib/models/common/Fields.ts +1 -1
  126. package/lib/models/common/Group.ts +3 -2
  127. package/lib/models/common/Library.ts +2 -1
  128. package/lib/models/common/LibraryUI.ts +1 -1
  129. package/lib/models/common/ModelData.ts +1 -1
  130. package/lib/models/common/ModelStatus/compareCustomTypeModels.ts +2 -1
  131. package/lib/models/common/ModelStatus/compareSliceModels.ts +2 -1
  132. package/lib/models/common/ModelStatus/index.ts +10 -9
  133. package/lib/models/common/Slice.ts +2 -2
  134. package/lib/models/common/Slices.ts +2 -2
  135. package/lib/models/common/normalizers/customType.ts +1 -1
  136. package/lib/models/common/normalizers/slices.ts +3 -2
  137. package/lib/models/common/widgets/Boolean/index.ts +5 -7
  138. package/lib/models/common/widgets/Color/index.ts +2 -3
  139. package/lib/models/common/widgets/ContentRelationship/Form.tsx +7 -9
  140. package/lib/models/common/widgets/ContentRelationship/index.ts +7 -8
  141. package/lib/models/common/widgets/Date/index.ts +2 -2
  142. package/lib/models/common/widgets/Embed/index.ts +2 -2
  143. package/lib/models/common/widgets/GeoPoint/index.ts +2 -3
  144. package/lib/models/common/widgets/Group/Form.jsx +3 -4
  145. package/lib/models/common/widgets/Group/ListItem/index.jsx +13 -23
  146. package/lib/models/common/widgets/Group/index.ts +4 -3
  147. package/lib/models/common/widgets/Image/Form.tsx +8 -11
  148. package/lib/models/common/widgets/Image/components.tsx +5 -5
  149. package/lib/models/common/widgets/Image/index.ts +3 -5
  150. package/lib/models/common/widgets/Link/Form.jsx +3 -5
  151. package/lib/models/common/widgets/Link/index.ts +3 -3
  152. package/lib/models/common/widgets/LinkToMedia/Form.jsx +2 -4
  153. package/lib/models/common/widgets/LinkToMedia/index.ts +3 -4
  154. package/lib/models/common/widgets/Number/index.ts +2 -2
  155. package/lib/models/common/widgets/Select/FormFields.jsx +7 -8
  156. package/lib/models/common/widgets/Select/index.ts +3 -6
  157. package/lib/models/common/widgets/StructuredText/Form.tsx +10 -10
  158. package/lib/models/common/widgets/StructuredText/index.ts +3 -6
  159. package/lib/models/common/widgets/StructuredText/options.tsx +2 -2
  160. package/lib/models/common/widgets/Text/index.ts +5 -5
  161. package/lib/models/common/widgets/Timestamp/index.ts +4 -5
  162. package/lib/models/common/widgets/UID/index.ts +4 -5
  163. package/lib/models/common/widgets/Widget.ts +2 -1
  164. package/lib/models/common/widgets/index.ts +1 -1
  165. package/lib/models/common/widgets/withGroup.ts +1 -2
  166. package/lib/models/server/ServerState.ts +4 -3
  167. package/lib/utils/index.ts +4 -5
  168. package/out/404.html +1 -1
  169. package/out/_next/static/6WrgMw0SELcypoJCYNiKd/_buildManifest.js +1 -0
  170. package/out/_next/static/chunks/{25-792af14760d9df34.js → 25-607d5cfe6492f4e8.js} +1 -1
  171. package/out/_next/static/chunks/286-6ee80333008646b9.js +1 -0
  172. package/out/_next/static/chunks/318-c84322cba57be932.js +1 -0
  173. package/out/_next/static/chunks/382-8194eab141c7ea2f.js +1 -0
  174. package/out/_next/static/chunks/727-b53258380c1a11f1.js +1 -0
  175. package/out/_next/static/chunks/799-68887319f3169f78.js +1 -0
  176. package/out/_next/static/chunks/pages/{_app-756c037ed6c707e9.js → _app-6177e3581af44083.js} +1 -1
  177. package/out/_next/static/chunks/pages/changelog-2d061c06b2b82e28.js +1 -0
  178. package/out/_next/static/chunks/pages/changes-cde59d56dc849106.js +1 -0
  179. package/out/_next/static/chunks/pages/custom-types/{[customTypeId]-d1a4a07e6b600fa6.js → [customTypeId]-89ccb93ce7409ad0.js} +1 -1
  180. package/out/_next/static/chunks/pages/index-b5817351a77c6d40.js +1 -0
  181. package/out/_next/static/chunks/pages/labs-0fc7d01b8c9bfc2a.js +1 -0
  182. package/out/_next/static/chunks/pages/page-types/{[pageTypeId]-a724ff12ef322020.js → [pageTypeId]-dbf86fe3a94dc892.js} +1 -1
  183. package/out/_next/static/chunks/pages/settings-897ad13a08f73048.js +1 -0
  184. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-ed3157875529f0f2.js +1 -0
  185. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-69cf4b12bb354f9f.js +1 -0
  186. package/out/_next/static/chunks/pages/slices-391f6c4b30af0759.js +1 -0
  187. package/out/_next/static/css/{838fd8bb5a7c32b0.css → 0e0d6c4ec6bf7373.css} +1 -1
  188. package/out/_next/static/css/{21654235130d0806.css → 243a4d347efcfd53.css} +1 -1
  189. package/out/_next/static/css/{b22c0750c14cc089.css → 27f2b9b9c9f65885.css} +1 -1
  190. package/out/_next/static/css/{72465cc1225f28a2.css → 6e65ff596e3b465e.css} +1 -1
  191. package/out/_next/static/css/70e3649c6ba13fdc.css +1 -0
  192. package/out/changelog.html +1 -1
  193. package/out/changes.html +1 -1
  194. package/out/custom-types/[customTypeId].html +1 -1
  195. package/out/custom-types.html +1 -1
  196. package/out/index.html +1 -1
  197. package/out/labs.html +1 -1
  198. package/out/page-types/[pageTypeId].html +1 -1
  199. package/out/settings.html +1 -1
  200. package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
  201. package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
  202. package/out/slices.html +1 -1
  203. package/package.json +5 -3
  204. package/pages/_app.tsx +6 -8
  205. package/pages/changelog.tsx +1 -2
  206. package/pages/changes.tsx +17 -15
  207. package/pages/custom-types.tsx +1 -2
  208. package/pages/index.tsx +1 -2
  209. package/pages/slices/[lib]/[sliceName]/[variation]/index.tsx +2 -3
  210. package/pages/slices/[lib]/[sliceName]/[variation]/simulator.tsx +2 -3
  211. package/pages/slices.tsx +22 -20
  212. package/sentry.client.config.ts +1 -1
  213. package/src/ErrorBoundary.tsx +1 -2
  214. package/src/apiClient.ts +7 -8
  215. package/src/components/BaseHoverCard/BaseHoverCard.stories.tsx +1 -1
  216. package/src/components/BaseHoverCard/BaseHoverCard.test.tsx +1 -1
  217. package/src/components/BaseHoverCard/BaseHoverCard.tsx +1 -1
  218. package/src/components/BlankSlate/BlankSlate.stories.tsx +1 -1
  219. package/src/components/BlankSlate/index.ts +1 -1
  220. package/src/components/Breadcrumb/Breadcrumb.module.css +11 -0
  221. package/src/components/Breadcrumb/Breadcrumb.module.css.d.ts +6 -0
  222. package/src/components/Breadcrumb/Breadcrumb.stories.tsx +34 -0
  223. package/src/components/Breadcrumb/Breadcrumb.tsx +43 -25
  224. package/src/components/Breadcrumb/index.ts +1 -1
  225. package/src/components/Card/Card.stories.tsx +1 -2
  226. package/src/components/Card/Card.tsx +3 -2
  227. package/src/components/CodeBlock/CodeBlock.module.css +46 -0
  228. package/src/components/CodeBlock/CodeBlock.module.css.d.ts +10 -0
  229. package/src/components/CodeBlock/CodeBlock.tsx +7 -8
  230. package/src/components/ContentTabs/ContentTabs.module.css +60 -0
  231. package/src/components/ContentTabs/ContentTabs.module.css.d.ts +12 -0
  232. package/src/components/ContentTabs/ContentTabs.tsx +2 -2
  233. package/src/components/Count/Count.module.css +19 -0
  234. package/src/components/Count/Count.module.css.d.ts +6 -0
  235. package/src/components/{Counter/Counter.stories.tsx → Count/Count.stories.tsx} +3 -3
  236. package/src/components/{Counter/Counter.tsx → Count/Count.tsx} +3 -4
  237. package/src/components/Count/index.ts +1 -0
  238. package/src/components/Divider/Divider.stories.tsx +1 -1
  239. package/src/components/HoverCard/HoverCard.module.css +79 -0
  240. package/src/components/HoverCard/HoverCard.module.css.d.ts +13 -0
  241. package/src/components/HoverCard/HoverCard.stories.tsx +3 -2
  242. package/src/components/HoverCard/HoverCard.test.tsx +2 -2
  243. package/src/components/HoverCard/HoverCard.tsx +3 -4
  244. package/src/components/HoverCard/index.ts +3 -3
  245. package/src/components/SideNav/SideNav.stories.tsx +6 -7
  246. package/src/components/SideNav/SideNav.tsx +6 -6
  247. package/src/components/SideNav/SideNavEnvironmentSelector.tsx +3 -4
  248. package/src/components/Table/Table.stories.tsx +2 -2
  249. package/src/components/Table/Table.test.tsx +1 -2
  250. package/src/components/Table/Table.tsx +2 -2
  251. package/src/components/Table/index.ts +1 -1
  252. package/src/components/TextLink/TextLink.module.css +58 -0
  253. package/src/components/TextLink/TextLink.module.css.d.ts +11 -0
  254. package/src/components/TextLink/TextLink.stories.tsx +1 -1
  255. package/src/components/TextLink/TextLink.tsx +5 -5
  256. package/src/domain/__tests__/customType.test.ts +1 -2
  257. package/src/domain/__tests__/slice.test.ts +40 -0
  258. package/src/domain/customType.ts +1 -2
  259. package/src/domain/slice.ts +29 -5
  260. package/src/features/autoSave/AutoSaveStatusIndicator.tsx +1 -2
  261. package/src/features/changelog/useSliceMachineLatestNonBreakingVersion.ts +0 -1
  262. package/src/features/changelog/useSliceMachineReleaseNotes.ts +0 -1
  263. package/src/features/changelog/useSliceMachineVersions.ts +0 -1
  264. package/src/features/changes/BlankSlates/NoChangesBlankSlate.tsx +9 -13
  265. package/src/features/changes/PushChangesButton.tsx +5 -6
  266. package/src/features/changes/StatusBadge.tsx +2 -3
  267. package/src/features/customTypes/EditDropdown.tsx +6 -10
  268. package/src/features/customTypes/PageTypeOnboarding.tsx +4 -5
  269. package/src/features/customTypes/__tests__/CustomTypeBuilderPage.test.tsx +12 -15
  270. package/src/features/customTypes/__tests__/CustomTypesTablePage.test.tsx +7 -7
  271. package/src/features/customTypes/actions/convertCustomToPageType.ts +2 -3
  272. package/src/features/customTypes/actions/createCustomType.ts +2 -3
  273. package/src/features/customTypes/actions/deleteCustomType.ts +2 -3
  274. package/src/features/customTypes/actions/renameCustomType.ts +2 -3
  275. package/src/features/customTypes/customTypesBuilder/CustomTypeProvider.tsx +8 -9
  276. package/src/features/customTypes/customTypesBuilder/CustomTypesBuilderPage.tsx +22 -16
  277. package/src/features/customTypes/customTypesBuilder/PageSnippetDialog/PageSnippetDialog.tsx +4 -5
  278. package/src/features/customTypes/customTypesBuilder/SliceZoneBlankSlate.tsx +1 -2
  279. package/src/features/customTypes/customTypesBuilder/useCustomType.ts +0 -1
  280. package/src/features/customTypes/customTypesConfig.ts +1 -2
  281. package/src/features/customTypes/customTypesTable/CustomTypesTable.tsx +14 -15
  282. package/src/features/customTypes/customTypesTable/CustomTypesTablePage.tsx +21 -23
  283. package/src/features/customTypes/customTypesTable/useCustomTypes.ts +4 -5
  284. package/src/features/documentation/MarkdownRenderer/index.tsx +5 -7
  285. package/src/features/documentation/useDocumentation.ts +0 -1
  286. package/src/features/environments/actions/getActiveEnvironment.ts +0 -1
  287. package/src/features/environments/actions/setEnvironment.ts +1 -2
  288. package/src/features/inAppGuide/InAppGuideContext.tsx +2 -3
  289. package/src/features/inAppGuide/InAppGuideDialog.tsx +4 -5
  290. package/src/features/inAppGuide/inAppGuideContent.tsx +1 -2
  291. package/src/features/labs/labsList/LabsList.tsx +2 -2
  292. package/src/features/labs/labsList/LabsListItem.tsx +1 -1
  293. package/src/features/labs/labsList/LabsPage.tsx +7 -5
  294. package/src/features/labs/labsList/useLab.tsx +0 -1
  295. package/src/features/settings/SettingsPage.tsx +8 -6
  296. package/src/features/settings/git/ConnectGitRepository.tsx +2 -3
  297. package/src/features/settings/git/GitOwnerSelect.tsx +1 -2
  298. package/src/features/settings/git/GitProvider.ts +0 -1
  299. package/src/features/settings/git/GitProviderConnectButtons.tsx +1 -2
  300. package/src/features/settings/git/GitRepositoriesList.tsx +1 -2
  301. package/src/features/settings/git/GitRepositoriesSearch.tsx +1 -2
  302. package/src/features/settings/git/GitRepositoryConnectDialog.tsx +3 -4
  303. package/src/features/settings/git/useGitOwners.ts +0 -1
  304. package/src/features/settings/git/useGitRepos.ts +0 -1
  305. package/src/features/settings/git/useLinkedGitRepos.ts +0 -1
  306. package/src/features/settings/git/useWriteAPIToken.ts +0 -1
  307. package/src/features/slices/actions/addSlicesToSliceZone.ts +1 -2
  308. package/src/features/slices/actions/createSlice.ts +3 -4
  309. package/src/features/slices/actions/deleteSlice.ts +1 -2
  310. package/src/features/slices/actions/renameSlice.ts +3 -4
  311. package/src/features/slices/actions/uploadSliceScreenshot.ts +1 -2
  312. package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewSliceDialog.tsx +9 -10
  313. package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewVariationDialog.tsx +7 -8
  314. package/src/features/slices/convertLegacySlice/ConvertLegacySliceButton.module.css +14 -0
  315. package/src/features/slices/convertLegacySlice/ConvertLegacySliceButton.module.css.d.ts +6 -0
  316. package/src/features/slices/convertLegacySlice/ConvertLegacySliceButton.tsx +10 -11
  317. package/src/features/slices/convertLegacySlice/ConvertLegacySliceMergeWithIdenticalDialog.tsx +5 -8
  318. package/src/features/slices/convertLegacySlice/types.ts +1 -1
  319. package/src/features/slices/sliceBuilder/FloatingBackButton.tsx +3 -4
  320. package/src/features/slices/sliceBuilder/SliceBuilderProvider.tsx +9 -10
  321. package/src/features/slices/sliceBuilder/actions/deleteVariation.ts +2 -3
  322. package/src/features/slices/sliceBuilder/actions/renameVariation.ts +1 -2
  323. package/src/features/slices/sliceBuilder/useGroupsInSlicesExperiment.ts +8 -0
  324. package/src/features/slices/sliceCards/NonSharedSliceCard.tsx +2 -3
  325. package/src/features/slices/sliceCards/SharedSliceCard.tsx +4 -5
  326. package/src/features/slicesTemplates/actions/createSlicesTemplates.ts +2 -3
  327. package/src/features/sync/AutoSyncProvider.tsx +17 -18
  328. package/src/features/sync/actions/pushChanges.ts +1 -1
  329. package/src/features/sync/components/AutoSyncStatusIndicator.tsx +2 -3
  330. package/src/features/sync/fetchUnSyncChanges.ts +1 -1
  331. package/src/features/sync/getUnSyncChanges.ts +4 -4
  332. package/src/features/sync/useUnSyncChanges.ts +4 -5
  333. package/src/hooks/useActionQueue.tsx +5 -5
  334. package/src/hooks/useAdapterName.ts +0 -1
  335. package/src/hooks/useAuthStatus.ts +1 -2
  336. package/src/hooks/useCurrentSlice.tsx +2 -3
  337. package/src/hooks/useEditorContent.ts +3 -3
  338. package/src/hooks/useExperimentVariant.ts +0 -1
  339. package/src/hooks/useIsEmptyProject.ts +0 -1
  340. package/src/hooks/useRepositoryInformation.ts +2 -3
  341. package/src/hooks/useRouteChange.tsx +1 -1
  342. package/src/hooks/useSMTracker.ts +4 -5
  343. package/src/hooks/useScreenshotChangesModal.ts +3 -3
  344. package/src/hooks/useServerState.ts +4 -5
  345. package/src/hooks/useSliceMachineConfig.ts +1 -2
  346. package/src/hooks/useSliceMachineRunningVersion.ts +0 -1
  347. package/src/hooks/useThrottle.ts +1 -1
  348. package/src/hooks/useUpdateAvailable.ts +0 -1
  349. package/src/hooks/useWindowDimensions.ts +1 -1
  350. package/src/hooks/useWindowSize.ts +2 -1
  351. package/src/modules/availableCustomTypes/index.ts +13 -12
  352. package/src/modules/environment/index.ts +9 -8
  353. package/src/modules/loading/index.ts +3 -2
  354. package/src/modules/modal/index.ts +3 -2
  355. package/src/modules/slices/index.ts +4 -4
  356. package/src/modules/slices/types.ts +1 -1
  357. package/src/modules/useSliceMachineActions.ts +22 -21
  358. package/src/modules/userContext/index.ts +5 -4
  359. package/src/redux/reducer.ts +5 -5
  360. package/src/redux/store.ts +6 -5
  361. package/src/redux/type.ts +4 -4
  362. package/src/theme.ts +1 -2
  363. package/test/__setup__.ts +3 -0
  364. package/vite.config.ts +4 -3
  365. package/components/Forms/RenameVariationModal/RenameVariationModal.css.ts +0 -7
  366. package/components/Navigation/index.css.ts +0 -5
  367. package/out/_next/static/chunks/286-e0950c3083c672e8.js +0 -1
  368. package/out/_next/static/chunks/318-d6f1200138628ec3.js +0 -1
  369. package/out/_next/static/chunks/727-2c302be2def92786.js +0 -1
  370. package/out/_next/static/chunks/799-7b910b896ff60ebe.js +0 -1
  371. package/out/_next/static/chunks/904-c9221a5cb09524e8.js +0 -1
  372. package/out/_next/static/chunks/pages/changelog-5c9ac93faf0df06b.js +0 -1
  373. package/out/_next/static/chunks/pages/changes-3e4989e09fd412a8.js +0 -1
  374. package/out/_next/static/chunks/pages/index-cf93d16e9c63b6db.js +0 -1
  375. package/out/_next/static/chunks/pages/labs-6f5925cd6cdcee9e.js +0 -1
  376. package/out/_next/static/chunks/pages/settings-f0620e5b727cda03.js +0 -1
  377. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-01d67e97cb901e46.js +0 -1
  378. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-8d7043e6638d65cd.js +0 -1
  379. package/out/_next/static/chunks/pages/slices-77cff50b1df13579.js +0 -1
  380. package/out/_next/static/css/be1f49e49a5aa7eb.css +0 -1
  381. package/out/_next/static/dLmvq3LL0BsWu15laiKoK/_buildManifest.js +0 -1
  382. package/src/components/Breadcrumb/Breadcrumb.css.ts +0 -5
  383. package/src/components/Breadcrumb/Breadcrumb.stories.ts +0 -32
  384. package/src/components/CodeBlock/CodeBlock.css.ts +0 -37
  385. package/src/components/ContentTabs/ContentTabs.css.ts +0 -49
  386. package/src/components/Counter/Counter.css.ts +0 -26
  387. package/src/components/Counter/index.ts +0 -1
  388. package/src/components/HoverCard/HoverCard.css.ts +0 -105
  389. package/src/components/TextLink/TextLink.css.ts +0 -65
  390. package/src/features/slices/convertLegacySlice/ConvertLegacySliceButton.css.ts +0 -15
  391. /package/out/_next/static/{dLmvq3LL0BsWu15laiKoK → 6WrgMw0SELcypoJCYNiKd}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[799],{56577:function(e,n,t){"use strict";t.d(n,{z:function(){return d}});var r=t(62230),o=t(85244),i=t(98240),s=t(52322),c=t(2784),u=t(75289),a=function(e,n){return e?"".concat(e,"-").concat(n):""},l=function(e){switch(e){case"white":case"secondaryMedium":case"secondarySmall":case"secondary":return"#1A1523";default:return"grey01"}},d=(0,c.forwardRef)(function(e,n){var t=e.label,c=e.Icon,d=e.type,f=e.form,p=e.isLoading,m=void 0!==p&&p,v=e.disabled,y=e.onClick,h=e.sx,x=e.iconSize,g=void 0===x?16:x,Z=e.iconFill,b=e.variant,j=void 0===b?"primary":b,I=(0,i.Z)(e,["label","Icon","type","form","isLoading","disabled","onClick","sx","iconSize","iconFill","variant"]);return(0,s.jsx)(u.zx,(0,o.Z)((0,r.Z)({ref:n,sx:(0,r.Z)((0,o.Z)((0,r.Z)({},void 0===h?{}:h),{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"}),m?{cursor:"wait !important"}:{}),type:d,form:f,disabled:void 0!==v&&v||m,onClick:m?void 0:y,variant:j},I),{children:m?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.$j,{size:g,color:l(j),"data-testid":a(I["data-testid"],"spinner")}),c&&t]}):(0,s.jsxs)(s.Fragment,{children:[c&&(0,s.jsx)(c,{size:g,fill:Z,"data-testid":a(I["data-testid"],"icon")}),t]})}))})},70041:function(e,n,t){"use strict";t.d(n,{W:function(){return c}});var r=t(62230),o=t(52322),i=t(63397);t(2784);var s=t(75289),c=function(e){var n=e.name,t=e.label,c=e.placeholder,u=e.error,a=e.testId,l=e.onChange;return(0,o.jsxs)(s.xu,{mb:3,children:[(0,o.jsx)(s.__,{htmlFor:n,mb:2,children:t}),(0,o.jsx)(i.gN,(0,r.Z)({name:n,type:"text",placeholder:c,as:s.II,autoComplete:"off"},l?{onChange:l}:null,a?{"data-testid":a}:null)),u?(0,o.jsx)(s.xv,{"data-testid":a?"".concat(a,"-error"):"input-error",sx:{color:"error",mt:1},children:u}):null]})}},68780:function(e,n,t){"use strict";var r=t(62230),o=t(85244),i=t(52322),s=t(56577),c=t(25812),u=t(63397),a=t(37149),l=t.n(a),d=t(75289),f=t(54132);n.Z=function(e){var n=e.children,t=e.close,a=e.isOpen,p=e.formId,m=e.validate,v=e.onSubmit,y=e.widthInPx,h=e.initialValues,x=e.content.title,g=e.cardProps,Z=e.omitFooter,b=void 0!==Z&&Z,j=e.isLoading,I=void 0!==j&&j,T=e.buttonLabel,_=void 0===T?"Save":T,S=e.testId,C=e.actionMessage;return l().setAppElement("#__next"),(0,i.jsx)(c.Z,{isOpen:a,shouldCloseOnOverlayClick:!0,onRequestClose:t,contentLabel:x,style:{content:{width:null!=y?y:"900px"}},children:(0,i.jsx)(u.J9,{initialValues:h,validate:function(e){return m?m(e):void 0},onSubmit:function(e){v(e)},children:function(e){var c=e.isValid,a=e.isSubmitting,l=e.values,m=e.errors,v=e.touched,y=e.setFieldValue,h=e.setValues;return(0,i.jsx)(u.l0,(0,o.Z)((0,r.Z)({id:p},null!=S?{"data-testid":S}:null),{children:(0,i.jsx)(f.Z,(0,o.Z)((0,r.Z)({borderFooter:!0,footerSx:{p:3,position:"sticky",bottom:0,background:"gray"},bodySx:{px:4,py:4},sx:{border:"none"}},g),{Header:function(e){var n=e.radius;return(0,i.jsxs)(d.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",pl:4,bg:"headSection",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:n,borderTopRightRadius:n,borderBottom:function(e){var n;return"1px solid ".concat(null===(n=e.colors)||void 0===n?void 0:n.borders)}},children:[(0,i.jsx)(d.X6,{sx:{fontSize:"20px"},children:x}),(0,i.jsx)(d.x8,{type:"button",onClick:t})]})},Footer:b?null:(0,i.jsxs)(d.kC,{sx:{alignItems:"space-between"},children:[(0,i.jsx)(d.kC,{sx:{fontSize:"14px",alignItems:"center"},children:"function"==typeof C?C(e):C}),(0,i.jsxs)(d.kC,{sx:{ml:"auto"},children:[(0,i.jsx)(d.zx,{mr:2,type:"button",onClick:t,variant:"secondary",disabled:a||I,children:"Cancel"}),(0,i.jsx)(s.z,{label:_,form:p,type:"submit",disabled:!c||a||I,isLoading:a||I,sx:{fontWeight:"400",paddingBlock:"8px",paddingInline:"16px",fontSize:"14px",borderRadius:"4px"}})]})]}),children:n({isValid:c,isSubmitting:a,values:l,errors:m,touched:v,setFieldValue:y,setValues:h})}))}))}})})}},2754:function(e,n,t){"use strict";t.d(n,{R$:function(){return l},Qj:function(){return v},T9:function(){return f},nf:function(){return m},u2:function(){return d},_T:function(){return p}});var r=t(67557),o=t(62230),i=t(85244),s=t(98240),c=t(52322),u=t(22715),a=t(6277);t(69143);var l=function(e){var n=e.backgroundImage,t=e.style,u=(0,s.Z)(e,["backgroundImage","style"]),l=void 0!==n;return(0,c.jsx)("article",(0,i.Z)((0,o.Z)({},u),{className:(0,a.W)("_18bjhbz0 _1ecs97dez0 _1ecs97dez1 _1ecs97dez2 _1ecs97dezb _1ecs97dfiv _1ecs97dfix _1ecs97dfiz _1ecs97d3fg _1ecs97d3mt _1ecs97df0r _1ecs97df23 _1ecs97df2h _1ecs97dezp",(0,r.Z)({},"_18bjhbz1 _1ecs97dezx _1ecs97df4v",l)),style:(0,o.Z)({backgroundImage:l?"url(".concat(n,")"):void 0},t)}))},d=function(e){return(0,c.jsx)("div",(0,i.Z)((0,o.Z)({},e),{className:"_1ecs97dez0 _1ecs97dez1 _1ecs97dez2 _1ecs97dezb _1ecs97d6r8 _1ecs97d6yl _1ecs97df29 _1ecs97df2l _1ecs97dezp"}))},f=function(e){return(0,c.jsx)("div",(0,i.Z)((0,o.Z)({},e),{className:"_18bjhbz3 _1ecs97dez0 _1ecs97dez1 _1ecs97dez2 _1ecs97dezb _1ecs97dffv"}))},p=function(e){return(0,c.jsx)(u.xv,(0,i.Z)((0,o.Z)({},e),{className:"_18bjhbz4"}))},m=function(e){return(0,c.jsx)(u.xv,(0,i.Z)((0,o.Z)({},e),{className:"_18bjhbz5",color:"grey11"}))},v=function(e){return(0,c.jsx)("div",(0,i.Z)((0,o.Z)({},e),{className:"_18bjhbz6 _1ecs97dez0 _1ecs97dez8 _1ecs97dez1 _1ecs97dez2 _1ecs97df95 _1ecs97dfdl",color:"grey"}))}},91061:function(e,n,t){"use strict";t.d(n,{AK:function(){return b},E3:function(){return m},EN:function(){return v},F$:function(){return x},GA:function(){return C},HO:function(){return g},L4:function(){return j},Tr:function(){return p},Ue:function(){return L},gR:function(){return I},j6:function(){return _},kQ:function(){return T},l9:function(){return S},mf:function(){return y},vB:function(){return h},xS:function(){return Z},y6:function(){return a}});var r=t(67557),o=t(62230),i=t(85244),s=t(17064),c=t(98863),u=t(88866);function a(e){var n;return null!==(n=e.format)&&void 0!==n?n:"custom"}function l(e){return Object.entries(e.json)}function d(e,n){return e.json[n]}function f(e,n){var t=d(e,n);if(void 0!==t)return Object.entries(t).find(function(e){var n=(0,s.Z)(e,2);return(n[0],n[1]).type===u.SlicesFieldType})}function p(e,n){if(t=e,d=f(t,c=n),(p=(0,s.Z)(null!=d?d:[],2))[0],null!==(a=null==(m=p[1])?void 0:m.config)&&void 0!==a?a:void 0)return e;var t,c,a,d,p,m,v=function(e,n){var t,r=l(e),o=r.findIndex(function(e){return(0,s.Z)(e,1)[0]===n}),i=r.flatMap(function(e){var n=(0,s.Z)(e,2),t=(n[0],n[1]);return Object.keys(t).filter(function(e){return t[e].type===u.SlicesFieldType})}),c=o;do t="slices".concat(0!==c?c.toString():""),c++;while(i.includes(t));return t}(e,n);return(0,i.Z)((0,o.Z)({},e),{json:(0,i.Z)((0,o.Z)({},e.json),(0,r.Z)({},n,(0,i.Z)((0,o.Z)({},e.json[n]),(0,r.Z)({},v,{type:u.SlicesFieldType,fieldset:"Slice Zone"}))))})}function m(e,n){var t=d(e,n);if(void 0===t)return e;var s=Object.keys(t).find(function(e){return t[e].type===u.SlicesFieldType});if(void 0===s)return e;var a=(0,c.ud)(t,s);return(0,i.Z)((0,o.Z)({},e),{json:(0,i.Z)((0,o.Z)({},e.json),(0,r.Z)({},n,a))})}function v(e){var n,t,s=e.customType,a=e.sectionId,l=e.sliceId,f=d(s,a);if(void 0===f)return s;var p=Object.keys(f).find(function(e){return f[e].type===u.SlicesFieldType});if(void 0===p)return s;var m=f[p];if(m.type!==u.SlicesFieldType)return s;var v=(0,c.ud)(null!==(t=null===(n=m.config)||void 0===n?void 0:n.choices)&&void 0!==t?t:{},l);return(0,i.Z)((0,o.Z)({},s),{json:(0,i.Z)((0,o.Z)({},s.json),(0,r.Z)({},a,(0,i.Z)((0,o.Z)({},f),(0,r.Z)({},p,(0,i.Z)((0,o.Z)({},m),{config:(0,i.Z)((0,o.Z)({},m.config),{choices:v})})))))})}function y(e){var n,t=(0,i.Z)((0,o.Z)({},e),{format:"page"}),r=l(e)[0];if(r){var c=(0,s.Z)(r,1)[0];t=p(t,c)}return t}function h(e,n){return(0,i.Z)((0,o.Z)({},e),{json:(0,i.Z)((0,o.Z)({},e.json),(0,r.Z)({},n,{}))})}function x(e,n){var t=(0,c.ud)(e.json,n);return(0,i.Z)((0,o.Z)({},e),{json:t})}function g(e,n,t){if(n===t)return e;var r=Object.keys(e.json).reduce(function(r,o){return o===n?r[t]=e.json[o]:r[o]=e.json[o],r},{});return(0,i.Z)((0,o.Z)({},e),{json:r})}function Z(e){var n=e.customType,t=e.sectionId,c=e.newField,a=e.newFieldId,l=n.json[t],d=f(n,t),p=Object.fromEntries(Object.entries(l).filter(function(e){var n=(0,s.Z)(e,2);return(n[0],n[1]).type!==u.SlicesFieldType})),m=(0,i.Z)((0,o.Z)({},p),(0,r.Z)({},a,c));if(void 0!==d){var v=(0,s.Z)(d,2),y=v[0],h=v[1];m[y]=h}return F({customType:n,sectionId:t,updatedSection:m})}function b(e){var n=e.customType,t=e.sectionId,r=e.fieldId,o=(0,c.ud)(n.json[t],r);return F({customType:n,sectionId:t,updatedSection:o})}function j(e){var n=e.customType,t=e.sectionId,r=e.previousFieldId,o=e.newFieldId,i=e.newField,s=w({fields:n.json[t],previousFieldId:r,newFieldId:o,newField:i});return F({customType:n,sectionId:t,updatedSection:s})}function I(e){var n=e.customType,t=e.sectionId,r=e.sourceIndex,o=e.destinationIndex,i=n.json[t],c=f(n,t),a=Object.fromEntries(Object.entries(i).filter(function(e){var n=(0,s.Z)(e,2);return(n[0],n[1]).type!==u.SlicesFieldType})),l=z({fields:a,sourceIndex:r,destinationIndex:o});if(void 0!==c){var d=(0,s.Z)(c,2),p=d[0],m=d[1];l[p]=m}return F({customType:n,sectionId:t,updatedSection:l})}function T(e){var n,t=e.customType,s=e.sectionId,c=e.groupFieldId,u=e.newField,a=e.newFieldId,l=k({customType:t,sectionId:s,groupFieldId:c}),d=null==l?void 0:null===(n=l.config)||void 0===n?void 0:n.fields;if(!l)return t;var f=O(l,(0,i.Z)((0,o.Z)({},d),(0,r.Z)({},a,u)));return F({customType:t,sectionId:s,updatedSection:(0,i.Z)((0,o.Z)({},t.json[s]),(0,r.Z)({},c,f))})}function _(e){var n,t=e.customType,s=e.sectionId,u=e.groupFieldId,a=e.fieldId,l=k({customType:t,sectionId:s,groupFieldId:u}),d=null==l?void 0:null===(n=l.config)||void 0===n?void 0:n.fields;if(!l||!d)return t;var f=(0,c.ud)(d,a),p=O(l,f);return F({customType:t,sectionId:s,updatedSection:(0,i.Z)((0,o.Z)({},t.json[s]),(0,r.Z)({},u,p))})}function S(e){var n,t=e.customType,s=e.sectionId,c=e.groupFieldId,u=e.previousFieldId,a=e.newFieldId,l=e.newField,d=k({customType:t,sectionId:s,groupFieldId:c}),f=null==d?void 0:null===(n=d.config)||void 0===n?void 0:n.fields;if(!d||!f)return t;var p=w({fields:f,previousFieldId:u,newFieldId:a,newField:l}),m=O(d,p);return F({customType:t,sectionId:s,updatedSection:(0,i.Z)((0,o.Z)({},t.json[s]),(0,r.Z)({},c,m))})}function C(e){var n,t=e.customType,s=e.sectionId,c=e.groupFieldId,u=e.sourceIndex,a=e.destinationIndex,l=k({customType:t,sectionId:s,groupFieldId:c}),d=null==l?void 0:null===(n=l.config)||void 0===n?void 0:n.fields;if(!l||!d)return t;var f=z({fields:d,sourceIndex:u,destinationIndex:a}),p=O(l,f);return F({customType:t,sectionId:s,updatedSection:(0,i.Z)((0,o.Z)({},t.json[s]),(0,r.Z)({},c,p))})}function F(e){var n=e.customType,t=e.sectionId,s=e.updatedSection;return(0,i.Z)((0,o.Z)({},n),{json:(0,i.Z)((0,o.Z)({},n.json),(0,r.Z)({},t,s))})}function w(e){var n=e.fields,t=e.previousFieldId,r=e.newFieldId,o=e.newField;return Object.entries(n).reduce(function(e,n){var i=(0,s.Z)(n,2),c=i[0],u=i[1];return c===t?e[r]=o:c!==r&&(e[c]=u),e},{})}function z(e){var n=e.fields,t=e.sourceIndex,r=e.destinationIndex,o=Object.entries(n),i=(0,s.Z)(o.splice(t,1),1)[0];return o.splice(r,0,i),Object.fromEntries(o)}function k(e){var n=e.customType,t=e.sectionId,r=e.groupFieldId,o=n.json[t][r];if(o.type===u.GroupFieldType)return o}function O(e,n){return(0,i.Z)((0,o.Z)({},e),{config:(0,i.Z)((0,o.Z)({},e.config),{fields:n})})}function L(e){var n,t,r=e.id,i=e.label,s=e.repeatable,c=e.format,u=(n=s,t=c,!1===n&&"page"===t?(0,o.Z)({},R,E):!1===n?N:"page"===t?(0,o.Z)({},M,E):A);return{format:c,id:r,json:u,label:i,repeatable:s,status:!0}}var N={Main:{}},R={Main:{slices:{config:{choices:{}},fieldset:"Slice Zone",type:"Slices"}}},A={Main:{uid:{config:{label:"UID"},type:"UID"}}},M={Main:(0,o.Z)({},A.Main,R.Main)},E={"SEO & Metadata":{meta_description:{config:{label:"Meta Description",placeholder:"A brief summary of the page"},type:"Text"},meta_image:{config:{constraint:{height:1260,width:2400},label:"Meta Image",thumbnails:[]},type:"Image"},meta_title:{config:{label:"Meta Title",placeholder:"A title of the page used for social media and search engines"},type:"Text"}}}},19345:function(e,n,t){"use strict";t.d(n,{_:function(){return N}});var r=t(22710),o=t(99267),i=t(52322),s=t(56577),c=t(54132),u=t(25812),a=t(81038),l=t(88932),d=t(78656);function f(){return(f=(0,r.Z)(function(e){var n,t,r,i,s,c;return(0,o.__generator)(this,function(o){switch(o.label){case 0:n=e.customType,t=e.onSuccess,r=d.$[n.format],o.label=1;case 1:return o.trys.push([1,3,,4]),[4,a.j.customTypes.deleteCustomType({id:n.id})];case 2:if((i=o.sent().errors).length>0)throw i;return t(),l.Am.success("".concat(r.name({start:!0,plural:!1})," deleted")),[3,4];case 3:return s=o.sent(),c="Internal Error: ".concat(r.name({start:!0,plural:!1})," could not be deleted"),console.error(c,s),l.Am.error(c),[3,4];case 4:return[2]}})})).apply(this,arguments)}var p=t(90374),m=t(2784),v=t(65186),y=t(59326),h=t(75289),x=function(e){var n,t=e.customType,a=e.format,l=e.onClose,x=e.onDeleteCustomTypeSuccess,g=d.$[a],Z=(0,m.useState)(!1),b=Z[0],j=Z[1],I=(0,p.Z)().deleteCustomTypeSuccess,T=(n=(0,r.Z)(function(){return(0,o.__generator)(this,function(e){switch(e.label){case 0:return j(!0),[4,function(e){return f.apply(this,arguments)}({customType:t,onSuccess:function(){return I(t.id)}})];case 1:return e.sent(),x(),[2]}})}),function(){return n.apply(this,arguments)}),_=(0,y.B7)().theme;return(0,i.jsx)(u.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:function(){return l()},children:(0,i.jsx)(c.Z,{bodySx:{p:0,bg:"white",position:"relative",height:"100%",padding:16},footerSx:{position:"sticky",bottom:0,p:0},sx:{border:"none",overflow:"hidden"},borderFooter:!0,Header:function(){var e;return(0,i.jsxs)(h.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",alignItems:"center",justifyContent:"space-between",borderBottom:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.borders))}},children:[(0,i.jsxs)(h.kC,{sx:{alignItems:"center"},children:[(0,i.jsx)(v.$vK,{size:20,color:null===(e=_.colors)||void 0===e?void 0:e.greyIcon}),(0,i.jsxs)(h.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:["Delete"," ",g.name({start:!1,plural:!1})]})]}),(0,i.jsx)(h.x8,{type:"button",onClick:function(){return l()}})]})},Footer:function(){return(0,i.jsxs)(h.kC,{sx:{justifyContent:"flex-end",height:64,alignItems:"center",paddingRight:16,borderTop:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.darkBorders))},backgroundColor:"gray"},children:[(0,i.jsx)(s.z,{label:"Cancel",variant:"secondary",onClick:function(){return l()},sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),void 0!==t&&(0,i.jsx)(s.z,{label:"Delete",variant:"danger",isLoading:b,onClick:function(){T()},sx:{minHeight:39,minWidth:78}})]})},children:(0,i.jsxs)("div",{children:["This action will immediately make the following change:",(0,i.jsx)("ul",{children:(0,i.jsxs)("li",{children:["Delete the"," ",(0,i.jsxs)(h.xv,{sx:{fontWeight:"bold"},children:["customtypes/",null==t?void 0:t.id,"/"]})," ","directory."]})}),"The next time you push your changes to Prismic, the following change will happen:",(0,i.jsx)("ul",{children:(0,i.jsxs)("li",{children:["Remove the"," ",g.name({start:!1,plural:!1})," and any associated Documents from your repository."]})})]})})})},g=t(62230),Z=t(85244);function b(){return(b=(0,r.Z)(function(e){var n,t,r,i,s,c,u,f;return(0,o.__generator)(this,function(o){switch(o.label){case 0:n=e.model,t=e.newLabel,r=e.onSuccess,i=d.$[n.format],o.label=1;case 1:return o.trys.push([1,3,,4]),s=(0,Z.Z)((0,g.Z)({},n),{label:t}),[4,a.j.customTypes.renameCustomType({model:s})];case 2:if((c=o.sent().errors).length>0)throw c;return r(s),l.Am.success("".concat(i.name({start:!0,plural:!1})," renamed")),[3,4];case 3:return u=o.sent(),f="Internal Error: ".concat(i.name({start:!0,plural:!1})," could not be renamed"),console.error(f,u),l.Am.error(f),[3,4];case 4:return[2]}})})).apply(this,arguments)}var j=t(50950),I=t(31667),T=t(56580),_=t(68780),S=t(70041),C=function(e){var n,t,s,c=e.isChangesLocal,u=e.customType,a=e.format,l=e.onClose,f=e.setLocalCustomType,v=null!==(n=null==u?void 0:u.label)&&void 0!==n?n:"",y=null!==(t=null==u?void 0:u.id)&&void 0!==t?t:"",x=(0,p.Z)().renameCustomTypeSuccess,C=(0,j.g)().syncChanges,F=(0,m.useState)(!1),w=F[0],z=F[1],k=(s=(0,r.Z)(function(e){return(0,o.__generator)(this,function(n){switch(n.label){case 0:if(z(!0),!(c&&f))return[3,1];return f((0,Z.Z)((0,g.Z)({},u),{label:e.customTypeName})),[3,3];case 1:return[4,function(e){return b.apply(this,arguments)}({model:u,newLabel:e.customTypeName,onSuccess:function(e){x(e),C()}})];case 2:n.sent(),n.label=3;case 3:return z(!1),l(),[2]}})}),function(e){return s.apply(this,arguments)}),O=(0,T.v9)(function(e){return{customTypeLabels:(0,I.YS)(e)}}).customTypeLabels,L=d.$[a];return(0,i.jsx)(_.Z,{isOpen:!0,testId:"rename-custom-type-modal",widthInPx:"530px",formId:"rename-custom-type-modal-".concat(y),buttonLabel:"Rename",close:l,onSubmit:function(e){k(e)},initialValues:{customTypeName:v},isLoading:w,content:{title:"Rename a ".concat(L.name({start:!1,plural:!1}))},validate:function(e){var n=e.customTypeName,t={};return n&&n.length||(t.customTypeName="Cannot be empty."),void 0!=t.customTypeName&&O.includes(n)&&v!==n&&(t.customTypeName="".concat(L.name({start:!0,plural:!1})," name is already taken.")),Object.keys(t).length>0?t:void 0},children:function(e){var n=e.errors;return(0,i.jsx)(h.xu,{children:(0,i.jsx)(S.W,{name:"customTypeName",label:"".concat(L.name({start:!0,plural:!1})," Name"),placeholder:"A display name for the ".concat(L.name({start:!1,plural:!1})),error:n.customTypeName,testId:"custom-type-name-input"})})}})},F=t(22715),w=t(5632),z=t(82770),k=t(91061);function O(){return(O=(0,r.Z)(function(e,n){var t,r,i,s,c;return(0,o.__generator)(this,function(o){switch(o.label){case 0:t=d.$[e.format],o.label=1;case 1:return o.trys.push([1,3,,4]),r=(0,k.mf)(e),[4,(0,z.KA)(r)];case 2:if((i=o.sent().errors).length>0)throw i;return n(r),l.Am.success("".concat(t.name({start:!0,plural:!1})," converted to page type")),[3,4];case 3:return s=o.sent(),c="Internal Error: ".concat(t.name({start:!0,plural:!1})," not converted to page type"),console.error(c,s),l.Am.error(c),[3,4];case 4:return[2]}})})).apply(this,arguments)}var L=t(67445),N=function(e){var n,t=e.format,s=e.customType,c=e.isChangesLocal,u=e.setLocalCustomType,a=(0,w.useRouter)(),l=(0,p.Z)().saveCustomTypeSuccess,d=(0,m.useState)(!1),f=d[0],v=d[1],y=(0,m.useState)(!1),h=y[0],g=y[1],Z=(0,m.useState)(!1),b=Z[0],j=Z[1],I=(n=(0,r.Z)(function(){var e,n;return(0,o.__generator)(this,function(t){switch(t.label){case 0:return j(!0),[4,function(e,n){return O.apply(this,arguments)}(s,l)];case 1:return t.sent(),e=L.cd.custom.getBuilderPagePathname(s.id),a.asPath===e&&(n=L.cd.page.getBuilderPagePathname(s.id),a.replace(n)),j(!1),[2]}})}),function(){return n.apply(this,arguments)}),T=function(){var e,n=L.cd[null!==(e=s.format)&&void 0!==e?e:"custom"].tablePagePathname;a.asPath!==n?a.replace(n):v(!1)};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(F.h_,{modal:!0,children:[(0,i.jsx)(F.$F,{disabled:b,children:(0,i.jsx)(F.hU,{color:"grey","data-testid":"editDropdown",hiddenLabel:"Custom type actions",icon:"moreVert",loading:b,variant:"solid"})}),(0,i.jsxs)(F.AW,{align:"end",children:[(0,i.jsx)(F.Xi,{startIcon:(0,i.jsx)(F.I5,{name:"edit"}),onSelect:function(){g(!0)},children:"Rename"}),"custom"===t&&!c&&(0,i.jsx)(F.Xi,{startIcon:(0,i.jsx)(F.I5,{name:"driveFileMove"}),onSelect:function(){I()},children:"Convert to page type"}),(0,i.jsx)(F.Xi,{color:"tomato",startIcon:(0,i.jsx)(F.I5,{name:"delete"}),onSelect:function(){v(!0)},children:"Remove"})]})]}),f?(0,i.jsx)(x,{format:t,customType:s,onClose:function(){return v(!1)},onDeleteCustomTypeSuccess:T}):null,h?(0,i.jsx)(C,{format:t,customType:s,isChangesLocal:c,onClose:function(){return g(!1)},setLocalCustomType:u}):null]})}},69143:function(){}}]);