@strapi/content-manager 0.0.0-experimental.fb92031f3d90f3d2a2d191ba65725b6c8e329a5d → 0.0.0-experimental.fca58d9b01ba89012d84a58a20556a6fd716cb92
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/admin/hooks/useDocumentActions.js +5 -1
- package/dist/admin/hooks/useDocumentActions.js.map +1 -1
- package/dist/admin/hooks/useDocumentActions.mjs +5 -1
- package/dist/admin/hooks/useDocumentActions.mjs.map +1 -1
- package/dist/admin/hooks/useDocumentContext.js.map +1 -1
- package/dist/admin/hooks/useDocumentContext.mjs.map +1 -1
- package/dist/admin/index.js +1 -3
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/pages/EditView/components/DocumentActions.js +206 -21
- package/dist/admin/pages/EditView/components/DocumentActions.js.map +1 -1
- package/dist/admin/pages/EditView/components/DocumentActions.mjs +208 -23
- package/dist/admin/pages/EditView/components/DocumentActions.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Relations/RelationModal.js +128 -55
- package/dist/admin/pages/EditView/components/FormInputs/Relations/RelationModal.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Relations/RelationModal.mjs +128 -55
- package/dist/admin/pages/EditView/components/FormInputs/Relations/RelationModal.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Relations/Relations.js +89 -50
- package/dist/admin/pages/EditView/components/FormInputs/Relations/Relations.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Relations/Relations.mjs +91 -52
- package/dist/admin/pages/EditView/components/FormInputs/Relations/Relations.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormLayout.js +3 -3
- package/dist/admin/pages/EditView/components/FormLayout.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormLayout.mjs +3 -3
- package/dist/admin/pages/EditView/components/FormLayout.mjs.map +1 -1
- package/dist/admin/src/hooks/useDocumentContext.d.ts +1 -1
- package/dist/admin/src/pages/EditView/components/FormInputs/Relations/RelationModal.d.ts +26 -5
- package/dist/admin/src/pages/EditView/components/FormLayout.d.ts +0 -1
- package/dist/admin/translations/en.json.js +2 -1
- package/dist/admin/translations/en.json.js.map +1 -1
- package/dist/admin/translations/en.json.mjs +2 -1
- package/dist/admin/translations/en.json.mjs.map +1 -1
- package/dist/admin/translations/ru.json.js +235 -226
- package/dist/admin/translations/ru.json.js.map +1 -1
- package/dist/admin/translations/ru.json.mjs +230 -226
- package/dist/admin/translations/ru.json.mjs.map +1 -1
- package/package.json +7 -7
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"FormLayout.js","sources":["../../../../../admin/src/pages/EditView/components/FormLayout.tsx"],"sourcesContent":["import { Box, Flex, Grid } from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\nimport { styled } from 'styled-components';\n\nimport { EditLayout } from '../../../hooks/useDocumentLayout';\n\nimport { InputRenderer } from './InputRenderer';\n\nimport type { UseDocument } from '../../../hooks/useDocument';\n\nexport const RESPONSIVE_CONTAINER_BREAKPOINTS = {\n sm: '27.5rem', // 440px\n};\n\nexport const ResponsiveGridRoot = styled(Grid.Root)`\n container-type: inline-size;\n`;\n\nexport const ResponsiveGridItem =\n /**\n * TODO:\n * JSDOM cannot handle container queries.\n * This is a temporary workaround so that tests do not fail in the CI when jestdom throws an error\n * for failing to parse the stylesheet.\n */\n process.env.NODE_ENV !== 'test'\n ? styled(Grid.Item)<{ col: number }>`\n grid-column: span 12;\n @container (min-width: ${RESPONSIVE_CONTAINER_BREAKPOINTS.sm}) {\n ${({ col }) => col && `grid-column: span ${col};`}\n }\n `\n : styled(Grid.Item)<{ col: number }>`\n grid-column: span 12;\n `;\n\ninterface FormLayoutProps extends Pick<EditLayout, 'layout'> {\n hasBackground?: boolean;\n
|
1
|
+
{"version":3,"file":"FormLayout.js","sources":["../../../../../admin/src/pages/EditView/components/FormLayout.tsx"],"sourcesContent":["import { Box, Flex, Grid } from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\nimport { styled } from 'styled-components';\n\nimport { EditLayout } from '../../../hooks/useDocumentLayout';\n\nimport { InputRenderer } from './InputRenderer';\n\nimport type { UseDocument } from '../../../hooks/useDocument';\n\nexport const RESPONSIVE_CONTAINER_BREAKPOINTS = {\n sm: '27.5rem', // 440px\n};\n\nexport const ResponsiveGridRoot = styled(Grid.Root)`\n container-type: inline-size;\n`;\n\nexport const ResponsiveGridItem =\n /**\n * TODO:\n * JSDOM cannot handle container queries.\n * This is a temporary workaround so that tests do not fail in the CI when jestdom throws an error\n * for failing to parse the stylesheet.\n */\n process.env.NODE_ENV !== 'test'\n ? styled(Grid.Item)<{ col: number }>`\n grid-column: span 12;\n @container (min-width: ${RESPONSIVE_CONTAINER_BREAKPOINTS.sm}) {\n ${({ col }) => col && `grid-column: span ${col};`}\n }\n `\n : styled(Grid.Item)<{ col: number }>`\n grid-column: span 12;\n `;\n\ninterface FormLayoutProps extends Pick<EditLayout, 'layout'> {\n hasBackground?: boolean;\n document: ReturnType<UseDocument>;\n}\n\nconst FormLayout = ({ layout, document, hasBackground = true }: FormLayoutProps) => {\n const { formatMessage } = useIntl();\n const modelUid = document.schema?.uid;\n\n return (\n <Flex direction=\"column\" alignItems=\"stretch\" gap={6}>\n {layout.map((panel, index) => {\n if (panel.some((row) => row.some((field) => field.type === 'dynamiczone'))) {\n const [row] = panel;\n const [field] = row;\n\n const fieldWithTranslatedLabel = {\n ...field,\n label: formatMessage({\n id: `content-manager.content-types.${modelUid}.${field.name}`,\n defaultMessage: field.label,\n }),\n };\n\n return (\n <Grid.Root key={field.name} gap={4}>\n <Grid.Item col={12} s={12} xs={12} direction=\"column\" alignItems=\"stretch\">\n <InputRenderer {...fieldWithTranslatedLabel} document={document} />\n </Grid.Item>\n </Grid.Root>\n );\n }\n\n return (\n <Box\n key={index}\n {...(hasBackground && {\n padding: 6,\n borderColor: 'neutral150',\n background: 'neutral0',\n hasRadius: true,\n shadow: 'tableShadow',\n })}\n >\n <Flex direction=\"column\" alignItems=\"stretch\" gap={6}>\n {panel.map((row, gridRowIndex) => (\n <ResponsiveGridRoot key={gridRowIndex} gap={4}>\n {row.map(({ size, ...field }) => {\n const fieldWithTranslatedLabel = {\n ...field,\n label: formatMessage({\n id: `content-manager.content-types.${modelUid}.${field.name}`,\n defaultMessage: field.label,\n }),\n };\n return (\n <ResponsiveGridItem\n col={size}\n key={field.name}\n s={12}\n xs={12}\n direction=\"column\"\n alignItems=\"stretch\"\n >\n <InputRenderer {...fieldWithTranslatedLabel} document={document} />\n </ResponsiveGridItem>\n );\n })}\n </ResponsiveGridRoot>\n ))}\n </Flex>\n </Box>\n );\n })}\n </Flex>\n );\n};\n\nexport { FormLayout, FormLayoutProps };\n"],"names":["RESPONSIVE_CONTAINER_BREAKPOINTS","sm","ResponsiveGridRoot","styled","Grid","Root","ResponsiveGridItem","process","env","NODE_ENV","Item","col","FormLayout","layout","document","hasBackground","formatMessage","useIntl","modelUid","schema","uid","_jsx","Flex","direction","alignItems","gap","map","panel","index","some","row","field","type","fieldWithTranslatedLabel","label","id","name","defaultMessage","s","xs","InputRenderer","Box","padding","borderColor","background","hasRadius","shadow","gridRowIndex","size"],"mappings":";;;;;;;;MAUaA,gCAAmC,GAAA;IAC9CC,EAAI,EAAA;AACN;MAEaC,kBAAqBC,GAAAA,uBAAAA,CAAOC,iBAAKC,CAAAA,IAAI,CAAC;;AAEnD;MAEaC,kBACX;;;;;MAMAC,OAAAA,CAAQC,GAAG,CAACC,QAAQ,KAAK,SACrBN,uBAAOC,CAAAA,iBAAAA,CAAKM,IAAI,CAAkB;;+BAET,EAAEV,gCAAAA,CAAiCC,EAAE,CAAC;AAC3D,UAAA,EAAE,CAAC,EAAEU,GAAG,EAAE,GAAKA,GAAAA,IAAO,CAAC,kBAAkB,EAAEA,GAAAA,CAAI,CAAC,CAAC;;AAErD,MAAA,CAAC,GACDR,uBAAAA,CAAOC,iBAAKM,CAAAA,IAAI,CAAkB;;AAElC,MAAA;AAOAE,MAAAA,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wCAAA,GAAGP,wBAAwB;wCAAEnB,QAAUA,EAAAA;;AANlDiB,iCAAAA,EAAAA,KAAAA,CAAMK,IAAI,CAAA;AASrB,6BAAA;AArBuBW,yBAAAA,EAAAA,YAAAA,CAAAA;;AAXxBnB,aAAAA,EAAAA,KAAAA,CAAAA;AAsCX,SAAA;;AAGN;;;;;;;"}
|
@@ -25,7 +25,7 @@ const ResponsiveGridItem = /**
|
|
25
25
|
`;
|
26
26
|
const FormLayout = ({ layout, document, hasBackground = true })=>{
|
27
27
|
const { formatMessage } = useIntl();
|
28
|
-
const
|
28
|
+
const modelUid = document.schema?.uid;
|
29
29
|
return /*#__PURE__*/ jsx(Flex, {
|
30
30
|
direction: "column",
|
31
31
|
alignItems: "stretch",
|
@@ -37,7 +37,7 @@ const FormLayout = ({ layout, document, hasBackground = true })=>{
|
|
37
37
|
const fieldWithTranslatedLabel = {
|
38
38
|
...field,
|
39
39
|
label: formatMessage({
|
40
|
-
id: `content-manager.content-types.${
|
40
|
+
id: `content-manager.content-types.${modelUid}.${field.name}`,
|
41
41
|
defaultMessage: field.label
|
42
42
|
})
|
43
43
|
};
|
@@ -74,7 +74,7 @@ const FormLayout = ({ layout, document, hasBackground = true })=>{
|
|
74
74
|
const fieldWithTranslatedLabel = {
|
75
75
|
...field,
|
76
76
|
label: formatMessage({
|
77
|
-
id: `content-manager.content-types.${
|
77
|
+
id: `content-manager.content-types.${modelUid}.${field.name}`,
|
78
78
|
defaultMessage: field.label
|
79
79
|
})
|
80
80
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"FormLayout.mjs","sources":["../../../../../admin/src/pages/EditView/components/FormLayout.tsx"],"sourcesContent":["import { Box, Flex, Grid } from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\nimport { styled } from 'styled-components';\n\nimport { EditLayout } from '../../../hooks/useDocumentLayout';\n\nimport { InputRenderer } from './InputRenderer';\n\nimport type { UseDocument } from '../../../hooks/useDocument';\n\nexport const RESPONSIVE_CONTAINER_BREAKPOINTS = {\n sm: '27.5rem', // 440px\n};\n\nexport const ResponsiveGridRoot = styled(Grid.Root)`\n container-type: inline-size;\n`;\n\nexport const ResponsiveGridItem =\n /**\n * TODO:\n * JSDOM cannot handle container queries.\n * This is a temporary workaround so that tests do not fail in the CI when jestdom throws an error\n * for failing to parse the stylesheet.\n */\n process.env.NODE_ENV !== 'test'\n ? styled(Grid.Item)<{ col: number }>`\n grid-column: span 12;\n @container (min-width: ${RESPONSIVE_CONTAINER_BREAKPOINTS.sm}) {\n ${({ col }) => col && `grid-column: span ${col};`}\n }\n `\n : styled(Grid.Item)<{ col: number }>`\n grid-column: span 12;\n `;\n\ninterface FormLayoutProps extends Pick<EditLayout, 'layout'> {\n hasBackground?: boolean;\n
|
1
|
+
{"version":3,"file":"FormLayout.mjs","sources":["../../../../../admin/src/pages/EditView/components/FormLayout.tsx"],"sourcesContent":["import { Box, Flex, Grid } from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\nimport { styled } from 'styled-components';\n\nimport { EditLayout } from '../../../hooks/useDocumentLayout';\n\nimport { InputRenderer } from './InputRenderer';\n\nimport type { UseDocument } from '../../../hooks/useDocument';\n\nexport const RESPONSIVE_CONTAINER_BREAKPOINTS = {\n sm: '27.5rem', // 440px\n};\n\nexport const ResponsiveGridRoot = styled(Grid.Root)`\n container-type: inline-size;\n`;\n\nexport const ResponsiveGridItem =\n /**\n * TODO:\n * JSDOM cannot handle container queries.\n * This is a temporary workaround so that tests do not fail in the CI when jestdom throws an error\n * for failing to parse the stylesheet.\n */\n process.env.NODE_ENV !== 'test'\n ? styled(Grid.Item)<{ col: number }>`\n grid-column: span 12;\n @container (min-width: ${RESPONSIVE_CONTAINER_BREAKPOINTS.sm}) {\n ${({ col }) => col && `grid-column: span ${col};`}\n }\n `\n : styled(Grid.Item)<{ col: number }>`\n grid-column: span 12;\n `;\n\ninterface FormLayoutProps extends Pick<EditLayout, 'layout'> {\n hasBackground?: boolean;\n document: ReturnType<UseDocument>;\n}\n\nconst FormLayout = ({ layout, document, hasBackground = true }: FormLayoutProps) => {\n const { formatMessage } = useIntl();\n const modelUid = document.schema?.uid;\n\n return (\n <Flex direction=\"column\" alignItems=\"stretch\" gap={6}>\n {layout.map((panel, index) => {\n if (panel.some((row) => row.some((field) => field.type === 'dynamiczone'))) {\n const [row] = panel;\n const [field] = row;\n\n const fieldWithTranslatedLabel = {\n ...field,\n label: formatMessage({\n id: `content-manager.content-types.${modelUid}.${field.name}`,\n defaultMessage: field.label,\n }),\n };\n\n return (\n <Grid.Root key={field.name} gap={4}>\n <Grid.Item col={12} s={12} xs={12} direction=\"column\" alignItems=\"stretch\">\n <InputRenderer {...fieldWithTranslatedLabel} document={document} />\n </Grid.Item>\n </Grid.Root>\n );\n }\n\n return (\n <Box\n key={index}\n {...(hasBackground && {\n padding: 6,\n borderColor: 'neutral150',\n background: 'neutral0',\n hasRadius: true,\n shadow: 'tableShadow',\n })}\n >\n <Flex direction=\"column\" alignItems=\"stretch\" gap={6}>\n {panel.map((row, gridRowIndex) => (\n <ResponsiveGridRoot key={gridRowIndex} gap={4}>\n {row.map(({ size, ...field }) => {\n const fieldWithTranslatedLabel = {\n ...field,\n label: formatMessage({\n id: `content-manager.content-types.${modelUid}.${field.name}`,\n defaultMessage: field.label,\n }),\n };\n return (\n <ResponsiveGridItem\n col={size}\n key={field.name}\n s={12}\n xs={12}\n direction=\"column\"\n alignItems=\"stretch\"\n >\n <InputRenderer {...fieldWithTranslatedLabel} document={document} />\n </ResponsiveGridItem>\n );\n })}\n </ResponsiveGridRoot>\n ))}\n </Flex>\n </Box>\n );\n })}\n </Flex>\n );\n};\n\nexport { FormLayout, FormLayoutProps };\n"],"names":["RESPONSIVE_CONTAINER_BREAKPOINTS","sm","ResponsiveGridRoot","styled","Grid","Root","ResponsiveGridItem","process","env","NODE_ENV","Item","col","FormLayout","layout","document","hasBackground","formatMessage","useIntl","modelUid","schema","uid","_jsx","Flex","direction","alignItems","gap","map","panel","index","some","row","field","type","fieldWithTranslatedLabel","label","id","name","defaultMessage","s","xs","InputRenderer","Box","padding","borderColor","background","hasRadius","shadow","gridRowIndex","size"],"mappings":";;;;;;MAUaA,gCAAmC,GAAA;IAC9CC,EAAI,EAAA;AACN;MAEaC,kBAAqBC,GAAAA,MAAAA,CAAOC,IAAKC,CAAAA,IAAI,CAAC;;AAEnD;MAEaC,kBACX;;;;;MAMAC,OAAAA,CAAQC,GAAG,CAACC,QAAQ,KAAK,SACrBN,MAAOC,CAAAA,IAAAA,CAAKM,IAAI,CAAkB;;+BAET,EAAEV,gCAAAA,CAAiCC,EAAE,CAAC;AAC3D,UAAA,EAAE,CAAC,EAAEU,GAAG,EAAE,GAAKA,GAAAA,IAAO,CAAC,kBAAkB,EAAEA,GAAAA,CAAI,CAAC,CAAC;;AAErD,MAAA,CAAC,GACDR,MAAAA,CAAOC,IAAKM,CAAAA,IAAI,CAAkB;;AAElC,MAAA;AAOAE,MAAAA,UAAAA,GAAa,CAAC,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,aAAgB,GAAA,IAAI,EAAmB,GAAA;IAC7E,MAAM,EAAEC,aAAa,EAAE,GAAGC,OAAAA,EAAAA;IAC1B,MAAMC,QAAAA,GAAWJ,QAASK,CAAAA,MAAM,EAAEC,GAAAA;AAElC,IAAA,qBACEC,GAACC,CAAAA,IAAAA,EAAAA;QAAKC,SAAU,EAAA,QAAA;QAASC,UAAW,EAAA,SAAA;QAAUC,GAAK,EAAA,CAAA;kBAChDZ,MAAOa,CAAAA,GAAG,CAAC,CAACC,KAAOC,EAAAA,KAAAA,GAAAA;AAClB,YAAA,IAAID,KAAME,CAAAA,IAAI,CAAC,CAACC,GAAQA,GAAAA,GAAAA,CAAID,IAAI,CAAC,CAACE,KAAAA,GAAUA,KAAMC,CAAAA,IAAI,KAAK,aAAiB,CAAA,CAAA,EAAA;gBAC1E,MAAM,CAACF,IAAI,GAAGH,KAAAA;gBACd,MAAM,CAACI,MAAM,GAAGD,GAAAA;AAEh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GAAG,CAAC,CAAC,EAAEsB,IAAI,EAAE,GAAGjB,KAAO,EAAA,GAAA;AAC1B,gCAAA,MAAME,wBAA2B,GAAA;AAC/B,oCAAA,GAAGF,KAAK;AACRG,oCAAAA,KAAAA,EAAOlB,aAAc,CAAA;wCACnBmB,EAAI,EAAA,CAAC,8BAA8B,EAAEjB,QAAAA,CAAS,CAAC,EAAEa,KAAAA,CAAMK,IAAI,CAAC,CAAC;AAC7DC,wCAAAA,cAAAA,EAAgBN,MAAMG;AACxB,qCAAA;AACF,iCAAA;AACA,gCAAA,qBACEb,GAACf,CAAAA,kBAAAA,EAAAA;oCACCK,GAAKqC,EAAAA,IAAAA;oCAELV,CAAG,EAAA,EAAA;oCACHC,EAAI,EAAA,EAAA;oCACJhB,SAAU,EAAA,QAAA;oCACVC,UAAW,EAAA,SAAA;AAEX,oCAAA,QAAA,gBAAAH,GAACmB,CAAAA,qBAAAA,EAAAA;AAAe,wCAAA,GAAGP,wBAAwB;wCAAEnB,QAAUA,EAAAA;;AANlDiB,iCAAAA,EAAAA,KAAAA,CAAMK,IAAI,CAAA;AASrB,6BAAA;AArBuBW,yBAAAA,EAAAA,YAAAA,CAAAA;;AAXxBnB,aAAAA,EAAAA,KAAAA,CAAAA;AAsCX,SAAA;;AAGN;;;;"}
|
@@ -7,12 +7,16 @@ interface State {
|
|
7
7
|
confirmDialogIntent: null | 'close' | 'back' | 'navigate' | DocumentMeta;
|
8
8
|
isModalOpen: boolean;
|
9
9
|
hasUnsavedChanges: boolean;
|
10
|
+
fieldToConnect?: string;
|
11
|
+
fieldToConnectUID?: string;
|
10
12
|
}
|
11
13
|
type Action = {
|
12
14
|
type: 'GO_TO_RELATION';
|
13
15
|
payload: {
|
14
16
|
document: DocumentMeta;
|
15
17
|
shouldBypassConfirmation: boolean;
|
18
|
+
fieldToConnect?: string;
|
19
|
+
fieldToConnectUID?: string;
|
16
20
|
};
|
17
21
|
} | {
|
18
22
|
type: 'GO_BACK';
|
@@ -21,6 +25,14 @@ type Action = {
|
|
21
25
|
};
|
22
26
|
} | {
|
23
27
|
type: 'GO_FULL_PAGE';
|
28
|
+
} | {
|
29
|
+
type: 'GO_TO_CREATED_RELATION';
|
30
|
+
payload: {
|
31
|
+
document: DocumentMeta;
|
32
|
+
shouldBypassConfirmation: boolean;
|
33
|
+
fieldToConnect?: string;
|
34
|
+
fieldToConnectUID?: string;
|
35
|
+
};
|
24
36
|
} | {
|
25
37
|
type: 'CANCEL_CONFIRM_DIALOG';
|
26
38
|
} | {
|
@@ -42,12 +54,21 @@ interface RelationModalContextValue {
|
|
42
54
|
currentDocumentMeta: DocumentMeta;
|
43
55
|
currentDocument: ReturnType<UseDocument>;
|
44
56
|
onPreview?: () => void;
|
57
|
+
isCreating: boolean;
|
45
58
|
}
|
46
59
|
declare const useRelationModal: <Selected, ShouldThrow extends boolean = true>(consumerName: string, selector: (value: RelationModalContextValue) => Selected, shouldThrowOnMissingContext?: ShouldThrow | undefined) => ShouldThrow extends true ? Selected : Selected | undefined;
|
47
|
-
|
48
|
-
children: React.ReactNode;
|
60
|
+
type RelationModalRendererProps = {
|
49
61
|
relation: DocumentMeta;
|
50
|
-
|
51
|
-
|
52
|
-
|
62
|
+
children: React.ReactNode;
|
63
|
+
} | {
|
64
|
+
relation?: never;
|
65
|
+
children: (props: {
|
66
|
+
dispatch: (action: Action) => void;
|
67
|
+
}) => React.ReactNode;
|
68
|
+
};
|
69
|
+
/**
|
70
|
+
* Component responsible for rendering its children wrapped in a modal, form and context if needed
|
71
|
+
*/
|
72
|
+
declare const RelationModalRenderer: (props: RelationModalRendererProps) => import("react/jsx-runtime").JSX.Element;
|
73
|
+
export { reducer, RelationModalRenderer, useRelationModal };
|
53
74
|
export type { State, Action };
|
@@ -31,7 +31,6 @@ export declare const ResponsiveGridItem: import("styled-components").IStyledComp
|
|
31
31
|
}>> & Omit<Grid.ItemComponent<"div">, keyof import("react").Component<any, {}, any>>;
|
32
32
|
interface FormLayoutProps extends Pick<EditLayout, 'layout'> {
|
33
33
|
hasBackground?: boolean;
|
34
|
-
model?: string;
|
35
34
|
document: ReturnType<UseDocument>;
|
36
35
|
}
|
37
36
|
declare const FormLayout: ({ layout, document, hasBackground }: FormLayoutProps) => import("react/jsx-runtime").JSX.Element;
|
@@ -256,7 +256,8 @@ var en = {
|
|
256
256
|
"preview.tabs.label": "Preview status",
|
257
257
|
"preview.content.close-editor": "Close editor",
|
258
258
|
"preview.content.open-editor": "Open editor",
|
259
|
-
"relation.
|
259
|
+
"relation.create": "Create a relation",
|
260
|
+
"relation.add": "Add or create a relation",
|
260
261
|
"relation.disconnect": "Remove",
|
261
262
|
"relation.error-adding-relation": "An error occurred while trying to add the relation.",
|
262
263
|
"relation.isLoading": "Relations are loading",
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"en.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"en.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
@@ -252,7 +252,8 @@ var en = {
|
|
252
252
|
"preview.tabs.label": "Preview status",
|
253
253
|
"preview.content.close-editor": "Close editor",
|
254
254
|
"preview.content.open-editor": "Open editor",
|
255
|
-
"relation.
|
255
|
+
"relation.create": "Create a relation",
|
256
|
+
"relation.add": "Add or create a relation",
|
256
257
|
"relation.disconnect": "Remove",
|
257
258
|
"relation.error-adding-relation": "An error occurred while trying to add the relation.",
|
258
259
|
"relation.isLoading": "Relations are loading",
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"en.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"en.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|