@contember/utilities 2.0.0-alpha.2 → 2.0.0-alpha.21

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 (291) hide show
  1. package/api-extractor.json +3 -0
  2. package/dist/development/index.cjs +10 -33
  3. package/dist/development/index.cjs.map +1 -1
  4. package/dist/development/index.js +11 -34
  5. package/dist/development/index.js.map +1 -1
  6. package/dist/development/src/assert-types/assertNever.cjs.map +1 -0
  7. package/dist/development/src/assert-types/assertNever.js.map +1 -0
  8. package/dist/development/{deprecate → src/deprecate}/deprecate.cjs +1 -2
  9. package/dist/development/src/deprecate/deprecate.cjs.map +1 -0
  10. package/dist/development/{deprecate → src/deprecate}/deprecate.js +1 -2
  11. package/dist/development/src/deprecate/deprecate.js.map +1 -0
  12. package/dist/development/src/dom/dataAttribute.cjs.map +1 -0
  13. package/dist/development/src/dom/dataAttribute.js.map +1 -0
  14. package/dist/development/src/dom/svgSizeProps.cjs.map +1 -0
  15. package/dist/development/src/dom/svgSizeProps.js.map +1 -0
  16. package/dist/development/src/structures/BijectiveIndexedMap.cjs +116 -0
  17. package/dist/development/src/structures/BijectiveIndexedMap.cjs.map +1 -0
  18. package/dist/development/src/structures/BijectiveIndexedMap.js +116 -0
  19. package/dist/development/src/structures/BijectiveIndexedMap.js.map +1 -0
  20. package/dist/development/src/structures/LRUCache.cjs +32 -0
  21. package/dist/development/src/structures/LRUCache.cjs.map +1 -0
  22. package/dist/development/src/structures/LRUCache.js +32 -0
  23. package/dist/development/src/structures/LRUCache.js.map +1 -0
  24. package/dist/development/src/structures/WeakIdCache.cjs +30 -0
  25. package/dist/development/src/structures/WeakIdCache.cjs.map +1 -0
  26. package/dist/development/src/structures/WeakIdCache.js +30 -0
  27. package/dist/development/src/structures/WeakIdCache.js.map +1 -0
  28. package/dist/production/index.cjs +10 -33
  29. package/dist/production/index.cjs.map +1 -1
  30. package/dist/production/index.js +11 -34
  31. package/dist/production/index.js.map +1 -1
  32. package/dist/production/src/assert-types/assertNever.cjs.map +1 -0
  33. package/dist/production/src/assert-types/assertNever.js.map +1 -0
  34. package/dist/production/src/deprecate/deprecate.cjs.map +1 -0
  35. package/dist/production/src/deprecate/deprecate.js.map +1 -0
  36. package/dist/production/src/dom/dataAttribute.cjs.map +1 -0
  37. package/dist/production/src/dom/dataAttribute.js.map +1 -0
  38. package/dist/production/src/dom/svgSizeProps.cjs.map +1 -0
  39. package/dist/production/src/dom/svgSizeProps.js.map +1 -0
  40. package/dist/production/src/structures/BijectiveIndexedMap.cjs +116 -0
  41. package/dist/production/src/structures/BijectiveIndexedMap.cjs.map +1 -0
  42. package/dist/production/src/structures/BijectiveIndexedMap.js +116 -0
  43. package/dist/production/src/structures/BijectiveIndexedMap.js.map +1 -0
  44. package/dist/production/src/structures/LRUCache.cjs +32 -0
  45. package/dist/production/src/structures/LRUCache.cjs.map +1 -0
  46. package/dist/production/src/structures/LRUCache.js +32 -0
  47. package/dist/production/src/structures/LRUCache.js.map +1 -0
  48. package/dist/production/src/structures/WeakIdCache.cjs +30 -0
  49. package/dist/production/src/structures/WeakIdCache.cjs.map +1 -0
  50. package/dist/production/src/structures/WeakIdCache.js +30 -0
  51. package/dist/production/src/structures/WeakIdCache.js.map +1 -0
  52. package/dist/types/assert-types/index.d.ts +0 -4
  53. package/dist/types/assert-types/index.d.ts.map +1 -1
  54. package/dist/types/dom/index.d.ts +0 -4
  55. package/dist/types/dom/index.d.ts.map +1 -1
  56. package/dist/types/dom/svgSizeProps.d.ts.map +1 -1
  57. package/dist/types/index.d.ts +1 -6
  58. package/dist/types/index.d.ts.map +1 -1
  59. package/dist/types/structures/BijectiveIndexedMap.d.ts +24 -0
  60. package/dist/types/structures/BijectiveIndexedMap.d.ts.map +1 -0
  61. package/dist/types/structures/LRUCache.d.ts +9 -0
  62. package/dist/types/structures/LRUCache.d.ts.map +1 -0
  63. package/dist/types/structures/WeakIdCache.d.ts +9 -0
  64. package/dist/types/structures/WeakIdCache.d.ts.map +1 -0
  65. package/dist/types/structures/index.d.ts +4 -0
  66. package/dist/types/structures/index.d.ts.map +1 -0
  67. package/dist/types/tsconfig.tsbuildinfo +1 -1
  68. package/dist/types/types/index.d.ts +0 -1
  69. package/dist/types/types/index.d.ts.map +1 -1
  70. package/package.json +4 -12
  71. package/src/assert-types/index.ts +0 -4
  72. package/src/dom/index.ts +0 -4
  73. package/src/dom/svgSizeProps.ts +3 -3
  74. package/src/index.ts +1 -6
  75. package/src/structures/BijectiveIndexedMap.ts +137 -0
  76. package/src/structures/LRUCache.ts +29 -0
  77. package/src/structures/WeakIdCache.ts +25 -0
  78. package/src/structures/index.ts +3 -0
  79. package/src/tsconfig.json +4 -1
  80. package/src/types/index.ts +0 -1
  81. package/tests/dom/dataAttribute.test.ts +13 -0
  82. package/tests/dom/svgSizeProps.test.ts +22 -0
  83. package/tests/tsconfig.json +10 -0
  84. package/tsconfig.json +8 -0
  85. package/tsdoc.json +6 -0
  86. package/vitest.config.ts +3 -0
  87. package/dist/development/assert-types/AssertionError.cjs +0 -9
  88. package/dist/development/assert-types/AssertionError.cjs.map +0 -1
  89. package/dist/development/assert-types/AssertionError.js +0 -9
  90. package/dist/development/assert-types/AssertionError.js.map +0 -1
  91. package/dist/development/assert-types/Predicates.cjs +0 -7
  92. package/dist/development/assert-types/Predicates.cjs.map +0 -1
  93. package/dist/development/assert-types/Predicates.js +0 -7
  94. package/dist/development/assert-types/Predicates.js.map +0 -1
  95. package/dist/development/assert-types/assert.cjs +0 -10
  96. package/dist/development/assert-types/assert.cjs.map +0 -1
  97. package/dist/development/assert-types/assert.js +0 -10
  98. package/dist/development/assert-types/assert.js.map +0 -1
  99. package/dist/development/assert-types/assertNever.cjs.map +0 -1
  100. package/dist/development/assert-types/assertNever.js.map +0 -1
  101. package/dist/development/css-utilities/px.cjs +0 -7
  102. package/dist/development/css-utilities/px.cjs.map +0 -1
  103. package/dist/development/css-utilities/px.js +0 -7
  104. package/dist/development/css-utilities/px.js.map +0 -1
  105. package/dist/development/data-utilities/dateToStringWithoutTimezone.cjs +0 -20
  106. package/dist/development/data-utilities/dateToStringWithoutTimezone.cjs.map +0 -1
  107. package/dist/development/data-utilities/dateToStringWithoutTimezone.js +0 -20
  108. package/dist/development/data-utilities/dateToStringWithoutTimezone.js.map +0 -1
  109. package/dist/development/deprecate/deprecate.cjs.map +0 -1
  110. package/dist/development/deprecate/deprecate.js.map +0 -1
  111. package/dist/development/dom/dataAttribute.cjs.map +0 -1
  112. package/dist/development/dom/dataAttribute.js.map +0 -1
  113. package/dist/development/dom/getElementDimensions.cjs +0 -22
  114. package/dist/development/dom/getElementDimensions.cjs.map +0 -1
  115. package/dist/development/dom/getElementDimensions.js +0 -22
  116. package/dist/development/dom/getElementDimensions.js.map +0 -1
  117. package/dist/development/dom/getSizeFromResizeObserverEntry.cjs +0 -24
  118. package/dist/development/dom/getSizeFromResizeObserverEntry.cjs.map +0 -1
  119. package/dist/development/dom/getSizeFromResizeObserverEntry.js +0 -24
  120. package/dist/development/dom/getSizeFromResizeObserverEntry.js.map +0 -1
  121. package/dist/development/dom/shouldCancelStart.cjs +0 -29
  122. package/dist/development/dom/shouldCancelStart.cjs.map +0 -1
  123. package/dist/development/dom/shouldCancelStart.js +0 -29
  124. package/dist/development/dom/shouldCancelStart.js.map +0 -1
  125. package/dist/development/dom/stateDataAttributes.cjs +0 -11
  126. package/dist/development/dom/stateDataAttributes.cjs.map +0 -1
  127. package/dist/development/dom/stateDataAttributes.js +0 -11
  128. package/dist/development/dom/stateDataAttributes.js.map +0 -1
  129. package/dist/development/dom/svgSizeProps.cjs.map +0 -1
  130. package/dist/development/dom/svgSizeProps.js.map +0 -1
  131. package/dist/development/events/isSpecialLinkClick.cjs +0 -5
  132. package/dist/development/events/isSpecialLinkClick.cjs.map +0 -1
  133. package/dist/development/events/isSpecialLinkClick.js +0 -5
  134. package/dist/development/events/isSpecialLinkClick.js.map +0 -1
  135. package/dist/development/functional/omit.cjs +0 -15
  136. package/dist/development/functional/omit.cjs.map +0 -1
  137. package/dist/development/functional/omit.js +0 -15
  138. package/dist/development/functional/omit.js.map +0 -1
  139. package/dist/development/functional/pick.cjs +0 -15
  140. package/dist/development/functional/pick.cjs.map +0 -1
  141. package/dist/development/functional/pick.js +0 -15
  142. package/dist/development/functional/pick.js.map +0 -1
  143. package/dist/development/functional/range.cjs +0 -7
  144. package/dist/development/functional/range.cjs.map +0 -1
  145. package/dist/development/functional/range.js +0 -7
  146. package/dist/development/functional/range.js.map +0 -1
  147. package/dist/development/string-utilities/kebabCase.cjs +0 -8
  148. package/dist/development/string-utilities/kebabCase.cjs.map +0 -1
  149. package/dist/development/string-utilities/kebabCase.js +0 -8
  150. package/dist/development/string-utilities/kebabCase.js.map +0 -1
  151. package/dist/production/assert-types/AssertionError.cjs +0 -9
  152. package/dist/production/assert-types/AssertionError.cjs.map +0 -1
  153. package/dist/production/assert-types/AssertionError.js +0 -9
  154. package/dist/production/assert-types/AssertionError.js.map +0 -1
  155. package/dist/production/assert-types/Predicates.cjs +0 -7
  156. package/dist/production/assert-types/Predicates.cjs.map +0 -1
  157. package/dist/production/assert-types/Predicates.js +0 -7
  158. package/dist/production/assert-types/Predicates.js.map +0 -1
  159. package/dist/production/assert-types/assert.cjs +0 -10
  160. package/dist/production/assert-types/assert.cjs.map +0 -1
  161. package/dist/production/assert-types/assert.js +0 -10
  162. package/dist/production/assert-types/assert.js.map +0 -1
  163. package/dist/production/assert-types/assertNever.cjs.map +0 -1
  164. package/dist/production/assert-types/assertNever.js.map +0 -1
  165. package/dist/production/css-utilities/px.cjs +0 -7
  166. package/dist/production/css-utilities/px.cjs.map +0 -1
  167. package/dist/production/css-utilities/px.js +0 -7
  168. package/dist/production/css-utilities/px.js.map +0 -1
  169. package/dist/production/data-utilities/dateToStringWithoutTimezone.cjs +0 -20
  170. package/dist/production/data-utilities/dateToStringWithoutTimezone.cjs.map +0 -1
  171. package/dist/production/data-utilities/dateToStringWithoutTimezone.js +0 -20
  172. package/dist/production/data-utilities/dateToStringWithoutTimezone.js.map +0 -1
  173. package/dist/production/deprecate/deprecate.cjs.map +0 -1
  174. package/dist/production/deprecate/deprecate.js.map +0 -1
  175. package/dist/production/dom/dataAttribute.cjs.map +0 -1
  176. package/dist/production/dom/dataAttribute.js.map +0 -1
  177. package/dist/production/dom/getElementDimensions.cjs +0 -22
  178. package/dist/production/dom/getElementDimensions.cjs.map +0 -1
  179. package/dist/production/dom/getElementDimensions.js +0 -22
  180. package/dist/production/dom/getElementDimensions.js.map +0 -1
  181. package/dist/production/dom/getSizeFromResizeObserverEntry.cjs +0 -24
  182. package/dist/production/dom/getSizeFromResizeObserverEntry.cjs.map +0 -1
  183. package/dist/production/dom/getSizeFromResizeObserverEntry.js +0 -24
  184. package/dist/production/dom/getSizeFromResizeObserverEntry.js.map +0 -1
  185. package/dist/production/dom/shouldCancelStart.cjs +0 -29
  186. package/dist/production/dom/shouldCancelStart.cjs.map +0 -1
  187. package/dist/production/dom/shouldCancelStart.js +0 -29
  188. package/dist/production/dom/shouldCancelStart.js.map +0 -1
  189. package/dist/production/dom/stateDataAttributes.cjs +0 -11
  190. package/dist/production/dom/stateDataAttributes.cjs.map +0 -1
  191. package/dist/production/dom/stateDataAttributes.js +0 -11
  192. package/dist/production/dom/stateDataAttributes.js.map +0 -1
  193. package/dist/production/dom/svgSizeProps.cjs.map +0 -1
  194. package/dist/production/dom/svgSizeProps.js.map +0 -1
  195. package/dist/production/events/isSpecialLinkClick.cjs +0 -5
  196. package/dist/production/events/isSpecialLinkClick.cjs.map +0 -1
  197. package/dist/production/events/isSpecialLinkClick.js +0 -5
  198. package/dist/production/events/isSpecialLinkClick.js.map +0 -1
  199. package/dist/production/functional/omit.cjs +0 -15
  200. package/dist/production/functional/omit.cjs.map +0 -1
  201. package/dist/production/functional/omit.js +0 -15
  202. package/dist/production/functional/omit.js.map +0 -1
  203. package/dist/production/functional/pick.cjs +0 -15
  204. package/dist/production/functional/pick.cjs.map +0 -1
  205. package/dist/production/functional/pick.js +0 -15
  206. package/dist/production/functional/pick.js.map +0 -1
  207. package/dist/production/functional/range.cjs +0 -7
  208. package/dist/production/functional/range.cjs.map +0 -1
  209. package/dist/production/functional/range.js +0 -7
  210. package/dist/production/functional/range.js.map +0 -1
  211. package/dist/production/string-utilities/kebabCase.cjs +0 -8
  212. package/dist/production/string-utilities/kebabCase.cjs.map +0 -1
  213. package/dist/production/string-utilities/kebabCase.js +0 -8
  214. package/dist/production/string-utilities/kebabCase.js.map +0 -1
  215. package/dist/types/assert-types/AssertionError.d.ts +0 -4
  216. package/dist/types/assert-types/AssertionError.d.ts.map +0 -1
  217. package/dist/types/assert-types/Predicates.d.ts +0 -2
  218. package/dist/types/assert-types/Predicates.d.ts.map +0 -1
  219. package/dist/types/assert-types/assert.d.ts +0 -3
  220. package/dist/types/assert-types/assert.d.ts.map +0 -1
  221. package/dist/types/assert-types/types.d.ts +0 -2
  222. package/dist/types/assert-types/types.d.ts.map +0 -1
  223. package/dist/types/css-utilities/index.d.ts +0 -2
  224. package/dist/types/css-utilities/index.d.ts.map +0 -1
  225. package/dist/types/css-utilities/px.d.ts +0 -8
  226. package/dist/types/css-utilities/px.d.ts.map +0 -1
  227. package/dist/types/data-utilities/dateToStringWithoutTimezone.d.ts +0 -4
  228. package/dist/types/data-utilities/dateToStringWithoutTimezone.d.ts.map +0 -1
  229. package/dist/types/data-utilities/index.d.ts +0 -2
  230. package/dist/types/data-utilities/index.d.ts.map +0 -1
  231. package/dist/types/dom/getElementDimensions.d.ts +0 -14
  232. package/dist/types/dom/getElementDimensions.d.ts.map +0 -1
  233. package/dist/types/dom/getSizeFromResizeObserverEntry.d.ts +0 -5
  234. package/dist/types/dom/getSizeFromResizeObserverEntry.d.ts.map +0 -1
  235. package/dist/types/dom/shouldCancelStart.d.ts +0 -4
  236. package/dist/types/dom/shouldCancelStart.d.ts.map +0 -1
  237. package/dist/types/dom/stateDataAttributes.d.ts +0 -4
  238. package/dist/types/dom/stateDataAttributes.d.ts.map +0 -1
  239. package/dist/types/events/index.d.ts +0 -2
  240. package/dist/types/events/index.d.ts.map +0 -1
  241. package/dist/types/events/isSpecialLinkClick.d.ts +0 -2
  242. package/dist/types/events/isSpecialLinkClick.d.ts.map +0 -1
  243. package/dist/types/functional/index.d.ts +0 -4
  244. package/dist/types/functional/index.d.ts.map +0 -1
  245. package/dist/types/functional/omit.d.ts +0 -2
  246. package/dist/types/functional/omit.d.ts.map +0 -1
  247. package/dist/types/functional/pick.d.ts +0 -2
  248. package/dist/types/functional/pick.d.ts.map +0 -1
  249. package/dist/types/functional/range.d.ts +0 -9
  250. package/dist/types/functional/range.d.ts.map +0 -1
  251. package/dist/types/string-utilities/index.d.ts +0 -2
  252. package/dist/types/string-utilities/index.d.ts.map +0 -1
  253. package/dist/types/string-utilities/kebabCase.d.ts +0 -2
  254. package/dist/types/string-utilities/kebabCase.d.ts.map +0 -1
  255. package/dist/types/types/PolymorphicRefs.d.ts +0 -47
  256. package/dist/types/types/PolymorphicRefs.d.ts.map +0 -1
  257. package/src/assert-types/AssertionError.ts +0 -5
  258. package/src/assert-types/Predicates.ts +0 -3
  259. package/src/assert-types/assert.ts +0 -15
  260. package/src/assert-types/types.ts +0 -1
  261. package/src/css-utilities/index.ts +0 -1
  262. package/src/css-utilities/px.ts +0 -9
  263. package/src/data-utilities/dateToStringWithoutTimezone.ts +0 -18
  264. package/src/data-utilities/index.ts +0 -1
  265. package/src/dom/getElementDimensions.ts +0 -36
  266. package/src/dom/getSizeFromResizeObserverEntry.ts +0 -26
  267. package/src/dom/shouldCancelStart.ts +0 -32
  268. package/src/dom/stateDataAttributes.ts +0 -8
  269. package/src/events/index.ts +0 -1
  270. package/src/events/isSpecialLinkClick.ts +0 -1
  271. package/src/functional/index.ts +0 -3
  272. package/src/functional/omit.ts +0 -13
  273. package/src/functional/pick.ts +0 -13
  274. package/src/functional/range.ts +0 -11
  275. package/src/string-utilities/index.ts +0 -1
  276. package/src/string-utilities/kebabCase.ts +0 -5
  277. package/src/types/PolymorphicRefs.ts +0 -70
  278. /package/dist/development/{assert-types → src/assert-types}/assertNever.cjs +0 -0
  279. /package/dist/development/{assert-types → src/assert-types}/assertNever.js +0 -0
  280. /package/dist/development/{dom → src/dom}/dataAttribute.cjs +0 -0
  281. /package/dist/development/{dom → src/dom}/dataAttribute.js +0 -0
  282. /package/dist/development/{dom → src/dom}/svgSizeProps.cjs +0 -0
  283. /package/dist/development/{dom → src/dom}/svgSizeProps.js +0 -0
  284. /package/dist/production/{assert-types → src/assert-types}/assertNever.cjs +0 -0
  285. /package/dist/production/{assert-types → src/assert-types}/assertNever.js +0 -0
  286. /package/dist/production/{deprecate → src/deprecate}/deprecate.cjs +0 -0
  287. /package/dist/production/{deprecate → src/deprecate}/deprecate.js +0 -0
  288. /package/dist/production/{dom → src/dom}/dataAttribute.cjs +0 -0
  289. /package/dist/production/{dom → src/dom}/dataAttribute.js +0 -0
  290. /package/dist/production/{dom → src/dom}/svgSizeProps.cjs +0 -0
  291. /package/dist/production/{dom → src/dom}/svgSizeProps.js +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"px.d.ts","sourceRoot":"","sources":["../../../src/css-utilities/px.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,EAAE,CAAC,CAAC,SAAS,MAAM,GAAG,KAAK,GAAG,IAAI,GAAG,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,GAAG,MAAM,CAEjF"}
