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.
Files changed (74) hide show
  1. package/dist/api/default_api_handler.d.mts +2 -1
  2. package/dist/api/default_api_handler.d.ts +2 -1
  3. package/dist/api/default_api_handler.js +15 -14
  4. package/dist/api/default_api_handler.mjs +1 -0
  5. package/dist/api/index.js +17 -37
  6. package/dist/api/index.mjs +4 -31
  7. package/dist/api/patch_resource_handler.js +2 -23
  8. package/dist/api/patch_resource_handler.mjs +3 -31
  9. package/dist/api/put_resource_handler.js +2 -23
  10. package/dist/api/put_resource_handler.mjs +3 -31
  11. package/dist/api/resource_handler.d.mts +3 -2
  12. package/dist/api/resource_handler.d.ts +3 -2
  13. package/dist/api/resource_handler.js +2 -23
  14. package/dist/api/resource_handler.mjs +3 -31
  15. package/dist/auth/cookie_manager.d.mts +5 -2
  16. package/dist/auth/cookie_manager.d.ts +5 -2
  17. package/dist/auth/cookie_manager.js +16 -9
  18. package/dist/auth/cookie_manager.mjs +14 -8
  19. package/dist/auth/index.d.mts +1 -1
  20. package/dist/auth/index.d.ts +1 -1
  21. package/dist/auth/index.js +14 -7
  22. package/dist/auth/index.mjs +13 -7
  23. package/dist/client/env_loader.d.mts +2 -2
  24. package/dist/client/env_loader.d.ts +2 -2
  25. package/dist/client/file_input.d.mts +2 -2
  26. package/dist/client/file_input.d.ts +2 -2
  27. package/dist/client/index.d.mts +0 -7
  28. package/dist/client/index.d.ts +0 -7
  29. package/dist/client/index.js +0 -117
  30. package/dist/client/index.mjs +0 -117
  31. package/dist/crud/crud_form.d.mts +2 -2
  32. package/dist/crud/crud_form.d.ts +2 -2
  33. package/dist/crud/crud_form.js +40 -151
  34. package/dist/crud/crud_form.mjs +40 -158
  35. package/dist/crud/crud_form_provider.d.mts +6 -7
  36. package/dist/crud/crud_form_provider.d.ts +6 -7
  37. package/dist/crud/crud_form_provider.mjs +1 -4
  38. package/dist/crud/index.d.mts +0 -1
  39. package/dist/crud/index.d.ts +0 -1
  40. package/dist/crud/index.js +2 -23
  41. package/dist/crud/index.mjs +3 -31
  42. package/dist/form/create_form_component.d.mts +2 -2
  43. package/dist/form/create_form_component.d.ts +2 -2
  44. package/dist/form/form_components.d.mts +3 -4
  45. package/dist/form/form_components.d.ts +3 -4
  46. package/dist/form/index.d.mts +0 -1
  47. package/dist/form/index.d.ts +0 -1
  48. package/dist/index.d.mts +2 -3
  49. package/dist/index.d.ts +2 -3
  50. package/dist/post/index.d.mts +2 -3
  51. package/dist/post/index.d.ts +2 -3
  52. package/dist/post/thumbnail_picker.d.mts +4 -4
  53. package/dist/post/thumbnail_picker.d.ts +4 -4
  54. package/dist/seo/index.d.mts +1 -1
  55. package/dist/seo/index.d.ts +1 -1
  56. package/dist/seo/seo.d.mts +2 -2
  57. package/dist/seo/seo.d.ts +2 -2
  58. package/dist/table/buttons.d.mts +2 -2
  59. package/dist/table/buttons.d.ts +2 -2
  60. package/dist/table/index.d.mts +1 -2
  61. package/dist/table/index.d.ts +1 -2
  62. package/dist/table/table.d.mts +2 -2
  63. package/dist/table/table.d.ts +2 -2
  64. package/dist/table/table_form.d.mts +2 -3
  65. package/dist/table/table_form.d.ts +2 -3
  66. package/package.json +12 -12
  67. package/dist/client/editor.d.mts +0 -12
  68. package/dist/client/editor.d.ts +0 -12
  69. package/dist/client/editor.js +0 -63
  70. package/dist/client/editor.mjs +0 -38
  71. package/dist/client/store_text_editor.d.mts +0 -13
  72. package/dist/client/store_text_editor.d.ts +0 -13
  73. package/dist/client/store_text_editor.js +0 -104
  74. 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
- };