@strapi/content-type-builder 5.0.0-rc.2 → 5.0.0-rc.21
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-XE65NvP8.js → ListView-BJkF062E.js} +21 -16
- package/dist/_chunks/ListView-BJkF062E.js.map +1 -0
- package/dist/_chunks/{ListView-yYLey9cN.mjs → ListView-ChHlVW9E.mjs} +21 -16
- package/dist/_chunks/ListView-ChHlVW9E.mjs.map +1 -0
- package/dist/_chunks/{index-BUl4iZYG.mjs → index-CclXDFWL.mjs} +10 -9
- package/dist/_chunks/{index-BUl4iZYG.mjs.map → index-CclXDFWL.mjs.map} +1 -1
- package/dist/_chunks/{index--5pQbGLD.js → index-DJuRylRg.js} +170 -60
- package/dist/_chunks/index-DJuRylRg.js.map +1 -0
- package/dist/_chunks/{index-b5GKS0j7.mjs → index-DoESWWlo.mjs} +171 -61
- package/dist/_chunks/index-DoESWWlo.mjs.map +1 -0
- package/dist/_chunks/{index-CcKr65ti.js → index-DrmFbRLA.js} +10 -9
- package/dist/_chunks/{index-CcKr65ti.js.map → index-DrmFbRLA.js.map} +1 -1
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- 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/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-XE65NvP8.js.map +0 -1
- package/dist/_chunks/ListView-yYLey9cN.mjs.map +0 -1
- package/dist/_chunks/index--5pQbGLD.js.map +0 -1
- package/dist/_chunks/index-b5GKS0j7.mjs.map +0 -1
- package/strapi-server.js +0 -3
|
@@ -4,13 +4,13 @@ import { createContext, useContext, useState, Fragment, useRef, useEffect, memo,
|
|
|
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
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, SubNav, SubNavHeader, SubNavSections, SubNavSection, SubNavLinkSection,
|
|
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";
|
|
8
8
|
import * as Icons from "@strapi/icons";
|
|
9
9
|
import { ArrowClockwise, Clock, Plus, Sparkle, ArrowLeft, Search, Trash, Eye, EyeStriked, OneWay, OneToOne, OneToMany, ManyToOne, ManyToMany, ManyWays } from "@strapi/icons";
|
|
10
10
|
import { createPortal } from "react-dom";
|
|
11
11
|
import { keyframes, styled } from "styled-components";
|
|
12
12
|
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-
|
|
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-CclXDFWL.mjs";
|
|
14
14
|
import isEqual from "lodash/isEqual";
|
|
15
15
|
import get from "lodash/get";
|
|
16
16
|
import groupBy from "lodash/groupBy";
|
|
@@ -338,6 +338,17 @@ const useContentTypeBuilderMenu = () => {
|
|
|
338
338
|
onSearchChange: setSearch
|
|
339
339
|
};
|
|
340
340
|
};
|
|
341
|
+
const SubNavLinkCustom = styled(SubNavLink)`
|
|
342
|
+
div {
|
|
343
|
+
width: inherit;
|
|
344
|
+
span:nth-child(2) {
|
|
345
|
+
white-space: nowrap;
|
|
346
|
+
overflow: hidden;
|
|
347
|
+
text-overflow: ellipsis;
|
|
348
|
+
width: inherit;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
`;
|
|
341
352
|
const ContentTypeBuilderNav = () => {
|
|
342
353
|
const { menu, searchValue, onSearchChange } = useContentTypeBuilderMenu();
|
|
343
354
|
const { formatMessage } = useIntl();
|
|
@@ -386,7 +397,17 @@ const ContentTypeBuilderNav = () => {
|
|
|
386
397
|
subLink.name
|
|
387
398
|
)) }, link.name);
|
|
388
399
|
}
|
|
389
|
-
return /* @__PURE__ */ jsx(
|
|
400
|
+
return /* @__PURE__ */ jsx(
|
|
401
|
+
SubNavLinkCustom,
|
|
402
|
+
{
|
|
403
|
+
tag: NavLink,
|
|
404
|
+
to: link.to,
|
|
405
|
+
active: link.active,
|
|
406
|
+
width: "100%",
|
|
407
|
+
children: upperFirst(formatMessage({ id: link.name, defaultMessage: link.title }))
|
|
408
|
+
},
|
|
409
|
+
link.name
|
|
410
|
+
);
|
|
390
411
|
})
|
|
391
412
|
}
|
|
392
413
|
),
|
|
@@ -565,7 +586,7 @@ const AttributeOption = ({ type = "text" }) => {
|
|
|
565
586
|
const AttributeList = ({ attributes }) => /* @__PURE__ */ jsx(KeyboardNavigable, { tagName: "button", children: /* @__PURE__ */ jsx(Flex, { direction: "column", alignItems: "stretch", gap: 8, children: attributes.map((attributeRow, index2) => {
|
|
566
587
|
return (
|
|
567
588
|
// eslint-disable-next-line react/no-array-index-key
|
|
568
|
-
/* @__PURE__ */ jsx(Grid.Root, { gap: 3, children: attributeRow.map((attribute) => /* @__PURE__ */ jsx(Grid.Item, { col: 6, children: /* @__PURE__ */ jsx(AttributeOption, { type: attribute }) }, attribute)) }, index2)
|
|
589
|
+
/* @__PURE__ */ jsx(Grid.Root, { gap: 3, children: attributeRow.map((attribute) => /* @__PURE__ */ jsx(Grid.Item, { col: 6, direction: "column", alignItems: "stretch", children: /* @__PURE__ */ jsx(AttributeOption, { type: attribute }) }, attribute)) }, index2)
|
|
569
590
|
);
|
|
570
591
|
}) }) });
|
|
571
592
|
const CustomFieldOption = ({ customFieldUid, customField }) => {
|
|
@@ -646,7 +667,7 @@ const CustomFieldsList = () => {
|
|
|
646
667
|
(a, b) => a[1].name > b[1].name ? 1 : -1
|
|
647
668
|
);
|
|
648
669
|
return /* @__PURE__ */ jsx(KeyboardNavigable, { tagName: "button", children: /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "stretch", gap: 3, children: [
|
|
649
|
-
/* @__PURE__ */ jsx(Grid.Root, { gap: 3, children: sortedCustomFields.map(([uid, customField]) => /* @__PURE__ */ jsx(Grid.Item, { col: 6, children: /* @__PURE__ */ jsx(CustomFieldOption, { customFieldUid: uid, customField }, uid) }, uid)) }),
|
|
670
|
+
/* @__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)) }),
|
|
650
671
|
/* @__PURE__ */ jsx(
|
|
651
672
|
Link,
|
|
652
673
|
{
|
|
@@ -718,6 +739,9 @@ const Wrapper$1 = styled(Flex)`
|
|
|
718
739
|
cursor: pointer;
|
|
719
740
|
user-select: none;
|
|
720
741
|
flex: 1;
|
|
742
|
+
border-radius: 4px;
|
|
743
|
+
border: 1px solid ${({ theme }) => theme.colors.neutral200};
|
|
744
|
+
|
|
721
745
|
${inputFocusStyle()}
|
|
722
746
|
}
|
|
723
747
|
|
|
@@ -729,7 +753,6 @@ const Wrapper$1 = styled(Flex)`
|
|
|
729
753
|
.option {
|
|
730
754
|
height: 100%;
|
|
731
755
|
border-radius: 4px;
|
|
732
|
-
border: 1px solid ${({ theme }) => theme.colors.neutral200};
|
|
733
756
|
will-change: transform, opacity;
|
|
734
757
|
background: ${({ theme }) => theme.colors.neutral0};
|
|
735
758
|
|
|
@@ -766,7 +789,6 @@ const Wrapper$1 = styled(Flex)`
|
|
|
766
789
|
.container input:checked ~ div {
|
|
767
790
|
background: ${({ theme }) => theme.colors.primary100};
|
|
768
791
|
color: ${({ theme }) => theme.colors.primary600};
|
|
769
|
-
border: 1px solid ${({ theme }) => theme.colors.primary200};
|
|
770
792
|
.checkmark {
|
|
771
793
|
border: solid 1px ${({ theme }) => theme.colors.primary600};
|
|
772
794
|
&::after {
|
|
@@ -932,10 +954,19 @@ const DraftAndPublishToggle = ({
|
|
|
932
954
|
/* @__PURE__ */ jsx(Checkbox, { checked: value, disabled, onCheckedChange: handleChange, children: label }),
|
|
933
955
|
/* @__PURE__ */ jsx(Field.Hint, {})
|
|
934
956
|
] }),
|
|
935
|
-
/* @__PURE__ */ jsx(Dialog.Root, { open: showWarning, onOpenChange: (isOpen) => setShowWarning(isOpen), children: /* @__PURE__ */ jsx(
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
957
|
+
/* @__PURE__ */ jsx(Dialog.Root, { open: showWarning, onOpenChange: (isOpen) => setShowWarning(isOpen), children: /* @__PURE__ */ jsx(
|
|
958
|
+
ConfirmDialog,
|
|
959
|
+
{
|
|
960
|
+
endAction: /* @__PURE__ */ jsx(Button, { onClick: handleConfirm, variant: "danger", width: "100%", justifyContent: "center", children: formatMessage({
|
|
961
|
+
id: getTrad("popUpWarning.draft-publish.button.confirm"),
|
|
962
|
+
defaultMessage: "Yes, disable"
|
|
963
|
+
}) }),
|
|
964
|
+
children: formatMessage({
|
|
965
|
+
id: getTrad("popUpWarning.draft-publish.message"),
|
|
966
|
+
defaultMessage: "If you disable the draft & publish, your drafts will be deleted."
|
|
967
|
+
})
|
|
968
|
+
}
|
|
969
|
+
) })
|
|
939
970
|
] });
|
|
940
971
|
};
|
|
941
972
|
const FormModalEndActions = ({
|
|
@@ -1700,7 +1731,7 @@ const IconPicker = ({ intlLabel, name, onChange, value = "" }) => {
|
|
|
1700
1731
|
id: getTrad("IconPicker.search.button.label"),
|
|
1701
1732
|
defaultMessage: "Search icon button"
|
|
1702
1733
|
}),
|
|
1703
|
-
|
|
1734
|
+
variant: "ghost",
|
|
1704
1735
|
children: /* @__PURE__ */ jsx(Search, {})
|
|
1705
1736
|
}
|
|
1706
1737
|
),
|
|
@@ -1720,7 +1751,7 @@ const IconPicker = ({ intlLabel, name, onChange, value = "" }) => {
|
|
|
1720
1751
|
id: getTrad("IconPicker.remove.button"),
|
|
1721
1752
|
defaultMessage: "Remove the selected icon"
|
|
1722
1753
|
}),
|
|
1723
|
-
|
|
1754
|
+
variant: "ghost",
|
|
1724
1755
|
children: /* @__PURE__ */ jsx(Trash, {})
|
|
1725
1756
|
}
|
|
1726
1757
|
)
|
|
@@ -1801,6 +1832,49 @@ const PluralName = ({
|
|
|
1801
1832
|
/* @__PURE__ */ jsx(Field.Error, {})
|
|
1802
1833
|
] });
|
|
1803
1834
|
};
|
|
1835
|
+
const parseDateValue = (value) => {
|
|
1836
|
+
if (value instanceof Date && isValidDate(value)) {
|
|
1837
|
+
return value;
|
|
1838
|
+
}
|
|
1839
|
+
if (typeof value === "string" || typeof value === "number") {
|
|
1840
|
+
const date = new Date(value);
|
|
1841
|
+
if (isValidDate(date)) {
|
|
1842
|
+
return date;
|
|
1843
|
+
}
|
|
1844
|
+
}
|
|
1845
|
+
};
|
|
1846
|
+
const isValidDate = (date) => !isNaN(date.getTime());
|
|
1847
|
+
const removeSeconds = (time) => {
|
|
1848
|
+
const [hours, minutes] = time.split(":");
|
|
1849
|
+
return `${hours}:${minutes}`;
|
|
1850
|
+
};
|
|
1851
|
+
const addSecondsAndMilliseconds = (time) => {
|
|
1852
|
+
return time.split(":").length === 2 ? `${time}:00.000` : time;
|
|
1853
|
+
};
|
|
1854
|
+
const formatTimeForInput = (value) => {
|
|
1855
|
+
if (!value)
|
|
1856
|
+
return;
|
|
1857
|
+
return value.split(":").length > 2 ? removeSeconds(value) : value;
|
|
1858
|
+
};
|
|
1859
|
+
const formatTimeForOutput = (value) => {
|
|
1860
|
+
if (!value)
|
|
1861
|
+
return void 0;
|
|
1862
|
+
return addSecondsAndMilliseconds(value);
|
|
1863
|
+
};
|
|
1864
|
+
const handleTimeChange = ({ value }) => {
|
|
1865
|
+
const formattedInputTime = formatTimeForInput(value);
|
|
1866
|
+
return formattedInputTime;
|
|
1867
|
+
};
|
|
1868
|
+
const handleTimeChangeEvent = (onChange, name, type, time) => {
|
|
1869
|
+
const formattedOutputTime = formatTimeForOutput(time);
|
|
1870
|
+
onChange({
|
|
1871
|
+
target: {
|
|
1872
|
+
name,
|
|
1873
|
+
value: formattedOutputTime,
|
|
1874
|
+
type
|
|
1875
|
+
}
|
|
1876
|
+
});
|
|
1877
|
+
};
|
|
1804
1878
|
const GenericInput = ({
|
|
1805
1879
|
autoComplete,
|
|
1806
1880
|
customInputs,
|
|
@@ -1952,6 +2026,7 @@ const GenericInput = ({
|
|
|
1952
2026
|
);
|
|
1953
2027
|
}
|
|
1954
2028
|
case "datetime": {
|
|
2029
|
+
const dateValue = parseDateValue(value);
|
|
1955
2030
|
return /* @__PURE__ */ jsx(
|
|
1956
2031
|
DateTimePicker,
|
|
1957
2032
|
{
|
|
@@ -1963,11 +2038,12 @@ const GenericInput = ({
|
|
|
1963
2038
|
},
|
|
1964
2039
|
onClear: () => onChange({ target: { name, value: null, type } }),
|
|
1965
2040
|
placeholder: formattedPlaceholder,
|
|
1966
|
-
value
|
|
2041
|
+
value: dateValue
|
|
1967
2042
|
}
|
|
1968
2043
|
);
|
|
1969
2044
|
}
|
|
1970
2045
|
case "date": {
|
|
2046
|
+
const dateValue = parseDateValue(value);
|
|
1971
2047
|
return /* @__PURE__ */ jsx(
|
|
1972
2048
|
DatePicker,
|
|
1973
2049
|
{
|
|
@@ -1984,7 +2060,7 @@ const GenericInput = ({
|
|
|
1984
2060
|
},
|
|
1985
2061
|
onClear: () => onChange({ target: { name, value: null, type } }),
|
|
1986
2062
|
placeholder: formattedPlaceholder,
|
|
1987
|
-
value
|
|
2063
|
+
value: dateValue
|
|
1988
2064
|
}
|
|
1989
2065
|
);
|
|
1990
2066
|
}
|
|
@@ -2096,23 +2172,15 @@ const GenericInput = ({
|
|
|
2096
2172
|
);
|
|
2097
2173
|
}
|
|
2098
2174
|
case "time": {
|
|
2099
|
-
|
|
2100
|
-
if (typeof value === "string" && value.split(":").length > 2) {
|
|
2101
|
-
const [hour, minute] = value.split(":");
|
|
2102
|
-
time = `${hour}:${minute}`;
|
|
2103
|
-
}
|
|
2175
|
+
const formattedValue = handleTimeChange({ value, onChange, name, type });
|
|
2104
2176
|
return /* @__PURE__ */ jsx(
|
|
2105
2177
|
TimePicker,
|
|
2106
2178
|
{
|
|
2107
2179
|
clearLabel: formatMessage({ id: "clearLabel", defaultMessage: "Clear" }),
|
|
2108
2180
|
disabled,
|
|
2109
|
-
onChange: (
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
onClear: () => {
|
|
2113
|
-
onChange({ target: { name, value: null, type } });
|
|
2114
|
-
},
|
|
2115
|
-
value: time
|
|
2181
|
+
onChange: (time) => handleTimeChangeEvent(onChange, name, type, time),
|
|
2182
|
+
onClear: () => handleTimeChangeEvent(onChange, name, type, void 0),
|
|
2183
|
+
value: formattedValue
|
|
2116
2184
|
}
|
|
2117
2185
|
);
|
|
2118
2186
|
}
|
|
@@ -2252,9 +2320,11 @@ const RelationTargetPicker = ({
|
|
|
2252
2320
|
] });
|
|
2253
2321
|
};
|
|
2254
2322
|
const MenuTrigger = styled(Menu.Trigger)`
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2323
|
+
max-width: 16.8rem;
|
|
2324
|
+
span {
|
|
2325
|
+
white-space: nowrap;
|
|
2326
|
+
overflow: hidden;
|
|
2327
|
+
text-overflow: ellipsis;
|
|
2258
2328
|
}
|
|
2259
2329
|
`;
|
|
2260
2330
|
const RelationFormBox = ({
|
|
@@ -2805,18 +2875,36 @@ const TabForm = ({
|
|
|
2805
2875
|
null
|
|
2806
2876
|
);
|
|
2807
2877
|
if (input.type === "pushRight") {
|
|
2808
|
-
return /* @__PURE__ */ jsx(
|
|
2878
|
+
return /* @__PURE__ */ jsx(
|
|
2879
|
+
Grid.Item,
|
|
2880
|
+
{
|
|
2881
|
+
col: input.size || 6,
|
|
2882
|
+
direction: "column",
|
|
2883
|
+
alignItems: "stretch",
|
|
2884
|
+
children: /* @__PURE__ */ jsx("div", {})
|
|
2885
|
+
},
|
|
2886
|
+
input.name || key
|
|
2887
|
+
);
|
|
2809
2888
|
}
|
|
2810
|
-
return /* @__PURE__ */ jsx(
|
|
2811
|
-
|
|
2889
|
+
return /* @__PURE__ */ jsx(
|
|
2890
|
+
Grid.Item,
|
|
2812
2891
|
{
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2892
|
+
col: input.size || 6,
|
|
2893
|
+
direction: "column",
|
|
2894
|
+
alignItems: "stretch",
|
|
2895
|
+
children: /* @__PURE__ */ jsx(
|
|
2896
|
+
MemoizedGenericInput,
|
|
2897
|
+
{
|
|
2898
|
+
...input,
|
|
2899
|
+
...genericInputProps,
|
|
2900
|
+
error: errorId,
|
|
2901
|
+
onChange,
|
|
2902
|
+
value
|
|
2903
|
+
}
|
|
2904
|
+
)
|
|
2905
|
+
},
|
|
2906
|
+
input.name || key
|
|
2907
|
+
);
|
|
2820
2908
|
}) })
|
|
2821
2909
|
] }, sectionIndex);
|
|
2822
2910
|
}) });
|
|
@@ -5007,9 +5095,10 @@ const FormModal = () => {
|
|
|
5007
5095
|
kind,
|
|
5008
5096
|
step,
|
|
5009
5097
|
targetUid,
|
|
5010
|
-
showBackLink
|
|
5098
|
+
showBackLink,
|
|
5099
|
+
activeTab,
|
|
5100
|
+
setActiveTab
|
|
5011
5101
|
} = useFormModalNavigation();
|
|
5012
|
-
const [activeTab, setActiveTab] = React.useState("basic");
|
|
5013
5102
|
const getPlugin = useStrapiApp("FormModal", (state) => state.getPlugin);
|
|
5014
5103
|
const getCustomField = useStrapiApp("FormModal", (state) => state.customFields.get);
|
|
5015
5104
|
const customField = getCustomField(customFieldUid);
|
|
@@ -6070,7 +6159,7 @@ const DataManagerProvider = ({ children }) => {
|
|
|
6070
6159
|
} = useSelector(makeSelectDataManagerProvider());
|
|
6071
6160
|
const { toggleNotification } = useNotification();
|
|
6072
6161
|
const { lockAppWithAutoreload, unlockAppWithAutoreload } = useAutoReloadOverlayBlocker();
|
|
6073
|
-
const setCurrentStep = useGuidedTour("DataManagerProvider", (state) => state
|
|
6162
|
+
const { setCurrentStep, setStepState } = useGuidedTour("DataManagerProvider", (state) => state);
|
|
6074
6163
|
const getPlugin = useStrapiApp("DataManagerProvider", (state) => state.getPlugin);
|
|
6075
6164
|
const plugin = getPlugin(pluginId);
|
|
6076
6165
|
const autoReload = useAppInfo("DataManagerProvider", (state) => state.autoReload);
|
|
@@ -6399,10 +6488,10 @@ const DataManagerProvider = ({ children }) => {
|
|
|
6399
6488
|
} else {
|
|
6400
6489
|
await put(requestURL, body);
|
|
6401
6490
|
}
|
|
6402
|
-
await serverRestartWatcher(true);
|
|
6403
|
-
unlockAppWithAutoreload?.();
|
|
6404
6491
|
if (isCreating && (initialData.contentType?.schema.kind === "collectionType" || initialData.contentType?.schema.kind === "singleType")) {
|
|
6405
|
-
|
|
6492
|
+
setStepState("contentTypeBuilder.success", true);
|
|
6493
|
+
trackUsage("didCreateGuidedTourCollectionType");
|
|
6494
|
+
setCurrentStep(null);
|
|
6406
6495
|
}
|
|
6407
6496
|
if (isInContentTypeView) {
|
|
6408
6497
|
trackUsage("didSaveContentType");
|
|
@@ -6414,6 +6503,8 @@ const DataManagerProvider = ({ children }) => {
|
|
|
6414
6503
|
} else {
|
|
6415
6504
|
trackUsage("didSaveComponent");
|
|
6416
6505
|
}
|
|
6506
|
+
await serverRestartWatcher(true);
|
|
6507
|
+
unlockAppWithAutoreload?.();
|
|
6417
6508
|
await getDataRef.current();
|
|
6418
6509
|
dispatch({ type: UPDATE_INITIAL_STATE });
|
|
6419
6510
|
await updatePermissions();
|
|
@@ -6493,7 +6584,8 @@ const INITIAL_STATE_DATA = {
|
|
|
6493
6584
|
kind: null,
|
|
6494
6585
|
step: null,
|
|
6495
6586
|
targetUid: null,
|
|
6496
|
-
customFieldUid: null
|
|
6587
|
+
customFieldUid: null,
|
|
6588
|
+
activeTab: "basic"
|
|
6497
6589
|
};
|
|
6498
6590
|
const FormModalNavigationProvider = ({ children }) => {
|
|
6499
6591
|
const [state, setFormModalNavigationState] = React.useState(INITIAL_STATE_DATA);
|
|
@@ -6505,7 +6597,8 @@ const FormModalNavigationProvider = ({ children }) => {
|
|
|
6505
6597
|
actionType: "create",
|
|
6506
6598
|
modalType: "customField",
|
|
6507
6599
|
attributeType,
|
|
6508
|
-
customFieldUid
|
|
6600
|
+
customFieldUid,
|
|
6601
|
+
activeTab: "basic"
|
|
6509
6602
|
};
|
|
6510
6603
|
});
|
|
6511
6604
|
};
|
|
@@ -6520,7 +6613,8 @@ const FormModalNavigationProvider = ({ children }) => {
|
|
|
6520
6613
|
modalType: "attribute",
|
|
6521
6614
|
step,
|
|
6522
6615
|
attributeType,
|
|
6523
|
-
showBackLink: true
|
|
6616
|
+
showBackLink: true,
|
|
6617
|
+
activeTab: "basic"
|
|
6524
6618
|
};
|
|
6525
6619
|
});
|
|
6526
6620
|
};
|
|
@@ -6547,13 +6641,14 @@ const FormModalNavigationProvider = ({ children }) => {
|
|
|
6547
6641
|
targetUid,
|
|
6548
6642
|
modalType: "chooseAttribute",
|
|
6549
6643
|
isOpen: true,
|
|
6550
|
-
showBackLink: false
|
|
6644
|
+
showBackLink: false,
|
|
6645
|
+
activeTab: "basic"
|
|
6551
6646
|
};
|
|
6552
6647
|
});
|
|
6553
6648
|
};
|
|
6554
6649
|
const onOpenModalCreateSchema = (nextState) => {
|
|
6555
6650
|
setFormModalNavigationState((prevState) => {
|
|
6556
|
-
return { ...prevState, ...nextState, isOpen: true };
|
|
6651
|
+
return { ...prevState, ...nextState, isOpen: true, activeTab: "basic" };
|
|
6557
6652
|
});
|
|
6558
6653
|
};
|
|
6559
6654
|
const onOpenModalEditCategory = (categoryName) => {
|
|
@@ -6563,7 +6658,8 @@ const FormModalNavigationProvider = ({ children }) => {
|
|
|
6563
6658
|
categoryName,
|
|
6564
6659
|
actionType: "edit",
|
|
6565
6660
|
modalType: "editCategory",
|
|
6566
|
-
isOpen: true
|
|
6661
|
+
isOpen: true,
|
|
6662
|
+
activeTab: "basic"
|
|
6567
6663
|
};
|
|
6568
6664
|
});
|
|
6569
6665
|
};
|
|
@@ -6584,7 +6680,8 @@ const FormModalNavigationProvider = ({ children }) => {
|
|
|
6584
6680
|
targetUid,
|
|
6585
6681
|
attributeName,
|
|
6586
6682
|
attributeType,
|
|
6587
|
-
isOpen: true
|
|
6683
|
+
isOpen: true,
|
|
6684
|
+
activeTab: "basic"
|
|
6588
6685
|
};
|
|
6589
6686
|
});
|
|
6590
6687
|
};
|
|
@@ -6618,7 +6715,8 @@ const FormModalNavigationProvider = ({ children }) => {
|
|
|
6618
6715
|
forTarget,
|
|
6619
6716
|
targetUid,
|
|
6620
6717
|
kind,
|
|
6621
|
-
isOpen: true
|
|
6718
|
+
isOpen: true,
|
|
6719
|
+
activeTab: "basic"
|
|
6622
6720
|
};
|
|
6623
6721
|
});
|
|
6624
6722
|
};
|
|
@@ -6631,7 +6729,8 @@ const FormModalNavigationProvider = ({ children }) => {
|
|
|
6631
6729
|
...prev,
|
|
6632
6730
|
forTarget,
|
|
6633
6731
|
targetUid,
|
|
6634
|
-
modalType: "chooseAttribute"
|
|
6732
|
+
modalType: "chooseAttribute",
|
|
6733
|
+
activeTab: "basic"
|
|
6635
6734
|
};
|
|
6636
6735
|
});
|
|
6637
6736
|
};
|
|
@@ -6641,7 +6740,8 @@ const FormModalNavigationProvider = ({ children }) => {
|
|
|
6641
6740
|
...prev,
|
|
6642
6741
|
attributeType: "component",
|
|
6643
6742
|
modalType: "attribute",
|
|
6644
|
-
step: "2"
|
|
6743
|
+
step: "2",
|
|
6744
|
+
activeTab: "basic"
|
|
6645
6745
|
};
|
|
6646
6746
|
});
|
|
6647
6747
|
};
|
|
@@ -6654,7 +6754,16 @@ const FormModalNavigationProvider = ({ children }) => {
|
|
|
6654
6754
|
actionType: "create",
|
|
6655
6755
|
step: "1",
|
|
6656
6756
|
attributeType: null,
|
|
6657
|
-
attributeName: null
|
|
6757
|
+
attributeName: null,
|
|
6758
|
+
activeTab: "basic"
|
|
6759
|
+
};
|
|
6760
|
+
});
|
|
6761
|
+
};
|
|
6762
|
+
const setActiveTab = (value) => {
|
|
6763
|
+
setFormModalNavigationState((prev) => {
|
|
6764
|
+
return {
|
|
6765
|
+
...prev,
|
|
6766
|
+
activeTab: value
|
|
6658
6767
|
};
|
|
6659
6768
|
});
|
|
6660
6769
|
};
|
|
@@ -6676,17 +6785,18 @@ const FormModalNavigationProvider = ({ children }) => {
|
|
|
6676
6785
|
onOpenModalEditField,
|
|
6677
6786
|
onOpenModalEditCustomField,
|
|
6678
6787
|
onOpenModalEditSchema,
|
|
6679
|
-
setFormModalNavigationState
|
|
6788
|
+
setFormModalNavigationState,
|
|
6789
|
+
setActiveTab
|
|
6680
6790
|
},
|
|
6681
6791
|
children
|
|
6682
6792
|
}
|
|
6683
6793
|
);
|
|
6684
6794
|
};
|
|
6685
|
-
const ListView$1 = lazy(() => import("./ListView-
|
|
6795
|
+
const ListView$1 = lazy(() => import("./ListView-ChHlVW9E.mjs"));
|
|
6686
6796
|
const RecursivePath = () => {
|
|
6687
6797
|
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Page.Loading, {}), children: /* @__PURE__ */ jsx(Routes, { children: /* @__PURE__ */ jsx(Route, { path: `/:componentUid`, element: /* @__PURE__ */ jsx(ListView$1, {}) }) }) });
|
|
6688
6798
|
};
|
|
6689
|
-
const ListView = lazy(() => import("./ListView-
|
|
6799
|
+
const ListView = lazy(() => import("./ListView-ChHlVW9E.mjs"));
|
|
6690
6800
|
const App = () => {
|
|
6691
6801
|
const { formatMessage } = useIntl();
|
|
6692
6802
|
const title = formatMessage({
|
|
@@ -6720,4 +6830,4 @@ export {
|
|
|
6720
6830
|
index as i,
|
|
6721
6831
|
useDataManager as u
|
|
6722
6832
|
};
|
|
6723
|
-
//# sourceMappingURL=index-
|
|
6833
|
+
//# sourceMappingURL=index-DoESWWlo.mjs.map
|