@mattisvensson/strapi-plugin-webatlas 0.2.5 → 0.3.0
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/README.md +2 -3
- package/dist/_chunks/{_baseConvert-DVIhGQH6.js.map → _baseConvert-B84_vf8X.js.map} +1 -1
- package/dist/_chunks/{_baseConvert-CDjccxdO.mjs.map → _baseConvert-C2SW1VHq.mjs.map} +1 -1
- package/dist/_chunks/de-4tL_cJTC.js +104 -0
- package/dist/_chunks/de-4tL_cJTC.js.map +1 -0
- package/dist/_chunks/de-C8PE3n3B.mjs +104 -0
- package/dist/_chunks/de-C8PE3n3B.mjs.map +1 -0
- package/dist/_chunks/en-Bg4z3fR7.js +104 -0
- package/dist/_chunks/en-Bg4z3fR7.js.map +1 -0
- package/dist/_chunks/en-CR1YZvJo.mjs +104 -0
- package/dist/_chunks/en-CR1YZvJo.mjs.map +1 -0
- package/dist/_chunks/{index-B-ABW-o6.js → index-B0XE_zRP.js} +298 -91
- package/dist/_chunks/index-B2Tiv3EK.mjs +92 -0
- package/dist/_chunks/{index-HHBjOGX5.mjs → index-B48CGofU.mjs} +70 -30
- package/dist/_chunks/{index-HHBjOGX5.mjs.map → index-B48CGofU.mjs.map} +1 -1
- package/dist/_chunks/{index-CAjBRbaH.js → index-B85fJxGa.js} +170 -77
- package/dist/_chunks/{index-Cs_oxZfX.js → index-BbM9Sn1t.js} +169 -108
- package/dist/_chunks/{index-BxuR805w.mjs → index-BocSkZOu.mjs} +57 -17
- package/dist/_chunks/{index-D_OdzeaU.mjs → index-C7B8QHDT.mjs} +296 -89
- package/dist/_chunks/{index-BjbgWZrg.mjs → index-CCiDvLAC.mjs} +171 -78
- package/dist/_chunks/index-CXzNr2cH.mjs +93 -0
- package/dist/_chunks/index-CXzNr2cH.mjs.map +1 -0
- package/dist/_chunks/{index-kz3NL7uv.js → index-Cd6y6nuf.js} +57 -8
- package/dist/_chunks/index-Cd6y6nuf.js.map +1 -0
- package/dist/_chunks/{index-CPE1Ne_e.js → index-Cf9ZIBLd.js} +171 -78
- package/dist/_chunks/index-Cf9ZIBLd.js.map +1 -0
- package/dist/_chunks/{index-yLrZAFVv.mjs → index-D981K4TK.mjs} +172 -79
- package/dist/_chunks/index-D981K4TK.mjs.map +1 -0
- package/dist/_chunks/{index-Djk_-mU6.js → index-DGb8ESH-.js} +56 -9
- package/dist/_chunks/{index-CuMn96qA.js → index-DYiJBXKE.js} +300 -93
- package/dist/_chunks/index-DYiJBXKE.js.map +1 -0
- package/dist/_chunks/{index-B7vKSyAn.js → index-DjZ3ZaVB.js} +60 -20
- package/dist/_chunks/{index-B7vKSyAn.js.map → index-DjZ3ZaVB.js.map} +1 -1
- package/dist/_chunks/{index-ChOgKZGK.mjs → index-DkhJl5mF.mjs} +298 -91
- package/dist/_chunks/index-DkhJl5mF.mjs.map +1 -0
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/components/CMEditViewAside/Alias.d.ts +1 -1
- package/dist/admin/src/components/URLInfo.d.ts +2 -1
- package/dist/admin/src/components/modals/NavModal.d.ts +2 -1
- package/dist/admin/src/utils/getRouteType.d.ts +2 -0
- package/dist/admin/src/utils/index.d.ts +2 -1
- package/dist/server/index.js +23 -12
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +23 -12
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/src/content-types/index.d.ts +5 -5
- package/dist/server/src/content-types/navigation/index.d.ts +1 -1
- package/dist/server/src/content-types/navigation/schema.d.ts +1 -1
- package/dist/server/src/content-types/navitem/index.d.ts +3 -3
- package/dist/server/src/content-types/navitem/schema.d.ts +3 -3
- package/dist/server/src/content-types/route/index.d.ts +1 -1
- package/dist/server/src/content-types/route/schema.d.ts +1 -1
- package/dist/server/src/index.d.ts +5 -5
- package/package.json +1 -1
- package/dist/_chunks/_baseConvert-CDjccxdO.mjs +0 -859
- package/dist/_chunks/_baseConvert-DVIhGQH6.js +0 -858
- package/dist/_chunks/en-B4KWt_jN.js +0 -4
- package/dist/_chunks/en-B4KWt_jN.js.map +0 -1
- package/dist/_chunks/en-Byx4XI2L.mjs +0 -4
- package/dist/_chunks/en-Byx4XI2L.mjs.map +0 -1
- package/dist/_chunks/index-1VNPebOd.mjs +0 -45
- package/dist/_chunks/index-1VNPebOd.mjs.map +0 -1
- package/dist/_chunks/index-B5ilx6DT.mjs +0 -44
- package/dist/_chunks/index-CPE1Ne_e.js.map +0 -1
- package/dist/_chunks/index-ChOgKZGK.mjs.map +0 -1
- package/dist/_chunks/index-CuMn96qA.js.map +0 -1
- package/dist/_chunks/index-Djk_-mU6.js.map +0 -1
- package/dist/_chunks/index-yLrZAFVv.mjs.map +0 -1
package/dist/admin/index.js
CHANGED
package/dist/admin/index.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
interface URLInfoProps {
|
|
2
2
|
validationState: 'initial' | 'checking' | 'done';
|
|
3
3
|
replacement: string;
|
|
4
|
+
setUrlStatus?: (isValid: 'valid' | 'invalid') => void;
|
|
4
5
|
}
|
|
5
|
-
export default function URLInfo({ validationState, replacement }: URLInfoProps): import("react/jsx-runtime").JSX.Element
|
|
6
|
+
export default function URLInfo({ validationState, replacement, setUrlStatus }: URLInfoProps): import("react/jsx-runtime").JSX.Element;
|
|
6
7
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export default function NavModal({ triggerText, triggerVariant, confirmText, closeText, titleText, loadingText, children, onConfirm, loading, modalToOpen, footer, currentModalType, }: {
|
|
2
|
+
export default function NavModal({ triggerText, triggerVariant, confirmText, closeText, titleText, loadingText, children, onConfirm, loading, modalToOpen, footer, currentModalType, currentModalMode, }: {
|
|
3
3
|
triggerText?: string;
|
|
4
4
|
triggerVariant?: "primary" | "secondary";
|
|
5
5
|
confirmText: string;
|
|
@@ -12,4 +12,5 @@ export default function NavModal({ triggerText, triggerVariant, confirmText, clo
|
|
|
12
12
|
modalToOpen?: string;
|
|
13
13
|
footer?: React.ReactNode;
|
|
14
14
|
currentModalType?: 'ItemCreate' | 'WrapperCreate' | 'ExternalCreate' | null;
|
|
15
|
+
currentModalMode?: 'create' | 'edit';
|
|
15
16
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,4 +3,5 @@ import duplicateCheck from "./duplicateCheck";
|
|
|
3
3
|
import { isNestedNavigation, isNestedNavItem } from "./typeChecks";
|
|
4
4
|
import getTranslation from "./getTranslation";
|
|
5
5
|
import countChildren from "./countChildren";
|
|
6
|
-
|
|
6
|
+
import getRouteType from "./getRouteType";
|
|
7
|
+
export { debounce, duplicateCheck, isNestedNavigation, isNestedNavItem, getTranslation, countChildren, getRouteType };
|
package/dist/server/index.js
CHANGED
|
@@ -20,7 +20,7 @@ function transformToUrl(input) {
|
|
|
20
20
|
input = input.replace(/-+/g, "-");
|
|
21
21
|
return input;
|
|
22
22
|
}
|
|
23
|
-
const version = "0.
|
|
23
|
+
const version = "0.3.0";
|
|
24
24
|
const keywords = [];
|
|
25
25
|
const type = "commonjs";
|
|
26
26
|
const exports$1 = {
|
|
@@ -974,10 +974,10 @@ const schema$2 = {
|
|
|
974
974
|
},
|
|
975
975
|
navitem: {
|
|
976
976
|
type: "relation",
|
|
977
|
-
|
|
977
|
+
configurable: true,
|
|
978
|
+
relation: "oneToMany",
|
|
978
979
|
target: "plugin::webatlas.navitem",
|
|
979
|
-
mappedBy: "route"
|
|
980
|
-
configurable: false
|
|
980
|
+
mappedBy: "route"
|
|
981
981
|
},
|
|
982
982
|
wrapper: {
|
|
983
983
|
type: "boolean",
|
|
@@ -1028,10 +1028,10 @@ const schema$1 = {
|
|
|
1028
1028
|
},
|
|
1029
1029
|
items: {
|
|
1030
1030
|
type: "relation",
|
|
1031
|
+
configurable: false,
|
|
1031
1032
|
relation: "oneToMany",
|
|
1032
1033
|
target: "plugin::webatlas.navitem",
|
|
1033
|
-
|
|
1034
|
-
mappedBy: "plugin::webatlas.navigation"
|
|
1034
|
+
mappedBy: "navigation"
|
|
1035
1035
|
}
|
|
1036
1036
|
}
|
|
1037
1037
|
};
|
|
@@ -1061,23 +1061,23 @@ const schema = {
|
|
|
1061
1061
|
attributes: {
|
|
1062
1062
|
navigation: {
|
|
1063
1063
|
type: "relation",
|
|
1064
|
+
configurable: false,
|
|
1064
1065
|
relation: "manyToOne",
|
|
1065
1066
|
target: "plugin::webatlas.navigation",
|
|
1066
|
-
configurable: false,
|
|
1067
1067
|
inversedBy: "items"
|
|
1068
1068
|
},
|
|
1069
1069
|
route: {
|
|
1070
1070
|
type: "relation",
|
|
1071
|
-
|
|
1071
|
+
configurable: false,
|
|
1072
|
+
relation: "manyToOne",
|
|
1072
1073
|
target: "plugin::webatlas.route",
|
|
1073
|
-
inversedBy: "navitem"
|
|
1074
|
-
configurable: false
|
|
1074
|
+
inversedBy: "navitem"
|
|
1075
1075
|
},
|
|
1076
1076
|
parent: {
|
|
1077
1077
|
type: "relation",
|
|
1078
|
+
configurable: false,
|
|
1078
1079
|
relation: "oneToOne",
|
|
1079
|
-
target: "plugin::webatlas.navitem"
|
|
1080
|
-
configurable: false
|
|
1080
|
+
target: "plugin::webatlas.navitem"
|
|
1081
1081
|
},
|
|
1082
1082
|
order: {
|
|
1083
1083
|
type: "integer",
|
|
@@ -1482,6 +1482,7 @@ const sortItems = (items) => {
|
|
|
1482
1482
|
function extractRouteAndItems(items) {
|
|
1483
1483
|
return items.map((item) => {
|
|
1484
1484
|
const route2 = { ...item.route };
|
|
1485
|
+
if (!route2) return null;
|
|
1485
1486
|
if (item.depth) {
|
|
1486
1487
|
route2.depth = item.depth;
|
|
1487
1488
|
}
|
|
@@ -5666,6 +5667,16 @@ const admin = ({ strapi: strapi2 }) => ({
|
|
|
5666
5667
|
},
|
|
5667
5668
|
async deleteNavigation(documentId) {
|
|
5668
5669
|
try {
|
|
5670
|
+
const navigation2 = await strapi2.documents(waNavigation).findOne({
|
|
5671
|
+
documentId,
|
|
5672
|
+
populate: ["items"]
|
|
5673
|
+
});
|
|
5674
|
+
if (!navigation2) throw new Error("Navigation not found");
|
|
5675
|
+
for (const item of navigation2.items) {
|
|
5676
|
+
await strapi2.documents(waNavItem).delete({
|
|
5677
|
+
documentId: item.documentId
|
|
5678
|
+
});
|
|
5679
|
+
}
|
|
5669
5680
|
return await strapi2.documents(waNavigation).delete({
|
|
5670
5681
|
documentId
|
|
5671
5682
|
});
|