@cgboiler/biz-basic 1.0.65 → 1.0.67
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/rich-text-editor/extensions/HashTag.js +3 -0
- package/es/rich-text-editor/index.css +1 -1
- package/es/rich-text-editor/index.less +0 -4
- package/es/rich-text-editor/menu-system/styles/animations.less +91 -91
- package/es/rich-text-editor/menu-system/styles/button-colors.less +142 -142
- package/es/rich-text-editor/menu-system/styles/button-group.less +23 -23
- package/es/rich-text-editor/menu-system/styles/button.less +322 -322
- package/es/rich-text-editor/menu-system/styles/card.less +78 -78
- package/es/rich-text-editor/menu-system/styles/color-highlight-button.less +57 -57
- package/es/rich-text-editor/menu-system/styles/color-highlight-popover.less +51 -51
- package/es/rich-text-editor/menu-system/styles/dropdown-menu.less +40 -40
- package/es/rich-text-editor/menu-system/styles/image-upload-node.less +240 -240
- package/es/rich-text-editor/menu-system/styles/input.less +53 -53
- package/es/rich-text-editor/menu-system/styles/link-popover.less +32 -32
- package/es/rich-text-editor/menu-system/styles/separator.less +26 -26
- package/es/rich-text-editor/menu-system/styles/simple-editor.less +39 -39
- package/es/rich-text-editor/menu-system/styles/toolbar.less +87 -87
- package/es/rich-text-editor/menu-system/styles/variables.less +294 -294
- package/es/vue-sfc-shim.d.ts +6 -6
- package/es/vue-tsx-shim.d.ts +24 -24
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/rich-text-editor/extensions/HashTag.js +3 -0
- package/lib/rich-text-editor/index.css +1 -1
- package/lib/rich-text-editor/index.less +0 -4
- package/lib/rich-text-editor/menu-system/styles/animations.less +91 -91
- package/lib/rich-text-editor/menu-system/styles/button-colors.less +142 -142
- package/lib/rich-text-editor/menu-system/styles/button-group.less +23 -23
- package/lib/rich-text-editor/menu-system/styles/button.less +322 -322
- package/lib/rich-text-editor/menu-system/styles/card.less +78 -78
- package/lib/rich-text-editor/menu-system/styles/color-highlight-button.less +57 -57
- package/lib/rich-text-editor/menu-system/styles/color-highlight-popover.less +51 -51
- package/lib/rich-text-editor/menu-system/styles/dropdown-menu.less +40 -40
- package/lib/rich-text-editor/menu-system/styles/image-upload-node.less +240 -240
- package/lib/rich-text-editor/menu-system/styles/input.less +53 -53
- package/lib/rich-text-editor/menu-system/styles/link-popover.less +32 -32
- package/lib/rich-text-editor/menu-system/styles/separator.less +26 -26
- package/lib/rich-text-editor/menu-system/styles/simple-editor.less +39 -39
- package/lib/rich-text-editor/menu-system/styles/toolbar.less +87 -87
- package/lib/rich-text-editor/menu-system/styles/variables.less +294 -294
- package/lib/vue-sfc-shim.d.ts +6 -6
- package/lib/vue-tsx-shim.d.ts +24 -24
- package/package.json +1 -1
- package/es/rich-text-editor/index copy 2.css +0 -1
- package/es/rich-text-editor/index copy 2.less +0 -598
- package/es/rich-text-editor/index copy.css +0 -1
- package/es/rich-text-editor/index copy.less +0 -356
- package/es/rich-text-editor/lib/utils.d.ts +0 -123
- package/es/rich-text-editor/lib/utils.js +0 -244
- package/lib/rich-text-editor/index copy 2.css +0 -1
- package/lib/rich-text-editor/index copy 2.less +0 -598
- package/lib/rich-text-editor/index copy.css +0 -1
- package/lib/rich-text-editor/index copy.less +0 -356
- package/lib/rich-text-editor/lib/utils.d.ts +0 -123
- package/lib/rich-text-editor/lib/utils.js +0 -263
|
@@ -1,263 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var __async = (__this, __arguments, generator) => {
|
|
19
|
-
return new Promise((resolve, reject) => {
|
|
20
|
-
var fulfilled = (value) => {
|
|
21
|
-
try {
|
|
22
|
-
step(generator.next(value));
|
|
23
|
-
} catch (e) {
|
|
24
|
-
reject(e);
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
var rejected = (value) => {
|
|
28
|
-
try {
|
|
29
|
-
step(generator.throw(value));
|
|
30
|
-
} catch (e) {
|
|
31
|
-
reject(e);
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
35
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
36
|
-
});
|
|
37
|
-
};
|
|
38
|
-
var stdin_exports = {};
|
|
39
|
-
__export(stdin_exports, {
|
|
40
|
-
MAC_SYMBOLS: () => MAC_SYMBOLS,
|
|
41
|
-
MAX_FILE_SIZE: () => MAX_FILE_SIZE,
|
|
42
|
-
cn: () => cn,
|
|
43
|
-
findNodeAtPosition: () => findNodeAtPosition,
|
|
44
|
-
findNodePosition: () => findNodePosition,
|
|
45
|
-
focusNextNode: () => focusNextNode,
|
|
46
|
-
formatShortcutKey: () => formatShortcutKey,
|
|
47
|
-
handleImageUpload: () => handleImageUpload,
|
|
48
|
-
isAllowedUri: () => isAllowedUri,
|
|
49
|
-
isExtensionAvailable: () => isExtensionAvailable,
|
|
50
|
-
isMac: () => isMac,
|
|
51
|
-
isMarkInSchema: () => isMarkInSchema,
|
|
52
|
-
isNodeInSchema: () => isNodeInSchema,
|
|
53
|
-
isNodeTypeSelected: () => isNodeTypeSelected,
|
|
54
|
-
isValidPosition: () => isValidPosition,
|
|
55
|
-
parseShortcutKeys: () => parseShortcutKeys,
|
|
56
|
-
sanitizeUrl: () => sanitizeUrl
|
|
57
|
-
});
|
|
58
|
-
module.exports = __toCommonJS(stdin_exports);
|
|
59
|
-
var import_state = require("@tiptap/pm/state");
|
|
60
|
-
var import_clsx = require("clsx");
|
|
61
|
-
const MAX_FILE_SIZE = 5 * 1024 * 1024;
|
|
62
|
-
const MAC_SYMBOLS = {
|
|
63
|
-
mod: "\u2318",
|
|
64
|
-
command: "\u2318",
|
|
65
|
-
meta: "\u2318",
|
|
66
|
-
ctrl: "\u2303",
|
|
67
|
-
control: "\u2303",
|
|
68
|
-
alt: "\u2325",
|
|
69
|
-
option: "\u2325",
|
|
70
|
-
shift: "\u21E7",
|
|
71
|
-
backspace: "Del",
|
|
72
|
-
delete: "\u2326",
|
|
73
|
-
enter: "\u23CE",
|
|
74
|
-
escape: "\u238B",
|
|
75
|
-
capslock: "\u21EA"
|
|
76
|
-
};
|
|
77
|
-
function cn(...inputs) {
|
|
78
|
-
return (0, import_clsx.clsx)(inputs);
|
|
79
|
-
}
|
|
80
|
-
function isMac() {
|
|
81
|
-
return typeof navigator !== "undefined" && navigator.platform.toLowerCase().includes("mac");
|
|
82
|
-
}
|
|
83
|
-
const formatShortcutKey = (key, isMac2, capitalize = true) => {
|
|
84
|
-
if (isMac2) {
|
|
85
|
-
const lowerKey = key.toLowerCase();
|
|
86
|
-
return MAC_SYMBOLS[lowerKey] || (capitalize ? key.toUpperCase() : key);
|
|
87
|
-
}
|
|
88
|
-
return capitalize ? key.charAt(0).toUpperCase() + key.slice(1) : key;
|
|
89
|
-
};
|
|
90
|
-
const parseShortcutKeys = (props) => {
|
|
91
|
-
const { shortcutKeys, delimiter = "+", capitalize = true } = props;
|
|
92
|
-
if (!shortcutKeys)
|
|
93
|
-
return [];
|
|
94
|
-
return shortcutKeys.split(delimiter).map((key) => key.trim()).map((key) => formatShortcutKey(key, isMac(), capitalize));
|
|
95
|
-
};
|
|
96
|
-
const isMarkInSchema = (markName, editor) => {
|
|
97
|
-
if (!(editor == null ? void 0 : editor.schema))
|
|
98
|
-
return false;
|
|
99
|
-
return editor.schema.spec.marks.get(markName) !== void 0;
|
|
100
|
-
};
|
|
101
|
-
const isNodeInSchema = (nodeName, editor) => {
|
|
102
|
-
if (!(editor == null ? void 0 : editor.schema))
|
|
103
|
-
return false;
|
|
104
|
-
return editor.schema.spec.nodes.get(nodeName) !== void 0;
|
|
105
|
-
};
|
|
106
|
-
function focusNextNode(editor) {
|
|
107
|
-
const { state, view } = editor;
|
|
108
|
-
const { doc, selection } = state;
|
|
109
|
-
const nextSel = import_state.Selection.findFrom(selection.$to, 1, true);
|
|
110
|
-
if (nextSel) {
|
|
111
|
-
view.dispatch(state.tr.setSelection(nextSel).scrollIntoView());
|
|
112
|
-
return true;
|
|
113
|
-
}
|
|
114
|
-
const paragraphType = state.schema.nodes.paragraph;
|
|
115
|
-
if (!paragraphType) {
|
|
116
|
-
console.warn("No paragraph node type found in schema.");
|
|
117
|
-
return false;
|
|
118
|
-
}
|
|
119
|
-
const end = doc.content.size;
|
|
120
|
-
const para = paragraphType.create();
|
|
121
|
-
let tr = state.tr.insert(end, para);
|
|
122
|
-
const $inside = tr.doc.resolve(end + 1);
|
|
123
|
-
tr = tr.setSelection(import_state.TextSelection.near($inside)).scrollIntoView();
|
|
124
|
-
view.dispatch(tr);
|
|
125
|
-
return true;
|
|
126
|
-
}
|
|
127
|
-
function isValidPosition(pos) {
|
|
128
|
-
return typeof pos === "number" && pos >= 0;
|
|
129
|
-
}
|
|
130
|
-
function isExtensionAvailable(editor, extensionNames) {
|
|
131
|
-
if (!editor)
|
|
132
|
-
return false;
|
|
133
|
-
const names = Array.isArray(extensionNames) ? extensionNames : [extensionNames];
|
|
134
|
-
const found = names.some(
|
|
135
|
-
(name) => editor.extensionManager.extensions.some((ext) => ext.name === name)
|
|
136
|
-
);
|
|
137
|
-
if (!found) {
|
|
138
|
-
console.warn(
|
|
139
|
-
`None of the extensions [${names.join(
|
|
140
|
-
", "
|
|
141
|
-
)}] were found in the editor schema. Ensure they are included in the editor configuration.`
|
|
142
|
-
);
|
|
143
|
-
}
|
|
144
|
-
return found;
|
|
145
|
-
}
|
|
146
|
-
function findNodeAtPosition(editor, position) {
|
|
147
|
-
try {
|
|
148
|
-
const node = editor.state.doc.nodeAt(position);
|
|
149
|
-
if (!node) {
|
|
150
|
-
console.warn(`No node found at position ${position}`);
|
|
151
|
-
return null;
|
|
152
|
-
}
|
|
153
|
-
return node;
|
|
154
|
-
} catch (error) {
|
|
155
|
-
console.error(`Error getting node at position ${position}:`, error);
|
|
156
|
-
return null;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
function findNodePosition(props) {
|
|
160
|
-
var _a;
|
|
161
|
-
const { editor, node, nodePos } = props;
|
|
162
|
-
if (!editor || !((_a = editor.state) == null ? void 0 : _a.doc))
|
|
163
|
-
return null;
|
|
164
|
-
const hasValidNode = node !== void 0 && node !== null;
|
|
165
|
-
const hasValidPos = isValidPosition(nodePos);
|
|
166
|
-
if (!hasValidNode && !hasValidPos) {
|
|
167
|
-
return null;
|
|
168
|
-
}
|
|
169
|
-
if (hasValidNode) {
|
|
170
|
-
let foundPos = -1;
|
|
171
|
-
let foundNode = null;
|
|
172
|
-
editor.state.doc.descendants((currentNode, pos) => {
|
|
173
|
-
if (currentNode === node) {
|
|
174
|
-
foundPos = pos;
|
|
175
|
-
foundNode = currentNode;
|
|
176
|
-
return false;
|
|
177
|
-
}
|
|
178
|
-
return true;
|
|
179
|
-
});
|
|
180
|
-
if (foundPos !== -1 && foundNode !== null) {
|
|
181
|
-
return { pos: foundPos, node: foundNode };
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
if (hasValidPos) {
|
|
185
|
-
const nodeAtPos = findNodeAtPosition(editor, nodePos);
|
|
186
|
-
if (nodeAtPos) {
|
|
187
|
-
return { pos: nodePos, node: nodeAtPos };
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
return null;
|
|
191
|
-
}
|
|
192
|
-
function isNodeTypeSelected(editor, types = []) {
|
|
193
|
-
if (!editor || !editor.state.selection)
|
|
194
|
-
return false;
|
|
195
|
-
const { state } = editor;
|
|
196
|
-
const { selection } = state;
|
|
197
|
-
if (selection.empty)
|
|
198
|
-
return false;
|
|
199
|
-
if (selection instanceof import_state.NodeSelection) {
|
|
200
|
-
const node = selection.node;
|
|
201
|
-
return node ? types.includes(node.type.name) : false;
|
|
202
|
-
}
|
|
203
|
-
return false;
|
|
204
|
-
}
|
|
205
|
-
const handleImageUpload = (file, onProgress, abortSignal) => __async(void 0, null, function* () {
|
|
206
|
-
if (!file) {
|
|
207
|
-
throw new Error("No file provided");
|
|
208
|
-
}
|
|
209
|
-
if (file.size > MAX_FILE_SIZE) {
|
|
210
|
-
throw new Error(`File size exceeds maximum allowed (${MAX_FILE_SIZE / (1024 * 1024)}MB)`);
|
|
211
|
-
}
|
|
212
|
-
for (let progress = 0; progress <= 100; progress += 10) {
|
|
213
|
-
if (abortSignal == null ? void 0 : abortSignal.aborted) {
|
|
214
|
-
throw new Error("Upload cancelled");
|
|
215
|
-
}
|
|
216
|
-
yield new Promise((resolve) => setTimeout(resolve, 500));
|
|
217
|
-
onProgress == null ? void 0 : onProgress({ progress });
|
|
218
|
-
}
|
|
219
|
-
return "/images/tiptap-ui-placeholder-image.jpg";
|
|
220
|
-
});
|
|
221
|
-
const ATTR_WHITESPACE = (
|
|
222
|
-
// eslint-disable-next-line no-control-regex
|
|
223
|
-
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
|
|
224
|
-
);
|
|
225
|
-
function isAllowedUri(uri, protocols) {
|
|
226
|
-
const allowedProtocols = [
|
|
227
|
-
"http",
|
|
228
|
-
"https",
|
|
229
|
-
"ftp",
|
|
230
|
-
"ftps",
|
|
231
|
-
"mailto",
|
|
232
|
-
"tel",
|
|
233
|
-
"callto",
|
|
234
|
-
"sms",
|
|
235
|
-
"cid",
|
|
236
|
-
"xmpp"
|
|
237
|
-
];
|
|
238
|
-
if (protocols) {
|
|
239
|
-
protocols.forEach((protocol) => {
|
|
240
|
-
const nextProtocol = typeof protocol === "string" ? protocol : protocol.scheme;
|
|
241
|
-
if (nextProtocol) {
|
|
242
|
-
allowedProtocols.push(nextProtocol);
|
|
243
|
-
}
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
return !uri || uri.replace(ATTR_WHITESPACE, "").match(
|
|
247
|
-
new RegExp(
|
|
248
|
-
// eslint-disable-next-line no-useless-escape
|
|
249
|
-
`^(?:(?:${allowedProtocols.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,
|
|
250
|
-
"i"
|
|
251
|
-
)
|
|
252
|
-
);
|
|
253
|
-
}
|
|
254
|
-
function sanitizeUrl(inputUrl, baseUrl, protocols) {
|
|
255
|
-
try {
|
|
256
|
-
const url = new URL(inputUrl, baseUrl);
|
|
257
|
-
if (isAllowedUri(url.href, protocols)) {
|
|
258
|
-
return url.href;
|
|
259
|
-
}
|
|
260
|
-
} catch (e) {
|
|
261
|
-
}
|
|
262
|
-
return "#";
|
|
263
|
-
}
|