dn-react-router-toolkit 0.9.7 → 0.9.9

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 (39) hide show
  1. package/dist/api/default_api_handler.d.mts +1 -1
  2. package/dist/api/default_api_handler.d.ts +1 -1
  3. package/dist/api/index.js +1 -1
  4. package/dist/api/index.mjs +1 -1
  5. package/dist/api/patch_resource_handler.js +1 -1
  6. package/dist/api/patch_resource_handler.mjs +1 -1
  7. package/dist/api/put_resource_handler.js +1 -1
  8. package/dist/api/put_resource_handler.mjs +1 -1
  9. package/dist/api/resource_handler.js +1 -1
  10. package/dist/api/resource_handler.mjs +1 -1
  11. package/dist/client/editor.d.mts +1 -1
  12. package/dist/client/editor.d.ts +1 -1
  13. package/dist/client/index.d.mts +1 -1
  14. package/dist/client/index.d.ts +1 -1
  15. package/dist/client/index.js +2 -2
  16. package/dist/client/index.mjs +1 -1
  17. package/dist/client/store_text_editor.d.mts +1 -1
  18. package/dist/client/store_text_editor.d.ts +1 -1
  19. package/dist/client/store_text_editor.js +2 -2
  20. package/dist/client/store_text_editor.mjs +1 -1
  21. package/dist/crud/crud_form.js +2 -2
  22. package/dist/crud/crud_form.mjs +1 -1
  23. package/dist/crud/index.js +1 -1
  24. package/dist/crud/index.mjs +1 -1
  25. package/dist/post/index.d.mts +1 -4
  26. package/dist/post/index.d.ts +1 -4
  27. package/dist/post/index.js +2 -475
  28. package/dist/post/index.mjs +1 -484
  29. package/dist/post/thumbnail_picker.d.mts +1 -1
  30. package/dist/post/thumbnail_picker.d.ts +1 -1
  31. package/package.json +3 -3
  32. package/dist/post/editor_toolbar.d.mts +0 -10
  33. package/dist/post/editor_toolbar.d.ts +0 -10
  34. package/dist/post/editor_toolbar.js +0 -203
  35. package/dist/post/editor_toolbar.mjs +0 -177
  36. package/dist/post/post_form_page.d.mts +0 -33
  37. package/dist/post/post_form_page.d.ts +0 -33
  38. package/dist/post/post_form_page.js +0 -583
  39. package/dist/post/post_form_page.mjs +0 -560
