@strapi/content-type-builder 5.0.0-rc.9 → 5.0.1

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 (42) hide show
  1. package/dist/_chunks/{ListView-BUKiiZrv.js → ListView-DNrG3LP8.js} +12 -11
  2. package/dist/_chunks/ListView-DNrG3LP8.js.map +1 -0
  3. package/dist/_chunks/{ListView-B33vu6Br.mjs → ListView-DzU2cU42.mjs} +12 -11
  4. package/dist/_chunks/ListView-DzU2cU42.mjs.map +1 -0
  5. package/dist/_chunks/{index-Hl6JWkwo.js → index-BOYSLPpG.js} +104 -179
  6. package/dist/_chunks/index-BOYSLPpG.js.map +1 -0
  7. package/dist/_chunks/{index-CCJpNwsW.mjs → index-BgNIUYf6.mjs} +108 -183
  8. package/dist/_chunks/index-BgNIUYf6.mjs.map +1 -0
  9. package/dist/_chunks/{index-nJaZni0J.js → index-Bp9_1YUM.js} +146 -5
  10. package/dist/_chunks/index-Bp9_1YUM.js.map +1 -0
  11. package/dist/_chunks/{index-BxeoMEGY.mjs → index-N6VHEZs0.mjs} +156 -16
  12. package/dist/_chunks/index-N6VHEZs0.mjs.map +1 -0
  13. package/dist/admin/index.js +5 -2
  14. package/dist/admin/index.js.map +1 -1
  15. package/dist/admin/index.mjs +4 -2
  16. package/dist/admin/src/components/FormModal/attributes/form.d.ts +1 -1
  17. package/dist/admin/src/components/FormModal/utils/relations.d.ts +2 -2
  18. package/dist/admin/src/components/FormModalNavigationProvider/constants.d.ts +1 -0
  19. package/dist/admin/src/components/SelectCategory.d.ts +2 -1
  20. package/dist/admin/src/contexts/FormModalNavigationContext.d.ts +2 -0
  21. package/dist/admin/src/exports.d.ts +15 -0
  22. package/dist/admin/src/index.d.ts +1 -0
  23. package/dist/admin/src/utils/parseDateValue.d.ts +1 -0
  24. package/dist/admin/src/utils/timeFormat.d.ts +16 -0
  25. package/dist/server/index.js +91 -54
  26. package/dist/server/index.js.map +1 -1
  27. package/dist/server/index.mjs +92 -55
  28. package/dist/server/index.mjs.map +1 -1
  29. package/dist/server/src/controllers/validation/model-schema.d.ts.map +1 -1
  30. package/dist/server/src/services/builder.d.ts +4 -0
  31. package/dist/server/src/services/builder.d.ts.map +1 -1
  32. package/dist/server/src/services/constants.d.ts +0 -1
  33. package/dist/server/src/services/constants.d.ts.map +1 -1
  34. package/dist/server/src/services/schema-builder/content-type-builder.d.ts.map +1 -1
  35. package/package.json +9 -8
  36. package/dist/_chunks/ListView-B33vu6Br.mjs.map +0 -1
  37. package/dist/_chunks/ListView-BUKiiZrv.js.map +0 -1
  38. package/dist/_chunks/index-BxeoMEGY.mjs.map +0 -1
  39. package/dist/_chunks/index-CCJpNwsW.mjs.map +0 -1
  40. package/dist/_chunks/index-Hl6JWkwo.js.map +0 -1
  41. package/dist/_chunks/index-nJaZni0J.js.map +0 -1
  42. package/strapi-server.js +0 -3
@@ -3,14 +3,13 @@ import * as React from "react";
3
3
  import { createContext, useContext, useState, Fragment, useRef, useEffect, memo, useMemo, lazy, Suspense } from "react";
4
4
  import { useNotification, useTracking, useStrapiApp, ConfirmDialog, translatedErrors, useGuidedTour, useAppInfo, useAuth, useFetchClient, Page, Layouts } from "@strapi/admin/strapi-admin";
5
5
  import { useIntl } from "react-intl";
