seat-editor 1.6.18 → 1.6.20

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.
@@ -12,3 +12,47 @@ export declare const constantData: {
12
12
  };
13
13
  janu: string;
14
14
  }[];
15
+ export declare const data2: {
16
+ uuid: string;
17
+ uuid_event_outlet: string;
18
+ uuid_area: any;
19
+ area_name: any;
20
+ uuid_area_group: string;
21
+ area_group_name: string;
22
+ uuid_table: string;
23
+ table_name: string;
24
+ name: string;
25
+ capacity: number;
26
+ max_capacity: any;
27
+ mc_amount: string;
28
+ dp_mc_amount: string;
29
+ price: string;
30
+ benefit: string;
31
+ notes: string;
32
+ properties: {
33
+ x: number;
34
+ y: number;
35
+ id: number;
36
+ src: string;
37
+ fill: string;
38
+ image: string;
39
+ shape: string;
40
+ width: number;
41
+ height: number;
42
+ labels: {
43
+ x: number;
44
+ y: number;
45
+ label: string;
46
+ fontSize: number;
47
+ fontColor: string;
48
+ }[];
49
+ opacity: number;
50
+ rotation: number;
51
+ seatCount: number;
52
+ uuid_table: string;
53
+ };
54
+ status: number;
55
+ media: any;
56
+ is_fdc: number;
57
+ max_pax_fdc: number;
58
+ }[];
@@ -38,3 +38,235 @@ export const constantData = [
38
38
  "janu": "test2"
39
39
  }
40
40
  ];
