ckeditor5-blazor 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/dist/ckeditor5-blazor-error.d.ts +7 -0
  2. package/dist/ckeditor5-blazor-error.d.ts.map +1 -0
  3. package/dist/elements/context/context.d.ts +26 -0
  4. package/dist/elements/context/context.d.ts.map +1 -0
  5. package/dist/elements/context/contexts-registry.d.ts +9 -0
  6. package/dist/elements/context/contexts-registry.d.ts.map +1 -0
  7. package/dist/elements/context/index.d.ts +4 -0
  8. package/dist/elements/context/index.d.ts.map +1 -0
  9. package/dist/elements/context/typings.d.ts +34 -0
  10. package/dist/elements/context/typings.d.ts.map +1 -0
  11. package/dist/elements/editable.d.ts +34 -0
  12. package/dist/elements/editable.d.ts.map +1 -0
  13. package/dist/elements/editor/custom-editor-plugins.d.ts +54 -0
  14. package/dist/elements/editor/custom-editor-plugins.d.ts.map +1 -0
  15. package/dist/elements/editor/editor.d.ts +31 -0
  16. package/dist/elements/editor/editor.d.ts.map +1 -0
  17. package/dist/elements/editor/editors-registry.d.ts +9 -0
  18. package/dist/elements/editor/editors-registry.d.ts.map +1 -0
  19. package/dist/elements/editor/index.d.ts +3 -0
  20. package/dist/elements/editor/index.d.ts.map +1 -0
  21. package/dist/elements/editor/plugins/dispatch-editor-roots-change-event.d.ts +23 -0
  22. package/dist/elements/editor/plugins/dispatch-editor-roots-change-event.d.ts.map +1 -0
  23. package/dist/elements/editor/plugins/index.d.ts +3 -0
  24. package/dist/elements/editor/plugins/index.d.ts.map +1 -0
  25. package/dist/elements/editor/plugins/sync-editor-with-input.d.ts +6 -0
  26. package/dist/elements/editor/plugins/sync-editor-with-input.d.ts.map +1 -0
  27. package/dist/elements/editor/typings.d.ts +99 -0
  28. package/dist/elements/editor/typings.d.ts.map +1 -0
  29. package/dist/elements/editor/utils/create-editor-in-context.d.ts +44 -0
  30. package/dist/elements/editor/utils/create-editor-in-context.d.ts.map +1 -0
  31. package/dist/elements/editor/utils/get-editor-roots-values.d.ts +9 -0
  32. package/dist/elements/editor/utils/get-editor-roots-values.d.ts.map +1 -0
  33. package/dist/elements/editor/utils/index.d.ts +14 -0
  34. package/dist/elements/editor/utils/index.d.ts.map +1 -0
  35. package/dist/elements/editor/utils/is-single-root-editor.d.ts +9 -0
  36. package/dist/elements/editor/utils/is-single-root-editor.d.ts.map +1 -0
  37. package/dist/elements/editor/utils/load-editor-constructor.d.ts +9 -0
  38. package/dist/elements/editor/utils/load-editor-constructor.d.ts.map +1 -0
  39. package/dist/elements/editor/utils/load-editor-plugins.d.ts +20 -0
  40. package/dist/elements/editor/utils/load-editor-plugins.d.ts.map +1 -0
  41. package/dist/elements/editor/utils/load-editor-translations.d.ts +14 -0
  42. package/dist/elements/editor/utils/load-editor-translations.d.ts.map +1 -0
  43. package/dist/elements/editor/utils/normalize-custom-translations.d.ts +11 -0
  44. package/dist/elements/editor/utils/normalize-custom-translations.d.ts.map +1 -0
  45. package/dist/elements/editor/utils/query-all-editor-ids.d.ts +5 -0
  46. package/dist/elements/editor/utils/query-all-editor-ids.d.ts.map +1 -0
  47. package/dist/elements/editor/utils/query-editor-editables.d.ts +25 -0
  48. package/dist/elements/editor/utils/query-editor-editables.d.ts.map +1 -0
  49. package/dist/elements/editor/utils/resolve-editor-config-elements-references.d.ts +9 -0
  50. package/dist/elements/editor/utils/resolve-editor-config-elements-references.d.ts.map +1 -0
  51. package/dist/elements/editor/utils/resolve-editor-config-translations.d.ts +25 -0
  52. package/dist/elements/editor/utils/resolve-editor-config-translations.d.ts.map +1 -0
  53. package/dist/elements/editor/utils/set-editor-editable-height.d.ts +9 -0
  54. package/dist/elements/editor/utils/set-editor-editable-height.d.ts.map +1 -0
  55. package/dist/elements/editor/utils/wrap-with-watchdog.d.ts +24 -0
  56. package/dist/elements/editor/utils/wrap-with-watchdog.d.ts.map +1 -0
  57. package/dist/elements/ensure-editor-elements-registered.d.ts +5 -0
  58. package/dist/elements/ensure-editor-elements-registered.d.ts.map +1 -0
  59. package/dist/elements/index.d.ts +6 -0
  60. package/dist/elements/index.d.ts.map +1 -0
  61. package/dist/elements/ui-part.d.ts +18 -0
  62. package/dist/elements/ui-part.d.ts.map +1 -0
  63. package/dist/index.cjs +5 -0
  64. package/dist/index.cjs.map +1 -0
  65. package/dist/index.d.ts +11 -0
  66. package/dist/index.d.ts.map +1 -0
  67. package/dist/index.mjs +1400 -0
  68. package/dist/index.mjs.map +1 -0
  69. package/dist/interop/create-context-blazor-interop.d.ts +10 -0
  70. package/dist/interop/create-context-blazor-interop.d.ts.map +1 -0
  71. package/dist/interop/create-editable-blazor-interop.d.ts +21 -0
  72. package/dist/interop/create-editable-blazor-interop.d.ts.map +1 -0
  73. package/dist/interop/create-editor-blazor-interop.d.ts +19 -0
  74. package/dist/interop/create-editor-blazor-interop.d.ts.map +1 -0
  75. package/dist/interop/create-ui-part-blazor-interop.d.ts +10 -0
  76. package/dist/interop/create-ui-part-blazor-interop.d.ts.map +1 -0
  77. package/dist/interop/index.d.ts +5 -0
  78. package/dist/interop/index.d.ts.map +1 -0
  79. package/dist/interop/utils/create-editor-value-sync.d.ts +63 -0
  80. package/dist/interop/utils/create-editor-value-sync.d.ts.map +1 -0
  81. package/dist/interop/utils/index.d.ts +2 -0
  82. package/dist/interop/utils/index.d.ts.map +1 -0
  83. package/dist/shared/async-registry.d.ts +136 -0
  84. package/dist/shared/async-registry.d.ts.map +1 -0
  85. package/dist/shared/camel-case.d.ts +8 -0
  86. package/dist/shared/camel-case.d.ts.map +1 -0
  87. package/dist/shared/debounce.d.ts +2 -0
  88. package/dist/shared/debounce.d.ts.map +1 -0
  89. package/dist/shared/deep-camel-case-keys.d.ts +8 -0
  90. package/dist/shared/deep-camel-case-keys.d.ts.map +1 -0
  91. package/dist/shared/filter-object-values.d.ts +9 -0
  92. package/dist/shared/filter-object-values.d.ts.map +1 -0
  93. package/dist/shared/index.d.ts +16 -0
  94. package/dist/shared/index.d.ts.map +1 -0
  95. package/dist/shared/is-empty-object.d.ts +2 -0
  96. package/dist/shared/is-empty-object.d.ts.map +1 -0
  97. package/dist/shared/is-plain-object.d.ts +8 -0
  98. package/dist/shared/is-plain-object.d.ts.map +1 -0
  99. package/dist/shared/map-object-values.d.ts +11 -0
  100. package/dist/shared/map-object-values.d.ts.map +1 -0
  101. package/dist/shared/once.d.ts +2 -0
  102. package/dist/shared/once.d.ts.map +1 -0
  103. package/dist/shared/shallow-equal.d.ts +9 -0
  104. package/dist/shared/shallow-equal.d.ts.map +1 -0
  105. package/dist/shared/timeout.d.ts +8 -0
  106. package/dist/shared/timeout.d.ts.map +1 -0
  107. package/dist/shared/uid.d.ts +7 -0
  108. package/dist/shared/uid.d.ts.map +1 -0
  109. package/dist/shared/wait-for-dom-ready.d.ts +5 -0
  110. package/dist/shared/wait-for-dom-ready.d.ts.map +1 -0
  111. package/dist/shared/wait-for-interactive-attribute.d.ts +18 -0
  112. package/dist/shared/wait-for-interactive-attribute.d.ts.map +1 -0
  113. package/dist/shared/wait-for.d.ts +20 -0
  114. package/dist/shared/wait-for.d.ts.map +1 -0
  115. package/dist/types/can-be-promise.type.d.ts +2 -0
  116. package/dist/types/can-be-promise.type.d.ts.map +1 -0
  117. package/dist/types/dot-net-interop.type.d.ts +7 -0
  118. package/dist/types/dot-net-interop.type.d.ts.map +1 -0
  119. package/dist/types/index.d.ts +4 -0
  120. package/dist/types/index.d.ts.map +1 -0
  121. package/dist/types/required-by.type.d.ts +2 -0
  122. package/dist/types/required-by.type.d.ts.map +1 -0
  123. package/package.json +49 -0
  124. package/src/ckeditor5-blazor-error.ts +9 -0
  125. package/src/elements/context/context.test.ts +323 -0
  126. package/src/elements/context/context.ts +128 -0
  127. package/src/elements/context/contexts-registry.test.ts +10 -0
  128. package/src/elements/context/contexts-registry.ts +10 -0
  129. package/src/elements/context/index.ts +3 -0
  130. package/src/elements/context/typings.ts +38 -0
  131. package/src/elements/editable.test.ts +383 -0
  132. package/src/elements/editable.ts +183 -0
  133. package/src/elements/editor/custom-editor-plugins.test.ts +103 -0
  134. package/src/elements/editor/custom-editor-plugins.ts +85 -0
  135. package/src/elements/editor/editor.test.ts +562 -0
  136. package/src/elements/editor/editor.ts +330 -0
  137. package/src/elements/editor/editors-registry.test.ts +10 -0
  138. package/src/elements/editor/editors-registry.ts +10 -0
  139. package/src/elements/editor/index.ts +2 -0
  140. package/src/elements/editor/plugins/dispatch-editor-roots-change-event.ts +76 -0
  141. package/src/elements/editor/plugins/index.ts +2 -0
  142. package/src/elements/editor/plugins/sync-editor-with-input.ts +79 -0
  143. package/src/elements/editor/typings.ts +114 -0
  144. package/src/elements/editor/utils/create-editor-in-context.ts +89 -0
  145. package/src/elements/editor/utils/get-editor-roots-values.test.ts +48 -0
  146. package/src/elements/editor/utils/get-editor-roots-values.ts +21 -0
  147. package/src/elements/editor/utils/index.ts +13 -0
  148. package/src/elements/editor/utils/is-single-root-editor.test.ts +40 -0
  149. package/src/elements/editor/utils/is-single-root-editor.ts +11 -0
  150. package/src/elements/editor/utils/load-editor-constructor.test.ts +62 -0
  151. package/src/elements/editor/utils/load-editor-constructor.ts +29 -0
  152. package/src/elements/editor/utils/load-editor-plugins.test.ts +100 -0
  153. package/src/elements/editor/utils/load-editor-plugins.ts +72 -0
  154. package/src/elements/editor/utils/load-editor-translations.ts +232 -0
  155. package/src/elements/editor/utils/normalize-custom-translations.test.ts +152 -0
  156. package/src/elements/editor/utils/normalize-custom-translations.ts +17 -0
  157. package/src/elements/editor/utils/query-all-editor-ids.ts +9 -0
  158. package/src/elements/editor/utils/query-editor-editables.ts +101 -0
  159. package/src/elements/editor/utils/resolve-editor-config-elements-references.test.ts +93 -0
  160. package/src/elements/editor/utils/resolve-editor-config-elements-references.ts +36 -0
  161. package/src/elements/editor/utils/resolve-editor-config-translations.test.ts +131 -0
  162. package/src/elements/editor/utils/resolve-editor-config-translations.ts +77 -0
  163. package/src/elements/editor/utils/set-editor-editable-height.test.ts +131 -0
  164. package/src/elements/editor/utils/set-editor-editable-height.ts +15 -0
  165. package/src/elements/editor/utils/wrap-with-watchdog.test.ts +45 -0
  166. package/src/elements/editor/utils/wrap-with-watchdog.ts +51 -0
  167. package/src/elements/ensure-editor-elements-registered.ts +24 -0
  168. package/src/elements/index.ts +14 -0
  169. package/src/elements/ui-part.test.ts +156 -0
  170. package/src/elements/ui-part.ts +84 -0
  171. package/src/index.ts +15 -0
  172. package/src/interop/create-context-blazor-interop.test.ts +30 -0
  173. package/src/interop/create-context-blazor-interop.ts +15 -0
  174. package/src/interop/create-editable-blazor-interop.test.ts +213 -0
  175. package/src/interop/create-editable-blazor-interop.ts +98 -0
  176. package/src/interop/create-editor-blazor-interop.test.ts +183 -0
  177. package/src/interop/create-editor-blazor-interop.ts +112 -0
  178. package/src/interop/create-ui-part-blazor-interop.test.ts +30 -0
  179. package/src/interop/create-ui-part-blazor-interop.ts +15 -0
  180. package/src/interop/index.ts +4 -0
  181. package/src/interop/utils/create-editor-value-sync.test.ts +302 -0
  182. package/src/interop/utils/create-editor-value-sync.ts +160 -0
  183. package/src/interop/utils/index.ts +1 -0
  184. package/src/shared/async-registry.test.ts +737 -0
  185. package/src/shared/async-registry.ts +353 -0
  186. package/src/shared/camel-case.test.ts +35 -0
  187. package/src/shared/camel-case.ts +11 -0
  188. package/src/shared/debounce.test.ts +72 -0
  189. package/src/shared/debounce.ts +16 -0
  190. package/src/shared/deep-camel-case-keys.test.ts +34 -0
  191. package/src/shared/deep-camel-case-keys.ts +26 -0
  192. package/src/shared/filter-object-values.test.ts +25 -0
  193. package/src/shared/filter-object-values.ts +17 -0
  194. package/src/shared/index.ts +15 -0
  195. package/src/shared/is-empty-object.test.ts +78 -0
  196. package/src/shared/is-empty-object.ts +3 -0
  197. package/src/shared/is-plain-object.test.ts +38 -0
  198. package/src/shared/is-plain-object.ts +15 -0
  199. package/src/shared/map-object-values.test.ts +29 -0
  200. package/src/shared/map-object-values.ts +19 -0
  201. package/src/shared/once.test.ts +116 -0
  202. package/src/shared/once.ts +12 -0
  203. package/src/shared/shallow-equal.test.ts +51 -0
  204. package/src/shared/shallow-equal.ts +30 -0
  205. package/src/shared/timeout.test.ts +65 -0
  206. package/src/shared/timeout.ts +13 -0
  207. package/src/shared/uid.test.ts +25 -0
  208. package/src/shared/uid.ts +8 -0
  209. package/src/shared/wait-for-dom-ready.test.ts +87 -0
  210. package/src/shared/wait-for-dom-ready.ts +21 -0
  211. package/src/shared/wait-for-interactive-attribute.test.ts +93 -0
  212. package/src/shared/wait-for-interactive-attribute.ts +50 -0
  213. package/src/shared/wait-for.test.ts +24 -0
  214. package/src/shared/wait-for.ts +56 -0
  215. package/src/types/can-be-promise.type.ts +1 -0
  216. package/src/types/dot-net-interop.type.ts +6 -0
  217. package/src/types/dotnet-global.d.ts +14 -0
  218. package/src/types/index.ts +3 -0
  219. package/src/types/required-by.type.ts +1 -0
