@forgedevstack/ink 1.1.7 → 1.1.8

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 (213) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +9 -1
  3. package/bin/ink.const.mjs +26 -0
  4. package/bin/ink.mjs +58 -0
  5. package/dist/components/InkEditor/InkEditor.cjs +1 -1
  6. package/dist/components/InkEditor/InkEditor.d.ts.map +1 -1
  7. package/dist/components/InkEditor/InkEditor.js +1178 -834
  8. package/dist/components/InkEditor/components/AiPanel/AiPanel.cjs +1 -1
  9. package/dist/components/InkEditor/components/AiPanel/AiPanel.d.ts.map +1 -1
  10. package/dist/components/InkEditor/components/AiPanel/AiPanel.js +58 -52
  11. package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.cjs +1 -0
  12. package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.d.ts +4 -0
  13. package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.d.ts.map +1 -0
  14. package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.js +209 -0
  15. package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.types.d.ts +10 -0
  16. package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.types.d.ts.map +1 -0
  17. package/dist/components/InkEditor/components/ExcelSheetPanel/index.d.ts +3 -0
  18. package/dist/components/InkEditor/components/ExcelSheetPanel/index.d.ts.map +1 -0
  19. package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.cjs +1 -0
  20. package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.d.ts +4 -0
  21. package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.d.ts.map +1 -0
  22. package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.js +91 -0
  23. package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.types.d.ts +11 -0
  24. package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.types.d.ts.map +1 -0
  25. package/dist/components/InkEditor/components/GraphEditModal/index.d.ts +3 -0
  26. package/dist/components/InkEditor/components/GraphEditModal/index.d.ts.map +1 -0
  27. package/dist/components/InkEditor/components/GraphPicker/GraphPicker.cjs +1 -0
  28. package/dist/components/InkEditor/components/GraphPicker/GraphPicker.d.ts +4 -0
  29. package/dist/components/InkEditor/components/GraphPicker/GraphPicker.d.ts.map +1 -0
  30. package/dist/components/InkEditor/components/GraphPicker/GraphPicker.js +98 -0
  31. package/dist/components/InkEditor/components/GraphPicker/GraphPicker.types.d.ts +10 -0
  32. package/dist/components/InkEditor/components/GraphPicker/GraphPicker.types.d.ts.map +1 -0
  33. package/dist/components/InkEditor/components/GraphPicker/index.d.ts +3 -0
  34. package/dist/components/InkEditor/components/GraphPicker/index.d.ts.map +1 -0
  35. package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.cjs +1 -0
  36. package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.d.ts +4 -0
  37. package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.d.ts.map +1 -0
  38. package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.js +27 -0
  39. package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.types.d.ts +7 -0
  40. package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.types.d.ts.map +1 -0
  41. package/dist/components/InkEditor/components/HtmlSourcePanel/index.d.ts +3 -0
  42. package/dist/components/InkEditor/components/HtmlSourcePanel/index.d.ts.map +1 -0
  43. package/dist/components/InkEditor/components/OutlineRail/OutlineRail.cjs +1 -1
  44. package/dist/components/InkEditor/components/OutlineRail/OutlineRail.d.ts.map +1 -1
  45. package/dist/components/InkEditor/components/OutlineRail/OutlineRail.js +17 -12
  46. package/dist/components/InkEditor/components/OutlineRail/OutlineRail.types.d.ts +1 -0
  47. package/dist/components/InkEditor/components/OutlineRail/OutlineRail.types.d.ts.map +1 -1
  48. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.cjs +1 -0
  49. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.const.cjs +1 -0
  50. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.const.d.ts +10 -0
  51. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.const.d.ts.map +1 -0
  52. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.const.js +18 -0
  53. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.d.ts +4 -0
  54. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.d.ts.map +1 -0
  55. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.js +95 -0
  56. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.types.d.ts +11 -0
  57. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.types.d.ts.map +1 -0
  58. package/dist/components/InkEditor/components/TableSizePicker/index.d.ts +3 -0
  59. package/dist/components/InkEditor/components/TableSizePicker/index.d.ts.map +1 -0
  60. package/dist/components/InkEditor/components/ThemePicker/ThemePicker.cjs +1 -0
  61. package/dist/components/InkEditor/components/ThemePicker/ThemePicker.d.ts +4 -0
  62. package/dist/components/InkEditor/components/ThemePicker/ThemePicker.d.ts.map +1 -0
  63. package/dist/components/InkEditor/components/ThemePicker/ThemePicker.js +81 -0
  64. package/dist/components/InkEditor/components/ThemePicker/ThemePicker.types.d.ts +12 -0
  65. package/dist/components/InkEditor/components/ThemePicker/ThemePicker.types.d.ts.map +1 -0
  66. package/dist/components/InkEditor/components/ThemePicker/index.d.ts +3 -0
  67. package/dist/components/InkEditor/components/ThemePicker/index.d.ts.map +1 -0
  68. package/dist/components/InkEditor/components/TitleGallery/TitleGallery.cjs +1 -0
  69. package/dist/components/InkEditor/components/TitleGallery/TitleGallery.d.ts +4 -0
  70. package/dist/components/InkEditor/components/TitleGallery/TitleGallery.d.ts.map +1 -0
  71. package/dist/components/InkEditor/components/TitleGallery/TitleGallery.js +79 -0
  72. package/dist/components/InkEditor/components/TitleGallery/TitleGallery.types.d.ts +10 -0
  73. package/dist/components/InkEditor/components/TitleGallery/TitleGallery.types.d.ts.map +1 -0
  74. package/dist/components/InkEditor/components/TitleGallery/index.d.ts +3 -0
  75. package/dist/components/InkEditor/components/TitleGallery/index.d.ts.map +1 -0
  76. package/dist/components/InkEditor/components/ToolbarButton/ToolbarButton.cjs +1 -1
  77. package/dist/components/InkEditor/components/ToolbarButton/ToolbarButton.d.ts.map +1 -1
  78. package/dist/components/InkEditor/components/ToolbarButton/ToolbarButton.js +41 -18
  79. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.cjs +1 -1
  80. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.d.ts.map +1 -1
  81. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.js +25 -23
  82. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.cjs +1 -1
  83. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.d.ts +1 -1
  84. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.d.ts.map +1 -1
  85. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.js +7 -7
  86. package/dist/components/InkEditor/components/index.d.ts +14 -0
  87. package/dist/components/InkEditor/components/index.d.ts.map +1 -1
  88. package/dist/components/InkEditor/helpers/format.utils.cjs +2 -2
  89. package/dist/components/InkEditor/helpers/format.utils.d.ts +1 -1
  90. package/dist/components/InkEditor/helpers/format.utils.d.ts.map +1 -1
  91. package/dist/components/InkEditor/helpers/format.utils.js +72 -72
  92. package/dist/constants/colorMode.const.cjs +1 -1
  93. package/dist/constants/colorMode.const.d.ts +1 -1
  94. package/dist/constants/colorMode.const.d.ts.map +1 -1
  95. package/dist/constants/colorMode.const.js +4 -4
  96. package/dist/constants/contextMenu.const.cjs +1 -1
  97. package/dist/constants/contextMenu.const.d.ts +2 -0
  98. package/dist/constants/contextMenu.const.d.ts.map +1 -1
  99. package/dist/constants/contextMenu.const.js +17 -15
  100. package/dist/constants/defaultIcons.cjs +1 -1
  101. package/dist/constants/defaultIcons.d.ts.map +1 -1
  102. package/dist/constants/defaultIcons.js +20 -13
  103. package/dist/constants/defaults.const.cjs +1 -1
  104. package/dist/constants/defaults.const.d.ts +48 -0
  105. package/dist/constants/defaults.const.d.ts.map +1 -1
  106. package/dist/constants/defaults.const.js +201 -102
  107. package/dist/constants/generals.const.cjs +1 -1
  108. package/dist/constants/generals.const.d.ts +48 -0
  109. package/dist/constants/generals.const.d.ts.map +1 -1
  110. package/dist/constants/generals.const.js +71 -28
  111. package/dist/constants/index.d.ts +1 -0
  112. package/dist/constants/index.d.ts.map +1 -1
  113. package/dist/constants/numbers.cjs +1 -1
  114. package/dist/constants/numbers.d.ts +14 -0
  115. package/dist/constants/numbers.d.ts.map +1 -1
  116. package/dist/constants/numbers.js +44 -30
  117. package/dist/constants/plugins.const.cjs +1 -0
  118. package/dist/constants/plugins.const.d.ts +13 -0
  119. package/dist/constants/plugins.const.d.ts.map +1 -0
  120. package/dist/constants/plugins.const.js +45 -0
  121. package/dist/constants/table.const.cjs +1 -1
  122. package/dist/constants/table.const.d.ts +4 -0
  123. package/dist/constants/table.const.d.ts.map +1 -1
  124. package/dist/constants/table.const.js +10 -6
  125. package/dist/constants/toolbar.const.cjs +1 -1
  126. package/dist/constants/toolbar.const.d.ts +7 -0
  127. package/dist/constants/toolbar.const.d.ts.map +1 -1
  128. package/dist/constants/toolbar.const.js +16 -9
  129. package/dist/constants/toolbarMenu.const.cjs +1 -1
  130. package/dist/constants/toolbarMenu.const.d.ts +2 -0
  131. package/dist/constants/toolbarMenu.const.d.ts.map +1 -1
  132. package/dist/constants/toolbarMenu.const.js +80 -19
  133. package/dist/hooks/index.d.ts +2 -0
  134. package/dist/hooks/index.d.ts.map +1 -0
  135. package/dist/hooks/useToolbarOverflow.cjs +1 -0
  136. package/dist/hooks/useToolbarOverflow.d.ts +8 -0
  137. package/dist/hooks/useToolbarOverflow.d.ts.map +1 -0
  138. package/dist/hooks/useToolbarOverflow.js +29 -0
  139. package/dist/index.cjs +1 -1
  140. package/dist/index.d.ts +5 -2
  141. package/dist/index.d.ts.map +1 -1
  142. package/dist/index.js +117 -86
  143. package/dist/plugins/excel/excel.utils.cjs +1 -0
  144. package/dist/plugins/excel/excel.utils.d.ts +13 -0
  145. package/dist/plugins/excel/excel.utils.d.ts.map +1 -0
  146. package/dist/plugins/excel/excel.utils.js +40 -0
  147. package/dist/plugins/excel/index.d.ts +3 -0
  148. package/dist/plugins/excel/index.d.ts.map +1 -0
  149. package/dist/plugins/graph/graph.const.cjs +1 -0
  150. package/dist/plugins/graph/graph.const.d.ts +14 -0
  151. package/dist/plugins/graph/graph.const.d.ts.map +1 -0
  152. package/dist/plugins/graph/graph.const.js +24 -0
  153. package/dist/plugins/graph/graph.types.d.ts +7 -0
  154. package/dist/plugins/graph/graph.types.d.ts.map +1 -0
  155. package/dist/plugins/graph/graph.utils.cjs +1 -0
  156. package/dist/plugins/graph/graph.utils.d.ts +11 -0
  157. package/dist/plugins/graph/graph.utils.d.ts.map +1 -0
  158. package/dist/plugins/graph/graph.utils.js +76 -0
  159. package/dist/plugins/graph/index.d.ts +4 -0
  160. package/dist/plugins/graph/index.d.ts.map +1 -0
  161. package/dist/plugins/host/index.d.ts +2 -0
  162. package/dist/plugins/host/index.d.ts.map +1 -0
  163. package/dist/plugins/host/inkPlugins.cjs +1 -0
  164. package/dist/plugins/host/inkPlugins.d.ts +16 -0
  165. package/dist/plugins/host/inkPlugins.d.ts.map +1 -0
  166. package/dist/plugins/host/inkPlugins.js +20 -0
  167. package/dist/plugins/index.d.ts +5 -0
  168. package/dist/plugins/index.d.ts.map +1 -0
  169. package/dist/plugins/theme/index.d.ts +4 -0
  170. package/dist/plugins/theme/index.d.ts.map +1 -0
  171. package/dist/plugins/theme/inkTheme.cjs +1 -0
  172. package/dist/plugins/theme/inkTheme.d.ts +5 -0
  173. package/dist/plugins/theme/inkTheme.d.ts.map +1 -0
  174. package/dist/plugins/theme/inkTheme.js +30 -0
  175. package/dist/plugins/theme/theme.const.cjs +1 -0
  176. package/dist/plugins/theme/theme.const.d.ts +9 -0
  177. package/dist/plugins/theme/theme.const.d.ts.map +1 -0
  178. package/dist/plugins/theme/theme.const.js +15 -0
  179. package/dist/plugins/theme/theme.types.d.ts +12 -0
  180. package/dist/plugins/theme/theme.types.d.ts.map +1 -0
  181. package/dist/plugins/titles/index.d.ts +4 -0
  182. package/dist/plugins/titles/index.d.ts.map +1 -0
  183. package/dist/plugins/titles/titles.const.cjs +1 -0
  184. package/dist/plugins/titles/titles.const.d.ts +4 -0
  185. package/dist/plugins/titles/titles.const.d.ts.map +1 -0
  186. package/dist/plugins/titles/titles.const.js +15 -0
  187. package/dist/plugins/titles/titles.types.d.ts +2 -0
  188. package/dist/plugins/titles/titles.types.d.ts.map +1 -0
  189. package/dist/plugins/titles/titles.utils.cjs +1 -0
  190. package/dist/plugins/titles/titles.utils.d.ts +3 -0
  191. package/dist/plugins/titles/titles.utils.d.ts.map +1 -0
  192. package/dist/plugins/titles/titles.utils.js +14 -0
  193. package/dist/styles.css +1 -1
  194. package/dist/types/features.types.d.ts +1 -1
  195. package/dist/types/features.types.d.ts.map +1 -1
  196. package/dist/types/index.d.ts +1 -0
  197. package/dist/types/index.d.ts.map +1 -1
  198. package/dist/types/ink.types.d.ts +6 -2
  199. package/dist/types/ink.types.d.ts.map +1 -1
  200. package/dist/types/plugin.types.d.ts +8 -0
  201. package/dist/types/plugin.types.d.ts.map +1 -0
  202. package/dist/types/premium.types.d.ts +1 -1
  203. package/dist/types/premium.types.d.ts.map +1 -1
  204. package/dist/utils/index.d.ts +1 -1
  205. package/dist/utils/index.d.ts.map +1 -1
  206. package/dist/utils/outline.utils.cjs +1 -1
  207. package/dist/utils/outline.utils.d.ts.map +1 -1
  208. package/dist/utils/outline.utils.js +32 -32
  209. package/dist/utils/table.utils.cjs +1 -1
  210. package/dist/utils/table.utils.d.ts +4 -0
  211. package/dist/utils/table.utils.d.ts.map +1 -1
  212. package/dist/utils/table.utils.js +84 -45
  213. package/package.json +7 -1
