@clepit/core 0.2.0-beta.322

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 (188) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/LICENSE +21 -0
  3. package/README.md +79 -0
  4. package/dist/core/editor/action-bar/css.d.ts +3 -0
  5. package/dist/core/editor/action-bar/index.d.ts +18 -0
  6. package/dist/core/editor/css.d.ts +3 -0
  7. package/dist/core/editor/index.d.ts +18 -0
  8. package/dist/core/editor/views/edit.d.ts +4 -0
  9. package/dist/core/editor/views/index.d.ts +4 -0
  10. package/dist/core/editor/views/json.d.ts +9 -0
  11. package/dist/core/editor/views/preview.d.ts +4 -0
  12. package/dist/core/element/index.d.ts +101 -0
  13. package/dist/core/i18n/index.d.ts +43 -0
  14. package/dist/core/managers/block/css.d.ts +3 -0
  15. package/dist/core/managers/block/index.d.ts +40 -0
  16. package/dist/core/managers/event.d.ts +13 -0
  17. package/dist/core/managers/style.d.ts +181 -0
  18. package/dist/core/renderer/draw.d.ts +27 -0
  19. package/dist/core/renderer/index.d.ts +15 -0
  20. package/dist/core/renderer/invalid-data.d.ts +4 -0
  21. package/dist/core/renderer/page.d.ts +37 -0
  22. package/dist/core/store.d.ts +42 -0
  23. package/dist/core/theme/css.d.ts +4 -0
  24. package/dist/core/theme/index.d.ts +42 -0
  25. package/dist/core/toolbars/block/css.d.ts +3 -0
  26. package/dist/core/toolbars/block/index.d.ts +38 -0
  27. package/dist/core/toolbars/inline/css.d.ts +6 -0
  28. package/dist/core/toolbars/inline/index.d.ts +43 -0
  29. package/dist/index.d.ts +12 -0
  30. package/dist/index.js +2 -0
  31. package/dist/index.mjs +2 -0
  32. package/dist/tools/block/alert/css.d.ts +5 -0
  33. package/dist/tools/block/alert/index.d.ts +13 -0
  34. package/dist/tools/block/alert/input.d.ts +13 -0
  35. package/dist/tools/block/alert/output.d.ts +9 -0
  36. package/dist/tools/block/audio/css.d.ts +5 -0
  37. package/dist/tools/block/audio/index.d.ts +13 -0
  38. package/dist/tools/block/audio/input.d.ts +22 -0
  39. package/dist/tools/block/audio/output.d.ts +9 -0
  40. package/dist/tools/block/checklist/css.d.ts +5 -0
  41. package/dist/tools/block/checklist/index.d.ts +13 -0
  42. package/dist/tools/block/checklist/input.d.ts +14 -0
  43. package/dist/tools/block/checklist/output.d.ts +9 -0
  44. package/dist/tools/block/code/css.d.ts +5 -0
  45. package/dist/tools/block/code/grammar/engine.d.ts +52 -0
  46. package/dist/tools/block/code/grammar/languages.d.ts +6 -0
  47. package/dist/tools/block/code/highlight.d.ts +22 -0
  48. package/dist/tools/block/code/index.d.ts +13 -0
  49. package/dist/tools/block/code/input.d.ts +57 -0
  50. package/dist/tools/block/code/loaders/language.d.ts +17 -0
  51. package/dist/tools/block/code/loaders/theme.d.ts +21 -0
  52. package/dist/tools/block/code/output.d.ts +32 -0
  53. package/dist/tools/block/code/theme-css.d.ts +14 -0
  54. package/dist/tools/block/code/theme-generator.d.ts +27 -0
  55. package/dist/tools/block/code/variants.d.ts +14 -0
  56. package/dist/tools/block/collapsible/css.d.ts +6 -0
  57. package/dist/tools/block/collapsible/index.d.ts +13 -0
  58. package/dist/tools/block/collapsible/input.d.ts +13 -0
  59. package/dist/tools/block/collapsible/output.d.ts +16 -0
  60. package/dist/tools/block/collection/css.d.ts +6 -0
  61. package/dist/tools/block/collection/index.d.ts +13 -0
  62. package/dist/tools/block/collection/input.d.ts +11 -0
  63. package/dist/tools/block/collection/output.d.ts +12 -0
  64. package/dist/tools/block/columns/css.d.ts +6 -0
  65. package/dist/tools/block/columns/index.d.ts +13 -0
  66. package/dist/tools/block/columns/input.d.ts +12 -0
  67. package/dist/tools/block/columns/output.d.ts +11 -0
  68. package/dist/tools/block/date/css.d.ts +6 -0
  69. package/dist/tools/block/date/index.d.ts +13 -0
  70. package/dist/tools/block/date/input.d.ts +12 -0
  71. package/dist/tools/block/date/output.d.ts +10 -0
  72. package/dist/tools/block/delimiter/css.d.ts +5 -0
  73. package/dist/tools/block/delimiter/index.d.ts +13 -0
  74. package/dist/tools/block/delimiter/input.d.ts +12 -0
  75. package/dist/tools/block/delimiter/output.d.ts +9 -0
  76. package/dist/tools/block/doc-card/css.d.ts +6 -0
  77. package/dist/tools/block/doc-card/index.d.ts +13 -0
  78. package/dist/tools/block/doc-card/input.d.ts +11 -0
  79. package/dist/tools/block/doc-card/output.d.ts +11 -0
  80. package/dist/tools/block/embed/css.d.ts +6 -0
  81. package/dist/tools/block/embed/index.d.ts +13 -0
  82. package/dist/tools/block/embed/input.d.ts +11 -0
  83. package/dist/tools/block/embed/output.d.ts +23 -0
  84. package/dist/tools/block/embed/providers.d.ts +5 -0
  85. package/dist/tools/block/file/css.d.ts +6 -0
  86. package/dist/tools/block/file/index.d.ts +13 -0
  87. package/dist/tools/block/file/input.d.ts +14 -0
  88. package/dist/tools/block/file/output.d.ts +10 -0
  89. package/dist/tools/block/glance/css.d.ts +5 -0
  90. package/dist/tools/block/glance/index.d.ts +13 -0
  91. package/dist/tools/block/glance/input.d.ts +11 -0
  92. package/dist/tools/block/glance/output.d.ts +18 -0
  93. package/dist/tools/block/header/css.d.ts +5 -0
  94. package/dist/tools/block/header/index.d.ts +13 -0
  95. package/dist/tools/block/header/input.d.ts +13 -0
  96. package/dist/tools/block/header/output.d.ts +9 -0
  97. package/dist/tools/block/image/css.d.ts +5 -0
  98. package/dist/tools/block/image/index.d.ts +13 -0
  99. package/dist/tools/block/image/input.d.ts +22 -0
  100. package/dist/tools/block/image/output.d.ts +9 -0
  101. package/dist/tools/block/list/css.d.ts +5 -0
  102. package/dist/tools/block/list/index.d.ts +13 -0
  103. package/dist/tools/block/list/input.d.ts +16 -0
  104. package/dist/tools/block/list/output.d.ts +9 -0
  105. package/dist/tools/block/openapi/css.d.ts +5 -0
  106. package/dist/tools/block/openapi/index.d.ts +13 -0
  107. package/dist/tools/block/openapi/input.d.ts +11 -0
  108. package/dist/tools/block/openapi/output.d.ts +24 -0
  109. package/dist/tools/block/openapi/schema.d.ts +17 -0
  110. package/dist/tools/block/openapi/snippets.d.ts +5 -0
  111. package/dist/tools/block/openapi/spec.d.ts +46 -0
  112. package/dist/tools/block/paragraph/css.d.ts +5 -0
  113. package/dist/tools/block/paragraph/index.d.ts +13 -0
  114. package/dist/tools/block/paragraph/input.d.ts +12 -0
  115. package/dist/tools/block/paragraph/output.d.ts +13 -0
  116. package/dist/tools/block/quote/css.d.ts +5 -0
  117. package/dist/tools/block/quote/index.d.ts +13 -0
  118. package/dist/tools/block/quote/input.d.ts +15 -0
  119. package/dist/tools/block/quote/output.d.ts +14 -0
  120. package/dist/tools/block/sketch/css.d.ts +6 -0
  121. package/dist/tools/block/sketch/index.d.ts +13 -0
  122. package/dist/tools/block/sketch/input.d.ts +14 -0
  123. package/dist/tools/block/sketch/output.d.ts +16 -0
  124. package/dist/tools/block/table/css.d.ts +5 -0
  125. package/dist/tools/block/table/index.d.ts +13 -0
  126. package/dist/tools/block/table/input.d.ts +28 -0
  127. package/dist/tools/block/table/output.d.ts +28 -0
  128. package/dist/tools/block/toc/css.d.ts +6 -0
  129. package/dist/tools/block/toc/index.d.ts +13 -0
  130. package/dist/tools/block/toc/input.d.ts +11 -0
  131. package/dist/tools/block/toc/output.d.ts +18 -0
  132. package/dist/tools/block/typeset/css.d.ts +6 -0
  133. package/dist/tools/block/typeset/index.d.ts +22 -0
  134. package/dist/tools/block/typeset/input.d.ts +18 -0
  135. package/dist/tools/block/typeset/latex/layout.d.ts +32 -0
  136. package/dist/tools/block/typeset/latex/model.d.ts +64 -0
  137. package/dist/tools/block/typeset/latex/parse.d.ts +3 -0
  138. package/dist/tools/block/typeset/latex/render.d.ts +7 -0
  139. package/dist/tools/block/typeset/latex/symbols.d.ts +26 -0
  140. package/dist/tools/block/typeset/mermaid/layout.d.ts +71 -0
  141. package/dist/tools/block/typeset/mermaid/model.d.ts +78 -0
  142. package/dist/tools/block/typeset/mermaid/parse.d.ts +3 -0
  143. package/dist/tools/block/typeset/mermaid/render.d.ts +7 -0
  144. package/dist/tools/block/typeset/output.d.ts +46 -0
  145. package/dist/tools/block/updates/css.d.ts +6 -0
  146. package/dist/tools/block/updates/index.d.ts +13 -0
  147. package/dist/tools/block/updates/input.d.ts +14 -0
  148. package/dist/tools/block/updates/output.d.ts +19 -0
  149. package/dist/tools/block/video/css.d.ts +5 -0
  150. package/dist/tools/block/video/index.d.ts +13 -0
  151. package/dist/tools/block/video/input.d.ts +22 -0
  152. package/dist/tools/block/video/output.d.ts +9 -0
  153. package/dist/tools/index.d.ts +3 -0
  154. package/dist/tools/inline/bold/css.d.ts +3 -0
  155. package/dist/tools/inline/bold/index.d.ts +10 -0
  156. package/dist/tools/inline/code/css.d.ts +3 -0
  157. package/dist/tools/inline/code/index.d.ts +12 -0
  158. package/dist/tools/inline/italic/css.d.ts +3 -0
  159. package/dist/tools/inline/italic/index.d.ts +10 -0
  160. package/dist/tools/inline/link/css.d.ts +3 -0
  161. package/dist/tools/inline/link/dialog.d.ts +31 -0
  162. package/dist/tools/inline/link/index.d.ts +11 -0
  163. package/dist/tools/inline/marker/css.d.ts +3 -0
  164. package/dist/tools/inline/marker/index.d.ts +16 -0
  165. package/dist/tools/inline/mention/css.d.ts +3 -0
  166. package/dist/tools/inline/mention/index.d.ts +10 -0
  167. package/dist/tools/inline/status/css.d.ts +3 -0
  168. package/dist/tools/inline/status/dialog.d.ts +30 -0
  169. package/dist/tools/inline/status/index.d.ts +12 -0
  170. package/dist/tools/inline/strikethrough/css.d.ts +3 -0
  171. package/dist/tools/inline/strikethrough/index.d.ts +10 -0
  172. package/dist/tools/inline/tooltip/css.d.ts +3 -0
  173. package/dist/tools/inline/tooltip/dialog.d.ts +52 -0
  174. package/dist/tools/inline/tooltip/index.d.ts +21 -0
  175. package/dist/tools/inline/underline/css.d.ts +3 -0
  176. package/dist/tools/inline/underline/index.d.ts +10 -0
  177. package/dist/types.d.ts +947 -0
  178. package/dist/utils/dialogs/css.d.ts +3 -0
  179. package/dist/utils/dom.d.ts +20 -0
  180. package/dist/utils/icons.d.ts +7 -0
  181. package/dist/utils/platform.d.ts +82 -0
  182. package/dist/utils/sanitize-html-nodom.d.ts +2 -0
  183. package/dist/utils/switch/css.d.ts +3 -0
  184. package/dist/utils/switch/index.d.ts +30 -0
  185. package/dist/utils/tooltip/css.d.ts +3 -0
  186. package/dist/utils/tooltip/index.d.ts +4 -0
  187. package/dist/utils/url.d.ts +52 -0
  188. package/package.json +66 -0
