@omegagrid/core 0.10.2 → 0.10.4

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 (317) hide show
  1. package/dist/common/actions.d.ts +16 -0
  2. package/dist/common/actions.d.ts.map +1 -0
  3. package/dist/common/actions.js +14 -0
  4. package/dist/common/actions.js.map +1 -0
  5. package/dist/common/colors.d.ts +39 -0
  6. package/dist/common/colors.d.ts.map +1 -0
  7. package/dist/common/colors.js +59 -0
  8. package/dist/common/colors.js.map +1 -0
  9. package/dist/common/csv.d.ts +23 -0
  10. package/dist/common/csv.d.ts.map +1 -0
  11. package/dist/common/csv.js +93 -0
  12. package/dist/common/csv.js.map +1 -0
  13. package/dist/common/dates.d.ts +32 -0
  14. package/dist/common/dates.d.ts.map +1 -0
  15. package/dist/common/dates.js +172 -0
  16. package/dist/common/dates.js.map +1 -0
  17. package/dist/common/device.d.ts +2 -0
  18. package/dist/common/device.d.ts.map +1 -0
  19. package/dist/common/device.js +13 -0
  20. package/dist/common/device.js.map +1 -0
  21. package/dist/common/dom.d.ts +90 -0
  22. package/dist/common/dom.d.ts.map +1 -0
  23. package/dist/common/dom.js +308 -0
  24. package/dist/common/dom.js.map +1 -0
  25. package/dist/common/events.d.ts +15 -0
  26. package/dist/common/events.d.ts.map +1 -0
  27. package/dist/common/events.js +33 -0
  28. package/dist/common/events.js.map +1 -0
  29. package/dist/common/html.d.ts +3 -0
  30. package/dist/common/html.d.ts.map +1 -0
  31. package/dist/common/html.js +25 -0
  32. package/dist/common/html.js.map +1 -0
  33. package/dist/common/index.d.ts +19 -0
  34. package/dist/common/index.d.ts.map +1 -0
  35. package/dist/common/index.js +19 -0
  36. package/dist/common/index.js.map +1 -0
  37. package/dist/common/linkedList.d.ts +24 -0
  38. package/dist/common/linkedList.d.ts.map +1 -0
  39. package/dist/common/linkedList.js +65 -0
  40. package/dist/common/linkedList.js.map +1 -0
  41. package/dist/common/loaders.d.ts +17 -0
  42. package/dist/common/loaders.d.ts.map +1 -0
  43. package/dist/common/loaders.js +54 -0
  44. package/dist/common/loaders.js.map +1 -0
  45. package/dist/common/logger.d.ts +25 -0
  46. package/dist/common/logger.d.ts.map +1 -0
  47. package/dist/common/logger.js +57 -0
  48. package/dist/common/logger.js.map +1 -0
  49. package/dist/common/matrix.d.ts +6 -0
  50. package/dist/common/matrix.d.ts.map +1 -0
  51. package/dist/common/matrix.js +17 -0
  52. package/dist/common/matrix.js.map +1 -0
  53. package/dist/common/numbers.d.ts +26 -0
  54. package/dist/common/numbers.d.ts.map +1 -0
  55. package/dist/common/numbers.js +239 -0
  56. package/dist/common/numbers.js.map +1 -0
  57. package/dist/common/options.d.ts +17 -0
  58. package/dist/common/options.d.ts.map +1 -0
  59. package/dist/common/options.js +29 -0
  60. package/dist/common/options.js.map +1 -0
  61. package/dist/common/paper.d.ts +8 -0
  62. package/dist/common/paper.d.ts.map +1 -0
  63. package/dist/common/paper.js +17 -0
  64. package/dist/common/paper.js.map +1 -0
  65. package/dist/common/shortcutManager.d.ts +17 -0
  66. package/dist/common/shortcutManager.d.ts.map +1 -0
  67. package/dist/common/shortcutManager.js +49 -0
  68. package/dist/common/shortcutManager.js.map +1 -0
  69. package/dist/common/tree.d.ts +87 -0
  70. package/dist/common/tree.d.ts.map +1 -0
  71. package/dist/common/tree.js +204 -0
  72. package/dist/common/tree.js.map +1 -0
  73. package/dist/common/utils.d.ts +30 -0
  74. package/dist/common/utils.d.ts.map +1 -0
  75. package/dist/common/utils.js +136 -0
  76. package/dist/common/utils.js.map +1 -0
  77. package/dist/constants.d.ts +48 -0
  78. package/dist/constants.d.ts.map +1 -0
  79. package/dist/constants.js +24 -0
  80. package/dist/constants.js.map +1 -0
  81. package/dist/index.d.ts +8 -0
  82. package/dist/index.d.ts.map +1 -0
  83. package/dist/index.js +8 -0
  84. package/dist/index.js.map +1 -0
  85. package/dist/model/adapter.d.ts +8 -0
  86. package/dist/model/adapter.d.ts.map +1 -0
  87. package/dist/model/adapter.js +13 -0
  88. package/dist/model/adapter.js.map +1 -0
  89. package/dist/model/component.d.ts +19 -0
  90. package/dist/model/component.d.ts.map +1 -0
  91. package/dist/model/component.js +84 -0
  92. package/dist/model/component.js.map +1 -0
  93. package/dist/model/componentSlice.d.ts +8 -0
  94. package/dist/model/componentSlice.d.ts.map +1 -0
  95. package/dist/model/componentSlice.js +10 -0
  96. package/dist/model/componentSlice.js.map +1 -0
  97. package/dist/model/componentStore.d.ts +12 -0
  98. package/dist/model/componentStore.d.ts.map +1 -0
  99. package/dist/model/componentStore.js +26 -0
  100. package/dist/model/componentStore.js.map +1 -0
  101. package/dist/model/index.d.ts +6 -0
  102. package/dist/model/index.d.ts.map +1 -0
  103. package/dist/model/index.js +6 -0
  104. package/dist/model/index.js.map +1 -0
  105. package/dist/model/plugins.d.ts +13 -0
  106. package/dist/model/plugins.d.ts.map +1 -0
  107. package/dist/model/plugins.js +27 -0
  108. package/dist/model/plugins.js.map +1 -0
  109. package/dist/themes/definitions/tmDark.d.ts +4 -0
  110. package/dist/themes/definitions/tmDark.d.ts.map +1 -0
  111. package/dist/themes/definitions/tmDark.js +83 -0
  112. package/dist/themes/definitions/tmDark.js.map +1 -0
  113. package/dist/themes/definitions/tmLight.d.ts +4 -0
  114. package/dist/themes/definitions/tmLight.d.ts.map +1 -0
  115. package/dist/themes/definitions/tmLight.js +83 -0
  116. package/dist/themes/definitions/tmLight.js.map +1 -0
  117. package/dist/themes/helpers.d.ts +7 -0
  118. package/dist/themes/helpers.d.ts.map +1 -0
  119. package/dist/themes/helpers.js +34 -0
  120. package/dist/themes/helpers.js.map +1 -0
  121. package/dist/themes/index.d.ts +18 -0
  122. package/dist/themes/index.d.ts.map +1 -0
  123. package/dist/themes/index.js +48 -0
  124. package/dist/themes/index.js.map +1 -0
  125. package/dist/themes/mixins.d.ts +10 -0
  126. package/dist/themes/mixins.d.ts.map +1 -0
  127. package/dist/themes/mixins.js +39 -0
  128. package/dist/themes/mixins.js.map +1 -0
  129. package/dist/themes/transformations.d.ts +9 -0
  130. package/dist/themes/transformations.d.ts.map +1 -0
  131. package/dist/themes/transformations.js +48 -0
  132. package/dist/themes/transformations.js.map +1 -0
  133. package/dist/types.d.ts +130 -0
  134. package/dist/types.d.ts.map +1 -0
  135. package/dist/types.js +12 -0
  136. package/dist/types.js.map +1 -0
  137. package/dist/ui/accordion.d.ts +16 -0
  138. package/dist/ui/accordion.d.ts.map +1 -0
  139. package/dist/ui/accordion.js +209 -0
  140. package/dist/ui/accordion.js.map +1 -0
  141. package/dist/ui/alert.d.ts +15 -0
  142. package/dist/ui/alert.d.ts.map +1 -0
  143. package/dist/ui/alert.js +101 -0
  144. package/dist/ui/alert.js.map +1 -0
  145. package/dist/ui/baseElement.d.ts +7 -0
  146. package/dist/ui/baseElement.d.ts.map +1 -0
  147. package/dist/ui/baseElement.js +10 -0
  148. package/dist/ui/baseElement.js.map +1 -0
  149. package/dist/ui/button.d.ts +21 -0
  150. package/dist/ui/button.d.ts.map +1 -0
  151. package/dist/ui/button.js +100 -0
  152. package/dist/ui/button.js.map +1 -0
  153. package/dist/ui/button.style.d.ts +2 -0
  154. package/dist/ui/button.style.d.ts.map +1 -0
  155. package/dist/ui/button.style.js +60 -0
  156. package/dist/ui/button.style.js.map +1 -0
  157. package/dist/ui/checkbox.d.ts +14 -0
  158. package/dist/ui/checkbox.d.ts.map +1 -0
  159. package/dist/ui/checkbox.js +47 -0
  160. package/dist/ui/checkbox.js.map +1 -0
  161. package/dist/ui/close.d.ts +6 -0
  162. package/dist/ui/close.d.ts.map +1 -0
  163. package/dist/ui/close.js +33 -0
  164. package/dist/ui/close.js.map +1 -0
  165. package/dist/ui/colorpicker.d.ts +24 -0
  166. package/dist/ui/colorpicker.d.ts.map +1 -0
  167. package/dist/ui/colorpicker.js +228 -0
  168. package/dist/ui/colorpicker.js.map +1 -0
  169. package/dist/ui/container.d.ts +39 -0
  170. package/dist/ui/container.d.ts.map +1 -0
  171. package/dist/ui/container.js +313 -0
  172. package/dist/ui/container.js.map +1 -0
  173. package/dist/ui/dropdown.d.ts +48 -0
  174. package/dist/ui/dropdown.d.ts.map +1 -0
  175. package/dist/ui/dropdown.js +300 -0
  176. package/dist/ui/dropdown.js.map +1 -0
  177. package/dist/ui/dropdownColorPicker.d.ts +12 -0
  178. package/dist/ui/dropdownColorPicker.d.ts.map +1 -0
  179. package/dist/ui/dropdownColorPicker.js +60 -0
  180. package/dist/ui/dropdownColorPicker.js.map +1 -0
  181. package/dist/ui/dropdownList.d.ts +8 -0
  182. package/dist/ui/dropdownList.d.ts.map +1 -0
  183. package/dist/ui/dropdownList.js +48 -0
  184. package/dist/ui/dropdownList.js.map +1 -0
  185. package/dist/ui/dropdownMenu.d.ts +11 -0
  186. package/dist/ui/dropdownMenu.d.ts.map +1 -0
  187. package/dist/ui/dropdownMenu.js +61 -0
  188. package/dist/ui/dropdownMenu.js.map +1 -0
  189. package/dist/ui/expander.d.ts +28 -0
  190. package/dist/ui/expander.d.ts.map +1 -0
  191. package/dist/ui/expander.js +144 -0
  192. package/dist/ui/expander.js.map +1 -0
  193. package/dist/ui/fileInput.d.ts +24 -0
  194. package/dist/ui/fileInput.d.ts.map +1 -0
  195. package/dist/ui/fileInput.js +130 -0
  196. package/dist/ui/fileInput.js.map +1 -0
  197. package/dist/ui/fileInput.style.d.ts +2 -0
  198. package/dist/ui/fileInput.style.d.ts.map +1 -0
  199. package/dist/ui/fileInput.style.js +73 -0
  200. package/dist/ui/fileInput.style.js.map +1 -0
  201. package/dist/ui/floatingWindow.d.ts +19 -0
  202. package/dist/ui/floatingWindow.d.ts.map +1 -0
  203. package/dist/ui/floatingWindow.js +87 -0
  204. package/dist/ui/floatingWindow.js.map +1 -0
  205. package/dist/ui/icon.d.ts +46 -0
  206. package/dist/ui/icon.d.ts.map +1 -0
  207. package/dist/ui/icon.js +189 -0
  208. package/dist/ui/icon.js.map +1 -0
  209. package/dist/ui/icon.style.d.ts +2 -0
  210. package/dist/ui/icon.style.d.ts.map +1 -0
  211. package/dist/ui/icon.style.js +556 -0
  212. package/dist/ui/icon.style.js.map +1 -0
  213. package/dist/ui/images.d.ts +2 -0
  214. package/dist/ui/images.d.ts.map +1 -0
  215. package/dist/ui/images.js +14 -0
  216. package/dist/ui/images.js.map +1 -0
  217. package/dist/ui/index.d.ts +32 -0
  218. package/dist/ui/index.d.ts.map +1 -0
  219. package/dist/ui/index.js +32 -0
  220. package/dist/ui/index.js.map +1 -0
  221. package/dist/ui/input.d.ts +12 -0
  222. package/dist/ui/input.d.ts.map +1 -0
  223. package/dist/ui/input.js +45 -0
  224. package/dist/ui/input.js.map +1 -0
  225. package/dist/ui/input.style.d.ts +2 -0
  226. package/dist/ui/input.style.d.ts.map +1 -0
  227. package/dist/ui/input.style.js +36 -0
  228. package/dist/ui/input.style.js.map +1 -0
  229. package/dist/ui/label.d.ts +16 -0
  230. package/dist/ui/label.d.ts.map +1 -0
  231. package/dist/ui/label.js +90 -0
  232. package/dist/ui/label.js.map +1 -0
  233. package/dist/ui/list.d.ts +87 -0
  234. package/dist/ui/list.d.ts.map +1 -0
  235. package/dist/ui/list.js +427 -0
  236. package/dist/ui/list.js.map +1 -0
  237. package/dist/ui/list.style.d.ts +2 -0
  238. package/dist/ui/list.style.d.ts.map +1 -0
  239. package/dist/ui/list.style.js +35 -0
  240. package/dist/ui/list.style.js.map +1 -0
  241. package/dist/ui/loader.d.ts +6 -0
  242. package/dist/ui/loader.d.ts.map +1 -0
  243. package/dist/ui/loader.js +25 -0
  244. package/dist/ui/loader.js.map +1 -0
  245. package/dist/ui/menu.d.ts +41 -0
  246. package/dist/ui/menu.d.ts.map +1 -0
  247. package/dist/ui/menu.js +154 -0
  248. package/dist/ui/menu.js.map +1 -0
  249. package/dist/ui/menu.style.d.ts +3 -0
  250. package/dist/ui/menu.style.d.ts.map +1 -0
  251. package/dist/ui/menu.style.js +50 -0
  252. package/dist/ui/menu.style.js.map +1 -0
  253. package/dist/ui/numericInput.d.ts +37 -0
  254. package/dist/ui/numericInput.d.ts.map +1 -0
  255. package/dist/ui/numericInput.js +175 -0
  256. package/dist/ui/numericInput.js.map +1 -0
  257. package/dist/ui/numericInput.style.d.ts +2 -0
  258. package/dist/ui/numericInput.style.d.ts.map +1 -0
  259. package/dist/ui/numericInput.style.js +29 -0
  260. package/dist/ui/numericInput.style.js.map +1 -0
  261. package/dist/ui/overlay.d.ts +17 -0
  262. package/dist/ui/overlay.d.ts.map +1 -0
  263. package/dist/ui/overlay.js +87 -0
  264. package/dist/ui/overlay.js.map +1 -0
  265. package/dist/ui/overlay.style.d.ts +2 -0
  266. package/dist/ui/overlay.style.d.ts.map +1 -0
  267. package/dist/ui/overlay.style.js +46 -0
  268. package/dist/ui/overlay.style.js.map +1 -0
  269. package/dist/ui/panel.d.ts +25 -0
  270. package/dist/ui/panel.d.ts.map +1 -0
  271. package/dist/ui/panel.js +151 -0
  272. package/dist/ui/panel.js.map +1 -0
  273. package/dist/ui/panel.style.d.ts +2 -0
  274. package/dist/ui/panel.style.d.ts.map +1 -0
  275. package/dist/ui/panel.style.js +73 -0
  276. package/dist/ui/panel.style.js.map +1 -0
  277. package/dist/ui/sizer.d.ts +53 -0
  278. package/dist/ui/sizer.d.ts.map +1 -0
  279. package/dist/ui/sizer.js +203 -0
  280. package/dist/ui/sizer.js.map +1 -0
  281. package/dist/ui/slider.d.ts +52 -0
  282. package/dist/ui/slider.d.ts.map +1 -0
  283. package/dist/ui/slider.js +213 -0
  284. package/dist/ui/slider.js.map +1 -0
  285. package/dist/ui/slider.style.d.ts +2 -0
  286. package/dist/ui/slider.style.d.ts.map +1 -0
  287. package/dist/ui/slider.style.js +61 -0
  288. package/dist/ui/slider.style.js.map +1 -0
  289. package/dist/ui/sortableList.d.ts +39 -0
  290. package/dist/ui/sortableList.d.ts.map +1 -0
  291. package/dist/ui/sortableList.js +167 -0
  292. package/dist/ui/sortableList.js.map +1 -0
  293. package/dist/ui/splitContainer.d.ts +52 -0
  294. package/dist/ui/splitContainer.d.ts.map +1 -0
  295. package/dist/ui/splitContainer.js +252 -0
  296. package/dist/ui/splitContainer.js.map +1 -0
  297. package/dist/ui/splitContainer.style.d.ts +2 -0
  298. package/dist/ui/splitContainer.style.d.ts.map +1 -0
  299. package/dist/ui/splitContainer.style.js +62 -0
  300. package/dist/ui/splitContainer.style.js.map +1 -0
  301. package/dist/ui/switch.d.ts +22 -0
  302. package/dist/ui/switch.d.ts.map +1 -0
  303. package/dist/ui/switch.js +83 -0
  304. package/dist/ui/switch.js.map +1 -0
  305. package/dist/ui/switch.style.d.ts +2 -0
  306. package/dist/ui/switch.style.d.ts.map +1 -0
  307. package/dist/ui/switch.style.js +149 -0
  308. package/dist/ui/switch.style.js.map +1 -0
  309. package/dist/ui/tooltip.d.ts +24 -0
  310. package/dist/ui/tooltip.d.ts.map +1 -0
  311. package/dist/ui/tooltip.js +143 -0
  312. package/dist/ui/tooltip.js.map +1 -0
  313. package/dist/ui/tooltip.style.d.ts +2 -0
  314. package/dist/ui/tooltip.style.d.ts.map +1 -0
  315. package/dist/ui/tooltip.style.js +112 -0
  316. package/dist/ui/tooltip.style.js.map +1 -0
  317. package/package.json +2 -2
