seat-editor 3.5.65 → 3.6.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.
Files changed (99) hide show
  1. package/dist/app/graph-view/page.d.ts +1 -1
  2. package/dist/app/graph-view-new/page.d.ts +1 -1
  3. package/dist/app/layout.d.ts +1 -1
  4. package/dist/app/new-board/page.d.ts +1 -1
  5. package/dist/app/new-board/page.js +18 -1
  6. package/dist/app/new-board/page.jsx +18 -1
  7. package/dist/app/old-board/page.d.ts +1 -2
  8. package/dist/app/only-view/chair.d.ts +1 -1
  9. package/dist/app/only-view/chair.js +2 -10
  10. package/dist/app/only-view/page.d.ts +1 -1
  11. package/dist/app/only-view/user.d.ts +1 -1
  12. package/dist/app/only-view/user.js +2 -10
  13. package/dist/app/page.d.ts +1 -1
  14. package/dist/app/test/page.d.ts +1 -2
  15. package/dist/app/v2/page.d.ts +1 -1
  16. package/dist/components/button-radio/index.d.ts +11 -0
  17. package/dist/components/button-radio/index.js +19 -0
  18. package/dist/components/button-radio/index.jsx +22 -0
  19. package/dist/components/button-tools/index.d.ts +1 -1
  20. package/dist/components/form-tools/label.d.ts +1 -1
  21. package/dist/components/form-tools/label.js +20 -2
  22. package/dist/components/form-tools/label.jsx +30 -2
  23. package/dist/components/form-tools/shape.d.ts +2 -2
  24. package/dist/components/icons/camera.d.ts +1 -2
  25. package/dist/components/icons/circle.d.ts +1 -2
  26. package/dist/components/icons/square.d.ts +1 -2
  27. package/dist/components/icons/type-1.d.ts +1 -2
  28. package/dist/components/icons/type-2.d.ts +1 -2
  29. package/dist/components/icons/type-3.d.ts +1 -2
  30. package/dist/components/icons/type-4.d.ts +1 -2
  31. package/dist/components/icons/type-5.d.ts +1 -2
  32. package/dist/components/input/number-indicator.d.ts +1 -1
  33. package/dist/components/joystick/index.d.ts +1 -2
  34. package/dist/components/layer/index.d.ts +1 -1
  35. package/dist/components/layer-v2/index.d.ts +1 -1
  36. package/dist/components/layer-v3/index.d.ts +10 -3
  37. package/dist/components/layer-v3/index.js +65 -95
  38. package/dist/components/layer-v3/index.jsx +79 -115
  39. package/dist/components/layer-v4/constant.d.ts +16 -2
  40. package/dist/components/layer-v4/constant.js +57 -12
  41. package/dist/components/layer-v4/index.d.ts +1 -1
  42. package/dist/components/layer-v4/index.js +111 -188
  43. package/dist/components/layer-v4/index.jsx +124 -215
  44. package/dist/components/layer-v5/index.d.ts +1 -1
  45. package/dist/components/lib/index.d.ts +1 -1
  46. package/dist/components/modal-preview/index.d.ts +4 -2
  47. package/dist/components/modal-preview/index.js +12 -2
  48. package/dist/components/modal-preview/index.jsx +13 -3
  49. package/dist/dto/table.d.ts +5 -0
  50. package/dist/features/board/index.d.ts +1 -1
  51. package/dist/features/board-v2/index.d.ts +1 -2
  52. package/dist/features/board-v3/board-slice.d.ts +2 -1
  53. package/dist/features/board-v3/board-slice.js +4 -1
  54. package/dist/features/board-v3/constant.d.ts +5 -1
  55. package/dist/features/board-v3/constant.js +23 -1
  56. package/dist/features/board-v3/index.d.ts +6 -1
  57. package/dist/features/board-v3/index.js +59 -49
  58. package/dist/features/board-v3/index.jsx +105 -68
  59. package/dist/features/board-v3/utils.js +48 -28
  60. package/dist/features/navbar/index.d.ts +1 -1
  61. package/dist/features/package/index.d.ts +6 -1
  62. package/dist/features/package/index.js +1 -1
  63. package/dist/features/package/index.jsx +2 -2
  64. package/dist/features/panel/index.d.ts +1 -1
  65. package/dist/features/panel/index.js +2 -2
  66. package/dist/features/panel/index.jsx +2 -2
  67. package/dist/features/panel/polygon.d.ts +1 -1
  68. package/dist/features/panel/select-tool.d.ts +1 -1
  69. package/dist/features/panel/selected-group.d.ts +1 -1
  70. package/dist/features/panel/selected-group.js +2 -2
  71. package/dist/features/panel/selected-group.jsx +4 -2
  72. package/dist/features/panel/square-circle-tool.d.ts +1 -1
  73. package/dist/features/panel/table-seat-circle.d.ts +1 -1
  74. package/dist/features/panel/table-seat-square.d.ts +1 -1
  75. package/dist/features/panel/text-tool.d.ts +1 -1
  76. package/dist/features/panel/upload-group-tool.d.ts +1 -1
  77. package/dist/features/panel/upload-tool.d.ts +1 -1
  78. package/dist/features/side-tool/icons.d.ts +1 -0
  79. package/dist/features/side-tool/icons.js +2 -0
  80. package/dist/features/side-tool/icons.jsx +6 -0
  81. package/dist/features/side-tool/index.d.ts +7 -2
  82. package/dist/features/side-tool/index.js +31 -3
  83. package/dist/features/side-tool/index.jsx +32 -16
  84. package/dist/features/side-tool/side-tool-slice.d.ts +2 -0
  85. package/dist/features/side-tool/side-tool-slice.js +8 -1
  86. package/dist/features/view-only/index.d.ts +1 -1
  87. package/dist/features/view-only-2/index.d.ts +1 -1
  88. package/dist/features/view-only-3/index.d.ts +1 -1
  89. package/dist/features/view-only-3/index.js +1 -22
  90. package/dist/features/view-only-3/index.jsx +1 -22
  91. package/dist/features/view-only-4/index.d.ts +1 -1
  92. package/dist/features/view-only-5/index.d.ts +1 -1
  93. package/dist/features/view-only-6/index.d.ts +1 -1
  94. package/dist/features/view-only-7/index.d.ts +1 -1
  95. package/dist/provider/antd-provider.js +5 -2
  96. package/dist/provider/antd-provider.jsx +5 -2
  97. package/dist/provider/redux-provider.d.ts +1 -1
  98. package/dist/provider/store-provider.d.ts +1 -1
  99. package/package.json +1 -1
