🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@supernovaio/prototyping-tooling

Package Overview
Dependencies
Maintainers
8
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@supernovaio/prototyping-tooling - npm Package Compare versions

Comparing version
0.9.7
to
0.9.8
+11
dist/debug-CLzmqn3R.js
let t = !1;
function a(e = !0) {
t = e;
}
function g(e, ...n) {
t && (/* @__PURE__ */ new Date()).toISOString().split("T")[1].slice(0, -1);
}
export {
g as d,
a as e
};
import { useState as r, useEffect as S, useCallback as s } from "react";
import { d as i } from "./debug-CLzmqn3R.js";
function E(e) {
const [d, u] = r(!1), [a, l] = r(""), [b, o] = r("disconnected");
S(() => {
if (!e) {
i("client", "useElementSelector: No host provided");
return;
}
const t = e.getStatus();
i("client", "useElementSelector: Initial status:", t), o(t);
const n = e.on("connected", () => {
i("client", "useElementSelector: Connected"), o("connected");
}), c = e.on("disconnected", () => {
i("client", "useElementSelector: Disconnected"), o("disconnected");
});
return () => {
n(), c();
};
}, [e]), S(() => {
if (!e) return;
const t = e.on("xpath-selected", (c) => {
l(c);
}), n = e.on("select-mode-disabled", () => {
u(!1);
});
return () => {
t(), n();
};
}, [e]);
const f = s((t) => {
if (e)
try {
e.enableSelectMode(t), u(t);
} catch (n) {
i("client", "Failed to toggle select mode:", n);
}
}, [e]), m = s(() => {
l("");
}, []);
return { selectMode: d, connectionStatus: b, selectedXPath: a, enableSelectMode: f, clearXPath: m };
}
function M(e) {
const [d, u] = r(!1), [a, l] = r(null), b = s((t) => {
e && (e.enableDesignMode(t), u(t), t || l(null));
}, [e]), o = s((t, n) => {
e && (e.updateElementText(t, n), l((c) => c ? { ...c, text: n } : null));
}, [e]), f = s((t, n, c) => {
e && e.updateProperty(t, n, c);
}, [e]), m = s(() => {
e && (e.deselectElement(), l(null));
}, [e]);
return S(() => {
if (!e) return;
const t = e.on("element-selected", (c) => {
l(c);
}), n = e.on("design-mode-disabled", () => {
d && u(!1);
});
return () => {
t(), n();
};
}, [e, d]), { designMode: d, selectedElement: a, enableDesignMode: b, updateText: o, updateProperty: f, deselectElement: m };
}
export {
M as a,
E as u
};
+28
-30

@@ -8,4 +8,4 @@ import { parse as P } from "@babel/parser";

