@yoopta/divider 4.9.9 → 6.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -1
- package/dist/commands/index.d.ts +2 -2
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/events/onKeyDown.d.ts +1 -1
- package/dist/events/onKeyDown.d.ts.map +1 -1
- package/dist/index.d.ts +1 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/plugin/{index.d.ts → divider-plugin.d.ts} +2 -2
- package/dist/plugin/divider-plugin.d.ts.map +1 -0
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +7 -6
- package/dist/components/DividerBlockOptions.d.ts +0 -10
- package/dist/components/DividerBlockOptions.d.ts.map +0 -1
- package/dist/elements/Divider.d.ts +0 -5
- package/dist/elements/Divider.d.ts.map +0 -1
- package/dist/plugin/index.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -20,7 +20,10 @@ yarn add @yoopta/divider
|
|
|
20
20
|
|
|
21
21
|
```javascript
|
|
22
22
|
export type DividerCommands = {
|
|
23
|
-
buildDividerElements: (
|
|
23
|
+
buildDividerElements: (
|
|
24
|
+
editor: YooEditor,
|
|
25
|
+
options?: Partial<DividerElementProps>,
|
|
26
|
+
) => DividerElement,
|
|
24
27
|
insertDivider: (editor: YooEditor, options?: Partial<DividerInsertOptions>) => void,
|
|
25
28
|
deleteDivider: (editor: YooEditor, blockId: string) => void,
|
|
26
29
|
updateDivider: (editor: YooEditor, blockId: string, props: Partial<DividerElementProps>) => void,
|
package/dist/commands/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { YooEditor, YooptaPathIndex } from '@yoopta/editor';
|
|
2
|
-
import { DividerElement, DividerElementProps } from '../types';
|
|
1
|
+
import type { YooEditor, YooptaPathIndex } from '@yoopta/editor';
|
|
2
|
+
import type { DividerElement, DividerElementProps } from '../types';
|
|
3
3
|
type DividerInsertOptions = DividerElementProps & {
|
|
4
4
|
at?: YooptaPathIndex;
|
|
5
5
|
focus?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGjE,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpE,KAAK,oBAAoB,GAAG,mBAAmB,GAAG;IAChD,EAAE,CAAC,EAAE,eAAe,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,oBAAoB,EAAE,CACpB,MAAM,EAAE,SAAS,EACjB,OAAO,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,KACnC,cAAc,CAAC;IACpB,aAAa,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,KAAK,IAAI,CAAC;IACpF,aAAa,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5D,aAAa,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAC;CAClG,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,eA4B7B,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { PluginEventHandlerOptions, SlateEditor, YooEditor } from '@yoopta/editor';
|
|
1
|
+
import type { PluginEventHandlerOptions, SlateEditor, YooEditor } from '@yoopta/editor';
|
|
2
2
|
export declare function onKeyDown(editor: YooEditor, slate: SlateEditor, { hotkeys, currentBlock }: PluginEventHandlerOptions): (event: any) => void;
|
|
3
3
|
//# sourceMappingURL=onKeyDown.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onKeyDown.d.ts","sourceRoot":"","sources":["../../src/events/onKeyDown.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"onKeyDown.d.ts","sourceRoot":"","sources":["../../src/events/onKeyDown.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAOxF,wBAAgB,SAAS,CACvB,MAAM,EAAE,SAAS,EACjB,KAAK,EAAE,WAAW,EAClB,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,yBAAyB,wBAqBrD"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
|
+
import { Divider } from './plugin/divider-plugin';
|
|
1
2
|
import { DividerElement, DividerElementProps, DividerTheme } from './types';
|
|
2
|
-
import { Divider } from './plugin';
|
|
3
3
|
export { DividerCommands } from './commands';
|
|
4
|
-
import './styles.css';
|
|
5
|
-
declare module 'slate' {
|
|
6
|
-
interface CustomTypes {
|
|
7
|
-
Element: DividerElement;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
4
|
export default Divider;
|
|
11
5
|
export { DividerElement, DividerElementProps, DividerTheme };
|
|
12
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5E,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,eAAe,OAAO,CAAC;AAEvB,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,YAAY,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{generateId as r,buildBlockData as i,Blocks as d,Elements as o,YooptaPlugin as n}from"@yoopta/editor";const a={buildDividerElements:(e,t={})=>({id:r(),type:"divider",children:[{text:""}],props:{color:t.color||"#EFEFEE",theme:t.theme||"solid",nodeType:"void"}}),insertDivider:(e,t={})=>{const{at:r,focus:o}=t,n=a.buildDividerElements(e),l=i({value:[n],type:"Divider"});d.insertBlock(e,l.type,{at:r,focus:o,blockData:l})},deleteDivider:(e,t)=>{d.deleteBlock(e,{blockId:t})},updateDivider:(e,t,r)=>{o.updateElement(e,{blockId:t,type:"divider",props:r})}},l=["solid","dashed","dotted","gradient"];const s=new n({type:"Divider",elements:e("divider",{render:r=>t("div",Object.assign({contentEditable:!1},{children:[e("hr",Object.assign({},r.attributes)),r.children]})),props:{theme:"solid",color:"#EFEFEE"},nodeType:"void"}),options:{display:{title:"Divider",description:"Divide your blocks"},shortcuts:["---","divider","line"]},parsers:{html:{deserialize:{nodeNames:["HR"],parse:e=>{const t=e.getAttribute("data-meta-theme")||"solid",i=e.getAttribute("data-meta-color")||"#EFEFEE";return{id:r(),type:"divider",props:{nodeType:"void",theme:t,color:i},children:[{text:""}]}}},serialize:e=>{const{theme:t="solid",color:r="#EFEFEE"}=e.props||{};return`<hr data-meta-theme="${t}" data-meta-color="${r}" style="background-color: #8383e0; height: 1.2px" />`}},markdown:{serialize:()=>"---\n"},email:{serialize:e=>{const{theme:t="solid",color:r="#EFEFEE"}=e.props||{};let i=`<hr data-meta-theme="${t}" data-meta-color="${r}" style="border-color: ${r}; background-color: ${r}; height: 1.2px;" />`;return"gradient"===t&&(i=`<hr data-meta-theme="${t}" data-meta-color="${r}" style="background: linear-gradient(to right, transparent, ${r}, transparent); height: 2px; width: 100%;" />`),`\n <table style="width: 100%;">\n <tbody style="width: 100%;">\n <tr>\n <td>${i}</td>\n </tr>\n </tbody>\n </table>`}}},commands:a,events:{onKeyDown:function(e,t,{hotkeys:r,currentBlock:i}){return t=>{if(r.isCmdShiftD(t)){t.preventDefault();const r=o.getElement(e,{blockId:i.id,type:"divider"}),d=l[(l.indexOf(r.props.theme)+1)%l.length];o.updateElement(e,{blockId:i.id,type:"divider",props:{theme:d}})}}}}});export{a as DividerCommands,s as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { YooptaPlugin } from '@yoopta/editor';
|
|
2
|
-
import { DividerElementMap } from '../types';
|
|
2
|
+
import type { DividerElementMap } from '../types';
|
|
3
3
|
declare const Divider: YooptaPlugin<DividerElementMap, Record<string, unknown>>;
|
|
4
4
|
export { Divider };
|
|
5
|
-
//# sourceMappingURL=
|
|
5
|
+
//# sourceMappingURL=divider-plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"divider-plugin.d.ts","sourceRoot":"","sources":["../../src/plugin/divider-plugin.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAc,MAAM,gBAAgB,CAAC;AAI1D,OAAO,KAAK,EAAE,iBAAiB,EAAuB,MAAM,UAAU,CAAC;AAcvE,QAAA,MAAM,OAAO,0DA6DX,CAAC;AAEH,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
package/dist/types.d.ts
CHANGED
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEtE,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,EAAE,YAAY,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,YAAY,CAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC;AAC1E,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,cAAc,CAAC;CACzB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yoopta/divider",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0-beta.2",
|
|
4
4
|
"description": "Divider plugin for Yoopta Editor",
|
|
5
5
|
"author": "Darginec05 <devopsbanda@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/Darginec05/Yoopta-Editor#readme",
|
|
@@ -14,12 +14,13 @@
|
|
|
14
14
|
"dist/"
|
|
15
15
|
],
|
|
16
16
|
"peerDependencies": {
|
|
17
|
-
"@yoopta/editor": ">=4.
|
|
18
|
-
"react": ">=
|
|
19
|
-
"react-dom": ">=
|
|
17
|
+
"@yoopta/editor": ">=4.9.9",
|
|
18
|
+
"react": ">=18.2.0",
|
|
19
|
+
"react-dom": ">=18.2.0"
|
|
20
20
|
},
|
|
21
21
|
"publishConfig": {
|
|
22
|
-
"registry": "https://registry.npmjs.org"
|
|
22
|
+
"registry": "https://registry.npmjs.org",
|
|
23
|
+
"access": "public"
|
|
23
24
|
},
|
|
24
25
|
"repository": {
|
|
25
26
|
"type": "git",
|
|
@@ -34,5 +35,5 @@
|
|
|
34
35
|
"bugs": {
|
|
35
36
|
"url": "https://github.com/Darginec05/Yoopta-Editor/issues"
|
|
36
37
|
},
|
|
37
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "58d2c0e3b3b615017e0adb353b80dc493a571186"
|
|
38
39
|
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { YooEditor, YooptaBlockData } from '@yoopta/editor';
|
|
2
|
-
import { DividerElementProps } from '../types';
|
|
3
|
-
type Props = {
|
|
4
|
-
editor: YooEditor;
|
|
5
|
-
block: YooptaBlockData;
|
|
6
|
-
props?: DividerElementProps;
|
|
7
|
-
};
|
|
8
|
-
declare const DividerBlockOptions: ({ editor, block, props: dividerProps }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export { DividerBlockOptions };
|
|
10
|
-
//# sourceMappingURL=DividerBlockOptions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DividerBlockOptions.d.ts","sourceRoot":"","sources":["../../src/components/DividerBlockOptions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,SAAS,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAgB,MAAM,UAAU,CAAC;AAQ7D,KAAK,KAAK,GAAG;IACX,MAAM,EAAE,SAAS,CAAC;IAClB,KAAK,EAAE,eAAe,CAAC;IACvB,KAAK,CAAC,EAAE,mBAAmB,CAAC;CAC7B,CAAC;AAEF,QAAA,MAAM,mBAAmB,2CAA4C,KAAK,4CA4FzE,CAAC;AAEF,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Divider.d.ts","sourceRoot":"","sources":["../../src/elements/Divider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,wBAAwB,EAAiC,MAAM,gBAAgB,CAAC;AAGzF,QAAA,MAAM,aAAa,+BAAgC,wBAAwB,gBAmD1E,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugin/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG7C,QAAA,MAAM,OAAO,0DAwEX,CAAC;AAEH,OAAO,EAAE,OAAO,EAAE,CAAC"}
|