@alpaca-headless/alpaca-headless-nextjs 1.0.2691 → 1.0.2692
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/cjs/components/Image.js +36 -0
- package/dist/cjs/components/index.js +1 -0
- package/dist/esm/components/Image.js +32 -0
- package/dist/esm/components/index.js +1 -0
- package/package.json +1 -1
- package/types/components/Image.d.ts +10 -0
- package/types/components/index.d.ts +1 -0
- package/types/fieldTypes.d.ts +7 -0
|
@@ -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;
|
|
@@ -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
|
+
};
|
package/package.json
CHANGED
|
@@ -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>;
|