forked from udecode/plate
-
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
3f029b9
commit 9268034
Showing
21 changed files
with
231 additions
and
18 deletions.
There are no files selected for viewing
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
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,12 @@ | ||
{ | ||
"name": "demo1", | ||
"dependencies": [], | ||
"registryDependencies": [], | ||
"files": [ | ||
{ | ||
"name": "demo1.tsx", | ||
"content": "import React from 'react';\nimport { PlateElement, PlateElementProps, Value } from '@udecode/plate-common';\n\n\nimport { cn } from '@/lib/utils';\n\nconst Demo1Element = React.forwardRef<\n React.ElementRef<typeof PlateElement>,\n PlateElementProps<Value, any>\n>(({ className, children, ...props }, ref) => {\n return (\n <PlateElement\n asChild\n ref={ref}\n className={cn(\n 'font-medium text-primary underline decoration-primary underline-offset-4',\n className\n )}\n {...(props as any)}\n >\n\n <strong>{children} <span>demo1</span></strong>\n </PlateElement>\n );\n});\nDemo1Element.displayName = 'Demo1Element';\n\nexport { Demo1Element };" | ||
} | ||
], | ||
"type": "components:plate-ui" | ||
} |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React from 'react'; | ||
import { PlateElement, PlateElementProps, Value } from '@udecode/plate-common'; | ||
|
||
|
||
import { cn } from '@/lib/utils'; | ||
|
||
const Demo1Element = React.forwardRef< | ||
React.ElementRef<typeof PlateElement>, | ||
PlateElementProps<Value, any> | ||
>(({ className, children, ...props }, ref) => { | ||
return ( | ||
<PlateElement | ||
asChild | ||
ref={ref} | ||
className={cn( | ||
'font-medium text-primary underline decoration-primary underline-offset-4', | ||
className | ||
)} | ||
{...(props as any)} | ||
> | ||
|
||
<strong>{children} <span>demo1</span></strong> | ||
</PlateElement> | ||
); | ||
}); | ||
Demo1Element.displayName = 'Demo1Element'; | ||
|
||
export { Demo1Element }; |
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 @@ | ||
__tests__ | ||
__test-utils__ | ||
__mocks__ |
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,11 @@ | ||
# demo1 | ||
|
||
|
||
|
||
## Documentation | ||
|
||
WIP | ||
|
||
## License | ||
|
||
[MIT](../../LICENSE) |
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,59 @@ | ||
{ | ||
"name": "@udecode/plate-demo1", | ||
"version": "26.0.3", | ||
"description": "demo1", | ||
"license": "MIT", | ||
"homepage": "https://platejs.org", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/udecode/plate.git", | ||
"directory": "packages/demo1" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/udecode/plate/issues" | ||
}, | ||
"sideEffects": false, | ||
"main": "dist/index.js", | ||
"module": "dist/index.mjs", | ||
"types": "dist/index.d.ts", | ||
"files": [ | ||
"dist/**/*" | ||
], | ||
"exports": { | ||
".": { | ||
"types": "./dist/index.d.ts", | ||
"import": "./dist/index.mjs", | ||
"module": "./dist/index.mjs", | ||
"require": "./dist/index.js" | ||
} | ||
}, | ||
"scripts": { | ||
"build": "yarn p:build", | ||
"build:watch": "yarn p:build:watch", | ||
"brl": "yarn p:brl", | ||
"lint": "yarn p:lint", | ||
"lint:fix": "yarn p:lint:fix", | ||
"test": "yarn p:test", | ||
"test:watch": "yarn p:test:watch", | ||
"typecheck": "yarn p:typecheck" | ||
}, | ||
"dependencies": { | ||
"@udecode/plate-common": "25.0.1" | ||
}, | ||
"peerDependencies": { | ||
"react": ">=16.8.0", | ||
"react-dom": ">=16.8.0", | ||
"slate": ">=0.94.0", | ||
"slate-history": ">=0.93.0", | ||
"slate-hyperscript": ">=0.66.0", | ||
"slate-react": ">=0.99.0" | ||
}, | ||
"keywords": [ | ||
"plate", | ||
"plugin", | ||
"slate" | ||
], | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} |
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,29 @@ | ||
import { | ||
createPluginFactory, | ||
HotkeyPlugin, | ||
onKeyDownToggleElement, | ||
} from '@udecode/plate-common'; | ||
|
||
export const ELEMENT_DEMO1 = 'demo1'; | ||
|
||
/** | ||
* Enables support for paragraphs. | ||
*/ | ||
export const createDemo1Plugin = createPluginFactory<HotkeyPlugin>({ | ||
key: ELEMENT_DEMO1, | ||
isElement: true, | ||
handlers: { | ||
onKeyDown: onKeyDownToggleElement, | ||
}, | ||
options: { | ||
hotkey: ['mod+opt+0', 'mod+shift+0'], | ||
}, | ||
deserializeHtml: { | ||
rules: [ | ||
{ | ||
validNodeName: 'P', | ||
}, | ||
], | ||
query: (el) => el.style.fontFamily !== 'Consolas', | ||
}, | ||
}); |
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,2 @@ | ||
|
||
export * from './createDemo1Plugin' |
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,8 @@ | ||
{ | ||
"extends": "../../config/tsconfig.build.json", | ||
"compilerOptions": { | ||
"declarationDir": "./dist", | ||
"outDir": "./dist" | ||
}, | ||
"include": ["src"] | ||
} |
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.