dn-react-router-toolkit 0.2.6 → 0.3.1
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/create_handler.d.mts +13 -0
- package/dist/api/create_handler.d.ts +13 -0
- package/dist/api/create_handler.js +276 -0
- package/dist/api/create_handler.mjs +282 -0
- package/dist/api/index.d.mts +4 -0
- package/dist/api/index.d.ts +4 -0
- package/dist/api/index.js +276 -0
- package/dist/api/index.mjs +282 -0
- package/dist/auth/client/index.d.mts +3 -0
- package/dist/auth/client/index.d.ts +3 -0
- package/dist/{date.js → auth/client/index.js} +25 -32
- package/dist/auth/client/index.mjs +21 -0
- package/dist/auth/client/redirect_page.d.mts +1 -0
- package/dist/auth/client/redirect_page.d.ts +1 -0
- package/dist/auth/index.d.mts +4 -0
- package/dist/auth/index.d.ts +4 -0
- package/dist/auth/index.js +116 -0
- package/dist/auth/index.mjs +89 -0
- package/dist/auth/server/index.d.mts +1 -0
- package/dist/auth/server/index.d.ts +1 -0
- package/dist/{slug.js → auth/server/index.js} +6 -14
- package/dist/auth/server/index.mjs +2 -0
- package/dist/auth/with_auth.d.mts +2 -6
- package/dist/auth/with_auth.d.ts +2 -6
- package/dist/auth/with_auth.js +3 -0
- package/dist/auth/with_auth.mjs +3 -0
- package/dist/{components → client}/client_env.d.mts +1 -1
- package/dist/{components → client}/client_env.d.ts +1 -1
- package/dist/{components → client}/client_env.js +6 -2
- package/dist/{components → client}/client_env.mjs +2 -2
- package/dist/client/index.d.mts +3 -0
- package/dist/client/index.d.ts +3 -0
- package/dist/{auth/client/google_login_button.js → client/index.js} +30 -33
- package/dist/client/index.mjs +31 -0
- package/dist/client/use_user_agent.d.mts +8 -0
- package/dist/client/use_user_agent.d.ts +8 -0
- package/dist/{file/client/format_size.js → client/use_user_agent.js} +14 -14
- package/dist/client/use_user_agent.mjs +13 -0
- package/dist/file/client/index.d.mts +1 -0
- package/dist/file/client/index.d.ts +1 -0
- package/dist/file/{cdn.js → client/index.js} +6 -16
- package/dist/file/client/index.mjs +2 -0
- package/dist/file/index.d.mts +1 -0
- package/dist/file/index.d.ts +1 -0
- package/dist/{cn.js → file/index.js} +6 -14
- package/dist/file/index.mjs +2 -0
- package/dist/file/server/index.d.mts +1 -0
- package/dist/file/server/index.d.ts +1 -0
- package/dist/file/server/index.js +24 -0
- package/dist/file/server/index.mjs +2 -0
- package/dist/http/index.d.mts +1 -1
- package/dist/http/index.d.ts +1 -1
- package/dist/http/index.js +3 -90
- package/dist/http/index.mjs +2 -68
- package/dist/index.d.mts +8 -6
- package/dist/index.d.ts +8 -6
- package/dist/index.js +3 -79
- package/dist/index.mjs +2 -58
- package/dist/modal/index.d.mts +1 -0
- package/dist/modal/index.d.ts +1 -0
- package/dist/{sleep.js → modal/index.js} +6 -14
- package/dist/modal/index.mjs +2 -0
- package/dist/seo/index.d.mts +4 -0
- package/dist/seo/index.d.ts +4 -0
- package/dist/seo/index.js +304 -0
- package/dist/seo/index.mjs +267 -0
- package/dist/seo/seo.js +9 -1
- package/dist/seo/seo.mjs +9 -1
- package/dist/text_editor/index.d.mts +1 -0
- package/dist/text_editor/index.d.ts +1 -0
- package/dist/text_editor/index.js +24 -0
- package/dist/text_editor/index.mjs +2 -0
- package/package.json +58 -32
- package/dist/auth/apple_auth.d.mts +0 -38
- package/dist/auth/apple_auth.d.ts +0 -38
- package/dist/auth/apple_auth.js +0 -88
- package/dist/auth/apple_auth.mjs +0 -63
- package/dist/auth/auth_repository.d.mts +0 -41
- package/dist/auth/auth_repository.d.ts +0 -41
- package/dist/auth/auth_repository.js +0 -18
- package/dist/auth/auth_repository.mjs +0 -0
- package/dist/auth/auth_service.d.mts +0 -63
- package/dist/auth/auth_service.d.ts +0 -63
- package/dist/auth/auth_service.js +0 -210
- package/dist/auth/auth_service.mjs +0 -171
- package/dist/auth/client/google_login_button.d.mts +0 -7
- package/dist/auth/client/google_login_button.d.ts +0 -7
- package/dist/auth/client/google_login_button.mjs +0 -37
- package/dist/auth/client/provider.d.mts +0 -24
- package/dist/auth/client/provider.d.ts +0 -24
- package/dist/auth/client/provider.js +0 -154
- package/dist/auth/client/provider.mjs +0 -118
- package/dist/auth/google_auth.d.mts +0 -33
- package/dist/auth/google_auth.d.ts +0 -33
- package/dist/auth/google_auth.js +0 -135
- package/dist/auth/google_auth.mjs +0 -108
- package/dist/auth/handlers/find_auth.d.mts +0 -13
- package/dist/auth/handlers/find_auth.d.ts +0 -13
- package/dist/auth/handlers/find_auth.js +0 -82
- package/dist/auth/handlers/find_auth.mjs +0 -55
- package/dist/auth/handlers/login.d.mts +0 -13
- package/dist/auth/handlers/login.d.ts +0 -13
- package/dist/auth/handlers/login.js +0 -107
- package/dist/auth/handlers/login.mjs +0 -80
- package/dist/auth/handlers/login_with_thirdparty.d.mts +0 -15
- package/dist/auth/handlers/login_with_thirdparty.d.ts +0 -15
- package/dist/auth/handlers/login_with_thirdparty.js +0 -98
- package/dist/auth/handlers/login_with_thirdparty.mjs +0 -71
- package/dist/auth/handlers/logout.d.mts +0 -13
- package/dist/auth/handlers/logout.d.ts +0 -13
- package/dist/auth/handlers/logout.js +0 -102
- package/dist/auth/handlers/logout.mjs +0 -75
- package/dist/auth/handlers/refresh.d.mts +0 -13
- package/dist/auth/handlers/refresh.d.ts +0 -13
- package/dist/auth/handlers/refresh.js +0 -92
- package/dist/auth/handlers/refresh.mjs +0 -65
- package/dist/auth/handlers/request_password_reset.d.mts +0 -10
- package/dist/auth/handlers/request_password_reset.d.ts +0 -10
- package/dist/auth/handlers/request_password_reset.js +0 -87
- package/dist/auth/handlers/request_password_reset.mjs +0 -60
- package/dist/auth/handlers/reset_password.d.mts +0 -10
- package/dist/auth/handlers/reset_password.d.ts +0 -10
- package/dist/auth/handlers/reset_password.js +0 -88
- package/dist/auth/handlers/reset_password.mjs +0 -61
- package/dist/auth/handlers/signup.d.mts +0 -15
- package/dist/auth/handlers/signup.d.ts +0 -15
- package/dist/auth/handlers/signup.js +0 -147
- package/dist/auth/handlers/signup.mjs +0 -112
- package/dist/auth/handlers/signup_with_thirdparty.d.mts +0 -17
- package/dist/auth/handlers/signup_with_thirdparty.d.ts +0 -17
- package/dist/auth/handlers/signup_with_thirdparty.js +0 -123
- package/dist/auth/handlers/signup_with_thirdparty.mjs +0 -98
- package/dist/auth/handlers/thirdparty_auth_callback.d.mts +0 -16
- package/dist/auth/handlers/thirdparty_auth_callback.d.ts +0 -16
- package/dist/auth/handlers/thirdparty_auth_callback.js +0 -129
- package/dist/auth/handlers/thirdparty_auth_callback.mjs +0 -102
- package/dist/auth/jwt_manager.d.mts +0 -38
- package/dist/auth/jwt_manager.d.ts +0 -38
- package/dist/auth/jwt_manager.js +0 -90
- package/dist/auth/jwt_manager.mjs +0 -65
- package/dist/auth/kakao_auth.d.mts +0 -27
- package/dist/auth/kakao_auth.d.ts +0 -27
- package/dist/auth/kakao_auth.js +0 -56
- package/dist/auth/kakao_auth.mjs +0 -31
- package/dist/auth/password_recovery.d.mts +0 -34
- package/dist/auth/password_recovery.d.ts +0 -34
- package/dist/auth/password_recovery.js +0 -169
- package/dist/auth/password_recovery.mjs +0 -134
- package/dist/auth/thirdparty_auth.d.mts +0 -41
- package/dist/auth/thirdparty_auth.d.ts +0 -41
- package/dist/auth/thirdparty_auth.js +0 -113
- package/dist/auth/thirdparty_auth.mjs +0 -86
- package/dist/cn.d.mts +0 -3
- package/dist/cn.d.ts +0 -3
- package/dist/cn.mjs +0 -7
- package/dist/components/index.d.mts +0 -5
- package/dist/components/index.d.ts +0 -5
- package/dist/components/index.js +0 -261
- package/dist/components/index.mjs +0 -219
- package/dist/components/modal/fullscreen_container.d.mts +0 -7
- package/dist/components/modal/fullscreen_container.d.ts +0 -7
- package/dist/components/modal/fullscreen_container.js +0 -102
- package/dist/components/modal/fullscreen_container.mjs +0 -68
- package/dist/components/modal/hooks.d.mts +0 -18
- package/dist/components/modal/hooks.d.ts +0 -18
- package/dist/components/modal/hooks.js +0 -236
- package/dist/components/modal/hooks.mjs +0 -204
- package/dist/components/modal/index.d.mts +0 -4
- package/dist/components/modal/index.d.ts +0 -4
- package/dist/components/modal/index.js +0 -238
- package/dist/components/modal/index.mjs +0 -203
- package/dist/components/modal/modal.d.mts +0 -13
- package/dist/components/modal/modal.d.ts +0 -13
- package/dist/components/modal/modal.js +0 -155
- package/dist/components/modal/modal.mjs +0 -130
- package/dist/components/styles.d.mts +0 -9
- package/dist/components/styles.d.ts +0 -9
- package/dist/components/styles.js +0 -48
- package/dist/components/styles.mjs +0 -17
- package/dist/date.d.mts +0 -5
- package/dist/date.d.ts +0 -5
- package/dist/date.mjs +0 -29
- package/dist/file/cdn.d.mts +0 -6
- package/dist/file/cdn.d.ts +0 -6
- package/dist/file/cdn.mjs +0 -9
- package/dist/file/client/drop_file_input.d.mts +0 -36
- package/dist/file/client/drop_file_input.d.ts +0 -36
- package/dist/file/client/drop_file_input.js +0 -323
- package/dist/file/client/drop_file_input.mjs +0 -294
- package/dist/file/client/file_upload_button.d.mts +0 -10
- package/dist/file/client/file_upload_button.d.ts +0 -10
- package/dist/file/client/file_upload_button.js +0 -89
- package/dist/file/client/file_upload_button.mjs +0 -58
- package/dist/file/client/file_uploader.d.mts +0 -13
- package/dist/file/client/file_uploader.d.ts +0 -13
- package/dist/file/client/file_uploader.js +0 -163
- package/dist/file/client/file_uploader.mjs +0 -136
- package/dist/file/client/format_size.d.mts +0 -3
- package/dist/file/client/format_size.d.ts +0 -3
- package/dist/file/client/format_size.mjs +0 -13
- package/dist/file/client/metadata.d.mts +0 -7
- package/dist/file/client/metadata.d.ts +0 -7
- package/dist/file/client/metadata.js +0 -85
- package/dist/file/client/metadata.mjs +0 -60
- package/dist/file/file_repository.d.mts +0 -16
- package/dist/file/file_repository.d.ts +0 -16
- package/dist/file/file_repository.js +0 -18
- package/dist/file/file_repository.mjs +0 -0
- package/dist/file/file_service.d.mts +0 -32
- package/dist/file/file_service.d.ts +0 -32
- package/dist/file/file_service.js +0 -66
- package/dist/file/file_service.mjs +0 -41
- package/dist/file/handlers/delete_file.d.mts +0 -17
- package/dist/file/handlers/delete_file.d.ts +0 -17
- package/dist/file/handlers/delete_file.js +0 -99
- package/dist/file/handlers/delete_file.mjs +0 -72
- package/dist/file/handlers/upload_file.d.mts +0 -16
- package/dist/file/handlers/upload_file.d.ts +0 -16
- package/dist/file/handlers/upload_file.js +0 -106
- package/dist/file/handlers/upload_file.mjs +0 -79
- package/dist/file/object_storage.d.mts +0 -19
- package/dist/file/object_storage.d.ts +0 -19
- package/dist/file/object_storage.js +0 -78
- package/dist/file/object_storage.mjs +0 -57
- package/dist/file/responsive_image.d.mts +0 -20
- package/dist/file/responsive_image.d.ts +0 -20
- package/dist/file/responsive_image.js +0 -132
- package/dist/file/responsive_image.mjs +0 -96
- package/dist/http/response.d.mts +0 -19
- package/dist/http/response.d.ts +0 -19
- package/dist/http/response.js +0 -109
- package/dist/http/response.mjs +0 -68
- package/dist/route/api.d.mts +0 -21
- package/dist/route/api.d.ts +0 -21
- package/dist/route/api.js +0 -584
- package/dist/route/api.mjs +0 -547
- package/dist/singleton.d.mts +0 -3
- package/dist/singleton.d.ts +0 -3
- package/dist/singleton.js +0 -37
- package/dist/singleton.mjs +0 -12
- package/dist/sleep.d.mts +0 -3
- package/dist/sleep.d.ts +0 -3
- package/dist/sleep.mjs +0 -7
- package/dist/slug.d.mts +0 -3
- package/dist/slug.d.ts +0 -3
- package/dist/slug.mjs +0 -7
- package/dist/text_editor/attach_media.d.mts +0 -16
- package/dist/text_editor/attach_media.d.ts +0 -16
- package/dist/text_editor/attach_media.js +0 -237
- package/dist/text_editor/attach_media.mjs +0 -210
- package/dist/text_editor/plugins/drag_and_drop.d.mts +0 -13
- package/dist/text_editor/plugins/drag_and_drop.d.ts +0 -13
- package/dist/text_editor/plugins/drag_and_drop.js +0 -59
- package/dist/text_editor/plugins/drag_and_drop.mjs +0 -34
- package/dist/text_editor/plugins/keymap.d.mts +0 -5
- package/dist/text_editor/plugins/keymap.d.ts +0 -5
- package/dist/text_editor/plugins/keymap.js +0 -40
- package/dist/text_editor/plugins/keymap.mjs +0 -15
- package/dist/text_editor/plugins/placehoder.d.mts +0 -5
- package/dist/text_editor/plugins/placehoder.d.ts +0 -5
- package/dist/text_editor/plugins/placehoder.js +0 -112
- package/dist/text_editor/plugins/placehoder.mjs +0 -87
- package/dist/text_editor/plugins/trailing_paragraph.d.mts +0 -5
- package/dist/text_editor/plugins/trailing_paragraph.d.ts +0 -5
- package/dist/text_editor/plugins/trailing_paragraph.js +0 -46
- package/dist/text_editor/plugins/trailing_paragraph.mjs +0 -21
- package/dist/text_editor/plugins/upload_placeholder.d.mts +0 -7
- package/dist/text_editor/plugins/upload_placeholder.d.ts +0 -7
- package/dist/text_editor/plugins/upload_placeholder.js +0 -94
- package/dist/text_editor/plugins/upload_placeholder.mjs +0 -68
- package/dist/text_editor/schema.d.mts +0 -9
- package/dist/text_editor/schema.d.ts +0 -9
- package/dist/text_editor/schema.js +0 -354
- package/dist/text_editor/schema.mjs +0 -319
- package/dist/text_editor/text_editor.d.mts +0 -44
- package/dist/text_editor/text_editor.d.ts +0 -44
- package/dist/text_editor/text_editor.js +0 -830
- package/dist/text_editor/text_editor.mjs +0 -802
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/text_editor/plugins/placehoder.tsx
|
|
21
|
-
var placehoder_exports = {};
|
|
22
|
-
__export(placehoder_exports, {
|
|
23
|
-
placeholderPlugin: () => placeholderPlugin
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(placehoder_exports);
|
|
26
|
-
var import_prosemirror_state2 = require("prosemirror-state");
|
|
27
|
-
|
|
28
|
-
// src/text_editor/plugins/upload_placeholder.tsx
|
|
29
|
-
var import_prosemirror_state = require("prosemirror-state");
|
|
30
|
-
var import_prosemirror_view = require("prosemirror-view");
|
|
31
|
-
var uploadPlaceholderPlugin = new import_prosemirror_state.Plugin({
|
|
32
|
-
state: {
|
|
33
|
-
init() {
|
|
34
|
-
return import_prosemirror_view.DecorationSet.empty;
|
|
35
|
-
},
|
|
36
|
-
apply(tr, set) {
|
|
37
|
-
set = set.map(tr.mapping, tr.doc);
|
|
38
|
-
const action = tr.getMeta(this);
|
|
39
|
-
if (action && action.add) {
|
|
40
|
-
const { type, width, height } = action.add;
|
|
41
|
-
const widget = document.createElement("div");
|
|
42
|
-
widget.className = "upload-placeholder";
|
|
43
|
-
widget.style.width = `100%`;
|
|
44
|
-
if (type.startsWith("image/") || type.startsWith("video/")) {
|
|
45
|
-
widget.style.aspectRatio = `${width} / ${height}`;
|
|
46
|
-
widget.style.maxWidth = `${width}px`;
|
|
47
|
-
} else {
|
|
48
|
-
widget.style.height = "80px";
|
|
49
|
-
}
|
|
50
|
-
const progress = document.createElement("div");
|
|
51
|
-
progress.className = "upload-progress";
|
|
52
|
-
widget.appendChild(progress);
|
|
53
|
-
const deco = import_prosemirror_view.Decoration.widget(action.add.pos, widget, {
|
|
54
|
-
id: action.add.id
|
|
55
|
-
});
|
|
56
|
-
set = set.add(tr.doc, [deco]);
|
|
57
|
-
} else if (action && action.progress) {
|
|
58
|
-
const found = set.find(
|
|
59
|
-
void 0,
|
|
60
|
-
void 0,
|
|
61
|
-
(spec) => spec.id === action.progress.id
|
|
62
|
-
);
|
|
63
|
-
if (found.length) {
|
|
64
|
-
const widget = found[0].type.toDOM;
|
|
65
|
-
const progress = widget.querySelector(".upload-progress");
|
|
66
|
-
if (progress) {
|
|
67
|
-
progress.innerHTML = `${Math.round(action.progress.progress)}%`;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
} else if (action && action.remove) {
|
|
71
|
-
set = set.remove(
|
|
72
|
-
set.find(void 0, void 0, (spec) => spec.id === action.remove.id)
|
|
73
|
-
);
|
|
74
|
-
}
|
|
75
|
-
return set;
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
props: {
|
|
79
|
-
decorations(state) {
|
|
80
|
-
return this.getState(state);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
// src/text_editor/plugins/placehoder.tsx
|
|
86
|
-
var getFirstChildDescendants = (view) => {
|
|
87
|
-
const nodes = [];
|
|
88
|
-
view.state.doc?.descendants((n) => {
|
|
89
|
-
nodes.push(n);
|
|
90
|
-
});
|
|
91
|
-
return nodes;
|
|
92
|
-
};
|
|
93
|
-
function placeholderPlugin(text) {
|
|
94
|
-
const update = (view) => {
|
|
95
|
-
const decos = uploadPlaceholderPlugin.getState(view.state);
|
|
96
|
-
if (decos && decos.find().length > 0 || view.state.doc.content.content.some((e) => e.type.name !== "paragraph") || view.state.doc.childCount > 1 || getFirstChildDescendants(view).length > 1 || view.state.doc.textContent) {
|
|
97
|
-
view.dom.removeAttribute("data-placeholder");
|
|
98
|
-
} else {
|
|
99
|
-
view.dom.setAttribute("data-placeholder", text);
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
return new import_prosemirror_state2.Plugin({
|
|
103
|
-
view(view) {
|
|
104
|
-
update(view);
|
|
105
|
-
return { update };
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
110
|
-
0 && (module.exports = {
|
|
111
|
-
placeholderPlugin
|
|
112
|
-
});
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
// src/text_editor/plugins/placehoder.tsx
|
|
2
|
-
import { Plugin as Plugin2 } from "prosemirror-state";
|
|
3
|
-
|
|
4
|
-
// src/text_editor/plugins/upload_placeholder.tsx
|
|
5
|
-
import { Plugin } from "prosemirror-state";
|
|
6
|
-
import { Decoration, DecorationSet } from "prosemirror-view";
|
|
7
|
-
var uploadPlaceholderPlugin = new Plugin({
|
|
8
|
-
state: {
|
|
9
|
-
init() {
|
|
10
|
-
return DecorationSet.empty;
|
|
11
|
-
},
|
|
12
|
-
apply(tr, set) {
|
|
13
|
-
set = set.map(tr.mapping, tr.doc);
|
|
14
|
-
const action = tr.getMeta(this);
|
|
15
|
-
if (action && action.add) {
|
|
16
|
-
const { type, width, height } = action.add;
|
|
17
|
-
const widget = document.createElement("div");
|
|
18
|
-
widget.className = "upload-placeholder";
|
|
19
|
-
widget.style.width = `100%`;
|
|
20
|
-
if (type.startsWith("image/") || type.startsWith("video/")) {
|
|
21
|
-
widget.style.aspectRatio = `${width} / ${height}`;
|
|
22
|
-
widget.style.maxWidth = `${width}px`;
|
|
23
|
-
} else {
|
|
24
|
-
widget.style.height = "80px";
|
|
25
|
-
}
|
|
26
|
-
const progress = document.createElement("div");
|
|
27
|
-
progress.className = "upload-progress";
|
|
28
|
-
widget.appendChild(progress);
|
|
29
|
-
const deco = Decoration.widget(action.add.pos, widget, {
|
|
30
|
-
id: action.add.id
|
|
31
|
-
});
|
|
32
|
-
set = set.add(tr.doc, [deco]);
|
|
33
|
-
} else if (action && action.progress) {
|
|
34
|
-
const found = set.find(
|
|
35
|
-
void 0,
|
|
36
|
-
void 0,
|
|
37
|
-
(spec) => spec.id === action.progress.id
|
|
38
|
-
);
|
|
39
|
-
if (found.length) {
|
|
40
|
-
const widget = found[0].type.toDOM;
|
|
41
|
-
const progress = widget.querySelector(".upload-progress");
|
|
42
|
-
if (progress) {
|
|
43
|
-
progress.innerHTML = `${Math.round(action.progress.progress)}%`;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
} else if (action && action.remove) {
|
|
47
|
-
set = set.remove(
|
|
48
|
-
set.find(void 0, void 0, (spec) => spec.id === action.remove.id)
|
|
49
|
-
);
|
|
50
|
-
}
|
|
51
|
-
return set;
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
props: {
|
|
55
|
-
decorations(state) {
|
|
56
|
-
return this.getState(state);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
// src/text_editor/plugins/placehoder.tsx
|
|
62
|
-
var getFirstChildDescendants = (view) => {
|
|
63
|
-
const nodes = [];
|
|
64
|
-
view.state.doc?.descendants((n) => {
|
|
65
|
-
nodes.push(n);
|
|
66
|
-
});
|
|
67
|
-
return nodes;
|
|
68
|
-
};
|
|
69
|
-
function placeholderPlugin(text) {
|
|
70
|
-
const update = (view) => {
|
|
71
|
-
const decos = uploadPlaceholderPlugin.getState(view.state);
|
|
72
|
-
if (decos && decos.find().length > 0 || view.state.doc.content.content.some((e) => e.type.name !== "paragraph") || view.state.doc.childCount > 1 || getFirstChildDescendants(view).length > 1 || view.state.doc.textContent) {
|
|
73
|
-
view.dom.removeAttribute("data-placeholder");
|
|
74
|
-
} else {
|
|
75
|
-
view.dom.setAttribute("data-placeholder", text);
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
return new Plugin2({
|
|
79
|
-
view(view) {
|
|
80
|
-
update(view);
|
|
81
|
-
return { update };
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
export {
|
|
86
|
-
placeholderPlugin
|
|
87
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/text_editor/plugins/trailing_paragraph.tsx
|
|
21
|
-
var trailing_paragraph_exports = {};
|
|
22
|
-
__export(trailing_paragraph_exports, {
|
|
23
|
-
trailingParagraph: () => trailingParagraph
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(trailing_paragraph_exports);
|
|
26
|
-
var import_prosemirror_state = require("prosemirror-state");
|
|
27
|
-
function trailingParagraph() {
|
|
28
|
-
return new import_prosemirror_state.Plugin({
|
|
29
|
-
appendTransaction(transactions, oldState, newState) {
|
|
30
|
-
const doc = newState.doc;
|
|
31
|
-
const lastNode = doc.lastChild;
|
|
32
|
-
if (lastNode && lastNode.type.name !== "paragraph") {
|
|
33
|
-
const paragraphType = newState.schema.nodes.paragraph;
|
|
34
|
-
const tr = newState.tr;
|
|
35
|
-
const endPos = doc.content.size;
|
|
36
|
-
tr.insert(endPos, paragraphType.create());
|
|
37
|
-
return tr;
|
|
38
|
-
}
|
|
39
|
-
return null;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
-
0 && (module.exports = {
|
|
45
|
-
trailingParagraph
|
|
46
|
-
});
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// src/text_editor/plugins/trailing_paragraph.tsx
|
|
2
|
-
import { Plugin } from "prosemirror-state";
|
|
3
|
-
function trailingParagraph() {
|
|
4
|
-
return new Plugin({
|
|
5
|
-
appendTransaction(transactions, oldState, newState) {
|
|
6
|
-
const doc = newState.doc;
|
|
7
|
-
const lastNode = doc.lastChild;
|
|
8
|
-
if (lastNode && lastNode.type.name !== "paragraph") {
|
|
9
|
-
const paragraphType = newState.schema.nodes.paragraph;
|
|
10
|
-
const tr = newState.tr;
|
|
11
|
-
const endPos = doc.content.size;
|
|
12
|
-
tr.insert(endPos, paragraphType.create());
|
|
13
|
-
return tr;
|
|
14
|
-
}
|
|
15
|
-
return null;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
export {
|
|
20
|
-
trailingParagraph
|
|
21
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Plugin, EditorState } from 'prosemirror-state';
|
|
2
|
-
import { DecorationSet } from 'prosemirror-view';
|
|
3
|
-
|
|
4
|
-
declare const uploadPlaceholderPlugin: Plugin<DecorationSet>;
|
|
5
|
-
declare const findPlaceholder: (state: EditorState, id: unknown) => number | null;
|
|
6
|
-
|
|
7
|
-
export { findPlaceholder, uploadPlaceholderPlugin };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Plugin, EditorState } from 'prosemirror-state';
|
|
2
|
-
import { DecorationSet } from 'prosemirror-view';
|
|
3
|
-
|
|
4
|
-
declare const uploadPlaceholderPlugin: Plugin<DecorationSet>;
|
|
5
|
-
declare const findPlaceholder: (state: EditorState, id: unknown) => number | null;
|
|
6
|
-
|
|
7
|
-
export { findPlaceholder, uploadPlaceholderPlugin };
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/text_editor/plugins/upload_placeholder.tsx
|
|
21
|
-
var upload_placeholder_exports = {};
|
|
22
|
-
__export(upload_placeholder_exports, {
|
|
23
|
-
findPlaceholder: () => findPlaceholder,
|
|
24
|
-
uploadPlaceholderPlugin: () => uploadPlaceholderPlugin
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(upload_placeholder_exports);
|
|
27
|
-
var import_prosemirror_state = require("prosemirror-state");
|
|
28
|
-
var import_prosemirror_view = require("prosemirror-view");
|
|
29
|
-
var uploadPlaceholderPlugin = new import_prosemirror_state.Plugin({
|
|
30
|
-
state: {
|
|
31
|
-
init() {
|
|
32
|
-
return import_prosemirror_view.DecorationSet.empty;
|
|
33
|
-
},
|
|
34
|
-
apply(tr, set) {
|
|
35
|
-
set = set.map(tr.mapping, tr.doc);
|
|
36
|
-
const action = tr.getMeta(this);
|
|
37
|
-
if (action && action.add) {
|
|
38
|
-
const { type, width, height } = action.add;
|
|
39
|
-
const widget = document.createElement("div");
|
|
40
|
-
widget.className = "upload-placeholder";
|
|
41
|
-
widget.style.width = `100%`;
|
|
42
|
-
if (type.startsWith("image/") || type.startsWith("video/")) {
|
|
43
|
-
widget.style.aspectRatio = `${width} / ${height}`;
|
|
44
|
-
widget.style.maxWidth = `${width}px`;
|
|
45
|
-
} else {
|
|
46
|
-
widget.style.height = "80px";
|
|
47
|
-
}
|
|
48
|
-
const progress = document.createElement("div");
|
|
49
|
-
progress.className = "upload-progress";
|
|
50
|
-
widget.appendChild(progress);
|
|
51
|
-
const deco = import_prosemirror_view.Decoration.widget(action.add.pos, widget, {
|
|
52
|
-
id: action.add.id
|
|
53
|
-
});
|
|
54
|
-
set = set.add(tr.doc, [deco]);
|
|
55
|
-
} else if (action && action.progress) {
|
|
56
|
-
const found = set.find(
|
|
57
|
-
void 0,
|
|
58
|
-
void 0,
|
|
59
|
-
(spec) => spec.id === action.progress.id
|
|
60
|
-
);
|
|
61
|
-
if (found.length) {
|
|
62
|
-
const widget = found[0].type.toDOM;
|
|
63
|
-
const progress = widget.querySelector(".upload-progress");
|
|
64
|
-
if (progress) {
|
|
65
|
-
progress.innerHTML = `${Math.round(action.progress.progress)}%`;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
} else if (action && action.remove) {
|
|
69
|
-
set = set.remove(
|
|
70
|
-
set.find(void 0, void 0, (spec) => spec.id === action.remove.id)
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
return set;
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
props: {
|
|
77
|
-
decorations(state) {
|
|
78
|
-
return this.getState(state);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
var findPlaceholder = (state, id) => {
|
|
83
|
-
const decos = uploadPlaceholderPlugin.getState(state);
|
|
84
|
-
if (!decos) {
|
|
85
|
-
return null;
|
|
86
|
-
}
|
|
87
|
-
const found = decos.find(void 0, void 0, (spec) => spec.id === id);
|
|
88
|
-
return found.length ? found[0].from : null;
|
|
89
|
-
};
|
|
90
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
91
|
-
0 && (module.exports = {
|
|
92
|
-
findPlaceholder,
|
|
93
|
-
uploadPlaceholderPlugin
|
|
94
|
-
});
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
// src/text_editor/plugins/upload_placeholder.tsx
|
|
2
|
-
import { Plugin } from "prosemirror-state";
|
|
3
|
-
import { Decoration, DecorationSet } from "prosemirror-view";
|
|
4
|
-
var uploadPlaceholderPlugin = new Plugin({
|
|
5
|
-
state: {
|
|
6
|
-
init() {
|
|
7
|
-
return DecorationSet.empty;
|
|
8
|
-
},
|
|
9
|
-
apply(tr, set) {
|
|
10
|
-
set = set.map(tr.mapping, tr.doc);
|
|
11
|
-
const action = tr.getMeta(this);
|
|
12
|
-
if (action && action.add) {
|
|
13
|
-
const { type, width, height } = action.add;
|
|
14
|
-
const widget = document.createElement("div");
|
|
15
|
-
widget.className = "upload-placeholder";
|
|
16
|
-
widget.style.width = `100%`;
|
|
17
|
-
if (type.startsWith("image/") || type.startsWith("video/")) {
|
|
18
|
-
widget.style.aspectRatio = `${width} / ${height}`;
|
|
19
|
-
widget.style.maxWidth = `${width}px`;
|
|
20
|
-
} else {
|
|
21
|
-
widget.style.height = "80px";
|
|
22
|
-
}
|
|
23
|
-
const progress = document.createElement("div");
|
|
24
|
-
progress.className = "upload-progress";
|
|
25
|
-
widget.appendChild(progress);
|
|
26
|
-
const deco = Decoration.widget(action.add.pos, widget, {
|
|
27
|
-
id: action.add.id
|
|
28
|
-
});
|
|
29
|
-
set = set.add(tr.doc, [deco]);
|
|
30
|
-
} else if (action && action.progress) {
|
|
31
|
-
const found = set.find(
|
|
32
|
-
void 0,
|
|
33
|
-
void 0,
|
|
34
|
-
(spec) => spec.id === action.progress.id
|
|
35
|
-
);
|
|
36
|
-
if (found.length) {
|
|
37
|
-
const widget = found[0].type.toDOM;
|
|
38
|
-
const progress = widget.querySelector(".upload-progress");
|
|
39
|
-
if (progress) {
|
|
40
|
-
progress.innerHTML = `${Math.round(action.progress.progress)}%`;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
} else if (action && action.remove) {
|
|
44
|
-
set = set.remove(
|
|
45
|
-
set.find(void 0, void 0, (spec) => spec.id === action.remove.id)
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
return set;
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
props: {
|
|
52
|
-
decorations(state) {
|
|
53
|
-
return this.getState(state);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
var findPlaceholder = (state, id) => {
|
|
58
|
-
const decos = uploadPlaceholderPlugin.getState(state);
|
|
59
|
-
if (!decos) {
|
|
60
|
-
return null;
|
|
61
|
-
}
|
|
62
|
-
const found = decos.find(void 0, void 0, (spec) => spec.id === id);
|
|
63
|
-
return found.length ? found[0].from : null;
|
|
64
|
-
};
|
|
65
|
-
export {
|
|
66
|
-
findPlaceholder,
|
|
67
|
-
uploadPlaceholderPlugin
|
|
68
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as orderedmap from 'orderedmap';
|
|
2
|
-
import * as prosemirror_model from 'prosemirror-model';
|
|
3
|
-
import { Schema } from 'prosemirror-model';
|
|
4
|
-
|
|
5
|
-
declare function createSchema({ cdnOrigin }: {
|
|
6
|
-
cdnOrigin?: string;
|
|
7
|
-
}): Schema<keyof orderedmap.default<prosemirror_model.NodeSpec>, keyof orderedmap.default<prosemirror_model.MarkSpec>>;
|
|
8
|
-
|
|
9
|
-
export { createSchema };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as orderedmap from 'orderedmap';
|
|
2
|
-
import * as prosemirror_model from 'prosemirror-model';
|
|
3
|
-
import { Schema } from 'prosemirror-model';
|
|
4
|
-
|
|
5
|
-
declare function createSchema({ cdnOrigin }: {
|
|
6
|
-
cdnOrigin?: string;
|
|
7
|
-
}): Schema<keyof orderedmap.default<prosemirror_model.NodeSpec>, keyof orderedmap.default<prosemirror_model.MarkSpec>>;
|
|
8
|
-
|
|
9
|
-
export { createSchema };
|