@histoire/vendors 0.17.17 → 1.0.0-alpha.2

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 (216) hide show
  1. package/dist/client/b-floating-vue.js +2175 -2150
  2. package/dist/client/b-iconify.js +663 -850
  3. package/dist/client/b-pinia.js +130 -68
  4. package/dist/client/b-scroll.js +3 -52
  5. package/dist/client/b-vue-router.js +385 -237
  6. package/dist/client/b-vue-use.js +4578 -3115
  7. package/dist/client/b-vue.js +1 -1
  8. package/dist/client/index.js +162 -20
  9. package/dist/client/node_modules/@babel/helper-string-parser/package.json +31 -0
  10. package/dist/client/node_modules/@babel/helper-validator-identifier/package.json +31 -0
  11. package/dist/client/node_modules/@babel/parser/package.json +10 -6
  12. package/dist/client/node_modules/@babel/parser/typings/babel-parser.d.ts +167 -188
  13. package/dist/client/node_modules/@babel/types/lib/index-legacy.d.ts +2786 -0
  14. package/dist/client/node_modules/@babel/types/lib/index.d.ts +3286 -0
  15. package/dist/client/node_modules/@babel/types/package.json +39 -0
  16. package/dist/client/node_modules/@floating-ui/core/dist/floating-ui.core.d.ts +525 -0
  17. package/dist/client/node_modules/@floating-ui/core/package.json +32 -39
  18. package/dist/client/node_modules/@floating-ui/dom/package.json +23 -24
  19. package/dist/client/node_modules/@floating-ui/dom/src/autoUpdate.d.ts +31 -0
  20. package/dist/client/node_modules/@floating-ui/dom/src/index.d.ts +11 -7
  21. package/dist/client/node_modules/@floating-ui/dom/src/platform.d.ts +1 -1
  22. package/dist/client/node_modules/@floating-ui/dom/src/types.d.ts +121 -20
  23. package/dist/client/node_modules/@floating-ui/dom/src/utils/getBoundingClientRect.d.ts +1 -1
  24. package/dist/client/node_modules/@floating-ui/dom/src/utils/getClippingRect.d.ts +12 -0
  25. package/dist/client/node_modules/@floating-ui/dom/src/utils/getCssDimensions.d.ts +4 -0
  26. package/dist/client/node_modules/@floating-ui/dom/src/utils/getDimensions.d.ts +1 -1
  27. package/dist/client/node_modules/@floating-ui/dom/src/utils/getNearestOverflowAncestor.d.ts +1 -0
  28. package/dist/client/node_modules/@floating-ui/dom/src/utils/getOverflowAncestors.d.ts +3 -0
  29. package/dist/client/node_modules/@floating-ui/dom/src/utils/getScale.d.ts +7 -0
  30. package/dist/client/node_modules/@floating-ui/dom/src/utils/getViewportRect.d.ts +2 -2
  31. package/dist/client/node_modules/@floating-ui/dom/src/utils/getWindowScrollBarX.d.ts +1 -1
  32. package/dist/client/node_modules/@floating-ui/dom/src/utils/is.d.ts +3 -1
  33. package/dist/client/node_modules/@floating-ui/dom/src/utils/unwrapElement.d.ts +2 -0
  34. package/dist/client/node_modules/@floating-ui/dom/src/utils/userAgent.d.ts +1 -0
  35. package/dist/client/node_modules/@floating-ui/dom/src/utils/window.d.ts +1 -2
  36. package/dist/client/node_modules/@floating-ui/utils/dist/floating-ui.utils.d.ts +103 -0
  37. package/dist/client/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.d.ts +47 -0
  38. package/dist/client/node_modules/@floating-ui/utils/dom/floating-ui.utils.dom.d.ts +47 -0
  39. package/dist/client/node_modules/@floating-ui/utils/dom/package.json +6 -0
  40. package/dist/client/node_modules/@floating-ui/utils/package.json +70 -0
  41. package/dist/client/node_modules/@iconify/types/package.json +23 -0
  42. package/dist/client/node_modules/@iconify/types/provider.d.ts +44 -0
  43. package/dist/client/node_modules/@iconify/types/types.d.ts +272 -0
  44. package/dist/client/node_modules/@iconify/vue/dist/iconify.d.ts +122 -327
  45. package/dist/client/node_modules/@iconify/vue/dist/offline.d.ts +36 -269
  46. package/dist/client/node_modules/@iconify/vue/package.json +64 -60
  47. package/dist/client/node_modules/@jridgewell/sourcemap-codec/dist/types/scopes.d.ts +49 -0
  48. package/dist/client/node_modules/@jridgewell/sourcemap-codec/dist/types/sourcemap-codec.d.ts +2 -0
  49. package/dist/client/node_modules/@jridgewell/sourcemap-codec/dist/types/strings.d.ts +15 -0
  50. package/dist/client/node_modules/@jridgewell/sourcemap-codec/dist/types/vlq.d.ts +6 -0
  51. package/dist/client/node_modules/@jridgewell/sourcemap-codec/package.json +3 -2
  52. package/dist/client/node_modules/@types/web-bluetooth/index.d.ts +33 -14
  53. package/dist/client/node_modules/@types/web-bluetooth/package.json +12 -12
  54. package/dist/client/node_modules/@vue/compiler-core/dist/compiler-core.d.ts +218 -125
  55. package/dist/client/node_modules/@vue/compiler-core/package.json +20 -5
  56. package/dist/client/node_modules/@vue/compiler-dom/dist/compiler-dom.d.ts +6 -3
  57. package/dist/client/node_modules/@vue/compiler-dom/package.json +17 -3
  58. package/dist/client/node_modules/@vue/compiler-sfc/dist/compiler-sfc.d.ts +35 -25
  59. package/dist/client/node_modules/@vue/compiler-sfc/package.json +27 -18
  60. package/dist/client/node_modules/@vue/compiler-ssr/dist/compiler-ssr.d.ts +2 -2
  61. package/dist/client/node_modules/@vue/compiler-ssr/package.json +3 -3
  62. package/dist/client/node_modules/@vue/devtools-api/package.json +1 -1
  63. package/dist/client/node_modules/@vue/reactivity/dist/reactivity.d.ts +268 -166
  64. package/dist/client/node_modules/@vue/reactivity/package.json +16 -2
  65. package/dist/client/node_modules/@vue/runtime-core/dist/runtime-core.d.ts +728 -529
  66. package/dist/client/node_modules/@vue/runtime-core/package.json +17 -3
  67. package/dist/client/node_modules/@vue/runtime-dom/dist/runtime-dom.d.ts +195 -86
  68. package/dist/client/node_modules/@vue/runtime-dom/package.json +22 -4
  69. package/dist/client/node_modules/@vue/server-renderer/dist/server-renderer.d.ts +4 -8
  70. package/dist/client/node_modules/@vue/server-renderer/package.json +18 -4
  71. package/dist/client/node_modules/@vue/shared/dist/shared.d.ts +45 -30
  72. package/dist/client/node_modules/@vue/shared/package.json +15 -1
  73. package/dist/client/node_modules/@vueuse/core/index.d.ts +2323 -666
  74. package/dist/client/node_modules/@vueuse/core/package.json +22 -12
  75. package/dist/client/node_modules/@vueuse/metadata/index.d.ts +7 -5
  76. package/dist/client/node_modules/@vueuse/metadata/package.json +14 -7
  77. package/dist/client/node_modules/@vueuse/shared/index.d.ts +451 -280
  78. package/dist/client/node_modules/@vueuse/shared/package.json +17 -6
  79. package/dist/client/node_modules/compute-scroll-into-view/dist/index.d.ts +75 -0
  80. package/dist/client/node_modules/compute-scroll-into-view/package.json +35 -45
  81. package/dist/client/node_modules/entities/lib/decode.d.ts +211 -0
  82. package/dist/client/node_modules/entities/lib/decode_codepoint.d.ts +19 -0
  83. package/dist/client/node_modules/entities/lib/encode.d.ts +22 -0
  84. package/dist/client/node_modules/entities/lib/escape.d.ts +43 -0
  85. package/dist/client/node_modules/entities/lib/esm/decode.d.ts +211 -0
  86. package/dist/client/node_modules/entities/lib/esm/decode_codepoint.d.ts +19 -0
  87. package/dist/client/node_modules/entities/lib/esm/encode.d.ts +22 -0
  88. package/dist/client/node_modules/entities/lib/esm/escape.d.ts +43 -0
  89. package/dist/client/node_modules/entities/lib/esm/generated/decode-data-html.d.ts +3 -0
  90. package/dist/client/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts +3 -0
  91. package/dist/client/node_modules/entities/lib/esm/generated/encode-html.d.ts +8 -0
  92. package/dist/client/node_modules/entities/lib/esm/index.d.ts +96 -0
  93. package/dist/client/node_modules/entities/lib/esm/package.json +1 -0
  94. package/dist/client/node_modules/entities/lib/generated/decode-data-html.d.ts +3 -0
  95. package/dist/client/node_modules/entities/lib/generated/decode-data-xml.d.ts +3 -0
  96. package/dist/client/node_modules/entities/lib/generated/encode-html.d.ts +8 -0
  97. package/dist/client/node_modules/entities/lib/index.d.ts +96 -0
  98. package/dist/client/node_modules/entities/package.json +90 -0
  99. package/dist/client/node_modules/floating-vue/dist/components/Dropdown.d.ts +398 -0
  100. package/dist/client/node_modules/floating-vue/dist/components/Menu.d.ts +398 -0
  101. package/dist/client/node_modules/floating-vue/dist/components/Popper.d.ts +225 -105
  102. package/dist/client/node_modules/floating-vue/dist/components/Popper.vue.d.ts +471 -364
  103. package/dist/client/node_modules/floating-vue/dist/components/PopperContent.vue.d.ts +14 -25
  104. package/dist/client/node_modules/floating-vue/dist/components/PopperWrapper.vue.d.ts +392 -6
  105. package/dist/client/node_modules/floating-vue/dist/components/Tooltip.d.ts +398 -0
  106. package/dist/client/node_modules/floating-vue/dist/components/TooltipDirective.vue.d.ts +49 -10
  107. package/dist/client/node_modules/floating-vue/dist/config.d.ts +1 -1
  108. package/dist/client/node_modules/floating-vue/dist/index.d.ts +2071 -247
  109. package/dist/client/node_modules/floating-vue/dist/util/events.d.ts +2 -0
  110. package/dist/client/node_modules/floating-vue/dist/util/popper.d.ts +1 -1
  111. package/dist/client/node_modules/floating-vue/package.json +42 -33
  112. package/dist/client/node_modules/magic-string/dist/magic-string.cjs.d.ts +250 -229
  113. package/dist/client/node_modules/magic-string/package.json +24 -26
  114. package/dist/client/node_modules/nanoid/package.json +1 -1
  115. package/dist/client/node_modules/picocolors/package.json +2 -2
  116. package/dist/client/node_modules/picocolors/types.d.ts +51 -0
  117. package/dist/client/node_modules/pinia/dist/pinia.d.ts +116 -37
  118. package/dist/client/node_modules/pinia/package.json +7 -11
  119. package/dist/client/node_modules/postcss/lib/at-rule.d.ts +22 -19
  120. package/dist/client/node_modules/postcss/lib/comment.d.ts +6 -5
  121. package/dist/client/node_modules/postcss/lib/container.d.ts +72 -82
  122. package/dist/client/node_modules/postcss/lib/css-syntax-error.d.ts +1 -1
  123. package/dist/client/node_modules/postcss/lib/declaration.d.ts +16 -13
  124. package/dist/client/node_modules/postcss/lib/document.d.ts +4 -4
  125. package/dist/client/node_modules/postcss/lib/input.d.ts +28 -16
  126. package/dist/client/node_modules/postcss/lib/lazy-result.d.ts +40 -40
  127. package/dist/client/node_modules/postcss/lib/list.d.ts +5 -2
  128. package/dist/client/node_modules/postcss/lib/no-work-result.d.ts +5 -5
  129. package/dist/client/node_modules/postcss/lib/node.d.ts +19 -14
  130. package/dist/client/node_modules/postcss/lib/postcss.d.ts +25 -8
  131. package/dist/client/node_modules/postcss/lib/processor.d.ts +1 -1
  132. package/dist/client/node_modules/postcss/lib/result.d.ts +10 -11
  133. package/dist/client/node_modules/postcss/lib/root.d.ts +4 -4
  134. package/dist/client/node_modules/postcss/lib/rule.d.ts +22 -13
  135. package/dist/client/node_modules/postcss/package.json +4 -4
  136. package/dist/client/node_modules/scroll-into-view-if-needed/dist/index.d.ts +79 -0
  137. package/dist/client/node_modules/scroll-into-view-if-needed/package.json +28 -67
  138. package/dist/client/node_modules/source-map-js/lib/source-map-consumer.d.ts +1 -0
  139. package/dist/client/node_modules/source-map-js/lib/source-map-generator.d.ts +1 -0
  140. package/dist/client/node_modules/source-map-js/lib/source-node.d.ts +1 -0
  141. package/dist/client/node_modules/source-map-js/package.json +1 -1
  142. package/dist/client/node_modules/source-map-js/source-map.d.ts +88 -99
  143. package/dist/client/node_modules/vue/dist/vue.d.ts +0 -4
  144. package/dist/client/node_modules/vue/jsx-runtime/index.d.ts +2 -1
  145. package/dist/client/node_modules/vue/jsx.d.ts +2 -1
  146. package/dist/client/node_modules/vue/package.json +13 -14
  147. package/dist/client/node_modules/{pinia/node_modules/vue-demi → vue-demi}/package.json +1 -1
  148. package/dist/client/node_modules/vue-router/dist/vue-router.d.ts +410 -81
  149. package/dist/client/node_modules/vue-router/package.json +66 -37
  150. package/dist/client/node_modules/vue-router/vue-router-auto-routes.d.ts +4 -0
  151. package/dist/client/node_modules/vue-router/vue-router-auto.d.ts +4 -0
  152. package/dist/client/vue.runtime.esm-bundler.js +6458 -4714
  153. package/package.json +17 -17
  154. package/rollup.config.mjs +6 -6
  155. package/dist/client/index2.js +0 -168
  156. package/dist/client/node_modules/@floating-ui/core/index.d.ts +0 -1
  157. package/dist/client/node_modules/@floating-ui/core/src/_babel.d.ts +0 -1
  158. package/dist/client/node_modules/@floating-ui/core/src/computeCoordsFromPlacement.d.ts +0 -4
  159. package/dist/client/node_modules/@floating-ui/core/src/computePosition.d.ts +0 -2
  160. package/dist/client/node_modules/@floating-ui/core/src/detectOverflow.d.ts +0 -9
  161. package/dist/client/node_modules/@floating-ui/core/src/enums.d.ts +0 -4
  162. package/dist/client/node_modules/@floating-ui/core/src/index.d.ts +0 -11
  163. package/dist/client/node_modules/@floating-ui/core/src/middleware/arrow.d.ts +0 -6
  164. package/dist/client/node_modules/@floating-ui/core/src/middleware/autoPlacement.d.ts +0 -9
  165. package/dist/client/node_modules/@floating-ui/core/src/middleware/flip.d.ts +0 -10
  166. package/dist/client/node_modules/@floating-ui/core/src/middleware/hide.d.ts +0 -2
  167. package/dist/client/node_modules/@floating-ui/core/src/middleware/inline.d.ts +0 -5
  168. package/dist/client/node_modules/@floating-ui/core/src/middleware/offset.d.ts +0 -21
  169. package/dist/client/node_modules/@floating-ui/core/src/middleware/shift.d.ts +0 -32
  170. package/dist/client/node_modules/@floating-ui/core/src/middleware/size.d.ts +0 -6
  171. package/dist/client/node_modules/@floating-ui/core/src/types.d.ts +0 -148
  172. package/dist/client/node_modules/@floating-ui/core/src/utils/expandPaddingObject.d.ts +0 -2
  173. package/dist/client/node_modules/@floating-ui/core/src/utils/getAlignment.d.ts +0 -2
  174. package/dist/client/node_modules/@floating-ui/core/src/utils/getAlignmentSides.d.ts +0 -5
  175. package/dist/client/node_modules/@floating-ui/core/src/utils/getBasePlacement.d.ts +0 -2
  176. package/dist/client/node_modules/@floating-ui/core/src/utils/getCrossAxis.d.ts +0 -2
  177. package/dist/client/node_modules/@floating-ui/core/src/utils/getExpandedPlacements.d.ts +0 -2
  178. package/dist/client/node_modules/@floating-ui/core/src/utils/getLengthFromAxis.d.ts +0 -2
  179. package/dist/client/node_modules/@floating-ui/core/src/utils/getMainAxisFromPlacement.d.ts +0 -2
  180. package/dist/client/node_modules/@floating-ui/core/src/utils/getOppositeAlignmentPlacement.d.ts +0 -2
  181. package/dist/client/node_modules/@floating-ui/core/src/utils/getOppositePlacement.d.ts +0 -1
  182. package/dist/client/node_modules/@floating-ui/core/src/utils/getPaddingObject.d.ts +0 -2
  183. package/dist/client/node_modules/@floating-ui/core/src/utils/math.d.ts +0 -2
  184. package/dist/client/node_modules/@floating-ui/core/src/utils/rectToClientRect.d.ts +0 -2
  185. package/dist/client/node_modules/@floating-ui/core/src/utils/within.d.ts +0 -1
  186. package/dist/client/node_modules/@floating-ui/dom/src/utils/contains.d.ts +0 -1
  187. package/dist/client/node_modules/@floating-ui/dom/src/utils/getClippingClientRect.d.ts +0 -6
  188. package/dist/client/node_modules/@floating-ui/dom/src/utils/getScrollParent.d.ts +0 -1
  189. package/dist/client/node_modules/@floating-ui/dom/src/utils/getScrollParents.d.ts +0 -1
  190. package/dist/client/node_modules/@vue/reactivity-transform/dist/reactivity-transform.d.ts +0 -43
  191. package/dist/client/node_modules/@vue/reactivity-transform/package.json +0 -41
  192. package/dist/client/node_modules/@vueuse/core/node_modules/vue-demi/package.json +0 -47
  193. package/dist/client/node_modules/@vueuse/shared/node_modules/vue-demi/lib/index.d.ts +0 -22
  194. package/dist/client/node_modules/@vueuse/shared/node_modules/vue-demi/lib/v2/index.d.ts +0 -33
  195. package/dist/client/node_modules/@vueuse/shared/node_modules/vue-demi/lib/v2.7/index.d.ts +0 -38
  196. package/dist/client/node_modules/@vueuse/shared/node_modules/vue-demi/lib/v3/index.d.ts +0 -22
  197. package/dist/client/node_modules/@vueuse/shared/node_modules/vue-demi/package.json +0 -47
  198. package/dist/client/node_modules/compute-scroll-into-view/typings/index.d.ts +0 -19
  199. package/dist/client/node_modules/floating-vue/dist/components/Dropdown.vue.d.ts +0 -25
  200. package/dist/client/node_modules/floating-vue/dist/components/Menu.vue.d.ts +0 -25
  201. package/dist/client/node_modules/floating-vue/dist/components/Tooltip.vue.d.ts +0 -25
  202. package/dist/client/node_modules/floating-vue/src/global-shim.d.ts +0 -1
  203. package/dist/client/node_modules/floating-vue/src/vue-shim.d.ts +0 -5
  204. package/dist/client/node_modules/pinia/node_modules/vue-demi/lib/index.d.ts +0 -22
  205. package/dist/client/node_modules/pinia/node_modules/vue-demi/lib/v2/index.d.ts +0 -33
  206. package/dist/client/node_modules/pinia/node_modules/vue-demi/lib/v2.7/index.d.ts +0 -38
  207. package/dist/client/node_modules/pinia/node_modules/vue-demi/lib/v3/index.d.ts +0 -22
  208. package/dist/client/node_modules/scroll-into-view-if-needed/typings/index.d.ts +0 -13
  209. package/dist/client/node_modules/scroll-into-view-if-needed/typings/types.d.ts +0 -19
  210. package/dist/client/node_modules/vue/macros-global.d.ts +0 -19
  211. package/dist/client/node_modules/vue/macros.d.ts +0 -112
  212. package/dist/client/node_modules/vue/ref-macros.d.ts +0 -2
  213. /package/dist/client/node_modules/{@vueuse/core/node_modules/vue-demi → vue-demi}/lib/index.d.ts +0 -0
  214. /package/dist/client/node_modules/{@vueuse/core/node_modules/vue-demi → vue-demi}/lib/v2/index.d.ts +0 -0
  215. /package/dist/client/node_modules/{@vueuse/core/node_modules/vue-demi → vue-demi}/lib/v2.7/index.d.ts +0 -0
  216. /package/dist/client/node_modules/{@vueuse/core/node_modules/vue-demi → vue-demi}/lib/v3/index.d.ts +0 -0
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@vueuse/shared",
3
- "version": "9.13.0",
3
+ "type": "module",
4
+ "version": "12.7.0",
4
5
  "author": "Anthony Fu <https://github.com/antfu>",
