@forgedevstack/ink 1.0.1 → 1.1.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 (114) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +78 -122
  3. package/dist/components/InkEditor/InkEditor.cjs +1 -1
  4. package/dist/components/InkEditor/InkEditor.d.ts.map +1 -1
  5. package/dist/components/InkEditor/InkEditor.js +495 -156
  6. package/dist/components/InkEditor/components/AiPanel/AiPanel.cjs +1 -0
  7. package/dist/components/InkEditor/components/AiPanel/AiPanel.d.ts +11 -0
  8. package/dist/components/InkEditor/components/AiPanel/AiPanel.d.ts.map +1 -0
  9. package/dist/components/InkEditor/components/AiPanel/AiPanel.js +178 -0
  10. package/dist/components/InkEditor/components/AiPanel/index.d.ts +3 -0
  11. package/dist/components/InkEditor/components/AiPanel/index.d.ts.map +1 -0
  12. package/dist/components/InkEditor/components/BlockHandles/BlockHandles.cjs +1 -0
  13. package/dist/components/InkEditor/components/BlockHandles/BlockHandles.d.ts +9 -0
  14. package/dist/components/InkEditor/components/BlockHandles/BlockHandles.d.ts.map +1 -0
  15. package/dist/components/InkEditor/components/BlockHandles/BlockHandles.js +12 -0
  16. package/dist/components/InkEditor/components/BlockHandles/index.d.ts +3 -0
  17. package/dist/components/InkEditor/components/BlockHandles/index.d.ts.map +1 -0
  18. package/dist/components/InkEditor/components/CommentsPanel/CommentsPanel.cjs +1 -0
  19. package/dist/components/InkEditor/components/CommentsPanel/CommentsPanel.d.ts +11 -0
  20. package/dist/components/InkEditor/components/CommentsPanel/CommentsPanel.d.ts.map +1 -0
  21. package/dist/components/InkEditor/components/CommentsPanel/CommentsPanel.js +61 -0
  22. package/dist/components/InkEditor/components/CommentsPanel/index.d.ts +3 -0
  23. package/dist/components/InkEditor/components/CommentsPanel/index.d.ts.map +1 -0
  24. package/dist/components/InkEditor/components/SlashMenu/SlashMenu.cjs +1 -0
  25. package/dist/components/InkEditor/components/SlashMenu/SlashMenu.d.ts +10 -0
  26. package/dist/components/InkEditor/components/SlashMenu/SlashMenu.d.ts.map +1 -0
  27. package/dist/components/InkEditor/components/SlashMenu/SlashMenu.js +20 -0
  28. package/dist/components/InkEditor/components/SlashMenu/index.d.ts +3 -0
  29. package/dist/components/InkEditor/components/SlashMenu/index.d.ts.map +1 -0
  30. package/dist/components/InkEditor/components/TrackChangesBar/TrackChangesBar.cjs +1 -0
  31. package/dist/components/InkEditor/components/TrackChangesBar/TrackChangesBar.d.ts +11 -0
  32. package/dist/components/InkEditor/components/TrackChangesBar/TrackChangesBar.d.ts.map +1 -0
  33. package/dist/components/InkEditor/components/TrackChangesBar/TrackChangesBar.js +27 -0
  34. package/dist/components/InkEditor/components/TrackChangesBar/index.d.ts +3 -0
  35. package/dist/components/InkEditor/components/TrackChangesBar/index.d.ts.map +1 -0
  36. package/dist/components/InkEditor/components/index.d.ts +5 -0
  37. package/dist/components/InkEditor/components/index.d.ts.map +1 -1
  38. package/dist/constants/aiModels.const.cjs +1 -0
  39. package/dist/constants/aiModels.const.d.ts +5 -0
  40. package/dist/constants/aiModels.const.d.ts.map +1 -0
  41. package/dist/constants/aiModels.const.js +31 -0
  42. package/dist/constants/defaults.const.cjs +1 -1
  43. package/dist/constants/defaults.const.d.ts +32 -1
  44. package/dist/constants/defaults.const.d.ts.map +1 -1
  45. package/dist/constants/defaults.const.js +124 -20
  46. package/dist/constants/index.d.ts +1 -0
  47. package/dist/constants/index.d.ts.map +1 -1
  48. package/dist/constants/numbers.const.cjs +1 -1
  49. package/dist/constants/numbers.const.d.ts +13 -0
  50. package/dist/constants/numbers.const.d.ts.map +1 -1
  51. package/dist/constants/numbers.const.js +13 -3
  52. package/dist/index.cjs +1 -1
  53. package/dist/index.d.ts +3 -3
  54. package/dist/index.d.ts.map +1 -1
  55. package/dist/index.js +32 -13
  56. package/dist/plugins/ai/aiPlugin.cjs +1 -1
  57. package/dist/plugins/ai/aiPlugin.d.ts.map +1 -1
  58. package/dist/plugins/ai/aiPlugin.js +40 -18
  59. package/dist/plugins/ai/demoProvider.cjs +1 -0
  60. package/dist/plugins/ai/demoProvider.d.ts +3 -0
  61. package/dist/plugins/ai/demoProvider.d.ts.map +1 -0
  62. package/dist/plugins/ai/demoProvider.js +130 -0
  63. package/dist/plugins/ai/index.cjs +1 -1
  64. package/dist/plugins/ai/index.d.ts +4 -1
  65. package/dist/plugins/ai/index.d.ts.map +1 -1
  66. package/dist/plugins/ai/index.js +15 -3
  67. package/dist/plugins/ai/stubs.cjs +1 -0
  68. package/dist/plugins/ai/stubs.d.ts +7 -0
  69. package/dist/plugins/ai/stubs.d.ts.map +1 -0
  70. package/dist/plugins/ai/stubs.js +23 -0
  71. package/dist/styles.css +464 -19
  72. package/dist/types/ai.types.d.ts +111 -2
  73. package/dist/types/ai.types.d.ts.map +1 -1
  74. package/dist/types/comments.types.d.ts +17 -0
  75. package/dist/types/comments.types.d.ts.map +1 -0
  76. package/dist/types/features.types.d.ts +5 -0
  77. package/dist/types/features.types.d.ts.map +1 -0
  78. package/dist/types/index.d.ts +5 -2
  79. package/dist/types/index.d.ts.map +1 -1
  80. package/dist/types/ink.types.d.ts +26 -1
  81. package/dist/types/ink.types.d.ts.map +1 -1
  82. package/dist/types/trackChanges.types.d.ts +12 -0
  83. package/dist/types/trackChanges.types.d.ts.map +1 -0
  84. package/dist/utils/blocks.utils.cjs +1 -0
  85. package/dist/utils/blocks.utils.d.ts +4 -0
  86. package/dist/utils/blocks.utils.d.ts.map +1 -0
  87. package/dist/utils/blocks.utils.js +41 -0
  88. package/dist/utils/comments.utils.cjs +1 -0
  89. package/dist/utils/comments.utils.d.ts +5 -0
  90. package/dist/utils/comments.utils.d.ts.map +1 -0
  91. package/dist/utils/comments.utils.js +32 -0
  92. package/dist/utils/history.utils.cjs +1 -0
  93. package/dist/utils/history.utils.d.ts +13 -0
  94. package/dist/utils/history.utils.d.ts.map +1 -0
  95. package/dist/utils/history.utils.js +29 -0
  96. package/dist/utils/id.utils.cjs +1 -0
  97. package/dist/utils/id.utils.d.ts +2 -0
  98. package/dist/utils/id.utils.d.ts.map +1 -0
  99. package/dist/utils/id.utils.js +4 -0
  100. package/dist/utils/index.d.ts +7 -0
  101. package/dist/utils/index.d.ts.map +1 -1
  102. package/dist/utils/slash.utils.cjs +1 -0
  103. package/dist/utils/slash.utils.d.ts +4 -0
  104. package/dist/utils/slash.utils.d.ts.map +1 -0
  105. package/dist/utils/slash.utils.js +13 -0
  106. package/dist/utils/table.utils.cjs +1 -0
  107. package/dist/utils/table.utils.d.ts +2 -0
  108. package/dist/utils/table.utils.d.ts.map +1 -0
  109. package/dist/utils/table.utils.js +13 -0
  110. package/dist/utils/trackChanges.utils.cjs +1 -0
  111. package/dist/utils/trackChanges.utils.d.ts +7 -0
  112. package/dist/utils/trackChanges.utils.d.ts.map +1 -0
  113. package/dist/utils/trackChanges.utils.js +34 -0
  114. package/package.json +2 -2
