@cgboiler/biz-basic 1.0.33 → 1.0.34
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 +18 -19
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/rich-text-editor/RichTextEditor.js +18 -19
- package/package.json +1 -1
package/es/index.d.ts
CHANGED
package/es/index.js
CHANGED
|
@@ -163,28 +163,27 @@ var stdin_default = defineComponent({
|
|
|
163
163
|
const now = /* @__PURE__ */ new Date();
|
|
164
164
|
const formattedTime = `${now.toLocaleDateString()} ${now.toLocaleTimeString()}`;
|
|
165
165
|
const noteTitle = `\u7B14\u8BB0 at ${formattedTime}`;
|
|
166
|
-
if (content
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
title: noteTitle,
|
|
171
|
-
content
|
|
172
|
-
});
|
|
173
|
-
let metadata = (yield historyStore.getItem(HISTORY_METADATA_KEY)) || [];
|
|
174
|
-
const existingNoteIndex = metadata.findIndex((meta) => meta.id === noteId.value);
|
|
175
|
-
if (existingNoteIndex === -1) {
|
|
176
|
-
metadata.push({
|
|
177
|
-
id: noteId.value,
|
|
178
|
-
timestamp: now.getTime()
|
|
166
|
+
if (content !== "<p></p>") {
|
|
167
|
+
yield historyStore.setItem(noteId.value, {
|
|
168
|
+
title: noteTitle,
|
|
169
|
+
content
|
|
179
170
|
});
|
|
180
|
-
metadata
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
171
|
+
let metadata = (yield historyStore.getItem(HISTORY_METADATA_KEY)) || [];
|
|
172
|
+
const existingNoteIndex = metadata.findIndex((meta) => meta.id === noteId.value);
|
|
173
|
+
if (existingNoteIndex === -1) {
|
|
174
|
+
metadata.push({
|
|
175
|
+
id: noteId.value,
|
|
176
|
+
timestamp: now.getTime()
|
|
177
|
+
});
|
|
178
|
+
metadata.sort((a, b) => b.timestamp - a.timestamp);
|
|
179
|
+
if (metadata.length > MAX_HISTORY_ITEMS) {
|
|
180
|
+
const itemsToRemove = metadata.splice(MAX_HISTORY_ITEMS);
|
|
181
|
+
for (const item of itemsToRemove) {
|
|
182
|
+
yield historyStore.removeItem(item.id);
|
|
183
|
+
}
|
|
185
184
|
}
|
|
185
|
+
yield historyStore.setItem(HISTORY_METADATA_KEY, metadata);
|
|
186
186
|
}
|
|
187
|
-
yield historyStore.setItem(HISTORY_METADATA_KEY, metadata);
|
|
188
187
|
}
|
|
189
188
|
}
|
|
190
189
|
saveTimeoutId = setTimeout(saveLoop, 1e4);
|
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.33";
|
|
40
40
|
function install(app) {
|
|
41
41
|
const components = [
|
|
42
42
|
import_rich_text_editor.default
|
|
@@ -195,28 +195,27 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
195
195
|
const now = /* @__PURE__ */ new Date();
|
|
196
196
|
const formattedTime = `${now.toLocaleDateString()} ${now.toLocaleTimeString()}`;
|
|
197
197
|
const noteTitle = `\u7B14\u8BB0 at ${formattedTime}`;
|
|
198
|
-
if (content
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
title: noteTitle,
|
|
203
|
-
content
|
|
204
|
-
});
|
|
205
|
-
let metadata = (yield historyStore.getItem(HISTORY_METADATA_KEY)) || [];
|
|
206
|
-
const existingNoteIndex = metadata.findIndex((meta) => meta.id === noteId.value);
|
|
207
|
-
if (existingNoteIndex === -1) {
|
|
208
|
-
metadata.push({
|
|
209
|
-
id: noteId.value,
|
|
210
|
-
timestamp: now.getTime()
|
|
198
|
+
if (content !== "<p></p>") {
|
|
199
|
+
yield historyStore.setItem(noteId.value, {
|
|
200
|
+
title: noteTitle,
|
|
201
|
+
content
|
|
211
202
|
});
|
|
212
|
-
metadata
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
203
|
+
let metadata = (yield historyStore.getItem(HISTORY_METADATA_KEY)) || [];
|
|
204
|
+
const existingNoteIndex = metadata.findIndex((meta) => meta.id === noteId.value);
|
|
205
|
+
if (existingNoteIndex === -1) {
|
|
206
|
+
metadata.push({
|
|
207
|
+
id: noteId.value,
|
|
208
|
+
timestamp: now.getTime()
|
|
209
|
+
});
|
|
210
|
+
metadata.sort((a, b) => b.timestamp - a.timestamp);
|
|
211
|
+
if (metadata.length > MAX_HISTORY_ITEMS) {
|
|
212
|
+
const itemsToRemove = metadata.splice(MAX_HISTORY_ITEMS);
|
|
213
|
+
for (const item of itemsToRemove) {
|
|
214
|
+
yield historyStore.removeItem(item.id);
|
|
215
|
+
}
|
|
217
216
|
}
|
|
217
|
+
yield historyStore.setItem(HISTORY_METADATA_KEY, metadata);
|
|
218
218
|
}
|
|
219
|
-
yield historyStore.setItem(HISTORY_METADATA_KEY, metadata);
|
|
220
219
|
}
|
|
221
220
|
}
|
|
222
221
|
saveTimeoutId = setTimeout(saveLoop, 1e4);
|