@nectary/components 5.42.5-rc.0 → 5.43.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 (539) hide show
  1. package/accordion/global/index.js +1 -1
  2. package/accordion/index.js +5 -5
  3. package/accordion-item/global/index.js +1 -1
  4. package/accordion-item/index.js +6 -6
  5. package/action-menu/global/index.js +1 -1
  6. package/action-menu/index.js +4 -4
  7. package/action-menu-option/global/index.js +1 -1
  8. package/action-menu-option/index.js +4 -4
  9. package/alert/global/index.js +1 -1
  10. package/alert/index.js +6 -6
  11. package/avatar/global/index.js +1 -1
  12. package/avatar/index.js +4 -4
  13. package/badge/global/index.js +1 -1
  14. package/badge/index.js +5 -5
  15. package/bundle.js +8259 -13221
  16. package/button/global/index.js +1 -1
  17. package/button/index.js +7 -7
  18. package/button-group/global/index.js +1 -1
  19. package/button-group/index.js +4 -4
  20. package/button-group-item/global/index.js +1 -1
  21. package/button-group-item/index.js +3 -3
  22. package/card-container/global/index.js +1 -1
  23. package/card-container/index.js +1 -1
  24. package/card-v2/global/index.js +1 -1
  25. package/card-v2/index.js +3 -3
  26. package/card-v2-title/global/index.js +1 -1
  27. package/card-v2-title/index.js +2 -2
  28. package/checkbox/global/index.js +1 -1
  29. package/checkbox/index.js +5 -5
  30. package/chip/global/index.js +1 -1
  31. package/chip/index.js +6 -6
  32. package/code-tag/global/index.js +1 -1
  33. package/code-tag/index.js +2 -2
  34. package/color-menu/global/index.js +1 -1
  35. package/color-menu/index.js +6 -6
  36. package/color-menu-option/global/index.js +1 -1
  37. package/color-menu-option/index.js +5 -5
  38. package/color-swatch/global/index.js +2 -2
  39. package/color-swatch/index.js +19 -5
  40. package/color-swatch/utils.d.ts +2 -2
  41. package/color-swatch/utils.js +1 -1
  42. package/date-picker/global/index.js +1 -1
  43. package/date-picker/index.js +10 -10
  44. package/dialog/global/index.js +1 -1
  45. package/dialog/index.d.ts +2 -2
  46. package/dialog/index.js +9 -9
  47. package/emoji/global/index.js +1 -1
  48. package/emoji/index.js +3 -3
  49. package/emoji/utils.js +1 -1
  50. package/emoji-picker/global/index.js +1 -1
  51. package/emoji-picker/index.js +16 -13
  52. package/field/global/index.js +1 -1
  53. package/field/index.js +4 -4
  54. package/field-v2/global/index.js +1 -1
  55. package/field-v2/index.js +5 -5
  56. package/file-drop/global/index.js +1 -1
  57. package/file-drop/index.js +6 -6
  58. package/file-picker/global/index.js +1 -1
  59. package/file-picker/index.js +4 -4
  60. package/file-status/global/index.js +1 -1
  61. package/file-status/index.js +6 -6
  62. package/flag/global/index.js +1 -1
  63. package/flag/index.js +3 -3
  64. package/flag/utils.js +1 -1
  65. package/floating-panel/global/index.js +1 -1
  66. package/floating-panel/index.d.ts +3 -3
  67. package/floating-panel/index.js +12 -10
  68. package/floating-panel-button/index.js +3 -3
  69. package/floating-panel-icon-button/index.js +4 -4
  70. package/grid/global/index.js +1 -1
  71. package/grid/index.js +1 -1
  72. package/grid-item/global/index.js +1 -1
  73. package/grid-item/index.js +2 -2
  74. package/help-tooltip/global/index.js +1 -1
  75. package/help-tooltip/index.js +5 -5
  76. package/icon/generated-icon-type.d.ts +1 -1
  77. package/icon/global/index.js +1 -1
  78. package/icon/index.d.ts +1 -1
  79. package/icon/index.js +2 -2
  80. package/inline-alert/global/index.js +1 -1
  81. package/inline-alert/index.js +8 -8
  82. package/input/global/index.js +1 -1
  83. package/input/index.js +8 -8
  84. package/link/global/index.js +1 -1
  85. package/link/index.d.ts +2 -2
  86. package/link/index.js +10 -10
  87. package/link/types.d.ts +8 -8
  88. package/list/global/index.js +1 -1
  89. package/list/index.js +1 -1
  90. package/list-item/global/index.js +1 -1
  91. package/list-item/index.js +1 -1
  92. package/package.json +10 -10
  93. package/pagination/global/index.js +1 -1
  94. package/pagination/index.d.ts +2 -2
  95. package/pagination/index.js +6 -6
  96. package/persistent-overlay/global/index.js +1 -1
  97. package/persistent-overlay/index.js +4 -4
  98. package/pop/global/index.js +1 -1
  99. package/pop/index.d.ts +1 -1
  100. package/pop/index.js +10 -9
  101. package/popover/global/index.js +1 -1
  102. package/popover/index.js +7 -7
  103. package/progress/global/index.js +1 -1
  104. package/progress/index.js +3 -3
  105. package/progress-stepper/global/index.js +1 -1
  106. package/progress-stepper/index.js +6 -6
  107. package/progress-stepper-item/global/index.js +1 -1
  108. package/progress-stepper-item/index.js +5 -5
  109. package/progress-stepper-item/utils.d.ts +5 -5
  110. package/progress-stepper-item/utils.js +1 -1
  111. package/progress-stepper-item-v2/global/index.js +1 -1
  112. package/progress-stepper-item-v2/index.js +6 -5
  113. package/progress-stepper-item-v2/utils.d.ts +3 -3
  114. package/progress-stepper-item-v2/utils.js +1 -1
  115. package/progress-stepper-v2/compact.js +5 -4
  116. package/progress-stepper-v2/global/index.js +1 -1
  117. package/progress-stepper-v2/index.js +14 -11
  118. package/progress-stepper-v2/separators.js +1 -1
  119. package/progress-stepper-v2/step-chip.js +2 -2
  120. package/radio/global/index.js +1 -1
  121. package/radio/index.js +4 -4
  122. package/radio-option/global/index.js +1 -1
  123. package/radio-option/index.js +2 -2
  124. package/rich-text/global/index.js +1 -1
  125. package/rich-text/index.js +10 -10
  126. package/rich-text/utils.js +1 -1
  127. package/rich-textarea/global/index.js +1 -1
  128. package/rich-textarea/index.js +8 -8
  129. package/rich-textarea/utils.js +2 -2
  130. package/rich-textarea-chip/index.js +5 -5
  131. package/segment-collapse/global/index.js +1 -1
  132. package/segment-collapse/index.js +4 -4
  133. package/segmented-control/global/index.js +1 -1
  134. package/segmented-control/index.js +5 -5
  135. package/segmented-control-option/global/index.js +1 -1
  136. package/segmented-control-option/index.js +3 -3
  137. package/segmented-icon-control/global/index.js +1 -1
  138. package/segmented-icon-control/index.js +6 -6
  139. package/segmented-icon-control-option/global/index.js +1 -1
  140. package/segmented-icon-control-option/index.js +3 -3
  141. package/select-button/global/index.js +1 -1
  142. package/select-button/index.js +7 -7
  143. package/select-menu/global/index.js +1 -1
  144. package/select-menu/index.js +12 -12
  145. package/select-menu-option/global/index.js +1 -1
  146. package/select-menu-option/index.js +4 -4
  147. package/sheet/global/index.js +1 -1
  148. package/sheet/index.d.ts +1 -1
  149. package/sheet/index.js +7 -7
  150. package/sheet-title/global/index.js +1 -1
  151. package/sheet-title/index.d.ts +1 -1
  152. package/sheet-title/index.js +5 -5
  153. package/skeleton/global/index.js +1 -1
  154. package/skeleton/index.js +3 -3
  155. package/skeleton-item/global/index.js +1 -1
  156. package/skeleton-item/index.js +1 -1
  157. package/spinner/global/index.js +1 -1
  158. package/spinner/index.js +4 -4
  159. package/standalone.js +88 -25
  160. package/stop-events/index.js +2 -2
  161. package/table/global/index.js +1 -1
  162. package/table/index.js +1 -1
  163. package/table-body/global/index.js +1 -1
  164. package/table-body/index.js +1 -1
  165. package/table-cell/global/index.js +1 -1
  166. package/table-cell/index.js +3 -3
  167. package/table-head/global/index.js +1 -1
  168. package/table-head/index.js +1 -1
  169. package/table-head-cell/global/index.js +1 -1
  170. package/table-head-cell/index.js +4 -4
  171. package/table-row/global/index.js +1 -1
  172. package/table-row/index.js +2 -2
  173. package/tabs/global/index.js +1 -1
  174. package/tabs/index.js +6 -6
  175. package/tabs-icon-option/global/index.js +1 -1
  176. package/tabs-icon-option/index.js +3 -3
  177. package/tabs-option/global/index.js +1 -1
  178. package/tabs-option/index.js +4 -4
  179. package/tag/global/index.js +1 -1
  180. package/tag/index.js +5 -5
  181. package/text/global/index.js +1 -1
  182. package/text/index.js +3 -3
  183. package/textarea/global/index.js +1 -1
  184. package/textarea/index.js +7 -7
  185. package/time-picker/global/index.js +1 -1
  186. package/time-picker/index.js +8 -7
  187. package/title/global/index.js +1 -1
  188. package/title/index.js +3 -3
  189. package/toast/global/index.js +1 -1
  190. package/toast/index.js +7 -7
  191. package/toast/types.d.ts +0 -2
  192. package/toast-manager/global/index.js +1 -1
  193. package/toast-manager/index.js +7 -6
  194. package/toggle/global/index.js +1 -1
  195. package/toggle/index.js +3 -3
  196. package/tooltip/global/index.js +1 -1
  197. package/tooltip/index.d.ts +1 -1
  198. package/tooltip/index.js +9 -8
  199. package/utils/component-names.d.ts +1 -1
  200. package/utils/control-keyboard-navigation.d.ts +1 -1
  201. package/utils/control-keyboard-navigation.js +2 -2
  202. package/utils/element.d.ts +109 -16
  203. package/utils/element.js +2 -2
  204. package/utils/global-components-manager.d.ts +47 -4
  205. package/utils/global-components-manager.js +2 -91
  206. package/utils/index.js +73 -73
  207. package/utils/placement.js +1 -1
  208. package/utils/rect.js +1 -1
  209. package/utils/shared/cdn-loader.js +136 -0
  210. package/utils/shared/deferred-promise.js +10 -0
  211. package/utils/shared/global-elements-manager.js +150 -0
  212. package/utils/shared/global-elements-store.js +33 -0
  213. package/utils/shared/index.d.js +16 -0
  214. package/utils/shared/index.js +16 -0
  215. package/utils/shared/nectary-element-base.js +25 -0
  216. package/accordion/types.d.js +0 -1
  217. package/accordion-item/index.d.js +0 -3
  218. package/action-menu/global/index.d.js +0 -1
  219. package/action-menu/index.d.js +0 -1
  220. package/action-menu/types.d.js +0 -1
  221. package/action-menu-option/global/index.d.js +0 -1
  222. package/action-menu-option/index.d.js +0 -1
  223. package/action-menu-option/types.d.js +0 -1
  224. package/action-menu-option/utils.d.js +0 -1
  225. package/alert/global/index.d.js +0 -1
  226. package/alert/index.d.js +0 -3
  227. package/alert/types.d.js +0 -1
  228. package/alert/utils.d.js +0 -1
  229. package/avatar/colors.d.js +0 -1
  230. package/avatar/global/index.d.js +0 -1
  231. package/avatar/index.d.js +0 -1
  232. package/avatar/types.d.js +0 -1
  233. package/avatar/utils.d.js +0 -1
  234. package/badge/global/index.d.js +0 -1
  235. package/badge/index.d.js +0 -1
  236. package/badge/types.d.js +0 -1
  237. package/badge/utils.d.js +0 -1
  238. package/button/global/index.d.js +0 -1
  239. package/button/index.d.js +0 -1
  240. package/button/types.d.js +0 -1
  241. package/button/utils.d.js +0 -1
  242. package/button-group/global/index.d.js +0 -1
  243. package/button-group/index.d.js +0 -1
  244. package/button-group/types.d.js +0 -1
  245. package/button-group-item/global/index.d.js +0 -1
  246. package/button-group-item/index.d.js +0 -1
  247. package/button-group-item/types.d.js +0 -1
  248. package/card-container/global/index.d.js +0 -1
  249. package/card-container/index.d.js +0 -1
  250. package/card-container/types.d.js +0 -1
  251. package/card-v2/global/index.d.js +0 -1
  252. package/card-v2/index.d.js +0 -1
  253. package/card-v2/types.d.js +0 -1
  254. package/card-v2-title/global/index.d.js +0 -1
  255. package/card-v2-title/index.d.js +0 -1
  256. package/card-v2-title/types.d.js +0 -1
  257. package/checkbox/global/index.d.js +0 -1
  258. package/checkbox/index.d.js +0 -1
  259. package/checkbox/types.d.js +0 -1
  260. package/chip/colors.d.js +0 -1
  261. package/chip/global/index.d.js +0 -1
  262. package/chip/index.d.js +0 -2
  263. package/chip/types.d.js +0 -1
  264. package/chip/utils.d.js +0 -1
  265. package/code-tag/global/index.d.js +0 -1
  266. package/code-tag/index.d.js +0 -1
  267. package/code-tag/types.d.js +0 -1
  268. package/color-menu/global/index.d.js +0 -1
  269. package/color-menu/index.d.js +0 -1
  270. package/color-menu/types.d.js +0 -1
  271. package/color-menu/utils.d.js +0 -1
  272. package/color-menu-option/global/index.d.js +0 -1
  273. package/color-menu-option/index.d.js +0 -2
  274. package/color-menu-option/types.d.js +0 -1
  275. package/color-menu-option/utils.d.js +0 -1
  276. package/color-swatch/global/index.d.js +0 -40
  277. package/color-swatch/index.d.js +0 -6
  278. package/color-swatch/types.d.js +0 -1
  279. package/color-swatch/utils.d.js +0 -1
  280. package/date-picker/global/index.d.js +0 -1
  281. package/date-picker/index.d.js +0 -2
  282. package/date-picker/types.d.js +0 -1
  283. package/date-picker/utils.d.js +0 -1
  284. package/dialog/global/index.d.js +0 -1
  285. package/dialog/index.d.js +0 -3
  286. package/dialog/types.d.js +0 -1
  287. package/emoji/global/index.d.js +0 -1
  288. package/emoji/index.d.js +0 -1
  289. package/emoji/types.d.js +0 -1
  290. package/emoji/utils.d.js +0 -1
  291. package/emoji-picker/global/index.d.js +0 -1
  292. package/emoji-picker/index.d.js +0 -7
  293. package/emoji-picker/types.d.js +0 -1
  294. package/field/global/index.d.js +0 -1
  295. package/field/index.d.js +0 -1
  296. package/field/types.d.js +0 -1
  297. package/field-v2/global/index.d.js +0 -1
  298. package/field-v2/index.d.js +0 -1
  299. package/field-v2/types.d.js +0 -1
  300. package/file-drop/global/index.d.js +0 -1
  301. package/file-drop/index.d.js +0 -2
  302. package/file-drop/types.d.js +0 -1
  303. package/file-drop/utils.d.js +0 -1
  304. package/file-picker/global/index.d.js +0 -1
  305. package/file-picker/index.d.js +0 -1
  306. package/file-picker/types.d.js +0 -1
  307. package/file-picker/utils.d.js +0 -1
  308. package/file-status/global/index.d.js +0 -1
  309. package/file-status/index.d.js +0 -3
  310. package/file-status/types.d.js +0 -1
  311. package/file-status/utils.d.js +0 -1
  312. package/flag/global/index.d.js +0 -1
  313. package/flag/index.d.js +0 -1
  314. package/flag/types.d.js +0 -1
  315. package/flag/utils.d.js +0 -1
  316. package/floating-panel/global/index.d.js +0 -1
  317. package/floating-panel/index.d.js +0 -4
  318. package/floating-panel/types.d.js +0 -1
  319. package/floating-panel-button/index.d.js +0 -1
  320. package/floating-panel-button/types.d.js +0 -1
  321. package/floating-panel-icon-button/index.d.js +0 -2
  322. package/floating-panel-icon-button/types.d.js +0 -1
  323. package/grid/global/index.d.js +0 -1
  324. package/grid/index.d.js +0 -1
  325. package/grid/types.d.js +0 -1
  326. package/grid-item/global/index.d.js +0 -1
  327. package/grid-item/index.d.js +0 -1
  328. package/grid-item/types.d.js +0 -1
  329. package/help-tooltip/global/index.d.js +0 -1
  330. package/help-tooltip/index.d.js +0 -2
  331. package/help-tooltip/types.d.js +0 -1
  332. package/icon/generated-icon-type.d.js +0 -1
  333. package/icon/global/index.d.js +0 -1
  334. package/icon/index.d.js +0 -1
  335. package/icon/types.d.js +0 -1
  336. package/inline-alert/global/index.d.js +0 -1
  337. package/inline-alert/index.d.js +0 -5
  338. package/inline-alert/types.d.js +0 -1
  339. package/inline-alert/utils.d.js +0 -1
  340. package/input/global/index.d.js +0 -1
  341. package/input/index.d.js +0 -1
  342. package/input/types.d.js +0 -1
  343. package/input/utils.d.js +0 -1
  344. package/link/global/index.d.js +0 -1
  345. package/link/index.d.js +0 -2
  346. package/link/types.d.js +0 -1
  347. package/link/utils.d.js +0 -1
  348. package/list/global/index.d.js +0 -1
  349. package/list/index.d.js +0 -1
  350. package/list/types.d.js +0 -1
  351. package/list-item/global/index.d.js +0 -1
  352. package/list-item/index.d.js +0 -1
  353. package/list-item/types.d.js +0 -1
  354. package/pagination/global/index.d.js +0 -1
  355. package/pagination/index.d.js +0 -1
  356. package/pagination/types.d.js +0 -1
  357. package/persistent-overlay/global/index.d.js +0 -1
  358. package/persistent-overlay/index.d.js +0 -1
  359. package/persistent-overlay/types.d.js +0 -1
  360. package/pop/global/index.d.js +0 -1
  361. package/pop/index.d.js +0 -1
  362. package/pop/types.d.js +0 -1
  363. package/pop/utils.d.js +0 -1
  364. package/popover/global/index.d.js +0 -1
  365. package/popover/index.d.js +0 -1
  366. package/popover/types.d.js +0 -1
  367. package/popover/utils.d.js +0 -1
  368. package/progress/global/index.d.js +0 -1
  369. package/progress/index.d.js +0 -1
  370. package/progress/types.d.js +0 -1
  371. package/progress-stepper/global/index.d.js +0 -1
  372. package/progress-stepper/index.d.js +0 -1
  373. package/progress-stepper/types.d.js +0 -1
  374. package/progress-stepper-item/global/index.d.js +0 -1
  375. package/progress-stepper-item/index.d.js +0 -2
  376. package/progress-stepper-item/types.d.js +0 -1
  377. package/progress-stepper-item/utils.d.js +0 -1
  378. package/progress-stepper-item-v2/global/index.d.js +0 -1
  379. package/progress-stepper-item-v2/index.d.js +0 -2
  380. package/progress-stepper-item-v2/types.d.js +0 -1
  381. package/progress-stepper-item-v2/utils.d.js +0 -1
  382. package/progress-stepper-v2/compact-format.d.js +0 -1
  383. package/progress-stepper-v2/compact.d.js +0 -1
  384. package/progress-stepper-v2/global/index.d.js +0 -1
  385. package/progress-stepper-v2/index.d.js +0 -84
  386. package/progress-stepper-v2/model.d.js +0 -1
  387. package/progress-stepper-v2/orientation.d.js +0 -1
  388. package/progress-stepper-v2/separators.d.js +0 -1
  389. package/progress-stepper-v2/step-chip.d.js +0 -1
  390. package/progress-stepper-v2/types.d.js +0 -1
  391. package/radio/global/index.d.js +0 -1
  392. package/radio/index.d.js +0 -1
  393. package/radio/types.d.js +0 -1
  394. package/radio-option/global/index.d.js +0 -1
  395. package/radio-option/index.d.js +0 -1
  396. package/radio-option/types.d.js +0 -1
  397. package/rich-text/global/index.d.js +0 -1
  398. package/rich-text/index.d.js +0 -4
  399. package/rich-text/types.d.js +0 -1
  400. package/rich-text/utils.d.js +0 -1
  401. package/rich-textarea/global/index.d.js +0 -1
  402. package/rich-textarea/index.d.js +0 -1
  403. package/rich-textarea/types.d.js +0 -1
  404. package/rich-textarea/utils.d.js +0 -1
  405. package/rich-textarea-chip/index.d.js +0 -2
  406. package/rich-textarea-chip/types.d.js +0 -1
  407. package/segment-collapse/global/index.d.js +0 -1
  408. package/segment-collapse/index.d.js +0 -1
  409. package/segment-collapse/types.d.js +0 -1
  410. package/segmented-control/global/index.d.js +0 -1
  411. package/segmented-control/index.d.js +0 -1
  412. package/segmented-control/types.d.js +0 -1
  413. package/segmented-control-option/global/index.d.js +0 -1
  414. package/segmented-control-option/index.d.js +0 -1
  415. package/segmented-control-option/types.d.js +0 -1
  416. package/segmented-icon-control/global/index.d.js +0 -1
  417. package/segmented-icon-control/index.d.js +0 -1
  418. package/segmented-icon-control/types.d.js +0 -1
  419. package/segmented-icon-control-option/global/index.d.js +0 -1
  420. package/segmented-icon-control-option/index.d.js +0 -1
  421. package/segmented-icon-control-option/types.d.js +0 -1
  422. package/select-button/global/index.d.js +0 -1
  423. package/select-button/index.d.js +0 -2
  424. package/select-button/types.d.js +0 -1
  425. package/select-menu/global/index.d.js +0 -1
  426. package/select-menu/index.d.js +0 -3
  427. package/select-menu/types.d.js +0 -1
  428. package/select-menu-option/global/index.d.js +0 -1
  429. package/select-menu-option/index.d.js +0 -2
  430. package/select-menu-option/types.d.js +0 -1
  431. package/select-menu-option/utils.d.js +0 -1
  432. package/sheet/global/index.d.js +0 -1
  433. package/sheet/index.d.js +0 -1
  434. package/sheet/types.d.js +0 -1
  435. package/sheet-title/global/index.d.js +0 -1
  436. package/sheet-title/index.d.js +0 -2
  437. package/sheet-title/types.d.js +0 -1
  438. package/skeleton/global/index.d.js +0 -1
  439. package/skeleton/index.d.js +0 -1
  440. package/skeleton/types.d.js +0 -1
  441. package/skeleton-item/global/index.d.js +0 -1
  442. package/skeleton-item/index.d.js +0 -1
  443. package/skeleton-item/types.d.js +0 -1
  444. package/spinner/global/index.d.js +0 -1
  445. package/spinner/index.d.js +0 -1
  446. package/spinner/types.d.js +0 -1
  447. package/stop-events/index.d.js +0 -1
  448. package/table/global/index.d.js +0 -1
  449. package/table/index.d.js +0 -1
  450. package/table/types.d.js +0 -1
  451. package/table-body/global/index.d.js +0 -1
  452. package/table-body/index.d.js +0 -1
  453. package/table-body/types.d.js +0 -1
  454. package/table-cell/global/index.d.js +0 -1
  455. package/table-cell/index.d.js +0 -1
  456. package/table-cell/types.d.js +0 -1
  457. package/table-cell/utils.d.js +0 -1
  458. package/table-head/global/index.d.js +0 -1
  459. package/table-head/index.d.js +0 -1
  460. package/table-head/types.d.js +0 -1
  461. package/table-head-cell/global/index.d.js +0 -1
  462. package/table-head-cell/index.d.js +0 -1
  463. package/table-head-cell/types.d.js +0 -1
  464. package/table-row/global/index.d.js +0 -1
  465. package/table-row/index.d.js +0 -1
  466. package/table-row/types.d.js +0 -1
  467. package/tabs/global/index.d.js +0 -1
  468. package/tabs/index.d.js +0 -1
  469. package/tabs/types.d.js +0 -1
  470. package/tabs-icon-option/global/index.d.js +0 -1
  471. package/tabs-icon-option/index.d.js +0 -1
  472. package/tabs-icon-option/types.d.js +0 -1
  473. package/tabs-option/global/index.d.js +0 -1
  474. package/tabs-option/index.d.js +0 -1
  475. package/tabs-option/types.d.js +0 -1
  476. package/tag/colors.d.js +0 -1
  477. package/tag/global/index.d.js +0 -1
  478. package/tag/index.d.js +0 -2
  479. package/tag/types.d.js +0 -1
  480. package/tag/utils.d.js +0 -1
  481. package/text/global/index.d.js +0 -1
  482. package/text/index.d.js +0 -1
  483. package/text/types.d.js +0 -1
  484. package/text/utils.d.js +0 -1
  485. package/textarea/global/index.d.js +0 -1
  486. package/textarea/index.d.js +0 -1
  487. package/textarea/types.d.js +0 -1
  488. package/time-picker/global/index.d.js +0 -1
  489. package/time-picker/index.d.js +0 -2
  490. package/time-picker/types.d.js +0 -1
  491. package/time-picker/utils.d.js +0 -1
  492. package/title/global/index.d.js +0 -1
  493. package/title/index.d.js +0 -1
  494. package/title/types.d.js +0 -1
  495. package/title/utils.d.js +0 -1
  496. package/toast/global/index.d.js +0 -1
  497. package/toast/index.d.js +0 -2
  498. package/toast/types.d.js +0 -1
  499. package/toast/utils.d.js +0 -1
  500. package/toast-manager/global/index.d.js +0 -1
  501. package/toast-manager/index.d.js +0 -2
  502. package/toast-manager/types.d.js +0 -1
  503. package/toast-manager/utils.d.js +0 -1
  504. package/toggle/global/index.d.js +0 -1
  505. package/toggle/index.d.js +0 -1
  506. package/toggle/types.d.js +0 -1
  507. package/tooltip/global/index.d.js +0 -1
  508. package/tooltip/index.d.js +0 -2
  509. package/tooltip/tooltip-state.d.js +0 -1
  510. package/tooltip/types.d.js +0 -1
  511. package/tooltip/utils.d.js +0 -1
  512. package/utils/adapters.d.js +0 -1
  513. package/utils/component-names.d.js +0 -1
  514. package/utils/context.d.js +0 -1
  515. package/utils/control-keyboard-navigation.d.js +0 -1
  516. package/utils/countries.d.js +0 -1
  517. package/utils/csv.d.js +0 -1
  518. package/utils/debounce.d.js +0 -1
  519. package/utils/dom.d.js +0 -1
  520. package/utils/element.d.js +0 -1
  521. package/utils/event-target.d.js +0 -1
  522. package/utils/form.d.js +0 -1
  523. package/utils/get-react-event-handler.d.js +0 -1
  524. package/utils/global-components-constants.d.js +0 -1
  525. package/utils/global-components-manager.d.js +0 -1
  526. package/utils/index.d.js +0 -75
  527. package/utils/markdown.d.js +0 -1
  528. package/utils/placement.d.js +0 -1
  529. package/utils/rect.d.js +0 -1
  530. package/utils/scroll-lock.d.js +0 -1
  531. package/utils/size.d.js +0 -1
  532. package/utils/slot.d.js +0 -1
  533. package/utils/throttle.d.js +0 -1
  534. package/utils/uid.d.js +0 -1
  535. /package/{accordion-item/global/index.d.js → utils/shared/cdn-loader.d.js} +0 -0
  536. /package/{accordion-item/types.d.js → utils/shared/deferred-promise.d.js} +0 -0
  537. /package/{accordion-item/utils.d.js → utils/shared/global-elements-manager.d.js} +0 -0
  538. /package/{accordion/global/index.d.js → utils/shared/global-elements-store.d.js} +0 -0
  539. /package/{accordion/index.d.js → utils/shared/nectary-element-base.d.js} +0 -0
