@editora/plugins 1.0.0 → 1.0.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@editora/plugins",
3
- "version": "1.0.0",
4
- "description": "Comprehensive plugin collection for Editora Rich Text Editor with 40+ plugins",
3
+ "version": "1.0.2",
4
+ "description": "40+ Free Premium Plugins for Editora Rich Text Editor. Table editor, code formatting, accessibility, math, media, and more. Free enterprise plugin collection.",
5
5
  "author": "Ajay Kumar <ajaykr089@gmail.com>",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -9,7 +9,7 @@
9
9
  "url": "https://github.com/ajaykr089/Editora.git",
10
10
  "directory": "packages/plugins"
11
11
  },
12
- "homepage": "https://github.com/ajaykr089/Editora#readme",
12
+ "homepage": "https://editora-free.netlify.app/",
13
13
  "bugs": {
14
14
  "url": "https://github.com/ajaykr089/Editora/issues"
15
15
  },
@@ -22,8 +22,20 @@
22
22
  "text-formatting",
23
23
  "markdown",
24
24
  "accessibility",
25
+ "a11y",
25
26
  "math-editor",
26
- "code-editor"
27
+ "code-editor",
28
+ "free-plugins",
29
+ "table-editor",
30
+ "media-manager",
31
+ "spell-check",
32
+ "emoji-support",
33
+ "font-family",
34
+ "color-picker",
35
+ "document-manager",
36
+ "keyboard-shortcuts",
37
+ "page-break",
38
+ "link-editor"
27
39
  ],
28
40
  "main": "dist/index.cjs.js",
29
41
  "module": "dist/index.esm.js",
@@ -50,7 +62,7 @@
50
62
  "@editora/core": "^1.0.0"
51
63
  },
52
64
  "dependencies": {
53
- "@editora/core": "^1.0.0",
65
+ "@editora/core": "^1.0.2",
54
66
  "katex": "^0.16.27",
55
67
  "mathjax": "^3.2.2"
56
68
  },
@@ -62,5 +74,5 @@
62
74
  "publishConfig": {
63
75
  "access": "public"
64
76
  },
65
- "gitHead": "e26546f8b2455c9a27eceb61818db31fd81fb518"
77
+ "gitHead": "b4a92679b7a31308632c48abd5e536476d58b0c7"
66
78
  }
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index-CGbrgpa_.js");async function l(i){return new Promise((o,r)=>{const t=new FileReader;t.onload=async e=>{try{const n=e.target?.result,a=await c.mammoth.convertToHtml({arrayBuffer:n});o(a.value)}catch(n){r(new Error(`Failed to import Word document: ${n}`))}},t.onerror=()=>r(new Error("Failed to read file")),t.readAsArrayBuffer(i)})}async function m(i,o="document.docx"){try{const r=c.getApiUrl("exportWord"),t=c.getApiHeaders(),e=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",...t},body:JSON.stringify({htmlContent:i,filename:o})});if(!e.ok){const a=await e.json();throw new Error(a.error||"Failed to export document")}const n=await e.blob();h(n,o)}catch(r){throw new Error(`Failed to export to Word: ${r}`)}}async function p(i,o="document.pdf",r){try{const t=new c.E({orientation:"portrait",unit:"mm",format:"a4"}),e=20;if(r){const n=await c.html2canvas(r,{scale:2,useCORS:!0,allowTaint:!0}),a=n.toDataURL("image/png"),d=t.internal.pageSize.getWidth()-2*e,s=n.height*d/n.width;t.addImage(a,"PNG",e,e,d,s)}else{const n=u(i).split(`
2
- `);let a=e;n.forEach(d=>{a>t.internal.pageSize.getHeight()-e&&(t.addPage(),a=e),t.text(d,e,a),a+=7})}t.save(o)}catch(t){throw new Error(`Failed to export to PDF: ${t}`)}}function u(i){const o=document.createElement("div");return o.innerHTML=i,o.textContent||o.innerText||""}function h(i,o){const r=URL.createObjectURL(i),t=document.createElement("a");t.href=r,t.download=o,document.body.appendChild(t),t.click(),document.body.removeChild(t),URL.revokeObjectURL(r)}exports.exportToPdf=p;exports.exportToWord=m;exports.importFromWord=l;
@@ -1,77 +0,0 @@
1
- import { m as s, g as l, a as m, E as p, h } from "./index-560-K8WX.mjs";
2
- async function w(i) {
3
- return new Promise((o, r) => {
4
- const t = new FileReader();
5
- t.onload = async (e) => {
6
- try {
7
- const n = e.target?.result, a = await s.convertToHtml({ arrayBuffer: n });
8
- o(a.value);
9
- } catch (n) {
10
- r(new Error(`Failed to import Word document: ${n}`));
11
- }
12
- }, t.onerror = () => r(new Error("Failed to read file")), t.readAsArrayBuffer(i);
13
- });
14
- }
15
- async function y(i, o = "document.docx") {
16
- try {
17
- const r = l("exportWord"), t = m(), e = await fetch(r, {
18
- method: "POST",
19
- headers: {
20
- "Content-Type": "application/json",
21
- ...t
22
- },
23
- body: JSON.stringify({
24
- htmlContent: i,
25
- filename: o
26
- })
27
- });
28
- if (!e.ok) {
29
- const a = await e.json();
30
- throw new Error(a.error || "Failed to export document");
31
- }
32
- const n = await e.blob();
33
- f(n, o);
34
- } catch (r) {
35
- throw new Error(`Failed to export to Word: ${r}`);
36
- }
37
- }
38
- async function x(i, o = "document.pdf", r) {
39
- try {
40
- const t = new p({
41
- orientation: "portrait",
42
- unit: "mm",
43
- format: "a4"
44
- }), e = 20;
45
- if (r) {
46
- const n = await h(r, {
47
- scale: 2,
48
- useCORS: !0,
49
- allowTaint: !0
50
- }), a = n.toDataURL("image/png"), c = t.internal.pageSize.getWidth() - 2 * e, d = n.height * c / n.width;
51
- t.addImage(a, "PNG", e, e, c, d);
52
- } else {
53
- const n = u(i).split(`
54
- `);
55
- let a = e;
56
- n.forEach((c) => {
57
- a > t.internal.pageSize.getHeight() - e && (t.addPage(), a = e), t.text(c, e, a), a += 7;
58
- });
59
- }
60
- t.save(o);
61
- } catch (t) {
62
- throw new Error(`Failed to export to PDF: ${t}`);
63
- }
64
- }
65
- function u(i) {
66
- const o = document.createElement("div");
67
- return o.innerHTML = i, o.textContent || o.innerText || "";
68
- }
69
- function f(i, o) {
70
- const r = URL.createObjectURL(i), t = document.createElement("a");
71
- t.href = r, t.download = o, document.body.appendChild(t), t.click(), document.body.removeChild(t), URL.revokeObjectURL(r);
72
- }
73
- export {
74
- x as exportToPdf,
75
- y as exportToWord,
76
- w as importFromWord
77
- };