@@ -6,8 +6,8 @@ export declare const tagsDummy: (name: string, icon: string) => ({
6
6
  value: string;
7
7
  }[];
8
8
  direction: string;
9
+ offsetY: string;
9
10
  offsetX?: undefined;
10
- offsetY?: undefined;
11
11
  } | {
12
12
  gap: string;
13
13
  key: string;
@@ -38,7 +38,6 @@ export declare const tagsDummy: (name: string, icon: string) => ({
38
38
  value: string;
39
39
  symbol: {
40
40
  value: string;
41
- gap: number;
42
41
  position: string;
43
42
  };
44
43
  fontWeight?: undefined;
@@ -47,6 +46,17 @@ export declare const tagsDummy: (name: string, icon: string) => ({
47
46
  direction: string;
48
47
  offsetY: number;
49
48
  offsetX?: undefined;
49
+ } | {
50
+ gap: string;
51
+ key: string;
52
+ items: {
53
+ type: string;
54
+ value: string;
55
+ fontWeight: string;
56
+ }[];
57
+ offsetY: string;
58
+ direction: string;
59
+ offsetX?: undefined;
50
60
  })[];
51
61
  export declare const PRIVILEGED_TAGS: {
52
62
  CURRENT_TIME: {
@@ -57,4 +67,8 @@ export declare const PRIVILEGED_TAGS: {
57
67
  key: string;
58
68
  items: string[];
59
69
  }[];
70
+ POS_VIEW: {
71
+ key: string;
72
+ items: string[];
73
+ }[];
60
74
  };
@@ -13,6 +13,7 @@ export const tagsDummy = (name, icon) => [
13
13
  },
14
14
  ],
15
15
  direction: "column",
16
+ offsetY: "5",
16
17
  },
17
18
  {
18
19
  gap: "8",
@@ -50,23 +51,53 @@ export const tagsDummy = (name, icon) => [
50
51
  value: "22:00",
51
52
  symbol: {
52
53
  value: "+1",
53
- gap: 1,
54
+ // gap: 1,
54
55
  position: "right-top"
55
56
  },
56
57
  },
57
- // as Position, // right | right-top | right-bottom | left | left-top | left-bottom | top | bottom
58
- // {
59
- // type: "text",
60
- // value: "23:00",
61
- // symbol: {
62
- // value: "+1",
63
- // gap: 1,
64
- // position: "right-top" as Position, // right | right-top | right-bottom | left | left-top | left-bottom | top | bottom
65
- // },
66
- // },
67
58
  ],
68
59
  direction: "column",
69
- offsetY: -35,
60
+ offsetY: -10,
61
+ },
62
+ //POST TYPE
63
+ {
64
+ gap: "0",
65
+ key: "table_name",
66
+ items: [
67
+ {
68
+ type: "text",
69
+ value: name,
70
+ fontWeight: "bold"
71
+ }
72
+ ],
73
+ offsetY: "0",
74
+ direction: "column",
75
+ },
76
+ {
77
+ gap: "0",
78
+ key: "pax_pos",
79
+ items: [
80
+ {
81
+ type: "text",
82
+ value: "8",
83
+ },
84
+ ],
85
+ offsetX: "0",
86
+ offsetY: "0",
87
+ direction: "column",
88
+ },
89
+ {
90
+ gap: "0",
91
+ key: "price",
92
+ items: [
93
+ {
94
+ type: "text",
95
+ value: "11.000K",
96
+ },
97
+ ],
98
+ offsetX: "0",
99
+ offsetY: "0",
100
+ direction: "column",
70
101
  },
71
102
  ];
72
103
  export const PRIVILEGED_TAGS = {
@@ -90,4 +121,18 @@ export const PRIVILEGED_TAGS = {
90
121
  items: ["text"],
91
122
  },
92
123
  ],
124
+ POS_VIEW: [
125
+ {
126
+ key: "table_name",
127
+ items: ["text"],
128
+ },
129
+ {
130
+ key: "pax_pos",
131
+ items: ["text"],
132
+ },
133
+ {
134
+ key: "price",
135
+ items: ["text"],
136
+ },
137
+ ]
93
138
  };
@@ -20,5 +20,5 @@ interface LayersProps {
20
20
  items: string[];
21
21
  }[];
22
22
  }
23
- declare const Layers: ({ components, selectedTable, iconTags, eventMatchTable, onHighlightGroup, onForceRestoreGroup, selectedTableColor, privilegedTags, }: LayersProps) => import("react").JSX.Element;
23
+ declare const Layers: ({ components, selectedTable, iconTags, eventMatchTable, onHighlightGroup, onForceRestoreGroup, selectedTableColor, privilegedTags, }: LayersProps) => import("react/jsx-runtime").JSX.Element;
24
24
  export default Layers;
@@ -6,6 +6,7 @@ import { arcByDirection, distributeWithSpacing, getBoundingBoxFromPoints, } from
6
6
  import { PRIVILEGED_TAGS, tagsDummy } from "./constant";
7
7
  import { useAppSelector } from "../../hooks/use-redux";
8
8
  import { RsvpIcons } from "../../features/board-v3/icons";
9
+ import { LabelItem } from "../layer-v3";
9
10
  const toKebabCase = (str) => str.replace(/[A-Z]/g, (m) => "-" + m.toLowerCase());
