openmagic 0.18.0 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -914,7 +914,7 @@ function buildContextParts(context) {
914
914
  const parts = {};
915
915
  if (context.selectedElement) {
916
916
  const el = context.selectedElement;
917
- parts.selectedElement = JSON.stringify({
917
+ const elementData = {
918
918
  cssSelector: el.cssSelector,
919
919
  tagName: el.tagName,
920
920
  id: el.id,
@@ -923,7 +923,29 @@ function buildContextParts(context) {
923
923
  computedStyles: el.computedStyles,
924
924
  ancestry: el.ancestry,
925
925
  componentHint: el.componentHint
926
- }, null, 2);
926
+ };
927
+ if (el.parentStyles && Object.keys(el.parentStyles).length) {
928
+ elementData.parentContainerStyles = el.parentStyles;
929
+ }
930
+ if (el.siblings?.length) {
931
+ elementData.siblings = el.siblings;
932
+ }
933
+ if (el.matchedCssRules?.length) {
934
+ elementData.matchedCssRules = el.matchedCssRules;
935
+ }
936
+ if (el.viewport) {
937
+ elementData.viewport = el.viewport;
938
+ }
939
+ if (el.ariaAttributes && Object.keys(el.ariaAttributes).length) {
940
+ elementData.ariaAttributes = el.ariaAttributes;
941
+ }
942
+ if (el.eventHandlers?.length) {
943
+ elementData.eventHandlers = el.eventHandlers;
944
+ }
945
+ if (el.reactProps) {
946
+ elementData.reactProps = el.reactProps;
947
+ }
948
+ parts.selectedElement = JSON.stringify(elementData, null, 2);
927
949
  }
928
950
  if (context.files?.length) {
929
951
  parts.files = context.files;
@@ -1378,7 +1400,7 @@ async function handleLlmChat(params, onChunk, onDone, onError) {
1378
1400
  }
1379
1401
 
1380
1402
  // src/server.ts
1381
- var VERSION = "0.18.0";
1403
+ var VERSION = "0.19.0";
1382
1404
  var __dirname = dirname2(fileURLToPath(import.meta.url));
1383
1405
  function attachOpenMagic(httpServer, roots) {
1384
1406
  function handleRequest(req, res) {
@@ -1911,7 +1933,7 @@ process.on("uncaughtException", (err) => {
1911
1933
  process.exit(1);
1912
1934
  });
1913
1935
  var childProcesses = [];
1914
- var VERSION2 = "0.18.0";
1936
+ var VERSION2 = "0.19.0";
1915
1937
  function ask(question) {
1916
1938
  const rl = createInterface({ input: process.stdin, output: process.stdout });
1917
1939
  return new Promise((resolve3) => {