@proveanything/smartlinks-utils-ui 0.6.4 → 0.6.5

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.
@@ -116,6 +116,8 @@ interface EditorContext<TData = unknown> {
116
116
  value: TData;
117
117
  onChange: (next: TData) => void;
118
118
  source: RecordSource;
119
+ /** UUID of the concrete record currently open in the editor, when one exists. */
120
+ recordId?: string;
119
121
  parentValue?: TData | null;
120
122
  scope: ParsedRef;
121
123
  isDirty: boolean;
@@ -700,6 +700,7 @@ function useRecordEditor(args) {
700
700
  value,
701
701
  onChange: setValue,
702
702
  source: effectiveSource,
703
+ recordId: resolved.recordId,
703
704
  parentValue: resolved.parentValue,
704
705
  scope,
705
706
  isDirty,
@@ -4266,7 +4267,14 @@ function RecordsAdminShell(props) {
4266
4267
  const editorCtx = useRecordEditor({
4267
4268
  ctx,
4268
4269
  scope: editingTargetScope ?? parseRef(""),
4269
- resolved: { data: resolved.data, source: resolved.source, sourceRef: resolved.sourceRef, parentValue: resolved.parentValue, facetRule: resolved.facetRule },
4270
+ resolved: {
4271
+ data: resolved.data,
4272
+ source: resolved.source,
4273
+ sourceRef: resolved.sourceRef,
4274
+ recordId: resolved.recordId,
4275
+ parentValue: resolved.parentValue,
4276
+ facetRule: resolved.facetRule
4277
+ },
4270
4278
  defaultData,
4271
4279
  reseed: dirtyStrategy === "keep" ? "preserve-dirty" : "always",
4272
4280
  // Seed an empty rule for freshly-minted `rule:{id}` refs so the Targeting
@@ -4486,14 +4494,14 @@ function RecordsAdminShell(props) {
4486
4494
  useEffect(() => {
4487
4495
  if (!pendingPasteTarget) return;
4488
4496
  if (!editingScope) return;
4489
- const matched = pendingPasteTarget.kind === "record" ? selectedRecordId === pendingPasteTarget.recordId : editingScope.raw === pendingPasteTarget.ref;
4497
+ const matched = pendingPasteTarget.kind === "record" ? (isCollection ? selectedItemId : selectedRecordId) === pendingPasteTarget.recordId : editingScope.raw === pendingPasteTarget.ref;
4490
4498
  if (!matched) return;
4491
4499
  const t = window.setTimeout(() => {
4492
4500
  setPendingPasteTarget(null);
4493
4501
  void pasteCurrent();
4494
4502
  }, 0);
4495
4503
  return () => window.clearTimeout(t);
4496
- }, [pendingPasteTarget, editingScope, selectedRecordId, pasteCurrent]);
4504
+ }, [pendingPasteTarget, editingScope, isCollection, selectedItemId, selectedRecordId, pasteCurrent]);
4497
4505
  const rowClipboard = enableClipboard ? (record) => {
4498
4506
  const summaryHasData = record.data != null;
4499
4507
  const sourceParsed = record.scope;