dn-react-router-toolkit 0.8.1 → 0.9.0

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.
Files changed (53) hide show
  1. package/dist/crud/index.d.mts +0 -20
  2. package/dist/crud/index.d.ts +0 -20
  3. package/dist/crud/index.js +12 -8587
  4. package/dist/crud/index.mjs +0 -8596
  5. package/dist/post/index.js +67 -7705
  6. package/dist/post/index.mjs +54 -7718
  7. package/dist/post/post_form_page.js +67 -7705
  8. package/dist/post/post_form_page.mjs +54 -7718
  9. package/dist/table/index.d.mts +0 -2
  10. package/dist/table/index.d.ts +0 -2
  11. package/dist/table/index.js +12 -79
  12. package/dist/table/index.mjs +12 -77
  13. package/dist/table/load_table.d.mts +1 -1
  14. package/dist/table/load_table.d.ts +1 -1
  15. package/dist/table/load_table.js +2 -2
  16. package/dist/table/load_table.mjs +2 -2
  17. package/dist/table/loader.js +2 -2
  18. package/dist/table/loader.mjs +2 -2
  19. package/dist/table/table.d.mts +2 -2
  20. package/dist/table/table.d.ts +2 -2
  21. package/dist/table/table.js +6 -23
  22. package/dist/table/table.mjs +6 -23
  23. package/dist/table/table_form.js +6 -23
  24. package/dist/table/table_form.mjs +6 -23
  25. package/package.json +2 -2
  26. package/dist/crud/crud_loader.d.mts +0 -26
  27. package/dist/crud/crud_loader.d.ts +0 -26
  28. package/dist/crud/crud_loader.js +0 -351
  29. package/dist/crud/crud_loader.mjs +0 -337
  30. package/dist/crud/crud_page.d.mts +0 -32
  31. package/dist/crud/crud_page.d.ts +0 -32
  32. package/dist/crud/crud_page.js +0 -776
  33. package/dist/crud/crud_page.mjs +0 -758
  34. package/dist/crud/generate_handlers.d.mts +0 -16
  35. package/dist/crud/generate_handlers.d.ts +0 -16
  36. package/dist/crud/generate_handlers.js +0 -39
  37. package/dist/crud/generate_handlers.mjs +0 -14
  38. package/dist/crud/generate_pages.d.mts +0 -19
  39. package/dist/crud/generate_pages.d.ts +0 -19
  40. package/dist/crud/generate_pages.js +0 -55
  41. package/dist/crud/generate_pages.mjs +0 -30
  42. package/dist/crud/generate_routes.d.mts +0 -5
  43. package/dist/crud/generate_routes.d.ts +0 -5
  44. package/dist/crud/generate_routes.js +0 -7639
  45. package/dist/crud/generate_routes.mjs +0 -7627
  46. package/dist/table/item_loader.d.mts +0 -14
  47. package/dist/table/item_loader.d.ts +0 -14
  48. package/dist/table/item_loader.js +0 -43
  49. package/dist/table/item_loader.mjs +0 -18
  50. package/dist/table/page.d.mts +0 -16
  51. package/dist/table/page.d.ts +0 -16
  52. package/dist/table/page.js +0 -375
  53. package/dist/table/page.mjs +0 -350
