-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update next.js * Move to define views as a string which we'll compile only for the dashboard next * Compile & use views * Use fields * Remove Hint - if we ever revive GraphQL support we'll need this again but it's in the way for now * Reference nested views * Fix custom views * Improve error handling during builds * Update cito * Update error reporting * Update web * Interim * Allow inline components as views still * Restore media root icon
- Loading branch information
Showing
123 changed files
with
937 additions
and
1,116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"_id": "2mWHuPMJwVqOpADbv7Uf9nFl7zj", | ||
"_type": "CustomViewExample", | ||
"_index": "Zy", | ||
"_i18nId": "2mWHuPMJwVqOpADbv7Uf9nFl7zj", | ||
"title": "Custom view" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export function CustomRootView() { | ||
return ( | ||
<div style={{width: '100%', height: '100%', background: 'yellow'}}> | ||
Custom root view | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import {FieldOptions, ScalarField, WithoutLabel} from 'alinea/core' | ||
|
||
export interface PositionOptions extends FieldOptions<Position> {} | ||
|
||
export interface Position { | ||
x: number | null | ||
y: number | null | ||
} | ||
|
||
class PositionField extends ScalarField<Position, PositionOptions> {} | ||
|
||
export function position( | ||
label: string, | ||
options: WithoutLabel<PositionOptions> = {} | ||
) { | ||
return new PositionField({ | ||
options: {label, ...options}, | ||
view: '@/field/PositionField.view#PositionInput' | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export default function CustomEntryView() { | ||
return ( | ||
<div style={{width: '100%', height: '100%', background: 'red'}}> | ||
Custom entry view | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,6 @@ | ||
import {Config} from 'alinea' | ||
|
||
export const CustomPage = Config.document('Custom page', { | ||
view() { | ||
return ( | ||
<div style={{width: '100%', height: '100%', background: 'red'}}> | ||
Custom entry view | ||
</div> | ||
) | ||
}, | ||
view: '@/schema/example/CustomEntryView', | ||
fields: {} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import {Config, Field} from 'alinea' | ||
|
||
export const CustomViewExample = Config.document('Custom view', { | ||
fields: { | ||
...Field.view('@/schema/example/CustomViewExample.view#CustomViewExample') | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export function CustomViewExample() { | ||
return <div>Custom view example</div> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import {cms} from '@/cms' | ||
import {DemoRecipePage} from '@/page/demo/DemoRecipePage' | ||
|
||
export default async ({params}) => { | ||
export default async function DemoSlug({params}) { | ||
const props = await cms.get(DemoRecipePage.fragment.wherePath(params.slug)) | ||
return <DemoRecipePage {...props} /> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import {cms} from '@/cms' | ||
import {DemoHomePage} from '@/page/demo/DemoHomePage' | ||
|
||
export default async () => { | ||
export default async function DemoPage() { | ||
const props = await cms.get(DemoHomePage.fragment) | ||
return <DemoHomePage {...props} /> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.