@cube-drone/marquee-html-renderer 0.7.0 → 0.7.2
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/profile.d.ts +4 -0
- package/dist/profile.js +4 -2
- package/dist/render.js +3 -1
- package/package.json +5 -5
- package/src/profile.ts +8 -2
- package/src/render.ts +3 -1
package/dist/profile.d.ts
CHANGED
|
@@ -2,6 +2,10 @@ import type { Attrs } from "@cube-drone/marquee-parser";
|
|
|
2
2
|
export interface MediaResolution {
|
|
3
3
|
kind: "image" | "audio" | "video";
|
|
4
4
|
url: string;
|
|
5
|
+
/** A video that is really a silent animation (a gif that became a video):
|
|
6
|
+
* drawn looping, muted, autoplaying, with no controls. The embedder decides -
|
|
7
|
+
* the language only carries the choice. Ignored for images and audio. */
|
|
8
|
+
loop?: boolean;
|
|
5
9
|
}
|
|
6
10
|
export type TurbolinkLevel = "full" | "title" | "bare";
|
|
7
11
|
/** What an emoji slug becomes: replacement text, or a custom-emoji image. */
|
package/dist/profile.js
CHANGED
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
// meaning, the embedder defines policy. Every render-time capability
|
|
3
3
|
// decision routes through here; the renderer itself never fetches, never
|
|
4
4
|
// guesses trust, never widens a scheme allowlist.
|
|
5
|
+
// Mirror of the Rust renderer's table (rust/html_renderer/src/profile.rs). `apng` and
|
|
6
|
+
// `opus` joined 2026-09-03: ringtome mints both and they rendered as the placeholder.
|
|
5
7
|
const MEDIA_KINDS = {
|
|
6
8
|
png: "image", jpg: "image", jpeg: "image", gif: "image", webp: "image",
|
|
7
|
-
avif: "image", svg: "image",
|
|
8
|
-
mp3: "audio", ogg: "audio", wav: "audio", flac: "audio", m4a: "audio",
|
|
9
|
+
avif: "image", apng: "image", svg: "image",
|
|
10
|
+
mp3: "audio", ogg: "audio", opus: "audio", wav: "audio", flac: "audio", m4a: "audio",
|
|
9
11
|
mp4: "video", webm: "video",
|
|
10
12
|
};
|
|
11
13
|
function scheme(target) {
|
package/dist/render.js
CHANGED
|
@@ -205,7 +205,9 @@ function embed(target, alt, profile) {
|
|
|
205
205
|
case "audio":
|
|
206
206
|
return `<audio class="mq-embed" controls src="${url}" aria-label="${escapeAttr(alt)}"></audio>`;
|
|
207
207
|
case "video":
|
|
208
|
-
return
|
|
208
|
+
return media.loop === true
|
|
209
|
+
? `<video class="mq-embed" autoplay loop muted playsinline src="${url}" aria-label="${escapeAttr(alt)}"></video>`
|
|
210
|
+
: `<video class="mq-embed" controls src="${url}" aria-label="${escapeAttr(alt)}"></video>`;
|
|
209
211
|
}
|
|
210
212
|
}
|
|
211
213
|
// The contractual shrug applied to media: degrade to a labeled link, or
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cube-drone/marquee-html-renderer",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"description": "Reference static HTML renderer for the Marquee markup language",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -35,12 +35,12 @@
|
|
|
35
35
|
"prepack": "npm run build"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@cube-drone/marquee-parser": "^0.7.
|
|
38
|
+
"@cube-drone/marquee-parser": "^0.7.2"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@cube-drone/marquee-css": "^0.7.
|
|
42
|
-
"@cube-drone/marquee-fonts": "^0.7.
|
|
43
|
-
"@cube-drone/marquee-turbolink": "^0.7.
|
|
41
|
+
"@cube-drone/marquee-css": "^0.7.2",
|
|
42
|
+
"@cube-drone/marquee-fonts": "^0.7.2",
|
|
43
|
+
"@cube-drone/marquee-turbolink": "^0.7.2",
|
|
44
44
|
"@types/node": "^24.0.0",
|
|
45
45
|
"typescript": "^5.9.0"
|
|
46
46
|
}
|
package/src/profile.ts
CHANGED
|
@@ -8,6 +8,10 @@ import type { Attrs } from "@cube-drone/marquee-parser";
|
|
|
8
8
|
export interface MediaResolution {
|
|
9
9
|
kind: "image" | "audio" | "video";
|
|
10
10
|
url: string;
|
|
11
|
+
/** A video that is really a silent animation (a gif that became a video):
|
|
12
|
+
* drawn looping, muted, autoplaying, with no controls. The embedder decides -
|
|
13
|
+
* the language only carries the choice. Ignored for images and audio. */
|
|
14
|
+
loop?: boolean;
|
|
11
15
|
}
|
|
12
16
|
|
|
13
17
|
export type TurbolinkLevel = "full" | "title" | "bare";
|
|
@@ -44,10 +48,12 @@ export interface Profile {
|
|
|
44
48
|
span(name: string, attrs: Attrs, renderedChildren: string): string | null;
|
|
45
49
|
}
|
|
46
50
|
|
|
51
|
+
// Mirror of the Rust renderer's table (rust/html_renderer/src/profile.rs). `apng` and
|
|
52
|
+
// `opus` joined 2026-09-03: ringtome mints both and they rendered as the placeholder.
|
|
47
53
|
const MEDIA_KINDS: Record<string, MediaResolution["kind"]> = {
|
|
48
54
|
png: "image", jpg: "image", jpeg: "image", gif: "image", webp: "image",
|
|
49
|
-
avif: "image", svg: "image",
|
|
50
|
-
mp3: "audio", ogg: "audio", wav: "audio", flac: "audio", m4a: "audio",
|
|
55
|
+
avif: "image", apng: "image", svg: "image",
|
|
56
|
+
mp3: "audio", ogg: "audio", opus: "audio", wav: "audio", flac: "audio", m4a: "audio",
|
|
51
57
|
mp4: "video", webm: "video",
|
|
52
58
|
};
|
|
53
59
|
|
package/src/render.ts
CHANGED
|
@@ -232,7 +232,9 @@ function embed(target: string, alt: string, profile: Profile): string {
|
|
|
232
232
|
case "audio":
|
|
233
233
|
return `<audio class="mq-embed" controls src="${url}" aria-label="${escapeAttr(alt)}"></audio>`;
|
|
234
234
|
case "video":
|
|
235
|
-
return
|
|
235
|
+
return media.loop === true
|
|
236
|
+
? `<video class="mq-embed" autoplay loop muted playsinline src="${url}" aria-label="${escapeAttr(alt)}"></video>`
|
|
237
|
+
: `<video class="mq-embed" controls src="${url}" aria-label="${escapeAttr(alt)}"></video>`;
|
|
236
238
|
}
|
|
237
239
|
}
|
|
238
240
|
// The contractual shrug applied to media: degrade to a labeled link, or
|