5
6
  "license": "MIT",
6
7
  "funding": "https://github.com/sponsors/antfu",
@@ -21,9 +22,8 @@
21
22
  "sideEffects": false,
22
23
  "exports": {
23
24
  ".": {
24
- "types": "./index.d.ts",
25
- "require": "./index.cjs",
26
- "import": "./index.mjs"
25
+ "import": "./index.mjs",
26
+ "require": "./index.cjs"
27
27
  },
28
28
  "./*": "./*"
29
29
  },
@@ -32,7 +32,18 @@
32
32
  "unpkg": "./index.iife.min.js",
33
33
  "jsdelivr": "./index.iife.min.js",
34
34
  "types": "./index.d.ts",
35
+ "files": [
36
+ "*.cjs",
37
+ "*.d.cts",
38
+ "*.d.mts",
39
+ "*.d.ts",
40
+ "*.js",
41
+ "*.mjs"
42
+ ],
35
43
  "dependencies": {
36
- "vue-demi": "*"
44
+ "vue": "^3.5.13"
45
+ },
46
+ "scripts": {
47
+ "build": "rollup --config=rollup.config.ts --configPlugin=rollup-plugin-esbuild"
37
48
  }
38
- }
49
+ }
@@ -0,0 +1,75 @@
1
+ /** @public */
2
+ export declare const compute: (
3
+ target: Element,
4
+ options: Options
5
+ ) => ScrollAction[]
6
+
7
+ /** @public */
8
+ export declare interface Options {
9
+ /**
10
+ * Control the logical scroll position on the y-axis. The spec states that the `block` direction is related to the [writing-mode](https://developer.mozilla.org/en-US/docs/Web/CSS/writing-mode), but this is not implemented yet in this library.
11
+ * This means that `block: 'start'` aligns to the top edge and `block: 'end'` to the bottom.
12
+ * @defaultValue 'center'
13
+ */
14
+ block?: ScrollLogicalPosition
15
+ /**
16
+ * Like `block` this is affected by the [writing-mode](https://developer.mozilla.org/en-US/docs/Web/CSS/writing-mode). In left-to-right pages `inline: 'start'` will align to the left edge. In right-to-left it should be flipped. This will be supported in a future release.
17
+ * @defaultValue 'nearest'
18
+ */
19
+ inline?: ScrollLogicalPosition
20
+ /**
21
+ * This is a proposed addition to the spec that you can track here: https://github.com/w3c/csswg-drafts/pull/5677
22
+ *
23
+ * This library will be updated to reflect any changes to the spec and will provide a migration path.
24
+ * To be backwards compatible with `Element.scrollIntoViewIfNeeded` if something is not 100% visible it will count as "needs scrolling". If you need a different visibility ratio your best option would be to implement an [Intersection Observer](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API).
25
+ * @defaultValue 'always'
26
+ */
27
+ scrollMode?: ScrollMode
28
+ /**
29
+ * By default there is no boundary. All the parent elements of your target is checked until it reaches the viewport ([`document.scrollingElement`](https://developer.mozilla.org/en-US/docs/Web/API/document/scrollingElement)) when calculating layout and what to scroll.
30
+ * By passing a boundary you can short-circuit this loop depending on your needs:
31
+ *
32
+ * - Prevent the browser window from scrolling.
33
+ * - Scroll elements into view in a list, without scrolling container elements.
34
+ *
35
+ * You can also pass a function to do more dynamic checks to override the scroll scoping:
36
+ *
37
+ * ```js
38
+ * let actions = compute(target, {
39
+ * boundary: (parent) => {
40
+ * // By default `overflow: hidden` elements are allowed, only `overflow: visible | clip` is skipped as
41
+ * // this is required by the CSSOM spec
42
+ * if (getComputedStyle(parent)['overflow'] === 'hidden') {
43
+ * return false
44
+ * }
45
+
46
+ * return true
47
+ * },
48
+ * })
49
+ * ```
50
+ * @defaultValue null
51
+ */
52
+ boundary?: Element | ((parent: Element) => boolean) | null
53
+ /**
54
+ * New option that skips auto-scrolling all nodes with overflow: hidden set
55
+ * See FF implementation: https://hg.mozilla.org/integration/fx-team/rev/c48c3ec05012#l7.18
56
+ * @defaultValue false
57
+ * @public
58
+ */
59
+ skipOverflowHiddenElements?: boolean
60
+ }
61
+
62
+ /** @public */
63
+ export declare interface ScrollAction {
64
+ el: Element
65
+ top: number
66
+ left: number
67
+ }
68
+
69
+ /**
70
+ * This new option is tracked in this PR, which is the most likely candidate at the time: https://github.com/w3c/csswg-drafts/pull/1805
71
+ * @public
72
+ */
73
+ export declare type ScrollMode = 'always' | 'if-needed'
74
+
75
+ export {}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "compute-scroll-into-view",
3
- "version": "1.0.20",
3
+ "version": "3.1.1",
4
4
  "description": "The engine that powers scroll-into-view-if-needed",
