@orieljs/inertia-react 0.1.0-alpha.5 → 0.1.0-alpha.7

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/NOTICE CHANGED
@@ -7,3 +7,10 @@ This product includes software developed by the Oriel project
7
7
  Oriel is licensed under the Apache License, Version 2.0 (see LICENSE).
8
8
  The Oriel name and logo are not covered by that license; see TRADEMARKS.md
9
9
  (https://github.com/orieljs/framework/blob/main/TRADEMARKS.md).
10
+
11
+ @orieljs/support (and @orieljs/framework, which bundles it) includes transliteration data from
12
+ voku/portable-ascii (https://github.com/voku/portable-ascii), Copyright (C) 2019 Lars Moelleken, MIT License.
13
+
14
+ @orieljs/notifications (and @orieljs/framework, which bundles it) includes the HTML and CSS of
15
+ Laravel's default notification mail (laravel/framework, https://github.com/laravel/framework),
16
+ Copyright (c) Taylor Otwell, MIT License.
package/README.md CHANGED
@@ -3,18 +3,22 @@
3
3
  The Oriel React adapter for Inertia: the official `@inertiajs/react` 3.7 adapter, re-exported with typed pages and Oriel route helpers. Apps load it through `oriel({ input, framework })` from `@orieljs/vite`.
4
4
 
5
5
  ```bash
6
- npm install @orieljs/inertia-react react react-dom
6
+ npm install @orieljs/inertia-react @orieljs/inertia-client react react-dom
7
7
  ```
8
8
 
9
- ```tsx
10
- // resources/js/app.tsx
9
+ ```tsx title="resources/js/app.tsx"
11
10
  import { createInertiaApp } from '@orieljs/inertia-react'
12
11
 
13
12
  createInertiaApp({ pages: './pages' })
14
13
  ```
15
14
 
16
- ```tsx
17
- // resources/js/pages/Posts/Index.tsx
15
+ ```tsx title="resources/js/pages/Posts/Index.tsx"
16
+ // @filename: resources/js/oriel/pages.d.ts
17
+ declare module '@orieljs/inertia-client' {
18
+ interface Pages { 'Posts/Index': { posts: { id: number; title: string }[] } }
19
+ }
20
+ export {}
21
+ // ---cut---
18
22
  import { usePage } from '@orieljs/inertia-react'
19
23
 
20
24
  export default function Index() {
@@ -25,14 +29,14 @@ export default function Index() {
25
29
 
26
30
  It adds a typed `usePage<N>()` (props, shared props and errors come from the generated page types), `route()`, `hasRoute()`, `currentRoute()` and `isCurrentRoute()`, and a `./server` export for server-side rendering. During server-side rendering `currentRoute()` and `isCurrentRoute()` read the URL of the page being rendered, so active links hydrate unchanged.
27
31
 
28
- Known limitations:
32
+ Precognition (`useForm('post', url, data).validate('title')`, `form.withPrecognition()`, `<Form>`'s `validate()`) works on routes with the `precognitive` middleware.
29
33
 
30
- - Precognition (`useForm().validate()`, `withPrecognition`) is exported by the official adapter, but Oriel has no Precognition middleware yet.
34
+ Documentation: https://orieljs.vercel.app/docs/inertia
31
35
 
32
36
  Status: early alpha. APIs will change.
33
37
 
34
38
  ## License
35
39
 
36
- Oriel is open-source software licensed under the Apache License 2.0 (Apache-2.0; see `LICENSE` and `NOTICE`). The Oriel name and logo are trademarks; see [`TRADEMARKS.md`](https://github.com/orieljs/framework/blob/main/TRADEMARKS.md).
40
+ Oriel is open-source software licensed under the Apache License 2.0 (Apache-2.0; see `LICENSE` and `NOTICE`). The Oriel name and logo are trademarks; see `TRADEMARKS.md`.
37
41
 
38
42
  Website: https://orieljs.vercel.app
package/TRADEMARKS.md ADDED
@@ -0,0 +1,33 @@
1
+ # Oriel trademark policy
2
+
3
+ The Oriel code is open source under the Apache License 2.0. The **Oriel name and logo** are not: the license covers
4
+ the code only (section 6 of the license says so), and the name and logo stay with the project. This page explains
5
+ what you can and can't do with them. The goal is simple: people should always be able to tell what is the real Oriel
6
+ and what isn't.
7
+
8
+ ## You can, without asking
9
+
10
+ - Use, change, ship and sell the code, as the license allows.
11
+ - Say that your app or package is "built with Oriel", "for Oriel" or "compatible with Oriel".
12
+ - Name a package `oriel-<something>` or `<something>-for-oriel` when it works with Oriel, as long as it is clear that
13
+ it is not official (for example, don't publish it under the `@orieljs` npm scope).
14
+ - Use the name and logo to write about Oriel, teach it, or link to it, in articles, talks, videos and courses.
15
+ - Use the unmodified logo to point to the project, as it is (no recolouring, cropping or
16
+ distortion).
17
+
18
+ ## You can't, without written permission
19
+
20
+ - Call a fork, a modified copy or a competing product "Oriel", or anything likely to be confused with it.
21
+ - Use the name or logo as the name, logo or domain of your own product, company or service.
22
+ - Suggest that the Oriel project made, endorses or supports your work when it doesn't.
23
+ - Sell merchandise with the name or logo.
24
+
25
+ ## Forks
26
+
27
+ Forks are welcome. Please give yours a different name and logo, keep the `LICENSE` and `NOTICE` files, and say that
28
+ it is based on Oriel.
29
+
30
+ ## Questions
31
+
32
+ Open an issue at https://github.com/orieljs/framework or email meeeet.dev@gmail.com. If you're unsure whether a use
33
+ is fine, ask; the answer is usually yes.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../index.ts","../usePage.ts"],"sourcesContent":["/**\n * The Oriel React adapter: the official @inertiajs/react (createInertiaApp, Link, useForm, Head, Deferred, WhenVisible,\n * InfiniteScroll, Form, router, …) with Oriel's typed client helpers. useForm's Precognition calls (validate(),\n * precognitive forms) are not supported: Oriel has no Precognition middleware.\n */\nexport * from '@inertiajs/react'\n// Shadows the official usePage (an explicit export wins over `export *`).\nexport { usePage } from './usePage'\nexport { currentRoute, hasRoute, isCurrentRoute, route, RouteError } from '@orieljs/inertia-client'\nexport type {\n ErrorBags,\n Errors,\n LinkProps,\n PageName,\n PageProps,\n Pages,\n RouteList,\n RouteName,\n SharedProps,\n TypedPage,\n} from '@orieljs/inertia-client'\n","import { usePage as useInertiaPage } from '@inertiajs/react'\nimport type { PageName, TypedPage } from '@orieljs/inertia-client'\n\n/**\n * The current page, typed by its name: usePage<'Posts/Index'>().props holds that page's props, the shared props and\n * the validation errors (the types `oriel inertia:types` generates). The same page object as @inertiajs/react's\n * usePage(), so the component re-renders on every visit.\n */\nexport function usePage<N extends PageName = PageName>(): TypedPage<N> {\n return useInertiaPage() as unknown as TypedPage<N>\n}\n"],"mappings":";AAKA,cAAc;;;ACLd,SAAS,WAAW,sBAAsB;AAQnC,SAAS,UAAuD;AACrE,SAAO,eAAe;AACxB;;;ADFA,SAAS,cAAc,UAAU,gBAAgB,OAAO,kBAAkB;","names":[]}
1
+ {"version":3,"sources":["../index.ts","../usePage.ts"],"sourcesContent":["/**\n * The Oriel React adapter: the official @inertiajs/react (createInertiaApp, Link, useForm, Head, Deferred, WhenVisible,\n * InfiniteScroll, Form, router, …) with Oriel's typed client helpers. Precognition (`useForm('post', url,\n * data).validate('title')`, `<Form>`'s validate()) asks routes that have the `precognitive` middleware.\n */\nexport * from '@inertiajs/react'\n// Shadows the official usePage (an explicit export wins over `export *`).\nexport { usePage } from './usePage'\nexport { currentRoute, hasRoute, isCurrentRoute, route, RouteError } from '@orieljs/inertia-client'\nexport type {\n ErrorBags,\n Errors,\n LinkProps,\n PageName,\n PageProps,\n Pages,\n RouteList,\n RouteName,\n SharedProps,\n TypedPage,\n} from '@orieljs/inertia-client'\n","import { usePage as useInertiaPage } from '@inertiajs/react'\nimport type { PageName, TypedPage } from '@orieljs/inertia-client'\n\n/**\n * The current page, typed by its name: usePage<'Posts/Index'>().props holds that page's props, the shared props and\n * the validation errors (the types `oriel inertia:types` generates). The same page object as @inertiajs/react's\n * usePage(), so the component re-renders on every visit.\n */\nexport function usePage<N extends PageName = PageName>(): TypedPage<N> {\n return useInertiaPage() as unknown as TypedPage<N>\n}\n"],"mappings":";AAKA,cAAc;;;ACLd,SAAS,WAAW,sBAAsB;AAQnC,SAAS,UAAuD;AACrE,SAAO,eAAe;AACxB;;;ADFA,SAAS,cAAc,UAAU,gBAAgB,OAAO,kBAAkB;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orieljs/inertia-react",
3
- "version": "0.1.0-alpha.5",
3
+ "version": "0.1.0-alpha.7",
4
4
  "description": "The Oriel React adapter: the official Inertia React adapter with typed pages and route().",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -31,12 +31,13 @@
31
31
  "files": [
32
32
  "dist",
33
33
  "LICENSE",
34
- "NOTICE"
34
+ "NOTICE",
35
+ "TRADEMARKS.md"
35
36
  ],
36
37
  "dependencies": {
37
38
  "@inertiajs/core": "3.7.1",
38
39
  "@inertiajs/react": "3.7.1",
39
- "@orieljs/inertia-client": "0.1.0-alpha.5"
40
+ "@orieljs/inertia-client": "0.1.0-alpha.7"
40
41
  },
41
42
  "peerDependencies": {
42
43
  "react": "^19.0.0",