dn-react-router-toolkit 0.7.7 → 0.7.8
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/create_api_handler.d.mts +5 -5
- package/dist/api/create_api_handler.d.ts +5 -5
- package/dist/client/env_loader.d.mts +2 -2
- package/dist/client/env_loader.d.ts +2 -2
- package/dist/client/env_loader.js +2 -12
- package/dist/client/env_loader.mjs +2 -2
- package/dist/client/file_input.d.mts +3 -2
- package/dist/client/file_input.d.ts +3 -2
- package/dist/client/file_input.js +30 -37
- package/dist/client/file_input.mjs +33 -28
- package/dist/client/index.d.mts +1 -0
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.js +38 -44
- package/dist/client/index.mjs +39 -33
- package/dist/client/store_text_editor.d.mts +2 -2
- package/dist/client/store_text_editor.d.ts +2 -2
- package/dist/client/store_text_editor.js +3 -12
- package/dist/client/store_text_editor.mjs +3 -2
- package/dist/crud/crud_form.d.mts +5 -4
- package/dist/crud/crud_form.d.ts +5 -4
- package/dist/crud/crud_form.js +74 -72
- package/dist/crud/crud_form.mjs +79 -62
- package/dist/crud/crud_form_provider.d.mts +9 -7
- package/dist/crud/crud_form_provider.d.ts +9 -7
- package/dist/crud/crud_form_provider.js +2 -12
- package/dist/crud/crud_form_provider.mjs +6 -3
- package/dist/crud/crud_page.d.mts +10 -6
- package/dist/crud/crud_page.d.ts +10 -6
- package/dist/crud/crud_page.js +272 -409
- package/dist/crud/crud_page.mjs +277 -399
- package/dist/crud/generate_pages.d.mts +10 -2
- package/dist/crud/generate_pages.d.ts +10 -2
- package/dist/crud/generate_pages.js +17 -14
- package/dist/crud/generate_pages.mjs +17 -4
- package/dist/crud/index.d.mts +2 -1
- package/dist/crud/index.d.ts +2 -1
- package/dist/crud/index.js +290 -404
- package/dist/crud/index.mjs +295 -404
- package/dist/form/create_form_component.d.mts +3 -2
- package/dist/form/create_form_component.d.ts +3 -2
- package/dist/form/create_form_component.js +3 -12
- package/dist/form/create_form_component.mjs +3 -2
- package/dist/form/form_components.d.mts +5 -4
- package/dist/form/form_components.d.ts +5 -4
- package/dist/form/form_components.js +3 -12
- package/dist/form/form_components.mjs +3 -2
- package/dist/form/index.d.mts +1 -0
- package/dist/form/index.d.ts +1 -0
- package/dist/form/index.js +3 -12
- package/dist/form/index.mjs +3 -2
- package/dist/post/editor_toolbar.d.mts +4 -3
- package/dist/post/editor_toolbar.d.ts +4 -3
- package/dist/post/editor_toolbar.js +116 -273
- package/dist/post/editor_toolbar.mjs +123 -263
- package/dist/post/index.d.mts +1 -0
- package/dist/post/index.d.ts +1 -0
- package/dist/post/index.js +329 -411
- package/dist/post/index.mjs +337 -409
- package/dist/post/post_form_page.d.mts +5 -4
- package/dist/post/post_form_page.d.ts +5 -4
- package/dist/post/post_form_page.js +331 -413
- package/dist/post/post_form_page.mjs +337 -409
- package/dist/post/thumbnail_picker.d.mts +3 -2
- package/dist/post/thumbnail_picker.d.ts +3 -2
- package/dist/post/thumbnail_picker.js +14 -23
- package/dist/post/thumbnail_picker.mjs +14 -13
- package/dist/seo/index.d.mts +1 -1
- package/dist/seo/index.d.ts +1 -1
- package/dist/seo/index.js +2 -2
- package/dist/seo/index.mjs +2 -2
- package/dist/seo/seo.d.mts +2 -2
- package/dist/seo/seo.d.ts +2 -2
- package/dist/seo/seo.js +2 -2
- package/dist/seo/seo.mjs +2 -2
- package/dist/table/buttons.d.mts +2 -2
- package/dist/table/buttons.d.ts +2 -2
- package/dist/table/buttons.js +42 -57
- package/dist/table/buttons.mjs +42 -47
- package/dist/table/index.d.mts +1 -0
- package/dist/table/index.d.ts +1 -0
- package/dist/table/index.js +185 -338
- package/dist/table/index.mjs +185 -328
- package/dist/table/page.d.mts +5 -4
- package/dist/table/page.d.ts +5 -4
- package/dist/table/page.js +185 -338
- package/dist/table/page.mjs +185 -328
- package/dist/table/table.d.mts +5 -4
- package/dist/table/table.d.ts +5 -4
- package/dist/table/table.js +77 -237
- package/dist/table/table.mjs +77 -227
- package/package.json +7 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Table,
|
|
1
|
+
import { Table, InferSelectModel, SQLWrapper } from 'drizzle-orm';
|
|
2
2
|
import { ActionFunctionArgs, LoaderFunctionArgs } from 'react-router';
|
|
3
3
|
import { TableRepository } from '../table/repository.mjs';
|
|
4
4
|
import { WithAuthHandler } from '../auth/with_auth.mjs';
|
|
@@ -10,13 +10,13 @@ type APIHandlerOptions<T extends Table, TSelect> = {
|
|
|
10
10
|
withAuthAction: WithAuthHandler<ActionFunctionArgs>;
|
|
11
11
|
repository: TableRepository<T, TSelect>;
|
|
12
12
|
validators?: {
|
|
13
|
-
[K in keyof
|
|
14
|
-
validate?: (value?:
|
|
15
|
-
message?: (value?:
|
|
13
|
+
[K in keyof InferSelectModel<T>]?: {
|
|
14
|
+
validate?: (value?: InferSelectModel<T>[K]) => boolean;
|
|
15
|
+
message?: (value?: InferSelectModel<T>[K]) => string;
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
18
|
existingConditions?: {
|
|
19
|
-
[K in keyof
|
|
19
|
+
[K in keyof InferSelectModel<T>]?: (value: InferSelectModel<T>[K]) => SQLWrapper;
|
|
20
20
|
};
|
|
21
21
|
injectUserId?: boolean;
|
|
22
22
|
roles?: string[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Table,
|
|
1
|
+
import { Table, InferSelectModel, SQLWrapper } from 'drizzle-orm';
|
|
2
2
|
import { ActionFunctionArgs, LoaderFunctionArgs } from 'react-router';
|
|
3
3
|
import { TableRepository } from '../table/repository.js';
|
|
4
4
|
import { WithAuthHandler } from '../auth/with_auth.js';
|
|
@@ -10,13 +10,13 @@ type APIHandlerOptions<T extends Table, TSelect> = {
|
|
|
10
10
|
withAuthAction: WithAuthHandler<ActionFunctionArgs>;
|
|
11
11
|
repository: TableRepository<T, TSelect>;
|
|
12
12
|
validators?: {
|
|
13
|
-
[K in keyof
|
|
14
|
-
validate?: (value?:
|
|
15
|
-
message?: (value?:
|
|
13
|
+
[K in keyof InferSelectModel<T>]?: {
|
|
14
|
+
validate?: (value?: InferSelectModel<T>[K]) => boolean;
|
|
15
|
+
message?: (value?: InferSelectModel<T>[K]) => string;
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
18
|
existingConditions?: {
|
|
19
|
-
[K in keyof
|
|
19
|
+
[K in keyof InferSelectModel<T>]?: (value: InferSelectModel<T>[K]) => SQLWrapper;
|
|
20
20
|
};
|
|
21
21
|
injectUserId?: boolean;
|
|
22
22
|
roles?: string[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
|
|
3
3
|
declare function EnvLoader({ dataKey }: {
|
|
4
4
|
dataKey?: string;
|
|
5
|
-
}):
|
|
5
|
+
}): react_jsx_runtime.JSX.Element | undefined;
|
|
6
6
|
|
|
7
7
|
export { EnvLoader };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
|
|
3
3
|
declare function EnvLoader({ dataKey }: {
|
|
4
4
|
dataKey?: string;
|
|
5
|
-
}):
|
|
5
|
+
}): react_jsx_runtime.JSX.Element | undefined;
|
|
6
6
|
|
|
7
7
|
export { EnvLoader };
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
|
|
30
20
|
// src/client/env_loader.tsx
|
|
@@ -33,14 +23,14 @@ __export(env_loader_exports, {
|
|
|
33
23
|
EnvLoader: () => EnvLoader
|
|
34
24
|
});
|
|
35
25
|
module.exports = __toCommonJS(env_loader_exports);
|
|
36
|
-
var import_react = __toESM(require("react"));
|
|
37
26
|
var import_react_router = require("react-router");
|
|
27
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
38
28
|
function EnvLoader({ dataKey = "ENV" }) {
|
|
39
29
|
const data = (0, import_react_router.useRouteLoaderData)("root");
|
|
40
30
|
if (!data) {
|
|
41
31
|
return;
|
|
42
32
|
}
|
|
43
|
-
return /* @__PURE__ */
|
|
33
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
44
34
|
"script",
|
|
45
35
|
{
|
|
46
36
|
dangerouslySetInnerHTML: {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// src/client/env_loader.tsx
|
|
2
|
-
import React from "react";
|
|
3
2
|
import { useRouteLoaderData } from "react-router";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
function EnvLoader({ dataKey = "ENV" }) {
|
|
5
5
|
const data = useRouteLoaderData("root");
|
|
6
6
|
if (!data) {
|
|
7
7
|
return;
|
|
8
8
|
}
|
|
9
|
-
return /* @__PURE__ */
|
|
9
|
+
return /* @__PURE__ */ jsx(
|
|
10
10
|
"script",
|
|
11
11
|
{
|
|
12
12
|
dangerouslySetInnerHTML: {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { DetailedHTMLProps, InputHTMLAttributes, Ref, ChangeEvent } from 'react';
|
|
2
3
|
|
|
3
4
|
type Props = Omit<DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "onChange"> & {
|
|
4
5
|
buttonRef?: Ref<HTMLButtonElement>;
|
|
5
6
|
} & {
|
|
6
7
|
onChange?: (event: ChangeEvent<HTMLInputElement>) => void | Promise<void>;
|
|
7
8
|
};
|
|
8
|
-
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_runtime.JSX.Element;
|
|
9
10
|
|
|
10
11
|
export { FileInput };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { DetailedHTMLProps, InputHTMLAttributes, Ref, ChangeEvent } from 'react';
|
|
2
3
|
|
|
3
4
|
type Props = Omit<DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "onChange"> & {
|
|
4
5
|
buttonRef?: Ref<HTMLButtonElement>;
|
|
5
6
|
} & {
|
|
6
7
|
onChange?: (event: ChangeEvent<HTMLInputElement>) => void | Promise<void>;
|
|
7
8
|
};
|
|
8
|
-
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_runtime.JSX.Element;
|
|
9
10
|
|
|
10
11
|
export { FileInput };
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
|
|
30
20
|
// src/client/file_input.tsx
|
|
@@ -34,7 +24,7 @@ __export(file_input_exports, {
|
|
|
34
24
|
});
|
|
35
25
|
module.exports = __toCommonJS(file_input_exports);
|
|
36
26
|
var import_react = require("react");
|
|
37
|
-
var
|
|
27
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
38
28
|
function FileInput({
|
|
39
29
|
buttonRef,
|
|
40
30
|
className,
|
|
@@ -44,35 +34,38 @@ function FileInput({
|
|
|
44
34
|
onChange,
|
|
45
35
|
...props
|
|
46
36
|
}) {
|
|
47
|
-
const inputRef =
|
|
48
|
-
return /* @__PURE__ */
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
37
|
+
const inputRef = (0, import_react.useRef)(null);
|
|
38
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
39
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
40
|
+
"button",
|
|
41
|
+
{
|
|
42
|
+
ref: buttonRef,
|
|
43
|
+
className,
|
|
44
|
+
type: "button",
|
|
45
|
+
onClick: () => {
|
|
46
|
+
inputRef.current?.click();
|
|
47
|
+
},
|
|
48
|
+
children
|
|
56
49
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
50
|
+
),
|
|
51
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
52
|
+
"input",
|
|
53
|
+
{
|
|
54
|
+
...props,
|
|
55
|
+
type: "file",
|
|
56
|
+
ref: inputRef,
|
|
57
|
+
style: {
|
|
58
|
+
display: "none"
|
|
59
|
+
},
|
|
60
|
+
onChange: async (e) => {
|
|
61
|
+
await onChange?.(e);
|
|
62
|
+
if (inputRef.current) {
|
|
63
|
+
inputRef.current.value = "";
|
|
64
|
+
}
|
|
72
65
|
}
|
|
73
66
|
}
|
|
74
|
-
|
|
75
|
-
)
|
|
67
|
+
)
|
|
68
|
+
] });
|
|
76
69
|
}
|
|
77
70
|
// Annotate the CommonJS export names for ESM import in node:
|
|
78
71
|
0 && (module.exports = {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// src/client/file_input.tsx
|
|
2
|
-
import
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
useRef
|
|
4
|
+
} from "react";
|
|
5
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
6
|
function FileInput({
|
|
5
7
|
buttonRef,
|
|
6
8
|
className,
|
|
@@ -10,35 +12,38 @@ function FileInput({
|
|
|
10
12
|
onChange,
|
|
11
13
|
...props
|
|
12
14
|
}) {
|
|
13
|
-
const inputRef =
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
const inputRef = useRef(null);
|
|
16
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
17
|
+
/* @__PURE__ */ jsx(
|
|
18
|
+
"button",
|
|
19
|
+
{
|
|
20
|
+
ref: buttonRef,
|
|
21
|
+
className,
|
|
22
|
+
type: "button",
|
|
23
|
+
onClick: () => {
|
|
24
|
+
inputRef.current?.click();
|
|
25
|
+
},
|
|
26
|
+
children
|
|
22
27
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
28
|
+
),
|
|
29
|
+
/* @__PURE__ */ jsx(
|
|
30
|
+
"input",
|
|
31
|
+
{
|
|
32
|
+
...props,
|
|
33
|
+
type: "file",
|
|
34
|
+
ref: inputRef,
|
|
35
|
+
style: {
|
|
36
|
+
display: "none"
|
|
37
|
+
},
|
|
38
|
+
onChange: async (e) => {
|
|
39
|
+
await onChange?.(e);
|
|
40
|
+
if (inputRef.current) {
|
|
41
|
+
inputRef.current.value = "";
|
|
42
|
+
}
|
|
38
43
|
}
|
|
39
44
|
}
|
|
40
|
-
|
|
41
|
-
)
|
|
45
|
+
)
|
|
46
|
+
] });
|
|
42
47
|
}
|
|
43
48
|
export {
|
|
44
49
|
FileInput
|
package/dist/client/index.d.mts
CHANGED
|
@@ -4,6 +4,7 @@ export { FileInput } from './file_input.mjs';
|
|
|
4
4
|
export { useUserAgent } from './use_user_agent.mjs';
|
|
5
5
|
export { StoreTextEditor } from './store_text_editor.mjs';
|
|
6
6
|
export { createAttachFileOptions } from './editor.mjs';
|
|
7
|
+
import 'react/jsx-runtime';
|
|
7
8
|
import 'react';
|
|
8
9
|
import 'dn-react-text-editor';
|
|
9
10
|
import 'react-store-input';
|
package/dist/client/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export { FileInput } from './file_input.js';
|
|
|
4
4
|
export { useUserAgent } from './use_user_agent.js';
|
|
5
5
|
export { StoreTextEditor } from './store_text_editor.js';
|
|
6
6
|
export { createAttachFileOptions } from './editor.js';
|
|
7
|
+
import 'react/jsx-runtime';
|
|
7
8
|
import 'react';
|
|
8
9
|
import 'dn-react-text-editor';
|
|
9
10
|
import 'react-store-input';
|
package/dist/client/index.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
|
|
30
20
|
// src/client/index.ts
|
|
@@ -48,14 +38,14 @@ function env(key) {
|
|
|
48
38
|
}
|
|
49
39
|
|
|
50
40
|
// src/client/env_loader.tsx
|
|
51
|
-
var import_react = __toESM(require("react"));
|
|
52
41
|
var import_react_router = require("react-router");
|
|
42
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
53
43
|
function EnvLoader({ dataKey = "ENV" }) {
|
|
54
44
|
const data = (0, import_react_router.useRouteLoaderData)("root");
|
|
55
45
|
if (!data) {
|
|
56
46
|
return;
|
|
57
47
|
}
|
|
58
|
-
return /* @__PURE__ */
|
|
48
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
59
49
|
"script",
|
|
60
50
|
{
|
|
61
51
|
dangerouslySetInnerHTML: {
|
|
@@ -66,8 +56,8 @@ function EnvLoader({ dataKey = "ENV" }) {
|
|
|
66
56
|
}
|
|
67
57
|
|
|
68
58
|
// src/client/file_input.tsx
|
|
69
|
-
var
|
|
70
|
-
var
|
|
59
|
+
var import_react = require("react");
|
|
60
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
71
61
|
function FileInput({
|
|
72
62
|
buttonRef,
|
|
73
63
|
className,
|
|
@@ -77,35 +67,38 @@ function FileInput({
|
|
|
77
67
|
onChange,
|
|
78
68
|
...props
|
|
79
69
|
}) {
|
|
80
|
-
const inputRef =
|
|
81
|
-
return /* @__PURE__ */
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
70
|
+
const inputRef = (0, import_react.useRef)(null);
|
|
71
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
|
|
72
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
73
|
+
"button",
|
|
74
|
+
{
|
|
75
|
+
ref: buttonRef,
|
|
76
|
+
className,
|
|
77
|
+
type: "button",
|
|
78
|
+
onClick: () => {
|
|
79
|
+
inputRef.current?.click();
|
|
80
|
+
},
|
|
81
|
+
children
|
|
89
82
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
83
|
+
),
|
|
84
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
85
|
+
"input",
|
|
86
|
+
{
|
|
87
|
+
...props,
|
|
88
|
+
type: "file",
|
|
89
|
+
ref: inputRef,
|
|
90
|
+
style: {
|
|
91
|
+
display: "none"
|
|
92
|
+
},
|
|
93
|
+
onChange: async (e) => {
|
|
94
|
+
await onChange?.(e);
|
|
95
|
+
if (inputRef.current) {
|
|
96
|
+
inputRef.current.value = "";
|
|
97
|
+
}
|
|
105
98
|
}
|
|
106
99
|
}
|
|
107
|
-
|
|
108
|
-
)
|
|
100
|
+
)
|
|
101
|
+
] });
|
|
109
102
|
}
|
|
110
103
|
|
|
111
104
|
// src/client/use_user_agent.tsx
|
|
@@ -122,7 +115,8 @@ function useUserAgent() {
|
|
|
122
115
|
// src/client/store_text_editor.tsx
|
|
123
116
|
var import_dn_react_text_editor = require("dn-react-text-editor");
|
|
124
117
|
var import_react_store_input = require("react-store-input");
|
|
125
|
-
var
|
|
118
|
+
var import_react2 = require("react");
|
|
119
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
126
120
|
function StoreTextEditor({
|
|
127
121
|
store,
|
|
128
122
|
name,
|
|
@@ -132,8 +126,8 @@ function StoreTextEditor({
|
|
|
132
126
|
ref,
|
|
133
127
|
...props
|
|
134
128
|
}) {
|
|
135
|
-
const controllerRef = (0,
|
|
136
|
-
(0,
|
|
129
|
+
const controllerRef = (0, import_react2.useRef)(null);
|
|
130
|
+
(0, import_react2.useImperativeHandle)(
|
|
137
131
|
ref,
|
|
138
132
|
() => controllerRef.current,
|
|
139
133
|
[]
|
|
@@ -181,7 +175,7 @@ function StoreTextEditor({
|
|
|
181
175
|
}
|
|
182
176
|
return void 0;
|
|
183
177
|
};
|
|
184
|
-
return /* @__PURE__ */
|
|
178
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
185
179
|
import_dn_react_text_editor.TextEditor,
|
|
186
180
|
{
|
|
187
181
|
...props,
|
package/dist/client/index.mjs
CHANGED
|
@@ -7,14 +7,14 @@ function env(key) {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
// src/client/env_loader.tsx
|
|
10
|
-
import React from "react";
|
|
11
10
|
import { useRouteLoaderData } from "react-router";
|
|
11
|
+
import { jsx } from "react/jsx-runtime";
|
|
12
12
|
function EnvLoader({ dataKey = "ENV" }) {
|
|
13
13
|
const data = useRouteLoaderData("root");
|
|
14
14
|
if (!data) {
|
|
15
15
|
return;
|
|
16
16
|
}
|
|
17
|
-
return /* @__PURE__ */
|
|
17
|
+
return /* @__PURE__ */ jsx(
|
|
18
18
|
"script",
|
|
19
19
|
{
|
|
20
20
|
dangerouslySetInnerHTML: {
|
|
@@ -25,8 +25,10 @@ function EnvLoader({ dataKey = "ENV" }) {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
// src/client/file_input.tsx
|
|
28
|
-
import
|
|
29
|
-
|
|
28
|
+
import {
|
|
29
|
+
useRef
|
|
30
|
+
} from "react";
|
|
31
|
+
import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
30
32
|
function FileInput({
|
|
31
33
|
buttonRef,
|
|
32
34
|
className,
|
|
@@ -36,35 +38,38 @@ function FileInput({
|
|
|
36
38
|
onChange,
|
|
37
39
|
...props
|
|
38
40
|
}) {
|
|
39
|
-
const inputRef =
|
|
40
|
-
return /* @__PURE__ */
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
const inputRef = useRef(null);
|
|
42
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
43
|
+
/* @__PURE__ */ jsx2(
|
|
44
|
+
"button",
|
|
45
|
+
{
|
|
46
|
+
ref: buttonRef,
|
|
47
|
+
className,
|
|
48
|
+
type: "button",
|
|
49
|
+
onClick: () => {
|
|
50
|
+
inputRef.current?.click();
|
|
51
|
+
},
|
|
52
|
+
children
|
|
48
53
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
54
|
+
),
|
|
55
|
+
/* @__PURE__ */ jsx2(
|
|
56
|
+
"input",
|
|
57
|
+
{
|
|
58
|
+
...props,
|
|
59
|
+
type: "file",
|
|
60
|
+
ref: inputRef,
|
|
61
|
+
style: {
|
|
62
|
+
display: "none"
|
|
63
|
+
},
|
|
64
|
+
onChange: async (e) => {
|
|
65
|
+
await onChange?.(e);
|
|
66
|
+
if (inputRef.current) {
|
|
67
|
+
inputRef.current.value = "";
|
|
68
|
+
}
|
|
64
69
|
}
|
|
65
70
|
}
|
|
66
|
-
|
|
67
|
-
)
|
|
71
|
+
)
|
|
72
|
+
] });
|
|
68
73
|
}
|
|
69
74
|
|
|
70
75
|
// src/client/use_user_agent.tsx
|
|
@@ -83,7 +88,8 @@ import {
|
|
|
83
88
|
TextEditor
|
|
84
89
|
} from "dn-react-text-editor";
|
|
85
90
|
import { useStoreController } from "react-store-input";
|
|
86
|
-
import
|
|
91
|
+
import { useImperativeHandle, useRef as useRef2 } from "react";
|
|
92
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
87
93
|
function StoreTextEditor({
|
|
88
94
|
store,
|
|
89
95
|
name,
|
|
@@ -93,7 +99,7 @@ function StoreTextEditor({
|
|
|
93
99
|
ref,
|
|
94
100
|
...props
|
|
95
101
|
}) {
|
|
96
|
-
const controllerRef =
|
|
102
|
+
const controllerRef = useRef2(null);
|
|
97
103
|
useImperativeHandle(
|
|
98
104
|
ref,
|
|
99
105
|
() => controllerRef.current,
|
|
@@ -142,7 +148,7 @@ function StoreTextEditor({
|
|
|
142
148
|
}
|
|
143
149
|
return void 0;
|
|
144
150
|
};
|
|
145
|
-
return /* @__PURE__ */
|
|
151
|
+
return /* @__PURE__ */ jsx3(
|
|
146
152
|
TextEditor,
|
|
147
153
|
{
|
|
148
154
|
...props,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
1
2
|
import { TextEditorProps } from 'dn-react-text-editor';
|
|
2
3
|
import { Store } from 'react-store-input';
|
|
3
|
-
import React__default from 'react';
|
|
4
4
|
|
|
5
5
|
type Props<TState> = {
|
|
6
6
|
store: Store<TState>;
|
|
@@ -8,6 +8,6 @@ type Props<TState> = {
|
|
|
8
8
|
getter?: (state: TState) => string;
|
|
9
9
|
setter?: (state: TState, value: string) => void;
|
|
10
10
|
} & TextEditorProps;
|
|
11
|
-
declare function StoreTextEditor<TState>({ store, name, getter, setter, defaultValue, ref, ...props }: Props<TState>):
|
|
11
|
+
declare function StoreTextEditor<TState>({ store, name, getter, setter, defaultValue, ref, ...props }: Props<TState>): react_jsx_runtime.JSX.Element;
|
|
12
12
|
|
|
13
13
|
export { StoreTextEditor };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
1
2
|
import { TextEditorProps } from 'dn-react-text-editor';
|
|
2
3
|
import { Store } from 'react-store-input';
|
|
3
|
-
import React__default from 'react';
|
|
4
4
|
|
|
5
5
|
type Props<TState> = {
|
|
6
6
|
store: Store<TState>;
|
|
@@ -8,6 +8,6 @@ type Props<TState> = {
|
|
|
8
8
|
getter?: (state: TState) => string;
|
|
9
9
|
setter?: (state: TState, value: string) => void;
|
|
10
10
|
} & TextEditorProps;
|
|
11
|
-
declare function StoreTextEditor<TState>({ store, name, getter, setter, defaultValue, ref, ...props }: Props<TState>):
|
|
11
|
+
declare function StoreTextEditor<TState>({ store, name, getter, setter, defaultValue, ref, ...props }: Props<TState>): react_jsx_runtime.JSX.Element;
|
|
12
12
|
|
|
13
13
|
export { StoreTextEditor };
|