@@ -1,16 +0,0 @@
1
- import { LoaderFunctionArgs } from 'react-router';
2
- import { CrudHandler } from './crud_loader.mjs';
3
- import '../table/item_loader.mjs';
4
- import '../table/repository.mjs';
5
- import 'drizzle-orm';
6
- import 'drizzle-orm/node-postgres';
7
- import 'drizzle-orm/pg-core';
8
- import '../table/load_table.mjs';
9
- import '../api/create_api_handler.mjs';
10
- import '../auth/with_auth.mjs';
11
- import 'dn-react-toolkit/auth';
12
- import 'dn-react-toolkit/auth/server';
13
-
14
- declare const generateHandlers: (handlers: Record<string, CrudHandler>) => (args: LoaderFunctionArgs) => Promise<any>;
15
-
16
- export { generateHandlers };
@@ -1,16 +0,0 @@
1
- import { LoaderFunctionArgs } from 'react-router';
2
- import { CrudHandler } from './crud_loader.js';
3
- import '../table/item_loader.js';
4
- import '../table/repository.js';
5
- import 'drizzle-orm';
6
- import 'drizzle-orm/node-postgres';
7
- import 'drizzle-orm/pg-core';
8
- import '../table/load_table.js';
9
- import '../api/create_api_handler.js';
10
- import '../auth/with_auth.js';
11
- import 'dn-react-toolkit/auth';
12
- import 'dn-react-toolkit/auth/server';
13
-
14
- declare const generateHandlers: (handlers: Record<string, CrudHandler>) => (args: LoaderFunctionArgs) => Promise<any>;
15
-
16
- export { generateHandlers };
@@ -1,39 +0,0 @@
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
-
20
- // src/crud/generate_handlers.ts
21
- var generate_handlers_exports = {};
22
- __export(generate_handlers_exports, {
23
- generateHandlers: () => generateHandlers
24
- });
25
- module.exports = __toCommonJS(generate_handlers_exports);
26
- var generateHandlers = (handlers) => {
27
- return async (args) => {
28
- const pattern = args.unstable_pattern;
29
- for (const route of Object.keys(handlers)) {
30
- if (pattern.startsWith(route) || pattern.startsWith(`/api${route}`)) {
31
- return handlers[route](route)(args);
32
- }
33
- }
34
- };
35
- };
36
- // Annotate the CommonJS export names for ESM import in node:
37
- 0 && (module.exports = {
38
- generateHandlers
39
- });
@@ -1,14 +0,0 @@
1
- // src/crud/generate_handlers.ts
2
- var generateHandlers = (handlers) => {
3
- return async (args) => {
4
- const pattern = args.unstable_pattern;
5
- for (const route of Object.keys(handlers)) {
6
- if (pattern.startsWith(route) || pattern.startsWith(`/api${route}`)) {
7
- return handlers[route](route)(args);
8
- }
9
- }
10
- };
11
- };
12
- export {
13
- generateHandlers
14
- };
@@ -1,19 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { CrudPage } from './crud_page.mjs';
3
- import './crud_form_provider.mjs';
4
- import 'react';
5
- import 'react-store-input';
6
- import '../table/table_form.mjs';
7
- import '../table/table.mjs';
8
- import '../table/use_table.mjs';
9
-
10
- declare const generatePages: (pages: Record<string, CrudPage>) => {
11
- Page: () => react_jsx_runtime.JSX.Element | undefined;
12
- routes: string[];
13
- menus: {
14
- title: string;
15
- to: string;
16
- }[];
17
- };
18
-
19
- export { generatePages };
@@ -1,19 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { CrudPage } from './crud_page.js';
3
- import './crud_form_provider.js';
4
- import 'react';
5
- import 'react-store-input';
6
- import '../table/table_form.js';
7
- import '../table/table.js';
8
- import '../table/use_table.js';
9
-
10
- declare const generatePages: (pages: Record<string, CrudPage>) => {
11
- Page: () => react_jsx_runtime.JSX.Element | undefined;
12
- routes: string[];
13
- menus: {
14
- title: string;
15
- to: string;
16
- }[];
17
- };
18
-
19
- export { generatePages };
@@ -1,55 +0,0 @@
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
-
20
- // src/crud/generate_pages.tsx
21
- var generate_pages_exports = {};
22
- __export(generate_pages_exports, {
23
- generatePages: () => generatePages
24
- });
25
- module.exports = __toCommonJS(generate_pages_exports);
26
- var import_react_router = require("react-router");
27
- var import_jsx_runtime = require("react/jsx-runtime");
28
- var generatePages = (pages) => {
29
- function Page() {
30
- const { pathname } = (0, import_react_router.useLocation)();
31
- for (const route of Object.keys(pages)) {
32
- if (pathname.startsWith(route)) {
33
- const Page2 = pages[route].create(route);
34
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Page2, {});
35
- }
36
- }
37
- }
38
- const routes = Object.keys(pages);
39
- const menus = Object.keys(pages).map((path) => {
40
- const page = pages[path];
41
- return {
42
- title: page.name,
43
- to: path
44
- };
45
- });
46
- return {
47
- Page,
48
- routes,
49
- menus
50
- };
51
- };
52
- // Annotate the CommonJS export names for ESM import in node:
53
- 0 && (module.exports = {
54
- generatePages
55
- });
@@ -1,30 +0,0 @@
1
- // src/crud/generate_pages.tsx
2
- import { useLocation } from "react-router";
3
- import { jsx } from "react/jsx-runtime";
4
- var generatePages = (pages) => {
5
- function Page() {
6
- const { pathname } = useLocation();
7
- for (const route of Object.keys(pages)) {
8
- if (pathname.startsWith(route)) {
9
- const Page2 = pages[route].create(route);
10
- return /* @__PURE__ */ jsx(Page2, {});
11
- }
12
- }
13
- }
14
- const routes = Object.keys(pages);
15
- const menus = Object.keys(pages).map((path) => {
16
- const page = pages[path];
17
- return {
18
- title: page.name,
19
- to: path
20
- };
21
- });
22
- return {
23
- Page,
24
- routes,
25
- menus
26
- };
27
- };
28
- export {
29
- generatePages
30
- };
@@ -1,5 +0,0 @@
1
- import * as Routes from '@react-router/dev/routes';
2
-
3
- declare function generateCrudRoutes<T extends string[]>(routes: T, apiFile: string, file: string): Routes.RouteConfigEntry[];
4
-
5
- export { generateCrudRoutes };
@@ -1,5 +0,0 @@
1
- import * as Routes from '@react-router/dev/routes';
2
-
3
- declare function generateCrudRoutes<T extends string[]>(routes: T, apiFile: string, file: string): Routes.RouteConfigEntry[];
4
-
5
- export { generateCrudRoutes };