41
+ export const data2 = [
42
+ {
43
+ "uuid": "d1b7568b-4711-40a3-b426-220db075785e",
44
+ "uuid_event_outlet": "82147ecc-d17c-4b10-bf7e-4ca704242445",
45
+ "uuid_area": null,
46
+ "area_name": null,
47
+ "uuid_area_group": "a77c1139-dc00-4169-93a8-75ed1825c344",
48
+ "area_group_name": "Area Musholla",
49
+ "uuid_table": "c160055a-c1df-49be-b52d-1baf3891c646",
50
+ "table_name": "New Table 3",
51
+ "name": "New Table 3",
52
+ "capacity": 1,
53
+ "max_capacity": null,
54
+ "mc_amount": "0",
55
+ "dp_mc_amount": "0",
56
+ "price": "0",
57
+ "benefit": "",
58
+ "notes": "",
59
+ "properties": {
60
+ "x": 20,
61
+ "y": 234,
62
+ "id": 1753784212894,
63
+ "src": "https://d3l3j4e3k9p181.cloudfront.net/dev/5bf923de-2366-4a11-9b8b-e92de0afbf05/3a65cb36-7d85-4c38-9403-a15f94641920/68d45207-d66b-4bb5-92a2-4e5a87715e98/rsvp/1753784261235494218_png-transparent-club-chair-couch-furniture-fbx-armchair-angle-3d-computer-graphics-furniture.png",
64
+ "fill": "#bca16a",
65
+ "image": "/5bf923de-2366-4a11-9b8b-e92de0afbf05/3a65cb36-7d85-4c38-9403-a15f94641920/68d45207-d66b-4bb5-92a2-4e5a87715e98/rsvp/1753784261235494218_png-transparent-club-chair-couch-furniture-fbx-armchair-angle-3d-computer-graphics-furniture.png",
66
+ "shape": "image-table",
67
+ "width": 61,
68
+ "height": 91,
69
+ "labels": [
70
+ {
71
+ "x": 0,
72
+ "y": 26,
73
+ "label": "New Table 3",
74
+ "fontSize": 12,
75
+ "fontColor": "#0d0c0c"
76
+ }
77
+ ],
78
+ "opacity": 1,
79
+ "rotation": 0,
80
+ "seatCount": 0,
81
+ "uuid_table": "c160055a-c1df-49be-b52d-1baf3891c646"
82
+ },
83
+ "status": 0,
84
+ "media": null,
85
+ "is_fdc": 0,
86
+ "max_pax_fdc": 0
87
+ },
88
+ {
89
+ "uuid": "a934afa7-88e2-4a2a-8121-f6827e598e59",
90
+ "uuid_event_outlet": "82147ecc-d17c-4b10-bf7e-4ca704242445",
91
+ "uuid_area": null,
92
+ "area_name": null,
93
+ "uuid_area_group": "a77c1139-dc00-4169-93a8-75ed1825c344",
94
+ "area_group_name": "Area Musholla",
95
+ "uuid_table": "b71b4c48-90d9-4992-9098-51e20175d0bc",
96
+ "table_name": "New Table 5",
97
+ "name": "New Table 5",
98
+ "capacity": 1,
99
+ "max_capacity": null,
100
+ "mc_amount": "0",
101
+ "dp_mc_amount": "0",
102
+ "price": "0",
103
+ "benefit": "",
104
+ "notes": "",
105
+ "properties": {
106
+ "x": 499,
107
+ "y": 89,
108
+ "id": 1753784212896,
109
+ "src": "https://d3l3j4e3k9p181.cloudfront.net/dev/5bf923de-2366-4a11-9b8b-e92de0afbf05/3a65cb36-7d85-4c38-9403-a15f94641920/68d45207-d66b-4bb5-92a2-4e5a87715e98/rsvp/1753784304409930195_png-transparent-club-chair-couch-furniture-fbx-armchair-angle-3d-computer-graphics-furniture.png",
110
+ "fill": "#bca16a",
111
+ "image": "/5bf923de-2366-4a11-9b8b-e92de0afbf05/3a65cb36-7d85-4c38-9403-a15f94641920/68d45207-d66b-4bb5-92a2-4e5a87715e98/rsvp/1753784304409930195_png-transparent-club-chair-couch-furniture-fbx-armchair-angle-3d-computer-graphics-furniture.png",
112
+ "shape": "image-table",
113
+ "width": 61,
114
+ "height": 91,
115
+ "labels": [
116
+ {
117
+ "x": 0,
118
+ "y": 27,
119
+ "label": "New Table 5",
120
+ "fontSize": 12,
121
+ "fontColor": "#0d0c0c"
122
+ }
123
+ ],
124
+ "opacity": 1,
125
+ "rotation": 0,
126
+ "seatCount": 0,
127
+ "uuid_table": "b71b4c48-90d9-4992-9098-51e20175d0bc"
128
+ },
129
+ "status": 0,
130
+ "media": null,
131
+ "is_fdc": 0,
132
+ "max_pax_fdc": 0
133
+ },
134
+ {
135
+ "uuid": "3783aedc-7456-4a05-bdb1-fa800ba92886",
136
+ "uuid_event_outlet": "82147ecc-d17c-4b10-bf7e-4ca704242445",
137
+ "uuid_area": null,
138
+ "area_name": null,
139
+ "uuid_area_group": "a77c1139-dc00-4169-93a8-75ed1825c344",
140
+ "area_group_name": "Area Musholla",
141
+ "uuid_table": "5612fdfb-cd5f-4846-8e2b-b0358bb5fb99",
142
+ "table_name": "New Table 2",
143
+ "name": "New Table 2",
144
+ "capacity": 1,
145
+ "max_capacity": null,
146
+ "mc_amount": "0",
147
+ "dp_mc_amount": "0",
148
+ "price": "0",
149
+ "benefit": "",
150
+ "notes": "",
151
+ "properties": {
152
+ "x": 327,
153
+ "y": 94,
154
+ "id": 1753784212893,
155
+ "src": "https://d3l3j4e3k9p181.cloudfront.net/dev/5bf923de-2366-4a11-9b8b-e92de0afbf05/3a65cb36-7d85-4c38-9403-a15f94641920/68d45207-d66b-4bb5-92a2-4e5a87715e98/rsvp/1753784223751899172_png-transparent-club-chair-couch-furniture-fbx-armchair-angle-3d-computer-graphics-furniture.png",
156
+ "fill": "#bca16a",
157
+ "image": "/5bf923de-2366-4a11-9b8b-e92de0afbf05/3a65cb36-7d85-4c38-9403-a15f94641920/68d45207-d66b-4bb5-92a2-4e5a87715e98/rsvp/1753784223751899172_png-transparent-club-chair-couch-furniture-fbx-armchair-angle-3d-computer-graphics-furniture.png",
158
+ "shape": "image-table",
159
+ "width": 61,
160
+ "height": 91,
161
+ "labels": [
162
+ {
163
+ "x": 0,
164
+ "y": 26,
165
+ "label": "New Table 2",
166
+ "fontSize": 12,
167
+ "fontColor": "#0d0c0c"
168
+ }
169
+ ],
170
+ "opacity": 1,
171
+ "rotation": 0,
172
+ "seatCount": 0,
173
+ "uuid_table": "5612fdfb-cd5f-4846-8e2b-b0358bb5fb99"
174
+ },
175
+ "status": 0,
176
+ "media": null,
177
+ "is_fdc": 0,
178
+ "max_pax_fdc": 0
179
+ },
180
+ {
181
+ "uuid": "dfe5ecee-ba43-479f-ba61-3a62190e6d54",
182
+ "uuid_event_outlet": "82147ecc-d17c-4b10-bf7e-4ca704242445",
183
+ "uuid_area": null,
184
+ "area_name": null,
185
+ "uuid_area_group": "a77c1139-dc00-4169-93a8-75ed1825c344",
186
+ "area_group_name": "Area Musholla",
187
+ "uuid_table": "601899a7-b836-4bff-9a72-6f099196327d",
188
+ "table_name": "New Table 4",
189
+ "name": "New Table 4",
190
+ "capacity": 1,
191
+ "max_capacity": null,
192
+ "mc_amount": "0",
193
+ "dp_mc_amount": "0",
194
+ "price": "0",
195
+ "benefit": "",
196
+ "notes": "",
197
+ "properties": {
198
+ "x": 622,
199
+ "y": 234,
200
+ "id": 1753784212895,
201
+ "src": "https://d3l3j4e3k9p181.cloudfront.net/dev/5bf923de-2366-4a11-9b8b-e92de0afbf05/3a65cb36-7d85-4c38-9403-a15f94641920/68d45207-d66b-4bb5-92a2-4e5a87715e98/rsvp/1753784286964301060_png-transparent-club-chair-couch-furniture-fbx-armchair-angle-3d-computer-graphics-furniture.png",
202
+ "fill": "#bca16a",
203
+ "image": "/5bf923de-2366-4a11-9b8b-e92de0afbf05/3a65cb36-7d85-4c38-9403-a15f94641920/68d45207-d66b-4bb5-92a2-4e5a87715e98/rsvp/1753784286964301060_png-transparent-club-chair-couch-furniture-fbx-armchair-angle-3d-computer-graphics-furniture.png",
204
+ "shape": "image-table",
205
+ "width": 61,
206
+ "height": 91,
207
+ "labels": [
208
+ {
209
+ "x": 0,
210
+ "y": 27,
211
+ "label": "New Table 4",
212
+ "fontSize": 12,
213
+ "fontColor": "#0d0c0c"
214
+ }
215
+ ],
216
+ "opacity": 1,
217
+ "rotation": 0,
218
+ "seatCount": 0,
219
+ "uuid_table": "601899a7-b836-4bff-9a72-6f099196327d"
220
+ },
221
+ "status": 0,
222
+ "media": null,
223
+ "is_fdc": 0,
224
+ "max_pax_fdc": 0
225
+ },
226
+ {
227
+ "uuid": "eb89cbaa-8ba6-4c78-bcd9-2fc190de945c",
228
+ "uuid_event_outlet": "82147ecc-d17c-4b10-bf7e-4ca704242445",
229
+ "uuid_area": null,
230
+ "area_name": null,
231
+ "uuid_area_group": "a77c1139-dc00-4169-93a8-75ed1825c344",
232
+ "area_group_name": "Area Musholla",
233
+ "uuid_table": "8ea6f8ca-7ecd-48ec-a1a7-7bd258e403f5",
234
+ "table_name": "New Table 6",
235
+ "name": "New Table 6",
236
+ "capacity": 1,
237
+ "max_capacity": null,
238
+ "mc_amount": "0",
239
+ "dp_mc_amount": "0",
240
+ "price": "0",
241
+ "benefit": "",
242
+ "notes": "",
243
+ "properties": {
244
+ "x": 645,
245
+ "y": 88,
246
+ "id": 1753784212897,
247
+ "src": "https://d3l3j4e3k9p181.cloudfront.net/dev/5bf923de-2366-4a11-9b8b-e92de0afbf05/3a65cb36-7d85-4c38-9403-a15f94641920/68d45207-d66b-4bb5-92a2-4e5a87715e98/rsvp/1753784322083647106_png-transparent-club-chair-couch-furniture-fbx-armchair-angle-3d-computer-graphics-furniture.png",
248
+ "fill": "#bca16a",
249
+ "image": "/5bf923de-2366-4a11-9b8b-e92de0afbf05/3a65cb36-7d85-4c38-9403-a15f94641920/68d45207-d66b-4bb5-92a2-4e5a87715e98/rsvp/1753784322083647106_png-transparent-club-chair-couch-furniture-fbx-armchair-angle-3d-computer-graphics-furniture.png",
250
+ "shape": "image-table",
251
+ "width": 61,
252
+ "height": 91,
253
+ "labels": [
254
+ {
255
+ "x": 0,
256
+ "y": 27,
257
+ "label": "New Table 6",
258
+ "fontSize": 12,
259
+ "fontColor": "#0d0c0c"
260
+ }
261
+ ],
262
+ "opacity": 1,
263
+ "rotation": 0,
264
+ "seatCount": 0,
265
+ "uuid_table": "8ea6f8ca-7ecd-48ec-a1a7-7bd258e403f5"
266
+ },
267
+ "status": 0,
268
+ "media": null,
269
+ "is_fdc": 0,
270
+ "max_pax_fdc": 0
271
+ }
272
+ ];
@@ -23,7 +23,9 @@ export default function NewBoard() {
23
23
  id: 1747388267451,
24
24
  x: 100,
25
25
  y: 100,
26
- shape: "background",
26
+ text: "tsdsdsds",
27
+ fill: "#000000",
28
+ shape: "text",
27
29
  width: 100,
28
30
  height: 100,
29
31
  }]);
