@strapi/content-type-builder 5.0.0-rc.3 → 5.0.0-rc.30
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-CXba7ij5.mjs → ListView-CGLqkUBZ.mjs} +21 -16
- package/dist/_chunks/ListView-CGLqkUBZ.mjs.map +1 -0
- package/dist/_chunks/{ListView-BQb88LNw.js → ListView-LfXjdWfW.js} +21 -16
- package/dist/_chunks/ListView-LfXjdWfW.js.map +1 -0
- package/dist/_chunks/{index-C2yjWkJh.mjs → index-BXPQ175h.mjs} +177 -199
- package/dist/_chunks/index-BXPQ175h.mjs.map +1 -0
- package/dist/_chunks/{index-lmF90uIG.js → index-BolZAeLc.js} +150 -9
- package/dist/_chunks/index-BolZAeLc.js.map +1 -0
- package/dist/_chunks/{index-Bhjcor9k.js → index-BrsV2OKM.js} +173 -195
- package/dist/_chunks/index-BrsV2OKM.js.map +1 -0
- package/dist/_chunks/{index-1dZSgaqS.mjs → index-DFvzA6Sy.mjs} +160 -20
- package/dist/_chunks/index-DFvzA6Sy.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-BQb88LNw.js.map +0 -1
- package/dist/_chunks/ListView-CXba7ij5.mjs.map +0 -1
- package/dist/_chunks/index-1dZSgaqS.mjs.map +0 -1
- package/dist/_chunks/index-Bhjcor9k.js.map +0 -1
- package/dist/_chunks/index-C2yjWkJh.mjs.map +0 -1
- package/dist/_chunks/index-lmF90uIG.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-BolZAeLc.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);
|
|
@@ -377,6 +245,17 @@ const useContentTypeBuilderMenu = () => {
|
|
|
377
245
|
onSearchChange: setSearch
|
|
378
246
|
};
|
|
379
247
|
};
|
|
248
|
+
const SubNavLinkCustom = styledComponents.styled(designSystem.SubNavLink)`
|
|
249
|
+
div {
|
|
250
|
+
width: inherit;
|
|
251
|
+
span:nth-child(2) {
|
|
252
|
+
white-space: nowrap;
|
|
253
|
+
overflow: hidden;
|
|
254
|
+
text-overflow: ellipsis;
|
|
255
|
+
width: inherit;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
`;
|
|
380
259
|
const ContentTypeBuilderNav = () => {
|
|
381
260
|
const { menu, searchValue, onSearchChange } = useContentTypeBuilderMenu();
|
|
382
261
|
const { formatMessage } = reactIntl.useIntl();
|
|
@@ -425,7 +304,17 @@ const ContentTypeBuilderNav = () => {
|
|
|
425
304
|
subLink.name
|
|
426
305
|
)) }, link.name);
|
|
427
306
|
}
|
|
428
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
307
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
308
|
+
SubNavLinkCustom,
|
|
309
|
+
{
|
|
310
|
+
tag: reactRouterDom.NavLink,
|
|
311
|
+
to: link.to,
|
|
312
|
+
active: link.active,
|
|
313
|
+
width: "100%",
|
|
314
|
+
children: upperFirst__default.default(formatMessage({ id: link.name, defaultMessage: link.title }))
|
|
315
|
+
},
|
|
316
|
+
link.name
|
|
317
|
+
);
|
|
429
318
|
})
|
|
430
319
|
}
|
|
431
320
|
),
|
|
@@ -604,7 +493,7 @@ const AttributeOption = ({ type = "text" }) => {
|
|
|
604
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) => {
|
|
605
494
|
return (
|
|
606
495
|
// eslint-disable-next-line react/no-array-index-key
|
|
607
|
-
/* @__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)
|
|
608
497
|
);
|
|
609
498
|
}) }) });
|
|
610
499
|
const CustomFieldOption = ({ customFieldUid, customField }) => {
|
|
@@ -685,7 +574,7 @@ const CustomFieldsList = () => {
|
|
|
685
574
|
(a, b) => a[1].name > b[1].name ? 1 : -1
|
|
686
575
|
);
|
|
687
576
|
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.KeyboardNavigable, { tagName: "button", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 3, children: [
|
|
688
|
-
/* @__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)) }),
|
|
689
578
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
690
579
|
designSystem.Link,
|
|
691
580
|
{
|
|
@@ -757,6 +646,9 @@ const Wrapper$1 = styledComponents.styled(designSystem.Flex)`
|
|
|
757
646
|
cursor: pointer;
|
|
758
647
|
user-select: none;
|
|
759
648
|
flex: 1;
|
|
649
|
+
border-radius: 4px;
|
|
650
|
+
border: 1px solid ${({ theme }) => theme.colors.neutral200};
|
|
651
|
+
|
|
760
652
|
${designSystem.inputFocusStyle()}
|
|
761
653
|
}
|
|
762
654
|
|
|
@@ -768,7 +660,6 @@ const Wrapper$1 = styledComponents.styled(designSystem.Flex)`
|
|
|
768
660
|
.option {
|
|
769
661
|
height: 100%;
|
|
770
662
|
border-radius: 4px;
|
|
771
|
-
border: 1px solid ${({ theme }) => theme.colors.neutral200};
|
|
772
663
|
will-change: transform, opacity;
|
|
773
664
|
background: ${({ theme }) => theme.colors.neutral0};
|
|
774
665
|
|
|
@@ -805,7 +696,6 @@ const Wrapper$1 = styledComponents.styled(designSystem.Flex)`
|
|
|
805
696
|
.container input:checked ~ div {
|
|
806
697
|
background: ${({ theme }) => theme.colors.primary100};
|
|
807
698
|
color: ${({ theme }) => theme.colors.primary600};
|
|
808
|
-
border: 1px solid ${({ theme }) => theme.colors.primary200};
|
|
809
699
|
.checkmark {
|
|
810
700
|
border: solid 1px ${({ theme }) => theme.colors.primary600};
|
|
811
701
|
&::after {
|
|
@@ -971,10 +861,19 @@ const DraftAndPublishToggle = ({
|
|
|
971
861
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Checkbox, { checked: value, disabled, onCheckedChange: handleChange, children: label }),
|
|
972
862
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Hint, {})
|
|
973
863
|
] }),
|
|
974
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Root, { open: showWarning, onOpenChange: (isOpen) => setShowWarning(isOpen), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
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
|
+
) })
|
|
978
877
|
] });
|
|
979
878
|
};
|
|
980
879
|
const FormModalEndActions = ({
|
|
@@ -1739,7 +1638,7 @@ const IconPicker = ({ intlLabel, name, onChange, value = "" }) => {
|
|
|
1739
1638
|
id: getTrad("IconPicker.search.button.label"),
|
|
1740
1639
|
defaultMessage: "Search icon button"
|
|
1741
1640
|
}),
|
|
1742
|
-
|
|
1641
|
+
variant: "ghost",
|
|
1743
1642
|
children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Search, {})
|
|
1744
1643
|
}
|
|
1745
1644
|
),
|
|
@@ -1759,7 +1658,7 @@ const IconPicker = ({ intlLabel, name, onChange, value = "" }) => {
|
|
|
1759
1658
|
id: getTrad("IconPicker.remove.button"),
|
|
1760
1659
|
defaultMessage: "Remove the selected icon"
|
|
1761
1660
|
}),
|
|
1762
|
-
|
|
1661
|
+
variant: "ghost",
|
|
1763
1662
|
children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Trash, {})
|
|
1764
1663
|
}
|
|
1765
1664
|
)
|
|
@@ -1840,6 +1739,49 @@ const PluralName = ({
|
|
|
1840
1739
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {})
|
|
1841
1740
|
] });
|
|
1842
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
|
+
};
|
|
1843
1785
|
const GenericInput = ({
|
|
1844
1786
|
autoComplete,
|
|
1845
1787
|
customInputs,
|
|
@@ -1991,6 +1933,7 @@ const GenericInput = ({
|
|
|
1991
1933
|
);
|
|
1992
1934
|
}
|
|
1993
1935
|
case "datetime": {
|
|
1936
|
+
const dateValue = parseDateValue(value);
|
|
1994
1937
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1995
1938
|
designSystem.DateTimePicker,
|
|
1996
1939
|
{
|
|
@@ -2002,11 +1945,12 @@ const GenericInput = ({
|
|
|
2002
1945
|
},
|
|
2003
1946
|
onClear: () => onChange({ target: { name, value: null, type } }),
|
|
2004
1947
|
placeholder: formattedPlaceholder,
|
|
2005
|
-
value
|
|
1948
|
+
value: dateValue
|
|
2006
1949
|
}
|
|
2007
1950
|
);
|
|
2008
1951
|
}
|
|
2009
1952
|
case "date": {
|
|
1953
|
+
const dateValue = parseDateValue(value);
|
|
2010
1954
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2011
1955
|
designSystem.DatePicker,
|
|
2012
1956
|
{
|
|
@@ -2023,7 +1967,7 @@ const GenericInput = ({
|
|
|
2023
1967
|
},
|
|
2024
1968
|
onClear: () => onChange({ target: { name, value: null, type } }),
|
|
2025
1969
|
placeholder: formattedPlaceholder,
|
|
2026
|
-
value
|
|
1970
|
+
value: dateValue
|
|
2027
1971
|
}
|
|
2028
1972
|
);
|
|
2029
1973
|
}
|
|
@@ -2135,23 +2079,15 @@ const GenericInput = ({
|
|
|
2135
2079
|
);
|
|
2136
2080
|
}
|
|
2137
2081
|
case "time": {
|
|
2138
|
-
|
|
2139
|
-
if (typeof value === "string" && value.split(":").length > 2) {
|
|
2140
|
-
const [hour, minute] = value.split(":");
|
|
2141
|
-
time = `${hour}:${minute}`;
|
|
2142
|
-
}
|
|
2082
|
+
const formattedValue = handleTimeChange({ value, onChange, name, type });
|
|
2143
2083
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2144
2084
|
designSystem.TimePicker,
|
|
2145
2085
|
{
|
|
2146
2086
|
clearLabel: formatMessage({ id: "clearLabel", defaultMessage: "Clear" }),
|
|
2147
2087
|
disabled,
|
|
2148
|
-
onChange: (
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
onClear: () => {
|
|
2152
|
-
onChange({ target: { name, value: null, type } });
|
|
2153
|
-
},
|
|
2154
|
-
value: time
|
|
2088
|
+
onChange: (time) => handleTimeChangeEvent(onChange, name, type, time),
|
|
2089
|
+
onClear: () => handleTimeChangeEvent(onChange, name, type, void 0),
|
|
2090
|
+
value: formattedValue
|
|
2155
2091
|
}
|
|
2156
2092
|
);
|
|
2157
2093
|
}
|
|
@@ -2291,9 +2227,11 @@ const RelationTargetPicker = ({
|
|
|
2291
2227
|
] });
|
|
2292
2228
|
};
|
|
2293
2229
|
const MenuTrigger = styledComponents.styled(designSystem.Menu.Trigger)`
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2230
|
+
max-width: 16.8rem;
|
|
2231
|
+
span {
|
|
2232
|
+
white-space: nowrap;
|
|
2233
|
+
overflow: hidden;
|
|
2234
|
+
text-overflow: ellipsis;
|
|
2297
2235
|
}
|
|
2298
2236
|
`;
|
|
2299
2237
|
const RelationFormBox = ({
|
|
@@ -2844,18 +2782,36 @@ const TabForm = ({
|
|
|
2844
2782
|
null
|
|
2845
2783
|
);
|
|
2846
2784
|
if (input.type === "pushRight") {
|
|
2847
|
-
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
|
+
);
|
|
2848
2795
|
}
|
|
2849
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2850
|
-
|
|
2796
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2797
|
+
designSystem.Grid.Item,
|
|
2851
2798
|
{
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
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
|
+
);
|
|
2859
2815
|
}) })
|
|
2860
2816
|
] }, sectionIndex);
|
|
2861
2817
|
}) });
|
|
@@ -5046,9 +5002,10 @@ const FormModal = () => {
|
|
|
5046
5002
|
kind,
|
|
5047
5003
|
step,
|
|
5048
5004
|
targetUid,
|
|
5049
|
-
showBackLink
|
|
5005
|
+
showBackLink,
|
|
5006
|
+
activeTab,
|
|
5007
|
+
setActiveTab
|
|
5050
5008
|
} = useFormModalNavigation();
|
|
5051
|
-
const [activeTab, setActiveTab] = React__namespace.useState("basic");
|
|
5052
5009
|
const getPlugin = strapiAdmin.useStrapiApp("FormModal", (state) => state.getPlugin);
|
|
5053
5010
|
const getCustomField = strapiAdmin.useStrapiApp("FormModal", (state) => state.customFields.get);
|
|
5054
5011
|
const customField = getCustomField(customFieldUid);
|
|
@@ -6108,8 +6065,8 @@ const DataManagerProvider = ({ children }) => {
|
|
|
6108
6065
|
reservedNames
|
|
6109
6066
|
} = reactRedux.useSelector(makeSelectDataManagerProvider());
|
|
6110
6067
|
const { toggleNotification } = strapiAdmin.useNotification();
|
|
6111
|
-
const { lockAppWithAutoreload, unlockAppWithAutoreload } = useAutoReloadOverlayBlocker();
|
|
6112
|
-
const setCurrentStep = strapiAdmin.useGuidedTour("DataManagerProvider", (state) => state
|
|
6068
|
+
const { lockAppWithAutoreload, unlockAppWithAutoreload } = index$1.useAutoReloadOverlayBlocker();
|
|
6069
|
+
const { setCurrentStep, setStepState } = strapiAdmin.useGuidedTour("DataManagerProvider", (state) => state);
|
|
6113
6070
|
const getPlugin = strapiAdmin.useStrapiApp("DataManagerProvider", (state) => state.getPlugin);
|
|
6114
6071
|
const plugin = getPlugin(index$1.pluginId);
|
|
6115
6072
|
const autoReload = strapiAdmin.useAppInfo("DataManagerProvider", (state) => state.autoReload);
|
|
@@ -6438,10 +6395,10 @@ const DataManagerProvider = ({ children }) => {
|
|
|
6438
6395
|
} else {
|
|
6439
6396
|
await put(requestURL, body);
|
|
6440
6397
|
}
|
|
6441
|
-
await serverRestartWatcher(true);
|
|
6442
|
-
unlockAppWithAutoreload?.();
|
|
6443
6398
|
if (isCreating && (initialData.contentType?.schema.kind === "collectionType" || initialData.contentType?.schema.kind === "singleType")) {
|
|
6444
|
-
|
|
6399
|
+
setStepState("contentTypeBuilder.success", true);
|
|
6400
|
+
trackUsage("didCreateGuidedTourCollectionType");
|
|
6401
|
+
setCurrentStep(null);
|
|
6445
6402
|
}
|
|
6446
6403
|
if (isInContentTypeView) {
|
|
6447
6404
|
trackUsage("didSaveContentType");
|
|
@@ -6453,6 +6410,8 @@ const DataManagerProvider = ({ children }) => {
|
|
|
6453
6410
|
} else {
|
|
6454
6411
|
trackUsage("didSaveComponent");
|
|
6455
6412
|
}
|
|
6413
|
+
await serverRestartWatcher(true);
|
|
6414
|
+
unlockAppWithAutoreload?.();
|
|
6456
6415
|
await getDataRef.current();
|
|
6457
6416
|
dispatch({ type: index$1.UPDATE_INITIAL_STATE });
|
|
6458
6417
|
await updatePermissions();
|
|
@@ -6532,7 +6491,8 @@ const INITIAL_STATE_DATA = {
|
|
|
6532
6491
|
kind: null,
|
|
6533
6492
|
step: null,
|
|
6534
6493
|
targetUid: null,
|
|
6535
|
-
customFieldUid: null
|
|
6494
|
+
customFieldUid: null,
|
|
6495
|
+
activeTab: "basic"
|
|
6536
6496
|
};
|
|
6537
6497
|
const FormModalNavigationProvider = ({ children }) => {
|
|
6538
6498
|
const [state, setFormModalNavigationState] = React__namespace.useState(INITIAL_STATE_DATA);
|
|
@@ -6544,7 +6504,8 @@ const FormModalNavigationProvider = ({ children }) => {
|
|
|
6544
6504
|
actionType: "create",
|
|
6545
6505
|
modalType: "customField",
|
|
6546
6506
|
attributeType,
|
|
6547
|
-
customFieldUid
|
|
6507
|
+
customFieldUid,
|
|
6508
|
+
activeTab: "basic"
|
|
6548
6509
|
};
|
|
6549
6510
|
});
|
|
6550
6511
|
};
|
|
@@ -6559,7 +6520,8 @@ const FormModalNavigationProvider = ({ children }) => {
|
|
|
6559
6520
|
modalType: "attribute",
|
|
6560
6521
|
step,
|
|
6561
6522
|
attributeType,
|
|
6562
|
-
showBackLink: true
|
|
6523
|
+
showBackLink: true,
|
|
6524
|
+
activeTab: "basic"
|
|
6563
6525
|
};
|
|
6564
6526
|
});
|
|
6565
6527
|
};
|
|
@@ -6586,13 +6548,14 @@ const FormModalNavigationProvider = ({ children }) => {
|
|
|
6586
6548
|
targetUid,
|
|
6587
6549
|
modalType: "chooseAttribute",
|
|
6588
6550
|
isOpen: true,
|
|
6589
|
-
showBackLink: false
|
|
6551
|
+
showBackLink: false,
|
|
6552
|
+
activeTab: "basic"
|
|
6590
6553
|
};
|
|
6591
6554
|
});
|
|
6592
6555
|
};
|
|
6593
6556
|
const onOpenModalCreateSchema = (nextState) => {
|
|
6594
6557
|
setFormModalNavigationState((prevState) => {
|
|
6595
|
-
return { ...prevState, ...nextState, isOpen: true };
|
|
6558
|
+
return { ...prevState, ...nextState, isOpen: true, activeTab: "basic" };
|
|
6596
6559
|
});
|
|
6597
6560
|
};
|
|
6598
6561
|
const onOpenModalEditCategory = (categoryName) => {
|
|
@@ -6602,7 +6565,8 @@ const FormModalNavigationProvider = ({ children }) => {
|
|
|
6602
6565
|
categoryName,
|
|
6603
6566
|
actionType: "edit",
|
|
6604
6567
|
modalType: "editCategory",
|
|
6605
|
-
isOpen: true
|
|
6568
|
+
isOpen: true,
|
|
6569
|
+
activeTab: "basic"
|
|
6606
6570
|
};
|
|
6607
6571
|
});
|
|
6608
6572
|
};
|
|
@@ -6623,7 +6587,8 @@ const FormModalNavigationProvider = ({ children }) => {
|
|
|
6623
6587
|
targetUid,
|
|
6624
6588
|
attributeName,
|
|
6625
6589
|
attributeType,
|
|
6626
|
-
isOpen: true
|
|
6590
|
+
isOpen: true,
|
|
6591
|
+
activeTab: "basic"
|
|
6627
6592
|
};
|
|
6628
6593
|
});
|
|
6629
6594
|
};
|
|
@@ -6657,7 +6622,8 @@ const FormModalNavigationProvider = ({ children }) => {
|
|
|
6657
6622
|
forTarget,
|
|
6658
6623
|
targetUid,
|
|
6659
6624
|
kind,
|
|
6660
|
-
isOpen: true
|
|
6625
|
+
isOpen: true,
|
|
6626
|
+
activeTab: "basic"
|
|
6661
6627
|
};
|
|
6662
6628
|
});
|
|
6663
6629
|
};
|
|
@@ -6670,7 +6636,8 @@ const FormModalNavigationProvider = ({ children }) => {
|
|
|
6670
6636
|
...prev,
|
|
6671
6637
|
forTarget,
|
|
6672
6638
|
targetUid,
|
|
6673
|
-
modalType: "chooseAttribute"
|
|
6639
|
+
modalType: "chooseAttribute",
|
|
6640
|
+
activeTab: "basic"
|
|
6674
6641
|
};
|
|
6675
6642
|
});
|
|
6676
6643
|
};
|
|
@@ -6680,7 +6647,8 @@ const FormModalNavigationProvider = ({ children }) => {
|
|
|
6680
6647
|
...prev,
|
|
6681
6648
|
attributeType: "component",
|
|
6682
6649
|
modalType: "attribute",
|
|
6683
|
-
step: "2"
|
|
6650
|
+
step: "2",
|
|
6651
|
+
activeTab: "basic"
|
|
6684
6652
|
};
|
|
6685
6653
|
});
|
|
6686
6654
|
};
|
|
@@ -6693,7 +6661,16 @@ const FormModalNavigationProvider = ({ children }) => {
|
|
|
6693
6661
|
actionType: "create",
|
|
6694
6662
|
step: "1",
|
|
6695
6663
|
attributeType: null,
|
|
6696
|
-
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
|
|
6697
6674
|
};
|
|
6698
6675
|
});
|
|
6699
6676
|
};
|
|
@@ -6715,17 +6692,18 @@ const FormModalNavigationProvider = ({ children }) => {
|
|
|
6715
6692
|
onOpenModalEditField,
|
|
6716
6693
|
onOpenModalEditCustomField,
|
|
6717
6694
|
onOpenModalEditSchema,
|
|
6718
|
-
setFormModalNavigationState
|
|
6695
|
+
setFormModalNavigationState,
|
|
6696
|
+
setActiveTab
|
|
6719
6697
|
},
|
|
6720
6698
|
children
|
|
6721
6699
|
}
|
|
6722
6700
|
);
|
|
6723
6701
|
};
|
|
6724
|
-
const ListView$1 = React.lazy(() => Promise.resolve().then(() => require("./ListView-
|
|
6702
|
+
const ListView$1 = React.lazy(() => Promise.resolve().then(() => require("./ListView-LfXjdWfW.js")));
|
|
6725
6703
|
const RecursivePath = () => {
|
|
6726
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, {}) }) }) });
|
|
6727
6705
|
};
|
|
6728
|
-
const ListView = React.lazy(() => Promise.resolve().then(() => require("./ListView-
|
|
6706
|
+
const ListView = React.lazy(() => Promise.resolve().then(() => require("./ListView-LfXjdWfW.js")));
|
|
6729
6707
|
const App = () => {
|
|
6730
6708
|
const { formatMessage } = reactIntl.useIntl();
|
|
6731
6709
|
const title = formatMessage({
|
|
@@ -6741,7 +6719,7 @@ const App = () => {
|
|
|
6741
6719
|
}, []);
|
|
6742
6720
|
return /* @__PURE__ */ jsxRuntime.jsxs(strapiAdmin.Page.Protect, { permissions: index$1.PERMISSIONS.main, children: [
|
|
6743
6721
|
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Title, { children: title }),
|
|
6744
|
-
/* @__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: [
|
|
6745
6723
|
/* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { path: "content-types/:uid", element: /* @__PURE__ */ jsxRuntime.jsx(ListView, {}) }),
|
|
6746
6724
|
/* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { path: `component-categories/:categoryUid/*`, element: /* @__PURE__ */ jsxRuntime.jsx(RecursivePath, {}) })
|
|
6747
6725
|
] }) }) }) }) }) })
|
|
@@ -6757,4 +6735,4 @@ exports.getTrad = getTrad;
|
|
|
6757
6735
|
exports.index = index;
|
|
6758
6736
|
exports.useDataManager = useDataManager;
|
|
6759
6737
|
exports.useFormModalNavigation = useFormModalNavigation;
|
|
6760
|
-
//# sourceMappingURL=index-
|
|
6738
|
+
//# sourceMappingURL=index-BrsV2OKM.js.map
|