@cgboiler/biz-basic 1.0.28 → 1.0.29
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/RichTextEditor.js +16 -15
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/rich-text-editor/RichTextEditor.js +16 -15
- package/package.json +1 -1
package/es/index.d.ts
CHANGED
package/es/index.js
CHANGED
|
@@ -141,24 +141,18 @@ var stdin_default = defineComponent({
|
|
|
141
141
|
};
|
|
142
142
|
const HISTORY_METADATA_KEY = "rich_text_editor_history_metadata";
|
|
143
143
|
const MAX_HISTORY_ITEMS = 10;
|
|
144
|
-
let
|
|
144
|
+
let saveTimeoutId = null;
|
|
145
145
|
const noteId = ref("");
|
|
146
146
|
const historyStore = localforage.createInstance({
|
|
147
147
|
name: "RichTextEditorHistory",
|
|
148
148
|
storeName: "notes"
|
|
149
149
|
});
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
const now = /* @__PURE__ */ new Date();
|
|
153
|
-
const formattedTime = `${now.toLocaleDateString()} ${now.toLocaleTimeString()}`;
|
|
154
|
-
noteId.value = `note-${now.getTime()}`;
|
|
155
|
-
const noteTitle = `\u7B14\u8BB0 at ${formattedTime}`;
|
|
156
|
-
saveIntervalId = setInterval(() => __async(this, null, function* () {
|
|
157
|
-
if (!editor.value || editor.value.isDestroyed || !editor.value.isEditable) {
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
150
|
+
const saveLoop = () => __async(this, null, function* () {
|
|
151
|
+
if (editor.value && !editor.value.isDestroyed && editor.value.isEditable) {
|
|
160
152
|
const content = editor.value.getHTML();
|
|
161
|
-
|
|
153
|
+
const now = /* @__PURE__ */ new Date();
|
|
154
|
+
const formattedTime = `${now.toLocaleDateString()} ${now.toLocaleTimeString()}`;
|
|
155
|
+
const noteTitle = `\u7B14\u8BB0 at ${formattedTime}`;
|
|
162
156
|
yield historyStore.setItem(noteId.value, {
|
|
163
157
|
title: noteTitle,
|
|
164
158
|
content
|
|
@@ -179,7 +173,14 @@ var stdin_default = defineComponent({
|
|
|
179
173
|
}
|
|
180
174
|
yield historyStore.setItem(HISTORY_METADATA_KEY, metadata);
|
|
181
175
|
}
|
|
182
|
-
}
|
|
176
|
+
}
|
|
177
|
+
saveTimeoutId = setTimeout(saveLoop, 1e4);
|
|
178
|
+
});
|
|
179
|
+
onMounted(() => {
|
|
180
|
+
initEditor();
|
|
181
|
+
const now = /* @__PURE__ */ new Date();
|
|
182
|
+
noteId.value = `note-${now.getTime()}`;
|
|
183
|
+
saveLoop();
|
|
183
184
|
nextTick(() => {
|
|
184
185
|
var _a, _b;
|
|
185
186
|
const editorElement = (_b = (_a = editor.value) == null ? void 0 : _a.view) == null ? void 0 : _b.dom;
|
|
@@ -190,8 +191,8 @@ var stdin_default = defineComponent({
|
|
|
190
191
|
});
|
|
191
192
|
onBeforeUnmount(() => {
|
|
192
193
|
var _a, _b, _c;
|
|
193
|
-
if (
|
|
194
|
-
|
|
194
|
+
if (saveTimeoutId) {
|
|
195
|
+
clearTimeout(saveTimeoutId);
|
|
195
196
|
}
|
|
196
197
|
const editorElement = (_b = (_a = editor.value) == null ? void 0 : _a.view) == null ? void 0 : _b.dom;
|
|
197
198
|
if (editorElement) {
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -36,7 +36,7 @@ __export(stdin_exports, {
|
|
|
36
36
|
module.exports = __toCommonJS(stdin_exports);
|
|
37
37
|
var import_rich_text_editor = __toESM(require("./rich-text-editor"));
|
|
38
38
|
__reExport(stdin_exports, require("./rich-text-editor"), module.exports);
|
|
39
|
-
const version = "1.0.
|
|
39
|
+
const version = "1.0.28";
|
|
40
40
|
function install(app) {
|
|
41
41
|
const components = [
|
|
42
42
|
import_rich_text_editor.default
|
|
@@ -173,24 +173,18 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
173
173
|
};
|
|
174
174
|
const HISTORY_METADATA_KEY = "rich_text_editor_history_metadata";
|
|
175
175
|
const MAX_HISTORY_ITEMS = 10;
|
|
176
|
-
let
|
|
176
|
+
let saveTimeoutId = null;
|
|
177
177
|
const noteId = (0, import_vue2.ref)("");
|
|
178
178
|
const historyStore = import_localforage.default.createInstance({
|
|
179
179
|
name: "RichTextEditorHistory",
|
|
180
180
|
storeName: "notes"
|
|
181
181
|
});
|
|
182
|
-
(
|
|
183
|
-
|
|
184
|
-
const now = /* @__PURE__ */ new Date();
|
|
185
|
-
const formattedTime = `${now.toLocaleDateString()} ${now.toLocaleTimeString()}`;
|
|
186
|
-
noteId.value = `note-${now.getTime()}`;
|
|
187
|
-
const noteTitle = `\u7B14\u8BB0 at ${formattedTime}`;
|
|
188
|
-
saveIntervalId = setInterval(() => __async(this, null, function* () {
|
|
189
|
-
if (!editor.value || editor.value.isDestroyed || !editor.value.isEditable) {
|
|
190
|
-
return;
|
|
191
|
-
}
|
|
182
|
+
const saveLoop = () => __async(this, null, function* () {
|
|
183
|
+
if (editor.value && !editor.value.isDestroyed && editor.value.isEditable) {
|
|
192
184
|
const content = editor.value.getHTML();
|
|
193
|
-
|
|
185
|
+
const now = /* @__PURE__ */ new Date();
|
|
186
|
+
const formattedTime = `${now.toLocaleDateString()} ${now.toLocaleTimeString()}`;
|
|
187
|
+
const noteTitle = `\u7B14\u8BB0 at ${formattedTime}`;
|
|
194
188
|
yield historyStore.setItem(noteId.value, {
|
|
195
189
|
title: noteTitle,
|
|
196
190
|
content
|
|
@@ -211,7 +205,14 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
211
205
|
}
|
|
212
206
|
yield historyStore.setItem(HISTORY_METADATA_KEY, metadata);
|
|
213
207
|
}
|
|
214
|
-
}
|
|
208
|
+
}
|
|
209
|
+
saveTimeoutId = setTimeout(saveLoop, 1e4);
|
|
210
|
+
});
|
|
211
|
+
(0, import_vue2.onMounted)(() => {
|
|
212
|
+
initEditor();
|
|
213
|
+
const now = /* @__PURE__ */ new Date();
|
|
214
|
+
noteId.value = `note-${now.getTime()}`;
|
|
215
|
+
saveLoop();
|
|
215
216
|
(0, import_vue2.nextTick)(() => {
|
|
216
217
|
var _a, _b;
|
|
217
218
|
const editorElement = (_b = (_a = editor.value) == null ? void 0 : _a.view) == null ? void 0 : _b.dom;
|
|
@@ -222,8 +223,8 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
222
223
|
});
|
|
223
224
|
(0, import_vue2.onBeforeUnmount)(() => {
|
|
224
225
|
var _a, _b, _c;
|
|
225
|
-
if (
|
|
226
|
-
|
|
226
|
+
if (saveTimeoutId) {
|
|
227
|
+
clearTimeout(saveTimeoutId);
|
|
227
228
|
}
|
|
228
229
|
const editorElement = (_b = (_a = editor.value) == null ? void 0 : _a.view) == null ? void 0 : _b.dom;
|
|
229
230
|
if (editorElement) {
|