dn-react-router-toolkit 0.9.11 → 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/default_api_handler.js +15 -14
- package/dist/api/default_api_handler.mjs +1 -0
- package/dist/api/index.js +17 -37
- package/dist/api/index.mjs +4 -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/auth/cookie_manager.d.mts +5 -2
- package/dist/auth/cookie_manager.d.ts +5 -2
- package/dist/auth/cookie_manager.js +16 -9
- package/dist/auth/cookie_manager.mjs +14 -8
- package/dist/auth/index.d.mts +1 -1
- package/dist/auth/index.d.ts +1 -1
- package/dist/auth/index.js +14 -7
- package/dist/auth/index.mjs +13 -7
- 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 +12 -12
- 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,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
|
-
};
|