@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 CHANGED
@@ -5,6 +5,6 @@ declare namespace _default {
5
5
  }
6
6
  export default _default;
7
7
  export function install(app: any): void;
8
- export const version: "1.0.32";
8
+ export const version: "1.0.33";
9
9
  import RichTextEditor from './rich-text-editor';
10
10
  export { RichTextEditor };
package/es/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import RichTextEditor from "./rich-text-editor";
2
- const version = "1.0.32";
2
+ const version = "1.0.33";
3
3
  function install(app) {
4
4
  const components = [
5
5
  RichTextEditor
@@ -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 === "<p></p>") {
167
- return;
168
- }
169
- yield historyStore.setItem(noteId.value, {
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.sort((a, b) => b.timestamp - a.timestamp);
181
- if (metadata.length > MAX_HISTORY_ITEMS) {
182
- const itemsToRemove = metadata.splice(MAX_HISTORY_ITEMS);
183
- for (const item of itemsToRemove) {
184
- yield historyStore.removeItem(item.id);
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
@@ -5,6 +5,6 @@ declare namespace _default {
5
5
  }
6
6
  export default _default;
7
7
  export function install(app: any): void;
8
- export const version: "1.0.32";
8
+ export const version: "1.0.33";
9
9
  import RichTextEditor from './rich-text-editor';
10
10
  export { RichTextEditor };
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.32";
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 === "<p></p>") {
199
- return;
200
- }
201
- yield historyStore.setItem(noteId.value, {
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.sort((a, b) => b.timestamp - a.timestamp);
213
- if (metadata.length > MAX_HISTORY_ITEMS) {
214
- const itemsToRemove = metadata.splice(MAX_HISTORY_ITEMS);
215
- for (const item of itemsToRemove) {
216
- yield historyStore.removeItem(item.id);
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cgboiler/biz-basic",
3
- "version": "1.0.33",
3
+ "version": "1.0.34",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",