@yoopta/marks 2.0.1 → 4.0.0-rc.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023-present Akhmed Ibragimov
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,5 @@
1
+ import { YooptaMarkProps } from '@yoopta/editor';
2
+ type BoldMarkProps = YooptaMarkProps<'bold', boolean>;
3
+ export declare const Bold: import("@yoopta/editor").YooptaMark<BoldMarkProps>;
4
+ export {};
5
+ //# sourceMappingURL=bold.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bold.d.ts","sourceRoot":"","sources":["../../src/components/bold.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEnE,KAAK,aAAa,GAAG,eAAe,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEtD,eAAO,MAAM,IAAI,oDAIf,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { YooptaMarkProps } from '@yoopta/editor';
2
+ type CodeMarkProps = YooptaMarkProps<'code', boolean>;
3
+ export declare const CodeMark: import("@yoopta/editor").YooptaMark<CodeMarkProps>;
4
+ export {};
5
+ //# sourceMappingURL=code.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code.d.ts","sourceRoot":"","sources":["../../src/components/code.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAoB,MAAM,gBAAgB,CAAC;AAEnE,KAAK,aAAa,GAAG,eAAe,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEtD,eAAO,MAAM,QAAQ,oDAQnB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { YooptaMarkProps } from '@yoopta/editor';
2
+ export type LeafColorProps = {
3
+ color: string;
4
+ backgroundColor: string;
5
+ backgroundImage?: string;
6
+ backgroundClip?: string;
7
+ webkitTextFillColor?: string;
8
+ };
9
+ export declare const Highlight: import("@yoopta/editor").YooptaMark<YooptaMarkProps<"highlight", LeafColorProps>>;
10
+ //# sourceMappingURL=highlight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"highlight.d.ts","sourceRoot":"","sources":["../../src/components/highlight.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAoB,MAAM,gBAAgB,CAAC;AAEnE,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,SAAS,mFAepB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { YooptaMarkProps } from '@yoopta/editor';
2
+ type ItalicMarkProps = YooptaMarkProps<'italic', boolean>;
3
+ export declare const Italic: import("@yoopta/editor").YooptaMark<ItalicMarkProps>;
4
+ export {};
5
+ //# sourceMappingURL=italic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"italic.d.ts","sourceRoot":"","sources":["../../src/components/italic.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEnE,KAAK,eAAe,GAAG,eAAe,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AAE1D,eAAO,MAAM,MAAM,sDAIjB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { YooptaMarkProps } from '@yoopta/editor';
2
+ type StrikeMarkProps = YooptaMarkProps<'strike', boolean>;
3
+ export declare const Strike: import("@yoopta/editor").YooptaMark<StrikeMarkProps>;
4
+ export {};
5
+ //# sourceMappingURL=strike.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"strike.d.ts","sourceRoot":"","sources":["../../src/components/strike.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEnE,KAAK,eAAe,GAAG,eAAe,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AAE1D,eAAO,MAAM,MAAM,sDAIjB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { YooptaMarkProps } from '@yoopta/editor';
2
+ type UnderlineMarkProps = YooptaMarkProps<'underline', boolean>;
3
+ export declare const Underline: import("@yoopta/editor").YooptaMark<UnderlineMarkProps>;
4
+ export {};
5
+ //# sourceMappingURL=underline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"underline.d.ts","sourceRoot":"","sources":["../../src/components/underline.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEnE,KAAK,kBAAkB,GAAG,eAAe,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;AAEhE,eAAO,MAAM,SAAS,yDAIpB,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1 +1,8 @@
1
- export { Bold, Italic, Underline, Strike, CodeMark } from './components/Marks';
1
+ import './styles.css';
2
+ export { Bold } from './components/bold';
3
+ export { Italic } from './components/italic';
4
+ export { Underline } from './components/underline';
5
+ export { Strike } from './components/strike';
6
+ export { CodeMark } from './components/code';
7
+ export { Highlight } from './components/highlight';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC"}
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{createYooptaMark as e}from"@yoopta/editor";var o="doUI64CQ",t="l-JZUAo-",d="_5SCxD00I",a="_7vXfdYaS",r="_7YZYr7Zb";!function(e,o){void 0===o&&(o={});var t=o.insertAt;if(e&&"undefined"!=typeof document){var d=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===t&&d.firstChild?d.insertBefore(a,d.firstChild):d.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}(".doUI64CQ{font-weight:700}.l-JZUAo-{font-style:italic}._5SCxD00I{text-decoration:line-through}._7vXfdYaS{word-wrap:break-word;border-bottom:.05em solid}._7YZYr7Zb{background:#f7f7f7;border:1px solid rgba(0,0,0,.1);border-radius:5px;color:#000;font-family:SFMono-Regular,Menlo,Consolas,PT Mono,Liberation Mono,Courier,monospace;font-size:75%;margin:3px 2px;padding:2px 6px}");const s=e({type:"bold",hotkey:"mod+b",className:o,as:"strong"}),i=e({type:"italic",hotkey:"mod+i",className:t,as:"em"}),n=e({type:"underline",hotkey:"mod+u",className:a}),l=e({type:"strike",hotkey:"mod+shift+s",className:d}),m=e({type:"code",hotkey:"mod+e",className:r});export{s as Bold,m as CodeMark,i as Italic,l as Strike,n as Underline};
1
+ import{jsx as e}from"react/jsx-runtime";import{createYooptaMark as o}from"@yoopta/editor";!function(e,o){void 0===o&&(o={});var r=o.insertAt;if(e&&"undefined"!=typeof document){var t=document.head||document.getElementsByTagName("head")[0],d=document.createElement("style");d.type="text/css","top"===r&&t.firstChild?t.insertBefore(d,t.firstChild):t.appendChild(d),d.styleSheet?d.styleSheet.cssText=e:d.appendChild(document.createTextNode(e))}}(".yoo-marks-rounded{border-radius:.25rem}.yoo-marks-bg-\\[\\#F2F2F2\\]{--tw-bg-opacity:1;background-color:rgb(242 242 242/var(--tw-bg-opacity))}.yoo-marks-px-\\[4px\\]{padding-left:4px;padding-right:4px}.yoo-marks-py-\\[2px\\]{padding-bottom:2px;padding-top:2px}.yoo-marks-text-\\[75\\%\\]{font-size:75%}.yoo-marks-italic{font-style:italic}.yoo-marks-underline{text-decoration-line:underline}");const r=o({type:"bold",hotkey:"mod+b",render:o=>e("strong",Object.assign({className:"yoo-marks-bold"},{children:o.children}))}),t=o({type:"italic",hotkey:"mod+i",render:o=>e("i",Object.assign({className:"yoo-marks-italic"},{children:o.children}))}),d=o({type:"underline",hotkey:"mod+u",render:o=>e("u",Object.assign({className:"yoo-marks-underline"},{children:o.children}))}),i=o({type:"strike",hotkey:"mod+shift+s",render:o=>e("s",Object.assign({className:"yoo-marks-stroke"},{children:o.children}))}),n=o({type:"code",hotkey:"mod+e",render:o=>e("code",Object.assign({className:"yoo-marks-bg-[#F2F2F2] yoo-marks-py-[2px] yoo-marks-px-[4px] yoo-marks-rounded yoo-marks-text-[75%]"},{children:o.children}))}),a=o({type:"highlight",render:o=>{var r;const t=null===(r=o.leaf)||void 0===r?void 0:r.highlight,d={color:null==t?void 0:t.color,backgroundColor:null==t?void 0:t.backgroundColor,backgroundImage:null==t?void 0:t.backgroundImage,WebkitTextFillColor:null==t?void 0:t.webkitTextFillColor,backgroundClip:null==t?void 0:t.backgroundClip};return e("span",Object.assign({style:d},{children:o.children}))}});export{r as Bold,n as CodeMark,a as Highlight,t as Italic,i as Strike,d as Underline};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoopta/marks",
3
- "version": "2.0.1",
3
+ "version": "4.0.0-rc.1",
4
4
  "description": "> TODO: description",
5
5
  "author": "Darginec05 <devopsbanda@gmail.com>",
6
6
  "homepage": "https://github.com/Darginec05/Editor-Yoopta#readme",
@@ -14,11 +14,11 @@
14
14
  "dist/"
15
15
  ],