package/dist/index.js CHANGED
@@ -1,107 +1,138 @@
1
- import { InkEditor as _ } from "./components/InkEditor/InkEditor.js";
2
- import { Box as t } from "./common-components/Box/Box.js";
3
- import { Button as O } from "./common-components/Button/Button.js";
4
- import { Canvas as A } from "./common-components/Canvas/Canvas.js";
5
- import { Field as T } from "./common-components/Field/Field.js";
6
- import { ContextMenu as i } from "./common-components/ContextMenu/ContextMenu.js";
7
- import { UndoIcon as x } from "./common-components/icons/UndoIcon.js";
1
+ import { InkEditor as t } from "./components/InkEditor/InkEditor.js";
2
+ import { Box as I } from "./common-components/Box/Box.js";
3
+ import { Button as E } from "./common-components/Button/Button.js";
4
+ import { Canvas as p } from "./common-components/Canvas/Canvas.js";
5
+ import { Field as A } from "./common-components/Field/Field.js";
6
+ import { ContextMenu as l } from "./common-components/ContextMenu/ContextMenu.js";
7
+ import { UndoIcon as N } from "./common-components/icons/UndoIcon.js";
8
8
  import { RedoIcon as f } from "./common-components/icons/RedoIcon.js";
9
- import { GripIcon as K } from "./common-components/icons/GripIcon.js";
9
+ import { GripIcon as L } from "./common-components/icons/GripIcon.js";
10
10
  import "react/jsx-runtime";
