@threekit-tools/treble 0.0.89 → 0.0.90-next-02

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 (158) hide show
  1. package/dist/Treble/Treble.d.ts +1 -1
  2. package/dist/Treble/Treble.js +3 -3
  3. package/dist/components/AttributeValue/index.js +2 -0
  4. package/dist/components/BreatheAnimation/index.js +2 -2
  5. package/dist/components/TurntableAnimation/index.js +2 -2
  6. package/dist/components/Wishlist/index.d.ts +1 -1
  7. package/dist/components/Zoom/index.d.ts +1 -1
  8. package/dist/components/containers/formInputContainer.d.ts +1 -1
  9. package/dist/components/containers/formInputContainer.js +3 -3
  10. package/dist/hooks/useConfigurationChangeStatus/index.d.ts +2 -0
  11. package/dist/hooks/useConfigurationChangeStatus/index.js +8 -0
  12. package/dist/hooks/useNestedConfigurator/index.js +1 -2
  13. package/dist/hooks/usePlayerReady/index.d.ts +2 -0
  14. package/dist/hooks/usePlayerReady/index.js +8 -0
  15. package/dist/hooks/useRoomBuilder/RoomBuilderLayout.d.ts +8 -0
  16. package/dist/hooks/useRoomBuilder/RoomBuilderLayout.js +22 -0
  17. package/dist/hooks/useRoomBuilder/RoomBuilderState.d.ts +132 -0
  18. package/dist/hooks/useRoomBuilder/RoomBuilderState.js +1431 -0
  19. package/dist/hooks/useRoomBuilder/constants.d.ts +56 -0
  20. package/dist/hooks/useRoomBuilder/constants.js +63 -0
  21. package/dist/hooks/useRoomBuilder/dataHandlers.d.ts +18 -0
  22. package/dist/hooks/useRoomBuilder/dataHandlers.js +187 -0
  23. package/dist/hooks/useRoomBuilder/draw.d.ts +55 -0
  24. package/dist/hooks/useRoomBuilder/draw.js +573 -0
  25. package/dist/hooks/useRoomBuilder/findLoops.d.ts +5 -0
  26. package/dist/hooks/useRoomBuilder/findLoops.js +99 -0
  27. package/dist/hooks/useRoomBuilder/geometry.d.ts +33 -0
  28. package/dist/hooks/useRoomBuilder/geometry.js +325 -0
  29. package/dist/hooks/useRoomBuilder/index.d.ts +57 -0
  30. package/dist/hooks/useRoomBuilder/index.js +411 -0
  31. package/dist/hooks/useRoomBuilder/messaging.d.ts +8 -0
  32. package/dist/hooks/useRoomBuilder/messaging.js +18 -0
  33. package/dist/hooks/useRoomBuilder/themes.d.ts +12 -0
  34. package/dist/hooks/useRoomBuilder/themes.js +273 -0
  35. package/dist/hooks/useRoomBuilder/types.d.ts +247 -0
  36. package/dist/hooks/useRoomBuilder/types.js +40 -0
  37. package/dist/hooks/useRoomBuilder/validators.d.ts +36 -0
  38. package/dist/hooks/useRoomBuilder/validators.js +362 -0
  39. package/dist/icons/Add.d.ts +1 -1
  40. package/dist/icons/Add.js +3 -3
  41. package/dist/icons/Angle.d.ts +3 -0
  42. package/dist/icons/Angle.js +21 -0
  43. package/dist/icons/ArrowLeft.d.ts +1 -1
  44. package/dist/icons/ArrowLeft.js +3 -3
  45. package/dist/icons/ArrowRight.d.ts +1 -1
  46. package/dist/icons/ArrowRight.js +3 -3
  47. package/dist/icons/Camera.d.ts +1 -1
  48. package/dist/icons/Camera.js +3 -3
  49. package/dist/icons/CaretDown.d.ts +1 -1
  50. package/dist/icons/CaretDown.js +3 -3
  51. package/dist/icons/CaretLeft.d.ts +1 -1
  52. package/dist/icons/CaretLeft.js +3 -3
  53. package/dist/icons/CaretRight.d.ts +1 -1
  54. package/dist/icons/CaretRight.js +3 -3
  55. package/dist/icons/CaretUp.d.ts +1 -1
  56. package/dist/icons/CaretUp.js +3 -3
  57. package/dist/icons/Cart.d.ts +1 -1
  58. package/dist/icons/Cart.js +3 -3
  59. package/dist/icons/Checkmate.d.ts +1 -1
  60. package/dist/icons/Checkmate.js +3 -3
  61. package/dist/icons/Clipboard.d.ts +1 -1
  62. package/dist/icons/Clipboard.js +3 -3
  63. package/dist/icons/ColorPicker.d.ts +1 -1
  64. package/dist/icons/ColorPicker.js +3 -3
  65. package/dist/icons/Copy.d.ts +1 -1
  66. package/dist/icons/Copy.js +3 -3
  67. package/dist/icons/Cursor.d.ts +3 -0
  68. package/dist/icons/Cursor.js +21 -0
  69. package/dist/icons/Delete.d.ts +1 -1
  70. package/dist/icons/Delete.js +3 -3
  71. package/dist/icons/Door.d.ts +3 -0
  72. package/dist/icons/Door.js +22 -0
  73. package/dist/icons/DoubleCaretLeft.d.ts +1 -1
  74. package/dist/icons/DoubleCaretLeft.js +3 -3
  75. package/dist/icons/DoubleCaretRight.d.ts +1 -1
  76. package/dist/icons/DoubleCaretRight.js +3 -3
  77. package/dist/icons/Download.d.ts +1 -1
  78. package/dist/icons/Download.js +3 -3
  79. package/dist/icons/Drag.d.ts +1 -1
  80. package/dist/icons/Drag.js +3 -3
  81. package/dist/icons/Draggable.d.ts +1 -1
  82. package/dist/icons/Draggable.js +3 -3
  83. package/dist/icons/Draw.d.ts +3 -0
  84. package/dist/icons/Draw.js +21 -0
  85. package/dist/icons/Edit.d.ts +1 -1
  86. package/dist/icons/Edit.js +3 -3
  87. package/dist/icons/Heart.d.ts +1 -1
  88. package/dist/icons/Heart.js +3 -3
  89. package/dist/icons/Image.d.ts +1 -1
  90. package/dist/icons/Image.js +3 -3
  91. package/dist/icons/Info.d.ts +1 -1
  92. package/dist/icons/Info.js +3 -3
  93. package/dist/icons/Layout.d.ts +3 -0
  94. package/dist/icons/Layout.js +21 -0
  95. package/dist/icons/Mail.d.ts +1 -1
  96. package/dist/icons/Mail.js +3 -3
  97. package/dist/icons/Menu.d.ts +1 -1
  98. package/dist/icons/Menu.js +3 -3
  99. package/dist/icons/More.d.ts +1 -1
  100. package/dist/icons/More.js +3 -3
  101. package/dist/icons/NewWindow.d.ts +1 -1
  102. package/dist/icons/NewWindow.js +3 -3
  103. package/dist/icons/Opening.d.ts +3 -0
  104. package/dist/icons/Opening.js +21 -0
  105. package/dist/icons/Pause.d.ts +1 -1
  106. package/dist/icons/Pause.js +3 -3
  107. package/dist/icons/Play.d.ts +1 -1
  108. package/dist/icons/Play.js +3 -3
  109. package/dist/icons/Player3D.d.ts +3 -0
  110. package/dist/icons/Player3D.js +21 -0
  111. package/dist/icons/Redo.d.ts +1 -1
  112. package/dist/icons/Redo.js +3 -3
  113. package/dist/icons/Remove.d.ts +1 -1
  114. package/dist/icons/Remove.js +3 -3
  115. package/dist/icons/Ruler.d.ts +1 -1
  116. package/dist/icons/Ruler.js +3 -3
  117. package/dist/icons/Search.d.ts +1 -1
  118. package/dist/icons/Search.js +3 -3
  119. package/dist/icons/Settings.d.ts +1 -1
  120. package/dist/icons/Settings.js +3 -3
  121. package/dist/icons/Share.d.ts +1 -1
  122. package/dist/icons/Share.js +3 -3
  123. package/dist/icons/Switch.d.ts +1 -1
  124. package/dist/icons/Switch.js +3 -3
  125. package/dist/icons/Tag.d.ts +1 -1
  126. package/dist/icons/Tag.js +3 -3
  127. package/dist/icons/TrashCan.d.ts +3 -0
  128. package/dist/icons/TrashCan.js +21 -0
  129. package/dist/icons/TrashCanAlt.d.ts +3 -0
  130. package/dist/icons/TrashCanAlt.js +21 -0
  131. package/dist/icons/Undo.d.ts +1 -1
  132. package/dist/icons/Undo.js +3 -3
  133. package/dist/icons/Wall.d.ts +3 -0
  134. package/dist/icons/Wall.js +21 -0
  135. package/dist/icons/Window.d.ts +3 -0
  136. package/dist/icons/Window.js +22 -0
  137. package/dist/icons/Wishlist.d.ts +1 -1
  138. package/dist/icons/Wishlist.js +3 -3
  139. package/dist/icons/ZoomIn.d.ts +1 -1
  140. package/dist/icons/ZoomIn.js +3 -3
  141. package/dist/icons/ZoomOut.d.ts +1 -1
  142. package/dist/icons/ZoomOut.js +3 -3
  143. package/dist/icons/index.d.ts +2 -6
  144. package/dist/icons/index.js +22 -0
  145. package/dist/icons/types.d.ts +7 -0
  146. package/dist/icons/types.js +2 -0
  147. package/dist/index.d.ts +17 -2
  148. package/dist/index.js +35 -4
  149. package/dist/store/attributes.d.ts +1 -0
  150. package/dist/store/index.d.ts +39 -8
  151. package/dist/store/index.js +3 -1
  152. package/dist/store/roomBuilder.d.ts +38 -0
  153. package/dist/store/roomBuilder.js +174 -0
  154. package/dist/store/treble.js +16 -9
  155. package/dist/types.d.ts +47 -7
  156. package/dist/types.js +1 -0
  157. package/dist/utils.d.ts +1 -1
  158. package/package.json +1 -1