@@ -0,0 +1,136 @@
1
+ /**
2
+ * Generic async registry for objects with an async destroy method.
3
+ * Provides a way to register, unregister, and execute callbacks on objects by ID.
4
+ */
5
+ export declare class AsyncRegistry<T extends Destructible> {
6
+ /**
7
+ * Map of registered items.
8
+ */
9
+ private readonly items;
10
+ /**
11
+ * Map of initialization errors for items that failed to register.
12
+ */
13
+ private readonly initializationErrors;
14
+ /**
15
+ * Map of pending callbacks waiting for items to be registered or fail.
16
+ */
17
+ private readonly pendingCallbacks;
18
+ /**
19
+ * Set of watchers that observe changes to the registry.
20
+ */
21
+ private readonly watchers;
22
+ /**
23
+ * Executes a function on an item.
24
+ * If the item is not yet registered, it will wait for it to be registered.
25
+ *
26
+ * @param id The ID of the item.
27
+ * @param onSuccess The function to execute.
28
+ * @param onError Optional error callback.
29
+ * @returns A promise that resolves with the result of the function.
30
+ */
31
+ execute<R, E extends T = T>(id: RegistryId | null, onSuccess: (item: E) => R, onError?: (error: any) => void): Promise<Awaited<R>>;
32
+ /**
33
+ * Registers an item.
34
+ *
35
+ * @param id The ID of the item.
36
+ * @param item The item instance.
37
+ */
38
+ register(id: RegistryId | null, item: T): void;
39
+ /**
40
+ * Registers an error for an item.
41
+ *
42
+ * @param id The ID of the item.
43
+ * @param error The error to register.
44
+ */
45
+ error(id: RegistryId | null, error: any): void;
46
+ /**
47
+ * Resets errors for an item.
48
+ *
49
+ * @param id The ID of the item.
50
+ */
51
+ resetErrors(id: RegistryId | null): void;
52
+ /**
53
+ * Un-registers an item.
54
+ *
55
+ * @param id The ID of the item.
56
+ */
57
+ unregister(id: RegistryId | null): void;
58
+ /**
59
+ * Gets all registered items.
60
+ *
61
+ * @returns An array of all registered items.
62
+ */
63
+ getItems(): T[];
64
+ /**
65
+ * Checks if an item with the given ID is registered.
66
+ *
67
+ * @param id The ID of the item.
68
+ * @returns `true` if the item is registered, `false` otherwise.
69
+ */
70
+ hasItem(id: RegistryId | null): boolean;
71
+ /**
72
+ * Gets a promise that resolves with the item instance for the given ID.
73
+ * If the item is not registered yet, it will wait for it to be registered.
74
+ *
75
+ * @param id The ID of the item.
76
+ * @param timeout Optional timeout in milliseconds.
77
+ * @returns A promise that resolves with the item instance.
78
+ */
79
+ waitFor<E extends T = T>(id: RegistryId | null, timeout?: number): Promise<E>;
80
+ /**
81
+ * Destroys all registered items and clears the registry.
82
+ * This will call the `destroy` method on each item.
83
+ */
84
+ destroyAll(): Promise<void>;
85
+ /**
86
+ * Registers a watcher that will be called whenever the registry changes.
87
+ *
88
+ * @param watcher The watcher function to register.
89
+ * @returns A function to unregister the watcher.
90
+ */
91
+ watch(watcher: RegistryWatcher<T>): () => void;
92
+ /**
93
+ * Un-registers a watcher.
94
+ *
95
+ * @param watcher The watcher function to unregister.
96
+ */
97
+ unwatch(watcher: RegistryWatcher<T>): void;
98
+ /**
99
+ * Resets the registry by clearing all items, errors, and pending callbacks.
100
+ */
101
+ reset(): void;
102
+ /**
103
+ * Notifies all watchers about changes to the registry.
104
+ */
105
+ private notifyWatchers;
106
+ /**
107
+ * Gets or creates pending callbacks for a specific ID.
108
+ *
109
+ * @param id The ID of the item.
110
+ * @returns The pending callbacks structure.
111
+ */
112
+ private getPendingCallbacks;
113
+ /**
114
+ * Registers an item as the default (null ID) item if it's the first one.
115
+ *
116
+ * @param id The ID of the item being registered.
117
+ * @param item The item instance.
118
+ */
119
+ private registerAsDefault;
120
+ }
121
+ /**
122
+ * Interface for objects that can be destroyed.
123
+ */
124
+ export type Destructible = {
125
+ destroy: () => Promise<any>;
126
+ };
127
+ /**
128
+ * Identifier of the registry item.
129
+ */
130
+ type RegistryId = string;
131
+ /**
132
+ * Callback type for watching registry changes.
133
+ */
134
+ type RegistryWatcher<T> = (items: Map<RegistryId | null, T>, errors: Map<RegistryId | null, Error>) => void;
135
+ export {};
136
+ //# sourceMappingURL=async-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"async-registry.d.ts","sourceRoot":"","sources":["../../../src/shared/async-registry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,qBAAa,aAAa,CAAC,CAAC,SAAS,YAAY;IAC/C;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAmC;IAEzD;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAqC;IAE1E;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAqD;IAEtF;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAiC;IAE1D;;;;;;;;OAQG;IACH,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,EACxB,EAAE,EAAE,UAAU,GAAG,IAAI,EACrB,SAAS,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,EACzB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,GAC7B,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAgCtB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,EAAE,UAAU,GAAG,IAAI,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI;IAqB9C;;;;;OAKG;IACH,KAAK,CAAC,EAAE,EAAE,UAAU,GAAG,IAAI,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;IAqB9C;;;;OAIG;IACH,WAAW,CAAC,EAAE,EAAE,UAAU,GAAG,IAAI,GAAG,IAAI;IAWxC;;;;OAIG;IACH,UAAU,CAAC,EAAE,EAAE,UAAU,GAAG,IAAI,GAAG,IAAI;IAgBvC;;;;OAIG;IACH,QAAQ,IAAI,CAAC,EAAE;IAIf;;;;;OAKG;IACH,OAAO,CAAC,EAAE,EAAE,UAAU,GAAG,IAAI,GAAG,OAAO;IAIvC;;;;;;;OAOG;IACH,OAAO,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,UAAU,GAAG,IAAI,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;IAwC7E;;;OAGG;IACG,UAAU;IAehB;;;;;OAKG;IACH,KAAK,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI;IAY9C;;;;OAIG;IACH,OAAO,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,IAAI;IAI1C;;OAEG;IACH,KAAK,IAAI,IAAI;IAOb;;OAEG;IACH,OAAO,CAAC,cAAc;IAStB;;;;;OAKG;IACH,OAAO,CAAC,mBAAmB;IAW3B;;;;;OAKG;IACH,OAAO,CAAC,iBAAiB;CAK1B;AAED;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC;CAC7B,CAAC;AAEF;;GAEG;AACH,KAAK,UAAU,GAAG,MAAM,CAAC;AAUzB;;GAEG;AACH,KAAK,eAAe,CAAC,CAAC,IAAI,CACxB,KAAK,EAAE,GAAG,CAAC,UAAU,GAAG,IAAI,EAAE,CAAC,CAAC,EAChC,MAAM,EAAE,GAAG,CAAC,UAAU,GAAG,IAAI,EAAE,KAAK,CAAC,KAClC,IAAI,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Converts a string to camelCase.
3
+ *
4
+ * @param str The string to convert
5
+ * @returns The camelCased string
6
+ */
7
+ export declare function camelCase(str: string): string;
8
+ //# sourceMappingURL=camel-case.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"camel-case.d.ts","sourceRoot":"","sources":["../../../src/shared/camel-case.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAI7C"}
@@ -0,0 +1,2 @@
1
+ export declare function debounce<T extends (...args: any[]) => any>(delay: number, callback: T): (...args: Parameters<T>) => void;
2
+ //# sourceMappingURL=debounce.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debounce.d.ts","sourceRoot":"","sources":["../../../src/shared/debounce.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EACxD,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,CAAC,GACV,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,IAAI,CAYlC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Recursively converts all keys of a plain object or array to camelCase.
3
+ * Skips class instances and leaves them untouched.
4
+ *
5
+ * @param input The object or array to process
6
+ */
7
+ export declare function deepCamelCaseKeys<T>(input: T): T;
8
+ //# sourceMappingURL=deep-camel-case-keys.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deep-camel-case-keys.d.ts","sourceRoot":"","sources":["../../../src/shared/deep-camel-case-keys.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAgBhD"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Filters the values of an object based on a provided filter function.
3
+ *
4
+ * @param obj The object to filter.
5
+ * @param filter The filter function that determines whether a value should be included.
6
+ * @returns A new object containing only the key-value pairs that passed the filter.
7
+ */
8
+ export declare function filterObjectValues<T>(obj: Record<string, T>, filter: (value: T, key: string) => boolean): Record<string, T>;
9
+ //# sourceMappingURL=filter-object-values.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter-object-values.d.ts","sourceRoot":"","sources":["../../../src/shared/filter-object-values.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAClC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,EACtB,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,KAAK,OAAO,GACzC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAMnB"}
@@ -0,0 +1,16 @@
1
+ export * from './async-registry';
2
+ export * from './camel-case';
3
+ export * from './debounce';
4
+ export * from './deep-camel-case-keys';
5
+ export * from './filter-object-values';
6
+ export * from './is-empty-object';
7
+ export * from './is-plain-object';
8
+ export * from './map-object-values';
9
+ export * from './once';
10
+ export * from './shallow-equal';
11
+ export * from './timeout';
12
+ export * from './uid';
13
+ export * from './wait-for';
14
+ export * from './wait-for-dom-ready';
15
+ export * from './wait-for-interactive-attribute';
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shared/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,kCAAkC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function isEmptyObject(obj: Record<string, unknown>): boolean;
2
+ //# sourceMappingURL=is-empty-object.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-empty-object.d.ts","sourceRoot":"","sources":["../../../src/shared/is-empty-object.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAEnE"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Utility to check if a value is a plain object (not an array, not null, not a class instance).
3
+ *
4
+ * @param value The value to check.
5
+ * @returns True if the value is a plain object, false otherwise.
6
+ */
7
+ export declare function isPlainObject(value: unknown): value is Record<string, unknown>;
8
+ //# sourceMappingURL=is-plain-object.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-plain-object.d.ts","sourceRoot":"","sources":["../../../src/shared/is-plain-object.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAQ9E"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Maps the values of an object using a provided mapper function.
3
+ *
4
+ * @param obj The object whose values will be mapped.
5
+ * @param mapper A function that takes a value and its key, and returns a new value.
6
+ * @template T The type of the original values in the object.
7
+ * @template U The type of the new values in the object.
8
+ * @returns A new object with the same keys as the original, but with values transformed by
9
+ */
10
+ export declare function mapObjectValues<T, U>(obj: Record<string, T>, mapper: (value: T, key: string) => U): Record<string, U>;
11
+ //# sourceMappingURL=map-object-values.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"map-object-values.d.ts","sourceRoot":"","sources":["../../../src/shared/map-object-values.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,CAAC,EAClC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,EACtB,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC,GACnC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAMnB"}
@@ -0,0 +1,2 @@
1
+ export declare function once<T extends (...args: any[]) => any>(fn: T): T;
2
+ //# sourceMappingURL=once.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"once.d.ts","sourceRoot":"","sources":["../../../src/shared/once.ts"],"names":[],"mappings":"AAAA,wBAAgB,IAAI,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,CAWhE"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Performs a shallow comparison of two objects.
3
+ *
4
+ * @param objA - The first object to compare.
5
+ * @param objB - The second object to compare.
6
+ * @returns True if the objects are shallowly equal, false otherwise.
7
+ */
8
+ export declare function shallowEqual<T extends Record<string, unknown>>(objA: T, objB: T): boolean;
9
+ //# sourceMappingURL=shallow-equal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shallow-equal.d.ts","sourceRoot":"","sources":["../../../src/shared/shallow-equal.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5D,IAAI,EAAE,CAAC,EACP,IAAI,EAAE,CAAC,GACN,OAAO,CAmBT"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Returns a promise that resolves after a specified number of milliseconds.
3
+ *
4
+ * @param ms The number of milliseconds to wait.
5
+ * @returns A promise that resolves after the specified time.
6
+ */
7
+ export declare function timeout(ms: number): Promise<void>;
8
+ //# sourceMappingURL=timeout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timeout.d.ts","sourceRoot":"","sources":["../../../src/shared/timeout.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAMjD"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Generates a unique identifier string
3
+ *
4
+ * @returns Random string that can be used as unique identifier
5
+ */
6
+ export declare function uid(): string;
7
+ //# sourceMappingURL=uid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uid.d.ts","sourceRoot":"","sources":["../../../src/shared/uid.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,GAAG,WAElB"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Returns a promise that resolves when the DOM is fully loaded and ready.
3
+ */
4
+ export declare function waitForDOMReady(): Promise<void>;
5
+ //# sourceMappingURL=wait-for-dom-ready.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wait-for-dom-ready.d.ts","sourceRoot":"","sources":["../../../src/shared/wait-for-dom-ready.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CAiB/C"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Waits for the 'data-cke-interactive' attribute to be added to the element.
3
+ */
4
+ export declare function waitForInteractiveAttribute(element: HTMLElement): WaitForInteractiveResult;
5
+ /**
6
+ * Marks the given element as interactive by adding the 'data-cke-interactive' attribute.
7
+ *
8
+ * @param element - The HTML element to mark as interactive.
9
+ */
10
+ export declare function markElementAsInteractive(element: HTMLElement): void;
11
+ /**
12
+ * Result of waiting for the interactive attribute.
13
+ */
14
+ export type WaitForInteractiveResult = {
15
+ promise: Promise<void>;
16
+ disconnect: () => void;
17
+ };
18
+ //# sourceMappingURL=wait-for-interactive-attribute.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wait-for-interactive-attribute.d.ts","sourceRoot":"","sources":["../../../src/shared/wait-for-interactive-attribute.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,WAAW,GAAG,wBAAwB,CA6B1F;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,WAAW,QAE5D;AAED;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { CanBePromise } from '../types';
2
+ /**
3
+ * Waits for the provided callback to succeed. The callback is executed multiple times until it succeeds or the timeout is reached.
4
+ * It's executed immediately and then with a delay defined by the `retry` option.
5
+ *
6
+ * @param callback The callback to execute.
7
+ * @param config Configuration for the function.
8
+ * @param config.timeOutAfter The maximum time to wait for the callback to succeed, in milliseconds. Default is 500ms.
9
+ * @param config.retryAfter The time to wait between retries, in milliseconds. Default is 100ms.
10
+ * @returns A promise that resolves when the callback succeeds.
11
+ */
12
+ export declare function waitFor<R>(callback: () => CanBePromise<R>, { timeOutAfter, retryAfter, }?: WaitForConfig): Promise<R>;
13
+ /**
14
+ * Configuration for the `waitFor` function.
15
+ */
16
+ export type WaitForConfig = {
17
+ timeOutAfter?: number;
18
+ retryAfter?: number;
19
+ };
20
+ //# sourceMappingURL=wait-for.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wait-for.d.ts","sourceRoot":"","sources":["../../../src/shared/wait-for.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C;;;;;;;;;GASG;AACH,wBAAgB,OAAO,CAAC,CAAC,EACvB,QAAQ,EAAE,MAAM,YAAY,CAAC,CAAC,CAAC,EAC/B,EACE,YAAkB,EAClB,UAAgB,GACjB,GAAE,aAAkB,GACpB,OAAO,CAAC,CAAC,CAAC,CA6BZ;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export type CanBePromise<T> = T | Promise<T>;
2
+ //# sourceMappingURL=can-be-promise.type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"can-be-promise.type.d.ts","sourceRoot":"","sources":["../../../src/types/can-be-promise.type.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Represents the .NET interop helper for communication with Blazor.
3
+ */
4
+ export type DotNetInterop = {
5
+ invokeMethodAsync: (methodName: string, ...args: any[]) => Promise<void>;
6
+ };
7
+ //# sourceMappingURL=dot-net-interop.type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dot-net-interop.type.d.ts","sourceRoot":"","sources":["../../../src/types/dot-net-interop.type.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,iBAAiB,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1E,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from './can-be-promise.type';
2
+ export * from './dot-net-interop.type';
3
+ export * from './required-by.type';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export type RequiredBy<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;
2
+ //# sourceMappingURL=required-by.type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"required-by.type.d.ts","sourceRoot":"","sources":["../../../src/types/required-by.type.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "ckeditor5-blazor",
3
+ "version": "0.1.0",
4
+ "description": "CKEditor 5 integration for Blazor",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/Mati365/ckeditor5-blazor.git"
9
+ },
10
+ "keywords": [
11
+ "ckeditor",
12
+ "blazor",
13
+ "editor"
14
+ ],
15
+ "exports": {
16
+ ".": {
17
+ "types": "./dist/index.d.ts",
18
+ "import": "./dist/index.mjs",
19
+ "require": "./dist/index.cjs"
20
+ }
21
+ },
22
+ "main": "dist/index.cjs",
23
+ "module": "dist/index.mjs",
24
+ "types": "dist/index.d.ts",
25
+ "files": [
26
+ "dist",
27
+ "src"
28
+ ],
29
+ "scripts": {
30
+ "clean": "rm -rf dist",
31
+ "build": "pnpm run clean && vite build && node ./scripts/check-dist-imports.mjs",
32
+ "watch": "vite build --watch",
33
+ "dev": "vite build --watch",
34
+ "typecheck": "tsc --noEmit --pretty",
35
+ "test": "vitest --coverage",
36
+ "test:watch": "vitest --watch --coverage"
37
+ },
38
+ "devDependencies": {
39
+ "@vitest/coverage-v8": "^4.0.18",
40
+ "ckeditor5": "^47.4.0",
41
+ "ckeditor5-premium-features": "^47.4.0",
42
+ "happy-dom": "^20.5.0",
43
+ "typescript": "^5.9.3",
44
+ "vite": "^7.3.1",
45
+ "vite-plugin-dts": "^4.5.4",
46
+ "vite-tsconfig-paths": "^6.0.5",
47
+ "vitest": "^4.0.18"
48
+ }
49
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Custom error class for CKEditor5 Blazor-related errors.
3
+ */
4
+ export class CKEditor5BlazorError extends Error {
5
+ constructor(message: string) {
6
+ super(message);
7
+ this.name = 'CKEditor5BlazorError';
8
+ }
9
+ }