@strapi/content-manager 5.0.0-rc.2 → 5.0.0-rc.20
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/{ComponentConfigurationPage-Bv-IXOYu.js → ComponentConfigurationPage-DnnZJc1F.js} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-Bv-IXOYu.js.map → ComponentConfigurationPage-DnnZJc1F.js.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-BxJCkKZV.mjs → ComponentConfigurationPage-hLMNf7KI.mjs} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-BxJCkKZV.mjs.map → ComponentConfigurationPage-hLMNf7KI.mjs.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-QZl5zOz-.js → EditConfigurationPage-CpLj5gYZ.js} +3 -3
- package/dist/_chunks/{EditConfigurationPage-QZl5zOz-.js.map → EditConfigurationPage-CpLj5gYZ.js.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-BGwHNypQ.mjs → EditConfigurationPage-Dh6sq-G4.mjs} +3 -3
- package/dist/_chunks/{EditConfigurationPage-BGwHNypQ.mjs.map → EditConfigurationPage-Dh6sq-G4.mjs.map} +1 -1
- package/dist/_chunks/{EditViewPage-CtdtssrH.mjs → EditViewPage-BU1ugeVi.mjs} +19 -8
- package/dist/_chunks/EditViewPage-BU1ugeVi.mjs.map +1 -0
- package/dist/_chunks/{EditViewPage-DxKueadW.js → EditViewPage-D2QVRr_2.js} +19 -8
- package/dist/_chunks/EditViewPage-D2QVRr_2.js.map +1 -0
- package/dist/_chunks/{Field-BPw8fE3W.js → Field-BEDX9i_V.js} +120 -92
- package/dist/_chunks/Field-BEDX9i_V.js.map +1 -0
- package/dist/_chunks/{Field-BU7_nR4F.mjs → Field-VSPY6uzs.mjs} +118 -90
- package/dist/_chunks/Field-VSPY6uzs.mjs.map +1 -0
- package/dist/_chunks/{Form-ffghBTPI.mjs → Form-05Oaes1N.mjs} +35 -16
- package/dist/_chunks/Form-05Oaes1N.mjs.map +1 -0
- package/dist/_chunks/{Form-DtvmbGdZ.js → Form-DCaY8xBX.js} +35 -16
- package/dist/_chunks/Form-DCaY8xBX.js.map +1 -0
- package/dist/_chunks/{History-D6PRyNcx.mjs → History-BqO2G3MV.mjs} +4 -4
- package/dist/_chunks/{History-D6PRyNcx.mjs.map → History-BqO2G3MV.mjs.map} +1 -1
- package/dist/_chunks/{History-CSr8y9KM.js → History-BrJ1tUvt.js} +4 -4
- package/dist/_chunks/{History-CSr8y9KM.js.map → History-BrJ1tUvt.js.map} +1 -1
- package/dist/_chunks/{ListConfigurationPage-BC9bCi9k.mjs → ListConfigurationPage-C6rsFlme.mjs} +14 -4
- package/dist/_chunks/ListConfigurationPage-C6rsFlme.mjs.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-DsmAQ3YM.js → ListConfigurationPage-Eane5LKE.js} +14 -4
- package/dist/_chunks/ListConfigurationPage-Eane5LKE.js.map +1 -0
- package/dist/_chunks/{ListViewPage-DqAIb_ie.js → ListViewPage-Coj-RPsx.js} +49 -40
- package/dist/_chunks/ListViewPage-Coj-RPsx.js.map +1 -0
- package/dist/_chunks/{ListViewPage-B1GyNqfn.mjs → ListViewPage-yE_zYhcI.mjs} +47 -38
- package/dist/_chunks/ListViewPage-yE_zYhcI.mjs.map +1 -0
- package/dist/_chunks/{NoContentTypePage-xjvn5XwY.js → NoContentTypePage-BDJ0dshy.js} +2 -2
- package/dist/_chunks/{NoContentTypePage-xjvn5XwY.js.map → NoContentTypePage-BDJ0dshy.js.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-CJ-HJriz.mjs → NoContentTypePage-NW_FSVdY.mjs} +2 -2
- package/dist/_chunks/{NoContentTypePage-CJ-HJriz.mjs.map → NoContentTypePage-NW_FSVdY.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-DObTkKmZ.js → NoPermissionsPage-BOtb5FTM.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-DObTkKmZ.js.map → NoPermissionsPage-BOtb5FTM.js.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage--afHbbbD.mjs → NoPermissionsPage-h0I3ImsX.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage--afHbbbD.mjs.map → NoPermissionsPage-h0I3ImsX.mjs.map} +1 -1
- package/dist/_chunks/{Relations-t4Q0DpqW.js → Relations-CVh0DOKv.js} +4 -4
- package/dist/_chunks/{Relations-t4Q0DpqW.js.map → Relations-CVh0DOKv.js.map} +1 -1
- package/dist/_chunks/{Relations-heq-nLGU.mjs → Relations-FP0uWpBz.mjs} +4 -4
- package/dist/_chunks/{Relations-heq-nLGU.mjs.map → Relations-FP0uWpBz.mjs.map} +1 -1
- package/dist/_chunks/{en-uOUIxfcQ.js → en-BlhnxQfj.js} +7 -6
- package/dist/_chunks/{en-uOUIxfcQ.js.map → en-BlhnxQfj.js.map} +1 -1
- package/dist/_chunks/{en-BrCTWlZv.mjs → en-C8YBvRrK.mjs} +7 -6
- package/dist/_chunks/{en-BrCTWlZv.mjs.map → en-C8YBvRrK.mjs.map} +1 -1
- package/dist/_chunks/{index-BcQ8cRyl.mjs → index-CPCHQ3X_.mjs} +1927 -1765
- package/dist/_chunks/index-CPCHQ3X_.mjs.map +1 -0
- package/dist/_chunks/{index-1zxclxo_.js → index-DTKVhcla.js} +1907 -1745
- package/dist/_chunks/index-DTKVhcla.js.map +1 -0
- package/dist/_chunks/{layout-Jl9mJFJZ.mjs → layout-B4UhJ8MJ.mjs} +22 -9
- package/dist/_chunks/layout-B4UhJ8MJ.mjs.map +1 -0
- package/dist/_chunks/{layout-tVvbqota.js → layout-CWgZzMYf.js} +21 -8
- package/dist/_chunks/layout-CWgZzMYf.js.map +1 -0
- package/dist/_chunks/{relations-f4Pv7Kgo.mjs → relations-B83Ge9a7.mjs} +2 -2
- package/dist/_chunks/{relations-f4Pv7Kgo.mjs.map → relations-B83Ge9a7.mjs.map} +1 -1
- package/dist/_chunks/{relations-CK2Jd0HM.js → relations-D81a_2zw.js} +2 -2
- package/dist/_chunks/{relations-CK2Jd0HM.js.map → relations-D81a_2zw.js.map} +1 -1
- package/dist/_chunks/{usePrev-B9w_-eYc.js → useDebounce-CtcjDB3L.js} +14 -1
- package/dist/_chunks/useDebounce-CtcjDB3L.js.map +1 -0
- package/dist/_chunks/useDebounce-DmuSJIF3.mjs +29 -0
- package/dist/_chunks/useDebounce-DmuSJIF3.mjs.map +1 -0
- package/dist/admin/index.js +2 -1
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/index.mjs +5 -4
- package/dist/admin/src/exports.d.ts +1 -1
- package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
- package/dist/admin/src/hooks/useDocument.d.ts +30 -1
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.d.ts +2 -2
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygFooter.d.ts +2 -2
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +4 -48
- package/dist/admin/src/pages/EditView/components/Header.d.ts +10 -11
- package/dist/admin/src/services/api.d.ts +1 -1
- package/dist/admin/src/services/components.d.ts +2 -2
- package/dist/admin/src/services/contentTypes.d.ts +3 -3
- package/dist/admin/src/services/documents.d.ts +19 -17
- package/dist/admin/src/services/init.d.ts +1 -1
- package/dist/admin/src/services/relations.d.ts +2 -2
- package/dist/admin/src/services/uid.d.ts +3 -3
- package/dist/admin/src/utils/validation.d.ts +4 -1
- package/dist/server/index.js +147 -82
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +148 -83
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
- package/dist/server/src/controllers/relations.d.ts.map +1 -1
- package/dist/server/src/history/services/history.d.ts.map +1 -1
- package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
- package/dist/server/src/history/services/utils.d.ts +2 -1
- package/dist/server/src/history/services/utils.d.ts.map +1 -1
- package/dist/server/src/policies/hasPermissions.d.ts.map +1 -1
- package/dist/server/src/services/document-metadata.d.ts.map +1 -1
- package/dist/server/src/services/permission-checker.d.ts.map +1 -1
- package/dist/shared/contracts/collection-types.d.ts +3 -1
- package/dist/shared/contracts/collection-types.d.ts.map +1 -1
- package/package.json +11 -11
- package/dist/_chunks/EditViewPage-CtdtssrH.mjs.map +0 -1
- package/dist/_chunks/EditViewPage-DxKueadW.js.map +0 -1
- package/dist/_chunks/Field-BPw8fE3W.js.map +0 -1
- package/dist/_chunks/Field-BU7_nR4F.mjs.map +0 -1
- package/dist/_chunks/Form-DtvmbGdZ.js.map +0 -1
- package/dist/_chunks/Form-ffghBTPI.mjs.map +0 -1
- package/dist/_chunks/ListConfigurationPage-BC9bCi9k.mjs.map +0 -1
- package/dist/_chunks/ListConfigurationPage-DsmAQ3YM.js.map +0 -1
- package/dist/_chunks/ListViewPage-B1GyNqfn.mjs.map +0 -1
- package/dist/_chunks/ListViewPage-DqAIb_ie.js.map +0 -1
- package/dist/_chunks/index-1zxclxo_.js.map +0 -1
- package/dist/_chunks/index-BcQ8cRyl.mjs.map +0 -1
- package/dist/_chunks/layout-Jl9mJFJZ.mjs.map +0 -1
- package/dist/_chunks/layout-tVvbqota.js.map +0 -1
- package/dist/_chunks/usePrev-B9w_-eYc.js.map +0 -1
- package/dist/_chunks/usePrev-DH6iah0A.mjs +0 -16
- package/dist/_chunks/usePrev-DH6iah0A.mjs.map +0 -1
- package/strapi-server.js +0 -3
@@ -5,9 +5,9 @@ const strapiAdmin = require("@strapi/admin/strapi-admin");
|
|
5
5
|
const designSystem = require("@strapi/design-system");
|
6
6
|
const pipe$1 = require("lodash/fp/pipe");
|
7
7
|
const reactIntl = require("react-intl");
|
8
|
-
const index = require("./index-
|
8
|
+
const index = require("./index-DTKVhcla.js");
|
9
9
|
const fractionalIndexing = require("fractional-indexing");
|
10
|
-
const Relations = require("./Relations-
|
10
|
+
const Relations = require("./Relations-CVh0DOKv.js");
|
11
11
|
const Icons = require("@strapi/icons");
|
12
12
|
const styledComponents = require("styled-components");
|
13
13
|
const ComponentIcon = require("./ComponentIcon-BXdiCGQp.js");
|
@@ -17,7 +17,7 @@ const objects = require("./objects-gigeqt7s.js");
|
|
17
17
|
const slate = require("slate");
|
18
18
|
const slateHistory = require("slate-history");
|
19
19
|
const slateReact = require("slate-react");
|
20
|
-
const
|
20
|
+
const useDebounce = require("./useDebounce-CtcjDB3L.js");
|
21
21
|
const Toolbar = require("@radix-ui/react-toolbar");
|
22
22
|
const reactRouterDom = require("react-router-dom");
|
23
23
|
const CodeMirror = require("codemirror5");
|
@@ -768,7 +768,7 @@ const ImageDialog = () => {
|
|
768
768
|
const nodeImage = {
|
769
769
|
...expectedImage,
|
770
770
|
alternativeText: expectedImage.alternativeText || expectedImage.name,
|
771
|
-
url:
|
771
|
+
url: useDebounce.prefixFileUrlWithBackendUrl(image.url)
|
772
772
|
};
|
773
773
|
return nodeImage;
|
774
774
|
});
|
@@ -1441,7 +1441,7 @@ const ToolbarButton = ({
|
|
1441
1441
|
width: 7,
|
1442
1442
|
height: 7,
|
1443
1443
|
hasRadius: true,
|
1444
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, {
|
1444
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { fill: disabled ? "neutral300" : enabledColor })
|
1445
1445
|
}
|
1446
1446
|
)
|
1447
1447
|
}
|
@@ -1783,6 +1783,7 @@ const DragItem = styledComponents.styled(designSystem.Flex)`
|
|
1783
1783
|
}
|
1784
1784
|
`;
|
1785
1785
|
const DragIconButton = styledComponents.styled(designSystem.IconButton)`
|
1786
|
+
user-select: none;
|
1786
1787
|
display: flex;
|
1787
1788
|
align-items: center;
|
1788
1789
|
justify-content: center;
|
@@ -1911,6 +1912,7 @@ const DragAndDropElement = ({
|
|
1911
1912
|
DragIconButton,
|
1912
1913
|
{
|
1913
1914
|
tag: "div",
|
1915
|
+
contentEditable: false,
|
1914
1916
|
role: "button",
|
1915
1917
|
tabIndex: 0,
|
1916
1918
|
withTooltip: false,
|
@@ -2706,7 +2708,18 @@ const NonRepeatableComponent = ({
|
|
2706
2708
|
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 6, children: layout.map((row, index2) => {
|
2707
2709
|
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
2708
2710
|
const completeFieldName = `${name2}.${field.name}`;
|
2709
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
2711
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
2712
|
+
designSystem.Grid.Item,
|
2713
|
+
{
|
2714
|
+
col: size,
|
2715
|
+
s: 12,
|
2716
|
+
xs: 12,
|
2717
|
+
direction: "column",
|
2718
|
+
alignItems: "stretch",
|
2719
|
+
children: children({ ...field, name: completeFieldName })
|
2720
|
+
},
|
2721
|
+
completeFieldName
|
2722
|
+
);
|
2710
2723
|
}) }, index2);
|
2711
2724
|
}) })
|
2712
2725
|
}
|
@@ -2746,7 +2759,7 @@ const RepeatableComponent = ({
|
|
2746
2759
|
}
|
2747
2760
|
return void 0;
|
2748
2761
|
}, [search, name2, value]);
|
2749
|
-
const prevValue =
|
2762
|
+
const prevValue = useDebounce.usePrev(value);
|
2750
2763
|
React__namespace.useEffect(() => {
|
2751
2764
|
if (prevValue && prevValue.length < value.length) {
|
2752
2765
|
setCollapseToOpen(value[value.length - 1].__temp_key__);
|
@@ -2884,7 +2897,18 @@ const RepeatableComponent = ({
|
|
2884
2897
|
children: layout.map((row, index22) => {
|
2885
2898
|
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
2886
2899
|
const completeFieldName = `${nameWithIndex}.${field.name}`;
|
2887
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
2900
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
2901
|
+
designSystem.Grid.Item,
|
2902
|
+
{
|
2903
|
+
col: size,
|
2904
|
+
s: 12,
|
2905
|
+
xs: 12,
|
2906
|
+
direction: "column",
|
2907
|
+
alignItems: "stretch",
|
2908
|
+
children: children({ ...field, name: completeFieldName })
|
2909
|
+
},
|
2910
|
+
completeFieldName
|
2911
|
+
);
|
2888
2912
|
}) }, index22);
|
2889
2913
|
})
|
2890
2914
|
}
|
@@ -2979,7 +3003,7 @@ const Component = ({
|
|
2979
3003
|
/* @__PURE__ */ jsxRuntime.jsx(
|
2980
3004
|
designSystem.IconButton,
|
2981
3005
|
{
|
2982
|
-
|
3006
|
+
variant: "ghost",
|
2983
3007
|
onClick: onDeleteComponent,
|
2984
3008
|
label: formatMessage({
|
2985
3009
|
id: index.getTranslation("containers.Edit.delete"),
|
@@ -2992,7 +3016,7 @@ const Component = ({
|
|
2992
3016
|
designSystem.IconButton,
|
2993
3017
|
{
|
2994
3018
|
ref: composedAccordionRefs,
|
2995
|
-
|
3019
|
+
variant: "ghost",
|
2996
3020
|
onClick: (e) => e.stopPropagation(),
|
2997
3021
|
"data-handler-id": handlerId,
|
2998
3022
|
label: formatMessage({
|
@@ -3062,7 +3086,7 @@ const ComponentInput = ({
|
|
3062
3086
|
id: index.getTranslation("components.reset-entry"),
|
3063
3087
|
defaultMessage: "Reset Entry"
|
3064
3088
|
}),
|
3065
|
-
|
3089
|
+
variant: "ghost",
|
3066
3090
|
onClick: () => {
|
3067
3091
|
field.onChange(name2, null);
|
3068
3092
|
},
|
@@ -3091,11 +3115,8 @@ const AddComponentButton = ({
|
|
3091
3115
|
onClick,
|
3092
3116
|
disabled: isDisabled,
|
3093
3117
|
background: "neutral0",
|
3094
|
-
paddingTop: 3,
|
3095
|
-
paddingBottom: 3,
|
3096
|
-
paddingLeft: 4,
|
3097
|
-
paddingRight: 4,
|
3098
3118
|
style: { cursor: isDisabled ? "not-allowed" : "pointer" },
|
3119
|
+
variant: "tertiary",
|
3099
3120
|
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { tag: "span", gap: 2, children: [
|
3100
3121
|
/* @__PURE__ */ jsxRuntime.jsx(StyledAddIcon, { "aria-hidden": true, $isOpen: isOpen, $hasError: hasError && !isOpen }),
|
3101
3122
|
/* @__PURE__ */ jsxRuntime.jsx(
|
@@ -3124,10 +3145,11 @@ const StyledAddIcon = styledComponents.styled(Icons.PlusCircle)`
|
|
3124
3145
|
}
|
3125
3146
|
`;
|
3126
3147
|
const AddComponentTitle = styledComponents.styled(designSystem.Typography)``;
|
3127
|
-
const StyledButton = styledComponents.styled(designSystem.
|
3148
|
+
const StyledButton = styledComponents.styled(designSystem.Button)`
|
3128
3149
|
border-radius: 26px;
|
3129
3150
|
border-color: ${({ theme }) => theme.colors.neutral150};
|
3130
3151
|
box-shadow: ${({ theme }) => theme.shadows.filterShadow};
|
3152
|
+
height: 5rem;
|
3131
3153
|
|
3132
3154
|
&:hover {
|
3133
3155
|
${AddComponentTitle} {
|
@@ -3139,7 +3161,7 @@ const StyledButton = styledComponents.styled(designSystem.BaseButton)`
|
|
3139
3161
|
fill: ${({ theme }) => theme.colors.primary600};
|
3140
3162
|
}
|
3141
3163
|
> path {
|
3142
|
-
fill: ${({ theme }) => theme.colors.
|
3164
|
+
fill: ${({ theme }) => theme.colors.primary600};
|
3143
3165
|
}
|
3144
3166
|
}
|
3145
3167
|
}
|
@@ -3270,18 +3292,6 @@ const NotAllowedInput = ({ hint, label, required, name: name2 }) => {
|
|
3270
3292
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Hint, {})
|
3271
3293
|
] });
|
3272
3294
|
};
|
3273
|
-
function useDebounce(value, delay) {
|
3274
|
-
const [debouncedValue, setDebouncedValue] = React.useState(value);
|
3275
|
-
React.useEffect(() => {
|
3276
|
-
const handler = setTimeout(() => {
|
3277
|
-
setDebouncedValue(value);
|
3278
|
-
}, delay);
|
3279
|
-
return () => {
|
3280
|
-
clearTimeout(handler);
|
3281
|
-
};
|
3282
|
-
}, [value, delay]);
|
3283
|
-
return debouncedValue;
|
3284
|
-
}
|
3285
3295
|
const uidApi = index.contentManagerApi.injectEndpoints({
|
3286
3296
|
endpoints: (builder) => ({
|
3287
3297
|
getDefaultUID: builder.query({
|
@@ -3316,7 +3326,10 @@ const uidApi = index.contentManagerApi.injectEndpoints({
|
|
3316
3326
|
config: {
|
3317
3327
|
params
|
3318
3328
|
}
|
3319
|
-
})
|
3329
|
+
}),
|
3330
|
+
providesTags: (_res, _error, params) => [
|
3331
|
+
{ type: "UidAvailability", id: params.contentTypeUID }
|
3332
|
+
]
|
3320
3333
|
})
|
3321
3334
|
})
|
3322
3335
|
});
|
@@ -3328,8 +3341,10 @@ const UIDInput = React__namespace.forwardRef(
|
|
3328
3341
|
const allFormValues = strapiAdmin.useForm("InputUID", (form) => form.values);
|
3329
3342
|
const [availability, setAvailability] = React__namespace.useState();
|
3330
3343
|
const [showRegenerate, setShowRegenerate] = React__namespace.useState(false);
|
3344
|
+
const isCloning = reactRouterDom.useMatch(index.CLONE_PATH) !== null;
|
3331
3345
|
const field = strapiAdmin.useField(name2);
|
3332
|
-
const debouncedValue = useDebounce(field.value, 300);
|
3346
|
+
const debouncedValue = useDebounce.useDebounce(field.value, 300);
|
3347
|
+
const hasChanged = debouncedValue !== field.initialValue;
|
3333
3348
|
const { toggleNotification } = strapiAdmin.useNotification();
|
3334
3349
|
const { _unstableFormatAPIError: formatAPIError } = strapiAdmin.useAPIErrorHandler();
|
3335
3350
|
const { formatMessage } = reactIntl.useIntl();
|
@@ -3405,8 +3420,9 @@ const UIDInput = React__namespace.forwardRef(
|
|
3405
3420
|
params
|
3406
3421
|
},
|
3407
3422
|
{
|
3423
|
+
// Don't check availability if the value is empty or wasn't changed
|
3408
3424
|
skip: !Boolean(
|
3409
|
-
|
3425
|
+
(hasChanged || isCloning) && debouncedValue && UID_REGEX.test(debouncedValue.trim())
|
3410
3426
|
)
|
3411
3427
|
}
|
3412
3428
|
);
|
@@ -3435,6 +3451,7 @@ const UIDInput = React__namespace.forwardRef(
|
|
3435
3451
|
const isLoading = isGeneratingDefaultUID || isGeneratingUID || isCheckingAvailability;
|
3436
3452
|
const fieldRef = strapiAdmin.useFocusInputField(name2);
|
3437
3453
|
const composedRefs = designSystem.useComposedRefs(ref, fieldRef);
|
3454
|
+
const shouldShowAvailability = (hasChanged || isCloning) && debouncedValue != null && availability && !showRegenerate;
|
3438
3455
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { hint, name: name2, error: field.error, required, children: [
|
3439
3456
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { action: labelAction, children: label }),
|
3440
3457
|
/* @__PURE__ */ jsxRuntime.jsx(
|
@@ -3443,7 +3460,7 @@ const UIDInput = React__namespace.forwardRef(
|
|
3443
3460
|
ref: composedRefs,
|
3444
3461
|
disabled: props.disabled,
|
3445
3462
|
endAction: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { position: "relative", gap: 1, children: [
|
3446
|
-
|
3463
|
+
shouldShowAvailability && /* @__PURE__ */ jsxRuntime.jsxs(
|
3447
3464
|
TextValidation,
|
3448
3465
|
{
|
3449
3466
|
alignItems: "center",
|
@@ -4277,7 +4294,7 @@ const EditorLayout = ({
|
|
4277
4294
|
justifyContent: "flex-end",
|
4278
4295
|
shrink: 0,
|
4279
4296
|
width: "100%",
|
4280
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(ExpandButton$1, { onClick: onCollapse, children: [
|
4297
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(ExpandButton$1, { onClick: onCollapse, variant: "tertiary", size: "M", children: [
|
4281
4298
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage({
|
4282
4299
|
id: "components.Wysiwyg.collapse",
|
4283
4300
|
defaultMessage: "Collapse"
|
@@ -4295,12 +4312,14 @@ const EditorLayout = ({
|
|
4295
4312
|
) }) });
|
4296
4313
|
}
|
4297
4314
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
4298
|
-
designSystem.
|
4315
|
+
designSystem.Flex,
|
4299
4316
|
{
|
4300
4317
|
borderColor: error ? "danger600" : "neutral200",
|
4301
4318
|
borderStyle: "solid",
|
4302
4319
|
borderWidth: "1px",
|
4303
4320
|
hasRadius: true,
|
4321
|
+
direction: "column",
|
4322
|
+
alignItems: "stretch",
|
4304
4323
|
children
|
4305
4324
|
}
|
4306
4325
|
);
|
@@ -4311,11 +4330,19 @@ const ExpandWrapper = styledComponents.styled(designSystem.Flex)`
|
|
4311
4330
|
const BoxWithBorder = styledComponents.styled(designSystem.Box)`
|
4312
4331
|
border-right: 1px solid ${({ theme }) => theme.colors.neutral200};
|
4313
4332
|
`;
|
4314
|
-
const ExpandButton$1 = styledComponents.styled(designSystem.
|
4333
|
+
const ExpandButton$1 = styledComponents.styled(designSystem.Button)`
|
4315
4334
|
background-color: transparent;
|
4316
4335
|
border: none;
|
4317
4336
|
align-items: center;
|
4318
4337
|
|
4338
|
+
& > span {
|
4339
|
+
display: flex;
|
4340
|
+
justify-content: space-between;
|
4341
|
+
align-items: center;
|
4342
|
+
width: 100%;
|
4343
|
+
font-weight: ${({ theme }) => theme.fontWeights.regular};
|
4344
|
+
}
|
4345
|
+
|
4319
4346
|
svg {
|
4320
4347
|
margin-left: ${({ theme }) => `${theme.spaces[2]}`};
|
4321
4348
|
|
@@ -4582,40 +4609,28 @@ const quoteAndCodeHandler = (editor, markdownType) => {
|
|
4582
4609
|
insertWithoutTextToEdit(editor, markdownType, line, contentLength);
|
4583
4610
|
}
|
4584
4611
|
};
|
4585
|
-
const CustomIconButton = styledComponents.styled(designSystem.IconButton)`
|
4586
|
-
padding: ${({ theme }) => theme.spaces[2]};
|
4587
|
-
|
4588
|
-
svg {
|
4589
|
-
width: 1.8rem;
|
4590
|
-
height: 1.8rem;
|
4591
|
-
}
|
4592
|
-
`;
|
4593
|
-
const CustomLinkIconButton = styledComponents.styled(CustomIconButton)`
|
4594
|
-
svg {
|
4595
|
-
width: 0.8rem;
|
4596
|
-
height: 0.8rem;
|
4597
|
-
}
|
4598
|
-
`;
|
4599
4612
|
const MainButtons = styledComponents.styled(designSystem.IconButtonGroup)`
|
4600
4613
|
margin-left: ${({ theme }) => theme.spaces[4]};
|
4601
4614
|
`;
|
4602
4615
|
const MoreButton = styledComponents.styled(designSystem.IconButton)`
|
4603
4616
|
margin: ${({ theme }) => `0 ${theme.spaces[2]}`};
|
4604
|
-
padding: ${({ theme }) => theme.spaces[2]};
|
4605
|
-
|
4606
|
-
svg {
|
4607
|
-
width: 1.8rem;
|
4608
|
-
height: 1.8rem;
|
4609
|
-
}
|
4610
4617
|
`;
|
4611
4618
|
const IconButtonGroupMargin = styledComponents.styled(designSystem.IconButtonGroup)`
|
4612
4619
|
margin-right: ${({ theme }) => `${theme.spaces[2]}`};
|
4613
4620
|
`;
|
4614
|
-
const ExpandButton = styledComponents.styled(designSystem.
|
4621
|
+
const ExpandButton = styledComponents.styled(designSystem.Button)`
|
4615
4622
|
background-color: transparent;
|
4616
4623
|
border: none;
|
4617
4624
|
align-items: center;
|
4618
4625
|
|
4626
|
+
& > span {
|
4627
|
+
display: flex;
|
4628
|
+
justify-content: space-between;
|
4629
|
+
align-items: center;
|
4630
|
+
width: 100%;
|
4631
|
+
font-weight: ${({ theme }) => theme.fontWeights.regular};
|
4632
|
+
}
|
4633
|
+
|
4619
4634
|
svg {
|
4620
4635
|
margin-left: ${({ theme }) => `${theme.spaces[2]}`};
|
4621
4636
|
path {
|
@@ -4627,7 +4642,7 @@ const ExpandButton = styledComponents.styled(designSystem.BaseButton)`
|
|
4627
4642
|
`;
|
4628
4643
|
const WysiwygFooter = ({ onToggleExpand }) => {
|
4629
4644
|
const { formatMessage } = reactIntl.useIntl();
|
4630
|
-
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 2, background: "neutral100", borderRadius: `0 0 0.4rem 0.4rem`, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "flex-end", alignItems: "flex-end", children: /* @__PURE__ */ jsxRuntime.jsxs(ExpandButton, { id: "expand", onClick: onToggleExpand, children: [
|
4645
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 2, background: "neutral100", borderRadius: `0 0 0.4rem 0.4rem`, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "flex-end", alignItems: "flex-end", children: /* @__PURE__ */ jsxRuntime.jsxs(ExpandButton, { id: "expand", onClick: onToggleExpand, variant: "tertiary", size: "M", children: [
|
4631
4646
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral800", children: formatMessage({
|
4632
4647
|
id: "components.WysiwygBottomControls.fullscreen",
|
4633
4648
|
defaultMessage: "Expand"
|
@@ -4664,18 +4679,27 @@ const WysiwygNav = ({
|
|
4664
4679
|
borderRadius: `0.4rem 0.4rem 0 0`,
|
4665
4680
|
children: [
|
4666
4681
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { children: [
|
4667
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Root, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
4668
|
-
|
4669
|
-
|
4670
|
-
|
4671
|
-
|
4672
|
-
|
4673
|
-
|
4674
|
-
|
4682
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Root, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
4683
|
+
designSystem.SingleSelect,
|
4684
|
+
{
|
4685
|
+
disabled: true,
|
4686
|
+
placeholder: selectPlaceholder,
|
4687
|
+
"aria-label": selectPlaceholder,
|
4688
|
+
size: "S",
|
4689
|
+
children: [
|
4690
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h1", children: "h1" }),
|
4691
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h2", children: "h2" }),
|
4692
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h3", children: "h3" }),
|
4693
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h4", children: "h4" }),
|
4694
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h5", children: "h5" }),
|
4695
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h6", children: "h6" })
|
4696
|
+
]
|
4697
|
+
}
|
4698
|
+
) }),
|
4675
4699
|
/* @__PURE__ */ jsxRuntime.jsxs(MainButtons, { children: [
|
4676
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
4677
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
4678
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
4700
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { disabled: true, label: "Bold", name: "Bold", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Bold, {}) }),
|
4701
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { disabled: true, label: "Italic", name: "Italic", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Italic, {}) }),
|
4702
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { disabled: true, label: "Underline", name: "Underline", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Underline, {}) })
|
4679
4703
|
] }),
|
4680
4704
|
/* @__PURE__ */ jsxRuntime.jsx(MoreButton, { disabled: true, label: "More", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.More, {}) })
|
4681
4705
|
] }),
|
@@ -4702,6 +4726,7 @@ const WysiwygNav = ({
|
|
4702
4726
|
placeholder: selectPlaceholder,
|
4703
4727
|
"aria-label": selectPlaceholder,
|
4704
4728
|
onChange: (value) => onActionClick(value, editorRef),
|
4729
|
+
size: "S",
|
4705
4730
|
children: [
|
4706
4731
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h1", children: "h1" }),
|
4707
4732
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h2", children: "h2" }),
|
@@ -4713,17 +4738,9 @@ const WysiwygNav = ({
|
|
4713
4738
|
}
|
4714
4739
|
) }),
|
4715
4740
|
/* @__PURE__ */ jsxRuntime.jsxs(MainButtons, { children: [
|
4741
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { onClick: () => onActionClick("Bold", editorRef), label: "Bold", name: "Bold", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Bold, {}) }),
|
4716
4742
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4717
|
-
|
4718
|
-
{
|
4719
|
-
onClick: () => onActionClick("Bold", editorRef),
|
4720
|
-
label: "Bold",
|
4721
|
-
name: "Bold",
|
4722
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Bold, {})
|
4723
|
-
}
|
4724
|
-
),
|
4725
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
4726
|
-
CustomIconButton,
|
4743
|
+
designSystem.IconButton,
|
4727
4744
|
{
|
4728
4745
|
onClick: () => onActionClick("Italic", editorRef),
|
4729
4746
|
label: "Italic",
|
@@ -4732,7 +4749,7 @@ const WysiwygNav = ({
|
|
4732
4749
|
}
|
4733
4750
|
),
|
4734
4751
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4735
|
-
|
4752
|
+
designSystem.IconButton,
|
4736
4753
|
{
|
4737
4754
|
onClick: () => onActionClick("Underline", editorRef),
|
4738
4755
|
label: "Underline",
|
@@ -4746,7 +4763,7 @@ const WysiwygNav = ({
|
|
4746
4763
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Content, { sideOffset: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { padding: 2, children: [
|
4747
4764
|
/* @__PURE__ */ jsxRuntime.jsxs(IconButtonGroupMargin, { children: [
|
4748
4765
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4749
|
-
|
4766
|
+
designSystem.IconButton,
|
4750
4767
|
{
|
4751
4768
|
onClick: () => onActionClick("Strikethrough", editorRef, handleTogglePopover),
|
4752
4769
|
label: "Strikethrough",
|
@@ -4755,7 +4772,7 @@ const WysiwygNav = ({
|
|
4755
4772
|
}
|
4756
4773
|
),
|
4757
4774
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4758
|
-
|
4775
|
+
designSystem.IconButton,
|
4759
4776
|
{
|
4760
4777
|
onClick: () => onActionClick("BulletList", editorRef, handleTogglePopover),
|
4761
4778
|
label: "BulletList",
|
@@ -4764,7 +4781,7 @@ const WysiwygNav = ({
|
|
4764
4781
|
}
|
4765
4782
|
),
|
4766
4783
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4767
|
-
|
4784
|
+
designSystem.IconButton,
|
4768
4785
|
{
|
4769
4786
|
onClick: () => onActionClick("NumberList", editorRef, handleTogglePopover),
|
4770
4787
|
label: "NumberList",
|
@@ -4775,7 +4792,7 @@ const WysiwygNav = ({
|
|
4775
4792
|
] }),
|
4776
4793
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.IconButtonGroup, { children: [
|
4777
4794
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4778
|
-
|
4795
|
+
designSystem.IconButton,
|
4779
4796
|
{
|
4780
4797
|
onClick: () => onActionClick("Code", editorRef, handleTogglePopover),
|
4781
4798
|
label: "Code",
|
@@ -4784,7 +4801,7 @@ const WysiwygNav = ({
|
|
4784
4801
|
}
|
4785
4802
|
),
|
4786
4803
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4787
|
-
|
4804
|
+
designSystem.IconButton,
|
4788
4805
|
{
|
4789
4806
|
onClick: () => {
|
4790
4807
|
handleTogglePopover();
|
@@ -4796,7 +4813,7 @@ const WysiwygNav = ({
|
|
4796
4813
|
}
|
4797
4814
|
),
|
4798
4815
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4799
|
-
|
4816
|
+
designSystem.IconButton,
|
4800
4817
|
{
|
4801
4818
|
onClick: () => onActionClick("Link", editorRef, handleTogglePopover),
|
4802
4819
|
label: "Link",
|
@@ -4805,7 +4822,7 @@ const WysiwygNav = ({
|
|
4805
4822
|
}
|
4806
4823
|
),
|
4807
4824
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4808
|
-
|
4825
|
+
designSystem.IconButton,
|
4809
4826
|
{
|
4810
4827
|
onClick: () => onActionClick("Quote", editorRef, handleTogglePopover),
|
4811
4828
|
label: "Quote",
|
@@ -4883,7 +4900,7 @@ const Wysiwyg = React__namespace.forwardRef(
|
|
4883
4900
|
const handleSelectAssets = (files) => {
|
4884
4901
|
const formattedFiles = files.map((f) => ({
|
4885
4902
|
alt: f.alternativeText || f.name,
|
4886
|
-
url:
|
4903
|
+
url: useDebounce.prefixFileUrlWithBackendUrl(f.url),
|
4887
4904
|
mime: f.mime
|
4888
4905
|
}));
|
4889
4906
|
insertFile(editorRef, formattedFiles);
|
@@ -5137,7 +5154,7 @@ const DynamicComponent = ({
|
|
5137
5154
|
/* @__PURE__ */ jsxRuntime.jsx(
|
5138
5155
|
designSystem.IconButton,
|
5139
5156
|
{
|
5140
|
-
|
5157
|
+
variant: "ghost",
|
5141
5158
|
label: formatMessage(
|
5142
5159
|
{
|
5143
5160
|
id: index.getTranslation("components.DynamicZone.delete-label"),
|
@@ -5152,7 +5169,7 @@ const DynamicComponent = ({
|
|
5152
5169
|
/* @__PURE__ */ jsxRuntime.jsx(
|
5153
5170
|
designSystem.IconButton,
|
5154
5171
|
{
|
5155
|
-
|
5172
|
+
variant: "ghost",
|
5156
5173
|
onClick: (e) => e.stopPropagation(),
|
5157
5174
|
"data-handler-id": handlerId,
|
5158
5175
|
ref: dragRef,
|
@@ -5213,7 +5230,18 @@ const DynamicComponent = ({
|
|
5213
5230
|
] }),
|
5214
5231
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Content, { children: /* @__PURE__ */ jsxRuntime.jsx(AccordionContentRadius, { background: "neutral0", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingLeft: 6, paddingRight: 6, paddingTop: 6, paddingBottom: 6, children: components[componentUid]?.layout?.map((row, rowInd) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
5215
5232
|
const fieldName = `${name2}.${index$1}.${field.name}`;
|
5216
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
5233
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
5234
|
+
designSystem.Grid.Item,
|
5235
|
+
{
|
5236
|
+
col: size,
|
5237
|
+
s: 12,
|
5238
|
+
xs: 12,
|
5239
|
+
direction: "column",
|
5240
|
+
alignItems: "stretch",
|
5241
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(MemoizedInputRenderer, { ...field, name: fieldName })
|
5242
|
+
},
|
5243
|
+
fieldName
|
5244
|
+
);
|
5217
5245
|
}) }, rowInd)) }) }) })
|
5218
5246
|
] }) }) })
|
5219
5247
|
] });
|
@@ -5520,4 +5548,4 @@ exports.transformDocument = transformDocument;
|
|
5520
5548
|
exports.useDynamicZone = useDynamicZone;
|
5521
5549
|
exports.useFieldHint = useFieldHint;
|
5522
5550
|
exports.useLazyComponents = useLazyComponents;
|
5523
|
-
//# sourceMappingURL=Field-
|
5551
|
+
//# sourceMappingURL=Field-BEDX9i_V.js.map
|