6
- import { NavLink, Link as Link$1, useNavigate, useLocation, useMatch, Navigate, Routes, Route } from "react-router-dom";
7
- import { Flex, Box, Typography, Link, useFilter, useCollator, SubNavLink, SubNav, SubNavHeader, SubNavSections, SubNavSection, SubNavLinkSection, TextButton, Field, MultiSelectNested, KeyboardNavigable, Grid, LinkButton, Modal, Tabs, Divider, SingleSelect, SingleSelectOption, inputFocusStyle, Checkbox, TextInput, NumberInput, Dialog, Button, Breadcrumbs, Crumb, Searchbar, IconButton, Tooltip, VisuallyHidden, TimePicker, Textarea, DatePicker, DateTimePicker, Toggle, JSONInput, Menu, Combobox, ComboboxOption } from "@strapi/design-system";
6
+ import { NavLink, Link, useNavigate, useLocation, useMatch, Navigate, Routes, Route } from "react-router-dom";
7
+ import { p as pluginId, n as nameToSlug, O as ON_CHANGE_RELATION_TARGET, a as ON_CHANGE_RELATION_TYPE, g as getRelationType, M as MAX_COMPONENT_DEPTH, c as createComponentUid, b as createUid, i as initialState, S as SET_DATA_TO_EDIT, d as SET_DYNAMIC_ZONE_DATA_SCHEMA, e as SET_CUSTOM_FIELD_DATA_SCHEMA, f as SET_ATTRIBUTE_DATA_SCHEMA, R as RESET_PROPS, h as SET_ERRORS, j as ON_CHANGE, k as RESET_PROPS_AND_SET_THE_FORM_FOR_ADDING_A_COMPO_TO_A_DZ, l as RESET_PROPS_AND_SET_FORM_FOR_ADDING_AN_EXISTING_COMPO, m as RESET_PROPS_AND_SAVE_CURRENT_DATA, o as initialState$1, q as makeUnique, u as useAutoReloadOverlayBlocker, G as GET_DATA_SUCCEEDED, r as RELOAD_PLUGIN, s as retrieveComponentsFromSchema, t as SET_MODIFIED_DATA, A as ADD_CUSTOM_FIELD_ATTRIBUTE, E as EDIT_CUSTOM_FIELD_ATTRIBUTE, v as ADD_CREATED_COMPONENT_TO_DYNAMIC_ZONE, C as CHANGE_DYNAMIC_ZONE_COMPONENTS, D as DELETE_NOT_SAVED_TYPE, w as REMOVE_COMPONENT_FROM_DYNAMIC_ZONE, U as UPDATE_INITIAL_STATE, x as UPDATE_SCHEMA, y as EDIT_ATTRIBUTE, z as ADD_ATTRIBUTE, B as CREATE_SCHEMA, F as CREATE_COMPONENT_SCHEMA, H as REMOVE_FIELD_FROM_DISPLAYED_COMPONENT, I as REMOVE_FIELD, P as PERMISSIONS, J as AutoReloadOverlayBlockerProvider } from "./index-N6VHEZs0.mjs";
8
+ import { useFilter, useCollator, SubNavLink, SubNav, SubNavHeader, SubNavSections, SubNavSection, SubNavLinkSection, Box, TextButton, Field, MultiSelectNested, Flex, Typography, KeyboardNavigable, Grid, LinkButton, Link as Link$1, Modal, Tabs, Divider, SingleSelect, SingleSelectOption, inputFocusStyle, Checkbox, TextInput, NumberInput, Dialog, Button, Breadcrumbs, Crumb, Searchbar, IconButton, Tooltip, VisuallyHidden, TimePicker, Textarea, DatePicker, DateTimePicker, Toggle, JSONInput, Menu, Combobox, ComboboxOption } from "@strapi/design-system";
8
9
  import * as Icons from "@strapi/icons";
9
- import { ArrowClockwise, Clock, Plus, Sparkle, ArrowLeft, Search, Trash, Eye, EyeStriked, OneWay, OneToOne, OneToMany, ManyToOne, ManyToMany, ManyWays } from "@strapi/icons";
10
- import { createPortal } from "react-dom";
11
- import { keyframes, styled } from "styled-components";
10
+ import { Plus, Sparkle, ArrowLeft, Search, Trash, Eye, EyeStriked, OneWay, OneToOne, OneToMany, ManyToOne, ManyToMany, ManyWays } from "@strapi/icons";
12
11
  import upperFirst from "lodash/upperFirst";
