@riebeckite/plugin-responsive-image 0.0.13 → 0.0.15
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 -1
- package/README_ja.md +2 -1
- package/dist/index.js +5 -6
- package/dist/src/html.d.ts +2 -2
- package/package.json +3 -3
package/README.md
CHANGED
package/README_ja.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -382,18 +382,19 @@ function serializeAttribute(attribute) {
|
|
|
382
382
|
var PLUGIN_NAME = "responsive-image";
|
|
383
383
|
function responsiveImage(options = {}) {
|
|
384
384
|
const resolved = resolveResponsiveImageOptions(options);
|
|
385
|
-
const tracked = /* @__PURE__ */ new Map();
|
|
386
385
|
return definePlugin({
|
|
387
386
|
name: PLUGIN_NAME,
|
|
388
387
|
order: 100,
|
|
388
|
+
processedContentCache: {
|
|
389
|
+
version: "responsive-image-v1",
|
|
390
|
+
dependencyMode: "none"
|
|
391
|
+
},
|
|
392
|
+
outputDependencies: [{ type: "global" }],
|
|
389
393
|
options,
|
|
390
394
|
validateOptions: validateResponsiveImageOptions,
|
|
391
395
|
extendHtmlPipeline: (pipeline) => {
|
|
392
396
|
pipeline.use(rehypeResponsiveImage, options);
|
|
393
397
|
},
|
|
394
|
-
onPostProcessed: (context) => {
|
|
395
|
-
tracked.set(context.slug, context.content);
|
|
396
|
-
},
|
|
397
398
|
onManifestCreated: (context) => {
|
|
398
399
|
const knownPaths = collectKnownAssetPaths(context.manifest);
|
|
399
400
|
for (const entry of context.manifest.entries) {
|
|
@@ -401,8 +402,6 @@ function responsiveImage(options = {}) {
|
|
|
401
402
|
const html = applyResponsiveImages(entry.html, knownPaths, options);
|
|
402
403
|
if (html === entry.html) continue;
|
|
403
404
|
entry.html = html;
|
|
404
|
-
const content = tracked.get(entry.slug);
|
|
405
|
-
if (content) content.html = html;
|
|
406
405
|
}
|
|
407
406
|
if (resolved.generate) {
|
|
408
407
|
context.logger.warn(
|
package/dist/src/html.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { ResponsiveImageOptions } from "./options.js";
|
|
|
3
3
|
* Manifest pass: replace marked `<img>` elements with a `<picture>` element
|
|
4
4
|
* built from sibling variants that already exist in the content manifest.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* The mutated entry HTML becomes the final rendering source; the Core
|
|
7
|
+
* synchronization step makes it visible to `getProcessedContent`.
|
|
8
8
|
*/
|
|
9
9
|
export declare function applyResponsiveImages(html: string, knownPaths: Iterable<string>, options?: ResponsiveImageOptions): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riebeckite/plugin-responsive-image",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
"./style.css": "./style.css"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@riebeckite/core": "0.0.
|
|
18
|
+
"@riebeckite/core": "0.0.15"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"tsx": "^4.22.4",
|
|
22
|
-
"@riebeckite/test": "0.0.
|
|
22
|
+
"@riebeckite/test": "0.0.15"
|
|
23
23
|
},
|
|
24
24
|
"publishConfig": {
|
|
25
25
|
"access": "public"
|