@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.cjs CHANGED
@@ -4251,17 +4251,14 @@ function freezeMatchedRule(rule) {
4251
4251
  });
4252
4252
  }
4253
4253
  function targetIdentity(target) {
4254
- const source = target.source;
4255
- if (source.fileId !== void 0 && source.line !== void 0 && source.column !== void 0) {
4256
- return `source:${source.fileId}:${String(source.line)}:${String(source.column)}`;
4257
- }
4258
- return [
4259
- "element",
4260
- source.origin,
4261
- source.relativePath ?? "",
4254
+ if (target.element.instance !== void 0)
4255
+ return `instance:${target.element.instance.id}`;
4256
+ return JSON.stringify([
4257
+ target.page?.url ?? "",
4258
+ target.source,
4262
4259
  target.element.selector,
4263
4260
  target.element.sanitizedHtml
4264
- ].join("\0");
4261
+ ]);
4265
4262
  }
4266
4263
  async function authorizeTarget(target, input) {
4267
4264
  const source = await authorizeSourceRef(target.source, input.registry, input.root);
@@ -4298,6 +4295,19 @@ async function authorizeTarget(target, input) {
4298
4295
  ...reactSource === void 0 ? {} : { source: reactSource }
4299
4296
  }),
4300
4297
  element: Object.freeze({
4298
+ ...target.element.instance === void 0 ? {} : {
4299
+ instance: Object.freeze({
4300
+ ...target.element.instance,
4301
+ label: (0, import_shared15.redactSensitiveText)(target.element.instance.label).slice(
4302
+ 0,
4303
+ import_shared15.ELEMENT_INSTANCE_LIMITS.labelCharacters
4304
+ ),
4305
+ context: (0, import_shared15.redactSensitiveText)(target.element.instance.context).slice(
4306
+ 0,
4307
+ import_shared15.ELEMENT_INSTANCE_LIMITS.contextCharacters
4308
+ )
4309
+ })
4310
+ },
4301
4311
  tagName: target.element.tagName,
4302
4312
  selector: target.element.selector,
4303
4313
  sanitizedHtml: target.element.sanitizedHtml,