change default slot name to 'content'

This commit is contained in:
Bowen Tan 2021-10-18 13:50:23 +08:00
parent 7198022b1e
commit e7e479f32d
7 changed files with 14 additions and 15 deletions

View File

@ -43,7 +43,7 @@ export const Editor = () => {
const componentId = appModelManager.genId(component);
eventBus.send(
'operation',
new CreateComponentOperation(component, id, 'container')
new CreateComponentOperation(component, id, 'content')
);
const newLayout = produce(layout, draft => {

View File

@ -50,7 +50,6 @@ export const ComponentItemView: React.FC<Props> = props => {
return (
<Box
width="full"
cursor="pointer"
onDragOver={onDragOver}
onDragLeave={() => setIsDragOver(false)}
onDrop={() => setIsDragOver(false)}
@ -58,7 +57,7 @@ export const ComponentItemView: React.FC<Props> = props => {
>
{noChevron ? null : expandIcon}
<HStack width="full" justify="space-between">
<Text color={isSelected ? 'red.500' : 'black'} onClick={onClick}>
<Text color={isSelected ? 'red.500' : 'black'} onClick={onClick} cursor="pointer">
{title}
</Text>
<IconButton

View File

@ -71,7 +71,7 @@ export const DefaultAppSchema: Application = {
traits: [
{
type: 'core/v1/slot',
properties: { container: { id: 'grid', slot: 'container' } },
properties: { container: { id: 'grid', slot: 'content' } },
},
],
},
@ -82,7 +82,7 @@ export const DefaultAppSchema: Application = {
traits: [
{
type: 'core/v1/slot',
properties: { container: { id: 'grid', slot: 'container' } },
properties: { container: { id: 'grid', slot: 'content' } },
},
],
},
@ -93,7 +93,7 @@ export const DefaultAppSchema: Application = {
traits: [
{
type: 'core/v1/slot',
properties: { container: { id: 'grid', slot: 'container' } },
properties: { container: { id: 'grid', slot: 'content' } },
},
],
},

View File

@ -72,7 +72,7 @@
traits: [
{
type: 'core/v1/slot',
properties: { container: { id: 'grid', slot: 'container' } },
properties: { container: { id: 'grid', slot: 'content' } },
},
],
},
@ -83,7 +83,7 @@
traits: [
{
type: 'core/v1/slot',
properties: { container: { id: 'grid', slot: 'container' } },
properties: { container: { id: 'grid', slot: 'content' } },
},
],
},
@ -94,7 +94,7 @@
traits: [
{
type: 'core/v1/slot',
properties: { container: { id: 'grid', slot: 'container' } },
properties: { container: { id: 'grid', slot: 'content' } },
},
],
},
@ -105,7 +105,7 @@
traits: [
{
type: 'core/v1/slot',
properties: { container: { id: 'grid', slot: 'container' } },
properties: { container: { id: 'grid', slot: 'content' } },
},
],
},

View File

@ -58,7 +58,7 @@
properties: {
container: {
id: 'tooltip',
slot: 'trigger',
slot: 'content',
},
},
},

View File

@ -30,7 +30,7 @@ const TooltipImpl: ComponentImplementation<Static<typeof PropsSchema>> = ({
defaultIsOpen={defaultIsOpen}
shouldWrapChildren={shouldWrapChildren}
>
<Slot slotsMap={slotsMap} slot="trigger" />
<Slot slotsMap={slotsMap} slot="content" />
</Tooltip>
);
};
@ -84,7 +84,7 @@ export default {
properties: PropsSchema,
state: {},
methods: [],
slots: ['trigger'],
slots: ['content'],
styleSlots: [],
events: [],
},

View File

@ -23,7 +23,7 @@ const GridLayout: ComponentImplementation<Static<typeof PropsSchema>> = ({
return (
<Suspense fallback={null}>
<BaseGridLayout onDragStop={onDragStop} onDrop={onDrop} layout={layout}>
{getSlots(slotsMap, 'container')}
{getSlots(slotsMap, 'content')}
</BaseGridLayout>
</Suspense>
);
@ -60,7 +60,7 @@ export default {
properties: PropsSchema,
state: {},
methods: [],
slots: ['container'],
slots: ['content'],
styleSlots: [],
events: [],
},