@alignable/bifrost 0.0.26 → 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.
@@ -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-SCZZADHB.js.map
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,6 +1,6 @@
1
1
  import { PageContextBuiltIn } from 'vite-plugin-ssr/types';
2
- import { A as AugmentMe, P as PageContextNoProxy } from './internal-45a068f0.js';
3
- export { N as BifrostConfig, a as BifrostProxyConfig, D as DocumentProps, b as LayoutComponent, L as LayoutMap, c as PageContext } from './internal-45a068f0.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
4
  export { PageContextProvider, usePageContext } from './renderer/usePageContext.js';
5
5
  import 'react';
6
6
  import './proxy/pages/_config.js';
@@ -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,4 +1,4 @@
1
- import { f as PageContextProxyInit, A as AugmentMe } from '../../internal-45a068f0.js';
1
+ import { f as PageContextProxyInit, A as AugmentMe } from '../../internal-f86846b4.js';
2
2
  import 'react';
3
3
  import 'vite-plugin-ssr/types';
4
4
  import './_config.js';
@@ -1,4 +1,4 @@
1
- import { g as PageContextProxyClient } from '../../internal-45a068f0.js';
1
+ import { g as PageContextProxyClient } from '../../internal-f86846b4.js';
2
2
  import 'react';
3
3
  import 'vite-plugin-ssr/types';
4
4
  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 { h as PageContextProxyServer } from '../../internal-45a068f0.js';
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,4 +1,4 @@
1
- import { i as PageContextProxyRestorationVisit } from '../../../internal-45a068f0.js';
1
+ import { i as PageContextProxyRestorationVisit } from '../../../internal-f86846b4.js';
2
2
  import 'react';
3
3
  import 'vite-plugin-ssr/types';
4
4
  import '../_config.js';
@@ -1,4 +1,4 @@
1
- import { P as PageContextNoProxy } from '../internal-45a068f0.js';
1
+ import { P as PageContextNoProxy } from '../internal-f86846b4.js';
2
2
  import 'react';
3
3
  import 'vite-plugin-ssr/types';
4
4
  import '../proxy/pages/_config.js';
@@ -1,4 +1,4 @@
1
- import { d as PageContextNoProxyClient } from '../internal-45a068f0.js';
1
+ import { d as PageContextNoProxyClient } from '../internal-f86846b4.js';
2
2
  import 'react';
3
3
  import 'vite-plugin-ssr/types';
4
4
  import '../proxy/pages/_config.js';
@@ -4,7 +4,7 @@ import {
4
4
  } from "../chunk-TUQ332K5.js";
5
5
  import {
6
6
  documentPropsToReact
7
- } from "../chunk-SCZZADHB.js";
7
+ } from "../chunk-VYXAWOXV.js";
8
8
  import {
9
9
  PageShell
10
10
  } from "../chunk-4DL7N7Y5.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-45a068f0.js';
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,6 +1,6 @@
1
1
  import {
2
2
  documentPropsToReact
3
- } from "../chunk-SCZZADHB.js";
3
+ } from "../chunk-VYXAWOXV.js";
4
4
  import {
5
5
  PageShell
6
6
  } from "../chunk-4DL7N7Y5.js";
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { c as PageContext } from '../internal-45a068f0.js';
2
+ import { c as PageContext } from '../internal-f86846b4.js';
3
3
  import 'vite-plugin-ssr/types';
4
4
  import '../proxy/pages/_config.js';
5
5
  import './_config.js';
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
- import { D as DocumentProps } from '../../internal-45a068f0.js';
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 };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  documentPropsToReact
3
- } from "../../chunk-SCZZADHB.js";
3
+ } from "../../chunk-VYXAWOXV.js";
4
4
  export {
5
5
  documentPropsToReact
6
6
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@alignable/bifrost",
3
3
  "repository": "https://github.com/Alignable/bifrost.git",
4
- "version": "0.0.26",
4
+ "version": "0.0.27",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
7
7
  "exports": {
@@ -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":[]}