@@ -0,0 +1,362 @@
1
+ "use strict";
2
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
3
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
4
+ if (ar || !(i in from)) {
5
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
6
+ ar[i] = from[i];
7
+ }
8
+ }
9
+ return to.concat(ar || Array.prototype.slice.call(from));
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.runValidators = exports.isVertexLandingOnFeature = exports.areWallsDuplicated = exports.areWallsOrphaningFeatures = exports.areWallsIntersecting = exports.areWallsTooShort = exports.isFeatureCollidingWithExistingFeature = exports.isFeatureOutsideWallBounds = exports.isWallEndingOnFeature = exports.isWallOverlappingExisitingWalls = exports.isWallIntersectingFeature = exports.isWallTooShort = void 0;
13
+ var types_1 = require("./types");
14
+ var geometry_1 = require("./geometry");
15
+ var messaging_1 = require("./messaging");
16
+ var constants_1 = require("./constants");
17
+ function isLineTooShort(wallOrLine) {
18
+ var minLength = constants_1.MIN_WALL_LENGTH;
19
+ var line = Array.isArray(wallOrLine) ? wallOrLine : wallOrLine.line;
20
+ var tooClose = geometry_1.arePointsWithinProximity.apply(void 0, __spreadArray(__spreadArray([], line, false), [minLength], false));
21
+ if (tooClose)
22
+ return {
23
+ message: messaging_1.errorMessages.wallTooShort(),
24
+ type: types_1.IErrorTypes.HARD,
25
+ };
26
+ return false;
27
+ }
28
+ function isWallTooShort(input) {
29
+ return isLineTooShort(input.newWall.line);
30
+ }
31
+ exports.isWallTooShort = isWallTooShort;
32
+ function isWallIntersectingFeature(input) {
33
+ var _a;
34
+ var newWall = input.newWall, walls = input.walls, features = input.features;
35
+ if (!walls.length || !Object.values(features).flat().length)
36
+ return false;
37
+ var intersectingFeature;
38
+ for (var i = 0; i < walls.length && !intersectingFeature; i++) {
39
+ if (!walls[i].connections)
40
+ continue;
41
+ var intersectionPoint = (0, geometry_1.getLineSegmentsIntersection)(newWall.line, walls[i].line);
42
+ if (!intersectionPoint)
43
+ continue;
44
+ var intersectionOffset = (0, geometry_1.getLengthOfLineSegment)([
45
+ walls[i].line[0],
46
+ intersectionPoint,
47
+ ]);
48
+ for (var j = 0; j < walls[i].connections.length && !intersectingFeature; j++) {
49
+ var _b = walls[i].connections[j], type = _b[0], index = _b[1];
50
+ var feature = (_a = features[type]) === null || _a === void 0 ? void 0 : _a[index];
51
+ if (!feature)
52
+ continue;
53
+ if (feature.offset < intersectionOffset &&
54
+ intersectionOffset < feature.offset + feature.length)
55
+ intersectingFeature = { type: type, index: index };
56
+ }
57
+ }
58
+ if (!intersectingFeature)
59
+ return false;
60
+ return ({
61
+ address: intersectingFeature,
62
+ message: messaging_1.errorMessages.addWallCollidingWithFeature(intersectingFeature.type),
63
+ type: types_1.IErrorTypes.SOFT,
64
+ } || false);
65
+ }
66
+ exports.isWallIntersectingFeature = isWallIntersectingFeature;
67
+ function isWallOverlappingExisitingWalls(input) {
68
+ var newWall = input.newWall, walls = input.walls;
69
+ var snapStartTo = newWall.snapStartTo, snapEndTo = newWall.snapEndTo;
70
+ if ((snapStartTo === null || snapStartTo === void 0 ? void 0 : snapStartTo.type) === types_1.IElements.WALL &&
71
+ (snapEndTo === null || snapEndTo === void 0 ? void 0 : snapEndTo.type) === types_1.IElements.WALL &&
72
+ snapStartTo.index === snapEndTo.index) {
73
+ return {
74
+ address: {
75
+ type: types_1.IElements.WALL,
76
+ index: snapStartTo.index,
77
+ },
78
+ type: types_1.IErrorTypes.SOFT,
79
+ message: messaging_1.errorMessages.wallsNotUnique(),
80
+ };
81
+ }
82
+ var overlappingIndex = walls.findIndex(function (wall, i) {
83
+ var line = wall.line;
84
+ if ((0, geometry_1.areLinesEqual)(line, newWall.line))
85
+ return true;
86
+ if ((snapStartTo === null || snapStartTo === void 0 ? void 0 : snapStartTo.type) === types_1.IElements.VERTEX &&
87
+ ((0, geometry_1.arePointsEqual)(snapStartTo.point, line[0]) ||
88
+ (0, geometry_1.arePointsEqual)(snapStartTo.point, line[1])) &&
89
+ (snapEndTo === null || snapEndTo === void 0 ? void 0 : snapEndTo.type) === types_1.IElements.WALL &&
90
+ snapEndTo.index === i) {
91
+ return true;
92
+ }
93
+ if ((snapEndTo === null || snapEndTo === void 0 ? void 0 : snapEndTo.type) === types_1.IElements.VERTEX &&
94
+ ((0, geometry_1.arePointsEqual)(snapEndTo.point, line[0]) ||
95
+ (0, geometry_1.arePointsEqual)(snapEndTo.point, line[1])) &&
96
+ (snapStartTo === null || snapStartTo === void 0 ? void 0 : snapStartTo.type) === types_1.IElements.WALL &&
97
+ snapStartTo.index === i) {
98
+ return true;
99
+ }
100
+ return false;
101
+ });
102
+ if (overlappingIndex !== -1) {
103
+ return {
104
+ address: {
105
+ type: types_1.IElements.WALL,
106
+ index: overlappingIndex,
107
+ },
108
+ type: types_1.IErrorTypes.SOFT,
109
+ message: messaging_1.errorMessages.wallsNotUnique(),
110
+ };
111
+ }
112
+ return false;
113
+ }
114
+ exports.isWallOverlappingExisitingWalls = isWallOverlappingExisitingWalls;
115
+ function isWallEndingOnFeature(input) {
116
+ var snapPoint = input.newWall.snapEndTo;
117
+ if (!snapPoint)
118
+ return false;
119
+ if (snapPoint.type === types_1.IElements.WINDOW ||
120
+ snapPoint.type === types_1.IElements.DOOR ||
121
+ snapPoint.type === types_1.IElements.OPENING)
122
+ return {
123
+ address: snapPoint,
124
+ message: messaging_1.errorMessages.addWallCollidingWithFeature(snapPoint.type),
125
+ type: types_1.IErrorTypes.SOFT,
126
+ };
127
+ return false;
128
+ }
129
+ exports.isWallEndingOnFeature = isWallEndingOnFeature;
130
+ function isFeatureOutsideWallBounds(input) {
131
+ var wall = input.wall, updatedFeature = input.updatedFeature;
132
+ var padding = constants_1.WALL_PADDING_FOR_FEATURE;
133
+ var wallLength = (0, geometry_1.getLengthOfLineSegment)(wall.line);
134
+ if (updatedFeature.offset < padding ||
135
+ updatedFeature.offset + updatedFeature.length > wallLength - padding)
136
+ return {
137
+ address: updatedFeature.address,
138
+ type: types_1.IErrorTypes.HARD,
139
+ message: messaging_1.errorMessages.featureOutsideWallBounds(),
140
+ };
141
+ return false;
142
+ }
143
+ exports.isFeatureOutsideWallBounds = isFeatureOutsideWallBounds;
144
+ function isFeatureCollidingWithExistingFeature(input) {
145
+ var _a, _b;
146
+ var features = input.features, wall = input.wall, updatedFeature = input.updatedFeature;
147
+ if (!features || !((_a = wall.connections) === null || _a === void 0 ? void 0 : _a.length))
148
+ return false;
149
+ if (!Object.values(updatedFeature).flat().length)
150
+ return false;
151
+ for (var i = 0; i < wall.connections.length; i++) {
152
+ var _c = wall.connections[i], type = _c[0], index = _c[1];
153
+ if (updatedFeature.address.type === type &&
154
+ updatedFeature.address.index === index)
155
+ continue;
156
+ var existingFeature = (_b = features[type]) === null || _b === void 0 ? void 0 : _b[index];
157
+ if (!existingFeature)
158
+ continue;
159
+ if ((0, geometry_1.doLinesOverlap)([updatedFeature.offset, updatedFeature.length], [existingFeature.offset, existingFeature.length]))
160
+ return {
161
+ address: { type: type, index: index },
162
+ type: types_1.IErrorTypes.SOFT,
163
+ message: messaging_1.errorMessages.featuresColliding(type),
164
+ };
165
+ }
166
+ return false;
167
+ }
168
+ exports.isFeatureCollidingWithExistingFeature = isFeatureCollidingWithExistingFeature;
169
+ function areWallsTooShort(input) {
170
+ var walls = input.walls, vertex = input.vertex, updatedPosition = input.updatedPosition;
171
+ var _a = vertex.connections.reduce(function (output, connection) {
172
+ var _a;
173
+ var wallIndex = connection[0], vertexIndex = connection[1];
174
+ output.wallIndexes.push(wallIndex);
175
+ output.updatedVerticesMap = Object.assign(output.updatedVerticesMap, (_a = {},
176
+ _a[wallIndex] = vertexIndex,
177
+ _a));
178
+ return output;
179
+ }, {
180
+ wallIndexes: [],
181
+ updatedVerticesMap: {},
182
+ }), wallIndexes = _a.wallIndexes, updatedVerticesMap = _a.updatedVerticesMap;
183
+ for (var _i = 0, wallIndexes_1 = wallIndexes; _i < wallIndexes_1.length; _i++) {
184
+ var index = wallIndexes_1[_i];
185
+ var line = walls[index].line;
186
+ line[updatedVerticesMap[index]] = updatedPosition.point;
187
+ if (isLineTooShort(line))
188
+ return {
189
+ address: { type: types_1.IElements.WALL, index: index },
190
+ message: messaging_1.errorMessages.wallTooShort(),
191
+ type: types_1.IErrorTypes.HARD,
192
+ };
193
+ }
194
+ return false;
195
+ }
196
+ exports.areWallsTooShort = areWallsTooShort;
197
+ function areWallsIntersecting(input) {
198
+ var walls = input.walls, vertex = input.vertex, updatedPosition = input.updatedPosition;
199
+ var _a = vertex.connections.reduce(function (output, connection) {
200
+ var _a;
201
+ var wallIndex = connection[0], vertexIndex = connection[1];
202
+ output.wallIndexes.add(wallIndex);
203
+ output.updatedVerticesMap = Object.assign(output.updatedVerticesMap, (_a = {},
204
+ _a[wallIndex] = vertexIndex,
205
+ _a));
206
+ return output;
207
+ }, {
208
+ wallIndexes: new Set([]),
209
+ updatedVerticesMap: {},
210
+ }), wallIndexes = _a.wallIndexes, updatedVerticesMap = _a.updatedVerticesMap;
211
+ for (var _i = 0, _b = Array.from(wallIndexes); _i < _b.length; _i++) {
212
+ var validateWallIndex = _b[_i];
213
+ var line = walls[validateWallIndex].line;
214
+ line[updatedVerticesMap[validateWallIndex]] = updatedPosition.point;
215
+ for (var i = 0; i < walls.length; i++) {
216
+ if (wallIndexes.has(i))
217
+ continue;
218
+ var wall = walls[i];
219
+ if (!wall)
220
+ continue;
221
+ var intersectionPoint = (0, geometry_1.getLineSegmentsIntersection)(line, wall.line);
222
+ if (intersectionPoint)
223
+ return {
224
+ address: { type: types_1.IElements.WALL, index: i },
225
+ message: messaging_1.errorMessages.addWallCollidingWithWall(),
226
+ type: types_1.IErrorTypes.SOFT,
227
+ };
228
+ }
229
+ }
230
+ return false;
231
+ }
232
+ exports.areWallsIntersecting = areWallsIntersecting;
233
+ function areWallsOrphaningFeatures(input) {
234
+ var _a;
235
+ var walls = input.walls, vertex = input.vertex, features = input.features, updatedPosition = input.updatedPosition;
236
+ var _b = vertex.connections.reduce(function (output, connection) {
237
+ var _a;
238
+ var wallIndex = connection[0], vertexIndex = connection[1];
239
+ output.wallIndexes.add(wallIndex);
240
+ output.updatedVerticesMap = Object.assign(output.updatedVerticesMap, (_a = {},
241
+ _a[wallIndex] = vertexIndex,
242
+ _a));
243
+ return output;
244
+ }, {
245
+ wallIndexes: new Set([]),
246
+ updatedVerticesMap: {},
247
+ }), wallIndexes = _b.wallIndexes, updatedVerticesMap = _b.updatedVerticesMap;
248
+ for (var _i = 0, _c = Array.from(wallIndexes); _i < _c.length; _i++) {
249
+ var wallIdx = _c[_i];
250
+ var wall = walls[wallIdx];
251
+ if (!wall.connections.length)
252
+ continue;
253
+ var updatedLine = JSON.parse(JSON.stringify(wall.line));
254
+ updatedLine[updatedVerticesMap[wallIdx]] = updatedPosition.point;
255
+ var currentWallLength = (0, geometry_1.getLengthOfLineSegment)(wall.line);
256
+ var updatedWallLength = (0, geometry_1.getLengthOfLineSegment)(updatedLine);
257
+ var wallLengthDelta = updatedWallLength - currentWallLength;
258
+ for (var i = 0; i < wall.connections.length; i++) {
259
+ var _d = wall.connections[i], type = _d[0], index = _d[1];
260
+ var feat = (_a = features[type]) === null || _a === void 0 ? void 0 : _a[index];
261
+ if (!feat)
262
+ continue;
263
+ var error = {
264
+ address: { type: type, index: index },
265
+ message: 'feature collision',
266
+ type: types_1.IErrorTypes.HARD,
267
+ };
268
+ if (updatedVerticesMap[wallIdx] === 0 &&
269
+ feat.offset - wallLengthDelta < constants_1.WALL_PADDING_FOR_FEATURE)
270
+ return error;
271
+ else if (feat.offset + feat.length >
272
+ updatedWallLength - constants_1.WALL_PADDING_FOR_FEATURE) {
273
+ return error;
274
+ }
275
+ }
276
+ }
277
+ return false;
278
+ }
279
+ exports.areWallsOrphaningFeatures = areWallsOrphaningFeatures;
280
+ function areWallsDuplicated(input) {
281
+ var _a, _b, _c;
282
+ var walls = input.walls, vertex = input.vertex, updatedPosition = input.updatedPosition;
283
+ var point = (_b = (_a = updatedPosition.snapTo) === null || _a === void 0 ? void 0 : _a.point) !== null && _b !== void 0 ? _b : updatedPosition.point;
284
+ var _d = vertex.connections.reduce(function (output, connection) {
285
+ var _a;
286
+ var wallIndex = connection[0], vertexIndex = connection[1];
287
+ output.wallIndexes.add(wallIndex);
288
+ output.updatedVerticesMap = Object.assign(output.updatedVerticesMap, (_a = {},
289
+ _a[wallIndex] = vertexIndex,
290
+ _a));
291
+ return output;
292
+ }, {
293
+ wallIndexes: new Set([]),
294
+ updatedVerticesMap: {},
295
+ }), wallIndexes = _d.wallIndexes, updatedVerticesMap = _d.updatedVerticesMap;
296
+ for (var _i = 0, _e = Array.from(wallIndexes); _i < _e.length; _i++) {
297
+ var wallIdx = _e[_i];
298
+ var wall = walls[wallIdx];
299
+ var updatedLine = JSON.parse(JSON.stringify(wall.line));
300
+ updatedLine[updatedVerticesMap[wallIdx]] = point;
301
+ if (((_c = updatedPosition.snapTo) === null || _c === void 0 ? void 0 : _c.type) === types_1.IElements.WALL &&
302
+ updatedPosition.snapTo.index !== wallIdx) {
303
+ var _f = walls[updatedPosition.snapTo.index].line, xTest = _f[0], yTest = _f[1];
304
+ var unmovedPoint = updatedLine[updatedVerticesMap[wallIdx] === 1 ? 0 : 1];
305
+ if ((0, geometry_1.arePointsEqual)(unmovedPoint, xTest) ||
306
+ (0, geometry_1.arePointsEqual)(unmovedPoint, yTest))
307
+ return {
308
+ address: {
309
+ type: types_1.IElements.WALL,
310
+ index: updatedPosition.snapTo.index,
311
+ },
312
+ type: types_1.IErrorTypes.SOFT,
313
+ message: messaging_1.errorMessages.wallsNotUnique(),
314
+ };
315
+ }
316
+ for (var i = 0; i < walls.length; i++) {
317
+ if (wallIdx === i)
318
+ continue;
319
+ var existingWall = walls[i];
320
+ var error = {
321
+ address: { type: types_1.IElements.WALL, index: i },
322
+ type: types_1.IErrorTypes.SOFT,
323
+ message: messaging_1.errorMessages.wallsNotUnique(),
324
+ };
325
+ if (((0, geometry_1.arePointsEqual)(existingWall[0], wall.line[0]) &&
326
+ (0, geometry_1.arePointsEqual)(existingWall[1], wall.line[1])) ||
327
+ ((0, geometry_1.arePointsEqual)(existingWall[0], wall.line[1]) &&
328
+ (0, geometry_1.arePointsEqual)(existingWall[1], wall.line[0]))) {
329
+ return error;
330
+ }
331
+ }
332
+ }
333
+ return false;
334
+ }
335
+ exports.areWallsDuplicated = areWallsDuplicated;
336
+ function isVertexLandingOnFeature(input) {
337
+ var snapPoint = input.updatedPosition.snapTo;
338
+ if (!snapPoint)
339
+ return false;
340
+ if (snapPoint.type === types_1.IElements.WINDOW ||
341
+ snapPoint.type === types_1.IElements.DOOR ||
342
+ snapPoint.type === types_1.IElements.OPENING)
343
+ return {
344
+ address: snapPoint,
345
+ message: messaging_1.errorMessages.addWallCollidingWithFeature(snapPoint.type),
346
+ type: types_1.IErrorTypes.SOFT,
347
+ };
348
+ return false;
349
+ }
350
+ exports.isVertexLandingOnFeature = isVertexLandingOnFeature;
351
+ function runValidators(validators, input) {
352
+ var errors = validators.reduce(function (output, validate) {
353
+ var error = validate(input);
354
+ if (error)
355
+ output.push(error);
356
+ return output;
357
+ }, []);
358
+ if (errors.length)
359
+ return errors;
360
+ return null;
361
+ }
362
+ exports.runValidators = runValidators;
@@ -1,3 +1,3 @@
1
- import { IIcon } from './index';
1
+ import { IIcon } from './types';
2
2
  export declare const Add: IIcon;
