dn-react-router-toolkit 0.9.8 → 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.
- package/dist/api/index.js +1 -1
- package/dist/api/index.mjs +1 -1
- package/dist/api/patch_resource_handler.js +1 -1
- package/dist/api/patch_resource_handler.mjs +1 -1
- package/dist/api/put_resource_handler.js +1 -1
- package/dist/api/put_resource_handler.mjs +1 -1
- package/dist/api/resource_handler.js +1 -1
- package/dist/api/resource_handler.mjs +1 -1
- package/dist/client/editor.d.mts +1 -1
- package/dist/client/editor.d.ts +1 -1
- package/dist/client/index.d.mts +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.js +2 -2
- package/dist/client/index.mjs +1 -1
- package/dist/client/store_text_editor.d.mts +1 -1
- package/dist/client/store_text_editor.d.ts +1 -1
- package/dist/client/store_text_editor.js +2 -2
- package/dist/client/store_text_editor.mjs +1 -1
- package/dist/crud/crud_form.js +2 -2
- package/dist/crud/crud_form.mjs +1 -1
- package/dist/crud/index.js +1 -1
- package/dist/crud/index.mjs +1 -1
- package/dist/post/index.d.mts +1 -4
- package/dist/post/index.d.ts +1 -4
- package/dist/post/index.js +2 -475
- package/dist/post/index.mjs +1 -484
- package/dist/post/thumbnail_picker.d.mts +1 -1
- package/dist/post/thumbnail_picker.d.ts +1 -1
- package/package.json +2 -2
- package/dist/post/editor_toolbar.d.mts +0 -10
- package/dist/post/editor_toolbar.d.ts +0 -10
- package/dist/post/editor_toolbar.js +0 -203
- package/dist/post/editor_toolbar.mjs +0 -177
- package/dist/post/post_form_page.d.mts +0 -33
- package/dist/post/post_form_page.d.ts +0 -33
- package/dist/post/post_form_page.js +0 -583
- package/dist/post/post_form_page.mjs +0 -560
|
@@ -1,583 +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/post_form_page.tsx
|
|
31
|
-
var post_form_page_exports = {};
|
|
32
|
-
__export(post_form_page_exports, {
|
|
33
|
-
createPostFormPage: () => createPostFormPage
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(post_form_page_exports);
|
|
36
|
-
var import_react_router4 = require("react-router");
|
|
37
|
-
var import_react_store_input5 = require("react-store-input");
|
|
38
|
-
|
|
39
|
-
// src/post/editor_toolbar.tsx
|
|
40
|
-
var import_go = require("react-icons/go");
|
|
41
|
-
|
|
42
|
-
// src/client/env_loader.tsx
|
|
43
|
-
var import_react_router = require("react-router");
|
|
44
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
45
|
-
|
|
46
|
-
// src/client/file_input.tsx
|
|
47
|
-
var import_react = require("react");
|
|
48
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
49
|
-
function FileInput({
|
|
50
|
-
buttonRef,
|
|
51
|
-
className,
|
|
52
|
-
ref,
|
|
53
|
-
children,
|
|
54
|
-
onClick,
|
|
55
|
-
onChange,
|
|
56
|
-
...props
|
|
57
|
-
}) {
|
|
58
|
-
const inputRef = (0, import_react.useRef)(null);
|
|
59
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
|
|
60
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
61
|
-
"button",
|
|
62
|
-
{
|
|
63
|
-
ref: buttonRef,
|
|
64
|
-
className,
|
|
65
|
-
type: "button",
|
|
66
|
-
onClick: () => {
|
|
67
|
-
inputRef.current?.click();
|
|
68
|
-
},
|
|
69
|
-
children
|
|
70
|
-
}
|
|
71
|
-
),
|
|
72
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
73
|
-
"input",
|
|
74
|
-
{
|
|
75
|
-
...props,
|
|
76
|
-
type: "file",
|
|
77
|
-
ref: inputRef,
|
|
78
|
-
style: {
|
|
79
|
-
display: "none"
|
|
80
|
-
},
|
|
81
|
-
onChange: async (e) => {
|
|
82
|
-
await onChange?.(e);
|
|
83
|
-
if (inputRef.current) {
|
|
84
|
-
inputRef.current.value = "";
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
)
|
|
89
|
-
] });
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// src/client/use_user_agent.tsx
|
|
93
|
-
var import_react_router2 = require("react-router");
|
|
94
|
-
|
|
95
|
-
// src/client/store_text_editor.tsx
|
|
96
|
-
var import_dn_react_text_editor = require("dn-react-text-editor");
|
|
97
|
-
var import_react_store_input = require("react-store-input");
|
|
98
|
-
var import_react2 = require("react");
|
|
99
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
100
|
-
function StoreTextEditor({
|
|
101
|
-
store,
|
|
102
|
-
name,
|
|
103
|
-
getter,
|
|
104
|
-
setter,
|
|
105
|
-
defaultValue,
|
|
106
|
-
ref,
|
|
107
|
-
...props
|
|
108
|
-
}) {
|
|
109
|
-
const controllerRef = (0, import_react2.useRef)(null);
|
|
110
|
-
(0, import_react2.useImperativeHandle)(
|
|
111
|
-
ref,
|
|
112
|
-
() => controllerRef.current,
|
|
113
|
-
[]
|
|
114
|
-
);
|
|
115
|
-
const { dispatch } = (0, import_react_store_input.useStoreController)(store, {
|
|
116
|
-
onSubscribe: (state) => {
|
|
117
|
-
const controller = controllerRef.current;
|
|
118
|
-
if (!controller) {
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
const getResult = () => {
|
|
122
|
-
if (getter) {
|
|
123
|
-
return getter(state) || "";
|
|
124
|
-
}
|
|
125
|
-
if (name) {
|
|
126
|
-
return state[name] || "";
|
|
127
|
-
}
|
|
128
|
-
return "";
|
|
129
|
-
};
|
|
130
|
-
const result = getResult();
|
|
131
|
-
if (controller.value !== result) {
|
|
132
|
-
controller.value = result;
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
onDispatch: (state) => {
|
|
136
|
-
const controller = controllerRef.current;
|
|
137
|
-
if (!controller) {
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
if (setter) {
|
|
141
|
-
setter(state, controller.value);
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
if (name) {
|
|
145
|
-
state[name] = controller.value;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
|
-
const getDefaultValue = () => {
|
|
150
|
-
if (getter) {
|
|
151
|
-
return getter(store.state);
|
|
152
|
-
}
|
|
153
|
-
if (name) {
|
|
154
|
-
return store.state[name];
|
|
155
|
-
}
|
|
156
|
-
return void 0;
|
|
157
|
-
};
|
|
158
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
159
|
-
import_dn_react_text_editor.TextEditor,
|
|
160
|
-
{
|
|
161
|
-
...props,
|
|
162
|
-
ref: controllerRef,
|
|
163
|
-
defaultValue: defaultValue ?? getDefaultValue(),
|
|
164
|
-
onChange: (e) => {
|
|
165
|
-
dispatch();
|
|
166
|
-
props.onChange?.(e);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
// src/client/editor.tsx
|
|
173
|
-
var import_client = require("gw-file/client");
|
|
174
|
-
|
|
175
|
-
// src/utils/cn.ts
|
|
176
|
-
function cn(...classes) {
|
|
177
|
-
return classes.filter(Boolean).join(" ").trim();
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
// src/utils/date.ts
|
|
181
|
-
var import_moment_timezone = __toESM(require("moment-timezone"));
|
|
182
|
-
|
|
183
|
-
// src/utils/slug.ts
|
|
184
|
-
var toSlug = (str) => {
|
|
185
|
-
return str.toLowerCase().replace(/[^a-zA-Z0-9가-힣ㄱ-ㅎㅏ-ㅣ]+/g, "-").replace(/^-|-$/g, "");
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
// src/post/editor_toolbar.tsx
|
|
189
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
190
|
-
function EditorToolbar({
|
|
191
|
-
textEditorRef,
|
|
192
|
-
className
|
|
193
|
-
}) {
|
|
194
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
195
|
-
"div",
|
|
196
|
-
{
|
|
197
|
-
className: cn("w-full h-12 flex items-center gap-0.5 px-1", className),
|
|
198
|
-
children: [
|
|
199
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
200
|
-
FileInput,
|
|
201
|
-
{
|
|
202
|
-
className: "button-icon-base text-[18px]",
|
|
203
|
-
onChange: async (e) => {
|
|
204
|
-
const files = e.target.files;
|
|
205
|
-
if (!files || files.length === 0) {
|
|
206
|
-
return;
|
|
207
|
-
}
|
|
208
|
-
textEditorRef.current?.commands.attachFile(Array.from(files));
|
|
209
|
-
},
|
|
210
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_go.GoFileMedia, {})
|
|
211
|
-
}
|
|
212
|
-
),
|
|
213
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
214
|
-
"button",
|
|
215
|
-
{
|
|
216
|
-
type: "button",
|
|
217
|
-
onClick: () => {
|
|
218
|
-
const href = prompt("\uB9C1\uD06C URL\uC744 \uC785\uB825\uD558\uC138\uC694");
|
|
219
|
-
if (!href) {
|
|
220
|
-
return;
|
|
221
|
-
}
|
|
222
|
-
textEditorRef.current?.commands.toggleMark("link", { href });
|
|
223
|
-
},
|
|
224
|
-
className: "button-icon-base text-[20px]",
|
|
225
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_go.GoLink, {})
|
|
226
|
-
}
|
|
227
|
-
),
|
|
228
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
229
|
-
"button",
|
|
230
|
-
{
|
|
231
|
-
type: "button",
|
|
232
|
-
onClick: () => {
|
|
233
|
-
textEditorRef.current?.commands.toggleBlockType("heading", {
|
|
234
|
-
level: 2
|
|
235
|
-
});
|
|
236
|
-
},
|
|
237
|
-
className: "button-icon-base text-[18px]",
|
|
238
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "H2" })
|
|
239
|
-
}
|
|
240
|
-
),
|
|
241
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
242
|
-
"button",
|
|
243
|
-
{
|
|
244
|
-
type: "button",
|
|
245
|
-
onClick: () => {
|
|
246
|
-
textEditorRef.current?.commands.toggleBlockType("heading", {
|
|
247
|
-
level: 3
|
|
248
|
-
});
|
|
249
|
-
},
|
|
250
|
-
className: "button-icon-base text-[18px]",
|
|
251
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "H3" })
|
|
252
|
-
}
|
|
253
|
-
),
|
|
254
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
255
|
-
"button",
|
|
256
|
-
{
|
|
257
|
-
type: "button",
|
|
258
|
-
onClick: () => {
|
|
259
|
-
textEditorRef.current?.commands.wrapInList("ordered_list");
|
|
260
|
-
},
|
|
261
|
-
className: "button-icon-base text-[20px]",
|
|
262
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_go.GoListOrdered, {})
|
|
263
|
-
}
|
|
264
|
-
),
|
|
265
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
266
|
-
"button",
|
|
267
|
-
{
|
|
268
|
-
type: "button",
|
|
269
|
-
onClick: () => {
|
|
270
|
-
textEditorRef.current?.commands.wrapInList("bullet_list");
|
|
271
|
-
},
|
|
272
|
-
className: "button-icon-base text-[20px]",
|
|
273
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_go.GoListUnordered, {})
|
|
274
|
-
}
|
|
275
|
-
)
|
|
276
|
-
]
|
|
277
|
-
}
|
|
278
|
-
);
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
// src/post/post_form_page.tsx
|
|
282
|
-
var import_react6 = require("react");
|
|
283
|
-
var import_dn_react_text_editor2 = require("dn-react-text-editor");
|
|
284
|
-
|
|
285
|
-
// src/post/thumbnail_picker.tsx
|
|
286
|
-
var import_react_store_input2 = require("react-store-input");
|
|
287
|
-
var import_react3 = require("react");
|
|
288
|
-
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
289
|
-
function PostThumbnailPicker({
|
|
290
|
-
store,
|
|
291
|
-
textEditorRef
|
|
292
|
-
}) {
|
|
293
|
-
const thumbnail = (0, import_react_store_input2.useSelector)(store, (state) => state.thumbnail);
|
|
294
|
-
const [thumbnails, setThumbnails] = (0, import_react3.useState)([]);
|
|
295
|
-
(0, import_react3.useEffect)(() => {
|
|
296
|
-
const update = () => {
|
|
297
|
-
const textEditor = textEditorRef.current;
|
|
298
|
-
if (!textEditor) {
|
|
299
|
-
return;
|
|
300
|
-
}
|
|
301
|
-
const html = textEditor.value;
|
|
302
|
-
if (!html) {
|
|
303
|
-
return;
|
|
304
|
-
}
|
|
305
|
-
const parser = new DOMParser();
|
|
306
|
-
const docHtml = parser.parseFromString(html, "text/html");
|
|
307
|
-
const images = docHtml.querySelectorAll("img");
|
|
308
|
-
const thumbnails2 = Array.from(images).map((img) => img.src);
|
|
309
|
-
setThumbnails(thumbnails2);
|
|
310
|
-
if (thumbnails2.length > 0 && !store.state.thumbnail) {
|
|
311
|
-
store.dispatch((state) => {
|
|
312
|
-
state.thumbnail = thumbnails2[0];
|
|
313
|
-
});
|
|
314
|
-
}
|
|
315
|
-
};
|
|
316
|
-
const unsubscribe = store.subscribe((tr) => {
|
|
317
|
-
update();
|
|
318
|
-
});
|
|
319
|
-
setTimeout(() => {
|
|
320
|
-
update();
|
|
321
|
-
}, 0);
|
|
322
|
-
return () => {
|
|
323
|
-
unsubscribe();
|
|
324
|
-
};
|
|
325
|
-
}, []);
|
|
326
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "grid grid-cols-6 gap-1", children: thumbnails.map((url, index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
327
|
-
"button",
|
|
328
|
-
{
|
|
329
|
-
type: "button",
|
|
330
|
-
className: cn(
|
|
331
|
-
"border border-neutral-200 rounded-lg overflow-hidden aspect-4/3",
|
|
332
|
-
thumbnail === url && "border-transparent ring-2 ring-primary"
|
|
333
|
-
),
|
|
334
|
-
onClick: () => {
|
|
335
|
-
store.dispatch((state) => {
|
|
336
|
-
state.thumbnail = url;
|
|
337
|
-
});
|
|
338
|
-
},
|
|
339
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
340
|
-
"img",
|
|
341
|
-
{
|
|
342
|
-
src: url,
|
|
343
|
-
alt: `Thumbnail ${index + 1}`,
|
|
344
|
-
className: "w-full h-full object-cover"
|
|
345
|
-
}
|
|
346
|
-
)
|
|
347
|
-
},
|
|
348
|
-
index
|
|
349
|
-
)) });
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
// src/crud/crud_form_provider.tsx
|
|
353
|
-
var import_react_router3 = require("react-router");
|
|
354
|
-
var import_react_store_input3 = require("react-store-input");
|
|
355
|
-
var import_react4 = require("react");
|
|
356
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
357
|
-
var FormContext = (0, import_react4.createContext)({});
|
|
358
|
-
|
|
359
|
-
// src/form/create_form_component.tsx
|
|
360
|
-
var import_react5 = require("react");
|
|
361
|
-
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
362
|
-
function createComponent(tag, options) {
|
|
363
|
-
return function FormComponent({ className, ...props }) {
|
|
364
|
-
const Tag = tag;
|
|
365
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Tag, { ...props, className: cn(options.className, className) });
|
|
366
|
-
};
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
// src/form/form_components.tsx
|
|
370
|
-
var FormEntry = createComponent("div", {
|
|
371
|
-
className: "flex-1"
|
|
372
|
-
});
|
|
373
|
-
var FormRow = createComponent("div", {
|
|
374
|
-
className: "flex-1 flex gap-4 mb-6"
|
|
375
|
-
});
|
|
376
|
-
var FormLabel = createComponent("label", {
|
|
377
|
-
className: "flex-1 font-semibold mb-2.5 block"
|
|
378
|
-
});
|
|
379
|
-
|
|
380
|
-
// src/crud/crud_form.tsx
|
|
381
|
-
var import_react_store_input4 = require("react-store-input");
|
|
382
|
-
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
383
|
-
|
|
384
|
-
// src/post/post_form_page.tsx
|
|
385
|
-
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
386
|
-
var createPostFormPage = ({
|
|
387
|
-
header: AdminPageHeader,
|
|
388
|
-
textEditorClassName,
|
|
389
|
-
attachFile
|
|
390
|
-
}) => {
|
|
391
|
-
return function PostFormPage({ form }) {
|
|
392
|
-
const { boards } = (0, import_react_router4.useLoaderData)();
|
|
393
|
-
const component = (0, import_react_store_input5.useStoreComponent)(form.store);
|
|
394
|
-
const textEditorRef = (0, import_react6.useRef)(null);
|
|
395
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
396
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
397
|
-
AdminPageHeader,
|
|
398
|
-
{
|
|
399
|
-
title: `${form.name} \uCD94\uAC00`,
|
|
400
|
-
actions: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
401
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
402
|
-
"button",
|
|
403
|
-
{
|
|
404
|
-
type: "button",
|
|
405
|
-
className: "button-outline",
|
|
406
|
-
onClick: () => {
|
|
407
|
-
form.delete();
|
|
408
|
-
},
|
|
409
|
-
children: "\uC0AD\uC81C\uD558\uAE30"
|
|
410
|
-
}
|
|
411
|
-
),
|
|
412
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
413
|
-
"button",
|
|
414
|
-
{
|
|
415
|
-
type: "button",
|
|
416
|
-
className: "button-primary",
|
|
417
|
-
onClick: () => {
|
|
418
|
-
form.submit();
|
|
419
|
-
},
|
|
420
|
-
children: "\uC800\uC7A5\uD558\uAE30"
|
|
421
|
-
}
|
|
422
|
-
)
|
|
423
|
-
] })
|
|
424
|
-
}
|
|
425
|
-
),
|
|
426
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "px-4", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "max-w-7xl mx-auto w-full", children: [
|
|
427
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(FormRow, { children: [
|
|
428
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(FormEntry, { children: [
|
|
429
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(FormLabel, { children: "\uACF5\uAC1C\uC5EC\uBD80" }),
|
|
430
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
431
|
-
component.select,
|
|
432
|
-
{
|
|
433
|
-
name: "isPublic",
|
|
434
|
-
className: "select-form",
|
|
435
|
-
toInputValue: (value) => value ? "true" : "false",
|
|
436
|
-
toStateValue: (value) => Boolean(value === "true"),
|
|
437
|
-
children: [
|
|
438
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "true", children: "\uACF5\uAC1C" }),
|
|
439
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "false", children: "\uBE44\uACF5\uAC1C" })
|
|
440
|
-
]
|
|
441
|
-
}
|
|
442
|
-
)
|
|
443
|
-
] }),
|
|
444
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(FormEntry, { children: [
|
|
445
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(FormLabel, { children: "\uC791\uC131\uC77C\uC2DC" }),
|
|
446
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
447
|
-
component.input,
|
|
448
|
-
{
|
|
449
|
-
name: "createdAt",
|
|
450
|
-
className: "input-form",
|
|
451
|
-
type: "datetime-local"
|
|
452
|
-
}
|
|
453
|
-
)
|
|
454
|
-
] })
|
|
455
|
-
] }),
|
|
456
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(FormRow, { children: [
|
|
457
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(FormEntry, { children: [
|
|
458
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(FormLabel, { children: "\uAC8C\uC2DC\uD310" }),
|
|
459
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(component.select, { name: "boardId", className: "select-form", children: [
|
|
460
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "", children: "\uC120\uD0DD\uD558\uC138\uC694" }),
|
|
461
|
-
boards.map((board) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: board.id, children: board.title }, board.id))
|
|
462
|
-
] })
|
|
463
|
-
] }),
|
|
464
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(FormEntry, { children: [
|
|
465
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(FormLabel, { children: "\uCE74\uD14C\uACE0\uB9AC" }),
|
|
466
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
467
|
-
component.input,
|
|
468
|
-
{
|
|
469
|
-
name: "category",
|
|
470
|
-
className: "input-form",
|
|
471
|
-
placeholder: "\uCE74\uD14C\uACE0\uB9AC"
|
|
472
|
-
}
|
|
473
|
-
)
|
|
474
|
-
] })
|
|
475
|
-
] }),
|
|
476
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(FormRow, { children: [
|
|
477
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(FormEntry, { children: [
|
|
478
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(FormLabel, { children: "\uC81C\uBAA9" }),
|
|
479
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
480
|
-
component.input,
|
|
481
|
-
{
|
|
482
|
-
name: "title",
|
|
483
|
-
className: "input-form",
|
|
484
|
-
placeholder: "\uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694",
|
|
485
|
-
onChange: (e) => {
|
|
486
|
-
const title = e.target.value;
|
|
487
|
-
form.store.dispatch((state) => {
|
|
488
|
-
state.slug = toSlug(title);
|
|
489
|
-
});
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
)
|
|
493
|
-
] }),
|
|
494
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(FormEntry, { children: [
|
|
495
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(FormLabel, { children: "\uBD80\uC81C\uBAA9" }),
|
|
496
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
497
|
-
component.input,
|
|
498
|
-
{
|
|
499
|
-
name: "subtitle",
|
|
500
|
-
className: "input-form",
|
|
501
|
-
placeholder: "\uBD80\uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694"
|
|
502
|
-
}
|
|
503
|
-
)
|
|
504
|
-
] })
|
|
505
|
-
] }),
|
|
506
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(FormRow, { children: [
|
|
507
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(FormEntry, { children: [
|
|
508
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(FormLabel, { children: "\uC2AC\uB7EC\uADF8" }),
|
|
509
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
510
|
-
component.input,
|
|
511
|
-
{
|
|
512
|
-
name: "slug",
|
|
513
|
-
className: "input-form",
|
|
514
|
-
placeholder: "\uC81C\uBAA9"
|
|
515
|
-
}
|
|
516
|
-
)
|
|
517
|
-
] }),
|
|
518
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(FormEntry, { children: [
|
|
519
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(FormLabel, { children: "\uD0DC\uADF8" }),
|
|
520
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
521
|
-
component.input,
|
|
522
|
-
{
|
|
523
|
-
name: "tags",
|
|
524
|
-
className: "input-form",
|
|
525
|
-
placeholder: "\uD0DC\uADF8 1, \uD0DC\uADF8 2, \uD0DC\uADF8 3"
|
|
526
|
-
}
|
|
527
|
-
)
|
|
528
|
-
] })
|
|
529
|
-
] }),
|
|
530
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(FormRow, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(FormEntry, { children: [
|
|
531
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(FormLabel, { children: "\uC124\uBA85" }),
|
|
532
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
533
|
-
StoreTextEditor,
|
|
534
|
-
{
|
|
535
|
-
store: form.store,
|
|
536
|
-
mode: "text",
|
|
537
|
-
name: "description",
|
|
538
|
-
className: "text-editor min-h-[80px]",
|
|
539
|
-
placeholder: "\uC124\uBA85"
|
|
540
|
-
}
|
|
541
|
-
)
|
|
542
|
-
] }) }),
|
|
543
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(FormRow, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(FormEntry, { children: [
|
|
544
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(FormLabel, { children: "\uC378\uB124\uC77C" }),
|
|
545
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
546
|
-
PostThumbnailPicker,
|
|
547
|
-
{
|
|
548
|
-
store: form.store,
|
|
549
|
-
textEditorRef
|
|
550
|
-
}
|
|
551
|
-
)
|
|
552
|
-
] }) })
|
|
553
|
-
] }) }),
|
|
554
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "sticky top-[160px] z-998 bg-white px-4", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
555
|
-
EditorToolbar,
|
|
556
|
-
{
|
|
557
|
-
textEditorRef,
|
|
558
|
-
className: "max-w-7xl mx-auto"
|
|
559
|
-
}
|
|
560
|
-
) }),
|
|
561
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "px-4", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
562
|
-
StoreTextEditor,
|
|
563
|
-
{
|
|
564
|
-
ref: textEditorRef,
|
|
565
|
-
store: form.store,
|
|
566
|
-
name: "html",
|
|
567
|
-
placeholder: "\uC5EC\uAE30\uC5D0 \uBCF8\uBB38\uC744 \uC791\uC131\uD558\uC138\uC694...",
|
|
568
|
-
updateDelay: 500,
|
|
569
|
-
editor: {
|
|
570
|
-
attributes: {
|
|
571
|
-
class: cn(textEditorClassName, "pb-[50vh]")
|
|
572
|
-
}
|
|
573
|
-
},
|
|
574
|
-
attachFile
|
|
575
|
-
}
|
|
576
|
-
) })
|
|
577
|
-
] });
|
|
578
|
-
};
|
|
579
|
-
};
|
|
580
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
581
|
-
0 && (module.exports = {
|
|
582
|
-
createPostFormPage
|
|
583
|
-
});
|