@strapi/content-type-builder 5.0.0-rc.9 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{ListView-BUKiiZrv.js → ListView-CxvINB8V.js} +12 -11
- package/dist/_chunks/ListView-CxvINB8V.js.map +1 -0
- package/dist/_chunks/{ListView-B33vu6Br.mjs → ListView-D1VH47yt.mjs} +12 -11
- package/dist/_chunks/ListView-D1VH47yt.mjs.map +1 -0
- package/dist/_chunks/{index-Hl6JWkwo.js → index-BVbHj3Bu.js} +101 -177
- package/dist/_chunks/index-BVbHj3Bu.js.map +1 -0
- package/dist/_chunks/{index-BxeoMEGY.mjs → index-Bd7-GZsY.mjs} +156 -16
- package/dist/_chunks/index-Bd7-GZsY.mjs.map +1 -0
- package/dist/_chunks/{index-nJaZni0J.js → index-Be2fSfxp.js} +146 -5
- package/dist/_chunks/index-Be2fSfxp.js.map +1 -0
- package/dist/_chunks/{index-CCJpNwsW.mjs → index-S6EtktTB.mjs} +105 -181
- package/dist/_chunks/index-S6EtktTB.mjs.map +1 -0
- package/dist/admin/index.js +5 -2
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/index.mjs +4 -2
- package/dist/admin/src/components/FormModal/attributes/form.d.ts +1 -1
- package/dist/admin/src/components/FormModal/utils/relations.d.ts +2 -2
- package/dist/admin/src/components/FormModalNavigationProvider/constants.d.ts +1 -0
- package/dist/admin/src/contexts/FormModalNavigationContext.d.ts +2 -0
- package/dist/admin/src/exports.d.ts +15 -0
- package/dist/admin/src/index.d.ts +1 -0
- package/dist/admin/src/utils/parseDateValue.d.ts +1 -0
- package/dist/admin/src/utils/timeFormat.d.ts +16 -0
- package/dist/server/index.js +91 -54
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +92 -55
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/src/controllers/validation/model-schema.d.ts.map +1 -1
- package/dist/server/src/services/builder.d.ts +4 -0
- package/dist/server/src/services/builder.d.ts.map +1 -1
- package/dist/server/src/services/constants.d.ts +0 -1
- package/dist/server/src/services/constants.d.ts.map +1 -1
- package/dist/server/src/services/schema-builder/content-type-builder.d.ts.map +1 -1
- package/package.json +9 -8
- package/dist/_chunks/ListView-B33vu6Br.mjs.map +0 -1
- package/dist/_chunks/ListView-BUKiiZrv.js.map +0 -1
- package/dist/_chunks/index-BxeoMEGY.mjs.map +0 -1
- package/dist/_chunks/index-CCJpNwsW.mjs.map +0 -1
- package/dist/_chunks/index-Hl6JWkwo.js.map +0 -1
- package/dist/_chunks/index-nJaZni0J.js.map +0 -1
- package/strapi-server.js +0 -3
|
@@ -4,12 +4,11 @@ const React = require("react");
|
|
|
4
4
|
const strapiAdmin = require("@strapi/admin/strapi-admin");
|
|
5
5
|
const reactIntl = require("react-intl");
|
|
6
6
|
const reactRouterDom = require("react-router-dom");
|
|
7
|
+
const index$1 = require("./index-Be2fSfxp.js");
|
|
7
8
|
const designSystem = require("@strapi/design-system");
|
|
8
9
|
const Icons = require("@strapi/icons");
|
|
9
|
-
const reactDom = require("react-dom");
|
|
10
|
-
const styledComponents = require("styled-components");
|
|
11
10
|
const upperFirst = require("lodash/upperFirst");
|
|
12
|
-
const
|
|
11
|
+
const styledComponents = require("styled-components");
|
|
13
12
|
const isEqual = require("lodash/isEqual");
|
|
14
13
|
const get = require("lodash/get");
|
|
15
14
|
const groupBy = require("lodash/groupBy");
|
|
@@ -73,137 +72,6 @@ const toNumber__default = /* @__PURE__ */ _interopDefault(toNumber);
|
|
|
73
72
|
const camelCase__default = /* @__PURE__ */ _interopDefault(camelCase);
|
|
74
73
|
const omit__default = /* @__PURE__ */ _interopDefault(omit);
|
|
75
74
|
const sortBy__default = /* @__PURE__ */ _interopDefault(sortBy);
|
|
76
|
-
const AutoReloadOverlayBlockerContext = React__namespace.createContext(
|
|
77
|
-
{}
|
|
78
|
-
);
|
|
79
|
-
const MAX_ELAPSED_TIME = 30 * 1e3;
|
|
80
|
-
const AutoReloadOverlayBlockerProvider = ({ children }) => {
|
|
81
|
-
const [isOpen, setIsOpen] = React__namespace.useState(false);
|
|
82
|
-
const [config, setConfig] = React__namespace.useState({});
|
|
83
|
-
const [failed, setFailed] = React__namespace.useState(false);
|
|
84
|
-
const lockAppWithAutoreload = React__namespace.useCallback((config2 = {}) => {
|
|
85
|
-
setIsOpen(true);
|
|
86
|
-
setConfig(config2);
|
|
87
|
-
}, []);
|
|
88
|
-
const unlockAppWithAutoreload = React__namespace.useCallback(() => {
|
|
89
|
-
setIsOpen(false);
|
|
90
|
-
setConfig({});
|
|
91
|
-
}, []);
|
|
92
|
-
React__namespace.useEffect(() => {
|
|
93
|
-
if (isOpen) {
|
|
94
|
-
const timeout = setTimeout(() => {
|
|
95
|
-
setFailed(true);
|
|
96
|
-
}, MAX_ELAPSED_TIME);
|
|
97
|
-
return () => {
|
|
98
|
-
clearTimeout(timeout);
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
}, [isOpen]);
|
|
102
|
-
let displayedIcon = config?.icon || "reload";
|
|
103
|
-
let description = {
|
|
104
|
-
id: config?.description || "components.OverlayBlocker.description",
|
|
105
|
-
defaultMessage: "You're using a feature that needs the server to restart. The page will reload automatically."
|
|
106
|
-
};
|
|
107
|
-
let title = {
|
|
108
|
-
id: config?.title || "components.OverlayBlocker.title",
|
|
109
|
-
defaultMessage: "Waiting for restart"
|
|
110
|
-
};
|
|
111
|
-
if (failed) {
|
|
112
|
-
displayedIcon = "time";
|
|
113
|
-
description = {
|
|
114
|
-
id: "components.OverlayBlocker.description.serverError",
|
|
115
|
-
defaultMessage: "The server should have restarted, please check your logs in the terminal."
|
|
116
|
-
};
|
|
117
|
-
title = {
|
|
118
|
-
id: "components.OverlayBlocker.title.serverError",
|
|
119
|
-
defaultMessage: "The restart is taking longer than expected"
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
const autoReloadValue = React__namespace.useMemo(
|
|
123
|
-
() => ({
|
|
124
|
-
lockAppWithAutoreload,
|
|
125
|
-
unlockAppWithAutoreload
|
|
126
|
-
}),
|
|
127
|
-
[lockAppWithAutoreload, unlockAppWithAutoreload]
|
|
128
|
-
);
|
|
129
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(AutoReloadOverlayBlockerContext.Provider, { value: autoReloadValue, children: [
|
|
130
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
131
|
-
Blocker,
|
|
132
|
-
{
|
|
133
|
-
displayedIcon,
|
|
134
|
-
isOpen,
|
|
135
|
-
description,
|
|
136
|
-
title
|
|
137
|
-
}
|
|
138
|
-
),
|
|
139
|
-
children
|
|
140
|
-
] });
|
|
141
|
-
};
|
|
142
|
-
const Blocker = ({ displayedIcon, description, title, isOpen }) => {
|
|
143
|
-
const { formatMessage } = reactIntl.useIntl();
|
|
144
|
-
return isOpen && globalThis?.document?.body ? reactDom.createPortal(
|
|
145
|
-
/* @__PURE__ */ jsxRuntime.jsxs(Overlay, { id: "autoReloadOverlayBlocker", direction: "column", alignItems: "center", gap: 6, children: [
|
|
146
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "center", gap: 2, children: [
|
|
147
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "h1", variant: "alpha", children: formatMessage(title) }),
|
|
148
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "h2", textColor: "neutral600", fontSize: 4, fontWeight: "regular", children: formatMessage(description) })
|
|
149
|
-
] }),
|
|
150
|
-
displayedIcon === "reload" && /* @__PURE__ */ jsxRuntime.jsx(IconBox$1, { padding: 6, background: "primary100", borderColor: "primary200", children: /* @__PURE__ */ jsxRuntime.jsx(LoaderReload, { width: "3.6rem", height: "3.6rem" }) }),
|
|
151
|
-
displayedIcon === "time" && /* @__PURE__ */ jsxRuntime.jsx(IconBox$1, { padding: 6, background: "primary100", borderColor: "primary200", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Clock, { width: "4rem", height: "4rem" }) }),
|
|
152
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { marginTop: 2, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Link, { href: "https://docs.strapi.io", isExternal: true, children: formatMessage({
|
|
153
|
-
id: "global.documentation",
|
|
154
|
-
defaultMessage: "Read the documentation"
|
|
155
|
-
}) }) })
|
|
156
|
-
] }),
|
|
157
|
-
// eslint-disable-next-line no-undef
|
|
158
|
-
globalThis.document.body
|
|
159
|
-
) : null;
|
|
160
|
-
};
|
|
161
|
-
const rotation = styledComponents.keyframes`
|
|
162
|
-
from {
|
|
163
|
-
transform: rotate(0deg);
|
|
164
|
-
}
|
|
165
|
-
to {
|
|
166
|
-
transform: rotate(359deg);
|
|
167
|
-
}
|
|
168
|
-
`;
|
|
169
|
-
const LoaderReload = styledComponents.styled(Icons.ArrowClockwise)`
|
|
170
|
-
animation: ${rotation} 1s infinite linear;
|
|
171
|
-
`;
|
|
172
|
-
const Overlay = styledComponents.styled(designSystem.Flex)`
|
|
173
|
-
position: fixed;
|
|
174
|
-
top: 0;
|
|
175
|
-
right: 0;
|
|
176
|
-
bottom: 0;
|
|
177
|
-
left: 0;
|
|
178
|
-
/* TODO: set this up in the theme for consistence z-index values */
|
|
179
|
-
z-index: 1140;
|
|
180
|
-
padding-top: 16rem;
|
|
181
|
-
|
|
182
|
-
& > * {
|
|
183
|
-
position: relative;
|
|
184
|
-
z-index: 1;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
&:before {
|
|
188
|
-
content: '';
|
|
189
|
-
position: fixed;
|
|
190
|
-
top: 0;
|
|
191
|
-
right: 0;
|
|
192
|
-
bottom: 0;
|
|
193
|
-
left: 0;
|
|
194
|
-
background: ${({ theme }) => theme.colors.neutral0};
|
|
195
|
-
opacity: 0.9;
|
|
196
|
-
}
|
|
197
|
-
`;
|
|
198
|
-
const IconBox$1 = styledComponents.styled(designSystem.Box)`
|
|
199
|
-
border-radius: 50%;
|
|
200
|
-
svg {
|
|
201
|
-
> path {
|
|
202
|
-
fill: ${({ theme }) => theme.colors.primary600} !important;
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
`;
|
|
206
|
-
const useAutoReloadOverlayBlocker = () => React__namespace.useContext(AutoReloadOverlayBlockerContext);
|
|
207
75
|
const getTrad = (id) => `${index$1.pluginId}.${id}`;
|
|
208
76
|
const DataManagerContext = React.createContext();
|
|
209
77
|
const useDataManager = () => React.useContext(DataManagerContext);
|
|
@@ -778,6 +646,9 @@ const Wrapper$1 = styledComponents.styled(designSystem.Flex)`
|
|
|
778
646
|
cursor: pointer;
|
|
779
647
|
user-select: none;
|
|
780
648
|
flex: 1;
|
|
649
|
+
border-radius: 4px;
|
|
650
|
+
border: 1px solid ${({ theme }) => theme.colors.neutral200};
|
|
651
|
+
|
|
781
652
|
${designSystem.inputFocusStyle()}
|
|
782
653
|
}
|
|
783
654
|
|
|
@@ -789,7 +660,6 @@ const Wrapper$1 = styledComponents.styled(designSystem.Flex)`
|
|
|
789
660
|
.option {
|
|
790
661
|
height: 100%;
|
|
791
662
|
border-radius: 4px;
|
|
792
|
-
border: 1px solid ${({ theme }) => theme.colors.neutral200};
|
|
793
663
|
will-change: transform, opacity;
|
|
794
664
|
background: ${({ theme }) => theme.colors.neutral0};
|
|
795
665
|
|
|
@@ -826,7 +696,6 @@ const Wrapper$1 = styledComponents.styled(designSystem.Flex)`
|
|
|
826
696
|
.container input:checked ~ div {
|
|
827
697
|
background: ${({ theme }) => theme.colors.primary100};
|
|
828
698
|
color: ${({ theme }) => theme.colors.primary600};
|
|
829
|
-
border: 1px solid ${({ theme }) => theme.colors.primary200};
|
|
830
699
|
.checkmark {
|
|
831
700
|
border: solid 1px ${({ theme }) => theme.colors.primary600};
|
|
832
701
|
&::after {
|
|
@@ -1870,6 +1739,49 @@ const PluralName = ({
|
|
|
1870
1739
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {})
|
|
1871
1740
|
] });
|
|
1872
1741
|
};
|
|
1742
|
+
const parseDateValue = (value) => {
|
|
1743
|
+
if (value instanceof Date && isValidDate(value)) {
|
|
1744
|
+
return value;
|
|
1745
|
+
}
|
|
1746
|
+
if (typeof value === "string" || typeof value === "number") {
|
|
1747
|
+
const date = new Date(value);
|
|
1748
|
+
if (isValidDate(date)) {
|
|
1749
|
+
return date;
|
|
1750
|
+
}
|
|
1751
|
+
}
|
|
1752
|
+
};
|
|
1753
|
+
const isValidDate = (date) => !isNaN(date.getTime());
|
|
1754
|
+
const removeSeconds = (time) => {
|
|
1755
|
+
const [hours, minutes] = time.split(":");
|
|
1756
|
+
return `${hours}:${minutes}`;
|
|
1757
|
+
};
|
|
1758
|
+
const addSecondsAndMilliseconds = (time) => {
|
|
1759
|
+
return time.split(":").length === 2 ? `${time}:00.000` : time;
|
|
1760
|
+
};
|
|
1761
|
+
const formatTimeForInput = (value) => {
|
|
1762
|
+
if (!value)
|
|
1763
|
+
return;
|
|
1764
|
+
return value.split(":").length > 2 ? removeSeconds(value) : value;
|
|
1765
|
+
};
|
|
1766
|
+
const formatTimeForOutput = (value) => {
|
|
1767
|
+
if (!value)
|
|
1768
|
+
return void 0;
|
|
1769
|
+
return addSecondsAndMilliseconds(value);
|
|
1770
|
+
};
|
|
1771
|
+
const handleTimeChange = ({ value }) => {
|
|
1772
|
+
const formattedInputTime = formatTimeForInput(value);
|
|
1773
|
+
return formattedInputTime;
|
|
1774
|
+
};
|
|
1775
|
+
const handleTimeChangeEvent = (onChange, name, type, time) => {
|
|
1776
|
+
const formattedOutputTime = formatTimeForOutput(time);
|
|
1777
|
+
onChange({
|
|
1778
|
+
target: {
|
|
1779
|
+
name,
|
|
1780
|
+
value: formattedOutputTime,
|
|
1781
|
+
type
|
|
1782
|
+
}
|
|
1783
|
+
});
|
|
1784
|
+
};
|
|
1873
1785
|
const GenericInput = ({
|
|
1874
1786
|
autoComplete,
|
|
1875
1787
|
customInputs,
|
|
@@ -2021,6 +1933,7 @@ const GenericInput = ({
|
|
|
2021
1933
|
);
|
|
2022
1934
|
}
|
|
2023
1935
|
case "datetime": {
|
|
1936
|
+
const dateValue = parseDateValue(value);
|
|
2024
1937
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2025
1938
|
designSystem.DateTimePicker,
|
|
2026
1939
|
{
|
|
@@ -2032,11 +1945,12 @@ const GenericInput = ({
|
|
|
2032
1945
|
},
|
|
2033
1946
|
onClear: () => onChange({ target: { name, value: null, type } }),
|
|
2034
1947
|
placeholder: formattedPlaceholder,
|
|
2035
|
-
value
|
|
1948
|
+
value: dateValue
|
|
2036
1949
|
}
|
|
2037
1950
|
);
|
|
2038
1951
|
}
|
|
2039
1952
|
case "date": {
|
|
1953
|
+
const dateValue = parseDateValue(value);
|
|
2040
1954
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2041
1955
|
designSystem.DatePicker,
|
|
2042
1956
|
{
|
|
@@ -2053,7 +1967,7 @@ const GenericInput = ({
|
|
|
2053
1967
|
},
|
|
2054
1968
|
onClear: () => onChange({ target: { name, value: null, type } }),
|
|
2055
1969
|
placeholder: formattedPlaceholder,
|
|
2056
|
-
value
|
|
1970
|
+
value: dateValue
|
|
2057
1971
|
}
|
|
2058
1972
|
);
|
|
2059
1973
|
}
|
|
@@ -2165,23 +2079,15 @@ const GenericInput = ({
|
|
|
2165
2079
|
);
|
|
2166
2080
|
}
|
|
2167
2081
|
case "time": {
|
|
2168
|
-
|
|
2169
|
-
if (typeof value === "string" && value.split(":").length > 2) {
|
|
2170
|
-
const [hour, minute] = value.split(":");
|
|
2171
|
-
time = `${hour}:${minute}`;
|
|
2172
|
-
}
|
|
2082
|
+
const formattedValue = handleTimeChange({ value, onChange, name, type });
|
|
2173
2083
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2174
2084
|
designSystem.TimePicker,
|
|
2175
2085
|
{
|
|
2176
2086
|
clearLabel: formatMessage({ id: "clearLabel", defaultMessage: "Clear" }),
|
|
2177
2087
|
disabled,
|
|
2178
|
-
onChange: (
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
onClear: () => {
|
|
2182
|
-
onChange({ target: { name, value: null, type } });
|
|
2183
|
-
},
|
|
2184
|
-
value: time
|
|
2088
|
+
onChange: (time) => handleTimeChangeEvent(onChange, name, type, time),
|
|
2089
|
+
onClear: () => handleTimeChangeEvent(onChange, name, type, void 0),
|
|
2090
|
+
value: formattedValue
|
|
2185
2091
|
}
|
|
2186
2092
|
);
|
|
2187
2093
|
}
|
|
@@ -2327,10 +2233,6 @@ const MenuTrigger = styledComponents.styled(designSystem.Menu.Trigger)`
|
|
|
2327
2233
|
overflow: hidden;
|
|
2328
2234
|
text-overflow: ellipsis;
|
|
2329
2235
|
}
|
|
2330
|
-
svg {
|
|
2331
|
-
width: 0.6rem;
|
|
2332
|
-
height: 0.4rem;
|
|
2333
|
-
}
|
|
2334
2236
|
`;
|
|
2335
2237
|
const RelationFormBox = ({
|
|
2336
2238
|
disabled = false,
|
|
@@ -5100,9 +5002,10 @@ const FormModal = () => {
|
|
|
5100
5002
|
kind,
|
|
5101
5003
|
step,
|
|
5102
5004
|
targetUid,
|
|
5103
|
-
showBackLink
|
|
5005
|
+
showBackLink,
|
|
5006
|
+
activeTab,
|
|
5007
|
+
setActiveTab
|
|
5104
5008
|
} = useFormModalNavigation();
|
|
5105
|
-
const [activeTab, setActiveTab] = React__namespace.useState("basic");
|
|
5106
5009
|
const getPlugin = strapiAdmin.useStrapiApp("FormModal", (state) => state.getPlugin);
|
|
5107
5010
|
const getCustomField = strapiAdmin.useStrapiApp("FormModal", (state) => state.customFields.get);
|
|
5108
5011
|
const customField = getCustomField(customFieldUid);
|
|
@@ -6162,8 +6065,8 @@ const DataManagerProvider = ({ children }) => {
|
|
|
6162
6065
|
reservedNames
|
|
6163
6066
|
} = reactRedux.useSelector(makeSelectDataManagerProvider());
|
|
6164
6067
|
const { toggleNotification } = strapiAdmin.useNotification();
|
|
6165
|
-
const { lockAppWithAutoreload, unlockAppWithAutoreload } = useAutoReloadOverlayBlocker();
|
|
6166
|
-
const setCurrentStep = strapiAdmin.useGuidedTour("DataManagerProvider", (state) => state
|
|
6068
|
+
const { lockAppWithAutoreload, unlockAppWithAutoreload } = index$1.useAutoReloadOverlayBlocker();
|
|
6069
|
+
const { setCurrentStep, setStepState } = strapiAdmin.useGuidedTour("DataManagerProvider", (state) => state);
|
|
6167
6070
|
const getPlugin = strapiAdmin.useStrapiApp("DataManagerProvider", (state) => state.getPlugin);
|
|
6168
6071
|
const plugin = getPlugin(index$1.pluginId);
|
|
6169
6072
|
const autoReload = strapiAdmin.useAppInfo("DataManagerProvider", (state) => state.autoReload);
|
|
@@ -6492,10 +6395,10 @@ const DataManagerProvider = ({ children }) => {
|
|
|
6492
6395
|
} else {
|
|
6493
6396
|
await put(requestURL, body);
|
|
6494
6397
|
}
|
|
6495
|
-
await serverRestartWatcher(true);
|
|
6496
|
-
unlockAppWithAutoreload?.();
|
|
6497
6398
|
if (isCreating && (initialData.contentType?.schema.kind === "collectionType" || initialData.contentType?.schema.kind === "singleType")) {
|
|
6498
|
-
|
|
6399
|
+
setStepState("contentTypeBuilder.success", true);
|
|
6400
|
+
trackUsage("didCreateGuidedTourCollectionType");
|
|
6401
|
+
setCurrentStep(null);
|
|
6499
6402
|
}
|
|
6500
6403
|
if (isInContentTypeView) {
|
|
6501
6404
|
trackUsage("didSaveContentType");
|
|
@@ -6507,6 +6410,8 @@ const DataManagerProvider = ({ children }) => {
|
|
|
6507
6410
|
} else {
|
|
6508
6411
|
trackUsage("didSaveComponent");
|
|
6509
6412
|
}
|
|
6413
|
+
await serverRestartWatcher(true);
|
|
6414
|
+
unlockAppWithAutoreload?.();
|
|
6510
6415
|
await getDataRef.current();
|
|
6511
6416
|
dispatch({ type: index$1.UPDATE_INITIAL_STATE });
|
|
6512
6417
|
await updatePermissions();
|
|
@@ -6586,7 +6491,8 @@ const INITIAL_STATE_DATA = {
|
|
|
6586
6491
|
kind: null,
|
|
6587
6492
|
step: null,
|
|
6588
6493
|
targetUid: null,
|
|
6589
|
-
customFieldUid: null
|
|
6494
|
+
customFieldUid: null,
|
|
6495
|
+
activeTab: "basic"
|
|
6590
6496
|
};
|
|
6591
6497
|
const FormModalNavigationProvider = ({ children }) => {
|
|
6592
6498
|
const [state, setFormModalNavigationState] = React__namespace.useState(INITIAL_STATE_DATA);
|
|
@@ -6598,7 +6504,8 @@ const FormModalNavigationProvider = ({ children }) => {
|
|
|
6598
6504
|
actionType: "create",
|
|
6599
6505
|
modalType: "customField",
|
|
6600
6506
|
attributeType,
|
|
6601
|
-
customFieldUid
|
|
6507
|
+
customFieldUid,
|
|
6508
|
+
activeTab: "basic"
|
|
6602
6509
|
};
|
|
6603
6510
|
});
|
|
6604
6511
|
};
|
|
@@ -6613,7 +6520,8 @@ const FormModalNavigationProvider = ({ children }) => {
|
|
|
6613
6520
|
modalType: "attribute",
|
|
6614
6521
|
step,
|
|
6615
6522
|
attributeType,
|
|
6616
|
-
showBackLink: true
|
|
6523
|
+
showBackLink: true,
|
|
6524
|
+
activeTab: "basic"
|
|
6617
6525
|
};
|
|
6618
6526
|
});
|
|
6619
6527
|
};
|
|
@@ -6640,13 +6548,14 @@ const FormModalNavigationProvider = ({ children }) => {
|
|
|
6640
6548
|
targetUid,
|
|
6641
6549
|
modalType: "chooseAttribute",
|
|
6642
6550
|
isOpen: true,
|
|
6643
|
-
showBackLink: false
|
|
6551
|
+
showBackLink: false,
|
|
6552
|
+
activeTab: "basic"
|
|
6644
6553
|
};
|
|
6645
6554
|
});
|
|
6646
6555
|
};
|
|
6647
6556
|
const onOpenModalCreateSchema = (nextState) => {
|
|
6648
6557
|
setFormModalNavigationState((prevState) => {
|
|
6649
|
-
return { ...prevState, ...nextState, isOpen: true };
|
|
6558
|
+
return { ...prevState, ...nextState, isOpen: true, activeTab: "basic" };
|
|
6650
6559
|
});
|
|
6651
6560
|
};
|
|
6652
6561
|
const onOpenModalEditCategory = (categoryName) => {
|
|
@@ -6656,7 +6565,8 @@ const FormModalNavigationProvider = ({ children }) => {
|
|
|
6656
6565
|
categoryName,
|
|
6657
6566
|
actionType: "edit",
|
|
6658
6567
|
modalType: "editCategory",
|
|
6659
|
-
isOpen: true
|
|
6568
|
+
isOpen: true,
|
|
6569
|
+
activeTab: "basic"
|
|
6660
6570
|
};
|
|
6661
6571
|
});
|
|
6662
6572
|
};
|
|
@@ -6677,7 +6587,8 @@ const FormModalNavigationProvider = ({ children }) => {
|
|
|
6677
6587
|
targetUid,
|
|
6678
6588
|
attributeName,
|
|
6679
6589
|
attributeType,
|
|
6680
|
-
isOpen: true
|
|
6590
|
+
isOpen: true,
|
|
6591
|
+
activeTab: "basic"
|
|
6681
6592
|
};
|
|
6682
6593
|
});
|
|
6683
6594
|
};
|
|
@@ -6711,7 +6622,8 @@ const FormModalNavigationProvider = ({ children }) => {
|
|
|
6711
6622
|
forTarget,
|
|
6712
6623
|
targetUid,
|
|
6713
6624
|
kind,
|
|
6714
|
-
isOpen: true
|
|
6625
|
+
isOpen: true,
|
|
6626
|
+
activeTab: "basic"
|
|
6715
6627
|
};
|
|
6716
6628
|
});
|
|
6717
6629
|
};
|
|
@@ -6724,7 +6636,8 @@ const FormModalNavigationProvider = ({ children }) => {
|
|
|
6724
6636
|
...prev,
|
|
6725
6637
|
forTarget,
|
|
6726
6638
|
targetUid,
|
|
6727
|
-
modalType: "chooseAttribute"
|
|
6639
|
+
modalType: "chooseAttribute",
|
|
6640
|
+
activeTab: "basic"
|
|
6728
6641
|
};
|
|
6729
6642
|
});
|
|
6730
6643
|
};
|
|
@@ -6734,7 +6647,8 @@ const FormModalNavigationProvider = ({ children }) => {
|
|
|
6734
6647
|
...prev,
|
|
6735
6648
|
attributeType: "component",
|
|
6736
6649
|
modalType: "attribute",
|
|
6737
|
-
step: "2"
|
|
6650
|
+
step: "2",
|
|
6651
|
+
activeTab: "basic"
|
|
6738
6652
|
};
|
|
6739
6653
|
});
|
|
6740
6654
|
};
|
|
@@ -6747,7 +6661,16 @@ const FormModalNavigationProvider = ({ children }) => {
|
|
|
6747
6661
|
actionType: "create",
|
|
6748
6662
|
step: "1",
|
|
6749
6663
|
attributeType: null,
|
|
6750
|
-
attributeName: null
|
|
6664
|
+
attributeName: null,
|
|
6665
|
+
activeTab: "basic"
|
|
6666
|
+
};
|
|
6667
|
+
});
|
|
6668
|
+
};
|
|
6669
|
+
const setActiveTab = (value) => {
|
|
6670
|
+
setFormModalNavigationState((prev) => {
|
|
6671
|
+
return {
|
|
6672
|
+
...prev,
|
|
6673
|
+
activeTab: value
|
|
6751
6674
|
};
|
|
6752
6675
|
});
|
|
6753
6676
|
};
|
|
@@ -6769,17 +6692,18 @@ const FormModalNavigationProvider = ({ children }) => {
|
|
|
6769
6692
|
onOpenModalEditField,
|
|
6770
6693
|
onOpenModalEditCustomField,
|
|
6771
6694
|
onOpenModalEditSchema,
|
|
6772
|
-
setFormModalNavigationState
|
|
6695
|
+
setFormModalNavigationState,
|
|
6696
|
+
setActiveTab
|
|
6773
6697
|
},
|
|
6774
6698
|
children
|
|
6775
6699
|
}
|
|
6776
6700
|
);
|
|
6777
6701
|
};
|
|
6778
|
-
const ListView$1 = React.lazy(() => Promise.resolve().then(() => require("./ListView-
|
|
6702
|
+
const ListView$1 = React.lazy(() => Promise.resolve().then(() => require("./ListView-CxvINB8V.js")));
|
|
6779
6703
|
const RecursivePath = () => {
|
|
6780
6704
|
return /* @__PURE__ */ jsxRuntime.jsx(React.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Loading, {}), children: /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Routes, { children: /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { path: `/:componentUid`, element: /* @__PURE__ */ jsxRuntime.jsx(ListView$1, {}) }) }) });
|
|
6781
6705
|
};
|
|
6782
|
-
const ListView = React.lazy(() => Promise.resolve().then(() => require("./ListView-
|
|
6706
|
+
const ListView = React.lazy(() => Promise.resolve().then(() => require("./ListView-CxvINB8V.js")));
|
|
6783
6707
|
const App = () => {
|
|
6784
6708
|
const { formatMessage } = reactIntl.useIntl();
|
|
6785
6709
|
const title = formatMessage({
|
|
@@ -6795,7 +6719,7 @@ const App = () => {
|
|
|
6795
6719
|
}, []);
|
|
6796
6720
|
return /* @__PURE__ */ jsxRuntime.jsxs(strapiAdmin.Page.Protect, { permissions: index$1.PERMISSIONS.main, children: [
|
|
6797
6721
|
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Title, { children: title }),
|
|
6798
|
-
/* @__PURE__ */ jsxRuntime.jsx(AutoReloadOverlayBlockerProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(FormModalNavigationProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(DataManagerProvider$1, { children: /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Layouts.Root, { sideNav: /* @__PURE__ */ jsxRuntime.jsx(ContentTypeBuilderNav, {}), children: /* @__PURE__ */ jsxRuntime.jsx(React.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Loading, {}), children: /* @__PURE__ */ jsxRuntime.jsxs(reactRouterDom.Routes, { children: [
|
|
6722
|
+
/* @__PURE__ */ jsxRuntime.jsx(index$1.AutoReloadOverlayBlockerProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(FormModalNavigationProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(DataManagerProvider$1, { children: /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Layouts.Root, { sideNav: /* @__PURE__ */ jsxRuntime.jsx(ContentTypeBuilderNav, {}), children: /* @__PURE__ */ jsxRuntime.jsx(React.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Loading, {}), children: /* @__PURE__ */ jsxRuntime.jsxs(reactRouterDom.Routes, { children: [
|
|
6799
6723
|
/* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { path: "content-types/:uid", element: /* @__PURE__ */ jsxRuntime.jsx(ListView, {}) }),
|
|
6800
6724
|
/* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { path: `component-categories/:categoryUid/*`, element: /* @__PURE__ */ jsxRuntime.jsx(RecursivePath, {}) })
|
|
6801
6725
|
] }) }) }) }) }) })
|
|
@@ -6811,4 +6735,4 @@ exports.getTrad = getTrad;
|
|
|
6811
6735
|
exports.index = index;
|
|
6812
6736
|
exports.useDataManager = useDataManager;
|
|
6813
6737
|
exports.useFormModalNavigation = useFormModalNavigation;
|
|
6814
|
-
//# sourceMappingURL=index-
|
|
6738
|
+
//# sourceMappingURL=index-BVbHj3Bu.js.map
|