10
11
  const iconNames = [
11
12
  "upcoming",
@@ -35,126 +36,110 @@ const getIconFromId = (data) => {
35
36
  };
36
37
  const Layers = ({ components, selectedTable, iconTags, eventMatchTable, onHighlightGroup, onForceRestoreGroup, selectedTableColor, privilegedTags = [], }) => {
37
38
  const { isShowTagType } = useAppSelector((state) => state.board);
38
- const showLabels = !["type-1", "type-2"].includes(isShowTagType) && !iconTags;
39
+ const showLabels = !["type-1", "type-2", "type-3"].includes(isShowTagType) && !iconTags;
39
40
  const renderShape = (item) => {
40
41
  var _a, _b, _c, _d, _e, _f, _g;
41
- const { id, x, y, width, height, fill, opacity, rotate = 0, rotation, shape, text, stroke, strokeWidth, labels, fontSize, fontColor, seatFill, src, tags, gapTags, label, points, seatPositions, radius, } = item;
42
+ const { id, x, y, width, height, fill, opacity, rotate = 0, rotation, shape, text, stroke, strokeWidth, labels, fontSize, fontColor, seatFill, src, tags, gapTags, label, points, seatPositions, radius, horizontalAlign, verticalAlign, fontSizeType1, fontSizeType2, fontSizeType3, } = item;
42
43
  const fontSizeFromLabel = (_a = labels === null || labels === void 0 ? void 0 : labels[0]) === null || _a === void 0 ? void 0 : _a.fontSize;
44
+ const fontTypeSize = {
45
+ "type-1": fontSizeType1,
46
+ "type-2": fontSizeType2,
47
+ "type-3": fontSizeType3,
48
+ };
43
49
  const renderTags = (data) => {
44
50
  var _a;
45
51
  const tags = data !== null && data !== void 0 ? data : tagsDummy(((_a = labels === null || labels === void 0 ? void 0 : labels[0]) === null || _a === void 0 ? void 0 : _a.label) || "Table", getIconFromId(id));
52
+ const scaleFontSize = Number(fontTypeSize[isShowTagType] || 1);
46
53
  const privileged = !isEmpty(privilegedTags)
47
54
  ? privilegedTags
48
55
  : isShowTagType === "type-1"
49
56
  ? PRIVILEGED_TAGS["CURRENT_TIME"]
50
57
  : isShowTagType === "type-2"
51
58
  ? PRIVILEGED_TAGS["NEXT_3_RESERVATION"]
52
- : undefined;
53
- if (tags && (tags === null || tags === void 0 ? void 0 : tags.length) > 0) {
54
- const scaleDefault = Number(fontSize || fontSizeFromLabel || 12) / 12;
55
- const gapBetweenTags = Number(gapTags || 20) * scaleDefault;
56
- const defaultFontSize = Number(fontSize || fontSizeFromLabel || 12);
57
- // Hitung total tinggi semua grup tag (buat center vertikal)
58
- const totalTagHeight = (tags === null || tags === void 0 ? void 0 : tags.filter((tag) => privileged === null || privileged === void 0 ? void 0 : privileged.find((p) => p.key === tag.key)).reduce((sum, tag) => {
59
- var _a;
60
- const items = tag.items || [];
61
- const isColumn = (_a = tag.direction) === null || _a === void 0 ? void 0 : _a.includes("column");
62
- const tagHeight = isColumn
63
- ? items.length * defaultFontSize + 2 * (Number(tag.gap) || 2)
64
- : defaultFontSize; // horizontal = 1 line
65
- return sum + tagHeight + gapBetweenTags;
66
- }, 0)) - gapBetweenTags;
67
- const startY = Number(height) / 4 - totalTagHeight / 3; // titik awal supaya semua di tengah
68
- let currentY = startY;
69
- return tags
70
- .filter((tag) => privileged === null || privileged === void 0 ? void 0 : privileged.find((p) => p.key === tag.key))
71
- .map((tag, tagIndex) => {
72
- var _a;
73
- const itemsPriv = privileged[tagIndex].items;
74
- const direction = ((_a = tag.direction) === null || _a === void 0 ? void 0 : _a.includes("column"))
75
- ? "column"
76
- : "flex";
77
- const gap = Number(tag.gap || 2) * scaleDefault;
78
- const items = tag.items || [];
79
- const fontSize = Number(defaultFontSize);
80
- const isColumn = direction === "column";
81
- const groupHeight = isColumn
82
- ? items.length * fontSize + 2 * gap
83
- : fontSize;
84
- const centerX = width / 2;
85
- const centerY = currentY + groupHeight;
86
- // naikkan posisi Y untuk grup berikutnya
87
- currentY += groupHeight + gapBetweenTags;
88
- const elements = items
89
- .filter((item) => itemsPriv.includes(item.type))
90
- .map((item, i) => {
91
- var _a, _b;
92
- const offsetY = isColumn
93
- ? i * (fontSize + gap) - groupHeight / 2 + fontSize / 2
94
- : 0;
95
- const offsetX = !isColumn
96
- ? i * (fontSize + gap) - (1 * (fontSize + gap)) / 2
97
- : 0;
98
- const posX = centerX + offsetX + Number((_a = tag.offsetX) !== null && _a !== void 0 ? _a : 0);
99
- const posY = centerY + offsetY + Number((_b = tag.offsetY) !== null && _b !== void 0 ? _b : 0);
100
- const renderSymbol = (symbol) => {
101
- if (!symbol)
102
- return null;
103
- const { position = "right", size = (item === null || item === void 0 ? void 0 : item.fontSize) || Number(fontSize), gap: symbolGap = 0, } = symbol;
104
- const sizeFont = (item === null || item === void 0 ? void 0 : item.fontSize) || Number(fontSize) / 3;
105
- let offsetSymbolX = 0;
106
- let offsetSymbolY = 0;
107
- switch (position) {
108
- case "right":
109
- offsetSymbolX = size + symbolGap;
110
- break;
111
- case "left":
112
- offsetSymbolX = -(size + symbolGap);
113
- break;
114
- case "top":
115
- offsetSymbolY = -(size + symbolGap);
116
- break;
117
- case "bottom":
118
- offsetSymbolY = size + symbolGap;
119
- break;
120
- case "right-top":
121
- offsetSymbolX = size + symbolGap;
122
- offsetSymbolY = -(size / 4);
123
- break;
124
- case "right-bottom":
125
- offsetSymbolX = size + symbolGap;
126
- offsetSymbolY = size / 4;
127
- break;
128
- case "left-top":
129
- offsetSymbolX = -size - symbolGap;
130
- offsetSymbolY = -(size / 4);
131
- break;
132
- case "left-bottom":
133
- offsetSymbolX = -size - symbolGap;
134
- offsetSymbolY = size / 4;
135
- break;
136
- }
137
- return (_createElement("tspan", Object.assign({}, symbol, { key: `symbol-${tagIndex}-${i}`, x: posX + offsetSymbolX, y: posY + offsetSymbolY, textAnchor: "middle", dominantBaseline: "middle", fontSize: `${sizeFont}px` }), symbol.value));
59
+ : isShowTagType === "type-3"
60
+ ? PRIVILEGED_TAGS["POS_VIEW"]
61
+ : undefined;
62
+ if (!(tags === null || tags === void 0 ? void 0 : tags.length))
63
+ return null;
64
+ const scaleDefault = Number(scaleFontSize || fontSize || fontSizeFromLabel || 12);
65
+ const postViewTagDummy = isShowTagType === "type-3";
66
+ const gapBetweenTags = Number((postViewTagDummy ? 1 : gapTags) || 20) * scaleDefault;
67
+ const defaultFontSize = Number(fontSize || fontSizeFromLabel || 12) * scaleDefault;
68
+ const filteredTags = tags.filter((tag) => privileged === null || privileged === void 0 ? void 0 : privileged.find((p) => p.key === tag.key));
69
+ // hitung tinggi tiap group
70
+ const groupHeights = filteredTags.map((tag) => {
71
+ var _a;
72
+ const isColumn = (_a = tag.direction) === null || _a === void 0 ? void 0 : _a.includes("column");
73
+ const gap = Number(tag.gap || 2) * scaleDefault;
74
+ const items = tag.items || [];
75
+ return isColumn
76
+ ? (items.length - 1) * (defaultFontSize + gap) + defaultFontSize
77
+ : defaultFontSize;
78
+ });
79
+ // total tinggi semua group + gap antar group
80
+ const totalTagHeight = groupHeights.reduce((sum, h) => sum + h, 0) +
81
+ (filteredTags.length - 1) * gapBetweenTags;
82
+ // startY supaya center vertikal
83
+ let currentY = height / 2 - totalTagHeight / 2;
84
+ return filteredTags.map((tag, tagIndex) => {
85
+ var _a;
86
+ const itemsPriv = privileged[tagIndex].items;
87
+ const isColumn = (_a = tag.direction) === null || _a === void 0 ? void 0 : _a.includes("column");
88
+ const gap = Number(tag.gap || 2) * scaleDefault;
89
+ const items = tag.items || [];
90
+ const groupHeight = groupHeights[tagIndex];
91
+ const centerX = width / 2;
92
+ const centerY = currentY + groupHeight / 2;
93
+ currentY += groupHeight + gapBetweenTags;
94
+ const elements = items
95
+ .filter((item) => itemsPriv.includes(item.type))
96
+ .map((item, i) => {
97
+ var _a, _b, _c;
98
+ const offsetY = isColumn
99
+ ? i * (defaultFontSize + gap) - groupHeight / 2 + defaultFontSize / 2
100
+ : 0;
101
+ const offsetX = !isColumn
102
+ ? i * (defaultFontSize + gap) - ((items.length - 1) * (defaultFontSize + gap)) / 2
103
+ : 0;
104
+ const posX = centerX + offsetX + Number((_a = tag.offsetX) !== null && _a !== void 0 ? _a : 0);
105
+ const posY = centerY + offsetY + Number((_b = tag.offsetY) !== null && _b !== void 0 ? _b : 0);
106
+ const renderSymbol = (symbol, width) => {
107
+ var _a;
108
+ if (!symbol)
109
+ return null;
110
+ const { position = "right", size = Number(item === null || item === void 0 ? void 0 : item.fontSize) || defaultFontSize / 3, gap: symbolGap = 0, } = symbol;
111
+ const sizeFont = defaultFontSize / 3;
112
+ const offsets = {
113
+ right: { x: size + (symbolGap * scaleFontSize) + width / 2.3, y: 0 },
114
+ left: { x: -(size + (symbolGap * scaleFontSize) + width / 2.3), y: 0 },
115
+ top: { x: 0, y: -(size + (symbolGap * scaleFontSize) + width / 2.3) },
116
+ bottom: { x: 0, y: size + (symbolGap * scaleFontSize) + width / 2.3 },
117
+ "right-top": { x: size + (symbolGap * scaleFontSize) + width / 2.3, y: -(defaultFontSize / 4) },
118
+ "right-bottom": { x: size + (symbolGap * scaleFontSize) + width / 2.3, y: defaultFontSize / 4 },
119
+ "left-top": { x: -(size + (symbolGap * scaleFontSize) + width / 2.3), y: -(defaultFontSize / 4) },
120
+ "left-bottom": { x: -(size + (symbolGap * scaleFontSize) + width / 2.3), y: defaultFontSize / 4 },
138
121
  };
139
- if (item.type === "icon") {
140
- const icons = iconTags !== null && iconTags !== void 0 ? iconTags : dummyIconTags;
141
- const iconTag = icons === null || icons === void 0 ? void 0 : icons.find((icon) => icon.key === item.value);
142
- if (!iconTag)
143
- return null;
144
- const scale = defaultFontSize / 12;
145
- return (_createElement("g", Object.assign({}, item, { key: `icon-${tagIndex}-${i}`, transform: `translate(${posX - defaultFontSize}, ${posY - defaultFontSize / 2}) scale(${scale})` }), iconTag.icon));
146
- }
147
- if (item.type === "text") {
148
- return (_createElement("text", Object.assign({}, item, { key: `text-${tagIndex}-${i}`, x: posX, y: posY, textAnchor: "middle", dominantBaseline: "middle", fontSize: defaultFontSize }),
149
- item.value,
150
- " ",
151
- renderSymbol(item === null || item === void 0 ? void 0 : item.symbol)));
152
- }
153
- return null;
154
- });
155
- return (_jsx("g", { pointerEvents: "none", children: elements }, `group-${tagIndex}`));
122
+ const { x: sx, y: sy } = (_a = offsets[position]) !== null && _a !== void 0 ? _a : offsets.right;
123
+ return (_jsx("tspan", { x: posX + sx, y: posY + sy, textAnchor: "middle", dominantBaseline: "middle", fontSize: `${sizeFont}px`, children: symbol.value }, `symbol-${tagIndex}-${i}`));
124
+ };
125
+ if (item.type === "icon") {
126
+ const icons = iconTags !== null && iconTags !== void 0 ? iconTags : dummyIconTags;
127
+ const iconTag = icons === null || icons === void 0 ? void 0 : icons.find((icon) => icon.key === item.value);
128
+ if (!iconTag)
129
+ return null;
130
+ const scale = defaultFontSize / 12;
131
+ return (_createElement("g", Object.assign({}, item, { key: `icon-${tagIndex}-${i}`, transform: `translate(${posX - defaultFontSize / 1.3}, ${posY - defaultFontSize / 1.3}) scale(${scale})` }), iconTag.icon));
132
+ }
133
+ if (item.type === "text") {
134
+ const widthText = ((_c = item === null || item === void 0 ? void 0 : item.value) === null || _c === void 0 ? void 0 : _c.length) * defaultFontSize * 0.6;
135
+ return (_createElement("text", Object.assign({}, item, { key: `text-${tagIndex}-${i}`, x: posX, y: posY, textAnchor: "middle", dominantBaseline: "middle", fontSize: defaultFontSize }),
136
+ item.value,
137
+ renderSymbol(item === null || item === void 0 ? void 0 : item.symbol, widthText)));
138
+ }
139
+ return null;
156
140
  });
157
- }
141
+ return (_jsx("g", { pointerEvents: "none", transform: `rotate(${-rotation}, ${width / 2}, ${height / 2})`, children: elements }, `group-${tagIndex}`));
142
+ });
158
143
  };
159
144
  let commonProps = {
160
145
  fill,
@@ -162,6 +147,16 @@ const Layers = ({ components, selectedTable, iconTags, eventMatchTable, onHighli
162
147
  stroke,
163
148
  strokeWidth,
164
149
  };
150
+ const labelProps = {
151
+ labels,
152
+ id,
153
+ width,
154
+ height,
155
+ commonProps,
156
+ horizontalAlign,
157
+ verticalAlign,
158
+ rotation,
159
+ };
165
160
  const hasSelected = (selectedTable === null || selectedTable === void 0 ? void 0 : selectedTable.id) === id;
166
161
  if (hasSelected) {
167
162
  const eventSelectedStyles = eventMatchTable === null || eventMatchTable === void 0 ? void 0 : eventMatchTable.find((style) => style.event === "selected");
@@ -290,16 +285,7 @@ const Layers = ({ components, selectedTable, iconTags, eventMatchTable, onHighli
290
285
  "points",
291
286
  "tags",
292
287
  "seatCount",
293
- ]), commonProps), `${id}-rect`), renderTags(tags), showLabels && (_jsx("g", { transform: `rotate(${-rotation}, ${width / 2}, ${height / 2})`, pointerEvents: "none", children: labels === null || labels === void 0 ? void 0 : labels.map((_, index) => {
294
- var _a, _b, _c, _d, _e, _f, _g;
295
- const cx = width / 2 + ((_a = _ === null || _ === void 0 ? void 0 : _.x) !== null && _a !== void 0 ? _a : 0);
296
- const cy = height / 2 + ((_b = _ === null || _ === void 0 ? void 0 : _.y) !== null && _b !== void 0 ? _b : 0);
297
- return (_createElement("text", Object.assign({ pointerEvents: "none" }, omit(commonProps, [
298
- "opacity",
299
- "stroke",
300
- "strokeWidth",
301
- ]), { transform: `rotate(${(_c = _ === null || _ === void 0 ? void 0 : _.rotation) !== null && _c !== void 0 ? _c : 0}, ${cx},${cy})`, key: `${id}-label-${index}`, x: width / 2 + ((_d = _ === null || _ === void 0 ? void 0 : _.x) !== null && _d !== void 0 ? _d : 0), y: height / 2 + ((_e = _ === null || _ === void 0 ? void 0 : _.y) !== null && _e !== void 0 ? _e : 0), fill: (_f = _ === null || _ === void 0 ? void 0 : _.fontColor) !== null && _f !== void 0 ? _f : "black", fontSize: `${(_g = _ === null || _ === void 0 ? void 0 : _.fontSize) !== null && _g !== void 0 ? _g : 10}px`, fontWeight: "bold", textAnchor: "middle", dominantBaseline: "middle" }), _ === null || _ === void 0 ? void 0 : _.label));
302
- }) }))] }) }, id));
288
+ ]), commonProps), `${id}-rect`), renderTags(tags), showLabels && (_jsx("g", { transform: `rotate(${-rotation}, ${width / 2}, ${height / 2})`, pointerEvents: "none", children: _jsx(LabelItem, Object.assign({}, labelProps)) }))] }) }, id));
303
289
  case "polygon":