@@ -1 +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"}
1
+ {"version":3,"file":"defaults.const.d.ts","sourceRoot":"","sources":["../../src/constants/defaults.const.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAChF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAMlD,eAAO,MAAM,mBAAmB,EAAE,aAAa,EA0B9C,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,aAAa,EAO7C,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,aAAa,EAiB7C,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,CA0BnD,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;AACrD,eAAO,MAAM,eAAe,sBAAsB,CAAC;AACnD,eAAO,MAAM,cAAc,qBAAqB,CAAC;AACjD,eAAO,MAAM,sBAAsB,sBAAsB,CAAC;AAC1D,eAAO,MAAM,mBAAmB,kBAAkB,CAAC;AACnD,eAAO,MAAM,mBAAmB,kBAAkB,CAAC;AACnD,eAAO,MAAM,sBAAsB,qBAAqB,CAAC;AACzD,eAAO,MAAM,kBAAkB,QAAQ,CAAC;AACxC,eAAO,MAAM,mBAAmB,EAAG,SAAkB,CAAC;AACtD,eAAO,MAAM,oBAAoB,EAAE,iBASlC,CAAC;AACF,eAAO,MAAM,sBAAsB,IAAyB,CAAC;AAC7D,eAAO,MAAM,sBAAsB,IAAyB,CAAC;AAE7D,eAAO,MAAM,kBAAkB,EAAE,gBAAgB,EAqChD,CAAC;AAEF,eAAO,MAAM,uBAAuB,uIAW1B,CAAC;AAEX,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;IAK7B,CAAC"}
@@ -1,4 +1,5 @@
1
- const t = [
1
+ import { INK_DEFAULT_TABLE_ROWS as e, INK_DEFAULT_TABLE_COLS as t } from "./numbers.const.js";
2
+ const a = [
2
3
  "headingDropdown",
3
4
  "divider",
4
5
  "bold",
@@ -14,16 +15,41 @@ const t = [
14
15
  "divider",
15
16
  "link",
16
17
  "image",
18
+ "table",
19
+ "divider",
20
+ "undo",
21
+ "redo",
22
+ "divider",
23
+ "trackChanges",
24
+ "comments",
25
+ "ai",
17
26
  "divider",
18
27
  "clearFormat"
19
- ], e = [
28
+ ], l = [
20
29
  "bold",
21
30
  "italic",
22
31
  "underline",
23
32
  "divider",
24
33
  "bulletList",
25
34
  "orderedList"
26
- ], i = [
35
+ ], n = [
36
+ "headingDropdown",
37
+ "divider",
38
+ "bold",
39
+ "italic",
40
+ "underline",
41
+ "divider",
42
+ "bulletList",
43
+ "orderedList",
44
+ "table",
45
+ "divider",
46
+ "trackChanges",
47
+ "comments",
48
+ "ai",
49
+ "divider",
50
+ "undo",
51
+ "redo"
52
+ ], d = [
27
53
  { value: "p", label: "Paragraph" },
28
54
  { value: "h1", label: "Heading 1" },
29
55
  { value: "h2", label: "Heading 2" },
@@ -31,7 +57,7 @@ const t = [
31
57
  { value: "h4", label: "Heading 4" },
32
58
  { value: "h5", label: "Heading 5" },
33
59
  { value: "h6", label: "Heading 6" }
34
- ], l = {
60
+ ], o = {
35
61
  bold: { title: "Bold (Ctrl+B)", command: "bold" },
36
62
  italic: { title: "Italic (Ctrl+I)", command: "italic" },
37
63
  underline: { title: "Underline (Ctrl+U)", command: "underline" },
@@ -53,29 +79,107 @@ const t = [
53
79
  alignJustify: { title: "Justify", command: "justifyFull" },
54
80
  indent: { title: "Indent", command: "indent" },
55
81
  outdent: { title: "Outdent", command: "outdent" },
56
- clearFormat: { title: "Clear formatting", command: "removeFormat" }
57
- }, a = [
82
+ clearFormat: { title: "Clear formatting", command: "removeFormat" },
83
+ undo: { title: "Undo", command: "undo" },
84
+ redo: { title: "Redo", command: "redo" }
85
+ }, r = [
58
86
  "#111827",
59
87
  "#dc2626",
60
88
  "#ea580c",
61
89
  "#ca8a04",
62
90
  "#16a34a",
63
91
  "#2563eb",
64
- "#7c3aed",
92
+ "#0f766e",
65
93
  "#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";
94
+ ], s = "Start typing...", c = "Ink-Editor", m = "Ink-Editor__toolbar", _ = "Ink-Editor__content", u = "Ink-Editor__divider", I = "Ink-Editor__button", L = "Ink-Editor__button--active", g = "Ink-Editor__footer", h = "Ink-Editor__shell", b = "Ink-Editor__body", A = "Ink-tc-insert", N = "Ink-tc-delete", S = "Ink-comment-mark", E = "You", T = "classic", k = {
95
+ table: !0,
96
+ trackChanges: !0,
97
+ comments: !0,
98
+ ai: !0,
99
+ blocks: !0,
100
+ slash: !0,
101
+ history: !0,
102
+ typoAutoFix: !0
103
+ }, C = e, O = t, K = [
104
+ {
105
+ id: "heading1",
106
+ label: "Heading 1",
107
+ keywords: ["h1", "title", "heading"],
108
+ insert: "heading1"
109
+ },
110
+ {
111
+ id: "heading2",
112
+ label: "Heading 2",
113
+ keywords: ["h2", "subtitle", "heading"],
114
+ insert: "heading2"
115
+ },
116
+ {
117
+ id: "bullet",
118
+ label: "Bullet list",
119
+ keywords: ["ul", "list", "bullet"],
120
+ insert: "bulletList"
121
+ },
122
+ {
123
+ id: "ordered",
124
+ label: "Numbered list",
125
+ keywords: ["ol", "list", "numbered"],
126
+ insert: "orderedList"
127
+ },
128
+ {
129
+ id: "table",
130
+ label: "Table",
131
+ keywords: ["table", "grid"],
132
+ insert: "table"
133
+ },
134
+ {
135
+ id: "ai",
136
+ label: "Ask AI",
137
+ keywords: ["ai", "assistant", "chat"],
138
+ insert: "ai"
139
+ }
140
+ ], v = [
141
+ "English",
142
+ "Spanish",
143
+ "French",
144
+ "German",
145
+ "Chinese (Simplified)",
146
+ "Japanese",
147
+ "Russian",
148
+ "Portuguese",
149
+ "Korean",
150
+ "Italian"
151
+ ], B = [
152
+ { id: "rewrite", label: "Rewrite", capability: "rewrite" },
153
+ { id: "summarize", label: "Summarize", capability: "summarize" },
154
+ { id: "expand", label: "Expand", capability: "expand" },
155
+ { id: "tone", label: "Adjust tone", capability: "tone" }
156
+ ];
67
157
  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,
158
+ o as INK_BUTTON_CONFIG,
159
+ b as INK_CLASS_BODY,
160
+ I as INK_CLASS_BUTTON,
161
+ L as INK_CLASS_BUTTON_ACTIVE,
162
+ S as INK_CLASS_COMMENT_MARK,
163
+ _ as INK_CLASS_CONTENT,
164
+ u as INK_CLASS_DIVIDER,
73
165
  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
166
+ c as INK_CLASS_ROOT,
167
+ h as INK_CLASS_SHELL,
168
+ N as INK_CLASS_TC_DELETE,
169
+ A as INK_CLASS_TC_INSERT,
170
+ m as INK_CLASS_TOOLBAR,
171
+ n as INK_COLLAB_TOOLBAR,
172
+ r as INK_COLOR_SWATCHES,
173
+ E as INK_DEFAULT_AUTHOR,
174
+ k as INK_DEFAULT_FEATURES,
175
+ a as INK_DEFAULT_TOOLBAR,
176
+ T as INK_DEFAULT_VARIANT,
177
+ d as INK_HEADING_OPTIONS,
178
+ s as INK_PLACEHOLDER_DEFAULT,
179
+ B as INK_QUICK_ACTIONS,
180
+ l as INK_SIMPLE_TOOLBAR,
181
+ K as INK_SLASH_COMMANDS,
182
+ O as INK_TABLE_DEFAULT_COLS,
183
+ C as INK_TABLE_DEFAULT_ROWS,
184
+ v as INK_TRANSLATE_LANGUAGES
81
185
  };
@@ -1,4 +1,5 @@
1
1
  export * from './numbers.const';
2
2
  export * from './typos.const';
3
3
  export * from './defaults.const';
4
+ export * from './aiModels.const';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +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"}
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;AACjC,cAAc,kBAAkB,CAAC"}
@@ -1 +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=_;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=150,I="#111827",L="#fef08a",T=3,N=3,A=1,E=1,O=12,M=12,K=50,S="#fde047",H=8,t=180;exports.INK_COMMENT_HIGHLIGHT_COLOR=S;exports.INK_DEFAULT_HIGHLIGHT_COLOR=L;exports.INK_DEFAULT_TABLE_COLS=N;exports.INK_DEFAULT_TABLE_ROWS=T;exports.INK_DEFAULT_TEXT_COLOR=I;exports.INK_DEMO_AI_DELAY_MS=t;exports.INK_HISTORY_MAX=K;exports.INK_MIN_HEIGHT=_;exports.INK_SLASH_MENU_MAX_ITEMS=H;exports.INK_TABLE_MAX_COLS=M;exports.INK_TABLE_MAX_ROWS=O;exports.INK_TABLE_MIN_COLS=E;exports.INK_TABLE_MIN_ROWS=A;
@@ -2,4 +2,17 @@ export declare const INK_MIN_HEIGHT = 150;
2
2
  export declare const INK_DEFAULT_TEXT_COLOR = "#111827";
3
3
  export declare const INK_DEFAULT_HIGHLIGHT_COLOR = "#fef08a";
4
4
  export declare const INK_COLOR_SWATCH_COUNT = 8;
5
+ export declare const INK_DEFAULT_TABLE_ROWS = 3;
6
+ export declare const INK_DEFAULT_TABLE_COLS = 3;
7
+ export declare const INK_TABLE_MIN_ROWS = 1;
8
+ export declare const INK_TABLE_MIN_COLS = 1;
9
+ export declare const INK_TABLE_MAX_ROWS = 12;
10
+ export declare const INK_TABLE_MAX_COLS = 12;
11
+ export declare const INK_HISTORY_MAX = 50;
12
+ export declare const INK_COMMENT_HIGHLIGHT_COLOR = "#fde047";
13
+ export declare const INK_BLOCK_HANDLE_OFFSET_PX = 28;
14
+ export declare const INK_SLASH_MENU_MAX_ITEMS = 8;
15
+ export declare const INK_AI_PANEL_WIDTH_PX = 320;
16
+ export declare const INK_COMMENTS_PANEL_WIDTH_PX = 300;
17
+ export declare const INK_DEMO_AI_DELAY_MS = 180;
5
18
  //# sourceMappingURL=numbers.const.d.ts.map
@@ -1 +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"}
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;AACxC,eAAO,MAAM,sBAAsB,IAAI,CAAC;AACxC,eAAO,MAAM,sBAAsB,IAAI,CAAC;AACxC,eAAO,MAAM,kBAAkB,IAAI,CAAC;AACpC,eAAO,MAAM,kBAAkB,IAAI,CAAC;AACpC,eAAO,MAAM,kBAAkB,KAAK,CAAC;AACrC,eAAO,MAAM,kBAAkB,KAAK,CAAC;AACrC,eAAO,MAAM,eAAe,KAAK,CAAC;AAClC,eAAO,MAAM,2BAA2B,YAAY,CAAC;AACrD,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAC7C,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAC1C,eAAO,MAAM,qBAAqB,MAAM,CAAC;AACzC,eAAO,MAAM,2BAA2B,MAAM,CAAC;AAC/C,eAAO,MAAM,oBAAoB,MAAM,CAAC"}
@@ -1,6 +1,16 @@
1
- const _ = 150, I = "#111827", T = "#fef08a";
1
+ const _ = 150, I = "#111827", L = "#fef08a", N = 3, T = 3, A = 1, E = 1, O = 12, o = 12, t = 50, c = "#fde047", n = 8, s = 180;
2
2
  export {
3
- T as INK_DEFAULT_HIGHLIGHT_COLOR,
3
+ c as INK_COMMENT_HIGHLIGHT_COLOR,
4
+ L as INK_DEFAULT_HIGHLIGHT_COLOR,
5
+ T as INK_DEFAULT_TABLE_COLS,
6
+ N as INK_DEFAULT_TABLE_ROWS,
4
7
  I as INK_DEFAULT_TEXT_COLOR,
5
- _ as INK_MIN_HEIGHT
8
+ s as INK_DEMO_AI_DELAY_MS,
9
+ t as INK_HISTORY_MAX,
10
+ _ as INK_MIN_HEIGHT,
11
+ n as INK_SLASH_MENU_MAX_ITEMS,
12
+ o as INK_TABLE_MAX_COLS,
13
+ O as INK_TABLE_MAX_ROWS,
14
+ E as INK_TABLE_MIN_COLS,
15
+ A as INK_TABLE_MIN_ROWS
6
16
  };
package/dist/index.cjs CHANGED
@@ -1 +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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./components/InkEditor/InkEditor.cjs"),A=require("./utils/cn.utils.cjs"),r=require("./utils/typo.utils.cjs"),i=require("./utils/id.utils.cjs"),n=require("./utils/table.utils.cjs"),O=require("./utils/trackChanges.utils.cjs"),N=require("./utils/comments.utils.cjs"),o=require("./utils/history.utils.cjs"),T=require("./constants/typos.const.cjs"),_=require("./constants/defaults.const.cjs"),e=require("./constants/aiModels.const.cjs"),I=require("./plugins/ai/aiPlugin.cjs");exports.InkEditor=t.InkEditor;exports.cn=A.cn;exports.applyTypoAutoFix=r.applyTypoAutoFix;exports.createInkId=i.createInkId;exports.buildTableHtml=n.buildTableHtml;exports.createTrackChange=O.createTrackChange;exports.createCommentThread=N.createCommentThread;exports.InkHistoryStack=o.InkHistoryStack;exports.TYPO_DICTIONARY=T.TYPO_DICTIONARY;exports.INK_COLLAB_TOOLBAR=_.INK_COLLAB_TOOLBAR;exports.INK_DEFAULT_FEATURES=_.INK_DEFAULT_FEATURES;exports.INK_DEFAULT_TOOLBAR=_.INK_DEFAULT_TOOLBAR;exports.INK_HEADING_OPTIONS=_.INK_HEADING_OPTIONS;exports.INK_QUICK_ACTIONS=_.INK_QUICK_ACTIONS;exports.INK_SIMPLE_TOOLBAR=_.INK_SIMPLE_TOOLBAR;exports.INK_SLASH_COMMANDS=_.INK_SLASH_COMMANDS;exports.INK_TRANSLATE_LANGUAGES=_.INK_TRANSLATE_LANGUAGES;exports.INK_AI_DEMO_MODEL_ID=e.INK_AI_DEMO_MODEL_ID;exports.INK_AI_DEMO_PROVIDER_ID=e.INK_AI_DEMO_PROVIDER_ID;exports.INK_AI_MODEL_CATALOG=e.INK_AI_MODEL_CATALOG;exports.createInkAiPlugin=I.createInkAiPlugin;exports.inkAi=I.inkAi;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { InkEditor } from './components';
2
- export { applyTypoAutoFix, cn } from './utils';
2
+ export { applyTypoAutoFix, cn, buildTableHtml, createInkId, createCommentThread, createTrackChange, InkHistoryStack, } from './utils';
3
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';
4
+ export { INK_DEFAULT_TOOLBAR, INK_SIMPLE_TOOLBAR, INK_COLLAB_TOOLBAR, INK_HEADING_OPTIONS, INK_SLASH_COMMANDS, INK_AI_MODEL_CATALOG, INK_AI_DEMO_PROVIDER_ID, INK_AI_DEMO_MODEL_ID, INK_TRANSLATE_LANGUAGES, INK_QUICK_ACTIONS, INK_DEFAULT_FEATURES, TYPO_DICTIONARY, } from './constants';
5
+ export type { InkEditorProps, ToolbarOption, TypoFixResult, SlashCommandItem, InkAiCapability, InkAiRequest, InkAiResponse, InkAiAgent, InkAiPlugin, InkAiChatTurn, InkAiDiffSuggestion, InkAiReviewSuggestion, InkAiContextFile, InkAiDocumentSnapshot, InkAiModelCatalogEntry, InkAiProvider, InkAiConfig, InkAiUiTheme, InkCommentReply, InkCommentThread, InkTrackChange, InkTrackChangeType, InkFeaturesConfig, InkFeatureName, InkEditorVariant, InkAiPlacement, } from './types';
6
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EACL,gBAAgB,EAChB,EAAE,EACF,cAAc,EACd,WAAW,EACX,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,GAChB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,oBAAoB,EACpB,uBAAuB,EACvB,iBAAiB,EACjB,oBAAoB,EACpB,eAAe,GAChB,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,cAAc,EACd,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,aAAa,EACb,UAAU,EACV,WAAW,EACX,aAAa,EACb,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,sBAAsB,EACtB,aAAa,EACb,WAAW,EACX,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,cAAc,GACf,MAAM,SAAS,CAAC"}
package/dist/index.js CHANGED
@@ -1,17 +1,36 @@
1
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";
2
+ import { cn as e } from "./utils/cn.utils.js";
3
+ import { applyTypoAutoFix as t } from "./utils/typo.utils.js";
4
+ import { createInkId as N } from "./utils/id.utils.js";
5
+ import { buildTableHtml as m } from "./utils/table.utils.js";
6
+ import { createTrackChange as E } from "./utils/trackChanges.utils.js";
7
+ import { createCommentThread as x } from "./utils/comments.utils.js";
8
+ import { InkHistoryStack as D } from "./utils/history.utils.js";
9
+ import { TYPO_DICTIONARY as a } from "./constants/typos.const.js";
10
+ import { INK_COLLAB_TOOLBAR as n, INK_DEFAULT_FEATURES as i, INK_DEFAULT_TOOLBAR as C, INK_HEADING_OPTIONS as R, INK_QUICK_ACTIONS as c, INK_SIMPLE_TOOLBAR as k, INK_SLASH_COMMANDS as M, INK_TRANSLATE_LANGUAGES as l } from "./constants/defaults.const.js";
11
+ import { INK_AI_DEMO_MODEL_ID as U, INK_AI_DEMO_PROVIDER_ID as d, INK_AI_MODEL_CATALOG as B } from "./constants/aiModels.const.js";
12
+ import { createInkAiPlugin as G, inkAi as H } from "./plugins/ai/aiPlugin.js";
7
13
  export {
8
- m as INK_DEFAULT_TOOLBAR,
9
- N as INK_HEADING_OPTIONS,
10
- n as INK_SIMPLE_TOOLBAR,
14
+ U as INK_AI_DEMO_MODEL_ID,
15
+ d as INK_AI_DEMO_PROVIDER_ID,
16
+ B as INK_AI_MODEL_CATALOG,
17
+ n as INK_COLLAB_TOOLBAR,
18
+ i as INK_DEFAULT_FEATURES,
19
+ C as INK_DEFAULT_TOOLBAR,
20
+ R as INK_HEADING_OPTIONS,
21
+ c as INK_QUICK_ACTIONS,
22
+ k as INK_SIMPLE_TOOLBAR,
23
+ M as INK_SLASH_COMMANDS,
24
+ l as INK_TRANSLATE_LANGUAGES,
11
25
  I as InkEditor,
12
- f as TYPO_DICTIONARY,
13
- A as applyTypoAutoFix,
14
- t as cn,
15
- x as createInkAiPlugin,
16
- T as inkAi
26
+ D as InkHistoryStack,
27
+ a as TYPO_DICTIONARY,
28
+ t as applyTypoAutoFix,
29
+ m as buildTableHtml,
30
+ e as cn,
31
+ x as createCommentThread,
32
+ G as createInkAiPlugin,
33
+ N as createInkId,
34
+ E as createTrackChange,
35
+ H as inkAi
17
36
  };
@@ -1 +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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./demoProvider.cjs"),n=new Map,e=new Map,o=()=>{if(!e.has("demo")){const r=u.createDemoAiProvider();e.set(r.id,r)}},s=()=>(o(),{register:r=>{n.set(r.id,r)},unregister:r=>{n.delete(r)},getAgent:r=>n.get(r),listAgents:()=>Array.from(n.values()),run:async(r,i)=>{const t=n.get(r);if(!t)throw new Error(`Ink AI agent "${r}" is not registered.`);if(!t.capabilities.includes(i.capability))throw new Error(`Ink AI agent "${r}" does not support "${i.capability}".`);return t.run(i)},registerProvider:r=>{e.set(r.id,r)},unregisterProvider:r=>{r!=="demo"&&e.delete(r)},getProvider:r=>(o(),e.get(r)),listProviders:()=>(o(),Array.from(e.values())),runProvider:async(r,i)=>{o();const t=e.get(r);if(!t)throw new Error(`Ink AI provider "${r}" is not registered. Bring your own LLM via inkAi.registerProvider.`);return t.run(i)},exportHistory:r=>JSON.stringify(r,null,2)}),a=s();exports.createInkAiPlugin=s;exports.inkAi=a;
@@ -1 +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"}
1
+ {"version":3,"file":"aiPlugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/ai/aiPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA6B,WAAW,EAA8C,MAAM,aAAa,CAAC;AAatH,eAAO,MAAM,iBAAiB,QAAO,WA+CpC,CAAC;AAEF,eAAO,MAAM,KAAK,aAAsB,CAAC"}
@@ -1,22 +1,44 @@
1
- const e = /* @__PURE__ */ new Map(), r = () => ({
2
- register: (t) => {
3
- e.set(t.id, t);
1
+ import { createDemoAiProvider as s } from "./demoProvider.js";
2
+ const n = /* @__PURE__ */ new Map(), e = /* @__PURE__ */ new Map(), o = () => {
3
+ if (!e.has("demo")) {
4
+ const r = s();
5
+ e.set(r.id, r);
6
+ }
7
+ }, a = () => (o(), {
8
+ register: (r) => {
9
+ n.set(r.id, r);
4
10
  },
5
- unregister: (t) => {
6
- e.delete(t);
11
+ unregister: (r) => {
12
+ n.delete(r);
7
13
  },
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();
14
+ getAgent: (r) => n.get(r),
15
+ listAgents: () => Array.from(n.values()),
16
+ run: async (r, i) => {
17
+ const t = n.get(r);
18
+ if (!t)
19
+ throw new Error(`Ink AI agent "${r}" is not registered.`);
20
+ if (!t.capabilities.includes(i.capability))
21
+ throw new Error(`Ink AI agent "${r}" does not support "${i.capability}".`);
22
+ return t.run(i);
23
+ },
24
+ registerProvider: (r) => {
25
+ e.set(r.id, r);
26
+ },
27
+ unregisterProvider: (r) => {
28
+ r !== "demo" && e.delete(r);
29
+ },
30
+ getProvider: (r) => (o(), e.get(r)),
31
+ listProviders: () => (o(), Array.from(e.values())),
32
+ runProvider: async (r, i) => {
33
+ o();
34
+ const t = e.get(r);
35
+ if (!t)
36
+ throw new Error(`Ink AI provider "${r}" is not registered. Bring your own LLM via inkAi.registerProvider.`);
37
+ return t.run(i);
38
+ },
39
+ exportHistory: (r) => JSON.stringify(r, null, 2)
40
+ }), u = a();
19
41
  export {
20
- r as createInkAiPlugin,
21
- s as inkAi
42
+ a as createInkAiPlugin,
43
+ u as inkAi
22
44
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../../constants/numbers.const.cjs"),i=require("../../constants/aiModels.const.cjs"),r=require("../../utils/id.utils.cjs"),g=t=>new Promise(n=>{window.setTimeout(n,t)}),c=t=>t.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim(),o=t=>`<p>${t}</p>`,p=async t=>{var d,l;await g(u.INK_DEMO_AI_DELAY_MS);const n=t.selectionHtml||t.html||"",s=c(n)||"your content",m=((d=t.prompt)==null?void 0:d.trim())||"";switch(t.capability){case"chat":{const e=m?`Demo assistant: regarding “${m.slice(0,120)}”, here’s a concise take based on the current document (${s.slice(0,80)}…). Connect your own LLM provider for production answers.`:`Demo assistant ready. Ask a question about: ${s.slice(0,100)}…`;return{text:e,turns:[{id:r.createInkId("turn"),role:"assistant",content:e,timestamp:Date.now(),capability:"chat"}],meta:{provider:i.INK_AI_DEMO_PROVIDER_ID,model:i.INK_AI_DEMO_MODEL_ID}}}case"summarize":{const e=o(`Summary (demo): ${s.slice(0,160)}${s.length>160?"…":""}`);return{html:e,text:c(e),diff:{id:r.createInkId("diff"),originalHtml:n,suggestedHtml:e,summary:"Demo summary of the selection"}}}case"expand":{const e=o(`${s} Additionally, this demo expansion adds clarifying context, examples, and a short closing sentence so you can preview apply/reject flows.`);return{html:e,diff:{id:r.createInkId("diff"),originalHtml:n,suggestedHtml:e,summary:"Demo expansion"}}}case"tone":{const e=o(`In a clearer, more professional tone: ${s}`);return{html:e,diff:{id:r.createInkId("diff"),originalHtml:n,suggestedHtml:e,summary:"Demo tone adjustment"}}}case"translate":{const e=((l=t.options)==null?void 0:l.language)||"Spanish",a=o(`[${e} demo] ${s}`);return{html:a,text:c(a),diff:{id:r.createInkId("diff"),originalHtml:n,suggestedHtml:a,summary:`Demo translation to ${e}`}}}case"review":return{text:"Demo review complete",reviewSuggestions:[{id:r.createInkId("rev"),message:"Consider shortening long sentences for clarity.",severity:"info",originalText:s.slice(0,40),suggestedText:s.slice(0,40)},{id:r.createInkId("rev"),message:"Possible passive voice — prefer active constructions.",severity:"warning",originalText:"was processed",suggestedText:"the team processed"}]};case"suggestDiff":case"quickAction":case"rewrite":default:{const e=o(`Rewritten (demo): ${s}`);return{html:e,diff:{id:r.createInkId("diff"),originalHtml:n,suggestedHtml:e,summary:"Demo rewrite suggestion"}}}}},I=()=>({id:i.INK_AI_DEMO_PROVIDER_ID,name:"Ink Demo Provider",models:[{id:i.INK_AI_DEMO_MODEL_ID,provider:"demo",label:"Ink Demo (local)",family:"Demo"}],run:p});exports.createDemoAiProvider=I;
@@ -0,0 +1,3 @@
1
+ import { InkAiProvider } from '../../types';
2
+ export declare const createDemoAiProvider: () => InkAiProvider;
3
+ //# sourceMappingURL=demoProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"demoProvider.d.ts","sourceRoot":"","sources":["../../../src/plugins/ai/demoProvider.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAA+B,MAAM,aAAa,CAAC;AAiI9E,eAAO,MAAM,oBAAoB,QAAO,aAYtC,CAAC"}
@@ -0,0 +1,130 @@
1
+ import { INK_DEMO_AI_DELAY_MS as u } from "../../constants/numbers.const.js";
2
+ import { INK_AI_DEMO_MODEL_ID as d, INK_AI_DEMO_PROVIDER_ID as g } from "../../constants/aiModels.const.js";
3
+ import { createInkId as i } from "../../utils/id.utils.js";
4
+ const p = (t) => new Promise((o) => {
5
+ window.setTimeout(o, t);
6
+ }), a = (t) => t.replace(/<[^>]+>/g, " ").replace(/\s+/g, " ").trim(), n = (t) => `<p>${t}</p>`, f = async (t) => {
7
+ var c, l;
8
+ await p(u);
9
+ const o = t.selectionHtml || t.html || "", s = a(o) || "your content", m = ((c = t.prompt) == null ? void 0 : c.trim()) || "";
10
+ switch (t.capability) {
11
+ case "chat": {
12
+ const e = m ? `Demo assistant: regarding “${m.slice(0, 120)}”, here’s a concise take based on the current document (${s.slice(0, 80)}…). Connect your own LLM provider for production answers.` : `Demo assistant ready. Ask a question about: ${s.slice(0, 100)}…`;
13
+ return {
14
+ text: e,
15
+ turns: [
16
+ {
17
+ id: i("turn"),
18
+ role: "assistant",
19
+ content: e,
20
+ timestamp: Date.now(),
21
+ capability: "chat"
22
+ }
23
+ ],
24
+ meta: { provider: g, model: d }
25
+ };
26
+ }
27
+ case "summarize": {
28
+ const e = n(`Summary (demo): ${s.slice(0, 160)}${s.length > 160 ? "…" : ""}`);
29
+ return {
30
+ html: e,
31
+ text: a(e),
32
+ diff: {
33
+ id: i("diff"),
34
+ originalHtml: o,
35
+ suggestedHtml: e,
36
+ summary: "Demo summary of the selection"
37
+ }
38
+ };
39
+ }
40
+ case "expand": {
41
+ const e = n(
42
+ `${s} Additionally, this demo expansion adds clarifying context, examples, and a short closing sentence so you can preview apply/reject flows.`
43
+ );
44
+ return {
45
+ html: e,
46
+ diff: {
47
+ id: i("diff"),
48
+ originalHtml: o,
49
+ suggestedHtml: e,
50
+ summary: "Demo expansion"
51
+ }
52
+ };
53
+ }
54
+ case "tone": {
55
+ const e = n(`In a clearer, more professional tone: ${s}`);
56
+ return {
57
+ html: e,
58
+ diff: {
59
+ id: i("diff"),
60
+ originalHtml: o,
61
+ suggestedHtml: e,
62
+ summary: "Demo tone adjustment"
63
+ }
64
+ };
65
+ }
66
+ case "translate": {
67
+ const e = ((l = t.options) == null ? void 0 : l.language) || "Spanish", r = n(`[${e} demo] ${s}`);
68
+ return {
69
+ html: r,
70
+ text: a(r),
71
+ diff: {
72
+ id: i("diff"),
73
+ originalHtml: o,
74
+ suggestedHtml: r,
75
+ summary: `Demo translation to ${e}`
76
+ }
77
+ };
78
+ }
79
+ case "review":
80
+ return {
81
+ text: "Demo review complete",
82
+ reviewSuggestions: [
83
+ {
84
+ id: i("rev"),
85
+ message: "Consider shortening long sentences for clarity.",
86
+ severity: "info",
87
+ originalText: s.slice(0, 40),
88
+ suggestedText: s.slice(0, 40)
89
+ },
90
+ {
91
+ id: i("rev"),
92
+ message: "Possible passive voice — prefer active constructions.",
93
+ severity: "warning",
94
+ originalText: "was processed",
95
+ suggestedText: "the team processed"
96
+ }
97
+ ]
98
+ };
99
+ case "suggestDiff":
100
+ case "quickAction":
101
+ case "rewrite":
102
+ default: {
103
+ const e = n(`Rewritten (demo): ${s}`);
104
+ return {
105
+ html: e,
106
+ diff: {
107
+ id: i("diff"),
108
+ originalHtml: o,
109
+ suggestedHtml: e,
110
+ summary: "Demo rewrite suggestion"
111
+ }
112
+ };
113
+ }
114
+ }
115
+ }, h = () => ({
116
+ id: g,
117
+ name: "Ink Demo Provider",
118
+ models: [
119
+ {
120
+ id: d,
121
+ provider: "demo",
122
+ label: "Ink Demo (local)",
123
+ family: "Demo"
124
+ }
125
+ ],
126
+ run: f
127
+ });
128
+ export {
129
+ h as createDemoAiProvider
130
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./aiPlugin.cjs");exports.createInkAiPlugin=i.createInkAiPlugin;exports.inkAi=i.inkAi;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./aiPlugin.cjs"),t=require("./demoProvider.cjs"),e=require("./stubs.cjs"),o=require("../../constants/aiModels.const.cjs");exports.createInkAiPlugin=r.createInkAiPlugin;exports.inkAi=r.inkAi;exports.createDemoAiProvider=t.createDemoAiProvider;exports.createNoopCostControl=e.createNoopCostControl;exports.createNoopExternalKnowledge=e.createNoopExternalKnowledge;exports.createNoopModeration=e.createNoopModeration;exports.createNoopQualityEval=e.createNoopQualityEval;exports.createOpenPermissions=e.createOpenPermissions;exports.INK_AI_DEMO_MODEL_ID=o.INK_AI_DEMO_MODEL_ID;exports.INK_AI_DEMO_PROVIDER_ID=o.INK_AI_DEMO_PROVIDER_ID;exports.INK_AI_MODEL_CATALOG=o.INK_AI_MODEL_CATALOG;
@@ -1,3 +1,6 @@
1
1
  export { createInkAiPlugin, inkAi } from './aiPlugin';
2
- export type { InkAiCapability, InkAiRequest, InkAiResponse, InkAiAgent, InkAiPlugin, } from '../../types';
2
+ export { createDemoAiProvider } from './demoProvider';
3
+ export { createNoopCostControl, createNoopModeration, createOpenPermissions, createNoopExternalKnowledge, createNoopQualityEval, } from './stubs';
4
+ export { INK_AI_MODEL_CATALOG, INK_AI_DEMO_PROVIDER_ID, INK_AI_DEMO_MODEL_ID } from '../../constants';
5
+ export type { InkAiCapability, InkAiRequest, InkAiResponse, InkAiAgent, InkAiPlugin, InkAiChatTurn, InkAiDiffSuggestion, InkAiReviewSuggestion, InkAiContextFile, InkAiDocumentSnapshot, InkAiModelCatalogEntry, InkAiProvider, InkAiCostControlHooks, InkAiModerationHook, InkAiPermissionsHook, InkAiExternalKnowledgeHook, InkAiQualityEvalHook, InkAiFallbackChain, InkAiUiTheme, InkAiConfig, } from '../../types';
3
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +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"}
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,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,2BAA2B,EAC3B,qBAAqB,GACtB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACtG,YAAY,EACV,eAAe,EACf,YAAY,EACZ,aAAa,EACb,UAAU,EACV,WAAW,EACX,aAAa,EACb,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,sBAAsB,EACtB,aAAa,EACb,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,0BAA0B,EAC1B,oBAAoB,EACpB,kBAAkB,EAClB,YAAY,EACZ,WAAW,GACZ,MAAM,aAAa,CAAC"}
@@ -1,5 +1,17 @@
1
- import { createInkAiPlugin as n, inkAi as r } from "./aiPlugin.js";
1
+ import { createInkAiPlugin as r, inkAi as t } from "./aiPlugin.js";
2
+ import { createDemoAiProvider as _ } from "./demoProvider.js";
3
+ import { createNoopCostControl as I, createNoopExternalKnowledge as n, createNoopModeration as p, createNoopQualityEval as A, createOpenPermissions as D } from "./stubs.js";
4
+ import { INK_AI_DEMO_MODEL_ID as E, INK_AI_DEMO_PROVIDER_ID as N, INK_AI_MODEL_CATALOG as O } from "../../constants/aiModels.const.js";
2
5
  export {
3
- n as createInkAiPlugin,
4
- r as inkAi
6
+ E as INK_AI_DEMO_MODEL_ID,
7
+ N as INK_AI_DEMO_PROVIDER_ID,
8
+ O as INK_AI_MODEL_CATALOG,
9
+ _ as createDemoAiProvider,
10
+ r as createInkAiPlugin,
11
+ I as createNoopCostControl,
12
+ n as createNoopExternalKnowledge,
13
+ p as createNoopModeration,
14
+ A as createNoopQualityEval,
15
+ D as createOpenPermissions,
16
+ t as inkAi
5
17
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=()=>({cacheGet:async()=>{},cacheSet:async()=>{},rateLimitCheck:async()=>!0,preferCheaperModel:(n,e)=>e}),t=()=>({screen:async()=>({allowed:!0})}),a=()=>({canUse:()=>!0}),r=()=>({retrieve:async()=>[]}),c=()=>({evaluate:async()=>({score:1,notes:"MVP stub — no remote eval suite"})});exports.createNoopCostControl=o;exports.createNoopExternalKnowledge=r;exports.createNoopModeration=t;exports.createNoopQualityEval=c;exports.createOpenPermissions=a;
@@ -0,0 +1,7 @@
1
+ import { InkAiCostControlHooks, InkAiExternalKnowledgeHook, InkAiModerationHook, InkAiPermissionsHook, InkAiQualityEvalHook } from '../../types';
2
+ export declare const createNoopCostControl: () => InkAiCostControlHooks;
3
+ export declare const createNoopModeration: () => InkAiModerationHook;
4
+ export declare const createOpenPermissions: () => InkAiPermissionsHook;
5
+ export declare const createNoopExternalKnowledge: () => InkAiExternalKnowledgeHook;
6
+ export declare const createNoopQualityEval: () => InkAiQualityEvalHook;
7
+ //# sourceMappingURL=stubs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stubs.d.ts","sourceRoot":"","sources":["../../../src/plugins/ai/stubs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,0BAA0B,EAC1B,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,aAAa,CAAC;AAErB,eAAO,MAAM,qBAAqB,QAAO,qBAKvC,CAAC;AAEH,eAAO,MAAM,oBAAoB,QAAO,mBAEtC,CAAC;AAEH,eAAO,MAAM,qBAAqB,QAAO,oBAEvC,CAAC;AAEH,eAAO,MAAM,2BAA2B,QAAO,0BAE7C,CAAC;AAEH,eAAO,MAAM,qBAAqB,QAAO,oBAEvC,CAAC"}
@@ -0,0 +1,23 @@
1
+ const o = () => ({
2
+ cacheGet: async () => {
3
+ },
4
+ cacheSet: async () => {
5
+ },
6
+ rateLimitCheck: async () => !0,
7
+ preferCheaperModel: (t, e) => e
8
+ }), a = () => ({
9
+ screen: async () => ({ allowed: !0 })
10
+ }), c = () => ({
11
+ canUse: () => !0
12
+ }), r = () => ({
13
+ retrieve: async () => []
14
+ }), n = () => ({
15
+ evaluate: async () => ({ score: 1, notes: "MVP stub — no remote eval suite" })
16
+ });
17
+ export {
18
+ o as createNoopCostControl,
19
+ r as createNoopExternalKnowledge,
20
+ a as createNoopModeration,
21
+ n as createNoopQualityEval,
22
+ c as createOpenPermissions
23
+ };