@mattisvensson/strapi-plugin-webatlas 0.1.4 → 0.1.5

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.
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const React = require("react");
5
+ const admin = require("@strapi/strapi/admin");
6
+ const designSystem = require("@strapi/design-system");
7
+ const icons = require("@strapi/icons");
8
+ const index = require("./index-CAeHuae_.js");
9
+ const Routes = () => {
10
+ const { getRoutes } = index.useApi();
11
+ const [routes, setRoutes] = React.useState([]);
12
+ React.useEffect(() => {
13
+ async function fetchRoutes() {
14
+ const data = await getRoutes();
15
+ setRoutes(data);
16
+ }
17
+ fetchRoutes();
18
+ }, []);
19
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
20
+ /* @__PURE__ */ jsxRuntime.jsx(
21
+ admin.Layouts.Header,
22
+ {
23
+ title: "Routes",
24
+ subtitle: "Overview of all existing routes"
25
+ }
26
+ ),
27
+ /* @__PURE__ */ jsxRuntime.jsx(admin.Layouts.Content, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Table, { colCount: 6, rowCount: routes.length, children: [
28
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Thead, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Tr, { children: [
29
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Th, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", children: "ID" }) }),
30
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Th, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", children: "Title" }) }),
31
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Th, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", children: "Route" }) }),
32
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Th, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", children: "Internal" }) }),
33
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Th, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", children: "Active" }) }),
34
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Th, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.VisuallyHidden, { children: "Actions" }) })
35
+ ] }) }),
36
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tbody, { children: routes.map((route) => /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Tr, { children: [
37
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral800", children: route.id }) }),
38
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral800", children: route.title }) }),
39
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral800", children: route.fullPath }) }),
40
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral800", children: route.internal ? "Yes" : "No" }) }),
41
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral800", children: route.active ? "Yes" : "No" }) }),
42
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { gap: 2, justifyContent: "end", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.LinkButton, { variant: "secondary", startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Pencil, {}), href: `/admin/content-manager/collection-types/${route.relatedContentType}/${route.relatedId}`, children: "Edit" }) }) })
43
+ ] }, route.id)) })
44
+ ] }) })
45
+ ] });
46
+ };
47
+ exports.default = Routes;
48
+ //# sourceMappingURL=index-BuVQnQLC.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-BuVQnQLC.js","sources":["../../admin/src/pages/Routes/index.tsx"],"sourcesContent":["/*\n *\n * Routes\n * This file contains the Routes page of the Webatlas plugin for Strapi.\n * It displays a table of all existing routes with their details and allows editing.\n *\n*/\n\nimport { useState, useEffect } from 'react';\nimport { useFetchClient, Layouts } from '@strapi/strapi/admin';\nimport { Flex, Typography, Table, Thead, Tbody, Tr, Td, Th, VisuallyHidden, LinkButton } from '@strapi/design-system';\nimport { Pencil } from '@strapi/icons';\nimport { Route } from '../../../../types';\nimport { useApi } from '../../hooks';\n\nconst Routes = () => {\n const { getRoutes } = useApi();\n\n const [routes, setRoutes] = useState([]);\n\n useEffect(() => {\n async function fetchRoutes() {\n const data = await getRoutes();\n setRoutes(data);\n }\n fetchRoutes();\n }, [])\n\n return (\n <>\n <Layouts.Header\n title='Routes'\n subtitle='Overview of all existing routes'\n />\n <Layouts.Content>\n <Table colCount={6} rowCount={routes.length}>\n <Thead>\n <Tr>\n <Th>\n <Typography variant=\"sigma\">ID</Typography>\n </Th>\n <Th>\n <Typography variant=\"sigma\">Title</Typography>\n </Th>\n <Th>\n <Typography variant=\"sigma\">Route</Typography>\n </Th>\n <Th>\n <Typography variant=\"sigma\">Internal</Typography>\n </Th>\n <Th>\n <Typography variant=\"sigma\">Active</Typography>\n </Th>\n <Th>\n <VisuallyHidden>Actions</VisuallyHidden>\n </Th>\n </Tr>\n </Thead>\n <Tbody>\n {routes.map((route: Route) => <Tr key={route.id}>\n <Td>\n <Typography textColor=\"neutral800\">{route.id}</Typography>\n </Td>\n <Td>\n <Typography textColor=\"neutral800\">{route.title}</Typography>\n </Td>\n <Td>\n <Typography textColor=\"neutral800\">{route.fullPath}</Typography>\n </Td>\n <Td>\n <Typography textColor=\"neutral800\">{route.internal ? 'Yes' : 'No'}</Typography>\n </Td>\n <Td>\n <Typography textColor=\"neutral800\">{route.active ? 'Yes' : 'No'}</Typography>\n </Td>\n <Td>\n <Flex gap={2} justifyContent=\"end\">\n {/* <Button variant=\"secondary\">More info</Button> */}\n <LinkButton variant=\"secondary\" startIcon={<Pencil />} href={`/admin/content-manager/collection-types/${route.relatedContentType}/${route.relatedId}`}>Edit</LinkButton>\n </Flex>\n </Td>\n </Tr>)}\n </Tbody>\n </Table>\n </Layouts.Content>\n </>\n );\n};\n\nexport default Routes;"],"names":["useApi","useState","useEffect","jsxs","Fragment","jsx","Layouts","Table","Thead","Tr","Th","Typography","VisuallyHidden","Tbody","Td","Flex","LinkButton","Pencil"],"mappings":";;;;;;;;AAeA,MAAM,SAAS,MAAM;AACb,QAAA,EAAE,UAAU,IAAIA,aAAO;AAE7B,QAAM,CAAC,QAAQ,SAAS,IAAIC,MAAAA,SAAS,CAAA,CAAE;AAEvCC,QAAAA,UAAU,MAAM;AACd,mBAAe,cAAc;AACrB,YAAA,OAAO,MAAM,UAAU;AAC7B,gBAAU,IAAI;AAAA,IAAA;AAEJ,gBAAA;AAAA,EACd,GAAG,EAAE;AAEL,SAEIC,2BAAA,KAAAC,qBAAA,EAAA,UAAA;AAAA,IAAAC,2BAAA;AAAA,MAACC,MAAAA,QAAQ;AAAA,MAAR;AAAA,QACC,OAAM;AAAA,QACN,UAAS;AAAA,MAAA;AAAA,IACX;AAAA,IACAD,2BAAAA,IAACC,MAAAA,QAAQ,SAAR,EACC,UAAAH,2BAAAA,KAACI,aAAAA,SAAM,UAAU,GAAG,UAAU,OAAO,QACnC,UAAA;AAAA,MAACF,2BAAA,IAAAG,aAAA,OAAA,EACC,0CAACC,aAAAA,IACC,EAAA,UAAA;AAAA,QAAAJ,2BAAAA,IAACK,mBACC,UAACL,2BAAA,IAAAM,aAAA,YAAA,EAAW,SAAQ,SAAQ,gBAAE,EAChC,CAAA;AA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