3
3
  export default Add;
package/dist/icons/Add.js CHANGED
@@ -10,9 +10,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.Add = void 0;
11
11
  var react_1 = __importDefault(require("react"));
12
12
  var styled_components_1 = __importDefault(require("styled-components"));
13
- var SVG = styled_components_1.default.svg(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .tk-icon {\n stroke: ", ";\n }\n"], ["\n .tk-icon {\n stroke: ", ";\n }\n"])), function (props) { return props.theme.textColor; });
14
- var Add = function () {
15
- return (react_1.default.createElement(SVG, { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
13
+ var SVG = styled_components_1.default.svg(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .tk-icon {\n stroke: ", ";\n }\n"], ["\n .tk-icon {\n stroke: ", ";\n }\n"])), function (props) { return props.color || props.theme.textColor; });
14
+ var Add = function (props) {
15
+ return (react_1.default.createElement(SVG, { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", color: props.color },
16
16
  react_1.default.createElement("path", { d: "M10 2V18M18 10H2", className: "tk-icon", strokeWidth: "2" })));
17
17
  };
18
18
  exports.Add = Add;
@@ -0,0 +1,3 @@
1
+ import { IIcon } from './types';
2
+ export declare const Angle: IIcon;
3
+ export default Angle;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
+ return cooked;
5
+ };
6
+ var __importDefault = (this && this.__importDefault) || function (mod) {
7
+ return (mod && mod.__esModule) ? mod : { "default": mod };
8
+ };
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.Angle = void 0;
11
+ var react_1 = __importDefault(require("react"));
12
+ var styled_components_1 = __importDefault(require("styled-components"));
13
+ var SVG = styled_components_1.default.svg(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .tk-icon {\n fill: ", ";\n }\n"], ["\n .tk-icon {\n fill: ", ";\n }\n"])), function (props) { return props.color || props.theme.textColor; });
14
+ var Angle = function (props) {
15
+ return (react_1.default.createElement(SVG, { width: "20", height: "21", viewBox: "0 0 20 21", fill: "none", xmlns: "http://www.w3.org/2000/svg", color: props.color },
16
+ react_1.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.0029 10.9668C10.9125 11.2917 10.039 11.9454 9.5216 12.8766C8.97049 13.8686 8.90036 15.0374 9.27465 16.2072L0.97078 16.1273C0.439764 16.1222 0.00515131 16.5486 4.53878e-05 17.0796C-0.00506054 17.6106 0.421274 18.0452 0.95229 18.0503L19.0292 18.2241C19.5602 18.2292 19.9948 17.8029 20 17.2719C20.0007 17.1974 19.9929 17.1248 19.9775 17.0551C19.9823 16.813 19.8962 16.5689 19.7174 16.3783L6.41793 2.20388C6.05457 1.81662 5.44606 1.79724 5.0588 2.1606C4.67154 2.52396 4.65216 3.13246 5.01552 3.51973L12.0029 10.9668ZM13.5876 12.6557L16.9894 16.2814L11.3602 16.2272C10.8318 15.2171 10.8908 14.3718 11.2027 13.8105C11.5367 13.2092 12.3007 12.6821 13.5876 12.6557Z", className: "tk-icon" })));
17
+ };
18
+ exports.Angle = Angle;
19
+ exports.Angle.iconName = 'angle';
20
+ exports.default = exports.Angle;
21
+ var templateObject_1;
@@ -1,3 +1,3 @@
1
- import { IIcon } from './index';
1
+ import { IIcon } from './types';
2
2
  export declare const ArrowLeft: IIcon;
3
3
  export default ArrowLeft;
@@ -10,9 +10,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.ArrowLeft = void 0;
11
11
  var react_1 = __importDefault(require("react"));
12
12
  var styled_components_1 = __importDefault(require("styled-components"));
13
- var SVG = styled_components_1.default.svg(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .tk-icon {\n stroke: ", ";\n }\n"], ["\n .tk-icon {\n stroke: ", ";\n }\n"])), function (props) { return props.theme.textColor; });
14
- var ArrowLeft = function () {
15
- return (react_1.default.createElement(SVG, { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
13
+ var SVG = styled_components_1.default.svg(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .tk-icon {\n stroke: ", ";\n }\n"], ["\n .tk-icon {\n stroke: ", ";\n }\n"])), function (props) { return props.color || props.theme.textColor; });
14
+ var ArrowLeft = function (props) {
15
+ return (react_1.default.createElement(SVG, { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", color: props.color },
16
16
  react_1.default.createElement("path", { d: "M9 4L3 10M3 10L9 16M3 10L18.5 10", className: "tk-icon", strokeWidth: "2" })));
17
17
  };
18
18
  exports.ArrowLeft = ArrowLeft;
@@ -1,3 +1,3 @@
1
- import { IIcon } from './index';
1
+ import { IIcon } from './types';
2
2
  export declare const ArrowRight: IIcon;
3
3
  export default ArrowRight;
@@ -10,9 +10,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.ArrowRight = void 0;
11
11
  var react_1 = __importDefault(require("react"));
12
12
  var styled_components_1 = __importDefault(require("styled-components"));
13
- var SVG = styled_components_1.default.svg(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .tk-icon {\n stroke: ", ";\n }\n"], ["\n .tk-icon {\n stroke: ", ";\n }\n"])), function (props) { return props.theme.textColor; });
14
- var ArrowRight = function () {
15
- return (react_1.default.createElement(SVG, { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
13
+ var SVG = styled_components_1.default.svg(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .tk-icon {\n stroke: ", ";\n }\n"], ["\n .tk-icon {\n stroke: ", ";\n }\n"])), function (props) { return props.color || props.theme.textColor; });
14
+ var ArrowRight = function (props) {
15
+ return (react_1.default.createElement(SVG, { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", color: props.color },
16
16
  react_1.default.createElement("path", { d: "M11.5 16L17.5 10M17.5 10L11.5 4M17.5 10L2 10", className: "tk-icon", strokeWidth: "2" })));
17
17
  };
18
18
  exports.ArrowRight = ArrowRight;
@@ -1,3 +1,3 @@
1
- import { IIcon } from './index';
1
+ import { IIcon } from './types';
2
2
  export declare const Camera: IIcon;
3
3
  export default Camera;
@@ -10,9 +10,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.Camera = void 0;
11
11
  var react_1 = __importDefault(require("react"));
12
12
  var styled_components_1 = __importDefault(require("styled-components"));
13
- var SVG = styled_components_1.default.svg(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .tk-icon {\n stroke: ", ";\n }\n"], ["\n .tk-icon {\n stroke: ", ";\n }\n"])), function (props) { return props.theme.textColor; });
14
- var Camera = function () {
15
- return (react_1.default.createElement(SVG, { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
13
+ var SVG = styled_components_1.default.svg(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .tk-icon {\n stroke: ", ";\n }\n"], ["\n .tk-icon {\n stroke: ", ";\n }\n"])), function (props) { return props.color || props.theme.textColor; });
14
+ var Camera = function (props) {
15
+ return (react_1.default.createElement(SVG, { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", color: props.color },
16
16
  react_1.default.createElement("path", { d: "M13.5 4H6.5L5.5 6H2V17H18V6H14.5L13.5 4Z", className: "tk-icon", strokeWidth: "2" }),
17
17
  react_1.default.createElement("circle", { cx: "10", cy: "11", r: "3", className: "tk-icon", strokeWidth: "2" })));
18
18
  };
@@ -1,3 +1,3 @@
1
- import { IIcon } from './index';
1
+ import { IIcon } from './types';
2
2
  export declare const CaretDown: IIcon;
3
3
  export default CaretDown;
@@ -10,9 +10,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.CaretDown = void 0;
11
11
  var react_1 = __importDefault(require("react"));
12
12
  var styled_components_1 = __importDefault(require("styled-components"));
13
- var SVG = styled_components_1.default.svg(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .tk-icon {\n stroke: ", ";\n }\n"], ["\n .tk-icon {\n stroke: ", ";\n }\n"])), function (props) { return props.theme.textColor; });
14
- var CaretDown = function () {
15
- return (react_1.default.createElement(SVG, { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
13
+ var SVG = styled_components_1.default.svg(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .tk-icon {\n stroke: ", ";\n }\n"], ["\n .tk-icon {\n stroke: ", ";\n }\n"])), function (props) { return props.color || props.theme.textColor; });
14
+ var CaretDown = function (props) {
15
+ return (react_1.default.createElement(SVG, { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", color: props.color },
16
16
  react_1.default.createElement("path", { d: "M3 7L10 14L17 7", className: "tk-icon", strokeWidth: "2" })));
17
17
  };
18
18
  exports.CaretDown = CaretDown;
@@ -1,3 +1,3 @@
1
- import { IIcon } from './index';
1
+ import { IIcon } from './types';
2
2
  export declare const CaretLeft: IIcon;
3
3
  export default CaretLeft;
@@ -10,9 +10,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.CaretLeft = void 0;
11
11
  var react_1 = __importDefault(require("react"));
12
12
  var styled_components_1 = __importDefault(require("styled-components"));
13
- var SVG = styled_components_1.default.svg(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .tk-icon {\n stroke: ", ";\n }\n"], ["\n .tk-icon {\n stroke: ", ";\n }\n"])), function (props) { return props.theme.textColor; });
14
- var CaretLeft = function () {
15
- return (react_1.default.createElement(SVG, { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
13
+ var SVG = styled_components_1.default.svg(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .tk-icon {\n stroke: ", ";\n }\n"], ["\n .tk-icon {\n stroke: ", ";\n }\n"])), function (props) { return props.color || props.theme.textColor; });
14
+ var CaretLeft = function (props) {
15
+ return (react_1.default.createElement(SVG, { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", color: props.color },
16
16
  react_1.default.createElement("path", { d: "M13.5 3L6.5 10L13.5 17", className: "tk-icon", strokeWidth: "2" })));
17
17
  };
18
18
  exports.CaretLeft = CaretLeft;
@@ -1,3 +1,3 @@
1
- import { IIcon } from './index';
1
+ import { IIcon } from './types';
2
2
  export declare const CaretRight: IIcon;
3
3
  export default CaretRight;
@@ -10,9 +10,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.CaretRight = void 0;
11
11
  var react_1 = __importDefault(require("react"));
12
12
  var styled_components_1 = __importDefault(require("styled-components"));
13
- var SVG = styled_components_1.default.svg(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .tk-icon {\n stroke: ", ";\n }\n"], ["\n .tk-icon {\n stroke: ", ";\n }\n"])), function (props) { return props.theme.textColor; });
14
- var CaretRight = function () {
15
- return (react_1.default.createElement(SVG, { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
13
+ var SVG = styled_components_1.default.svg(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .tk-icon {\n stroke: ", ";\n }\n"], ["\n .tk-icon {\n stroke: ", ";\n }\n"])), function (props) { return props.color || props.theme.textColor; });
14
+ var CaretRight = function (props) {
15
+ return (react_1.default.createElement(SVG, { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", color: props.color },
16
16
  react_1.default.createElement("path", { d: "M6.5 17L13.5 10L6.5 3", className: "tk-icon", strokeWidth: "2" })));
17
17
  };
18
18
  exports.CaretRight = CaretRight;
@@ -1,3 +1,3 @@
1
- import { IIcon } from './index';
1
+ import { IIcon } from './types';
2
2
  export declare const CaretUp: IIcon;
3
3
  export default CaretUp;
@@ -10,9 +10,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.CaretUp = void 0;
11
11
  var react_1 = __importDefault(require("react"));
12
12
  var styled_components_1 = __importDefault(require("styled-components"));
13
- var SVG = styled_components_1.default.svg(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .tk-icon {\n stroke: ", ";\n }\n"], ["\n .tk-icon {\n stroke: ", ";\n }\n"])), function (props) { return props.theme.textColor; });
14
- var CaretUp = function () {
15
- return (react_1.default.createElement(SVG, { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
13
+ var SVG = styled_components_1.default.svg(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .tk-icon {\n stroke: ", ";\n }\n"], ["\n .tk-icon {\n stroke: ", ";\n }\n"])), function (props) { return props.color || props.theme.textColor; });
14
+ var CaretUp = function (props) {
15
+ return (react_1.default.createElement(SVG, { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", color: props.color },
16
16
  react_1.default.createElement("path", { d: "M17 14L10 7L3 14", className: "tk-icon", strokeWidth: "2" })));
17
17
  };
18
18
  exports.CaretUp = CaretUp;
@@ -1,3 +1,3 @@
1
- import { IIcon } from './index';
1
+ import { IIcon } from './types';
2
2
  export declare const Cart: IIcon;
3
3
  export default Cart;
@@ -10,9 +10,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.Cart = void 0;
11
11
  var react_1 = __importDefault(require("react"));
12
12
  var styled_components_1 = __importDefault(require("styled-components"));
13
- var SVG = styled_components_1.default.svg(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .tk-icon {\n stroke: ", ";\n }\n"], ["\n .tk-icon {\n stroke: ", ";\n }\n"])), function (props) { return props.theme.textColor; });
14
- var Cart = function () {
15
- return (react_1.default.createElement(SVG, { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
13
+ var SVG = styled_components_1.default.svg(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .tk-icon {\n stroke: ", ";\n }\n"], ["\n .tk-icon {\n stroke: ", ";\n }\n"])), function (props) { return props.color || props.theme.textColor; });
14
+ var Cart = function (props) {
15
+ return (react_1.default.createElement(SVG, { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", color: props.color },
16
16
  react_1.default.createElement("path", { d: "M14.5 15H5.5L6.5 12M1.5 3H3.5L4.16667 5M6.5 12H14.5L17 5H4.16667M6.5 12L4.16667 5", className: "tk-icon", strokeLinecap: "round", strokeWidth: "2" }),
17
17
  react_1.default.createElement("circle", { cx: "5", cy: "16.5", r: "1", className: "tk-icon", strokeWidth: "1" }),
18
18
  react_1.default.createElement("circle", { cx: "15", cy: "16.5", r: "1", className: "tk-icon", strokeWidth: "1" })));
@@ -1,3 +1,3 @@
1
- import { IIcon } from './index';
1
+ import { IIcon } from './types';
2
2
  export declare const Checkmate: IIcon;
3
3
  export default Checkmate;
@@ -10,9 +10,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.Checkmate = void 0;
11
11
  var react_1 = __importDefault(require("react"));
12
12
  var styled_components_1 = __importDefault(require("styled-components"));
13
- var SVG = styled_components_1.default.svg(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .tk-icon {\n stroke: ", ";\n }\n"], ["\n .tk-icon {\n stroke: ", ";\n }\n"])), function (props) { return props.theme.textColor; });
14
- var Checkmate = function () {
15
- return (react_1.default.createElement(SVG, { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
13
+ var SVG = styled_components_1.default.svg(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .tk-icon {\n stroke: ", ";\n }\n"], ["\n .tk-icon {\n stroke: ", ";\n }\n"])), function (props) { return props.color || props.theme.textColor; });
14
+ var Checkmate = function (props) {
15
+ return (react_1.default.createElement(SVG, { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", color: props.color },
16
16
  react_1.default.createElement("path", { d: "M2 8.5L8 14.5L18 4.5", className: "tk-icon", strokeWidth: "2" })));
17
17
  };
18
18
  exports.Checkmate = Checkmate;
@@ -1,3 +1,3 @@
1
- import { IIcon } from './index';
1
+ import { IIcon } from './types';
2
2
  export declare const Clipboard: IIcon;
3
3
  export default Clipboard;
@@ -10,9 +10,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.Clipboard = void 0;
11
11
  var react_1 = __importDefault(require("react"));
12
12
  var styled_components_1 = __importDefault(require("styled-components"));
13
- var SVG = styled_components_1.default.svg(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .tk-icon {\n stroke: ", ";\n }\n"], ["\n .tk-icon {\n stroke: ", ";\n }\n"])), function (props) { return props.theme.textColor; });
14
- var Clipboard = function () {
15
- return (react_1.default.createElement(SVG, { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
13
+ var SVG = styled_components_1.default.svg(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .tk-icon {\n stroke: ", ";\n }\n"], ["\n .tk-icon {\n stroke: ", ";\n }\n"])), function (props) { return props.color || props.theme.textColor; });
14
+ var Clipboard = function (props) {
15
+ return (react_1.default.createElement(SVG, { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", color: props.color },
16
16
  react_1.default.createElement("path", { d: "M12 4L8 4V3L12 3V4Z", className: "tk-icon", strokeWidth: "2" }),
17
17
  react_1.default.createElement("path", { d: "M6 3H4V18H16V3H14", className: "tk-icon", strokeWidth: "2" }),
18
18
  react_1.default.createElement("path", { d: "M11.5 2C11.5 1.17157 10.8284 0.5 10 0.5C9.17157 0.5 8.5 1.17157 8.5 2", className: "tk-icon", strokeWidth: "1" }),
@@ -1,3 +1,3 @@
1
- import { IIcon } from './index';
1
+ import { IIcon } from './types';
2
2
  export declare const ColorPicker: IIcon;
3
3
  export default ColorPicker;