@forgedevstack/ink 1.0.0

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.
Files changed (90) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/LICENSE +21 -0
  3. package/README.md +83 -0
  4. package/dist/angular/index.cjs +30 -0
  5. package/dist/angular/index.d.ts +16 -0
  6. package/dist/angular/index.d.ts.map +1 -0
  7. package/dist/angular/index.js +39 -0
  8. package/dist/components/InkEditor/InkEditor.cjs +1 -0
  9. package/dist/components/InkEditor/InkEditor.d.ts +4 -0
  10. package/dist/components/InkEditor/InkEditor.d.ts.map +1 -0
  11. package/dist/components/InkEditor/InkEditor.js +225 -0
  12. package/dist/components/InkEditor/components/ToolbarButton/ToolbarButton.cjs +1 -0
  13. package/dist/components/InkEditor/components/ToolbarButton/ToolbarButton.d.ts +4 -0
  14. package/dist/components/InkEditor/components/ToolbarButton/ToolbarButton.d.ts.map +1 -0
  15. package/dist/components/InkEditor/components/ToolbarButton/ToolbarButton.js +22 -0
  16. package/dist/components/InkEditor/components/ToolbarButton/index.d.ts +2 -0
  17. package/dist/components/InkEditor/components/ToolbarButton/index.d.ts.map +1 -0
  18. package/dist/components/InkEditor/components/ToolbarColorPicker/ToolbarColorPicker.cjs +1 -0
  19. package/dist/components/InkEditor/components/ToolbarColorPicker/ToolbarColorPicker.d.ts +4 -0
  20. package/dist/components/InkEditor/components/ToolbarColorPicker/ToolbarColorPicker.d.ts.map +1 -0
  21. package/dist/components/InkEditor/components/ToolbarColorPicker/ToolbarColorPicker.js +24 -0
  22. package/dist/components/InkEditor/components/ToolbarColorPicker/index.d.ts +2 -0
  23. package/dist/components/InkEditor/components/ToolbarColorPicker/index.d.ts.map +1 -0
  24. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.cjs +1 -0
  25. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.d.ts +4 -0
  26. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.d.ts.map +1 -0
  27. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.js +21 -0
  28. package/dist/components/InkEditor/components/ToolbarDropdown/index.d.ts +2 -0
  29. package/dist/components/InkEditor/components/ToolbarDropdown/index.d.ts.map +1 -0
  30. package/dist/components/InkEditor/components/index.d.ts +4 -0
  31. package/dist/components/InkEditor/components/index.d.ts.map +1 -0
  32. package/dist/components/InkEditor/helpers/format.utils.cjs +1 -0
  33. package/dist/components/InkEditor/helpers/format.utils.d.ts +13 -0
  34. package/dist/components/InkEditor/helpers/format.utils.d.ts.map +1 -0
  35. package/dist/components/InkEditor/helpers/format.utils.js +26 -0
  36. package/dist/components/InkEditor/helpers/index.d.ts +2 -0
  37. package/dist/components/InkEditor/helpers/index.d.ts.map +1 -0
  38. package/dist/components/InkEditor/index.d.ts +3 -0
  39. package/dist/components/InkEditor/index.d.ts.map +1 -0
  40. package/dist/components/index.d.ts +2 -0
  41. package/dist/components/index.d.ts.map +1 -0
  42. package/dist/constants/defaults.const.cjs +1 -0
  43. package/dist/constants/defaults.const.d.ts +19 -0
  44. package/dist/constants/defaults.const.d.ts.map +1 -0
  45. package/dist/constants/defaults.const.js +81 -0
  46. package/dist/constants/index.d.ts +4 -0
  47. package/dist/constants/index.d.ts.map +1 -0
  48. package/dist/constants/numbers.const.cjs +1 -0
  49. package/dist/constants/numbers.const.d.ts +5 -0
  50. package/dist/constants/numbers.const.d.ts.map +1 -0
  51. package/dist/constants/numbers.const.js +6 -0
  52. package/dist/constants/typos.const.cjs +1 -0
  53. package/dist/constants/typos.const.d.ts +3 -0
  54. package/dist/constants/typos.const.d.ts.map +1 -0
  55. package/dist/constants/typos.const.js +26 -0
  56. package/dist/index.cjs +1 -0
  57. package/dist/index.d.ts +6 -0
  58. package/dist/index.d.ts.map +1 -0
  59. package/dist/index.js +17 -0
  60. package/dist/plugins/ai/aiPlugin.cjs +1 -0
  61. package/dist/plugins/ai/aiPlugin.d.ts +4 -0
  62. package/dist/plugins/ai/aiPlugin.d.ts.map +1 -0
  63. package/dist/plugins/ai/aiPlugin.js +22 -0
  64. package/dist/plugins/ai/index.cjs +1 -0
  65. package/dist/plugins/ai/index.d.ts +3 -0
  66. package/dist/plugins/ai/index.d.ts.map +1 -0
  67. package/dist/plugins/ai/index.js +5 -0
  68. package/dist/styles.css +149 -0
  69. package/dist/types/ai.types.d.ts +25 -0
  70. package/dist/types/ai.types.d.ts.map +1 -0
  71. package/dist/types/index.d.ts +3 -0
  72. package/dist/types/index.d.ts.map +1 -0
  73. package/dist/types/ink.types.d.ts +48 -0
  74. package/dist/types/ink.types.d.ts.map +1 -0
  75. package/dist/utils/cn.utils.cjs +1 -0
  76. package/dist/utils/cn.utils.d.ts +2 -0
  77. package/dist/utils/cn.utils.d.ts.map +1 -0
  78. package/dist/utils/cn.utils.js +4 -0
  79. package/dist/utils/index.d.ts +3 -0
  80. package/dist/utils/index.d.ts.map +1 -0
  81. package/dist/utils/typo.utils.cjs +1 -0
  82. package/dist/utils/typo.utils.d.ts +3 -0
  83. package/dist/utils/typo.utils.d.ts.map +1 -0
  84. package/dist/utils/typo.utils.js +15 -0
  85. package/dist/utils/typo.utils.test.d.ts +2 -0
  86. package/dist/utils/typo.utils.test.d.ts.map +1 -0
  87. package/package.json +89 -0
  88. package/wordpress/README.md +13 -0
  89. package/wordpress/ink-editor/assets/.gitkeep +0 -0
  90. package/wordpress/ink-editor/ink-editor.php +92 -0
