ag-common 0.0.449 → 0.0.451
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/common/helpers/binary.d.ts +1 -0
- package/dist/common/helpers/binary.js +4 -10
- package/dist/common/helpers/string/truncate.d.ts +1 -1
- package/dist/common/helpers/string/truncate.js +1 -1
- package/dist/ui/components/HeadersRaw/index.d.ts +6 -5
- package/dist/ui/components/HeadersRaw/index.js +2 -2
- package/package.json +1 -1
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.base64ToBinary = exports.arrayBufferToBase64 = void 0;
|
|
3
|
+
exports.base64ToBinary = exports.arrayBufferToBase64 = exports.toBuffer = void 0;
|
|
4
4
|
const base64_1 = require("./string/base64");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const view = new Uint8Array(ab);
|
|
8
|
-
for (let i = 0; i < buffer.length; ++i) {
|
|
9
|
-
buffer[i] = view[i];
|
|
10
|
-
}
|
|
11
|
-
return buffer;
|
|
12
|
-
}
|
|
5
|
+
const toBuffer = (ab) => Buffer.from(ab);
|
|
6
|
+
exports.toBuffer = toBuffer;
|
|
13
7
|
function toArrayBuffer(base64) {
|
|
14
8
|
const binary_string = (0, base64_1.fromBase64)(base64);
|
|
15
9
|
const len = binary_string.length;
|
|
@@ -39,5 +33,5 @@ exports.arrayBufferToBase64 = arrayBufferToBase64;
|
|
|
39
33
|
* @param raw
|
|
40
34
|
* @returns
|
|
41
35
|
*/
|
|
42
|
-
const base64ToBinary = (raw) => toBuffer(toArrayBuffer(raw));
|
|
36
|
+
const base64ToBinary = (raw) => (0, exports.toBuffer)(toArrayBuffer(raw));
|
|
43
37
|
exports.base64ToBinary = base64ToBinary;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function truncate(str: string
|
|
1
|
+
export declare function truncate(str: string, n: number, ellip: string): string;
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
/** full page title = title | hostname | tagline */
|
|
2
3
|
export interface IHeadersRaw {
|
|
4
|
+
/** eg https://abc.def */
|
|
5
|
+
siteUrl: string;
|
|
3
6
|
title?: string;
|
|
4
7
|
image?: string;
|
|
5
8
|
description?: string;
|
|
6
|
-
/** eg https://abc.def */
|
|
7
|
-
siteUrl: string;
|
|
8
9
|
/** eg 'a site to remember' */
|
|
9
|
-
tagline
|
|
10
|
+
tagline?: string;
|
|
10
11
|
/** csv or separate keyword strings */
|
|
11
|
-
keywords
|
|
12
|
+
keywords?: string | string[];
|
|
12
13
|
}
|
|
13
14
|
export declare const HeadersRaw: ({ title, image, siteUrl, tagline, keywords, }: IHeadersRaw) => React.JSX.Element[];
|
|
14
15
|
export declare const HeadersRawNext: ({ title, image, siteUrl, tagline, description, keywords, }: IHeadersRaw) => {
|
|
15
16
|
title: string;
|
|
16
17
|
description: string;
|
|
17
|
-
keywords: string | string[];
|
|
18
|
+
keywords: string | string[] | undefined;
|
|
18
19
|
openGraph: {
|
|
19
20
|
title: string;
|
|
20
21
|
description: string;
|
|
@@ -7,7 +7,7 @@ exports.HeadersRawNext = exports.HeadersRaw = void 0;
|
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const HeadersRaw = ({ title, image, siteUrl, tagline, keywords, }) => {
|
|
9
9
|
const { origin, hostname } = new URL(siteUrl);
|
|
10
|
-
const fullTitle =
|
|
10
|
+
const fullTitle = [title, hostname, tagline].filter((r) => r).join(' | ');
|
|
11
11
|
const titleFallback = title || fullTitle;
|
|
12
12
|
const titleBlock = [
|
|
13
13
|
react_1.default.createElement("title", { key: "1" }, fullTitle),
|
|
@@ -42,7 +42,7 @@ const HeadersRaw = ({ title, image, siteUrl, tagline, keywords, }) => {
|
|
|
42
42
|
exports.HeadersRaw = HeadersRaw;
|
|
43
43
|
const HeadersRawNext = ({ title, image, siteUrl, tagline, description, keywords, }) => {
|
|
44
44
|
const { origin, hostname } = new URL(siteUrl);
|
|
45
|
-
const fullTitle =
|
|
45
|
+
const fullTitle = [title, hostname, tagline].filter((r) => r).join(' | ');
|
|
46
46
|
return {
|
|
47
47
|
title: fullTitle,
|
|
48
48
|
description: description || fullTitle,
|
package/package.json
CHANGED