@supersoniks/concorde 5.0.0 → 5.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (287) hide show
  1. package/.gitlab-ci.yml +0 -13
  2. package/build-infos.json +1 -1
  3. package/concorde-core.bundle.js +257 -273
  4. package/concorde-core.es.js +4127 -4039
  5. package/dist/concorde-core.bundle.js +257 -273
  6. package/dist/concorde-core.es.js +4127 -4039
  7. package/gitlab/job_tests.sh +25 -12
  8. package/index.html +1 -1
  9. package/package.json +3 -1
  10. package/scripts/post-build-docs.js +0 -0
  11. package/scripts/post-build.mjs +0 -0
  12. package/src/core/components/functional/fetch/fetch.md +0 -0
  13. package/src/core/components/functional/if/if.md +0 -0
  14. package/src/core/components/functional/list/list.demo.ts +0 -0
  15. package/src/core/components/functional/list/list.md +0 -0
  16. package/src/core/components/functional/list/list.ts +0 -0
  17. package/src/core/components/functional/router/router.md +0 -0
  18. package/src/core/components/functional/router/router.ts +0 -0
  19. package/src/core/components/functional/sdui/sdui.md +0 -0
  20. package/src/core/components/functional/states/states.md +0 -0
  21. package/src/core/components/functional/submit/submit.md +0 -0
  22. package/src/core/components/ui/_css/size.ts +0 -0
  23. package/src/core/components/ui/alert/alert.ts +0 -0
  24. package/src/core/components/ui/button/button.md +0 -0
  25. package/src/core/components/ui/captcha/altchaStyles.ts +0 -0
  26. package/src/core/components/ui/captcha/captcha.md +0 -0
  27. package/src/core/components/ui/card/card.md +0 -0
  28. package/src/core/components/ui/divider/divider.ts +0 -0
  29. package/src/core/components/ui/form/input/input.md +0 -0
  30. package/src/core/components/ui/form/radio/radio.md +0 -0
  31. package/src/core/components/ui/form/select/select.md +0 -0
  32. package/src/core/components/ui/form/switch/switch.md +0 -0
  33. package/src/core/components/ui/loader/loader.md +0 -0
  34. package/src/core/components/ui/menu/menu.md +0 -0
  35. package/src/core/components/ui/modal/modal-close.ts +0 -0
  36. package/src/core/components/ui/modal/modal.md +0 -0
  37. package/src/core/components/ui/pop/pop.md +103 -1
  38. package/src/core/components/ui/pop/pop.ts +70 -115
  39. package/src/core/components/ui/table/table-caption.ts +0 -0
  40. package/src/core/components/ui/table/table.md +0 -0
  41. package/src/core/components/ui/theme/theme.ts +1 -1
  42. package/src/core/components/ui/tooltip/tooltip.ts +178 -154
  43. package/src/core/utils/positioning.spec.ts +180 -0
  44. package/src/core/utils/positioning.ts +164 -0
  45. package/src/core/utils/route.ts +0 -0
  46. package/src/directives.ts +2 -3
  47. package/src/docs/_core-concept/subscriber.md +0 -0
  48. package/src/docs/_getting-started/concorde-outside.md +0 -0
  49. package/src/docs/_getting-started/my-first-subscriber.md +0 -0
  50. package/src/docs/_getting-started/pubsub.md +0 -0
  51. package/src/docs/_getting-started/start.md +0 -0
  52. package/src/docs/example/users.ts +0 -0
  53. package/src/docs/search/docs-search.json +90 -0
  54. package/src/docs/search/page.ts +0 -0
  55. package/src/docs/tailwind/css/tailwind.css +7 -6
  56. package/src/tsconfig.json +387 -381
  57. package/src/tsconfig.tsbuildinfo +1 -1
  58. package/vitest.setup.ts +49 -13
  59. package/.github/workflows/ci.yml +0 -21
  60. package/.github-export-ignore +0 -30
  61. package/CONTRIBUTING.md +0 -59
  62. package/DEV.md +0 -54
  63. package/LICENSE +0 -21
  64. package/OPEN_SOURCE_CHECKPOINT.md +0 -133
  65. package/concorde-3d.bundle.js +0 -3960
  66. package/concorde-3d.es.js +0 -33433
  67. package/concorde-hugging-face-infer.bundle.js +0 -32
  68. package/concorde-hugging-face-infer.es.js +0 -2952
  69. package/concorde-shader.bundle.js +0 -116
  70. package/concorde-shader.es.js +0 -8353
  71. package/concorde-webgpu.bundle.js +0 -307
  72. package/concorde-webgpu.es.js +0 -8627
  73. package/docs/altcha-widget.js +0 -2662
  74. package/docs/assets/index-BZiZXMU-.css +0 -1
  75. package/docs/assets/index-FmK4JaIM.js +0 -11992
  76. package/docs/crawl/core/components/functional/date/date.html +0 -190
  77. package/docs/crawl/core/components/functional/fetch/fetch.html +0 -109
  78. package/docs/crawl/core/components/functional/if/if.html +0 -27
  79. package/docs/crawl/core/components/functional/jsonata/jsonata.html +0 -79
  80. package/docs/crawl/core/components/functional/list/list.html +0 -70
  81. package/docs/crawl/core/components/functional/mix/mix.html +0 -45
  82. package/docs/crawl/core/components/functional/queue/queue.html +0 -96
  83. package/docs/crawl/core/components/functional/router/router.html +0 -106
  84. package/docs/crawl/core/components/functional/sdui/sdui.html +0 -269
  85. package/docs/crawl/core/components/functional/states/states.html +0 -66
  86. package/docs/crawl/core/components/functional/submit/submit.html +0 -160
  87. package/docs/crawl/core/components/functional/subscriber/subscriber.html +0 -67
  88. package/docs/crawl/core/components/functional/value/value.html +0 -51
  89. package/docs/crawl/core/components/ui/alert/alert.html +0 -110
  90. package/docs/crawl/core/components/ui/alert-messages/alert-messages.html +0 -23
  91. package/docs/crawl/core/components/ui/badge/badge.html +0 -119
  92. package/docs/crawl/core/components/ui/button/button.html +0 -149
  93. package/docs/crawl/core/components/ui/captcha/captcha.html +0 -30
  94. package/docs/crawl/core/components/ui/card/card.html +0 -99
  95. package/docs/crawl/core/components/ui/divider/divider.html +0 -58
  96. package/docs/crawl/core/components/ui/form/checkbox/checkbox.html +0 -73
  97. package/docs/crawl/core/components/ui/form/fieldset/fieldset.html +0 -135
  98. package/docs/crawl/core/components/ui/form/form-actions/form-actions.html +0 -79
  99. package/docs/crawl/core/components/ui/form/form-layout/form-layout.html +0 -62
  100. package/docs/crawl/core/components/ui/form/input/input.html +0 -109
  101. package/docs/crawl/core/components/ui/form/input-autocomplete/input-autocomplete.html +0 -106
  102. package/docs/crawl/core/components/ui/form/radio/radio.html +0 -56
  103. package/docs/crawl/core/components/ui/form/select/select.html +0 -73
  104. package/docs/crawl/core/components/ui/form/switch/switch.html +0 -56
  105. package/docs/crawl/core/components/ui/form/textarea/textarea.html +0 -59
  106. package/docs/crawl/core/components/ui/group/group.html +0 -82
  107. package/docs/crawl/core/components/ui/icon/icon.html +0 -133
  108. package/docs/crawl/core/components/ui/image/image.html +0 -110
  109. package/docs/crawl/core/components/ui/link/link.html +0 -42
  110. package/docs/crawl/core/components/ui/loader/loader.html +0 -50
  111. package/docs/crawl/core/components/ui/menu/menu.html +0 -322
  112. package/docs/crawl/core/components/ui/modal/modal.html +0 -117
  113. package/docs/crawl/core/components/ui/pop/pop.html +0 -102
  114. package/docs/crawl/core/components/ui/progress/progress.html +0 -58
  115. package/docs/crawl/core/components/ui/table/table.html +0 -413
  116. package/docs/crawl/core/components/ui/toast/toast.html +0 -122
  117. package/docs/crawl/core/components/ui/tooltip/tooltip.html +0 -79
  118. package/docs/crawl/docs/_core-concept/dataFlow.html +0 -177
  119. package/docs/crawl/docs/_core-concept/overview.html +0 -66
  120. package/docs/crawl/docs/_core-concept/subscriber.html +0 -75
  121. package/docs/crawl/docs/_decorators/ancestor-attribute.html +0 -116
  122. package/docs/crawl/docs/_decorators/auto-subscribe.html +0 -202
  123. package/docs/crawl/docs/_decorators/bind.html +0 -141
  124. package/docs/crawl/docs/_decorators/get.html +0 -149
  125. package/docs/crawl/docs/_decorators/handle.html +0 -165
  126. package/docs/crawl/docs/_decorators/on-assign.html +0 -355
  127. package/docs/crawl/docs/_decorators/patch.html +0 -78
  128. package/docs/crawl/docs/_decorators/post.html +0 -139
  129. package/docs/crawl/docs/_decorators/publish.html +0 -61
  130. package/docs/crawl/docs/_decorators/put.html +0 -78
  131. package/docs/crawl/docs/_decorators/subscribe.html +0 -109
  132. package/docs/crawl/docs/_decorators/wait-for-ancestors.html +0 -137
  133. package/docs/crawl/docs/_directives/sub.html +0 -93
  134. package/docs/crawl/docs/_getting-started/ai-agents.html +0 -173
  135. package/docs/crawl/docs/_getting-started/concorde-manual-install.html +0 -100
  136. package/docs/crawl/docs/_getting-started/concorde-outside.html +0 -58
  137. package/docs/crawl/docs/_getting-started/create-a-component.html +0 -111
  138. package/docs/crawl/docs/_getting-started/my-first-component.html +0 -189
  139. package/docs/crawl/docs/_getting-started/my-first-subscriber.html +0 -110
  140. package/docs/crawl/docs/_getting-started/pubsub.html +0 -62
  141. package/docs/crawl/docs/_getting-started/start.html +0 -76
  142. package/docs/crawl/docs/_getting-started/theming.html +0 -85
  143. package/docs/crawl/docs/_misc/api-configuration.html +0 -149
  144. package/docs/crawl/docs/_misc/dataProviderKey.html +0 -135
  145. package/docs/crawl/docs/_misc/docs-mock-api.html +0 -158
  146. package/docs/crawl/docs/_misc/dynamic-path.html +0 -180
  147. package/docs/crawl/docs/_misc/endpoint.html +0 -50
  148. package/docs/crawl/docs/_misc/formelement-subscriber-removal.html +0 -138
  149. package/docs/crawl/docs/_misc/html-integration.html +0 -48
  150. package/docs/crawl/hubs/decorators.html +0 -547
  151. package/docs/crawl/hubs/form-components.html +0 -357
  152. package/docs/crawl/hubs/remote-data.html +0 -452
  153. package/docs/crawl/index.html +0 -101
  154. package/docs/css/docs.css +0 -0
  155. package/docs/docs-mock-api-sw.js +0 -720
  156. package/docs/docs-mock-api-sw.js.map +0 -7
  157. package/docs/fonts/ClashGrotesk-Bold.eot +0 -0
  158. package/docs/fonts/ClashGrotesk-Bold.ttf +0 -0
  159. package/docs/fonts/ClashGrotesk-Bold.woff +0 -0
  160. package/docs/fonts/ClashGrotesk-Bold.woff2 +0 -0
  161. package/docs/fonts/ClashGrotesk-Extralight.eot +0 -0
  162. package/docs/fonts/ClashGrotesk-Extralight.ttf +0 -0
  163. package/docs/fonts/ClashGrotesk-Extralight.woff +0 -0
  164. package/docs/fonts/ClashGrotesk-Extralight.woff2 +0 -0
  165. package/docs/fonts/ClashGrotesk-Light.eot +0 -0
  166. package/docs/fonts/ClashGrotesk-Light.ttf +0 -0
  167. package/docs/fonts/ClashGrotesk-Light.woff +0 -0
  168. package/docs/fonts/ClashGrotesk-Light.woff2 +0 -0
  169. package/docs/fonts/ClashGrotesk-Medium.eot +0 -0
  170. package/docs/fonts/ClashGrotesk-Medium.ttf +0 -0
  171. package/docs/fonts/ClashGrotesk-Medium.woff +0 -0
  172. package/docs/fonts/ClashGrotesk-Medium.woff2 +0 -0
  173. package/docs/fonts/ClashGrotesk-Regular.eot +0 -0
  174. package/docs/fonts/ClashGrotesk-Regular.ttf +0 -0
  175. package/docs/fonts/ClashGrotesk-Regular.woff +0 -0
  176. package/docs/fonts/ClashGrotesk-Regular.woff2 +0 -0
  177. package/docs/fonts/ClashGrotesk-Semibold.eot +0 -0
  178. package/docs/fonts/ClashGrotesk-Semibold.ttf +0 -0
  179. package/docs/fonts/ClashGrotesk-Semibold.woff +0 -0
  180. package/docs/fonts/ClashGrotesk-Semibold.woff2 +0 -0
  181. package/docs/fonts/ClashGrotesk-Variable.eot +0 -0
  182. package/docs/fonts/ClashGrotesk-Variable.ttf +0 -0
  183. package/docs/fonts/ClashGrotesk-Variable.woff +0 -0
  184. package/docs/fonts/ClashGrotesk-Variable.woff2 +0 -0
  185. package/docs/img/concorde-icon.svg +0 -5
  186. package/docs/img/concorde-logo.svg +0 -1
  187. package/docs/img/concorde.png +0 -0
  188. package/docs/img/concorde_def.png +0 -0
  189. package/docs/img/concorde_seuil.png.webp +0 -0
  190. package/docs/img/concorde_seuil_invert.png +0 -0
  191. package/docs/img/paul_metrand.jpg +0 -0
  192. package/docs/img/paul_metrand_xs.jpg +0 -0
  193. package/docs/index.html +0 -93
  194. package/docs/llms-full.txt +0 -5787
  195. package/docs/llms.txt +0 -104
  196. package/docs/robots.txt +0 -16
  197. package/docs/sitemap.xml +0 -237
  198. package/docs/src/core/components/functional/date/date.md +0 -290
  199. package/docs/src/core/components/functional/fetch/fetch.md +0 -125
  200. package/docs/src/core/components/functional/if/if.md +0 -9
  201. package/docs/src/core/components/functional/jsonata/jsonata.md +0 -56
  202. package/docs/src/core/components/functional/list/list.md +0 -65
  203. package/docs/src/core/components/functional/mix/mix.md +0 -41
  204. package/docs/src/core/components/functional/queue/queue.md +0 -72
  205. package/docs/src/core/components/functional/router/router.md +0 -94
  206. package/docs/src/core/components/functional/sdui/default-library.json +0 -108
  207. package/docs/src/core/components/functional/sdui/example.json +0 -99
  208. package/docs/src/core/components/functional/sdui/sdui.md +0 -356
  209. package/docs/src/core/components/functional/states/states.md +0 -87
  210. package/docs/src/core/components/functional/submit/submit.md +0 -114
  211. package/docs/src/core/components/functional/subscriber/subscriber.md +0 -91
  212. package/docs/src/core/components/functional/value/value.md +0 -35
  213. package/docs/src/core/components/ui/alert/alert.md +0 -121
  214. package/docs/src/core/components/ui/alert-messages/alert-messages.md +0 -0
  215. package/docs/src/core/components/ui/badge/badge.md +0 -127
  216. package/docs/src/core/components/ui/button/button.md +0 -182
  217. package/docs/src/core/components/ui/captcha/captcha.md +0 -12
  218. package/docs/src/core/components/ui/card/card.md +0 -97
  219. package/docs/src/core/components/ui/divider/divider.md +0 -35
  220. package/docs/src/core/components/ui/form/checkbox/checkbox.md +0 -77
  221. package/docs/src/core/components/ui/form/fieldset/fieldset.md +0 -129
  222. package/docs/src/core/components/ui/form/form-actions/form-actions.md +0 -77
  223. package/docs/src/core/components/ui/form/form-layout/form-layout.md +0 -44
  224. package/docs/src/core/components/ui/form/input/input.md +0 -142
  225. package/docs/src/core/components/ui/form/input-autocomplete/input-autocomplete.md +0 -133
  226. package/docs/src/core/components/ui/form/radio/radio.md +0 -57
  227. package/docs/src/core/components/ui/form/select/select.md +0 -71
  228. package/docs/src/core/components/ui/form/switch/switch.md +0 -57
  229. package/docs/src/core/components/ui/form/textarea/textarea.md +0 -65
  230. package/docs/src/core/components/ui/group/group.md +0 -75
  231. package/docs/src/core/components/ui/icon/icon.md +0 -125
  232. package/docs/src/core/components/ui/icon/icons.json +0 -1
  233. package/docs/src/core/components/ui/image/image.md +0 -107
  234. package/docs/src/core/components/ui/link/link.md +0 -43
  235. package/docs/src/core/components/ui/loader/loader.md +0 -55
  236. package/docs/src/core/components/ui/menu/menu.md +0 -329
  237. package/docs/src/core/components/ui/modal/modal.md +0 -119
  238. package/docs/src/core/components/ui/pop/pop.md +0 -96
  239. package/docs/src/core/components/ui/progress/progress.md +0 -63
  240. package/docs/src/core/components/ui/table/table.md +0 -455
  241. package/docs/src/core/components/ui/toast/toast.md +0 -166
  242. package/docs/src/core/components/ui/tooltip/tooltip.md +0 -82
  243. package/docs/src/docs/_core-concept/dataFlow.md +0 -88
  244. package/docs/src/docs/_core-concept/overview.md +0 -57
  245. package/docs/src/docs/_core-concept/subscriber.md +0 -75
  246. package/docs/src/docs/_decorators/ancestor-attribute.md +0 -127
  247. package/docs/src/docs/_decorators/auto-subscribe.md +0 -202
  248. package/docs/src/docs/_decorators/bind.md +0 -167
  249. package/docs/src/docs/_decorators/get.md +0 -162
  250. package/docs/src/docs/_decorators/handle.md +0 -175
  251. package/docs/src/docs/_decorators/on-assign.md +0 -390
  252. package/docs/src/docs/_decorators/patch.md +0 -70
  253. package/docs/src/docs/_decorators/post.md +0 -146
  254. package/docs/src/docs/_decorators/publish.md +0 -55
  255. package/docs/src/docs/_decorators/put.md +0 -70
  256. package/docs/src/docs/_decorators/subscribe.md +0 -100
  257. package/docs/src/docs/_decorators/wait-for-ancestors.md +0 -163
  258. package/docs/src/docs/_directives/sub.md +0 -91
  259. package/docs/src/docs/_getting-started/ai-agents.md +0 -76
  260. package/docs/src/docs/_getting-started/concorde-manual-install.md +0 -133
  261. package/docs/src/docs/_getting-started/concorde-outside.md +0 -33
  262. package/docs/src/docs/_getting-started/create-a-component.md +0 -139
  263. package/docs/src/docs/_getting-started/my-first-component.md +0 -236
  264. package/docs/src/docs/_getting-started/my-first-subscriber.md +0 -120
  265. package/docs/src/docs/_getting-started/pubsub.md +0 -37
  266. package/docs/src/docs/_getting-started/start.md +0 -47
  267. package/docs/src/docs/_getting-started/theming.md +0 -91
  268. package/docs/src/docs/_misc/api-configuration.md +0 -81
  269. package/docs/src/docs/_misc/dataProviderKey.md +0 -168
  270. package/docs/src/docs/_misc/docs-mock-api.md +0 -63
  271. package/docs/src/docs/_misc/dynamic-path.md +0 -71
  272. package/docs/src/docs/_misc/endpoint.md +0 -45
  273. package/docs/src/docs/_misc/formelement-subscriber-removal.md +0 -115
  274. package/docs/src/docs/_misc/html-integration.md +0 -15
  275. package/docs/src/docs/search/docs-search.json +0 -9512
  276. package/docs/src/tag-list.json +0 -1
  277. package/docs/src/tsconfig-model.json +0 -23
  278. package/docs/src/tsconfig.declarations.json +0 -22
  279. package/docs/src/tsconfig.emit.json +0 -23
  280. package/docs/src/tsconfig.json +0 -858
  281. package/docs/svg/regular/plane.svg +0 -1
  282. package/docs/svg/solid/plane.svg +0 -1
  283. package/gitlab/job_github_mirror.sh +0 -39
  284. package/scripts/github-export.mjs +0 -150
  285. package/src/css.d.ts +0 -19
  286. package/src/tsconfig.declarations.json +0 -22
  287. package/src/tsconfig.emit.json +0 -23
