@brightspot/ui 6.0.4-pr.228.1 → 6.0.4
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.
- package/dist/custom-elements.json +237 -237
- package/dist/storybook/assets/{ActionBar.stories-B3W9l3sW.js → ActionBar.stories-BSwwf2PX.js} +1 -1
- package/dist/storybook/assets/{ActionItem.stories-Bgq9Si14.js → ActionItem.stories-SCIA5Rt0.js} +1 -1
- package/dist/storybook/assets/{AiSparkle.stories-BvZZGCv0.js → AiSparkle.stories-ByeiNU3G.js} +1 -1
- package/dist/storybook/assets/{Avatar.stories-DKefO8vf.js → Avatar.stories-1EUJytBr.js} +1 -1
- package/dist/storybook/assets/{AvatarGroup.stories-DLU0xm5i.js → AvatarGroup.stories-Bstlt4go.js} +1 -1
- package/dist/storybook/assets/{Badge.stories-DYf4buS2.js → Badge.stories-X7m0Vl2G.js} +1 -1
- package/dist/storybook/assets/{Banner.stories-kvxGWQ8i.js → Banner.stories-ljxjOtEc.js} +1 -1
- package/dist/storybook/assets/{Button-QbHhnaex.js → Button-Dbpmp5Ih.js} +1 -1
- package/dist/storybook/assets/{Button.stories-Cbc2kacG.js → Button.stories-C5qS3rIw.js} +1 -1
- package/dist/storybook/assets/{ButtonGroup.stories-BlMr_i2l.js → ButtonGroup.stories-Bl1Ko9jX.js} +1 -1
- package/dist/storybook/assets/{Card.stories-CXgpz0_-.js → Card.stories-CfFIzXg5.js} +1 -1
- package/dist/storybook/assets/{Celebrate.stories-DGuheVhJ.js → Celebrate.stories-TSJrIQR8.js} +1 -1
- package/dist/storybook/assets/{Checkbox.stories-D5gjg3gd.js → Checkbox.stories-DUpT9Iwh.js} +1 -1
- package/dist/storybook/assets/{CircularProgress.stories-BtEajA8s.js → CircularProgress.stories-usNosiIU.js} +1 -1
- package/dist/storybook/assets/{ClipboardMixin.stories-CVWhGXfx.js → ClipboardMixin.stories-0jnZ0Drs.js} +1 -1
- package/dist/storybook/assets/{Color-6BZIO3FS-Cy2iWC0B.js → Color-6BZIO3FS-C6ecAOER.js} +1 -1
- package/dist/storybook/assets/{Colors.stories-lMKhdwtD.js → Colors.stories-DcbIlkPs.js} +1 -1
- package/dist/storybook/assets/{CombinedEffects.stories-GYFjehaD.js → CombinedEffects.stories-CU-hwRPT.js} +1 -1
- package/dist/storybook/assets/{ComponentStatesMixin-Cxyscq1q.js → ComponentStatesMixin-Dcz-J-hg.js} +1 -1
- package/dist/storybook/assets/{ComponentStatesMixin.stories-Czvdt00v.js → ComponentStatesMixin.stories-orhdmIUX.js} +1 -1
- package/dist/storybook/assets/{CopyToClipboard.stories-EYf9o4P1.js → CopyToClipboard.stories-D1R2yCQL.js} +1 -1
- package/dist/storybook/assets/{Debounce.stories-B4zKKGEF.js → Debounce.stories-6z8aEn7O.js} +1 -1
- package/dist/storybook/assets/{DocsRenderer-LL677BLK-BTEtWPBs.js → DocsRenderer-LL677BLK-B-fTNYB5.js} +3 -3
- package/dist/storybook/assets/{Dropdown.stories-WQFH9gjF.js → Dropdown.stories-CeVpVPrP.js} +1 -1
- package/dist/storybook/assets/{EmptyState.stories-CtZTgOyf.js → EmptyState.stories-DdCyApUP.js} +1 -1
- package/dist/storybook/assets/{EscaAvatar.stories-PJbKYuIx.js → EscaAvatar.stories-DNK85ssI.js} +1 -1
- package/dist/storybook/assets/{Events.stories-CED0yKoW.js → Events.stories-B1qeq2wy.js} +1 -1
- package/dist/storybook/assets/{Heading.stories-Yo84UBrv.js → Heading.stories-DRu5hUyJ.js} +1 -1
- package/dist/storybook/assets/{HueRipple.stories-DQaK4bfx.js → HueRipple.stories-D3zqVZWM.js} +1 -1
- package/dist/storybook/assets/{Icon.stories-BLBUeiJt.js → Icon.stories-CKG5fIIH.js} +1 -1
- package/dist/storybook/assets/{IconButton.stories-DE-AWDCu.js → IconButton.stories-B3RZKBqV.js} +1 -1
- package/dist/storybook/assets/{LinearProgress.stories-BMOO9ziw.js → LinearProgress.stories-BPvFKGi0.js} +1 -1
- package/dist/storybook/assets/{Message.stories-CQ4FeNtL.js → Message.stories-Dq3YDccT.js} +1 -1
- package/dist/storybook/assets/{OnFindMixin.stories-BgF86VyY.js → OnFindMixin.stories-qKTooUKN.js} +1 -1
- package/dist/storybook/assets/{Pagination.stories-BQz3D7WR.js → Pagination.stories-BaFWcckS.js} +1 -1
- package/dist/storybook/assets/{Popover.stories-BySl8X_V.js → Popover.stories-DlHlfWrk.js} +1 -1
- package/dist/storybook/assets/{ReadyMixin-ZKicHfUd.js → ReadyMixin-BQ-q8NO4.js} +1 -1
- package/dist/storybook/assets/{RovingTabindexMixin.stories-DSHo6CDn.js → RovingTabindexMixin.stories-CQkteE6h.js} +1 -1
- package/dist/storybook/assets/{Rtc.stories-k6JRiPH-.js → Rtc.stories-BWBDrPM8.js} +1 -1
- package/dist/storybook/assets/{ScrollShadow.stories-DC0FuAGC.js → ScrollShadow.stories-BtM7Q6Ys.js} +1 -1
- package/dist/storybook/assets/{Switch.stories-wOpKQIoZ.js → Switch.stories-Ys6MzOf7.js} +1 -1
- package/dist/storybook/assets/{Tab.stories-48kIvcjq.js → Tab.stories-CNIDOscR.js} +1 -1
- package/dist/storybook/assets/{Tabs.stories-BOy2M1hf.js → Tabs.stories-oAxuRqKE.js} +1 -1
- package/dist/storybook/assets/{Throttle.stories-nWsWmaUP.js → Throttle.stories-D2nPrZEL.js} +1 -1
- package/dist/storybook/assets/{Tooltip.stories-lw4S0OCL.js → Tooltip.stories-DJhjWYNV.js} +1 -1
- package/dist/storybook/assets/{Upload.stories-CT96w70S.js → Upload.stories-DBveASQF.js} +1 -1
- package/dist/storybook/assets/{UploadItem.stories-DAQ0uKRd.js → UploadItem.stories-Co5bGJs6.js} +1 -1
- package/dist/storybook/assets/{Welcome.stories-D_tWLJfQ.js → Welcome.stories-Cls_kv8A.js} +1 -1
- package/dist/storybook/assets/{Widget.stories-Vklgd-HE.js → Widget.stories-CXpqw5z8.js} +1 -1
- package/dist/storybook/assets/{WithTooltip-65CFNBJE-CkTzfxlJ.js → WithTooltip-65CFNBJE-Ik6o5Ygb.js} +1 -1
- package/dist/storybook/assets/{blocks-Dcu5vb5v.js → blocks-DjXAnVrm.js} +5 -5
- package/dist/storybook/assets/{formatter-EIJCOSYU-Dv3UXZl_.js → formatter-EIJCOSYU-CQXaWVan.js} +1 -1
- package/dist/storybook/assets/if-defined-BVO6TNCy.js +1 -0
- package/dist/storybook/assets/{iframe-DUPD-I_r.js → iframe-D43T7JCn.js} +4 -4
- package/dist/storybook/assets/{index-DonibaDQ.js → index-DIk8fbbl.js} +1 -1
- package/dist/storybook/assets/onFind-CamigPPi.js +1 -0
- package/dist/storybook/assets/{onFind.stories-CUNfMRDo.js → onFind.stories-DgxMtTTG.js} +20 -20
- package/dist/storybook/assets/{onRemove.stories-SA3czp21.js → onRemove.stories-DltMfNLX.js} +1 -1
- package/dist/storybook/assets/{onVisible.stories-BaKmrATX.js → onVisible.stories-x3VhGAuF.js} +1 -1
- package/dist/storybook/assets/{style-map-DcmF1KuF.js → style-map-C5J-rKx9.js} +1 -1
- package/dist/storybook/assets/{syntaxhighlighter-ED5Y7EFY-CgbdQuEL.js → syntaxhighlighter-ED5Y7EFY-CphVNry2.js} +1 -1
- package/dist/storybook/iframe.html +1 -1
- package/dist/storybook/project.json +1 -1
- package/dist/util/onFind.d.ts.map +1 -1
- package/dist/util/onFind.js +66 -137
- package/dist/util/onFind.js.map +1 -1
- package/package.json +1 -1
- package/src/legacy/tool-ui/src/dom/onFind.ts +270 -29
- package/src/legacy/tool-ui/src/main/webapp/dist/{2111.efb40a1ab7d6b02913dd.js → 2111.3956b5196a514b2c0131.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{2456.2c20c3564647ca071b26.js → 2456.5bcfb782c2ec27de32ed.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{2537.a4d0a358f9c1a60ebc68.js → 2537.e8f1359bedd328bf57f4.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{270.8fb1c93bc009582a32cd.js → 270.3011484ff80f3093083a.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{2825.9c2b897f2a3799dcbd19.js → 2825.c1342ac2662d11fd4125.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{2947.52cb126b0e2ab4415189.js → 2947.f96d21c44c05980974ef.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{3532.ed7716198932139a4fb1.js → 3532.c358dfbb2cde0f802c7f.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{3543.c62d88fc2904cccc7e64.js → 3543.2d704cf9e170322468e7.js} +2 -2
- package/src/legacy/tool-ui/src/main/webapp/dist/{3611.5466757310c53bea4b6e.js → 3611.61837ffa933f74502094.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/4114.57fe159e416e716f8cbc.js +1 -0
- package/src/legacy/tool-ui/src/main/webapp/dist/{4374.a2ea1952e2daf222dc20.js → 4374.37147747a254da8f5f8a.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{4450.9eaca48c71e3dfb64a45.js → 4450.16dd5684292fd0a7ea7f.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{4478.3c6e9704ad67996b53a8.js → 4478.93f64e6a6ccb35a6c6d4.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/4582.243dbaa3d8a8648f6f40.js +1 -0
- package/src/legacy/tool-ui/src/main/webapp/dist/{4790.ff3be0fd92b8d7422ae0.js → 4790.10d75f7c7f8e54ce83a1.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/4795.034ebc93a67b7a3d6536.js +1 -0
- package/src/legacy/tool-ui/src/main/webapp/dist/{5098.36bb17ff636e87930c6c.js → 5098.33613009827cfc80aafb.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{5385.a7d0efb64a5e06173012.js → 5385.6656501b67424994820b.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{5598.2f1f3ddbbaefdc2fce5a.js → 5598.d84773ca53126661bdca.js} +2 -2
- package/src/legacy/tool-ui/src/main/webapp/dist/{5617.96a2611314c9148efa9c.js → 5617.c81ecb679371ca302f1f.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{7175.43f44b9e832f6734d8ea.js → 5718.449113ae2463a3bb8a83.js} +2 -2
- package/src/legacy/tool-ui/src/main/webapp/dist/{1478.b8f12bb302ba4337da4c.js → 6086.7ca02b827506f29db590.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{6216.3ad86a4e1c11cd87b2cc.js → 6216.2d532054fcb8e634f96b.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{6497.17547f58bb12eb6df22d.js → 6497.b7d8dcbf0e7c8d8d538d.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{6565.9abec7b54647bee08edc.js → 6565.0e5abc3bd344c53ae154.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{1536.9b3398bf3ebc2f20f009.js → 7033.4cd6efbe12e7aaa35745.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{7202.237027436f4c50941edf.js → 7202.1e5b8f21215ea6eae20a.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{6664.ec6ef73e3bb33125bd4c.js → 7361.793163ca71dfac69d9eb.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{7524.ae0837d4dafc92523de7.js → 7524.2990be869cf0a2988d17.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{7741.84e705c31c3ebc66db92.js → 7741.0b2789c4e783af835763.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{7863.043ee730e243753af268.js → 7863.2a1d1fd229778a47e10b.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{8752.3e4315bdb4ad40297406.js → 8752.3d02a0f42ec39786fdf0.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{8897.b12d749c9564eaa0c945.js → 8897.bfeed19f2a4acbb6d67c.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{8934.9f3371f510334b7bae6d.js → 8934.e90ceca8169fc25e4e1b.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{9277.385ca94e4e3722d25e81.js → 9277.88b2d89b3ba1c24e7f93.js} +2 -2
- package/src/legacy/tool-ui/src/main/webapp/dist/{9360.269cf0d9b358dcf52f55.js → 9360.bb0352313d610cae11de.js} +2 -2
- package/src/legacy/tool-ui/src/main/webapp/dist/{9576.18cf577b8886dd85372e.js → 9576.174d6a99544d17e7416d.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/Appetizeio.185641211f7c0e42a455.js +1 -0
- package/src/legacy/tool-ui/src/main/webapp/dist/CISpectrum.74db7dc80b3a6797a167.js +1 -0
- package/src/legacy/tool-ui/src/main/webapp/dist/{CodeMirror.2fda1e731cfcb7bec629.js → CodeMirror.5ddffe054374f883d6f8.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{ImageEditor.a6da6e88cc958354ec68.js → ImageEditor.14e3b3035666436f53a5.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/RTEProseMirror.24cbb57c0030725925a0.js +500 -0
- package/src/legacy/tool-ui/src/main/webapp/dist/TimedContent.4bb4dc83ffbe4019dd7b.js +1 -0
- package/src/legacy/tool-ui/src/main/webapp/dist/{VideoEditor.c183998c7b2b0dae98f6.js → VideoEditor.11c89dda5cf125738a33.js} +2 -2
- package/src/legacy/tool-ui/src/main/webapp/dist/{v4.18729ea4f861ad351303.js → v4.e496a62fb1d4be0544d4.js} +9 -9
- package/src/legacy/tool-ui/src/main/webapp/dist/{v5.beb4fdae5f572ba09fa3.js → v5.1711204aaf6c5fa01b1b.js} +8 -8
- package/dist/storybook/assets/if-defined-Ct57L3GT.js +0 -1
- package/dist/storybook/assets/onFind-BCF79WfX.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/3409.8e764d5fa8e2c2cf4d00.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/4795.d4ba3cc84dbf7e58fecb.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/5306.b41630da0d1df3453bc0.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/6996.f0fbe667259b36548b69.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/8430.0e134152362fff9ad9d0.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/Appetizeio.47287ce7992dc52bcb47.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/CISpectrum.45b362ff7dbae9d80cd9.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/RTEProseMirror.5a8f4754ee77adc85db2.js +0 -500
- package/src/legacy/tool-ui/src/main/webapp/dist/TimedContent.2d0ed03e8d1c994ecfb2.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/bsp-rings-bg.svg +0 -9
- /package/src/legacy/tool-ui/src/main/webapp/dist/{3543.c62d88fc2904cccc7e64.js.LICENSE.txt → 3543.2d704cf9e170322468e7.js.LICENSE.txt} +0 -0
- /package/src/legacy/tool-ui/src/main/webapp/dist/{5598.2f1f3ddbbaefdc2fce5a.js.LICENSE.txt → 5598.d84773ca53126661bdca.js.LICENSE.txt} +0 -0
- /package/src/legacy/tool-ui/src/main/webapp/dist/{7175.43f44b9e832f6734d8ea.js.LICENSE.txt → 5718.449113ae2463a3bb8a83.js.LICENSE.txt} +0 -0
- /package/src/legacy/tool-ui/src/main/webapp/dist/{9277.385ca94e4e3722d25e81.js.LICENSE.txt → 9277.88b2d89b3ba1c24e7f93.js.LICENSE.txt} +0 -0
- /package/src/legacy/tool-ui/src/main/webapp/dist/{9360.269cf0d9b358dcf52f55.js.LICENSE.txt → 9360.bb0352313d610cae11de.js.LICENSE.txt} +0 -0
- /package/src/legacy/tool-ui/src/main/webapp/dist/{RTEProseMirror.5a8f4754ee77adc85db2.js.LICENSE.txt → RTEProseMirror.24cbb57c0030725925a0.js.LICENSE.txt} +0 -0
- /package/src/legacy/tool-ui/src/main/webapp/dist/{VideoEditor.c183998c7b2b0dae98f6.js.LICENSE.txt → VideoEditor.11c89dda5cf125738a33.js.LICENSE.txt} +0 -0
- /package/src/legacy/tool-ui/src/main/webapp/dist/{v4.18729ea4f861ad351303.js.LICENSE.txt → v4.e496a62fb1d4be0544d4.js.LICENSE.txt} +0 -0
- /package/src/legacy/tool-ui/src/main/webapp/dist/{v5.beb4fdae5f572ba09fa3.js.LICENSE.txt → v5.1711204aaf6c5fa01b1b.js.LICENSE.txt} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{R as e}from"./iframe-
|
|
1
|
+
import{R as e}from"./iframe-D43T7JCn.js";import"./preload-helper-PPVm8Dsz.js";const o={},c=e.createContext(o);function u(n){const t=e.useContext(c);return e.useMemo(function(){return typeof n=="function"?n(t):{...t,...n}},[t,n])}function r(n){let t;return n.disableParentContext?t=typeof n.components=="function"?n.components(o):n.components||o:t=u(n.components),e.createElement(c.Provider,{value:t},n.children)}export{r as MDXProvider,u as useMDXComponents};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Q as W}from"./iframe-D43T7JCn.js";var L={exports:{}},K=L.exports,I;function V(){return I||(I=1,(function(s){(function(t,e){s.exports?s.exports=e():t.log=e()})(K,function(){var t=function(){},e="undefined",c=typeof window!==e&&typeof window.navigator!==e&&/Trident\/|MSIE /.test(window.navigator.userAgent),o=["trace","debug","info","warn","error"],n={},a=null;function v(i,u){var r=i[u];if(typeof r.bind=="function")return r.bind(i);try{return Function.prototype.bind.call(r,i)}catch{return function(){return Function.prototype.apply.apply(r,[i,arguments])}}}function U(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function P(i){return i==="debug"&&(i="log"),typeof console===e?!1:i==="trace"&&c?U:console[i]!==void 0?v(console,i):console.log!==void 0?v(console,"log"):t}function y(){for(var i=this.getLevel(),u=0;u<o.length;u++){var r=o[u];this[r]=u<i?t:this.methodFactory(r,i,this.name)}if(this.log=this.debug,typeof console===e&&i<this.levels.SILENT)return"No console available for logging"}function q(i){return function(){typeof console!==e&&(y.call(this),this[i].apply(this,arguments))}}function z(i,u,r){return P(i)||q.apply(this,arguments)}function T(i,u){var r=this,m,k,h,g="loglevel";typeof i=="string"?g+=":"+i:typeof i=="symbol"&&(g=void 0);function D(l){var f=(o[l]||"silent").toUpperCase();if(!(typeof window===e||!g)){try{window.localStorage[g]=f;return}catch{}try{window.document.cookie=encodeURIComponent(g)+"="+f+";"}catch{}}}function x(){var l;if(!(typeof window===e||!g)){try{l=window.localStorage[g]}catch{}if(typeof l===e)try{var f=window.document.cookie,w=encodeURIComponent(g),C=f.indexOf(w+"=");C!==-1&&(l=/^([^;]+)/.exec(f.slice(C+w.length+1))[1])}catch{}return r.levels[l]===void 0&&(l=void 0),l}}function $(){if(!(typeof window===e||!g)){try{window.localStorage.removeItem(g)}catch{}try{window.document.cookie=encodeURIComponent(g)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function b(l){var f=l;if(typeof f=="string"&&r.levels[f.toUpperCase()]!==void 0&&(f=r.levels[f.toUpperCase()]),typeof f=="number"&&f>=0&&f<=r.levels.SILENT)return f;throw new TypeError("log.setLevel() called with invalid level: "+l)}r.name=i,r.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},r.methodFactory=u||z,r.getLevel=function(){return h??k??m},r.setLevel=function(l,f){return h=b(l),f!==!1&&D(h),y.call(r)},r.setDefaultLevel=function(l){k=b(l),x()||r.setLevel(l,!1)},r.resetLevel=function(){h=null,$(),y.call(r)},r.enableAll=function(l){r.setLevel(r.levels.TRACE,l)},r.disableAll=function(l){r.setLevel(r.levels.SILENT,l)},r.rebuild=function(){if(a!==r&&(m=b(a.getLevel())),y.call(r),a===r)for(var l in n)n[l].rebuild()},m=b(a?a.getLevel():"WARN");var F=x();F!=null&&(h=b(F)),y.call(r)}a=new T,a.getLogger=function(u){if(typeof u!="symbol"&&typeof u!="string"||u==="")throw new TypeError("You must supply a name when creating a logger.");var r=n[u];return r||(r=n[u]=new T(u,a.methodFactory)),r};var _=typeof window!==e?window.log:void 0;return a.noConflict=function(){return typeof window!==e&&window.log===a&&(window.log=_),a},a.getLoggers=function(){return n},a.default=a,a})})(L)),L.exports}var Y=V();const G=W(Y),R=Symbol.for("brightspot.onFind");let p;function d(){return p||(p=globalThis[R],p||(p={calledIndex:0,callbacks:[],blacklist:[],triggerPaused:!1,triggerOnResume:!1,triggerAll:!1,triggerElements:[],triggerFrame:0,initialized:!1},globalThis[R]=p),p)}class J{#r;#e;#t;#i;#n;constructor(t,e,c){this.#r=t,this.#e=`data-ofc${d().calledIndex++}`,Array.isArray(e)||(e=[e]),this.#t=e.map(e.some(n=>n.indexOf(",")>-1)?n=>n:n=>`${n}:not([${this.#e}])`).join(","),this.#i=c;const o=e.map(n=>n.trim()).filter(n=>n.indexOf(" ")<0&&n.indexOf(",")<0);o.length===e.length&&(this.#n=o)}addTriggerElements(t,e){if(this.#r.contains(e)){e.matches(this.#t)&&t.push(e);for(const c of e.querySelectorAll(this.#t))t.push(c)}}trigger(t){if(document.readyState!=="loading")if(this.#n&&Array.isArray(t))for(const e of t)this.#n.some(c=>e.matches(c))&&this.#o(e);else for(const e of this.#r.querySelectorAll(this.#t))this.#o(e)}#o(t){if(!N(t)&&!t.hasAttribute(this.#e)){t.setAttribute(this.#e,"");try{this.#i(t)}catch(e){G.error("Failed callback!",t,e)}}}}function N(s){if(!(s instanceof Element))return!1;const{blacklist:t}=d();return t.length>0&&t.some(e=>s.closest(e)!==null)}const S=Array.prototype.every,O=s=>s.nodeType===Node.TEXT_NODE;function A(s){const t=d();if(t.triggerPaused){t.triggerOnResume=!0;return}const e=Array.isArray(s),c=[];if(e){for(const o of s){const n=o.target;if(!N(n))switch(o.type){case"attributes":o.oldValue!==n.getAttribute(o.attributeName)&&c.push(o);break;case"childList":(!S.call(o.addedNodes,O)||!S.call(o.removedNodes,O))&&c.push(o);break}}if(c.length===0)return}if(c.length>500&&(t.triggerAll=!0),!t.triggerAll)if(e)for(const o of c){const n=o.target;switch(o.type){case"attributes":t.triggerElements.push(n);break;case"childList":for(const a of t.callbacks)a.addTriggerElements(t.triggerElements,n);break}}else t.triggerAll=!0;(t.triggerAll||t.triggerElements.length>0)&&!t.triggerFrame&&(t.triggerFrame=window.requestAnimationFrame(()=>{const o=t.triggerAll?void 0:t.triggerElements;t.triggerAll=!1,t.triggerElements=[],t.triggerFrame=0,t.callbacks.forEach(n=>n.trigger(o))}))}function M(){A(),new MutationObserver(A).observe(document,{attributes:!0,attributeFilter:["class","data-bsp-autosubmit","data-chart-type","data-code-type","data-internal-name","data-tab","name","rel","target"],attributeOldValue:!0,childList:!0,subtree:!0})}function Q(){const s=d();s.initialized||(s.initialized=!0,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",M):M())}function E(s,t,e){Q();let c,o;typeof e<"u"?(c=s,o=t):(c=document,o=s,e=t);const n=new J(c,o,e);return n.trigger(),d().callbacks.push(n),()=>{const{callbacks:a}=d(),v=a.indexOf(n);v!==-1&&a.splice(v,1)}}E.triggerCallbacks=A;E.pause=()=>{d().triggerPaused=!0};E.resume=()=>{const s=d();s.triggerPaused=!1,s.triggerOnResume&&(s.triggerOnResume=!1,setTimeout(A,100))};E.ignore=(...s)=>{const{blacklist:t}=d();for(const e of s){try{document.querySelector(e)}catch{continue}t.includes(e)||t.push(e)}};export{G as l,E as o};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{x as f}from"./iframe-
|
|
1
|
+
import{x as f}from"./iframe-D43T7JCn.js";import{l as P,o as p}from"./onFind-CamigPPi.js";import"./preload-helper-PPVm8Dsz.js";const F=Symbol.for("brightspot.onFind");let y;function v(){return y||(y=globalThis[F],y||(y={calledIndex:0,callbacks:[],blacklist:[],triggerPaused:!1,triggerOnResume:!1,triggerAll:!1,triggerElements:[],triggerFrame:0,initialized:!1},globalThis[F]=y),y)}class O{#n;#e;#t;#a;#s;constructor(t,e,n){this.#n=t,this.#e=`data-ofc${v().calledIndex++}`,Array.isArray(e)||(e=[e]),this.#t=e.map(e.some(o=>o.indexOf(",")>-1)?o=>o:o=>`${o}:not([${this.#e}])`).join(","),this.#a=n;const a=e.map(o=>o.trim()).filter(o=>o.indexOf(" ")<0&&o.indexOf(",")<0);a.length===e.length&&(this.#s=a)}addTriggerElements(t,e){if(this.#n.contains(e)){e.matches(this.#t)&&t.push(e);for(const n of e.querySelectorAll(this.#t))t.push(n)}}trigger(t){if(document.readyState!=="loading")if(this.#s&&Array.isArray(t))for(const e of t)this.#s.some(n=>e.matches(n))&&this.#o(e);else for(const e of this.#n.querySelectorAll(this.#t))this.#o(e)}#o(t){if(!H(t)&&!t.hasAttribute(this.#e)){t.setAttribute(this.#e,"");try{this.#a(t)}catch(e){P.error("Failed callback!",t,e)}}}}function H(s){if(!(s instanceof Element))return!1;const{blacklist:t}=v();return t.length>0&&t.some(e=>s.closest(e)!==null)}const $=Array.prototype.every,S=s=>s.nodeType===Node.TEXT_NODE;function C(s){const t=v();if(t.triggerPaused){t.triggerOnResume=!0;return}const e=Array.isArray(s),n=[];if(e){for(const a of s){const o=a.target;if(!H(o))switch(a.type){case"attributes":a.oldValue!==o.getAttribute(a.attributeName)&&n.push(a);break;case"childList":(!$.call(a.addedNodes,S)||!$.call(a.removedNodes,S))&&n.push(a);break}}if(n.length===0)return}if(n.length>500&&(t.triggerAll=!0),!t.triggerAll)if(e)for(const a of n){const o=a.target;switch(a.type){case"attributes":t.triggerElements.push(o);break;case"childList":for(const c of t.callbacks)c.addTriggerElements(t.triggerElements,o);break}}else t.triggerAll=!0;(t.triggerAll||t.triggerElements.length>0)&&!t.triggerFrame&&(t.triggerFrame=window.requestAnimationFrame(()=>{const a=t.triggerAll?void 0:t.triggerElements;t.triggerAll=!1,t.triggerElements=[],t.triggerFrame=0,t.callbacks.forEach(o=>o.trigger(a))}))}function z(){C(),new MutationObserver(C).observe(document,{attributes:!0,attributeFilter:["class","data-bsp-autosubmit","data-chart-type","data-code-type","data-internal-name","data-tab","name","rel","target"],attributeOldValue:!0,childList:!0,subtree:!0})}function D(){const s=v();s.initialized||(s.initialized=!0,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",z):z())}function b(s,t,e){D();let n,a;typeof e<"u"?(n=s,a=t):(n=document,a=s,e=t);const o=new O(n,a,e);return o.trigger(),v().callbacks.push(o),()=>{const{callbacks:c}=v(),m=c.indexOf(o);m!==-1&&c.splice(m,1)}}b.triggerCallbacks=C;b.pause=()=>{v().triggerPaused=!0};b.resume=()=>{const s=v();s.triggerPaused=!1,s.triggerOnResume&&(s.triggerOnResume=!1,setTimeout(C,100))};b.ignore=(...s)=>{const{blacklist:t}=v();for(const e of s){try{document.querySelector(e)}catch{continue}t.includes(e)||t.push(e)}};const{expect:d,userEvent:r,waitFor:u,within:k}=__STORYBOOK_MODULE_TEST__,R={title:"Utilities/onFind",tags:["autodocs"],parameters:{docs:{subtitle:"The `onFind` utility observes DOM mutations and executes callbacks when elements matching specified selectors appear. Uses MutationObserver internally to efficiently track element additions and attribute changes."},controls:{expanded:!0}},argTypes:{selector:{control:{type:"text"},description:"CSS selector to watch for"}},args:{selector:".dynamic-item"}},h={render:s=>{const t=`onfind-${Math.random().toString(36).substring(2,9)}`,e=`.dynamic-item-${t}`;let n=0,a=0;const o=()=>{const i=document.getElementById(`${t}-items-count`),l=document.getElementById(`${t}-found-count`);i&&(i.textContent=String(n)),l&&(l.textContent=String(a))};return p(e,i=>{a++,o(),i.classList.add("ring-2","ring-success-500")}),f`
|
|
2
2
|
<div class="space-y-4">
|
|
3
3
|
<div class="text-base">
|
|
4
4
|
<p class="mb-2">
|
|
@@ -8,10 +8,10 @@ import{x as f}from"./iframe-DUPD-I_r.js";import{l as F,o as p}from"./onFind-BCF7
|
|
|
8
8
|
</div>
|
|
9
9
|
|
|
10
10
|
<div class="flex gap-2">
|
|
11
|
-
<button data-testid="add-item" @click=${()=>{
|
|
11
|
+
<button data-testid="add-item" @click=${()=>{n++;const i=document.getElementById(`${t}-container`);if(i){const l=document.createElement("div");l.className=`dynamic-item-${t} rounded border bg-white p-4`,l.textContent=`Item ${n}`,i.appendChild(l)}o()}} class="btu-button btu-button-primary btu-button-sm">
|
|
12
12
|
Add Item
|
|
13
13
|
</button>
|
|
14
|
-
<button data-testid="clear-items" @click=${()=>{
|
|
14
|
+
<button data-testid="clear-items" @click=${()=>{n=0,a=0;const i=document.getElementById(`${t}-container`);i&&(i.innerHTML=""),o()}} class="btu-button btu-button-gray btu-button-sm">
|
|
15
15
|
Clear All
|
|
16
16
|
</button>
|
|
17
17
|
</div>
|
|
@@ -35,7 +35,7 @@ import{x as f}from"./iframe-DUPD-I_r.js";import{l as F,o as p}from"./onFind-BCF7
|
|
|
35
35
|
</div>
|
|
36
36
|
</div>
|
|
37
37
|
</div>
|
|
38
|
-
`},parameters:{docs:{description:{story:"Interactive example showing onFind detecting dynamically added elements. Elements are automatically highlighted when detected."}}},play:async({canvasElement:
|
|
38
|
+
`},parameters:{docs:{description:{story:"Interactive example showing onFind detecting dynamically added elements. Elements are automatically highlighted when detected."}}},play:async({canvasElement:s,step:t})=>{const e=k(s);await t("Detects dynamically added element",async()=>{await r.click(e.getByTestId("add-item")),await u(()=>d(e.getByTestId("found-count")).toHaveTextContent("1"))}),await t("Detects multiple elements",async()=>{await r.click(e.getByTestId("add-item")),await r.click(e.getByTestId("add-item")),await u(()=>d(e.getByTestId("found-count")).toHaveTextContent("3"))}),await t("Clear resets counts",async()=>{await r.click(e.getByTestId("clear-items")),d(e.getByTestId("items-count")).toHaveTextContent("0"),d(e.getByTestId("found-count")).toHaveTextContent("0")}),await t("Detection resumes after clear",async()=>{await r.click(e.getByTestId("add-item")),await u(()=>d(e.getByTestId("found-count")).toHaveTextContent("1"))})}},B={render:()=>{const s="onfind-ignore-demo",t=".ignore-demo-item",e="ignore-demo-zone";let n=0,a=0;const o=()=>{const i=document.getElementById(`${s}-found-count`);i&&(i.textContent=String(n))};return p.ignore(`.${e}`),p(t,i=>{n++,o(),i.classList.add("ring-2","ring-success-500")}),f`
|
|
39
39
|
<div class="space-y-4">
|
|
40
40
|
<p class="text-base">
|
|
41
41
|
Elements added inside the <strong>ignored zone</strong> are skipped by onFind callbacks. Elements added
|
|
@@ -43,10 +43,10 @@ import{x as f}from"./iframe-DUPD-I_r.js";import{l as F,o as p}from"./onFind-BCF7
|
|
|
43
43
|
</p>
|
|
44
44
|
|
|
45
45
|
<div class="flex gap-2">
|
|
46
|
-
<button data-testid="add-outside" @click=${()=>{
|
|
46
|
+
<button data-testid="add-outside" @click=${()=>{a++;const i=document.getElementById(`${s}-outside`);if(i){const l=document.createElement("div");l.className=`${t.slice(1)} rounded border bg-white p-4`,l.textContent=`Outside ${a}`,i.appendChild(l)}}} class="btu-button btu-button-primary btu-button-sm">
|
|
47
47
|
Add Outside
|
|
48
48
|
</button>
|
|
49
|
-
<button data-testid="add-inside" @click=${()=>{
|
|
49
|
+
<button data-testid="add-inside" @click=${()=>{a++;const i=document.getElementById(`${s}-inside`);if(i){const l=document.createElement("div");l.className=`${t.slice(1)} rounded border bg-white p-4`,l.textContent=`Inside ${a}`,i.appendChild(l)}}} class="btu-button btu-button-gray btu-button-sm">
|
|
50
50
|
Add Inside Ignored
|
|
51
51
|
</button>
|
|
52
52
|
</div>
|
|
@@ -54,14 +54,14 @@ import{x as f}from"./iframe-DUPD-I_r.js";import{l as F,o as p}from"./onFind-BCF7
|
|
|
54
54
|
<div class="grid grid-cols-2 gap-4">
|
|
55
55
|
<div>
|
|
56
56
|
<div class="mb-1 text-xs font-semibold text-gray-500">Normal zone</div>
|
|
57
|
-
<div id="${
|
|
57
|
+
<div id="${s}-outside" class="min-h-32 space-y-2 rounded border-2 border-gray-300 bg-gray-50 p-4">
|
|
58
58
|
<div class="text-sm text-gray-400">Items detected here</div>
|
|
59
59
|
</div>
|
|
60
60
|
</div>
|
|
61
61
|
<div>
|
|
62
62
|
<div class="mb-1 text-xs font-semibold text-gray-500">Ignored zone</div>
|
|
63
63
|
<div
|
|
64
|
-
id="${
|
|
64
|
+
id="${s}-inside"
|
|
65
65
|
class="${e} border-red-300 bg-red-50 min-h-32 space-y-2 rounded border-2 p-4"
|
|
66
66
|
>
|
|
67
67
|
<div class="text-sm text-gray-400">Items ignored here</div>
|
|
@@ -73,14 +73,14 @@ import{x as f}from"./iframe-DUPD-I_r.js";import{l as F,o as p}from"./onFind-BCF7
|
|
|
73
73
|
<div class="text-xs text-gray-500">Items detected by onFind</div>
|
|
74
74
|
<div
|
|
75
75
|
data-testid="ignore-found-count"
|
|
76
|
-
id="${
|
|
76
|
+
id="${s}-found-count"
|
|
77
77
|
class="text-2xl font-bold text-primary-600"
|
|
78
78
|
>
|
|
79
79
|
0
|
|
80
80
|
</div>
|
|
81
81
|
</div>
|
|
82
82
|
</div>
|
|
83
|
-
`},parameters:{docs:{description:{story:"Demonstrates `onFind.ignore()` — elements inside ignored containers are excluded from callback processing. Useful for skipping rich-text editors or other zones where DOM mutations should not trigger component initialization."}}},play:async({canvasElement:
|
|
83
|
+
`},parameters:{docs:{description:{story:"Demonstrates `onFind.ignore()` — elements inside ignored containers are excluded from callback processing. Useful for skipping rich-text editors or other zones where DOM mutations should not trigger component initialization."}}},play:async({canvasElement:s,step:t})=>{const e=k(s);await t("Detects outside ignored zone",async()=>{await r.click(e.getByTestId("add-outside")),await u(()=>d(e.getByTestId("ignore-found-count")).toHaveTextContent("1"))}),await t("Skips inside ignored zone",async()=>{await r.click(e.getByTestId("add-inside")),await new Promise(n=>requestAnimationFrame(()=>requestAnimationFrame(n))),d(e.getByTestId("ignore-found-count")).toHaveTextContent("1")}),await t("Continues detecting outside",async()=>{await r.click(e.getByTestId("add-outside")),await u(()=>d(e.getByTestId("ignore-found-count")).toHaveTextContent("2"))})}},I={render:()=>{const s="onfind-pause-demo",t=".pause-demo-item";let e=0,n=0;const a=()=>{const i=document.getElementById(`${s}-found-count`);i&&(i.textContent=String(e))};p(t,i=>{e++,a(),i.classList.add("ring-2","ring-success-500")});const o=()=>{n++;const i=document.getElementById(`${s}-container`);if(i){const l=document.createElement("div");l.className=`${t.slice(1)} rounded border bg-white p-4`,l.textContent=`Item ${n}`,i.appendChild(l)}};let c=!1;return f`
|
|
84
84
|
<div class="space-y-4">
|
|
85
85
|
<p class="text-base">
|
|
86
86
|
Use <code>onFind.pause()</code> to temporarily stop detection and <code>onFind.resume()</code> to restart it.
|
|
@@ -88,15 +88,15 @@ import{x as f}from"./iframe-DUPD-I_r.js";import{l as F,o as p}from"./onFind-BCF7
|
|
|
88
88
|
</p>
|
|
89
89
|
|
|
90
90
|
<div class="flex gap-2">
|
|
91
|
-
<button data-testid="pause-add" @click=${
|
|
91
|
+
<button data-testid="pause-add" @click=${o} class="btu-button btu-button-primary btu-button-sm">
|
|
92
92
|
Add Item
|
|
93
93
|
</button>
|
|
94
|
-
<button data-testid="toggle-pause" @click=${()=>{c=!c,c?p.pause():p.resume();const
|
|
94
|
+
<button data-testid="toggle-pause" @click=${()=>{c=!c,c?p.pause():p.resume();const i=document.querySelector('[data-testid="toggle-pause"]');i&&(i.textContent=c?"Resume":"Pause",i.className=c?"btu-button btu-button-success btu-button-sm":"btu-button btu-button-warning btu-button-sm")}} class="btu-button btu-button-warning btu-button-sm">
|
|
95
95
|
Pause
|
|
96
96
|
</button>
|
|
97
97
|
</div>
|
|
98
98
|
|
|
99
|
-
<div id="${
|
|
99
|
+
<div id="${s}-container" class="min-h-32 space-y-2 rounded border-2 border-gray-300 bg-gray-50 p-4">
|
|
100
100
|
<div class="text-sm text-gray-500">Items will appear here...</div>
|
|
101
101
|
</div>
|
|
102
102
|
|
|
@@ -104,14 +104,14 @@ import{x as f}from"./iframe-DUPD-I_r.js";import{l as F,o as p}from"./onFind-BCF7
|
|
|
104
104
|
<div class="text-xs text-gray-500">Items detected by onFind</div>
|
|
105
105
|
<div
|
|
106
106
|
data-testid="pause-found-count"
|
|
107
|
-
id="${
|
|
107
|
+
id="${s}-found-count"
|
|
108
108
|
class="text-2xl font-bold text-primary-600"
|
|
109
109
|
>
|
|
110
110
|
0
|
|
111
111
|
</div>
|
|
112
112
|
</div>
|
|
113
113
|
</div>
|
|
114
|
-
`},parameters:{docs:{description:{story:"Demonstrates `onFind.pause()` and `onFind.resume()`. While paused, DOM mutations are queued and processed when resumed."}}},play:async({canvasElement:
|
|
114
|
+
`},parameters:{docs:{description:{story:"Demonstrates `onFind.pause()` and `onFind.resume()`. While paused, DOM mutations are queued and processed when resumed."}}},play:async({canvasElement:s,step:t})=>{const e=k(s);await t("Normal detection before pause",async()=>{await r.click(e.getByTestId("pause-add")),await u(()=>d(e.getByTestId("pause-found-count")).toHaveTextContent("1"))}),await t("Pause stops detection",async()=>{await r.click(e.getByTestId("toggle-pause")),await r.click(e.getByTestId("pause-add")),await new Promise(n=>setTimeout(n,200)),d(e.getByTestId("pause-found-count")).toHaveTextContent("1")}),await t("Resume triggers pending detection",async()=>{await r.click(e.getByTestId("toggle-pause")),await u(()=>d(e.getByTestId("pause-found-count")).toHaveTextContent("2"),{timeout:2e3})})}},w={render:()=>{const s=p,t=".singleton-item-a",e=".singleton-item-b";let n=0,a=0;const o=()=>{const g=document.getElementById("singleton-count-a"),x=document.getElementById("singleton-count-b");g&&(g.textContent=String(n)),x&&(x.textContent=String(a))};s.ignore(".singleton-ignored-zone"),s(t,g=>{n++,o(),g.classList.add("ring-2","ring-blue-500")}),b(e,g=>{a++,o(),g.classList.add("ring-2","ring-purple-500")});const c=(g,x,M)=>{const A=document.getElementById(M);if(A){const E=document.createElement("div");E.className=`${g.slice(1)} rounded border bg-white p-4`,E.textContent=x,A.appendChild(E)}};let m=!1;return f`
|
|
115
115
|
<div class="space-y-4">
|
|
116
116
|
<p class="text-base">
|
|
117
117
|
Two separate ES module instances of <code>onFind</code> (each with its own <code>_state</code> cache) share
|
|
@@ -121,7 +121,7 @@ import{x as f}from"./iframe-DUPD-I_r.js";import{l as F,o as p}from"./onFind-BCF7
|
|
|
121
121
|
<div class="flex items-center gap-4">
|
|
122
122
|
<button
|
|
123
123
|
data-testid="singleton-toggle-pause"
|
|
124
|
-
@click=${()=>{m=!m,m?
|
|
124
|
+
@click=${()=>{m=!m,m?s.pause():s.resume();const g=document.querySelector('[data-testid="singleton-toggle-pause"]');g&&(g.textContent=m?"Resume":"Pause",g.className=m?"btu-button btu-button-success btu-button-sm":"btu-button btu-button-warning btu-button-sm")}}
|
|
125
125
|
class="btu-button btu-button-warning btu-button-sm"
|
|
126
126
|
>
|
|
127
127
|
Pause
|
|
@@ -203,7 +203,7 @@ import{x as f}from"./iframe-DUPD-I_r.js";import{l as F,o as p}from"./onFind-BCF7
|
|
|
203
203
|
</div>
|
|
204
204
|
</div>
|
|
205
205
|
</div>
|
|
206
|
-
`},parameters:{docs:{description:{story:"Two independent module instances of `onFind` (simulating separate bundles) share a single MutationObserver, ignore list, and pause/resume state through the `globalThis[Symbol.for()]` singleton pattern."}}},play:async({canvasElement:
|
|
206
|
+
`},parameters:{docs:{description:{story:"Two independent module instances of `onFind` (simulating separate bundles) share a single MutationObserver, ignore list, and pause/resume state through the `globalThis[Symbol.for()]` singleton pattern."}}},play:async({canvasElement:s,step:t})=>{const e=k(s);await t("Shared observer: Bundle A detects A items, Bundle B detects B items",async()=>{await r.click(e.getByTestId("singleton-add-a")),await u(()=>d(e.getByTestId("singleton-count-a")).toHaveTextContent("1")),await r.click(e.getByTestId("singleton-add-b")),await u(()=>d(e.getByTestId("singleton-count-b")).toHaveTextContent("1"))}),await t("Cross-zone detection fires correct callback",async()=>{await r.click(e.getByTestId("singleton-zone-a-add-b")),await u(()=>d(e.getByTestId("singleton-count-b")).toHaveTextContent("2")),d(e.getByTestId("singleton-count-a")).toHaveTextContent("1"),await r.click(e.getByTestId("singleton-zone-b-add-a")),await u(()=>d(e.getByTestId("singleton-count-a")).toHaveTextContent("2")),d(e.getByTestId("singleton-count-b")).toHaveTextContent("2")}),await t("Shared ignore list: Bundle A ignore() blocks Bundle B callbacks",async()=>{const n=e.getByTestId("singleton-count-a").textContent,a=e.getByTestId("singleton-count-b").textContent;await r.click(e.getByTestId("singleton-add-ignored")),await new Promise(o=>requestAnimationFrame(()=>requestAnimationFrame(o))),d(e.getByTestId("singleton-count-a")).toHaveTextContent(n),d(e.getByTestId("singleton-count-b")).toHaveTextContent(a)}),await t("Ignore lists are merged and deduped across bundles",async()=>{const n=globalThis[Symbol.for("brightspot.onFind")],a=n.blacklist.length;b.ignore(".singleton-ignored-zone"),d(n.blacklist.length).toBe(a),b.ignore(".bundle-b-ignored"),d(n.blacklist).toContain(".singleton-ignored-zone"),d(n.blacklist).toContain(".bundle-b-ignored"),d(n.blacklist.length).toBe(a+1)}),await t("Shared pause/resume: Bundle A pause() stops Bundle B detection",async()=>{await r.click(e.getByTestId("singleton-toggle-pause")),await r.click(e.getByTestId("singleton-add-a")),await r.click(e.getByTestId("singleton-add-b")),await new Promise(n=>setTimeout(n,200)),d(e.getByTestId("singleton-count-a")).toHaveTextContent("2"),d(e.getByTestId("singleton-count-b")).toHaveTextContent("2"),await r.click(e.getByTestId("singleton-toggle-pause")),await u(()=>d(e.getByTestId("singleton-count-a")).toHaveTextContent("3"),{timeout:2e3}),await u(()=>d(e.getByTestId("singleton-count-b")).toHaveTextContent("3"),{timeout:2e3})}),await t("No index collision on data-ofc attributes",async()=>{const n=s.querySelectorAll(".singleton-item-a, .singleton-item-b"),a=new Set;n.forEach(o=>{o.getAttributeNames().filter(c=>c.startsWith("data-ofc")).forEach(c=>a.add(c))}),d(a.size).toBeGreaterThanOrEqual(2)}),await t("Singleton state: both bundles share the same globalThis object",async()=>{const n=globalThis[Symbol.for("brightspot.onFind")];d(n).toBeDefined(),d(n.callbacks).toBeDefined(),d(Array.isArray(n.callbacks)).toBe(!0),d(n.initialized).toBe(!0),d(p.pause).not.toBe(b.pause),d(p.resume).not.toBe(b.resume)})}},T={render:()=>f`
|
|
207
207
|
<div class="space-y-4 text-sm">
|
|
208
208
|
<div>
|
|
209
209
|
<h3 class="mb-2 font-bold">Basic Usage</h3>
|
|
@@ -850,7 +850,7 @@ onFind.ignore('.ProseMirror', '.RichTextEditor')
|
|
|
850
850
|
expect(canvas.getByTestId('singleton-count-b')).toHaveTextContent(countBBefore!);
|
|
851
851
|
});
|
|
852
852
|
await step('Ignore lists are merged and deduped across bundles', async () => {
|
|
853
|
-
const state = (globalThis as any)[Symbol.for('brightspot.onFind
|
|
853
|
+
const state = (globalThis as any)[Symbol.for('brightspot.onFind')];
|
|
854
854
|
const before = state.blacklist.length;
|
|
855
855
|
|
|
856
856
|
// Bundle B ignores the same selector Bundle A already added in render()
|
|
@@ -889,7 +889,7 @@ onFind.ignore('.ProseMirror', '.RichTextEditor')
|
|
|
889
889
|
expect(indices.size).toBeGreaterThanOrEqual(2);
|
|
890
890
|
});
|
|
891
891
|
await step('Singleton state: both bundles share the same globalThis object', async () => {
|
|
892
|
-
const state = (globalThis as any)[Symbol.for('brightspot.onFind
|
|
892
|
+
const state = (globalThis as any)[Symbol.for('brightspot.onFind')];
|
|
893
893
|
expect(state).toBeDefined();
|
|
894
894
|
expect(state.callbacks).toBeDefined();
|
|
895
895
|
expect(Array.isArray(state.callbacks)).toBe(true);
|
|
@@ -1042,4 +1042,4 @@ onFind.ignore('.ProseMirror', '.RichTextEditor')
|
|
|
1042
1042
|
}
|
|
1043
1043
|
}
|
|
1044
1044
|
}
|
|
1045
|
-
}`,...T.parameters?.docs?.source}}};const
|
|
1045
|
+
}`,...T.parameters?.docs?.source}}};const U=["Interactive","Ignore","PauseResume","Singleton","UsageExample"];export{B as Ignore,h as Interactive,I as PauseResume,w as Singleton,T as UsageExample,U as __namedExportsOrder,R as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{x as p}from"./iframe-
|
|
1
|
+
import{x as p}from"./iframe-D43T7JCn.js";import"./preload-helper-PPVm8Dsz.js";let l=!1;function m(e,o){const s=new MutationObserver(r=>{for(const v of r)for(const n of v.removedNodes)n.contains(e)&&!l&&(s.disconnect(),o())});s.observe(document,{childList:!0,subtree:!0})}m.pause=()=>{l=!0};m.resume=()=>{l=!1};const h={title:"Utilities/onRemove",tags:["autodocs"],parameters:{docs:{subtitle:"The `onRemove` utility triggers a callback when a DOM element is removed from the document. Uses MutationObserver to watch for removals, with global pause/resume support."},controls:{expanded:!0}},argTypes:{selector:{control:{type:"text"},description:"CSS selector of element to watch"}},args:{selector:".watched-item"}},i={render:()=>{const e=`onremove-${Math.random().toString(36).substring(2,9)}`;let o=0,s=0;const r=()=>{const n=document.getElementById(`${e}-items-count`),t=document.getElementById(`${e}-removed-count`);n&&(n.textContent=String(o)),t&&(t.textContent=String(s))};return p`
|
|
2
2
|
<div class="space-y-4">
|
|
3
3
|
<div class="text-base">
|
|
4
4
|
<p class="mb-2">
|
package/dist/storybook/assets/{onVisible.stories-BaKmrATX.js → onVisible.stories-x3VhGAuF.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{x as d}from"./iframe-
|
|
1
|
+
import{x as d}from"./iframe-D43T7JCn.js";import{o as g}from"./onFind-CamigPPi.js";import"./preload-helper-PPVm8Dsz.js";const b=Symbol.for("brightspot.onVisible");let t;function v(){return t||(t=globalThis[b],t||(t={calledIndex:0},globalThis[b]=t),t)}function h(i,r){const s=`_ovc${v().calledIndex++}`,n=new IntersectionObserver(e=>{for(const o of e)if(o.isIntersecting){const c=o.target,m=c.classList;m.contains(s)||(m.add(s),n.unobserve(c),r(c))}});g(i,e=>{n.observe(e)})}const f={title:"Utilities/onVisible",tags:["autodocs"],parameters:{docs:{subtitle:"The `onVisible` utility triggers a callback once when elements matching a selector become visible in the viewport. Combines `onFind` with `IntersectionObserver` for lazy initialization of dynamically added elements."},controls:{expanded:!0}},argTypes:{selector:{control:{type:"text"},description:"CSS selector to watch for visibility"}},args:{selector:".lazy-item"}},l={render:()=>{const i=`onvisible-${Math.random().toString(36).substring(2,9)}`,r=`.lazy-item-${i}`;let s=0;const n=()=>{const e=document.getElementById(`${i}-visible-count`);e&&(e.textContent=String(s))};return h(r,e=>{s++,n(),e.classList.remove("opacity-30"),e.classList.add("ring-2","ring-success-500","opacity-100"),e.textContent+=" — visible!"}),d`
|
|
2
2
|
<div class="space-y-4">
|
|
3
3
|
<div class="text-base">
|
|
4
4
|
<p class="mb-2">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as l,ae as u,af as c,ag as a}from"./iframe-
|
|
1
|
+
import{e as l,ae as u,af as c,ag as a}from"./iframe-D43T7JCn.js";const o="important",d=" !"+o,h=l(class extends u{constructor(s){if(super(s),s.type!==c.ATTRIBUTE||s.name!=="style"||s.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(s){return Object.keys(s).reduce(((n,t)=>{const e=s[t];return e==null?n:n+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${e};`}),"")}update(s,[n]){const{style:t}=s.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(n)),this.render(n);for(const e of this.ft)n[e]==null&&(this.ft.delete(e),e.includes("-")?t.removeProperty(e):t[e]=null);for(const e in n){const r=n[e];if(r!=null){this.ft.add(e);const i=typeof r=="string"&&r.endsWith(d);e.includes("-")||i?t.setProperty(e,i?r.slice(0,-11):r,i?o:""):t[e]=r}}return a}});export{h as o};
|