@@ -50,10 +52,11 @@ export default function NewBoard() {
50
52
  extraComponent: true,
51
53
  }} mappingKey="properties" onCurrentStateChange={(setState) => {
52
54
  var _a, _b, _c, _d;
55
+ console.log({ setState }, "masukk");
53
56
  if (((_a = setState === null || setState === void 0 ? void 0 : setState.components) === null || _a === void 0 ? void 0 : _a.length) > 0) {
54
57
  setInitialValue((_b = setState === null || setState === void 0 ? void 0 : setState.components) !== null && _b !== void 0 ? _b : []);
55
58
  }
56
- if (setState === null || setState === void 0 ? void 0 : setState.background) {
59
+ if (setState === null || setState === void 0 ? void 0 : setState.backgroundColor) {
57
60
  setBackgroundColor(setState === null || setState === void 0 ? void 0 : setState.backgroundColor);
58
61
  }
59
62
  if (((_c = setState === null || setState === void 0 ? void 0 : setState.extraComponents) === null || _c === void 0 ? void 0 : _c.length) > 0) {
@@ -72,7 +72,7 @@ const LayerView = (props) => {
72
72
  setSelectedTable(find);
73
73
  };
74
74
  const boundingBox = useMemo(() => {
75
- var _a, _b, _c, _d, _e, _f;
75
+ var _a, _b, _c, _d, _e, _f, _g;
76
76
  if (!componentsEditor && (componentsEditor === null || componentsEditor === void 0 ? void 0 : componentsEditor.length) === 0) {
77
77
  return { minX: 0, minY: 0, width: 500, height: 500 };
78
78
  }
@@ -107,10 +107,13 @@ const LayerView = (props) => {
107
107
  maxX = Math.max(maxX, values.x + values.width);
108
108
  maxY = Math.max(maxY, values.y + values.height);
109
109
  }
110
+ console.log("masuk image table", values);
110
111
  });
111
112
  extraComponentsEditor === null || extraComponentsEditor === void 0 ? void 0 : extraComponentsEditor.forEach((values) => {
112
113
  var _a, _b;
114
+ console.log("masuk extra component background1", values);
113
115
  if ((_a = values === null || values === void 0 ? void 0 : values.shape) === null || _a === void 0 ? void 0 : _a.includes("background")) {
116
+ console.log("masuk extra component background2", values);
114
117
  minX = Math.min(minX, values.x);
115
118
  minY = Math.min(minY, values.y);
116
119
  maxX = Math.max(maxX, values.x + values.width);
@@ -122,25 +125,28 @@ const LayerView = (props) => {
122
125
  maxX = Math.max(maxX, values.x + values.width);
123
126
  maxY = Math.max(maxY, values.y + values.height);
124
127
  }
128
+ console.log("masuk extra component", values);
125
129
  });
126
130
  if ((extraComponentsEditor === null || extraComponentsEditor === void 0 ? void 0 : extraComponentsEditor.length) === 1 &&
127
131
  ((_b = (_a = extraComponentsEditor === null || extraComponentsEditor === void 0 ? void 0 : extraComponentsEditor[0]) === null || _a === void 0 ? void 0 : _a.shape) === null || _b === void 0 ? void 0 : _b.includes("background"))) {
132
+ console.log("masuk extra component background");
128
133
  minX = (_c = extraComponentsEditor === null || extraComponentsEditor === void 0 ? void 0 : extraComponentsEditor[0]) === null || _c === void 0 ? void 0 : _c.x;
129
134
  minY = (_d = extraComponentsEditor === null || extraComponentsEditor === void 0 ? void 0 : extraComponentsEditor[0]) === null || _d === void 0 ? void 0 : _d.y;
130
135
  maxX = (_e = extraComponentsEditor === null || extraComponentsEditor === void 0 ? void 0 : extraComponentsEditor[0]) === null || _e === void 0 ? void 0 : _e.width;
131
136
  maxY = (_f = extraComponentsEditor === null || extraComponentsEditor === void 0 ? void 0 : extraComponentsEditor[0]) === null || _f === void 0 ? void 0 : _f.height;
132
137
  }
133
- if ((extraComponentsEditor === null || extraComponentsEditor === void 0 ? void 0 : extraComponentsEditor.length) < 1) {
138
+ if ((extraComponentsEditor === null || extraComponentsEditor === void 0 ? void 0 : extraComponentsEditor.length) < 1 && ["background", "text"].includes((_g = componentsEditor === null || componentsEditor === void 0 ? void 0 : componentsEditor[0]) === null || _g === void 0 ? void 0 : _g.shape)) {
134
139
  minX = minX - minX * 0.5;
135
140
  minY = minY - minY * 0.5;
136
141
  }
137
142
  return {
138
- minX,
139
- minY,
143
+ minX: minX - minX * 0.5,
144
+ minY: minY - minY * 0.5,
140
145
  width: maxX,
141
146
  height: maxY,
142
147
  };
143
148
  }, [componentsEditor, extraComponentsEditor]);
149
+ console.log({ boundingBox });
144
150
  const renderElements = (elementEditor, mappingKey, colorMatchKey) => {
145
151
  return elementEditor === null || elementEditor === void 0 ? void 0 : elementEditor.map((editorItem, i) => {
146
152
  var _a, _b, _c, _d;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "seat-editor",
3
- "version": "1.6.18",
3
+ "version": "1.6.20",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",