fw-webbuilder 1.1.152 → 1.1.154

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/index.d.ts CHANGED
@@ -69,7 +69,7 @@ declare class webBuilderService {
69
69
  objects: any;
70
70
  /**
71
71
  * danh sách freeblock(có nhánh)
72
- * */
72
+ */
73
73
  freeblocks: any;
74
74
  /**
75
75
  * chatboxs của trang
@@ -80,11 +80,17 @@ declare class webBuilderService {
80
80
  */
81
81
  device: string | 'desktop' | 'tablet_landscape' | 'tablet_portrait' | 'mobile_landscape' | 'mobile_portrait';
82
82
  type: string | 'design' | 'preview' | 'build';
83
+ /**
84
+ * loading tổng, true thì toàn bộ giao diện sẽ ko làm được gì
85
+ */
83
86
  loading: boolean;
84
87
  group_frames: any;
85
88
  group_objects: any;
86
89
  toolsBox: any;
87
90
  toolsBoxPosition: any;
91
+ /**
92
+ * lúc thiết kế ở freeblock
93
+ */
88
94
  isFreeBlock: boolean;
89
95
  header: any;
90
96
  footer: any;
@@ -111,10 +117,14 @@ declare class webBuilderService {
111
117
  ctrlZ: any;
112
118
  ctrlY: any;
113
119
  constructor(http: HttpClient, socketService: SocketService, route: ActivatedRoute);
114
- realTimeUpdate(): void;
115
120
  closeConnection(): void;
116
121
  onNotifyChange(callback: (data: any) => void): any;
117
122
  notifyChange(data: any): void;
123
+ /**
124
+ * dùng trong preview-web
125
+ * @param values
126
+ * @returns
127
+ */
118
128
  findItems_inTree_byType(values: any): any;
119
129
  findItemsInTreeByType(tree: any, values: any): any;
120
130
  /**
@@ -123,6 +133,12 @@ declare class webBuilderService {
123
133
  * @returns
124
134
  */
125
135
  findItemById(id: string): any;
136
+ /**
137
+ * Tìm TẤT CẢ đối tượng dù ở currentPage hay freeblocks
138
+ * @param id id của đối tượng cần tìm
139
+ * @returns
140
+ */
141
+ findItemsById(id: string): any[];
126
142
  /**
127
143
  * hàm tìm kiếm 1 đối tượng trong tree
128
144
  * @param tree khối
@@ -140,10 +156,13 @@ declare class webBuilderService {
140
156
  addTemplate(data: any): Promise<any>;
141
157
  updateTemplate(id: string, data: any): Promise<any>;
142
158
  deleteTemplate(id: string): Promise<any>;
143
- sortVietnamese(arr: string[]): string[];
159
+ sortVietnamese(arr: any[]): any[];
160
+ /**
161
+ * tách ra hàm getHeaderFooter vì lúc đổi thiết bị phải get lại freeblocks
162
+ */
144
163
  getHeaderFooter(): void;
145
- connectProject(_id: string): Promise<any>;
146
- setProjectWorking(data: any): void;
164
+ connectProject(_id: string): Promise<void>;
165
+ setProjectWorking(data: any): Promise<void>;
147
166
  /**
148
167
  * Lấy chi tiết trang có tất cả nhánh
149
168
  * @param id id trang
@@ -163,41 +182,32 @@ declare class webBuilderService {
163
182
  */
164
183
  getFullObjectsForObject(object: any): any;
165
184
  addPage(data: any): Promise<any>;
185
+ updatePage(id: string, data: any, code?: any): Promise<any>;
166
186
  deletePage(id: string): Promise<any>;
167
187
  getPage(id: string): Promise<any>;
168
- deleteBlockDbAndLocal(id: string): void;
169
- deleteObjectDbAndLocal(id: string): Promise<void>;
188
+ deleteBlockDbAndLocal(id: string): Promise<any>;
189
+ deleteObjectDbAndLocal(id: string): Promise<any>;
170
190
  /**
171
191
  *
172
192
  * @param nodes nhánh cần làm phẳng từ page
173
193
  */
174
194
  flatNodes(nodes: any): any;
175
- updatePage(id: string, data: any): Promise<any>;
176
195
  getPages(): Promise<any>;
177
- /**
178
- *
179
- * @param data ko cần tính index, hàm từ tính luôn
180
- * @returns
181
- */
182
- addBlock(data: any): Promise<any>;
183
- updateBlock(id: string, data: any): Promise<any>;
184
- deleteBlock(id: string): Promise<any>;
185
- deleteBlockClone(block: any): Promise<any>;
186
- /**
187
- *
188
- * @param data dữ liệu object tạo mới
189
- * @param sync đồng bộ giao diện, true thì giao diện sẽ cập nhật ngay, false thì không cập nhật giao diện chỉ add trên db
190
- * @returns
191
- */
196
+ addBlock(data: any, code?: any): Promise<any>;
197
+ updateBlock(id: string, data: any, code?: string): Promise<any>;
198
+ deleteBlock(id: string, code?: any): Promise<any>;
199
+ deleteBlockClone(block: any, code?: string): Promise<any>;
192
200
  addObject(data: any, code?: any): Promise<any>;
193
- updateObject(id: string, data: any): Promise<any>;
201
+ updateObject(id: string, data: any, code?: string): Promise<any>;
194
202
  /**
195
- * hàm này xóa tất cả object và nhánh con của nó
203
+ * hàm này xóa tất cả object và nhánh con của nó(lưu ý hàm này ko được xóa objectClone nhớ kiểm tra is_clone trước khi sử dụng)
204
+ * trong nhánh có thể có object clone nên phải check
205
+ * nếu xóa item gốc thì tất cả object_clone từ item gốc phải xóa trên DOM luôn
196
206
  * @param id id của object cần xóa
197
207
  * @returns
198
208
  */
199
- deleteObject(id: string): any;
200
- deleteObjectClone(object: any): Promise<any>;
209
+ deleteObject(id: string, code?: any): Promise<any>;
210
+ deleteObjectClone(object: any, code?: string): Promise<any>;
201
211
  uploadFile(file: File, newPath: string, options?: any): Promise<Object>;
202
212
  upLoadImage(file: any, oldPath: string, newPath: string, options?: any): Promise<any>;
203
213
  upLoadAdminImage(file: any, oldPath: string, newPath: string, options?: any): Promise<any>;
@@ -264,10 +274,20 @@ declare class webBuilderService {
264
274
  handleCtrl_D(): Promise<any>;
265
275
  handleCtrl_V(): any;
266
276
  handleCtrl_Z(): Promise<void>;
267
- private deleteObject2;
268
- private deleteBlock2;
277
+ handleCtrl_Y(): Promise<void>;
278
+ /**
279
+ * bộ hàm private 2 này giành riêng cho việc ctrl_z
280
+ * trong hàm sẽ cập nhật db, local và DOM
281
+ */
282
+ private updateObject2;
283
+ private updateBlock2;
269
284
  private addObject2;
270
285
  private addBlock2;
286
+ private updatePage2;
287
+ private deleteObject2;
288
+ private deleteBlock2;
289
+ private deleteBlockClone2;
290
+ private deleteObjectClone2;
271
291
  applyFontLinks(fontLinksFromDB: string): void;
272
292
  getFontNames(fontLinkTag: string): string[];
273
293
  /**
@@ -275,7 +295,7 @@ declare class webBuilderService {
275
295
  * @param page _id của page chứa block
276
296
  * @param block block có NHÁNH(objects) cần copy
277
297
  */
278
- handleCopyBlock(page: any, block: any): Promise<void>;
298
+ handleCopyBlock(page: any, block: any, code: any): Promise<void>;
279
299
  /**
280
300
  * Hàm này dùng để copy object
281
301
  * khi copy page thì cần mọi object nằm ở vị trí cũ,
@@ -284,7 +304,7 @@ declare class webBuilderService {
284
304
  * @param object object có NHÁNH(objects) cần copy
285
305
  * @param change_position
286
306
  */
287
- handleCopyObject(parent: any, object: any, change_position?: boolean): Promise<void>;
307
+ handleCopyObject(parent: any, object: any, change_position: boolean | undefined, code: any): Promise<void>;
288
308
  /**
289
309
  * hàm này copy page, page truyền vào phải có nhánh
290
310
  * @param page page phải có NHÁNH
@@ -297,13 +317,13 @@ declare class webBuilderService {
297
317
  * @param block block phải có NHÁNH
298
318
  * @returns
299
319
  */
300
- handleCloneBlock(page: any, block: any): Promise<void>;
320
+ handleCloneBlock(page: any, block: any, codeUpdate: any): Promise<void>;
301
321
  /**
302
322
  * Chỉ cần dùng hàm này sẽ cập nhật dữ liệu và giao diện
303
323
  * @param parent đối tượng cha
304
324
  * @param object đối tượng clone
305
325
  */
306
- handleCloneObject(parent: any, object: any, change_position?: boolean): Promise<void>;
326
+ handleCloneObject(parent: any, object: any, change_position: boolean | undefined, codeUpdate: any): Promise<void>;
307
327
  handleOrder(customer_info: any, note: any, payment_method: any, id_user: any): Promise<any>;
308
328
  getOrders_byFields(query: any, sort: any, page?: number, limit?: number): Promise<any>;
309
329
  updateOrder(id: string, data: any): Promise<any>;
@@ -610,8 +630,8 @@ declare class WbDragDrop implements OnInit {
610
630
  onResizeLeft(e: any): void;
611
631
  onResizeRight(e: any): void;
612
632
  updatePositionDB(): void;
613
- updateClassAndConfig(): void;
614
- updatePositionAndClass(): void;
633
+ updateClassAndConfig(codeUpdate: any): void;
634
+ updatePositionAndClass(codeUpdate: any): void;
615
635
  updateHeight(): void;
616
636
  conditionShowActive(): any;
617
637
  conditionShowResize(): any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fw-webbuilder",
3
- "version": "1.1.152",
3
+ "version": "1.1.154",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^20.3.0",
6
6
  "@angular/core": "^20.3.0",