304
290
  if (!points)
305
291
  return null;
@@ -307,16 +293,7 @@ const Layers = ({ components, selectedTable, iconTags, eventMatchTable, onHighli
307
293
  const box = getBoundingBoxFromPoints(points, rotation !== null && rotation !== void 0 ? rotation : 0);
308
294
  const centerX = box.x + box.width / 2;
309
295
  const centerY = box.y + box.height / 2;
310
- return (_jsx("g", { "data-id": id, transform: `translate(${x}, ${y})`, children: _jsxs("g", { transform: `rotate(${rotation}, 0, 0)`, children: [_createElement("polygon", Object.assign({}, commonProps, { key: id, points: finalPoint, x: "0", y: "0" })), _jsx("g", { "data-text": `${id}-text`, transform: `rotate(${-rotation}, ${centerX}, ${centerY}) translate(${box === null || box === void 0 ? void 0 : box.x}, ${box === null || box === void 0 ? void 0 : box.y})`, children: labels === null || labels === void 0 ? void 0 : labels.map((_, index) => {
311
- var _a, _b, _c, _d, _e, _f, _g;
312
- const cx = (box === null || box === void 0 ? void 0 : box.width) / 2 + ((_a = _ === null || _ === void 0 ? void 0 : _.x) !== null && _a !== void 0 ? _a : 0);
313
- const cy = (box === null || box === void 0 ? void 0 : box.height) / 2 + ((_b = _ === null || _ === void 0 ? void 0 : _.y) !== null && _b !== void 0 ? _b : 0);
314
- return (_createElement("text", Object.assign({}, omit(commonProps, [
315
- "opacity",
316
- "stroke",
317
- "strokeWidth",
318
- ]), { transform: `rotate(${(_c = _ === null || _ === void 0 ? void 0 : _.rotation) !== null && _c !== void 0 ? _c : 0}, ${cx},${cy})`, key: `${id}-label-${index}`, x: (box === null || box === void 0 ? void 0 : box.width) / 2 + ((_d = _ === null || _ === void 0 ? void 0 : _.x) !== null && _d !== void 0 ? _d : 0), y: (box === null || box === void 0 ? void 0 : box.height) / 2 + ((_e = _ === null || _ === void 0 ? void 0 : _.y) !== null && _e !== void 0 ? _e : 0), fill: (_f = _ === null || _ === void 0 ? void 0 : _.fontColor) !== null && _f !== void 0 ? _f : "black", fontSize: `${(_g = _ === null || _ === void 0 ? void 0 : _.fontSize) !== null && _g !== void 0 ? _g : 10}px`, fontWeight: "bold", textAnchor: "middle", dominantBaseline: "middle" }), _ === null || _ === void 0 ? void 0 : _.label));
319
- }) })] }) }, id));
296
+ return (_jsx("g", { "data-id": id, transform: `translate(${x}, ${y})`, children: _jsxs("g", { transform: `rotate(${rotation}, 0, 0)`, children: [_createElement("polygon", Object.assign({}, commonProps, { key: id, points: finalPoint, x: "0", y: "0" })), _jsx("g", { "data-text": `${id}-text`, transform: `rotate(${-rotation}, ${centerX}, ${centerY}) translate(${box === null || box === void 0 ? void 0 : box.x}, ${box === null || box === void 0 ? void 0 : box.y})`, children: _jsx(LabelItem, Object.assign({}, labelProps)) })] }) }, id));
320
297
  case "circle":
321
298
  return (_jsxs("g", { style: { pointerEvents: "all" }, "data-id": id, transform: `translate(${x}, ${y})`, onContextMenu: (e) => e.preventDefault(), onDragEnter: (e) => {
322
299
  e.preventDefault(); // penting
@@ -362,16 +339,7 @@ const Layers = ({ components, selectedTable, iconTags, eventMatchTable, onHighli
362
339
  "points",
363
340
  "tags",
364
341
  "seatCount",
365
- ])), id), renderTags(tags), showLabels && (_jsx("g", { transform: `rotate(${-rotation}, ${width / 2}, ${height / 2})`, children: labels === null || labels === void 0 ? void 0 : labels.map((_, index) => {
366
- var _a, _b, _c, _d, _e, _f, _g;
367
- const cx = width / 2 + ((_a = _ === null || _ === void 0 ? void 0 : _.x) !== null && _a !== void 0 ? _a : 0);
368
- const cy = height / 2 + ((_b = _ === null || _ === void 0 ? void 0 : _.y) !== null && _b !== void 0 ? _b : 0);
369
- return (_createElement("text", Object.assign({}, omit(commonProps, [
370
- "opacity",
371
- "stroke",
372
- "strokeWidth",
373
- ]), { transform: `rotate(${(_c = _ === null || _ === void 0 ? void 0 : _.rotation) !== null && _c !== void 0 ? _c : 0}, ${cx},${cy})`, key: `${id}-label-${index}`, x: width / 2 + ((_d = _ === null || _ === void 0 ? void 0 : _.x) !== null && _d !== void 0 ? _d : 0), y: height / 2 + ((_e = _ === null || _ === void 0 ? void 0 : _.y) !== null && _e !== void 0 ? _e : 0), fill: (_f = _ === null || _ === void 0 ? void 0 : _.fontColor) !== null && _f !== void 0 ? _f : "black", fontSize: `${(_g = _ === null || _ === void 0 ? void 0 : _.fontSize) !== null && _g !== void 0 ? _g : 10}px`, fontWeight: "bold", textAnchor: "middle", dominantBaseline: "middle" }), _ === null || _ === void 0 ? void 0 : _.label));
374
- }) }))] })] }, id));
342
+ ])), id), renderTags(tags), showLabels && (_jsx("g", { transform: `rotate(${-rotation}, ${width / 2}, ${height / 2})`, children: _jsx(LabelItem, Object.assign({}, labelProps)) }))] })] }, id));
375
343
  case "table-seat-circle": {
376
344
  const seatCount = item.seatCount;
377
345
  const openSpace = (_b = item.openSpace) !== null && _b !== void 0 ? _b : 0;
@@ -436,10 +404,7 @@ const Layers = ({ components, selectedTable, iconTags, eventMatchTable, onHighli
436
404
  "points",
437
405
  "tags",
438
406
  "seatCount",
439
- ]), commonProps)), _jsx("g", { "data-seat": `${id}-seats`, children: seatCircles.map(({ cx, cy }, i) => (_jsx("circle", { cx: cx, cy: cy, r: seatRadius, fill: seatFill, className: item === null || item === void 0 ? void 0 : item.className }, `${id}-seat-${i}`))) }), renderTags(tags), showLabels && (_jsx("g", { transform: `rotate(${-rotation}, ${width / 2}, ${height / 2})`, children: labels === null || labels === void 0 ? void 0 : labels.map((_, index) => {
440
- var _a, _b, _c, _d;
441
- return (_jsx("text", { x: width / 2 + ((_a = _ === null || _ === void 0 ? void 0 : _.x) !== null && _a !== void 0 ? _a : 0), y: height / 2 + ((_b = _ === null || _ === void 0 ? void 0 : _.y) !== null && _b !== void 0 ? _b : 0), fill: (_c = _ === null || _ === void 0 ? void 0 : _.fontColor) !== null && _c !== void 0 ? _c : "black", fontSize: `${(_d = _ === null || _ === void 0 ? void 0 : _.fontSize) !== null && _d !== void 0 ? _d : 10}px`, fontWeight: "bold", textAnchor: "middle", dominantBaseline: "middle", transform: transformRotate, children: _ === null || _ === void 0 ? void 0 : _.label }, `${id}-label-${index}`));
442
- }) }))] }) }, id));
407
+ ]), commonProps)), _jsx("g", { "data-seat": `${id}-seats`, children: seatCircles.map(({ cx, cy }, i) => (_jsx("circle", { cx: cx, cy: cy, r: seatRadius, fill: seatFill, className: item === null || item === void 0 ? void 0 : item.className }, `${id}-seat-${i}`))) }), renderTags(tags), showLabels && (_jsx("g", { transform: `rotate(${-rotation}, ${width / 2}, ${height / 2})`, children: _jsx(LabelItem, Object.assign({}, labelProps)) }))] }) }, id));
443
408
  }