5
5
  "keywords": [
6
6
  "if-needed",
@@ -20,71 +20,61 @@
20
20
  "license": "MIT",
21
21
  "author": "Cody Olsen",
22
22
  "sideEffects": false,
23
+ "type": "module",
23
24
  "exports": {
24
25
  ".": {
25
- "types": "./typings/index.d.ts",
26
+ "types": "./dist/index.d.ts",
26
27
  "source": "./src/index.ts",
27
- "import": "./dist/index.mjs",
28
- "require": "./dist/index.js",
29
- "default": "./dist/index.mjs"
28
+ "require": "./dist/index.cjs",
29
+ "import": "./dist/index.js",
30
+ "default": "./dist/index.js"
30
31
  },
31
32
  "./package.json": "./package.json"
32
33
  },
33
- "main": "dist/index.js",
34
- "umd:main": "umd/compute-scroll-into-view.min.js",
35
- "module": "dist/index.mjs",
36
- "source": "src/index.ts",
37
- "typings": "typings/index.d.ts",
34
+ "main": "./dist/index.cjs",
35
+ "module": "./dist/index.js",
36
+ "source": "./src/index.ts",
37
+ "typings": "./dist/index.d.ts",
38
38
  "files": [
39
39
  "dist",
40
- "typings",
41
- "umd/compute-scroll-into-view.min.js",
42
- "umd/compute-scroll-into-view.min.js.map"
40
+ "src"
43
41
  ],
44
42
  "scripts": {
45
- "prebuild": "rimraf 'dist' 'umd'",
46
- "build": "npm run build:dist && npm run build:umd",
47
- "build:dist": "microbundle -f cjs,es",
48
- "build:umd": "microbundle -f umd -o umd",
43
+ "prebuild": "npx rimraf 'dist'",
44
+ "build": "pkg build --strict",
49
45
  "prepublishOnly": "npm run build",
50
- "test": "jest -c integration/jest.config.js",
51
- "typecheck": "tsc --noEmit"
52
- },
53
- "husky": {
54
- "hooks": {
55
- "pre-commit": "lint-staged"
56
- }
57
- },
58
- "lint-staged": {
59
- "*.{js,ts,tsx,json,md}": "prettier --write"
60
- },
61
- "browserify": {
62
- "transform": [
63
- "loose-envify"
64
- ]
46
+ "test": "npx cross-env JEST_PUPPETEER_CONFIG='jest-puppeteer.config.cjs' jest -c integration/jest.config.cjs",
47
+ "typecheck": "tsc"
65
48
  },
49
+ "browserslist": [
50
+ "> 0.2% and supports es6-module and supports es6-module-dynamic-import and not dead",
51
+ "maintained node versions"
52
+ ],
66
53
  "prettier": {
67
54
  "semi": false,
68
55
  "singleQuote": true
69
56
  },
70
57
  "devDependencies": {
71
- "@sanity/semantic-release-preset": "^2.0.2",
72
- "husky": "^8.0.2",
73
- "jest": "^29.3.1",
58
+ "@sanity/pkg-utils": "^2.2.5",
59
+ "@sanity/semantic-release-preset": "^4.0.0",
60
+ "@types/expect-puppeteer": "^5.0.2",
61
+ "@types/jest": "^29.4.0",
62
+ "@types/jest-environment-puppeteer": "^5.0.3",
63
+ "@types/puppeteer": "^7.0.4",
64
+ "cross-env": "^7.0.3",
65
+ "jest": "^29.5.0",
74
66
  "jest-junit": "^15.0.0",
75
- "jest-puppeteer": "^6.1.1",
76
- "lint-staged": "^13.0.4",
77
- "microbundle": "^0.15.1",
78
- "prettier": "^2.8.0",
79
- "prettier-plugin-packagejson": "^2.3.0",
80
- "puppeteer": "^19.3.0",
81
- "rimraf": "^3.0.2",
82
- "serve": "^14.1.2",
83
- "typescript": "^4.9.3"
67
+ "jest-puppeteer": "^8.0.0",
68
+ "prettier": "^2.8.4",
69
+ "prettier-plugin-packagejson": "^2.4.3",
70
+ "puppeteer": "^19.7.0",
71
+ "rimraf": "^4.1.2",
72
+ "serve": "^14.2.0",
73
+ "typescript": "^5.0.0"
84
74
  },
85
75
  "bundlesize": [
86
76
  {
87
- "path": "./umd/compute-scroll-into-view.min.js",
77
+ "path": "./dist/index.js",
88
78
  "maxSize": "3 kB",
89
79
  "compression": "none"
90
80
  }
@@ -0,0 +1,211 @@
1
+ import htmlDecodeTree from "./generated/decode-data-html.js";
2
+ import xmlDecodeTree from "./generated/decode-data-xml.js";
3
+ import decodeCodePoint from "./decode_codepoint.js";
4
+ export { htmlDecodeTree, xmlDecodeTree, decodeCodePoint };
5
+ export { replaceCodePoint, fromCodePoint } from "./decode_codepoint.js";
6
+ export declare enum BinTrieFlags {
7
+ VALUE_LENGTH = 49152,
8
+ BRANCH_LENGTH = 16256,
9
+ JUMP_TABLE = 127
10
+ }
11
+ export declare enum DecodingMode {
12
+ /** Entities in text nodes that can end with any character. */
13
+ Legacy = 0,
14
+ /** Only allow entities terminated with a semicolon. */
15
+ Strict = 1,
16
+ /** Entities in attributes have limitations on ending characters. */
17
+ Attribute = 2
18
+ }
19
+ /**
20
+ * Producers for character reference errors as defined in the HTML spec.
21
+ */
22
+ export interface EntityErrorProducer {
23
+ missingSemicolonAfterCharacterReference(): void;
24
+ absenceOfDigitsInNumericCharacterReference(consumedCharacters: number): void;
25
+ validateNumericCharacterReference(code: number): void;
26
+ }
27
+ /**
28
+ * Token decoder with support of writing partial entities.
29
+ */
30
+ export declare class EntityDecoder {
31
+ /** The tree used to decode entities. */
32
+ private readonly decodeTree;
33
+ /**
34
+ * The function that is called when a codepoint is decoded.
35
+ *
36
+ * For multi-byte named entities, this will be called multiple times,
37
+ * with the second codepoint, and the same `consumed` value.
38
+ *
39
+ * @param codepoint The decoded codepoint.
40
+ * @param consumed The number of bytes consumed by the decoder.
41
+ */
42
+ private readonly emitCodePoint;
43
+ /** An object that is used to produce errors. */
44
+ private readonly errors?;
45
+ constructor(
46
+ /** The tree used to decode entities. */
47
+ decodeTree: Uint16Array,
48
+ /**
49
+ * The function that is called when a codepoint is decoded.
50
+ *
51
+ * For multi-byte named entities, this will be called multiple times,
52
+ * with the second codepoint, and the same `consumed` value.
53
+ *
54
+ * @param codepoint The decoded codepoint.
55
+ * @param consumed The number of bytes consumed by the decoder.
56
+ */
57
+ emitCodePoint: (cp: number, consumed: number) => void,
58
+ /** An object that is used to produce errors. */
59
+ errors?: EntityErrorProducer | undefined);
60
+ /** The current state of the decoder. */
61
+ private state;
62
+ /** Characters that were consumed while parsing an entity. */
63
+ private consumed;
64
+ /**
65
+ * The result of the entity.
66
+ *
67
+ * Either the result index of a numeric entity, or the codepoint of a
68
+ * numeric entity.
69
+ */
70
+ private result;
71
+ /** The current index in the decode tree. */
72
+ private treeIndex;
73
+ /** The number of characters that were consumed in excess. */
74
+ private excess;
75
+ /** The mode in which the decoder is operating. */
76
+ private decodeMode;
77
+ /** Resets the instance to make it reusable. */
78
+ startEntity(decodeMode: DecodingMode): void;
79
+ /**
80
+ * Write an entity to the decoder. This can be called multiple times with partial entities.
81
+ * If the entity is incomplete, the decoder will return -1.
82
+ *
83
+ * Mirrors the implementation of `getDecoder`, but with the ability to stop decoding if the
84
+ * entity is incomplete, and resume when the next string is written.
85
+ *
86
+ * @param string The string containing the entity (or a continuation of the entity).
87
+ * @param offset The offset at which the entity begins. Should be 0 if this is not the first call.
88
+ * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
89
+ */
90
+ write(str: string, offset: number): number;
91
+ /**
92
+ * Switches between the numeric decimal and hexadecimal states.
93
+ *
94
+ * Equivalent to the `Numeric character reference state` in the HTML spec.
95
+ *
96
+ * @param str The string containing the entity (or a continuation of the entity).
97
+ * @param offset The current offset.
98
+ * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
99
+ */
100
+ private stateNumericStart;
101
+ private addToNumericResult;
102
+ /**
103
+ * Parses a hexadecimal numeric entity.
104
+ *
105
+ * Equivalent to the `Hexademical character reference state` in the HTML spec.
106
+ *
107
+ * @param str The string containing the entity (or a continuation of the entity).
108
+ * @param offset The current offset.
109
+ * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
110
+ */
111
+ private stateNumericHex;
112
+ /**
113
+ * Parses a decimal numeric entity.
114
+ *
115
+ * Equivalent to the `Decimal character reference state` in the HTML spec.
116
+ *
117
+ * @param str The string containing the entity (or a continuation of the entity).
118
+ * @param offset The current offset.
119
+ * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
120
+ */
121
+ private stateNumericDecimal;
122
+ /**
123
+ * Validate and emit a numeric entity.
124
+ *
125
+ * Implements the logic from the `Hexademical character reference start
126
+ * state` and `Numeric character reference end state` in the HTML spec.
127
+ *
128
+ * @param lastCp The last code point of the entity. Used to see if the
129
+ * entity was terminated with a semicolon.
130
+ * @param expectedLength The minimum number of characters that should be
131
+ * consumed. Used to validate that at least one digit
132
+ * was consumed.
133
+ * @returns The number of characters that were consumed.
134
+ */
135
+ private emitNumericEntity;
136
+ /**
137
+ * Parses a named entity.
138
+ *
139
+ * Equivalent to the `Named character reference state` in the HTML spec.
140
+ *
141
+ * @param str The string containing the entity (or a continuation of the entity).
142
+ * @param offset The current offset.
143
+ * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
144
+ */
145
+ private stateNamedEntity;
146
+ /**
147
+ * Emit a named entity that was not terminated with a semicolon.
148
+ *
149
+ * @returns The number of characters consumed.
150
+ */
151
+ private emitNotTerminatedNamedEntity;
152
+ /**
153
+ * Emit a named entity.
154
+ *
155
+ * @param result The index of the entity in the decode tree.
156
+ * @param valueLength The number of bytes in the entity.
157
+ * @param consumed The number of characters consumed.
158
+ *
159
+ * @returns The number of characters consumed.
160
+ */
161
+ private emitNamedEntityData;
162
+ /**
163
+ * Signal to the parser that the end of the input was reached.
164
+ *
165
+ * Remaining data will be emitted and relevant errors will be produced.
166
+ *
167
+ * @returns The number of characters consumed.
168
+ */
169
+ end(): number;
170
+ }
171
+ /**
172
+ * Determines the branch of the current node that is taken given the current
173
+ * character. This function is used to traverse the trie.
174
+ *
175
+ * @param decodeTree The trie.
176
+ * @param current The current node.
177
+ * @param nodeIdx The index right after the current node and its value.
178
+ * @param char The current character.
179
+ * @returns The index of the next node, or -1 if no branch is taken.
180
+ */
181
+ export declare function determineBranch(decodeTree: Uint16Array, current: number, nodeIdx: number, char: number): number;
182
+ /**
183
+ * Decodes an HTML string.
184
+ *
185
+ * @param str The string to decode.
186
+ * @param mode The decoding mode.
187
+ * @returns The decoded string.
188
+ */
189
+ export declare function decodeHTML(str: string, mode?: DecodingMode): string;
190
+ /**
191
+ * Decodes an HTML string in an attribute.
192
+ *
193
+ * @param str The string to decode.
194
+ * @returns The decoded string.
195
+ */
196
+ export declare function decodeHTMLAttribute(str: string): string;
197
+ /**
198
+ * Decodes an HTML string, requiring all entities to be terminated by a semicolon.
199
+ *
200
+ * @param str The string to decode.
201
+ * @returns The decoded string.
202
+ */
203
+ export declare function decodeHTMLStrict(str: string): string;
204
+ /**
205
+ * Decodes an XML string, requiring all entities to be terminated by a semicolon.
206
+ *
207
+ * @param str The string to decode.
208
+ * @returns The decoded string.
209
+ */
210
+ export declare function decodeXML(str: string): string;
211
+ //# sourceMappingURL=decode.d.ts.map
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Polyfill for `String.fromCodePoint`. It is used to create a string from a Unicode code point.
3
+ */
4
+ export declare const fromCodePoint: (...codePoints: number[]) => string;
5
+ /**
6
+ * Replace the given code point with a replacement character if it is a
7
+ * surrogate or is outside the valid range. Otherwise return the code
8
+ * point unchanged.
9
+ */
10
+ export declare function replaceCodePoint(codePoint: number): number;
11
+ /**
12
+ * Replace the code point if relevant, then convert it to a string.
13
+ *
14
+ * @deprecated Use `fromCodePoint(replaceCodePoint(codePoint))` instead.
15
+ * @param codePoint The code point to decode.
16
+ * @returns The decoded code point.
17
+ */
18
+ export default function decodeCodePoint(codePoint: number): string;
19
+ //# sourceMappingURL=decode_codepoint.d.ts.map
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Encodes all characters in the input using HTML entities. This includes
3
+ * characters that are valid ASCII characters in HTML documents, such as `#`.
4
+ *
5
+ * To get a more compact output, consider using the `encodeNonAsciiHTML`
6
+ * function, which will only encode characters that are not valid in HTML
7
+ * documents, as well as non-ASCII characters.
8
+ *
9
+ * If a character has no equivalent entity, a numeric hexadecimal reference
10
+ * (eg. `&#xfc;`) will be used.
11
+ */
12
+ export declare function encodeHTML(data: string): string;
13
+ /**
14
+ * Encodes all non-ASCII characters, as well as characters not valid in HTML
15
+ * documents using HTML entities. This function will not encode characters that
16
+ * are valid in HTML documents, such as `#`.
17
+ *
18
+ * If a character has no equivalent entity, a numeric hexadecimal reference
19
+ * (eg. `&#xfc;`) will be used.
20
+ */
21
+ export declare function encodeNonAsciiHTML(data: string): string;
22
+ //# sourceMappingURL=encode.d.ts.map
@@ -0,0 +1,43 @@
1
+ export declare const xmlReplacer: RegExp;
2
+ export declare const getCodePoint: (str: string, index: number) => number;
3
+ /**
4
+ * Encodes all non-ASCII characters, as well as characters not valid in XML
5
+ * documents using XML entities.
6
+ *
7
+ * If a character has no equivalent entity, a
8
+ * numeric hexadecimal reference (eg. `&#xfc;`) will be used.
9
+ */
10
+ export declare function encodeXML(str: string): string;
11
+ /**
12
+ * Encodes all non-ASCII characters, as well as characters not valid in XML
13
+ * documents using numeric hexadecimal reference (eg. `&#xfc;`).
14
+ *
15
+ * Have a look at `escapeUTF8` if you want a more concise output at the expense
16
+ * of reduced transportability.
17
+ *
18
+ * @param data String to escape.
19
+ */
20
+ export declare const escape: typeof encodeXML;
21
+ /**
22
+ * Encodes all characters not valid in XML documents using XML entities.
23
+ *
24
+ * Note that the output will be character-set dependent.
25
+ *
26
+ * @param data String to escape.
27
+ */
28
+ export declare const escapeUTF8: (data: string) => string;
29
+ /**
30
+ * Encodes all characters that have to be escaped in HTML attributes,
31
+ * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
32
+ *
33
+ * @param data String to escape.
34
+ */
35
+ export declare const escapeAttribute: (data: string) => string;
36
+ /**
37
+ * Encodes all characters that have to be escaped in HTML text,
38
+ * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
39
+ *
40
+ * @param data String to escape.
41
+ */
42
+ export declare const escapeText: (data: string) => string;
43
+ //# sourceMappingURL=escape.d.ts.map