13
- import { p as pluginId, n as nameToSlug, O as ON_CHANGE_RELATION_TARGET, a as ON_CHANGE_RELATION_TYPE, g as getRelationType, M as MAX_COMPONENT_DEPTH, c as createComponentUid, b as createUid, i as initialState, S as SET_DATA_TO_EDIT, d as SET_DYNAMIC_ZONE_DATA_SCHEMA, e as SET_CUSTOM_FIELD_DATA_SCHEMA, f as SET_ATTRIBUTE_DATA_SCHEMA, R as RESET_PROPS, h as SET_ERRORS, j as ON_CHANGE, k as RESET_PROPS_AND_SET_THE_FORM_FOR_ADDING_A_COMPO_TO_A_DZ, l as RESET_PROPS_AND_SET_FORM_FOR_ADDING_AN_EXISTING_COMPO, m as RESET_PROPS_AND_SAVE_CURRENT_DATA, o as initialState$1, q as makeUnique, G as GET_DATA_SUCCEEDED, r as RELOAD_PLUGIN, s as retrieveComponentsFromSchema, t as SET_MODIFIED_DATA, A as ADD_CUSTOM_FIELD_ATTRIBUTE, E as EDIT_CUSTOM_FIELD_ATTRIBUTE, u as ADD_CREATED_COMPONENT_TO_DYNAMIC_ZONE, C as CHANGE_DYNAMIC_ZONE_COMPONENTS, D as DELETE_NOT_SAVED_TYPE, v as REMOVE_COMPONENT_FROM_DYNAMIC_ZONE, U as UPDATE_INITIAL_STATE, w as UPDATE_SCHEMA, x as EDIT_ATTRIBUTE, y as ADD_ATTRIBUTE, z as CREATE_SCHEMA, B as CREATE_COMPONENT_SCHEMA, F as REMOVE_FIELD_FROM_DISPLAYED_COMPONENT, H as REMOVE_FIELD, P as PERMISSIONS } from "./index-BxeoMEGY.mjs";
12
+ import { styled } from "styled-components";
14
13
  import isEqual from "lodash/isEqual";
15
14
  import get from "lodash/get";
16
15
  import groupBy from "lodash/groupBy";
@@ -34,137 +33,6 @@ import { createSelector } from "@reduxjs/toolkit";
34
33
  import camelCase from "lodash/camelCase";
35
34
  import omit from "lodash/omit";
36
35
  import sortBy from "lodash/sortBy";
