@cedarjs/web 6.0.0 → 7.0.0-canary.2982
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/apollo/ApolloProviderWithFetchConfig.d.ts +1 -1
- package/dist/apollo/ApolloProviderWithFetchConfig.d.ts.map +1 -1
- package/dist/apollo/ApolloProviderWithFetchConfig.js +23 -16
- package/dist/apollo/CedarApolloProvider.js +1 -1
- package/dist/apollo/apolloLinkTypes.d.ts +4 -4
- package/dist/apollo/apolloLinkTypes.d.ts.map +1 -1
- package/dist/apollo/fragmentRegistry.d.ts +3 -3
- package/dist/apollo/fragmentRegistry.d.ts.map +1 -1
- package/dist/apollo/fragmentRegistry.js +35 -8
- package/dist/apollo/links.d.ts +4 -5
- package/dist/apollo/links.d.ts.map +1 -1
- package/dist/apollo/links.js +7 -7
- package/dist/apollo/sseLink.d.ts +5 -8
- package/dist/apollo/sseLink.d.ts.map +1 -1
- package/dist/apollo/sseLink.js +9 -12
- package/dist/apollo/suspense.d.ts +3 -3
- package/dist/apollo/suspense.d.ts.map +1 -1
- package/dist/apollo/suspense.js +1 -1
- package/dist/apollo/useCache.d.ts +4 -6
- package/dist/apollo/useCache.d.ts.map +1 -1
- package/dist/apollo/useCache.js +1 -1
- package/dist/bundled/apollo-upload-client.d.ts +2 -2
- package/dist/bundled/apollo-upload-client.d.ts.map +1 -1
- package/dist/bundled/apollo-upload-client.js +1562 -1734
- package/dist/components/DevFatalErrorPage.d.ts +3 -3
- package/dist/components/DevFatalErrorPage.d.ts.map +1 -1
- package/dist/components/DevFatalErrorPage.js +2 -2
- package/dist/components/FatalErrorBoundary.d.ts +1 -1
- package/dist/components/cell/CellErrorBoundary.d.ts +3 -3
- package/dist/components/cell/CellErrorBoundary.d.ts.map +1 -1
- package/dist/components/cell/cellTypes.d.ts +50 -17
- package/dist/components/cell/cellTypes.d.ts.map +1 -1
- package/dist/components/cell/createCell.d.ts +2 -1
- package/dist/components/cell/createCell.d.ts.map +1 -1
- package/dist/components/cell/createCell.js +65 -60
- package/dist/components/cell/createFragmentCell.d.ts +2 -1
- package/dist/components/cell/createFragmentCell.d.ts.map +1 -1
- package/dist/components/cell/createFragmentCell.js +4 -2
- package/dist/components/cell/createServerCell.d.ts +3 -2
- package/dist/components/cell/createServerCell.d.ts.map +1 -1
- package/dist/components/cell/createServerCell.js +4 -2
- package/dist/components/cell/createSuspendingCell.d.ts +2 -1
- package/dist/components/cell/createSuspendingCell.d.ts.map +1 -1
- package/dist/components/cell/createSuspendingCell.js +37 -34
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -5
- package/dist/server/middleware.d.ts +1 -1
- package/dist/server/middleware.d.ts.map +1 -1
- package/package.json +15 -14
- package/dist/components/RedwoodProvider.d.ts +0 -9
- package/dist/components/RedwoodProvider.d.ts.map +0 -1
- package/dist/components/RedwoodProvider.js +0 -23
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import React, { Suspense } from "react";
|
|
2
|
+
import { CombinedGraphQLErrors } from "@apollo/client";
|
|
2
3
|
import {
|
|
3
4
|
useApolloClient,
|
|
4
5
|
useBackgroundQuery,
|
|
5
6
|
useReadQuery
|
|
6
|
-
} from "@apollo/client/react
|
|
7
|
+
} from "@apollo/client/react";
|
|
7
8
|
import { CellErrorBoundary } from "./CellErrorBoundary.js";
|
|
8
9
|
import { isDataEmpty } from "./isCellEmpty.js";
|
|
9
10
|
function createSuspendingCell(createCellProps) {
|
|
10
11
|
const {
|
|
11
12
|
QUERY,
|
|
13
|
+
// Unlike in createCell this is destructured from a variable rather than
|
|
14
|
+
// from an annotated parameter, so the default's return type has to be
|
|
15
|
+
// spelled out. Without it the inferred object literal type widens the
|
|
16
|
+
// union and options like `skip` are no longer visible on it
|
|
12
17
|
beforeQuery = (props) => ({
|
|
13
18
|
// By default, we assume that the props are the gql-variables.
|
|
14
19
|
variables: props,
|
|
@@ -44,31 +49,36 @@ function createSuspendingCell(createCellProps) {
|
|
|
44
49
|
networkStatus
|
|
45
50
|
};
|
|
46
51
|
if (isEmpty(data, { isDataEmpty }) && Empty) {
|
|
47
|
-
|
|
48
|
-
Empty,
|
|
49
|
-
{
|
|
50
|
-
...userProps,
|
|
51
|
-
...afterQueryData,
|
|
52
|
-
queryResult: queryResultWithNetworkStatus
|
|
53
|
-
}
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
return /* @__PURE__ */ React.createElement(
|
|
57
|
-
Success,
|
|
58
|
-
{
|
|
59
|
-
...afterQueryData,
|
|
52
|
+
const emptyProps = {
|
|
60
53
|
...userProps,
|
|
54
|
+
...afterQueryData,
|
|
61
55
|
queryResult: queryResultWithNetworkStatus
|
|
62
|
-
}
|
|
63
|
-
|
|
56
|
+
};
|
|
57
|
+
return /* @__PURE__ */ React.createElement(Empty, { ...emptyProps });
|
|
58
|
+
}
|
|
59
|
+
const successProps = {
|
|
60
|
+
...afterQueryData,
|
|
61
|
+
...userProps,
|
|
62
|
+
queryResult: queryResultWithNetworkStatus
|
|
63
|
+
};
|
|
64
|
+
return /* @__PURE__ */ React.createElement(Success, { ...successProps });
|
|
64
65
|
}
|
|
65
66
|
SuspendingSuccess.displayName = displayName;
|
|
66
67
|
return (props) => {
|
|
67
68
|
const { children: _, ...variables } = props;
|
|
68
69
|
const options = beforeQuery(variables);
|
|
69
|
-
const
|
|
70
|
-
const
|
|
70
|
+
const queryOptions = typeof options === "symbol" ? void 0 : options;
|
|
71
|
+
const skipped = !queryOptions || queryOptions.skip === true;
|
|
72
|
+
const query = typeof cellQuery === "function" ? cellQuery(queryOptions ?? {}) : cellQuery;
|
|
73
|
+
const backgroundQueryOptions = options;
|
|
74
|
+
const [queryRef, other] = useBackgroundQuery(
|
|
75
|
+
query,
|
|
76
|
+
backgroundQueryOptions
|
|
77
|
+
);
|
|
71
78
|
const client = useApolloClient();
|
|
79
|
+
if (skipped || !queryRef) {
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
72
82
|
const suspenseQueryResult = {
|
|
73
83
|
client,
|
|
74
84
|
...other,
|
|
@@ -77,7 +87,7 @@ function createSuspendingCell(createCellProps) {
|
|
|
77
87
|
const FailureComponent = ({ error, resetErrorBoundary }) => {
|
|
78
88
|
if (!Failure) {
|
|
79
89
|
if (error) {
|
|
80
|
-
throw error;
|
|
90
|
+
throw error instanceof Error ? error : new Error(error.message);
|
|
81
91
|
}
|
|
82
92
|
throw new Error("Unreachable code: FailureComponent without a Failure");
|
|
83
93
|
}
|
|
@@ -88,26 +98,19 @@ function createSuspendingCell(createCellProps) {
|
|
|
88
98
|
return suspenseQueryResult.refetch?.(variables2);
|
|
89
99
|
}
|
|
90
100
|
};
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}
|
|
98
|
-
);
|
|
101
|
+
const failureProps = {
|
|
102
|
+
error,
|
|
103
|
+
errorCode: CombinedGraphQLErrors.is(error) ? error.errors[0]?.extensions?.["code"] : void 0,
|
|
104
|
+
queryResult: queryResultWithErrorReset
|
|
105
|
+
};
|
|
106
|
+
return /* @__PURE__ */ React.createElement(Failure, { ...failureProps });
|
|
99
107
|
};
|
|
100
108
|
const wrapInSuspenseIfLoadingPresent = (suspendingSuccessElement, LoadingComponent) => {
|
|
101
109
|
if (!LoadingComponent) {
|
|
102
110
|
return suspendingSuccessElement;
|
|
103
111
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
{
|
|
107
|
-
fallback: /* @__PURE__ */ React.createElement(LoadingComponent, { ...props, queryResult: suspenseQueryResult })
|
|
108
|
-
},
|
|
109
|
-
suspendingSuccessElement
|
|
110
|
-
);
|
|
112
|
+
const loadingProps = { ...props, queryResult: suspenseQueryResult };
|
|
113
|
+
return /* @__PURE__ */ React.createElement(Suspense, { fallback: /* @__PURE__ */ React.createElement(LoadingComponent, { ...loadingProps }) }, suspendingSuccessElement);
|
|
111
114
|
};
|
|
112
115
|
return /* @__PURE__ */ React.createElement(CellErrorBoundary, { renderFallback: FailureComponent }, wrapInSuspenseIfLoadingPresent(
|
|
113
116
|
/* @__PURE__ */ React.createElement(
|
package/dist/index.d.ts
CHANGED
|
@@ -2,13 +2,13 @@ import './global.web-auto-imports.js';
|
|
|
2
2
|
import './config.js';
|
|
3
3
|
export { FatalErrorBoundary } from './components/FatalErrorBoundary.js';
|
|
4
4
|
export { FetchConfigProvider, useFetchConfig, } from './components/FetchConfigProvider.js';
|
|
5
|
-
export { useQuery, useMutation, useSubscription
|
|
5
|
+
export { useQuery, useMutation, useSubscription } from '@apollo/client/react';
|
|
6
6
|
export { useFragment } from './apollo/fragmentRegistry.js';
|
|
7
7
|
export type { FragmentHookOptions, FragmentHookResult, } from './apollo/fragmentRegistry.js';
|
|
8
8
|
export * from './components/cell/CellCacheContext.js';
|
|
9
9
|
export { createCell } from './components/cell/createCell.js';
|
|
10
10
|
export { createFragmentCell } from './components/cell/createFragmentCell.js';
|
|
11
|
-
export type { CellProps, CellFailureProps, CellLoadingProps, CellSuccessProps, CellSuccessData, } from './components/cell/cellTypes.js';
|
|
11
|
+
export type { CellProps, CellFailureProps, CellLoadingProps, CellSuccessProps, CellSuccessData, CellBeforeQueryOptions, CellBeforeQueryResult, DataObject, } from './components/cell/cellTypes.js';
|
|
12
12
|
export * from './graphql.js';
|
|
13
13
|
export * from './components/CedarProvider.js';
|
|
14
14
|
export * from './components/MetaTags.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,8BAA8B,CAAA;AACrC,OAAO,aAAa,CAAA;AAEpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAA;AAEvE,OAAO,EACL,mBAAmB,EACnB,cAAc,GACf,MAAM,qCAAqC,CAAA;AAC5C,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,8BAA8B,CAAA;AACrC,OAAO,aAAa,CAAA;AAEpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAA;AAEvE,OAAO,EACL,mBAAmB,EACnB,cAAc,GACf,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC1D,YAAY,EACV,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,8BAA8B,CAAA;AAErC,cAAc,uCAAuC,CAAA;AAErD,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAA;AAE5E,YAAY,EACV,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EACrB,UAAU,GACX,MAAM,gCAAgC,CAAA;AAEvC,cAAc,cAAc,CAAA;AAE5B,cAAc,+BAA+B,CAAA;AAE7C,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAE,MAAM,IAAI,IAAI,EAAE,MAAM,EAAE,CAAA;AAEjC,cAAc,0BAA0B,CAAA;AACxC,cAAc,uBAAuB,CAAA;AAErC,cAAc,8BAA8B,CAAA;AAE5C,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -5,11 +5,7 @@ import {
|
|
|
5
5
|
FetchConfigProvider,
|
|
6
6
|
useFetchConfig
|
|
7
7
|
} from "./components/FetchConfigProvider.js";
|
|
8
|
-
import {
|
|
9
|
-
useQuery,
|
|
10
|
-
useMutation,
|
|
11
|
-
useSubscription
|
|
12
|
-
} from "@apollo/client/react/hooks/hooks.cjs";
|
|
8
|
+
import { useQuery, useMutation, useSubscription } from "@apollo/client/react";
|
|
13
9
|
import { useFragment } from "./apollo/fragmentRegistry.js";
|
|
14
10
|
export * from "./components/cell/CellCacheContext.js";
|
|
15
11
|
import { createCell } from "./components/cell/createCell.js";
|
|
@@ -8,7 +8,7 @@ export type MiddlewareInvokeOptions = {
|
|
|
8
8
|
route?: RWRouteManifestItem;
|
|
9
9
|
cssPaths?: string[];
|
|
10
10
|
params?: Record<string, unknown>;
|
|
11
|
-
|
|
11
|
+
viteSsrDevServer?: ViteDevServer;
|
|
12
12
|
};
|
|
13
13
|
export type Middleware = (req: MiddlewareRequest, res: MiddlewareResponse, options?: MiddlewareInvokeOptions) => Promise<MiddlewareResponse> | MiddlewareResponse | void;
|
|
14
14
|
export interface MiddlewareClass {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../src/server/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,MAAM,CAAA;AAIzC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAA;AAE3E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAEjE,cAAc,wBAAwB,CAAA;AACtC,cAAc,yBAAyB,CAAA;AAEvC,MAAM,MAAM,uBAAuB,GAAG;IACpC,KAAK,CAAC,EAAE,mBAAmB,CAAA;IAC3B,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC,
|
|
1
|
+
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../src/server/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,MAAM,CAAA;AAIzC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAA;AAE3E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAEjE,cAAc,wBAAwB,CAAA;AACtC,cAAc,yBAAyB,CAAA;AAEvC,MAAM,MAAM,uBAAuB,GAAG;IACpC,KAAK,CAAC,EAAE,mBAAmB,CAAA;IAC3B,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC,gBAAgB,CAAC,EAAE,aAAa,CAAA;CACjC,CAAA;AAED,MAAM,MAAM,UAAU,GAAG,CACvB,GAAG,EAAE,iBAAiB,EACtB,GAAG,EAAE,kBAAkB,EACvB,OAAO,CAAC,EAAE,uBAAuB,KAC9B,OAAO,CAAC,kBAAkB,CAAC,GAAG,kBAAkB,GAAG,IAAI,CAAA;AAE5D,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,UAAU,CAAA;CACnB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/web",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0-canary.2982",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/cedarjs/cedar.git",
|
|
@@ -80,49 +80,50 @@
|
|
|
80
80
|
"test:watch": "vitest watch"
|
|
81
81
|
},
|
|
82
82
|
"dependencies": {
|
|
83
|
-
"@apollo/client": "
|
|
84
|
-
"@cedarjs/server-store": "
|
|
83
|
+
"@apollo/client": "4.2.7",
|
|
84
|
+
"@cedarjs/server-store": "7.0.0-canary.2982",
|
|
85
85
|
"@dr.pogodin/react-helmet": "2.0.4",
|
|
86
86
|
"@whatwg-node/fetch": "0.10.13",
|
|
87
|
-
"apollo-upload-client": "
|
|
87
|
+
"apollo-upload-client": "19.0.0",
|
|
88
88
|
"cookie": "1.1.1",
|
|
89
89
|
"graphql": "16.14.2",
|
|
90
90
|
"graphql-sse": "2.6.0",
|
|
91
91
|
"graphql-tag": "2.12.6",
|
|
92
92
|
"react-hot-toast": "2.6.0",
|
|
93
|
+
"rxjs": "7.8.2",
|
|
93
94
|
"stacktracey": "2.2.0",
|
|
94
95
|
"ts-toolbelt": "9.6.0"
|
|
95
96
|
},
|
|
96
97
|
"devDependencies": {
|
|
97
|
-
"@apollo/client-react-streaming": "0.
|
|
98
|
+
"@apollo/client-react-streaming": "0.14.5",
|
|
98
99
|
"@arethetypeswrong/cli": "0.18.5",
|
|
99
100
|
"@babel/cli": "7.29.7",
|
|
100
101
|
"@babel/core": "^7.26.10",
|
|
101
102
|
"@babel/plugin-transform-runtime": "7.29.7",
|
|
102
103
|
"@babel/runtime": "7.29.7",
|
|
103
|
-
"@cedarjs/auth": "
|
|
104
|
-
"@cedarjs/framework-tools": "
|
|
105
|
-
"@cedarjs/internal": "
|
|
104
|
+
"@cedarjs/auth": "7.0.0-canary.2982",
|
|
105
|
+
"@cedarjs/framework-tools": "7.0.0-canary.2982",
|
|
106
|
+
"@cedarjs/internal": "7.0.0-canary.2982",
|
|
106
107
|
"@rollup/plugin-babel": "6.1.0",
|
|
107
108
|
"@testing-library/dom": "10.4.1",
|
|
108
109
|
"@testing-library/jest-dom": "6.9.1",
|
|
109
110
|
"@testing-library/react": "16.3.2",
|
|
110
|
-
"@types/apollo-upload-client": "^
|
|
111
|
+
"@types/apollo-upload-client": "^19",
|
|
111
112
|
"@types/react": "^18.2.55",
|
|
112
113
|
"@types/react-dom": "^18.2.19",
|
|
113
114
|
"concurrently": "9.2.4",
|
|
114
115
|
"nodemon": "3.1.14",
|
|
115
116
|
"publint": "0.3.23",
|
|
116
|
-
"react": "
|
|
117
|
-
"react-dom": "
|
|
117
|
+
"react": "19.2.3",
|
|
118
|
+
"react-dom": "19.2.3",
|
|
118
119
|
"tstyche": "5.0.2",
|
|
119
120
|
"typescript": "5.9.3",
|
|
120
121
|
"vitest": "4.1.10"
|
|
121
122
|
},
|
|
122
123
|
"peerDependencies": {
|
|
123
|
-
"@cedarjs/auth": "
|
|
124
|
-
"react": "
|
|
125
|
-
"react-dom": "
|
|
124
|
+
"@cedarjs/auth": "7.0.0-canary.2982",
|
|
125
|
+
"react": "19.2.3",
|
|
126
|
+
"react-dom": "19.2.3"
|
|
126
127
|
},
|
|
127
128
|
"engines": {
|
|
128
129
|
"node": ">=24"
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface RedwoodProviderProps {
|
|
3
|
-
children: React.ReactNode;
|
|
4
|
-
titleTemplate?: string;
|
|
5
|
-
}
|
|
6
|
-
export declare const RedwoodProvider: ({ children, titleTemplate, }: RedwoodProviderProps) => React.JSX.Element;
|
|
7
|
-
declare global { }
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=RedwoodProvider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RedwoodProvider.d.ts","sourceRoot":"","sources":["../../src/components/RedwoodProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,UAAU,oBAAoB;IAC5B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,eAAO,MAAM,eAAe,GAAI,8BAG7B,oBAAoB,sBAuBtB,CAAA;AAED,OAAO,CAAC,MAAM,CAAC,GAAE"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Helmet, HelmetProvider } from "@dr.pogodin/react-helmet";
|
|
3
|
-
const RedwoodProvider = ({
|
|
4
|
-
children,
|
|
5
|
-
titleTemplate
|
|
6
|
-
}) => {
|
|
7
|
-
const appTitle = globalThis.__REDWOOD__APP_TITLE;
|
|
8
|
-
const template = () => {
|
|
9
|
-
if (titleTemplate) {
|
|
10
|
-
let template2 = titleTemplate.replace(/%AppTitle/g, appTitle);
|
|
11
|
-
template2 = template2.replace(/%PageTitle/g, "%s");
|
|
12
|
-
return template2;
|
|
13
|
-
}
|
|
14
|
-
return "";
|
|
15
|
-
};
|
|
16
|
-
if (RWJS_ENV.RWJS_EXP_STREAMING_SSR) {
|
|
17
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, children);
|
|
18
|
-
}
|
|
19
|
-
return /* @__PURE__ */ React.createElement(HelmetProvider, { context: globalThis.__REDWOOD__HELMET_CONTEXT }, /* @__PURE__ */ React.createElement(Helmet, { titleTemplate: template(), defaultTitle: appTitle }, /* @__PURE__ */ React.createElement("title", null, appTitle)), children);
|
|
20
|
-
};
|
|
21
|
-
export {
|
|
22
|
-
RedwoodProvider
|
|
23
|
-
};
|