444
409
  case "table-seat-rect-circle": {
445
410
  const clamp = (v, min, max) => Math.max(min, Math.min(max, v));
@@ -568,16 +533,7 @@ const Layers = ({ components, selectedTable, iconTags, eventMatchTable, onHighli
568
533
  "points",
569
534
  "tags",
570
535
  "seatCount",
571
- ]), commonProps)), _jsx("g", { "data-seat": `${id}-seats`, children: seats === null || seats === void 0 ? void 0 : seats.map(({ height, width, x, y, id }, i) => (_jsx("rect", { x: x, y: y, id: `seat-${id}`, height: height, width: width, rx: radius / 4, fill: seatFill, className: item === null || item === void 0 ? void 0 : item.className }, `${id}-seat-${i}`))) }, `${id}-seats`), renderTags(tags), showLabels && (_jsx("g", { transform: `rotate(${-rotation}, ${width / 2}, ${height / 2})`, children: labels === null || labels === void 0 ? void 0 : labels.map((_, index) => {
572
- var _a, _b, _c, _d, _e, _f, _g;
573
- const cx = width / 2 + ((_a = _ === null || _ === void 0 ? void 0 : _.x) !== null && _a !== void 0 ? _a : 0);
574
- const cy = height / 2 + ((_b = _ === null || _ === void 0 ? void 0 : _.y) !== null && _b !== void 0 ? _b : 0);
575
- return (_createElement("text", Object.assign({}, omit(commonProps, [
576
- "opacity",
577
- "stroke",
578
- "strokeWidth",
579
- ]), { transform: `rotate(${(_c = _ === null || _ === void 0 ? void 0 : _.rotation) !== null && _c !== void 0 ? _c : 0}, ${cx},${cy})`, key: `${id}-label-${index}`, x: width / 2 + ((_d = _ === null || _ === void 0 ? void 0 : _.x) !== null && _d !== void 0 ? _d : 0), y: height / 2 + ((_e = _ === null || _ === void 0 ? void 0 : _.y) !== null && _e !== void 0 ? _e : 0), fill: (_f = _ === null || _ === void 0 ? void 0 : _.fontColor) !== null && _f !== void 0 ? _f : "black", fontSize: `${(_g = _ === null || _ === void 0 ? void 0 : _.fontSize) !== null && _g !== void 0 ? _g : 10}px`, fontWeight: "bold", textAnchor: "middle", dominantBaseline: "middle" }), _ === null || _ === void 0 ? void 0 : _.label));
580
- }) }))] }) }, id));
536
+ ]), commonProps)), _jsx("g", { "data-seat": `${id}-seats`, children: seats === null || seats === void 0 ? void 0 : seats.map(({ height, width, x, y, id }, i) => (_jsx("rect", { x: x, y: y, id: `seat-${id}`, height: height, width: width, rx: radius / 4, fill: seatFill, className: item === null || item === void 0 ? void 0 : item.className }, `${id}-seat-${i}`))) }, `${id}-seats`), renderTags(tags), showLabels && (_jsx("g", { transform: `rotate(${-rotation}, ${width / 2}, ${height / 2})`, children: _jsx(LabelItem, Object.assign({}, labelProps)) }))] }) }, id));
581
537
  }