@@ -1,25 +1,118 @@
1
- import { NectaryElementBase } from '@nectary/shared';
2
- import type { ComponentName } from './component-names';
1
+ // Generated by dts-bundle-generator v9.5.1
2
+
3
+ export type SinchElementName = `sinch-${string}`;
4
+ declare class NectaryElementBase extends HTMLElement {
5
+ private static _isGlobal;
6
+ static get elementName(): SinchElementName;
7
+ static get isGlobal(): boolean;
8
+ static set isGlobal(value: boolean);
9
+ }
10
+ declare const BASE_COMPONENT_NAMES_LIST: readonly [
11
+ "accordion-item",
12
+ "accordion",
13
+ "action-menu-option",
14
+ "action-menu",
15
+ "alert",
16
+ "avatar",
17
+ "badge",
18
+ "button-group-item",
19
+ "button-group",
20
+ "button",
21
+ "card-container",
22
+ "card-v2-title",
23
+ "card-v2",
24
+ "checkbox",
25
+ "chip",
26
+ "code-tag",
27
+ "color-menu-option",
28
+ "color-menu",
29
+ "color-swatch",
30
+ "date-picker",
31
+ "dialog",
32
+ "emoji-picker",
33
+ "emoji",
34
+ "field",
35
+ "field-v2",
36
+ "file-drop",
37
+ "file-picker",
38
+ "file-status",
39
+ "flag",
40
+ "floating-panel",
41
+ "floating-panel-button",
42
+ "floating-panel-icon-button",
43
+ "grid-item",
44
+ "grid",
45
+ "help-tooltip",
46
+ "icon",
47
+ "inline-alert",
48
+ "input",
49
+ "link",
50
+ "list-item",
51
+ "list",
52
+ "pagination",
53
+ "persistent-overlay",
54
+ "pop",
55
+ "popover",
56
+ "progress-stepper-item-v2",
57
+ "progress-stepper-item",
58
+ "progress-stepper-v2",
59
+ "progress-stepper",
60
+ "progress",
61
+ "radio-option",
62
+ "radio",
63
+ "rich-text",
64
+ "rich-textarea",
65
+ "rich-textarea-chip",
66
+ "segment-collapse",
67
+ "segmented-control-option",
68
+ "segmented-control",
69
+ "segmented-icon-control-option",
70
+ "segmented-icon-control",
71
+ "select-button",
72
+ "select-menu-option",
73
+ "select-menu",
74
+ "sheet",
75
+ "sheet-title",
76
+ "skeleton-item",
77
+ "skeleton",
78
+ "spinner",
79
+ "stop-events",
80
+ "table-body",
81
+ "table-cell",
82
+ "table-head-cell",
83
+ "table-head",
84
+ "table-row",
85
+ "table",
86
+ "tabs-icon-option",
87
+ "tabs-option",
88
+ "tabs",
89
+ "tag",
90
+ "text",
91
+ "textarea",
92
+ "time-picker",
93
+ "title",
94
+ "toast-manager",
95
+ "toast",
96
+ "toggle",
97
+ "tooltip"
98
+ ];
99
+ export type ComponentName = `sinch-${typeof BASE_COMPONENT_NAMES_LIST[number]}`;
3
100
  export declare const pascalToKebabCase: (str: string) => string;
