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,13 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { TextEditorProps } from 'gw-react-text-editor';
|
|
3
|
-
import { Store } from 'react-store-input';
|
|
4
|
-
|
|
5
|
-
type Props<TState> = {
|
|
6
|
-
store: Store<TState>;
|
|
7
|
-
name?: keyof TState;
|
|
8
|
-
getter?: (state: TState) => string;
|
|
9
|
-
setter?: (state: TState, value: string) => void;
|
|
10
|
-
} & TextEditorProps;
|
|
11
|
-
declare function StoreTextEditor<TState>({ store, name, getter, setter, defaultValue, ref, ...props }: Props<TState>): react_jsx_runtime.JSX.Element;
|
|
12
|
-
|
|
13
|
-
export { StoreTextEditor };
|
|
@@ -1,104 +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/client/store_text_editor.tsx
|
|
21
|
-
var store_text_editor_exports = {};
|
|
22
|
-
__export(store_text_editor_exports, {
|
|
23
|
-
StoreTextEditor: () => StoreTextEditor
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(store_text_editor_exports);
|
|
26
|
-
var import_gw_react_text_editor = require("gw-react-text-editor");
|
|
27
|
-
var import_react_store_input = require("react-store-input");
|
|
28
|
-
var import_react = require("react");
|
|
29
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
30
|
-
function StoreTextEditor({
|
|
31
|
-
store,
|
|
32
|
-
name,
|
|
33
|
-
getter,
|
|
34
|
-
setter,
|
|
35
|
-
defaultValue,
|
|
36
|
-
ref,
|
|
37
|
-
...props
|
|
38
|
-
}) {
|
|
39
|
-
const controllerRef = (0, import_react.useRef)(null);
|
|
40
|
-
(0, import_react.useImperativeHandle)(
|
|
41
|
-
ref,
|
|
42
|
-
() => controllerRef.current,
|
|
43
|
-
[]
|
|
44
|
-
);
|
|
45
|
-
const { dispatch } = (0, import_react_store_input.useStoreController)(store, {
|
|
46
|
-
onSubscribe: (state) => {
|
|
47
|
-
const controller = controllerRef.current;
|
|
48
|
-
if (!controller) {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
const getResult = () => {
|
|
52
|
-
if (getter) {
|
|
53
|
-
return getter(state) || "";
|
|
54
|
-
}
|
|
55
|
-
if (name) {
|
|
56
|
-
return state[name] || "";
|
|
57
|
-
}
|
|
58
|
-
return "";
|
|
59
|
-
};
|
|
60
|
-
const result = getResult();
|
|
61
|
-
if (controller.value !== result) {
|
|
62
|
-
controller.value = result;
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
onDispatch: (state) => {
|
|
66
|
-
const controller = controllerRef.current;
|
|
67
|
-
if (!controller) {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
if (setter) {
|
|
71
|
-
setter(state, controller.value);
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
if (name) {
|
|
75
|
-
state[name] = controller.value;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
const getDefaultValue = () => {
|
|
80
|
-
if (getter) {
|
|
81
|
-
return getter(store.state);
|
|
82
|
-
}
|
|
83
|
-
if (name) {
|
|
84
|
-
return store.state[name];
|
|
85
|
-
}
|
|
86
|
-
return void 0;
|
|
87
|
-
};
|
|
88
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
89
|
-
import_gw_react_text_editor.TextEditor,
|
|
90
|
-
{
|
|
91
|
-
...props,
|
|
92
|
-
ref: controllerRef,
|
|
93
|
-
defaultValue: defaultValue ?? getDefaultValue(),
|
|
94
|
-
onChange: (e) => {
|
|
95
|
-
dispatch();
|
|
96
|
-
props.onChange?.(e);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
);
|
|
100
|
-
}
|
|
101
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
102
|
-
0 && (module.exports = {
|
|
103
|
-
StoreTextEditor
|
|
104
|
-
});
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
// src/client/store_text_editor.tsx
|
|
2
|
-
import {
|
|
3
|
-
TextEditor
|
|
4
|
-
} from "gw-react-text-editor";
|
|
5
|
-
import { useStoreController } from "react-store-input";
|
|
6
|
-
import { useImperativeHandle, useRef } from "react";
|
|
7
|
-
import { jsx } from "react/jsx-runtime";
|
|
8
|
-
function StoreTextEditor({
|
|
9
|
-
store,
|
|
10
|
-
name,
|
|
11
|
-
getter,
|
|
12
|
-
setter,
|
|
13
|
-
defaultValue,
|
|
14
|
-
ref,
|
|
15
|
-
...props
|
|
16
|
-
}) {
|
|
17
|
-
const controllerRef = useRef(null);
|
|
18
|
-
useImperativeHandle(
|
|
19
|
-
ref,
|
|
20
|
-
() => controllerRef.current,
|
|
21
|
-
[]
|
|
22
|
-
);
|
|
23
|
-
const { dispatch } = useStoreController(store, {
|
|
24
|
-
onSubscribe: (state) => {
|
|
25
|
-
const controller = controllerRef.current;
|
|
26
|
-
if (!controller) {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
const getResult = () => {
|
|
30
|
-
if (getter) {
|
|
31
|
-
return getter(state) || "";
|
|
32
|
-
}
|
|
33
|
-
if (name) {
|
|
34
|
-
return state[name] || "";
|
|
35
|
-
}
|
|
36
|
-
return "";
|
|
37
|
-
};
|
|
38
|
-
const result = getResult();
|
|
39
|
-
if (controller.value !== result) {
|
|
40
|
-
controller.value = result;
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
onDispatch: (state) => {
|
|
44
|
-
const controller = controllerRef.current;
|
|
45
|
-
if (!controller) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
if (setter) {
|
|
49
|
-
setter(state, controller.value);
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
if (name) {
|
|
53
|
-
state[name] = controller.value;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
const getDefaultValue = () => {
|
|
58
|
-
if (getter) {
|
|
59
|
-
return getter(store.state);
|
|
60
|
-
}
|
|
61
|
-
if (name) {
|
|
62
|
-
return store.state[name];
|
|
63
|
-
}
|
|
64
|
-
return void 0;
|
|
65
|
-
};
|
|
66
|
-
return /* @__PURE__ */ jsx(
|
|
67
|
-
TextEditor,
|
|
68
|
-
{
|
|
69
|
-
...props,
|
|
70
|
-
ref: controllerRef,
|
|
71
|
-
defaultValue: defaultValue ?? getDefaultValue(),
|
|
72
|
-
onChange: (e) => {
|
|
73
|
-
dispatch();
|
|
74
|
-
props.onChange?.(e);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
);
|
|
78
|
-
}
|
|
79
|
-
export {
|
|
80
|
-
StoreTextEditor
|
|
81
|
-
};
|