582
538
  case "table-seat-square": {
583
539
  const openSpace = item.openSpace || 0; // from 0 to 0.9
@@ -677,16 +633,7 @@ const Layers = ({ components, selectedTable, iconTags, eventMatchTable, onHighli
677
633
  "points",
678
634
  "tags",
679
635
  "seatCount",
680
- ]))), renderTags(tags), _jsx("g", { "data-seat": `${id}-seats`, transform: `translate(${-x}, ${-y})`, children: [...topSeats, ...bottomSeats, ...leftSeats, ...rightSeats].map(({ cx, cy, id }, i) => (_jsx("circle", { id: `seat-${id}`, cx: cx, cy: cy, r: r, fill: seatFill, className: item === null || item === void 0 ? void 0 : item.className }, `${id}-seat-${i}`))) }, `${id}-seats`), showLabels && (_jsx("g", { transform: `rotate(${-rotation}, ${width / 2}, ${height / 2})`, children: labels === null || labels === void 0 ? void 0 : labels.map((_, index) => {
681
- var _a, _b, _c, _d, _e, _f, _g;
682
- const cx = width / 2 + ((_a = _ === null || _ === void 0 ? void 0 : _.x) !== null && _a !== void 0 ? _a : 0);
683
- const cy = height / 2 + ((_b = _ === null || _ === void 0 ? void 0 : _.y) !== null && _b !== void 0 ? _b : 0);
684
- return (_createElement("text", Object.assign({}, omit(commonProps, [
685
- "opacity",
686
- "stroke",
687
- "strokeWidth",
688
- ]), { transform: `rotate(${(_c = _ === null || _ === void 0 ? void 0 : _.rotation) !== null && _c !== void 0 ? _c : 0}, ${cx},${cy})`, key: `${id}-label-${index}`, x: width / 2 + ((_d = _ === null || _ === void 0 ? void 0 : _.x) !== null && _d !== void 0 ? _d : 0), y: height / 2 + ((_e = _ === null || _ === void 0 ? void 0 : _.y) !== null && _e !== void 0 ? _e : 0), fill: (_f = _ === null || _ === void 0 ? void 0 : _.fontColor) !== null && _f !== void 0 ? _f : "black", fontSize: `${(_g = _ === null || _ === void 0 ? void 0 : _.fontSize) !== null && _g !== void 0 ? _g : 10}px`, fontWeight: "bold", textAnchor: "middle", dominantBaseline: "middle" }), _ === null || _ === void 0 ? void 0 : _.label));
689
- }) }))] }) }, id));
636
+ ]))), renderTags(tags), _jsx("g", { "data-seat": `${id}-seats`, transform: `translate(${-x}, ${-y})`, children: [...topSeats, ...bottomSeats, ...leftSeats, ...rightSeats].map(({ cx, cy, id }, i) => (_jsx("circle", { id: `seat-${id}`, cx: cx, cy: cy, r: r, fill: seatFill, className: item === null || item === void 0 ? void 0 : item.className }, `${id}-seat-${i}`))) }, `${id}-seats`), showLabels && (_jsx("g", { transform: `rotate(${-rotation}, ${width / 2}, ${height / 2})`, children: _jsx(LabelItem, Object.assign({}, labelProps)) }))] }) }, id));
690
637
  }