4
101
  export declare const registerComponent: (name: ComponentName, constructor: CustomElementConstructor) => void;
5
102
  export declare const defineCustomElement: (name: ComponentName, constructor?: CustomElementConstructor) => Promise<void>;
6
- interface SetNectaryRegistryOptions {
7
- manualRegistration?: boolean;
103
+ export interface SetNectaryRegistryOptions {
104
+ manualRegistration?: boolean;
8
105
  }
9
106
  export declare const setNectaryRegistry: (registry?: CustomElementRegistry, options?: SetNectaryRegistryOptions) => void;
10
107
  export declare const resetNectaryRegistry: () => void;
11
- declare global {
12
- interface ShadowRootInit {
13
- customElements?: CustomElementRegistry;
14
- }
15
- }
16
108
  export declare class NectaryElement extends NectaryElementBase {
17
- #private;
18
- attachShadow(options?: Partial<ShadowRootInit>): ShadowRoot;
19
- version: string;
20
- get focusable(): boolean;
21
- connectedCallback(): void;
22
- disconnectedCallback(): void;
23
- get isDomConnected(): boolean;
109
+ #private;
110
+ attachShadow(options?: Partial<ShadowRootInit>): ShadowRoot;
111
+ version: string;
112
+ get focusable(): boolean;
113
+ connectedCallback(): void;
114
+ disconnectedCallback(): void;
115
+ get isDomConnected(): boolean;
24
116
  }
117
+
25
118
  export {};
package/utils/element.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { NectaryElementBase, sinchElementNameToBase } from "./shared/nectary-element-base.js";
2
2
  import { getConstructor } from "./shared/global-elements-store.js";
3
- import { C as COMPONENTS_STORE_KEY } from "../global-components-constants.js";
4
- const version = "5.42.5-rc.0";
3
+ import { COMPONENTS_STORE_KEY } from "./global-components-constants.js";
4
+ const version = "5.0.1";
5
5
  const pkg = {
6
6
  version
7
7
  };
@@ -1,8 +1,51 @@
1
- import { GlobalElementsManager } from '@nectary/shared';
1
+ // Generated by dts-bundle-generator v9.5.1
2
+
3
+ export type SinchElementName = `sinch-${string}`;
4
+ export interface GlobalManagerConfig {
5
+ storeKey: symbol;
6
+ registryUrl: string;
7
+ baseElementNames: Set<string>;
8
+ nameToPathMap?: Map<string, string>;
9
+ }
10
+ export interface GlobalManagerInitOptions {
11
+ /**
12
+ * URL to resolve the modules from
13
+ */
14
+ cdnUrl: string;
15
+ /**
16
+ * Fallback URL to resolve the modules from if `cdnUrl` fails
17
+ */
18
+ fallbackCdnUrl?: string;
19
+ /**
20
+ * Preloads all components from the bundle.js module
21
+ */
22
+ preload?: boolean;
23
+ /**
24
+ * Target version of the library to resolve
25
+ *
26
+ * If left unspecified, it will resolve to the latest version
27
+ */
28
+ targetlibVersion?: string;
29
+ }
30
+ declare abstract class GlobalElementsManager {
31
+ private config;
32
+ constructor(config: GlobalManagerConfig);
33
+ getConstructor(name: SinchElementName): Promise<CustomElementConstructor> | null;
34
+ private patchCustomElements;
35
+ private toClassName;
36
+ private loadModule;
37
+ private createLoader;
38
+ private preloadBundle;
39
+ init(options: GlobalManagerInitOptions): Promise<void>;
40
+ whenLoaded(): Promise<void>;
41
+ private getModulePath;
42
+ preload(name: SinchElementName | SinchElementName[] | "all"): Promise<void>;
43
+ }
2
44
  declare class GlobalComponentsManagerImpl extends GlobalElementsManager {
3
- private static instance;
4
- constructor();
5
- static getInstance(): GlobalComponentsManagerImpl;
45
+ private static instance;
46
+ constructor();
47
+ static getInstance(): GlobalComponentsManagerImpl;
6
48
  }
7
49
  export declare const GlobalComponentsManager: GlobalComponentsManagerImpl;
50
+
8
51
  export {};
@@ -1,95 +1,6 @@
1
1
  import { GlobalElementsManager } from "./shared/global-elements-manager.js";
2
- import { a as COMPONENTS_REGISTRY_URL, C as COMPONENTS_STORE_KEY } from "../global-components-constants.js";
3
- const BASE_COMPONENT_NAMES_LIST = [
4
- "accordion-item",
5
- "accordion",
6
- "action-menu-option",
7
- "action-menu",
8
- "alert",
9
- "avatar",
10
- "badge",
11
- "button-group-item",
12
- "button-group",
13
- "button",
14
- "card-container",
15
- "card-v2-title",
16
- "card-v2",
17
- "checkbox",
18
- "chip",
19
- "code-tag",
20
- "color-menu-option",
21
- "color-menu",
22
- "color-swatch",
23
- "date-picker",
24
- "dialog",
25
- "emoji-picker",
26
- "emoji",
27
- "field",
28
- "field-v2",
29
- "file-drop",
30
- "file-picker",
31
- "file-status",
32
- "flag",
33
- "floating-panel",
34
- "floating-panel-button",
35
- "floating-panel-icon-button",
36
- "grid-item",
37
- "grid",
38
- "help-tooltip",
39
- "icon",
40
- "inline-alert",
41
- "input",
42
- "link",
43
- "list-item",
44
- "list",
45
- "pagination",
46
- "persistent-overlay",
47
- "pop",
48
- "popover",
49
- "progress-stepper-item-v2",
50
- "progress-stepper-item",
51
- "progress-stepper-v2",
52
- "progress-stepper",
53
- "progress",
54
- "radio-option",
55
- "radio",
56
- "rich-text",
57
- "rich-textarea",
58
- "rich-textarea-chip",
59
- "segment-collapse",
60
- "segmented-control-option",
61
- "segmented-control",
62
- "segmented-icon-control-option",
63
- "segmented-icon-control",
64
- "select-button",
65
- "select-menu-option",
66
- "select-menu",
67
- "sheet",
68
- "sheet-title",
69
- "skeleton-item",
70
- "skeleton",
71
- "spinner",
72
- "stop-events",
73
- "table-body",
74
- "table-cell",
75
- "table-head-cell",
76
- "table-head",
77
- "table-row",
78
- "table",
79
- "tabs-icon-option",
80
- "tabs-option",
81
- "tabs",
82
- "tag",
83
- "text",
84
- "textarea",
85
- "time-picker",
86
- "title",
87
- "toast-manager",
88
- "toast",
89
- "toggle",
90
- "tooltip"
91
- ];
92
- const BASE_COMPONENT_NAMES = new Set(BASE_COMPONENT_NAMES_LIST);
2
+ import { BASE_COMPONENT_NAMES } from "./component-names.js";
3
+ import { COMPONENTS_REGISTRY_URL, COMPONENTS_STORE_KEY } from "./global-components-constants.js";
93
4
  class GlobalComponentsManagerImpl extends GlobalElementsManager {
94
5
  static instance = null;
95
6
  constructor() {
package/utils/index.js CHANGED
@@ -1,75 +1,75 @@
1
- import { C, s } from "../context.js";
2
- import { C as C2, g, p, u, a } from "../csv.js";
3
- import { a as a2, b, c, d, e, f, g as g2, h, i, j, k, l, m, n, o, p as p2, q, r, s as s2, t, u as u2, v, w, x, y, z, A, B, C as C3 } from "../dom.js";
4
- import { N, d as d2, p as p3, r as r2, a as a3, s as s3 } from "../element.js";
5
- import { g as g3, a as a4, r as r3 } from "../rect.js";
6
- import { g as g4, a as a5, i as i2 } from "../slot.js";
7
- import { t as t2 } from "../throttle.js";
8
- import { d as d3, a as a6 } from "../debounce.js";
9
- import { g as g5 } from "../get-react-event-handler.js";
10
- import { i as i3, p as p4 } from "../markdown.js";
11
- import { g as g6, a as a7, b as b2, i as i4 } from "../event-target.js";
12
- import { i as i5 } from "../control-keyboard-navigation.js";
13
- import { g as g7 } from "../uid.js";
1
+ import { Context, subscribeContext } from "./context.js";
2
+ import { CSV_DELIMITER, getFirstCsvValue, packCsv, unpackCsv, updateCsv } from "./csv.js";
3
+ import { applyRange, attrValueToFloat, attrValueToInteger, attrValueToPixels, clampNumber, cloneNode, composedContains, createScopedElement, getAttribute, getBooleanAttribute, getCssVar, getCssVars, getDeepActiveElement, getIntegerAttribute, getLiteralAttribute, getScrollableParents, getTransformedAncestor, hasClass, isAttrEqual, isAttrTrue, isLiteralValue, isTransformedElement, setClass, shouldReduceMotion, updateAttribute, updateBooleanAttribute, updateExplicitBooleanAttribute, updateIntegerAttribute, updateLiteralAttribute } from "./dom.js";
4
+ import { NectaryElement, defineCustomElement, pascalToKebabCase, registerComponent, resetNectaryRegistry, setNectaryRegistry } from "./element.js";
5
+ import { getRect, getTargetRect, rectOverlap } from "./rect.js";
6
+ import { getFirstFocusableElement, getFirstSlotElement, isElementFocused } from "./slot.js";
7
+ import { throttleAnimationFrame } from "./throttle.js";
8
+ import { debounceAnimationFrame, debounceTimeout } from "./debounce.js";
9
+ import { getReactEventHandler } from "./get-react-event-handler.js";
10
+ import { isEmojiString, parseMarkdown } from "./markdown.js";
11
+ import { getTargetAttribute, getTargetByAttribute, getTargetIndexInParent, isTargetEqual } from "./event-target.js";
12
+ import { isActivationKey } from "./control-keyboard-navigation.js";
13
+ import { getUid } from "./uid.js";
14
14
  export {
15
- C2 as CSV_DELIMITER,
16
- C as Context,
17
- N as NectaryElement,
18
- a2 as applyRange,
19
- b as attrValueToFloat,
20
- c as attrValueToInteger,
21
- d as attrValueToPixels,
22
- e as clampNumber,
23
- f as cloneNode,
24
- g2 as composedContains,
25
- h as createScopedElement,
26
- d3 as debounceAnimationFrame,
27
- a6 as debounceTimeout,
28
- d2 as defineCustomElement,
29
- i as getAttribute,
30
- j as getBooleanAttribute,
31
- k as getCssVar,
32
- l as getCssVars,
33
- m as getDeepActiveElement,
34
- g as getFirstCsvValue,
35
- g4 as getFirstFocusableElement,
36
- a5 as getFirstSlotElement,
37
- n as getIntegerAttribute,
38
- o as getLiteralAttribute,
39
- g5 as getReactEventHandler,
40
- g3 as getRect,
41
- p2 as getScrollableParents,
42
- g6 as getTargetAttribute,
43
- a7 as getTargetByAttribute,
44
- b2 as getTargetIndexInParent,
45
- a4 as getTargetRect,
46
- q as getTransformedAncestor,
47
- g7 as getUid,
48
- r as hasClass,
49
- i5 as isActivationKey,
50
- s2 as isAttrEqual,
51
- t as isAttrTrue,
52
- i2 as isElementFocused,
53
- i3 as isEmojiString,
54
- u2 as isLiteralValue,
55
- i4 as isTargetEqual,
56
- v as isTransformedElement,
57
- p as packCsv,
58
- p4 as parseMarkdown,
59
- p3 as pascalToKebabCase,
60
- r3 as rectOverlap,
61
- r2 as registerComponent,
62
- a3 as resetNectaryRegistry,
63
- w as setClass,
64
- s3 as setNectaryRegistry,
65
- x as shouldReduceMotion,
66
- s as subscribeContext,
67
- t2 as throttleAnimationFrame,
68
- u as unpackCsv,
69
- y as updateAttribute,
70
- z as updateBooleanAttribute,
71
- a as updateCsv,
72
- A as updateExplicitBooleanAttribute,
73
- B as updateIntegerAttribute,
74
- C3 as updateLiteralAttribute
15
+ CSV_DELIMITER,
16
+ Context,
17
+ NectaryElement,
18
+ applyRange,
19
+ attrValueToFloat,
20
+ attrValueToInteger,
21
+ attrValueToPixels,
22
+ clampNumber,
23
+ cloneNode,
24
+ composedContains,
25
+ createScopedElement,
26
+ debounceAnimationFrame,
27
+ debounceTimeout,
28
+ defineCustomElement,
29
+ getAttribute,
30
+ getBooleanAttribute,
31
+ getCssVar,
32
+ getCssVars,
33
+ getDeepActiveElement,
34
+ getFirstCsvValue,
35
+ getFirstFocusableElement,
36
+ getFirstSlotElement,
37
+ getIntegerAttribute,
38
+ getLiteralAttribute,
39
+ getReactEventHandler,
40
+ getRect,
41
+ getScrollableParents,
42
+ getTargetAttribute,
43
+ getTargetByAttribute,
44
+ getTargetIndexInParent,
45
+ getTargetRect,
46
+ getTransformedAncestor,
47
+ getUid,
48
+ hasClass,
49
+ isActivationKey,
50
+ isAttrEqual,
51
+ isAttrTrue,
52
+ isElementFocused,
53
+ isEmojiString,
54
+ isLiteralValue,
55
+ isTargetEqual,
56
+ isTransformedElement,
57
+ packCsv,
58
+ parseMarkdown,
59
+ pascalToKebabCase,
60
+ rectOverlap,
61
+ registerComponent,
62
+ resetNectaryRegistry,
63
+ setClass,
64
+ setNectaryRegistry,
65
+ shouldReduceMotion,
66
+ subscribeContext,
67
+ throttleAnimationFrame,
68
+ unpackCsv,
69
+ updateAttribute,
70
+ updateBooleanAttribute,
71
+ updateCsv,
72
+ updateExplicitBooleanAttribute,
73
+ updateIntegerAttribute,
74
+ updateLiteralAttribute
75
75
  };
@@ -1,4 +1,4 @@
1
- import { v as isTransformedElement, q as getTransformedAncestor } from "../dom.js";
1
+ import { isTransformedElement, getTransformedAncestor } from "./dom.js";
2
2
  const resolveTransformedAncestor = (node, ancestorHint) => {
3
3
  if (node != null && ancestorHint != null && ancestorHint.isConnected && isTransformedElement(ancestorHint) && (ancestorHint === node || ancestorHint.contains(node))) {
4
4
  return ancestorHint;
package/utils/rect.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as getFirstSlotElement } from "../slot.js";
1
+ import { getFirstSlotElement } from "./slot.js";
2
2
  const getRect = (el) => {
3
3
  const { x, y, width, height } = el.getBoundingClientRect();
4
4
  return { x, y, width, height };
@@ -0,0 +1,136 @@
1
+ const getNonEsmShModuleFile = (modulePath) => {
2
+ if (modulePath === "bundle") {
3
+ return "bundle.js";
4
+ }
5
+ return `${modulePath}/index.js`;
6
+ };
7
+ const getImportPath = (cdnUrl, version, modulePath) => {
8
+ if (cdnUrl.length === 0) {
9
+ return null;
10
+ }
11
+ const host = new URL(cdnUrl).host;
12
+ if (host === "esm.sh") {
13
+ if (version.length !== 0) {
14
+ return `${cdnUrl}@${version}/es2022/${modulePath}.mjs`;
15
+ }
16
+ return `${cdnUrl}/${modulePath}`;
17
+ }
18
+ const moduleFile = getNonEsmShModuleFile(modulePath);
19
+ if (version.length !== 0) {
20
+ return `${cdnUrl}/${version}/${moduleFile}`;
21
+ }
22
+ return `${cdnUrl}/latest/${moduleFile}`;
23
+ };
24
+ const getCssImportPath = (cdnUrl, version, modulePath) => {
25
+ if (cdnUrl.length === 0) {
26
+ return null;
27
+ }
28
+ const host = new URL(cdnUrl).host;
29
+ if (host === "esm.sh") {
30
+ if (cdnUrl.includes("theme-base")) {
31
+ modulePath = `dist/${modulePath}`;
32
+ }
33
+ if (version.length !== 0) {
34
+ return `${cdnUrl}@${version}/es2022/${modulePath}.css`;
35
+ }
36
+ return `${cdnUrl}/${modulePath}`;
37
+ }
38
+ if (version.length !== 0) {
39
+ return `${cdnUrl}/${version}/${modulePath}.js`;
40
+ }
41
+ return `${cdnUrl}/latest/${modulePath}.js`;
42
+ };
43
+ const FALLBACK_DELAY_MS = 2e3;
44
+ const loadModuleWithFallback = async (options) => {
45
+ const { cdnUrl, fallbackCdnUrl, version, modulePath, logPrefix = "CDN" } = options;
46
+ const importPath = getImportPath(cdnUrl, version, modulePath);
47
+ const fallbackImportPath = getImportPath(fallbackCdnUrl, version, modulePath);
48
+ const promises = [
49
+ import(
50
+ /* webpackIgnore: true */
51
+ importPath
52
+ )
53
+ ];
54
+ let timeoutId = null;
55
+ if (fallbackImportPath !== null) {
56
+ promises.push(
57
+ new Promise((resolve) => {
58
+ timeoutId = setTimeout(() => resolve(import(
59
+ /* webpackIgnore: true */
60
+ fallbackImportPath
61
+ )), FALLBACK_DELAY_MS);
62
+ })
63
+ );
64
+ }
65
+ try {
66
+ const module = await Promise.any(promises);
67
+ if (timeoutId !== null) {
68
+ clearTimeout(timeoutId);
69
+ }
70
+ return module;
71
+ } catch (error) {
72
+ if (error instanceof AggregateError) {
73
+ console.error(`${logPrefix} primary load failed: ${importPath}`, error.errors[0]);
74
+ if (fallbackImportPath !== null) {
75
+ console.error(`${logPrefix} fallback load failed: ${fallbackImportPath}`, error.errors[1]);
76
+ }
77
+ } else {
78
+ console.error(`${logPrefix} failed to load module: ${importPath}`, error);
79
+ }
80
+ throw error;
81
+ }
82
+ };
83
+ const fetchCSS = async (url) => {
84
+ const res = await fetch(url);
85
+ if (!res.ok) {
86
+ throw new Error(`CSS fetch failed: ${res.status} ${url}`);
87
+ }
88
+ const css = await res.text();
89
+ return { default: css };
90
+ };
91
+ const loadCSSFromUrl = (url) => {
92
+ if (url.endsWith(".css")) {
93
+ return fetchCSS(url);
94
+ }
95
+ return import(
96
+ /* webpackIgnore: true */
97
+ url
98
+ );
99
+ };
100
+ const loadCSSModuleWithFallback = async (options) => {
101
+ const { cdnUrl, fallbackCdnUrl, version, modulePath, logPrefix = "CDN" } = options;
102
+ const importPath = getCssImportPath(cdnUrl, version, modulePath);
103
+ const fallbackImportPath = getCssImportPath(fallbackCdnUrl, version, modulePath);
104
+ const promises = [
105
+ loadCSSFromUrl(importPath)
106
+ ];
107
+ let timeoutId = null;
108
+ if (fallbackImportPath !== null) {
109
+ promises.push(
110
+ new Promise((resolve) => {
111
+ timeoutId = setTimeout(() => resolve(loadCSSFromUrl(fallbackImportPath)), FALLBACK_DELAY_MS);
112
+ })
113
+ );
114
+ }
115
+ try {
116
+ const module = await Promise.any(promises);
117
+ if (timeoutId !== null) {
118
+ clearTimeout(timeoutId);
119
+ }
120
+ return module;
121
+ } catch (error) {
122
+ if (error instanceof AggregateError) {
123
+ console.error(`${logPrefix} primary load failed: ${importPath}`, error.errors[0]);
124
+ if (fallbackImportPath !== null) {
125
+ console.error(`${logPrefix} fallback load failed: ${fallbackImportPath}`, error.errors[1]);
126
+ }
127
+ } else {
128
+ console.error(`${logPrefix} failed to load module: ${importPath}`, error);
129
+ }
130
+ throw error;
131
+ }
132
+ };
133
+ export {
134
+ loadCSSModuleWithFallback,
135
+ loadModuleWithFallback
136
+ };
@@ -0,0 +1,10 @@
1
+ const createDeferredPromise = () => {
2
+ let resolve;
3
+ const promise = new Promise((r) => {
4
+ resolve = r;
5
+ });
6
+ return { promise, resolve };
7
+ };
8
+ export {
9
+ createDeferredPromise
10
+ };