@lightnet/sveltia-admin 4.2.3 → 4.4.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/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # @lightnet/sveltia-admin
2
2
 
3
+ ## 4.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#475](https://github.com/LightNetDev/LightNet/pull/475) [`24a5813`](https://github.com/LightNetDev/LightNet/commit/24a58138e83824c7f740b77c2373f152c6d02eb7) - Support `SoftwareApplication` and `WebPage` as media type structured data classifications in JSON definitions and the admin interface. For these types, use the first content entry's HTTP(S) link as the resource URL and identify the LightNet detail page with `mainEntityOfPage`. Retain the detail URL when the first entry is an upload or has no valid HTTP(S) URL.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [[`24a5813`](https://github.com/LightNetDev/LightNet/commit/24a58138e83824c7f740b77c2373f152c6d02eb7)]:
12
+ - lightnet@4.9.0
13
+
14
+ ## 4.3.0
15
+
16
+ ### Minor Changes
17
+
18
+ - [#473](https://github.com/LightNetDev/LightNet/pull/473) [`9e673cf`](https://github.com/LightNetDev/LightNet/commit/9e673cfdc58cab88f96d2f3a22d23b327be626a6) - Add an optional `schemaType` field to media types, supporting `CreativeWork`, `Book`, `Article`, `DigitalDocument`, `AudioObject`, `VideoObject`, and `ImageObject`. Explicit types determine the main JSON-LD type independently of the page layout, while audio, video, and document files retain their own types. Omitting the field preserves automatic inference. The field is also available in the admin interface.
19
+
20
+ ### Patch Changes
21
+
22
+ - [#473](https://github.com/LightNetDev/LightNet/pull/473) [`9e673cf`](https://github.com/LightNetDev/LightNet/commit/9e673cfdc58cab88f96d2f3a22d23b327be626a6) - Removed behaviour around adding Astro base path.
23
+
24
+ - [#473](https://github.com/LightNetDev/LightNet/pull/473) [`9e673cf`](https://github.com/LightNetDev/LightNet/commit/9e673cfdc58cab88f96d2f3a22d23b327be626a6) - Update dependencies.
25
+ - Updated dependencies [[`9e673cf`](https://github.com/LightNetDev/LightNet/commit/9e673cfdc58cab88f96d2f3a22d23b327be626a6), [`9e673cf`](https://github.com/LightNetDev/LightNet/commit/9e673cfdc58cab88f96d2f3a22d23b327be626a6), [`9e673cf`](https://github.com/LightNetDev/LightNet/commit/9e673cfdc58cab88f96d2f3a22d23b327be626a6), [`9e673cf`](https://github.com/LightNetDev/LightNet/commit/9e673cfdc58cab88f96d2f3a22d23b327be626a6), [`9e673cf`](https://github.com/LightNetDev/LightNet/commit/9e673cfdc58cab88f96d2f3a22d23b327be626a6), [`9e673cf`](https://github.com/LightNetDev/LightNet/commit/9e673cfdc58cab88f96d2f3a22d23b327be626a6)]:
26
+ - lightnet@4.8.0
27
+
3
28
  ## 4.2.3
4
29
 
5
30
  ### Patch Changes
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Admin UI for LightNet based on Sveltia CMS.",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
- "version": "4.2.3",
6
+ "version": "4.4.0",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
@@ -32,16 +32,16 @@
32
32
  },
33
33
  "peerDependencies": {
34
34
  "astro": "^6.0.0",
35
- "lightnet": "^4.6.2"
35
+ "lightnet": "^4.9.0"
36
36
  },
37
37
  "dependencies": {
38
- "@sveltia/cms": "0.248.0"
38
+ "@sveltia/cms": "0.256.1"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@internal/e2e-test-utils": "^0.0.1",
42
42
  "@playwright/test": "^1.64.1",
43
43
  "astro": "^6.4.8",
44
- "lightnet": "^4.6.2",
44
+ "lightnet": "^4.9.0",
45
45
  "typescript": "^6.0.3",
46
46
  "vitest": "^5.0.5"
47
47
  },
package/src/Admin.astro CHANGED
@@ -1,7 +1,5 @@
1
1
  ---
2
2
  import config from "virtual:lightnet/sveltiaAdminConfig"
3
-
4
- import { pathWithBase } from "./utils/path-with-base"
5
3
  ---
6
4
 
7
5
  <!doctype html>
@@ -12,7 +10,7 @@ import { pathWithBase } from "./utils/path-with-base"
12
10
  <meta name="robots" content="noindex" />
13
11
  <title>LightNet Administration</title>
14
12
  <link
15
- href={pathWithBase(`/${config.path}/config.json`)}
13
+ href={`/${config.path}/config.json`}
16
14
  type="application/json"
17
15
  rel="cms-config-url"
18
16
  />
package/src/admin.html.ts CHANGED
@@ -3,8 +3,6 @@ import { readFile } from "node:fs/promises"
3
3
  import type { APIRoute } from "astro"
4
4
  import config from "virtual:lightnet/sveltiaAdminConfig"
5
5
 
6
- import { pathWithBase } from "./utils/path-with-base"
7
-
8
6
  let sveltiaScriptUrl = ""
9
7
  const getSveltiaScriptUrl = async () => {
10
8
  // The package does not export package.json. Resolve its entry first so this
@@ -21,7 +19,7 @@ const getSveltiaScriptUrl = async () => {
21
19
  }
22
20
 
23
21
  export const GET: APIRoute = async () => {
24
- const configUrl = pathWithBase(`/${config.path}/config.json`)
22
+ const configUrl = `/${config.path}/config.json`
25
23
  const scriptUrl = await getSveltiaScriptUrl()
26
24
 
27
25
  return new Response(
@@ -19,6 +19,24 @@ export const mediaTypeCollection: Collection = {
19
19
  summary: translatedLabel(),
20
20
  fields: [
21
21
  inlineTranslation({ name: "label", label: "Name" }),
22
+ {
23
+ name: "schemaType",
24
+ label: "Structured Data Type",
25
+ widget: "select",
26
+ required: false,
27
+ options: [
28
+ { label: "General creative work", value: "CreativeWork" },
29
+ { label: "Book", value: "Book" },
30
+ { label: "Article", value: "Article" },
31
+ { label: "Digital document", value: "DigitalDocument" },
32
+ { label: "Audio recording", value: "AudioObject" },
33
+ { label: "Video recording", value: "VideoObject" },
34
+ { label: "Image", value: "ImageObject" },
35
+ { label: "Software application", value: "SoftwareApplication" },
36
+ { label: "Web page", value: "WebPage" },
37
+ ],
38
+ hint: "Describe what the media items are. Leave empty to infer the type from the details page layout and content.",
39
+ },
22
40
  {
23
41
  name: "icon",
24
42
  label: "Icon",
@@ -1,15 +0,0 @@
1
- /**
2
- * Prefix a site-internal path with Astro's configured base path.
3
- *
4
- * This helper trims any trailing slash from `BASE_URL`, ensures the input
5
- * path starts with a leading slash, and concatenates the two values.
6
- * Absolute URLs are out of scope for this helper.
7
- *
8
- * @param path internal path such as "/en/media", "/api/internal/search.json", or "/"
9
- * @returns base-aware internal path
10
- */
11
- export function pathWithBase(path: string) {
12
- const normalizedBase = import.meta.env.BASE_URL.replace(/\/+$/, "")
13
- const normalizedPath = path.startsWith("/") ? path : `/${path}`
14
- return `${normalizedBase}${normalizedPath}`
15
- }