This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
||||
ALIGN_VALUES, GAP_VALUES, MAX_COLUMNS, MIN_COLUMNS, SPACING_VALUES,
|
||||
} from '@/lib/ui/node';
|
||||
import { dataSourceFor, dataSourceLabel } from '@/lib/skills/surfaces';
|
||||
import { kindOfBinding } from '@/lib/ui/series';
|
||||
import { nodeRegistry } from '@/lib/ui/registry';
|
||||
import { hideOp, layoutOp, nudgeOp, presentationOp, propOp, removeOp, replaceOp } from './ops';
|
||||
|
||||
@@ -43,8 +44,25 @@ export function NodeInspector({ node, siblings, page = null, onOperate, registry
|
||||
if (op) onOperate(op);
|
||||
};
|
||||
|
||||
const shapes = node.data ? dataSourceFor(node.data.source)?.shapes || [] : null;
|
||||
const replacements = can('replace') ? registry.replacements(node.type, { shapes, page }) : [];
|
||||
/**
|
||||
* What this node could be shown as.
|
||||
*
|
||||
* The same five facts the conversation passes, in the same order, to the same
|
||||
* registry call — the editor holds no compatibility rule of its own, so a
|
||||
* type in this list is exactly a type "show this as a …" would accept. Two
|
||||
* readings of the rule is how a picker comes to offer something the operation
|
||||
* then refuses.
|
||||
*/
|
||||
const shapes = node.data?.source ? dataSourceFor(node.data.source)?.shapes || [] : null;
|
||||
const replacements = can('replace')
|
||||
? registry.replacements(node.type, {
|
||||
shapes,
|
||||
page,
|
||||
seriesKind: kindOfBinding(node.data),
|
||||
seriesBound: Boolean(node.data?.series),
|
||||
bound: Boolean(node.data),
|
||||
})
|
||||
: [];
|
||||
|
||||
return (
|
||||
<div className="space-y-4">
|
||||
|
||||
Reference in New Issue
Block a user