forked from sanity-io/table
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7f1e14b
commit 441c0f7
Showing
16 changed files
with
19,824 additions
and
7,163 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,4 +52,3 @@ package-lock.json | |
|
||
# Compiled plugin | ||
/lib | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
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,16 @@ | ||
import { defineConfig } from '@sanity/pkg-utils'; | ||
|
||
export default defineConfig({ | ||
dist: 'lib', | ||
minify: true, | ||
legacyExports: true, | ||
// Remove this block to enable strict export validation | ||
extract: { | ||
rules: { | ||
'ae-forgotten-export': 'off', | ||
'ae-incompatible-release-tags': 'off', | ||
'ae-internal-missing-underscore': 'off', | ||
'ae-missing-release-tag': 'off', | ||
}, | ||
}, | ||
}); |
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 |
---|---|---|
|
@@ -11,12 +11,7 @@ | |
"lint": "eslint . --cache && prettier --check .", | ||
"format": "eslint . --fix --cache && prettier --write ." | ||
}, | ||
"files": [ | ||
"src", | ||
"lib", | ||
"v2-incompatible.js", | ||
"sanity.json" | ||
], | ||
"files": ["src", "lib", "v2-incompatible.js", "sanity.json"], | ||
"source": "./src/index.ts", | ||
"exports": { | ||
".": { | ||
|
@@ -38,25 +33,31 @@ | |
"url": "git+ssh://[email protected]/MathisBullinger/sanity-plugin-another-table.git" | ||
}, | ||
"author": "Mathis Bullinger <[email protected]>", | ||
"keywords": [ | ||
"sanity", | ||
"sanity-plugin" | ||
], | ||
"keywords": ["sanity", "sanity-plugin"], | ||
"license": "MIT", | ||
"peerDependencies": { | ||
"react": "^17.0.1", | ||
"react-dom": "^17.0.1", | ||
"sanity": "^2.33.2" | ||
"@sanity/icons": "^1.2.8", | ||
"react": "^18", | ||
"react-dom": "^18", | ||
"sanity": "dev-preview || 3.0.0-rc.0" | ||
}, | ||
"devDependencies": { | ||
"@sanity/eslint-config-no-v2-imports": "^0.0.1-studio-v3.3", | ||
"@sanity/icons": "^1.2.8", | ||
"@sanity/pkg-utils": "^1.17.3", | ||
"@types/react": "^17.0.3", | ||
"@sanity/plugin-kit": "^2.1.8", | ||
"@types/react": "^18", | ||
"@types/react-dom": "^18", | ||
"eslint": "^8.17.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-config-react-app": "^7.0.1", | ||
"eslint-plugin-react": "^7.30.0", | ||
"eslint-config-sanity": "^6.0.0", | ||
"eslint-plugin-react": "^7.31.10", | ||
"eslint-plugin-react-hooks": "^4.6.0", | ||
"prettier": "^2.7.1", | ||
"react": "^18", | ||
"react-dom": "^18", | ||
"sanity": "dev-preview || 3.0.0-rc.0", | ||
"typescript": "^4.8.0" | ||
}, | ||
"bugs": { | ||
|
@@ -65,6 +66,6 @@ | |
"homepage": "https://github.com/MathisBullinger/sanity-plugin-another-table#readme", | ||
"dependencies": { | ||
"@sanity/incompatible-plugin": "^1.0.4", | ||
"@sanity/ui": "^0.37.22" | ||
"@sanity/ui": "1.0.0-beta.32" | ||
} | ||
} |
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,17 @@ | ||
import React from 'react'; | ||
|
||
export default function TableIcon() { | ||
return ( | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
width="1em" | ||
height="1em" | ||
viewBox="0 0 25 25" | ||
fill="none" | ||
stroke="currentColor" | ||
strokeWidth="1.2" | ||
> | ||
<path d="M3 3h18v18H3zM21 9H3M21 15H3M12 3v18" /> | ||
</svg> | ||
); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export { default as TableComponent } from './TableComponent'; | ||
export { default as TablePreview } from './TablePreview'; | ||
export { default as TableIcon } from './TableIcon'; |
This file was deleted.
Oops, something went wrong.
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,10 +1,58 @@ | ||
import { definePlugin } from 'sanity'; | ||
import { table, row } from 'src/schema'; | ||
|
||
export default definePlugin({ | ||
name: 'table', | ||
schema: { | ||
types: [table, row], | ||
}, | ||
document: {}, | ||
import { TableComponent, TablePreview, TableIcon } from './components'; | ||
|
||
interface TableOptions { | ||
rowType: string; | ||
} | ||
|
||
export default definePlugin<TableOptions>(function ({ rowType }) { | ||
return { | ||
name: 'table', | ||
schema: { | ||
types: [ | ||
{ | ||
title: 'Table Row', | ||
name: rowType, | ||
type: 'object', | ||
fields: [ | ||
{ | ||
name: 'cells', | ||
type: 'array', | ||
of: [{ type: 'string' }], | ||
}, | ||
], | ||
}, | ||
{ | ||
title: 'Table', | ||
name: 'table', | ||
type: 'object', | ||
fields: [ | ||
{ | ||
name: 'rows', | ||
type: 'array', | ||
of: [ | ||
{ | ||
type: rowType, | ||
}, | ||
], | ||
}, | ||
], | ||
components: { | ||
input: TableComponent, | ||
preview: TablePreview, | ||
}, | ||
preview: { | ||
select: { | ||
rows: 'rows', | ||
}, | ||
prepare: () => ({ | ||
title: 'Table', | ||
media: TableIcon | ||
}), | ||
}, | ||
}, | ||
], | ||
}, | ||
}; | ||
}); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.