@spotpatch/dev-server 0.11.0 → 0.11.1

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.js CHANGED
@@ -3911,6 +3911,7 @@ import {
3911
3911
  import { realpath as realpath6 } from "fs/promises";
3912
3912
  import path8 from "path";
3913
3913
  import {
3914
+ ELEMENT_INSTANCE_LIMITS,
3914
3915
  ERROR_CODES as ERROR_CODES9,
3915
3916
  SpotPatchError as SpotPatchError9,
3916
3917
  redactSensitiveText,
@@ -4301,17 +4302,14 @@ function freezeMatchedRule(rule) {
4301
4302
  });
4302
4303
  }
4303
4304
  function targetIdentity(target) {
4304
- const source = target.source;
4305
- if (source.fileId !== void 0 && source.line !== void 0 && source.column !== void 0) {
4306
- return `source:${source.fileId}:${String(source.line)}:${String(source.column)}`;
4307
- }
4308
- return [
4309
- "element",
4310
- source.origin,
4311
- source.relativePath ?? "",
4305
+ if (target.element.instance !== void 0)
4306
+ return `instance:${target.element.instance.id}`;
4307
+ return JSON.stringify([
4308
+ target.page?.url ?? "",
4309
+ target.source,
4312
4310
  target.element.selector,
4313
4311
  target.element.sanitizedHtml
4314
- ].join("\0");
4312
+ ]);
4315
4313
  }
4316
4314
  async function authorizeTarget(target, input) {
4317
4315
  const source = await authorizeSourceRef(target.source, input.registry, input.root);
@@ -4348,6 +4346,19 @@ async function authorizeTarget(target, input) {
4348
4346
  ...reactSource === void 0 ? {} : { source: reactSource }
4349
4347
  }),
4350
4348
  element: Object.freeze({
4349
+ ...target.element.instance === void 0 ? {} : {
4350
+ instance: Object.freeze({
4351
+ ...target.element.instance,
4352
+ label: redactSensitiveText(target.element.instance.label).slice(
4353
+ 0,
4354
+ ELEMENT_INSTANCE_LIMITS.labelCharacters
4355
+ ),
4356
+ context: redactSensitiveText(target.element.instance.context).slice(
4357
+ 0,
4358
+ ELEMENT_INSTANCE_LIMITS.contextCharacters
4359
+ )
4360
+ })
4361
+ },
4351
4362
  tagName: target.element.tagName,
4352
4363
  selector: target.element.selector,
4353
4364
  sanitizedHtml: target.element.sanitizedHtml,