@joycostudio/iris 0.0.0-stage → 0.0.1
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/LICENSE +15 -0
- package/README.md +137 -2
- package/dist/browser.cjs +466 -0
- package/dist/browser.cjs.map +1 -0
- package/dist/browser.d.cts +69 -0
- package/dist/browser.d.ts +69 -0
- package/dist/browser.js +439 -0
- package/dist/browser.js.map +1 -0
- package/dist/cli.cjs +681 -0
- package/dist/cli.cjs.map +1 -0
- package/dist/cli.d.cts +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +658 -0
- package/dist/cli.js.map +1 -0
- package/dist/core.cjs +355 -0
- package/dist/core.cjs.map +1 -0
- package/dist/core.d.cts +8 -0
- package/dist/core.d.ts +8 -0
- package/dist/core.js +328 -0
- package/dist/core.js.map +1 -0
- package/dist/next.cjs +380 -0
- package/dist/next.cjs.map +1 -0
- package/dist/next.d.cts +16 -0
- package/dist/next.d.ts +16 -0
- package/dist/next.js +352 -0
- package/dist/next.js.map +1 -0
- package/dist/node.cjs +580 -0
- package/dist/node.cjs.map +1 -0
- package/dist/node.d.cts +47 -0
- package/dist/node.d.ts +47 -0
- package/dist/node.js +542 -0
- package/dist/node.js.map +1 -0
- package/dist/policy-types-LoD2Ldcl.d.cts +147 -0
- package/dist/policy-types-LoD2Ldcl.d.ts +147 -0
- package/dist/react.cjs +628 -0
- package/dist/react.cjs.map +1 -0
- package/dist/react.d.cts +42 -0
- package/dist/react.d.ts +42 -0
- package/dist/react.js +611 -0
- package/dist/react.js.map +1 -0
- package/dist/types-Dv3DS4OX.d.cts +17 -0
- package/dist/types-Dv3DS4OX.d.ts +17 -0
- package/package.json +102 -4
- package/skills/iris-audit/SKILL.md +77 -0
package/dist/next.cjs
ADDED
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
|
|
31
|
+
// packages/next/index.tsx
|
|
32
|
+
var next_exports = {};
|
|
33
|
+
__export(next_exports, {
|
|
34
|
+
createIrisNextImage: () => createIrisNextImage
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(next_exports);
|
|
37
|
+
var import_image = __toESM(require("next/image.js"), 1);
|
|
38
|
+
var import_react = require("react");
|
|
39
|
+
|
|
40
|
+
// packages/core/placeholder.ts
|
|
41
|
+
function placeholderSettings(input) {
|
|
42
|
+
if (!input || input === "none") return null;
|
|
43
|
+
const options = input === "blur" ? {} : input;
|
|
44
|
+
return {
|
|
45
|
+
width: options.width ?? 10,
|
|
46
|
+
quality: options.quality ?? 40,
|
|
47
|
+
blur: options.blur ?? 12
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function resolvePlaceholder({
|
|
51
|
+
asset,
|
|
52
|
+
placeholder
|
|
53
|
+
}) {
|
|
54
|
+
const settings = placeholderSettings(placeholder);
|
|
55
|
+
if (!settings) return null;
|
|
56
|
+
const url = asset.placeholders?.find(
|
|
57
|
+
(item) => item.width === settings.width && item.quality === settings.quality
|
|
58
|
+
)?.url ?? (settings.width === 10 && settings.quality === 40 ? asset.placeholder : void 0);
|
|
59
|
+
return url ? { url, blur: settings.blur } : null;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// packages/next/index.tsx
|
|
63
|
+
var import_react2 = require("@joycostudio/iris/react");
|
|
64
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
65
|
+
var Image = "default" in import_image.default ? import_image.default.default : import_image.default;
|
|
66
|
+
var EMPTY_IMAGE = "data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";
|
|
67
|
+
function isEmptyImage(image) {
|
|
68
|
+
return (image.currentSrc || image.src) === EMPTY_IMAGE;
|
|
69
|
+
}
|
|
70
|
+
function createIrisNextImage({
|
|
71
|
+
iris,
|
|
72
|
+
catalog
|
|
73
|
+
}) {
|
|
74
|
+
return function IrisImage({
|
|
75
|
+
recipe: override,
|
|
76
|
+
usage,
|
|
77
|
+
...props
|
|
78
|
+
}) {
|
|
79
|
+
const src = typeof props.src === "string" ? props.src : props.src && "src" in props.src ? props.src.src : null;
|
|
80
|
+
const asset = src ? catalog[src] : void 0;
|
|
81
|
+
if (!src || !asset)
|
|
82
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
83
|
+
Image,
|
|
84
|
+
{
|
|
85
|
+
...props,
|
|
86
|
+
"data-iris": props["data-iris"] || props.alt || src || void 0
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
const contextUsage = {
|
|
90
|
+
width: props.width ? Number(props.width) : void 0,
|
|
91
|
+
...usage,
|
|
92
|
+
priority: Boolean(props.priority || props.preload || usage?.priority)
|
|
93
|
+
};
|
|
94
|
+
const selected = iris.select({
|
|
95
|
+
asset,
|
|
96
|
+
usage: contextUsage,
|
|
97
|
+
recipe: override
|
|
98
|
+
});
|
|
99
|
+
if (!selected.ok) throw new Error(`Iris: ${selected.error.message}`);
|
|
100
|
+
const { name, recipe } = selected.data;
|
|
101
|
+
const animated = asset.animated || /\.(?:gif|svg)(?:[?#]|$)/i.test(src);
|
|
102
|
+
const direct = props.unoptimized || animated;
|
|
103
|
+
const sizes = props.sizes || (props.width ? `${props.width}px` : "100vw");
|
|
104
|
+
const normalProps = {
|
|
105
|
+
...props,
|
|
106
|
+
src,
|
|
107
|
+
sizes,
|
|
108
|
+
unoptimized: direct,
|
|
109
|
+
placeholder: "empty"
|
|
110
|
+
};
|
|
111
|
+
const { props: normal } = (0, import_image.getImageProps)(normalProps);
|
|
112
|
+
const liveProgressive = Boolean(
|
|
113
|
+
normal.src === src && !normal.srcSet && asset.progressive
|
|
114
|
+
);
|
|
115
|
+
const preview = !direct && !liveProgressive ? previewImage({ recipe, asset, props: normalProps }) : void 0;
|
|
116
|
+
const progressiveDelivery = liveProgressive;
|
|
117
|
+
const placeholder = !liveProgressive ? resolvePlaceholder({ asset, placeholder: recipe.placeholder }) : null;
|
|
118
|
+
const previewSettings = recipe.preview && recipe.preview !== "none" ? recipe.preview : null;
|
|
119
|
+
const loadPreviewFirst = Boolean(preview && previewSettings?.loadFirst);
|
|
120
|
+
const key = JSON.stringify([
|
|
121
|
+
src,
|
|
122
|
+
name,
|
|
123
|
+
sizes,
|
|
124
|
+
props.quality,
|
|
125
|
+
previewSettings,
|
|
126
|
+
liveProgressive,
|
|
127
|
+
loadPreviewFirst
|
|
128
|
+
]);
|
|
129
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
130
|
+
DeliveryImage,
|
|
131
|
+
{
|
|
132
|
+
...normalProps,
|
|
133
|
+
src,
|
|
134
|
+
source: src,
|
|
135
|
+
unoptimized: Boolean(direct),
|
|
136
|
+
recipeName: name,
|
|
137
|
+
preview,
|
|
138
|
+
loadPreviewFirst,
|
|
139
|
+
previewMinDisplayMs: previewSettings?.minDisplayMs ?? 0,
|
|
140
|
+
blurDataURL: placeholder?.url,
|
|
141
|
+
blurRadius: placeholder?.blur ?? 0,
|
|
142
|
+
progressiveDelivery
|
|
143
|
+
},
|
|
144
|
+
key
|
|
145
|
+
);
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
function previewImage({
|
|
149
|
+
recipe,
|
|
150
|
+
asset,
|
|
151
|
+
props
|
|
152
|
+
}) {
|
|
153
|
+
const preview = recipe.preview;
|
|
154
|
+
if (!preview || preview === "none") return void 0;
|
|
155
|
+
if (preview.url)
|
|
156
|
+
return preview.url === asset.src ? void 0 : { src: preview.url, unoptimized: true };
|
|
157
|
+
const quality = preview.quality ?? props.quality;
|
|
158
|
+
const { props: candidates } = (0, import_image.getImageProps)({
|
|
159
|
+
...props,
|
|
160
|
+
quality,
|
|
161
|
+
width: 1,
|
|
162
|
+
height: 1,
|
|
163
|
+
fill: false,
|
|
164
|
+
sizes: "1px",
|
|
165
|
+
placeholder: "empty",
|
|
166
|
+
overrideSrc: void 0
|
|
167
|
+
});
|
|
168
|
+
const widths = (candidates.srcSet?.split(", ") ?? []).flatMap((item) => {
|
|
169
|
+
const match = item.match(/^(.*) (\d+)w$/);
|
|
170
|
+
return match ? [{ url: match[1], width: Number(match[2]) }] : [];
|
|
171
|
+
});
|
|
172
|
+
if (!widths.length) return void 0;
|
|
173
|
+
const loader = ({ width }) => {
|
|
174
|
+
const cap = preview.ratio === void 0 ? Math.min(width, preview.maxWidth ?? 640) : Math.min(
|
|
175
|
+
Math.floor(width * preview.ratio),
|
|
176
|
+
preview.maxWidth ?? Infinity
|
|
177
|
+
);
|
|
178
|
+
const smaller = widths.filter((candidate) => candidate.width < width);
|
|
179
|
+
const selected = smaller.filter((candidate) => candidate.width <= cap).at(-1) ?? smaller[0] ?? widths[0];
|
|
180
|
+
return selected.url;
|
|
181
|
+
};
|
|
182
|
+
return { src: asset.src, loader, quality, unoptimized: false };
|
|
183
|
+
}
|
|
184
|
+
function DeliveryImage({
|
|
185
|
+
source,
|
|
186
|
+
recipeName,
|
|
187
|
+
preview,
|
|
188
|
+
loadPreviewFirst,
|
|
189
|
+
previewMinDisplayMs,
|
|
190
|
+
progressiveDelivery,
|
|
191
|
+
style,
|
|
192
|
+
onLoad,
|
|
193
|
+
onError,
|
|
194
|
+
onLoadCapture,
|
|
195
|
+
blurDataURL,
|
|
196
|
+
blurRadius,
|
|
197
|
+
...props
|
|
198
|
+
}) {
|
|
199
|
+
const [loaded, setLoaded] = (0, import_react.useState)(false);
|
|
200
|
+
const [previewLoaded, setPreviewLoaded] = (0, import_react.useState)(false);
|
|
201
|
+
const [finalStarted, setFinalStarted] = (0, import_react.useState)(!loadPreviewFirst);
|
|
202
|
+
const layerZIndex = typeof style?.zIndex === "number" ? style.zIndex : 0;
|
|
203
|
+
const iris = (0, import_react2.useIrisDebugger)();
|
|
204
|
+
const finalRef = (0, import_react.useRef)(null);
|
|
205
|
+
const previewRef = (0, import_react.useRef)(null);
|
|
206
|
+
const previewMarked = (0, import_react.useRef)(false);
|
|
207
|
+
const attachFinal = (0, import_react.useCallback)((image) => {
|
|
208
|
+
finalRef.current = image;
|
|
209
|
+
if (image?.complete && image.naturalWidth && !isEmptyImage(image))
|
|
210
|
+
setLoaded(true);
|
|
211
|
+
}, []);
|
|
212
|
+
(0, import_react.useEffect)(() => {
|
|
213
|
+
let timer;
|
|
214
|
+
let observer;
|
|
215
|
+
const startFallback = () => {
|
|
216
|
+
timer ?? (timer = setTimeout(() => setFinalStarted(true), 3e3));
|
|
217
|
+
};
|
|
218
|
+
if (loadPreviewFirst && !finalStarted && previewLoaded) {
|
|
219
|
+
timer = setTimeout(() => setFinalStarted(true), previewMinDisplayMs);
|
|
220
|
+
} else if (loadPreviewFirst && !finalStarted && previewRef.current) {
|
|
221
|
+
if (typeof IntersectionObserver === "undefined") startFallback();
|
|
222
|
+
else {
|
|
223
|
+
observer = new IntersectionObserver((entries) => {
|
|
224
|
+
if (entries.some((entry) => entry.isIntersecting)) {
|
|
225
|
+
startFallback();
|
|
226
|
+
observer?.disconnect();
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
observer.observe(previewRef.current);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
return () => {
|
|
233
|
+
observer?.disconnect();
|
|
234
|
+
if (timer) clearTimeout(timer);
|
|
235
|
+
};
|
|
236
|
+
}, [loadPreviewFirst, finalStarted, previewLoaded, previewMinDisplayMs]);
|
|
237
|
+
const revealPreview = (0, import_react.useCallback)(
|
|
238
|
+
(image) => {
|
|
239
|
+
if (!image.isConnected || !image.naturalWidth || previewMarked.current)
|
|
240
|
+
return;
|
|
241
|
+
previewMarked.current = true;
|
|
242
|
+
setPreviewLoaded(true);
|
|
243
|
+
if (finalRef.current) iris?.markPreview(finalRef.current, image);
|
|
244
|
+
},
|
|
245
|
+
[iris]
|
|
246
|
+
);
|
|
247
|
+
const attachPreview = (0, import_react.useCallback)(
|
|
248
|
+
(image) => {
|
|
249
|
+
previewRef.current = image;
|
|
250
|
+
if (image?.complete && image.naturalWidth) revealPreview(image);
|
|
251
|
+
},
|
|
252
|
+
[revealPreview]
|
|
253
|
+
);
|
|
254
|
+
(0, import_react.useLayoutEffect)(() => {
|
|
255
|
+
if (iris && finalRef.current) {
|
|
256
|
+
iris.startTimeline(finalRef.current);
|
|
257
|
+
if (finalRef.current.complete && finalRef.current.naturalWidth && !isEmptyImage(finalRef.current))
|
|
258
|
+
iris.markFinal(finalRef.current);
|
|
259
|
+
}
|
|
260
|
+
}, [iris, source]);
|
|
261
|
+
(0, import_react.useLayoutEffect)(() => {
|
|
262
|
+
const image = finalRef.current;
|
|
263
|
+
if (finalStarted && image?.complete && image.naturalWidth && !isEmptyImage(image)) {
|
|
264
|
+
setLoaded(true);
|
|
265
|
+
iris?.markFinal(image);
|
|
266
|
+
}
|
|
267
|
+
}, [finalStarted, iris]);
|
|
268
|
+
const layers = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
269
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
270
|
+
Image,
|
|
271
|
+
{
|
|
272
|
+
...props,
|
|
273
|
+
src: finalStarted ? props.src : EMPTY_IMAGE,
|
|
274
|
+
unoptimized: finalStarted ? props.unoptimized : true,
|
|
275
|
+
loader: finalStarted ? props.loader : void 0,
|
|
276
|
+
overrideSrc: finalStarted ? props.overrideSrc : void 0,
|
|
277
|
+
priority: finalStarted ? props.priority : false,
|
|
278
|
+
preload: finalStarted ? props.preload : false,
|
|
279
|
+
fetchPriority: finalStarted ? props.fetchPriority : "auto",
|
|
280
|
+
ref: attachFinal,
|
|
281
|
+
"data-iris": props["data-iris"] || props.alt || source,
|
|
282
|
+
"data-iris-src": source,
|
|
283
|
+
"data-iris-recipe": recipeName,
|
|
284
|
+
"data-iris-delivery": progressiveDelivery ? "progressive" : void 0,
|
|
285
|
+
placeholder: "empty",
|
|
286
|
+
style: {
|
|
287
|
+
...style,
|
|
288
|
+
...preview || blurDataURL ? { zIndex: layerZIndex + 2 } : {},
|
|
289
|
+
...loaded ? { backgroundImage: "none" } : {}
|
|
290
|
+
},
|
|
291
|
+
onLoadCapture: (event) => {
|
|
292
|
+
if (isEmptyImage(event.currentTarget)) return;
|
|
293
|
+
event.currentTarget.style.backgroundImage = "none";
|
|
294
|
+
setLoaded(true);
|
|
295
|
+
onLoadCapture?.(event);
|
|
296
|
+
},
|
|
297
|
+
onLoad: (event) => {
|
|
298
|
+
if (isEmptyImage(event.currentTarget)) return;
|
|
299
|
+
setLoaded(true);
|
|
300
|
+
iris?.markFinal(event.currentTarget);
|
|
301
|
+
onLoad?.(event);
|
|
302
|
+
},
|
|
303
|
+
onError: (event) => {
|
|
304
|
+
if (isEmptyImage(event.currentTarget)) return;
|
|
305
|
+
onError?.(event);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
),
|
|
309
|
+
preview && !loaded && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
310
|
+
Image,
|
|
311
|
+
{
|
|
312
|
+
...props,
|
|
313
|
+
src: preview.src,
|
|
314
|
+
loader: preview.loader,
|
|
315
|
+
overrideSrc: void 0,
|
|
316
|
+
ref: attachPreview,
|
|
317
|
+
unoptimized: preview.unoptimized,
|
|
318
|
+
quality: preview.quality,
|
|
319
|
+
fill: true,
|
|
320
|
+
width: void 0,
|
|
321
|
+
height: void 0,
|
|
322
|
+
alt: "",
|
|
323
|
+
"aria-hidden": "true",
|
|
324
|
+
"data-iris": void 0,
|
|
325
|
+
"data-slot": "image-preview",
|
|
326
|
+
priority: false,
|
|
327
|
+
preload: false,
|
|
328
|
+
fetchPriority: "auto",
|
|
329
|
+
placeholder: "empty",
|
|
330
|
+
style: {
|
|
331
|
+
...style,
|
|
332
|
+
pointerEvents: "none",
|
|
333
|
+
zIndex: layerZIndex + 1,
|
|
334
|
+
backgroundImage: "none"
|
|
335
|
+
},
|
|
336
|
+
onLoadCapture: (event) => revealPreview(event.currentTarget),
|
|
337
|
+
onError: () => setFinalStarted(true)
|
|
338
|
+
}
|
|
339
|
+
),
|
|
340
|
+
!loaded && !previewLoaded && blurDataURL && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
341
|
+
"span",
|
|
342
|
+
{
|
|
343
|
+
"aria-hidden": "true",
|
|
344
|
+
"data-slot": "image-placeholder",
|
|
345
|
+
"data-stage": "blur",
|
|
346
|
+
style: {
|
|
347
|
+
position: "absolute",
|
|
348
|
+
inset: 0,
|
|
349
|
+
...style,
|
|
350
|
+
pointerEvents: "none",
|
|
351
|
+
zIndex: layerZIndex,
|
|
352
|
+
backgroundImage: `url(${JSON.stringify(blurDataURL)})`,
|
|
353
|
+
backgroundSize: style?.objectFit === "contain" ? "contain" : style?.objectFit === "cover" ? "cover" : "100% 100%",
|
|
354
|
+
backgroundPosition: style?.objectPosition ?? "center",
|
|
355
|
+
backgroundRepeat: "no-repeat",
|
|
356
|
+
filter: `blur(${blurRadius}px)`,
|
|
357
|
+
clipPath: "inset(0)"
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
)
|
|
361
|
+
] });
|
|
362
|
+
return preview || blurDataURL ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
363
|
+
"span",
|
|
364
|
+
{
|
|
365
|
+
"data-slot": "iris-image",
|
|
366
|
+
style: props.fill ? { position: "absolute", inset: 0, isolation: "isolate" } : {
|
|
367
|
+
position: "relative",
|
|
368
|
+
display: "inline-grid",
|
|
369
|
+
maxWidth: "100%",
|
|
370
|
+
isolation: "isolate"
|
|
371
|
+
},
|
|
372
|
+
children: layers
|
|
373
|
+
}
|
|
374
|
+
) : layers;
|
|
375
|
+
}
|
|
376
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
377
|
+
0 && (module.exports = {
|
|
378
|
+
createIrisNextImage
|
|
379
|
+
});
|
|
380
|
+
//# sourceMappingURL=next.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../packages/next/index.tsx","../packages/core/placeholder.ts"],"sourcesContent":["\"use client\"\n\nimport NextImage, { getImageProps, type ImageProps } from \"next/image.js\"\nimport {\n useCallback,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n} from \"react\"\nimport type {\n IrisCatalogAsset,\n IrisPolicy,\n IrisPolicyUsage,\n IrisRecipe,\n} from \"../core\"\nimport { resolvePlaceholder } from \"../core/placeholder\"\nimport { useIrisDebugger } from \"@joycostudio/iris/react\"\n\n// Next exposes a CommonJS entry; native ESM and bundlers unwrap it differently.\nconst Image = (\n \"default\" in NextImage ? NextImage.default : NextImage\n) as typeof NextImage\nconst EMPTY_IMAGE = \"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=\"\n\nfunction isEmptyImage(image: HTMLImageElement) {\n return (image.currentSrc || image.src) === EMPTY_IMAGE\n}\n\nexport type IrisNextImageProps<Custom = Record<string, unknown>> =\n ImageProps & {\n recipe?: string\n usage?: IrisPolicyUsage<Custom>\n \"data-iris\"?: string\n }\n\n/** Next owns responsive widths, optimizer URLs and allowed quality values. */\nexport function createIrisNextImage<Custom>({\n iris,\n catalog,\n}: {\n iris: IrisPolicy<Custom>\n catalog: Readonly<Record<string, IrisCatalogAsset>>\n}) {\n return function IrisImage({\n recipe: override,\n usage,\n ...props\n }: IrisNextImageProps<Custom>) {\n const src =\n typeof props.src === \"string\"\n ? props.src\n : props.src && \"src\" in props.src\n ? props.src.src\n : null\n const asset = src ? catalog[src] : undefined\n if (!src || !asset)\n return (\n <Image\n {...props}\n data-iris={props[\"data-iris\"] || props.alt || src || undefined}\n />\n )\n const contextUsage = {\n width: props.width ? Number(props.width) : undefined,\n ...usage,\n priority: Boolean(props.priority || props.preload || usage?.priority),\n }\n const selected = iris.select({\n asset,\n usage: contextUsage,\n recipe: override,\n })\n if (!selected.ok) throw new Error(`Iris: ${selected.error.message}`)\n const { name, recipe } = selected.data\n const animated = asset.animated || /\\.(?:gif|svg)(?:[?#]|$)/i.test(src)\n const direct = props.unoptimized || animated\n const sizes = props.sizes || (props.width ? `${props.width}px` : \"100vw\")\n const normalProps = {\n ...props,\n src,\n sizes,\n unoptimized: direct,\n placeholder: \"empty\" as const,\n }\n const { props: normal } = getImageProps(normalProps)\n // Source metadata describes the served file only when Next passes it through.\n const liveProgressive = Boolean(\n normal.src === src && !normal.srcSet && asset.progressive\n )\n const preview =\n !direct && !liveProgressive\n ? previewImage({ recipe, asset, props: normalProps })\n : undefined\n const progressiveDelivery = liveProgressive\n const placeholder = !liveProgressive\n ? resolvePlaceholder({ asset, placeholder: recipe.placeholder })\n : null\n const previewSettings =\n recipe.preview && recipe.preview !== \"none\" ? recipe.preview : null\n const loadPreviewFirst = Boolean(preview && previewSettings?.loadFirst)\n const key = JSON.stringify([\n src,\n name,\n sizes,\n props.quality,\n previewSettings,\n liveProgressive,\n loadPreviewFirst,\n ])\n return (\n <DeliveryImage\n key={key}\n {...normalProps}\n src={src}\n source={src}\n unoptimized={Boolean(direct)}\n recipeName={name}\n preview={preview}\n loadPreviewFirst={loadPreviewFirst}\n previewMinDisplayMs={previewSettings?.minDisplayMs ?? 0}\n blurDataURL={placeholder?.url}\n blurRadius={placeholder?.blur ?? 0}\n progressiveDelivery={progressiveDelivery}\n />\n )\n }\n}\n\ntype PreviewImage = {\n src: string\n loader?: NonNullable<ImageProps[\"loader\"]>\n quality?: ImageProps[\"quality\"]\n unoptimized: boolean\n}\n\nfunction previewImage({\n recipe,\n asset,\n props,\n}: {\n recipe: IrisRecipe\n asset: IrisCatalogAsset\n props: ImageProps\n}): PreviewImage | undefined {\n const preview = recipe.preview\n if (!preview || preview === \"none\") return undefined\n if (preview.url)\n return preview.url === asset.src\n ? undefined\n : { src: preview.url, unoptimized: true }\n\n // Next knows the optimizer's allowed widths (and any custom loader). Build\n // those URLs once, then map each responsive final descriptor to a smaller\n // preview URL. The browser applies the same `sizes` to both images, so a\n // ratio follows the width it actually selects at each viewport and DPR.\n const quality = preview.quality ?? props.quality\n const { props: candidates } = getImageProps({\n ...props,\n quality,\n width: 1,\n height: 1,\n fill: false,\n sizes: \"1px\",\n placeholder: \"empty\",\n overrideSrc: undefined,\n })\n const widths = (candidates.srcSet?.split(\", \") ?? []).flatMap((item) => {\n const match = item.match(/^(.*) (\\d+)w$/)\n return match ? [{ url: match[1], width: Number(match[2]) }] : []\n })\n if (!widths.length) return undefined\n const loader: NonNullable<ImageProps[\"loader\"]> = ({ width }) => {\n const cap =\n preview.ratio === undefined\n ? Math.min(width, preview.maxWidth ?? 640)\n : Math.min(\n Math.floor(width * preview.ratio),\n preview.maxWidth ?? Infinity\n )\n const smaller = widths.filter((candidate) => candidate.width < width)\n const selected =\n smaller.filter((candidate) => candidate.width <= cap).at(-1) ??\n smaller[0] ??\n widths[0]\n return selected.url\n }\n return { src: asset.src, loader, quality, unoptimized: false }\n}\n\nfunction DeliveryImage({\n source,\n recipeName,\n preview,\n loadPreviewFirst,\n previewMinDisplayMs,\n progressiveDelivery,\n style,\n onLoad,\n onError,\n onLoadCapture,\n blurDataURL,\n blurRadius,\n ...props\n}: ImageProps & {\n source: string\n recipeName: string\n preview?: PreviewImage\n loadPreviewFirst: boolean\n previewMinDisplayMs: number\n blurRadius: number\n progressiveDelivery: boolean\n \"data-iris\"?: string\n}) {\n const [loaded, setLoaded] = useState(false)\n const [previewLoaded, setPreviewLoaded] = useState(false)\n const [finalStarted, setFinalStarted] = useState(!loadPreviewFirst)\n // Keep each fallback behind the final image. Browsers can paint an image as\n // soon as it decodes, even before React hydrates and receives its load event.\n // Covering the final with a blur made already-loaded images wait for hydration.\n const layerZIndex = typeof style?.zIndex === \"number\" ? style.zIndex : 0\n const iris = useIrisDebugger()\n const finalRef = useRef<HTMLImageElement | null>(null)\n const previewRef = useRef<HTMLImageElement | null>(null)\n const previewMarked = useRef(false)\n const attachFinal = useCallback((image: HTMLImageElement | null) => {\n finalRef.current = image\n if (image?.complete && image.naturalWidth && !isEmptyImage(image))\n setLoaded(true)\n }, [])\n useEffect(() => {\n let timer: ReturnType<typeof setTimeout> | undefined\n let observer: IntersectionObserver | undefined\n const startFallback = () => {\n timer ??= setTimeout(() => setFinalStarted(true), 3000)\n }\n if (loadPreviewFirst && !finalStarted && previewLoaded) {\n timer = setTimeout(() => setFinalStarted(true), previewMinDisplayMs)\n } else if (loadPreviewFirst && !finalStarted && previewRef.current) {\n if (typeof IntersectionObserver === \"undefined\") startFallback()\n else {\n observer = new IntersectionObserver((entries) => {\n if (entries.some((entry) => entry.isIntersecting)) {\n startFallback()\n observer?.disconnect()\n }\n })\n observer.observe(previewRef.current)\n }\n }\n return () => {\n observer?.disconnect()\n if (timer) clearTimeout(timer)\n }\n }, [loadPreviewFirst, finalStarted, previewLoaded, previewMinDisplayMs])\n const revealPreview = useCallback(\n (image: HTMLImageElement) => {\n if (!image.isConnected || !image.naturalWidth || previewMarked.current)\n return\n previewMarked.current = true\n setPreviewLoaded(true)\n if (finalRef.current) iris?.markPreview(finalRef.current, image)\n },\n [iris]\n )\n const attachPreview = useCallback(\n (image: HTMLImageElement | null) => {\n previewRef.current = image\n if (image?.complete && image.naturalWidth) revealPreview(image)\n },\n [revealPreview]\n )\n useLayoutEffect(() => {\n if (iris && finalRef.current) {\n iris.startTimeline(finalRef.current)\n if (\n finalRef.current.complete &&\n finalRef.current.naturalWidth &&\n !isEmptyImage(finalRef.current)\n )\n iris.markFinal(finalRef.current)\n }\n }, [iris, source])\n useLayoutEffect(() => {\n const image = finalRef.current\n if (\n finalStarted &&\n image?.complete &&\n image.naturalWidth &&\n !isEmptyImage(image)\n ) {\n setLoaded(true)\n iris?.markFinal(image)\n }\n }, [finalStarted, iris])\n const layers = (\n <>\n <Image\n {...props}\n src={finalStarted ? props.src : EMPTY_IMAGE}\n unoptimized={finalStarted ? props.unoptimized : true}\n loader={finalStarted ? props.loader : undefined}\n overrideSrc={finalStarted ? props.overrideSrc : undefined}\n priority={finalStarted ? props.priority : false}\n preload={finalStarted ? props.preload : false}\n fetchPriority={finalStarted ? props.fetchPriority : \"auto\"}\n ref={attachFinal}\n data-iris={props[\"data-iris\"] || props.alt || source}\n data-iris-src={source}\n data-iris-recipe={recipeName}\n data-iris-delivery={progressiveDelivery ? \"progressive\" : undefined}\n placeholder=\"empty\"\n style={{\n ...style,\n ...(preview || blurDataURL ? { zIndex: layerZIndex + 2 } : {}),\n ...(loaded ? { backgroundImage: \"none\" } : {}),\n }}\n onLoadCapture={(event) => {\n if (isEmptyImage(event.currentTarget)) return\n event.currentTarget.style.backgroundImage = \"none\"\n setLoaded(true)\n onLoadCapture?.(event)\n }}\n onLoad={(event) => {\n if (isEmptyImage(event.currentTarget)) return\n setLoaded(true)\n iris?.markFinal(event.currentTarget)\n onLoad?.(event)\n }}\n onError={(event) => {\n if (isEmptyImage(event.currentTarget)) return\n onError?.(event)\n }}\n />\n {preview && !loaded && (\n <Image\n {...props}\n src={preview.src}\n loader={preview.loader}\n overrideSrc={undefined}\n ref={attachPreview}\n unoptimized={preview.unoptimized}\n quality={preview.quality}\n fill\n width={undefined}\n height={undefined}\n alt=\"\"\n aria-hidden=\"true\"\n data-iris={undefined}\n data-slot=\"image-preview\"\n priority={false}\n preload={false}\n fetchPriority=\"auto\"\n placeholder=\"empty\"\n style={{\n ...style,\n pointerEvents: \"none\",\n zIndex: layerZIndex + 1,\n backgroundImage: \"none\",\n }}\n onLoadCapture={(event) => revealPreview(event.currentTarget)}\n onError={() => setFinalStarted(true)}\n />\n )}\n {!loaded && !previewLoaded && blurDataURL && (\n <span\n aria-hidden=\"true\"\n data-slot=\"image-placeholder\"\n data-stage=\"blur\"\n style={{\n position: \"absolute\",\n inset: 0,\n ...style,\n pointerEvents: \"none\",\n zIndex: layerZIndex,\n backgroundImage: `url(${JSON.stringify(blurDataURL)})`,\n backgroundSize:\n style?.objectFit === \"contain\"\n ? \"contain\"\n : style?.objectFit === \"cover\"\n ? \"cover\"\n : \"100% 100%\",\n backgroundPosition: style?.objectPosition ?? \"center\",\n backgroundRepeat: \"no-repeat\",\n filter: `blur(${blurRadius}px)`,\n clipPath: \"inset(0)\",\n }}\n />\n )}\n </>\n )\n // Isolate the layers so their z-index cannot cover captions or controls in\n // the parent. Keep the containing block mounted after load to avoid shifts.\n return preview || blurDataURL ? (\n <span\n data-slot=\"iris-image\"\n style={\n props.fill\n ? { position: \"absolute\", inset: 0, isolation: \"isolate\" }\n : {\n position: \"relative\",\n display: \"inline-grid\",\n maxWidth: \"100%\",\n isolation: \"isolate\",\n }\n }\n >\n {layers}\n </span>\n ) : (\n layers\n )\n}\n","import type { IrisCatalogAsset, IrisRecipe } from \"./policy-types\"\n\nexport function placeholderSettings(input: IrisRecipe[\"placeholder\"]) {\n if (!input || input === \"none\") return null\n const options = input === \"blur\" ? {} : input\n return {\n width: options.width ?? 10,\n quality: options.quality ?? 40,\n blur: options.blur ?? 12,\n }\n}\n\nexport function resolvePlaceholder({\n asset,\n placeholder,\n}: {\n asset: IrisCatalogAsset\n placeholder: IrisRecipe[\"placeholder\"]\n}) {\n const settings = placeholderSettings(placeholder)\n if (!settings) return null\n const url =\n asset.placeholders?.find(\n (item) =>\n item.width === settings.width && item.quality === settings.quality\n )?.url ??\n (settings.width === 10 && settings.quality === 40\n ? asset.placeholder\n : undefined)\n return url ? { url, blur: settings.blur } : null\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAA0D;AAC1D,mBAMO;;;ACPA,SAAS,oBAAoB,OAAkC;AACpE,MAAI,CAAC,SAAS,UAAU,OAAQ,QAAO;AACvC,QAAM,UAAU,UAAU,SAAS,CAAC,IAAI;AACxC,SAAO;AAAA,IACL,OAAO,QAAQ,SAAS;AAAA,IACxB,SAAS,QAAQ,WAAW;AAAA,IAC5B,MAAM,QAAQ,QAAQ;AAAA,EACxB;AACF;AAEO,SAAS,mBAAmB;AAAA,EACjC;AAAA,EACA;AACF,GAGG;AACD,QAAM,WAAW,oBAAoB,WAAW;AAChD,MAAI,CAAC,SAAU,QAAO;AACtB,QAAM,MACJ,MAAM,cAAc;AAAA,IAClB,CAAC,SACC,KAAK,UAAU,SAAS,SAAS,KAAK,YAAY,SAAS;AAAA,EAC/D,GAAG,QACF,SAAS,UAAU,MAAM,SAAS,YAAY,KAC3C,MAAM,cACN;AACN,SAAO,MAAM,EAAE,KAAK,MAAM,SAAS,KAAK,IAAI;AAC9C;;;ADbA,IAAAA,gBAAgC;AAyCxB;AAtCR,IAAM,QACJ,aAAa,aAAAC,UAAY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iBAAiB,OAAO,KAAK,UAAU,WAAW,CAAC;AAAA,UACnD,gBACE,OAAO,cAAc,YACjB,YACA,OAAO,cAAc,UACnB,UACA;AAAA,UACR,oBAAoB,OAAO,kBAAkB;AAAA,UAC7C,kBAAkB;AAAA,UAClB,QAAQ,QAAQ,UAAU;AAAA,UAC1B,UAAU;AAAA,QACZ;AAAA;AAAA,IACF;AAAA,KAEJ;AAIF,SAAO,WAAW,cAChB;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,OACE,MAAM,OACF,EAAE,UAAU,YAAY,OAAO,GAAG,WAAW,UAAU,IACvD;AAAA,QACE,UAAU;AAAA,QACV,SAAS;AAAA,QACT,UAAU;AAAA,QACV,WAAW;AAAA,MACb;AAAA,MAGL;AAAA;AAAA,EACH,IAEA;AAEJ;","names":["import_react","NextImage"]}
|
package/dist/next.d.cts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ImageProps } from 'next/image.js';
|
|
3
|
+
import { k as IrisPolicyUsage, a as IrisPolicy, c as IrisCatalogAsset } from './policy-types-LoD2Ldcl.cjs';
|
|
4
|
+
|
|
5
|
+
type IrisNextImageProps<Custom = Record<string, unknown>> = ImageProps & {
|
|
6
|
+
recipe?: string;
|
|
7
|
+
usage?: IrisPolicyUsage<Custom>;
|
|
8
|
+
"data-iris"?: string;
|
|
9
|
+
};
|
|
10
|
+
/** Next owns responsive widths, optimizer URLs and allowed quality values. */
|
|
11
|
+
declare function createIrisNextImage<Custom>({ iris, catalog, }: {
|
|
12
|
+
iris: IrisPolicy<Custom>;
|
|
13
|
+
catalog: Readonly<Record<string, IrisCatalogAsset>>;
|
|
14
|
+
}): ({ recipe: override, usage, ...props }: IrisNextImageProps<Custom>) => react.JSX.Element;
|
|
15
|
+
|
|
16
|
+
export { type IrisNextImageProps, createIrisNextImage };
|
package/dist/next.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ImageProps } from 'next/image.js';
|
|
3
|
+
import { k as IrisPolicyUsage, a as IrisPolicy, c as IrisCatalogAsset } from './policy-types-LoD2Ldcl.js';
|
|
4
|
+
|
|
5
|
+
type IrisNextImageProps<Custom = Record<string, unknown>> = ImageProps & {
|
|
6
|
+
recipe?: string;
|
|
7
|
+
usage?: IrisPolicyUsage<Custom>;
|
|
8
|
+
"data-iris"?: string;
|
|
9
|
+
};
|
|
10
|
+
/** Next owns responsive widths, optimizer URLs and allowed quality values. */
|
|
11
|
+
declare function createIrisNextImage<Custom>({ iris, catalog, }: {
|
|
12
|
+
iris: IrisPolicy<Custom>;
|
|
13
|
+
catalog: Readonly<Record<string, IrisCatalogAsset>>;
|
|
14
|
+
}): ({ recipe: override, usage, ...props }: IrisNextImageProps<Custom>) => react.JSX.Element;
|
|
15
|
+
|
|
16
|
+
export { type IrisNextImageProps, createIrisNextImage };
|