@@ -0,0 +1,164 @@
1
+ import HTML, { SearchableDomElement } from "./HTML";
2
+
3
+ export type FloatingSide = "top" | "right" | "bottom" | "left";
4
+ export type FloatingAlign = "start" | "center" | "end";
5
+
6
+ export type FloatingBounds = {
7
+ minX: number;
8
+ minY: number;
9
+ maxX: number;
10
+ maxY: number;
11
+ };
12
+
13
+ type Rect = Pick<DOMRect, "left" | "top" | "right" | "bottom" | "width" | "height">;
14
+ type Size = Pick<DOMRect, "width" | "height">;
15
+
16
+ export const supportsPopover = "popover" in HTMLElement.prototype;
17
+
18
+ const OPPOSITE_SIDE: Record<FloatingSide, FloatingSide> = {
19
+ top: "bottom",
20
+ bottom: "top",
21
+ left: "right",
22
+ right: "left",
23
+ };
24
+
25
+ /**
26
+ * Zone dans laquelle un élément flottant doit rester visible :
27
+ * le viewport, restreint par le premier ancêtre qui scrolle ou clippe `node`.
28
+ */
29
+ export function getFloatingBounds(
30
+ node: SearchableDomElement,
31
+ padding = 0,
32
+ ): FloatingBounds {
33
+ const clipRect = (
34
+ HTML.getScrollableAncestor(node) as HTMLElement | null
35
+ )?.getBoundingClientRect();
36
+
37
+ // `||` et non `??` : un bord à 0 (ancêtre non rendu) retombe sur le viewport, comme historiquement dans sonic-pop.
38
+ return {
39
+ minX: Math.max(0, clipRect?.left || 0) + padding,
40
+ minY: Math.max(0, clipRect?.top || 0) + padding,
41
+ maxX:
42
+ Math.min(window.innerWidth, clipRect?.right || window.innerWidth) -
43
+ padding,
44
+ maxY:
45
+ Math.min(window.innerHeight, clipRect?.bottom || window.innerHeight) -
46
+ padding,
47
+ };
48
+ }
49
+
50
+ function alignOnAxis(
51
+ start: number,
52
+ length: number,
53
+ floatingLength: number,
54
+ align: FloatingAlign,
55
+ ) {
56
+ if (align === "start") return start;
57
+ if (align === "end") return start + length - floatingLength;
58
+ return start + (length - floatingLength) / 2;
59
+ }
60
+
61
+ function placeOnSide(
62
+ anchor: Rect,
63
+ floating: Size,
64
+ side: FloatingSide,
65
+ align: FloatingAlign,
66
+ gap: number,
67
+ ) {
68
+ switch (side) {
69
+ case "top":
70
+ return {
71
+ x: alignOnAxis(anchor.left, anchor.width, floating.width, align),
72
+ y: anchor.top - floating.height - gap,
73
+ };
74
+ case "bottom":
75
+ return {
76
+ x: alignOnAxis(anchor.left, anchor.width, floating.width, align),
77
+ y: anchor.bottom + gap,
78
+ };
79
+ case "left":
80
+ return {
81
+ x: anchor.left - floating.width - gap,
82
+ y: alignOnAxis(anchor.top, anchor.height, floating.height, align),
83
+ };
84
+ case "right":
85
+ return {
86
+ x: anchor.right + gap,
87
+ y: alignOnAxis(anchor.top, anchor.height, floating.height, align),
88
+ };
89
+ default:
90
+ return { x: anchor.left, y: anchor.top };
91
+ }
92
+ }
93
+
94
+ function overflowsSide(
95
+ position: { x: number; y: number },
96
+ floating: Size,
97
+ side: FloatingSide,
98
+ bounds: FloatingBounds,
99
+ ) {
100
+ switch (side) {
101
+ case "top":
102
+ return position.y < bounds.minY;
103
+ case "bottom":
104
+ return position.y + floating.height > bounds.maxY;
105
+ case "left":
106
+ return position.x < bounds.minX;
107
+ case "right":
108
+ return position.x + floating.width > bounds.maxX;
109
+ default:
110
+ return false;
111
+ }
112
+ }
113
+
114
+ /**
115
+ * Position (coordonnées viewport) d'un élément flottant accolé à `anchor` :
116
+ * bascule sur le côté opposé s'il déborde, puis le contraint dans `bounds`.
117
+ * S'il est plus grand que `bounds`, c'est le bord bas / droit qui l'emporte.
118
+ */
119
+ export function computeFloatingPosition({
120
+ anchor,
121
+ floating,
122
+ side,
123
+ align = "center",
124
+ gap = 0,
125
+ bounds,
126
+ }: {
127
+ anchor: Rect;
128
+ floating: Size;
129
+ side: FloatingSide;
130
+ align?: FloatingAlign;
131
+ gap?: number;
132
+ bounds: FloatingBounds;
133
+ }) {
134
+ let placedSide = side;
135
+ let position = placeOnSide(anchor, floating, placedSide, align, gap);
136
+
137
+ if (overflowsSide(position, floating, placedSide, bounds)) {
138
+ placedSide = OPPOSITE_SIDE[placedSide];
139
+ position = placeOnSide(anchor, floating, placedSide, align, gap);
140
+ }
141
+
142
+ return {
143
+ side: placedSide,
144
+ x: Math.min(
145
+ Math.max(position.x, bounds.minX),
146
+ bounds.maxX - floating.width,
147
+ ),
148
+ y: Math.min(
149
+ Math.max(position.y, bounds.minY),
150
+ bounds.maxY - floating.height,
151
+ ),
152
+ };
153
+ }
154
+
155
+ /** Appelle `callback` à chaque frame ; renvoie la fonction d'arrêt. */
156
+ export function startFrameLoop(callback: () => void) {
157
+ let frame = 0;
158
+ const tick = () => {
159
+ callback();
160
+ frame = requestAnimationFrame(tick);
161
+ };
162
+ tick();
163
+ return () => cancelAnimationFrame(frame);
164
+ }
File without changes
package/src/directives.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import * as directives from "@supersoniks/concorde/core/directives/DataProvider";
2
2
  import {dp as pubDp, dataProvider as pubDataProvider, get as pubGet, set as pubSet} from "@supersoniks/concorde/core/utils/PublisherProxy";