16
16
  "peerDependencies": {
17
- "@yoopta/editor": ">=1.9.18-rc",
17
+ "@yoopta/editor": ">=4.0.0-rc.0",
18
18
  "react": ">=17.0.2",
19
19
  "react-dom": ">=17.0.2",
20
- "slate": ">=0.72.3",
21
- "slate-react": ">=0.95.0"
20
+ "slate": ">=0.99.0",
21
+ "slate-react": ">=0.99.0"
22
22
  },
23
23
  "publishConfig": {
24
24
  "registry": "https://registry.yarnpkg.com"
@@ -28,12 +28,16 @@
28
28
  "url": "git+https://github.com/Darginec05/Editor-Yoopta.git"
29
29
  },
30
30
  "scripts": {
31
- "test": "node ./__tests__/@yoopta/paragraph.test.js"
31
+ "test": "node ./__tests__/@yoopta/paragraph.test.js",
32
+ "start": "rollup --config rollup.config.js --watch --bundleConfigAsCjs --environment NODE_ENV:development",
33
+ "prepublishOnly": "yarn build",
34
+ "build": "rollup --config rollup.config.js --bundleConfigAsCjs --environment NODE_ENV:production"
32
35
  },
33
36
  "bugs": {
34
37
  "url": "https://github.com/Darginec05/Editor-Yoopta/issues"
35
38
  },
36
39
  "dependencies": {
37
40
  "body-scroll-lock": "^4.0.0-beta.0"
38
- }
41
+ },
42
+ "gitHead": "c46f09afdb5f60f98f2065e24305a9d02ed57ca7"
39
43
  }
@@ -1,5 +0,0 @@
1
- export declare const Bold: import("@yoopta/editor").YooptaMark;
2
- export declare const Italic: import("@yoopta/editor").YooptaMark;
3
- export declare const Underline: import("@yoopta/editor").YooptaMark;
4
- export declare const Strike: import("@yoopta/editor").YooptaMark;
5
- export declare const CodeMark: import("@yoopta/editor").YooptaMark;
package/dist/types.d.ts DELETED
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export declare function getRectByCurrentSelection(): DOMRect;