@@ -0,0 +1,3 @@
1
+ export declare const stylesKey = "clepit-dialogs-styles";
2
+ export declare const style = "\n/* Dialog Overlay */\n/* A native <dialog>. showModal() puts it in the top layer and paints a real\n * ::backdrop, so the full-screen scrim, the z-index and the manual centring are\n * the browser's job now. The non-modal branch below keeps the old flex overlay\n * for a DOM without showModal, where the element is an ordinary block. */\n.clepit-dialog-overlay {\n border: none;\n padding: 0;\n background: transparent;\n max-width: none;\n max-height: none;\n}\n\n.clepit-dialog-overlay[open] {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.clepit-dialog-overlay::backdrop {\n background: rgba(0, 0, 0, 0.5);\n backdrop-filter: blur(2px);\n}\n\n/* Fallback: no showModal, so the element is not in the top layer and paints no\n * backdrop of its own. */\n.clepit-dialog-overlay:not([open]) {\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.5);\n align-items: center;\n justify-content: center;\n z-index: 10000;\n backdrop-filter: blur(2px);\n}\n\n/* Dialog Container */\n.clepit-dialog {\n background: var(--clepit-bg);\n border-radius: 8px;\n box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);\n padding: 24px;\n min-width: 400px;\n max-width: 500px;\n max-height: 80vh;\n overflow-y: auto;\n position: relative;\n transform: scale(0.95);\n opacity: 0;\n transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n.clepit-dialog--hidden {\n transform: scale(0.95);\n opacity: 0;\n}\n\n.clepit-dialog:not(.clepit-dialog--hidden) {\n transform: scale(1);\n opacity: 1;\n}\n\n/* Dialog Title */\n.clepit-dialog-title {\n margin: 0 0 20px 0;\n font-size: 18px;\n font-weight: 600;\n color: var(--clepit-text);\n text-align: center;\n}\n\n/* Dialog Group */\n.clepit-dialog-group {\n margin-bottom: 16px;\n}\n\n/* Dialog Label */\n.clepit-dialog-label {\n display: block;\n margin-bottom: 6px;\n font-size: 14px;\n font-weight: 500;\n color: var(--clepit-text);\n}\n\n/* Dialog Input */\n.clepit-dialog-input {\n width: 100%;\n padding: 10px 12px;\n border: 1px solid var(--clepit-border);\n border-radius: 6px;\n font-size: 14px;\n color: var(--clepit-text);\n background: var(--clepit-bg);\n transition: border-color 0.2s ease, box-shadow 0.2s ease;\n box-sizing: border-box;\n}\n\n.clepit-dialog-input:focus {\n outline: none;\n border-color: var(--clepit-primary);\n box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);\n}\n\n.clepit-dialog-input::placeholder {\n color: var(--clepit-text-subtle);\n}\n\n/* Dialog Buttons */\n.clepit-dialog-buttons {\n display: flex;\n gap: 12px;\n justify-content: flex-end;\n margin-top: 24px;\n}\n\n/* Dialog Button */\n.clepit-dialog-button {\n padding: 10px 20px;\n border: none;\n border-radius: 6px;\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: all 0.2s ease;\n min-width: 80px;\n}\n\n.clepit-dialog-button--cancel {\n background: var(--clepit-surface);\n color: var(--clepit-text);\n border: 1px solid var(--clepit-border);\n}\n\n.clepit-dialog-button--cancel:hover {\n background: var(--clepit-border);\n border-color: var(--clepit-text-subtle);\n}\n\n.clepit-dialog-button--save {\n background: var(--clepit-primary);\n color: white;\n}\n\n.clepit-dialog-button--save:hover {\n background: var(--clepit-primary);\n}\n\n.clepit-dialog-button--save:disabled {\n background: var(--clepit-text-subtle);\n cursor: not-allowed;\n}\n\n/* Responsive */\n@media (max-width: 640px) {\n .clepit-dialog {\n min-width: 320px;\n max-width: 90vw;\n margin: 20px;\n }\n\n .clepit-dialog-buttons {\n flex-direction: column;\n }\n\n .clepit-dialog-button {\n width: 100%;\n }\n}\n";
3
+ //# sourceMappingURL=css.d.ts.map
@@ -0,0 +1,20 @@
1
+ export declare function createElement<K extends keyof HTMLElementTagNameMap>(tag: K, className?: string, attributes?: Record<string, string>): HTMLElementTagNameMap[K];
2
+ export declare function createTextElement(text: string, className?: string): HTMLElement;
3
+ export declare function setContentEditable(element: HTMLElement, editable: boolean): void;
4
+ export declare function getSelection(): Selection | null;
5
+ export declare function getRange(): Range | null;
6
+ export declare function setRange(range: Range): void;
7
+ export declare function createRange(): Range;
8
+ export declare function getCaretPosition(element: HTMLElement): number;
9
+ export declare function setCaretPosition(element: HTMLElement, position: number): void;
10
+ export declare function generateId(): string;
11
+ export declare function generateElementId(containerId: string, suffix: string): string;
12
+ export declare function debounce<T extends (...args: any[]) => any>(func: T, wait: number): (...args: Parameters<T>) => void;
13
+ export declare function throttle<T extends (...args: any[]) => any>(func: T, limit: number): (...args: Parameters<T>) => void;
14
+ export declare function isEmptyHtml(html?: string): boolean;
15
+ /**
16
+ * Sanitizes HTML content to remove dangerous elements while preserving inline formatting
17
+ */
18
+ export declare function sanitizeHtml(html?: string): string;
19
+ export declare function isCaretAtBoundary(element: HTMLElement, direction: 'left' | 'right'): boolean;
20
+ //# sourceMappingURL=dom.d.ts.map
@@ -0,0 +1,7 @@
1
+ export declare const EDIT_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M12 20h9\"/><path d=\"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z\"/></svg>";
2
+ export declare const PREVIEW_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z\"/><circle cx=\"12\" cy=\"12\" r=\"3\"/></svg>";
3
+ export declare const JSON_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z\"/><polyline points=\"14,2 14,8 20,8\"/><line x1=\"16\" y1=\"13\" x2=\"8\" y2=\"13\"/><line x1=\"16\" y1=\"17\" x2=\"8\" y2=\"17\"/><polyline points=\"10,9 9,9 8,9\"/></svg>";
4
+ export declare const COPY_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><rect x=\"9\" y=\"9\" width=\"13\" height=\"13\" rx=\"2\" ry=\"2\"/><path d=\"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1\"/></svg>";
5
+ export declare const DOWNLOAD_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\"/><polyline points=\"7,10 12,15 17,10\"/><line x1=\"12\" y1=\"15\" x2=\"12\" y2=\"3\"/></svg>";
6
+ export declare const CLEAR_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M3 6h18\"/><path d=\"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6\"/><path d=\"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2\"/><line x1=\"10\" y1=\"11\" x2=\"10\" y2=\"17\"/><line x1=\"14\" y1=\"11\" x2=\"14\" y2=\"17\"/></svg>";
7
+ //# sourceMappingURL=icons.d.ts.map
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Platform detection and keyboard symbol utilities
3
+ */
4
+ export type Platform = 'mac' | 'windows' | 'linux' | 'unknown';
5
+ /**
6
+ * Detect the user's operating system
7
+ */
8
+ export declare function detectPlatform(): Platform;
9
+ /**
10
+ * Get the command/control key symbol for the current platform
11
+ */
12
+ export declare function getCmdSymbol(): string;
13
+ /**
14
+ * Get the shift key symbol for the current platform
15
+ */
16
+ export declare function getShiftSymbol(): string;
17
+ /**
18
+ * Get the option/alt key symbol for the current platform
19
+ */
20
+ export declare function getOptionSymbol(): string;
21
+ /**
22
+ * Get the backspace key symbol for the current platform
23
+ */
24
+ export declare function getBackspaceSymbol(): string;
25
+ /**
26
+ * Get the delete key symbol for the current platform
27
+ */
28
+ export declare function getDeleteSymbol(): string;
29
+ /**
30
+ * Get the arrow key symbols
31
+ */
32
+ export declare function getArrowSymbols(): {
33
+ down: string;
34
+ left: string;
35
+ right: string;
36
+ up: string;
37
+ };
38
+ /**
39
+ * Format a keyboard shortcut for display
40
+ */
41
+ export declare function formatShortcut(keys: string[]): string;
42
+ /**
43
+ * Common shortcut builders
44
+ */
45
+ export declare const Shortcuts: {
46
+ cmd: (key: string) => string;
47
+ cmdA: () => string;
48
+ cmdArrow: (direction: "up" | "down" | "left" | "right") => string;
49
+ cmdB: () => string;
50
+ cmdBackspace: () => string;
51
+ cmdC: () => string;
52
+ cmdD: () => string;
53
+ cmdDelete: () => string;
54
+ cmdF: () => string;
55
+ cmdG: () => string;
56
+ cmdH: () => string;
57
+ cmdI: () => string;
58
+ cmdJ: () => string;
59
+ cmdK: () => string;
60
+ cmdL: () => string;
61
+ cmdM: () => string;
62
+ cmdN: () => string;
63
+ cmdO: () => string;
64
+ cmdOption: (key: string) => string;
65
+ cmdP: () => string;
66
+ cmdQ: () => string;
67
+ cmdR: () => string;
68
+ cmdS: () => string;
69
+ cmdShift: (key: string) => string;
70
+ cmdShiftArrow: (direction: "up" | "down" | "left" | "right") => string;
71
+ cmdShiftBackspace: () => string;
72
+ cmdShiftOption: (key: string) => string;
73
+ cmdShiftZ: () => string;
74
+ cmdT: () => string;
75
+ cmdU: () => string;
76
+ cmdV: () => string;
77
+ cmdW: () => string;
78
+ cmdX: () => string;
79
+ cmdY: () => string;
80
+ cmdZ: () => string;
81
+ };
82
+ //# sourceMappingURL=platform.d.ts.map
@@ -0,0 +1,2 @@
1
+ export declare const sanitizeHtmlWithoutDom: (html?: string) => string;
2
+ //# sourceMappingURL=sanitize-html-nodom.d.ts.map
@@ -0,0 +1,3 @@
1
+ export declare const switchStylesKey = "clepit-custom-switch-styles";
2
+ export declare const switchStyle: string;
3
+ //# sourceMappingURL=css.d.ts.map
@@ -0,0 +1,30 @@
1
+ import { EditorClassNames, EditorStyles } from '../../types';
2
+ export interface SwitchConfig {
3
+ checked?: boolean;
4
+ onToggle?: (checked: boolean) => void;
5
+ classNames?: EditorClassNames['switch'];
6
+ styles?: EditorStyles['switch'];
7
+ label?: string;
8
+ id?: string;
9
+ }
10
+ export declare class Switch {
11
+ /**
12
+ * Create a switch component
13
+ * @param config - Switch configuration
14
+ * @returns HTMLDivElement containing the switch
15
+ */
16
+ static create(config?: SwitchConfig): HTMLElement;
17
+ /**
18
+ * Get the current state of the switch
19
+ * @param element - The switch element
20
+ * @returns boolean indicating if the switch is checked
21
+ */
22
+ static getState(element: HTMLElement): boolean;
23
+ /**
24
+ * Set the state of a switch
25
+ * @param element - The switch element
26
+ * @param checked - Whether the switch should be checked
27
+ */
28
+ static setState(element: HTMLElement, checked: boolean): void;
29
+ }
30
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,3 @@
1
+ export declare const tooltipStylesKey = "clepit-inline-tooltip-styles";
2
+ export declare const tooltipStyle = "\n/* Inline Tooltip Container */\n.clepit-inline-tooltip {\n position: fixed;\n z-index: 9999;\n pointer-events: none;\n opacity: 0;\n transition: opacity 0.2s ease-in-out;\n}\n\n/* Tooltip Content */\n.clepit-inline-tooltip-content {\n background: var(--clepit-text);\n color: var(--clepit-bg);\n padding: 6px 10px;\n border-radius: 6px;\n font-size: 12px;\n font-weight: 500;\n white-space: nowrap;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);\n transform: translateY(8px);\n transition: transform 0.2s ease-in-out;\n position: relative;\n}\n\n/* Tooltip Arrow */\n.clepit-inline-tooltip-arrow {\n position: absolute;\n width: 0;\n height: 0;\n}\n\n/* Arrow pointing down (when tooltip is above target) */\n.clepit-inline-tooltip-arrow--above {\n top: 100%;\n left: 50%;\n transform: translateX(-50%);\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n border-top: 6px solid var(--clepit-text);\n}\n\n/* Arrow pointing up (when tooltip is below target) */\n.clepit-inline-tooltip-arrow--below {\n bottom: 100%;\n left: 50%;\n transform: translateX(-50%);\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n border-bottom: 6px solid var(--clepit-text);\n}\n";
3
+ //# sourceMappingURL=css.d.ts.map
@@ -0,0 +1,4 @@
1
+ import { EditorClassNames, EditorStyles } from '../../types';
2
+ export type TooltipPosition = 'above' | 'below';
3
+ export declare function attachTooltip(target: HTMLElement, text: string, position?: TooltipPosition, classNames?: EditorClassNames['tooltips'], styles?: EditorStyles['tooltips']): void;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,52 @@
1
+ /**
2
+ * URL detection and validation utilities for the editor
3
+ */
4
+ export interface URLInfo {
5
+ isUrl: boolean;
6
+ isImage: boolean;
7
+ isVideo: boolean;
8
+ isYouTube: boolean;
9
+ isVimeo: boolean;
10
+ url: string;
11
+ }
12
+ /**
13
+ * Check if a string is a valid URL
14
+ */
15
+ export declare function isValidUrl(text: string): boolean;
16
+ /**
17
+ * Check if a URL is an image based on file extension
18
+ */
19
+ export declare function isImageUrl(url: string): boolean;
20
+ /**
21
+ * Check if a URL is a video based on file extension
22
+ */
23
+ export declare function isVideoUrl(url: string): boolean;
24
+ /**
25
+ * Check if a URL is a YouTube video
26
+ */
27
+ export declare function isYouTubeUrl(url: string): boolean;
28
+ /**
29
+ * Check if a URL is a Vimeo video
30
+ */
31
+ export declare function isVimeoUrl(url: string): boolean;
32
+ /**
33
+ * Extract YouTube video ID from URL
34
+ */
35
+ export declare function extractYouTubeId(url: string): string | null;
36
+ /**
37
+ * Extract Vimeo video ID from URL
38
+ */
39
+ export declare function extractVimeoId(url: string): string | null;
40
+ /**
41
+ * Convert YouTube URL to embed URL
42
+ */
43
+ export declare function convertYouTubeToEmbed(url: string): string | null;
44
+ /**
45
+ * Convert Vimeo URL to embed URL
46
+ */
47
+ export declare function convertVimeoToEmbed(url: string): string | null;
48
+ /**
49
+ * Analyze a text string to determine if it's a URL and what type
50
+ */
51
+ export declare function analyzeUrl(text: string): URLInfo;
52
+ //# sourceMappingURL=url.d.ts.map
package/package.json ADDED
@@ -0,0 +1,66 @@
1
+ {
2
+ "author": "Bomdisoft",
3
+ "dependencies": {},
4
+ "description": "A block-style editor with built-in plugins and renderer",
5
+ "devDependencies": {
6
+ "@bomdisoft/store": "0.0.0",
7
+ "@bomdisoft/typescript-config": "0.0.0",
8
+ "@happy-dom/global-registrator": "^20.10.3",
9
+ "@types/bun": "^1.3.14",
10
+ "terser": "^5.48.0",
11
+ "vite": "^8.0.16",
12
+ "vite-plugin-dts": "^5.0.2"
13
+ },
14
+ "exports": {
15
+ ".": {
16
+ "import": "./dist/index.mjs",
17
+ "require": "./dist/index.js",
18
+ "types": "./dist/index.d.ts"
19
+ }
20
+ },
21
+ "files": [
22
+ "dist",
23
+ "!dist/**/*.map",
24
+ "CHANGELOG.md",
25
+ "LICENSE",
26
+ "README.md"
27
+ ],
28
+ "homepage": "https://clepit.com",
29
+ "keywords": [
30
+ "editor",
31
+ "block-editor",
32
+ "wysiwyg",
33
+ "typescript",
34
+ "react",
35
+ "vue",
36
+ "vanilla",
37
+ "json",
38
+ "framework-agnostic"
39
+ ],
40
+ "license": "MIT",
41
+ "main": "dist/index.js",
42
+ "module": "dist/index.mjs",
43
+ "name": "@clepit/core",
44
+ "publishConfig": {
45
+ "access": "public"
46
+ },
47
+ "scripts": {
48
+ "build": "vite build",
49
+ "check": "biome check",
50
+ "dev": "vite",
51
+ "format": "biome format --write",
52
+ "lint": "biome lint && bun run scripts/check-draw-paths.ts",
53
+ "lint:draw-paths": "bun run scripts/check-draw-paths.ts",
54
+ "lint:fix": "biome lint --fix",
55
+ "lint:fix:unsafe": "biome lint --fix --unsafe",
56
+ "preview": "vite preview",
57
+ "test": "bun test test --isolate --pass-with-no-tests && bun run scripts/draw-without-a-browser.ts",
58
+ "test:coverage": "bun test test --isolate --coverage --pass-with-no-tests",
59
+ "test:nodom": "bun run scripts/draw-without-a-browser.ts",
60
+ "test:unit": "bun test test --isolate --pass-with-no-tests && bun run scripts/draw-without-a-browser.ts",
61
+ "test:watch": "bun test test --isolate --watch --pass-with-no-tests",
62
+ "typecheck": "tsc --noEmit -p tsconfig.typecheck.json"
63
+ },
64
+ "types": "dist/index.d.ts",
65
+ "version": "0.2.0-beta.322"
66
+ }