@@ -1,203 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
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
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // src/post/editor_toolbar.tsx
31
- var editor_toolbar_exports = {};
32
- __export(editor_toolbar_exports, {
33
- EditorToolbar: () => EditorToolbar
34
- });
35
- module.exports = __toCommonJS(editor_toolbar_exports);
36
- var import_go = require("react-icons/go");
37
-
38
- // src/client/env_loader.tsx
39
- var import_react_router = require("react-router");
40
- var import_jsx_runtime = require("react/jsx-runtime");
41
-
42
- // src/client/file_input.tsx
43
- var import_react = require("react");
44
- var import_jsx_runtime2 = require("react/jsx-runtime");
45
- function FileInput({
46
- buttonRef,
47
- className,
48
- ref,
49
- children,
50
- onClick,
51
- onChange,
52
- ...props
53
- }) {
54
- const inputRef = (0, import_react.useRef)(null);
55
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
56
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
57
- "button",
58
- {
59
- ref: buttonRef,
60
- className,
61
- type: "button",
62
- onClick: () => {
63
- inputRef.current?.click();
64
- },
65
- children
66
- }
67
- ),
68
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
69
- "input",
70
- {
71
- ...props,
72
- type: "file",
73
- ref: inputRef,
74
- style: {
75
- display: "none"
76
- },
77
- onChange: async (e) => {
78
- await onChange?.(e);
79
- if (inputRef.current) {
80
- inputRef.current.value = "";
81
- }
82
- }
83
- }
84
- )
85
- ] });
86
- }
87
-
88
- // src/client/use_user_agent.tsx
89
- var import_react_router2 = require("react-router");
90
-
91
- // src/client/store_text_editor.tsx
92
- var import_dn_react_text_editor = require("dn-react-text-editor");
93
- var import_react_store_input = require("react-store-input");
94
- var import_react2 = require("react");
95
- var import_jsx_runtime3 = require("react/jsx-runtime");
96
-
97
- // src/client/editor.tsx
98
- var import_client = require("gw-file/client");
99
-
100
- // src/utils/cn.ts
101
- function cn(...classes) {
102
- return classes.filter(Boolean).join(" ").trim();
103
- }
104
-
105
- // src/utils/date.ts
106
- var import_moment_timezone = __toESM(require("moment-timezone"));
107
-
108
- // src/post/editor_toolbar.tsx
109
- var import_jsx_runtime4 = require("react/jsx-runtime");
110
- function EditorToolbar({
111
- textEditorRef,
112
- className
113
- }) {
114
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
115
- "div",
116
- {
117
- className: cn("w-full h-12 flex items-center gap-0.5 px-1", className),
118
- children: [
119
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
120
- FileInput,
121
- {
122
- className: "button-icon-base text-[18px]",
123
- onChange: async (e) => {
124
- const files = e.target.files;
125
- if (!files || files.length === 0) {
126
- return;
127
- }
128
- textEditorRef.current?.commands.attachFile(Array.from(files));
129
- },
130
- children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_go.GoFileMedia, {})
131
- }
132
- ),
133
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
134
- "button",
135
- {
136
- type: "button",
137
- onClick: () => {
138
- const href = prompt("\uB9C1\uD06C URL\uC744 \uC785\uB825\uD558\uC138\uC694");
139
- if (!href) {
140
- return;
141
- }
142
- textEditorRef.current?.commands.toggleMark("link", { href });
143
- },
144
- className: "button-icon-base text-[20px]",
145
- children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_go.GoLink, {})
146
- }
147
- ),
148
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
149
- "button",
150
- {
151
- type: "button",
152
- onClick: () => {
153
- textEditorRef.current?.commands.toggleBlockType("heading", {
154
- level: 2
155
- });
156
- },
157
- className: "button-icon-base text-[18px]",
158
- children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "H2" })
159
- }
160
- ),
161
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
162
- "button",
163
- {
164
- type: "button",
165
- onClick: () => {
166
- textEditorRef.current?.commands.toggleBlockType("heading", {
167
- level: 3
168
- });
169
- },
170
- className: "button-icon-base text-[18px]",
171
- children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "H3" })
172
- }
173
- ),
174
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
175
- "button",
176
- {
177
- type: "button",
178
- onClick: () => {
179
- textEditorRef.current?.commands.wrapInList("ordered_list");
180
- },
181
- className: "button-icon-base text-[20px]",
182
- children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_go.GoListOrdered, {})
183
- }
184
- ),
185
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
186
- "button",
187
- {
188
- type: "button",
189
- onClick: () => {
190
- textEditorRef.current?.commands.wrapInList("bullet_list");
191
- },
192
- className: "button-icon-base text-[20px]",
193
- children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_go.GoListUnordered, {})
194
- }
195
- )
196
- ]
197
- }
198
- );
199
- }
200
- // Annotate the CommonJS export names for ESM import in node:
201
- 0 && (module.exports = {
202
- EditorToolbar
203
- });
@@ -1,177 +0,0 @@
1
- // src/post/editor_toolbar.tsx
2
- import {
3
- GoFileMedia,
4
- GoLink,
5
- GoListOrdered,
6
- GoListUnordered
7
- } from "react-icons/go";
8
-
9
- // src/client/env_loader.tsx
10
- import { useRouteLoaderData } from "react-router";
11
- import { jsx } from "react/jsx-runtime";
12
-
13
- // src/client/file_input.tsx
14
- import {
15
- useRef
16
- } from "react";
17
- import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
18
- function FileInput({
19
- buttonRef,
20
- className,
21
- ref,
22
- children,
23
- onClick,
24
- onChange,
25
- ...props
26
- }) {
27
- const inputRef = useRef(null);
28
- return /* @__PURE__ */ jsxs(Fragment, { children: [
29
- /* @__PURE__ */ jsx2(
30
- "button",
31
- {
32
- ref: buttonRef,
33
- className,
34
- type: "button",
35
- onClick: () => {
36
- inputRef.current?.click();
37
- },
38
- children
39
- }
40
- ),
41
- /* @__PURE__ */ jsx2(
42
- "input",
43
- {
44
- ...props,
45
- type: "file",
46
- ref: inputRef,
47
- style: {
48
- display: "none"
49
- },
50
- onChange: async (e) => {
51
- await onChange?.(e);
52
- if (inputRef.current) {
53
- inputRef.current.value = "";
54
- }
55
- }
56
- }
57
- )
58
- ] });
59
- }
60
-
61
- // src/client/use_user_agent.tsx
62
- import { useRouteLoaderData as useRouteLoaderData2 } from "react-router";
63
-
64
- // src/client/store_text_editor.tsx
65
- import {
66
- TextEditor
67
- } from "dn-react-text-editor";
68
- import { useStoreController } from "react-store-input";
69
- import { useImperativeHandle, useRef as useRef2 } from "react";
70
- import { jsx as jsx3 } from "react/jsx-runtime";
71
-
72
- // src/client/editor.tsx
73
- import { generateMetadata } from "gw-file/client";
74
-
75
- // src/utils/cn.ts
76
- function cn(...classes) {
77
- return classes.filter(Boolean).join(" ").trim();
78
- }
79
-
80
- // src/utils/date.ts
81
- import moment from "moment-timezone";
82
-
83
- // src/post/editor_toolbar.tsx
84
- import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
85
- function EditorToolbar({
86
- textEditorRef,
87
- className
88
- }) {
89
- return /* @__PURE__ */ jsxs2(
90
- "div",
91
- {
92
- className: cn("w-full h-12 flex items-center gap-0.5 px-1", className),
93
- children: [
94
- /* @__PURE__ */ jsx4(
95
- FileInput,
96
- {
97
- className: "button-icon-base text-[18px]",
98
- onChange: async (e) => {
99
- const files = e.target.files;
100
- if (!files || files.length === 0) {
101
- return;
102
- }
103
- textEditorRef.current?.commands.attachFile(Array.from(files));
104
- },
105
- children: /* @__PURE__ */ jsx4(GoFileMedia, {})
106
- }
107
- ),
108
- /* @__PURE__ */ jsx4(
109
- "button",
110
- {
111
- type: "button",
112
- onClick: () => {
113
- const href = prompt("\uB9C1\uD06C URL\uC744 \uC785\uB825\uD558\uC138\uC694");
114
- if (!href) {
115
- return;
116
- }
117
- textEditorRef.current?.commands.toggleMark("link", { href });
118
- },
119
- className: "button-icon-base text-[20px]",
120
- children: /* @__PURE__ */ jsx4(GoLink, {})
121
- }
122
- ),
123
- /* @__PURE__ */ jsx4(
124
- "button",
125
- {
126
- type: "button",
127
- onClick: () => {
128
- textEditorRef.current?.commands.toggleBlockType("heading", {
129
- level: 2
130
- });
131
- },
132
- className: "button-icon-base text-[18px]",
133
- children: /* @__PURE__ */ jsx4("span", { children: "H2" })
134
- }
135
- ),
136
- /* @__PURE__ */ jsx4(
137
- "button",
138
- {
139
- type: "button",
140
- onClick: () => {
141
- textEditorRef.current?.commands.toggleBlockType("heading", {
142
- level: 3
143
- });
144
- },
145
- className: "button-icon-base text-[18px]",
146
- children: /* @__PURE__ */ jsx4("span", { children: "H3" })
147
- }
148
- ),
149
- /* @__PURE__ */ jsx4(
150
- "button",
151
- {
152
- type: "button",
153
- onClick: () => {
154
- textEditorRef.current?.commands.wrapInList("ordered_list");
155
- },
156
- className: "button-icon-base text-[20px]",
157
- children: /* @__PURE__ */ jsx4(GoListOrdered, {})
158
- }
159
- ),
160
- /* @__PURE__ */ jsx4(
161
- "button",
162
- {
163
- type: "button",
164
- onClick: () => {
165
- textEditorRef.current?.commands.wrapInList("bullet_list");
166
- },
167
- className: "button-icon-base text-[20px]",
168
- children: /* @__PURE__ */ jsx4(GoListUnordered, {})
169
- }
170
- )
171
- ]
172
- }
173
- );
174
- }
175
- export {
176
- EditorToolbar
177
- };
@@ -1,33 +0,0 @@
1
- import { FC, ReactNode } from 'react';
2
- import { GenerateMetadata, UploadFile } from 'dn-react-text-editor';
3
- import { FormContextProps } from '../crud/crud_form_provider.mjs';
4
- import 'react/jsx-runtime';
5
- import 'react-store-input';
6
-
7
- declare const createPostFormPage: <TModel extends {
8
- boardId: string | null;
9
- thumbnail: string;
10
- category: string;
11
- title: string;
12
- subtitle: string;
13
- slug: string;
14
- tags: string;
15
- description: string;
16
- html: string;
17
- isPublic: boolean;
18
- createdAt: Date;
19
- }>({ header: AdminPageHeader, textEditorClassName, attachFile, }: {
20
- header: FC<{
21
- title: string;
22
- actions?: ReactNode;
23
- }>;
24
- textEditorClassName: string;
25
- attachFile?: {
26
- generateMetadata?: GenerateMetadata | undefined;
27
- uploadFile?: UploadFile;
28
- };
29
- }) => FC<{
30
- form: FormContextProps<TModel>;
31
- }>;
32
-
33
- export { createPostFormPage };
@@ -1,33 +0,0 @@
1
- import { FC, ReactNode } from 'react';
2
- import { GenerateMetadata, UploadFile } from 'dn-react-text-editor';
3
- import { FormContextProps } from '../crud/crud_form_provider.js';
4
- import 'react/jsx-runtime';
5
- import 'react-store-input';
6
-
7
- declare const createPostFormPage: <TModel extends {
8
- boardId: string | null;
9
- thumbnail: string;
10
- category: string;
11
- title: string;
12
- subtitle: string;
13
- slug: string;
14
- tags: string;
15
- description: string;
16
- html: string;
17
- isPublic: boolean;
18
- createdAt: Date;
19
- }>({ header: AdminPageHeader, textEditorClassName, attachFile, }: {
20
- header: FC<{
21
- title: string;
22
- actions?: ReactNode;
23
- }>;
24
- textEditorClassName: string;
25
- attachFile?: {
26
- generateMetadata?: GenerateMetadata | undefined;
27
- uploadFile?: UploadFile;
28
- };
29
- }) => FC<{
30
- form: FormContextProps<TModel>;
31
- }>;
32
-
33
- export { createPostFormPage };