let r = 0;
for (let f = 0; f < d.length; f++) {
const s = d.charCodeAt(f);
for (let c = 0; c < d.length; c++) {
const s = d.charCodeAt(c);
r = (r << 5) - r + s, r = r & r;

@@ -15,6 +15,6 @@ }

}
function k(d = {}) {
const { prefix: r = "forge" } = d, f = (s, i, u) => {
const o = T(`${s}:${i}:${u}`);
return `${r}-${o}-${i}-${u}`;
function B(d = {}) {
const { prefix: r = "forge" } = d, c = (s, i, u) => {
const a = T(`${s}:${i}:${u}`);
return `${r}-${a}-${i}-${u}`;
};

@@ -26,3 +26,3 @@ return { name: "forge-id-plugin", enforce: "pre", transform(s, i) {

try {
let o = function(e) {
let a = function(e) {
const n = e.parent;

@@ -34,6 +34,6 @@ if (n.type === "VariableDeclarator" && n.id.type === "Identifier" && /^[A-Z]/.test(n.id.name))

if (l) {
const c = l.parent;
if (c.type === "VariableDeclarator" && c.id.type === "Identifier" && /^[A-Z]/.test(c.id.name) || c.type === "ExportDefaultDeclaration")
const f = l.parent;
if (f.type === "VariableDeclarator" && f.id.type === "Identifier" && /^[A-Z]/.test(f.id.name) || f.type === "ExportDefaultDeclaration")
return !0;
if (c.type === "CallExpression") {
if (f.type === "CallExpression") {
const p = l.parentPath;

@@ -50,16 +50,16 @@ if (p) {

};
const x = P(s, { sourceType: "module", plugins: ["jsx", "typescript"] }), C = /* @__PURE__ */ new Set();
let b = !1, a = 0;
const x = P(s, { sourceType: "module", plugins: ["jsx", "typescript"] }), J = /* @__PURE__ */ new Set();
let b = !1, o = 0;
if (E(x, { FunctionDeclaration: { enter(e) {
e.node.id && /^[A-Z]/.test(e.node.id.name) && a++;
e.node.id && /^[A-Z]/.test(e.node.id.name) && o++;
}, exit(e) {
e.node.id && /^[A-Z]/.test(e.node.id.name) && a--;
e.node.id && /^[A-Z]/.test(e.node.id.name) && o--;
} }, ArrowFunctionExpression: { enter(e) {
o(e) && a++;
a(e) && o++;
}, exit(e) {
o(e) && a--;
a(e) && o--;
} }, FunctionExpression: { enter(e) {
o(e) && a++;
a(e) && o++;
}, exit(e) {
o(e) && a--;
a(e) && o--;
} }, JSXOpeningElement(e) {

@@ -70,8 +70,6 @@ if (e.node.name.type === "JSXIdentifier") {

return;
if (l && a > 0) {
if (l && o > 0) {
const t = e.scope.getBinding(n);
if (t && t.scope.path.type !== "Program") {
console.log(`[Plugin] Skipping ${n} - locally-scoped dynamic component inside definition`);
if (t && t.scope.path.type !== "Program")
return;
}
}

@@ -83,9 +81,9 @@ if (!e.node.attributes.some((t) => t.type === "JSXAttribute" && t.name.type === "JSXIdentifier" && t.name.name === "data-forge-id")) {

if (!m) return;
const A = f(i, t.line, t.column), v = { type: "JSXAttribute", name: { type: "JSXIdentifier", name: "data-forge-id" }, value: { type: "StringLiteral", value: A }, loc: e.node.loc }, $ = { type: "JSXAttribute", name: { type: "JSXIdentifier", name: "data-component" }, value: { type: "StringLiteral", value: n }, loc: e.node.loc }, h = { type: "JSXAttribute", name: { type: "JSXIdentifier", name: "data-source-pos" }, value: { type: "StringLiteral", value: `${u}:${t.line}:${t.column}:${m.line}:${m.column}` }, loc: e.node.loc }, J = !l && a > 0, X = e.node.attributes.some((g) => g.type === "JSXSpreadAttribute");
if (J && X) {
const A = c(i, t.line, t.column), v = { type: "JSXAttribute", name: { type: "JSXIdentifier", name: "data-forge-id" }, value: { type: "StringLiteral", value: A }, loc: e.node.loc }, h = { type: "JSXAttribute", name: { type: "JSXIdentifier", name: "data-component" }, value: { type: "StringLiteral", value: n }, loc: e.node.loc }, C = { type: "JSXAttribute", name: { type: "JSXIdentifier", name: "data-source-pos" }, value: { type: "StringLiteral", value: `${u}:${t.line}:${t.column}:${m.line}:${m.column}` }, loc: e.node.loc }, X = !l && o > 0, $ = e.node.attributes.some((g) => g.type === "JSXSpreadAttribute");
if (X && $) {
const g = e.node.attributes.findIndex((D) => D.type === "JSXSpreadAttribute");
e.node.attributes.splice(g, 0, v, $, h);
e.node.attributes.splice(g, 0, v, h, C);
} else
e.node.attributes.push(v, $, h);
C.add(A), b = !0;
e.node.attributes.push(v, h, C);
J.add(A), b = !0;
}

@@ -97,4 +95,4 @@ }

}
} catch (o) {
return o instanceof Error && console.warn(`Failed to parse ${i} for forge-id injection: ${o.message}`), null;
} catch {
return null;
}

@@ -105,3 +103,3 @@ return null;

export {
k as supernovaDesignPlugin
B as supernovaDesignPlugin
};
import { b as $, c as X, R as Y, d as U, Z as x, C as v, M as E, B as R, e as G, P as B, i as W, a as V, T as P } from "./constants-DHvpLY46.js";
import { d as c } from "./debug-BuKzUOMn.js";
import { d as c } from "./debug-CLzmqn3R.js";
class j {

@@ -41,7 +41,7 @@ registry = /* @__PURE__ */ new Map();

}
function I(r) {
function C(r) {
return r.length === 1 && r[0].startsWith("*[@id=") ? `//${r[0]}` : "/" + r.join("/");
}
const u = { FunctionComponent: 0, ClassComponent: 1, IndeterminateComponent: 2, HostRoot: 3, HostPortal: 4, HostComponent: 5, HostText: 6, Fragment: 7, Mode: 8, ContextConsumer: 9, ContextProvider: 10, ForwardRef: 11, Profiler: 12, SuspenseComponent: 13, MemoComponent: 14, SimpleMemoComponent: 15, LazyComponent: 16, IncompleteClassComponent: 17, DehydratedFragment: 18, SuspenseListComponent: 19, ScopeComponent: 21, OffscreenComponent: 22, LegacyHiddenComponent: 23, CacheComponent: 24, TracingMarkerComponent: 25, HostHoistable: 26, HostSingleton: 27, IncompleteFunctionComponent: 28, Throw: 29, ViewTransitionComponent: 30, ActivityComponent: 31 }, K = /* @__PURE__ */ new Set(["Component", "PureComponent", "Fragment", "Suspense", "Profiler", "StrictMode", "Routes", "Route", "Outlet", "Root", "ErrorBoundaryHandler", "HotReload", "Hot"]), z = [/Boundary$/, /BoundaryHandler$/, /Provider$/, /Consumer$/, /^(Inner|Outer)/, /Router$/, /^Client(Page|Segment|Root)/, /^Server(Root|Component|Render)/, /^RSC/, /Context$/, /^Hot(Reload)?$/, /^(Dev|React)(Overlay|Tools|Root)/, /Overlay$/, /Handler$/, /^With[A-Z]/, /Wrapper$/, /^Root$/];
let C = null;
let I = null;
function T(r) {

@@ -52,6 +52,6 @@ const e = (t) => t.some((n) => n.startsWith("__reactFiber$") || n.startsWith("__reactInternalInstance$") || n.startsWith("__reactProps$"));

function J() {
if (C !== null) return C;
if (I !== null) return I;
if (typeof document > "u") return !1;
if (document.body && T(document.body))
return c("client", "Detected React on document.body"), C = !0, !0;
return c("client", "Detected React on document.body"), I = !0, !0;
for (const e of Y) {

@@ -61,6 +61,6 @@ const t = document.querySelector(e);

if (T(t))
return c("client", "Detected React on", e), C = !0, !0;
return c("client", "Detected React on", e), I = !0, !0;
for (const n of t.children)
if (T(n))
return c("client", "Detected React on child of", e), C = !0, !0;
return c("client", "Detected React on child of", e), I = !0, !0;
}

@@ -71,3 +71,3 @@ }

if (T(e))
return c("client", "Detected React on body child:", e.tagName), C = !0, !0;
return c("client", "Detected React on body child:", e.tagName), I = !0, !0;
}

@@ -77,6 +77,6 @@ const r = document.querySelectorAll("*");

if (T(e))
return c("client", "Detected React on deep scan:", e.tagName), C = !0, !0;
return c("client", "Detected React on deep scan:", e.tagName), I = !0, !0;
if (r.length > U) break;
}
return c("client", "React NOT detected on page"), C = !1, !1;
return c("client", "React NOT detected on page"), I = !1, !1;
}

@@ -217,3 +217,3 @@ function q(r) {

for (const n of t) {
const o = { xpath: I(n.xpath), forgeId: n.forgeId, forgeIdIndex: n.forgeIdIndex }, i = this.resolveLocator(o);
const o = { xpath: C(n.xpath), forgeId: n.forgeId, forgeIdIndex: n.forgeIdIndex }, i = this.resolveLocator(o);
i && this.accumulationElements.push(i);

@@ -246,3 +246,3 @@ }

}
return { xpath: I(_(e)), forgeId: t, forgeIdIndex: n };
return { xpath: C(_(e)), forgeId: t, forgeIdIndex: n };
}

@@ -266,3 +266,3 @@ elementToInfo(e) {

const n = e[e.length - 1].getBoundingClientRect(), o = n.left + n.width / 2, i = n.bottom, s = e.map((g) => this.elementToInfo(g)), a = e.map((g) => this.elementToLocator(g)), l = this.getAnchorRect(a), h = o - 2, d = i - R - 2, m = l && l.width > 0 && l.height > 0 ? { x: (h - l.left) / l.width, y: (d - l.top) / l.height } : { x: 0, y: 0 }, f = s[0];
this.messenger.send({ type: "ACCUMULATION_UPDATED", annotation: { id: this.accumulationId, dotX: o, dotY: i, anchorOffset: m, mode: e.length > 1 ? "multi" : "single", elements: s, xpaths: s.map((g) => I(g.xpath)), elementTag: f.elementTag, componentName: f.componentName, componentPath: f.componentPath, forgeId: f.forgeId, sourcePos: f.sourcePos }, origin: E });
this.messenger.send({ type: "ACCUMULATION_UPDATED", annotation: { id: this.accumulationId, dotX: o, dotY: i, anchorOffset: m, mode: e.length > 1 ? "multi" : "single", elements: s, xpaths: s.map((g) => C(g.xpath)), elementTag: f.elementTag, componentName: f.componentName, componentPath: f.componentPath, forgeId: f.forgeId, sourcePos: f.sourcePos }, origin: E });
}

@@ -279,3 +279,3 @@ removeDot(e) {

for (const t of e) {
const n = t.elements.map((i) => ({ xpath: I(i.xpath), forgeId: i.forgeId, forgeIdIndex: i.forgeIdIndex })), o = this.getAnchorRect(n);
const n = t.elements.map((i) => ({ xpath: C(i.xpath), forgeId: i.forgeId, forgeIdIndex: i.forgeIdIndex })), o = this.getAnchorRect(n);
if (o && t.anchorOffset && o.width > 0 && o.height > 0) {

@@ -411,6 +411,8 @@ const i = { rx: t.anchorOffset.x, ry: t.anchorOffset.y }, s = o.left + i.rx * o.width, a = o.top + i.ry * o.height;

const o = document.createElement("div");
Object.assign(o.style, { position: "fixed", zIndex: x.TOOLTIP, backgroundColor: "rgb(238, 248, 255)", color: "rgba(26, 88, 208, 1)", border: "1px solid rgba(86, 153, 255, 0.3)", padding: "4px", borderRadius: "5px", fontSize: "12px", fontFamily: "Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif", whiteSpace: "nowrap", pointerEvents: "none", boxShadow: "0 2px 8px rgba(0,0,0,0.3)", transition: "opacity 0.1s ease" }), o.textContent = n.map((l) => `<${l}>`).join(" "), o.className = "forge-annotation-component-tooltip", document.body.appendChild(o);
const i = o.getBoundingClientRect();
let s = t.left + t.width / 2 - i.width / 2, a = t.top - i.height - 6;
s < 4 && (s = 4), s + i.width > window.innerWidth - 4 && (s = window.innerWidth - i.width - 4), a < 4 && (a = t.bottom + 6), o.style.left = `${s}px`, o.style.top = `${a}px`, this.componentTooltip = o;
Object.assign(o.style, { position: "fixed", zIndex: x.TOOLTIP, backgroundColor: "rgb(238, 248, 255)", color: "rgba(26, 88, 208, 1)", border: "1px solid rgba(86, 153, 255, 0.3)", padding: "4px", borderRadius: "5px", fontSize: "12px", fontFamily: "Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif", whiteSpace: "nowrap", pointerEvents: "none", boxShadow: "0 2px 8px rgba(0,0,0,0.3)", transition: "opacity 0.1s ease" });
const i = n.length <= 6 ? n : [n[0], "...", ...n.slice(-5)];
o.textContent = i.map((h) => h === "..." ? h : `<${h}>`).join(" "), o.className = "forge-annotation-component-tooltip", document.body.appendChild(o);
const s = o.getBoundingClientRect();
let a = t.left + t.width / 2 - s.width / 2, l = t.top - s.height - 6;
a < 4 && (a = 4), a + s.width > window.innerWidth - 4 && (a = window.innerWidth - s.width - 4), l < 4 && (l = t.bottom + 6), o.style.left = `${a}px`, o.style.top = `${l}px`, this.componentTooltip = o;
}

@@ -607,5 +609,5 @@ removeComponentTooltip() {

this.hoverSuppressed = !0, this.removeHoverOverlay();
const a = e.map((p) => this.elementToInfo(p)), l = a.map((p) => ({ xpath: I(p.xpath), forgeId: p.forgeId, forgeIdIndex: p.forgeIdIndex })), h = this.getAnchorRect(l), d = n - 2, m = o - R - 2, f = h && h.width > 0 && h.height > 0 ? { x: (d - h.left) / h.width, y: (m - h.top) / h.height } : { x: 0, y: 0 };
const a = e.map((p) => this.elementToInfo(p)), l = a.map((p) => ({ xpath: C(p.xpath), forgeId: p.forgeId, forgeIdIndex: p.forgeIdIndex })), h = this.getAnchorRect(l), d = n - 2, m = o - R - 2, f = h && h.width > 0 && h.height > 0 ? { x: (d - h.left) / h.width, y: (m - h.top) / h.height } : { x: 0, y: 0 };
this.pendingAnnotations.set(s, { dotX: n, dotY: o, mode: t, locators: l }), this.clearDragHighlights(), this.highlightLocators(l, t === "multi");
const g = a[0], y = { id: s, dotX: n, dotY: o, anchorOffset: f, mode: t, elements: a, xpaths: a.map((p) => I(p.xpath)), elementTag: g.elementTag, componentName: g.componentName, componentPath: g.componentPath, forgeId: g.forgeId, sourcePos: g.sourcePos };
const g = a[0], y = { id: s, dotX: n, dotY: o, anchorOffset: f, mode: t, elements: a, xpaths: a.map((p) => C(p.xpath)), elementTag: g.elementTag, componentName: g.componentName, componentPath: g.componentPath, forgeId: g.forgeId, sourcePos: g.sourcePos };
c("annotation", "Annotation created (pending):", y), this.messenger.send({ type: "ANNOTATION_CREATED", annotation: y, origin: E });

@@ -650,3 +652,3 @@ }

handleSelectModeClick(e) {
const t = I(_(e));
const t = C(_(e));
c("client", "Element clicked, XPath:", t), this.messenger.send({ type: "XPATH_REPORT", xpath: t, origin: E }), this.messenger.send({ type: "SELECT_MODE_DISABLED", origin: E });

@@ -774,3 +776,3 @@ }

this.clearSelection(), this.selectedElement = n, this.applyHighlight(n);
const a = n.textContent?.trim() || "", l = n.tagName.toLowerCase(), h = I(_(n)), d = this.componentRegistry.getEditableProps(s), m = this.extractPropValues(n, d);
const a = n.textContent?.trim() || "", l = n.tagName.toLowerCase(), h = C(_(n)), d = this.componentRegistry.getEditableProps(s), m = this.extractPropValues(n, d);
c("client", "Element selected in design mode:", { forgeId: t, sourcePos: i, text: a, type: l, componentName: s, editableProps: d, propValues: m }), this.messenger.send({ type: "ELEMENT_SELECTED", forgeId: t, sourcePos: i || void 0, text: a, elementType: l, xpath: h, componentName: s, editableProps: d, propValues: m, origin: E });

@@ -862,3 +864,3 @@ }

c("client", "Setting up message listener..."), this.messenger.onMessage((e) => {
if (W(e.data) || (this.isConnectedToHost || (this.isConnectedToHost = !0, this.readyIntervalId !== null && (window.clearInterval(this.readyIntervalId), this.readyIntervalId = null, c("client", "Host connection detected, stopped CHILD_READY retries"))), console.log("Received message from host:", { isConnectedToHost: this.isConnectedToHost }), !e.data || typeof e.data != "object" || !("origin" in e.data))) return;
if (W(e.data) || (this.isConnectedToHost || (this.isConnectedToHost = !0, this.readyIntervalId !== null && (window.clearInterval(this.readyIntervalId), this.readyIntervalId = null, c("client", "Host connection detected, stopped CHILD_READY retries"))), !e.data || typeof e.data != "object" || !("origin" in e.data))) return;
const t = e.data;

@@ -865,0 +867,0 @@ if (t.origin === V) {

@@ -1,1 +0,1 @@

{"version":3,"file":"AnnotationOverlay.d.ts","sourceRoot":"","sources":["../../../src/client/annotation/AnnotationOverlay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAEhE,OAAO,KAAK,EAAkB,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AA6B1G;;;GAGG;AACH,qBAAa,iBAAiB;IAC5B,OAAc,0BAA0B,SAAyB;IACjE,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,SAAS,CAAiB;IAClC,OAAO,CAAC,YAAY,CAA8B;IAClD,OAAO,CAAC,gBAAgB,CAA8B;IACtD,OAAO,CAAC,QAAQ,CAA8B;IAC9C,OAAO,CAAC,cAAc,CAAuB;IAC7C,OAAO,CAAC,oBAAoB,CAAuB;IACnD,OAAO,CAAC,IAAI,CAA6B;IAEzC,OAAO,CAAC,UAAU,CAAQ;IAC1B,OAAO,CAAC,UAAU,CAAI;IACtB,OAAO,CAAC,UAAU,CAAI;IACtB,OAAO,CAAC,eAAe,CAA2B;IAClD,OAAO,CAAC,eAAe,CAAQ;IAC/B,OAAO,CAAC,o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AAO,CAAC,iBAAiB,CAAiC;IAC1D,OAAO,CAAC,gBAAgB,CAAsB;IAC9C,OAAO,CAAC,gBAAgB,CAAsB;IAC9C,OAAO,CAAC,2BAA2B,CAAgC;IACnE,OAAO,CAAC,OAAO,CAAC,CAAwB;IAExC,OAAO;IA4BP,4EAA4E;IAC5E,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,WAAW;IAO7D,6FAA6F;IAC7F,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAI5C,2FAA2F;IAC3F,kBAAkB,CAAC,WAAW,EAAE,qBAAqB,EAAE,GAAG,IAAI;IAS9D,OAAO,CAAC,oBAAoB;IA2F5B,OAAO,CAAC,aAAa;IAarB,OAAO,CAAC,aAAa;IAerB,OAAO,CAAC,iBAAiB;IAezB,OAAO,CAAC,0BAA0B;IAiBlC,OAAO,CAAC,2BAA2B;IASnC,OAAO,CAAC,iBAAiB;IAKzB,OAAO,CAAC,iBAAiB;IAOzB,OAAO,CAAC,SAAS;IAwBjB,OAAO,CAAC,uBAAuB;IAkB/B,OAAO,CAAC,mBAAmB;IAO3B,OAAO,CAAC,yBAAyB;CAkBlC"}
import { T as c, W as h, a as i, i as d, M as E } from "./constants-DHvpLY46.js";
import { d as n } from "./debug-BuKzUOMn.js";
import { d as n } from "./debug-CLzmqn3R.js";
class u {

@@ -4,0 +4,0 @@ iframe;

import { ForgeHost as r } from "./host.js";
import { ForgeClient as t } from "./client.js";
import { a as S, u as m } from "./useDesignMode--DcwfmhZ.js";
import { e as p } from "./debug-BuKzUOMn.js";
import { a as S, u as m } from "./useDesignMode-VIipNUSj.js";
import { e as p } from "./debug-CLzmqn3R.js";
import { a as E, M as g } from "./constants-DHvpLY46.js";

@@ -6,0 +6,0 @@ export {

@@ -1,2 +0,2 @@

import { a as o, u as a } from "./useDesignMode--DcwfmhZ.js";
import { a as o, u as a } from "./useDesignMode-VIipNUSj.js";
export {

@@ -3,0 +3,0 @@ o as useDesignMode,

{
"name": "@supernovaio/prototyping-tooling",
"version": "0.9.7",
"version": "0.9.8",
"description": "Prototyping Tooling — iframe communication bridge for design-to-code workflows",

@@ -5,0 +5,0 @@ "type": "module",

let n = !1;
function i(e = !0) {
n = e;
}
function l(e, ...t) {
if (!n) return;
const o = e === "client" ? "🔵" : e === "host" ? "🟡" : e === "annotation" ? "🟢" : "⚪", s = (/* @__PURE__ */ new Date()).toISOString().split("T")[1].slice(0, -1);
console.log(`[${s}] ${o} [${e.toUpperCase()}]`, ...t);
}
export {
l as d,
i as e
};
import { useState as r, useEffect as S, useCallback as s } from "react";
import { d as i } from "./debug-BuKzUOMn.js";
function E(e) {
const [d, u] = r(!1), [a, l] = r(""), [b, o] = r("disconnected");
S(() => {
if (!e) {
i("client", "useElementSelector: No host provided");
return;
}
const t = e.getStatus();
i("client", "useElementSelector: Initial status:", t), o(t);
const n = e.on("connected", () => {
i("client", "useElementSelector: Connected"), o("connected");
}), c = e.on("disconnected", () => {
i("client", "useElementSelector: Disconnected"), o("disconnected");
});
return () => {
n(), c();
};
}, [e]), S(() => {
if (!e) return;
const t = e.on("xpath-selected", (c) => {
l(c);
}), n = e.on("select-mode-disabled", () => {
u(!1);
});
return () => {
t(), n();
};
}, [e]);
const f = s((t) => {
if (e)
try {
e.enableSelectMode(t), u(t);
} catch (n) {
i("client", "Failed to toggle select mode:", n);
}
}, [e]), m = s(() => {
l("");
}, []);
return { selectMode: d, connectionStatus: b, selectedXPath: a, enableSelectMode: f, clearXPath: m };
}
function M(e) {
const [d, u] = r(!1), [a, l] = r(null), b = s((t) => {
e && (e.enableDesignMode(t), u(t), t || l(null));
}, [e]), o = s((t, n) => {
e && (e.updateElementText(t, n), l((c) => c ? { ...c, text: n } : null));
}, [e]), f = s((t, n, c) => {
e && e.updateProperty(t, n, c);
}, [e]), m = s(() => {
e && (e.deselectElement(), l(null));
}, [e]);
return S(() => {
if (!e) return;
const t = e.on("element-selected", (c) => {
l(c);
}), n = e.on("design-mode-disabled", () => {
d && u(!1);
});
return () => {
t(), n();
};
}, [e, d]), { designMode: d, selectedElement: a, enableDesignMode: b, updateText: o, updateProperty: f, deselectElement: m };
}
export {
M as a,
E as u
};