@strapi/plugin-documentation 5.0.0-alpha.0 → 5.0.0-alpha.1
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/admin/src/hooks/useDocumentation.js +1 -2
- package/admin/src/index.js +1 -1
- package/admin/src/pages/PluginPage/index.jsx +3 -5
- package/admin/src/pages/SettingsPage/index.jsx +4 -8
- package/admin/src/utils/prefixPluginTranslations.js +13 -0
- package/dist/_chunks/{EditViewPage-xYzUSAwS-OCSjk-Vt.mjs → EditViewPage-kgrZ8rEg-N3ylaYYT.mjs} +21 -7
- package/dist/_chunks/{EditViewPage-xYzUSAwS-OCSjk-Vt.mjs.map → EditViewPage-kgrZ8rEg-N3ylaYYT.mjs.map} +1 -1
- package/dist/_chunks/{EditViewPage-xYzUSAwS-NigDiZi1.js → EditViewPage-kgrZ8rEg-QXBi74pP.js} +26 -12
- package/dist/_chunks/{EditViewPage-xYzUSAwS-NigDiZi1.js.map → EditViewPage-kgrZ8rEg-QXBi74pP.js.map} +1 -1
- package/dist/_chunks/{ListViewPage-xOVa04T_-JQSQJ0aH.js → ListViewPage-BNB0ptO7-Y0blKENS.js} +16 -17
- package/dist/_chunks/ListViewPage-BNB0ptO7-Y0blKENS.js.map +1 -0
- package/dist/_chunks/{ListViewPage-xOVa04T_-MAsyJIvQ.mjs → ListViewPage-BNB0ptO7-qPG-Y69A.mjs} +9 -10
- package/dist/_chunks/ListViewPage-BNB0ptO7-qPG-Y69A.mjs.map +1 -0
- package/dist/_chunks/{ReviewWorkflowsColumn-FDxVKdto-9EdyIGCi.js → ReviewWorkflowsColumn-56Z6l-FH-j4yjCkjD.js} +2 -2
- package/dist/_chunks/{ReviewWorkflowsColumn-FDxVKdto-9EdyIGCi.js.map → ReviewWorkflowsColumn-56Z6l-FH-j4yjCkjD.js.map} +1 -1
- package/dist/_chunks/{ReviewWorkflowsColumn-FDxVKdto-E7QaAVIp.mjs → ReviewWorkflowsColumn-56Z6l-FH-jOwjGO3o.mjs} +2 -2
- package/dist/_chunks/{ReviewWorkflowsColumn-FDxVKdto-E7QaAVIp.mjs.map → ReviewWorkflowsColumn-56Z6l-FH-jOwjGO3o.mjs.map} +1 -1
- package/dist/_chunks/{constants-WjN6I3sL-1yTyGpl5.mjs → constants-evLWZCaJ-Oxpg3z7Q.mjs} +2 -2
- package/dist/_chunks/{constants-WjN6I3sL-1yTyGpl5.mjs.map → constants-evLWZCaJ-Oxpg3z7Q.mjs.map} +1 -1
- package/dist/_chunks/{constants-WjN6I3sL-5vTd1Y1g.js → constants-evLWZCaJ-ZpfIp8P_.js} +2 -2
- package/dist/_chunks/{constants-WjN6I3sL-5vTd1Y1g.js.map → constants-evLWZCaJ-ZpfIp8P_.js.map} +1 -1
- package/dist/_chunks/{index-m8HLcGmV.js → index-7OS1Qe_4.js} +4 -5
- package/dist/_chunks/index-7OS1Qe_4.js.map +1 -0
- package/dist/_chunks/{index-h-OcS50W.mjs → index-JM6LA3Oe.mjs} +17 -9
- package/dist/_chunks/index-JM6LA3Oe.mjs.map +1 -0
- package/dist/_chunks/{index-FiShd2zI.js → index-R7UT09YY.js} +2794 -2683
- package/dist/_chunks/index-R7UT09YY.js.map +1 -0
- package/dist/_chunks/{index--rtz8bZh.mjs → index-lggLaJiY.mjs} +2827 -2716
- package/dist/_chunks/index-lggLaJiY.mjs.map +1 -0
- package/dist/_chunks/{index-vWzO1snG.js → index-ri1exVbc.js} +18 -10
- package/dist/_chunks/index-ri1exVbc.js.map +1 -0
- package/dist/_chunks/{index-Qt8XLNQZ.mjs → index-ynnbYrP0.mjs} +6 -7
- package/dist/_chunks/index-ynnbYrP0.mjs.map +1 -0
- package/dist/_chunks/{useDocumentation-hOQyphRS.js → useDocumentation-GsX6iQVe.js} +3 -4
- package/dist/_chunks/useDocumentation-GsX6iQVe.js.map +1 -0
- package/dist/_chunks/{useDocumentation-EsufCjtn.mjs → useDocumentation-jTKQvwxD.mjs} +3 -4
- package/dist/_chunks/useDocumentation-jTKQvwxD.mjs.map +1 -0
- package/dist/_chunks/{useSyncRbac-Kt8Li0Yf-f6LRUqJf.js → useSyncRbac-83vFRiaG-5ec8lrUQ.js} +2 -2
- package/dist/_chunks/{useSyncRbac-Kt8Li0Yf-f6LRUqJf.js.map → useSyncRbac-83vFRiaG-5ec8lrUQ.js.map} +1 -1
- package/dist/_chunks/{useSyncRbac-Kt8Li0Yf-mDaHJCOQ.mjs → useSyncRbac-83vFRiaG-oJpvBKQE.mjs} +2 -2
- package/dist/_chunks/{useSyncRbac-Kt8Li0Yf-mDaHJCOQ.mjs.map → useSyncRbac-83vFRiaG-oJpvBKQE.mjs.map} +1 -1
- package/dist/admin/index.js +1 -2
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/index.mjs +1 -2
- package/dist/admin/index.mjs.map +1 -1
- package/package.json +6 -6
- package/dist/_chunks/ListViewPage-xOVa04T_-JQSQJ0aH.js.map +0 -1
- package/dist/_chunks/ListViewPage-xOVa04T_-MAsyJIvQ.mjs.map +0 -1
- package/dist/_chunks/index--rtz8bZh.mjs.map +0 -1
- package/dist/_chunks/index-FiShd2zI.js.map +0 -1
- package/dist/_chunks/index-Qt8XLNQZ.mjs.map +0 -1
- package/dist/_chunks/index-h-OcS50W.mjs.map +0 -1
- package/dist/_chunks/index-m8HLcGmV.js.map +0 -1
- package/dist/_chunks/index-vWzO1snG.js.map +0 -1
- package/dist/_chunks/useDocumentation-EsufCjtn.mjs.map +0 -1
- package/dist/_chunks/useDocumentation-hOQyphRS.js.map +0 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
2
|
|
|
3
|
-
import { useFetchClient } from '@strapi/
|
|
4
|
-
import { useAPIErrorHandler, useNotification } from '@strapi/strapi/admin';
|
|
3
|
+
import { useAPIErrorHandler, useNotification, useFetchClient } from '@strapi/strapi/admin';
|
|
5
4
|
import { useIntl } from 'react-intl';
|
|
6
5
|
import { useMutation, useQuery } from 'react-query';
|
|
7
6
|
|
package/admin/src/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { prefixPluginTranslations } from '@strapi/helper-plugin';
|
|
2
1
|
import { Information } from '@strapi/icons';
|
|
3
2
|
|
|
4
3
|
import pluginPkg from '../../package.json';
|
|
5
4
|
|
|
6
5
|
import { PERMISSIONS } from './constants';
|
|
7
6
|
import pluginId from './pluginId';
|
|
7
|
+
import { prefixPluginTranslations } from './utils/prefixPluginTranslations';
|
|
8
8
|
|
|
9
9
|
const name = pluginPkg.strapi.name;
|
|
10
10
|
|
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
HeaderLayout,
|
|
9
9
|
IconButton,
|
|
10
10
|
Layout,
|
|
11
|
-
Main,
|
|
12
11
|
Table,
|
|
13
12
|
Tbody,
|
|
14
13
|
Td,
|
|
@@ -18,7 +17,7 @@ import {
|
|
|
18
17
|
Typography,
|
|
19
18
|
EmptyStateLayout,
|
|
20
19
|
} from '@strapi/design-system';
|
|
21
|
-
import {
|
|
20
|
+
import { useRBAC } from '@strapi/helper-plugin';
|
|
22
21
|
import { Eye as Show, Refresh as Reload, Trash } from '@strapi/icons';
|
|
23
22
|
import { Page } from '@strapi/strapi/admin';
|
|
24
23
|
import { Helmet } from 'react-helmet';
|
|
@@ -30,7 +29,6 @@ import { useDocumentation } from '../../hooks/useDocumentation';
|
|
|
30
29
|
import { getTrad } from '../../utils';
|
|
31
30
|
|
|
32
31
|
const PluginPage = () => {
|
|
33
|
-
useFocusWhenNavigate();
|
|
34
32
|
const { formatMessage } = useIntl();
|
|
35
33
|
const { data, isLoading, isError, remove, regenerate } = useDocumentation();
|
|
36
34
|
const [showConfirmDelete, setShowConfirmDelete] = useState(false);
|
|
@@ -74,7 +72,7 @@ const PluginPage = () => {
|
|
|
74
72
|
return (
|
|
75
73
|
<Layout>
|
|
76
74
|
<Helmet title={title} />
|
|
77
|
-
<Main
|
|
75
|
+
<Page.Main>
|
|
78
76
|
<HeaderLayout
|
|
79
77
|
title={title}
|
|
80
78
|
subtitle={formatMessage({
|
|
@@ -189,7 +187,7 @@ const PluginPage = () => {
|
|
|
189
187
|
onClose={handleShowConfirmDelete}
|
|
190
188
|
isOpen={showConfirmDelete}
|
|
191
189
|
/>
|
|
192
|
-
</Main>
|
|
190
|
+
</Page.Main>
|
|
193
191
|
</Layout>
|
|
194
192
|
);
|
|
195
193
|
};
|
|
@@ -8,17 +8,14 @@ import {
|
|
|
8
8
|
Grid,
|
|
9
9
|
GridItem,
|
|
10
10
|
HeaderLayout,
|
|
11
|
-
Main,
|
|
12
11
|
TextInput,
|
|
13
12
|
ToggleInput,
|
|
14
13
|
Typography,
|
|
15
14
|
FieldAction,
|
|
16
15
|
} from '@strapi/design-system';
|
|
17
|
-
import {
|
|
16
|
+
import { useRBAC } from '@strapi/helper-plugin';
|
|
18
17
|
import { Check, Eye as Show, EyeStriked as Hide } from '@strapi/icons';
|
|
19
|
-
import { translatedErrors } from '@strapi/strapi/admin';
|
|
20
|
-
// Strapi Icons
|
|
21
|
-
import { Page } from '@strapi/strapi/admin';
|
|
18
|
+
import { translatedErrors, Page } from '@strapi/strapi/admin';
|
|
22
19
|
import { Form, Formik } from 'formik';
|
|
23
20
|
import { useIntl } from 'react-intl';
|
|
24
21
|
import styled from 'styled-components';
|
|
@@ -36,7 +33,6 @@ const schema = yup.object().shape({
|
|
|
36
33
|
});
|
|
37
34
|
|
|
38
35
|
const SettingsPage = () => {
|
|
39
|
-
useFocusWhenNavigate();
|
|
40
36
|
const { formatMessage } = useIntl();
|
|
41
37
|
const { submit, data, isLoading } = useDocumentation();
|
|
42
38
|
const [passwordShown, setPasswordShown] = useState(false);
|
|
@@ -54,7 +50,7 @@ const SettingsPage = () => {
|
|
|
54
50
|
}
|
|
55
51
|
|
|
56
52
|
return (
|
|
57
|
-
<Main>
|
|
53
|
+
<Page.Main>
|
|
58
54
|
<Formik
|
|
59
55
|
initialValues={{
|
|
60
56
|
restrictedAccess: data?.documentationAccess.restrictedAccess || false,
|
|
@@ -190,7 +186,7 @@ const SettingsPage = () => {
|
|
|
190
186
|
);
|
|
191
187
|
}}
|
|
192
188
|
</Formik>
|
|
193
|
-
</Main>
|
|
189
|
+
</Page.Main>
|
|
194
190
|
);
|
|
195
191
|
};
|
|
196
192
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const prefixPluginTranslations = (trad, pluginId) => {
|
|
2
|
+
if (!pluginId) {
|
|
3
|
+
throw new TypeError("pluginId can't be empty");
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
return Object.keys(trad).reduce((acc, current) => {
|
|
7
|
+
acc[`${pluginId}.${current}`] = trad[current];
|
|
8
|
+
|
|
9
|
+
return acc;
|
|
10
|
+
}, {});
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { prefixPluginTranslations };
|
package/dist/_chunks/{EditViewPage-xYzUSAwS-OCSjk-Vt.mjs → EditViewPage-kgrZ8rEg-N3ylaYYT.mjs}
RENAMED
|
@@ -2,12 +2,11 @@ import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import React__default, { useContext, useCallback, useState, useRef, useReducer, useMemo, useEffect, createContext, useLayoutEffect, Component as Component$1, memo as memo$1, forwardRef, Children as Children$1, isValidElement, createElement, cloneElement, Fragment } from "react";
|
|
4
4
|
import { TextInput, Flex, Icon, Typography, BaseLink, Button, useComposedRefs, Popover, Field, FieldLabel, FieldInput, Box, IconButton, Divider, VisuallyHidden, FieldHint, FieldError, TextButton, BaseButton, FieldAction, IconButtonGroup, Portal, FocusTrap, InputWrapper, SingleSelect, SingleSelectOption, Tooltip, Grid as Grid$1, GridItem, KeyboardNavigable, Accordion, AccordionToggle, AccordionContent as AccordionContent$1, Main, TabGroup, Tabs, TabPanels, TabPanel, Tab as Tab$1 } from "@strapi/design-system";
|
|
5
|
-
import { useQueryParams, useFocusInputField, useLockScroll, useQuery } from "@strapi/helper-plugin";
|
|
6
5
|
import { Helmet } from "react-helmet";
|
|
7
6
|
import { useIntl } from "react-intl";
|
|
8
7
|
import { useLocation, useParams } from "react-router-dom";
|
|
9
8
|
import styled, { css, keyframes } from "styled-components";
|
|
10
|
-
import { g as getDefaultExportFromCjs, _ as _extends, $ as $c512c27ab02ef895$export$50c7b4e9d9f19c1, c as commonjsGlobal, r as require$$0$2, D as DIRECTIONS, a as getTranslation, u as useField, b as createContext$1, d as contentManagerApi, e as useDoc, f as useForm, h as useNotification, i as useAPIErrorHandler, j as
|
|
9
|
+
import { g as getDefaultExportFromCjs, _ as _extends, $ as $c512c27ab02ef895$export$50c7b4e9d9f19c1, c as commonjsGlobal, r as require$$0$2, D as DIRECTIONS, a as getTranslation, u as useField, b as createContext$1, d as contentManagerApi, e as useDoc, f as useForm, h as useNotification, i as useAPIErrorHandler, j as useQueryParams, k as buildValidParams, l as useFocusInputField, m as useStrapiApp, n as $c512c27ab02ef895$export$fd42f52fd3ae1109, p as prefixFileUrlWithBackendUrl, o as DOCUMENT_META_FIELDS, q as useDocumentRBAC, I as InputRenderer$1, R as RelationsField, s as useDragAndDrop, t as ItemTypes, v as useComponent, C as ComponentProvider, w as generateNKeysBetween, x as useDocLayout, y as getIn, z as getEmptyImage, A as useDocumentLayout, P as Page, F as Form, B as createYupSchema, H as Header, E as Panels, G as Blocker, J as DocumentRBAC, S as SINGLE_TYPES } from "./index-lggLaJiY.mjs";
|
|
11
10
|
import * as Icons from "@strapi/icons";
|
|
12
11
|
import { EyeStriked, Expand, PlusCircle, CheckCircle, ExclamationMarkCircle, Loader, Refresh, Collapse, Bold, Italic, Underline, StrikeThrough, Code, More, BulletList, NumberList, Picture, Link as Link$1, Quote, HeadingOne, HeadingTwo, HeadingThree, HeadingFour, HeadingFive, HeadingSix, Paragraph, Drag, Trash, Plus } from "@strapi/icons";
|
|
13
12
|
import { createDraft, finishDraft, isDraft, produce } from "immer";
|
|
@@ -20,7 +19,7 @@ import require$$2 from "path";
|
|
|
20
19
|
import require$$1$1 from "url";
|
|
21
20
|
import require$$1 from "fs";
|
|
22
21
|
import require$$8 from "punycode";
|
|
23
|
-
import { u as useSyncRbac } from "./useSyncRbac-
|
|
22
|
+
import { u as useSyncRbac } from "./useSyncRbac-83vFRiaG-oJpvBKQE.mjs";
|
|
24
23
|
const NotAllowedInput = ({ hint, label: label2, required, name: name2 }) => {
|
|
25
24
|
const { formatMessage } = useIntl();
|
|
26
25
|
const placeholder = formatMessage({
|
|
@@ -80744,7 +80743,14 @@ const EditorLayout$1 = ({
|
|
|
80744
80743
|
}) => {
|
|
80745
80744
|
const { formatMessage } = useIntl();
|
|
80746
80745
|
const { isExpandedMode } = useBlocksEditorContext("editorLayout");
|
|
80747
|
-
|
|
80746
|
+
React.useEffect(() => {
|
|
80747
|
+
if (isExpandedMode) {
|
|
80748
|
+
document.body.classList.add("lock-body-scroll");
|
|
80749
|
+
}
|
|
80750
|
+
return () => {
|
|
80751
|
+
document.body.classList.remove("lock-body-scroll");
|
|
80752
|
+
};
|
|
80753
|
+
}, [isExpandedMode]);
|
|
80748
80754
|
if (isExpandedMode) {
|
|
80749
80755
|
return /* @__PURE__ */ jsx(Portal, { role: "dialog", "aria-modal": false, children: /* @__PURE__ */ jsx(FocusTrap, { onEscape: onCollapse, children: /* @__PURE__ */ jsx(
|
|
80750
80756
|
ExpandWrapper$1,
|
|
@@ -81308,6 +81314,8 @@ const RepeatableComponent = ({
|
|
|
81308
81314
|
}) => {
|
|
81309
81315
|
const { toggleNotification } = useNotification();
|
|
81310
81316
|
const { formatMessage } = useIntl();
|
|
81317
|
+
const { search: searchString } = useLocation();
|
|
81318
|
+
const search = React.useMemo(() => new URLSearchParams(searchString), [searchString]);
|
|
81311
81319
|
const { components } = useDoc();
|
|
81312
81320
|
const { value = [], error: error2 } = useField(name2);
|
|
81313
81321
|
const addFieldRow = useForm("RepeatableComponent", (state) => state.addFieldRow);
|
|
@@ -81316,7 +81324,6 @@ const RepeatableComponent = ({
|
|
|
81316
81324
|
const { max = Infinity } = attribute2;
|
|
81317
81325
|
const [collapseToOpen, setCollapseToOpen] = React.useState(null);
|
|
81318
81326
|
const [liveText, setLiveText] = React.useState("");
|
|
81319
|
-
const search = useQuery();
|
|
81320
81327
|
const componentTmpKeyWithFocussedField = React.useMemo(() => {
|
|
81321
81328
|
if (search.has("field")) {
|
|
81322
81329
|
const fieldParam = search.get("field");
|
|
@@ -83331,7 +83338,14 @@ const EditorLayout = ({
|
|
|
83331
83338
|
onCollapse
|
|
83332
83339
|
}) => {
|
|
83333
83340
|
const { formatMessage } = useIntl();
|
|
83334
|
-
|
|
83341
|
+
React.useEffect(() => {
|
|
83342
|
+
if (isExpandMode) {
|
|
83343
|
+
document.body.classList.add("lock-body-scroll");
|
|
83344
|
+
}
|
|
83345
|
+
return () => {
|
|
83346
|
+
document.body.classList.remove("lock-body-scroll");
|
|
83347
|
+
};
|
|
83348
|
+
}, [isExpandMode]);
|
|
83335
83349
|
if (isExpandMode) {
|
|
83336
83350
|
return /* @__PURE__ */ jsx(Portal, { role: "dialog", "aria-modal": false, children: /* @__PURE__ */ jsx(FocusTrap, { onEscape: onCollapse, children: /* @__PURE__ */ jsx(
|
|
83337
83351
|
ExpandWrapper,
|
|
@@ -84365,4 +84379,4 @@ export {
|
|
|
84365
84379
|
EditViewPage,
|
|
84366
84380
|
ProtectedEditViewPage
|
|
84367
84381
|
};
|
|
84368
|
-
//# sourceMappingURL=EditViewPage-
|
|
84382
|
+
//# sourceMappingURL=EditViewPage-kgrZ8rEg-N3ylaYYT.mjs.map
|