@alignable/bifrost 0.0.18 → 0.0.19
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/DocumentProps-b3e3740a.d.ts +15 -0
- package/dist/{chunk-AIK6VRNF.js → chunk-UO3LKNUB.js} +4 -3
- package/dist/chunk-UO3LKNUB.js.map +1 -0
- package/dist/index.d.ts +3 -2
- package/dist/{internal-88049c17.d.ts → internal-b825691d.d.ts} +2 -8
- package/dist/proxy/pages/onBeforeRender.d.ts +2 -1
- package/dist/proxy/pages/onRenderClient.d.ts +2 -1
- package/dist/proxy/pages/onRenderHtml.d.ts +2 -1
- package/dist/proxy/pages/restorationVisit/onRenderClient.d.ts +2 -1
- package/dist/renderer/getConfigOrPageContext.d.ts +2 -1
- package/dist/renderer/onRenderClient.d.ts +2 -1
- package/dist/renderer/onRenderClient.js +1 -1
- package/dist/renderer/onRenderHtml.d.ts +2 -1
- package/dist/renderer/onRenderHtml.js +1 -1
- package/dist/renderer/usePageContext.d.ts +2 -1
- package/dist/renderer/utils/buildHead.d.ts +2 -5
- package/dist/renderer/utils/buildHead.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-AIK6VRNF.js.map +0 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface DocumentProps {
|
|
2
|
+
title?: string;
|
|
3
|
+
description?: string;
|
|
4
|
+
viewport?: {
|
|
5
|
+
[key: string]: string;
|
|
6
|
+
};
|
|
7
|
+
metaTags?: MetaTag[];
|
|
8
|
+
}
|
|
9
|
+
type MetaTag = {
|
|
10
|
+
name?: string;
|
|
11
|
+
property?: string;
|
|
12
|
+
content: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export { DocumentProps as D };
|
|
@@ -3,7 +3,8 @@ import React from "react";
|
|
|
3
3
|
function documentPropsToReact({
|
|
4
4
|
title = "",
|
|
5
5
|
description = "",
|
|
6
|
-
viewport = {}
|
|
6
|
+
viewport = {},
|
|
7
|
+
metaTags = []
|
|
7
8
|
}) {
|
|
8
9
|
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(
|
|
9
10
|
"meta",
|
|
@@ -11,10 +12,10 @@ function documentPropsToReact({
|
|
|
11
12
|
name: "viewport",
|
|
12
13
|
content: Object.entries(viewport).map((e) => e.join("=")).join(", ")
|
|
13
14
|
}
|
|
14
|
-
));
|
|
15
|
+
), metaTags.map(({ name, property, content }) => /* @__PURE__ */ React.createElement("meta", { name, property, content })));
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
export {
|
|
18
19
|
documentPropsToReact
|
|
19
20
|
};
|
|
20
|
-
//# sourceMappingURL=chunk-
|
|
21
|
+
//# sourceMappingURL=chunk-UO3LKNUB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../renderer/utils/buildHead.tsx"],"sourcesContent":["import React from \"react\";\nimport { DocumentProps } from \"../../types/internal\";\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":[]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
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,
|
|
2
|
+
import { A as AugmentMe, P as PageContextNoProxy } from './internal-b825691d.js';
|
|
3
|
+
export { N as BifrostConfig, a as BifrostProxyConfig, b as LayoutComponent, L as LayoutMap, c as PageContext } from './internal-b825691d.js';
|
|
4
4
|
export { usePageContext } from './renderer/usePageContext.js';
|
|
5
|
+
export { D as DocumentProps } from './DocumentProps-b3e3740a.js';
|
|
5
6
|
import 'react';
|
|
6
7
|
import './proxy/pages/_config.js';
|
|
7
8
|
import './renderer/_config.js';
|
|
@@ -2,6 +2,7 @@ import { PropsWithChildren } from 'react';
|
|
|
2
2
|
import { ConfigNonHeaderFile, Config, PageContextBuiltIn, PageContextBuiltInClientWithClientRouting } from 'vite-plugin-ssr/types';
|
|
3
3
|
import _default from './proxy/pages/_config.js';
|
|
4
4
|
import _default$1 from './renderer/_config.js';
|
|
5
|
+
import { D as DocumentProps } from './DocumentProps-b3e3740a.js';
|
|
5
6
|
|
|
6
7
|
declare namespace AugmentMe {
|
|
7
8
|
interface PageContextInit {
|
|
@@ -42,13 +43,6 @@ type PageContextProxyRestorationVisit = PageContextBuiltInClientWithClientRoutin
|
|
|
42
43
|
bodyEl: Element;
|
|
43
44
|
headEl: HTMLHeadElement;
|
|
44
45
|
} & PageContextProxyCommon;
|
|
45
|
-
interface DocumentProps {
|
|
46
|
-
title?: string;
|
|
47
|
-
description?: string;
|
|
48
|
-
viewport?: {
|
|
49
|
-
[key: string]: string;
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
46
|
type NoProxyConfig = ConfigConstructor<typeof _default$1, {
|
|
53
47
|
Layout: LayoutComponent;
|
|
54
48
|
layoutProps: AugmentMe.LayoutProps;
|
|
@@ -70,4 +64,4 @@ type PageContextNoProxyClient = PageContextBuiltInClientWithClientRouting<Page>
|
|
|
70
64
|
type PageContextNoProxy = PageContextNoProxyServer | PageContextNoProxyClient;
|
|
71
65
|
type PageContext = PageContextNoProxy | PageContextProxy | PageContextProxyRestorationVisit;
|
|
72
66
|
|
|
73
|
-
export { AugmentMe as A,
|
|
67
|
+
export { AugmentMe as A, LayoutMap as L, NoProxyConfig as N, PageContextNoProxy as P, ProxyConfig as a, LayoutComponent as b, PageContext as c, PageContextNoProxyClient as d, PageContextNoProxyServer as e, PageContextProxyServer as f, PageContextProxyClient as g, PageContextProxyRestorationVisit as h };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { f as PageContextProxyServer } from '../../internal-
|
|
1
|
+
import { f as PageContextProxyServer } from '../../internal-b825691d.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'vite-plugin-ssr/types';
|
|
4
4
|
import './_config.js';
|
|
5
5
|
import '../../renderer/_config.js';
|
|
6
|
+
import '../../DocumentProps-b3e3740a.js';
|
|
6
7
|
|
|
7
8
|
declare function onBeforeRender(pageContext: PageContextProxyServer): Promise<{
|
|
8
9
|
pageContext: {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { g as PageContextProxyClient } from '../../internal-
|
|
1
|
+
import { g as PageContextProxyClient } from '../../internal-b825691d.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'vite-plugin-ssr/types';
|
|
4
4
|
import './_config.js';
|
|
5
5
|
import '../../renderer/_config.js';
|
|
6
|
+
import '../../DocumentProps-b3e3740a.js';
|
|
6
7
|
|
|
7
8
|
declare function onRenderClient(pageContext: PageContextProxyClient): Promise<void>;
|
|
8
9
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as vite_plugin_ssr_dist_types_node_runtime_html_renderHtml_js from 'vite-plugin-ssr/dist/types/node/runtime/html/renderHtml.js';
|
|
2
|
-
import { f as PageContextProxyServer } from '../../internal-
|
|
2
|
+
import { f as PageContextProxyServer } from '../../internal-b825691d.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'vite-plugin-ssr/types';
|
|
5
5
|
import './_config.js';
|
|
6
6
|
import '../../renderer/_config.js';
|
|
7
|
+
import '../../DocumentProps-b3e3740a.js';
|
|
7
8
|
|
|
8
9
|
declare function onRenderHtml(pageContext: PageContextProxyServer): Promise<{
|
|
9
10
|
documentHtml: vite_plugin_ssr_dist_types_node_runtime_html_renderHtml_js.TemplateWrapped;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { h as PageContextProxyRestorationVisit } from '../../../internal-
|
|
1
|
+
import { h as PageContextProxyRestorationVisit } from '../../../internal-b825691d.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'vite-plugin-ssr/types';
|
|
4
4
|
import '../_config.js';
|
|
5
5
|
import '../../../renderer/_config.js';
|
|
6
|
+
import '../../../DocumentProps-b3e3740a.js';
|
|
6
7
|
|
|
7
8
|
declare function onRenderClient(pageContext: PageContextProxyRestorationVisit): Promise<void>;
|
|
8
9
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { P as PageContextNoProxy } from '../internal-
|
|
1
|
+
import { P as PageContextNoProxy } from '../internal-b825691d.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'vite-plugin-ssr/types';
|
|
4
4
|
import '../proxy/pages/_config.js';
|
|
5
5
|
import './_config.js';
|
|
6
|
+
import '../DocumentProps-b3e3740a.js';
|
|
6
7
|
|
|
7
8
|
type ConfigOrContext = PageContextNoProxy | PageContextNoProxy["config"];
|
|
8
9
|
/**
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { d as PageContextNoProxyClient } from '../internal-
|
|
1
|
+
import { d as PageContextNoProxyClient } from '../internal-b825691d.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'vite-plugin-ssr/types';
|
|
4
4
|
import '../proxy/pages/_config.js';
|
|
5
5
|
import './_config.js';
|
|
6
|
+
import '../DocumentProps-b3e3740a.js';
|
|
6
7
|
|
|
7
8
|
declare function onRenderClient(pageContext: PageContextNoProxyClient): Promise<void>;
|
|
8
9
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as vite_plugin_ssr_dist_types_node_runtime_html_renderHtml_js from 'vite-plugin-ssr/dist/types/node/runtime/html/renderHtml.js';
|
|
2
|
-
import { e as PageContextNoProxyServer } from '../internal-
|
|
2
|
+
import { e as PageContextNoProxyServer } from '../internal-b825691d.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'vite-plugin-ssr/types';
|
|
5
5
|
import '../proxy/pages/_config.js';
|
|
6
6
|
import './_config.js';
|
|
7
|
+
import '../DocumentProps-b3e3740a.js';
|
|
7
8
|
|
|
8
9
|
declare function onRenderHtml(pageContext: PageContextNoProxyServer): Promise<{
|
|
9
10
|
pageContext: {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { c as PageContext } from '../internal-
|
|
2
|
+
import { c as PageContext } from '../internal-b825691d.js';
|
|
3
3
|
import 'vite-plugin-ssr/types';
|
|
4
4
|
import '../proxy/pages/_config.js';
|
|
5
5
|
import './_config.js';
|
|
6
|
+
import '../DocumentProps-b3e3740a.js';
|
|
6
7
|
|
|
7
8
|
declare function PageContextProvider({ pageContext, children }: {
|
|
8
9
|
pageContext: PageContext;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { D as DocumentProps } from '../../
|
|
3
|
-
import 'vite-plugin-ssr/types';
|
|
4
|
-
import '../../proxy/pages/_config.js';
|
|
5
|
-
import '../_config.js';
|
|
2
|
+
import { D as DocumentProps } from '../../DocumentProps-b3e3740a.js';
|
|
6
3
|
|
|
7
|
-
declare function documentPropsToReact({ title, description, viewport, }: DocumentProps): React.ReactElement;
|
|
4
|
+
declare function documentPropsToReact({ title, description, viewport, metaTags, }: DocumentProps): React.ReactElement;
|
|
8
5
|
|
|
9
6
|
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\";\n\nexport function documentPropsToReact({\n title = \"\",\n description = \"\",\n viewport = {},\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 </>\n );\n}\n"],"mappings":";AAAA,OAAO,WAAW;AAGX,SAAS,qBAAqB;AAAA,EACnC,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,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,CACF;AAEJ;","names":[]}
|