@insitue/sdk 0.4.5 → 0.4.6

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  mountCaptureOnly
3
- } from "./chunk-SI2PTZTD.js";
3
+ } from "./chunk-6PYLXFYS.js";
4
4
  export {
5
5
  mountCaptureOnly
6
6
  };
@@ -543,6 +543,17 @@ function fromAttribute(el) {
543
543
  }
544
544
  return null;
545
545
  }
546
+ function fromCmsAttribute(el) {
547
+ let cur = el;
548
+ for (let i3 = 0; cur && i3 < 16; i3++, cur = cur.parentElement) {
549
+ const handle = cur.getAttribute("data-insitue-cms");
550
+ if (handle) {
551
+ const adminUrl = cur.getAttribute("data-insitue-cms-url") ?? void 0;
552
+ return adminUrl ? { handle, adminUrl } : { handle };
553
+ }
554
+ }
555
+ return void 0;
556
+ }
546
557
  function resolveTarget(el) {
547
558
  const selector = buildSelector(el);
548
559
  const fiber = getFiber(el);
@@ -580,7 +591,9 @@ function resolveTarget(el) {
580
591
  }
581
592
  }
582
593
  }
583
- return source === void 0 ? { confidence, componentStack, selector } : { source, confidence, componentStack, selector };
594
+ const cmsSource = fromCmsAttribute(el);
595
+ const base = source === void 0 ? { confidence, componentStack, selector } : { source, confidence, componentStack, selector };
596
+ return cmsSource ? { ...base, cmsSource } : base;
584
597
  }
585
598
  var CAPTURE_SCHEMA_VERSION = 3;
586
599
  var PROTOCOL_VERSION = 5;
@@ -3055,8 +3068,8 @@ function CaptureApp(props) {
3055
3068
  k("span", {}, isDev ? "InSitue Dev \xB7 pick + describe \u2192 CLI" : ""),
3056
3069
  k(
3057
3070
  "span",
3058
- { title: `@insitue/sdk@${"0.4.5"}` },
3059
- `InSitue \xB7 v${"0.4.5"}`
3071
+ { title: `@insitue/sdk@${"0.4.6"}` },
3072
+ `InSitue \xB7 v${"0.4.6"}`
3060
3073
  )
3061
3074
  ]
3062
3075
  )
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  mountCaptureOnly
3
- } from "./chunk-SI2PTZTD.js";
3
+ } from "./chunk-6PYLXFYS.js";
4
4
 
5
5
  // src/InSitue.tsx
6
6
  import { useEffect } from "react";
@@ -54,7 +54,7 @@ function InSitue({ port }) {
54
54
  }
55
55
 
56
56
  // src/index.ts
57
- var SDK_VERSION = "0.4.5";
57
+ var SDK_VERSION = "0.4.6";
58
58
  export {
59
59
  InSitue,
60
60
  InSitueCapture,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insitue/sdk",
3
- "version": "0.4.5",
3
+ "version": "0.4.6",
4
4
  "description": "InSitue capture SDK — drop one snippet into your deployed app; your users point at a bug, InSitue opens a verified pull request.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -51,7 +51,7 @@
51
51
  "tsup": "^8.3.5",
52
52
  "typescript": "^5.6.3",
53
53
  "vitest": "^3.2.4",
54
- "@insitue/capture-core": "0.3.2"
54
+ "@insitue/capture-core": "0.3.3"
55
55
  },
56
56
  "repository": {
57
57
  "type": "git",