@@ -0,0 +1,26 @@
1
+ const n = (t, e) => document.execCommand(t, !1, e), r = (t) => document.queryCommandState(t), a = (t) => document.queryCommandValue(t), d = (t) => {
2
+ if (!t) return !1;
3
+ const e = t.startsWith("http://") || t.startsWith("https://") || t.startsWith("mailto:") ? t : `https://${t}`;
4
+ return n("createLink", e);
5
+ }, c = (t) => n("foreColor", t), l = (t) => n("hiliteColor", t), i = (t) => n("insertHTML", t), m = (t, e = "") => {
6
+ const s = e.replace(/"/g, """);
7
+ return i(`<img src="${t}" alt="${s}" style="max-width:100%;height:auto;" />`);
8
+ }, h = (t) => new Promise((e, s) => {
9
+ const o = new FileReader();
10
+ o.onload = () => e(String(o.result)), o.onerror = s, o.readAsDataURL(t);
11
+ }), u = () => {
12
+ const t = /* @__PURE__ */ new Set();
13
+ return r("bold") && t.add("bold"), r("italic") && t.add("italic"), r("underline") && t.add("underline"), r("strikeThrough") && t.add("strikethrough"), r("insertUnorderedList") && t.add("bulletList"), r("insertOrderedList") && t.add("orderedList"), t;
14
+ };
15
+ export {
16
+ n as execCommand,
17
+ h as fileToDataUrl,
18
+ u as getActiveFormats,
19
+ i as insertHTML,
20
+ m as insertImage,
21
+ d as insertLink,
22
+ r as queryCommandState,
23
+ a as queryCommandValue,
24
+ l as setHighlightColor,
25
+ c as setTextColor
26
+ };
@@ -0,0 +1,2 @@
1
+ export { execCommand, queryCommandState, queryCommandValue, insertLink, setTextColor, setHighlightColor, insertHTML, insertImage, fileToDataUrl, getActiveFormats, applyFormat, } from './format.utils';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/InkEditor/helpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,UAAU,EACV,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,WAAW,GACZ,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { InkEditor } from './InkEditor';
2
+ export type { InkEditorProps, ToolbarOption } from '../../types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/InkEditor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { InkEditor } from './InkEditor';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=["headingDropdown","divider","bold","italic","underline","strikethrough","divider","textColor","highlightColor","divider","bulletList","orderedList","divider","link","image","divider","clearFormat"],e=["bold","italic","underline","divider","bulletList","orderedList"],i=[{value:"p",label:"Paragraph"},{value:"h1",label:"Heading 1"},{value:"h2",label:"Heading 2"},{value:"h3",label:"Heading 3"},{value:"h4",label:"Heading 4"},{value:"h5",label:"Heading 5"},{value:"h6",label:"Heading 6"}],l={bold:{title:"Bold (Ctrl+B)",command:"bold"},italic:{title:"Italic (Ctrl+I)",command:"italic"},underline:{title:"Underline (Ctrl+U)",command:"underline"},strikethrough:{title:"Strikethrough",command:"strikeThrough"},heading1:{title:"Heading 1",command:"formatBlock",value:"h1"},heading2:{title:"Heading 2",command:"formatBlock",value:"h2"},heading3:{title:"Heading 3",command:"formatBlock",value:"h3"},heading4:{title:"Heading 4",command:"formatBlock",value:"h4"},heading5:{title:"Heading 5",command:"formatBlock",value:"h5"},heading6:{title:"Heading 6",command:"formatBlock",value:"h6"},paragraph:{title:"Paragraph",command:"formatBlock",value:"p"},bulletList:{title:"Bullet list",command:"insertUnorderedList"},orderedList:{title:"Numbered list",command:"insertOrderedList"},blockquote:{title:"Quote",command:"formatBlock",value:"blockquote"},code:{title:"Code block",command:"formatBlock",value:"pre"},alignLeft:{title:"Align left",command:"justifyLeft"},alignCenter:{title:"Align center",command:"justifyCenter"},alignRight:{title:"Align right",command:"justifyRight"},alignJustify:{title:"Justify",command:"justifyFull"},indent:{title:"Indent",command:"indent"},outdent:{title:"Outdent",command:"outdent"},clearFormat:{title:"Clear formatting",command:"removeFormat"}},a=["#111827","#dc2626","#ea580c","#ca8a04","#16a34a","#2563eb","#7c3aed","#db2777"],o="Start typing...",n="Ink-Editor",d="Ink-Editor__toolbar",r="Ink-Editor__content",_="Ink-Editor__divider",c="Ink-Editor__button",m="Ink-Editor__button--active",I="Ink-Editor__footer";exports.INK_BUTTON_CONFIG=l;exports.INK_CLASS_BUTTON=c;exports.INK_CLASS_BUTTON_ACTIVE=m;exports.INK_CLASS_CONTENT=r;exports.INK_CLASS_DIVIDER=_;exports.INK_CLASS_FOOTER=I;exports.INK_CLASS_ROOT=n;exports.INK_CLASS_TOOLBAR=d;exports.INK_COLOR_SWATCHES=a;exports.INK_DEFAULT_TOOLBAR=t;exports.INK_HEADING_OPTIONS=i;exports.INK_PLACEHOLDER_DEFAULT=o;exports.INK_SIMPLE_TOOLBAR=e;
@@ -0,0 +1,19 @@
1
+ import { DropdownOption, ToolbarOption } from '../types';
2
+ export declare const INK_DEFAULT_TOOLBAR: ToolbarOption[];
3
+ export declare const INK_SIMPLE_TOOLBAR: ToolbarOption[];
4
+ export declare const INK_HEADING_OPTIONS: DropdownOption[];
5
+ export declare const INK_BUTTON_CONFIG: Record<string, {
6
+ title: string;
7
+ command: string;
8
+ value?: string;
9
+ }>;
10
+ export declare const INK_COLOR_SWATCHES: string[];
11
+ export declare const INK_PLACEHOLDER_DEFAULT = "Start typing...";
12
+ export declare const INK_CLASS_ROOT = "Ink-Editor";
13
+ export declare const INK_CLASS_TOOLBAR = "Ink-Editor__toolbar";
14
+ export declare const INK_CLASS_CONTENT = "Ink-Editor__content";
15
+ export declare const INK_CLASS_DIVIDER = "Ink-Editor__divider";
16
+ export declare const INK_CLASS_BUTTON = "Ink-Editor__button";
17
+ export declare const INK_CLASS_BUTTON_ACTIVE = "Ink-Editor__button--active";
18
+ export declare const INK_CLASS_FOOTER = "Ink-Editor__footer";
19
+ //# sourceMappingURL=defaults.const.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaults.const.d.ts","sourceRoot":"","sources":["../../src/constants/defaults.const.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9D,eAAO,MAAM,mBAAmB,EAAE,aAAa,EAkB9C,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,aAAa,EAO7C,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,cAAc,EAQ/C,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,MAAM,CACpC,MAAM,EACN;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAwBnD,CAAC;AAEF,eAAO,MAAM,kBAAkB,UAS9B,CAAC;AAEF,eAAO,MAAM,uBAAuB,oBAAoB,CAAC;AACzD,eAAO,MAAM,cAAc,eAAe,CAAC;AAC3C,eAAO,MAAM,iBAAiB,wBAAwB,CAAC;AACvD,eAAO,MAAM,iBAAiB,wBAAwB,CAAC;AACvD,eAAO,MAAM,iBAAiB,wBAAwB,CAAC;AACvD,eAAO,MAAM,gBAAgB,uBAAuB,CAAC;AACrD,eAAO,MAAM,uBAAuB,+BAA+B,CAAC;AACpE,eAAO,MAAM,gBAAgB,uBAAuB,CAAC"}
@@ -0,0 +1,81 @@
1
+ const t = [
2
+ "headingDropdown",
3
+ "divider",
4
+ "bold",
5
+ "italic",
6
+ "underline",
7
+ "strikethrough",
8
+ "divider",
9
+ "textColor",
10
+ "highlightColor",
11
+ "divider",
12
+ "bulletList",
13
+ "orderedList",
14
+ "divider",
15
+ "link",
16
+ "image",
17
+ "divider",
18
+ "clearFormat"
19
+ ], e = [
20
+ "bold",
21
+ "italic",
22
+ "underline",
23
+ "divider",
24
+ "bulletList",
25
+ "orderedList"
26
+ ], i = [
27
+ { value: "p", label: "Paragraph" },
28
+ { value: "h1", label: "Heading 1" },
29
+ { value: "h2", label: "Heading 2" },
30
+ { value: "h3", label: "Heading 3" },
31
+ { value: "h4", label: "Heading 4" },
32
+ { value: "h5", label: "Heading 5" },
33
+ { value: "h6", label: "Heading 6" }
34
+ ], l = {
35
+ bold: { title: "Bold (Ctrl+B)", command: "bold" },
36
+ italic: { title: "Italic (Ctrl+I)", command: "italic" },
37
+ underline: { title: "Underline (Ctrl+U)", command: "underline" },
38
+ strikethrough: { title: "Strikethrough", command: "strikeThrough" },
39
+ heading1: { title: "Heading 1", command: "formatBlock", value: "h1" },
40
+ heading2: { title: "Heading 2", command: "formatBlock", value: "h2" },
41
+ heading3: { title: "Heading 3", command: "formatBlock", value: "h3" },
42
+ heading4: { title: "Heading 4", command: "formatBlock", value: "h4" },
43
+ heading5: { title: "Heading 5", command: "formatBlock", value: "h5" },
44
+ heading6: { title: "Heading 6", command: "formatBlock", value: "h6" },
45
+ paragraph: { title: "Paragraph", command: "formatBlock", value: "p" },
46
+ bulletList: { title: "Bullet list", command: "insertUnorderedList" },
47
+ orderedList: { title: "Numbered list", command: "insertOrderedList" },
48
+ blockquote: { title: "Quote", command: "formatBlock", value: "blockquote" },
49
+ code: { title: "Code block", command: "formatBlock", value: "pre" },
50
+ alignLeft: { title: "Align left", command: "justifyLeft" },
51
+ alignCenter: { title: "Align center", command: "justifyCenter" },
52
+ alignRight: { title: "Align right", command: "justifyRight" },
53
+ alignJustify: { title: "Justify", command: "justifyFull" },
54
+ indent: { title: "Indent", command: "indent" },
55
+ outdent: { title: "Outdent", command: "outdent" },
56
+ clearFormat: { title: "Clear formatting", command: "removeFormat" }
57
+ }, a = [
58
+ "#111827",
59
+ "#dc2626",
60
+ "#ea580c",
61
+ "#ca8a04",
62
+ "#16a34a",
63
+ "#2563eb",
64
+ "#7c3aed",
65
+ "#db2777"
66
+ ], o = "Start typing...", n = "Ink-Editor", d = "Ink-Editor__toolbar", r = "Ink-Editor__content", c = "Ink-Editor__divider", m = "Ink-Editor__button", u = "Ink-Editor__button--active", g = "Ink-Editor__footer";
67
+ export {
68
+ l as INK_BUTTON_CONFIG,
69
+ m as INK_CLASS_BUTTON,
70
+ u as INK_CLASS_BUTTON_ACTIVE,
71
+ r as INK_CLASS_CONTENT,
72
+ c as INK_CLASS_DIVIDER,
73
+ g as INK_CLASS_FOOTER,
74
+ n as INK_CLASS_ROOT,
75
+ d as INK_CLASS_TOOLBAR,
76
+ a as INK_COLOR_SWATCHES,
77
+ t as INK_DEFAULT_TOOLBAR,
78
+ i as INK_HEADING_OPTIONS,
79
+ o as INK_PLACEHOLDER_DEFAULT,
80
+ e as INK_SIMPLE_TOOLBAR
81
+ };
@@ -0,0 +1,4 @@
1
+ export * from './numbers.const';
2
+ export * from './typos.const';
3
+ export * from './defaults.const';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=150,I="#111827",T="#fef08a";exports.INK_DEFAULT_HIGHLIGHT_COLOR=T;exports.INK_DEFAULT_TEXT_COLOR=I;exports.INK_MIN_HEIGHT=_;
@@ -0,0 +1,5 @@
1
+ export declare const INK_MIN_HEIGHT = 150;
2
+ export declare const INK_DEFAULT_TEXT_COLOR = "#111827";
3
+ export declare const INK_DEFAULT_HIGHLIGHT_COLOR = "#fef08a";
4
+ export declare const INK_COLOR_SWATCH_COUNT = 8;
5
+ //# sourceMappingURL=numbers.const.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"numbers.const.d.ts","sourceRoot":"","sources":["../../src/constants/numbers.const.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,MAAM,CAAC;AAClC,eAAO,MAAM,sBAAsB,YAAY,CAAC;AAChD,eAAO,MAAM,2BAA2B,YAAY,CAAC;AACrD,eAAO,MAAM,sBAAsB,IAAI,CAAC"}
@@ -0,0 +1,6 @@
1
+ const _ = 150, I = "#111827", T = "#fef08a";
2
+ export {
3
+ T as INK_DEFAULT_HIGHLIGHT_COLOR,
4
+ I as INK_DEFAULT_TEXT_COLOR,
5
+ _ as INK_MIN_HEIGHT
6
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={teh:"the",adn:"and",taht:"that",waht:"what",whcih:"which",recieve:"receive",occured:"occurred",seperate:"separate",definately:"definitely",neccessary:"necessary",accomodate:"accommodate",begining:"beginning",enviroment:"environment",independant:"independent",sucess:"success",untill:"until",wierd:"weird",writting:"writing",lenght:"length",thier:"their"},t=/\b([A-Za-z']+)\b/g;exports.TYPO_DICTIONARY=e;exports.TYPO_WORD_BOUNDARY=t;
@@ -0,0 +1,3 @@
1
+ export declare const TYPO_DICTIONARY: Record<string, string>;
2
+ export declare const TYPO_WORD_BOUNDARY: RegExp;
3
+ //# sourceMappingURL=typos.const.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typos.const.d.ts","sourceRoot":"","sources":["../../src/constants/typos.const.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAqBlD,CAAC;AAEF,eAAO,MAAM,kBAAkB,QAAsB,CAAC"}
@@ -0,0 +1,26 @@
1
+ const e = {
2
+ teh: "the",
3
+ adn: "and",
4
+ taht: "that",
5
+ waht: "what",
6
+ whcih: "which",
7
+ recieve: "receive",
8
+ occured: "occurred",
9
+ seperate: "separate",
10
+ definately: "definitely",
11
+ neccessary: "necessary",
12
+ accomodate: "accommodate",
13
+ begining: "beginning",
14
+ enviroment: "environment",
15
+ independant: "independent",
16
+ sucess: "success",
17
+ untill: "until",
18
+ wierd: "weird",
19
+ writting: "writing",
20
+ lenght: "length",
21
+ thier: "their"
22
+ }, n = /\b([A-Za-z']+)\b/g;
23
+ export {
24
+ e as TYPO_DICTIONARY,
25
+ n as TYPO_WORD_BOUNDARY
26
+ };
package/dist/index.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./components/InkEditor/InkEditor.cjs"),n=require("./utils/cn.utils.cjs"),o=require("./utils/typo.utils.cjs"),t=require("./plugins/ai/aiPlugin.cjs"),r=require("./constants/typos.const.cjs"),i=require("./constants/defaults.const.cjs");exports.InkEditor=e.InkEditor;exports.cn=n.cn;exports.applyTypoAutoFix=o.applyTypoAutoFix;exports.createInkAiPlugin=t.createInkAiPlugin;exports.inkAi=t.inkAi;exports.TYPO_DICTIONARY=r.TYPO_DICTIONARY;exports.INK_DEFAULT_TOOLBAR=i.INK_DEFAULT_TOOLBAR;exports.INK_HEADING_OPTIONS=i.INK_HEADING_OPTIONS;exports.INK_SIMPLE_TOOLBAR=i.INK_SIMPLE_TOOLBAR;
@@ -0,0 +1,6 @@
1
+ export { InkEditor } from './components';
2
+ export { applyTypoAutoFix, cn } from './utils';
3
+ export { inkAi, createInkAiPlugin } from './plugins/ai';
4
+ export { INK_DEFAULT_TOOLBAR, INK_SIMPLE_TOOLBAR, INK_HEADING_OPTIONS, TYPO_DICTIONARY, } from './constants';
5
+ export type { InkEditorProps, ToolbarOption, TypoFixResult, InkAiCapability, InkAiRequest, InkAiResponse, InkAiAgent, InkAiPlugin, } from './types';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,GAChB,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,cAAc,EACd,aAAa,EACb,aAAa,EACb,eAAe,EACf,YAAY,EACZ,aAAa,EACb,UAAU,EACV,WAAW,GACZ,MAAM,SAAS,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,17 @@
1
+ import { InkEditor as I } from "./components/InkEditor/InkEditor.js";
2
+ import { cn as t } from "./utils/cn.utils.js";
3
+ import { applyTypoAutoFix as A } from "./utils/typo.utils.js";
4
+ import { createInkAiPlugin as x, inkAi as T } from "./plugins/ai/aiPlugin.js";
5
+ import { TYPO_DICTIONARY as f } from "./constants/typos.const.js";
6
+ import { INK_DEFAULT_TOOLBAR as m, INK_HEADING_OPTIONS as N, INK_SIMPLE_TOOLBAR as n } from "./constants/defaults.const.js";
7
+ export {
8
+ m as INK_DEFAULT_TOOLBAR,
9
+ N as INK_HEADING_OPTIONS,
10
+ n as INK_SIMPLE_TOOLBAR,
11
+ I as InkEditor,
12
+ f as TYPO_DICTIONARY,
13
+ A as applyTypoAutoFix,
14
+ t as cn,
15
+ x as createInkAiPlugin,
16
+ T as inkAi
17
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=new Map,r=()=>({register:e=>{t.set(e.id,e)},unregister:e=>{t.delete(e)},getAgent:e=>t.get(e),listAgents:()=>Array.from(t.values()),run:async(e,n)=>{const i=t.get(e);if(!i)throw new Error(`Ink AI agent "${e}" is not registered. AI agents ship in 1.x.`);if(!i.capabilities.includes(n.capability))throw new Error(`Ink AI agent "${e}" does not support "${n.capability}".`);return i.run(n)}}),s=r();exports.createInkAiPlugin=r;exports.inkAi=s;
@@ -0,0 +1,4 @@
1
+ import { InkAiPlugin } from '../../types';
2
+ export declare const createInkAiPlugin: () => InkAiPlugin;
3
+ export declare const inkAi: InkAiPlugin;
4
+ //# sourceMappingURL=aiPlugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aiPlugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/ai/aiPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,WAAW,EAA+B,MAAM,aAAa,CAAC;AAIxF,eAAO,MAAM,iBAAiB,QAAO,WAmBnC,CAAC;AAEH,eAAO,MAAM,KAAK,aAAsB,CAAC"}
@@ -0,0 +1,22 @@
1
+ const e = /* @__PURE__ */ new Map(), r = () => ({
2
+ register: (t) => {
3
+ e.set(t.id, t);
4
+ },
5
+ unregister: (t) => {
6
+ e.delete(t);
7
+ },
8
+ getAgent: (t) => e.get(t),
9
+ listAgents: () => Array.from(e.values()),
10
+ run: async (t, n) => {
11
+ const i = e.get(t);
12
+ if (!i)
13
+ throw new Error(`Ink AI agent "${t}" is not registered. AI agents ship in 1.x.`);
14
+ if (!i.capabilities.includes(n.capability))
15
+ throw new Error(`Ink AI agent "${t}" does not support "${n.capability}".`);
16
+ return i.run(n);
17
+ }
18
+ }), s = r();
19
+ export {
20
+ r as createInkAiPlugin,
21
+ s as inkAi
22
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./aiPlugin.cjs");exports.createInkAiPlugin=i.createInkAiPlugin;exports.inkAi=i.inkAi;
@@ -0,0 +1,3 @@
1
+ export { createInkAiPlugin, inkAi } from './aiPlugin';
2
+ export type { InkAiCapability, InkAiRequest, InkAiResponse, InkAiAgent, InkAiPlugin, } from '../../types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/ai/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACtD,YAAY,EACV,eAAe,EACf,YAAY,EACZ,aAAa,EACb,UAAU,EACV,WAAW,GACZ,MAAM,aAAa,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { createInkAiPlugin as n, inkAi as r } from "./aiPlugin.js";
2
+ export {
3
+ n as createInkAiPlugin,
4
+ r as inkAi
5
+ };
@@ -0,0 +1,149 @@
1
+ .Ink-Editor {
2
+ --ink-border: #e5e7eb;
3
+ --ink-bg: #ffffff;
4
+ --ink-toolbar: #f9fafb;
5
+ --ink-text: #111827;
6
+ --ink-muted: #6b7280;
7
+ --ink-accent: #0f766e;
8
+ --ink-accent-soft: #ccfbf1;
9
+ border: 1px solid var(--ink-border);
10
+ border-radius: 0.75rem;
11
+ overflow: hidden;
12
+ background: var(--ink-bg);
13
+ color: var(--ink-text);
14
+ box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
15
+ }
16
+
17
+ .Ink-Editor[data-disabled='true'] {
18
+ opacity: 0.6;
19
+ pointer-events: none;
20
+ }
21
+
22
+ .Ink-Editor__toolbar {
23
+ display: flex;
24
+ flex-wrap: wrap;
25
+ align-items: center;
26
+ gap: 0.25rem;
27
+ padding: 0.5rem;
28
+ border-bottom: 1px solid var(--ink-border);
29
+ background: var(--ink-toolbar);
30
+ }
31
+
32
+ .Ink-Editor__button,
33
+ .Ink-Editor__select {
34
+ border: 0;
35
+ background: transparent;
36
+ color: inherit;
37
+ border-radius: 0.375rem;
38
+ cursor: pointer;
39
+ }
40
+
41
+ .Ink-Editor__button {
42
+ min-width: 2rem;
43
+ height: 2rem;
44
+ padding: 0 0.4rem;
45
+ font-weight: 700;
46
+ }
47
+
48
+ .Ink-Editor__button:hover,
49
+ .Ink-Editor__select:hover {
50
+ background: rgb(0 0 0 / 0.06);
51
+ }
52
+
53
+ .Ink-Editor__button--active {
54
+ background: var(--ink-accent-soft);
55
+ color: var(--ink-accent);
56
+ }
57
+
58
+ .Ink-Editor__select {
59
+ height: 2rem;
60
+ padding: 0 0.5rem;
61
+ }
62
+
63
+ .Ink-Editor__divider {
64
+ width: 1px;
65
+ height: 1.25rem;
66
+ margin: 0 0.25rem;
67
+ background: var(--ink-border);
68
+ }
69
+
70
+ .Ink-Editor__color {
71
+ position: relative;
72
+ display: inline-flex;
73
+ align-items: center;
74
+ justify-content: center;
75
+ width: 2rem;
76
+ height: 2rem;
77
+ cursor: pointer;
78
+ }
79
+
80
+ .Ink-Editor__color input {
81
+ position: absolute;
82
+ inset: 0;
83
+ opacity: 0;
84
+ cursor: pointer;
85
+ }
86
+
87
+ .Ink-Editor__color-swatch {
88
+ width: 1rem;
89
+ height: 1rem;
90
+ border-radius: 999px;
91
+ border: 1px solid var(--ink-border);
92
+ }
93
+
94
+ .Ink-Editor__content {
95
+ min-height: 150px;
96
+ padding: 1rem;
97
+ outline: none;
98
+ overflow: auto;
99
+ line-height: 1.6;
100
+ }
101
+
102
+ .Ink-Editor__content:empty::before {
103
+ content: attr(data-placeholder);
104
+ color: var(--ink-muted);
105
+ pointer-events: none;
106
+ }
107
+
108
+ .Ink-Editor__content img {
109
+ max-width: 100%;
110
+ height: auto;
111
+ }
112
+
113
+ .Ink-Editor__content h1,
114
+ .Ink-Editor__content h2,
115
+ .Ink-Editor__content h3,
116
+ .Ink-Editor__content h4,
117
+ .Ink-Editor__content h5,
118
+ .Ink-Editor__content h6 {
119
+ margin: 0.75rem 0 0.5rem;
120
+ line-height: 1.25;
121
+ }
122
+
123
+ .Ink-Editor__content p,
124
+ .Ink-Editor__content ul,
125
+ .Ink-Editor__content ol,
126
+ .Ink-Editor__content blockquote,
127
+ .Ink-Editor__content pre {
128
+ margin: 0.5rem 0;
129
+ }
130
+
131
+ .Ink-Editor__footer {
132
+ padding: 0.35rem 0.75rem;
133
+ border-top: 1px solid var(--ink-border);
134
+ font-size: 0.75rem;
135
+ color: var(--ink-muted);
136
+ text-align: right;
137
+ }
138
+
139
+ @media (prefers-color-scheme: dark) {
140
+ .Ink-Editor {
141
+ --ink-border: #3f3f46;
142
+ --ink-bg: #18181b;
143
+ --ink-toolbar: #27272a;
144
+ --ink-text: #f4f4f5;
145
+ --ink-muted: #a1a1aa;
146
+ --ink-accent: #2dd4bf;
147
+ --ink-accent-soft: rgb(45 212 191 / 0.15);
148
+ }
149
+ }
@@ -0,0 +1,25 @@
1
+ export type InkAiCapability = 'rewrite' | 'summarize' | 'expand' | 'tone' | 'translate';
2
+ export interface InkAiRequest {
3
+ capability: InkAiCapability;
4
+ html: string;
5
+ selectionHtml?: string;
6
+ options?: Record<string, string>;
7
+ }
8
+ export interface InkAiResponse {
9
+ html: string;
10
+ meta?: Record<string, string>;
11
+ }
12
+ export interface InkAiAgent {
13
+ id: string;
14
+ name: string;
15
+ capabilities: InkAiCapability[];
16
+ run: (request: InkAiRequest) => Promise<InkAiResponse>;
17
+ }
18
+ export interface InkAiPlugin {
19
+ register: (agent: InkAiAgent) => void;
20
+ unregister: (agentId: string) => void;
21
+ getAgent: (agentId: string) => InkAiAgent | undefined;
22
+ listAgents: () => InkAiAgent[];
23
+ run: (agentId: string, request: InkAiRequest) => Promise<InkAiResponse>;
24
+ }
25
+ //# sourceMappingURL=ai.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai.types.d.ts","sourceRoot":"","sources":["../../src/types/ai.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GACvB,SAAS,GACT,WAAW,GACX,QAAQ,GACR,MAAM,GACN,WAAW,CAAC;AAEhB,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,eAAe,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,eAAe,EAAE,CAAC;IAChC,GAAG,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC;CACxD;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IACtC,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,UAAU,GAAG,SAAS,CAAC;IACtD,UAAU,EAAE,MAAM,UAAU,EAAE,CAAC;IAC/B,GAAG,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC;CACzE"}
@@ -0,0 +1,3 @@
1
+ export type { ToolbarOption, InkEditorProps, ToolbarButtonProps, DropdownOption, ToolbarDropdownProps, ToolbarColorPickerProps, TypoFixResult, } from './ink.types';
2
+ export type { InkAiCapability, InkAiRequest, InkAiResponse, InkAiAgent, InkAiPlugin, } from './ai.types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,oBAAoB,EACpB,uBAAuB,EACvB,aAAa,GACd,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,eAAe,EACf,YAAY,EACZ,aAAa,EACb,UAAU,EACV,WAAW,GACZ,MAAM,YAAY,CAAC"}
@@ -0,0 +1,48 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ export type ToolbarOption = 'bold' | 'italic' | 'underline' | 'strikethrough' | 'heading1' | 'heading2' | 'heading3' | 'heading4' | 'heading5' | 'heading6' | 'paragraph' | 'headingDropdown' | 'bulletList' | 'orderedList' | 'blockquote' | 'code' | 'link' | 'image' | 'textColor' | 'highlightColor' | 'alignLeft' | 'alignCenter' | 'alignRight' | 'alignJustify' | 'indent' | 'outdent' | 'clearFormat' | 'divider';
3
+ export interface InkEditorProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
4
+ value?: string;
5
+ defaultValue?: string;
6
+ onChange?: (value: string) => void;
7
+ placeholder?: string;
8
+ disabled?: boolean;
9
+ readOnly?: boolean;
10
+ minHeight?: string | number;
11
+ maxHeight?: string | number;
12
+ toolbar?: ToolbarOption[];
13
+ testId?: string;
14
+ allowImagePaste?: boolean;
15
+ showCharCount?: boolean;
16
+ charCountMax?: number;
17
+ typoAutoFix?: boolean;
18
+ }
19
+ export interface ToolbarButtonProps {
20
+ icon: ReactNode;
21
+ title: string;
22
+ active?: boolean;
23
+ onClick: () => void;
24
+ disabled?: boolean;
25
+ }
26
+ export interface DropdownOption {
27
+ value: string;
28
+ label: string;
29
+ }
30
+ export interface ToolbarDropdownProps {
31
+ options: DropdownOption[];
32
+ value: string;
33
+ onChange: (value: string) => void;
34
+ title: string;
35
+ disabled?: boolean;
36
+ }
37
+ export interface ToolbarColorPickerProps {
38
+ value: string;
39
+ onChange: (color: string) => void;
40
+ title: string;
41
+ disabled?: boolean;
42
+ type?: 'text' | 'highlight';
43
+ }
44
+ export interface TypoFixResult {
45
+ html: string;
46
+ fixedCount: number;
47
+ }
48
+ //# sourceMappingURL=ink.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ink.types.d.ts","sourceRoot":"","sources":["../../src/types/ink.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,MAAM,MAAM,aAAa,GACrB,MAAM,GACN,QAAQ,GACR,WAAW,GACX,eAAe,GACf,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,WAAW,GACX,iBAAiB,GACjB,YAAY,GACZ,aAAa,GACb,YAAY,GACZ,MAAM,GACN,MAAM,GACN,OAAO,GACP,WAAW,GACX,gBAAgB,GAChB,WAAW,GACX,aAAa,GACb,YAAY,GACZ,cAAc,GACd,QAAQ,GACR,SAAS,GACT,aAAa,GACb,SAAS,CAAC;AAEd,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IACtF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,OAAO,CAAC,EAAE,aAAa,EAAE,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;CAC7B;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;CACpB"}
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=(...e)=>e.filter(Boolean).join(" ");exports.cn=o;
@@ -0,0 +1,2 @@
1
+ export declare const cn: (...parts: Array<string | false | null | undefined>) => string;
2
+ //# sourceMappingURL=cn.utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cn.utils.d.ts","sourceRoot":"","sources":["../../src/utils/cn.utils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,EAAE,GAAI,GAAG,OAAO,KAAK,CAAC,MAAM,GAAG,KAAK,GAAG,IAAI,GAAG,SAAS,CAAC,KAAG,MACvC,CAAC"}
@@ -0,0 +1,4 @@
1
+ const n = (...o) => o.filter(Boolean).join(" ");
2
+ export {
3
+ n as cn
4
+ };
@@ -0,0 +1,3 @@
1
+ export { cn } from './cn.utils';
2
+ export { applyTypoAutoFix } from './typo.utils';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AAChC,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("../constants/typos.const.cjs"),u=t=>{var o;const r=t.toLowerCase(),e=p.TYPO_DICTIONARY[r];return e?t===t.toUpperCase()?e.toUpperCase():t[0]===((o=t[0])==null?void 0:o.toUpperCase())?e.charAt(0).toUpperCase()+e.slice(1):e:t},c=t=>{let r=0;return{html:t.split(/(<[^>]+>)/g).map(n=>!n||n.startsWith("<")?n:n.replace(p.TYPO_WORD_BOUNDARY,s=>{const i=u(s);return i!==s&&(r+=1),i})).join(""),fixedCount:r}};exports.applyTypoAutoFix=c;
@@ -0,0 +1,3 @@
1
+ import { TypoFixResult } from '../types';
2
+ export declare const applyTypoAutoFix: (html: string) => TypoFixResult;
3
+ //# sourceMappingURL=typo.utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typo.utils.d.ts","sourceRoot":"","sources":["../../src/utils/typo.utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAa9C,eAAO,MAAM,gBAAgB,GAAI,MAAM,MAAM,KAAG,aAc/C,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { TYPO_WORD_BOUNDARY as p, TYPO_DICTIONARY as c } from "../constants/typos.const.js";
2
+ const l = (t) => {
3
+ var s;
4
+ const r = t.toLowerCase(), e = c[r];
5
+ return e ? t === t.toUpperCase() ? e.toUpperCase() : t[0] === ((s = t[0]) == null ? void 0 : s.toUpperCase()) ? e.charAt(0).toUpperCase() + e.slice(1) : e : t;
6
+ }, a = (t) => {
7
+ let r = 0;
8
+ return { html: t.split(/(<[^>]+>)/g).map((n) => !n || n.startsWith("<") ? n : n.replace(p, (o) => {
9
+ const i = l(o);
10
+ return i !== o && (r += 1), i;
11
+ })).join(""), fixedCount: r };
12
+ };
13
+ export {
14
+ a as applyTypoAutoFix
15
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=typo.utils.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typo.utils.test.d.ts","sourceRoot":"","sources":["../../src/utils/typo.utils.test.ts"],"names":[],"mappings":""}