691
638
  case "table-seat-half-square": {
692
639
  const openSpace = item.openSpace || 0;
@@ -790,16 +737,7 @@ const Layers = ({ components, selectedTable, iconTags, eventMatchTable, onHighli
790
737
  "points",
791
738
  "tags",
792
739
  "seatCount",
793
- ]))), _jsx("g", { "data-seat": `${id}-seats`, children: seats === null || seats === void 0 ? void 0 : seats.map(({ d, id }, i) => (_jsx("path", { id: `seat-${id}`, d: d, fill: seatFill, className: item === null || item === void 0 ? void 0 : item.className }, `${id}-seat-${i}`))) }, `${id}-seats`), renderTags(tags), showLabels && (_jsx("g", { transform: `rotate(${-rotation}, ${width / 2}, ${height / 2})`, children: labels === null || labels === void 0 ? void 0 : labels.map((_, index) => {
794
- var _a, _b, _c, _d, _e, _f, _g;
795
- const cx = width / 2 + ((_a = _ === null || _ === void 0 ? void 0 : _.x) !== null && _a !== void 0 ? _a : 0);
796
- const cy = height / 2 + ((_b = _ === null || _ === void 0 ? void 0 : _.y) !== null && _b !== void 0 ? _b : 0);
797
- return (_createElement("text", Object.assign({}, omit(commonProps, [
798
- "opacity",
799
- "stroke",
800
- "strokeWidth",
801
- ]), { transform: `rotate(${(_c = _ === null || _ === void 0 ? void 0 : _.rotation) !== null && _c !== void 0 ? _c : 0}, ${cx},${cy})`, key: `${id}-label-${index}`, x: width / 2 + ((_d = _ === null || _ === void 0 ? void 0 : _.x) !== null && _d !== void 0 ? _d : 0), y: height / 2 + ((_e = _ === null || _ === void 0 ? void 0 : _.y) !== null && _e !== void 0 ? _e : 0), fill: (_f = _ === null || _ === void 0 ? void 0 : _.fontColor) !== null && _f !== void 0 ? _f : "black", fontSize: `${(_g = _ === null || _ === void 0 ? void 0 : _.fontSize) !== null && _g !== void 0 ? _g : 10}px`, fontWeight: "bold", textAnchor: "middle", dominantBaseline: "middle" }), _ === null || _ === void 0 ? void 0 : _.label));
802
- }) }))] }) }, id));
740
+ ]))), _jsx("g", { "data-seat": `${id}-seats`, children: seats === null || seats === void 0 ? void 0 : seats.map(({ d, id }, i) => (_jsx("path", { id: `seat-${id}`, d: d, fill: seatFill, className: item === null || item === void 0 ? void 0 : item.className }, `${id}-seat-${i}`))) }, `${id}-seats`), renderTags(tags), showLabels && (_jsx("g", { transform: `rotate(${-rotation}, ${width / 2}, ${height / 2})`, children: _jsx(LabelItem, Object.assign({}, labelProps)) }))] }) }, id));
803
741
  }