11
- import { cn as a } from "./utils/cn.utils.js";
12
- import { applyTypoAutoFix as P } from "./utils/typo.utils.js";
13
- import { createInkId as M } from "./utils/id.utils.js";
14
- import { buildTableHtml as c, deleteTableColumn as s, deleteTableRow as d, getTableCellFromSelection as u, insertTableColumn as b, insertTableRow as k } from "./utils/table.utils.js";
15
- import { TOOLBAR_STORAGE_KEY_HIDDEN as U, TOOLBAR_STORAGE_KEY_ITEMS as G } from "./constants/toolbarMenu.const.js";
16
- import { COLOR_MODE_DARK as H, COLOR_MODE_LIGHT as v, COLOR_MODE_SYSTEM as y, INK_DEFAULT_COLOR_MODE as V } from "./constants/colorMode.const.js";
11
+ import { cn as P } from "./utils/cn.utils.js";
12
+ import { applyTypoAutoFix as S } from "./utils/typo.utils.js";
13
+ import { createInkId as C } from "./utils/id.utils.js";
14
+ import { buildTableHtml as c, deleteTableColumn as M, deleteTableRow as d, getTableCellFromSelection as u, insertTableColumn as H, insertTableRow as k, toggleTableHeaderRow as G } from "./utils/table.utils.js";
15
+ import { TOOLBAR_STORAGE_KEY_HIDDEN as F, TOOLBAR_STORAGE_KEY_ITEMS as U } from "./constants/toolbarMenu.const.js";
16
+ import { COLOR_MODE_DARK as B, COLOR_MODE_LIGHT as g, COLOR_MODE_SYSTEM as v, INK_DEFAULT_COLOR_MODE as y } from "./constants/colorMode.const.js";
17
17
  import { TYPO_DICTIONARY as Y } from "./constants/typos.const.js";
18
- import { INK_FONT_OPTIONS as w } from "./constants/fonts.const.js";
18
+ import { INK_FONT_OPTIONS as z } from "./constants/fonts.const.js";
19
19
  import { INK_LIST_OPTIONS as Q } from "./constants/lists.const.js";
20
20
  import { INK_FIND_REPLACE_OPTIONS as j } from "./constants/findReplaceMenu.const.js";
21
- import { INK_CHROME_TOOLBAR as J, INK_COLLAB_TOOLBAR as W, INK_DEFAULT_FEATURES as Z, INK_DEFAULT_TOOLBAR as $, INK_HEADING_OPTIONS as ee, INK_QUICK_ACTIONS as oe, INK_SIMPLE_TOOLBAR as re, INK_SLASH_COMMANDS as _e, INK_TRANSLATE_LANGUAGES as Ie } from "./constants/defaults.const.js";
22
- import { INK_AI_DEMO_MODEL_ID as me, INK_AI_DEMO_PROVIDER_ID as Oe, INK_AI_MODEL_CATALOG as Ee } from "./constants/aiModels.const.js";
23
- import { INK_AI_INK_SERVER_PROVIDER_ID as Ne, INK_AI_OPENAI_MODEL_GPT_4_1 as Te, INK_AI_OPENAI_MODEL_GPT_4_1_MINI as pe, INK_AI_OPENAI_PROVIDER_ID as ie, INK_AI_OPENAI_PROVIDER_NAME as ne } from "./constants/openai.const.js";
24
- import { INK_PREMIUM_FEATURES as Re, INK_PREMIUM_LICENSE_PREFIX as fe } from "./constants/premium.const.js";
25
- import { INK_DEFAULT_ICONS as Ke } from "./constants/defaultIcons.js";
26
- import { createTrackChange as ae } from "./utils/trackChanges.utils.js";
27
- import { createCommentThread as Pe } from "./utils/comments.utils.js";
28
- import { InkHistoryStack as Me } from "./utils/history.utils.js";
29
- import { hasInkPremiumFeature as ce, isInkPremiumLicenseKey as se, resolveInkPremium as de, themeTokensToStyle as ue } from "./utils/premium.utils.js";
30
- import { mintInkPremiumLicenseKey as ke } from "./utils/license.utils.js";
31
- import { sanitizePastedHtml as Ue } from "./utils/paste.utils.js";
32
- import { captureSelectionInRoot as Be, restoreSelectionInRoot as He, withPreservedSelection as ve } from "./utils/selection.utils.js";
33
- import { buildVisibleToolbarItems as Ve, listCustomizableToolbarOptions as he, normalizeToolbarItems as Ye } from "./utils/toolbarStorage.utils.js";
34
- import { createInkAiPlugin as we, inkAi as ze } from "./plugins/ai/aiPlugin.js";
35
- import { createDemoAiProvider as Xe } from "./plugins/ai/demoProvider.js";
21
+ import { INK_CHROME_TOOLBAR as J, INK_COLLAB_TOOLBAR as Z, INK_DEFAULT_FEATURES as $, INK_DEFAULT_TOOLBAR as ee, INK_HEADING_OPTIONS as oe, INK_QUICK_ACTIONS as re, INK_SIMPLE_TOOLBAR as te, INK_SLASH_COMMANDS as _e, INK_TRANSLATE_LANGUAGES as Ie } from "./constants/defaults.const.js";
22
+ import { INK_AI_DEMO_MODEL_ID as Ee, INK_AI_DEMO_PROVIDER_ID as Te, INK_AI_MODEL_CATALOG as pe } from "./constants/aiModels.const.js";
23
+ import { INK_AI_INK_SERVER_PROVIDER_ID as Ae, INK_AI_OPENAI_MODEL_GPT_4_1 as ie, INK_AI_OPENAI_MODEL_GPT_4_1_MINI as le, INK_AI_OPENAI_PROVIDER_ID as xe, INK_AI_OPENAI_PROVIDER_NAME as Ne } from "./constants/openai.const.js";
24
+ import { INK_PREMIUM_FEATURES as fe, INK_PREMIUM_LICENSE_PREFIX as Re } from "./constants/premium.const.js";
25
+ import { INK_DEFAULT_ICONS as ae } from "./constants/defaultIcons.js";
26
+ import { createTrackChange as De } from "./utils/trackChanges.utils.js";
27
+ import { createCommentThread as Ke } from "./utils/comments.utils.js";
28
+ import { InkHistoryStack as se } from "./utils/history.utils.js";
29
+ import { hasInkPremiumFeature as Me, isInkPremiumLicenseKey as de, resolveInkPremium as ue, themeTokensToStyle as He } from "./utils/premium.utils.js";
30
+ import { mintInkPremiumLicenseKey as Ge } from "./utils/license.utils.js";
31
+ import { sanitizePastedHtml as Fe } from "./utils/paste.utils.js";
32
+ import { captureSelectionInRoot as he, restoreSelectionInRoot as Be, withPreservedSelection as ge } from "./utils/selection.utils.js";
33
+ import { buildVisibleToolbarItems as ye, listCustomizableToolbarOptions as Ve, normalizeToolbarItems as Ye } from "./utils/toolbarStorage.utils.js";
34
+ import { createInkAiPlugin as ze, inkAi as Xe } from "./plugins/ai/aiPlugin.js";
35
+ import { createDemoAiProvider as We } from "./plugins/ai/demoProvider.js";
36
36
  import { createOpenAiProvider as qe } from "./plugins/ai/openaiProvider.js";
