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

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 (449) hide show
  1. package/out/404.html +1 -1
  2. package/out/_next/static/chunks/127-5f39b7de8178c2e4.js +1 -0
  3. package/out/_next/static/chunks/{183-ebd633fed7c74545.js → 183-6ad5c4eb28d4b155.js} +1 -1
  4. package/out/_next/static/chunks/453-4e2d00a3515202f4.js +1 -0
  5. package/out/_next/static/chunks/46-bd45510ac2a839b5.js +10 -0
  6. package/out/_next/static/chunks/614-af117b661cd3429a.js +1 -0
  7. package/out/_next/static/chunks/90-2d4bdae13d031364.js +1 -0
  8. package/out/_next/static/chunks/91-aa2369249805fb5a.js +1 -0
  9. package/out/_next/static/chunks/96-24fed6adc069e313.js +1 -0
  10. package/out/_next/static/chunks/pages/{_app-6177e3581af44083.js → _app-2e45ed74db68cb0a.js} +3 -3
  11. package/out/_next/static/chunks/pages/changelog-ac1004bdd31d17f8.js +1 -0
  12. package/out/_next/static/chunks/pages/changes-5c4bd80747884a8c.js +1 -0
  13. package/out/_next/static/chunks/pages/custom-types/[customTypeId]-5b08515fec5e6668.js +1 -0
  14. package/out/_next/static/chunks/pages/{custom-types-3c8e721ec6802127.js → custom-types-75e8eddec659f440.js} +1 -1
  15. package/out/_next/static/chunks/pages/index-16754a04037cf9c1.js +1 -0
  16. package/out/_next/static/chunks/pages/labs-d6f2feb6720ee64c.js +1 -0
  17. package/out/_next/static/chunks/pages/page-types/[pageTypeId]-41fc6d4f726fdfb9.js +1 -0
  18. package/out/_next/static/chunks/pages/settings-7ad1540dc0af794d.js +1 -0
  19. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-9941e7eeb9d4d084.js +1 -0
  20. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-8c8d4de562fca8ac.js +1 -0
  21. package/out/_next/static/chunks/pages/slices-801310de228fd05e.js +1 -0
  22. package/out/_next/static/css/17da9daaa8986410.css +1 -0
  23. package/out/_next/static/css/{27f2b9b9c9f65885.css → 663a1bac4ce890da.css} +1 -1
  24. package/out/_next/static/css/c36992b18975f9b9.css +1 -0
  25. package/out/_next/static/css/{243a4d347efcfd53.css → df904982b9637c1a.css} +1 -1
  26. package/out/_next/static/umd9mjV29cCbZplewdOPw/_buildManifest.js +1 -0
  27. package/out/changelog.html +1 -1
  28. package/out/changes.html +1 -1
  29. package/out/custom-types/[customTypeId].html +1 -1
  30. package/out/custom-types.html +1 -1
  31. package/out/index.html +1 -1
  32. package/out/labs.html +1 -1
  33. package/out/page-types/[pageTypeId].html +1 -1
  34. package/out/settings.html +1 -1
  35. package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
  36. package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
  37. package/out/slices.html +1 -1
  38. package/package.json +6 -6
  39. package/sentry.client.config.ts +2 -1
  40. package/src/ErrorBoundary.tsx +2 -1
  41. package/src/apiClient.ts +12 -7
  42. package/src/components/Card/Card.stories.tsx +4 -3
  43. package/src/components/CodeBlock/CodeBlock.tsx +6 -5
  44. package/src/components/Count/Count.tsx +2 -1
  45. package/src/components/HoverCard/HoverCard.tsx +3 -2
  46. package/src/components/SideNav/SideNav.stories.tsx +3 -2
  47. package/src/components/SideNav/SideNav.tsx +3 -2
  48. package/src/components/SideNav/SideNavEnvironmentSelector.tsx +3 -2
  49. package/src/components/Table/Table.test.tsx +4 -3
  50. package/src/domain/__tests__/customType.test.ts +0 -184
  51. package/src/domain/__tests__/group.test.ts +161 -0
  52. package/src/domain/__tests__/slice.test.ts +3 -2
  53. package/src/domain/customType.ts +0 -191
  54. package/src/domain/group.ts +89 -0
  55. package/src/domain/slice.ts +29 -12
  56. package/src/features/autoSave/AutoSaveStatusIndicator.tsx +2 -1
  57. package/src/features/changelog/useSliceMachineLatestNonBreakingVersion.ts +2 -1
  58. package/src/features/changelog/useSliceMachineReleaseNotes.ts +2 -1
  59. package/src/features/changelog/useSliceMachineVersions.ts +2 -1
  60. package/src/features/changes/BlankSlates/NoChangesBlankSlate.tsx +9 -8
  61. package/src/features/changes/PushChangesButton.tsx +5 -4
  62. package/src/features/changes/StatusBadge.tsx +3 -2
  63. package/src/features/customTypes/EditDropdown.tsx +4 -3
  64. package/src/features/customTypes/PageTypeOnboarding.tsx +4 -3
  65. package/src/features/customTypes/__tests__/CustomTypeBuilderPage.test.tsx +5 -4
  66. package/src/features/customTypes/__tests__/CustomTypesTablePage.test.tsx +5 -4
  67. package/src/features/customTypes/actions/convertCustomToPageType.ts +3 -2
  68. package/src/features/customTypes/actions/createCustomType.ts +4 -3
  69. package/src/features/customTypes/actions/deleteCustomType.ts +2 -1
  70. package/src/features/customTypes/actions/renameCustomType.ts +2 -1
  71. package/src/features/customTypes/customTypesBuilder/CustomTypeProvider.tsx +6 -5
  72. package/src/features/customTypes/customTypesBuilder/CustomTypesBuilderPage.tsx +21 -17
  73. package/src/features/customTypes/customTypesBuilder/PageSnippetDialog/PageSnippetDialog.tsx +7 -6
  74. package/src/features/customTypes/customTypesBuilder/SliceZoneBlankSlate.tsx +4 -3
  75. package/src/features/customTypes/customTypesBuilder/useCustomType.ts +2 -1
  76. package/src/features/customTypes/customTypesConfig.ts +3 -2
  77. package/src/features/customTypes/customTypesTable/CustomTypesTable.tsx +8 -7
  78. package/src/features/customTypes/customTypesTable/CustomTypesTablePage.tsx +12 -11
  79. package/src/features/customTypes/customTypesTable/useCustomTypes.ts +6 -5
  80. package/src/features/documentation/MarkdownRenderer/index.tsx +4 -3
  81. package/src/features/documentation/useDocumentation.ts +2 -1
  82. package/src/features/environments/actions/getActiveEnvironment.ts +2 -1
  83. package/src/features/environments/actions/getEnvironments.ts +1 -1
  84. package/src/features/environments/actions/setEnvironment.ts +3 -2
  85. package/src/features/inAppGuide/InAppGuideContext.tsx +2 -1
  86. package/src/features/inAppGuide/InAppGuideDialog.tsx +4 -3
  87. package/src/features/inAppGuide/inAppGuideContent.tsx +2 -1
  88. package/src/features/labs/labsList/LabsPage.tsx +7 -6
  89. package/src/features/labs/labsList/useLab.tsx +2 -1
  90. package/src/features/settings/SettingsPage.tsx +9 -8
  91. package/src/features/settings/git/ConnectGitRepository.tsx +11 -10
  92. package/src/features/settings/git/GitOwnerSelect.tsx +2 -1
  93. package/src/features/settings/git/GitProvider.ts +5 -4
  94. package/src/features/settings/git/GitProviderConnectButtons.tsx +2 -1
  95. package/src/features/settings/git/GitRepositoriesList.tsx +6 -5
  96. package/src/features/settings/git/GitRepositoriesSearch.tsx +7 -6
  97. package/src/features/settings/git/GitRepositoryConnectDialog.tsx +4 -3
  98. package/src/features/settings/git/useGitIntegrationExperiment.ts +1 -1
  99. package/src/features/settings/git/useGitOwners.ts +2 -1
  100. package/src/features/settings/git/useGitRepos.ts +2 -1
  101. package/src/features/settings/git/useLinkedGitRepos.ts +3 -2
  102. package/src/features/settings/git/useWriteAPIToken.ts +3 -2
  103. package/src/features/slices/actions/addSlicesToSliceZone.ts +3 -2
  104. package/src/features/slices/actions/createSlice.ts +5 -4
  105. package/src/features/slices/actions/deleteSlice.ts +2 -1
  106. package/src/features/slices/actions/renameSlice.ts +5 -4
  107. package/src/features/slices/actions/uploadSliceScreenshot.ts +3 -2
  108. package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewSliceDialog.tsx +5 -4
  109. package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewVariationDialog.tsx +2 -1
  110. package/src/features/slices/convertLegacySlice/ConvertLegacySliceButton.tsx +10 -9
  111. package/src/features/slices/convertLegacySlice/types.ts +2 -2
  112. package/src/features/slices/sliceBuilder/FloatingBackButton.tsx +9 -8
  113. package/src/features/slices/sliceBuilder/SliceBuilderProvider.tsx +7 -6
  114. package/src/features/slices/sliceBuilder/actions/deleteVariation.ts +7 -6
  115. package/src/features/slices/sliceBuilder/actions/renameVariation.ts +5 -4
  116. package/src/features/slices/sliceBuilder/useGroupsInSlicesExperiment.ts +1 -1
  117. package/src/features/slices/sliceCards/NonSharedSliceCard.tsx +5 -4
  118. package/src/features/slices/sliceCards/SharedSliceCard.tsx +9 -8
  119. package/src/features/slicesTemplates/actions/createSlicesTemplates.ts +3 -2
  120. package/src/features/slicesTemplates/useSlicesTemplates.ts +2 -1
  121. package/src/features/sync/AutoSyncProvider.tsx +10 -9
  122. package/src/features/sync/actions/pushChanges.ts +4 -3
  123. package/src/features/sync/actions/trackPushChangesSuccess.ts +3 -3
  124. package/src/features/sync/components/AutoSyncStatusIndicator.tsx +4 -3
  125. package/src/features/sync/fetchUnSyncChanges.ts +4 -4
  126. package/src/features/sync/getUnSyncChanges.ts +5 -5
  127. package/src/features/sync/useUnSyncChanges.ts +5 -4
  128. package/src/hooks/useAdapterName.ts +2 -1
  129. package/src/hooks/useAuthStatus.ts +3 -2
  130. package/src/hooks/useCurrentSlice.tsx +5 -4
  131. package/src/hooks/useEditorContent.ts +4 -3
  132. package/src/hooks/useExperimentVariant.ts +2 -1
  133. package/src/hooks/useIsEmptyProject.ts +2 -1
  134. package/src/hooks/useRepositoryInformation.ts +3 -2
  135. package/src/hooks/useSMTracker.ts +5 -4
  136. package/src/hooks/useScreenshotChangesModal.ts +4 -3
  137. package/src/hooks/useServerState.ts +4 -3
  138. package/src/hooks/useSliceMachineConfig.ts +2 -1
  139. package/src/hooks/useSliceMachineRunningVersion.ts +2 -1
  140. package/src/hooks/useUpdateAvailable.ts +2 -1
  141. package/{components → src/legacy/components}/App/index.tsx +9 -8
  142. package/{components → src/legacy/components}/AppLayout/index.tsx +8 -7
  143. package/{components → src/legacy/components}/Changelog/index.tsx +5 -4
  144. package/{components → src/legacy/components}/Changelog/navigation/index.tsx +5 -4
  145. package/{components → src/legacy/components}/Changelog/versionDetails/UpdateCommandBox.tsx +5 -4
  146. package/{components → src/legacy/components}/Changelog/versionDetails/index.tsx +2 -1
  147. package/{components → src/legacy/components}/ChangesEmptyState/AuthErrorPage.tsx +3 -2
  148. package/{components → src/legacy/components}/ChangesItems/ChangesItems.tsx +14 -13
  149. package/{components → src/legacy/components}/ChangesItems/DevCollaborationExperiment.tsx +3 -2
  150. package/{components → src/legacy/components}/CodeBlock/index.tsx +2 -1
  151. package/{components → src/legacy/components}/ConfigErrors/index.jsx +3 -2
  152. package/{components → src/legacy/components}/CustomTypeTable/changesPage.tsx +11 -10
  153. package/{components → src/legacy/components}/DeleteCTModal/index.tsx +7 -6
  154. package/{components → src/legacy/components}/DeleteDocumentsDrawer/AssociatedDocumentsCard.tsx +3 -2
  155. package/{components → src/legacy/components}/DeleteDocumentsDrawer/HardDeleteDocumentsDrawer.tsx +6 -5
  156. package/{components → src/legacy/components}/DeleteDocumentsDrawer/SoftDeleteDocumentsDrawer.tsx +6 -5
  157. package/{components → src/legacy/components}/DeleteSliceModal/index.tsx +7 -6
  158. package/{components → src/legacy/components}/DeleteVariationModal/index.tsx +6 -5
  159. package/{components → src/legacy/components}/EmptyState/index.tsx +2 -1
  160. package/{components → src/legacy/components}/FormFields/Input.tsx +2 -1
  161. package/{components → src/legacy/components}/Forms/CreateCustomTypeModal/CreateCustomTypeModal.tsx +17 -16
  162. package/{components → src/legacy/components}/Forms/CreateSliceModal/CreateSliceModal.tsx +8 -7
  163. package/{components → src/legacy/components}/Forms/RenameCustomTypeModal/RenameCustomTypeModal.tsx +7 -6
  164. package/{components → src/legacy/components}/Forms/RenameSliceModal/RenameSliceModal.tsx +7 -6
  165. package/src/legacy/components/Forms/RenameVariationModal/RenameVariationModal.module.css.d.ts +5 -0
  166. package/{components → src/legacy/components}/Forms/RenameVariationModal/RenameVariationModal.tsx +6 -5
  167. package/{components → src/legacy/components}/Forms/components/SelectRepeatable.tsx +2 -1
  168. package/{components → src/legacy/components}/Forms/formsValidator.ts +4 -3
  169. package/{components → src/legacy/components}/ListItem/Header.tsx +2 -1
  170. package/{components → src/legacy/components}/ListItem/index.tsx +3 -2
  171. package/{components → src/legacy/components}/LoginModal/index.tsx +20 -19
  172. package/{components → src/legacy/components}/ModalFormCard/index.tsx +3 -2
  173. package/{components → src/legacy/components}/Navigation/ChangesItem.tsx +12 -11
  174. package/{components → src/legacy/components}/Navigation/Environment.tsx +13 -12
  175. package/{components → src/legacy/components}/Navigation/RunningVersion.tsx +3 -2
  176. package/{components → src/legacy/components}/Navigation/UpdateBox.tsx +3 -2
  177. package/src/legacy/components/Navigation/VideoItem.module.css.d.ts +5 -0
  178. package/{components → src/legacy/components}/Navigation/VideoItem.tsx +15 -14
  179. package/src/legacy/components/Navigation/index.module.css.d.ts +5 -0
  180. package/{components → src/legacy/components}/Navigation/index.test.tsx +7 -9
  181. package/{components → src/legacy/components}/Navigation/index.tsx +21 -20
  182. package/{components → src/legacy/components}/ReviewModal/ReviewForm.tsx +10 -9
  183. package/{components → src/legacy/components}/ReviewModal/ReviewModal.tsx +7 -6
  184. package/{components → src/legacy/components}/ScreenshotChangesModal/VariationDropZone.tsx +6 -5
  185. package/{components → src/legacy/components}/ScreenshotChangesModal/index.tsx +11 -10
  186. package/{components → src/legacy/components}/ScreenshotChangesModal/useCustomScreenshot.tsx +2 -1
  187. package/{components → src/legacy/components}/ScreenshotPreviewModal/index.tsx +8 -7
  188. package/{components → src/legacy/components}/Simulator/components/FailedConnect/index.tsx +2 -1
  189. package/{components → src/legacy/components}/Simulator/components/Header/VariationsPopover/MenuList.tsx +2 -1
  190. package/{components → src/legacy/components}/Simulator/components/Header/VariationsPopover/index.tsx +2 -1
  191. package/{components → src/legacy/components}/Simulator/components/Header/index.tsx +7 -6
  192. package/{components → src/legacy/components}/Simulator/components/IframeRenderer/index.tsx +3 -2
  193. package/{components → src/legacy/components}/Simulator/components/Toolbar/ScreensizeInput/index.tsx +2 -1
  194. package/{components → src/legacy/components}/Simulator/components/Toolbar/index.tsx +3 -2
  195. package/{components → src/legacy/components}/Simulator/index.tsx +12 -11
  196. package/{components → src/legacy/components}/SliceMachineDrawer/index.tsx +2 -1
  197. package/{components → src/legacy/components}/Tooltip/TextWithTooltip.tsx +2 -1
  198. package/{components → src/legacy/components}/Tooltip/index.jsx +2 -1
  199. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/DeleteSliceZoneModal.tsx +4 -3
  200. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/List.tsx +11 -10
  201. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/SlicesTemplatesModal.tsx +10 -9
  202. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/UpdateSliceZoneModal.tsx +3 -2
  203. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/UpdateSliceZoneModalList.tsx +4 -3
  204. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/index.tsx +23 -19
  205. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/SliceZone/sliceTemplatesComingSoon.ts +1 -1
  206. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabModal/create.tsx +2 -1
  207. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabModal/delete.tsx +1 -1
  208. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabModal/update.tsx +2 -1
  209. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabZone/index.tsx +29 -28
  210. package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/index.tsx +7 -6
  211. package/{lib → src/legacy/lib}/builders/SliceBuilder/FieldZones/index.tsx +42 -49
  212. package/{lib → src/legacy/lib}/builders/SliceBuilder/Sidebar/AddVariationModal.tsx +4 -3
  213. package/{lib → src/legacy/lib}/builders/SliceBuilder/Sidebar/index.tsx +13 -12
  214. package/{lib → src/legacy/lib}/builders/SliceBuilder/SimulatorButton/index.tsx +15 -11
  215. package/{lib → src/legacy/lib}/builders/SliceBuilder/index.tsx +9 -8
  216. package/{lib → src/legacy/lib}/builders/common/EditModal/Field.jsx +2 -1
  217. package/{lib → src/legacy/lib}/builders/common/EditModal/index.jsx +12 -8
  218. package/{lib → src/legacy/lib}/builders/common/SelectFieldTypeModal/index.jsx +4 -3
  219. package/{lib → src/legacy/lib}/builders/common/Zone/Card/components/ErrorTooltip.tsx +2 -1
  220. package/{lib → src/legacy/lib}/builders/common/Zone/Card/components/Hints/CodeBlock.tsx +2 -1
  221. package/{lib → src/legacy/lib}/builders/common/Zone/Card/components/Hints/index.tsx +2 -1
  222. package/{lib → src/legacy/lib}/builders/common/Zone/Card/components/NewField.tsx +14 -10
  223. package/{lib → src/legacy/lib}/builders/common/Zone/Card/index.jsx +7 -3
  224. package/{lib → src/legacy/lib}/builders/common/Zone/index.jsx +7 -9
  225. package/{lib → src/legacy/lib}/builders/utils/index.ts +1 -1
  226. package/{lib → src/legacy/lib}/models/common/DeprecatedMockConfigMessage.tsx +2 -1
  227. package/{lib → src/legacy/lib}/models/common/ModelData.ts +3 -3
  228. package/{lib → src/legacy/lib}/models/common/ModelStatus/index.ts +2 -2
  229. package/{lib → src/legacy/lib}/models/common/Slice.ts +17 -3
  230. package/{lib → src/legacy/lib}/models/common/normalizers/customType.ts +2 -2
  231. package/{lib → src/legacy/lib}/models/common/normalizers/slices.ts +2 -2
  232. package/{lib → src/legacy/lib}/models/common/widgets/ContentRelationship/Form.tsx +6 -5
  233. package/{lib → src/legacy/lib}/models/common/widgets/ContentRelationship/index.ts +3 -2
  234. package/{lib → src/legacy/lib}/models/common/widgets/Group/Form.jsx +6 -5
  235. package/{lib → src/legacy/lib}/models/common/widgets/Group/ListItem/index.jsx +62 -67
  236. package/{lib → src/legacy/lib}/models/common/widgets/Group/index.ts +2 -1
  237. package/{lib → src/legacy/lib}/models/common/widgets/Image/Form.tsx +6 -5
  238. package/{lib → src/legacy/lib}/models/common/widgets/Image/components.tsx +5 -4
  239. package/{lib → src/legacy/lib}/models/common/widgets/Link/Form.jsx +5 -5
  240. package/{lib → src/legacy/lib}/models/common/widgets/LinkToMedia/Form.jsx +4 -4
  241. package/{lib → src/legacy/lib}/models/common/widgets/LinkToMedia/index.ts +2 -1
  242. package/{lib → src/legacy/lib}/models/common/widgets/Select/FormFields.jsx +6 -5
  243. package/{lib → src/legacy/lib}/models/common/widgets/StructuredText/Form.tsx +7 -6
  244. package/{lib → src/legacy/lib}/models/common/widgets/Widget.ts +2 -1
  245. package/src/legacy/lib/models/common/widgets/groupBuilderArray.ts +18 -0
  246. package/src/legacy/lib/models/common/widgets/sliceBuilderArray.ts +19 -0
  247. package/src/legacy/lib/models/common/widgets/withGroup.ts +2 -0
  248. package/{lib → src/legacy/lib}/models/server/ServerState.ts +2 -2
  249. package/{lib → src/legacy/lib}/utils/shared/customTypes.ts +1 -1
  250. package/src/modules/availableCustomTypes/index.ts +10 -9
  251. package/src/modules/availableCustomTypes/types.ts +2 -2
  252. package/src/modules/environment/index.ts +7 -6
  253. package/src/modules/environment/types.ts +1 -1
  254. package/src/modules/modal/index.ts +2 -1
  255. package/src/modules/slices/index.ts +12 -8
  256. package/src/modules/slices/selector.ts +1 -1
  257. package/src/modules/slices/types.ts +2 -2
  258. package/src/modules/useSliceMachineActions.ts +10 -6
  259. package/src/modules/userContext/index.ts +6 -5
  260. package/{pages → src/pages}/_app.tsx +22 -22
  261. package/{pages → src/pages}/changelog.tsx +2 -1
  262. package/{pages → src/pages}/changes.tsx +25 -21
  263. package/src/pages/custom-types/[customTypeId].tsx +1 -0
  264. package/{pages → src/pages}/custom-types.tsx +2 -1
  265. package/{pages → src/pages}/index.tsx +4 -3
  266. package/src/pages/labs.tsx +1 -0
  267. package/src/pages/page-types/[pageTypeId].tsx +1 -0
  268. package/src/pages/settings.tsx +1 -0
  269. package/{pages → src/pages}/slices/[lib]/[sliceName]/[variation]/index.tsx +4 -3
  270. package/{pages → src/pages}/slices/[lib]/[sliceName]/[variation]/simulator.tsx +3 -2
  271. package/{pages → src/pages}/slices.tsx +24 -23
  272. package/src/redux/reducer.ts +7 -6
  273. package/src/redux/store.ts +2 -1
  274. package/src/redux/type.ts +7 -6
  275. package/src/utils/getContentTypeForTracking.ts +21 -0
  276. package/test/__setup__.ts +10 -8
  277. package/test/__testutils__/createTestPlugin.ts +3 -2
  278. package/test/__testutils__/createTestProject.ts +5 -4
  279. package/test/__testutils__/index.tsx +6 -5
  280. package/test/__testutils__/mockAWSACLAPI.ts +1 -1
  281. package/test/__testutils__/mockCustomTypesAPI.ts +1 -1
  282. package/test/__testutils__/mockPrismicAuthAPI.ts +1 -1
  283. package/test/__testutils__/mockPrismicUserAPI.ts +2 -3
  284. package/test/__testutils__/readMSWFormData.ts +1 -1
  285. package/test/components/IframeRenderer.test.ts +3 -2
  286. package/test/lib/builders/EditModal.test.tsx +5 -3
  287. package/test/lib/builders/buildersUtils.test.ts +3 -3
  288. package/test/lib/consts.test.ts +6 -2
  289. package/test/lib/models/common/CustomType.test.ts +6 -2
  290. package/test/lib/models/common/ModelStatus.test.ts +6 -4
  291. package/test/lib/models/common/Slice.test.ts +3 -2
  292. package/test/lib/models/common/widgets/index.test.ts +8 -4
  293. package/test/lib/utils/index.test.ts +3 -2
  294. package/test/lib/utils/preferWroomBase.test.ts +3 -2
  295. package/test/lib/utils/shared/customTypes.test.ts +2 -1
  296. package/test/pages/slices.test.tsx +10 -10
  297. package/test/src/modules/__fixtures__/serverState.ts +1 -1
  298. package/test/src/modules/__fixtures__/sliceUtilsFactory.ts +3 -3
  299. package/test/src/modules/availableCustomTypes/index.test.ts +3 -3
  300. package/test/src/modules/environment.test.ts +3 -5
  301. package/test/src/modules/loading.test.ts +3 -3
  302. package/test/src/modules/modal.test.ts +5 -5
  303. package/test/src/modules/slices.test.ts +3 -2
  304. package/test/src/modules/userContext.test.ts +3 -3
  305. package/test/src/normalizers/customType.test.ts +16 -3
  306. package/test/src/utils/fieldNameCreator.test.ts +1 -1
  307. package/tsconfig.json +1 -6
  308. package/vite.config.ts +1 -7
  309. package/lib/models/common/widgets/sliceBuilderArray.ts +0 -31
  310. package/lib/models/common/widgets/withGroup.ts +0 -19
  311. package/out/_next/static/6WrgMw0SELcypoJCYNiKd/_buildManifest.js +0 -1
  312. package/out/_next/static/chunks/25-607d5cfe6492f4e8.js +0 -1
  313. package/out/_next/static/chunks/286-6ee80333008646b9.js +0 -1
  314. package/out/_next/static/chunks/318-c84322cba57be932.js +0 -1
  315. package/out/_next/static/chunks/382-8194eab141c7ea2f.js +0 -1
  316. package/out/_next/static/chunks/46-d22d7a121254e31d.js +0 -8
  317. package/out/_next/static/chunks/727-b53258380c1a11f1.js +0 -1
  318. package/out/_next/static/chunks/799-68887319f3169f78.js +0 -1
  319. package/out/_next/static/chunks/pages/changelog-2d061c06b2b82e28.js +0 -1
  320. package/out/_next/static/chunks/pages/changes-cde59d56dc849106.js +0 -1
  321. package/out/_next/static/chunks/pages/custom-types/[customTypeId]-89ccb93ce7409ad0.js +0 -1
  322. package/out/_next/static/chunks/pages/index-b5817351a77c6d40.js +0 -1
  323. package/out/_next/static/chunks/pages/labs-0fc7d01b8c9bfc2a.js +0 -1
  324. package/out/_next/static/chunks/pages/page-types/[pageTypeId]-dbf86fe3a94dc892.js +0 -1
  325. package/out/_next/static/chunks/pages/settings-897ad13a08f73048.js +0 -1
  326. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-ed3157875529f0f2.js +0 -1
  327. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-69cf4b12bb354f9f.js +0 -1
  328. package/out/_next/static/chunks/pages/slices-391f6c4b30af0759.js +0 -1
  329. package/out/_next/static/css/0e0d6c4ec6bf7373.css +0 -1
  330. package/out/_next/static/css/f8eb526e10bc2441.css +0 -1
  331. package/pages/custom-types/[customTypeId].tsx +0 -1
  332. package/pages/labs.tsx +0 -1
  333. package/pages/page-types/[pageTypeId].tsx +0 -1
  334. package/pages/settings.tsx +0 -1
  335. /package/out/_next/static/{6WrgMw0SELcypoJCYNiKd → umd9mjV29cCbZplewdOPw}/_ssgManifest.js +0 -0
  336. /package/{components → src/legacy/components}/AuthInstructions/index.jsx +0 -0
  337. /package/{components → src/legacy/components}/Button/index.tsx +0 -0
  338. /package/{components → src/legacy/components}/Card/CardBox.tsx +0 -0
  339. /package/{components → src/legacy/components}/Card/Default.jsx +0 -0
  340. /package/{components → src/legacy/components}/Card/Preview.jsx +0 -0
  341. /package/{components → src/legacy/components}/Card/WithTabs/components.jsx +0 -0
  342. /package/{components → src/legacy/components}/Card/WithTabs/index.jsx +0 -0
  343. /package/{components → src/legacy/components}/Card/index.tsx +0 -0
  344. /package/{components → src/legacy/components}/Changelog/navigation/VersionBadge.tsx +0 -0
  345. /package/{components → src/legacy/components}/Changelog/navigation/VersionTag.tsx +0 -0
  346. /package/{components → src/legacy/components}/Changelog/versionDetails/ReleaseNotesDetails.tsx +0 -0
  347. /package/{components → src/legacy/components}/Changelog/versionDetails/VersionKindLabel.tsx +0 -0
  348. /package/{components → src/legacy/components}/ChangesEmptyState/OfflinePage.tsx +0 -0
  349. /package/{components → src/legacy/components}/ChangesEmptyState/index.ts +0 -0
  350. /package/{components → src/legacy/components}/ChangesItems/ErrorBanner.tsx +0 -0
  351. /package/{components → src/legacy/components}/ChangesItems/index.ts +0 -0
  352. /package/{components → src/legacy/components}/ChangesSectionHeader/ChangesSectionHeader.tsx +0 -0
  353. /package/{components → src/legacy/components}/ChangesSectionHeader/index.ts +0 -0
  354. /package/{components → src/legacy/components}/DeleteDocumentsDrawer/index.tsx +0 -0
  355. /package/{components → src/legacy/components}/DropDownSelector/MenuList.tsx +0 -0
  356. /package/{components → src/legacy/components}/DropDownSelector/index.tsx +0 -0
  357. /package/{components → src/legacy/components}/Flex/index.tsx +0 -0
  358. /package/{components → src/legacy/components}/FormFields/Array.jsx +0 -0
  359. /package/{components → src/legacy/components}/FormFields/Checkbox.jsx +0 -0
  360. /package/{components → src/legacy/components}/FormFields/CheckboxControl.jsx +0 -0
  361. /package/{components → src/legacy/components}/FormFields/SelectDefaultValue.jsx +0 -0
  362. /package/{components → src/legacy/components}/FormFields/index.ts +0 -0
  363. /package/{components → src/legacy/components}/Forms/CreateCustomTypeModal/index.tsx +0 -0
  364. /package/{components → src/legacy/components}/Forms/CreateSliceModal/index.tsx +0 -0
  365. /package/{components → src/legacy/components}/Forms/RenameCustomTypeModal/index.ts +0 -0
  366. /package/{components → src/legacy/components}/Forms/RenameSliceModal/index.ts +0 -0
  367. /package/{components → src/legacy/components}/Forms/RenameVariationModal/RenameVariationModal.module.css +0 -0
  368. /package/{components → src/legacy/components}/Forms/RenameVariationModal/index.ts +0 -0
  369. /package/{components → src/legacy/components}/Forms/components/FlexCard.tsx +0 -0
  370. /package/{components → src/legacy/components}/Forms/components/InputBox.tsx +0 -0
  371. /package/{components → src/legacy/components}/Forms/formsTypes.ts +0 -0
  372. /package/{components → src/legacy/components}/FullPage/index.tsx +0 -0
  373. /package/{components → src/legacy/components}/Grid/index.tsx +0 -0
  374. /package/{components → src/legacy/components}/InputDeleteIcon/index.jsx +0 -0
  375. /package/{components → src/legacy/components}/ItemHeader/index.tsx +0 -0
  376. /package/{components → src/legacy/components}/Li/index.tsx +0 -0
  377. /package/{components → src/legacy/components}/ListItem/utils.js +0 -0
  378. /package/{components → src/legacy/components}/LoadingPage/index.tsx +0 -0
  379. /package/{components → src/legacy/components}/MissingLibraries/index.tsx +0 -0
  380. /package/{components → src/legacy/components}/Navigation/VideoItem.module.css +0 -0
  381. /package/{components → src/legacy/components}/Navigation/index.module.css +0 -0
  382. /package/{components → src/legacy/components}/ReactTooltipPortal/index.tsx +0 -0
  383. /package/{components → src/legacy/components}/ReviewModal/ReviewFormSelect.tsx +0 -0
  384. /package/{components → src/legacy/components}/ReviewModal/index.ts +0 -0
  385. /package/{components → src/legacy/components}/ScreenshotPreview/index.tsx +0 -0
  386. /package/{components → src/legacy/components}/Simulator/components/FullPage/index.tsx +0 -0
  387. /package/{components → src/legacy/components}/Simulator/components/Header/links.ts +0 -0
  388. /package/{components → src/legacy/components}/SliceMachineIconButton/index.tsx +0 -0
  389. /package/{components → src/legacy/components}/SliceMachineModal/index.tsx +0 -0
  390. /package/{components → src/legacy/components}/ToasterContainer/index.tsx +0 -0
  391. /package/{components → src/legacy/components}/Warnings/index.jsx +0 -0
  392. /package/{components → src/legacy/components}/WindowPortal/index.js +0 -0
  393. /package/{components → src/legacy/components}/YoutubeEmbed/index.tsx +0 -0
  394. /package/{lib → src/legacy/lib}/builders/CustomTypeBuilder/TabModal/InputBox.tsx +0 -0
  395. /package/{lib → src/legacy/lib}/builders/common/EditModal/Form.jsx +0 -0
  396. /package/{lib → src/legacy/lib}/builders/common/SelectFieldTypeModal/FieldTypeCard.jsx +0 -0
  397. /package/{lib → src/legacy/lib}/builders/common/Zone/Card/components/EditItem.jsx +0 -0
  398. /package/{lib → src/legacy/lib}/builders/common/Zone/components/EmptyState/index.tsx +0 -0
  399. /package/{lib → src/legacy/lib}/consts.ts +0 -0
  400. /package/{lib → src/legacy/lib}/env/sentry.ts +0 -0
  401. /package/{lib → src/legacy/lib}/forms/defaults.ts +0 -0
  402. /package/{lib → src/legacy/lib}/forms/fields.ts +0 -0
  403. /package/{lib → src/legacy/lib}/forms/index.ts +0 -0
  404. /package/{lib → src/legacy/lib}/forms/types.ts +0 -0
  405. /package/{lib → src/legacy/lib}/hljs/svelte.ts +0 -0
  406. /package/{lib → src/legacy/lib}/models/common/Auth.ts +0 -0
  407. /package/{lib → src/legacy/lib}/models/common/ComponentUI.ts +0 -0
  408. /package/{lib → src/legacy/lib}/models/common/CustomType/index.ts +0 -0
  409. /package/{lib → src/legacy/lib}/models/common/CustomType/sliceZone.ts +0 -0
  410. /package/{lib → src/legacy/lib}/models/common/CustomType/tab.ts +0 -0
  411. /package/{lib → src/legacy/lib}/models/common/Environment.ts +0 -0
  412. /package/{lib → src/legacy/lib}/models/common/ErrorWithStatus.ts +0 -0
  413. /package/{lib → src/legacy/lib}/models/common/Fields.ts +0 -0
  414. /package/{lib → src/legacy/lib}/models/common/Group.ts +0 -0
  415. /package/{lib → src/legacy/lib}/models/common/Library.ts +0 -0
  416. /package/{lib → src/legacy/lib}/models/common/LibraryUI.ts +0 -0
  417. /package/{lib → src/legacy/lib}/models/common/Manifest.ts +0 -0
  418. /package/{lib → src/legacy/lib}/models/common/ModelStatus/compareCustomTypeModels.ts +0 -0
  419. /package/{lib → src/legacy/lib}/models/common/ModelStatus/compareSliceModels.ts +0 -0
  420. /package/{lib → src/legacy/lib}/models/common/PrismicData.ts +0 -0
  421. /package/{lib → src/legacy/lib}/models/common/PrismicFile.ts +0 -0
  422. /package/{lib → src/legacy/lib}/models/common/Screenshots.ts +0 -0
  423. /package/{lib → src/legacy/lib}/models/common/Simulator.ts +0 -0
  424. /package/{lib → src/legacy/lib}/models/common/Slices.ts +0 -0
  425. /package/{lib → src/legacy/lib}/models/common/UserProfile.ts +0 -0
  426. /package/{lib → src/legacy/lib}/models/common/Warning.ts +0 -0
  427. /package/{lib → src/legacy/lib}/models/common/widgets/Boolean/index.ts +0 -0
  428. /package/{lib → src/legacy/lib}/models/common/widgets/Color/index.ts +0 -0
  429. /package/{lib → src/legacy/lib}/models/common/widgets/Date/index.ts +0 -0
  430. /package/{lib → src/legacy/lib}/models/common/widgets/Embed/index.ts +0 -0
  431. /package/{lib → src/legacy/lib}/models/common/widgets/GeoPoint/index.ts +0 -0
  432. /package/{lib → src/legacy/lib}/models/common/widgets/Image/index.ts +0 -0
  433. /package/{lib → src/legacy/lib}/models/common/widgets/Link/index.ts +0 -0
  434. /package/{lib → src/legacy/lib}/models/common/widgets/Number/index.ts +0 -0
  435. /package/{lib → src/legacy/lib}/models/common/widgets/Select/index.ts +0 -0
  436. /package/{lib → src/legacy/lib}/models/common/widgets/StructuredText/index.ts +0 -0
  437. /package/{lib → src/legacy/lib}/models/common/widgets/StructuredText/options.tsx +0 -0
  438. /package/{lib → src/legacy/lib}/models/common/widgets/Text/index.ts +0 -0
  439. /package/{lib → src/legacy/lib}/models/common/widgets/Timestamp/index.ts +0 -0
  440. /package/{lib → src/legacy/lib}/models/common/widgets/UID/index.ts +0 -0
  441. /package/{lib → src/legacy/lib}/models/common/widgets/ctBuilderArray.ts +0 -0
  442. /package/{lib → src/legacy/lib}/models/common/widgets/index.ts +0 -0
  443. /package/{lib → src/legacy/lib}/prismic/endpoints.ts +0 -0
  444. /package/{lib → src/legacy/lib}/utils/index.ts +0 -0
  445. /package/{lib → src/legacy/lib}/utils/poll.ts +0 -0
  446. /package/{lib → src/legacy/lib}/utils/preferWroomBase.ts +0 -0
  447. /package/{lib → src/legacy/lib}/utils/repo.ts +0 -0
  448. /package/{lib → src/legacy/lib}/utils/str.ts +0 -0
  449. /package/{pages → src/pages}/api/embed.js +0 -0
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[453],{2754:function(e,n,t){"use strict";t.d(n,{R$:function(){return l},Qj:function(){return h},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),a=t(22715),u=t(6277);t(69143);var l=function(e){var n=e.backgroundImage,t=e.style,a=(0,s.Z)(e,["backgroundImage","style"]),l=void 0!==n;return(0,c.jsx)("article",(0,i.Z)((0,o.Z)({},a),{className:(0,u.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)(a.xv,(0,i.Z)((0,o.Z)({},e),{className:"_18bjhbz4"}))},m=function(e){return(0,c.jsx)(a.xv,(0,i.Z)((0,o.Z)({},e),{className:"_18bjhbz5",color:"grey11"}))},h=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 j},E3:function(){return m},EN:function(){return h},F$:function(){return x},HO:function(){return b},L4:function(){return Z},Tr:function(){return p},Ue:function(){return T},gR:function(){return _},mf:function(){return v},vB:function(){return y},xS:function(){return g},y6:function(){return u}});var r=t(67557),o=t(62230),i=t(85244),s=t(17064),c=t(98863),a=t(88866);function u(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===a.SlicesFieldType})}function p(e,n){if(t=e,d=f(t,c=n),(p=(0,s.Z)(null!=d?d:[],2))[0],null!==(u=null==(m=p[1])?void 0:m.config)&&void 0!==u?u:void 0)return e;var t,c,u,d,p,m,h=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===a.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)({},h,{type:a.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===a.SlicesFieldType});if(void 0===s)return e;var u=(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,u))})}function h(e){var n,t,s=e.customType,u=e.sectionId,l=e.sliceId,f=d(s,u);if(void 0===f)return s;var p=Object.keys(f).find(function(e){return f[e].type===a.SlicesFieldType});if(void 0===p)return s;var m=f[p];if(m.type!==a.SlicesFieldType)return s;var h=(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)({},u,(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:h})})))))})}function v(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 y(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 b(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 g(e){var n=e.customType,t=e.sectionId,c=e.newField,u=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!==a.SlicesFieldType})),m=(0,i.Z)((0,o.Z)({},p),(0,r.Z)({},u,c));if(void 0!==d){var h=(0,s.Z)(d,2),v=h[0],y=h[1];m[v]=y}return I({customType:n,sectionId:t,updatedSection:m})}function j(e){var n=e.customType,t=e.sectionId,r=e.fieldId,o=(0,c.ud)(n.json[t],r);return I({customType:n,sectionId:t,updatedSection:o})}function Z(e){var n,t,r,o,i,c=e.customType,a=e.sectionId,u=e.previousFieldId,l=e.newFieldId,d=e.newField,f=(n={fields:c.json[a],previousFieldId:u,newFieldId:l,newField:d},t=n.fields,r=n.previousFieldId,o=n.newFieldId,i=n.newField,Object.entries(t).reduce(function(e,n){var t=(0,s.Z)(n,2),c=t[0],a=t[1];return c===r?e[o]=i:c!==o&&(e[c]=a),e},{}));return I({customType:c,sectionId:a,updatedSection:f})}function _(e){var n,t,r,o,i,c,u,l=e.customType,d=e.sectionId,p=e.sourceIndex,m=e.destinationIndex,h=l.json[d],v=f(l,d),y=(n={fields:Object.fromEntries(Object.entries(h).filter(function(e){var n=(0,s.Z)(e,2);return(n[0],n[1]).type!==a.SlicesFieldType})),sourceIndex:p,destinationIndex:m},t=n.fields,r=n.sourceIndex,o=n.destinationIndex,i=Object.entries(t),c=(0,s.Z)(i.splice(r,1),1)[0],i.splice(o,0,c),Object.fromEntries(i));if(void 0!==v){var x=(0,s.Z)(v,2),b=x[0],g=x[1];y[b]=g}return I({customType:l,sectionId:d,updatedSection:y})}function I(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 T(e){var n,t,r=e.id,i=e.label,s=e.repeatable,c=e.format,a=(n=s,t=c,!1===n&&"page"===t?(0,o.Z)({},C,k):!1===n?S:"page"===t?(0,o.Z)({},w,k):z);return{format:c,id:r,json:a,label:i,repeatable:s,status:!0}}var S={Main:{}},C={Main:{slices:{config:{choices:{}},fieldset:"Slice Zone",type:"Slices"}}},z={Main:{uid:{config:{label:"UID"},type:"UID"}}},w={Main:(0,o.Z)({},z.Main,C.Main)},k={"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"}}}},54845:function(e,n,t){"use strict";t.d(n,{_:function(){return N}});var r=t(22710),o=t(99267),i=t(52322),s=t(22715),c=t(5632),a=t(2784),u=t(65186),l=t(59326),d=t(75289),f=t(88932),p=t(81038),m=t(78656);function h(){return(h=(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=m.$[n.format],o.label=1;case 1:return o.trys.push([1,3,,4]),[4,p.j.customTypes.deleteCustomType({id:n.id})];case 2:if((i=o.sent().errors).length>0)throw i;return t(),f.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),f.Am.error(c),[3,4];case 4:return[2]}})})).apply(this,arguments)}var v=t(34226),y=t(98898),x=t(83399),b=t(90374),g=function(e){var n,t=e.customType,s=e.format,c=e.onClose,f=e.onDeleteCustomTypeSuccess,p=m.$[s],g=(0,a.useState)(!1),j=g[0],Z=g[1],_=(0,b.Z)().deleteCustomTypeSuccess,I=(n=(0,r.Z)(function(){return(0,o.__generator)(this,function(e){switch(e.label){case 0:return Z(!0),[4,function(e){return h.apply(this,arguments)}({customType:t,onSuccess:function(){return _(t.id)}})];case 1:return e.sent(),f(),[2]}})}),function(){return n.apply(this,arguments)}),T=(0,l.B7)().theme;return(0,i.jsx)(x.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:function(){return c()},children:(0,i.jsx)(y.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)(d.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)(d.kC,{sx:{alignItems:"center"},children:[(0,i.jsx)(u.$vK,{size:20,color:null===(e=T.colors)||void 0===e?void 0:e.greyIcon}),(0,i.jsxs)(d.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:["Delete"," ",p.name({start:!1,plural:!1})]})]}),(0,i.jsx)(d.x8,{type:"button",onClick:function(){return c()}})]})},Footer:function(){return(0,i.jsxs)(d.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)(v.z,{label:"Cancel",variant:"secondary",onClick:function(){return c()},sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),void 0!==t&&(0,i.jsx)(v.z,{label:"Delete",variant:"danger",isLoading:j,onClick:function(){I()},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)(d.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"," ",p.name({start:!1,plural:!1})," and any associated Documents from your repository."]})})]})})})},j=t(62230),Z=t(85244),_=t(56580);function I(){return(I=(0,r.Z)(function(e){var n,t,r,i,s,c,a,u;return(0,o.__generator)(this,function(o){switch(o.label){case 0:n=e.model,t=e.newLabel,r=e.onSuccess,i=m.$[n.format],o.label=1;case 1:return o.trys.push([1,3,,4]),s=(0,Z.Z)((0,j.Z)({},n),{label:t}),[4,p.j.customTypes.renameCustomType({model:s})];case 2:if((c=o.sent().errors).length>0)throw c;return r(s),f.Am.success("".concat(i.name({start:!0,plural:!1})," renamed")),[3,4];case 3:return a=o.sent(),u="Internal Error: ".concat(i.name({start:!0,plural:!1})," could not be renamed"),console.error(u,a),f.Am.error(u),[3,4];case 4:return[2]}})})).apply(this,arguments)}var T=t(50950),S=t(28849),C=t(6134),z=t(36960),w=function(e){var n,t,s,c=e.isChangesLocal,u=e.customType,l=e.format,f=e.onClose,p=e.setLocalCustomType,h=null!==(n=null==u?void 0:u.label)&&void 0!==n?n:"",v=null!==(t=null==u?void 0:u.id)&&void 0!==t?t:"",y=(0,b.Z)().renameCustomTypeSuccess,x=(0,T.g)().syncChanges,g=(0,a.useState)(!1),w=g[0],k=g[1],F=(s=(0,r.Z)(function(e){return(0,o.__generator)(this,function(n){switch(n.label){case 0:if(k(!0),!(c&&p))return[3,1];return p((0,Z.Z)((0,j.Z)({},u),{label:e.customTypeName})),[3,3];case 1:return[4,function(e){return I.apply(this,arguments)}({model:u,newLabel:e.customTypeName,onSuccess:function(e){y(e),x()}})];case 2:n.sent(),n.label=3;case 3:return k(!1),f(),[2]}})}),function(e){return s.apply(this,arguments)}),O=(0,_.v9)(function(e){return{customTypeLabels:(0,S.YS)(e)}}).customTypeLabels,L=m.$[l];return(0,i.jsx)(C.Z,{isOpen:!0,testId:"rename-custom-type-modal",widthInPx:"530px",formId:"rename-custom-type-modal-".concat(v),buttonLabel:"Rename",close:f,onSubmit:function(e){F(e)},initialValues:{customTypeName:h},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)&&h!==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)(d.xu,{children:(0,i.jsx)(z.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"})})}})},k=t(82770),F=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=m.$[e.format],o.label=1;case 1:return o.trys.push([1,3,,4]),r=(0,F.mf)(e),[4,(0,k.KA)(r)];case 2:if((i=o.sent().errors).length>0)throw i;return n(r),f.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),f.Am.error(c),[3,4];case 4:return[2]}})})).apply(this,arguments)}var L=t(67445),N=function(e){var n,t=e.format,u=e.customType,l=e.isChangesLocal,d=e.setLocalCustomType,f=(0,c.useRouter)(),p=(0,b.Z)().saveCustomTypeSuccess,m=(0,a.useState)(!1),h=m[0],v=m[1],y=(0,a.useState)(!1),x=y[0],j=y[1],Z=(0,a.useState)(!1),_=Z[0],I=Z[1],T=(n=(0,r.Z)(function(){var e,n;return(0,o.__generator)(this,function(t){switch(t.label){case 0:return I(!0),[4,function(e,n){return O.apply(this,arguments)}(u,p)];case 1:return t.sent(),e=L.cd.custom.getBuilderPagePathname(u.id),f.asPath===e&&(n=L.cd.page.getBuilderPagePathname(u.id),f.replace(n)),I(!1),[2]}})}),function(){return n.apply(this,arguments)}),S=function(){var e,n=L.cd[null!==(e=u.format)&&void 0!==e?e:"custom"].tablePagePathname;f.asPath!==n?f.replace(n):v(!1)};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(s.h_,{modal:!0,children:[(0,i.jsx)(s.$F,{disabled:_,children:(0,i.jsx)(s.hU,{color:"grey","data-testid":"editDropdown",hiddenLabel:"Custom type actions",icon:"moreVert",loading:_,variant:"solid"})}),(0,i.jsxs)(s.AW,{align:"end",children:[(0,i.jsx)(s.Xi,{startIcon:(0,i.jsx)(s.I5,{name:"edit"}),onSelect:function(){j(!0)},children:"Rename"}),"custom"===t&&!l&&(0,i.jsx)(s.Xi,{startIcon:(0,i.jsx)(s.I5,{name:"driveFileMove"}),onSelect:function(){T()},children:"Convert to page type"}),(0,i.jsx)(s.Xi,{color:"tomato",startIcon:(0,i.jsx)(s.I5,{name:"delete"}),onSelect:function(){v(!0)},children:"Remove"})]})]}),h?(0,i.jsx)(g,{format:t,customType:u,onClose:function(){return v(!1)},onDeleteCustomTypeSuccess:S}):null,x?(0,i.jsx)(w,{format:t,customType:u,isChangesLocal:l,onClose:function(){return j(!1)},setLocalCustomType:d}):null]})}},34226: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),a=t(75289),u=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,h=e.disabled,v=e.onClick,y=e.sx,x=e.iconSize,b=void 0===x?16:x,g=e.iconFill,j=e.variant,Z=void 0===j?"primary":j,_=(0,i.Z)(e,["label","Icon","type","form","isLoading","disabled","onClick","sx","iconSize","iconFill","variant"]);return(0,s.jsx)(a.zx,(0,o.Z)((0,r.Z)({ref:n,sx:(0,r.Z)((0,o.Z)((0,r.Z)({},void 0===y?{}:y),{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"}),m?{cursor:"wait !important"}:{}),type:d,form:f,disabled:void 0!==h&&h||m,onClick:m?void 0:v,variant:Z},_),{children:m?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a.$j,{size:b,color:l(Z),"data-testid":u(_["data-testid"],"spinner")}),c&&t]}):(0,s.jsxs)(s.Fragment,{children:[c&&(0,s.jsx)(c,{size:b,fill:g,"data-testid":u(_["data-testid"],"icon")}),t]})}))})},36960: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,a=e.error,u=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,u?{"data-testid":u}:null)),a?(0,o.jsx)(s.xv,{"data-testid":u?"".concat(u,"-error"):"input-error",sx:{color:"error",mt:1},children:a}):null]})}},6134:function(e,n,t){"use strict";var r=t(62230),o=t(85244),i=t(52322),s=t(63397),c=t(37149),a=t.n(c),u=t(75289),l=t(34226),d=t(83399),f=t(98898);n.Z=function(e){var n=e.children,t=e.close,c=e.isOpen,p=e.formId,m=e.validate,h=e.onSubmit,v=e.widthInPx,y=e.initialValues,x=e.content.title,b=e.cardProps,g=e.omitFooter,j=void 0!==g&&g,Z=e.isLoading,_=void 0!==Z&&Z,I=e.buttonLabel,T=void 0===I?"Save":I,S=e.testId,C=e.actionMessage;return a().setAppElement("#__next"),(0,i.jsx)(d.Z,{isOpen:c,shouldCloseOnOverlayClick:!0,onRequestClose:t,contentLabel:x,style:{content:{width:null!=v?v:"900px"}},children:(0,i.jsx)(s.J9,{initialValues:y,validate:function(e){return m?m(e):void 0},onSubmit:function(e){h(e)},children:function(e){var c=e.isValid,a=e.isSubmitting,d=e.values,m=e.errors,h=e.touched,v=e.setFieldValue,y=e.setValues;return(0,i.jsx)(s.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"}},b),{Header:function(e){var n=e.radius;return(0,i.jsxs)(u.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)(u.X6,{sx:{fontSize:"20px"},children:x}),(0,i.jsx)(u.x8,{type:"button",onClick:t})]})},Footer:j?null:(0,i.jsxs)(u.kC,{sx:{alignItems:"space-between"},children:[(0,i.jsx)(u.kC,{sx:{fontSize:"14px",alignItems:"center"},children:"function"==typeof C?C(e):C}),(0,i.jsxs)(u.kC,{sx:{ml:"auto"},children:[(0,i.jsx)(u.zx,{mr:2,type:"button",onClick:t,variant:"secondary",disabled:a||_,children:"Cancel"}),(0,i.jsx)(l.z,{label:T,form:p,type:"submit",disabled:!c||a||_,isLoading:a||_,sx:{fontWeight:"400",paddingBlock:"8px",paddingInline:"16px",fontSize:"14px",borderRadius:"4px"}})]})]}),children:n({isValid:c,isSubmitting:a,values:d,errors:m,touched:h,setFieldValue:v,setValues:y})}))}))}})})}},69143:function(){}}]);