804
742
  case "table-seat-rect-square": {
805
743
  const clamp = (v, min, max) => Math.max(min, Math.min(max, v));
@@ -927,16 +865,7 @@ const Layers = ({ components, selectedTable, iconTags, eventMatchTable, onHighli
927
865
  "points",
928
866
  "tags",
929
867
  "seatCount",
930
- ]))), _jsx("g", { "data-seat": `${id}-seats`, transform: `translate(${-x}, ${-y})`, children: seats === null || seats === void 0 ? void 0 : seats.map(({ height, width, x, y, id }, i) => (_jsx("rect", { x: x, y: y, id: `seat-${id}`, height: height, width: width, rx: radius / 4, fill: seatFill }, `${id}-seat-${i}`))) }, `${id}-seats`), renderTags(tags), showLabels && (_jsx("g", { transform: `rotate(${-rotation}, ${width / 2}, ${height / 2})`, children: labels === null || labels === void 0 ? void 0 : labels.map((_, index) => {
931
- var _a, _b, _c, _d, _e, _f, _g;
932
- const cx = width / 2 + ((_a = _ === null || _ === void 0 ? void 0 : _.x) !== null && _a !== void 0 ? _a : 0);
933
- const cy = height / 2 + ((_b = _ === null || _ === void 0 ? void 0 : _.y) !== null && _b !== void 0 ? _b : 0);
934
- return (_createElement("text", Object.assign({}, omit(commonProps, [
935
- "opacity",
936
- "stroke",
937
- "strokeWidth",
938
- ]), { transform: `rotate(${(_c = _ === null || _ === void 0 ? void 0 : _.rotation) !== null && _c !== void 0 ? _c : 0}, ${cx},${cy})`, key: `${id}-label-${index}`, x: width / 2 + ((_d = _ === null || _ === void 0 ? void 0 : _.x) !== null && _d !== void 0 ? _d : 0), y: height / 2 + ((_e = _ === null || _ === void 0 ? void 0 : _.y) !== null && _e !== void 0 ? _e : 0), fill: (_f = _ === null || _ === void 0 ? void 0 : _.fontColor) !== null && _f !== void 0 ? _f : "black", fontSize: `${(_g = _ === null || _ === void 0 ? void 0 : _.fontSize) !== null && _g !== void 0 ? _g : 10}px`, fontWeight: "bold", textAnchor: "middle", dominantBaseline: "middle" }), _ === null || _ === void 0 ? void 0 : _.label));
939
- }) }))] }) }, id));
868
+ ]))), _jsx("g", { "data-seat": `${id}-seats`, transform: `translate(${-x}, ${-y})`, children: seats === null || seats === void 0 ? void 0 : seats.map(({ height, width, x, y, id }, i) => (_jsx("rect", { x: x, y: y, id: `seat-${id}`, height: height, width: width, rx: radius / 4, fill: seatFill }, `${id}-seat-${i}`))) }, `${id}-seats`), renderTags(tags), showLabels && (_jsx("g", { transform: `rotate(${-rotation}, ${width / 2}, ${height / 2})`, children: _jsx(LabelItem, Object.assign({}, labelProps)) }))] }) }, id));
940
869
  }
941
870
  case "text":
942
871
  return (_jsx("g", { onContextMenu: (e) => e.preventDefault(), "data-id": id, transform: `translate(${x}, ${y})`, children: _jsxs("g", { transform: `rotate(${rotation}, 0, 0)`, children: [_jsx("rect", { width: width, height: height, fill: "transparent", opacity: opacity }), _jsx("text", Object.assign({ x: width / 2, y: height / 2, textAnchor: "middle", dominantBaseline: "middle", fill: fill !== null && fill !== void 0 ? fill : fontColor, fontSize: fontSize !== null && fontSize !== void 0 ? fontSize : height * 0.6, opacity: opacity }, omit(commonProps, ["fill", "opacity"]), { children: text }))] }) }, id));
@@ -971,15 +900,9 @@ const Layers = ({ components, selectedTable, iconTags, eventMatchTable, onHighli
971
900
  e.preventDefault();
972
901
  const group = e.currentTarget;
973
902
  highlightGroup(group, "mousedown");
974
- }, children: _jsxs("g", { transform: `rotate(${rotation}, 0, 0)`, children: [_jsx("image", Object.assign({ href: src, width: width, height: height, transform: transformRotate }, commonProps)), renderTags(tags), showLabels && (_jsx("g", { transform: `rotate(${-rotation}, ${width / 2}, ${height / 2})`, children: labels === null || labels === void 0 ? void 0 : labels.map((_, index) => {
975
- var _a, _b, _c, _d;
976
- return (_jsx("text", { x: x + width / 2 + ((_a = _ === null || _ === void 0 ? void 0 : _.x) !== null && _a !== void 0 ? _a : 0), y: y + height / 2 + ((_b = _ === null || _ === void 0 ? void 0 : _.y) !== null && _b !== void 0 ? _b : 0), fill: (_c = _ === null || _ === void 0 ? void 0 : _.fontColor) !== null && _c !== void 0 ? _c : "black", fontSize: `${(_d = _ === null || _ === void 0 ? void 0 : _.fontSize) !== null && _d !== void 0 ? _d : 10}px`, fontWeight: "bold", textAnchor: "middle", dominantBaseline: "middle", transform: transformRotate, children: _ === null || _ === void 0 ? void 0 : _.label }, index));
977
- }) }))] }) }, id));
903
+ }, children: _jsxs("g", { transform: `rotate(${rotation}, 0, 0)`, children: [_jsx("image", Object.assign({ href: src, width: width, height: height, transform: transformRotate }, commonProps)), renderTags(tags), showLabels && (_jsx("g", { transform: `rotate(${-rotation}, ${width / 2}, ${height / 2})`, children: _jsx(LabelItem, Object.assign({}, labelProps)) }))] }) }, id));
978
904
  case "background":
979
- return (_jsxs("g", { onContextMenu: (e) => e.preventDefault(), children: [_jsx("image", Object.assign({ href: src, x: x, y: y, width: width, height: height, transform: transformRotate }, commonProps)), labels === null || labels === void 0 ? void 0 : labels.map((_, index) => {
980
- var _a, _b, _c, _d;
981
- return (_jsx("text", { x: x + width / 2 + ((_a = _ === null || _ === void 0 ? void 0 : _.x) !== null && _a !== void 0 ? _a : 0), y: y + height / 2 + ((_b = _ === null || _ === void 0 ? void 0 : _.y) !== null && _b !== void 0 ? _b : 0), fill: (_c = _ === null || _ === void 0 ? void 0 : _.fontColor) !== null && _c !== void 0 ? _c : "black", fontSize: `${(_d = _ === null || _ === void 0 ? void 0 : _.fontSize) !== null && _d !== void 0 ? _d : 10}px`, fontWeight: "bold", textAnchor: "middle", dominantBaseline: "middle", transform: transformRotate, children: _ === null || _ === void 0 ? void 0 : _.label }, index));
982
- })] }, id));
905
+ return (_jsx("g", { onContextMenu: (e) => e.preventDefault(), transform: `translate(${x}, ${y})`, children: _jsxs("g", { transform: `rotate(${rotation}, 0, 0)`, children: [_jsx("image", { href: src, width: width, height: height }), _jsx("g", { "data-text": `${id}-text`, transform: `rotate(${-rotation}, ${width / 2}, ${height / 2})`, children: _jsx(LabelItem, Object.assign({}, labelProps)) })] }) }, id));
983
906
  default:
984
907
  return _jsx("g", {}, id);
985
908
  }