dn-react-router-toolkit 0.8.1 → 0.9.1

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 (130) hide show
  1. package/dist/api/create_api_handler.d.mts +2 -2
  2. package/dist/api/create_api_handler.d.ts +2 -2
  3. package/dist/api/create_api_handler.js +55 -52
  4. package/dist/api/create_api_handler.mjs +61 -59
  5. package/dist/api/create_handler.d.mts +5 -5
  6. package/dist/api/create_handler.d.ts +5 -5
  7. package/dist/api/create_handler.js +41 -44
  8. package/dist/api/create_handler.mjs +41 -44
  9. package/dist/api/index.d.mts +4 -3
  10. package/dist/api/index.d.ts +4 -3
  11. package/dist/api/index.js +118 -102
  12. package/dist/api/index.mjs +130 -109
  13. package/dist/api/item_api_handler.d.mts +4 -3
  14. package/dist/api/item_api_handler.d.ts +4 -3
  15. package/dist/api/item_api_handler.js +22 -6
  16. package/dist/api/item_api_handler.mjs +28 -6
  17. package/dist/auth/cookie_manager.d.mts +1 -1
  18. package/dist/auth/cookie_manager.d.ts +1 -1
  19. package/dist/auth/index.d.mts +2 -2
  20. package/dist/auth/index.d.ts +2 -2
  21. package/dist/auth/index.js +18 -18
  22. package/dist/auth/index.mjs +18 -18
  23. package/dist/auth/with_auth.d.mts +2 -2
  24. package/dist/auth/with_auth.d.ts +2 -2
  25. package/dist/auth/with_auth.js +18 -18
  26. package/dist/auth/with_auth.mjs +18 -18
  27. package/dist/client/editor.d.mts +2 -2
  28. package/dist/client/editor.d.ts +2 -2
  29. package/dist/client/editor.js +9 -3
  30. package/dist/client/editor.mjs +9 -3
  31. package/dist/client/index.d.mts +2 -2
  32. package/dist/client/index.d.ts +2 -2
  33. package/dist/client/index.js +9 -3
  34. package/dist/client/index.mjs +9 -3
  35. package/dist/crud/crud_form.js +22 -4
  36. package/dist/crud/crud_form.mjs +11 -3
  37. package/dist/crud/crud_form_provider.js +16 -3
  38. package/dist/crud/crud_form_provider.mjs +14 -1
  39. package/dist/crud/index.d.mts +0 -20
  40. package/dist/crud/index.d.ts +0 -20
  41. package/dist/crud/index.js +32 -8589
  42. package/dist/crud/index.mjs +11 -8599
  43. package/dist/db/backup/index.d.mts +1 -1
  44. package/dist/db/backup/index.d.ts +1 -1
  45. package/dist/form/create_form_component.js +21 -2
  46. package/dist/form/create_form_component.mjs +10 -1
  47. package/dist/form/form_components.js +21 -2
  48. package/dist/form/form_components.mjs +10 -1
  49. package/dist/form/index.js +21 -2
  50. package/dist/form/index.mjs +10 -1
  51. package/dist/post/editor_toolbar.js +20 -3
  52. package/dist/post/editor_toolbar.mjs +9 -2
  53. package/dist/post/index.js +93 -7711
  54. package/dist/post/index.mjs +69 -7723
  55. package/dist/post/post_form_page.js +91 -7711
  56. package/dist/post/post_form_page.mjs +69 -7725
  57. package/dist/post/thumbnail_picker.js +21 -2
  58. package/dist/post/thumbnail_picker.mjs +10 -1
  59. package/dist/table/buttons.js +11 -14
  60. package/dist/table/buttons.mjs +10 -13
  61. package/dist/table/index.d.mts +0 -2
  62. package/dist/table/index.d.ts +0 -2
  63. package/dist/table/index.js +24 -95
  64. package/dist/table/index.mjs +23 -92
  65. package/dist/table/load_table.d.mts +1 -1
  66. package/dist/table/load_table.d.ts +1 -1
  67. package/dist/table/load_table.js +2 -2
  68. package/dist/table/load_table.mjs +2 -2
  69. package/dist/table/loader.js +2 -2
  70. package/dist/table/loader.mjs +2 -2
  71. package/dist/table/table.d.mts +2 -2
  72. package/dist/table/table.d.ts +2 -2
  73. package/dist/table/table.js +14 -25
  74. package/dist/table/table.mjs +11 -24
  75. package/dist/table/table_form.js +16 -39
  76. package/dist/table/table_form.mjs +15 -38
  77. package/dist/utils/cn.d.mts +3 -0
  78. package/dist/utils/cn.d.ts +3 -0
  79. package/dist/utils/cn.js +32 -0
  80. package/dist/utils/cn.mjs +7 -0
  81. package/dist/utils/date.d.mts +5 -0
  82. package/dist/utils/date.d.ts +5 -0
  83. package/dist/utils/date.js +65 -0
  84. package/dist/utils/date.mjs +29 -0
  85. package/dist/utils/index.d.mts +7 -0
  86. package/dist/utils/index.d.ts +7 -0
  87. package/dist/utils/index.js +116 -0
  88. package/dist/utils/index.mjs +73 -0
  89. package/dist/utils/korean.d.mts +6 -0
  90. package/dist/utils/korean.d.ts +6 -0
  91. package/dist/{crud/generate_pages.js → utils/korean.js} +16 -30
  92. package/dist/utils/korean.mjs +16 -0
  93. package/dist/utils/singleton.d.mts +3 -0
  94. package/dist/utils/singleton.d.ts +3 -0
  95. package/dist/utils/singleton.js +37 -0
  96. package/dist/utils/singleton.mjs +12 -0
  97. package/dist/utils/sleep.d.mts +3 -0
  98. package/dist/utils/sleep.d.ts +3 -0
  99. package/dist/{table/item_loader.js → utils/sleep.js} +8 -19
  100. package/dist/utils/sleep.mjs +7 -0
  101. package/dist/utils/slug.d.mts +3 -0
  102. package/dist/utils/slug.d.ts +3 -0
  103. package/dist/{crud/generate_handlers.js → utils/slug.js} +8 -15
  104. package/dist/utils/slug.mjs +7 -0
  105. package/package.json +7 -3
  106. package/dist/crud/crud_loader.d.mts +0 -26
  107. package/dist/crud/crud_loader.d.ts +0 -26
  108. package/dist/crud/crud_loader.js +0 -351
  109. package/dist/crud/crud_loader.mjs +0 -337
  110. package/dist/crud/crud_page.d.mts +0 -32
  111. package/dist/crud/crud_page.d.ts +0 -32
  112. package/dist/crud/crud_page.js +0 -776
  113. package/dist/crud/crud_page.mjs +0 -758
  114. package/dist/crud/generate_handlers.d.mts +0 -16
  115. package/dist/crud/generate_handlers.d.ts +0 -16
  116. package/dist/crud/generate_handlers.mjs +0 -14
  117. package/dist/crud/generate_pages.d.mts +0 -19
  118. package/dist/crud/generate_pages.d.ts +0 -19
  119. package/dist/crud/generate_pages.mjs +0 -30
  120. package/dist/crud/generate_routes.d.mts +0 -5
  121. package/dist/crud/generate_routes.d.ts +0 -5
  122. package/dist/crud/generate_routes.js +0 -7639
  123. package/dist/crud/generate_routes.mjs +0 -7627
  124. package/dist/table/item_loader.d.mts +0 -14
  125. package/dist/table/item_loader.d.ts +0 -14
  126. package/dist/table/item_loader.mjs +0 -18
  127. package/dist/table/page.d.mts +0 -16
  128. package/dist/table/page.d.ts +0 -16
  129. package/dist/table/page.js +0 -375
  130. 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,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,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 };