lines-overlay 0.1.20 → 0.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +5 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +668 -1
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +631 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +11 -11
- package/{components → src/components}/config-button.tsx +1 -1
- package/{lines-overlay.tsx → src/lines-overlay.tsx} +1 -1
- package/tsconfig.json +2 -2
- package/tsup.config.ts +17 -0
- package/dist/components/config-button.d.ts +0 -6
- package/dist/components/config-button.js +0 -51
- package/dist/components/config-options.d.ts +0 -2
- package/dist/components/config-options.js +0 -101
- package/dist/components/data.d.ts +0 -25
- package/dist/components/data.js +0 -28
- package/dist/components/index.d.ts +0 -3
- package/dist/components/index.js +0 -3
- package/dist/components/move-lines-button.d.ts +0 -4
- package/dist/components/move-lines-button.js +0 -44
- package/dist/lines-overlay.d.ts +0 -1
- package/dist/lines-overlay.js +0 -65
- package/dist/types.d.ts +0 -3
- package/dist/types.js +0 -1
- package/dist/ui/button.d.ts +0 -22
- package/dist/ui/button.js +0 -93
- package/dist/ui/buttons-wrapper.d.ts +0 -8
- package/dist/ui/buttons-wrapper.js +0 -13
- package/dist/ui/index.d.ts +0 -3
- package/dist/ui/index.js +0 -3
- package/dist/ui/lucide-icon.d.ts +0 -34
- package/dist/ui/lucide-icon.js +0 -37
- package/dist/ui/separator.d.ts +0 -6
- package/dist/ui/separator.js +0 -28
- package/index.css +0 -0
- /package/{comandos.txt → src/comandos.txt} +0 -0
- /package/{components → src/components}/config-options.tsx +0 -0
- /package/{components → src/components}/data.ts +0 -0
- /package/{components → src/components}/index.ts +0 -0
- /package/{components → src/components}/move-lines-button.tsx +0 -0
- /package/{index.ts → src/index.ts} +0 -0
- /package/{ui → src/ui}/button.tsx +0 -0
- /package/{ui → src/ui}/buttons-wrapper.tsx +0 -0
- /package/{ui → src/ui}/index.ts +0 -0
- /package/{ui → src/ui}/lucide-icon.tsx +0 -0
- /package/{ui → src/ui}/separator.tsx +0 -0
package/dist/index.d.mts
ADDED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1 +1,668 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/index.ts
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
|
+
RowGrid: () => RowGrid
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(index_exports);
|
|
36
|
+
|
|
37
|
+
// src/lines-overlay.tsx
|
|
38
|
+
var import_lucide_react3 = require("lucide-react");
|
|
39
|
+
var import_react2 = require("react");
|
|
40
|
+
|
|
41
|
+
// src/components/move-lines-button.tsx
|
|
42
|
+
var import_lucide_react = require("lucide-react");
|
|
43
|
+
var import_react = require("react");
|
|
44
|
+
|
|
45
|
+
// src/ui/button.tsx
|
|
46
|
+
var React = __toESM(require("react"));
|
|
47
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
48
|
+
var styles = {
|
|
49
|
+
base: {
|
|
50
|
+
width: "auto",
|
|
51
|
+
display: "inline-flex",
|
|
52
|
+
alignItems: "center",
|
|
53
|
+
justifyContent: "center",
|
|
54
|
+
gap: 8,
|
|
55
|
+
borderRadius: 6,
|
|
56
|
+
position: "relative",
|
|
57
|
+
outline: "none",
|
|
58
|
+
userSelect: "none"
|
|
59
|
+
},
|
|
60
|
+
variants: {
|
|
61
|
+
default: {
|
|
62
|
+
backgroundColor: "#0ea5e9",
|
|
63
|
+
color: "#ffffff"
|
|
64
|
+
},
|
|
65
|
+
ghost: {
|
|
66
|
+
backgroundColor: "transparent",
|
|
67
|
+
color: "#111827",
|
|
68
|
+
border: "1px solid #e5e7eb"
|
|
69
|
+
},
|
|
70
|
+
transparent: {
|
|
71
|
+
backgroundColor: "transparent",
|
|
72
|
+
color: "#0ea5e9"
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
sizes: {
|
|
76
|
+
default: {
|
|
77
|
+
minHeight: 40,
|
|
78
|
+
paddingInline: 12,
|
|
79
|
+
paddingBlock: 12 * 0.73438 / 0.93
|
|
80
|
+
},
|
|
81
|
+
sm: {
|
|
82
|
+
minHeight: 36,
|
|
83
|
+
paddingInline: 12,
|
|
84
|
+
paddingBlock: 10
|
|
85
|
+
},
|
|
86
|
+
"icon-sm": {
|
|
87
|
+
width: 32,
|
|
88
|
+
height: 32,
|
|
89
|
+
padding: 0
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
selected: {
|
|
93
|
+
border: "2px solid #60a5fa",
|
|
94
|
+
color: "#0ea5e9",
|
|
95
|
+
backgroundColor: "rgba(59,130,246,0.08)"
|
|
96
|
+
},
|
|
97
|
+
closeButton: {
|
|
98
|
+
borderRadius: 9999,
|
|
99
|
+
color: "#0f172a"
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
function resolveButtonStyles({
|
|
103
|
+
variant,
|
|
104
|
+
size,
|
|
105
|
+
selected,
|
|
106
|
+
disabled,
|
|
107
|
+
closeButton,
|
|
108
|
+
style
|
|
109
|
+
}) {
|
|
110
|
+
return {
|
|
111
|
+
...styles.base,
|
|
112
|
+
...styles.variants[variant],
|
|
113
|
+
...styles.sizes[size],
|
|
114
|
+
...disabled && { opacity: 0.6, cursor: "not-allowed" },
|
|
115
|
+
...selected && styles.selected,
|
|
116
|
+
...closeButton && styles.closeButton,
|
|
117
|
+
...style
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
var Slot = React.forwardRef(
|
|
121
|
+
({ children, className, style, ...slotProps }, ref) => {
|
|
122
|
+
if (!children || !React.isValidElement(children)) {
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
const child = children;
|
|
126
|
+
const mergedClassName = [className, child.props.className].filter(Boolean).join(" ");
|
|
127
|
+
const mergedStyle = { ...style, ...child.props.style };
|
|
128
|
+
return React.cloneElement(child, {
|
|
129
|
+
...slotProps,
|
|
130
|
+
...child.props,
|
|
131
|
+
className: mergedClassName || void 0,
|
|
132
|
+
style: mergedStyle,
|
|
133
|
+
ref
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
);
|
|
137
|
+
var Button = React.forwardRef(
|
|
138
|
+
({
|
|
139
|
+
className,
|
|
140
|
+
variant = "default",
|
|
141
|
+
size = "default",
|
|
142
|
+
asChild = false,
|
|
143
|
+
selected = false,
|
|
144
|
+
disabled = false,
|
|
145
|
+
closeButton = false,
|
|
146
|
+
style,
|
|
147
|
+
...props
|
|
148
|
+
}, ref) => {
|
|
149
|
+
const Comp = asChild ? Slot : "button";
|
|
150
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
151
|
+
Comp,
|
|
152
|
+
{
|
|
153
|
+
ref,
|
|
154
|
+
className,
|
|
155
|
+
disabled,
|
|
156
|
+
style: resolveButtonStyles({
|
|
157
|
+
variant,
|
|
158
|
+
size,
|
|
159
|
+
selected,
|
|
160
|
+
disabled,
|
|
161
|
+
closeButton,
|
|
162
|
+
style
|
|
163
|
+
}),
|
|
164
|
+
...props
|
|
165
|
+
}
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
);
|
|
169
|
+
|
|
170
|
+
// src/ui/lucide-icon.tsx
|
|
171
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
172
|
+
var weights = {
|
|
173
|
+
thin: 2.25,
|
|
174
|
+
light: 2.35,
|
|
175
|
+
normal: 2.65,
|
|
176
|
+
semibold: 2.75,
|
|
177
|
+
bold: 2.85,
|
|
178
|
+
extrabold: 3
|
|
179
|
+
};
|
|
180
|
+
var iconSizes = {
|
|
181
|
+
xs: "0.937em",
|
|
182
|
+
sm: "0.968em",
|
|
183
|
+
base: "1em",
|
|
184
|
+
md: "1.033em",
|
|
185
|
+
lg: "1.067em",
|
|
186
|
+
xl: "1.138em",
|
|
187
|
+
"2xl": "1.215em",
|
|
188
|
+
"3xl": "1.296em",
|
|
189
|
+
h6: "1.067em",
|
|
190
|
+
h5: "1.138em",
|
|
191
|
+
h4: "1.215em",
|
|
192
|
+
h3: "1.296em",
|
|
193
|
+
h2: "1.383em",
|
|
194
|
+
h1: "1.4757em"
|
|
195
|
+
};
|
|
196
|
+
var css = {
|
|
197
|
+
wrapper: {
|
|
198
|
+
height: "0.75rem",
|
|
199
|
+
display: "inline-flex",
|
|
200
|
+
justifyContent: "center",
|
|
201
|
+
alignItems: "center",
|
|
202
|
+
overflow: "visible"
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
var Icon = ({ Icon: Icon2, size, className, strokeWidth, fill }) => {
|
|
206
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { "data-icon": true, style: css.wrapper, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
207
|
+
Icon2,
|
|
208
|
+
{
|
|
209
|
+
size: iconSizes[size] || size || "1.067em",
|
|
210
|
+
strokeWidth: weights[strokeWidth] || strokeWidth || 2.6,
|
|
211
|
+
className,
|
|
212
|
+
fill: fill || "none"
|
|
213
|
+
}
|
|
214
|
+
) });
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
// src/ui/separator.tsx
|
|
218
|
+
var React2 = __toESM(require("react"));
|
|
219
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
220
|
+
var css2 = {
|
|
221
|
+
base: {
|
|
222
|
+
flexShrink: 0,
|
|
223
|
+
backgroundColor: "#e5e7eb"
|
|
224
|
+
},
|
|
225
|
+
horizontal: {
|
|
226
|
+
height: 1,
|
|
227
|
+
width: "100%"
|
|
228
|
+
},
|
|
229
|
+
vertical: {
|
|
230
|
+
height: "100%",
|
|
231
|
+
width: 1
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
var Separator = React2.forwardRef(
|
|
235
|
+
({ className, orientation = "horizontal", decorative = true, style, ...props }, ref) => {
|
|
236
|
+
const dimensionStyle = orientation === "horizontal" ? css2.horizontal : css2.vertical;
|
|
237
|
+
const ariaProps = decorative ? { role: "none" } : {
|
|
238
|
+
role: "separator",
|
|
239
|
+
"aria-orientation": orientation
|
|
240
|
+
};
|
|
241
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
242
|
+
"div",
|
|
243
|
+
{
|
|
244
|
+
ref,
|
|
245
|
+
style: { ...css2.base, ...dimensionStyle, ...style },
|
|
246
|
+
className,
|
|
247
|
+
...ariaProps,
|
|
248
|
+
...props
|
|
249
|
+
}
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
);
|
|
253
|
+
Separator.displayName = "Separator";
|
|
254
|
+
|
|
255
|
+
// src/components/move-lines-button.tsx
|
|
256
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
257
|
+
var css3 = {
|
|
258
|
+
wrapper: {
|
|
259
|
+
position: "absolute",
|
|
260
|
+
left: "50%",
|
|
261
|
+
top: "44%",
|
|
262
|
+
transform: "translate(-50%, -50%)",
|
|
263
|
+
pointerEvents: "auto"
|
|
264
|
+
},
|
|
265
|
+
button: {
|
|
266
|
+
borderRadius: 9999,
|
|
267
|
+
backgroundColor: "rgba(255,255,255,0.75)",
|
|
268
|
+
backdropFilter: "blur(2px)"
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
function MoveLinesButton({ targetRef }) {
|
|
272
|
+
const dragging = (0, import_react.useRef)(false);
|
|
273
|
+
const last = (0, import_react.useRef)({ x: 0, y: 0 });
|
|
274
|
+
function onMouseDown(e) {
|
|
275
|
+
dragging.current = true;
|
|
276
|
+
last.current = { x: e.clientX, y: e.clientY };
|
|
277
|
+
document.addEventListener("mousemove", onMove);
|
|
278
|
+
document.addEventListener("mouseup", onUp);
|
|
279
|
+
}
|
|
280
|
+
function onMove(e) {
|
|
281
|
+
if (!dragging.current || !targetRef.current) return;
|
|
282
|
+
const dx = e.clientX - last.current.x;
|
|
283
|
+
const dy = e.clientY - last.current.y;
|
|
284
|
+
const el = targetRef.current;
|
|
285
|
+
el.style.left = `${el.offsetLeft + dx}px`;
|
|
286
|
+
el.style.top = `${el.offsetTop + dy}px`;
|
|
287
|
+
last.current = { x: e.clientX, y: e.clientY };
|
|
288
|
+
}
|
|
289
|
+
function onUp() {
|
|
290
|
+
dragging.current = false;
|
|
291
|
+
document.removeEventListener("mousemove", onMove);
|
|
292
|
+
document.removeEventListener("mouseup", onUp);
|
|
293
|
+
}
|
|
294
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { style: css3.wrapper, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
295
|
+
Button,
|
|
296
|
+
{
|
|
297
|
+
size: "icon-sm",
|
|
298
|
+
"data-black": true,
|
|
299
|
+
variant: "ghost",
|
|
300
|
+
onMouseDown,
|
|
301
|
+
style: css3.button,
|
|
302
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { Icon: import_lucide_react.Move, size: "lg", strokeWidth: "thin" })
|
|
303
|
+
}
|
|
304
|
+
) });
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
// src/components/config-button.tsx
|
|
308
|
+
var import_lucide_react2 = require("lucide-react");
|
|
309
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
310
|
+
var css4 = {
|
|
311
|
+
container: {
|
|
312
|
+
position: "fixed",
|
|
313
|
+
bottom: 8,
|
|
314
|
+
right: 8,
|
|
315
|
+
zIndex: 9999,
|
|
316
|
+
pointerEvents: "auto",
|
|
317
|
+
height: 40,
|
|
318
|
+
borderWidth: 1,
|
|
319
|
+
borderStyle: "solid",
|
|
320
|
+
borderColor: "rgba(148,163,184,0.8)",
|
|
321
|
+
backgroundColor: "rgba(255,255,255,0.70)",
|
|
322
|
+
boxShadow: "0 1px 3px rgba(15,23,42,0.2)",
|
|
323
|
+
display: "flex",
|
|
324
|
+
alignItems: "center",
|
|
325
|
+
paddingLeft: 14,
|
|
326
|
+
paddingRight: 4
|
|
327
|
+
},
|
|
328
|
+
label: {
|
|
329
|
+
fontWeight: 500,
|
|
330
|
+
fontSize: "0.8125rem",
|
|
331
|
+
letterSpacing: "0.03em",
|
|
332
|
+
paddingRight: 8
|
|
333
|
+
},
|
|
334
|
+
buttonsRow: {
|
|
335
|
+
height: "100%",
|
|
336
|
+
display: "flex",
|
|
337
|
+
alignItems: "center",
|
|
338
|
+
gap: 4
|
|
339
|
+
},
|
|
340
|
+
closeIcon: {
|
|
341
|
+
color: "#dc2626"
|
|
342
|
+
}
|
|
343
|
+
};
|
|
344
|
+
function ConfigButton({
|
|
345
|
+
onToggleConfig,
|
|
346
|
+
open,
|
|
347
|
+
setShow
|
|
348
|
+
}) {
|
|
349
|
+
const handleClick = (e, item) => {
|
|
350
|
+
if (item === 1) {
|
|
351
|
+
onToggleConfig();
|
|
352
|
+
} else {
|
|
353
|
+
e.stopPropagation();
|
|
354
|
+
setShow((v) => !v);
|
|
355
|
+
}
|
|
356
|
+
};
|
|
357
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: css4.container, children: [
|
|
358
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { style: css4.label, children: "Configurar" }),
|
|
359
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { style: css4.buttonsRow, children: [1, 2, 3].map(
|
|
360
|
+
(item) => item !== 2 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
361
|
+
Button,
|
|
362
|
+
{
|
|
363
|
+
variant: "transparent",
|
|
364
|
+
size: "icon-sm",
|
|
365
|
+
"data-black": true,
|
|
366
|
+
onClick: (e) => {
|
|
367
|
+
handleClick(e, item);
|
|
368
|
+
},
|
|
369
|
+
children: item === 1 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { Icon: open ? import_lucide_react2.ChevronDown : import_lucide_react2.ChevronUp, size: "xl", strokeWidth: "light" }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { Icon: import_lucide_react2.X, size: "sm", strokeWidth: "light", className: void 0 })
|
|
370
|
+
},
|
|
371
|
+
item
|
|
372
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Separator, { orientation: "vertical" })
|
|
373
|
+
) })
|
|
374
|
+
] });
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
// src/components/data.ts
|
|
378
|
+
var NUMBER_FIELDS = [
|
|
379
|
+
{
|
|
380
|
+
key: "lines",
|
|
381
|
+
label: "Linhas",
|
|
382
|
+
quick: [2, 4, 8, 12],
|
|
383
|
+
step: 4
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
key: "gap",
|
|
387
|
+
label: "Gap",
|
|
388
|
+
quick: [16, 24, 32, 40, 44],
|
|
389
|
+
step: 4
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
key: "opacity",
|
|
393
|
+
label: "Opacidade",
|
|
394
|
+
quick: [0.2, 0.3, 0.5, 0.7],
|
|
395
|
+
step: 0.05
|
|
396
|
+
}
|
|
397
|
+
];
|
|
398
|
+
var colorOptions = [
|
|
399
|
+
{ name: "Azul", value: "#2563eb" },
|
|
400
|
+
{ name: "Amarelo", value: "#eab308" },
|
|
401
|
+
{ name: "Verde", value: "#16a34a" },
|
|
402
|
+
{ name: "Roxo", value: "#7c3aed" },
|
|
403
|
+
{ name: "Violeta", value: "#9333ea" },
|
|
404
|
+
{ name: "Violeta", value: "#d71212" }
|
|
405
|
+
];
|
|
406
|
+
|
|
407
|
+
// src/components/config-options.tsx
|
|
408
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
409
|
+
var css5 = {
|
|
410
|
+
container: {
|
|
411
|
+
position: "fixed",
|
|
412
|
+
bottom: 52,
|
|
413
|
+
right: 8,
|
|
414
|
+
zIndex: 1e3,
|
|
415
|
+
pointerEvents: "auto",
|
|
416
|
+
fontSize: "0.875rem",
|
|
417
|
+
backgroundColor: "rgba(255,255,255,0.94)",
|
|
418
|
+
backdropFilter: "blur(4px)",
|
|
419
|
+
boxShadow: "0 4px 6px rgba(15,23,42,0.12)",
|
|
420
|
+
borderWidth: 1,
|
|
421
|
+
borderStyle: "solid",
|
|
422
|
+
borderColor: "rgba(148,163,184,0.5)",
|
|
423
|
+
paddingInline: 12,
|
|
424
|
+
paddingBlock: 8,
|
|
425
|
+
width: "auto",
|
|
426
|
+
display: "flex",
|
|
427
|
+
flexDirection: "column",
|
|
428
|
+
gap: 8
|
|
429
|
+
},
|
|
430
|
+
fieldRow: {
|
|
431
|
+
width: "100%",
|
|
432
|
+
borderBottomWidth: 1,
|
|
433
|
+
borderBottomStyle: "solid",
|
|
434
|
+
borderBottomColor: "rgba(148,163,184,0.4)",
|
|
435
|
+
paddingBottom: 12,
|
|
436
|
+
display: "flex",
|
|
437
|
+
flexDirection: "column",
|
|
438
|
+
gap: 4
|
|
439
|
+
},
|
|
440
|
+
wrapper: {
|
|
441
|
+
display: "flex",
|
|
442
|
+
alignItems: "flex-end",
|
|
443
|
+
gap: 8,
|
|
444
|
+
borderRadius: 6
|
|
445
|
+
},
|
|
446
|
+
inputWrapper: {
|
|
447
|
+
width: 104
|
|
448
|
+
},
|
|
449
|
+
label: {
|
|
450
|
+
display: "block",
|
|
451
|
+
fontSize: "0.75rem",
|
|
452
|
+
fontWeight: 500,
|
|
453
|
+
marginBottom: 4
|
|
454
|
+
},
|
|
455
|
+
numberInput: {
|
|
456
|
+
width: "100%",
|
|
457
|
+
height: 32,
|
|
458
|
+
borderRadius: 6,
|
|
459
|
+
borderWidth: 1,
|
|
460
|
+
borderStyle: "solid",
|
|
461
|
+
borderColor: "#e5e7eb",
|
|
462
|
+
paddingInline: 8,
|
|
463
|
+
fontSize: "0.875rem"
|
|
464
|
+
},
|
|
465
|
+
quickRow: {
|
|
466
|
+
display: "flex",
|
|
467
|
+
gap: 5,
|
|
468
|
+
marginTop: 4
|
|
469
|
+
},
|
|
470
|
+
quickButton: {
|
|
471
|
+
fontWeight: 500,
|
|
472
|
+
fontSize: "0.875rem"
|
|
473
|
+
},
|
|
474
|
+
colorSection: {
|
|
475
|
+
marginTop: 8
|
|
476
|
+
},
|
|
477
|
+
colorLabel: {
|
|
478
|
+
display: "block",
|
|
479
|
+
fontSize: "0.75rem",
|
|
480
|
+
fontWeight: 500,
|
|
481
|
+
marginBottom: 4
|
|
482
|
+
},
|
|
483
|
+
colorRow: {
|
|
484
|
+
display: "flex",
|
|
485
|
+
gap: 8
|
|
486
|
+
},
|
|
487
|
+
colorDot: {
|
|
488
|
+
display: "block",
|
|
489
|
+
width: "80%",
|
|
490
|
+
height: "80%",
|
|
491
|
+
borderRadius: 9999
|
|
492
|
+
}
|
|
493
|
+
};
|
|
494
|
+
function ConfigOptions(props) {
|
|
495
|
+
const fieldBindings = {
|
|
496
|
+
lines: { value: props.lines, set: props.setLines },
|
|
497
|
+
gap: { value: props.gap, set: props.setGap },
|
|
498
|
+
opacity: { value: props.opacity, set: props.setOpacity }
|
|
499
|
+
};
|
|
500
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: css5.container, children: [
|
|
501
|
+
NUMBER_FIELDS.map((field) => {
|
|
502
|
+
const binding = fieldBindings[field.key];
|
|
503
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: css5.fieldRow, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: css5.wrapper, children: [
|
|
504
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: css5.inputWrapper, children: [
|
|
505
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("label", { style: css5.label, children: field.label }),
|
|
506
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
507
|
+
"input",
|
|
508
|
+
{
|
|
509
|
+
style: css5.numberInput,
|
|
510
|
+
type: "number",
|
|
511
|
+
step: field.step,
|
|
512
|
+
value: binding.value,
|
|
513
|
+
onChange: (e) => binding.set(+e.target.value)
|
|
514
|
+
}
|
|
515
|
+
)
|
|
516
|
+
] }),
|
|
517
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: css5.quickRow, children: field.quick.map((v) => {
|
|
518
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
519
|
+
Button,
|
|
520
|
+
{
|
|
521
|
+
selected: binding.value === v,
|
|
522
|
+
"data-option": true,
|
|
523
|
+
variant: "ghost",
|
|
524
|
+
size: "icon-sm",
|
|
525
|
+
style: css5.quickButton,
|
|
526
|
+
onClick: () => binding.set(v),
|
|
527
|
+
children: v
|
|
528
|
+
},
|
|
529
|
+
v
|
|
530
|
+
);
|
|
531
|
+
}) })
|
|
532
|
+
] }) }, field.key);
|
|
533
|
+
}),
|
|
534
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: css5.colorSection, children: [
|
|
535
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { style: css5.colorLabel, children: "Cor" }),
|
|
536
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: css5.colorRow, children: colorOptions.map((c) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
537
|
+
Button,
|
|
538
|
+
{
|
|
539
|
+
variant: "ghost",
|
|
540
|
+
size: "icon-sm",
|
|
541
|
+
title: c.name,
|
|
542
|
+
onClick: () => props.setColor(c.value),
|
|
543
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { style: { ...css5.colorDot, backgroundColor: c.value } })
|
|
544
|
+
},
|
|
545
|
+
c.value
|
|
546
|
+
)) })
|
|
547
|
+
] })
|
|
548
|
+
] });
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
// src/lines-overlay.tsx
|
|
552
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
553
|
+
var css6 = {
|
|
554
|
+
overlay: {
|
|
555
|
+
position: "fixed",
|
|
556
|
+
top: 100,
|
|
557
|
+
left: 0,
|
|
558
|
+
width: "100%",
|
|
559
|
+
pointerEvents: "none",
|
|
560
|
+
display: "flex",
|
|
561
|
+
justifyContent: "center",
|
|
562
|
+
zIndex: 9998
|
|
563
|
+
},
|
|
564
|
+
grid: {
|
|
565
|
+
width: "100%"
|
|
566
|
+
},
|
|
567
|
+
triggerButton: {
|
|
568
|
+
position: "fixed",
|
|
569
|
+
bottom: 8,
|
|
570
|
+
right: 8,
|
|
571
|
+
zIndex: 9999,
|
|
572
|
+
fontSize: "0.75rem",
|
|
573
|
+
backgroundColor: "rgba(255,255,255,0.66)"
|
|
574
|
+
}
|
|
575
|
+
};
|
|
576
|
+
function RowGridCore({ show, setShow }) {
|
|
577
|
+
const containerRef = (0, import_react2.useRef)(null);
|
|
578
|
+
const [lines, setLines] = (0, import_react2.useState)(12);
|
|
579
|
+
const [gap, setGap] = (0, import_react2.useState)(24);
|
|
580
|
+
const [opacity, setOpacity] = (0, import_react2.useState)(0.3);
|
|
581
|
+
const [color, setColor] = (0, import_react2.useState)("#d71212");
|
|
582
|
+
const [showConfig, setShowConfig] = (0, import_react2.useState)(false);
|
|
583
|
+
(0, import_react2.useEffect)(() => {
|
|
584
|
+
const handler = (e) => {
|
|
585
|
+
if (e.ctrlKey && e.key === ";") {
|
|
586
|
+
setShow((v) => !v);
|
|
587
|
+
}
|
|
588
|
+
};
|
|
589
|
+
window.addEventListener("keydown", handler);
|
|
590
|
+
return () => window.removeEventListener("keydown", handler);
|
|
591
|
+
}, []);
|
|
592
|
+
if (!show) return null;
|
|
593
|
+
const height = lines * gap;
|
|
594
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { children: [
|
|
595
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
596
|
+
"div",
|
|
597
|
+
{
|
|
598
|
+
ref: containerRef,
|
|
599
|
+
style: { ...css6.overlay, height },
|
|
600
|
+
children: [
|
|
601
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
602
|
+
"div",
|
|
603
|
+
{
|
|
604
|
+
style: {
|
|
605
|
+
...css6.grid,
|
|
606
|
+
height,
|
|
607
|
+
backgroundImage: `repeating-linear-gradient(
|
|
608
|
+
to bottom,
|
|
609
|
+
${color},
|
|
610
|
+
${color} 1px,
|
|
611
|
+
transparent 1px,
|
|
612
|
+
transparent ${gap}px
|
|
613
|
+
)`,
|
|
614
|
+
opacity
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
),
|
|
618
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(MoveLinesButton, { targetRef: containerRef })
|
|
619
|
+
]
|
|
620
|
+
}
|
|
621
|
+
),
|
|
622
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
623
|
+
ConfigButton,
|
|
624
|
+
{
|
|
625
|
+
setShow,
|
|
626
|
+
onToggleConfig: () => setShowConfig((v) => !v),
|
|
627
|
+
open: showConfig
|
|
628
|
+
}
|
|
629
|
+
),
|
|
630
|
+
showConfig && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
631
|
+
ConfigOptions,
|
|
632
|
+
{
|
|
633
|
+
lines,
|
|
634
|
+
gap,
|
|
635
|
+
opacity,
|
|
636
|
+
color,
|
|
637
|
+
setLines,
|
|
638
|
+
setGap,
|
|
639
|
+
setOpacity,
|
|
640
|
+
setColor
|
|
641
|
+
}
|
|
642
|
+
)
|
|
643
|
+
] });
|
|
644
|
+
}
|
|
645
|
+
function RowGrid() {
|
|
646
|
+
const [show, setShow] = (0, import_react2.useState)(false);
|
|
647
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
648
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
649
|
+
Button,
|
|
650
|
+
{
|
|
651
|
+
size: "sm",
|
|
652
|
+
variant: "ghost",
|
|
653
|
+
style: { ...css6.triggerButton, visibility: show ? "hidden" : "visible" },
|
|
654
|
+
onClick: () => setShow((v) => !v),
|
|
655
|
+
children: [
|
|
656
|
+
"Mostrar linhas",
|
|
657
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { Icon: import_lucide_react3.Eye })
|
|
658
|
+
]
|
|
659
|
+
}
|
|
660
|
+
),
|
|
661
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(RowGridCore, { setShow, show })
|
|
662
|
+
] });
|
|
663
|
+
}
|
|
664
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
665
|
+
0 && (module.exports = {
|
|
666
|
+
RowGrid
|
|
667
|
+
});
|
|
668
|
+
//# sourceMappingURL=index.js.map
|