37
- import { createInkServerAiProvider as We } from "./plugins/ai/inkServerProvider.js";
37
+ import { createInkServerAiProvider as Ze } from "./plugins/ai/inkServerProvider.js";
38
+ import { createInkPluginHost as eo, inkPlugins as oo } from "./plugins/host/inkPlugins.js";
39
+ import { TITLE_PREVIEW_TEXT as to, TITLE_STYLE_DEFAULT as _o, TITLE_STYLE_IDS as Io } from "./plugins/titles/titles.const.js";
40
+ import { buildTitleHtml as Eo } from "./plugins/titles/titles.utils.js";
41
+ import { CSV_ACCEPT as po, createEmptyExcelGrid as Oo, excelGridToTableHtml as Ao, parseCsvText as io, setExcelCell as lo } from "./plugins/excel/excel.utils.js";
42
+ import { GRAPH_KINDS as No, GRAPH_KIND_DEFAULT as no, GRAPH_KIND_LABELS as fo, GRAPH_SAMPLE as Ro } from "./plugins/graph/graph.const.js";
43
+ import { buildGraphHtml as ao, parseGraphColors as Po } from "./plugins/graph/graph.utils.js";
44
+ import { INK_THEMES as So, THEME_DEFAULT as Ko } from "./plugins/theme/theme.const.js";
45
+ import { applyInkTheme as so, createInkThemePlugin as co, inkTheme as Mo } from "./plugins/theme/inkTheme.js";
38
46
  export {
39
- t as Box,
40
- O as Button,
41
- H as COLOR_MODE_DARK,
42
- v as COLOR_MODE_LIGHT,
43
- y as COLOR_MODE_SYSTEM,
44
- A as Canvas,
45
- i as ContextMenu,
46
- T as Field,
47
- K as GripIcon,
48
- me as INK_AI_DEMO_MODEL_ID,
49
- Oe as INK_AI_DEMO_PROVIDER_ID,
50
- Ne as INK_AI_INK_SERVER_PROVIDER_ID,
51
- Ee as INK_AI_MODEL_CATALOG,
52
- Te as INK_AI_OPENAI_MODEL_GPT_4_1,
53
- pe as INK_AI_OPENAI_MODEL_GPT_4_1_MINI,
54
- ie as INK_AI_OPENAI_PROVIDER_ID,
55
- ne as INK_AI_OPENAI_PROVIDER_NAME,
47
+ I as Box,
48
+ E as Button,
49
+ B as COLOR_MODE_DARK,
50
+ g as COLOR_MODE_LIGHT,
51
+ v as COLOR_MODE_SYSTEM,
52
+ po as CSV_ACCEPT,
53
+ p as Canvas,
54
+ l as ContextMenu,
55
+ A as Field,
56
+ No as GRAPH_KINDS,
57
+ no as GRAPH_KIND_DEFAULT,
58
+ fo as GRAPH_KIND_LABELS,
59
+ Ro as GRAPH_SAMPLE,
60
+ L as GripIcon,
61
+ Ee as INK_AI_DEMO_MODEL_ID,
62
+ Te as INK_AI_DEMO_PROVIDER_ID,
63
+ Ae as INK_AI_INK_SERVER_PROVIDER_ID,
64
+ pe as INK_AI_MODEL_CATALOG,
65
+ ie as INK_AI_OPENAI_MODEL_GPT_4_1,
66
+ le as INK_AI_OPENAI_MODEL_GPT_4_1_MINI,
67
+ xe as INK_AI_OPENAI_PROVIDER_ID,
68
+ Ne as INK_AI_OPENAI_PROVIDER_NAME,
56
69
  J as INK_CHROME_TOOLBAR,
57
- W as INK_COLLAB_TOOLBAR,
58
- V as INK_DEFAULT_COLOR_MODE,
59
- Z as INK_DEFAULT_FEATURES,
60
- Ke as INK_DEFAULT_ICONS,
61
- $ as INK_DEFAULT_TOOLBAR,
70
+ Z as INK_COLLAB_TOOLBAR,
71
+ y as INK_DEFAULT_COLOR_MODE,
72
+ $ as INK_DEFAULT_FEATURES,
73
+ ae as INK_DEFAULT_ICONS,
74
+ ee as INK_DEFAULT_TOOLBAR,
62
75
  j as INK_FIND_REPLACE_OPTIONS,
63
- w as INK_FONT_OPTIONS,
64
- ee as INK_HEADING_OPTIONS,
76
+ z as INK_FONT_OPTIONS,
77
+ oe as INK_HEADING_OPTIONS,
65
78
  Q as INK_LIST_OPTIONS,
66
- Re as INK_PREMIUM_FEATURES,
67
- fe as INK_PREMIUM_LICENSE_PREFIX,
68
- oe as INK_QUICK_ACTIONS,
69
- re as INK_SIMPLE_TOOLBAR,
79
+ fe as INK_PREMIUM_FEATURES,
80
+ Re as INK_PREMIUM_LICENSE_PREFIX,
81
+ re as INK_QUICK_ACTIONS,
82
+ te as INK_SIMPLE_TOOLBAR,
70
83
  _e as INK_SLASH_COMMANDS,
84
+ So as INK_THEMES,
71
85
  Ie as INK_TRANSLATE_LANGUAGES,
72
- _ as InkEditor,
73
- Me as InkHistoryStack,
86
+ t as InkEditor,
87
+ se as InkHistoryStack,
74
88
  f as RedoIcon,
75
- U as TOOLBAR_STORAGE_KEY_HIDDEN,
76
- G as TOOLBAR_STORAGE_KEY_ITEMS,
89
+ Ko as THEME_DEFAULT,
90
+ to as TITLE_PREVIEW_TEXT,
91
+ _o as TITLE_STYLE_DEFAULT,
92
+ Io as TITLE_STYLE_IDS,
93
+ F as TOOLBAR_STORAGE_KEY_HIDDEN,
94
+ U as TOOLBAR_STORAGE_KEY_ITEMS,
77
95
  Y as TYPO_DICTIONARY,
78
- x as UndoIcon,
79
- P as applyTypoAutoFix,
96
+ N as UndoIcon,
97
+ so as applyInkTheme,
98
+ S as applyTypoAutoFix,
99
+ ao as buildGraphHtml,
80
100
  c as buildTableHtml,
81
- Ve as buildVisibleToolbarItems,
82
- Be as captureSelectionInRoot,
83
- a as cn,
84
- Pe as createCommentThread,
85
- Xe as createDemoAiProvider,
86
- we as createInkAiPlugin,
87
- M as createInkId,
88
- We as createInkServerAiProvider,
101
+ Eo as buildTitleHtml,
102
+ ye as buildVisibleToolbarItems,
103
+ he as captureSelectionInRoot,
104
+ P as cn,
105
+ Ke as createCommentThread,
106
+ We as createDemoAiProvider,
107
+ Oo as createEmptyExcelGrid,
108
+ ze as createInkAiPlugin,
109
+ C as createInkId,
110
+ eo as createInkPluginHost,
111
+ Ze as createInkServerAiProvider,
112
+ co as createInkThemePlugin,
89
113
  qe as createOpenAiProvider,
90
- ae as createTrackChange,
91
- s as deleteTableColumn,
114
+ De as createTrackChange,
115
+ M as deleteTableColumn,
92
116
  d as deleteTableRow,
117
+ Ao as excelGridToTableHtml,
93
118
  u as getTableCellFromSelection,
94
- ce as hasInkPremiumFeature,
95
- ze as inkAi,
96
- b as insertTableColumn,
119
+ Me as hasInkPremiumFeature,
120
+ Xe as inkAi,
121
+ oo as inkPlugins,
122
+ Mo as inkTheme,
123
+ H as insertTableColumn,
97
124
  k as insertTableRow,
98
- se as isInkPremiumLicenseKey,
99
- he as listCustomizableToolbarOptions,
100
- ke as mintInkPremiumLicenseKey,
125
+ de as isInkPremiumLicenseKey,
126
+ Ve as listCustomizableToolbarOptions,
127
+ Ge as mintInkPremiumLicenseKey,
101
128
  Ye as normalizeToolbarItems,
102
- de as resolveInkPremium,
103
- He as restoreSelectionInRoot,
104
- Ue as sanitizePastedHtml,
105
- ue as themeTokensToStyle,
106
- ve as withPreservedSelection
129
+ io as parseCsvText,
130
+ Po as parseGraphColors,
131
+ ue as resolveInkPremium,
132
+ Be as restoreSelectionInRoot,
133
+ Fe as sanitizePastedHtml,
134
+ lo as setExcelCell,
135
+ He as themeTokensToStyle,
136
+ G as toggleTableHeaderRow,
137
+ ge as withPreservedSelection
107
138
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../constants/numbers.cjs"),l=require("../../constants/generals.const.cjs");require("../../constants/openai.const.cjs");require("react/jsx-runtime");const T=require("../../constants/table.const.cjs");require("../../utils/paste.utils.cjs");require("react");require("react-dom");const a=(e=t.INK_EXCEL_SHEET_ROWS,r=t.INK_EXCEL_SHEET_COLS)=>Array.from({length:e},()=>Array.from({length:r},()=>l.EMPTY_STRING)),u=e=>{const r=e.split(/\r?\n/).filter(E=>E.length>t.NUMBER_ZERO);return r.length===t.NUMBER_ZERO?a():r.map(E=>E.split(","))},C=e=>{const r=e.length>t.NUMBER_ZERO?e:a(),E=Math.max(...r.map(o=>o.length),t.INK_EXCEL_SHEET_COLS),n=r[t.NUMBER_ZERO]??[],c=Array.from({length:E},(o,s)=>`<th contenteditable="true">${n[s]??l.EMPTY_STRING}</th>`).join(l.EMPTY_STRING),_=r.slice(t.NUMBER_ONE).map(o=>`<tr>${Array.from({length:E},(R,N)=>`<td contenteditable="true">${(o[N]??l.EMPTY_STRING)||"<br>"}</td>`).join(l.EMPTY_STRING)}</tr>`).join(l.EMPTY_STRING);return`<table class="${T.TABLE_CLASS_NAME}"><thead><tr>${c}</tr></thead><tbody>${_}</tbody></table><p><br></p>`},M=(e,r,E,n)=>e.map((c,_)=>_===r?c.map((o,s)=>s===E?n:o):c),S=e=>{var E;if(e.length>=t.INK_EXCEL_SHEET_MAX_ROWS)return e;const r=((E=e[t.NUMBER_ZERO])==null?void 0:E.length)??t.INK_EXCEL_SHEET_COLS;return[...e,Array.from({length:r},()=>l.EMPTY_STRING)]},m=e=>{var E;return(((E=e[t.NUMBER_ZERO])==null?void 0:E.length)??t.INK_EXCEL_SHEET_COLS)>=t.INK_EXCEL_SHEET_MAX_COLS?e:e.map(n=>[...n,l.EMPTY_STRING])},i=e=>e.length<=t.NUMBER_ONE?e:e.slice(t.NUMBER_ZERO,-t.NUMBER_ONE),O=e=>{var E;return(((E=e[t.NUMBER_ZERO])==null?void 0:E.length)??t.NUMBER_ZERO)<=t.NUMBER_ONE?e:e.map(n=>n.slice(t.NUMBER_ZERO,-t.NUMBER_ONE))},h=e=>e.map(r=>r.map(()=>l.EMPTY_STRING)),x=".csv,text/csv";exports.CSV_ACCEPT=x;exports.addExcelCol=m;exports.addExcelRow=S;exports.clearExcelGrid=h;exports.createEmptyExcelGrid=a;exports.excelGridToTableHtml=C;exports.parseCsvText=u;exports.removeExcelCol=O;exports.removeExcelRow=i;exports.setExcelCell=M;
@@ -0,0 +1,13 @@
1
+ export type ExcelGrid = string[][];
2
+ export declare const createEmptyExcelGrid: (rows?: number, cols?: number) => ExcelGrid;
3
+ export declare const parseCsvText: (text: string) => ExcelGrid;
4
+ export declare const excelGridToTableHtml: (grid: ExcelGrid) => string;
5
+ export declare const setExcelCell: (grid: ExcelGrid, row: number, col: number, value: string) => ExcelGrid;
6
+ export declare const addExcelRow: (grid: ExcelGrid) => ExcelGrid;
7
+ export declare const addExcelCol: (grid: ExcelGrid) => ExcelGrid;
8
+ export declare const removeExcelRow: (grid: ExcelGrid) => ExcelGrid;
9
+ export declare const removeExcelCol: (grid: ExcelGrid) => ExcelGrid;
10
+ export declare const clearExcelGrid: (grid: ExcelGrid) => ExcelGrid;
11
+ export declare const CSV_ACCEPT = ".csv,text/csv";
12
+ export declare const CSV_NEWLINE = "\n";
13
+ //# sourceMappingURL=excel.utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"excel.utils.d.ts","sourceRoot":"","sources":["../../../src/plugins/excel/excel.utils.ts"],"names":[],"mappings":"AAWA,MAAM,MAAM,SAAS,GAAG,MAAM,EAAE,EAAE,CAAC;AAEnC,eAAO,MAAM,oBAAoB,GAC/B,aAA2B,EAC3B,aAA2B,KAC1B,SACmF,CAAC;AAEvF,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,KAAG,SAI3C,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,MAAM,SAAS,KAAG,MAmBtD,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,MAAM,SAAS,EAAE,KAAK,MAAM,EAAE,KAAK,MAAM,EAAE,OAAO,MAAM,KAAG,SAKrF,CAAC;AAEJ,eAAO,MAAM,WAAW,GAAI,MAAM,SAAS,KAAG,SAI7C,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,MAAM,SAAS,KAAG,SAI7C,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,MAAM,SAAS,KAAG,SAGhD,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,MAAM,SAAS,KAAG,SAIhD,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,MAAM,SAAS,KAAG,SACD,CAAC;AAEjD,eAAO,MAAM,UAAU,kBAAkB,CAAC;AAC1C,eAAO,MAAM,WAAW,OAAiB,CAAC"}
@@ -0,0 +1,40 @@
1
+ import { INK_EXCEL_SHEET_ROWS as i, INK_EXCEL_SHEET_COLS as m, NUMBER_ZERO as o, NUMBER_ONE as s, INK_EXCEL_SHEET_MAX_ROWS as C, INK_EXCEL_SHEET_MAX_COLS as f } from "../../constants/numbers.js";
2
+ import { EMPTY_STRING as n } from "../../constants/generals.const.js";
3
+ import "../../constants/openai.const.js";
4
+ import "react/jsx-runtime";
5
+ import { TABLE_CLASS_NAME as x } from "../../constants/table.const.js";
6
+ import "../../utils/paste.utils.js";
7
+ import "react";
8
+ import "react-dom";
9
+ const _ = (t = i, r = m) => Array.from({ length: t }, () => Array.from({ length: r }, () => n)), R = (t) => {
10
+ const r = t.split(/\r?\n/).filter((e) => e.length > o);
11
+ return r.length === o ? _() : r.map((e) => e.split(","));
12
+ }, M = (t) => {
13
+ const r = t.length > o ? t : _(), e = Math.max(...r.map((c) => c.length), m), l = r[o] ?? [], a = Array.from({ length: e }, (c, E) => `<th contenteditable="true">${l[E] ?? n}</th>`).join(n), p = r.slice(s).map((c) => `<tr>${Array.from({ length: e }, (h, u) => `<td contenteditable="true">${(c[u] ?? n) || "<br>"}</td>`).join(n)}</tr>`).join(n);
14
+ return `<table class="${x}"><thead><tr>${a}</tr></thead><tbody>${p}</tbody></table><p><br></p>`;
15
+ }, O = (t, r, e, l) => t.map(
16
+ (a, p) => p === r ? a.map((c, E) => E === e ? l : c) : a
17
+ ), X = (t) => {
18
+ var e;
19
+ if (t.length >= C) return t;
20
+ const r = ((e = t[o]) == null ? void 0 : e.length) ?? m;
21
+ return [...t, Array.from({ length: r }, () => n)];
22
+ }, $ = (t) => {
23
+ var e;
24
+ return (((e = t[o]) == null ? void 0 : e.length) ?? m) >= f ? t : t.map((l) => [...l, n]);
25
+ }, H = (t) => t.length <= s ? t : t.slice(o, -s), I = (t) => {
26
+ var e;
27
+ return (((e = t[o]) == null ? void 0 : e.length) ?? o) <= s ? t : t.map((l) => l.slice(o, -s));
28
+ }, g = (t) => t.map((r) => r.map(() => n)), G = ".csv,text/csv";
29
+ export {
30
+ G as CSV_ACCEPT,
31
+ $ as addExcelCol,
32
+ X as addExcelRow,
33
+ g as clearExcelGrid,
34
+ _ as createEmptyExcelGrid,
35
+ M as excelGridToTableHtml,
36
+ R as parseCsvText,
37
+ I as removeExcelCol,
38
+ H as removeExcelRow,
39
+ O as setExcelCell
40
+ };
@@ -0,0 +1,3 @@
1
+ export { CSV_ACCEPT, addExcelCol, addExcelRow, clearExcelGrid, createEmptyExcelGrid, excelGridToTableHtml, parseCsvText, removeExcelCol, removeExcelRow, setExcelCell, } from './excel.utils';
2
+ export type { ExcelGrid } from './excel.utils';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/excel/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,WAAW,EACX,WAAW,EACX,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,YAAY,GACb,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A="bar",_=[A,"line","pie"],R=[{label:"A",value:40},{label:"B",value:70},{label:"C",value:55},{label:"D",value:90}],P={bar:"Bar",line:"Line",pie:"Pie"},G=8,E=2,H=3,e=10,S=6,L=60,t=2,l=["#0E8A6E","#22A585","#0B6E58","#5C5E56"];exports.GRAPH_BAR_GAP_PX=G;exports.GRAPH_COLORS=l;exports.GRAPH_CORNER=t;exports.GRAPH_DOT_RADIUS=H;exports.GRAPH_KINDS=_;exports.GRAPH_KIND_DEFAULT=A;exports.GRAPH_KIND_LABELS=P;exports.GRAPH_LABEL_OFFSET=S;exports.GRAPH_LABEL_SIZE=e;exports.GRAPH_PIE_RADIUS=L;exports.GRAPH_SAMPLE=R;exports.GRAPH_STROKE_PX=E;
@@ -0,0 +1,14 @@
1
+ import { GraphKind, GraphPoint } from './graph.types';
2
+ export declare const GRAPH_KIND_DEFAULT: GraphKind;
3
+ export declare const GRAPH_KINDS: GraphKind[];
4
+ export declare const GRAPH_SAMPLE: GraphPoint[];
5
+ export declare const GRAPH_KIND_LABELS: Record<GraphKind, string>;
6
+ export declare const GRAPH_BAR_GAP_PX = 8;
7
+ export declare const GRAPH_STROKE_PX = 2;
8
+ export declare const GRAPH_DOT_RADIUS = 3;
9
+ export declare const GRAPH_LABEL_SIZE = 10;
10
+ export declare const GRAPH_LABEL_OFFSET = 6;
11
+ export declare const GRAPH_PIE_RADIUS = 60;
12
+ export declare const GRAPH_CORNER = 2;
13
+ export declare const GRAPH_COLORS: string[];
14
+ //# sourceMappingURL=graph.const.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph.const.d.ts","sourceRoot":"","sources":["../../../src/plugins/graph/graph.const.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3D,eAAO,MAAM,kBAAkB,EAAE,SAAiB,CAAC;AACnD,eAAO,MAAM,WAAW,EAAE,SAAS,EAAwC,CAAC;AAE5E,eAAO,MAAM,YAAY,EAAE,UAAU,EAKpC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAIvD,CAAC;AAEF,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC,eAAO,MAAM,eAAe,IAAI,CAAC;AACjC,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,eAAO,MAAM,kBAAkB,IAAI,CAAC;AACpC,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,eAAO,MAAM,YAAY,IAAI,CAAC;AAC9B,eAAO,MAAM,YAAY,UAA+C,CAAC"}
@@ -0,0 +1,24 @@
1
+ const A = "bar", _ = ["bar", "line", "pie"], R = [
2
+ { label: "A", value: 40 },
3
+ { label: "B", value: 70 },
4
+ { label: "C", value: 55 },
5
+ { label: "D", value: 90 }
6
+ ], P = {
7
+ bar: "Bar",
8
+ line: "Line",
9
+ pie: "Pie"
10
+ }, e = 8, n = 2, E = 3, l = 10, G = 6, o = 60, t = 2, H = ["#0E8A6E", "#22A585", "#0B6E58", "#5C5E56"];
11
+ export {
12
+ e as GRAPH_BAR_GAP_PX,
13
+ H as GRAPH_COLORS,
14
+ t as GRAPH_CORNER,
15
+ E as GRAPH_DOT_RADIUS,
16
+ _ as GRAPH_KINDS,
17
+ A as GRAPH_KIND_DEFAULT,
18
+ P as GRAPH_KIND_LABELS,
19
+ G as GRAPH_LABEL_OFFSET,
20
+ l as GRAPH_LABEL_SIZE,
21
+ o as GRAPH_PIE_RADIUS,
22
+ R as GRAPH_SAMPLE,
23
+ n as GRAPH_STROKE_PX
24
+ };
@@ -0,0 +1,7 @@
1
+ export type GraphKind = 'bar' | 'line' | 'pie';
2
+ export type GraphPoint = {
3
+ label: string;
4
+ value: number;
5
+ };
6
+ export type GraphColors = string[];
7
+ //# sourceMappingURL=graph.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph.types.d.ts","sourceRoot":"","sources":["../../../src/plugins/graph/graph.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,CAAC;AAE/C,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,MAAM,EAAE,CAAC"}
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../constants/numbers.cjs"),h=require("../../constants/generals.const.cjs"),l=require("../../constants/defaults.const.cjs");require("../../constants/openai.const.cjs");require("react/jsx-runtime");require("../../utils/paste.utils.cjs");require("react");require("react-dom");const r=require("./graph.const.cjs"),u=t=>Math.max(...t.map(_=>_.value),e.NUMBER_ONE),i=(t,_)=>t[_%t.length]??r.GRAPH_COLORS[_%r.GRAPH_COLORS.length]??r.GRAPH_COLORS[e.NUMBER_ZERO],$=t=>t&&t.length>e.NUMBER_ZERO?t:r.GRAPH_COLORS,S=(t,_=r.GRAPH_COLORS)=>{const n=$(_),R=e.INK_GRAPH_WIDTH-e.INK_GRAPH_PAD*2,c=e.INK_GRAPH_HEIGHT-e.INK_GRAPH_PAD*2,A=u(t),o=(R-r.GRAPH_BAR_GAP_PX*(t.length-e.NUMBER_ONE))/t.length,a=t.map((I,P)=>{const G=I.value/A*c,s=e.INK_GRAPH_PAD+P*(o+r.GRAPH_BAR_GAP_PX),H=e.INK_GRAPH_PAD+c-G,N=i(n,P);return`<rect x="${s}" y="${H}" width="${o}" height="${G}" fill="${N}" rx="${r.GRAPH_CORNER}"/><text x="${s+o/2}" y="${e.INK_GRAPH_HEIGHT-r.GRAPH_LABEL_OFFSET}" text-anchor="middle" font-size="${r.GRAPH_LABEL_SIZE}" fill="#5C5E56">${I.label}</text>`}).join(h.EMPTY_STRING);return`<svg class="${l.INK_CLASS_GRAPH_WRAP}" viewBox="0 0 ${e.INK_GRAPH_WIDTH} ${e.INK_GRAPH_HEIGHT}" width="${e.INK_GRAPH_WIDTH}" height="${e.INK_GRAPH_HEIGHT}">${a}</svg>`},T=(t,_=r.GRAPH_COLORS)=>{const n=$(_),R=i(n,e.NUMBER_ZERO),c=e.INK_GRAPH_WIDTH-e.INK_GRAPH_PAD*2,A=e.INK_GRAPH_HEIGHT-e.INK_GRAPH_PAD*2,o=u(t),a=t.length>e.NUMBER_ONE?c/(t.length-e.NUMBER_ONE):c,I=t.map((s,H)=>{const N=e.INK_GRAPH_PAD+H*a,E=e.INK_GRAPH_PAD+A-s.value/o*A;return{x:N,y:E,label:s.label}}),P=I.map((s,H)=>`${H===0?"M":"L"}${s.x} ${s.y}`).join(" "),G=I.map((s,H)=>`<circle cx="${s.x}" cy="${s.y}" r="${r.GRAPH_DOT_RADIUS}" fill="${i(n,H)}"/><text x="${s.x}" y="${e.INK_GRAPH_HEIGHT-r.GRAPH_LABEL_OFFSET}" text-anchor="middle" font-size="${r.GRAPH_LABEL_SIZE}" fill="#5C5E56">${s.label}</text>`).join(h.EMPTY_STRING);return`<svg class="${l.INK_CLASS_GRAPH_WRAP}" viewBox="0 0 ${e.INK_GRAPH_WIDTH} ${e.INK_GRAPH_HEIGHT}" width="${e.INK_GRAPH_WIDTH}" height="${e.INK_GRAPH_HEIGHT}"><path d="${P}" fill="none" stroke="${R}" stroke-width="${r.GRAPH_STROKE_PX}"/>${G}</svg>`},g=(t,_=r.GRAPH_COLORS)=>{const n=$(_),R=t.reduce((P,G)=>P+G.value,e.NUMBER_ZERO)||e.NUMBER_ONE,c=e.INK_GRAPH_WIDTH/2,A=e.INK_GRAPH_HEIGHT/2,o=r.GRAPH_PIE_RADIUS;let a=-Math.PI/2;const I=t.map((P,G)=>{const s=P.value/R*Math.PI*2,H=a;a+=s;const N=c+o*Math.cos(H),E=A+o*Math.sin(H),L=c+o*Math.cos(a),d=A+o*Math.sin(a),B=s>Math.PI?e.NUMBER_ONE:e.NUMBER_ZERO;return`<path d="M ${c} ${A} L ${N} ${E} A ${o} ${o} 0 ${B} 1 ${L} ${d} Z" fill="${i(n,G)}"/>`}).join(h.EMPTY_STRING);return`<svg class="${l.INK_CLASS_GRAPH_WRAP}" viewBox="0 0 ${e.INK_GRAPH_WIDTH} ${e.INK_GRAPH_HEIGHT}" width="${e.INK_GRAPH_WIDTH}" height="${e.INK_GRAPH_HEIGHT}">${I}</svg>`},O=t=>encodeURIComponent(JSON.stringify(t)),C=t=>{if(!t)return[];try{const _=JSON.parse(decodeURIComponent(t));return Array.isArray(_)?_.filter(n=>!!n&&typeof n=="object"&&typeof n.label=="string"&&typeof n.value=="number"):[]}catch{return[]}},K=t=>{if(!t)return[...r.GRAPH_COLORS];try{const _=JSON.parse(decodeURIComponent(t));if(!Array.isArray(_))return[...r.GRAPH_COLORS];const n=_.filter(R=>typeof R=="string"&&R.length>e.NUMBER_ZERO);return n.length>e.NUMBER_ZERO?n:[...r.GRAPH_COLORS]}catch{return[...r.GRAPH_COLORS]}},p=(t,_,n=r.GRAPH_COLORS)=>{const R=$(n),c=t==="line"?T(_,R):t==="pie"?g(_,R):S(_,R);return`<p class="${l.INK_CLASS_GRAPH_BLOCK}" ${l.INK_ATTR_GRAPH}="${t}" ${l.INK_ATTR_GRAPH_POINTS}="${O(_)}" ${l.INK_ATTR_GRAPH_COLORS}="${O(R)}">${c}</p><p><br></p>`},M=(t,_,n,R)=>{const c=R??K(t.getAttribute(l.INK_ATTR_GRAPH_COLORS)),A=document.createElement("div");A.innerHTML=p(_,n,c);const o=A.firstElementChild;o&&t.replaceWith(o)},f=t=>{if(!(t instanceof Node))return null;const _=t instanceof HTMLElement?t:t.parentElement;return(_==null?void 0:_.closest(`[${l.INK_ATTR_GRAPH}]`))??null};exports.buildBarSvg=S;exports.buildGraphHtml=p;exports.buildLineSvg=T;exports.buildPieSvg=g;exports.getGraphBlock=f;exports.parseGraphColors=K;exports.parseGraphPoints=C;exports.replaceGraphBlock=M;
@@ -0,0 +1,11 @@
1
+ import { GraphColors, GraphKind, GraphPoint } from './graph.types';
2
+ export declare const buildBarSvg: (points: GraphPoint[], colors?: GraphColors) => string;
3
+ export declare const buildLineSvg: (points: GraphPoint[], colors?: GraphColors) => string;
4
+ export declare const buildPieSvg: (points: GraphPoint[], colors?: GraphColors) => string;
5
+ export declare const parseGraphPoints: (value: string | null) => GraphPoint[];
6
+ export declare const parseGraphColors: (value: string | null) => GraphColors;
7
+ export declare const parseGraphValuesText: (text: string) => GraphPoint[];
8
+ export declare const buildGraphHtml: (kind: GraphKind, points: GraphPoint[], colors?: GraphColors) => string;
9
+ export declare const replaceGraphBlock: (block: HTMLElement, kind: GraphKind, points: GraphPoint[], colors?: GraphColors) => void;
10
+ export declare const getGraphBlock: (node: EventTarget | null) => HTMLElement | null;
11
+ //# sourceMappingURL=graph.utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph.utils.d.ts","sourceRoot":"","sources":["../../../src/plugins/graph/graph.utils.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAWxE,eAAO,MAAM,WAAW,GAAI,QAAQ,UAAU,EAAE,EAAE,SAAQ,WAA0B,KAAG,MAgBtF,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,QAAQ,UAAU,EAAE,EAAE,SAAQ,WAA0B,KAAG,MAoBvF,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,QAAQ,UAAU,EAAE,EAAE,SAAQ,WAA0B,KAAG,MAqBtF,CAAC;AAIF,eAAO,MAAM,gBAAgB,GAAI,OAAO,MAAM,GAAG,IAAI,KAAG,UAAU,EAejE,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,OAAO,MAAM,GAAG,IAAI,KAAG,WAUvD,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,MAAM,MAAM,KAAG,UAAU,EAQxD,CAAC;AAEP,eAAO,MAAM,cAAc,GACzB,MAAM,SAAS,EACf,QAAQ,UAAU,EAAE,EACpB,SAAQ,WAA0B,KACjC,MASF,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC5B,OAAO,WAAW,EAClB,MAAM,SAAS,EACf,QAAQ,UAAU,EAAE,EACpB,SAAS,WAAW,KACnB,IAQF,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,MAAM,WAAW,GAAG,IAAI,KAAG,WAAW,GAAG,IAItE,CAAC"}
@@ -0,0 +1,76 @@
1
+ import { NUMBER_ZERO as g, NUMBER_ONE as m, INK_GRAPH_PAD as R, INK_GRAPH_HEIGHT as $, INK_GRAPH_WIDTH as h } from "../../constants/numbers.js";
2
+ import { EMPTY_STRING as G } from "../../constants/generals.const.js";
3
+ import { INK_CLASS_GRAPH_BLOCK as b, INK_ATTR_GRAPH as v, INK_ATTR_GRAPH_POINTS as L, INK_ATTR_GRAPH_COLORS as E, INK_CLASS_GRAPH_WRAP as H } from "../../constants/defaults.const.js";
4
+ import "../../constants/openai.const.js";
5
+ import "react/jsx-runtime";
6
+ import "../../utils/paste.utils.js";
7
+ import "react";
8
+ import "react-dom";
9
+ import { GRAPH_COLORS as l, GRAPH_DOT_RADIUS as B, GRAPH_LABEL_SIZE as S, GRAPH_LABEL_OFFSET as N, GRAPH_STROKE_PX as K, GRAPH_PIE_RADIUS as w, GRAPH_BAR_GAP_PX as y, GRAPH_CORNER as U } from "./graph.const.js";
10
+ const T = (t) => Math.max(...t.map((e) => e.value), m), P = (t, e) => t[e % t.length] ?? l[e % l.length] ?? l[g], x = (t) => t && t.length > g ? t : l, W = (t, e = l) => {
11
+ const n = x(e), o = h - R * 2, c = $ - R * 2, a = T(t), s = (o - y * (t.length - m)) / t.length, p = t.map((u, _) => {
12
+ const A = u.value / a * c, r = R + _ * (s + y), i = R + c - A, f = P(n, _);
13
+ return `<rect x="${r}" y="${i}" width="${s}" height="${A}" fill="${f}" rx="${U}"/><text x="${r + s / 2}" y="${$ - N}" text-anchor="middle" font-size="${S}" fill="#5C5E56">${u.label}</text>`;
14
+ }).join(G);
15
+ return `<svg class="${H}" viewBox="0 0 ${h} ${$}" width="${h}" height="${$}">${p}</svg>`;
16
+ }, j = (t, e = l) => {
17
+ const n = x(e), o = P(n, g), c = h - R * 2, a = $ - R * 2, s = T(t), p = t.length > m ? c / (t.length - m) : c, u = t.map((r, i) => {
18
+ const f = R + i * p, d = R + a - r.value / s * a;
19
+ return { x: f, y: d, label: r.label };
20
+ }), _ = u.map((r, i) => `${i === 0 ? "M" : "L"}${r.x} ${r.y}`).join(" "), A = u.map(
21
+ (r, i) => `<circle cx="${r.x}" cy="${r.y}" r="${B}" fill="${P(n, i)}"/><text x="${r.x}" y="${$ - N}" text-anchor="middle" font-size="${S}" fill="#5C5E56">${r.label}</text>`
22
+ ).join(G);
23
+ return `<svg class="${H}" viewBox="0 0 ${h} ${$}" width="${h}" height="${$}"><path d="${_}" fill="none" stroke="${o}" stroke-width="${K}"/>${A}</svg>`;
24
+ }, D = (t, e = l) => {
25
+ const n = x(e), o = t.reduce((_, A) => _ + A.value, g) || m, c = h / 2, a = $ / 2, s = w;
26
+ let p = -Math.PI / 2;
27
+ const u = t.map((_, A) => {
28
+ const r = _.value / o * Math.PI * 2, i = p;
29
+ p += r;
30
+ const f = c + s * Math.cos(i), d = a + s * Math.sin(i), C = c + s * Math.cos(p), M = a + s * Math.sin(p), O = r > Math.PI ? m : g;
31
+ return `<path d="M ${c} ${a} L ${f} ${d} A ${s} ${s} 0 ${O} 1 ${C} ${M} Z" fill="${P(n, A)}"/>`;
32
+ }).join(G);
33
+ return `<svg class="${H}" viewBox="0 0 ${h} ${$}" width="${h}" height="${$}">${u}</svg>`;
34
+ }, I = (t) => encodeURIComponent(JSON.stringify(t)), et = (t) => {
35
+ if (!t) return [];
36
+ try {
37
+ const e = JSON.parse(decodeURIComponent(t));
38
+ return Array.isArray(e) ? e.filter(
39
+ (n) => !!n && typeof n == "object" && typeof n.label == "string" && typeof n.value == "number"
40
+ ) : [];
41
+ } catch {
42
+ return [];
43
+ }
44
+ }, k = (t) => {
45
+ if (!t) return [...l];
46
+ try {
47
+ const e = JSON.parse(decodeURIComponent(t));
48
+ if (!Array.isArray(e)) return [...l];
49
+ const n = e.filter((o) => typeof o == "string" && o.length > g);
50
+ return n.length > g ? n : [...l];
51
+ } catch {
52
+ return [...l];
53
+ }
54
+ }, J = (t, e, n = l) => {
55
+ const o = x(n), c = t === "line" ? j(e, o) : t === "pie" ? D(e, o) : W(e, o);
56
+ return `<p class="${b}" ${v}="${t}" ${L}="${I(e)}" ${E}="${I(o)}">${c}</p><p><br></p>`;
57
+ }, nt = (t, e, n, o) => {
58
+ const c = o ?? k(t.getAttribute(E)), a = document.createElement("div");
59
+ a.innerHTML = J(e, n, c);
60
+ const s = a.firstElementChild;
61
+ s && t.replaceWith(s);
62
+ }, rt = (t) => {
63
+ if (!(t instanceof Node)) return null;
64
+ const e = t instanceof HTMLElement ? t : t.parentElement;
65
+ return (e == null ? void 0 : e.closest(`[${v}]`)) ?? null;
66
+ };
67
+ export {
68
+ W as buildBarSvg,
69
+ J as buildGraphHtml,
70
+ j as buildLineSvg,
71
+ D as buildPieSvg,
72
+ rt as getGraphBlock,
73
+ k as parseGraphColors,
74
+ et as parseGraphPoints,
75
+ nt as replaceGraphBlock
76
+ };
@@ -0,0 +1,4 @@
1
+ export { GRAPH_KIND_DEFAULT, GRAPH_KIND_LABELS, GRAPH_KINDS, GRAPH_SAMPLE } from './graph.const';
2
+ export { buildGraphHtml, getGraphBlock, parseGraphColors, parseGraphPoints, parseGraphValuesText, replaceGraphBlock, } from './graph.utils';
3
+ export type { GraphColors, GraphKind, GraphPoint } from './graph.types';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/graph/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACjG,OAAO,EACL,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { createInkPluginHost, inkPlugins } from './inkPlugins';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/host/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../constants/plugins.const.cjs"),e=new Map,l=()=>{n.BUNDLED_HOST_PLUGINS.forEach(t=>{e.has(t.id)||e.set(t.id,t)})},s=()=>(l(),{install:t=>{e.set(t.id,t)},uninstall:t=>{e.delete(t)},isInstalled:t=>e.has(t),get:t=>e.get(t),list:()=>Array.from(e.values())}),i=s();exports.createInkPluginHost=s;exports.inkPlugins=i;
@@ -0,0 +1,16 @@
1
+ import { InkHostPlugin, InkHostPluginId } from '../../types/plugin.types';
2
+ export declare const createInkPluginHost: () => {
3
+ install: (plugin: InkHostPlugin) => void;
4
+ uninstall: (id: InkHostPluginId) => void;
5
+ isInstalled: (id: InkHostPluginId) => boolean;
6
+ get: (id: InkHostPluginId) => InkHostPlugin | undefined;
7
+ list: () => InkHostPlugin[];
8
+ };
9
+ export declare const inkPlugins: {
10
+ install: (plugin: InkHostPlugin) => void;
11
+ uninstall: (id: InkHostPluginId) => void;
12
+ isInstalled: (id: InkHostPluginId) => boolean;
13
+ get: (id: InkHostPluginId) => InkHostPlugin | undefined;
14
+ list: () => InkHostPlugin[];
15
+ };
16
+ //# sourceMappingURL=inkPlugins.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inkPlugins.d.ts","sourceRoot":"","sources":["../../../src/plugins/host/inkPlugins.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAY/E,eAAO,MAAM,mBAAmB;sBAGV,aAAa,KAAG,IAAI;oBAGtB,eAAe,KAAG,IAAI;sBAGpB,eAAe,KAAG,OAAO;cACjC,eAAe,KAAG,aAAa,GAAG,SAAS;gBAC3C,aAAa,EAAE;CAE5B,CAAC;AAEF,eAAO,MAAM,UAAU;sBAZD,aAAa,KAAG,IAAI;oBAGtB,eAAe,KAAG,IAAI;sBAGpB,eAAe,KAAG,OAAO;cACjC,eAAe,KAAG,aAAa,GAAG,SAAS;gBAC3C,aAAa,EAAE;CAIkB,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { BUNDLED_HOST_PLUGINS as e } from "../../constants/plugins.const.js";
2
+ const s = /* @__PURE__ */ new Map(), n = () => {
3
+ e.forEach((t) => {
4
+ s.has(t.id) || s.set(t.id, t);
5
+ });
6
+ }, l = () => (n(), {
7
+ install: (t) => {
8
+ s.set(t.id, t);
9
+ },
10
+ uninstall: (t) => {
11
+ s.delete(t);
12
+ },
13
+ isInstalled: (t) => s.has(t),
14
+ get: (t) => s.get(t),
15
+ list: () => Array.from(s.values())
16
+ }), i = l();
17
+ export {
18
+ l as createInkPluginHost,
19
+ i as inkPlugins
20
+ };
@@ -0,0 +1,5 @@
1
+ export * from './titles';
2
+ export * from './excel';
3
+ export * from './graph';
4
+ export * from './theme';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { INK_THEMES, THEME_ATTR, THEME_DEFAULT, THEME_ID_DARK, THEME_ID_INK, THEME_ID_PAPER, THEME_ID_SNOW } from './theme.const';
2
+ export { applyInkTheme, createInkThemePlugin, inkTheme } from './inkTheme';
3
+ export type { InkThemeDefinition, InkThemeId, InkThemePlugin } from './theme.types';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/theme/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAClI,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3E,YAAY,EAAE,kBAAkB,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../constants/plugins.const.cjs"),s=require("../host/inkPlugins.cjs"),e=require("./theme.const.cjs");let i=e.THEME_DEFAULT;const T=(t,n)=>{if(i=n,!!t){if(n===e.THEME_ID_PAPER){t.removeAttribute(e.THEME_ATTR);return}t.setAttribute(e.THEME_ATTR,n)}},l=()=>({install:()=>{s.inkPlugins.install({id:r.PLUGIN_ID_THEME,label:"Theme",color:r.PLUGIN_COLOR_THEME,hint:"Paper theme for the editor"})},apply:T,list:()=>e.INK_THEMES,current:()=>i}),u=l();exports.applyInkTheme=T;exports.createInkThemePlugin=l;exports.inkTheme=u;
@@ -0,0 +1,5 @@
1
+ import { InkThemeId, InkThemePlugin } from './theme.types';
2
+ export declare const applyInkTheme: (root: HTMLElement | null, id: InkThemeId) => void;
3
+ export declare const createInkThemePlugin: () => InkThemePlugin;
4
+ export declare const inkTheme: InkThemePlugin;
5
+ //# sourceMappingURL=inkTheme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inkTheme.d.ts","sourceRoot":"","sources":["../../../src/plugins/theme/inkTheme.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAIhE,eAAO,MAAM,aAAa,GAAI,MAAM,WAAW,GAAG,IAAI,EAAE,IAAI,UAAU,KAAG,IAQxE,CAAC;AAEF,eAAO,MAAM,oBAAoB,QAAO,cAYtC,CAAC;AAEH,eAAO,MAAM,QAAQ,gBAAyB,CAAC"}
@@ -0,0 +1,30 @@
1
+ import { PLUGIN_COLOR_THEME as i, PLUGIN_ID_THEME as E } from "../../constants/plugins.const.js";
2
+ import { inkPlugins as T } from "../host/inkPlugins.js";
3
+ import { THEME_DEFAULT as l, INK_THEMES as m, THEME_ID_PAPER as o, THEME_ATTR as r } from "./theme.const.js";
4
+ let n = l;
5
+ const p = (e, t) => {
6
+ if (n = t, !!e) {
7
+ if (t === o) {
8
+ e.removeAttribute(r);
9
+ return;
10
+ }
11
+ e.setAttribute(r, t);
12
+ }
13
+ }, _ = () => ({
14
+ install: () => {
15
+ T.install({
16
+ id: E,
17
+ label: "Theme",
18
+ color: i,
19
+ hint: "Paper theme for the editor"
20
+ });
21
+ },
22
+ apply: p,
23
+ list: () => m,
24
+ current: () => n
25
+ }), a = _();
26
+ export {
27
+ p as applyInkTheme,
28
+ _ as createInkThemePlugin,
29
+ a as inkTheme
30
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E="paper",_="snow",T="ink",e="dark",t="data-ink-theme",M=E,n=[{id:E,label:"Paper"},{id:_,label:"Snow"},{id:T,label:"Ink"},{id:e,label:"Dark"}];exports.INK_THEMES=n;exports.THEME_ATTR=t;exports.THEME_DEFAULT=M;exports.THEME_ID_DARK=e;exports.THEME_ID_INK=T;exports.THEME_ID_PAPER=E;exports.THEME_ID_SNOW=_;