@alpaca-headless/alpaca-headless-nextjs 1.0.2694 → 1.0.2695
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/Link.js +22 -0
- package/dist/cjs/components/index.js +1 -0
- package/dist/esm/components/Link.js +18 -0
- package/dist/esm/components/index.js +1 -0
- package/package.json +1 -1
- package/types/components/Link.d.ts +6 -0
- package/types/components/index.d.ts +1 -0
- package/types/fieldTypes.d.ts +6 -0
|
@@ -0,0 +1,22 @@
|
|
|
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.Link = void 0;
|
|
15
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
+
function Link(_a) {
|
|
17
|
+
var { field, children } = _a, props = __rest(_a, ["field", "children"]);
|
|
18
|
+
if (!field)
|
|
19
|
+
return;
|
|
20
|
+
return ((0, jsx_runtime_1.jsx)("a", Object.assign({ href: field.value.url }, props, { children: children })));
|
|
21
|
+
}
|
|
22
|
+
exports.Link = Link;
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
export function Link(_a) {
|
|
14
|
+
var { field, children } = _a, props = __rest(_a, ["field", "children"]);
|
|
15
|
+
if (!field)
|
|
16
|
+
return;
|
|
17
|
+
return (_jsx("a", Object.assign({ href: field.value.url }, props, { children: children })));
|
|
18
|
+
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { LinkField } from "../fieldTypes";
|
|
3
|
+
export declare function Link({ field, children, ...props }: {
|
|
4
|
+
field: LinkField;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
} & React.AnchorHTMLAttributes<HTMLAnchorElement>): import("react/jsx-runtime").JSX.Element | undefined;
|
package/types/fieldTypes.d.ts
CHANGED
|
@@ -4,6 +4,9 @@ export type TextField = {
|
|
|
4
4
|
export interface PictureField {
|
|
5
5
|
value: PictureValue | null;
|
|
6
6
|
}
|
|
7
|
+
export interface LinkField {
|
|
8
|
+
value: LinkValue;
|
|
9
|
+
}
|
|
7
10
|
export interface PictureValue {
|
|
8
11
|
altText: string;
|
|
9
12
|
alt: string;
|
|
@@ -22,3 +25,6 @@ export interface ImageValue {
|
|
|
22
25
|
altText: string;
|
|
23
26
|
src: string;
|
|
24
27
|
}
|
|
28
|
+
export interface LinkValue {
|
|
29
|
+
url: string;
|
|
30
|
+
}
|