37
- const AutoReloadOverlayBlockerContext = React.createContext(
38
- {}
39
- );
40
- const MAX_ELAPSED_TIME = 30 * 1e3;
41
- const AutoReloadOverlayBlockerProvider = ({ children }) => {
42
- const [isOpen, setIsOpen] = React.useState(false);
43
- const [config, setConfig] = React.useState({});
44
- const [failed, setFailed] = React.useState(false);
45
- const lockAppWithAutoreload = React.useCallback((config2 = {}) => {
46
- setIsOpen(true);
47
- setConfig(config2);
48
- }, []);
49
- const unlockAppWithAutoreload = React.useCallback(() => {
50
- setIsOpen(false);
51
- setConfig({});
52
- }, []);
53
- React.useEffect(() => {
54
- if (isOpen) {
55
- const timeout = setTimeout(() => {
56
- setFailed(true);
57
- }, MAX_ELAPSED_TIME);
58
- return () => {
59
- clearTimeout(timeout);
60
- };
61
- }
62
- }, [isOpen]);
63
- let displayedIcon = config?.icon || "reload";
64
- let description = {
65
- id: config?.description || "components.OverlayBlocker.description",
66
- defaultMessage: "You're using a feature that needs the server to restart. The page will reload automatically."
67
- };
68
- let title = {
69
- id: config?.title || "components.OverlayBlocker.title",
70
- defaultMessage: "Waiting for restart"
71
- };
72
- if (failed) {
73
- displayedIcon = "time";
74
- description = {
75
- id: "components.OverlayBlocker.description.serverError",
76
- defaultMessage: "The server should have restarted, please check your logs in the terminal."
77
- };
78
- title = {
79
- id: "components.OverlayBlocker.title.serverError",
80
- defaultMessage: "The restart is taking longer than expected"
81
- };
82
- }
83
- const autoReloadValue = React.useMemo(
84
- () => ({
85
- lockAppWithAutoreload,
86
- unlockAppWithAutoreload
87
- }),
88
- [lockAppWithAutoreload, unlockAppWithAutoreload]
89
- );
90
- return /* @__PURE__ */ jsxs(AutoReloadOverlayBlockerContext.Provider, { value: autoReloadValue, children: [
91
- /* @__PURE__ */ jsx(
92
- Blocker,
93
- {
94
- displayedIcon,
95
- isOpen,
96
- description,
97
- title
98
- }
99
- ),
100
- children
101
- ] });
102
- };
103
- const Blocker = ({ displayedIcon, description, title, isOpen }) => {
104
- const { formatMessage } = useIntl();
105
- return isOpen && globalThis?.document?.body ? createPortal(
106
- /* @__PURE__ */ jsxs(Overlay, { id: "autoReloadOverlayBlocker", direction: "column", alignItems: "center", gap: 6, children: [
107
- /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "center", gap: 2, children: [
108
- /* @__PURE__ */ jsx(Typography, { tag: "h1", variant: "alpha", children: formatMessage(title) }),
109
- /* @__PURE__ */ jsx(Typography, { tag: "h2", textColor: "neutral600", fontSize: 4, fontWeight: "regular", children: formatMessage(description) })
110
- ] }),
111
- displayedIcon === "reload" && /* @__PURE__ */ jsx(IconBox$1, { padding: 6, background: "primary100", borderColor: "primary200", children: /* @__PURE__ */ jsx(LoaderReload, { width: "3.6rem", height: "3.6rem" }) }),
112
- displayedIcon === "time" && /* @__PURE__ */ jsx(IconBox$1, { padding: 6, background: "primary100", borderColor: "primary200", children: /* @__PURE__ */ jsx(Clock, { width: "4rem", height: "4rem" }) }),
113
- /* @__PURE__ */ jsx(Box, { marginTop: 2, children: /* @__PURE__ */ jsx(Link, { href: "https://docs.strapi.io", isExternal: true, children: formatMessage({
114
- id: "global.documentation",
115
- defaultMessage: "Read the documentation"
116
- }) }) })
117
- ] }),
118
- // eslint-disable-next-line no-undef
119
- globalThis.document.body
120
- ) : null;
121
- };
122
- const rotation = keyframes`
123
- from {
124
- transform: rotate(0deg);
125
- }
126
- to {
127
- transform: rotate(359deg);
128
- }
129
- `;
130
- const LoaderReload = styled(ArrowClockwise)`
131
- animation: ${rotation} 1s infinite linear;
132
- `;
133
- const Overlay = styled(Flex)`
134
- position: fixed;
135
- top: 0;
136
- right: 0;
137
- bottom: 0;
138
- left: 0;
139
- /* TODO: set this up in the theme for consistence z-index values */
140
- z-index: 1140;
141
- padding-top: 16rem;
142
-
143
- & > * {
144
- position: relative;
145
- z-index: 1;
146
- }
147
-
148
- &:before {
149
- content: '';
150
- position: fixed;
151
- top: 0;
152
- right: 0;
153
- bottom: 0;
154
- left: 0;
155
- background: ${({ theme }) => theme.colors.neutral0};
156
- opacity: 0.9;
157
- }
158
- `;
159
- const IconBox$1 = styled(Box)`
160
- border-radius: 50%;
161
- svg {
162
- > path {
163
- fill: ${({ theme }) => theme.colors.primary600} !important;
164
- }
165
- }
166
- `;
167
- const useAutoReloadOverlayBlocker = () => React.useContext(AutoReloadOverlayBlockerContext);
168
36
  const getTrad = (id) => `${pluginId}.${id}`;
169
37
  const DataManagerContext = createContext();
170
38
  const useDataManager = () => useContext(DataManagerContext);
