dn-react-router-toolkit 0.9.12 → 0.10.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.
- package/dist/api/default_api_handler.d.mts +2 -1
- package/dist/api/default_api_handler.d.ts +2 -1
- package/dist/api/index.js +2 -23
- package/dist/api/index.mjs +3 -31
- package/dist/api/patch_resource_handler.js +2 -23
- package/dist/api/patch_resource_handler.mjs +3 -31
- package/dist/api/put_resource_handler.js +2 -23
- package/dist/api/put_resource_handler.mjs +3 -31
- package/dist/api/resource_handler.d.mts +3 -2
- package/dist/api/resource_handler.d.ts +3 -2
- package/dist/api/resource_handler.js +2 -23
- package/dist/api/resource_handler.mjs +3 -31
- package/dist/client/env_loader.d.mts +2 -2
- package/dist/client/env_loader.d.ts +2 -2
- package/dist/client/file_input.d.mts +2 -2
- package/dist/client/file_input.d.ts +2 -2
- package/dist/client/index.d.mts +0 -7
- package/dist/client/index.d.ts +0 -7
- package/dist/client/index.js +0 -117
- package/dist/client/index.mjs +0 -117
- package/dist/crud/crud_form.d.mts +2 -2
- package/dist/crud/crud_form.d.ts +2 -2
- package/dist/crud/crud_form.js +40 -151
- package/dist/crud/crud_form.mjs +40 -158
- package/dist/crud/crud_form_provider.d.mts +6 -7
- package/dist/crud/crud_form_provider.d.ts +6 -7
- package/dist/crud/crud_form_provider.mjs +1 -4
- package/dist/crud/index.d.mts +0 -1
- package/dist/crud/index.d.ts +0 -1
- package/dist/crud/index.js +2 -23
- package/dist/crud/index.mjs +3 -31
- package/dist/form/create_form_component.d.mts +2 -2
- package/dist/form/create_form_component.d.ts +2 -2
- package/dist/form/form_components.d.mts +3 -4
- package/dist/form/form_components.d.ts +3 -4
- package/dist/form/index.d.mts +0 -1
- package/dist/form/index.d.ts +0 -1
- package/dist/index.d.mts +2 -3
- package/dist/index.d.ts +2 -3
- package/dist/post/index.d.mts +2 -3
- package/dist/post/index.d.ts +2 -3
- package/dist/post/thumbnail_picker.d.mts +4 -4
- package/dist/post/thumbnail_picker.d.ts +4 -4
- package/dist/seo/index.d.mts +1 -1
- package/dist/seo/index.d.ts +1 -1
- package/dist/seo/seo.d.mts +2 -2
- package/dist/seo/seo.d.ts +2 -2
- package/dist/table/buttons.d.mts +2 -2
- package/dist/table/buttons.d.ts +2 -2
- package/dist/table/index.d.mts +1 -2
- package/dist/table/index.d.ts +1 -2
- package/dist/table/table.d.mts +2 -2
- package/dist/table/table.d.ts +2 -2
- package/dist/table/table_form.d.mts +2 -3
- package/dist/table/table_form.d.ts +2 -3
- package/package.json +13 -13
- package/dist/client/editor.d.mts +0 -12
- package/dist/client/editor.d.ts +0 -12
- package/dist/client/editor.js +0 -63
- package/dist/client/editor.mjs +0 -38
- package/dist/client/store_text_editor.d.mts +0 -13
- package/dist/client/store_text_editor.d.ts +0 -13
- package/dist/client/store_text_editor.js +0 -104
- package/dist/client/store_text_editor.mjs +0 -81
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as react_router from 'react-router';
|
|
1
2
|
import { LoaderFunctionArgs, ActionFunctionArgs } from 'react-router';
|
|
2
3
|
import { AuthService, PasswordRecoveryService, AuthProvider, JWTManager, ThirdpartyAuthPayload } from 'gw-auth/server';
|
|
3
4
|
import { FileService } from 'gw-file/server';
|
|
@@ -8,6 +9,6 @@ declare const defaultAPIHandler: <TFile>({ authService, fileService, passwordRec
|
|
|
8
9
|
passwordRecoveryService: PasswordRecoveryService;
|
|
9
10
|
authProviders: AuthProvider[];
|
|
10
11
|
signupTokenManager: JWTManager<ThirdpartyAuthPayload>;
|
|
11
|
-
}) => (args: LoaderFunctionArgs | ActionFunctionArgs) => Promise<(({ request }: LoaderFunctionArgs<
|
|
12
|
+
}) => (args: LoaderFunctionArgs | ActionFunctionArgs) => Promise<(({ request }: LoaderFunctionArgs<Readonly<react_router.RouterContextProvider>> | ActionFunctionArgs<Readonly<react_router.RouterContextProvider>>) => Promise<Response>) | Response>;
|
|
12
13
|
|
|
13
14
|
export { defaultAPIHandler };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as react_router from 'react-router';
|
|
1
2
|
import { LoaderFunctionArgs, ActionFunctionArgs } from 'react-router';
|
|
2
3
|
import { AuthService, PasswordRecoveryService, AuthProvider, JWTManager, ThirdpartyAuthPayload } from 'gw-auth/server';
|
|
3
4
|
import { FileService } from 'gw-file/server';
|
|
@@ -8,6 +9,6 @@ declare const defaultAPIHandler: <TFile>({ authService, fileService, passwordRec
|
|
|
8
9
|
passwordRecoveryService: PasswordRecoveryService;
|
|
9
10
|
authProviders: AuthProvider[];
|
|
10
11
|
signupTokenManager: JWTManager<ThirdpartyAuthPayload>;
|
|
11
|
-
}) => (args: LoaderFunctionArgs | ActionFunctionArgs) => Promise<(({ request }: LoaderFunctionArgs<
|
|
12
|
+
}) => (args: LoaderFunctionArgs | ActionFunctionArgs) => Promise<(({ request }: LoaderFunctionArgs<Readonly<react_router.RouterContextProvider>> | ActionFunctionArgs<Readonly<react_router.RouterContextProvider>>) => Promise<Response>) | Response>;
|
|
12
13
|
|
|
13
14
|
export { defaultAPIHandler };
|
package/dist/api/index.js
CHANGED
|
@@ -340,30 +340,9 @@ var FormLabel = createComponent("label", {
|
|
|
340
340
|
});
|
|
341
341
|
|
|
342
342
|
// src/crud/crud_form.tsx
|
|
343
|
-
var import_react_store_input3 = require("react-store-input");
|
|
344
|
-
|
|
345
|
-
// src/client/env_loader.tsx
|
|
346
|
-
var import_react_router3 = require("react-router");
|
|
347
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
348
|
-
|
|
349
|
-
// src/client/file_input.tsx
|
|
350
|
-
var import_react3 = require("react");
|
|
351
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
352
|
-
|
|
353
|
-
// src/client/use_user_agent.tsx
|
|
354
|
-
var import_react_router4 = require("react-router");
|
|
355
|
-
|
|
356
|
-
// src/client/store_text_editor.tsx
|
|
357
|
-
var import_gw_react_text_editor = require("gw-react-text-editor");
|
|
358
343
|
var import_react_store_input2 = require("react-store-input");
|
|
359
|
-
var
|
|
360
|
-
var
|
|
361
|
-
|
|
362
|
-
// src/client/editor.tsx
|
|
363
|
-
var import_client = require("gw-file/client");
|
|
364
|
-
|
|
365
|
-
// src/crud/crud_form.tsx
|
|
366
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
344
|
+
var import_text_editor = require("react-store-input/text-editor");
|
|
345
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
367
346
|
|
|
368
347
|
// src/api/put_resource_handler.ts
|
|
369
348
|
var import_drizzle_orm = require("drizzle-orm");
|
package/dist/api/index.mjs
CHANGED
|
@@ -252,10 +252,7 @@ import {
|
|
|
252
252
|
// src/crud/crud_form_provider.tsx
|
|
253
253
|
import { useNavigate } from "react-router";
|
|
254
254
|
import { useStore } from "react-store-input";
|
|
255
|
-
import {
|
|
256
|
-
createContext,
|
|
257
|
-
useContext
|
|
258
|
-
} from "react";
|
|
255
|
+
import { createContext, useContext } from "react";
|
|
259
256
|
|
|
260
257
|
// src/crud/serialize.ts
|
|
261
258
|
function deserialize(data) {
|
|
@@ -331,33 +328,8 @@ var FormLabel = createComponent("label", {
|
|
|
331
328
|
|
|
332
329
|
// src/crud/crud_form.tsx
|
|
333
330
|
import { useStoreComponent } from "react-store-input";
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
import { useRouteLoaderData } from "react-router";
|
|
337
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
338
|
-
|
|
339
|
-
// src/client/file_input.tsx
|
|
340
|
-
import {
|
|
341
|
-
useRef
|
|
342
|
-
} from "react";
|
|
343
|
-
import { Fragment, jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
344
|
-
|
|
345
|
-
// src/client/use_user_agent.tsx
|
|
346
|
-
import { useRouteLoaderData as useRouteLoaderData2 } from "react-router";
|
|
347
|
-
|
|
348
|
-
// src/client/store_text_editor.tsx
|
|
349
|
-
import {
|
|
350
|
-
TextEditor
|
|
351
|
-
} from "gw-react-text-editor";
|
|
352
|
-
import { useStoreController } from "react-store-input";
|
|
353
|
-
import { useImperativeHandle, useRef as useRef2 } from "react";
|
|
354
|
-
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
355
|
-
|
|
356
|
-
// src/client/editor.tsx
|
|
357
|
-
import { generateMetadata } from "gw-file/client";
|
|
358
|
-
|
|
359
|
-
// src/crud/crud_form.tsx
|
|
360
|
-
import { Fragment as Fragment2, jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
331
|
+
import { TextEditor } from "react-store-input/text-editor";
|
|
332
|
+
import { Fragment, jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
361
333
|
|
|
362
334
|
// src/api/put_resource_handler.ts
|
|
363
335
|
import {
|
|
@@ -113,30 +113,9 @@ var FormLabel = createComponent("label", {
|
|
|
113
113
|
});
|
|
114
114
|
|
|
115
115
|
// src/crud/crud_form.tsx
|
|
116
|
-
var import_react_store_input3 = require("react-store-input");
|
|
117
|
-
|
|
118
|
-
// src/client/env_loader.tsx
|
|
119
|
-
var import_react_router2 = require("react-router");
|
|
120
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
121
|
-
|
|
122
|
-
// src/client/file_input.tsx
|
|
123
|
-
var import_react3 = require("react");
|
|
124
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
125
|
-
|
|
126
|
-
// src/client/use_user_agent.tsx
|
|
127
|
-
var import_react_router3 = require("react-router");
|
|
128
|
-
|
|
129
|
-
// src/client/store_text_editor.tsx
|
|
130
|
-
var import_gw_react_text_editor = require("gw-react-text-editor");
|
|
131
116
|
var import_react_store_input2 = require("react-store-input");
|
|
132
|
-
var
|
|
133
|
-
var
|
|
134
|
-
|
|
135
|
-
// src/client/editor.tsx
|
|
136
|
-
var import_client = require("gw-file/client");
|
|
137
|
-
|
|
138
|
-
// src/crud/crud_form.tsx
|
|
139
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
117
|
+
var import_text_editor = require("react-store-input/text-editor");
|
|
118
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
140
119
|
|
|
141
120
|
// src/api/patch_resource_handler.ts
|
|
142
121
|
var import_drizzle_orm = require("drizzle-orm");
|
|
@@ -4,10 +4,7 @@ import { httpBadRequest, httpCreated } from "gw-response";
|
|
|
4
4
|
// src/crud/crud_form_provider.tsx
|
|
5
5
|
import { useNavigate } from "react-router";
|
|
6
6
|
import { useStore } from "react-store-input";
|
|
7
|
-
import {
|
|
8
|
-
createContext,
|
|
9
|
-
useContext
|
|
10
|
-
} from "react";
|
|
7
|
+
import { createContext, useContext } from "react";
|
|
11
8
|
|
|
12
9
|
// src/crud/serialize.ts
|
|
13
10
|
function deserialize(data) {
|
|
@@ -83,33 +80,8 @@ var FormLabel = createComponent("label", {
|
|
|
83
80
|
|
|
84
81
|
// src/crud/crud_form.tsx
|
|
85
82
|
import { useStoreComponent } from "react-store-input";
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
import { useRouteLoaderData } from "react-router";
|
|
89
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
90
|
-
|
|
91
|
-
// src/client/file_input.tsx
|
|
92
|
-
import {
|
|
93
|
-
useRef
|
|
94
|
-
} from "react";
|
|
95
|
-
import { Fragment, jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
96
|
-
|
|
97
|
-
// src/client/use_user_agent.tsx
|
|
98
|
-
import { useRouteLoaderData as useRouteLoaderData2 } from "react-router";
|
|
99
|
-
|
|
100
|
-
// src/client/store_text_editor.tsx
|
|
101
|
-
import {
|
|
102
|
-
TextEditor
|
|
103
|
-
} from "gw-react-text-editor";
|
|
104
|
-
import { useStoreController } from "react-store-input";
|
|
105
|
-
import { useImperativeHandle, useRef as useRef2 } from "react";
|
|
106
|
-
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
107
|
-
|
|
108
|
-
// src/client/editor.tsx
|
|
109
|
-
import { generateMetadata } from "gw-file/client";
|
|
110
|
-
|
|
111
|
-
// src/crud/crud_form.tsx
|
|
112
|
-
import { Fragment as Fragment2, jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
83
|
+
import { TextEditor } from "react-store-input/text-editor";
|
|
84
|
+
import { Fragment, jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
113
85
|
|
|
114
86
|
// src/api/patch_resource_handler.ts
|
|
115
87
|
import "drizzle-orm";
|
|
@@ -113,30 +113,9 @@ var FormLabel = createComponent("label", {
|
|
|
113
113
|
});
|
|
114
114
|
|
|
115
115
|
// src/crud/crud_form.tsx
|
|
116
|
-
var import_react_store_input3 = require("react-store-input");
|
|
117
|
-
|
|
118
|
-
// src/client/env_loader.tsx
|
|
119
|
-
var import_react_router2 = require("react-router");
|
|
120
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
121
|
-
|
|
122
|
-
// src/client/file_input.tsx
|
|
123
|
-
var import_react3 = require("react");
|
|
124
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
125
|
-
|
|
126
|
-
// src/client/use_user_agent.tsx
|
|
127
|
-
var import_react_router3 = require("react-router");
|
|
128
|
-
|
|
129
|
-
// src/client/store_text_editor.tsx
|
|
130
|
-
var import_gw_react_text_editor = require("gw-react-text-editor");
|
|
131
116
|
var import_react_store_input2 = require("react-store-input");
|
|
132
|
-
var
|
|
133
|
-
var
|
|
134
|
-
|
|
135
|
-
// src/client/editor.tsx
|
|
136
|
-
var import_client = require("gw-file/client");
|
|
137
|
-
|
|
138
|
-
// src/crud/crud_form.tsx
|
|
139
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
117
|
+
var import_text_editor = require("react-store-input/text-editor");
|
|
118
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
140
119
|
|
|
141
120
|
// src/api/put_resource_handler.ts
|
|
142
121
|
var import_drizzle_orm = require("drizzle-orm");
|
|
@@ -10,10 +10,7 @@ import {
|
|
|
10
10
|
// src/crud/crud_form_provider.tsx
|
|
11
11
|
import { useNavigate } from "react-router";
|
|
12
12
|
import { useStore } from "react-store-input";
|
|
13
|
-
import {
|
|
14
|
-
createContext,
|
|
15
|
-
useContext
|
|
16
|
-
} from "react";
|
|
13
|
+
import { createContext, useContext } from "react";
|
|
17
14
|
|
|
18
15
|
// src/crud/serialize.ts
|
|
19
16
|
function deserialize(data) {
|
|
@@ -89,33 +86,8 @@ var FormLabel = createComponent("label", {
|
|
|
89
86
|
|
|
90
87
|
// src/crud/crud_form.tsx
|
|
91
88
|
import { useStoreComponent } from "react-store-input";
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
import { useRouteLoaderData } from "react-router";
|
|
95
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
96
|
-
|
|
97
|
-
// src/client/file_input.tsx
|
|
98
|
-
import {
|
|
99
|
-
useRef
|
|
100
|
-
} from "react";
|
|
101
|
-
import { Fragment, jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
102
|
-
|
|
103
|
-
// src/client/use_user_agent.tsx
|
|
104
|
-
import { useRouteLoaderData as useRouteLoaderData2 } from "react-router";
|
|
105
|
-
|
|
106
|
-
// src/client/store_text_editor.tsx
|
|
107
|
-
import {
|
|
108
|
-
TextEditor
|
|
109
|
-
} from "gw-react-text-editor";
|
|
110
|
-
import { useStoreController } from "react-store-input";
|
|
111
|
-
import { useImperativeHandle, useRef as useRef2 } from "react";
|
|
112
|
-
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
113
|
-
|
|
114
|
-
// src/client/editor.tsx
|
|
115
|
-
import { generateMetadata } from "gw-file/client";
|
|
116
|
-
|
|
117
|
-
// src/crud/crud_form.tsx
|
|
118
|
-
import { Fragment as Fragment2, jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
89
|
+
import { TextEditor } from "react-store-input/text-editor";
|
|
90
|
+
import { Fragment, jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
119
91
|
|
|
120
92
|
// src/api/put_resource_handler.ts
|
|
121
93
|
import {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_router from 'react-router';
|
|
2
2
|
import { ActionFunctionArgs, LoaderFunctionArgs } from 'react-router';
|
|
3
|
+
import * as gw_result from 'gw-result';
|
|
3
4
|
import { TableRepository } from '../table/repository.mjs';
|
|
4
5
|
import { PgTableWithColumns } from 'drizzle-orm/pg-core';
|
|
5
6
|
import { WithAuthHandler } from '../auth/with_auth.mjs';
|
|
@@ -21,7 +22,7 @@ type APIHandlerOptions<T extends PgTableWithColumns<any>, TSelect, TPrimaryKey e
|
|
|
21
22
|
};
|
|
22
23
|
declare function resourceHandler<T extends PgTableWithColumns<any>, TSelect, TPrimaryKey extends keyof TSelect = "id" extends keyof TSelect ? "id" : never>({ withAuthAction, repository, validators, existingConditions, injectUserId, roles, isOwnedBy, primaryKey, }: APIHandlerOptions<T, TSelect, TPrimaryKey>): {
|
|
23
24
|
loader: ({ request }: LoaderFunctionArgs) => Promise<gw_result.Ok<{}>>;
|
|
24
|
-
action: (arg: ActionFunctionArgs<
|
|
25
|
+
action: (arg: ActionFunctionArgs<Readonly<react_router.RouterContextProvider>>) => Promise<unknown> | unknown;
|
|
25
26
|
};
|
|
26
27
|
|
|
27
28
|
export { type APIHandlerOptions, resourceHandler };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_router from 'react-router';
|
|
2
2
|
import { ActionFunctionArgs, LoaderFunctionArgs } from 'react-router';
|
|
3
|
+
import * as gw_result from 'gw-result';
|
|
3
4
|
import { TableRepository } from '../table/repository.js';
|
|
4
5
|
import { PgTableWithColumns } from 'drizzle-orm/pg-core';
|
|
5
6
|
import { WithAuthHandler } from '../auth/with_auth.js';
|
|
@@ -21,7 +22,7 @@ type APIHandlerOptions<T extends PgTableWithColumns<any>, TSelect, TPrimaryKey e
|
|
|
21
22
|
};
|
|
22
23
|
declare function resourceHandler<T extends PgTableWithColumns<any>, TSelect, TPrimaryKey extends keyof TSelect = "id" extends keyof TSelect ? "id" : never>({ withAuthAction, repository, validators, existingConditions, injectUserId, roles, isOwnedBy, primaryKey, }: APIHandlerOptions<T, TSelect, TPrimaryKey>): {
|
|
23
24
|
loader: ({ request }: LoaderFunctionArgs) => Promise<gw_result.Ok<{}>>;
|
|
24
|
-
action: (arg: ActionFunctionArgs<
|
|
25
|
+
action: (arg: ActionFunctionArgs<Readonly<react_router.RouterContextProvider>>) => Promise<unknown> | unknown;
|
|
25
26
|
};
|
|
26
27
|
|
|
27
28
|
export { type APIHandlerOptions, resourceHandler };
|
|
@@ -117,30 +117,9 @@ var FormLabel = createComponent("label", {
|
|
|
117
117
|
});
|
|
118
118
|
|
|
119
119
|
// src/crud/crud_form.tsx
|
|
120
|
-
var import_react_store_input3 = require("react-store-input");
|
|
121
|
-
|
|
122
|
-
// src/client/env_loader.tsx
|
|
123
|
-
var import_react_router2 = require("react-router");
|
|
124
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
125
|
-
|
|
126
|
-
// src/client/file_input.tsx
|
|
127
|
-
var import_react3 = require("react");
|
|
128
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
129
|
-
|
|
130
|
-
// src/client/use_user_agent.tsx
|
|
131
|
-
var import_react_router3 = require("react-router");
|
|
132
|
-
|
|
133
|
-
// src/client/store_text_editor.tsx
|
|
134
|
-
var import_gw_react_text_editor = require("gw-react-text-editor");
|
|
135
120
|
var import_react_store_input2 = require("react-store-input");
|
|
136
|
-
var
|
|
137
|
-
var
|
|
138
|
-
|
|
139
|
-
// src/client/editor.tsx
|
|
140
|
-
var import_client = require("gw-file/client");
|
|
141
|
-
|
|
142
|
-
// src/crud/crud_form.tsx
|
|
143
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
121
|
+
var import_text_editor = require("react-store-input/text-editor");
|
|
122
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
144
123
|
|
|
145
124
|
// src/api/put_resource_handler.ts
|
|
146
125
|
var import_drizzle_orm = require("drizzle-orm");
|
|
@@ -19,10 +19,7 @@ import {
|
|
|
19
19
|
// src/crud/crud_form_provider.tsx
|
|
20
20
|
import { useNavigate } from "react-router";
|
|
21
21
|
import { useStore } from "react-store-input";
|
|
22
|
-
import {
|
|
23
|
-
createContext,
|
|
24
|
-
useContext
|
|
25
|
-
} from "react";
|
|
22
|
+
import { createContext, useContext } from "react";
|
|
26
23
|
|
|
27
24
|
// src/crud/serialize.ts
|
|
28
25
|
function deserialize(data) {
|
|
@@ -98,33 +95,8 @@ var FormLabel = createComponent("label", {
|
|
|
98
95
|
|
|
99
96
|
// src/crud/crud_form.tsx
|
|
100
97
|
import { useStoreComponent } from "react-store-input";
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
import { useRouteLoaderData } from "react-router";
|
|
104
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
105
|
-
|
|
106
|
-
// src/client/file_input.tsx
|
|
107
|
-
import {
|
|
108
|
-
useRef
|
|
109
|
-
} from "react";
|
|
110
|
-
import { Fragment, jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
111
|
-
|
|
112
|
-
// src/client/use_user_agent.tsx
|
|
113
|
-
import { useRouteLoaderData as useRouteLoaderData2 } from "react-router";
|
|
114
|
-
|
|
115
|
-
// src/client/store_text_editor.tsx
|
|
116
|
-
import {
|
|
117
|
-
TextEditor
|
|
118
|
-
} from "gw-react-text-editor";
|
|
119
|
-
import { useStoreController } from "react-store-input";
|
|
120
|
-
import { useImperativeHandle, useRef as useRef2 } from "react";
|
|
121
|
-
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
122
|
-
|
|
123
|
-
// src/client/editor.tsx
|
|
124
|
-
import { generateMetadata } from "gw-file/client";
|
|
125
|
-
|
|
126
|
-
// src/crud/crud_form.tsx
|
|
127
|
-
import { Fragment as Fragment2, jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
98
|
+
import { TextEditor } from "react-store-input/text-editor";
|
|
99
|
+
import { Fragment, jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
128
100
|
|
|
129
101
|
// src/api/put_resource_handler.ts
|
|
130
102
|
import {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react from 'react';
|
|
2
2
|
|
|
3
3
|
declare function EnvLoader({ dataKey }: {
|
|
4
4
|
dataKey?: string;
|
|
5
|
-
}):
|
|
5
|
+
}): react.JSX.Element | undefined;
|
|
6
6
|
|
|
7
7
|
export { EnvLoader };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react from 'react';
|
|
2
2
|
|
|
3
3
|
declare function EnvLoader({ dataKey }: {
|
|
4
4
|
dataKey?: string;
|
|
5
|
-
}):
|
|
5
|
+
}): react.JSX.Element | undefined;
|
|
6
6
|
|
|
7
7
|
export { EnvLoader };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react from 'react';
|
|
2
2
|
import { DetailedHTMLProps, InputHTMLAttributes, Ref, ChangeEvent } from 'react';
|
|
3
3
|
|
|
4
4
|
type Props = Omit<DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "onChange"> & {
|
|
@@ -6,6 +6,6 @@ type Props = Omit<DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLI
|
|
|
6
6
|
} & {
|
|
7
7
|
onChange?: (event: ChangeEvent<HTMLInputElement>) => void | Promise<void>;
|
|
8
8
|
};
|
|
9
|
-
declare function FileInput({ buttonRef, className, ref, children, onClick, onChange, ...props }: Props):
|
|
9
|
+
declare function FileInput({ buttonRef, className, ref, children, onClick, onChange, ...props }: Props): react.JSX.Element;
|
|
10
10
|
|
|
11
11
|
export { FileInput };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react from 'react';
|
|
2
2
|
import { DetailedHTMLProps, InputHTMLAttributes, Ref, ChangeEvent } from 'react';
|
|
3
3
|
|
|
4
4
|
type Props = Omit<DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "onChange"> & {
|
|
@@ -6,6 +6,6 @@ type Props = Omit<DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLI
|
|
|
6
6
|
} & {
|
|
7
7
|
onChange?: (event: ChangeEvent<HTMLInputElement>) => void | Promise<void>;
|
|
8
8
|
};
|
|
9
|
-
declare function FileInput({ buttonRef, className, ref, children, onClick, onChange, ...props }: Props):
|
|
9
|
+
declare function FileInput({ buttonRef, className, ref, children, onClick, onChange, ...props }: Props): react.JSX.Element;
|
|
10
10
|
|
|
11
11
|
export { FileInput };
|
package/dist/client/index.d.mts
CHANGED
|
@@ -2,11 +2,4 @@ export { env } from './env.mjs';
|
|
|
2
2
|
export { EnvLoader } from './env_loader.mjs';
|
|
3
3
|
export { FileInput } from './file_input.mjs';
|
|
4
4
|
export { useUserAgent } from './use_user_agent.mjs';
|
|
5
|
-
export { StoreTextEditor } from './store_text_editor.mjs';
|
|
6
|
-
export { createAttachFileOptions } from './editor.mjs';
|
|
7
|
-
import 'react/jsx-runtime';
|
|
8
5
|
import 'react';
|
|
9
|
-
import 'gw-react-text-editor';
|
|
10
|
-
import 'react-store-input';
|
|
11
|
-
import 'gw-file/client';
|
|
12
|
-
import 'gw-file';
|
package/dist/client/index.d.ts
CHANGED
|
@@ -2,11 +2,4 @@ export { env } from './env.js';
|
|
|
2
2
|
export { EnvLoader } from './env_loader.js';
|
|
3
3
|
export { FileInput } from './file_input.js';
|
|
4
4
|
export { useUserAgent } from './use_user_agent.js';
|
|
5
|
-
export { StoreTextEditor } from './store_text_editor.js';
|
|
6
|
-
export { createAttachFileOptions } from './editor.js';
|
|
7
|
-
import 'react/jsx-runtime';
|
|
8
5
|
import 'react';
|
|
9
|
-
import 'gw-react-text-editor';
|
|
10
|
-
import 'react-store-input';
|
|
11
|
-
import 'gw-file/client';
|
|
12
|
-
import 'gw-file';
|
package/dist/client/index.js
CHANGED
|
@@ -22,8 +22,6 @@ var client_exports = {};
|
|
|
22
22
|
__export(client_exports, {
|
|
23
23
|
EnvLoader: () => EnvLoader,
|
|
24
24
|
FileInput: () => FileInput,
|
|
25
|
-
StoreTextEditor: () => StoreTextEditor,
|
|
26
|
-
createAttachFileOptions: () => createAttachFileOptions,
|
|
27
25
|
env: () => env,
|
|
28
26
|
useUserAgent: () => useUserAgent
|
|
29
27
|
});
|
|
@@ -111,125 +109,10 @@ function useUserAgent() {
|
|
|
111
109
|
const isDesktop = !isMobile && !isTablet;
|
|
112
110
|
return { userAgent, isMobile, isTablet, isDesktop };
|
|
113
111
|
}
|
|
114
|
-
|
|
115
|
-
// src/client/store_text_editor.tsx
|
|
116
|
-
var import_gw_react_text_editor = require("gw-react-text-editor");
|
|
117
|
-
var import_react_store_input = require("react-store-input");
|
|
118
|
-
var import_react2 = require("react");
|
|
119
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
120
|
-
function StoreTextEditor({
|
|
121
|
-
store,
|
|
122
|
-
name,
|
|
123
|
-
getter,
|
|
124
|
-
setter,
|
|
125
|
-
defaultValue,
|
|
126
|
-
ref,
|
|
127
|
-
...props
|
|
128
|
-
}) {
|
|
129
|
-
const controllerRef = (0, import_react2.useRef)(null);
|
|
130
|
-
(0, import_react2.useImperativeHandle)(
|
|
131
|
-
ref,
|
|
132
|
-
() => controllerRef.current,
|
|
133
|
-
[]
|
|
134
|
-
);
|
|
135
|
-
const { dispatch } = (0, import_react_store_input.useStoreController)(store, {
|
|
136
|
-
onSubscribe: (state) => {
|
|
137
|
-
const controller = controllerRef.current;
|
|
138
|
-
if (!controller) {
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
const getResult = () => {
|
|
142
|
-
if (getter) {
|
|
143
|
-
return getter(state) || "";
|
|
144
|
-
}
|
|
145
|
-
if (name) {
|
|
146
|
-
return state[name] || "";
|
|
147
|
-
}
|
|
148
|
-
return "";
|
|
149
|
-
};
|
|
150
|
-
const result = getResult();
|
|
151
|
-
if (controller.value !== result) {
|
|
152
|
-
controller.value = result;
|
|
153
|
-
}
|
|
154
|
-
},
|
|
155
|
-
onDispatch: (state) => {
|
|
156
|
-
const controller = controllerRef.current;
|
|
157
|
-
if (!controller) {
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
if (setter) {
|
|
161
|
-
setter(state, controller.value);
|
|
162
|
-
return;
|
|
163
|
-
}
|
|
164
|
-
if (name) {
|
|
165
|
-
state[name] = controller.value;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
const getDefaultValue = () => {
|
|
170
|
-
if (getter) {
|
|
171
|
-
return getter(store.state);
|
|
172
|
-
}
|
|
173
|
-
if (name) {
|
|
174
|
-
return store.state[name];
|
|
175
|
-
}
|
|
176
|
-
return void 0;
|
|
177
|
-
};
|
|
178
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
179
|
-
import_gw_react_text_editor.TextEditor,
|
|
180
|
-
{
|
|
181
|
-
...props,
|
|
182
|
-
ref: controllerRef,
|
|
183
|
-
defaultValue: defaultValue ?? getDefaultValue(),
|
|
184
|
-
onChange: (e) => {
|
|
185
|
-
dispatch();
|
|
186
|
-
props.onChange?.(e);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
// src/client/editor.tsx
|
|
193
|
-
var import_client = require("gw-file/client");
|
|
194
|
-
function createAttachFileOptions({
|
|
195
|
-
cdn,
|
|
196
|
-
fileUploader
|
|
197
|
-
}) {
|
|
198
|
-
return {
|
|
199
|
-
uploadFile: async (file) => {
|
|
200
|
-
const result = await fileUploader.uploadFile(file, {
|
|
201
|
-
convertToWebp: true
|
|
202
|
-
});
|
|
203
|
-
if (result.isErr) {
|
|
204
|
-
throw new Error(result.error.message);
|
|
205
|
-
}
|
|
206
|
-
return {
|
|
207
|
-
alt: file.name,
|
|
208
|
-
src: cdn(result.value.key)
|
|
209
|
-
};
|
|
210
|
-
},
|
|
211
|
-
generateMetadata: (file) => (0, import_client.generateMetadata)(file, {
|
|
212
|
-
uploadBlob: async (blob) => {
|
|
213
|
-
const result = await fileUploader.uploadBlob(blob, "file", {
|
|
214
|
-
convertToWebp: true
|
|
215
|
-
});
|
|
216
|
-
if (result.isErr) {
|
|
217
|
-
throw new Error(result.error.message);
|
|
218
|
-
}
|
|
219
|
-
return {
|
|
220
|
-
alt: file.name,
|
|
221
|
-
src: cdn(result.value.key)
|
|
222
|
-
};
|
|
223
|
-
}
|
|
224
|
-
})
|
|
225
|
-
};
|
|
226
|
-
}
|
|
227
112
|
// Annotate the CommonJS export names for ESM import in node:
|
|
228
113
|
0 && (module.exports = {
|
|
229
114
|
EnvLoader,
|
|
230
115
|
FileInput,
|
|
231
|
-
StoreTextEditor,
|
|
232
|
-
createAttachFileOptions,
|
|
233
116
|
env,
|
|
234
117
|
useUserAgent
|
|
235
118
|
});
|