foldkit 0.100.1 → 0.102.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. package/README.md +3 -2
  2. package/dist/canvas/view.d.ts +1 -1
  3. package/dist/canvas/view.d.ts.map +1 -1
  4. package/dist/canvas/view.js +5 -5
  5. package/dist/command/index.d.ts +71 -0
  6. package/dist/command/index.d.ts.map +1 -1
  7. package/dist/command/index.js +34 -1
  8. package/dist/command/public.d.ts +1 -1
  9. package/dist/command/public.d.ts.map +1 -1
  10. package/dist/command/public.js +1 -1
  11. package/dist/devTools/overlay.d.ts.map +1 -1
  12. package/dist/devTools/overlay.js +156 -149
  13. package/dist/dom/dom.d.ts +8 -11
  14. package/dist/dom/dom.d.ts.map +1 -1
  15. package/dist/dom/dom.js +8 -11
  16. package/dist/dom/elementMovement.d.ts +1 -3
  17. package/dist/dom/elementMovement.d.ts.map +1 -1
  18. package/dist/dom/elementMovement.js +1 -3
  19. package/dist/dom/inert.d.ts +2 -4
  20. package/dist/dom/inert.d.ts.map +1 -1
  21. package/dist/dom/inert.js +2 -4
  22. package/dist/dom/scrollLock.d.ts +2 -2
  23. package/dist/dom/scrollLock.js +2 -2
  24. package/dist/dom/waitForAnimation.d.ts +1 -1
  25. package/dist/dom/waitForAnimation.js +1 -1
  26. package/dist/html/boundary.d.ts +98 -0
  27. package/dist/html/boundary.d.ts.map +1 -0
  28. package/dist/html/boundary.js +176 -0
  29. package/dist/html/childAttribute.d.ts +44 -0
  30. package/dist/html/childAttribute.d.ts.map +1 -0
  31. package/dist/html/childAttribute.js +34 -0
  32. package/dist/html/index.d.ts +70 -23
  33. package/dist/html/index.d.ts.map +1 -1
  34. package/dist/html/index.js +639 -575
  35. package/dist/html/lazy.d.ts +12 -7
  36. package/dist/html/lazy.d.ts.map +1 -1
  37. package/dist/html/lazy.js +30 -11
  38. package/dist/html/public.d.ts +2 -2
  39. package/dist/html/public.d.ts.map +1 -1
  40. package/dist/html/public.js +1 -1
  41. package/dist/html/runtimeSingleton.d.ts +72 -0
  42. package/dist/html/runtimeSingleton.d.ts.map +1 -0
  43. package/dist/html/runtimeSingleton.js +112 -0
  44. package/dist/html/submodel.d.ts +98 -0
  45. package/dist/html/submodel.d.ts.map +1 -0
  46. package/dist/html/submodel.js +190 -0
  47. package/dist/index.d.ts +1 -0
  48. package/dist/index.d.ts.map +1 -1
  49. package/dist/index.js +1 -0
  50. package/dist/render/render.d.ts +1 -1
  51. package/dist/render/render.js +1 -1
  52. package/dist/runtime/messagePriority.d.ts +5 -1
  53. package/dist/runtime/messagePriority.d.ts.map +1 -1
  54. package/dist/runtime/messagePriority.js +25 -4
  55. package/dist/runtime/runtime.d.ts +11 -11
  56. package/dist/runtime/runtime.d.ts.map +1 -1
  57. package/dist/runtime/runtime.js +118 -63
  58. package/dist/runtime/subscription.d.ts +139 -19
  59. package/dist/runtime/subscription.d.ts.map +1 -1
  60. package/dist/runtime/subscription.js +90 -9
  61. package/dist/submodel/public.d.ts +4 -0
  62. package/dist/submodel/public.d.ts.map +1 -0
  63. package/dist/submodel/public.js +1 -0
  64. package/dist/submodel/submodel.d.ts +32 -0
  65. package/dist/submodel/submodel.d.ts.map +1 -0
  66. package/dist/submodel/submodel.js +1 -0
  67. package/dist/subscription/animationFrame.d.ts +23 -26
  68. package/dist/subscription/animationFrame.d.ts.map +1 -1
  69. package/dist/subscription/animationFrame.js +17 -18
  70. package/dist/subscription/public.d.ts +2 -2
  71. package/dist/subscription/public.d.ts.map +1 -1
  72. package/dist/subscription/public.js +1 -1
  73. package/dist/test/apps/disabledButton.d.ts +4 -5
  74. package/dist/test/apps/disabledButton.d.ts.map +1 -1
  75. package/dist/test/apps/disabledButton.js +16 -16
  76. package/dist/test/scene.d.ts +8 -8
  77. package/dist/test/scene.d.ts.map +1 -1
  78. package/dist/test/scene.js +25 -13
  79. package/dist/test/story.d.ts +15 -8
  80. package/dist/test/story.d.ts.map +1 -1
  81. package/dist/test/story.js +21 -9
  82. package/dist/ui/animation/index.d.ts +30 -14
  83. package/dist/ui/animation/index.d.ts.map +1 -1
  84. package/dist/ui/animation/index.js +9 -19
  85. package/dist/ui/animation/public.d.ts +2 -2
  86. package/dist/ui/animation/public.d.ts.map +1 -1
  87. package/dist/ui/animation/public.js +1 -1
  88. package/dist/ui/calendar/index.d.ts +199 -84
  89. package/dist/ui/calendar/index.d.ts.map +1 -1
  90. package/dist/ui/calendar/index.js +129 -140
  91. package/dist/ui/calendar/public.d.ts +2 -2
  92. package/dist/ui/calendar/public.d.ts.map +1 -1
  93. package/dist/ui/calendar/public.js +1 -1
  94. package/dist/ui/checkbox/index.d.ts +93 -21
  95. package/dist/ui/checkbox/index.d.ts.map +1 -1
  96. package/dist/ui/checkbox/index.js +62 -33
  97. package/dist/ui/checkbox/public.d.ts +2 -2
  98. package/dist/ui/checkbox/public.d.ts.map +1 -1
  99. package/dist/ui/checkbox/public.js +1 -1
  100. package/dist/ui/combobox/multi.d.ts +35 -91
  101. package/dist/ui/combobox/multi.d.ts.map +1 -1
  102. package/dist/ui/combobox/multi.js +34 -17
  103. package/dist/ui/combobox/multiPublic.d.ts +2 -2
  104. package/dist/ui/combobox/multiPublic.d.ts.map +1 -1
  105. package/dist/ui/combobox/multiPublic.js +1 -1
  106. package/dist/ui/combobox/public.d.ts +3 -3
  107. package/dist/ui/combobox/public.d.ts.map +1 -1
  108. package/dist/ui/combobox/public.js +2 -2
  109. package/dist/ui/combobox/shared.d.ts +56 -31
  110. package/dist/ui/combobox/shared.d.ts.map +1 -1
  111. package/dist/ui/combobox/shared.js +333 -322
  112. package/dist/ui/combobox/single.d.ts +46 -93
  113. package/dist/ui/combobox/single.d.ts.map +1 -1
  114. package/dist/ui/combobox/single.js +44 -17
  115. package/dist/ui/datePicker/index.d.ts +256 -48
  116. package/dist/ui/datePicker/index.d.ts.map +1 -1
  117. package/dist/ui/datePicker/index.js +149 -104
  118. package/dist/ui/datePicker/public.d.ts +2 -2
  119. package/dist/ui/datePicker/public.d.ts.map +1 -1
  120. package/dist/ui/datePicker/public.js +1 -1
  121. package/dist/ui/dialog/index.d.ts +95 -39
  122. package/dist/ui/dialog/index.d.ts.map +1 -1
  123. package/dist/ui/dialog/index.js +71 -62
  124. package/dist/ui/dialog/public.d.ts +2 -2
  125. package/dist/ui/dialog/public.d.ts.map +1 -1
  126. package/dist/ui/dialog/public.js +1 -1
  127. package/dist/ui/disclosure/index.d.ts +71 -31
  128. package/dist/ui/disclosure/index.d.ts.map +1 -1
  129. package/dist/ui/disclosure/index.js +57 -62
  130. package/dist/ui/disclosure/public.d.ts +2 -2
  131. package/dist/ui/disclosure/public.d.ts.map +1 -1
  132. package/dist/ui/disclosure/public.js +1 -1
  133. package/dist/ui/dragAndDrop/index.d.ts +385 -103
  134. package/dist/ui/dragAndDrop/index.d.ts.map +1 -1
  135. package/dist/ui/dragAndDrop/index.js +26 -31
  136. package/dist/ui/dragAndDrop/public.d.ts +1 -1
  137. package/dist/ui/dragAndDrop/public.d.ts.map +1 -1
  138. package/dist/ui/dragAndDrop/public.js +1 -1
  139. package/dist/ui/fileDrop/index.d.ts +42 -46
  140. package/dist/ui/fileDrop/index.d.ts.map +1 -1
  141. package/dist/ui/fileDrop/index.js +30 -46
  142. package/dist/ui/fileDrop/public.d.ts +2 -2
  143. package/dist/ui/fileDrop/public.d.ts.map +1 -1
  144. package/dist/ui/fileDrop/public.js +1 -1
  145. package/dist/ui/listbox/multi.d.ts +39 -84
  146. package/dist/ui/listbox/multi.d.ts.map +1 -1
  147. package/dist/ui/listbox/multi.js +38 -20
  148. package/dist/ui/listbox/multiPublic.d.ts +2 -2
  149. package/dist/ui/listbox/multiPublic.d.ts.map +1 -1
  150. package/dist/ui/listbox/multiPublic.js +1 -1
  151. package/dist/ui/listbox/public.d.ts +3 -3
  152. package/dist/ui/listbox/public.d.ts.map +1 -1
  153. package/dist/ui/listbox/public.js +2 -2
  154. package/dist/ui/listbox/shared.d.ts +71 -30
  155. package/dist/ui/listbox/shared.d.ts.map +1 -1
  156. package/dist/ui/listbox/shared.js +319 -296
  157. package/dist/ui/listbox/single.d.ts +57 -85
  158. package/dist/ui/listbox/single.d.ts.map +1 -1
  159. package/dist/ui/listbox/single.js +48 -24
  160. package/dist/ui/menu/index.d.ts +80 -36
  161. package/dist/ui/menu/index.d.ts.map +1 -1
  162. package/dist/ui/menu/index.js +117 -86
  163. package/dist/ui/menu/public.d.ts +2 -2
  164. package/dist/ui/menu/public.d.ts.map +1 -1
  165. package/dist/ui/menu/public.js +1 -1
  166. package/dist/ui/popover/index.d.ts +117 -44
  167. package/dist/ui/popover/index.d.ts.map +1 -1
  168. package/dist/ui/popover/index.js +88 -101
  169. package/dist/ui/popover/public.d.ts +2 -2
  170. package/dist/ui/popover/public.d.ts.map +1 -1
  171. package/dist/ui/popover/public.js +1 -1
  172. package/dist/ui/radioGroup/index.d.ts +122 -45
  173. package/dist/ui/radioGroup/index.d.ts.map +1 -1
  174. package/dist/ui/radioGroup/index.js +111 -72
  175. package/dist/ui/radioGroup/public.d.ts +2 -2
  176. package/dist/ui/radioGroup/public.d.ts.map +1 -1
  177. package/dist/ui/radioGroup/public.js +1 -1
  178. package/dist/ui/slider/index.d.ts +247 -103
  179. package/dist/ui/slider/index.d.ts.map +1 -1
  180. package/dist/ui/slider/index.js +52 -68
  181. package/dist/ui/slider/public.d.ts +2 -2
  182. package/dist/ui/slider/public.d.ts.map +1 -1
  183. package/dist/ui/slider/public.js +1 -1
  184. package/dist/ui/switch/index.d.ts +74 -21
  185. package/dist/ui/switch/index.d.ts.map +1 -1
  186. package/dist/ui/switch/index.js +62 -33
  187. package/dist/ui/switch/public.d.ts +2 -2
  188. package/dist/ui/switch/public.d.ts.map +1 -1
  189. package/dist/ui/switch/public.js +1 -1
  190. package/dist/ui/tabs/index.d.ts +107 -45
  191. package/dist/ui/tabs/index.d.ts.map +1 -1
  192. package/dist/ui/tabs/index.js +99 -81
  193. package/dist/ui/tabs/public.d.ts +2 -2
  194. package/dist/ui/tabs/public.d.ts.map +1 -1
  195. package/dist/ui/tabs/public.js +1 -1
  196. package/dist/ui/toast/index.d.ts +93 -109
  197. package/dist/ui/toast/index.d.ts.map +1 -1
  198. package/dist/ui/toast/index.js +16 -29
  199. package/dist/ui/toast/schema.d.ts +15 -4
  200. package/dist/ui/toast/schema.d.ts.map +1 -1
  201. package/dist/ui/toast/schema.js +11 -4
  202. package/dist/ui/toast/update.d.ts +36 -18
  203. package/dist/ui/toast/update.d.ts.map +1 -1
  204. package/dist/ui/toast/update.js +33 -14
  205. package/dist/ui/tooltip/index.d.ts +94 -42
  206. package/dist/ui/tooltip/index.d.ts.map +1 -1
  207. package/dist/ui/tooltip/index.js +64 -73
  208. package/dist/ui/tooltip/public.d.ts +2 -2
  209. package/dist/ui/tooltip/public.d.ts.map +1 -1
  210. package/dist/ui/tooltip/public.js +1 -1
  211. package/dist/ui/virtualList/index.d.ts +63 -80
  212. package/dist/ui/virtualList/index.d.ts.map +1 -1
  213. package/dist/ui/virtualList/index.js +22 -49
  214. package/dist/ui/virtualList/public.d.ts +2 -2
  215. package/dist/ui/virtualList/public.d.ts.map +1 -1
  216. package/dist/ui/virtualList/public.js +1 -1
  217. package/package.json +1 -1
