@cube-drone/marquee-html-renderer 0.7.1 → 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/render.js +3 -1
- package/package.json +5 -5
- package/src/profile.ts +4 -0
- 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/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";
|
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
|