@@ -1,4 +0,0 @@
1
- export declare const dateToStringWithoutTimezone: (date: Date, { includeTime }?: {
2
- includeTime?: boolean;
3
- }) => string;
4
- //# sourceMappingURL=dateToStringWithoutTimezone.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dateToStringWithoutTimezone.d.ts","sourceRoot":"","sources":["../../../src/data-utilities/dateToStringWithoutTimezone.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B,SAAU,IAAI,oBAAmB;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,KAAQ,MAiBzG,CAAA"}
@@ -1,2 +0,0 @@
1
- export * from './dateToStringWithoutTimezone';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/data-utilities/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAA"}
@@ -1,14 +0,0 @@
1
- /**
2
- * Calls the callback with the element's dimensions.
3
- *
4
- * @param element - The element to observe for dimensions
5
- * @param callback - The callback to call with the element's dimensions
6
- */
7
- export declare function getElementDimensionsCallback(element: HTMLElement, callback: (dimensions: DOMRectReadOnly) => void): void;
8
- /**
9
- * Returns a promise that resolves with the element's dimensions.
10
- * @param element - The element to observe for dimensions
11
- * @returns A promise that resolves with the element's dimensions
12
- */
13
- export declare function getElementDimensions(element: HTMLElement): Promise<DOMRectReadOnly>;
14
- //# sourceMappingURL=getElementDimensions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getElementDimensions.d.ts","sourceRoot":"","sources":["../../../src/dom/getElementDimensions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAC3C,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,CAAC,UAAU,EAAE,eAAe,KAAK,IAAI,QAc/C;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CACnC,OAAO,EAAE,WAAW,GAClB,OAAO,CAAC,eAAe,CAAC,CAI1B"}
@@ -1,5 +0,0 @@
1
- export declare function getSizeFromResizeObserverEntryFactory(box: ResizeObserverOptions['box']): (entry: ResizeObserverEntry) => {
2
- height: number;
3
- width: number;
4
- };
5
- //# sourceMappingURL=getSizeFromResizeObserverEntry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getSizeFromResizeObserverEntry.d.ts","sourceRoot":"","sources":["../../../src/dom/getSizeFromResizeObserverEntry.ts"],"names":[],"mappings":"AAAA,wBAAgB,qCAAqC,CAAC,GAAG,EAAE,qBAAqB,CAAC,KAAK,CAAC,WAChC,mBAAmB,KAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAwB7G"}
@@ -1,4 +0,0 @@
1
- export declare const shouldCancelStart: (event: {
2
- target?: unknown;
3
- }) => boolean;
4
- //# sourceMappingURL=shouldCancelStart.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"shouldCancelStart.d.ts","sourceRoot":"","sources":["../../../src/dom/shouldCancelStart.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,iBAAiB,UAAW;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAC,KAAG,OA2B7D,CAAA"}
@@ -1,4 +0,0 @@
1
- export declare function stateDataAttributes(state: Record<string, unknown>): {
2
- [k: string]: string | true | undefined;
3
- };
4
- //# sourceMappingURL=stateDataAttributes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stateDataAttributes.d.ts","sourceRoot":"","sources":["../../../src/dom/stateDataAttributes.ts"],"names":[],"mappings":"AAGA,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;EAIjE"}
@@ -1,2 +0,0 @@
1
- export * from './isSpecialLinkClick';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/events/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA"}
@@ -1,2 +0,0 @@
1
- export declare const isSpecialLinkClick: (e: MouseEvent) => boolean;
2
- //# sourceMappingURL=isSpecialLinkClick.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isSpecialLinkClick.d.ts","sourceRoot":"","sources":["../../../src/events/isSpecialLinkClick.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,MAAO,UAAU,KAAG,OAA2D,CAAA"}
@@ -1,4 +0,0 @@
1
- export * from './omit';
2
- export * from './pick';
3
- export * from './range';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/functional/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA;AACtB,cAAc,QAAQ,CAAA;AACtB,cAAc,SAAS,CAAA"}
@@ -1,2 +0,0 @@
1
- export declare function omit<T extends Object, K extends keyof T>(object: T, properties: ReadonlyArray<K>, strict?: boolean): Omit<T, K>;
2
- //# sourceMappingURL=omit.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"omit.d.ts","sourceRoot":"","sources":["../../../src/functional/omit.ts"],"names":[],"mappings":"AAAA,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,MAAM,GAAE,OAAe,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAYtI"}
@@ -1,2 +0,0 @@
1
- export declare function pick<T extends Object, K extends keyof T>(object: T, properties: ReadonlyArray<K>): Pick<T, K>;
2
- //# sourceMappingURL=pick.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pick.d.ts","sourceRoot":"","sources":["../../../src/functional/pick.ts"],"names":[],"mappings":"AAAA,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAY7G"}
@@ -1,9 +0,0 @@
1
- /**
2
- * Get a list of numbers between start and end, inclusive, with the given step size (defaulting to 1)
3
- * @param start - The starting number.
4
- * @param end - The ending number.
5
- * @param step - The step size, optional, defaults to 1.
6
- * @returns A list of numbers between start and end, inclusive, with the given step size (defaulting to 1)
7
- */
8
- export declare function range(start: number, end: number, step?: number): number[];
9
- //# sourceMappingURL=range.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"range.d.ts","sourceRoot":"","sources":["../../../src/functional/range.ts"],"names":[],"mappings":"AACA;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,SAAI,GAAG,MAAM,EAAE,CAEpE"}
@@ -1,2 +0,0 @@
1
- export * from './kebabCase';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/string-utilities/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA"}
@@ -1,2 +0,0 @@
1
- export declare function toKebabCase(value: string): string;
2
- //# sourceMappingURL=kebabCase.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"kebabCase.d.ts","sourceRoot":"","sources":["../../../src/string-utilities/kebabCase.ts"],"names":[],"mappings":"AAEA,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,UAExC"}
@@ -1,47 +0,0 @@
1
- import { ReactNode } from 'react';
2
- export type PropsOf<C extends keyof JSX.IntrinsicElements | React.JSXElementConstructor<any>> = JSX.LibraryManagedAttributes<C, React.ComponentPropsWithoutRef<C>>;
3
- export type AsProp<C extends React.ElementType> = {
4
- /**
5
- * An override of the default HTML tag.
6
- * Can also be another React component.
7
- */
8
- as?: C;
9
- };
10
- /**
11
- * Allows for extending a set of props (`ExtendedProps`) by an overriding set of props
12
- * (`OverrideProps`), ensuring that any duplicates are overridden by the overriding
13
- * set of props.
14
- */
15
- export type ExtendableProps<ExtendedProps = {}, OverrideProps = {}> = OverrideProps & Omit<ExtendedProps, keyof OverrideProps>;
16
- /**
17
- * Allows for inheriting the props from the specified element type so that
18
- * props like children, className & style work, as well as element-specific
19
- * attributes like aria roles. The component (`C`) must be passed in.
20
- */
21
- export type InheritableElementProps<C extends React.ElementType, Props = {}> = ExtendableProps<PropsOf<C>, Props>;
22
- /**
23
- * A more sophisticated version of `InheritableElementProps` where
24
- * the passed in `as` prop will determine which props can be included
25
- */
26
- export type PolymorphicComponentProps<C extends React.ElementType, Props = {}> = InheritableElementProps<C, Props & AsProp<C>>;
27
- /**
28
- * Utility type to extract the `ref` prop from a polymorphic component
29
- */
30
- export type PolymorphicRef<C extends React.ElementType> = React.ComponentPropsWithRef<C>['ref'];
31
- /**
32
- * A wrapper of `PolymorphicComponentProps` that also includes the `ref`
33
- * prop for the polymorphic component
34
- */
35
- export type PolymorphicComponentPropsWithRef<C extends React.ElementType, Props = {}> = PolymorphicComponentProps<C, Props> & {
36
- ref?: PolymorphicRef<C>;
37
- };
38
- /**
39
- * A polymorphic component is a component that can be rendered as different
40
- * HTML elements or other React components by specifying the `as` prop.
41
- * This type allows for specifying the component (`C`) and the props (`P`)
42
- * that the component accepts.
43
- */
44
- export type PolymorphicComponent<T extends React.ElementType, P = {}> = (<C extends React.ElementType = T>(props: PolymorphicComponentPropsWithRef<C, P>) => ReactNode) & {
45
- displayName?: string | undefined;
46
- };
47
- //# sourceMappingURL=PolymorphicRefs.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PolymorphicRefs.d.ts","sourceRoot":"","sources":["../../../src/types/PolymorphicRefs.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjC,MAAM,MAAM,OAAO,CAClB,CAAC,SAAS,MAAM,GAAG,CAAC,iBAAiB,GAAG,KAAK,CAAC,qBAAqB,CAAC,GAAG,CAAC,IACrE,GAAG,CAAC,wBAAwB,CAAC,CAAC,EAAE,KAAK,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC,CAAA;AAEtE,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,IAAI;IACjD;;;OAGG;IACH,EAAE,CAAC,EAAE,CAAC,CAAA;CACN,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,eAAe,CAC1B,aAAa,GAAG,EAAE,EAClB,aAAa,GAAG,EAAE,IACf,aAAa,GAAG,IAAI,CAAC,aAAa,EAAE,MAAM,aAAa,CAAC,CAAA;AAE5D;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,CAClC,CAAC,SAAS,KAAK,CAAC,WAAW,EAC3B,KAAK,GAAG,EAAE,IACP,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAA;AAEtC;;;GAGG;AACH,MAAM,MAAM,yBAAyB,CACpC,CAAC,SAAS,KAAK,CAAC,WAAW,EAC3B,KAAK,GAAG,EAAE,IACP,uBAAuB,CAAC,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;AAEjD;;GAEG;AACH,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;AAE/F;;;GAGG;AACH,MAAM,MAAM,gCAAgC,CAC3C,CAAC,SAAS,KAAK,CAAC,WAAW,EAC3B,KAAK,GAAG,EAAE,IACP,yBAAyB,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,CAAA;CAAE,CAAA;AAErE;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,EAAE,CAAC,GAAG,EAAE,IACjE,CAAC,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,CAAC,EAAE,KAAK,EAAE,gCAAgC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,GAC/F;IAAE,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAA"}
@@ -1,5 +0,0 @@
1
- export class AssertionError extends Error {
2
- constructor(value: unknown, that: string = 'value to pass assertion') {
3
- super(`Expecting ${that}, ${JSON.stringify(value)} given`)
4
- }
5
- }
@@ -1,3 +0,0 @@
1
- export function isNonNegativeNumber(value: unknown): value is number {
2
- return typeof value === 'number' && value >= 0
3
- }
@@ -1,15 +0,0 @@
1
- import { AssertionError } from './AssertionError'
2
- import { Predicate } from './types'
3
-
4
- export function assert<
5
- In,
6
- Out extends In
7
- >(
8
- that: string | undefined = undefined,
9
- value: In,
10
- predicate: Predicate<In, Out>, // (value: In) => value is Out,
11
- ): asserts value is Out {
12
- if (!predicate(value)) {
13
- throw new AssertionError(value, that)
14
- }
15
- }
@@ -1 +0,0 @@
1
- export type Predicate<T, U extends T> = (value: T) => value is U
@@ -1 +0,0 @@
1
- export * from './px'
@@ -1,9 +0,0 @@
1
- /**
2
- * Converts a value to a string in the format '10px'
3
- *
4
- * @param value - The value to convert to a string.
5
- * @returns Returns a string in the format '10px' or '' when value is falsy.
6
- */
7
- export function px<V extends number | false | null | undefined>(value?: V): string {
8
- return typeof value === 'number' && !(isNaN(value) || value === Infinity || value === -Infinity) ? value + 'px' : ''
9
- }
@@ -1,18 +0,0 @@
1
- export const dateToStringWithoutTimezone = (date: Date, { includeTime }: { includeTime?: boolean } = {}): string => {
2
- const [year, month, day] = [
3
- date.getFullYear(),
4
- (date.getMonth() + 1).toFixed(0).padStart(2, '0'),
5
- date.getDate().toFixed(0).padStart(2, '0'),
6
- ]
7
- let serialized = `${year}-${month}-${day}`
8
-
9
- if (includeTime) {
10
- const [hours, minutes] = [
11
- date.getHours().toFixed(0).padStart(2, '0'),
12
- date.getMinutes().toFixed(0).padStart(2, '0'),
13
- ]
14
- serialized += ` ${hours}:${minutes}`
15
- }
16
-
17
- return serialized
18
- }
@@ -1 +0,0 @@
1
- export * from './dateToStringWithoutTimezone'
@@ -1,36 +0,0 @@
1
- /**
2
- * Calls the callback with the element's dimensions.
3
- *
4
- * @param element - The element to observe for dimensions
5
- * @param callback - The callback to call with the element's dimensions
6
- */
7
- export function getElementDimensionsCallback(
8
- element: HTMLElement,
9
- callback: (dimensions: DOMRectReadOnly) => void,
10
- ) {
11
- const observer = new IntersectionObserver((entries, observer) => {
12
- if (entries.length === 1) {
13
- callback(entries[0].boundingClientRect)
14
- } else {
15
- const entry = entries.find(entry => entry.boundingClientRect.width > 0 || entry.boundingClientRect.height > 0) || entries[0]
16
- callback(entry.boundingClientRect)
17
- }
18
-
19
- observer.disconnect()
20
- })
21
-
22
- observer.observe(element)
23
- }
24
-
25
- /**
26
- * Returns a promise that resolves with the element's dimensions.
27
- * @param element - The element to observe for dimensions
28
- * @returns A promise that resolves with the element's dimensions
29
- */
30
- export function getElementDimensions(
31
- element: HTMLElement,
32
- ): Promise<DOMRectReadOnly> {
33
- return new Promise(resolve => {
34
- getElementDimensionsCallback(element, resolve)
35
- })
36
- }
@@ -1,26 +0,0 @@
1
- export function getSizeFromResizeObserverEntryFactory(box: ResizeObserverOptions['box']) {
2
- return function getSizeFromResizeObserverEntry(entry: ResizeObserverEntry): { height: number, width: number } {
3
- const boxSize = box === 'border-box'
4
- ? entry.borderBoxSize
5
- : box === 'content-box'
6
- ? entry.contentBoxSize
7
- : entry.devicePixelContentBoxSize
8
-
9
- if (boxSize) {
10
- const formatBoxSize: ResizeObserverSize[] = Array.isArray(boxSize) ? boxSize : [boxSize]
11
-
12
- return formatBoxSize.reduce(
13
- (previous, { inlineSize, blockSize }) => ({
14
- width: previous.width + inlineSize,
15
- height: previous.height + blockSize,
16
- }),
17
- { height: 0, width: 0 },
18
- )
19
- } else {
20
- return {
21
- width: entry.contentRect.width,
22
- height: entry.contentRect.height,
23
- }
24
- }
25
- }
26
- }
@@ -1,32 +0,0 @@
1
- const interactiveElements = new Set(['INPUT', 'TEXTAREA', 'SELECT', 'OPTION', 'BUTTON'])
2
-
3
- // This is almost completely copied from the defaultShouldCancelStart.js from react-sortable-hoc.
4
- // We just needed to add support for slate void elements as well as some additional checks.
5
- export const shouldCancelStart = (event: {target?: unknown}): boolean => {
6
- // Cancel sorting if the event target is an `input`, `textarea`, `select` or `option`
7
- if (!(event.target instanceof Element)) {
8
- return true
9
- }
10
-
11
- let el: Node | null = event.target
12
-
13
- while (el) {
14
- if (el instanceof Element) {
15
- if (interactiveElements.has(el.tagName)) {
16
- return true
17
- }
18
- if ((el as any).sortableHandle === true) {
19
- return false
20
- }
21
- if (el.getAttribute('data-slate-void') === 'true') {
22
- return false
23
- }
24
- if (el instanceof HTMLElement && el.contentEditable === 'true') {
25
- return true
26
- }
27
- }
28
- el = el.parentNode
29
- }
30
-
31
- return false
32
- }
@@ -1,8 +0,0 @@
1
- import { toKebabCase } from '../string-utilities'
2
- import { dataAttribute } from './dataAttribute'
3
-
4
- export function stateDataAttributes(state: Record<string, unknown>) {
5
- return Object.fromEntries(Object.entries(state).map(
6
- ([key, value]) => [`data-${toKebabCase(key).toLowerCase()}`, dataAttribute(value)],
7
- ))
8
- }
@@ -1 +0,0 @@
1
- export * from './isSpecialLinkClick'
@@ -1 +0,0 @@
1
- export const isSpecialLinkClick = (e: MouseEvent): boolean => e.metaKey || e.altKey || e.ctrlKey || e.shiftKey
@@ -1,3 +0,0 @@
1
- export * from './omit'
2
- export * from './pick'
3
- export * from './range'
@@ -1,13 +0,0 @@
1
- export function omit<T extends Object, K extends keyof T>(object: T, properties: ReadonlyArray<K>, strict: boolean = false): Omit<T, K> {
2
- const next: Partial<T> = { ...object }
3
-
4
- for (let key of properties) {
5
- if (key in object) {
6
- delete next[key]
7
- } else if (strict) {
8
- throw new Error(`Key "${String(key)}" does not exist in object ${JSON.stringify(object)}`)
9
- }
10
- }
11
-
12
- return next as Omit<T, K>
13
- }
@@ -1,13 +0,0 @@
1
- export function pick<T extends Object, K extends keyof T>(object: T, properties: ReadonlyArray<K>): Pick<T, K> {
2
- const next: Partial<Pick<T, K>> = {}
3
-
4
- for (let key of properties) {
5
- if (key in object) {
6
- next[key] = object[key]
7
- } else {
8
- throw new Error(`Key "${String(key)}" does not exist in object ${JSON.stringify(object)}`)
9
- }
10
- }
11
-
12
- return next as Pick<T, K>
13
- }
@@ -1,11 +0,0 @@
1
-
2
- /**
3
- * Get a list of numbers between start and end, inclusive, with the given step size (defaulting to 1)
4
- * @param start - The starting number.
5
- * @param end - The ending number.
6
- * @param step - The step size, optional, defaults to 1.
7
- * @returns A list of numbers between start and end, inclusive, with the given step size (defaulting to 1)
8
- */
9
- export function range(start: number, end: number, step = 1): number[] {
10
- return Array.from({ length: Math.floor(Math.abs(end - start) / step) + 1 }, (_, i) => start + i * (end > start ? 1 : -1) * Math.abs(step))
11
- }
@@ -1 +0,0 @@
1
- export * from './kebabCase'
@@ -1,5 +0,0 @@
1
- const UPPER_CASE_REG_EXP = /([A-Z])/g
2
-
3
- export function toKebabCase(value: string) {
4
- return value.replace(UPPER_CASE_REG_EXP, '-$1').toLowerCase()
5
- }
@@ -1,70 +0,0 @@
1
- // Source: https://www.benmvp.com/blog/forwarding-refs-polymorphic-react-component-typescript/
2
-
3
- // Source: https://github.com/emotion-js/emotion/blob/master/packages/styled-base/types/helper.d.ts
4
- // A more precise version of just React.ComponentPropsWithoutRef on its own
5
- import { ReactNode } from 'react'
6
-
7
- export type PropsOf<
8
- C extends keyof JSX.IntrinsicElements | React.JSXElementConstructor<any>
9
- > = JSX.LibraryManagedAttributes<C, React.ComponentPropsWithoutRef<C>>
10
-
11
- export type AsProp<C extends React.ElementType> = {
12
- /**
13
- * An override of the default HTML tag.
14
- * Can also be another React component.
15
- */
16
- as?: C
17
- }
18
-
19
- /**
20
- * Allows for extending a set of props (`ExtendedProps`) by an overriding set of props
21
- * (`OverrideProps`), ensuring that any duplicates are overridden by the overriding
22
- * set of props.
23
- */
24
- export type ExtendableProps<
25
- ExtendedProps = {},
26
- OverrideProps = {}
27
- > = OverrideProps & Omit<ExtendedProps, keyof OverrideProps>
28
-
29
- /**
30
- * Allows for inheriting the props from the specified element type so that
31
- * props like children, className & style work, as well as element-specific
32
- * attributes like aria roles. The component (`C`) must be passed in.
33
- */
34
- export type InheritableElementProps<
35
- C extends React.ElementType,
36
- Props = {}
37
- > = ExtendableProps<PropsOf<C>, Props>
38
-
39
- /**
40
- * A more sophisticated version of `InheritableElementProps` where
41
- * the passed in `as` prop will determine which props can be included
42
- */
43
- export type PolymorphicComponentProps<
44
- C extends React.ElementType,
45
- Props = {}
46
- > = InheritableElementProps<C, Props & AsProp<C>>
47
-
48
- /**
49
- * Utility type to extract the `ref` prop from a polymorphic component
50
- */
51
- export type PolymorphicRef<C extends React.ElementType> = React.ComponentPropsWithRef<C>['ref']
52
-
53
- /**
54
- * A wrapper of `PolymorphicComponentProps` that also includes the `ref`
55
- * prop for the polymorphic component
56
- */
57
- export type PolymorphicComponentPropsWithRef<
58
- C extends React.ElementType,
59
- Props = {}
60
- > = PolymorphicComponentProps<C, Props> & { ref?: PolymorphicRef<C> }
61
-
62
- /**
63
- * A polymorphic component is a component that can be rendered as different
64
- * HTML elements or other React components by specifying the `as` prop.
65
- * This type allows for specifying the component (`C`) and the props (`P`)
66
- * that the component accepts.
67
- */
68
- export type PolymorphicComponent<T extends React.ElementType, P = {}> =
69
- & (<C extends React.ElementType = T>(props: PolymorphicComponentPropsWithRef<C, P>) => ReactNode)
70
- & { displayName?: string | undefined }