@@ -89,6 +89,9 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
89
89
  entryId: S.String;
90
90
  message: S.Union<[import("../../schema/index.js").CallableTaggedStruct<"Showed", {}>, import("../../schema/index.js").CallableTaggedStruct<"Hid", {}>, import("../../schema/index.js").CallableTaggedStruct<"AdvancedAnimationFrame", {}>, import("../../schema/index.js").CallableTaggedStruct<"EndedAnimation", {}>]>;
91
91
  }>]>;
92
+ readonly OutMessage: S.Union<readonly [import("../../schema/index.js").CallableTaggedStruct<"DismissedToast", {
93
+ payload: S.Codec<A, I, never, never>;
94
+ }>]>;
92
95
  readonly Added: import("../../schema/index.js").CallableTaggedStruct<"Added", {
93
96
  entry: S.Struct<{
94
97
  readonly id: S.String;
@@ -104,12 +107,15 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
104
107
  readonly payload: S.Codec<A, I, never, never>;
105
108
  }>;
106
109
  }>;
110
+ readonly DismissedToast: import("../../schema/index.js").CallableTaggedStruct<"DismissedToast", {
111
+ payload: S.Codec<A, I, never, never>;
112
+ }>;
107
113
  readonly init: (config: InitConfig) => {
108
114
  readonly id: string;
109
115
  readonly defaultDuration: Duration.Duration;
110
116
  readonly entries: readonly {
111
117
  readonly id: string;
112
- readonly variant: "Success" | "Error" | "Info" | "Warning";
118
+ readonly variant: "Error" | "Success" | "Info" | "Warning";
113
119
  readonly animation: {
114
120
  readonly id: string;
115
121
  readonly isShowing: boolean;
@@ -127,7 +133,7 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
127
133
  readonly defaultDuration: Duration.Duration;
128
134
  readonly entries: readonly {
129
135
  readonly id: string;
130
- readonly variant: "Success" | "Error" | "Info" | "Warning";
136
+ readonly variant: "Error" | "Success" | "Info" | "Warning";
131
137
  readonly animation: {
132
138
  readonly id: string;
133
139
  readonly isShowing: boolean;
@@ -170,7 +176,7 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
170
176
  readonly _tag: "Added";
171
177
  readonly entry: {
172
178
  readonly id: string;
173
- readonly variant: "Success" | "Error" | "Info" | "Warning";
179
+ readonly variant: "Error" | "Success" | "Info" | "Warning";
174
180
  readonly animation: {
175
181
  readonly id: string;
176
182
  readonly isShowing: boolean;
@@ -186,7 +192,7 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
186
192
  readonly defaultDuration: Duration.Duration;
187
193
  readonly entries: readonly {
188
194
  readonly id: string;
189
- readonly variant: "Success" | "Error" | "Info" | "Warning";
195
+ readonly variant: "Error" | "Success" | "Info" | "Warning";
190
196
  readonly animation: {
191
197
  readonly id: string;
192
198
  readonly isShowing: boolean;
@@ -232,7 +238,7 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
232
238
  readonly _tag: "Added";
233
239
  readonly entry: {
234
240
  readonly id: string;
235
- readonly variant: "Success" | "Error" | "Info" | "Warning";
241
+ readonly variant: "Error" | "Success" | "Info" | "Warning";
236
242
  readonly animation: {
237
243
  readonly id: string;
238
244
  readonly isShowing: boolean;
@@ -244,13 +250,16 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
244
250
  readonly payload: A;
245
251
  };
246
252
  }, never, never>;
247
- }>[]];
253
+ }>[], Option.Option<{
254
+ readonly _tag: "DismissedToast";
255
+ readonly payload: A;
256
+ }>];
248
257
  readonly show: (model: {
249
258
  readonly id: string;
250
259
  readonly defaultDuration: Duration.Duration;
251
260
  readonly entries: readonly {
252
261
  readonly id: string;
253
- readonly variant: "Success" | "Error" | "Info" | "Warning";
262
+ readonly variant: "Error" | "Success" | "Info" | "Warning";
254
263
  readonly animation: {
255
264
  readonly id: string;
256
265
  readonly isShowing: boolean;
@@ -267,7 +276,7 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
267
276
  readonly defaultDuration: Duration.Duration;
268
277
  readonly entries: readonly {
269
278
  readonly id: string;
270
- readonly variant: "Success" | "Error" | "Info" | "Warning";
279
+ readonly variant: "Error" | "Success" | "Info" | "Warning";
271
280
  readonly animation: {
272
281
  readonly id: string;
273
282
  readonly isShowing: boolean;
@@ -313,7 +322,7 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
313
322
  readonly _tag: "Added";
314
323
  readonly entry: {
315
324
  readonly id: string;
316
- readonly variant: "Success" | "Error" | "Info" | "Warning";
325
+ readonly variant: "Error" | "Success" | "Info" | "Warning";
317
326
  readonly animation: {
318
327
  readonly id: string;
319
328
  readonly isShowing: boolean;
@@ -325,13 +334,16 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
325
334
  readonly payload: A;
326
335
  };
327
336
  }, never, never>;
328
- }>[]];
337
+ }>[], Option.Option<{
338
+ readonly _tag: "DismissedToast";
339
+ readonly payload: A;
340
+ }>];
329
341
  readonly dismiss: (model: {
330
342
  readonly id: string;
331
343
  readonly defaultDuration: Duration.Duration;
332
344
  readonly entries: readonly {
333
345
  readonly id: string;
334
- readonly variant: "Success" | "Error" | "Info" | "Warning";
346
+ readonly variant: "Error" | "Success" | "Info" | "Warning";
335
347
  readonly animation: {
336
348
  readonly id: string;
337
349
  readonly isShowing: boolean;
@@ -348,7 +360,7 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
348
360
  readonly defaultDuration: Duration.Duration;
349
361
  readonly entries: readonly {
350
362
  readonly id: string;
351
- readonly variant: "Success" | "Error" | "Info" | "Warning";
363
+ readonly variant: "Error" | "Success" | "Info" | "Warning";
352
364
  readonly animation: {
353
365
  readonly id: string;
354
366
  readonly isShowing: boolean;
@@ -394,7 +406,7 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
394
406
  readonly _tag: "Added";
395
407
  readonly entry: {
396
408
  readonly id: string;
397
- readonly variant: "Success" | "Error" | "Info" | "Warning";
409
+ readonly variant: "Error" | "Success" | "Info" | "Warning";
398
410
  readonly animation: {
399
411
  readonly id: string;
400
412
  readonly isShowing: boolean;
@@ -406,13 +418,16 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
406
418
  readonly payload: A;
407
419
  };
408
420
  }, never, never>;
409
- }>[]];
421
+ }>[], Option.Option<{
422
+ readonly _tag: "DismissedToast";
423
+ readonly payload: A;
424
+ }>];
410
425
  readonly dismissAll: (model: {
411
426
  readonly id: string;
412
427
  readonly defaultDuration: Duration.Duration;
413
428
  readonly entries: readonly {
414
429
  readonly id: string;
415
- readonly variant: "Success" | "Error" | "Info" | "Warning";
430
+ readonly variant: "Error" | "Success" | "Info" | "Warning";
416
431
  readonly animation: {
417
432
  readonly id: string;
418
433
  readonly isShowing: boolean;
@@ -429,7 +444,7 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
429
444
  readonly defaultDuration: Duration.Duration;
430
445
  readonly entries: readonly {
431
446
  readonly id: string;
432
- readonly variant: "Success" | "Error" | "Info" | "Warning";
447
+ readonly variant: "Error" | "Success" | "Info" | "Warning";
433
448
  readonly animation: {
434
449
  readonly id: string;
435
450
  readonly isShowing: boolean;
@@ -475,7 +490,7 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
475
490
  readonly _tag: "Added";
476
491
  readonly entry: {
477
492
  readonly id: string;
478
- readonly variant: "Success" | "Error" | "Info" | "Warning";
493
+ readonly variant: "Error" | "Success" | "Info" | "Warning";
479
494
  readonly animation: {
480
495
  readonly id: string;
481
496
  readonly isShowing: boolean;
@@ -487,6 +502,9 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
487
502
  readonly payload: A;
488
503
  };
489
504
  }, never, never>;
490
- }>[]];
505
+ }>[], Option.Option<{
506
+ readonly _tag: "DismissedToast";
507
+ readonly payload: A;
508
+ }>];
491
509
  };
492
510
  //# sourceMappingURL=update.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/ui/toast/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EACR,MAAM,EAGN,MAAM,EACN,MAAM,IAAI,CAAC,EACZ,MAAM,QAAQ,CAAA;AAEf,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAA;AAcjD,OAAO,EAML,KAAK,UAAU,EACf,KAAK,OAAO,EAKb,MAAM,aAAa,CAAA;AAIpB;;oDAEoD;AACpD,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,QAAQ,CAAC;IAClC,OAAO,EAAE,CAAC,CAAA;IACV,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAA;IACzB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAC,CAAA;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A;IACjB,QAAQ,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAA;IACzB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAC,CAAA;AAEF;;;eAGe;AACf,eAAO,MAAM,YAAY;;;;;;;;iBAUxB,CAAA;AAID;;;;;;4EAM4E;AAC5E,eAAO,MAAM,WAAW,GAAI,CAAC,EAAE,CAAC,EAAE,eAAe,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BA6ItC,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA+IG,SAAS,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAIP,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoB/C,CAAA"}
@@ -4,7 +4,7 @@ import { OptionExt } from '../../effectExtensions/index.js';
4
4
  import { evo } from '../../struct/index.js';
5
5
  import { Hid as AnimationHid, Showed as AnimationShowed, init as animationInit, } from '../animation/schema.js';
6
6
  import { defaultLeaveCommand as animationDefaultLeaveCommand, update as animationUpdate, } from '../animation/update.js';
7
- import { DEFAULT_DURATION, Dismissed, DismissedAll, ElapsedDuration, GotAnimationMessage, makeAdded, makeEntry, makeMessage, makeModel, } from './schema.js';
7
+ import { DEFAULT_DURATION, Dismissed, DismissedAll, ElapsedDuration, GotAnimationMessage, makeAdded, makeDismissedToast, makeEntry, makeMessage, makeModel, makeOutMessage, } from './schema.js';
8
8
  /** Schedules an auto-dismiss timer for an entry. The result Message carries a
9
9
  * version so stale timers (from hover or manual dismiss) are discarded in
10
10
  * the update function. Static. The Command definition doesn't depend on
@@ -26,7 +26,9 @@ export const makeRuntime = (payloadSchema) => {
26
26
  const EntrySchema = makeEntry(payloadSchema);
27
27
  const ModelSchema = makeModel(payloadSchema);
28
28
  const MessageSchema = makeMessage(payloadSchema);
29
+ const OutMessageSchema = makeOutMessage(payloadSchema);
29
30
  const Added = makeAdded(payloadSchema);
31
+ const DismissedToast = makeDismissedToast(payloadSchema);
30
32
  const withUpdateReturn = M.withReturnType();
31
33
  const updateEntry = (model, entryId, f) => evo(model, {
32
34
  entries: Array.map(entry => (entry.id === entryId ? f(entry) : entry)),
@@ -55,11 +57,11 @@ export const makeRuntime = (payloadSchema) => {
55
57
  const delegateToEntryAnimation = (model, entryId, animationMessage) => {
56
58
  const maybeEntry = Array.findFirst(model.entries, ({ id }) => id === entryId);
57
59
  return Option.match(maybeEntry, {
58
- onNone: () => [model, []],
60
+ onNone: () => [model, [], Option.none()],
59
61
  onSome: entry => {
60
62
  const [nextAnimation, animationCommands, maybeOutMessage] = animationUpdate(entry.animation, animationMessage);
61
63
  const toMessage = (message) => GotAnimationMessage({ entryId, message });
62
- const mappedCommands = animationCommands.map(Command.mapEffect(Effect.map(toMessage)));
64
+ const mappedCommands = Command.mapMessages(animationCommands, toMessage);
63
65
  const nextEntry = evo(entry, {
64
66
  animation: () => nextAnimation,
65
67
  });
@@ -67,18 +69,21 @@ export const makeRuntime = (payloadSchema) => {
67
69
  onNone: () => [
68
70
  updateEntry(model, entryId, () => nextEntry),
69
71
  mappedCommands,
72
+ Option.none(),
70
73
  ],
71
74
  onSome: M.type().pipe(withUpdateReturn, M.tagsExhaustive({
72
75
  StartedLeaveAnimating: () => [
73
76
  updateEntry(model, entryId, () => nextEntry),
74
77
  [
75
78
  ...mappedCommands,
76
- Command.mapEffect(animationDefaultLeaveCommand(nextAnimation), Effect.map(toMessage)),
79
+ Command.mapMessage(animationDefaultLeaveCommand(nextAnimation), toMessage),
77
80
  ],
81
+ Option.none(),
78
82
  ],
79
83
  TransitionedOut: () => [
80
84
  removeEntry(model, entryId),
81
85
  mappedCommands,
86
+ Option.some(DismissedToast({ payload: entry.payload })),
82
87
  ],
83
88
  })),
84
89
  });
@@ -110,7 +115,9 @@ export const makeRuntime = (payloadSchema) => {
110
115
  entries: [],
111
116
  nextEntryKey: 0,
112
117
  });
113
- /** Processes a toast message and returns the next model and commands. */
118
+ /** Processes a toast message and returns the next model, commands, and
119
+ * an optional `DismissedToast` OutMessage emitted once an entry has
120
+ * finished its leave animation. */
114
121
  const update = (model, message) => M.value(message).pipe(withUpdateReturn, M.tagsExhaustive({
115
122
  Added: ({ entry }) => {
116
123
  const modelWithEntry = evo(model, {
@@ -123,15 +130,19 @@ export const makeRuntime = (payloadSchema) => {
123
130
  onNone: () => [],
124
131
  onSome: rescheduleDismissCommands,
125
132
  });
126
- return [modelAfterShow, [...showCommands, ...dismissCommands]];
133
+ return [
134
+ modelAfterShow,
135
+ [...showCommands, ...dismissCommands],
136
+ Option.none(),
137
+ ];
127
138
  },
128
139
  Dismissed: ({ entryId }) => {
129
140
  const maybeEntry = Array.findFirst(model.entries, ({ id }) => id === entryId);
130
141
  return Option.match(maybeEntry, {
131
- onNone: () => [model, []],
142
+ onNone: () => [model, [], Option.none()],
132
143
  onSome: entry => {
133
144
  if (isEntryLeaving(entry)) {
134
- return [model, []];
145
+ return [model, [], Option.none()];
135
146
  }
136
147
  else {
137
148
  return delegateToEntryAnimation(model, entryId, AnimationHid());
@@ -139,21 +150,25 @@ export const makeRuntime = (payloadSchema) => {
139
150
  },
140
151
  });
141
152
  },
142
- DismissedAll: () => Array.reduce(model.entries, [model, []], ([currentModel, currentCommands], entry) => {
153
+ DismissedAll: () => Array.reduce(model.entries, [model, [], Option.none()], ([currentModel, currentCommands, currentOut], entry) => {
143
154
  if (isEntryLeaving(entry)) {
144
- return [currentModel, currentCommands];
155
+ return [currentModel, currentCommands, currentOut];
145
156
  }
146
157
  const [nextModel, nextCommands] = delegateToEntryAnimation(currentModel, entry.id, AnimationHid());
147
- return [nextModel, [...currentCommands, ...nextCommands]];
158
+ return [
159
+ nextModel,
160
+ [...currentCommands, ...nextCommands],
161
+ currentOut,
162
+ ];
148
163
  }),
149
164
  ElapsedDuration: ({ entryId, version }) => {
150
165
  const maybeEntry = Array.findFirst(model.entries, ({ id }) => id === entryId);
151
166
  return Option.match(maybeEntry, {
152
- onNone: () => [model, []],
167
+ onNone: () => [model, [], Option.none()],
153
168
  onSome: entry => {
154
169
  const isStale = version !== entry.pendingDismissVersion;
155
170
  if (isStale || isEntryLeaving(entry)) {
156
- return [model, []];
171
+ return [model, [], Option.none()];
157
172
  }
158
173
  else {
159
174
  return delegateToEntryAnimation(model, entryId, AnimationHid());
@@ -167,11 +182,12 @@ export const makeRuntime = (payloadSchema) => {
167
182
  pendingDismissVersion: Number.increment,
168
183
  })),
169
184
  [],
185
+ Option.none(),
170
186
  ],
171
187
  LeftEntry: ({ entryId }) => {
172
188
  const maybeEntry = Array.findFirst(model.entries, ({ id }) => id === entryId);
173
189
  return Option.match(maybeEntry, {
174
- onNone: () => [model, []],
190
+ onNone: () => [model, [], Option.none()],
175
191
  onSome: entry => {
176
192
  const nextEntry = evo(entry, {
177
193
  isHovered: () => false,
@@ -180,6 +196,7 @@ export const makeRuntime = (payloadSchema) => {
180
196
  return [
181
197
  updateEntry(model, entryId, () => nextEntry),
182
198
  rescheduleDismissCommands(nextEntry),
199
+ Option.none(),
183
200
  ];
184
201
  },
185
202
  });
@@ -196,7 +213,9 @@ export const makeRuntime = (payloadSchema) => {
196
213
  Entry: EntrySchema,
197
214
  Model: ModelSchema,
198
215
  Message: MessageSchema,
216
+ OutMessage: OutMessageSchema,
199
217
  Added,
218
+ DismissedToast,
200
219
  init,
201
220
  update,
202
221
  show,
@@ -1,9 +1,10 @@
1
- import { Duration, Effect, Schema as S } from 'effect';
1
+ import { Duration, Effect, Option, Schema as S } from 'effect';
2
2
  import * as Command from '../../command/index.js';
3
- import { type Attribute, type Html } from '../../html/index.js';
3
+ import { type ChildAttribute, type Html } from '../../html/index.js';
4
4
  import * as Mount from '../../mount/index.js';
5
+ import type { Reflect } from '../../submodel/submodel.js';
5
6
  import { AnchorConfig } from '../anchor.js';
6
- /** Schema for the tooltip component's state. `isOpen` is visibility; `isHovered` tracks pointer on trigger; `isFocused` tracks tooltip-affirming focus on the trigger (focus arriving without a preceding mouse press keyboard, touch, or pen; mouse-click-induced focus is excluded since it doesn't affirm the user wants the tooltip visible); `isDismissed` suppresses re-opening after the user dismissed the tooltip (via Escape or left-click) until they disengage (leave or blur). `showDelay` is the hover-to-show duration. `maybeLastPointerType` records the most recent pointer type that pressed the trigger, so a mouse-click-induced focus can be distinguished from other focus. */
7
+ /** Schema for the tooltip component's state. `isOpen` is visibility; `isHovered` tracks pointer on trigger; `isFocused` tracks tooltip-affirming focus on the trigger (focus arriving without a preceding mouse press, like keyboard, touch, or pen; mouse-click-induced focus is excluded since it doesn't affirm the user wants the tooltip visible); `isDismissed` suppresses re-opening after the user dismissed the tooltip (via Escape or left-click) until they disengage (leave or blur). `showDelay` is the hover-to-show duration. `maybeLastPointerType` records the most recent pointer type that pressed the trigger, so a mouse-click-induced focus can be distinguished from other focus. */
7
8
  export declare const Model: S.Struct<{
8
9
  readonly id: S.String;
9
10
  readonly isOpen: S.Boolean;
@@ -15,30 +16,26 @@ export declare const Model: S.Struct<{
15
16
  readonly maybeLastPointerType: S.Option<S.String>;
16
17
  }>;
17
18
  export type Model = typeof Model.Type;
18
- /** Sent when the pointer enters the tooltip trigger. Starts the show-delay timer. */
19
+ /** Sent when the pointer enters the tooltip trigger. */
19
20
  export declare const EnteredTrigger: import("../../schema/index.js").CallableTaggedStruct<"EnteredTrigger", {}>;
20
- /** Sent when the pointer leaves the tooltip trigger. Cancels any pending show-delay and hides the tooltip unless focus is active. */
21
+ /** Sent when the pointer leaves the tooltip trigger. */
21
22
  export declare const LeftTrigger: import("../../schema/index.js").CallableTaggedStruct<"LeftTrigger", {}>;
22
- /** Sent when focus enters the trigger. Shows the tooltip immediately unless the focus was caused by a mouse press, in which case the hover-delay path handles it instead. */
23
+ /** Sent when focus enters the trigger. */
23
24
  export declare const FocusedTrigger: import("../../schema/index.js").CallableTaggedStruct<"FocusedTrigger", {}>;
24
- /** Sent when focus leaves the trigger. Hides the tooltip unless hover is active. */
25
+ /** Sent when focus leaves the trigger. */
25
26
  export declare const BlurredTrigger: import("../../schema/index.js").CallableTaggedStruct<"BlurredTrigger", {}>;
26
- /** Sent when Escape is pressed while the tooltip is visible. Hides the tooltip and flags `isDismissed` so hover and focus do not re-open it until the user disengages (leaves or blurs the trigger). */
27
+ /** Sent when Escape is pressed while the tooltip is visible. */
27
28
  export declare const PressedEscape: import("../../schema/index.js").CallableTaggedStruct<"PressedEscape", {}>;
28
- /** Sent when a pointer presses the trigger. Records the pointer type so a following focus event from the same mouse click can be suppressed, and a left-click on an open tooltip dismisses it (the user is clicking the button for its action, not to keep the tooltip visible). */
29
+ /** Sent when a pointer presses the trigger. */
29
30
  export declare const PressedPointerOnTrigger: import("../../schema/index.js").CallableTaggedStruct<"PressedPointerOnTrigger", {
30
31
  pointerType: S.String;
31
32
  button: S.Number;
32
33
  }>;
33
- /** Sent when the show-delay timer fires. Carries a generation number that is compared against the current pending version to discard stale timers. */
34
+ /** Sent when the show-delay timer fires. */
34
35
  export declare const ElapsedShowDelay: import("../../schema/index.js").CallableTaggedStruct<"ElapsedShowDelay", {
35
36
  version: S.Number;
36
37
  }>;
37
- /** Signals that the show-delay has changed (e.g. in response to a user preference, input-method change, or reduced-motion setting). Does not affect the current open/closed state; the new delay applies to the next hover. Typically dispatched via the `setShowDelay` helper. */
38
- export declare const ChangedShowDelay: import("../../schema/index.js").CallableTaggedStruct<"ChangedShowDelay", {
39
- showDelay: S.DurationFromMillis;
40
- }>;
41
- /** Sent when the tooltip panel mounts and Floating UI has positioned it. Update no-ops; the side effect is the act of positioning, surfaced for DevTools observability. */
38
+ /** Sent when the tooltip panel mounts and Floating UI has positioned it. */
42
39
  export declare const CompletedAnchorTooltip: import("../../schema/index.js").CallableTaggedStruct<"CompletedAnchorTooltip", {}>;
43
40
  /** Union of all messages the tooltip component can produce. */
44
41
  export declare const Message: S.Union<[
@@ -49,7 +46,6 @@ export declare const Message: S.Union<[
49
46
  typeof PressedEscape,
50
47
  typeof PressedPointerOnTrigger,
51
48
  typeof ElapsedShowDelay,
52
- typeof ChangedShowDelay,
53
49
  typeof CompletedAnchorTooltip
54
50
  ]>;
55
51
  export type EnteredTrigger = typeof EnteredTrigger.Type;
@@ -59,15 +55,25 @@ export type BlurredTrigger = typeof BlurredTrigger.Type;
59
55
  export type PressedEscape = typeof PressedEscape.Type;
60
56
  export type PressedPointerOnTrigger = typeof PressedPointerOnTrigger.Type;
61
57
  export type Message = typeof Message.Type;
62
- /** Configuration for creating a tooltip model with `init`. `showDelay` controls how long the pointer must hover before the tooltip appears (default 500ms). Accepts any `Duration.Input` — a bare number is interpreted as milliseconds. Keyboard focus shows the tooltip immediately regardless of this value. */
58
+ /** Emitted once the tooltip transitions to visible (`isOpen` becomes true).
59
+ * Consumers typically use this for analytics, instrumentation, or to
60
+ * coordinate with other transient UI. */
61
+ export declare const Shown: import("../../schema/index.js").CallableTaggedStruct<"Shown", {}>;
62
+ /** Emitted once the tooltip transitions to hidden (`isOpen` becomes false). */
63
+ export declare const Hidden: import("../../schema/index.js").CallableTaggedStruct<"Hidden", {}>;
64
+ /** Union of out-messages the tooltip component can produce. */
65
+ export declare const OutMessage: S.Union<readonly [import("../../schema/index.js").CallableTaggedStruct<"Shown", {}>, import("../../schema/index.js").CallableTaggedStruct<"Hidden", {}>]>;
66
+ export type Shown = typeof Shown.Type;
67
+ export type Hidden = typeof Hidden.Type;
68
+ export type OutMessage = typeof OutMessage.Type;
69
+ /** Configuration for creating a tooltip model with `init`. */
63
70
  export type InitConfig = Readonly<{
64
71
  id: string;
65
72
  showDelay?: Duration.Input;
66
73
  }>;
67
74
  /** Creates an initial tooltip model from a config. Defaults to hidden. */
68
75
  export declare const init: (config: InitConfig) => Model;
69
- type UpdateReturn = readonly [Model, ReadonlyArray<Command.Command<Message>>];
70
- /** Waits for the tooltip's show delay before emitting `ElapsedShowDelay`. The version is echoed back so a stale timer is ignored when the user leaves before the delay fires. */
76
+ /** Waits for the tooltip's show delay before emitting `ElapsedShowDelay`. */
71
77
  export declare const ShowAfterDelay: Command.CommandDefinitionWithArgs<"ShowAfterDelay", {
72
78
  delay: S.DurationFromMillis;
73
79
  version: S.Number;
@@ -75,9 +81,7 @@ export declare const ShowAfterDelay: Command.CommandDefinitionWithArgs<"ShowAfte
75
81
  readonly _tag: "ElapsedShowDelay";
76
82
  readonly version: number;
77
83
  }, never, never>>;
78
- /** The anchor-positioning Mount this Tooltip renders on its panel. Exposed so
79
- * Scene tests can call `Scene.Mount.resolve(AnchorTooltip, CompletedAnchorTooltip())`
80
- * to acknowledge the mount produced by the rendered panel. */
84
+ /** The anchor-positioning Mount this Tooltip renders on its panel. */
81
85
  export declare const AnchorTooltip: Mount.MountDefinitionWithArgs<"AnchorTooltip", {
82
86
  buttonId: S.String;
83
87
  anchor: S.Struct<{
@@ -90,29 +94,77 @@ export declare const AnchorTooltip: Mount.MountDefinitionWithArgs<"AnchorTooltip
90
94
  }, {
91
95
  readonly _tag: "CompletedAnchorTooltip";
92
96
  }>;
93
- /** Processes a tooltip message and returns the next model and commands. */
97
+ type UpdateReturn = readonly [
98
+ Model,
99
+ ReadonlyArray<Command.Command<Message>>,
100
+ Option.Option<OutMessage>
101
+ ];
102
+ /** Processes a tooltip message and returns the next model, commands, and
103
+ * an optional OutMessage. `Shown`/`Hidden` fire only on `isOpen`
104
+ * transitions, so consumers don't get spurious events for messages that
105
+ * only update hover/focus/delay state without changing visibility. */
94
106
  export declare const update: (model: Model, message: Message) => UpdateReturn;
95
- /** Programmatically updates the tooltip's hover show-delay. Use this in response to user preference changes, input-method switches, or reduced-motion settings. The new delay applies to the next hover; any pending timer is unaffected (its stale version will discard harmlessly when it fires). */
96
- export declare const setShowDelay: (model: Model, showDelay: Duration.Input) => readonly [Model, ReadonlyArray<Command.Command<Message>>];
97
- /** Configuration for rendering a tooltip with `view`. */
98
- export type ViewConfig<ParentMessage> = Readonly<{
99
- model: Model;
100
- toParentMessage: (message: EnteredTrigger | LeftTrigger | FocusedTrigger | BlurredTrigger | PressedEscape | PressedPointerOnTrigger | typeof CompletedAnchorTooltip.Type) => ParentMessage;
107
+ /** Reflects an externally-sourced hover show-delay onto the model without
108
+ * emitting an OutMessage. Use to mirror an external config value (a user
109
+ * preference, a restored setting) onto the tooltip. */
110
+ export declare const reflectShowDelay: Reflect<Model, Duration.Input>;
111
+ /** Render-time payload published to the consumer's `toView`.
112
+ *
113
+ * - `trigger`: attribute bundle for the trigger element. Carries the
114
+ * hover/focus/keyboard handlers + ARIA `aria-describedby` linking to
115
+ * the panel.
116
+ * - `panel`: attribute bundle for the panel element. Carries the
117
+ * `role="tooltip"`, the anchor Mount that positions the panel via
118
+ * Floating UI, and a `data-open` attribute when visible.
119
+ * - `isVisible`: derived state. The consumer decides whether to render
120
+ * the panel conditionally on this. */
121
+ export type RenderInfo = Readonly<{
122
+ trigger: ReadonlyArray<ChildAttribute>;
123
+ panel: ReadonlyArray<ChildAttribute>;
124
+ isVisible: boolean;
125
+ }>;
126
+ /** Per-render view inputs passed to `view` via `h.submodel`'s `viewInputs` field. */
127
+ export type ViewInputs = Readonly<{
101
128
  anchor: AnchorConfig;
102
- triggerContent: Html;
103
- triggerClassName?: string;
104
- triggerAttributes?: ReadonlyArray<Attribute<ParentMessage>>;
105
- content: Html;
106
- panelClassName?: string;
107
- panelAttributes?: ReadonlyArray<Attribute<ParentMessage>>;
129
+ toView: (render: RenderInfo) => Html;
108
130
  isDisabled?: boolean;
109
- className?: string;
110
- attributes?: ReadonlyArray<Attribute<ParentMessage>>;
111
131
  }>;
112
- /** Renders a headless tooltip with an anchored non-interactive panel. Shows on hover (after delay) or focus (from keyboard, touch, or pen; mouse-click focus is excluded); hides on leave, blur, Escape, or left-click of the trigger. Uses `role="tooltip"` and links the trigger via `aria-describedby`. */
113
- export declare const view: <ParentMessage>(config: ViewConfig<ParentMessage>) => Html;
114
- /** Creates a memoized tooltip view. Static config is captured in a closure;
115
- * only `model` and `toParentMessage` are compared per render via `createLazy`. */
116
- export declare const lazy: <ParentMessage>(staticConfig: Omit<ViewConfig<ParentMessage>, "model" | "toParentMessage">) => ((model: Model, toParentMessage: ViewConfig<ParentMessage>["toParentMessage"]) => Html);
132
+ /** Renders a headless tooltip with an anchored non-interactive panel.
133
+ * Shows on hover (after delay) or focus (from keyboard, touch, or pen;
134
+ * mouse-click focus is excluded); hides on leave, blur, Escape, or
135
+ * left-click of the trigger. */
136
+ export declare const view: import("../../html/submodel.js").SubmodelView<{
137
+ readonly id: string;
138
+ readonly isOpen: boolean;
139
+ readonly isHovered: boolean;
140
+ readonly isFocused: boolean;
141
+ readonly isDismissed: boolean;
142
+ readonly showDelay: Duration.Duration;
143
+ readonly pendingShowVersion: number;
144
+ readonly maybeLastPointerType: Option.Option<string>;
145
+ }, {
146
+ readonly _tag: "EnteredTrigger";
147
+ } | {
148
+ readonly _tag: "LeftTrigger";
149
+ } | {
150
+ readonly _tag: "FocusedTrigger";
151
+ } | {
152
+ readonly _tag: "BlurredTrigger";
153
+ } | {
154
+ readonly _tag: "PressedEscape";
155
+ } | {
156
+ readonly _tag: "PressedPointerOnTrigger";
157
+ readonly pointerType: string;
158
+ readonly button: number;
159
+ } | {
160
+ readonly _tag: "ElapsedShowDelay";
161
+ readonly version: number;
162
+ } | {
163
+ readonly _tag: "CompletedAnchorTooltip";
164
+ }, Readonly<{
165
+ anchor: AnchorConfig;
166
+ toView: (render: RenderInfo) => Html;
167
+ isDisabled?: boolean;
168
+ }>>;
117
169
  export {};
118
170
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/tooltip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,MAAM,EAKN,MAAM,IAAI,CAAC,EACZ,MAAM,QAAQ,CAAA;AAEf,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAA;AAEjD,OAAO,EACL,KAAK,SAAS,EACd,KAAK,IAAI,EAGV,MAAM,qBAAqB,CAAA;AAE5B,OAAO,KAAK,KAAK,MAAM,sBAAsB,CAAA;AAE7C,OAAO,EAAE,YAAY,EAAe,MAAM,cAAc,CAAA;AAIxD,wqBAAwqB;AACxqB,eAAO,MAAM,KAAK;;;;;;;;;EAShB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,qFAAqF;AACrF,eAAO,MAAM,cAAc,4EAAsB,CAAA;AACjD,qIAAqI;AACrI,eAAO,MAAM,WAAW,yEAAmB,CAAA;AAC3C,6KAA6K;AAC7K,eAAO,MAAM,cAAc,4EAAsB,CAAA;AACjD,oFAAoF;AACpF,eAAO,MAAM,cAAc,4EAAsB,CAAA;AACjD,wMAAwM;AACxM,eAAO,MAAM,aAAa,2EAAqB,CAAA;AAC/C,oRAAoR;AACpR,eAAO,MAAM,uBAAuB;;;EAGlC,CAAA;AACF,sJAAsJ;AACtJ,eAAO,MAAM,gBAAgB;;EAE3B,CAAA;AACF,mRAAmR;AACnR,eAAO,MAAM,gBAAgB;;EAE3B,CAAA;AACF,2KAA2K;AAC3K,eAAO,MAAM,sBAAsB,oFAA8B,CAAA;AAEjE,+DAA+D;AAC/D,eAAO,MAAM,OAAO,EAAE,CAAC,CAAC,KAAK,CAC3B;IACE,OAAO,cAAc;IACrB,OAAO,WAAW;IAClB,OAAO,cAAc;IACrB,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