@strapi/content-type-builder 5.0.0-rc.8 → 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-BlRO0hDC.js → ListView-CxvINB8V.js} +14 -13
- package/dist/_chunks/ListView-CxvINB8V.js.map +1 -0
- package/dist/_chunks/{ListView-B6MnxBt0.mjs → ListView-D1VH47yt.mjs} +14 -13
- package/dist/_chunks/ListView-D1VH47yt.mjs.map +1 -0
- package/dist/_chunks/{index-BLF1AIxt.js → index-BVbHj3Bu.js} +146 -195
- package/dist/_chunks/index-BVbHj3Bu.js.map +1 -0
- package/dist/_chunks/{index-DTrOFTtR.mjs → index-Bd7-GZsY.mjs} +160 -20
- package/dist/_chunks/index-Bd7-GZsY.mjs.map +1 -0
- package/dist/_chunks/{index-DgZgByqn.js → index-Be2fSfxp.js} +150 -9
- package/dist/_chunks/index-Be2fSfxp.js.map +1 -0
- package/dist/_chunks/{index-DuI_0sF6.mjs → index-S6EtktTB.mjs} +150 -199
- 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-B6MnxBt0.mjs.map +0 -1
- package/dist/_chunks/ListView-BlRO0hDC.js.map +0 -1
- package/dist/_chunks/index-BLF1AIxt.js.map +0 -1
- package/dist/_chunks/index-DTrOFTtR.mjs.map +0 -1
- package/dist/_chunks/index-DgZgByqn.js.map +0 -1
- package/dist/_chunks/index-DuI_0sF6.mjs.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);
|
|
@@ -625,7 +493,7 @@ const AttributeOption = ({ type = "text" }) => {
|
|
|
625
493
|
const AttributeList = ({ attributes }) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.KeyboardNavigable, { tagName: "button", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 8, children: attributes.map((attributeRow, index2) => {
|
|
626
494
|
return (
|
|
627
495
|
// eslint-disable-next-line react/no-array-index-key
|
|
628
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 3, children: attributeRow.map((attribute) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, children: /* @__PURE__ */ jsxRuntime.jsx(AttributeOption, { type: attribute }) }, attribute)) }, index2)
|
|
496
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 3, children: attributeRow.map((attribute) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, direction: "column", alignItems: "stretch", children: /* @__PURE__ */ jsxRuntime.jsx(AttributeOption, { type: attribute }) }, attribute)) }, index2)
|
|
629
497
|
);
|
|
630
498
|
}) }) });
|
|
631
499
|
const CustomFieldOption = ({ customFieldUid, customField }) => {
|
|
@@ -706,7 +574,7 @@ const CustomFieldsList = () => {
|
|
|
706
574
|
(a, b) => a[1].name > b[1].name ? 1 : -1
|
|
707
575
|
);
|
|
708
576
|
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.KeyboardNavigable, { tagName: "button", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 3, children: [
|
|
709
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 3, children: sortedCustomFields.map(([uid, customField]) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, children: /* @__PURE__ */ jsxRuntime.jsx(CustomFieldOption, { customFieldUid: uid, customField }, uid) }, uid)) }),
|
|
577
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 3, children: sortedCustomFields.map(([uid, customField]) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, direction: "column", alignItems: "stretch", children: /* @__PURE__ */ jsxRuntime.jsx(CustomFieldOption, { customFieldUid: uid, customField }, uid) }, uid)) }),
|
|
710
578
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
711
579
|
designSystem.Link,
|
|
712
580
|
{
|
|
@@ -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 {
|
|
@@ -992,10 +861,19 @@ const DraftAndPublishToggle = ({
|
|
|
992
861
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Checkbox, { checked: value, disabled, onCheckedChange: handleChange, children: label }),
|
|
993
862
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Hint, {})
|
|
994
863
|
] }),
|
|
995
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Root, { open: showWarning, onOpenChange: (isOpen) => setShowWarning(isOpen), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
864
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Root, { open: showWarning, onOpenChange: (isOpen) => setShowWarning(isOpen), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
865
|
+
strapiAdmin.ConfirmDialog,
|
|
866
|
+
{
|
|
867
|
+
endAction: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: handleConfirm, variant: "danger", width: "100%", justifyContent: "center", children: formatMessage({
|
|
868
|
+
id: getTrad("popUpWarning.draft-publish.button.confirm"),
|
|
869
|
+
defaultMessage: "Yes, disable"
|
|
870
|
+
}) }),
|
|
871
|
+
children: formatMessage({
|
|
872
|
+
id: getTrad("popUpWarning.draft-publish.message"),
|
|
873
|
+
defaultMessage: "If you disable the draft & publish, your drafts will be deleted."
|
|
874
|
+
})
|
|
875
|
+
}
|
|
876
|
+
) })
|
|
999
877
|
] });
|
|
1000
878
|
};
|
|
1001
879
|
const FormModalEndActions = ({
|
|
@@ -1760,7 +1638,7 @@ const IconPicker = ({ intlLabel, name, onChange, value = "" }) => {
|
|
|
1760
1638
|
id: getTrad("IconPicker.search.button.label"),
|
|
1761
1639
|
defaultMessage: "Search icon button"
|
|
1762
1640
|
}),
|
|
1763
|
-
|
|
1641
|
+
variant: "ghost",
|
|
1764
1642
|
children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Search, {})
|
|
1765
1643
|
}
|
|
1766
1644
|
),
|
|
@@ -1780,7 +1658,7 @@ const IconPicker = ({ intlLabel, name, onChange, value = "" }) => {
|
|
|
1780
1658
|
id: getTrad("IconPicker.remove.button"),
|
|
1781
1659
|
defaultMessage: "Remove the selected icon"
|
|
1782
1660
|
}),
|
|
1783
|
-
|
|
1661
|
+
variant: "ghost",
|
|
1784
1662
|
children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Trash, {})
|
|
1785
1663
|
}
|
|
1786
1664
|
)
|
|
@@ -1861,6 +1739,49 @@ const PluralName = ({
|
|
|
1861
1739
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {})
|
|
1862
1740
|
] });
|
|
1863
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
|
+
};
|
|
1864
1785
|
const GenericInput = ({
|
|
1865
1786
|
autoComplete,
|
|
1866
1787
|
customInputs,
|
|
@@ -2012,6 +1933,7 @@ const GenericInput = ({
|
|
|
2012
1933
|
);
|
|
2013
1934
|
}
|
|
2014
1935
|
case "datetime": {
|
|
1936
|
+
const dateValue = parseDateValue(value);
|
|
2015
1937
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2016
1938
|
designSystem.DateTimePicker,
|
|
2017
1939
|
{
|
|
@@ -2023,11 +1945,12 @@ const GenericInput = ({
|
|
|
2023
1945
|
},
|
|
2024
1946
|
onClear: () => onChange({ target: { name, value: null, type } }),
|
|
2025
1947
|
placeholder: formattedPlaceholder,
|
|
2026
|
-
value
|
|
1948
|
+
value: dateValue
|
|
2027
1949
|
}
|
|
2028
1950
|
);
|
|
2029
1951
|
}
|
|
2030
1952
|
case "date": {
|
|
1953
|
+
const dateValue = parseDateValue(value);
|
|
2031
1954
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2032
1955
|
designSystem.DatePicker,
|
|
2033
1956
|
{
|
|
@@ -2044,7 +1967,7 @@ const GenericInput = ({
|
|
|
2044
1967
|
},
|
|
2045
1968
|
onClear: () => onChange({ target: { name, value: null, type } }),
|
|
2046
1969
|
placeholder: formattedPlaceholder,
|
|
2047
|
-
value
|
|
1970
|
+
value: dateValue
|
|
2048
1971
|
}
|
|
2049
1972
|
);
|
|
2050
1973
|
}
|
|
@@ -2156,23 +2079,15 @@ const GenericInput = ({
|
|
|
2156
2079
|
);
|
|
2157
2080
|
}
|
|
2158
2081
|
case "time": {
|
|
2159
|
-
|
|
2160
|
-
if (typeof value === "string" && value.split(":").length > 2) {
|
|
2161
|
-
const [hour, minute] = value.split(":");
|
|
2162
|
-
time = `${hour}:${minute}`;
|
|
2163
|
-
}
|
|
2082
|
+
const formattedValue = handleTimeChange({ value, onChange, name, type });
|
|
2164
2083
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2165
2084
|
designSystem.TimePicker,
|
|
2166
2085
|
{
|
|
2167
2086
|
clearLabel: formatMessage({ id: "clearLabel", defaultMessage: "Clear" }),
|
|
2168
2087
|
disabled,
|
|
2169
|
-
onChange: (
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
onClear: () => {
|
|
2173
|
-
onChange({ target: { name, value: null, type } });
|
|
2174
|
-
},
|
|
2175
|
-
value: time
|
|
2088
|
+
onChange: (time) => handleTimeChangeEvent(onChange, name, type, time),
|
|
2089
|
+
onClear: () => handleTimeChangeEvent(onChange, name, type, void 0),
|
|
2090
|
+
value: formattedValue
|
|
2176
2091
|
}
|
|
2177
2092
|
);
|
|
2178
2093
|
}
|
|
@@ -2318,10 +2233,6 @@ const MenuTrigger = styledComponents.styled(designSystem.Menu.Trigger)`
|
|
|
2318
2233
|
overflow: hidden;
|
|
2319
2234
|
text-overflow: ellipsis;
|
|
2320
2235
|
}
|
|
2321
|
-
svg {
|
|
2322
|
-
width: 0.6rem;
|
|
2323
|
-
height: 0.4rem;
|
|
2324
|
-
}
|
|
2325
2236
|
`;
|
|
2326
2237
|
const RelationFormBox = ({
|
|
2327
2238
|
disabled = false,
|
|
@@ -2871,18 +2782,36 @@ const TabForm = ({
|
|
|
2871
2782
|
null
|
|
2872
2783
|
);
|
|
2873
2784
|
if (input.type === "pushRight") {
|
|
2874
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2785
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2786
|
+
designSystem.Grid.Item,
|
|
2787
|
+
{
|
|
2788
|
+
col: input.size || 6,
|
|
2789
|
+
direction: "column",
|
|
2790
|
+
alignItems: "stretch",
|
|
2791
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", {})
|
|
2792
|
+
},
|
|
2793
|
+
input.name || key
|
|
2794
|
+
);
|
|
2875
2795
|
}
|
|
2876
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2877
|
-
|
|
2796
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2797
|
+
designSystem.Grid.Item,
|
|
2878
2798
|
{
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2799
|
+
col: input.size || 6,
|
|
2800
|
+
direction: "column",
|
|
2801
|
+
alignItems: "stretch",
|
|
2802
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2803
|
+
MemoizedGenericInput,
|
|
2804
|
+
{
|
|
2805
|
+
...input,
|
|
2806
|
+
...genericInputProps,
|
|
2807
|
+
error: errorId,
|
|
2808
|
+
onChange,
|
|
2809
|
+
value
|
|
2810
|
+
}
|
|
2811
|
+
)
|
|
2812
|
+
},
|
|
2813
|
+
input.name || key
|
|
2814
|
+
);
|
|
2886
2815
|
}) })
|
|
2887
2816
|
] }, sectionIndex);
|
|
2888
2817
|
}) });
|
|
@@ -5073,9 +5002,10 @@ const FormModal = () => {
|
|
|
5073
5002
|
kind,
|
|
5074
5003
|
step,
|
|
5075
5004
|
targetUid,
|
|
5076
|
-
showBackLink
|
|
5005
|
+
showBackLink,
|
|
5006
|
+
activeTab,
|
|
5007
|
+
setActiveTab
|
|
5077
5008
|
} = useFormModalNavigation();
|
|
5078
|
-
const [activeTab, setActiveTab] = React__namespace.useState("basic");
|
|
5079
5009
|
const getPlugin = strapiAdmin.useStrapiApp("FormModal", (state) => state.getPlugin);
|
|
5080
5010
|
const getCustomField = strapiAdmin.useStrapiApp("FormModal", (state) => state.customFields.get);
|
|
5081
5011
|
const customField = getCustomField(customFieldUid);
|
|
@@ -6135,8 +6065,8 @@ const DataManagerProvider = ({ children }) => {
|
|
|
6135
6065
|
reservedNames
|
|
6136
6066
|
} = reactRedux.useSelector(makeSelectDataManagerProvider());
|
|
6137
6067
|
const { toggleNotification } = strapiAdmin.useNotification();
|
|
6138
|
-
const { lockAppWithAutoreload, unlockAppWithAutoreload } = useAutoReloadOverlayBlocker();
|
|
6139
|
-
const setCurrentStep = strapiAdmin.useGuidedTour("DataManagerProvider", (state) => state
|
|
6068
|
+
const { lockAppWithAutoreload, unlockAppWithAutoreload } = index$1.useAutoReloadOverlayBlocker();
|
|
6069
|
+
const { setCurrentStep, setStepState } = strapiAdmin.useGuidedTour("DataManagerProvider", (state) => state);
|
|
6140
6070
|
const getPlugin = strapiAdmin.useStrapiApp("DataManagerProvider", (state) => state.getPlugin);
|
|
6141
6071
|
const plugin = getPlugin(index$1.pluginId);
|
|
6142
6072
|
const autoReload = strapiAdmin.useAppInfo("DataManagerProvider", (state) => state.autoReload);
|
|
@@ -6465,10 +6395,10 @@ const DataManagerProvider = ({ children }) => {
|
|
|
6465
6395
|
} else {
|
|
6466
6396
|
await put(requestURL, body);
|
|
6467
6397
|
}
|
|
6468
|
-
await serverRestartWatcher(true);
|
|
6469
|
-
unlockAppWithAutoreload?.();
|
|
6470
6398
|
if (isCreating && (initialData.contentType?.schema.kind === "collectionType" || initialData.contentType?.schema.kind === "singleType")) {
|
|
6471
|
-
|
|
6399
|
+
setStepState("contentTypeBuilder.success", true);
|
|
6400
|
+
trackUsage("didCreateGuidedTourCollectionType");
|
|
6401
|
+
setCurrentStep(null);
|
|
6472
6402
|
}
|
|
6473
6403
|
if (isInContentTypeView) {
|
|
6474
6404
|
trackUsage("didSaveContentType");
|
|
@@ -6480,6 +6410,8 @@ const DataManagerProvider = ({ children }) => {
|
|
|
6480
6410
|
} else {
|
|
6481
6411
|
trackUsage("didSaveComponent");
|
|
6482
6412
|
}
|
|
6413
|
+
await serverRestartWatcher(true);
|
|
6414
|
+
unlockAppWithAutoreload?.();
|
|
6483
6415
|
await getDataRef.current();
|
|
6484
6416
|
dispatch({ type: index$1.UPDATE_INITIAL_STATE });
|
|
6485
6417
|
await updatePermissions();
|
|
@@ -6559,7 +6491,8 @@ const INITIAL_STATE_DATA = {
|
|
|
6559
6491
|
kind: null,
|
|
6560
6492
|
step: null,
|
|
6561
6493
|
targetUid: null,
|
|
6562
|
-
customFieldUid: null
|
|
6494
|
+
customFieldUid: null,
|
|
6495
|
+
activeTab: "basic"
|
|
6563
6496
|
};
|
|
6564
6497
|
const FormModalNavigationProvider = ({ children }) => {
|
|
6565
6498
|
const [state, setFormModalNavigationState] = React__namespace.useState(INITIAL_STATE_DATA);
|
|
@@ -6571,7 +6504,8 @@ const FormModalNavigationProvider = ({ children }) => {
|
|
|
6571
6504
|
actionType: "create",
|
|
6572
6505
|
modalType: "customField",
|
|
6573
6506
|
attributeType,
|
|
6574
|
-
customFieldUid
|
|
6507
|
+
customFieldUid,
|
|
6508
|
+
activeTab: "basic"
|
|
6575
6509
|
};
|
|
6576
6510
|
});
|
|
6577
6511
|
};
|
|
@@ -6586,7 +6520,8 @@ const FormModalNavigationProvider = ({ children }) => {
|
|
|
6586
6520
|
modalType: "attribute",
|
|
6587
6521
|
step,
|
|
6588
6522
|
attributeType,
|
|
6589
|
-
showBackLink: true
|
|
6523
|
+
showBackLink: true,
|
|
6524
|
+
activeTab: "basic"
|
|
6590
6525
|
};
|
|
6591
6526
|
});
|
|
6592
6527
|
};
|
|
@@ -6613,13 +6548,14 @@ const FormModalNavigationProvider = ({ children }) => {
|
|
|
6613
6548
|
targetUid,
|
|
6614
6549
|
modalType: "chooseAttribute",
|
|
6615
6550
|
isOpen: true,
|
|
6616
|
-
showBackLink: false
|
|
6551
|
+
showBackLink: false,
|
|
6552
|
+
activeTab: "basic"
|
|
6617
6553
|
};
|
|
6618
6554
|
});
|
|
6619
6555
|
};
|
|
6620
6556
|
const onOpenModalCreateSchema = (nextState) => {
|
|
6621
6557
|
setFormModalNavigationState((prevState) => {
|
|
6622
|
-
return { ...prevState, ...nextState, isOpen: true };
|
|
6558
|
+
return { ...prevState, ...nextState, isOpen: true, activeTab: "basic" };
|
|
6623
6559
|
});
|
|
6624
6560
|
};
|
|
6625
6561
|
const onOpenModalEditCategory = (categoryName) => {
|
|
@@ -6629,7 +6565,8 @@ const FormModalNavigationProvider = ({ children }) => {
|
|
|
6629
6565
|
categoryName,
|
|
6630
6566
|
actionType: "edit",
|
|
6631
6567
|
modalType: "editCategory",
|
|
6632
|
-
isOpen: true
|
|
6568
|
+
isOpen: true,
|
|
6569
|
+
activeTab: "basic"
|
|
6633
6570
|
};
|
|
6634
6571
|
});
|
|
6635
6572
|
};
|
|
@@ -6650,7 +6587,8 @@ const FormModalNavigationProvider = ({ children }) => {
|
|
|
6650
6587
|
targetUid,
|
|
6651
6588
|
attributeName,
|
|
6652
6589
|
attributeType,
|
|
6653
|
-
isOpen: true
|
|
6590
|
+
isOpen: true,
|
|
6591
|
+
activeTab: "basic"
|
|
6654
6592
|
};
|
|
6655
6593
|
});
|
|
6656
6594
|
};
|
|
@@ -6684,7 +6622,8 @@ const FormModalNavigationProvider = ({ children }) => {
|
|
|
6684
6622
|
forTarget,
|
|
6685
6623
|
targetUid,
|
|
6686
6624
|
kind,
|
|
6687
|
-
isOpen: true
|
|
6625
|
+
isOpen: true,
|
|
6626
|
+
activeTab: "basic"
|
|
6688
6627
|
};
|
|
6689
6628
|
});
|
|
6690
6629
|
};
|
|
@@ -6697,7 +6636,8 @@ const FormModalNavigationProvider = ({ children }) => {
|
|
|
6697
6636
|
...prev,
|
|
6698
6637
|
forTarget,
|
|
6699
6638
|
targetUid,
|
|
6700
|
-
modalType: "chooseAttribute"
|
|
6639
|
+
modalType: "chooseAttribute",
|
|
6640
|
+
activeTab: "basic"
|
|
6701
6641
|
};
|
|
6702
6642
|
});
|
|
6703
6643
|
};
|
|
@@ -6707,7 +6647,8 @@ const FormModalNavigationProvider = ({ children }) => {
|
|
|
6707
6647
|
...prev,
|
|
6708
6648
|
attributeType: "component",
|
|
6709
6649
|
modalType: "attribute",
|
|
6710
|
-
step: "2"
|
|
6650
|
+
step: "2",
|
|
6651
|
+
activeTab: "basic"
|
|
6711
6652
|
};
|
|
6712
6653
|
});
|
|
6713
6654
|
};
|
|
@@ -6720,7 +6661,16 @@ const FormModalNavigationProvider = ({ children }) => {
|
|
|
6720
6661
|
actionType: "create",
|
|
6721
6662
|
step: "1",
|
|
6722
6663
|
attributeType: null,
|
|
6723
|
-
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
|
|
6724
6674
|
};
|
|
6725
6675
|
});
|
|
6726
6676
|
};
|
|
@@ -6742,17 +6692,18 @@ const FormModalNavigationProvider = ({ children }) => {
|
|
|
6742
6692
|
onOpenModalEditField,
|
|
6743
6693
|
onOpenModalEditCustomField,
|
|
6744
6694
|
onOpenModalEditSchema,
|
|
6745
|
-
setFormModalNavigationState
|
|
6695
|
+
setFormModalNavigationState,
|
|
6696
|
+
setActiveTab
|
|
6746
6697
|
},
|
|
6747
6698
|
children
|
|
6748
6699
|
}
|
|
6749
6700
|
);
|
|
6750
6701
|
};
|
|
6751
|
-
const ListView$1 = React.lazy(() => Promise.resolve().then(() => require("./ListView-
|
|
6702
|
+
const ListView$1 = React.lazy(() => Promise.resolve().then(() => require("./ListView-CxvINB8V.js")));
|
|
6752
6703
|
const RecursivePath = () => {
|
|
6753
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, {}) }) }) });
|
|
6754
6705
|
};
|
|
6755
|
-
const ListView = React.lazy(() => Promise.resolve().then(() => require("./ListView-
|
|
6706
|
+
const ListView = React.lazy(() => Promise.resolve().then(() => require("./ListView-CxvINB8V.js")));
|
|
6756
6707
|
const App = () => {
|
|
6757
6708
|
const { formatMessage } = reactIntl.useIntl();
|
|
6758
6709
|
const title = formatMessage({
|
|
@@ -6768,7 +6719,7 @@ const App = () => {
|
|
|
6768
6719
|
}, []);
|
|
6769
6720
|
return /* @__PURE__ */ jsxRuntime.jsxs(strapiAdmin.Page.Protect, { permissions: index$1.PERMISSIONS.main, children: [
|
|
6770
6721
|
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Title, { children: title }),
|
|
6771
|
-
/* @__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: [
|
|
6772
6723
|
/* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { path: "content-types/:uid", element: /* @__PURE__ */ jsxRuntime.jsx(ListView, {}) }),
|
|
6773
6724
|
/* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { path: `component-categories/:categoryUid/*`, element: /* @__PURE__ */ jsxRuntime.jsx(RecursivePath, {}) })
|
|
6774
6725
|
] }) }) }) }) }) })
|
|
@@ -6784,4 +6735,4 @@ exports.getTrad = getTrad;
|
|
|
6784
6735
|
exports.index = index;
|
|
6785
6736
|
exports.useDataManager = useDataManager;
|
|
6786
6737
|
exports.useFormModalNavigation = useFormModalNavigation;
|
|
6787
|
-
//# sourceMappingURL=index-
|
|
6738
|
+
//# sourceMappingURL=index-BVbHj3Bu.js.map
|