3
- import type {DirectiveResult} from "lit/async-directive.js";
4
3
 
5
4
  import {ConcordeWindow} from "./core/_types/types";
6
5
  /**
@@ -11,8 +10,8 @@ export const dp = pubDp;
11
10
  * @deprecated @see pubDataProvider
12
11
  */
13
12
  export const dataProvider = pubDataProvider;
14
- export const subscribe = directives.subscribe as DirectiveResult;
15
- export const sub = directives.sub as DirectiveResult;
13
+ export const subscribe = directives.subscribe;
14
+ export const sub = directives.sub;
16
15
 
17
16
  /**
18
17
  * @deprecated @see pubGet
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -2954,6 +2954,96 @@
2954
2954
  }
2955
2955
  }
2956
2956
  },
2957
+ {
2958
+ "search": "Default placement is bottom. Content is aligned on the start of the trigger, add center to center it. If there is not enough room, content flips to the opposite side and stays inside the viewport.\n",
2959
+ "files": {
2960
+ "core/components/ui/pop/pop.md": {
2961
+ "title": "Pop",
2962
+ "hashes": {
2963
+ "placement": {
2964
+ "count": 1,
2965
+ "title": "Placement",
2966
+ "type": "paragraph"
2967
+ }
2968
+ }
2969
+ }
2970
+ }
2971
+ },
2972
+ {
2973
+ "search": "Default shadow is lg.\n",
2974
+ "files": {
2975
+ "core/components/ui/pop/pop.md": {
2976
+ "title": "Pop",
2977
+ "hashes": {
2978
+ "shadow": {
2979
+ "count": 1,
2980
+ "title": "Shadow",
2981
+ "type": "paragraph"
2982
+ }
2983
+ }
2984
+ }
2985
+ }
2986
+ },
2987
+ {
2988
+ "search": "By default, pop is vertically aligned to the middle. Use inline to align it on the text baseline, e.g. inside a sentence.\n",
2989
+ "files": {
2990
+ "core/components/ui/pop/pop.md": {
2991
+ "title": "Pop",
2992
+ "hashes": {
2993
+ "inline": {
2994
+ "count": 1,
2995
+ "title": "Inline",
2996
+ "type": "paragraph"
2997
+ }
2998
+ }
2999
+ }
3000
+ }
3001
+ },
3002
+ {
3003
+ "search": "By default, a click inside the content closes the pop, as well as a click outside. Add data-on-select=&quot;keep&quot; on the content, or on any of its elements, to keep the pop open when interacting with it.\n",
3004
+ "files": {
3005
+ "core/components/ui/pop/pop.md": {
3006
+ "title": "Pop",
3007
+ "hashes": {
3008
+ "keep-open-on-select": {
3009
+ "count": 1,
3010
+ "title": "Keep open on select",
3011
+ "type": "paragraph"
3012
+ }
3013
+ }
3014
+ }
3015
+ }
3016
+ },
3017
+ {
3018
+ "search": "show() and hide() open and close the pop programmatically (see manual above). The pop dispatches a show event when it opens and a hide event when it closes.\n",
3019
+ "files": {
3020
+ "core/components/ui/pop/pop.md": {
3021
+ "title": "Pop",
3022
+ "hashes": {
3023
+ "methods-and-events": {
3024
+ "count": 1,
3025
+ "title": "Methods and events",
3026
+ "type": "paragraph"
3027
+ }
3028
+ }
3029
+ }
3030
+ }
3031
+ },
3032
+ {
3033
+ "search": "The content can be styled from outside with ::part(content).\n",
3034
+ "files": {
3035
+ "core/components/ui/pop/pop.md": {
3036
+ "title": "Pop",
3037
+ "hashes": {
3038
+ "styling": {
3039
+ "count": 1,
3040
+ "title": "Styling",
3041
+ "type": "paragraph"
3042
+ }
3043
+ }
3044
+ }
3045
+ }
3046
+ },
2957
3047
  {
2958
3048
  "search": "Progress bar",
2959
3049
  "files": {
File without changes
@@ -4,7 +4,8 @@
4
4
 
5
5
  @font-face {
6
6
  font-family: "ClashGrotesk-Variable";
7
- src: url("/fonts/ClashGrotesk-Variable.woff2") format("woff2"),
7
+ src:
8
+ url("/fonts/ClashGrotesk-Variable.woff2") format("woff2"),
8
9
  url("/fonts/ClashGrotesk-Variable.woff") format("woff"),
9
10
  url("/fonts/ClashGrotesk-Variable.ttf") format("truetype");
10
11
  font-weight: 200 700;
@@ -18,7 +19,6 @@
18
19
  --sc-headings-font-weight: 400;
19
20
  --sc-rounded: 0.5rem;
20
21
  --sc-border-width: max(2px, 0.18rem);
21
-
22
22
  }
23
23
 
24
24
  /*duotone*/
