@ory/elements-react 1.0.0-next.17 → 1.0.0-next.18
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/CHANGELOG.md +23 -0
- package/api-report/elements-react-client.api.json +144 -16
- package/api-report/elements-react-client.api.md +19 -8
- package/api-report/elements-react-theme.api.json +47 -0
- package/api-report/elements-react-theme.api.md +5 -2
- package/api-report/elements-react.api.json +7 -3
- package/api-report/elements-react.api.md +4 -2
- package/api-report/temp/elements-react-client.api.md +19 -8
- package/api-report/temp/elements-react-theme.api.md +5 -2
- package/api-report/temp/elements-react.api.md +4 -2
- package/dist/client/config.d.mts +21 -0
- package/dist/client/config.d.ts +21 -0
- package/dist/client/config.js +77 -0
- package/dist/client/config.js.map +1 -0
- package/dist/client/config.mjs +51 -0
- package/dist/client/config.mjs.map +1 -0
- package/dist/client/frontendClient.d.mts +3 -1
- package/dist/client/frontendClient.d.ts +3 -1
- package/dist/client/frontendClient.js +14 -2
- package/dist/client/frontendClient.js.map +1 -1
- package/dist/client/frontendClient.mjs +14 -2
- package/dist/client/frontendClient.mjs.map +1 -1
- package/dist/client/index.d.mts +3 -1
- package/dist/client/index.d.ts +3 -1
- package/dist/client/index.js +4 -0
- package/dist/client/index.js.map +1 -1
- package/dist/client/index.mjs +5 -0
- package/dist/client/index.mjs.map +1 -1
- package/dist/client/session-provider.d.mts +62 -0
- package/dist/client/session-provider.d.ts +62 -0
- package/dist/client/session-provider.js +96 -0
- package/dist/client/session-provider.js.map +1 -0
- package/dist/client/session-provider.mjs +71 -0
- package/dist/client/session-provider.mjs.map +1 -0
- package/dist/client/useSession.d.mts +22 -31
- package/dist/client/useSession.d.ts +22 -31
- package/dist/client/useSession.js +7 -49
- package/dist/client/useSession.js.map +1 -1
- package/dist/client/useSession.mjs +8 -49
- package/dist/client/useSession.mjs.map +1 -1
- package/dist/index.d.mts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.js +46 -24
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +49 -27
- package/dist/index.mjs.map +1 -1
- package/dist/theme/default/index.css +358 -251
- package/dist/theme/default/index.css.map +1 -1
- package/dist/theme/default/index.d.mts +4 -2
- package/dist/theme/default/index.d.ts +4 -2
- package/dist/theme/default/index.js +605 -531
- package/dist/theme/default/index.js.map +1 -1
- package/dist/theme/default/index.mjs +536 -463
- package/dist/theme/default/index.mjs.map +1 -1
- package/jest.config.ts +1 -1
- package/package.json +2 -1
- package/postcss.config.ts +1 -0
- package/tailwind.config.ts +14 -13
- package/tsconfig.json +4 -3
- package/variables-processed.json +385 -187
- package/.eslintrc.js +0 -63
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
## 1.0.0-next.18 (2024-12-30)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- add page and app router examples ([#307](https://github.com/ory/elements/pull/307))
|
|
6
|
+
- ⚠️ add getServerSession and SessionProvider ([#309](https://github.com/ory/elements/pull/309))
|
|
7
|
+
- add @ory/nextjs package ([#303](https://github.com/ory/elements/pull/303))
|
|
8
|
+
|
|
9
|
+
### 🩹 Fixes
|
|
10
|
+
|
|
11
|
+
- align font sizes to design & use updated variable names ([#318](https://github.com/ory/elements/pull/318))
|
|
12
|
+
- properly set default value for checkboxes ([#314](https://github.com/ory/elements/pull/314))
|
|
13
|
+
- passkey and webauthn in settings flow ([#317](https://github.com/ory/elements/pull/317))
|
|
14
|
+
|
|
15
|
+
### ⚠️ Breaking Changes
|
|
16
|
+
|
|
17
|
+
- ⚠️ add getServerSession and SessionProvider ([#309](https://github.com/ory/elements/pull/309))
|
|
18
|
+
|
|
19
|
+
### ❤️ Thank You
|
|
20
|
+
|
|
21
|
+
- hackerman @aeneasr
|
|
22
|
+
- Jonas Hungershausen
|
|
23
|
+
|
|
1
24
|
## 1.0.0-next.17 (2024-11-27)
|
|
2
25
|
|
|
3
26
|
|
|
@@ -173,53 +173,181 @@
|
|
|
173
173
|
"preserveMemberOrder": false,
|
|
174
174
|
"members": [
|
|
175
175
|
{
|
|
176
|
-
"kind": "
|
|
177
|
-
"canonicalReference": "@ory/elements-react!
|
|
178
|
-
"docComment": "
|
|
176
|
+
"kind": "TypeAlias",
|
|
177
|
+
"canonicalReference": "@ory/elements-react!SessionContextData:type",
|
|
178
|
+
"docComment": "",
|
|
179
179
|
"excerptTokens": [
|
|
180
180
|
{
|
|
181
181
|
"kind": "Content",
|
|
182
|
-
"text": "
|
|
182
|
+
"text": "type SessionContextData = "
|
|
183
183
|
},
|
|
184
184
|
{
|
|
185
185
|
"kind": "Content",
|
|
186
|
-
"text": "{\n
|
|
186
|
+
"text": "{\n isLoading: boolean;\n initialized: boolean;\n session: "
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"kind": "Reference",
|
|
190
|
+
"text": "Session",
|
|
191
|
+
"canonicalReference": "@ory/client-fetch!Session:interface"
|
|
187
192
|
},
|
|
188
193
|
{
|
|
189
194
|
"kind": "Content",
|
|
190
|
-
"text": "
|
|
195
|
+
"text": " | null;\n error: "
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"kind": "Reference",
|
|
199
|
+
"text": "Error",
|
|
200
|
+
"canonicalReference": "!Error:interface"
|
|
191
201
|
},
|
|
192
202
|
{
|
|
193
203
|
"kind": "Content",
|
|
194
|
-
"text": "
|
|
204
|
+
"text": " | undefined;\n refetch: () => "
|
|
195
205
|
},
|
|
196
206
|
{
|
|
197
207
|
"kind": "Reference",
|
|
198
|
-
"text": "
|
|
199
|
-
"canonicalReference": "
|
|
208
|
+
"text": "Promise",
|
|
209
|
+
"canonicalReference": "!Promise:interface"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"kind": "Content",
|
|
213
|
+
"text": "<void>;\n}"
|
|
200
214
|
},
|
|
201
215
|
{
|
|
202
216
|
"kind": "Content",
|
|
203
|
-
"text": "
|
|
217
|
+
"text": ";"
|
|
204
218
|
}
|
|
205
219
|
],
|
|
206
|
-
"fileUrlPath": "dist/client/
|
|
220
|
+
"fileUrlPath": "dist/client/session-provider.d.ts",
|
|
221
|
+
"releaseTag": "Public",
|
|
222
|
+
"name": "SessionContextData",
|
|
223
|
+
"typeTokenRange": {
|
|
224
|
+
"startIndex": 1,
|
|
225
|
+
"endIndex": 8
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"kind": "Function",
|
|
230
|
+
"canonicalReference": "@ory/elements-react!SessionProvider:function(1)",
|
|
231
|
+
"docComment": "/**\n * A provider that fetches the session from the Ory Network and provides it to the children.\n *\n * To use this provider, wrap your application in it:\n * ```tsx\n * import { SessionProvider } from \"@ory/elements-react\"\n *\n * export default function App() {\n * return (\n * <SessionProvider>\n * <MyApp />\n * </SessionProvider>\n * )\n * }\n * ```\n *\n * If you have a session from the server, you can pass it to the provider:\n * ```tsx\n * <SessionProvider session={serverSession}>\n * ```\n *\n * @param props - The provider props\n *\n * @see\n *\n * {@link useSession}\n */\n",
|
|
232
|
+
"excerptTokens": [
|
|
233
|
+
{
|
|
234
|
+
"kind": "Content",
|
|
235
|
+
"text": "declare function SessionProvider({ "
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
"kind": "Reference",
|
|
239
|
+
"text": "session",
|
|
240
|
+
"canonicalReference": "@ory/elements-react!~__type#session"
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
"kind": "Content",
|
|
244
|
+
"text": ": initialSession, children, baseUrl, }: "
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
"kind": "Reference",
|
|
248
|
+
"text": "SessionProviderProps",
|
|
249
|
+
"canonicalReference": "@ory/elements-react!SessionProviderProps:type"
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
"kind": "Content",
|
|
253
|
+
"text": "): "
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"kind": "Reference",
|
|
257
|
+
"text": "react_jsx_runtime.JSX.Element",
|
|
258
|
+
"canonicalReference": "@types/react!JSX.Element:interface"
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
"kind": "Content",
|
|
262
|
+
"text": ";"
|
|
263
|
+
}
|
|
264
|
+
],
|
|
265
|
+
"fileUrlPath": "dist/client/session-provider.d.ts",
|
|
207
266
|
"returnTypeTokenRange": {
|
|
208
|
-
"startIndex":
|
|
267
|
+
"startIndex": 5,
|
|
209
268
|
"endIndex": 6
|
|
210
269
|
},
|
|
211
270
|
"releaseTag": "Public",
|
|
212
271
|
"overloadIndex": 1,
|
|
213
272
|
"parameters": [
|
|
214
273
|
{
|
|
215
|
-
"parameterName": "
|
|
274
|
+
"parameterName": "{ session: initialSession, children, baseUrl, }",
|
|
216
275
|
"parameterTypeTokenRange": {
|
|
217
|
-
"startIndex":
|
|
218
|
-
"endIndex":
|
|
276
|
+
"startIndex": 3,
|
|
277
|
+
"endIndex": 4
|
|
219
278
|
},
|
|
220
|
-
"isOptional":
|
|
279
|
+
"isOptional": false
|
|
280
|
+
}
|
|
281
|
+
],
|
|
282
|
+
"name": "SessionProvider"
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
"kind": "TypeAlias",
|
|
286
|
+
"canonicalReference": "@ory/elements-react!SessionProviderProps:type",
|
|
287
|
+
"docComment": "",
|
|
288
|
+
"excerptTokens": [
|
|
289
|
+
{
|
|
290
|
+
"kind": "Content",
|
|
291
|
+
"text": "type SessionProviderProps = "
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
"kind": "Content",
|
|
295
|
+
"text": "{\n session?: "
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
"kind": "Reference",
|
|
299
|
+
"text": "Session",
|
|
300
|
+
"canonicalReference": "@ory/client-fetch!Session:interface"
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
"kind": "Content",
|
|
304
|
+
"text": " | null;\n baseUrl?: string;\n} & "
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
"kind": "Reference",
|
|
308
|
+
"text": "React.PropsWithChildren",
|
|
309
|
+
"canonicalReference": "@types/react!React.PropsWithChildren:type"
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
"kind": "Content",
|
|
313
|
+
"text": ";"
|
|
314
|
+
}
|
|
315
|
+
],
|
|
316
|
+
"fileUrlPath": "dist/client/session-provider.d.ts",
|
|
317
|
+
"releaseTag": "Public",
|
|
318
|
+
"name": "SessionProviderProps",
|
|
319
|
+
"typeTokenRange": {
|
|
320
|
+
"startIndex": 1,
|
|
321
|
+
"endIndex": 5
|
|
322
|
+
}
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
"kind": "Function",
|
|
326
|
+
"canonicalReference": "@ory/elements-react!useSession:function(1)",
|
|
327
|
+
"docComment": "/**\n * A hook to get the current session from the Ory Network.\n *\n * Usage:\n * ```ts\n * const session = useSession()\n *\n * if (session.state == \"loading\") {\n * return <div>Loading...</div>\n * }\n *\n * if (session.state == \"authenticated\") {\n * return <div>Session: {session.session.id}</div>\n * }\n * ```\n *\n * :::note This is a client-side hook and must be used within a React component. On the server, you can use the getServerSession function from `@ory/nextjs` and hydrate SessionProvider with the session. :::\n *\n * @returns The current session, and error or loading state.\n */\n",
|
|
328
|
+
"excerptTokens": [
|
|
329
|
+
{
|
|
330
|
+
"kind": "Content",
|
|
331
|
+
"text": "declare function useSession(): "
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
"kind": "Reference",
|
|
335
|
+
"text": "SessionContextData",
|
|
336
|
+
"canonicalReference": "@ory/elements-react!SessionContextData:type"
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
"kind": "Content",
|
|
340
|
+
"text": ";"
|
|
221
341
|
}
|
|
222
342
|
],
|
|
343
|
+
"fileUrlPath": "dist/client/useSession.d.ts",
|
|
344
|
+
"returnTypeTokenRange": {
|
|
345
|
+
"startIndex": 1,
|
|
346
|
+
"endIndex": 2
|
|
347
|
+
},
|
|
348
|
+
"releaseTag": "Public",
|
|
349
|
+
"overloadIndex": 1,
|
|
350
|
+
"parameters": [],
|
|
223
351
|
"name": "useSession"
|
|
224
352
|
}
|
|
225
353
|
]
|
|
@@ -4,19 +4,30 @@
|
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
6
|
|
|
7
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
8
|
import { Session } from '@ory/client-fetch';
|
|
8
9
|
|
|
9
|
-
// @public
|
|
10
|
-
export
|
|
11
|
-
sdk: {
|
|
12
|
-
url: string;
|
|
13
|
-
};
|
|
14
|
-
}) => {
|
|
15
|
-
session: Session | undefined;
|
|
16
|
-
error: string | undefined;
|
|
10
|
+
// @public (undocumented)
|
|
11
|
+
export type SessionContextData = {
|
|
17
12
|
isLoading: boolean;
|
|
13
|
+
initialized: boolean;
|
|
14
|
+
session: Session | null;
|
|
15
|
+
error: Error | undefined;
|
|
16
|
+
refetch: () => Promise<void>;
|
|
18
17
|
};
|
|
19
18
|
|
|
19
|
+
// @public
|
|
20
|
+
export function SessionProvider({ session: initialSession, children, baseUrl, }: SessionProviderProps): react_jsx_runtime.JSX.Element;
|
|
21
|
+
|
|
22
|
+
// @public (undocumented)
|
|
23
|
+
export type SessionProviderProps = {
|
|
24
|
+
session?: Session | null;
|
|
25
|
+
baseUrl?: string;
|
|
26
|
+
} & React.PropsWithChildren;
|
|
27
|
+
|
|
28
|
+
// @public
|
|
29
|
+
export function useSession(): SessionContextData;
|
|
30
|
+
|
|
20
31
|
// (No @packageDocumentation comment for this package)
|
|
21
32
|
|
|
22
33
|
```
|
|
@@ -478,6 +478,53 @@
|
|
|
478
478
|
"parameters": [],
|
|
479
479
|
"name": "DefaultCardHeader"
|
|
480
480
|
},
|
|
481
|
+
{
|
|
482
|
+
"kind": "Function",
|
|
483
|
+
"canonicalReference": "@ory/elements-react!DefaultCardLayout:function(1)",
|
|
484
|
+
"docComment": "",
|
|
485
|
+
"excerptTokens": [
|
|
486
|
+
{
|
|
487
|
+
"kind": "Content",
|
|
488
|
+
"text": "declare function DefaultCardLayout({ children }: "
|
|
489
|
+
},
|
|
490
|
+
{
|
|
491
|
+
"kind": "Reference",
|
|
492
|
+
"text": "PropsWithChildren",
|
|
493
|
+
"canonicalReference": "@types/react!React.PropsWithChildren:type"
|
|
494
|
+
},
|
|
495
|
+
{
|
|
496
|
+
"kind": "Content",
|
|
497
|
+
"text": "): "
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
"kind": "Reference",
|
|
501
|
+
"text": "react_jsx_runtime.JSX.Element",
|
|
502
|
+
"canonicalReference": "@types/react!JSX.Element:interface"
|
|
503
|
+
},
|
|
504
|
+
{
|
|
505
|
+
"kind": "Content",
|
|
506
|
+
"text": ";"
|
|
507
|
+
}
|
|
508
|
+
],
|
|
509
|
+
"fileUrlPath": "dist/theme/default/index.d.ts",
|
|
510
|
+
"returnTypeTokenRange": {
|
|
511
|
+
"startIndex": 3,
|
|
512
|
+
"endIndex": 4
|
|
513
|
+
},
|
|
514
|
+
"releaseTag": "Public",
|
|
515
|
+
"overloadIndex": 1,
|
|
516
|
+
"parameters": [
|
|
517
|
+
{
|
|
518
|
+
"parameterName": "{ children }",
|
|
519
|
+
"parameterTypeTokenRange": {
|
|
520
|
+
"startIndex": 1,
|
|
521
|
+
"endIndex": 2
|
|
522
|
+
},
|
|
523
|
+
"isOptional": false
|
|
524
|
+
}
|
|
525
|
+
],
|
|
526
|
+
"name": "DefaultCardLayout"
|
|
527
|
+
},
|
|
481
528
|
{
|
|
482
529
|
"kind": "Function",
|
|
483
530
|
"canonicalReference": "@ory/elements-react!DefaultCardLogo:function(1)",
|
|
@@ -56,6 +56,9 @@ export function DefaultCardFooter(): react_jsx_runtime.JSX.Element | null;
|
|
|
56
56
|
// @public (undocumented)
|
|
57
57
|
export function DefaultCardHeader(): react_jsx_runtime.JSX.Element;
|
|
58
58
|
|
|
59
|
+
// @public (undocumented)
|
|
60
|
+
export function DefaultCardLayout({ children }: PropsWithChildren): react_jsx_runtime.JSX.Element;
|
|
61
|
+
|
|
59
62
|
// @public (undocumented)
|
|
60
63
|
export function DefaultCardLogo(): react_jsx_runtime.JSX.Element;
|
|
61
64
|
|
|
@@ -138,8 +141,8 @@ export type VerificationFlowContextProps = {
|
|
|
138
141
|
|
|
139
142
|
// Warnings were encountered during analysis:
|
|
140
143
|
//
|
|
141
|
-
// dist/theme/default/index.d.ts:
|
|
142
|
-
// dist/theme/default/index.d.ts:
|
|
144
|
+
// dist/theme/default/index.d.ts:38:5 - (ae-forgotten-export) The symbol "OryFlowComponentOverrides" needs to be exported by the entry point index.d.ts
|
|
145
|
+
// dist/theme/default/index.d.ts:39:5 - (ae-forgotten-export) The symbol "OryClientConfiguration" needs to be exported by the entry point index.d.ts
|
|
143
146
|
|
|
144
147
|
// (No @packageDocumentation comment for this package)
|
|
145
148
|
|
|
@@ -1535,8 +1535,8 @@
|
|
|
1535
1535
|
},
|
|
1536
1536
|
{
|
|
1537
1537
|
"kind": "Reference",
|
|
1538
|
-
"text": "
|
|
1539
|
-
"canonicalReference": "@ory/elements-react!
|
|
1538
|
+
"text": "OryFormSectionFooterProps",
|
|
1539
|
+
"canonicalReference": "@ory/elements-react!OryFormSectionFooterProps:type"
|
|
1540
1540
|
},
|
|
1541
1541
|
{
|
|
1542
1542
|
"kind": "Content",
|
|
@@ -2308,6 +2308,10 @@
|
|
|
2308
2308
|
"text": "PropsWithChildren",
|
|
2309
2309
|
"canonicalReference": "@types/react!React.PropsWithChildren:type"
|
|
2310
2310
|
},
|
|
2311
|
+
{
|
|
2312
|
+
"kind": "Content",
|
|
2313
|
+
"text": "<{\n text?: string;\n}>"
|
|
2314
|
+
},
|
|
2311
2315
|
{
|
|
2312
2316
|
"kind": "Content",
|
|
2313
2317
|
"text": ";"
|
|
@@ -2318,7 +2322,7 @@
|
|
|
2318
2322
|
"name": "OryFormSectionFooterProps",
|
|
2319
2323
|
"typeTokenRange": {
|
|
2320
2324
|
"startIndex": 1,
|
|
2321
|
-
"endIndex":
|
|
2325
|
+
"endIndex": 3
|
|
2322
2326
|
}
|
|
2323
2327
|
},
|
|
2324
2328
|
{
|
|
@@ -191,7 +191,7 @@ export type OryFlowComponents = {
|
|
|
191
191
|
AuthMethodListItem: ComponentType<OryCardAuthMethodListItemProps>;
|
|
192
192
|
SettingsSection: ComponentType<OryFormSectionProps>;
|
|
193
193
|
SettingsSectionContent: ComponentType<OryFormSectionContentProps>;
|
|
194
|
-
SettingsSectionFooter: ComponentType<
|
|
194
|
+
SettingsSectionFooter: ComponentType<OryFormSectionFooterProps>;
|
|
195
195
|
};
|
|
196
196
|
Form: {
|
|
197
197
|
Root: ComponentType<OryFormRootProps>;
|
|
@@ -265,7 +265,9 @@ export type OryFormSectionContentProps = PropsWithChildren<{
|
|
|
265
265
|
}>;
|
|
266
266
|
|
|
267
267
|
// @public (undocumented)
|
|
268
|
-
export type OryFormSectionFooterProps = PropsWithChildren
|
|
268
|
+
export type OryFormSectionFooterProps = PropsWithChildren<{
|
|
269
|
+
text?: string;
|
|
270
|
+
}>;
|
|
269
271
|
|
|
270
272
|
// @public (undocumented)
|
|
271
273
|
export type OryFormSectionProps = PropsWithChildren<{
|
|
@@ -4,19 +4,30 @@
|
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
6
|
|
|
7
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
8
|
import { Session } from '@ory/client-fetch';
|
|
8
9
|
|
|
9
|
-
// @public
|
|
10
|
-
export
|
|
11
|
-
sdk: {
|
|
12
|
-
url: string;
|
|
13
|
-
};
|
|
14
|
-
}) => {
|
|
15
|
-
session: Session | undefined;
|
|
16
|
-
error: string | undefined;
|
|
10
|
+
// @public (undocumented)
|
|
11
|
+
export type SessionContextData = {
|
|
17
12
|
isLoading: boolean;
|
|
13
|
+
initialized: boolean;
|
|
14
|
+
session: Session | null;
|
|
15
|
+
error: Error | undefined;
|
|
16
|
+
refetch: () => Promise<void>;
|
|
18
17
|
};
|
|
19
18
|
|
|
19
|
+
// @public
|
|
20
|
+
export function SessionProvider({ session: initialSession, children, baseUrl, }: SessionProviderProps): react_jsx_runtime.JSX.Element;
|
|
21
|
+
|
|
22
|
+
// @public (undocumented)
|
|
23
|
+
export type SessionProviderProps = {
|
|
24
|
+
session?: Session | null;
|
|
25
|
+
baseUrl?: string;
|
|
26
|
+
} & React.PropsWithChildren;
|
|
27
|
+
|
|
28
|
+
// @public
|
|
29
|
+
export function useSession(): SessionContextData;
|
|
30
|
+
|
|
20
31
|
// (No @packageDocumentation comment for this package)
|
|
21
32
|
|
|
22
33
|
```
|
|
@@ -56,6 +56,9 @@ export function DefaultCardFooter(): react_jsx_runtime.JSX.Element | null;
|
|
|
56
56
|
// @public (undocumented)
|
|
57
57
|
export function DefaultCardHeader(): react_jsx_runtime.JSX.Element;
|
|
58
58
|
|
|
59
|
+
// @public (undocumented)
|
|
60
|
+
export function DefaultCardLayout({ children }: PropsWithChildren): react_jsx_runtime.JSX.Element;
|
|
61
|
+
|
|
59
62
|
// @public (undocumented)
|
|
60
63
|
export function DefaultCardLogo(): react_jsx_runtime.JSX.Element;
|
|
61
64
|
|
|
@@ -138,8 +141,8 @@ export type VerificationFlowContextProps = {
|
|
|
138
141
|
|
|
139
142
|
// Warnings were encountered during analysis:
|
|
140
143
|
//
|
|
141
|
-
// dist/theme/default/index.d.ts:
|
|
142
|
-
// dist/theme/default/index.d.ts:
|
|
144
|
+
// dist/theme/default/index.d.ts:38:5 - (ae-forgotten-export) The symbol "OryFlowComponentOverrides" needs to be exported by the entry point index.d.ts
|
|
145
|
+
// dist/theme/default/index.d.ts:39:5 - (ae-forgotten-export) The symbol "OryClientConfiguration" needs to be exported by the entry point index.d.ts
|
|
143
146
|
|
|
144
147
|
// (No @packageDocumentation comment for this package)
|
|
145
148
|
|
|
@@ -191,7 +191,7 @@ export type OryFlowComponents = {
|
|
|
191
191
|
AuthMethodListItem: ComponentType<OryCardAuthMethodListItemProps>;
|
|
192
192
|
SettingsSection: ComponentType<OryFormSectionProps>;
|
|
193
193
|
SettingsSectionContent: ComponentType<OryFormSectionContentProps>;
|
|
194
|
-
SettingsSectionFooter: ComponentType<
|
|
194
|
+
SettingsSectionFooter: ComponentType<OryFormSectionFooterProps>;
|
|
195
195
|
};
|
|
196
196
|
Form: {
|
|
197
197
|
Root: ComponentType<OryFormRootProps>;
|
|
@@ -265,7 +265,9 @@ export type OryFormSectionContentProps = PropsWithChildren<{
|
|
|
265
265
|
}>;
|
|
266
266
|
|
|
267
267
|
// @public (undocumented)
|
|
268
|
-
export type OryFormSectionFooterProps = PropsWithChildren
|
|
268
|
+
export type OryFormSectionFooterProps = PropsWithChildren<{
|
|
269
|
+
text?: string;
|
|
270
|
+
}>;
|
|
269
271
|
|
|
270
272
|
// @public (undocumented)
|
|
271
273
|
export type OryFormSectionProps = PropsWithChildren<{
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This function returns the base URL of the Ory SDK as set by environment variables `NEXT_PUBLIC_ORY_SDK_URL` or `ORY_SDK_URL`.
|
|
3
|
+
*/
|
|
4
|
+
declare function orySdkUrl(): string;
|
|
5
|
+
/**
|
|
6
|
+
* This function returns whether the current environment is a production environment.
|
|
7
|
+
*/
|
|
8
|
+
declare function isProduction(): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* This function returns the Ory SDK URL. If the environment is not production, it tries to guess the SDK URL based on the environment variables, assuming
|
|
11
|
+
* that Ory APIs are proxied through the same domain as the application.
|
|
12
|
+
*
|
|
13
|
+
* Currently, this is only tested for Vercel deployments.
|
|
14
|
+
*
|
|
15
|
+
* @param options - Options for guessing the SDK URL.
|
|
16
|
+
*/
|
|
17
|
+
declare function guessPotentiallyProxiedOrySdkUrl(options?: {
|
|
18
|
+
knownProxiedUrl?: string;
|
|
19
|
+
}): string;
|
|
20
|
+
|
|
21
|
+
export { guessPotentiallyProxiedOrySdkUrl, isProduction, orySdkUrl };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This function returns the base URL of the Ory SDK as set by environment variables `NEXT_PUBLIC_ORY_SDK_URL` or `ORY_SDK_URL`.
|
|
3
|
+
*/
|
|
4
|
+
declare function orySdkUrl(): string;
|
|
5
|
+
/**
|
|
6
|
+
* This function returns whether the current environment is a production environment.
|
|
7
|
+
*/
|
|
8
|
+
declare function isProduction(): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* This function returns the Ory SDK URL. If the environment is not production, it tries to guess the SDK URL based on the environment variables, assuming
|
|
11
|
+
* that Ory APIs are proxied through the same domain as the application.
|
|
12
|
+
*
|
|
13
|
+
* Currently, this is only tested for Vercel deployments.
|
|
14
|
+
*
|
|
15
|
+
* @param options - Options for guessing the SDK URL.
|
|
16
|
+
*/
|
|
17
|
+
declare function guessPotentiallyProxiedOrySdkUrl(options?: {
|
|
18
|
+
knownProxiedUrl?: string;
|
|
19
|
+
}): string;
|
|
20
|
+
|
|
21
|
+
export { guessPotentiallyProxiedOrySdkUrl, isProduction, orySdkUrl };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var config_exports = {};
|
|
20
|
+
__export(config_exports, {
|
|
21
|
+
guessPotentiallyProxiedOrySdkUrl: () => guessPotentiallyProxiedOrySdkUrl,
|
|
22
|
+
isProduction: () => isProduction,
|
|
23
|
+
orySdkUrl: () => orySdkUrl
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(config_exports);
|
|
26
|
+
function orySdkUrl() {
|
|
27
|
+
let baseUrl;
|
|
28
|
+
if (process.env.NEXT_PUBLIC_ORY_SDK_URL) {
|
|
29
|
+
baseUrl = process.env.NEXT_PUBLIC_ORY_SDK_URL;
|
|
30
|
+
}
|
|
31
|
+
if (process.env.ORY_SDK_URL) {
|
|
32
|
+
baseUrl = process.env._ORY_SDK_URL;
|
|
33
|
+
}
|
|
34
|
+
if (!baseUrl) {
|
|
35
|
+
throw new Error(
|
|
36
|
+
"You need to set environment variable `NEXT_PUBLIC_ORY_SDK_URL` or if you don't use Next.js `ORY_SDK_URL` to your Ory Network SDK URL."
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
return baseUrl.replace(/\/$/, "");
|
|
40
|
+
}
|
|
41
|
+
function isProduction() {
|
|
42
|
+
var _a, _b;
|
|
43
|
+
return ["production", "prod"].indexOf(
|
|
44
|
+
(_b = (_a = process.env.VERCEL_ENV) != null ? _a : process.env.NODE_ENV) != null ? _b : ""
|
|
45
|
+
) > -1;
|
|
46
|
+
}
|
|
47
|
+
function guessPotentiallyProxiedOrySdkUrl(options) {
|
|
48
|
+
if (isProduction()) {
|
|
49
|
+
return orySdkUrl();
|
|
50
|
+
}
|
|
51
|
+
if (process.env.VERCEL_ENV) {
|
|
52
|
+
if (!isProduction() && process.env.VERCEL_URL) {
|
|
53
|
+
return `https://${process.env.VERCEL_URL}`.replace(/\/$/, "");
|
|
54
|
+
}
|
|
55
|
+
if (process.env.__NEXT_PRIVATE_ORIGIN) {
|
|
56
|
+
return process.env.__NEXT_PRIVATE_ORIGIN.replace(/\/$/, "");
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (typeof window !== "undefined") {
|
|
60
|
+
return window.location.origin;
|
|
61
|
+
}
|
|
62
|
+
if (options == null ? void 0 : options.knownProxiedUrl) {
|
|
63
|
+
return options.knownProxiedUrl;
|
|
64
|
+
}
|
|
65
|
+
const final = orySdkUrl();
|
|
66
|
+
console.warn(
|
|
67
|
+
`Unable to determine a suitable SDK URL for setting up the Next.js integration of Ory Elements. Will proceed using default Ory SDK URL "${final}". This is likely not what you want for local development and your authentication and login may not work.`
|
|
68
|
+
);
|
|
69
|
+
return final;
|
|
70
|
+
}
|
|
71
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
72
|
+
0 && (module.exports = {
|
|
73
|
+
guessPotentiallyProxiedOrySdkUrl,
|
|
74
|
+
isProduction,
|
|
75
|
+
orySdkUrl
|
|
76
|
+
});
|
|
77
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/client/config.ts"],"sourcesContent":["// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * This function returns the base URL of the Ory SDK as set by environment variables `NEXT_PUBLIC_ORY_SDK_URL` or `ORY_SDK_URL`.\n */\nexport function orySdkUrl() {\n let baseUrl\n\n if (process.env.NEXT_PUBLIC_ORY_SDK_URL) {\n baseUrl = process.env.NEXT_PUBLIC_ORY_SDK_URL\n }\n\n if (process.env.ORY_SDK_URL) {\n baseUrl = process.env._ORY_SDK_URL\n }\n\n if (!baseUrl) {\n throw new Error(\n \"You need to set environment variable `NEXT_PUBLIC_ORY_SDK_URL` or if you don't use Next.js `ORY_SDK_URL` to your Ory Network SDK URL.\",\n )\n }\n\n return baseUrl.replace(/\\/$/, \"\")\n}\n\n/**\n * This function returns whether the current environment is a production environment.\n */\nexport function isProduction() {\n return (\n [\"production\", \"prod\"].indexOf(\n process.env.VERCEL_ENV ?? process.env.NODE_ENV ?? \"\",\n ) > -1\n )\n}\n\n/**\n * This function returns the Ory SDK URL. If the environment is not production, it tries to guess the SDK URL based on the environment variables, assuming\n * that Ory APIs are proxied through the same domain as the application.\n *\n * Currently, this is only tested for Vercel deployments.\n *\n * @param options - Options for guessing the SDK URL.\n */\nexport function guessPotentiallyProxiedOrySdkUrl(options?: {\n knownProxiedUrl?: string\n}) {\n if (isProduction()) {\n // In production, we use the production custom domain\n return orySdkUrl()\n }\n\n if (process.env.VERCEL_ENV) {\n // We are in vercel\n\n // The domain name of the generated deployment URL. Example: *.vercel.app. The value does not include the protocol scheme https://.\n //\n // This is only available for preview deployments on Vercel.\n if (!isProduction() && process.env.VERCEL_URL) {\n return `https://${process.env.VERCEL_URL}`.replace(/\\/$/, \"\")\n }\n\n // This is sometimes set by the render server.\n if (process.env.__NEXT_PRIVATE_ORIGIN) {\n return process.env.__NEXT_PRIVATE_ORIGIN.replace(/\\/$/, \"\")\n }\n }\n\n // Unable to figure out the SDK URL. Either because we are not using Vercel or because we are on a local machine.\n // Let's try to use the window location.\n if (typeof window !== \"undefined\") {\n return window.location.origin\n }\n\n if (options?.knownProxiedUrl) {\n return options.knownProxiedUrl\n }\n\n // We tried everything. Let's use the SDK URL.\n const final = orySdkUrl()\n console.warn(\n `Unable to determine a suitable SDK URL for setting up the Next.js integration of Ory Elements. Will proceed using default Ory SDK URL \"${final}\". This is likely not what you want for local development and your authentication and login may not work.`,\n )\n\n return final\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMO,SAAS,YAAY;AAC1B,MAAI;AAEJ,MAAI,QAAQ,IAAI,yBAAyB;AACvC,cAAU,QAAQ,IAAI;AAAA,EACxB;AAEA,MAAI,QAAQ,IAAI,aAAa;AAC3B,cAAU,QAAQ,IAAI;AAAA,EACxB;AAEA,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,SAAO,QAAQ,QAAQ,OAAO,EAAE;AAClC;AAKO,SAAS,eAAe;AA7B/B;AA8BE,SACE,CAAC,cAAc,MAAM,EAAE;AAAA,KACrB,mBAAQ,IAAI,eAAZ,YAA0B,QAAQ,IAAI,aAAtC,YAAkD;AAAA,EACpD,IAAI;AAER;AAUO,SAAS,iCAAiC,SAE9C;AACD,MAAI,aAAa,GAAG;AAElB,WAAO,UAAU;AAAA,EACnB;AAEA,MAAI,QAAQ,IAAI,YAAY;AAM1B,QAAI,CAAC,aAAa,KAAK,QAAQ,IAAI,YAAY;AAC7C,aAAO,WAAW,QAAQ,IAAI,UAAU,GAAG,QAAQ,OAAO,EAAE;AAAA,IAC9D;AAGA,QAAI,QAAQ,IAAI,uBAAuB;AACrC,aAAO,QAAQ,IAAI,sBAAsB,QAAQ,OAAO,EAAE;AAAA,IAC5D;AAAA,EACF;AAIA,MAAI,OAAO,WAAW,aAAa;AACjC,WAAO,OAAO,SAAS;AAAA,EACzB;AAEA,MAAI,mCAAS,iBAAiB;AAC5B,WAAO,QAAQ;AAAA,EACjB;AAGA,QAAM,QAAQ,UAAU;AACxB,UAAQ;AAAA,IACN,0IAA0I,KAAK;AAAA,EACjJ;AAEA,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
function orySdkUrl() {
|
|
2
|
+
let baseUrl;
|
|
3
|
+
if (process.env.NEXT_PUBLIC_ORY_SDK_URL) {
|
|
4
|
+
baseUrl = process.env.NEXT_PUBLIC_ORY_SDK_URL;
|
|
5
|
+
}
|
|
6
|
+
if (process.env.ORY_SDK_URL) {
|
|
7
|
+
baseUrl = process.env._ORY_SDK_URL;
|
|
8
|
+
}
|
|
9
|
+
if (!baseUrl) {
|
|
10
|
+
throw new Error(
|
|
11
|
+
"You need to set environment variable `NEXT_PUBLIC_ORY_SDK_URL` or if you don't use Next.js `ORY_SDK_URL` to your Ory Network SDK URL."
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
return baseUrl.replace(/\/$/, "");
|
|
15
|
+
}
|
|
16
|
+
function isProduction() {
|
|
17
|
+
var _a, _b;
|
|
18
|
+
return ["production", "prod"].indexOf(
|
|
19
|
+
(_b = (_a = process.env.VERCEL_ENV) != null ? _a : process.env.NODE_ENV) != null ? _b : ""
|
|
20
|
+
) > -1;
|
|
21
|
+
}
|
|
22
|
+
function guessPotentiallyProxiedOrySdkUrl(options) {
|
|
23
|
+
if (isProduction()) {
|
|
24
|
+
return orySdkUrl();
|
|
25
|
+
}
|
|
26
|
+
if (process.env.VERCEL_ENV) {
|
|
27
|
+
if (!isProduction() && process.env.VERCEL_URL) {
|
|
28
|
+
return `https://${process.env.VERCEL_URL}`.replace(/\/$/, "");
|
|
29
|
+
}
|
|
30
|
+
if (process.env.__NEXT_PRIVATE_ORIGIN) {
|
|
31
|
+
return process.env.__NEXT_PRIVATE_ORIGIN.replace(/\/$/, "");
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
if (typeof window !== "undefined") {
|
|
35
|
+
return window.location.origin;
|
|
36
|
+
}
|
|
37
|
+
if (options == null ? void 0 : options.knownProxiedUrl) {
|
|
38
|
+
return options.knownProxiedUrl;
|
|
39
|
+
}
|
|
40
|
+
const final = orySdkUrl();
|
|
41
|
+
console.warn(
|
|
42
|
+
`Unable to determine a suitable SDK URL for setting up the Next.js integration of Ory Elements. Will proceed using default Ory SDK URL "${final}". This is likely not what you want for local development and your authentication and login may not work.`
|
|
43
|
+
);
|
|
44
|
+
return final;
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
guessPotentiallyProxiedOrySdkUrl,
|
|
48
|
+
isProduction,
|
|
49
|
+
orySdkUrl
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=config.mjs.map
|