geoiq-frontend-ui-kit
Version:
This project is a UI kit for GeoIQ's frontend. It's built with React, TypeScript, and Vite.
147 lines (146 loc) • 3.75 kB
JavaScript
import { pushHistory as l } from "./index153.es.js";
import { emitChange as r, getSel as c } from "./index151.es.js";
import { render as o, keepingFixed as u, clampTextSize as d, clampBoxWidth as y } from "./index152.es.js";
import { SHAPES as p } from "./index150.es.js";
import { applyModeCursor as h } from "./index155.es.js";
function t(e, n, i) {
u(e, n, { x: n.x, y: n.y }, i);
}
function g(e) {
if (e.type === "text")
return "“" + (e.text.length > 16 ? e.text.slice(0, 16) + "…" : e.text) + "”";
if (e.type === "stroke")
return e.style === "highlight" ? "Highlighter" : "Brush stroke";
if (e.type === "sticker") return "Sticker";
const n = p.find((i) => i.id === e.shape);
return n ? n.name : e.shape;
}
function x(e, n) {
l(e), e.layers = e.layers.filter((i) => i.id !== n), e.selectedId === n && (e.selectedId = null), o(e), e.statusText = "Layer deleted", r(e);
}
function C(e) {
e.selectedId != null && x(e, e.selectedId);
}
function F(e) {
const n = c(e);
if (!n) return;
l(e);
const i = JSON.parse(JSON.stringify(n));
i.id = e.nextId++, i.type === "text" || i.type === "shape" || i.type === "sticker" ? (i.x += 20, i.y += 20) : i.type === "stroke" && (i.points = i.points.map((f) => ({ x: f.x + 20, y: f.y + 20 }))), e.layers.push(i), e.selectedId = i.id, o(e), e.statusText = "Layer duplicated", r(e);
}
function k(e) {
const n = e.layers.findIndex((f) => f.id === e.selectedId);
if (n < 0) return;
l(e);
const [i] = e.layers.splice(n, 1);
e.layers.push(i), o(e), r(e);
}
function z(e) {
const n = e.layers.findIndex((f) => f.id === e.selectedId);
if (n < 0) return;
l(e);
const [i] = e.layers.splice(n, 1);
e.layers.unshift(i), o(e), r(e);
}
function B(e, n, i) {
e.adj[n] = i, o(e), e.notify();
}
function W(e, n) {
e.adj.filter = n, o(e), r(e);
}
function b(e, n) {
e.selectedShapeType = n, e.notify();
}
function j(e, n) {
e.shapeFill = n, e.notify();
}
function w(e, n) {
e.shapeWidth = n, e.notify();
}
function H(e, n) {
e.brushSize = n, e.notify();
}
function L(e, n) {
e.brushStyle = n, e.notify();
}
function N(e, n) {
e.textFont = n, e.notify();
}
function A(e, n) {
e.textSize = n, e.notify();
}
function J(e, n) {
e.textColor = n, e.notify();
}
function O(e, n) {
e.shapeColor = n, e.notify();
}
function P(e, n) {
e.drawColor = n, h(e), e.notify();
}
function D(e, n) {
const i = c(e);
i && (l(e), i.color = n, o(e), r(e));
}
function E(e, n) {
const i = c(e);
!i || i.type !== "text" || (t(e, i, () => {
i.text = n;
}), o(e), e.notify());
}
function M(e, n) {
const i = c(e);
i && (l(e), t(e, i, () => {
i.font = n;
}), o(e), r(e));
}
function q(e, n) {
const i = c(e);
i && (t(e, i, () => {
i.size = n, d(e, i);
}), o(e), e.notify());
}
function v(e, n) {
const i = c(e);
!i || i.type !== "text" || (t(e, i, () => {
i.boxWidth = n, y(e, i), d(e, i);
}), o(e), e.notify());
}
function G(e, n) {
const i = c(e);
i && (l(e), i.fill = n, o(e), r(e));
}
function K(e, n) {
const i = c(e);
i && (t(e, i, () => {
i.width = n;
}), o(e), e.notify());
}
export {
k as bringSelectedToFront,
x as deleteLayer,
C as deleteSelected,
F as duplicateSelected,
g as layerName,
b as selectShapeType,
z as sendSelectedToBack,
B as setAdjustment,
H as setBrushSize,
L as setBrushStyle,
P as setDrawColor,
W as setFilter,
v as setSelectedBoxWidth,
D as setSelectedColor,
M as setSelectedFont,
G as setSelectedShapeFill,
E as setSelectedText,
q as setSelectedTextSize,
K as setSelectedWidth,
O as setShapeColor,
j as setShapeFill,
w as setShapeWidth,
J as setTextColor,
N as setTextFont,
A as setTextSize
};
//# sourceMappingURL=index158.es.js.map