@@ -29,7 +29,6 @@
29
29
  --sc-primary-content: white;
30
30
  } */
31
31
 
32
-
33
32
  [data-concorde-theme="light"] {
34
33
  --sc-base: #fffcf0;
35
34
  --sc-base-content: #111111;
@@ -53,7 +52,6 @@
53
52
  --sc-warning-content: #111827;
54
53
  --sc-danger: #dc2626;
55
54
  --sc-danger-content: #ffffff;
56
-
57
55
  }
58
56
 
59
57
  [data-concorde-theme="dark"] {
@@ -79,14 +77,13 @@
79
77
  --sc-warning-content: #111827;
80
78
  --sc-danger: #dd2528;
81
79
  --sc-danger-content: #ffffff;
82
- }
80
+ }
83
81
  [data-concorde-theme="light"],
84
82
  [data-concorde-theme="dark"] {
85
83
  --sc-input-bg: var(--sc-base-100);
86
84
  --sc-input-border-color: var(--sc-base-100);
87
85
  }
88
86
 
89
-
90
87
  html {
91
88
  font-family: var(--sc-font-family-base, sans-serif);
92
89
  }
@@ -178,3 +175,7 @@ html {
178
175
  transition: box-shadow 0.2s;
179
176
  border: solid 0.15rem transparent;
180
177
  }
178
+
179
+ p {
180
+ text-wrap: pretty;
181
+ }