@@ -0,0 +1,90 @@
1
+ import { Options } from 'ts-debounce';
2
+ import { CssPosition, Rect } from '../types';
3
+ export declare function createName(name: string, prefix?: string): string;
4
+ export declare function register(name: string, c: CustomElementConstructor, ext?: string, prefix?: string): void;
5
+ export declare function setStyle(elm: HTMLElement, style: CSSStyleDeclaration): HTMLElement;
6
+ type ElementAttributes<T extends HTMLElement> = Omit<Partial<T>, 'style'> & {
7
+ style?: Partial<CSSStyleDeclaration>;
8
+ listeners?: [string, EventListenerOrEventListenerObject][];
9
+ };
10
+ export declare function createElement<T extends HTMLElement>(elmName: string, attrs?: ElementAttributes<T>): T;
11
+ export declare function appendElement(parent: HTMLElement | DocumentFragment, child: HTMLElement): HTMLElement;
12
+ export declare function showElement(elm: HTMLElement, defaultDisplayStyle?: string): HTMLElement;
13
+ export declare function hideElement(elm: HTMLElement): HTMLElement;
14
+ export declare function isHidden(elm: HTMLElement): boolean;
15
+ export declare function showCell(cell: HTMLTableCellElement): void;
16
+ export declare function hideCell(cell: HTMLTableCellElement): void;
17
+ export declare function empty<T extends HTMLElement | ShadowRoot>(elm: T): T;
18
+ export declare function remove(elm: HTMLElement): void;
19
+ export declare function findParent<T extends HTMLElement>(elm: HTMLElement, selector: string | ((elm: HTMLElement) => boolean)): T;
20
+ type OnCallbackFunction<T extends Event> = (e: T, elm: HTMLElement) => void;
21
+ export declare function on<T extends Event>(elm: HTMLElement, event: string, selector: string, matchCallback: OnCallbackFunction<T>, notMatchCallback?: OnCallbackFunction<T>): HTMLElement;
22
+ export declare function debounceOn<T extends Event>(elm: HTMLElement, event: string, selector: string, callback: OnCallbackFunction<T>, options?: {
23
+ wait?: number;
24
+ noMatchCallback?: OnCallbackFunction<T>;
25
+ } & Options<void>): HTMLElement;
26
+ export declare function setClasses(elm: HTMLElement, classes?: string[]): HTMLElement;
27
+ export declare function getElementOffset(elm: HTMLElement, offsetElm: HTMLElement): {
28
+ top: number;
29
+ left: number;
30
+ };
31
+ export declare function appendStyle(elm: HTMLElement | DocumentFragment, style: string, id?: string): Node;
32
+ export declare function appendScript(elm: HTMLElement | DocumentFragment, js: string, id?: string): Node;
33
+ export declare function numToPixels(n: number): string;
34
+ export declare const px: typeof numToPixels;
35
+ export declare function setSize(elm: HTMLElement, size: {
36
+ w?: number | string;
37
+ h?: number | string;
38
+ }, minSize?: boolean): HTMLElement;
39
+ export declare function setMaxSize(elm: HTMLElement, size: {
40
+ w?: number | string;
41
+ h?: number | string;
42
+ }): HTMLElement;
43
+ export declare function setMinSize(elm: HTMLElement, size: {
44
+ w?: number | string;
45
+ h?: number | string;
46
+ }): HTMLElement;
47
+ export declare function setPosition(elm: HTMLElement | SVGElement, position: CssPosition): void;
48
+ export declare function setInset(elm: HTMLElement | SVGElement, value: number): void;
49
+ export declare function getBounds(elm: HTMLElement): Rect;
50
+ export declare function setBounds(elm: HTMLElement, bounds: Rect): void;
51
+ export declare function setLineHeight(elm: HTMLElement, height: number): void;
52
+ export declare function fixElementPosition(elm: HTMLElement, offsetElement?: HTMLElement): void;
53
+ export declare function fixElementSize(elm: HTMLElement, container?: HTMLElement): void;
54
+ export declare function setZIndex(elm: HTMLElement, zIndex: number): void;
55
+ export declare function setMargin(elm: HTMLElement, margin: {
56
+ r?: number;
57
+ b?: number;
58
+ l?: number;
59
+ t?: number;
60
+ }): void;
61
+ export declare function setPadding(elm: HTMLElement, padding: {
62
+ r?: number;
63
+ b?: number;
64
+ l?: number;
65
+ t?: number;
66
+ }): void;
67
+ export declare function setCenterPosition(elm: HTMLElement, parent: HTMLElement, options?: {
68
+ vertical: boolean;
69
+ horizontal: boolean;
70
+ }): void;
71
+ export declare function setBorderWidth(elm: HTMLElement, widths: {
72
+ r?: number;
73
+ b?: number;
74
+ l?: number;
75
+ t?: number;
76
+ }): void;
77
+ export declare function fixPosition(pos: {
78
+ x: number;
79
+ y: number;
80
+ w: number;
81
+ h: number;
82
+ }, container: HTMLElement): {
83
+ x: number;
84
+ y: number;
85
+ };
86
+ export declare function zoomElement(elm: HTMLElement, zoom: number): void;
87
+ export declare function measureText(text: string, font: string): TextMetrics;
88
+ export declare function query<T>(selector: string, parent?: ParentNode): T;
89
+ export {};
90
+ //# sourceMappingURL=dom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../src/common/dom.ts"],"names":[],"mappings":"AAGA,OAAO,EAAY,OAAO,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAE7C,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,GAAE,MAAyB,UAEzE;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,wBAAwB,EAAE,GAAG,GAAE,MAAa,EAAE,MAAM,GAAE,MAAyB,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C,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAE,UAAqB,GAAI,CAAC,CAE5E"}
@@ -0,0 +1,308 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ import constants from '../constants';
3
+ import { debounce } from 'ts-debounce';
4
+ import { isString } from './utils';
5
+ export function createName(name, prefix = constants.PREFIX) {
6
+ return `${prefix}-${name}`;
7
+ }
8
+ export function register(name, c, ext = null, prefix = constants.PREFIX) {
9
+ customElements.define(`${prefix}-${name}`, c, ext ? { extends: ext } : undefined);
10
+ }
11
+ export function setStyle(elm, style) {
12
+ for (const styleKey in style) {
13
+ elm.style[styleKey] = style[styleKey];
14
+ }
15
+ return elm;
16
+ }
17
+ export function createElement(elmName, attrs) {
18
+ const elm = document.createElement(elmName);
19
+ if (attrs) {
20
+ for (const key in attrs) {
21
+ switch (key) {
22
+ case 'listeners':
23
+ if (Array.isArray(attrs.listeners)) {
24
+ for (const listener of attrs.listeners) {
25
+ elm.addEventListener(listener[0], listener[1]);
26
+ }
27
+ }
28
+ break;
29
+ case 'style':
30
+ if (typeof attrs[key] === 'object') {
31
+ setStyle(elm, attrs[key]);
32
+ }
33
+ break;
34
+ default:
35
+ elm[key] = attrs[key];
36
+ }
37
+ }
38
+ }
39
+ return elm;
40
+ }
41
+ export function appendElement(parent, child) {
42
+ parent.appendChild(child);
43
+ return parent;
44
+ }
45
+ export function showElement(elm, defaultDisplayStyle = '') {
46
+ if (elm)
47
+ elm.style.display = elm.dataset.display || defaultDisplayStyle || 'block';
48
+ return elm;
49
+ }
50
+ export function hideElement(elm) {
51
+ if (elm) {
52
+ elm.dataset.display = elm.style.display == 'none' ? '' : elm.style.display;
53
+ elm.style.display = 'none';
54
+ }
55
+ return elm;
56
+ }
57
+ export function isHidden(elm) {
58
+ return elm.style.display == 'none';
59
+ }
60
+ export function showCell(cell) {
61
+ cell.style.display = 'table-cell';
62
+ }
63
+ export function hideCell(cell) {
64
+ cell.style.display = 'none';
65
+ }
66
+ export function empty(elm) {
67
+ elm.innerHTML = '';
68
+ return elm;
69
+ }
70
+ export function remove(elm) {
71
+ elm.parentNode?.removeChild(elm);
72
+ }
73
+ export function findParent(elm, selector) {
74
+ const predicate = typeof selector === 'string'
75
+ ? (elm) => elm.matches(selector)
76
+ : selector;
77
+ while (elm.parentNode) {
78
+ elm = elm.parentNode;
79
+ if (elm instanceof ShadowRoot && elm.host)
80
+ elm = elm.host;
81
+ if (elm instanceof HTMLElement && predicate(elm))
82
+ return elm;
83
+ }
84
+ return null;
85
+ }
86
+ export function on(elm, event, selector, matchCallback, notMatchCallback) {
87
+ elm.addEventListener(event, (e) => {
88
+ for (const parent of e.composedPath()) {
89
+ if (parent.matches && parent.matches(selector)) {
90
+ matchCallback(e, parent);
91
+ return;
92
+ }
93
+ }
94
+ if (notMatchCallback) {
95
+ notMatchCallback(e, null);
96
+ }
97
+ });
98
+ return elm;
99
+ }
100
+ export function debounceOn(elm, event, selector, callback, options) {
101
+ const origCallback = (e, path) => {
102
+ for (const parent of path) {
103
+ if (parent.matches && parent.matches(selector)) {
104
+ callback(e, parent);
105
+ return;
106
+ }
107
+ }
108
+ if (options?.noMatchCallback)
109
+ options.noMatchCallback(e, null);
110
+ };
111
+ const debouncedCallback = debounce((e, path) => origCallback(e, path), options.wait, options);
112
+ elm.addEventListener(event, (e) => debouncedCallback(e, e.composedPath()));
113
+ return elm;
114
+ }
115
+ export function setClasses(elm, classes) {
116
+ elm.className = classes ? classes.reduce((prev, cur, i) => prev + (cur ? ((i == 0 ? '' : ' ') + cur) : ''), '') : '';
117
+ return elm;
118
+ }
119
+ export function getElementOffset(elm, offsetElm) {
120
+ let x = 0;
121
+ let y = 0;
122
+ while (elm && !isNaN(elm.offsetLeft) && !isNaN(elm.offsetTop) && (!offsetElm || offsetElm !== elm)) {
123
+ x += elm.offsetLeft - elm.scrollLeft;
124
+ y += elm.offsetTop - elm.scrollTop;
125
+ elm = elm.offsetParent;
126
+ }
127
+ return { top: y, left: x };
128
+ }
129
+ export function appendStyle(elm, style, id = null) {
130
+ if (style) {
131
+ let styleElm = id ? elm.querySelector('#' + id) : null;
132
+ if (!styleElm) {
133
+ styleElm = createElement('style');
134
+ if (id)
135
+ styleElm.id = id;
136
+ }
137
+ styleElm.innerHTML = style;
138
+ if (!styleElm.parentElement) {
139
+ elm.appendChild(styleElm);
140
+ }
141
+ }
142
+ return elm;
143
+ }
144
+ export function appendScript(elm, js, id = null) {
145
+ if (!js)
146
+ return elm;
147
+ let scriptElm = id ? elm.querySelector('#' + id) : null;
148
+ if (!scriptElm) {
149
+ scriptElm = createElement('script');
150
+ if (id)
151
+ scriptElm.id = id;
152
+ }
153
+ scriptElm.textContent = js;
154
+ if (!scriptElm.parentElement) {
155
+ elm.appendChild(scriptElm);
156
+ }
157
+ return elm;
158
+ }
159
+ export function numToPixels(n) {
160
+ return isNaN(n) ? '0' : n.toString() + 'px';
161
+ }
162
+ export const px = numToPixels;
163
+ export function setSize(elm, size, minSize = false) {
164
+ if (!elm)
165
+ return;
166
+ if (size.w != null)
167
+ elm.style[minSize ? 'minWidth' : 'width'] = isString(size.w) ? size.w : numToPixels(size.w);
168
+ if (size.h != null)
169
+ elm.style[minSize ? 'minHeight' : 'height'] = isString(size.h) ? size.h : numToPixels(size.h);
170
+ return elm;
171
+ }
172
+ export function setMaxSize(elm, size) {
173
+ if (size.w != null)
174
+ elm.style['maxWidth'] = isString(size.w) ? size.w : numToPixels(size.w);
175
+ if (size.h != null)
176
+ elm.style['maxHeight'] = isString(size.h) ? size.h : numToPixels(size.h);
177
+ return elm;
178
+ }
179
+ export function setMinSize(elm, size) {
180
+ if (size.w != null)
181
+ elm.style['minWidth'] = isString(size.w) ? size.w : numToPixels(size.w);
182
+ if (size.h != null)
183
+ elm.style['minHeight'] = isString(size.h) ? size.h : numToPixels(size.h);
184
+ return elm;
185
+ }
186
+ export function setPosition(elm, position) {
187
+ elm.style.position = 'absolute';
188
+ if (position.r != null)
189
+ elm.style.right = typeof position.r === 'string' ? position.r : numToPixels(position.r);
190
+ if (position.b != null)
191
+ elm.style.bottom = typeof position.b === 'string' ? position.b : numToPixels(position.b);
192
+ if (position.l != null)
193
+ elm.style.left = typeof position.l === 'string' ? position.l : numToPixels(position.l);
194
+ if (position.t != null)
195
+ elm.style.top = typeof position.t === 'string' ? position.t : numToPixels(position.t);
196
+ }
197
+ export function setInset(elm, value) {
198
+ elm.style.position = 'absolute';
199
+ elm.style.inset = numToPixels(value);
200
+ }
201
+ export function getBounds(elm) {
202
+ return {
203
+ x: elm.offsetLeft,
204
+ y: elm.offsetTop,
205
+ w: elm.offsetWidth,
206
+ h: elm.offsetHeight
207
+ };
208
+ }
209
+ export function setBounds(elm, bounds) {
210
+ setPosition(elm, { l: bounds.x, t: bounds.y });
211
+ setSize(elm, { w: bounds.w, h: bounds.h });
212
+ }
213
+ export function setLineHeight(elm, height) {
214
+ elm.style.lineHeight = numToPixels(height);
215
+ }
216
+ export function fixElementPosition(elm, offsetElement = null) {
217
+ offsetElement = offsetElement || elm.parentElement;
218
+ const offset = getElementOffset(elm, offsetElement);
219
+ const fixedPosition = fixPosition({
220
+ x: offset.left,
221
+ y: offset.top,
222
+ w: elm.offsetWidth,
223
+ h: elm.offsetHeight
224
+ }, offsetElement);
225
+ setPosition(elm, { l: fixedPosition.x, t: fixedPosition.y });
226
+ }
227
+ export function fixElementSize(elm, container = null) {
228
+ container = container || elm.parentElement;
229
+ if (container.offsetWidth < elm.offsetWidth || container.offsetHeight < elm.offsetHeight) {
230
+ setSize(elm, {
231
+ w: Math.min(container.offsetWidth, elm.offsetWidth),
232
+ h: Math.min(container.offsetHeight, elm.offsetHeight),
233
+ });
234
+ }
235
+ }
236
+ export function setZIndex(elm, zIndex) {
237
+ elm.style.zIndex = zIndex.toString();
238
+ }
239
+ export function setMargin(elm, margin) {
240
+ if (margin.r !== undefined)
241
+ elm.style.marginRight = numToPixels(margin.r);
242
+ if (margin.l !== undefined)
243
+ elm.style.marginLeft = numToPixels(margin.l);
244
+ if (margin.t !== undefined)
245
+ elm.style.marginTop = numToPixels(margin.t);
246
+ if (margin.b !== undefined)
247
+ elm.style.marginBottom = numToPixels(margin.b);
248
+ }
249
+ export function setPadding(elm, padding) {
250
+ if (padding.r !== undefined)
251
+ elm.style.paddingRight = numToPixels(padding.r);
252
+ if (padding.l !== undefined)
253
+ elm.style.paddingLeft = numToPixels(padding.l);
254
+ if (padding.t !== undefined)
255
+ elm.style.paddingTop = numToPixels(padding.t);
256
+ if (padding.b !== undefined)
257
+ elm.style.paddingBottom = numToPixels(padding.b);
258
+ }
259
+ export function setCenterPosition(elm, parent, options = { vertical: true, horizontal: true }) {
260
+ elm.style.position = 'absolute';
261
+ if (options.vertical)
262
+ elm.style.top = numToPixels(Math.round((parent.clientHeight / 2) - (elm.offsetHeight / 2)));
263
+ if (options.horizontal)
264
+ elm.style.left = numToPixels(Math.round((parent.clientWidth / 2) - (elm.offsetWidth / 2)));
265
+ }
266
+ export function setBorderWidth(elm, widths) {
267
+ if (widths.r != null)
268
+ elm.style.borderRightWidth = numToPixels(widths.r);
269
+ if (widths.b != null)
270
+ elm.style.borderBottomWidth = numToPixels(widths.b);
271
+ if (widths.l != null)
272
+ elm.style.borderLeftWidth = numToPixels(widths.l);
273
+ if (widths.t != null)
274
+ elm.style.borderTopWidth = numToPixels(widths.t);
275
+ }
276
+ export function fixPosition(pos, container) {
277
+ let x = Math.max(0, pos.x);
278
+ let y = Math.max(0, pos.y);
279
+ if (x + pos.w > container.clientWidth)
280
+ x = container.clientWidth - pos.w;
281
+ if (y + pos.h > container.clientHeight)
282
+ y = container.clientHeight - pos.h;
283
+ return { x, y };
284
+ }
285
+ export function zoomElement(elm, zoom) {
286
+ elm.style.transformOrigin = '0% 0% 0px';
287
+ elm.style.transform = `scale(${zoom})`;
288
+ }
289
+ let textMeasureContextMap;
290
+ export function measureText(text, font) {
291
+ if (!textMeasureContextMap)
292
+ textMeasureContextMap = new Map();
293
+ let textMeasureContext = textMeasureContextMap.get(font);
294
+ if (!textMeasureContext) {
295
+ const canvas = document.createElement('canvas');
296
+ textMeasureContext = canvas.getContext('2d');
297
+ textMeasureContext.font = font;
298
+ textMeasureContextMap.set(font, textMeasureContext);
299
+ }
300
+ return textMeasureContext.measureText(text);
301
+ }
302
+ export function query(selector, parent = document) {
303
+ return parent.querySelector(selector);
304
+ }
305
+ // export function measureElementContent(elm: HTMLElement, container?: HTMLElement) {
306
+ // container = container ??
307
+ // }
308
+ //# sourceMappingURL=dom.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dom.js","sourceRoot":"","sources":["../../src/common/dom.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAW,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGnC,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,SAAiB,SAAS,CAAC,MAAM;IACzE,OAAO,GAAG,MAAM,IAAI,IAAI,EAAE,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,IAAY,EAAE,CAA2B,EAAE,MAAc,IAAI,EAAE,SAAiB,SAAS,CAAC,MAAM;IACxH,cAAc,CAAC,MAAM,CAAC,GAAG,MAAM,IAAI,IAAI,EAAE,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,EAAC,OAAO,EAAE,GAAG,EAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;AACjF,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,GAAgB,EAAE,KAA0B;IACpE,KAAK,MAAM,QAAQ,IAAI,KAAK,EAAE,CAAC;QAC9B,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC;IACvC,CAAC;IACD,OAAO,GAAG,CAAC;AACZ,CAAC;AAQD,MAAM,UAAU,aAAa,CAAwB,OAAe,EAAE,KAA4B;I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AE,SAAqB,QAAQ;IACvE,OAAO,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAM,CAAC;AAC5C,CAAC;AAED,qFAAqF;AACrF,6BAA6B;AAC7B,IAAI","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport constants from '../constants';\nimport { debounce, Options } from 'ts-debounce';\nimport { isString } from './utils';\nimport { CssPosition, Rect } from '../types';\n\nexport function createName(name: string, prefix: string = constants.PREFIX) {\n\treturn `${prefix}-${name}`;\n}\n\nexport function register(name: string, c: CustomElementConstructor, ext: string = null, prefix: string = constants.PREFIX) {\n\tcustomElements.define(`${prefix}-${name}`, c, ext ? {extends: ext} : undefined);\n}\n\nexport function setStyle(elm: HTMLElement, style: CSSStyleDeclaration) : HTMLElement {\n\tfor (const styleKey in style) {\n\t\telm.style[styleKey] = style[styleKey];\n\t}\n\treturn elm;\n}\n\n\ntype ElementAttributes<T extends HTMLElement> = Omit<Partial<T>, 'style'> & {\n\tstyle?: Partial<CSSStyleDeclaration>,\n\tlisteners?: [string, EventListenerOrEventListenerObject][]\n}\n\nexport function createElement<T extends HTMLElement>(elmName: string, attrs?: ElementAttributes<T>) : T {\n\tconst elm = document.createElement(elmName) as T;\n\tif (attrs) {\n\t\tfor (const key in attrs) {\n\t\t\tswitch (key) {\n\t\t\t\tcase 'listeners':\n\t\t\t\t\tif (Array.isArray(attrs.listeners)) {\n\t\t\t\t\t\tfor (const listener of attrs.listeners) {\n\t\t\t\t\t\t\telm.addEventListener(listener[0], listener[1]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'style':\n\t\t\t\t\tif (typeof attrs[key] === 'object') {\n\t\t\t\t\t\tsetStyle(elm, attrs[key] as unknown as CSSStyleDeclaration);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t(elm as any)[key] = (attrs as any)[key];\n\t\t\t}\n\t\t}\n\t}\n\treturn elm;\n}\n\nexport function appendElement(parent: HTMLElement|DocumentFragment, child: HTMLElement) {\n\tparent.appendChild(child);\n\treturn parent as HTMLElement;\n}\n\nexport function showElement(elm: HTMLElement, defaultDisplayStyle = '') : HTMLElement {\n\tif (elm) elm.style.display = elm.dataset.display || defaultDisplayStyle || 'block';\n\treturn elm;\n}\n\nexport function hideElement(elm: HTMLElement) : HTMLElement {\n\tif (elm) {\n\t\telm.dataset.display = elm.style.display == 'none' ? '' : elm.style.display;\n\t\telm.style.display = 'none';\n\t}\n\treturn elm;\n}\n\nexport function isHidden(elm: HTMLElement) {\n\treturn elm.style.display == 'none';\n}\n\nexport function showCell(cell: HTMLTableCellElement) {\n\tcell.style.display = 'table-cell';\n}\n\nexport function hideCell(cell: HTMLTableCellElement) {\n\tcell.style.display = 'none';\n}\n\nexport function empty<T extends HTMLElement|ShadowRoot>(elm: T) : T {\n\telm.innerHTML = '';\n\treturn elm;\n}\n\nexport function remove(elm: HTMLElement) {\n\telm.parentNode?.removeChild(elm);\n}\n\nexport function findParent<T extends HTMLElement>(elm: HTMLElement, selector: string|((elm: HTMLElement) => boolean)) : T {\n\tconst predicate = typeof selector === 'string' \n\t\t? (elm: HTMLElement) => elm.matches(selector as string) \n\t\t: selector;\n\t\t\n\twhile (elm.parentNode) {\n\t\telm = elm.parentNode as HTMLElement;\n\t\tif (elm instanceof ShadowRoot && elm.host) elm = elm.host as HTMLElement;\n\t\tif (elm instanceof HTMLElement && predicate(elm)) return elm as T;\t\n\t}\n\treturn null;\n}\n\ntype OnCallbackFunction<T extends Event> = (e: T, elm: HTMLElement) => void;\n\nexport function on<T extends Event>(elm: HTMLElement, event: string, selector: string, matchCallback: OnCallbackFunction<T>, notMatchCallback?: OnCallbackFunction<T>) : HTMLElement {\n\telm.addEventListener(event, (e: T) => {\n\t\tfor (const parent of e.composedPath() as HTMLElement[]) {\n\t\t\tif (parent.matches && parent.matches(selector)) {\n\t\t\t\tmatchCallback(e, parent);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (notMatchCallback) {\n\t\t\tnotMatchCallback(e, null);\n\t\t}\n\t});\n\treturn elm;\n}\n\nexport function debounceOn<T extends Event>(elm: HTMLElement, event: string, selector: string, callback: OnCallbackFunction<T>, options?: {\n\twait?: number, \n\tnoMatchCallback?: OnCallbackFunction<T>\n} & Options<void>) : HTMLElement {\n\tconst origCallback = (e: T, path: HTMLElement[]) => {\n\t\tfor (const parent of path) {\n\t\t\tif (parent.matches && parent.matches(selector)) {\n\t\t\t\tcallback(e, parent);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (options?.noMatchCallback) options.noMatchCallback(e, null);\n\t};\n\n\tconst debouncedCallback = debounce((e, path: HTMLElement[]) => origCallback(e, path), options.wait, options);\n\telm.addEventListener(event, (e: T) => debouncedCallback(e, e.composedPath() as HTMLElement[]));\t\n\treturn elm;\n}\n\nexport function setClasses(elm: HTMLElement, classes?: string[]) : HTMLElement {\n\telm.className = classes ? classes.reduce((prev, cur, i) => prev + (cur ? ((i == 0 ? '' : ' ') + cur) : ''), '') : '';\n\treturn elm;\n}\n\nexport function getElementOffset(elm: HTMLElement, offsetElm: HTMLElement) : {top: number, left: number} {\n\tlet x = 0;\n\tlet y = 0;\n\twhile(elm && !isNaN(elm.offsetLeft) && !isNaN(elm.offsetTop) && (!offsetElm || offsetElm !== elm)) {\n\t\tx += elm.offsetLeft - elm.scrollLeft;\n\t\ty += elm.offsetTop - elm.scrollTop;\n\t\telm = elm.offsetParent as HTMLElement;\n\t}\n\treturn { top: y, left: x };\n}\n\nexport function appendStyle(elm: HTMLElement|DocumentFragment, style: string, id: string = null) : Node {\n\tif (style) {\n\t\tlet styleElm = id ? elm.querySelector('#' + id) : null;\n\t\tif (!styleElm) {\n\t\t\tstyleElm = createElement('style');\n\t\t\tif (id) styleElm.id = id;\n\t\t}\n\t\t\n\t\tstyleElm.innerHTML = style;\n\t\t\n\t\tif (!styleElm.parentElement) {\n\t\t\telm.appendChild(styleElm);\n\t\t}\n\t}\n\treturn elm;\n}\n\nexport function appendScript(elm: HTMLElement|DocumentFragment, js: string, id: string = null) : Node {\n\tif (!js) return elm; \n\tlet scriptElm = id ? elm.querySelector('#' + id) : null;\n\tif (!scriptElm) {\n\t\tscriptElm = createElement('script');\n\t\tif (id) scriptElm.id = id;\n\t}\n\t\n\tscriptElm.textContent = js;\n\t\n\tif (!scriptElm.parentElement) {\n\t\telm.appendChild(scriptElm);\n\t}\n\t\n\treturn elm;\n}\n\nexport function numToPixels(n: number) : string {\n\treturn isNaN(n) ? '0' : n.toString() + 'px';\n}\n\nexport const px = numToPixels;\n\nexport function setSize(elm: HTMLElement, size: {w?: number|string, h?: number|string}, minSize = false) : HTMLElement {\n\tif (!elm) return;\n\tif (size.w != null) elm.style[minSize ? 'minWidth' : 'width'] = isString(size.w) ? size.w as string : numToPixels(size.w as number);\n\tif (size.h != null) elm.style[minSize ? 'minHeight' : 'height'] = isString(size.h) ? size.h as string : numToPixels(size.h as number);\n\treturn elm;\n}\n\nexport function setMaxSize(elm: HTMLElement, size: {w?: number|string, h?: number|string}) : HTMLElement {\n\tif (size.w != null) elm.style['maxWidth'] = isString(size.w) ? size.w as string : numToPixels(size.w as number);\n\tif (size.h != null) elm.style['maxHeight'] = isString(size.h) ? size.h as string : numToPixels(size.h as number);\n\treturn elm;\n}\n\nexport function setMinSize(elm: HTMLElement, size: {w?: number|string, h?: number|string}) : HTMLElement {\n\tif (size.w != null) elm.style['minWidth'] = isString(size.w) ? size.w as string : numToPixels(size.w as number);\n\tif (size.h != null) elm.style['minHeight'] = isString(size.h) ? size.h as string : numToPixels(size.h as number);\n\treturn elm;\n}\n\nexport function setPosition(elm: HTMLElement|SVGElement, position: CssPosition) {\n\telm.style.position = 'absolute';\n\tif (position.r != null) elm.style.right = typeof position.r === 'string' ? position.r : numToPixels(position.r);\n\tif (position.b != null) elm.style.bottom = typeof position.b === 'string' ? position.b : numToPixels(position.b);\n\tif (position.l != null) elm.style.left = typeof position.l === 'string' ? position.l : numToPixels(position.l);\n\tif (position.t != null) elm.style.top = typeof position.t === 'string' ? position.t : numToPixels(position.t);\n}\n\nexport function setInset(elm: HTMLElement|SVGElement, value: number) {\n\telm.style.position = 'absolute';\n\telm.style.inset = numToPixels(value);\n}\n\nexport function getBounds(elm: HTMLElement): Rect {\n\treturn {\n\t\tx: elm.offsetLeft,\n\t\ty: elm.offsetTop,\n\t\tw: elm.offsetWidth,\n\t\th: elm.offsetHeight\n\t}\n}\n\nexport function setBounds(elm: HTMLElement, bounds: Rect) {\n\tsetPosition(elm, {l: bounds.x, t: bounds.y});\n\tsetSize(elm, {w: bounds.w, h: bounds.h});\n}\n\nexport function setLineHeight(elm: HTMLElement, height: number) {\n\telm.style.lineHeight = numToPixels(height);\n}\n\nexport function fixElementPosition(elm: HTMLElement, offsetElement: HTMLElement = null) {\n\toffsetElement = offsetElement || elm.parentElement;\n\tconst offset = getElementOffset(elm as HTMLElement, offsetElement);\n\tconst fixedPosition = fixPosition({\n\t\tx: offset.left,\n\t\ty: offset.top,\n\t\tw: (elm as HTMLElement).offsetWidth,\n\t\th: (elm as HTMLElement).offsetHeight\n\t}, offsetElement);\n\tsetPosition(elm, {l: fixedPosition.x, t: fixedPosition.y});\n}\n\nexport function fixElementSize(elm: HTMLElement, container: HTMLElement = null) {\n\tcontainer = container || elm.parentElement;\n\tif (container.offsetWidth < elm.offsetWidth || container.offsetHeight < elm.offsetHeight) {\n\t\tsetSize(elm, {\n\t\t\tw: Math.min(container.offsetWidth, elm.offsetWidth),\n\t\t\th: Math.min(container.offsetHeight, elm.offsetHeight),\n\t\t});\n\t}\n}\n\nexport function setZIndex(elm: HTMLElement, zIndex: number) {\n\telm.style.zIndex = zIndex.toString();\n}\n\nexport function setMargin(elm: HTMLElement, margin: {r?: number, b?: number, l?: number, t?: number}) {\n\tif (margin.r !== undefined) elm.style.marginRight = numToPixels(margin.r);\n\tif (margin.l !== undefined) elm.style.marginLeft = numToPixels(margin.l);\n\tif (margin.t !== undefined) elm.style.marginTop = numToPixels(margin.t);\n\tif (margin.b !== undefined) elm.style.marginBottom = numToPixels(margin.b);\n}\n\nexport function setPadding(elm: HTMLElement, padding: {r?: number, b?: number, l?: number, t?: number}) {\n\tif (padding.r !== undefined) elm.style.paddingRight = numToPixels(padding.r);\n\tif (padding.l !== undefined) elm.style.paddingLeft = numToPixels(padding.l);\n\tif (padding.t !== undefined) elm.style.paddingTop = numToPixels(padding.t);\n\tif (padding.b !== undefined) elm.style.paddingBottom = numToPixels(padding.b);\n}\n\nexport function setCenterPosition(\n\telm: HTMLElement,\n\tparent: HTMLElement,\n\toptions: {vertical: boolean, horizontal: boolean} = {vertical: true, horizontal: true}\n) {\n\telm.style.position = 'absolute';\n\tif (options.vertical) elm.style.top = numToPixels(Math.round((parent.clientHeight / 2) - (elm.offsetHeight / 2)));\n\tif (options.horizontal) elm.style.left = numToPixels(Math.round((parent.clientWidth / 2) - (elm.offsetWidth / 2)));\n}\n\nexport function setBorderWidth(elm: HTMLElement, widths: {r?: number, b?: number, l?: number, t?: number}) {\n\tif (widths.r != null) elm.style.borderRightWidth = numToPixels(widths.r);\n\tif (widths.b != null) elm.style.borderBottomWidth = numToPixels(widths.b);\n\tif (widths.l != null) elm.style.borderLeftWidth = numToPixels(widths.l);\n\tif (widths.t != null) elm.style.borderTopWidth = numToPixels(widths.t);\n}\n\nexport function fixPosition(pos: {x: number, y: number, w: number, h: number}, container: HTMLElement) : {x: number, y: number} {\n\tlet x = Math.max(0, pos.x);\n\tlet y = Math.max(0, pos.y);\n\tif (x + pos.w > container.clientWidth) x = container.clientWidth - pos.w;\n\tif (y + pos.h > container.clientHeight) y = container.clientHeight - pos.h;\n\treturn {x, y};\n}\n\nexport function zoomElement(elm: HTMLElement, zoom: number) {\n\telm.style.transformOrigin = '0% 0% 0px';\n\telm.style.transform = `scale(${zoom})`;\n}\n\n\nlet textMeasureContextMap: Map<string, CanvasRenderingContext2D>;\nexport function measureText(text: string, font: string) {\n\tif (!textMeasureContextMap) textMeasureContextMap = new Map();\n\tlet textMeasureContext = textMeasureContextMap.get(font);\n\tif (!textMeasureContext) {\n\t\tconst canvas = document.createElement('canvas');\n\t\ttextMeasureContext = canvas.getContext('2d');\n\t\ttextMeasureContext.font = font;\n\t\ttextMeasureContextMap.set(font, textMeasureContext);\n\t}\n\treturn textMeasureContext.measureText(text);\n}\n\nexport function query<T>(selector: string, parent: ParentNode = document) : T {\n\treturn parent.querySelector(selector) as T;\n}\n\n// export function measureElementContent(elm: HTMLElement, container?: HTMLElement) {\n// \tcontainer = container ?? \n// }\n"]}
@@ -0,0 +1,15 @@
1
+ export declare class ChangeEvent<TValue = any> extends Event {
2
+ readonly value: TValue;
3
+ readonly oldValue: TValue;
4
+ constructor(args?: Partial<ChangeEvent> | TValue);
5
+ }
6
+ export declare class AddEvent<TValue = any> extends Event {
7
+ readonly value: TValue;
8
+ readonly oldValue: TValue;
9
+ constructor(args?: Partial<AddEvent> | TValue);
10
+ }
11
+ export declare class SerialzieEvent<TValue = any> extends Event {
12
+ data: TValue;
13
+ constructor(data: TValue);
14
+ }
15
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/common/events.ts"],"names":[],"mappings":"AAIA,qBAAa,WAAW,CAAC,MAAM,GAAG,GAAG,CAAE,SAAQ,KAAK;IAEnD,SAAgB,KAAK,EAAE,MAAM,CAAC;IAC9B,SAAgB,QAAQ,EAAE,MAAM,CAAC;gBAErB,IAAI,GAAE,OAAO,CAAC,WAAW,CAAC,GAAC,MAAW;CAUlD;AAED,qBAAa,QAAQ,CAAC,MAAM,GAAG,GAAG,CAAE,SAAQ,KAAK;IAEhD,SAAgB,KAAK,EAAE,MAAM,CAAC;IAC9B,SAAgB,QAAQ,EAAE,MAAM,CAAC;gBAErB,IAAI,GAAE,OAAO,CAAC,QAAQ,CAAC,GAAC,MAAW;CAQ/C;AAED,qBAAa,cAAc,CAAC,MAAM,GAAG,GAAG,CAAE,SAAQ,KAAK;IACnC,IAAI,EAAE,MAAM;gBAAZ,IAAI,EAAE,MAAM;CAG/B"}
@@ -0,0 +1,33 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ import { isObject } from "../common/utils";
3
+ export class ChangeEvent extends Event {
4
+ constructor(args = {}) {
5
+ if (isObject(args)) {
6
+ super(args.type ?? 'change');
7
+ this.value = args.value;
8
+ this.oldValue = args.oldValue;
9
+ }
10
+ else {
11
+ super('change');
12
+ this.value = args;
13
+ }
14
+ }
15
+ }
16
+ export class AddEvent extends Event {
17
+ constructor(args = {}) {
18
+ super('add');
19
+ if (isObject(args)) {
20
+ Object.assign(this, args);
21
+ }
22
+ else {
23
+ this.value = args;
24
+ }
25
+ }
26
+ }
27
+ export class SerialzieEvent extends Event {
28
+ constructor(data) {
29
+ super('serialize');
30
+ this.data = data;
31
+ }
32
+ }
33
+ //# sourceMappingURL=events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/common/events.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,MAAM,OAAO,WAA0B,SAAQ,KAAK;IAKnD,YAAY,OAAoC,EAAE;QACjD,IAAI,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YACpB,KAAK,CAAE,IAAY,CAAC,IAAI,IAAI,QAAQ,CAAC,CAAC;YACtC,IAAI,CAAC,KAAK,GAAI,IAAY,CAAC,KAAK,CAAC;YACjC,IAAI,CAAC,QAAQ,GAAI,IAAY,CAAC,QAAQ,CAAC;QACxC,CAAC;aAAM,CAAC;YACP,KAAK,CAAC,QAAQ,CAAC,CAAC;YAChB,IAAI,CAAC,KAAK,GAAG,IAAc,CAAC;QAC7B,CAAC;IACF,CAAC;CACD;AAED,MAAM,OAAO,QAAuB,SAAQ,KAAK;IAKhD,YAAY,OAAiC,EAAE;QAC9C,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YACpB,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC3B,CAAC;aAAM,CAAC;YACP,IAAI,CAAC,KAAK,GAAG,IAAc,CAAC;QAC7B,CAAC;IACF,CAAC;CACD;AAED,MAAM,OAAO,cAA6B,SAAQ,KAAK;IACtD,YAAmB,IAAY;QAC9B,KAAK,CAAC,WAAW,CAAC,CAAC;QADD,SAAI,GAAJ,IAAI,CAAQ;IAE/B,CAAC;CACD","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport { isObject } from \"../common/utils\";\n\nexport class ChangeEvent<TValue = any> extends Event {\n\n\tpublic readonly value: TValue;\n\tpublic readonly oldValue: TValue;\n\n\tconstructor(args: Partial<ChangeEvent>|TValue = {}) {\n\t\tif (isObject(args)) {\n\t\t\tsuper((args as any).type ?? 'change');\n\t\t\tthis.value = (args as any).value;\n\t\t\tthis.oldValue = (args as any).oldValue;\n\t\t} else {\n\t\t\tsuper('change');\n\t\t\tthis.value = args as TValue;\n\t\t}\n\t}\n}\n\nexport class AddEvent<TValue = any> extends Event {\n\n\tpublic readonly value: TValue;\n\tpublic readonly oldValue: TValue;\n\n\tconstructor(args: Partial<AddEvent>|TValue = {}) {\n\t\tsuper('add');\n\t\tif (isObject(args)) {\n\t\t\tObject.assign(this, args);\n\t\t} else {\n\t\t\tthis.value = args as TValue;\n\t\t}\n\t}\n}\n\nexport class SerialzieEvent<TValue = any> extends Event {\n\tconstructor(public data: TValue) {\n\t\tsuper('serialize');\n\t}\n}\n"]}
@@ -0,0 +1,3 @@
1
+ export declare function escapeHTML(text: string): string;
2
+ export declare function highlightText(text: string, segments: [number, number][], color?: string): string;
3
+ //# sourceMappingURL=html.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../src/common/html.ts"],"names":[],"mappings":"AAUA,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,UAEtC;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE,KAAK,GAAE,MAA+C,UAW/H"}
@@ -0,0 +1,25 @@
1
+ import constants from "../constants";
2
+ const tagsToReplace = {
3
+ '&': '&amp;',
4
+ '<': '&lt;',
5
+ '>': '&gt;'
6
+ };
7
+ const replaceTag = (tag) => tagsToReplace[tag] || tag;
8
+ export function escapeHTML(text) {
9
+ return text.replace(/[&<>]/g, replaceTag);
10
+ }
11
+ export function highlightText(text, segments, color = constants.DEFAULT_TEXT_HIGHLIGHT_COLOR) {
12
+ const chunks = [];
13
+ let min = 0, max = 0;
14
+ for (const seg of segments) {
15
+ min = seg[0];
16
+ if (max < min)
17
+ chunks.push(escapeHTML(text.substring(max, min)));
18
+ max = seg[1];
19
+ chunks.push(`<span style="color:${color}">${escapeHTML(text.substring(min, max))}</span>`);
20
+ }
21
+ if (max < text.length)
22
+ chunks.push(escapeHTML(text.substring(max)));
23
+ return chunks.join('');
24
+ }
25
+ //# sourceMappingURL=html.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"html.js","sourceRoot":"","sources":["../../src/common/html.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,MAAM,aAAa,GAA2B;IAC1C,GAAG,EAAE,OAAO;IACZ,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,MAAM;CACd,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC;AAE9D,MAAM,UAAU,UAAU,CAAC,IAAY;IACnC,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,IAAY,EAAE,QAA4B,EAAE,QAAgB,SAAS,CAAC,4BAA4B;IAC5H,MAAM,MAAM,GAAG,EAAE,CAAC;IAClB,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC;IACrB,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;QACzB,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QACb,IAAI,GAAG,GAAG,GAAG;YAAE,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;QACjE,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QACb,MAAM,CAAC,IAAI,CAAC,sBAAsB,KAAK,KAAK,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC;IAC/F,CAAC;IACD,IAAI,GAAG,GAAG,IAAI,CAAC,MAAM;QAAE,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACpE,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC3B,CAAC","sourcesContent":["import constants from \"../constants\";\n\nconst tagsToReplace: Record<string, string> = {\n '&': '&amp;',\n '<': '&lt;',\n '>': '&gt;'\n};\n\nconst replaceTag = (tag: string) => tagsToReplace[tag] || tag;\n\nexport function escapeHTML(text: string) {\n return text.replace(/[&<>]/g, replaceTag);\n}\n\nexport function highlightText(text: string, segments: [number, number][], color: string = constants.DEFAULT_TEXT_HIGHLIGHT_COLOR) {\n const chunks = [];\n let min = 0, max = 0;\n for (const seg of segments) {\n min = seg[0];\n if (max < min) chunks.push(escapeHTML(text.substring(max, min)));\n max = seg[1];\n chunks.push(`<span style=\"color:${color}\">${escapeHTML(text.substring(min, max))}</span>`);\n }\n if (max < text.length) chunks.push(escapeHTML(text.substring(max)));\n return chunks.join('');\n}"]}
@@ -0,0 +1,19 @@
1
+ export * as dom from './dom';
2
+ export * as html from './html';
3
+ export * as numbers from './numbers';
4
+ export * as dates from './dates';
5
+ export * as csv from './csv';
6
+ export * as log from './logger';
7
+ export * as tree from './tree';
8
+ export * as colors from './colors';
9
+ export * as actions from './actions';
10
+ export * as utils from './utils';
11
+ export * as matrix from './matrix';
12
+ export * as events from './events';
13
+ export * as paper from './paper';
14
+ export * as device from './device';
15
+ export * from './options';
16
+ export * from './loaders';
17
+ export * from './linkedList';
18
+ export * from './shortcutManager';
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,19 @@
1
+ export * as dom from './dom';
2
+ export * as html from './html';
3
+ export * as numbers from './numbers';
4
+ export * as dates from './dates';
5
+ export * as csv from './csv';
6
+ export * as log from './logger';
7
+ export * as tree from './tree';
8
+ export * as colors from './colors';
9
+ export * as actions from './actions';
10
+ export * as utils from './utils';
11
+ export * as matrix from './matrix';
12
+ export * as events from './events';
13
+ export * as paper from './paper';
14
+ export * as device from './device';
15
+ export * from './options';
16
+ export * from './loaders';
17
+ export * from './linkedList';
18
+ export * from './shortcutManager';
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC","sourcesContent":["export * as dom from './dom';\nexport * as html from './html';\nexport * as numbers from './numbers';\nexport * as dates from './dates';\nexport * as csv from './csv';\nexport * as log from './logger';\nexport * as tree from './tree';\nexport * as colors from './colors';\nexport * as actions from './actions';\nexport * as utils from './utils';\nexport * as matrix from './matrix';\nexport * as events from './events';\nexport * as paper from './paper';\nexport * as device from './device';\nexport * from './options';\nexport * from './loaders';\nexport * from './linkedList';\nexport * from './shortcutManager';"]}
@@ -0,0 +1,24 @@
1
+ export declare class LinkedListNode<T> {
2
+ data: T;
3
+ next: LinkedListNode<T> | null;
4
+ prev: LinkedListNode<T> | null;
5
+ constructor(data: T);
6
+ }
7
+ export interface ILinkedList<T> {
8
+ insertInBegin(data: T): LinkedListNode<T>;
9
+ insertAtEnd(data: T): LinkedListNode<T>;
10
+ deleteNode(node: LinkedListNode<T>): void;
11
+ traverse(): T[];
12
+ size(): number;
13
+ search(comparator: (data: T) => boolean): LinkedListNode<T> | null;
14
+ }
15
+ export declare class LinkedList<T> implements ILinkedList<T> {
16
+ private head;
17
+ insertAtEnd(data: T): LinkedListNode<T>;
18
+ insertInBegin(data: T): LinkedListNode<T>;
19
+ deleteNode(node: LinkedListNode<T>): void;
20
+ search(comparator: (data: T) => boolean): LinkedListNode<T> | null;
21
+ traverse(): T[];
22
+ size(): number;
23
+ }
24
+ //# sourceMappingURL=linkedList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"linkedList.d.ts","sourceRoot":"","sources":["../../src/common/linkedList.ts"],"names":[],"mappings":"AAAA,qBAAa,cAAc,CAAC,CAAC;IAGT,IAAI,EAAE,CAAC;IAFnB,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,IAAI,CAAQ;IACtC,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,IAAI,CAAQ;gBAC1B,IAAI,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,WAAW,CAAC,CAAC;IAC7B,aAAa,CAAC,IAAI,EAAE,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;IAC1C,WAAW,CAAC,IAAI,EAAE,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;IACxC,UAAU,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,IAAI,C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