pukaad-ui-lib 1.277.0 → 1.278.0

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/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pukaad-ui-lib",
3
3
  "configKey": "pukaadUI",
4
- "version": "1.277.0",
4
+ "version": "1.278.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -34,7 +34,7 @@
34
34
  />
35
35
 
36
36
  <!-- <InputCheckbox
37
- name="disableComment"
37
+ name="disableComment"โโห
38
38
  label="ไม่อนุญาตให้แสดงความคิดเห็น"
39
39
  v-model="form.disableComment"
40
40
  /> -->
@@ -149,26 +149,42 @@ const onSaveDraft = async () => {
149
149
  emit("success", res.data);
150
150
  isOpen.value = false;
151
151
  } catch (error) {
152
- $toast.error(error?.data?.message?.description || "\u0E1A\u0E31\u0E19\u0E17\u0E36\u0E01\u0E41\u0E1A\u0E1A\u0E23\u0E48\u0E32\u0E07\u0E44\u0E21\u0E48\u0E2A\u0E33\u0E40\u0E23\u0E47\u0E08");
152
+ $toast.error(
153
+ error?.data?.message?.description || "\u0E1A\u0E31\u0E19\u0E17\u0E36\u0E01\u0E41\u0E1A\u0E1A\u0E23\u0E48\u0E32\u0E07\u0E44\u0E21\u0E48\u0E2A\u0E33\u0E40\u0E23\u0E47\u0E08"
154
+ );
153
155
  } finally {
154
156
  isLoading.value = false;
155
157
  }
156
158
  } else {
157
159
  try {
158
- const drafts = JSON.parse(localStorage.getItem("blog_drafts") || "[]");
159
160
  const draftData = {
160
161
  ...form.value,
161
162
  savedAt: (/* @__PURE__ */ new Date()).toISOString(),
162
163
  id: form.value.id || `draft_${Date.now()}`
163
164
  };
164
- const idx = drafts.findIndex((d) => d.id === draftData.id);
165
- if (idx >= 0) drafts[idx] = draftData;
166
- else drafts.unshift(draftData);
167
- localStorage.setItem("blog_drafts", JSON.stringify(drafts));
168
- $toast.success("\u0E1A\u0E31\u0E19\u0E17\u0E36\u0E01\u0E41\u0E1A\u0E1A\u0E23\u0E48\u0E32\u0E07\u0E44\u0E27\u0E49\u0E43\u0E19\u0E40\u0E04\u0E23\u0E37\u0E48\u0E2D\u0E07\u0E2A\u0E33\u0E40\u0E23\u0E47\u0E08");
169
- emit("saveDraft", form.value);
170
- isOpen.value = false;
171
- } catch {
165
+ const request = indexedDB.open("PukaadDraftsDB", 1);
166
+ request.onupgradeneeded = (e) => {
167
+ e.target.result.createObjectStore("blogDrafts", { keyPath: "id" });
168
+ };
169
+ request.onsuccess = (e) => {
170
+ const db = e.target.result;
171
+ const tx = db.transaction("blogDrafts", "readwrite");
172
+ const store = tx.objectStore("blogDrafts");
173
+ store.put(draftData);
174
+ tx.oncomplete = () => {
175
+ $toast.success("\u0E1A\u0E31\u0E19\u0E17\u0E36\u0E01\u0E41\u0E1A\u0E1A\u0E23\u0E48\u0E32\u0E07\u0E44\u0E27\u0E49\u0E43\u0E19\u0E40\u0E04\u0E23\u0E37\u0E48\u0E2D\u0E07\u0E2A\u0E33\u0E40\u0E23\u0E47\u0E08");
176
+ emit("saveDraft", form.value);
177
+ isOpen.value = false;
178
+ };
179
+ tx.onerror = () => {
180
+ $toast.error("\u0E44\u0E21\u0E48\u0E2A\u0E32\u0E21\u0E32\u0E23\u0E16\u0E1A\u0E31\u0E19\u0E17\u0E36\u0E01\u0E41\u0E1A\u0E1A\u0E23\u0E48\u0E32\u0E07\u0E44\u0E14\u0E49");
181
+ };
182
+ };
183
+ request.onerror = () => {
184
+ $toast.error("\u0E44\u0E21\u0E48\u0E2A\u0E32\u0E21\u0E32\u0E23\u0E16\u0E1A\u0E31\u0E19\u0E17\u0E36\u0E01\u0E41\u0E1A\u0E1A\u0E23\u0E48\u0E32\u0E07\u0E44\u0E14\u0E49");
185
+ };
186
+ } catch (e) {
187
+ console.error(e);
172
188
  $toast.error("\u0E44\u0E21\u0E48\u0E2A\u0E32\u0E21\u0E32\u0E23\u0E16\u0E1A\u0E31\u0E19\u0E17\u0E36\u0E01\u0E41\u0E1A\u0E1A\u0E23\u0E48\u0E32\u0E07\u0E44\u0E14\u0E49");
173
189
  }
174
190
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pukaad-ui-lib",
3
- "version": "1.277.0",
3
+ "version": "1.278.0",
4
4
  "description": "pukaad-ui for MeMSG",
5
5
  "repository": {
6
6
  "type": "git",