@cgboiler/biz-mobile 1.18.4 → 1.18.5-beta
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/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/md-preview/index.less +101 -101
- package/es/org-picker/OrgPicker.d.ts +3 -3
- package/es/org-picker/OrgPicker.js +5 -19
- package/es/org-picker/_atomic.css +0 -1
- package/es/org-picker/index.less +181 -181
- package/es/org-picker/types.d.ts +2 -2
- package/es/org-picker/useApi.d.ts +7 -7
- package/es/org-picker/useApi.js +9 -16
- package/es/org-picker/useSearch.d.ts +2 -2
- package/es/org-picker/useSearch.js +21 -32
- package/es/project-select/index.less +45 -45
- package/es/rich-text-editor/RichTextEditor.js +61 -6
- package/es/rich-text-editor/_atomic.css +2 -0
- package/es/rich-text-editor/index.css +1 -0
- package/es/rich-text-editor/index.less +191 -0
- package/es/vue-sfc-shim.d.ts +8 -8
- package/es/vue-tsx-shim.d.ts +24 -24
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/md-preview/index.less +101 -101
- package/lib/org-picker/OrgPicker.d.ts +3 -3
- package/lib/org-picker/OrgPicker.js +5 -19
- package/lib/org-picker/_atomic.css +0 -1
- package/lib/org-picker/index.less +181 -181
- package/lib/org-picker/types.d.ts +2 -2
- package/lib/org-picker/useApi.d.ts +7 -7
- package/lib/org-picker/useApi.js +8 -15
- package/lib/org-picker/useSearch.d.ts +2 -2
- package/lib/org-picker/useSearch.js +20 -31
- package/lib/project-select/index.less +45 -45
- package/lib/rich-text-editor/RichTextEditor.js +70 -5
- package/lib/rich-text-editor/_atomic.css +2 -0
- package/lib/rich-text-editor/index.css +1 -0
- package/lib/rich-text-editor/index.less +191 -0
- package/lib/vue-sfc-shim.d.ts +8 -8
- package/lib/vue-tsx-shim.d.ts +24 -24
- package/package.json +68 -68
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ExtractPropTypes, PropType } from 'vue';
|
|
2
2
|
export interface OrgItem {
|
|
3
|
-
id: string;
|
|
3
|
+
id: string | number;
|
|
4
4
|
name: string;
|
|
5
5
|
type: string;
|
|
6
6
|
avatar?: string;
|
|
@@ -8,7 +8,7 @@ export interface OrgItem {
|
|
|
8
8
|
}
|
|
9
9
|
export declare const orgPickerProps: {
|
|
10
10
|
modelValue: {
|
|
11
|
-
type: PropType<(string)[] | null>;
|
|
11
|
+
type: PropType<(string | number)[] | null>;
|
|
12
12
|
default: () => null;
|
|
13
13
|
};
|
|
14
14
|
show: {
|
|
@@ -2,39 +2,39 @@ import { type OrgItem, RecentSelection } from './types';
|
|
|
2
2
|
export declare const useApi: () => {
|
|
3
3
|
userList: import("vue").Ref<{
|
|
4
4
|
[x: string]: any;
|
|
5
|
-
id: string;
|
|
5
|
+
id: string | number;
|
|
6
6
|
name: string;
|
|
7
7
|
type: string;
|
|
8
8
|
avatar?: string | undefined;
|
|
9
9
|
}[], OrgItem[] | {
|
|
10
10
|
[x: string]: any;
|
|
11
|
-
id: string;
|
|
11
|
+
id: string | number;
|
|
12
12
|
name: string;
|
|
13
13
|
type: string;
|
|
14
14
|
avatar?: string | undefined;
|
|
15
15
|
}[]>;
|
|
16
16
|
orgList: import("vue").Ref<{
|
|
17
17
|
[x: string]: any;
|
|
18
|
-
id: string;
|
|
18
|
+
id: string | number;
|
|
19
19
|
name: string;
|
|
20
20
|
type: string;
|
|
21
21
|
avatar?: string | undefined;
|
|
22
22
|
}[], OrgItem[] | {
|
|
23
23
|
[x: string]: any;
|
|
24
|
-
id: string;
|
|
24
|
+
id: string | number;
|
|
25
25
|
name: string;
|
|
26
26
|
type: string;
|
|
27
27
|
avatar?: string | undefined;
|
|
28
28
|
}[]>;
|
|
29
29
|
orgSearchList: import("vue").Ref<{
|
|
30
30
|
[x: string]: any;
|
|
31
|
-
id: string;
|
|
31
|
+
id: string | number;
|
|
32
32
|
name: string;
|
|
33
33
|
type: string;
|
|
34
34
|
avatar?: string | undefined;
|
|
35
35
|
}[], OrgItem[] | {
|
|
36
36
|
[x: string]: any;
|
|
37
|
-
id: string;
|
|
37
|
+
id: string | number;
|
|
38
38
|
name: string;
|
|
39
39
|
type: string;
|
|
40
40
|
avatar?: string | undefined;
|
|
@@ -55,5 +55,5 @@ export declare const useApi: () => {
|
|
|
55
55
|
searchOrgList: import("lodash-es").DebouncedFunc<(userName: string) => Promise<void>>;
|
|
56
56
|
getRecentSelectedUsers: () => Promise<RecentSelection[]>;
|
|
57
57
|
setRecentSelectedUsers: (users: OrgItem[]) => Promise<void>;
|
|
58
|
-
getUserInfoById: (id: string | number) =>
|
|
58
|
+
getUserInfoById: (id: string | number) => string;
|
|
59
59
|
};
|
package/lib/org-picker/useApi.js
CHANGED
|
@@ -59,13 +59,6 @@ const fetchOrgList = (deptId) => __async(void 0, null, function* () {
|
|
|
59
59
|
return fetchData(url, deptId || "");
|
|
60
60
|
});
|
|
61
61
|
const userList = (0, import_vue.ref)([]);
|
|
62
|
-
const userMap = (0, import_vue.computed)(() => {
|
|
63
|
-
const map = /* @__PURE__ */ new Map();
|
|
64
|
-
userList.value.forEach((item) => {
|
|
65
|
-
map.set(item.id, item);
|
|
66
|
-
});
|
|
67
|
-
return map;
|
|
68
|
-
});
|
|
69
62
|
function initUserList() {
|
|
70
63
|
return __async(this, null, function* () {
|
|
71
64
|
userList.value = yield (0, import_core.getUserList)();
|
|
@@ -93,13 +86,7 @@ const useApi = () => {
|
|
|
93
86
|
}
|
|
94
87
|
}
|
|
95
88
|
const list = yield fetchOrgList(currentDeptId.value);
|
|
96
|
-
orgList.value = list
|
|
97
|
-
var _a;
|
|
98
|
-
if (item.type === "user") {
|
|
99
|
-
return ((_a = userMap.value.get(item.id)) == null ? void 0 : _a.status) !== 5;
|
|
100
|
-
}
|
|
101
|
-
return true;
|
|
102
|
-
}) || [];
|
|
89
|
+
orgList.value = list || [];
|
|
103
90
|
});
|
|
104
91
|
const searchOrgList = (0, import_lodash_es.debounce)((userName) => __async(void 0, null, function* () {
|
|
105
92
|
if (!userName) {
|
|
@@ -261,7 +248,13 @@ const useApi = () => {
|
|
|
261
248
|
}
|
|
262
249
|
});
|
|
263
250
|
const getUserInfoById = (id) => {
|
|
264
|
-
|
|
251
|
+
let name = "";
|
|
252
|
+
userList.value.forEach((item) => {
|
|
253
|
+
if (item.id === id) {
|
|
254
|
+
name = item.name;
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
return name;
|
|
265
258
|
};
|
|
266
259
|
return {
|
|
267
260
|
userList,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare function useSearch(
|
|
1
|
+
export declare function useSearch(props: any, api: any): {
|
|
2
2
|
keyword: import("vue").Ref<string, string>;
|
|
3
3
|
searchRef: import("vue").Ref<any, any>;
|
|
4
4
|
setRecentUsers: (users: any[]) => Promise<void>;
|
|
@@ -7,5 +7,5 @@ export declare function useSearch({ props, api, isSearchFocus }: any): {
|
|
|
7
7
|
filteredOrgList: import("vue").ComputedRef<any>;
|
|
8
8
|
recentSelectedHistory: import("vue").Ref<any[], any[]>;
|
|
9
9
|
filterRecentSelectedHistory: import("vue").Ref<any[], any[]>;
|
|
10
|
-
highlightText: (text:
|
|
10
|
+
highlightText: (text: string | number, keyword: string) => string | number | (string | import("vue/jsx-runtime").JSX.Element)[];
|
|
11
11
|
};
|
|
@@ -44,12 +44,7 @@ var import_vue = require("vue");
|
|
|
44
44
|
var import_atomic = require("./_atomic.css");
|
|
45
45
|
var import_vue2 = require("vue");
|
|
46
46
|
var import_vant = require("vant");
|
|
47
|
-
|
|
48
|
-
function useSearch({
|
|
49
|
-
props,
|
|
50
|
-
api,
|
|
51
|
-
isSearchFocus
|
|
52
|
-
}) {
|
|
47
|
+
function useSearch(props, api) {
|
|
53
48
|
const {
|
|
54
49
|
orgSearchList,
|
|
55
50
|
getOrgList,
|
|
@@ -77,10 +72,7 @@ function useSearch({
|
|
|
77
72
|
});
|
|
78
73
|
(0, import_vue2.watchEffect)(() => {
|
|
79
74
|
if (keyword.value) {
|
|
80
|
-
filterRecentSelectedHistory.value = recentSelectedHistory.value.filter((item) => item.selectedUsers.some((user) => keyword.value.split("").some((char) =>
|
|
81
|
-
var _a;
|
|
82
|
-
return (_a = getUserInfoById(user.id)) == null ? void 0 : _a.name.includes(char);
|
|
83
|
-
})));
|
|
75
|
+
filterRecentSelectedHistory.value = recentSelectedHistory.value.filter((item) => item.selectedUsers.some((user) => keyword.value.split("").some((char) => getUserInfoById(user.id).includes(char))));
|
|
84
76
|
} else {
|
|
85
77
|
filterRecentSelectedHistory.value = recentSelectedHistory.value;
|
|
86
78
|
}
|
|
@@ -122,37 +114,34 @@ function useSearch({
|
|
|
122
114
|
handleSelect
|
|
123
115
|
}) => {
|
|
124
116
|
return (0, import_vue.createVNode)("div", {
|
|
125
|
-
"class": "absolute top-0 left-0 right-0 bottom-0 bg-[#fff] z-1
|
|
126
|
-
}, [filterRecentSelectedHistory.value.length
|
|
117
|
+
"class": "absolute top-0 left-0 right-0 bottom-0 bg-[#fff] z-1"
|
|
118
|
+
}, [filterRecentSelectedHistory.value.length ? (0, import_vue.createVNode)(import_vue.Fragment, null, [(0, import_vue.createVNode)("p", {
|
|
127
119
|
"class": "text-[14px] text-[#333] font-bold px-[16px] py-[12px] border-b border-[#eee]"
|
|
128
120
|
}, [(0, import_vue.createTextVNode)("\u6700\u8FD1\u9009\u62E9")]), (0, import_vue.createVNode)("div", {
|
|
129
|
-
"class": "recent-list-wrap flex-1 py-[8px]"
|
|
121
|
+
"class": "recent-list-wrap flex-1 overflow-auto py-[8px]"
|
|
130
122
|
}, [filterRecentSelectedHistory.value.map((historyItem) => (0, import_vue.createVNode)("div", {
|
|
131
123
|
"key": historyItem.id,
|
|
132
124
|
"onClick": () => handleHistorySelect(historyItem),
|
|
133
125
|
"class": "px-16px py-8px border-b border-[#eee]"
|
|
134
|
-
}, [(0, import_vue.createVNode)("span", null, [historyItem.selectedUsers.map((user) => {
|
|
135
|
-
var _a;
|
|
136
|
-
return highlightText((_a = getUserInfoById(user.id)) == null ? void 0 : _a.name, keyword.value);
|
|
137
|
-
}).reduce((prev, curr) => [prev, "\uFF0C", curr])])]))])]) : "", filteredOrgList.value.length ? (0, import_vue.createVNode)(import_vue.Fragment, null, [" ", (0, import_vue.createVNode)("p", {
|
|
126
|
+
}, [(0, import_vue.createVNode)("span", null, [historyItem.selectedUsers.map((user) => highlightText(getUserInfoById(user.id), keyword.value)).reduce((prev, curr) => [prev, "\uFF0C", curr])])]))])]) : "", filteredOrgList.value.length ? (0, import_vue.createVNode)(import_vue.Fragment, null, [" ", (0, import_vue.createVNode)("p", {
|
|
138
127
|
"class": "text-[14px] text-[#333] font-bold px-[16px] py-[12px] border-b border-[#eee]"
|
|
139
128
|
}, [(0, import_vue.createTextVNode)("\u901A\u8BAF\u5F55")]), (0, import_vue.createVNode)("div", {
|
|
140
|
-
"class": "
|
|
129
|
+
"class": "feed-list-wrap"
|
|
141
130
|
}, [filteredOrgList.value.length === 0 ? (0, import_vue.createVNode)(import_vant.Empty, {
|
|
142
131
|
"description": "\u672A\u627E\u5230\u76F8\u5173\u4EBA\u5458"
|
|
143
|
-
}, null) : (0, import_vue.createVNode)(
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
"
|
|
151
|
-
|
|
152
|
-
"
|
|
153
|
-
|
|
154
|
-
"
|
|
155
|
-
}
|
|
132
|
+
}, null) : (0, import_vue.createVNode)(import_vant.List, null, {
|
|
133
|
+
default: () => [filteredOrgList.value.map((item) => (0, import_vue.createVNode)("div", {
|
|
134
|
+
"class": ["org-item", isSelected(item) ? "selected" : ""],
|
|
135
|
+
"onClick": () => handleSelect(item)
|
|
136
|
+
}, [(0, import_vue.createVNode)(import_vant.Image, {
|
|
137
|
+
"class": "org-avatar",
|
|
138
|
+
"src": item.avatar
|
|
139
|
+
}, null), (0, import_vue.createVNode)("div", {
|
|
140
|
+
"class": "org-name"
|
|
141
|
+
}, [item.name, (0, import_vue.createVNode)("span", {
|
|
142
|
+
"class": "org-item-select-icon"
|
|
143
|
+
}, [(0, import_vue.createTextVNode)("\u2713")])])]))]
|
|
144
|
+
})])]) : ""]);
|
|
156
145
|
};
|
|
157
146
|
return {
|
|
158
147
|
keyword,
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
:root:root {
|
|
2
|
-
--van-action-sheet-max-height: 100%;
|
|
3
|
-
}
|
|
4
|
-
.project-list {
|
|
5
|
-
height: 85vh;
|
|
6
|
-
display: flex;
|
|
7
|
-
flex-direction: column;
|
|
8
|
-
|
|
9
|
-
.search-bar {
|
|
10
|
-
position: sticky;
|
|
11
|
-
top: 0;
|
|
12
|
-
z-index: 1;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.van-list {
|
|
16
|
-
flex: 1;
|
|
17
|
-
overflow-y: auto;
|
|
18
|
-
padding: 0 16px;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.project-item {
|
|
22
|
-
padding: 12px 0;
|
|
23
|
-
border-bottom: 1px solid #eee;
|
|
24
|
-
cursor: pointer;
|
|
25
|
-
|
|
26
|
-
&.selected {
|
|
27
|
-
color: var(--van-primary-color);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.project-name {
|
|
31
|
-
font-size: 14px;
|
|
32
|
-
|
|
33
|
-
.highlight {
|
|
34
|
-
color: var(--van-primary-color);
|
|
35
|
-
font-weight: bold;
|
|
36
|
-
padding: 0 2px;
|
|
37
|
-
border-radius: 2px;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
&:last-child {
|
|
42
|
-
border-bottom: none;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
1
|
+
:root:root {
|
|
2
|
+
--van-action-sheet-max-height: 100%;
|
|
3
|
+
}
|
|
4
|
+
.project-list {
|
|
5
|
+
height: 85vh;
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
|
|
9
|
+
.search-bar {
|
|
10
|
+
position: sticky;
|
|
11
|
+
top: 0;
|
|
12
|
+
z-index: 1;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.van-list {
|
|
16
|
+
flex: 1;
|
|
17
|
+
overflow-y: auto;
|
|
18
|
+
padding: 0 16px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.project-item {
|
|
22
|
+
padding: 12px 0;
|
|
23
|
+
border-bottom: 1px solid #eee;
|
|
24
|
+
cursor: pointer;
|
|
25
|
+
|
|
26
|
+
&.selected {
|
|
27
|
+
color: var(--van-primary-color);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.project-name {
|
|
31
|
+
font-size: 14px;
|
|
32
|
+
|
|
33
|
+
.highlight {
|
|
34
|
+
color: var(--van-primary-color);
|
|
35
|
+
font-weight: bold;
|
|
36
|
+
padding: 0 2px;
|
|
37
|
+
border-radius: 2px;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&:last-child {
|
|
42
|
+
border-bottom: none;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
4
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
7
|
var __export = (target, all) => {
|
|
6
8
|
for (var name in all)
|
|
@@ -14,6 +16,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
14
16
|
}
|
|
15
17
|
return to;
|
|
16
18
|
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
17
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
28
|
var stdin_exports = {};
|
|
19
29
|
__export(stdin_exports, {
|
|
@@ -23,9 +33,12 @@ module.exports = __toCommonJS(stdin_exports);
|
|
|
23
33
|
var import_vue = require("vue");
|
|
24
34
|
var import_atomic = require("./_atomic.css");
|
|
25
35
|
var import_vue2 = require("vue");
|
|
36
|
+
var import_starter_kit = __toESM(require("@tiptap/starter-kit"));
|
|
37
|
+
var import_vue_3 = require("@tiptap/vue-3");
|
|
38
|
+
var import_extension_table = require("@tiptap/extension-table");
|
|
39
|
+
var import_extensions = require("@tiptap/extensions");
|
|
26
40
|
var import_types = require("./types");
|
|
27
41
|
var import_index = require("./index.css");
|
|
28
|
-
var import_biz_basic = require("@cgboiler/biz-basic");
|
|
29
42
|
var stdin_default = (0, import_vue2.defineComponent)({
|
|
30
43
|
name: "RichTextEditor",
|
|
31
44
|
props: import_types.richTextEditorProps,
|
|
@@ -33,10 +46,62 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
33
46
|
setup(props, {
|
|
34
47
|
emit
|
|
35
48
|
}) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
49
|
+
const editor = (0, import_vue2.ref)();
|
|
50
|
+
const addTableRow = () => {
|
|
51
|
+
var _a;
|
|
52
|
+
(_a = editor.value) == null ? void 0 : _a.chain().focus().addRowAfter().run();
|
|
53
|
+
};
|
|
54
|
+
const deleteTableRow = () => {
|
|
55
|
+
var _a;
|
|
56
|
+
(_a = editor.value) == null ? void 0 : _a.chain().focus().deleteRow().run();
|
|
57
|
+
};
|
|
58
|
+
const setTextFormat = (level) => {
|
|
59
|
+
var _a, _b;
|
|
60
|
+
if (level === 0) {
|
|
61
|
+
(_a = editor.value) == null ? void 0 : _a.chain().focus().setParagraph().run();
|
|
62
|
+
} else {
|
|
63
|
+
(_b = editor.value) == null ? void 0 : _b.chain().focus().toggleHeading({
|
|
64
|
+
level
|
|
65
|
+
}).run();
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
const showTableButtons = (0, import_vue2.ref)(false);
|
|
69
|
+
(0, import_vue2.onMounted)(() => {
|
|
70
|
+
editor.value = new import_vue_3.Editor({
|
|
71
|
+
extensions: [import_starter_kit.default, import_extension_table.TableKit.configure({
|
|
72
|
+
table: {
|
|
73
|
+
resizable: true
|
|
74
|
+
}
|
|
75
|
+
}), import_extensions.Placeholder.configure({
|
|
76
|
+
placeholder: props.placeholder
|
|
77
|
+
})],
|
|
78
|
+
content: props.modelValue,
|
|
79
|
+
onUpdate: ({
|
|
80
|
+
editor: editor2
|
|
81
|
+
}) => {
|
|
82
|
+
const html = editor2.getHTML();
|
|
83
|
+
emit("update:modelValue", html);
|
|
84
|
+
},
|
|
85
|
+
onSelectionUpdate: ({
|
|
86
|
+
editor: editor2
|
|
87
|
+
}) => {
|
|
88
|
+
showTableButtons.value = editor2.isActive("table");
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
(0, import_vue2.watch)(() => props.modelValue, (newValue) => {
|
|
93
|
+
var _a, _b;
|
|
94
|
+
if (((_a = editor.value) == null ? void 0 : _a.getHTML()) !== newValue) {
|
|
95
|
+
(_b = editor.value) == null ? void 0 : _b.commands.setContent(newValue || "");
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
(0, import_vue2.onBeforeUnmount)(() => {
|
|
99
|
+
var _a;
|
|
100
|
+
(_a = editor.value) == null ? void 0 : _a.destroy();
|
|
101
|
+
});
|
|
102
|
+
return () => (0, import_vue.createVNode)(import_vue_3.EditorContent, {
|
|
103
|
+
"class": "ProseMirror",
|
|
104
|
+
"editor": editor.value
|
|
40
105
|
}, null);
|
|
41
106
|
}
|
|
42
107
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ProseMirror{flex:1;overflow:auto;outline:none;line-height:1.6;font-size:var(--font-base);--white: #fff;--black: #2e2b29;--black-contrast: #110f0e;--gray-1: rgba(61, 37, 20, .05);--gray-2: rgba(61, 37, 20, .08);--gray-3: rgba(61, 37, 20, .12);--gray-4: rgba(53, 38, 28, .3);--gray-5: rgba(28, 25, 23, .6);--green: #22c55e;--purple: #6a00f5;--purple-contrast: #5800cc;--purple-light: rgba(88, 5, 255, .05);--yellow-contrast: #facc15;--yellow: rgba(250, 204, 21, .4);--yellow-light: #fffae5;--red: #ff5c33;--red-light: #ffebe5;--shadow: 0px 12px 33px 0px rgba(0, 0, 0, .06), 0px 3.618px 9.949px 0px rgba(0, 0, 0, .04)}.ProseMirror :first-child{margin-top:0}.ProseMirror ul,.ProseMirror ol{padding:0 1rem;margin:1.25rem 1rem 1.25rem .4rem}.ProseMirror ul li p,.ProseMirror ol li p{margin-top:.25em;margin-bottom:.25em}.ProseMirror h1,.ProseMirror h2,.ProseMirror h3,.ProseMirror h4,.ProseMirror h5,.ProseMirror h6{line-height:1.1;margin-top:2.5rem;text-wrap:pretty}.ProseMirror h1,.ProseMirror h2{margin-top:3.5rem;margin-bottom:1.5rem}.ProseMirror h1{font-size:1.4rem}.ProseMirror h2{font-size:1.2rem}.ProseMirror h3{font-size:1.1rem}.ProseMirror h4,.ProseMirror h5,.ProseMirror h6{font-size:1rem}.ProseMirror code{background-color:var(--purple-light);border-radius:.4rem;color:var(--black);font-size:.85rem;padding:.25em .3em}.ProseMirror pre{background:var(--black);border-radius:.5rem;color:var(--white);font-family:JetBrainsMono,monospace;margin:1.5rem 0;padding:.75rem 1rem}.ProseMirror pre code{background:none;color:inherit;font-size:.8rem;padding:0}.ProseMirror blockquote{border-left:3px solid var(--gray-3);margin:1.5rem 0;padding-left:1rem}.ProseMirror hr{border:none;border-top:1px solid var(--gray-2);margin:2rem 0}.ProseMirror p.is-editor-empty:first-child:before{color:var(--gray-4);content:attr(data-placeholder);float:left;height:0;pointer-events:none}.ProseMirror .is-empty:before{color:var(--gray-4);content:attr(data-placeholder);float:left;height:0;pointer-events:none}.ProseMirror table{border-collapse:collapse;margin:0;overflow:hidden;table-layout:fixed;width:100%}.ProseMirror table td,.ProseMirror table th{border:1px solid var(--gray-3);box-sizing:border-box;min-width:1em;padding:6px 8px;position:relative;vertical-align:top}.ProseMirror table td>*,.ProseMirror table th>*{margin-bottom:0}.ProseMirror table th{background-color:var(--gray-1);font-weight:700;text-align:left}.ProseMirror table .selectedCell:after{background:var(--gray-2);content:"";left:0;right:0;top:0;bottom:0;pointer-events:none;position:absolute;z-index:2}.ProseMirror table .column-resize-handle{background-color:var(--purple);bottom:-2px;pointer-events:none;position:absolute;right:-2px;top:0;width:4px}.ProseMirror .tableWrapper{margin:1.5rem 0;overflow-x:auto}.ProseMirror.resize-cursor{cursor:ew-resize;cursor:col-resize}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
.ProseMirror {
|
|
2
|
+
flex: 1;
|
|
3
|
+
overflow: auto;
|
|
4
|
+
outline: none;
|
|
5
|
+
|
|
6
|
+
line-height: 1.6;
|
|
7
|
+
font-size: var(--font-base);
|
|
8
|
+
--white: #fff;
|
|
9
|
+
--black: #2e2b29;
|
|
10
|
+
--black-contrast: #110f0e;
|
|
11
|
+
--gray-1: rgba(61, 37, 20, 0.05);
|
|
12
|
+
--gray-2: rgba(61, 37, 20, 0.08);
|
|
13
|
+
--gray-3: rgba(61, 37, 20, 0.12);
|
|
14
|
+
--gray-4: rgba(53, 38, 28, 0.3);
|
|
15
|
+
--gray-5: rgba(28, 25, 23, 0.6);
|
|
16
|
+
--green: #22c55e;
|
|
17
|
+
--purple: #6a00f5;
|
|
18
|
+
--purple-contrast: #5800cc;
|
|
19
|
+
--purple-light: rgba(88, 5, 255, 0.05);
|
|
20
|
+
--yellow-contrast: #facc15;
|
|
21
|
+
--yellow: rgba(250, 204, 21, 0.4);
|
|
22
|
+
--yellow-light: #fffae5;
|
|
23
|
+
--red: #ff5c33;
|
|
24
|
+
--red-light: #ffebe5;
|
|
25
|
+
--shadow: 0px 12px 33px 0px rgba(0, 0, 0, 0.06), 0px 3.618px 9.949px 0px rgba(0, 0, 0, 0.04);
|
|
26
|
+
:first-child {
|
|
27
|
+
margin-top: 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* List styles */
|
|
31
|
+
ul,
|
|
32
|
+
ol {
|
|
33
|
+
padding: 0 1rem;
|
|
34
|
+
margin: 1.25rem 1rem 1.25rem 0.4rem;
|
|
35
|
+
|
|
36
|
+
li p {
|
|
37
|
+
margin-top: 0.25em;
|
|
38
|
+
margin-bottom: 0.25em;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* Heading styles */
|
|
43
|
+
h1,
|
|
44
|
+
h2,
|
|
45
|
+
h3,
|
|
46
|
+
h4,
|
|
47
|
+
h5,
|
|
48
|
+
h6 {
|
|
49
|
+
line-height: 1.1;
|
|
50
|
+
margin-top: 2.5rem;
|
|
51
|
+
text-wrap: pretty;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
h1,
|
|
55
|
+
h2 {
|
|
56
|
+
margin-top: 3.5rem;
|
|
57
|
+
margin-bottom: 1.5rem;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
h1 {
|
|
61
|
+
font-size: 1.4rem;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
h2 {
|
|
65
|
+
font-size: 1.2rem;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
h3 {
|
|
69
|
+
font-size: 1.1rem;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
h4,
|
|
73
|
+
h5,
|
|
74
|
+
h6 {
|
|
75
|
+
font-size: 1rem;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/* Code and preformatted text styles */
|
|
79
|
+
code {
|
|
80
|
+
background-color: var(--purple-light);
|
|
81
|
+
border-radius: 0.4rem;
|
|
82
|
+
color: var(--black);
|
|
83
|
+
font-size: 0.85rem;
|
|
84
|
+
padding: 0.25em 0.3em;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
pre {
|
|
88
|
+
background: var(--black);
|
|
89
|
+
border-radius: 0.5rem;
|
|
90
|
+
color: var(--white);
|
|
91
|
+
font-family: 'JetBrainsMono', monospace;
|
|
92
|
+
margin: 1.5rem 0;
|
|
93
|
+
padding: 0.75rem 1rem;
|
|
94
|
+
|
|
95
|
+
code {
|
|
96
|
+
background: none;
|
|
97
|
+
color: inherit;
|
|
98
|
+
font-size: 0.8rem;
|
|
99
|
+
padding: 0;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
blockquote {
|
|
104
|
+
border-left: 3px solid var(--gray-3);
|
|
105
|
+
margin: 1.5rem 0;
|
|
106
|
+
padding-left: 1rem;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
hr {
|
|
110
|
+
border: none;
|
|
111
|
+
border-top: 1px solid var(--gray-2);
|
|
112
|
+
margin: 2rem 0;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/* Placeholder (at the top) */
|
|
116
|
+
p.is-editor-empty:first-child::before {
|
|
117
|
+
color: var(--gray-4);
|
|
118
|
+
content: attr(data-placeholder);
|
|
119
|
+
float: left;
|
|
120
|
+
height: 0;
|
|
121
|
+
pointer-events: none;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.is-empty::before {
|
|
125
|
+
color: var(--gray-4);
|
|
126
|
+
content: attr(data-placeholder);
|
|
127
|
+
float: left;
|
|
128
|
+
height: 0;
|
|
129
|
+
pointer-events: none;
|
|
130
|
+
}
|
|
131
|
+
/* Table-specific styling */
|
|
132
|
+
table {
|
|
133
|
+
border-collapse: collapse;
|
|
134
|
+
margin: 0;
|
|
135
|
+
overflow: hidden;
|
|
136
|
+
table-layout: fixed;
|
|
137
|
+
width: 100%;
|
|
138
|
+
|
|
139
|
+
td,
|
|
140
|
+
th {
|
|
141
|
+
border: 1px solid var(--gray-3);
|
|
142
|
+
box-sizing: border-box;
|
|
143
|
+
min-width: 1em;
|
|
144
|
+
padding: 6px 8px;
|
|
145
|
+
position: relative;
|
|
146
|
+
vertical-align: top;
|
|
147
|
+
|
|
148
|
+
> * {
|
|
149
|
+
margin-bottom: 0;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
th {
|
|
154
|
+
background-color: var(--gray-1);
|
|
155
|
+
font-weight: bold;
|
|
156
|
+
text-align: left;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.selectedCell:after {
|
|
160
|
+
background: var(--gray-2);
|
|
161
|
+
content: '';
|
|
162
|
+
left: 0;
|
|
163
|
+
right: 0;
|
|
164
|
+
top: 0;
|
|
165
|
+
bottom: 0;
|
|
166
|
+
pointer-events: none;
|
|
167
|
+
position: absolute;
|
|
168
|
+
z-index: 2;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.column-resize-handle {
|
|
172
|
+
background-color: var(--purple);
|
|
173
|
+
bottom: -2px;
|
|
174
|
+
pointer-events: none;
|
|
175
|
+
position: absolute;
|
|
176
|
+
right: -2px;
|
|
177
|
+
top: 0;
|
|
178
|
+
width: 4px;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.tableWrapper {
|
|
183
|
+
margin: 1.5rem 0;
|
|
184
|
+
overflow-x: auto;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
&.resize-cursor {
|
|
188
|
+
cursor: ew-resize;
|
|
189
|
+
cursor: col-resize;
|
|
190
|
+
}
|
|
191
|
+
}
|
package/lib/vue-sfc-shim.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
declare module '*.vue' {
|
|
2
|
-
// eslint-disable-next-line
|
|
3
|
-
import { DefineComponent } from 'vue'
|
|
4
|
-
const Component: DefineComponent
|
|
5
|
-
export default Component
|
|
6
|
-
}
|
|
7
|
-
declare module "marked";
|
|
8
|
-
declare module "katex";
|
|
1
|
+
declare module '*.vue' {
|
|
2
|
+
// eslint-disable-next-line
|
|
3
|
+
import { DefineComponent } from 'vue'
|
|
4
|
+
const Component: DefineComponent
|
|
5
|
+
export default Component
|
|
6
|
+
}
|
|
7
|
+
declare module "marked";
|
|
8
|
+
declare module "katex";
|
|
9
9
|
declare module "diff-match-patch";
|
package/lib/vue-tsx-shim.d.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import 'vue';
|
|
2
|
-
|
|
3
|
-
type EventHandler = (...args: any[]) => void;
|
|
4
|
-
|
|
5
|
-
declare module 'vue' {
|
|
6
|
-
interface ComponentCustomProps {
|
|
7
|
-
id?: string;
|
|
8
|
-
role?: string;
|
|
9
|
-
tabindex?: number;
|
|
10
|
-
onClick?: EventHandler;
|
|
11
|
-
onTouchend?: EventHandler;
|
|
12
|
-
onTouchmove?: EventHandler;
|
|
13
|
-
onTouchstart?: EventHandler;
|
|
14
|
-
onTouchcancel?: EventHandler;
|
|
15
|
-
onTouchmovePassive?: EventHandler;
|
|
16
|
-
onTouchstartPassive?: EventHandler;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
interface HTMLAttributes {
|
|
20
|
-
onTouchmovePassive?: EventHandler;
|
|
21
|
-
onTouchstartPassive?: EventHandler;
|
|
22
|
-
onClickCapture?: EventHandler;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
1
|
+
import 'vue';
|
|
2
|
+
|
|
3
|
+
type EventHandler = (...args: any[]) => void;
|
|
4
|
+
|
|
5
|
+
declare module 'vue' {
|
|
6
|
+
interface ComponentCustomProps {
|
|
7
|
+
id?: string;
|
|
8
|
+
role?: string;
|
|
9
|
+
tabindex?: number;
|
|
10
|
+
onClick?: EventHandler;
|
|
11
|
+
onTouchend?: EventHandler;
|
|
12
|
+
onTouchmove?: EventHandler;
|
|
13
|
+
onTouchstart?: EventHandler;
|
|
14
|
+
onTouchcancel?: EventHandler;
|
|
15
|
+
onTouchmovePassive?: EventHandler;
|
|
16
|
+
onTouchstartPassive?: EventHandler;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface HTMLAttributes {
|
|
20
|
+
onTouchmovePassive?: EventHandler;
|
|
21
|
+
onTouchstartPassive?: EventHandler;
|
|
22
|
+
onClickCapture?: EventHandler;
|
|
23
|
+
}
|
|
24
|
+
}
|