dn-react-router-toolkit 0.9.0 → 0.9.2
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 +13 -0
- package/dist/api/default_api_handler.d.ts +13 -0
- package/dist/api/{create_handler.js → default_api_handler.js} +49 -52
- package/dist/api/{create_handler.mjs → default_api_handler.mjs} +45 -48
- package/dist/api/index.d.mts +8 -7
- package/dist/api/index.d.ts +8 -7
- package/dist/api/index.js +233 -147
- package/dist/api/index.mjs +238 -151
- package/dist/api/put_resource_handler.d.mts +25 -0
- package/dist/api/put_resource_handler.d.ts +25 -0
- package/dist/api/put_resource_handler.js +214 -0
- package/dist/api/put_resource_handler.mjs +194 -0
- package/dist/api/resource_handler.d.mts +26 -0
- package/dist/api/resource_handler.d.ts +26 -0
- package/dist/api/resource_handler.js +280 -0
- package/dist/api/resource_handler.mjs +265 -0
- package/dist/auth/cookie_manager.d.mts +1 -1
- package/dist/auth/cookie_manager.d.ts +1 -1
- package/dist/auth/index.d.mts +2 -2
- package/dist/auth/index.d.ts +2 -2
- package/dist/auth/index.js +18 -18
- package/dist/auth/index.mjs +18 -18
- package/dist/auth/with_auth.d.mts +2 -2
- package/dist/auth/with_auth.d.ts +2 -2
- package/dist/auth/with_auth.js +18 -18
- package/dist/auth/with_auth.mjs +18 -18
- package/dist/client/editor.d.mts +2 -2
- package/dist/client/editor.d.ts +2 -2
- package/dist/client/editor.js +9 -3
- package/dist/client/editor.mjs +9 -3
- package/dist/client/index.d.mts +2 -2
- package/dist/client/index.d.ts +2 -2
- package/dist/client/index.js +9 -3
- package/dist/client/index.mjs +9 -3
- package/dist/crud/crud_form.js +22 -4
- package/dist/crud/crud_form.mjs +11 -3
- package/dist/crud/crud_form_provider.js +16 -3
- package/dist/crud/crud_form_provider.mjs +14 -1
- package/dist/crud/index.js +22 -4
- package/dist/crud/index.mjs +11 -3
- package/dist/db/backup/index.d.mts +1 -1
- package/dist/db/backup/index.d.ts +1 -1
- package/dist/form/create_form_component.js +21 -2
- package/dist/form/create_form_component.mjs +10 -1
- package/dist/form/form_components.js +21 -2
- package/dist/form/form_components.mjs +10 -1
- package/dist/form/index.js +21 -2
- package/dist/form/index.mjs +10 -1
- package/dist/post/editor_toolbar.js +20 -3
- package/dist/post/editor_toolbar.mjs +9 -2
- package/dist/post/index.js +31 -11
- package/dist/post/index.mjs +19 -9
- package/dist/post/post_form_page.js +29 -11
- package/dist/post/post_form_page.mjs +17 -9
- package/dist/post/thumbnail_picker.js +21 -2
- package/dist/post/thumbnail_picker.mjs +10 -1
- package/dist/table/buttons.js +11 -14
- package/dist/table/buttons.mjs +10 -13
- package/dist/table/index.js +14 -18
- package/dist/table/index.mjs +13 -17
- package/dist/table/table.js +10 -4
- package/dist/table/table.mjs +5 -1
- package/dist/table/table_form.js +12 -18
- package/dist/table/table_form.mjs +9 -15
- package/dist/utils/cn.d.mts +3 -0
- package/dist/utils/cn.d.ts +3 -0
- package/dist/utils/cn.js +32 -0
- package/dist/utils/cn.mjs +7 -0
- package/dist/utils/date.d.mts +5 -0
- package/dist/utils/date.d.ts +5 -0
- package/dist/utils/date.js +65 -0
- package/dist/utils/date.mjs +29 -0
- package/dist/utils/index.d.mts +7 -0
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/index.js +116 -0
- package/dist/utils/index.mjs +73 -0
- package/dist/utils/korean.d.mts +6 -0
- package/dist/utils/korean.d.ts +6 -0
- package/dist/utils/korean.js +41 -0
- package/dist/utils/korean.mjs +16 -0
- package/dist/utils/singleton.d.mts +3 -0
- package/dist/utils/singleton.d.ts +3 -0
- package/dist/utils/singleton.js +37 -0
- package/dist/utils/singleton.mjs +12 -0
- package/dist/utils/sleep.d.mts +3 -0
- package/dist/utils/sleep.d.ts +3 -0
- package/dist/utils/sleep.js +32 -0
- package/dist/utils/sleep.mjs +7 -0
- package/dist/utils/slug.d.mts +3 -0
- package/dist/utils/slug.d.ts +3 -0
- package/dist/utils/slug.js +32 -0
- package/dist/utils/slug.mjs +7 -0
- package/package.json +8 -4
- package/dist/api/create_api_handler.d.mts +0 -30
- package/dist/api/create_api_handler.d.ts +0 -30
- package/dist/api/create_api_handler.js +0 -155
- package/dist/api/create_api_handler.mjs +0 -139
- package/dist/api/create_handler.d.mts +0 -13
- package/dist/api/create_handler.d.ts +0 -13
- package/dist/api/item_api_handler.d.mts +0 -21
- package/dist/api/item_api_handler.d.ts +0 -21
- package/dist/api/item_api_handler.js +0 -63
- package/dist/api/item_api_handler.mjs +0 -38
package/dist/auth/with_auth.js
CHANGED
|
@@ -46,31 +46,31 @@ function createWithStrictAuthHandler({ authService }) {
|
|
|
46
46
|
arg.request
|
|
47
47
|
);
|
|
48
48
|
if (accessToken) {
|
|
49
|
-
const
|
|
50
|
-
if (
|
|
51
|
-
|
|
49
|
+
const verifyResult = await authService.accessTokenManager.verify(accessToken);
|
|
50
|
+
if (verifyResult.isOk) {
|
|
51
|
+
const payload = verifyResult.value;
|
|
52
|
+
if (payload) {
|
|
53
|
+
return respond(payload);
|
|
54
|
+
}
|
|
52
55
|
}
|
|
53
56
|
}
|
|
54
57
|
const refreshToken = await authService.getRefreshTokenFromCookies(
|
|
55
58
|
arg.request
|
|
56
59
|
);
|
|
57
60
|
if (refreshToken) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
);
|
|
63
|
-
|
|
64
|
-
headers.append("Set-Cookie", setCookieHeader);
|
|
65
|
-
const payload = authService.accessTokenManager.decode(newAccessToken);
|
|
66
|
-
return respond(payload, headers);
|
|
67
|
-
} catch (e) {
|
|
68
|
-
console.log(e);
|
|
69
|
-
const setCookieHeader = await authService.getRefreshTokenSetCookie(void 0);
|
|
70
|
-
const headers = new Headers();
|
|
71
|
-
headers.append("Set-Cookie", setCookieHeader);
|
|
72
|
-
return respond(void 0, headers);
|
|
61
|
+
const refreshResult = await authService.refreshAccessToken(refreshToken);
|
|
62
|
+
if (refreshResult.isErr) {
|
|
63
|
+
const setCookieHeader2 = await authService.getRefreshTokenSetCookie(void 0);
|
|
64
|
+
const headers2 = new Headers();
|
|
65
|
+
headers2.append("Set-Cookie", setCookieHeader2);
|
|
66
|
+
return respond(void 0, headers2);
|
|
73
67
|
}
|
|
68
|
+
const newAccessToken = refreshResult.value;
|
|
69
|
+
const setCookieHeader = await authService.getAccessTokenSetCookie(newAccessToken);
|
|
70
|
+
const headers = new Headers();
|
|
71
|
+
headers.append("Set-Cookie", setCookieHeader);
|
|
72
|
+
const payload = authService.accessTokenManager.decode(newAccessToken);
|
|
73
|
+
return respond(payload, headers);
|
|
74
74
|
}
|
|
75
75
|
return respond(void 0);
|
|
76
76
|
};
|
package/dist/auth/with_auth.mjs
CHANGED
|
@@ -22,31 +22,31 @@ function createWithStrictAuthHandler({ authService }) {
|
|
|
22
22
|
arg.request
|
|
23
23
|
);
|
|
24
24
|
if (accessToken) {
|
|
25
|
-
const
|
|
26
|
-
if (
|
|
27
|
-
|
|
25
|
+
const verifyResult = await authService.accessTokenManager.verify(accessToken);
|
|
26
|
+
if (verifyResult.isOk) {
|
|
27
|
+
const payload = verifyResult.value;
|
|
28
|
+
if (payload) {
|
|
29
|
+
return respond(payload);
|
|
30
|
+
}
|
|
28
31
|
}
|
|
29
32
|
}
|
|
30
33
|
const refreshToken = await authService.getRefreshTokenFromCookies(
|
|
31
34
|
arg.request
|
|
32
35
|
);
|
|
33
36
|
if (refreshToken) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
);
|
|
39
|
-
|
|
40
|
-
headers.append("Set-Cookie", setCookieHeader);
|
|
41
|
-
const payload = authService.accessTokenManager.decode(newAccessToken);
|
|
42
|
-
return respond(payload, headers);
|
|
43
|
-
} catch (e) {
|
|
44
|
-
console.log(e);
|
|
45
|
-
const setCookieHeader = await authService.getRefreshTokenSetCookie(void 0);
|
|
46
|
-
const headers = new Headers();
|
|
47
|
-
headers.append("Set-Cookie", setCookieHeader);
|
|
48
|
-
return respond(void 0, headers);
|
|
37
|
+
const refreshResult = await authService.refreshAccessToken(refreshToken);
|
|
38
|
+
if (refreshResult.isErr) {
|
|
39
|
+
const setCookieHeader2 = await authService.getRefreshTokenSetCookie(void 0);
|
|
40
|
+
const headers2 = new Headers();
|
|
41
|
+
headers2.append("Set-Cookie", setCookieHeader2);
|
|
42
|
+
return respond(void 0, headers2);
|
|
49
43
|
}
|
|
44
|
+
const newAccessToken = refreshResult.value;
|
|
45
|
+
const setCookieHeader = await authService.getAccessTokenSetCookie(newAccessToken);
|
|
46
|
+
const headers = new Headers();
|
|
47
|
+
headers.append("Set-Cookie", setCookieHeader);
|
|
48
|
+
const payload = authService.accessTokenManager.decode(newAccessToken);
|
|
49
|
+
return respond(payload, headers);
|
|
50
50
|
}
|
|
51
51
|
return respond(void 0);
|
|
52
52
|
};
|
package/dist/client/editor.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FileUploader } from '
|
|
1
|
+
import { FileUploader } from 'gw-file/client';
|
|
2
2
|
import { AttachFileOptions } from 'dn-react-text-editor';
|
|
3
|
-
import { CDN } from '
|
|
3
|
+
import { CDN } from 'gw-file';
|
|
4
4
|
|
|
5
5
|
declare function createAttachFileOptions<TFile extends {
|
|
6
6
|
key: string;
|
package/dist/client/editor.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FileUploader } from '
|
|
1
|
+
import { FileUploader } from 'gw-file/client';
|
|
2
2
|
import { AttachFileOptions } from 'dn-react-text-editor';
|
|
3
|
-
import { CDN } from '
|
|
3
|
+
import { CDN } from 'gw-file';
|
|
4
4
|
|
|
5
5
|
declare function createAttachFileOptions<TFile extends {
|
|
6
6
|
key: string;
|
package/dist/client/editor.js
CHANGED
|
@@ -23,7 +23,7 @@ __export(editor_exports, {
|
|
|
23
23
|
createAttachFileOptions: () => createAttachFileOptions
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(editor_exports);
|
|
26
|
-
var import_client = require("
|
|
26
|
+
var import_client = require("gw-file/client");
|
|
27
27
|
function createAttachFileOptions({
|
|
28
28
|
cdn,
|
|
29
29
|
fileUploader
|
|
@@ -33,9 +33,12 @@ function createAttachFileOptions({
|
|
|
33
33
|
const result = await fileUploader.uploadFile(file, {
|
|
34
34
|
convertToWebp: true
|
|
35
35
|
});
|
|
36
|
+
if (result.isErr) {
|
|
37
|
+
throw new Error(result.error.message);
|
|
38
|
+
}
|
|
36
39
|
return {
|
|
37
40
|
alt: file.name,
|
|
38
|
-
src: cdn(result.key)
|
|
41
|
+
src: cdn(result.value.key)
|
|
39
42
|
};
|
|
40
43
|
},
|
|
41
44
|
generateMetadata: (file) => (0, import_client.generateMetadata)(file, {
|
|
@@ -43,9 +46,12 @@ function createAttachFileOptions({
|
|
|
43
46
|
const result = await fileUploader.uploadBlob(blob, "file", {
|
|
44
47
|
convertToWebp: true
|
|
45
48
|
});
|
|
49
|
+
if (result.isErr) {
|
|
50
|
+
throw new Error(result.error.message);
|
|
51
|
+
}
|
|
46
52
|
return {
|
|
47
53
|
alt: file.name,
|
|
48
|
-
src: cdn(result.key)
|
|
54
|
+
src: cdn(result.value.key)
|
|
49
55
|
};
|
|
50
56
|
}
|
|
51
57
|
})
|
package/dist/client/editor.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/client/editor.tsx
|
|
2
|
-
import { generateMetadata } from "
|
|
2
|
+
import { generateMetadata } from "gw-file/client";
|
|
3
3
|
function createAttachFileOptions({
|
|
4
4
|
cdn,
|
|
5
5
|
fileUploader
|
|
@@ -9,9 +9,12 @@ function createAttachFileOptions({
|
|
|
9
9
|
const result = await fileUploader.uploadFile(file, {
|
|
10
10
|
convertToWebp: true
|
|
11
11
|
});
|
|
12
|
+
if (result.isErr) {
|
|
13
|
+
throw new Error(result.error.message);
|
|
14
|
+
}
|
|
12
15
|
return {
|
|
13
16
|
alt: file.name,
|
|
14
|
-
src: cdn(result.key)
|
|
17
|
+
src: cdn(result.value.key)
|
|
15
18
|
};
|
|
16
19
|
},
|
|
17
20
|
generateMetadata: (file) => generateMetadata(file, {
|
|
@@ -19,9 +22,12 @@ function createAttachFileOptions({
|
|
|
19
22
|
const result = await fileUploader.uploadBlob(blob, "file", {
|
|
20
23
|
convertToWebp: true
|
|
21
24
|
});
|
|
25
|
+
if (result.isErr) {
|
|
26
|
+
throw new Error(result.error.message);
|
|
27
|
+
}
|
|
22
28
|
return {
|
|
23
29
|
alt: file.name,
|
|
24
|
-
src: cdn(result.key)
|
|
30
|
+
src: cdn(result.value.key)
|
|
25
31
|
};
|
|
26
32
|
}
|
|
27
33
|
})
|
package/dist/client/index.d.mts
CHANGED
package/dist/client/index.d.ts
CHANGED
package/dist/client/index.js
CHANGED
|
@@ -190,7 +190,7 @@ function StoreTextEditor({
|
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
// src/client/editor.tsx
|
|
193
|
-
var import_client = require("
|
|
193
|
+
var import_client = require("gw-file/client");
|
|
194
194
|
function createAttachFileOptions({
|
|
195
195
|
cdn,
|
|
196
196
|
fileUploader
|
|
@@ -200,9 +200,12 @@ function createAttachFileOptions({
|
|
|
200
200
|
const result = await fileUploader.uploadFile(file, {
|
|
201
201
|
convertToWebp: true
|
|
202
202
|
});
|
|
203
|
+
if (result.isErr) {
|
|
204
|
+
throw new Error(result.error.message);
|
|
205
|
+
}
|
|
203
206
|
return {
|
|
204
207
|
alt: file.name,
|
|
205
|
-
src: cdn(result.key)
|
|
208
|
+
src: cdn(result.value.key)
|
|
206
209
|
};
|
|
207
210
|
},
|
|
208
211
|
generateMetadata: (file) => (0, import_client.generateMetadata)(file, {
|
|
@@ -210,9 +213,12 @@ function createAttachFileOptions({
|
|
|
210
213
|
const result = await fileUploader.uploadBlob(blob, "file", {
|
|
211
214
|
convertToWebp: true
|
|
212
215
|
});
|
|
216
|
+
if (result.isErr) {
|
|
217
|
+
throw new Error(result.error.message);
|
|
218
|
+
}
|
|
213
219
|
return {
|
|
214
220
|
alt: file.name,
|
|
215
|
-
src: cdn(result.key)
|
|
221
|
+
src: cdn(result.value.key)
|
|
216
222
|
};
|
|
217
223
|
}
|
|
218
224
|
})
|
package/dist/client/index.mjs
CHANGED
|
@@ -163,7 +163,7 @@ function StoreTextEditor({
|
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
// src/client/editor.tsx
|
|
166
|
-
import { generateMetadata } from "
|
|
166
|
+
import { generateMetadata } from "gw-file/client";
|
|
167
167
|
function createAttachFileOptions({
|
|
168
168
|
cdn,
|
|
169
169
|
fileUploader
|
|
@@ -173,9 +173,12 @@ function createAttachFileOptions({
|
|
|
173
173
|
const result = await fileUploader.uploadFile(file, {
|
|
174
174
|
convertToWebp: true
|
|
175
175
|
});
|
|
176
|
+
if (result.isErr) {
|
|
177
|
+
throw new Error(result.error.message);
|
|
178
|
+
}
|
|
176
179
|
return {
|
|
177
180
|
alt: file.name,
|
|
178
|
-
src: cdn(result.key)
|
|
181
|
+
src: cdn(result.value.key)
|
|
179
182
|
};
|
|
180
183
|
},
|
|
181
184
|
generateMetadata: (file) => generateMetadata(file, {
|
|
@@ -183,9 +186,12 @@ function createAttachFileOptions({
|
|
|
183
186
|
const result = await fileUploader.uploadBlob(blob, "file", {
|
|
184
187
|
convertToWebp: true
|
|
185
188
|
});
|
|
189
|
+
if (result.isErr) {
|
|
190
|
+
throw new Error(result.error.message);
|
|
191
|
+
}
|
|
186
192
|
return {
|
|
187
193
|
alt: file.name,
|
|
188
|
-
src: cdn(result.key)
|
|
194
|
+
src: cdn(result.value.key)
|
|
189
195
|
};
|
|
190
196
|
}
|
|
191
197
|
})
|
package/dist/crud/crud_form.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
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
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
|
|
20
30
|
// src/crud/crud_form.tsx
|
|
@@ -28,7 +38,6 @@ module.exports = __toCommonJS(crud_form_exports);
|
|
|
28
38
|
var import_react_router = require("react-router");
|
|
29
39
|
var import_react_store_input = require("react-store-input");
|
|
30
40
|
var import_react = require("react");
|
|
31
|
-
var import_utils = require("dn-react-toolkit/utils");
|
|
32
41
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
33
42
|
var FormContext = (0, import_react.createContext)({});
|
|
34
43
|
function useFormContext() {
|
|
@@ -36,13 +45,22 @@ function useFormContext() {
|
|
|
36
45
|
}
|
|
37
46
|
|
|
38
47
|
// src/form/create_form_component.tsx
|
|
39
|
-
var import_utils2 = require("dn-react-toolkit/utils");
|
|
40
48
|
var import_react2 = require("react");
|
|
49
|
+
|
|
50
|
+
// src/utils/cn.ts
|
|
51
|
+
function cn(...classes) {
|
|
52
|
+
return classes.filter(Boolean).join(" ").trim();
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// src/utils/date.ts
|
|
56
|
+
var import_moment_timezone = __toESM(require("moment-timezone"));
|
|
57
|
+
|
|
58
|
+
// src/form/create_form_component.tsx
|
|
41
59
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
42
60
|
function createComponent(tag, options) {
|
|
43
61
|
return function FormComponent({ className, ...props }) {
|
|
44
62
|
const Tag = tag;
|
|
45
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Tag, { ...props, className:
|
|
63
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Tag, { ...props, className: cn(options.className, className) });
|
|
46
64
|
};
|
|
47
65
|
}
|
|
48
66
|
|
|
@@ -149,7 +167,7 @@ function StoreTextEditor({
|
|
|
149
167
|
}
|
|
150
168
|
|
|
151
169
|
// src/client/editor.tsx
|
|
152
|
-
var import_client = require("
|
|
170
|
+
var import_client = require("gw-file/client");
|
|
153
171
|
|
|
154
172
|
// src/crud/crud_form.tsx
|
|
155
173
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
package/dist/crud/crud_form.mjs
CHANGED
|
@@ -5,7 +5,6 @@ import {
|
|
|
5
5
|
createContext,
|
|
6
6
|
useContext
|
|
7
7
|
} from "react";
|
|
8
|
-
import { Korean } from "dn-react-toolkit/utils";
|
|
9
8
|
import { jsx } from "react/jsx-runtime";
|
|
10
9
|
var FormContext = createContext({});
|
|
11
10
|
function useFormContext() {
|
|
@@ -13,8 +12,17 @@ function useFormContext() {
|
|
|
13
12
|
}
|
|
14
13
|
|
|
15
14
|
// src/form/create_form_component.tsx
|
|
16
|
-
import { cn } from "dn-react-toolkit/utils";
|
|
17
15
|
import "react";
|
|
16
|
+
|
|
17
|
+
// src/utils/cn.ts
|
|
18
|
+
function cn(...classes) {
|
|
19
|
+
return classes.filter(Boolean).join(" ").trim();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// src/utils/date.ts
|
|
23
|
+
import moment from "moment-timezone";
|
|
24
|
+
|
|
25
|
+
// src/form/create_form_component.tsx
|
|
18
26
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
19
27
|
function createComponent(tag, options) {
|
|
20
28
|
return function FormComponent({ className, ...props }) {
|
|
@@ -130,7 +138,7 @@ function StoreTextEditor({
|
|
|
130
138
|
}
|
|
131
139
|
|
|
132
140
|
// src/client/editor.tsx
|
|
133
|
-
import { generateMetadata } from "
|
|
141
|
+
import { generateMetadata } from "gw-file/client";
|
|
134
142
|
|
|
135
143
|
// src/crud/crud_form.tsx
|
|
136
144
|
import { Fragment as Fragment2, jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
@@ -87,8 +87,21 @@ function serialize(value) {
|
|
|
87
87
|
return void 0;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
+
// src/utils/korean.ts
|
|
91
|
+
var Korean = class _Korean {
|
|
92
|
+
static hasFinalConsonant(word) {
|
|
93
|
+
if (!word) return false;
|
|
94
|
+
const lastChar = word[word.length - 1];
|
|
95
|
+
const code = lastChar.charCodeAt(0);
|
|
96
|
+
if (code < 44032 || code > 55203) return false;
|
|
97
|
+
return (code - 44032) % 28 !== 0;
|
|
98
|
+
}
|
|
99
|
+
static with(word, [withFinal, withoutFinal]) {
|
|
100
|
+
return word + (_Korean.hasFinalConsonant(word) ? withFinal : withoutFinal);
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
|
|
90
104
|
// src/crud/crud_form_provider.tsx
|
|
91
|
-
var import_utils = require("dn-react-toolkit/utils");
|
|
92
105
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
93
106
|
var FormContext = (0, import_react.createContext)({});
|
|
94
107
|
function useFormContext() {
|
|
@@ -139,7 +152,7 @@ function CrudFormProvider({
|
|
|
139
152
|
alert(message);
|
|
140
153
|
return;
|
|
141
154
|
}
|
|
142
|
-
alert(`${
|
|
155
|
+
alert(`${Korean.with(name, ["\uC744", "\uB97C"])} \uC800\uC7A5\uD588\uC2B5\uB2C8\uB2E4.`);
|
|
143
156
|
const { id } = await res.json();
|
|
144
157
|
navigate(`${prefix}/${id}`);
|
|
145
158
|
};
|
|
@@ -159,7 +172,7 @@ function CrudFormProvider({
|
|
|
159
172
|
alert(message);
|
|
160
173
|
return;
|
|
161
174
|
}
|
|
162
|
-
alert(`${
|
|
175
|
+
alert(`${Korean.with(name, ["\uC744", "\uB97C"])} \uC0AD\uC81C\uD588\uC2B5\uB2C8\uB2E4.`);
|
|
163
176
|
navigate(`${prefix}`);
|
|
164
177
|
};
|
|
165
178
|
const value = {
|
|
@@ -64,8 +64,21 @@ function serialize(value) {
|
|
|
64
64
|
return void 0;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
// src/utils/korean.ts
|
|
68
|
+
var Korean = class _Korean {
|
|
69
|
+
static hasFinalConsonant(word) {
|
|
70
|
+
if (!word) return false;
|
|
71
|
+
const lastChar = word[word.length - 1];
|
|
72
|
+
const code = lastChar.charCodeAt(0);
|
|
73
|
+
if (code < 44032 || code > 55203) return false;
|
|
74
|
+
return (code - 44032) % 28 !== 0;
|
|
75
|
+
}
|
|
76
|
+
static with(word, [withFinal, withoutFinal]) {
|
|
77
|
+
return word + (_Korean.hasFinalConsonant(word) ? withFinal : withoutFinal);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
67
81
|
// src/crud/crud_form_provider.tsx
|
|
68
|
-
import { Korean } from "dn-react-toolkit/utils";
|
|
69
82
|
import { jsx } from "react/jsx-runtime";
|
|
70
83
|
var FormContext = createContext({});
|
|
71
84
|
function useFormContext() {
|
package/dist/crud/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
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
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
|
|
20
30
|
// src/crud/index.ts
|
|
@@ -126,7 +136,6 @@ function deserialize(data) {
|
|
|
126
136
|
}
|
|
127
137
|
|
|
128
138
|
// src/crud/crud_form_provider.tsx
|
|
129
|
-
var import_utils = require("dn-react-toolkit/utils");
|
|
130
139
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
131
140
|
var FormContext = (0, import_react.createContext)({});
|
|
132
141
|
function useFormContext() {
|
|
@@ -134,13 +143,22 @@ function useFormContext() {
|
|
|
134
143
|
}
|
|
135
144
|
|
|
136
145
|
// src/form/create_form_component.tsx
|
|
137
|
-
var import_utils2 = require("dn-react-toolkit/utils");
|
|
138
146
|
var import_react2 = require("react");
|
|
147
|
+
|
|
148
|
+
// src/utils/cn.ts
|
|
149
|
+
function cn(...classes) {
|
|
150
|
+
return classes.filter(Boolean).join(" ").trim();
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// src/utils/date.ts
|
|
154
|
+
var import_moment_timezone = __toESM(require("moment-timezone"));
|
|
155
|
+
|
|
156
|
+
// src/form/create_form_component.tsx
|
|
139
157
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
140
158
|
function createComponent(tag, options) {
|
|
141
159
|
return function FormComponent({ className, ...props }) {
|
|
142
160
|
const Tag = tag;
|
|
143
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Tag, { ...props, className:
|
|
161
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Tag, { ...props, className: cn(options.className, className) });
|
|
144
162
|
};
|
|
145
163
|
}
|
|
146
164
|
|
|
@@ -176,7 +194,7 @@ var import_react4 = require("react");
|
|
|
176
194
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
177
195
|
|
|
178
196
|
// src/client/editor.tsx
|
|
179
|
-
var import_client = require("
|
|
197
|
+
var import_client = require("gw-file/client");
|
|
180
198
|
|
|
181
199
|
// src/crud/crud_form.tsx
|
|
182
200
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
package/dist/crud/index.mjs
CHANGED
|
@@ -100,7 +100,6 @@ function deserialize(data) {
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
// src/crud/crud_form_provider.tsx
|
|
103
|
-
import { Korean } from "dn-react-toolkit/utils";
|
|
104
103
|
import { jsx } from "react/jsx-runtime";
|
|
105
104
|
var FormContext = createContext({});
|
|
106
105
|
function useFormContext() {
|
|
@@ -108,8 +107,17 @@ function useFormContext() {
|
|
|
108
107
|
}
|
|
109
108
|
|
|
110
109
|
// src/form/create_form_component.tsx
|
|
111
|
-
import { cn } from "dn-react-toolkit/utils";
|
|
112
110
|
import "react";
|
|
111
|
+
|
|
112
|
+
// src/utils/cn.ts
|
|
113
|
+
function cn(...classes) {
|
|
114
|
+
return classes.filter(Boolean).join(" ").trim();
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// src/utils/date.ts
|
|
118
|
+
import moment from "moment-timezone";
|
|
119
|
+
|
|
120
|
+
// src/form/create_form_component.tsx
|
|
113
121
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
114
122
|
function createComponent(tag, options) {
|
|
115
123
|
return function FormComponent({ className, ...props }) {
|
|
@@ -154,7 +162,7 @@ import { useImperativeHandle, useRef as useRef2 } from "react";
|
|
|
154
162
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
155
163
|
|
|
156
164
|
// src/client/editor.tsx
|
|
157
|
-
import { generateMetadata } from "
|
|
165
|
+
import { generateMetadata } from "gw-file/client";
|
|
158
166
|
|
|
159
167
|
// src/crud/crud_form.tsx
|
|
160
168
|
import { Fragment as Fragment2, jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
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
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
|
|
20
30
|
// src/form/create_form_component.tsx
|
|
@@ -23,13 +33,22 @@ __export(create_form_component_exports, {
|
|
|
23
33
|
createComponent: () => createComponent
|
|
24
34
|
});
|
|
25
35
|
module.exports = __toCommonJS(create_form_component_exports);
|
|
26
|
-
var import_utils = require("dn-react-toolkit/utils");
|
|
27
36
|
var import_react = require("react");
|
|
37
|
+
|
|
38
|
+
// src/utils/cn.ts
|
|
39
|
+
function cn(...classes) {
|
|
40
|
+
return classes.filter(Boolean).join(" ").trim();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// src/utils/date.ts
|
|
44
|
+
var import_moment_timezone = __toESM(require("moment-timezone"));
|
|
45
|
+
|
|
46
|
+
// src/form/create_form_component.tsx
|
|
28
47
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
29
48
|
function createComponent(tag, options) {
|
|
30
49
|
return function FormComponent({ className, ...props }) {
|
|
31
50
|
const Tag = tag;
|
|
32
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Tag, { ...props, className:
|
|
51
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Tag, { ...props, className: cn(options.className, className) });
|
|
33
52
|
};
|
|
34
53
|
}
|
|
35
54
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
// src/form/create_form_component.tsx
|
|
2
|
-
import { cn } from "dn-react-toolkit/utils";
|
|
3
2
|
import "react";
|
|
3
|
+
|
|
4
|
+
// src/utils/cn.ts
|
|
5
|
+
function cn(...classes) {
|
|
6
|
+
return classes.filter(Boolean).join(" ").trim();
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// src/utils/date.ts
|
|
10
|
+
import moment from "moment-timezone";
|
|
11
|
+
|
|
12
|
+
// src/form/create_form_component.tsx
|
|
4
13
|
import { jsx } from "react/jsx-runtime";
|
|
5
14
|
function createComponent(tag, options) {
|
|
6
15
|
return function FormComponent({ className, ...props }) {
|