@alpaca-headless/alpaca-headless-nextjs 1.0.2691 → 1.0.2693

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.
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.Image = void 0;
15
+ const jsx_runtime_1 = require("react/jsx-runtime");
16
+ // const addClassName = (otherAttrs: { [key: string]: unknown }): void => {
17
+ // if (otherAttrs.class) {
18
+ // // if any classes are defined properly already
19
+ // if (otherAttrs.className) {
20
+ // let className: string = otherAttrs.className as string;
21
+ // className += ` ${otherAttrs.class}`;
22
+ // otherAttrs.className = className;
23
+ // } else {
24
+ // otherAttrs.className = otherAttrs.class;
25
+ // }
26
+ // delete otherAttrs.class;
27
+ // }
28
+ // };
29
+ const Image = (_a) => {
30
+ var { field } = _a, otherProps = __rest(_a, ["field"]);
31
+ if (!field)
32
+ return;
33
+ const attrs = Object.assign(Object.assign({}, field.value), otherProps);
34
+ return (0, jsx_runtime_1.jsx)("img", Object.assign({}, attrs, { alt: "" }));
35
+ };
36
+ exports.Image = Image;
@@ -18,3 +18,4 @@ __exportStar(require("./Placeholder"), exports);
18
18
  __exportStar(require("./Text"), exports);
19
19
  __exportStar(require("./Picture"), exports);
20
20
  __exportStar(require("./RichText"), exports);
21
+ __exportStar(require("./Image"), exports);
@@ -0,0 +1,32 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ // const addClassName = (otherAttrs: { [key: string]: unknown }): void => {
14
+ // if (otherAttrs.class) {
15
+ // // if any classes are defined properly already
16
+ // if (otherAttrs.className) {
17
+ // let className: string = otherAttrs.className as string;
18
+ // className += ` ${otherAttrs.class}`;
19
+ // otherAttrs.className = className;
20
+ // } else {
21
+ // otherAttrs.className = otherAttrs.class;
22
+ // }
23
+ // delete otherAttrs.class;
24
+ // }
25
+ // };
26
+ export const Image = (_a) => {
27
+ var { field } = _a, otherProps = __rest(_a, ["field"]);
28
+ if (!field)
29
+ return;
30
+ const attrs = Object.assign(Object.assign({}, field.value), otherProps);
31
+ return _jsx("img", Object.assign({}, attrs, { alt: "" }));
32
+ };
@@ -2,3 +2,4 @@ export * from "./Placeholder";
2
2
  export * from "./Text";
3
3
  export * from "./Picture";
4
4
  export * from "./RichText";
5
+ export * from "./Image";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alpaca-headless/alpaca-headless-nextjs",
3
- "version": "1.0.2691",
3
+ "version": "1.0.2693",
4
4
  "description": "Alpaca Headless NextJs Integration",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import { ImageField } from "../fieldTypes";
3
+ export interface ImageProps {
4
+ [attributeName: string]: unknown;
5
+ field?: ImageField;
6
+ imageParams?: {
7
+ [paramName: string]: string | number;
8
+ };
9
+ }
10
+ export declare const Image: React.FC<ImageProps>;
@@ -2,3 +2,4 @@ export * from "./Placeholder";
2
2
  export * from "./Text";
3
3
  export * from "./Picture";
4
4
  export * from "./RichText";
5
+ export * from "./Image";
@@ -15,3 +15,10 @@ export interface PictureVariant {
15
15
  src: string;
16
16
  videoId: string;
17
17
  }
18
+ export interface ImageField {
19
+ value: ImageValue | null;
20
+ }
21
+ export interface ImageValue {
22
+ altText: string;
23
+ src: string;
24
+ }