@@ -643,7 +511,7 @@ const EmptyAttributes = () => {
643
511
  /* @__PURE__ */ jsx(
644
512
  LinkButton,
645
513
  {
646
- tag: Link$1,
514
+ tag: Link,
647
515
  to: `/marketplace?${qs.stringify({ categories: ["Custom fields"] })}`,
648
516
  variant: "secondary",
649
517
  startIcon: /* @__PURE__ */ jsx(Plus, {}),
@@ -669,7 +537,7 @@ const CustomFieldsList = () => {
669
537
  return /* @__PURE__ */ jsx(KeyboardNavigable, { tagName: "button", children: /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "stretch", gap: 3, children: [
670
538
  /* @__PURE__ */ jsx(Grid.Root, { gap: 3, children: sortedCustomFields.map(([uid, customField]) => /* @__PURE__ */ jsx(Grid.Item, { col: 6, direction: "column", alignItems: "stretch", children: /* @__PURE__ */ jsx(CustomFieldOption, { customFieldUid: uid, customField }, uid) }, uid)) }),
671
539
  /* @__PURE__ */ jsx(
672
- Link,
540
+ Link$1,
673
541
  {
674
542
  href: "https://docs.strapi.io/developer-docs/latest/development/custom-fields.html",
675
543
  isExternal: true,
@@ -739,6 +607,9 @@ const Wrapper$1 = styled(Flex)`
739
607
  cursor: pointer;
740
608
  user-select: none;
741
609
  flex: 1;
610
+ border-radius: 4px;
611
+ border: 1px solid ${({ theme }) => theme.colors.neutral200};
612
+
742
613
  ${inputFocusStyle()}
743
614
  }
744
615
 
@@ -750,7 +621,6 @@ const Wrapper$1 = styled(Flex)`
750
621
  .option {
751
622
  height: 100%;
752
623
  border-radius: 4px;
753
- border: 1px solid ${({ theme }) => theme.colors.neutral200};
754
624
  will-change: transform, opacity;
755
625
  background: ${({ theme }) => theme.colors.neutral0};
756
626
 
@@ -787,7 +657,6 @@ const Wrapper$1 = styled(Flex)`
787
657
  .container input:checked ~ div {
788
658
  background: ${({ theme }) => theme.colors.primary100};
789
659
  color: ${({ theme }) => theme.colors.primary600};
790
- border: 1px solid ${({ theme }) => theme.colors.primary200};
791
660
  .checkmark {
792
661
  border: solid 1px ${({ theme }) => theme.colors.primary600};
793
662
  &::after {
@@ -1412,7 +1281,7 @@ const FormModalHeader = ({
1412
1281
  return /* @__PURE__ */ jsx(Modal.Header, { children: /* @__PURE__ */ jsxs(Flex, { gap: 3, children: [
1413
1282
  showBackLink && // This is a workaround and should use the LinkButton with a variant that currently doesn't exist
1414
1283
  /* @__PURE__ */ jsx(
1415
- Link,
1284
+ Link$1,
1416
1285
  {
1417
1286
  "aria-label": formatMessage({
1418
1287
  id: getTrad("modalForm.header.back"),
@@ -1831,6 +1700,49 @@ const PluralName = ({
1831
1700
  /* @__PURE__ */ jsx(Field.Error, {})
1832
1701
  ] });
1833
1702
  };
1703
+ const parseDateValue = (value) => {
1704
+ if (value instanceof Date && isValidDate(value)) {
1705
+ return value;
1706
+ }
1707
+ if (typeof value === "string" || typeof value === "number") {
1708
+ const date = new Date(value);
1709
+ if (isValidDate(date)) {
1710
+ return date;
1711
+ }
1712
+ }
1713
+ };
1714
+ const isValidDate = (date) => !isNaN(date.getTime());
1715
+ const removeSeconds = (time) => {
1716
+ const [hours, minutes] = time.split(":");
1717
+ return `${hours}:${minutes}`;
1718
+ };
1719
+ const addSecondsAndMilliseconds = (time) => {
1720
+ return time.split(":").length === 2 ? `${time}:00.000` : time;
1721
+ };
1722
+ const formatTimeForInput = (value) => {
1723
+ if (!value)
1724
+ return;
1725
+ return value.split(":").length > 2 ? removeSeconds(value) : value;
1726
+ };
1727
+ const formatTimeForOutput = (value) => {
1728
+ if (!value)
1729
+ return void 0;
1730
+ return addSecondsAndMilliseconds(value);
1731
+ };
1732
+ const handleTimeChange = ({ value }) => {
1733
+ const formattedInputTime = formatTimeForInput(value);
1734
+ return formattedInputTime;
1735
+ };
1736
+ const handleTimeChangeEvent = (onChange, name, type, time) => {
1737
+ const formattedOutputTime = formatTimeForOutput(time);
1738
+ onChange({
1739
+ target: {
1740
+ name,
1741
+ value: formattedOutputTime,
1742
+ type
1743
+ }
1744
+ });
1745
+ };
1834
1746
  const GenericInput = ({
1835
1747
  autoComplete,
1836
1748
  customInputs,
@@ -1982,6 +1894,7 @@ const GenericInput = ({
1982
1894
  );
1983
1895
  }
1984
1896
  case "datetime": {
1897
+ const dateValue = parseDateValue(value);
1985
1898
  return /* @__PURE__ */ jsx(
1986
1899
  DateTimePicker,
1987
1900
  {
@@ -1993,11 +1906,12 @@ const GenericInput = ({
1993
1906
  },
1994
1907
  onClear: () => onChange({ target: { name, value: null, type } }),
1995
1908
  placeholder: formattedPlaceholder,
1996
- value
1909
+ value: dateValue
1997
1910
  }
1998
1911
  );
1999
1912
  }
2000
1913
  case "date": {
1914
+ const dateValue = parseDateValue(value);
2001
1915
  return /* @__PURE__ */ jsx(
2002
1916
  DatePicker,
2003
1917
  {
@@ -2014,7 +1928,7 @@ const GenericInput = ({
2014
1928
  },
2015
1929
  onClear: () => onChange({ target: { name, value: null, type } }),
2016
1930
  placeholder: formattedPlaceholder,
2017
- value
1931
+ value: dateValue
2018
1932
  }
2019
1933
  );
2020
1934
  }
@@ -2126,23 +2040,15 @@ const GenericInput = ({
2126
2040
  );
2127
2041
  }
2128
2042
  case "time": {
2129
- let time = value;
2130
- if (typeof value === "string" && value.split(":").length > 2) {
2131
- const [hour, minute] = value.split(":");
2132
- time = `${hour}:${minute}`;
2133
- }
2043
+ const formattedValue = handleTimeChange({ value, onChange, name, type });
2134
2044
  return /* @__PURE__ */ jsx(
2135
2045
  TimePicker,
2136
2046
  {
2137
2047
  clearLabel: formatMessage({ id: "clearLabel", defaultMessage: "Clear" }),
2138
2048
  disabled,
2139
- onChange: (time2) => {
2140
- onChange({ target: { name, value: `${time2}`, type } });
2141
- },
2142
- onClear: () => {
2143
- onChange({ target: { name, value: null, type } });
2144
- },
2145
- value: time
2049
+ onChange: (time) => handleTimeChangeEvent(onChange, name, type, time),
2050
+ onClear: () => handleTimeChangeEvent(onChange, name, type, void 0),
2051
+ value: formattedValue
2146
2052
  }
2147
2053
  );
2148
2054
  }
@@ -2288,10 +2194,6 @@ const MenuTrigger = styled(Menu.Trigger)`
2288
2194
  overflow: hidden;
2289
2195
  text-overflow: ellipsis;
2290
2196
  }
2291
- svg {
2292
- width: 0.6rem;
2293
- height: 0.4rem;
2294
- }
2295
2197
  `;
2296
2198
  const RelationFormBox = ({
2297
2199
  disabled = false,
@@ -2493,7 +2395,8 @@ const SelectCategory = ({
2493
2395
  name,
2494
2396
  onChange,
2495
2397
  value = void 0,
2496
- isCreating
2398
+ isCreating,
2399
+ dynamicZoneTarget
2497
2400
  }) => {
2498
2401
  const { formatMessage } = useIntl();
2499
2402
  const { allComponentsCategories } = useDataManager();
@@ -2512,7 +2415,7 @@ const SelectCategory = ({
2512
2415
  /* @__PURE__ */ jsx(
2513
2416
  Combobox,
2514
2417
  {
2515
- disabled: !isCreating,
2418
+ disabled: !isCreating && !dynamicZoneTarget,
2516
2419
  onChange: handleChange,
2517
2420
  onCreateOption: handleCreateOption,
2518
2421
  value,
@@ -5061,9 +4964,10 @@ const FormModal = () => {
5061
4964
  kind,
5062
4965
  step,
5063
4966
  targetUid,
5064
- showBackLink
4967
+ showBackLink,
4968
+ activeTab,
4969
+ setActiveTab
5065
4970
  } = useFormModalNavigation();
5066
- const [activeTab, setActiveTab] = React.useState("basic");
5067
4971
  const getPlugin = useStrapiApp("FormModal", (state) => state.getPlugin);
5068
4972
  const getCustomField = useStrapiApp("FormModal", (state) => state.customFields.get);
5069
4973
  const customField = getCustomField(customFieldUid);
@@ -6124,7 +6028,7 @@ const DataManagerProvider = ({ children }) => {
6124
6028
  } = useSelector(makeSelectDataManagerProvider());
6125
6029
  const { toggleNotification } = useNotification();
6126
6030
  const { lockAppWithAutoreload, unlockAppWithAutoreload } = useAutoReloadOverlayBlocker();
6127
- const setCurrentStep = useGuidedTour("DataManagerProvider", (state) => state.setCurrentStep);
6031
+ const { setCurrentStep, setStepState } = useGuidedTour("DataManagerProvider", (state) => state);
6128
6032
  const getPlugin = useStrapiApp("DataManagerProvider", (state) => state.getPlugin);
6129
6033
  const plugin = getPlugin(pluginId);
6130
6034
  const autoReload = useAppInfo("DataManagerProvider", (state) => state.autoReload);
@@ -6453,10 +6357,10 @@ const DataManagerProvider = ({ children }) => {
6453
6357
  } else {
6454
6358
  await put(requestURL, body);
6455
6359
  }
6456
- await serverRestartWatcher(true);
6457
- unlockAppWithAutoreload?.();
6458
6360
  if (isCreating && (initialData.contentType?.schema.kind === "collectionType" || initialData.contentType?.schema.kind === "singleType")) {
6459
- setCurrentStep("contentTypeBuilder.success");
6361
+ setStepState("contentTypeBuilder.success", true);
6362
+ trackUsage("didCreateGuidedTourCollectionType");
6363
+ setCurrentStep(null);
6460
6364
  }
6461
6365
  if (isInContentTypeView) {
6462
6366
  trackUsage("didSaveContentType");
@@ -6468,6 +6372,8 @@ const DataManagerProvider = ({ children }) => {
6468
6372
  } else {
6469
6373
  trackUsage("didSaveComponent");
6470
6374
  }
6375
+ await serverRestartWatcher(true);
6376
+ unlockAppWithAutoreload?.();
6471
6377
  await getDataRef.current();
6472
6378
  dispatch({ type: UPDATE_INITIAL_STATE });
6473
6379
  await updatePermissions();
@@ -6547,7 +6453,8 @@ const INITIAL_STATE_DATA = {
6547
6453
  kind: null,
6548
6454
  step: null,
6549
6455
  targetUid: null,
6550
- customFieldUid: null
6456
+ customFieldUid: null,
6457
+ activeTab: "basic"
6551
6458
  };
6552
6459
  const FormModalNavigationProvider = ({ children }) => {
6553
6460
  const [state, setFormModalNavigationState] = React.useState(INITIAL_STATE_DATA);
@@ -6559,7 +6466,8 @@ const FormModalNavigationProvider = ({ children }) => {
6559
6466
  actionType: "create",
6560
6467
  modalType: "customField",
6561
6468
  attributeType,
6562
- customFieldUid
6469
+ customFieldUid,
6470
+ activeTab: "basic"
6563
6471
  };
6564
6472
  });
6565
6473
  };
@@ -6574,7 +6482,8 @@ const FormModalNavigationProvider = ({ children }) => {
6574
6482
  modalType: "attribute",
6575
6483
  step,
6576
6484
  attributeType,
6577
- showBackLink: true
6485
+ showBackLink: true,
6486
+ activeTab: "basic"
6578
6487
  };
6579
6488
  });
6580
6489
  };
@@ -6601,13 +6510,14 @@ const FormModalNavigationProvider = ({ children }) => {
6601
6510
  targetUid,
6602
6511
  modalType: "chooseAttribute",
6603
6512
  isOpen: true,
6604
- showBackLink: false
6513
+ showBackLink: false,
6514
+ activeTab: "basic"
6605
6515
  };
6606
6516
  });
6607
6517
  };
6608
6518
  const onOpenModalCreateSchema = (nextState) => {
6609
6519
  setFormModalNavigationState((prevState) => {
6610
- return { ...prevState, ...nextState, isOpen: true };
6520
+ return { ...prevState, ...nextState, isOpen: true, activeTab: "basic" };
6611
6521
  });
6612
6522
  };
6613
6523
  const onOpenModalEditCategory = (categoryName) => {
@@ -6617,7 +6527,8 @@ const FormModalNavigationProvider = ({ children }) => {
6617
6527
  categoryName,
6618
6528
  actionType: "edit",
6619
6529
  modalType: "editCategory",
6620
- isOpen: true
6530
+ isOpen: true,
6531
+ activeTab: "basic"
6621
6532
  };
6622
6533
  });
6623
6534
  };
@@ -6638,7 +6549,8 @@ const FormModalNavigationProvider = ({ children }) => {
6638
6549
  targetUid,
6639
6550
  attributeName,
6640
6551
  attributeType,
6641
- isOpen: true
6552
+ isOpen: true,
6553
+ activeTab: "basic"
6642
6554
  };
6643
6555
  });
6644
6556
  };
@@ -6672,7 +6584,8 @@ const FormModalNavigationProvider = ({ children }) => {
6672
6584
  forTarget,
6673
6585
  targetUid,
6674
6586
  kind,
6675
- isOpen: true
6587
+ isOpen: true,
6588
+ activeTab: "basic"
6676
6589
  };
6677
6590
  });
6678
6591
  };
@@ -6685,7 +6598,8 @@ const FormModalNavigationProvider = ({ children }) => {
6685
6598
  ...prev,
6686
6599
  forTarget,
6687
6600
  targetUid,
6688
- modalType: "chooseAttribute"
6601
+ modalType: "chooseAttribute",
6602
+ activeTab: "basic"
6689
6603
  };
6690
6604
  });
6691
6605
  };
@@ -6695,7 +6609,8 @@ const FormModalNavigationProvider = ({ children }) => {
6695
6609
  ...prev,
6696
6610
  attributeType: "component",
6697
6611
  modalType: "attribute",
6698
- step: "2"
6612
+ step: "2",
6613
+ activeTab: "basic"
6699
6614
  };
6700
6615
  });
6701
6616
  };
@@ -6708,7 +6623,16 @@ const FormModalNavigationProvider = ({ children }) => {
6708
6623
  actionType: "create",
6709
6624
  step: "1",
6710
6625
  attributeType: null,
6711
- attributeName: null
6626
+ attributeName: null,
6627
+ activeTab: "basic"
6628
+ };
6629
+ });
6630
+ };
6631
+ const setActiveTab = (value) => {
6632
+ setFormModalNavigationState((prev) => {
6633
+ return {
6634
+ ...prev,
6635
+ activeTab: value
6712
6636
  };
6713
6637
  });
6714
6638
  };
@@ -6730,17 +6654,18 @@ const FormModalNavigationProvider = ({ children }) => {
6730
6654
  onOpenModalEditField,
6731
6655
  onOpenModalEditCustomField,
6732
6656
  onOpenModalEditSchema,
6733
- setFormModalNavigationState
6657
+ setFormModalNavigationState,
6658
+ setActiveTab
6734
6659
  },
6735
6660
  children
6736
6661
  }
6737
6662
  );
6738
6663
  };
6739
- const ListView$1 = lazy(() => import("./ListView-B33vu6Br.mjs"));
6664
+ const ListView$1 = lazy(() => import("./ListView-DzU2cU42.mjs"));
6740
6665
  const RecursivePath = () => {
6741
6666
  return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Page.Loading, {}), children: /* @__PURE__ */ jsx(Routes, { children: /* @__PURE__ */ jsx(Route, { path: `/:componentUid`, element: /* @__PURE__ */ jsx(ListView$1, {}) }) }) });
6742
6667
  };
6743
- const ListView = lazy(() => import("./ListView-B33vu6Br.mjs"));
6668
+ const ListView = lazy(() => import("./ListView-DzU2cU42.mjs"));
6744
6669
  const App = () => {
6745
6670
  const { formatMessage } = useIntl();
6746
6671
  const title = formatMessage({
@@ -6774,4 +6699,4 @@ export {
6774
6699
  index as i,
6775
6700
  useDataManager as u
6776
6701
  };
6777
- //# sourceMappingURL=index-CCJpNwsW.mjs.map
6702
+ //# sourceMappingURL=index-BgNIUYf6.mjs.map