@primeui/texteditor-core 0.0.1-alpha.1

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 (166) hide show
  1. package/LICENSE +23 -0
  2. package/README.md +1 -0
  3. package/dist/chunk-22B454VC.mjs +83 -0
  4. package/dist/chunk-22B454VC.mjs.map +1 -0
  5. package/dist/chunk-3RKMABZR.mjs +320 -0
  6. package/dist/chunk-3RKMABZR.mjs.map +1 -0
  7. package/dist/chunk-6GY64GPU.mjs +18 -0
  8. package/dist/chunk-6GY64GPU.mjs.map +1 -0
  9. package/dist/chunk-6YDCG63C.mjs +833 -0
  10. package/dist/chunk-6YDCG63C.mjs.map +1 -0
  11. package/dist/chunk-6ZN5XRH2.mjs +45 -0
  12. package/dist/chunk-6ZN5XRH2.mjs.map +1 -0
  13. package/dist/chunk-72T5I4O4.mjs +76 -0
  14. package/dist/chunk-72T5I4O4.mjs.map +1 -0
  15. package/dist/chunk-7QCHSEN2.mjs +16 -0
  16. package/dist/chunk-7QCHSEN2.mjs.map +1 -0
  17. package/dist/chunk-AJOKUIQD.mjs +33 -0
  18. package/dist/chunk-AJOKUIQD.mjs.map +1 -0
  19. package/dist/chunk-AUTGNC2Q.mjs +197 -0
  20. package/dist/chunk-AUTGNC2Q.mjs.map +1 -0
  21. package/dist/chunk-CRAB2MFE.mjs +19 -0
  22. package/dist/chunk-CRAB2MFE.mjs.map +1 -0
  23. package/dist/chunk-DXPG5XMX.mjs +18 -0
  24. package/dist/chunk-DXPG5XMX.mjs.map +1 -0
  25. package/dist/chunk-E2KXUP3F.mjs +9 -0
  26. package/dist/chunk-E2KXUP3F.mjs.map +1 -0
  27. package/dist/chunk-EA2YI7LA.mjs +23 -0
  28. package/dist/chunk-EA2YI7LA.mjs.map +1 -0
  29. package/dist/chunk-F7BJWPT6.mjs +401 -0
  30. package/dist/chunk-F7BJWPT6.mjs.map +1 -0
  31. package/dist/chunk-FFCQLWS5.mjs +32 -0
  32. package/dist/chunk-FFCQLWS5.mjs.map +1 -0
  33. package/dist/chunk-GG56GLXC.mjs +42 -0
  34. package/dist/chunk-GG56GLXC.mjs.map +1 -0
  35. package/dist/chunk-GGPBV4BM.mjs +37 -0
  36. package/dist/chunk-GGPBV4BM.mjs.map +1 -0
  37. package/dist/chunk-H3RFOYCT.mjs +27 -0
  38. package/dist/chunk-H3RFOYCT.mjs.map +1 -0
  39. package/dist/chunk-IUQKSDKG.mjs +23 -0
  40. package/dist/chunk-IUQKSDKG.mjs.map +1 -0
  41. package/dist/chunk-J5LGTIGS.mjs +9 -0
  42. package/dist/chunk-J5LGTIGS.mjs.map +1 -0
  43. package/dist/chunk-KNZAMA6H.mjs +198 -0
  44. package/dist/chunk-KNZAMA6H.mjs.map +1 -0
  45. package/dist/chunk-MNKMKFLQ.mjs +27 -0
  46. package/dist/chunk-MNKMKFLQ.mjs.map +1 -0
  47. package/dist/chunk-MWT5PK3Z.mjs +52 -0
  48. package/dist/chunk-MWT5PK3Z.mjs.map +1 -0
  49. package/dist/chunk-NWRVBNBW.mjs +65 -0
  50. package/dist/chunk-NWRVBNBW.mjs.map +1 -0
  51. package/dist/chunk-OGEMGWLR.mjs +180 -0
  52. package/dist/chunk-OGEMGWLR.mjs.map +1 -0
  53. package/dist/chunk-PRFYR67X.mjs +60 -0
  54. package/dist/chunk-PRFYR67X.mjs.map +1 -0
  55. package/dist/chunk-PT2O4RV7.mjs +143 -0
  56. package/dist/chunk-PT2O4RV7.mjs.map +1 -0
  57. package/dist/chunk-PT5V6UYE.mjs +10 -0
  58. package/dist/chunk-PT5V6UYE.mjs.map +1 -0
  59. package/dist/chunk-RH45QRSV.mjs +26 -0
  60. package/dist/chunk-RH45QRSV.mjs.map +1 -0
  61. package/dist/chunk-RQ2HHNI6.mjs +55 -0
  62. package/dist/chunk-RQ2HHNI6.mjs.map +1 -0
  63. package/dist/chunk-TB7ZSSR2.mjs +6 -0
  64. package/dist/chunk-TB7ZSSR2.mjs.map +1 -0
  65. package/dist/chunk-TBQVZVKA.mjs +1891 -0
  66. package/dist/chunk-TBQVZVKA.mjs.map +1 -0
  67. package/dist/chunk-VWGQMUPD.mjs +182 -0
  68. package/dist/chunk-VWGQMUPD.mjs.map +1 -0
  69. package/dist/chunk-XKY2VYPW.mjs +26 -0
  70. package/dist/chunk-XKY2VYPW.mjs.map +1 -0
  71. package/dist/chunk-XSVIGDQR.mjs +22 -0
  72. package/dist/chunk-XSVIGDQR.mjs.map +1 -0
  73. package/dist/chunk-YHMP6AN3.mjs +231 -0
  74. package/dist/chunk-YHMP6AN3.mjs.map +1 -0
  75. package/dist/commands/index.d.mts +13 -0
  76. package/dist/commands/index.mjs +13 -0
  77. package/dist/commands/index.mjs.map +1 -0
  78. package/dist/createTextEditor.d.mts +7 -0
  79. package/dist/createTextEditor.mjs +31 -0
  80. package/dist/createTextEditor.mjs.map +1 -0
  81. package/dist/index.d.mts +17 -0
  82. package/dist/index.mjs +45 -0
  83. package/dist/index.mjs.map +1 -0
  84. package/dist/plugins/columnWidthPin.d.mts +5 -0
  85. package/dist/plugins/columnWidthPin.mjs +4 -0
  86. package/dist/plugins/columnWidthPin.mjs.map +1 -0
  87. package/dist/plugins/contextToolbar.d.mts +9 -0
  88. package/dist/plugins/contextToolbar.mjs +5 -0
  89. package/dist/plugins/contextToolbar.mjs.map +1 -0
  90. package/dist/plugins/defineTextEditorPlugin.d.mts +20 -0
  91. package/dist/plugins/defineTextEditorPlugin.mjs +4 -0
  92. package/dist/plugins/defineTextEditorPlugin.mjs.map +1 -0
  93. package/dist/plugins/inputRules.d.mts +14 -0
  94. package/dist/plugins/inputRules.mjs +8 -0
  95. package/dist/plugins/inputRules.mjs.map +1 -0
  96. package/dist/plugins/keymap.d.mts +16 -0
  97. package/dist/plugins/keymap.mjs +6 -0
  98. package/dist/plugins/keymap.mjs.map +1 -0
  99. package/dist/plugins/mention.d.mts +24 -0
  100. package/dist/plugins/mention.mjs +5 -0
  101. package/dist/plugins/mention.mjs.map +1 -0
  102. package/dist/plugins/mentionController.d.mts +16 -0
  103. package/dist/plugins/mentionController.mjs +4 -0
  104. package/dist/plugins/mentionController.mjs.map +1 -0
  105. package/dist/plugins/placeholder.d.mts +9 -0
  106. package/dist/plugins/placeholder.mjs +5 -0
  107. package/dist/plugins/placeholder.mjs.map +1 -0
  108. package/dist/plugins/registry.d.mts +7 -0
  109. package/dist/plugins/registry.mjs +4 -0
  110. package/dist/plugins/registry.mjs.map +1 -0
  111. package/dist/plugins/selectionHighlight.d.mts +14 -0
  112. package/dist/plugins/selectionHighlight.mjs +5 -0
  113. package/dist/plugins/selectionHighlight.mjs.map +1 -0
  114. package/dist/plugins/slashCommands.d.mts +28 -0
  115. package/dist/plugins/slashCommands.mjs +5 -0
  116. package/dist/plugins/slashCommands.mjs.map +1 -0
  117. package/dist/plugins/tableOverlay.d.mts +15 -0
  118. package/dist/plugins/tableOverlay.mjs +6 -0
  119. package/dist/plugins/tableOverlay.mjs.map +1 -0
  120. package/dist/plugins/trailingNode.d.mts +6 -0
  121. package/dist/plugins/trailingNode.mjs +4 -0
  122. package/dist/plugins/trailingNode.mjs.map +1 -0
  123. package/dist/position-DbkbTrFL.d.mts +50 -0
  124. package/dist/schema/index.d.mts +89 -0
  125. package/dist/schema/index.mjs +8 -0
  126. package/dist/schema/index.mjs.map +1 -0
  127. package/dist/serialization/index.d.mts +8 -0
  128. package/dist/serialization/index.mjs +5 -0
  129. package/dist/serialization/index.mjs.map +1 -0
  130. package/dist/texteditor.classes.d.mts +34 -0
  131. package/dist/texteditor.classes.mjs +4 -0
  132. package/dist/texteditor.classes.mjs.map +1 -0
  133. package/dist/texteditor.constants.d.mts +36 -0
  134. package/dist/texteditor.constants.mjs +4 -0
  135. package/dist/texteditor.constants.mjs.map +1 -0
  136. package/dist/texteditor.props.d.mts +5 -0
  137. package/dist/texteditor.props.mjs +4 -0
  138. package/dist/texteditor.props.mjs.map +1 -0
  139. package/dist/texteditor.refs.d.mts +5 -0
  140. package/dist/texteditor.refs.mjs +4 -0
  141. package/dist/texteditor.refs.mjs.map +1 -0
  142. package/dist/texteditor.state.d.mts +5 -0
  143. package/dist/texteditor.state.mjs +4 -0
  144. package/dist/texteditor.state.mjs.map +1 -0
  145. package/dist/ui/focus.d.mts +5 -0
  146. package/dist/ui/focus.mjs +4 -0
  147. package/dist/ui/focus.mjs.map +1 -0
  148. package/dist/ui/index.d.mts +6 -0
  149. package/dist/ui/index.mjs +9 -0
  150. package/dist/ui/index.mjs.map +1 -0
  151. package/dist/ui/keyboard.d.mts +4 -0
  152. package/dist/ui/keyboard.mjs +4 -0
  153. package/dist/ui/keyboard.mjs.map +1 -0
  154. package/dist/ui/menu.d.mts +10 -0
  155. package/dist/ui/menu.mjs +4 -0
  156. package/dist/ui/menu.mjs.map +1 -0
  157. package/dist/ui/positioning.d.mts +30 -0
  158. package/dist/ui/positioning.mjs +5 -0
  159. package/dist/ui/positioning.mjs.map +1 -0
  160. package/dist/ui/scroll.d.mts +6 -0
  161. package/dist/ui/scroll.mjs +4 -0
  162. package/dist/ui/scroll.mjs.map +1 -0
  163. package/dist/utils/index.d.mts +18 -0
  164. package/dist/utils/index.mjs +18 -0
  165. package/dist/utils/index.mjs.map +1 -0
  166. package/package.json +73 -0
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Public, named constants — exported from `@primeui/texteditor-core` and
3
+ * re-exported by every framework adapter. Demos and customer code should
4
+ * use these instead of inline magic numbers so call sites stay readable
5
+ * and the units of measure are obvious from the identifier.
6
+ */
7
+ /**
8
+ * File-size constants in bytes. Use these for `:maxFileSize` on
9
+ * `<TextEditor.ImageUpload>` and `<TextEditor.DocumentUpload>`.
10
+ */
11
+ declare const TEXT_EDITOR_FILE_SIZE: {
12
+ readonly ONE_MB: number;
13
+ readonly TWO_MB: number;
14
+ readonly THREE_MB: number;
15
+ readonly FOUR_MB: number;
16
+ readonly FIVE_MB: number;
17
+ readonly SIX_MB: number;
18
+ readonly SEVEN_MB: number;
19
+ readonly EIGHT_MB: number;
20
+ readonly NINE_MB: number;
21
+ readonly TEN_MB: number;
22
+ readonly TWENTY_FIVE_MB: number;
23
+ readonly FIFTY_MB: number;
24
+ };
25
+ /**
26
+ * Default upload allow-lists. Override these per-instance via
27
+ * `:allowedTypes` when the application has stricter or laxer rules.
28
+ */
29
+ declare const TEXT_EDITOR_ALLOWED_TYPES: {
30
+ readonly IMAGES_ANY: "image/*";
31
+ readonly IMAGES_COMMON: "image/jpeg,image/png,image/gif,image/webp";
32
+ readonly DOCUMENTS_OFFICE: ".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt,.csv,.zip";
33
+ readonly DOCUMENTS_PDF_ONLY: ".pdf";
34
+ };
35
+
36
+ export { TEXT_EDITOR_ALLOWED_TYPES, TEXT_EDITOR_FILE_SIZE };
@@ -0,0 +1,4 @@
1
+ export { TEXT_EDITOR_ALLOWED_TYPES, TEXT_EDITOR_FILE_SIZE } from './chunk-H3RFOYCT.mjs';
2
+ import './chunk-J5LGTIGS.mjs';
3
+ //# sourceMappingURL=texteditor.constants.mjs.map
4
+ //# sourceMappingURL=texteditor.constants.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"texteditor.constants.mjs"}
@@ -0,0 +1,5 @@
1
+ import { TextEditorProps } from '@primeui/texteditor-types';
2
+
3
+ declare const defaultTextEditorProps: TextEditorProps;
4
+
5
+ export { defaultTextEditorProps };
@@ -0,0 +1,4 @@
1
+ export { defaultTextEditorProps } from './chunk-AJOKUIQD.mjs';
2
+ import './chunk-J5LGTIGS.mjs';
3
+ //# sourceMappingURL=texteditor.props.mjs.map
4
+ //# sourceMappingURL=texteditor.props.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"texteditor.props.mjs"}
@@ -0,0 +1,5 @@
1
+ import { TextEditorRefs } from '@primeui/texteditor-types';
2
+
3
+ declare const defaultTextEditorRefs: TextEditorRefs;
4
+
5
+ export { defaultTextEditorRefs };
@@ -0,0 +1,4 @@
1
+ export { defaultTextEditorRefs } from './chunk-E2KXUP3F.mjs';
2
+ import './chunk-J5LGTIGS.mjs';
3
+ //# sourceMappingURL=texteditor.refs.mjs.map
4
+ //# sourceMappingURL=texteditor.refs.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"texteditor.refs.mjs"}
@@ -0,0 +1,5 @@
1
+ import { TextEditorState } from '@primeui/texteditor-types';
2
+
3
+ declare const defaultTextEditorState: TextEditorState;
4
+
5
+ export { defaultTextEditorState };
@@ -0,0 +1,4 @@
1
+ export { defaultTextEditorState } from './chunk-PT5V6UYE.mjs';
2
+ import './chunk-J5LGTIGS.mjs';
3
+ //# sourceMappingURL=texteditor.state.mjs.map
4
+ //# sourceMappingURL=texteditor.state.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"texteditor.state.mjs"}
@@ -0,0 +1,5 @@
1
+ declare function isClickOutside(target: Node, popoverEl: HTMLElement | null, triggerEl: HTMLElement | null, submenuSelector: string): boolean;
2
+ declare function isMouseLeavingBlockArea(relatedTarget: Element | null, blockClassName: string): boolean;
3
+ declare function setRovingTabindex(items: HTMLElement[], activeEl: HTMLElement | null): void;
4
+
5
+ export { isClickOutside, isMouseLeavingBlockArea, setRovingTabindex };
@@ -0,0 +1,4 @@
1
+ export { isClickOutside, isMouseLeavingBlockArea, setRovingTabindex } from '../chunk-XSVIGDQR.mjs';
2
+ import '../chunk-J5LGTIGS.mjs';
3
+ //# sourceMappingURL=focus.mjs.map
4
+ //# sourceMappingURL=focus.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"focus.mjs"}
@@ -0,0 +1,6 @@
1
+ export { AnchorRect, PopoverPositionOpts, Size, Viewport, computePopoverPosition, computeSubmenuPosition } from './positioning.mjs';
2
+ export { computeArrowNavIndex, computeFocusTrapTarget } from './keyboard.mjs';
3
+ export { assignActiveDescendantId, filterMenuItemsByText, getVisibleMenuItems } from './menu.mjs';
4
+ export { isClickOutside, isMouseLeavingBlockArea, setRovingTabindex } from './focus.mjs';
5
+ export { computeEdgeScrollSpeed } from './scroll.mjs';
6
+ export { c as clampToViewport } from '../position-DbkbTrFL.mjs';
@@ -0,0 +1,9 @@
1
+ export { isClickOutside, isMouseLeavingBlockArea, setRovingTabindex } from '../chunk-XSVIGDQR.mjs';
2
+ export { computeEdgeScrollSpeed } from '../chunk-DXPG5XMX.mjs';
3
+ export { computePopoverPosition, computeSubmenuPosition } from '../chunk-FFCQLWS5.mjs';
4
+ export { assignActiveDescendantId, filterMenuItemsByText, getVisibleMenuItems } from '../chunk-RH45QRSV.mjs';
5
+ export { computeArrowNavIndex, computeFocusTrapTarget } from '../chunk-CRAB2MFE.mjs';
6
+ export { clampToViewport } from '../chunk-22B454VC.mjs';
7
+ import '../chunk-J5LGTIGS.mjs';
8
+ //# sourceMappingURL=index.mjs.map
9
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.mjs"}
@@ -0,0 +1,4 @@
1
+ declare function computeArrowNavIndex(currentIdx: number, itemCount: number, dir: 'up' | 'down'): number;
2
+ declare function computeFocusTrapTarget(itemCount: number, focusedIdx: number, shift: boolean): number;
3
+
4
+ export { computeArrowNavIndex, computeFocusTrapTarget };
@@ -0,0 +1,4 @@
1
+ export { computeArrowNavIndex, computeFocusTrapTarget } from '../chunk-CRAB2MFE.mjs';
2
+ import '../chunk-J5LGTIGS.mjs';
3
+ //# sourceMappingURL=keyboard.mjs.map
4
+ //# sourceMappingURL=keyboard.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"keyboard.mjs"}
@@ -0,0 +1,10 @@
1
+ declare function getVisibleMenuItems(container: HTMLElement): HTMLElement[];
2
+ declare function filterMenuItemsByText(items: HTMLElement[], query: string): {
3
+ visible: HTMLElement[];
4
+ hiddenCount: number;
5
+ };
6
+ declare function assignActiveDescendantId(item: HTMLElement | null, idPrefix: string, counter: {
7
+ value: number;
8
+ }): string | null;
9
+
10
+ export { assignActiveDescendantId, filterMenuItemsByText, getVisibleMenuItems };
@@ -0,0 +1,4 @@
1
+ export { assignActiveDescendantId, filterMenuItemsByText, getVisibleMenuItems } from '../chunk-RH45QRSV.mjs';
2
+ import '../chunk-J5LGTIGS.mjs';
3
+ //# sourceMappingURL=menu.mjs.map
4
+ //# sourceMappingURL=menu.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"menu.mjs"}
@@ -0,0 +1,30 @@
1
+ export { c as clampToViewport } from '../position-DbkbTrFL.mjs';
2
+
3
+ interface Size {
4
+ width: number;
5
+ height: number;
6
+ }
7
+ interface Viewport {
8
+ width: number;
9
+ height: number;
10
+ }
11
+ interface AnchorRect {
12
+ top: number;
13
+ bottom: number;
14
+ left: number;
15
+ right: number;
16
+ }
17
+ interface PopoverPositionOpts {
18
+ margin: number;
19
+ isRtl: boolean;
20
+ }
21
+ declare function computePopoverPosition(anchor: AnchorRect, popoverSize: Size, viewport: Viewport, opts: PopoverPositionOpts): {
22
+ top: number;
23
+ left: number;
24
+ };
25
+ declare function computeSubmenuPosition(trigger: AnchorRect, popoverSize: Size, viewport: Viewport, opts: PopoverPositionOpts): {
26
+ top: number;
27
+ left: number;
28
+ };
29
+
30
+ export { type AnchorRect, type PopoverPositionOpts, type Size, type Viewport, computePopoverPosition, computeSubmenuPosition };
@@ -0,0 +1,5 @@
1
+ export { computePopoverPosition, computeSubmenuPosition } from '../chunk-FFCQLWS5.mjs';
2
+ export { clampToViewport } from '../chunk-22B454VC.mjs';
3
+ import '../chunk-J5LGTIGS.mjs';
4
+ //# sourceMappingURL=positioning.mjs.map
5
+ //# sourceMappingURL=positioning.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"positioning.mjs"}
@@ -0,0 +1,6 @@
1
+ declare function computeEdgeScrollSpeed(clientY: number, rect: {
2
+ top: number;
3
+ bottom: number;
4
+ }, threshold: number, maxSpeed: number): number;
5
+
6
+ export { computeEdgeScrollSpeed };
@@ -0,0 +1,4 @@
1
+ export { computeEdgeScrollSpeed } from '../chunk-DXPG5XMX.mjs';
2
+ import '../chunk-J5LGTIGS.mjs';
3
+ //# sourceMappingURL=scroll.mjs.map
4
+ //# sourceMappingURL=scroll.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"scroll.mjs"}
@@ -0,0 +1,18 @@
1
+ export { c as clampToViewport, a as computeBlockControlsStyle, b as computeDropIndicatorStyle, d as computeDropTargetIndex, i as inlineStartAbsolute, e as inlineStartFixed, s as setInlineStart } from '../position-DbkbTrFL.mjs';
2
+
3
+ /**
4
+ * Generate a short random ID suitable for unique element identification per editor instance.
5
+ */
6
+ declare function generateEditorId(): string;
7
+ /**
8
+ * Scroll the element matching `[data-active="true"]` inside the container into view.
9
+ * Used for popovers/menus that should reveal the active item when opened.
10
+ */
11
+ declare function scrollActiveItemIntoView(containerEl: HTMLElement | null): void;
12
+
13
+ declare function sanitizeUrl(url: string | null | undefined): string | null;
14
+ declare function sanitizeImageUrl(url: string | null | undefined): string | null;
15
+
16
+ declare function sanitizeCssValue(value: string | null | undefined): string | null;
17
+
18
+ export { generateEditorId, sanitizeCssValue, sanitizeImageUrl, sanitizeUrl, scrollActiveItemIntoView };
@@ -0,0 +1,18 @@
1
+ export { clampToViewport, computeBlockControlsStyle, computeDropIndicatorStyle, computeDropTargetIndex, inlineStartAbsolute, inlineStartFixed, setInlineStart } from '../chunk-22B454VC.mjs';
2
+ export { sanitizeCssValue } from '../chunk-7QCHSEN2.mjs';
3
+ export { sanitizeImageUrl, sanitizeUrl } from '../chunk-MNKMKFLQ.mjs';
4
+ import '../chunk-J5LGTIGS.mjs';
5
+
6
+ // src/utils/dom.ts
7
+ function generateEditorId() {
8
+ return Math.random().toString(36).slice(2, 10);
9
+ }
10
+ function scrollActiveItemIntoView(containerEl) {
11
+ if (!containerEl) return;
12
+ const activeItem = containerEl.querySelector('[data-active="true"]');
13
+ activeItem?.scrollIntoView({ block: "nearest" });
14
+ }
15
+
16
+ export { generateEditorId, scrollActiveItemIntoView };
17
+ //# sourceMappingURL=index.mjs.map
18
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/dom.ts"],"names":[],"mappings":";;;;;;AAGO,SAAS,gBAAA,GAA2B;AACvC,EAAA,OAAO,IAAA,CAAK,QAAO,CAAE,QAAA,CAAS,EAAE,CAAA,CAAE,KAAA,CAAM,GAAG,EAAE,CAAA;AACjD;AAMO,SAAS,yBAAyB,WAAA,EAAuC;AAC5E,EAAA,IAAI,CAAC,WAAA,EAAa;AAElB,EAAA,MAAM,UAAA,GAAa,WAAA,CAAY,aAAA,CAAc,sBAAsB,CAAA;AAEnE,EAAA,UAAA,EAAY,cAAA,CAAe,EAAE,KAAA,EAAO,SAAA,EAAW,CAAA;AACnD","file":"index.mjs","sourcesContent":["/**\n * Generate a short random ID suitable for unique element identification per editor instance.\n */\nexport function generateEditorId(): string {\n return Math.random().toString(36).slice(2, 10);\n}\n\n/**\n * Scroll the element matching `[data-active=\"true\"]` inside the container into view.\n * Used for popovers/menus that should reveal the active item when opened.\n */\nexport function scrollActiveItemIntoView(containerEl: HTMLElement | null): void {\n if (!containerEl) return;\n\n const activeItem = containerEl.querySelector('[data-active=\"true\"]') as HTMLElement | null;\n\n activeItem?.scrollIntoView({ block: 'nearest' });\n}\n"]}
package/package.json ADDED
@@ -0,0 +1,73 @@
1
+ {
2
+ "name": "@primeui/texteditor-core",
3
+ "version": "0.0.1-alpha.1",
4
+ "author": "PrimeTek Informatics",
5
+ "description": "TextEditor API for PrimeUI.",
6
+ "keywords": [
7
+ "texteditor",
8
+ "primeui"
9
+ ],
10
+ "license": "SEE LICENSE IN LICENSE.md",
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/primefaces/primeui.git",
14
+ "directory": "packages/components/texteditor/texteditor-core"
15
+ },
16
+ "bugs": {
17
+ "url": "https://github.com/primefaces/primeui/issues"
18
+ },
19
+ "main": "./dist/index.mjs",
20
+ "exports": {
21
+ ".": {
22
+ "types": "./dist/index.d.mts",
23
+ "import": "./dist/index.mjs",
24
+ "default": "./dist/index.mjs"
25
+ },
26
+ "./plugins/*": {
27
+ "types": "./dist/plugins/*.d.mts",
28
+ "import": "./dist/plugins/*.mjs",
29
+ "default": "./dist/plugins/*.mjs"
30
+ },
31
+ "./*": {
32
+ "types": "./dist/*/index.d.mts",
33
+ "import": "./dist/*/index.mjs",
34
+ "default": "./dist/*/index.mjs"
35
+ }
36
+ },
37
+ "publishConfig": {
38
+ "access": "public"
39
+ },
40
+ "sideEffects": false,
41
+ "files": [
42
+ "dist",
43
+ "README.md",
44
+ "LICENSE"
45
+ ],
46
+ "dependencies": {
47
+ "prosemirror-commands": "^1.7.1",
48
+ "prosemirror-dropcursor": "^1.8.2",
49
+ "prosemirror-gapcursor": "^1.4.1",
50
+ "prosemirror-history": "^1.5.0",
51
+ "prosemirror-inputrules": "^1.5.1",
52
+ "prosemirror-keymap": "^1.2.3",
53
+ "prosemirror-model": "^1.25.4",
54
+ "prosemirror-schema-list": "^1.5.1",
55
+ "prosemirror-state": "^1.4.4",
56
+ "prosemirror-tables": "^1.8.5",
57
+ "prosemirror-transform": "^1.12.0",
58
+ "prosemirror-view": "^1.41.7",
59
+ "@primeui/core": "0.0.1-alpha.1",
60
+ "@primeui/texteditor-types": "0.0.1-alpha.1"
61
+ },
62
+ "scripts": {
63
+ "build": "cross-env NODE_ENV=production INPUT_DIR=src/ OUTPUT_DIR=dist/ pnpm run build:package",
64
+ "build:dev": "cross-env NODE_ENV=development INPUT_DIR=src/ OUTPUT_DIR=dist/ pnpm run build:dev:package",
65
+ "build:package": "tsup",
66
+ "build:dev:package": "tsup --watch",
67
+ "type:check": "tsc --noEmit",
68
+ "test": "cross-env NODE_ENV=test pnpm --dir=../../../../ vitest run packages/components/texteditor/texteditor-core/src --environment jsdom",
69
+ "dev:link": "pnpm link --global && npm link"
70
+ },
71
+ "module": "./dist/index.mjs",
72
+ "types": "./dist/index.d.mts"
73
+ }