@alignable/bifrost 0.0.25 → 0.0.27
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/{chunk-SCZZADHB.js → chunk-VYXAWOXV.js} +4 -3
- package/dist/chunk-VYXAWOXV.js.map +1 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -0
- package/dist/{internal-45a068f0.d.ts → internal-f86846b4.d.ts} +4 -0
- package/dist/proxy/pages/onBeforeRender.d.ts +1 -1
- package/dist/proxy/pages/onRenderClient.d.ts +1 -1
- package/dist/proxy/pages/onRenderHtml.d.ts +1 -1
- package/dist/proxy/pages/restorationVisit/onRenderClient.d.ts +1 -1
- package/dist/renderer/getConfigOrPageContext.d.ts +1 -1
- package/dist/renderer/onRenderClient.d.ts +1 -1
- package/dist/renderer/onRenderClient.js +1 -1
- package/dist/renderer/onRenderHtml.d.ts +1 -1
- package/dist/renderer/onRenderHtml.js +1 -1
- package/dist/renderer/usePageContext.d.ts +1 -1
- package/dist/renderer/utils/buildHead.d.ts +2 -2
- package/dist/renderer/utils/buildHead.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-SCZZADHB.js.map +0 -1
|
@@ -4,7 +4,8 @@ function documentPropsToReact({
|
|
|
4
4
|
title = "",
|
|
5
5
|
description = "",
|
|
6
6
|
viewport = {},
|
|
7
|
-
metaTags = []
|
|
7
|
+
metaTags = [],
|
|
8
|
+
alternates = {}
|
|
8
9
|
}) {
|
|
9
10
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("title", null, title), /* @__PURE__ */ React.createElement("meta", { name: "title", property: "og:title", content: title }), /* @__PURE__ */ React.createElement("meta", { name: "description", content: description }), /* @__PURE__ */ React.createElement(
|
|
10
11
|
"meta",
|
|
@@ -12,10 +13,10 @@ function documentPropsToReact({
|
|
|
12
13
|
name: "viewport",
|
|
13
14
|
content: Object.entries(viewport).map((e) => e.join("=")).join(", ")
|
|
14
15
|
}
|
|
15
|
-
), metaTags.map(({ name, property, content }) => /* @__PURE__ */ React.createElement("meta", { name, property, content })));
|
|
16
|
+
), metaTags.map(({ name, property, content }) => /* @__PURE__ */ React.createElement("meta", { name, property, content })), alternates.canonical && /* @__PURE__ */ React.createElement("link", { rel: "canonical", href: alternates.canonical }));
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
export {
|
|
19
20
|
documentPropsToReact
|
|
20
21
|
};
|
|
21
|
-
//# sourceMappingURL=chunk-
|
|
22
|
+
//# sourceMappingURL=chunk-VYXAWOXV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../renderer/utils/buildHead.tsx"],"sourcesContent":["import React from \"react\";\nimport { DocumentProps } from \"../../types/internal.js\";\n\nexport function documentPropsToReact({\n title = \"\",\n description = \"\",\n viewport = {},\n metaTags = [],\n alternates = {},\n}: DocumentProps): React.ReactElement {\n return (\n <>\n <title>{title}</title>\n <meta name=\"title\" property=\"og:title\" content={title} />\n <meta name=\"description\" content={description} />\n <meta\n name=\"viewport\"\n content={Object.entries(viewport)\n .map((e) => e.join(\"=\"))\n .join(\", \")}\n />\n {metaTags.map(({ name, property, content }) => (\n <meta name={name} property={property} content={content} />\n ))}\n { alternates.canonical && <link rel=\"canonical\" href={alternates.canonical} /> }\n </>\n );\n}\n"],"mappings":";AAAA,OAAO,WAAW;AAGX,SAAS,qBAAqB;AAAA,EACnC,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,WAAW,CAAC;AAAA,EACZ,WAAW,CAAC;AAAA,EACZ,aAAa,CAAC;AAChB,GAAsC;AACpC,SACE,0DACE,oCAAC,eAAO,KAAM,GACd,oCAAC,UAAK,MAAK,SAAQ,UAAS,YAAW,SAAS,OAAO,GACvD,oCAAC,UAAK,MAAK,eAAc,SAAS,aAAa,GAC/C;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,SAAS,OAAO,QAAQ,QAAQ,EAC7B,IAAI,CAAC,MAAM,EAAE,KAAK,GAAG,CAAC,EACtB,KAAK,IAAI;AAAA;AAAA,EACd,GACC,SAAS,IAAI,CAAC,EAAE,MAAM,UAAU,QAAQ,MACvC,oCAAC,UAAK,MAAY,UAAoB,SAAkB,CACzD,GACC,WAAW,aAAa,oCAAC,UAAK,KAAI,aAAY,MAAM,WAAW,WAAW,CAC9E;AAEJ;","names":[]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PageContextBuiltIn } from 'vite-plugin-ssr/types';
|
|
2
|
-
import { A as AugmentMe, P as PageContextNoProxy } from './internal-
|
|
3
|
-
export { N as BifrostConfig, a as BifrostProxyConfig, D as DocumentProps, b as LayoutComponent, L as LayoutMap, c as PageContext } from './internal-
|
|
4
|
-
export { usePageContext } from './renderer/usePageContext.js';
|
|
2
|
+
import { A as AugmentMe, P as PageContextNoProxy } from './internal-f86846b4.js';
|
|
3
|
+
export { N as BifrostConfig, a as BifrostProxyConfig, D as DocumentProps, b as LayoutComponent, L as LayoutMap, c as PageContext } from './internal-f86846b4.js';
|
|
4
|
+
export { PageContextProvider, usePageContext } from './renderer/usePageContext.js';
|
|
5
5
|
import 'react';
|
|
6
6
|
import './proxy/pages/_config.js';
|
|
7
7
|
import './renderer/_config.js';
|
package/dist/index.js
CHANGED
|
@@ -18,6 +18,7 @@ type ConfigConstructor<LibConfig extends Config, T extends {
|
|
|
18
18
|
interface DocumentProps {
|
|
19
19
|
title?: string;
|
|
20
20
|
description?: string;
|
|
21
|
+
alternates?: Alternates;
|
|
21
22
|
viewport?: {
|
|
22
23
|
[key: string]: string;
|
|
23
24
|
};
|
|
@@ -28,6 +29,9 @@ type MetaTag = {
|
|
|
28
29
|
property?: string;
|
|
29
30
|
content: string;
|
|
30
31
|
};
|
|
32
|
+
type Alternates = {
|
|
33
|
+
canonical?: string;
|
|
34
|
+
};
|
|
31
35
|
type LayoutComponent = React.ComponentType<PropsWithChildren<AugmentMe.LayoutProps>>;
|
|
32
36
|
type LayoutMap = Record<string, LayoutComponent>;
|
|
33
37
|
type ProxyConfig = ConfigConstructor<typeof _default, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as vite_plugin_ssr_dist_esm_node_runtime_html_renderHtml_js from 'vite-plugin-ssr/dist/esm/node/runtime/html/renderHtml.js';
|
|
2
|
-
import { h as PageContextProxyServer } from '../../internal-
|
|
2
|
+
import { h as PageContextProxyServer } from '../../internal-f86846b4.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'vite-plugin-ssr/types';
|
|
5
5
|
import './_config.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as vite_plugin_ssr_dist_esm_node_runtime_html_renderHtml_js from 'vite-plugin-ssr/dist/esm/node/runtime/html/renderHtml.js';
|
|
2
|
-
import { e as PageContextNoProxyServer } from '../internal-
|
|
2
|
+
import { e as PageContextNoProxyServer } from '../internal-f86846b4.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'vite-plugin-ssr/types';
|
|
5
5
|
import '../proxy/pages/_config.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { D as DocumentProps } from '../../internal-
|
|
2
|
+
import { D as DocumentProps } from '../../internal-f86846b4.js';
|
|
3
3
|
import 'vite-plugin-ssr/types';
|
|
4
4
|
import '../../proxy/pages/_config.js';
|
|
5
5
|
import '../_config.js';
|
|
6
6
|
import '../../controller-16e58bbd.js';
|
|
7
7
|
|
|
8
|
-
declare function documentPropsToReact({ title, description, viewport, metaTags, }: DocumentProps): React.ReactElement;
|
|
8
|
+
declare function documentPropsToReact({ title, description, viewport, metaTags, alternates, }: DocumentProps): React.ReactElement;
|
|
9
9
|
|
|
10
10
|
export { documentPropsToReact };
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../renderer/utils/buildHead.tsx"],"sourcesContent":["import React from \"react\";\nimport { DocumentProps } from \"../../types/internal.js\";\n\nexport function documentPropsToReact({\n title = \"\",\n description = \"\",\n viewport = {},\n metaTags = [],\n}: DocumentProps): React.ReactElement {\n return (\n <>\n <title>{title}</title>\n <meta name=\"title\" property=\"og:title\" content={title} />\n <meta name=\"description\" content={description} />\n <meta\n name=\"viewport\"\n content={Object.entries(viewport)\n .map((e) => e.join(\"=\"))\n .join(\", \")}\n />\n {metaTags.map(({ name, property, content }) => (\n <meta name={name} property={property} content={content} />\n ))}\n </>\n );\n}\n"],"mappings":";AAAA,OAAO,WAAW;AAGX,SAAS,qBAAqB;AAAA,EACnC,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,WAAW,CAAC;AAAA,EACZ,WAAW,CAAC;AACd,GAAsC;AACpC,SACE,0DACE,oCAAC,eAAO,KAAM,GACd,oCAAC,UAAK,MAAK,SAAQ,UAAS,YAAW,SAAS,OAAO,GACvD,oCAAC,UAAK,MAAK,eAAc,SAAS,aAAa,GAC/C;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,SAAS,OAAO,QAAQ,QAAQ,EAC7B,IAAI,CAAC,MAAM,EAAE,KAAK,GAAG,CAAC,EACtB,KAAK,IAAI;AAAA;AAAA,EACd,GACC,SAAS,IAAI,CAAC,EAAE,MAAM,UAAU,QAAQ,MACvC,oCAAC,UAAK,MAAY,UAAoB,SAAkB,CACzD,CACH;AAEJ;","names":[]}
|