@brightspot/ui 6.0.4 → 6.0.5-pr.212.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.
- package/dist/storybook/assets/{ActionBar.stories-BSwwf2PX.js → ActionBar.stories-Yu6hLS-7.js} +1 -1
- package/dist/storybook/assets/{ActionItem.stories-SCIA5Rt0.js → ActionItem.stories-HDUuT_Y3.js} +1 -1
- package/dist/storybook/assets/{AiSparkle.stories-ByeiNU3G.js → AiSparkle.stories--LwneJIF.js} +1 -1
- package/dist/storybook/assets/{Avatar.stories-1EUJytBr.js → Avatar.stories-7nYYV75H.js} +1 -1
- package/dist/storybook/assets/{AvatarGroup.stories-Bstlt4go.js → AvatarGroup.stories-DxxDFJiA.js} +1 -1
- package/dist/storybook/assets/{Badge.stories-X7m0Vl2G.js → Badge.stories-D8fmfms-.js} +1 -1
- package/dist/storybook/assets/{Banner.stories-ljxjOtEc.js → Banner.stories-hlnDeqi6.js} +1 -1
- package/dist/storybook/assets/{Button-Dbpmp5Ih.js → Button-PG1zeey_.js} +1 -1
- package/dist/storybook/assets/{Button.stories-C5qS3rIw.js → Button.stories-D8OLuiQW.js} +1 -1
- package/dist/storybook/assets/{ButtonGroup.stories-Bl1Ko9jX.js → ButtonGroup.stories-Dz1B5l88.js} +1 -1
- package/dist/storybook/assets/{Card.stories-CfFIzXg5.js → Card.stories-Orbf7wd5.js} +1 -1
- package/dist/storybook/assets/{Celebrate.stories-TSJrIQR8.js → Celebrate.stories-BpTW_6sa.js} +1 -1
- package/dist/storybook/assets/{Checkbox.stories-DUpT9Iwh.js → Checkbox.stories-DZM4MMCD.js} +1 -1
- package/dist/storybook/assets/{CircularProgress.stories-usNosiIU.js → CircularProgress.stories-DWB5hxZv.js} +1 -1
- package/dist/storybook/assets/{ClipboardMixin.stories-0jnZ0Drs.js → ClipboardMixin.stories-BGanP3Ar.js} +1 -1
- package/dist/storybook/assets/{Color-6BZIO3FS-C6ecAOER.js → Color-6BZIO3FS-B2u7xxz5.js} +1 -1
- package/dist/storybook/assets/{Colors.stories-DcbIlkPs.js → Colors.stories-xHX6CHCh.js} +1 -1
- package/dist/storybook/assets/{CombinedEffects.stories-CU-hwRPT.js → CombinedEffects.stories-D10WQ6NJ.js} +1 -1
- package/dist/storybook/assets/{ComponentStatesMixin-Dcz-J-hg.js → ComponentStatesMixin-BACZA29L.js} +1 -1
- package/dist/storybook/assets/{ComponentStatesMixin.stories-orhdmIUX.js → ComponentStatesMixin.stories-Cz2QMyPD.js} +1 -1
- package/dist/storybook/assets/{CopyToClipboard.stories-D1R2yCQL.js → CopyToClipboard.stories-D81eKI8H.js} +1 -1
- package/dist/storybook/assets/{Debounce.stories-6z8aEn7O.js → Debounce.stories-C2WIJZtd.js} +1 -1
- package/dist/storybook/assets/{DocsRenderer-LL677BLK-B-fTNYB5.js → DocsRenderer-LL677BLK-CEUT7l9O.js} +3 -3
- package/dist/storybook/assets/{Dropdown.stories-CeVpVPrP.js → Dropdown.stories-DosyK4Xp.js} +1 -1
- package/dist/storybook/assets/{EmptyState.stories-DdCyApUP.js → EmptyState.stories-l8M0yROT.js} +1 -1
- package/dist/storybook/assets/{EscaAvatar.stories-DNK85ssI.js → EscaAvatar.stories-jSs4xDDT.js} +1 -1
- package/dist/storybook/assets/{Events.stories-B1qeq2wy.js → Events.stories-BPJUevWD.js} +1 -1
- package/dist/storybook/assets/{Heading.stories-DRu5hUyJ.js → Heading.stories-BwQNsNCD.js} +1 -1
- package/dist/storybook/assets/{HueRipple.stories-D3zqVZWM.js → HueRipple.stories-r24GQTwM.js} +1 -1
- package/dist/storybook/assets/{Icon.stories-CKG5fIIH.js → Icon.stories-C13rAqjc.js} +1 -1
- package/dist/storybook/assets/{IconButton.stories-B3RZKBqV.js → IconButton.stories-o6SQ3i0y.js} +1 -1
- package/dist/storybook/assets/{LinearProgress.stories-BPvFKGi0.js → LinearProgress.stories-DXQQsuwf.js} +1 -1
- package/dist/storybook/assets/{Message.stories-Dq3YDccT.js → Message.stories-BvivAs2E.js} +1 -1
- package/dist/storybook/assets/{OnFindMixin.stories-qKTooUKN.js → OnFindMixin.stories-DpFUP67v.js} +1 -1
- package/dist/storybook/assets/{Pagination.stories-BaFWcckS.js → Pagination.stories-BQIZcpxs.js} +1 -1
- package/dist/storybook/assets/{Popover.stories-DlHlfWrk.js → Popover.stories-DW_ME7-J.js} +1 -1
- package/dist/storybook/assets/{ReadyMixin-BQ-q8NO4.js → ReadyMixin-SsbjGIAN.js} +1 -1
- package/dist/storybook/assets/{RovingTabindexMixin.stories-CQkteE6h.js → RovingTabindexMixin.stories--7ZT92XF.js} +1 -1
- package/dist/storybook/assets/{Rtc.stories-BWBDrPM8.js → Rtc.stories-Jg3rW19u.js} +1 -1
- package/dist/storybook/assets/{ScrollShadow.stories-BtM7Q6Ys.js → ScrollShadow.stories-DugbXzyD.js} +1 -1
- package/dist/storybook/assets/{Switch.stories-Ys6MzOf7.js → Switch.stories-DULTCvm6.js} +1 -1
- package/dist/storybook/assets/{Tab.stories-CNIDOscR.js → Tab.stories-rQrDfwi4.js} +1 -1
- package/dist/storybook/assets/{Tabs.stories-oAxuRqKE.js → Tabs.stories-BF6JfaUj.js} +1 -1
- package/dist/storybook/assets/{Throttle.stories-D2nPrZEL.js → Throttle.stories-BTXPUD_9.js} +1 -1
- package/dist/storybook/assets/{Tooltip.stories-DJhjWYNV.js → Tooltip.stories-CC5jtR6l.js} +1 -1
- package/dist/storybook/assets/{Upload.stories-DBveASQF.js → Upload.stories-BcPWDJ9v.js} +1 -1
- package/dist/storybook/assets/{UploadItem.stories-Co5bGJs6.js → UploadItem.stories-CbBUmeMS.js} +1 -1
- package/dist/storybook/assets/{Welcome.stories-Cls_kv8A.js → Welcome.stories-LMHGYSp6.js} +1 -1
- package/dist/storybook/assets/{Widget.stories-CXpqw5z8.js → Widget.stories-C7SRQn3o.js} +1 -1
- package/dist/storybook/assets/{WithTooltip-65CFNBJE-Ik6o5Ygb.js → WithTooltip-65CFNBJE-Cp1Cy3oy.js} +1 -1
- package/dist/storybook/assets/{blocks-DjXAnVrm.js → blocks-BxdX04XX.js} +5 -5
- package/dist/storybook/assets/{formatter-EIJCOSYU-CQXaWVan.js → formatter-EIJCOSYU--pzeRzQ9.js} +1 -1
- package/dist/storybook/assets/if-defined-D53b_oJ7.js +1 -0
- package/dist/storybook/assets/{iframe-D43T7JCn.js → iframe-ComXXBv4.js} +3 -3
- package/dist/storybook/assets/{index-DIk8fbbl.js → index-DlomlmQt.js} +1 -1
- package/dist/storybook/assets/onFind-I2sK1i6b.js +1 -0
- package/dist/storybook/assets/{onFind.stories-DgxMtTTG.js → onFind.stories-BMm3A2oE.js} +20 -20
- package/dist/storybook/assets/{onRemove.stories-DltMfNLX.js → onRemove.stories-CellKu-r.js} +1 -1
- package/dist/storybook/assets/{onVisible.stories-x3VhGAuF.js → onVisible.stories-CrnqbcYv.js} +1 -1
- package/dist/storybook/assets/{style-map-C5J-rKx9.js → style-map-DPWIvyMv.js} +1 -1
- package/dist/storybook/assets/{syntaxhighlighter-ED5Y7EFY-CphVNry2.js → syntaxhighlighter-ED5Y7EFY-Bl3HCk9S.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 +137 -66
- package/dist/util/onFind.js.map +1 -1
- package/package.json +1 -1
- package/src/legacy/tool-ui/src/ContentEdit.css +1 -1
- package/src/legacy/tool-ui/src/ContentInputGroup.css +15 -13
- package/src/legacy/tool-ui/src/Entry.ts +35 -0
- package/src/legacy/tool-ui/src/Page.css +4 -2
- package/src/legacy/tool-ui/src/Widget.css +2 -2
- package/src/legacy/tool-ui/src/dom/onFind.ts +29 -270
- package/src/legacy/tool-ui/src/main/webapp/dist/{6086.7ca02b827506f29db590.js → 1478.b8f12bb302ba4337da4c.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{7033.4cd6efbe12e7aaa35745.js → 1536.9b3398bf3ebc2f20f009.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{2111.3956b5196a514b2c0131.js → 2111.efb40a1ab7d6b02913dd.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{2456.5bcfb782c2ec27de32ed.js → 2456.2c20c3564647ca071b26.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{2537.e8f1359bedd328bf57f4.js → 2537.a4d0a358f9c1a60ebc68.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{270.3011484ff80f3093083a.js → 270.8fb1c93bc009582a32cd.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{2825.c1342ac2662d11fd4125.js → 2825.9c2b897f2a3799dcbd19.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{2947.f96d21c44c05980974ef.js → 2947.52cb126b0e2ab4415189.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/3409.8e764d5fa8e2c2cf4d00.js +1 -0
- package/src/legacy/tool-ui/src/main/webapp/dist/{3532.c358dfbb2cde0f802c7f.js → 3532.ed7716198932139a4fb1.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{3543.2d704cf9e170322468e7.js → 3543.c62d88fc2904cccc7e64.js} +2 -2
- package/src/legacy/tool-ui/src/main/webapp/dist/{3611.61837ffa933f74502094.js → 3611.5466757310c53bea4b6e.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{4374.37147747a254da8f5f8a.js → 4374.a2ea1952e2daf222dc20.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{4450.16dd5684292fd0a7ea7f.js → 4450.9eaca48c71e3dfb64a45.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{4478.93f64e6a6ccb35a6c6d4.js → 4478.3c6e9704ad67996b53a8.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{4790.10d75f7c7f8e54ce83a1.js → 4790.ff3be0fd92b8d7422ae0.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/4795.d4ba3cc84dbf7e58fecb.js +1 -0
- package/src/legacy/tool-ui/src/main/webapp/dist/{5098.33613009827cfc80aafb.js → 5098.36bb17ff636e87930c6c.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/5306.b41630da0d1df3453bc0.js +1 -0
- package/src/legacy/tool-ui/src/main/webapp/dist/{5385.6656501b67424994820b.js → 5385.a7d0efb64a5e06173012.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{5598.d84773ca53126661bdca.js → 5598.2f1f3ddbbaefdc2fce5a.js} +2 -2
- package/src/legacy/tool-ui/src/main/webapp/dist/{5617.c81ecb679371ca302f1f.js → 5617.96a2611314c9148efa9c.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{6216.2d532054fcb8e634f96b.js → 6216.3ad86a4e1c11cd87b2cc.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{6497.b7d8dcbf0e7c8d8d538d.js → 6497.17547f58bb12eb6df22d.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{6565.0e5abc3bd344c53ae154.js → 6565.9abec7b54647bee08edc.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{7361.793163ca71dfac69d9eb.js → 6664.ec6ef73e3bb33125bd4c.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/6996.f0fbe667259b36548b69.js +1 -0
- package/src/legacy/tool-ui/src/main/webapp/dist/{5718.449113ae2463a3bb8a83.js → 7175.43f44b9e832f6734d8ea.js} +2 -2
- package/src/legacy/tool-ui/src/main/webapp/dist/{7202.1e5b8f21215ea6eae20a.js → 7202.237027436f4c50941edf.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{7524.2990be869cf0a2988d17.js → 7524.ae0837d4dafc92523de7.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{7741.0b2789c4e783af835763.js → 7741.84e705c31c3ebc66db92.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{7863.2a1d1fd229778a47e10b.js → 7863.043ee730e243753af268.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/8430.0e134152362fff9ad9d0.js +1 -0
- package/src/legacy/tool-ui/src/main/webapp/dist/{8752.3d02a0f42ec39786fdf0.js → 8752.3e4315bdb4ad40297406.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{8897.bfeed19f2a4acbb6d67c.js → 8897.b12d749c9564eaa0c945.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{8934.e90ceca8169fc25e4e1b.js → 8934.9f3371f510334b7bae6d.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{9277.88b2d89b3ba1c24e7f93.js → 9277.385ca94e4e3722d25e81.js} +2 -2
- package/src/legacy/tool-ui/src/main/webapp/dist/{9360.bb0352313d610cae11de.js → 9360.269cf0d9b358dcf52f55.js} +2 -2
- package/src/legacy/tool-ui/src/main/webapp/dist/{9576.174d6a99544d17e7416d.js → 9576.18cf577b8886dd85372e.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/Appetizeio.47287ce7992dc52bcb47.js +1 -0
- package/src/legacy/tool-ui/src/main/webapp/dist/CISpectrum.45b362ff7dbae9d80cd9.js +1 -0
- package/src/legacy/tool-ui/src/main/webapp/dist/{CodeMirror.5ddffe054374f883d6f8.js → CodeMirror.2fda1e731cfcb7bec629.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{ImageEditor.14e3b3035666436f53a5.js → ImageEditor.a6da6e88cc958354ec68.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/RTEProseMirror.5a8f4754ee77adc85db2.js +500 -0
- package/src/legacy/tool-ui/src/main/webapp/dist/TimedContent.2d0ed03e8d1c994ecfb2.js +1 -0
- package/src/legacy/tool-ui/src/main/webapp/dist/{VideoEditor.11c89dda5cf125738a33.js → VideoEditor.c183998c7b2b0dae98f6.js} +2 -2
- package/src/legacy/tool-ui/src/main/webapp/dist/{v4.e496a62fb1d4be0544d4.js → v4.3fe1a9cf9f56fbaf9b14.js} +9 -9
- package/src/legacy/tool-ui/src/main/webapp/dist/v5.177f4913df46d4960d57.js +92 -0
- package/src/legacy/tool-ui/src/main/webapp/dist/v5.5eac97ec93d474fa6085.css +5 -0
- package/src/legacy/tool-ui/src/v5.ts +5 -0
- package/dist/storybook/assets/if-defined-BVO6TNCy.js +0 -1
- package/dist/storybook/assets/onFind-CamigPPi.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/4114.57fe159e416e716f8cbc.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/4582.243dbaa3d8a8648f6f40.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/4795.034ebc93a67b7a3d6536.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/Appetizeio.185641211f7c0e42a455.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/CISpectrum.74db7dc80b3a6797a167.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/RTEProseMirror.24cbb57c0030725925a0.js +0 -500
- package/src/legacy/tool-ui/src/main/webapp/dist/TimedContent.4bb4dc83ffbe4019dd7b.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/v5.1711204aaf6c5fa01b1b.js +0 -92
- package/src/legacy/tool-ui/src/main/webapp/dist/v5.cb6c1a38c5ba7fa9ea93.css +0 -5
- /package/src/legacy/tool-ui/src/main/webapp/dist/{3543.2d704cf9e170322468e7.js.LICENSE.txt → 3543.c62d88fc2904cccc7e64.js.LICENSE.txt} +0 -0
- /package/src/legacy/tool-ui/src/main/webapp/dist/{5598.d84773ca53126661bdca.js.LICENSE.txt → 5598.2f1f3ddbbaefdc2fce5a.js.LICENSE.txt} +0 -0
- /package/src/legacy/tool-ui/src/main/webapp/dist/{5718.449113ae2463a3bb8a83.js.LICENSE.txt → 7175.43f44b9e832f6734d8ea.js.LICENSE.txt} +0 -0
- /package/src/legacy/tool-ui/src/main/webapp/dist/{9277.88b2d89b3ba1c24e7f93.js.LICENSE.txt → 9277.385ca94e4e3722d25e81.js.LICENSE.txt} +0 -0
- /package/src/legacy/tool-ui/src/main/webapp/dist/{9360.bb0352313d610cae11de.js.LICENSE.txt → 9360.269cf0d9b358dcf52f55.js.LICENSE.txt} +0 -0
- /package/src/legacy/tool-ui/src/main/webapp/dist/{RTEProseMirror.24cbb57c0030725925a0.js.LICENSE.txt → RTEProseMirror.5a8f4754ee77adc85db2.js.LICENSE.txt} +0 -0
- /package/src/legacy/tool-ui/src/main/webapp/dist/{VideoEditor.11c89dda5cf125738a33.js.LICENSE.txt → VideoEditor.c183998c7b2b0dae98f6.js.LICENSE.txt} +0 -0
- /package/src/legacy/tool-ui/src/main/webapp/dist/{v4.e496a62fb1d4be0544d4.js.LICENSE.txt → v4.3fe1a9cf9f56fbaf9b14.js.LICENSE.txt} +0 -0
- /package/src/legacy/tool-ui/src/main/webapp/dist/{v5.1711204aaf6c5fa01b1b.js.LICENSE.txt → v5.177f4913df46d4960d57.js.LICENSE.txt} +0 -0
|
@@ -1,277 +1,36 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export type CallbackFunction
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
? (s) => s
|
|
27
|
-
: (s) => `${s}:not([${this.#called}])`,
|
|
28
|
-
)
|
|
29
|
-
.join(',')
|
|
30
|
-
|
|
31
|
-
this.#fn = fn
|
|
32
|
-
|
|
33
|
-
const matches = selectors
|
|
34
|
-
.map((s) => s.trim())
|
|
35
|
-
.filter((s) => s.indexOf(' ') < 0 && s.indexOf(',') < 0)
|
|
36
|
-
|
|
37
|
-
if (matches.length === selectors.length) {
|
|
38
|
-
this.#matches = matches
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
addTriggerElements(triggerElements: Element[], element: Element) {
|
|
43
|
-
if (this.#root.contains(element)) {
|
|
44
|
-
if (element.matches(this.#selectors)) {
|
|
45
|
-
triggerElements.push(element)
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
for (const e of element.querySelectorAll(this.#selectors)) {
|
|
49
|
-
triggerElements.push(e)
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
trigger(elements?: E[]) {
|
|
55
|
-
if (document.readyState === 'loading') {
|
|
56
|
-
return
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
if (this.#matches && Array.isArray(elements)) {
|
|
60
|
-
for (const element of elements) {
|
|
61
|
-
if (this.#matches.some((m) => element.matches(m))) {
|
|
62
|
-
this.#callCallback(element)
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
} else {
|
|
66
|
-
for (const element of this.#root.querySelectorAll<E>(this.#selectors)) {
|
|
67
|
-
this.#callCallback(element)
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
#callCallback(element: E) {
|
|
73
|
-
if (inBlacklist(element)) {
|
|
74
|
-
return
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
if (!element.hasAttribute(this.#called)) {
|
|
78
|
-
element.setAttribute(this.#called, '')
|
|
79
|
-
|
|
80
|
-
try {
|
|
81
|
-
this.#fn(element)
|
|
82
|
-
} catch (error) {
|
|
83
|
-
log.error('Failed callback!', element, error)
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
let triggerPaused = false
|
|
90
|
-
let triggerOnResume = false
|
|
91
|
-
let triggerAll = false
|
|
92
|
-
let triggerElements: Element[] = []
|
|
93
|
-
let triggerFrame: number
|
|
94
|
-
const callbacks: Callback<Element>[] = []
|
|
95
|
-
|
|
96
|
-
function inBlacklist(node: Node) {
|
|
97
|
-
if (!(node instanceof Element)) return false
|
|
98
|
-
|
|
99
|
-
return (
|
|
100
|
-
node.closest('.CIG-wordCount') !== null ||
|
|
101
|
-
node.closest('.ContentEdit-previewDisplay') !== null ||
|
|
102
|
-
node.closest('.ContentLabel') !== null ||
|
|
103
|
-
node.closest('.PreviewFrame-typeDisplay') !== null ||
|
|
104
|
-
node.closest('.ProseMirrorToolbar') !== null ||
|
|
105
|
-
node.closest('.ProseMirror') !== null ||
|
|
106
|
-
node.closest('.ProseMirrorContainer') !== null ||
|
|
107
|
-
node.closest('.ProseMirror-fullscreen-container') !== null ||
|
|
108
|
-
node.closest('.ProseMirror-comments') !== null ||
|
|
109
|
-
node.closest('.RichTextEditor') !== null ||
|
|
110
|
-
node.closest('.WorkInProgressSaveStatus') !== null ||
|
|
111
|
-
node.closest('#aria-live-container') !== null ||
|
|
112
|
-
node.closest('.widget-urlsAutomatic') !== null
|
|
113
|
-
)
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
const every = Array.prototype.every
|
|
117
|
-
const isText = (node: Node) => node.nodeType === Node.TEXT_NODE
|
|
118
|
-
|
|
119
|
-
function triggerCallbacks(mutations?: MutationRecord[]) {
|
|
120
|
-
if (triggerPaused) {
|
|
121
|
-
triggerOnResume = true
|
|
122
|
-
return
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
const checkMutations = Array.isArray(mutations)
|
|
126
|
-
const validMutations = []
|
|
127
|
-
|
|
128
|
-
if (checkMutations) {
|
|
129
|
-
for (const mutation of mutations) {
|
|
130
|
-
const target = mutation.target
|
|
131
|
-
|
|
132
|
-
if (inBlacklist(target)) {
|
|
133
|
-
continue
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
switch (mutation.type) {
|
|
137
|
-
case 'attributes':
|
|
138
|
-
if (
|
|
139
|
-
mutation.oldValue !==
|
|
140
|
-
(target as Element).getAttribute(mutation.attributeName as string)
|
|
141
|
-
) {
|
|
142
|
-
validMutations.push(mutation)
|
|
143
|
-
}
|
|
144
|
-
break
|
|
145
|
-
case 'childList':
|
|
146
|
-
if (
|
|
147
|
-
!every.call(mutation.addedNodes, isText) ||
|
|
148
|
-
!every.call(mutation.removedNodes, isText)
|
|
149
|
-
) {
|
|
150
|
-
validMutations.push(mutation)
|
|
151
|
-
}
|
|
152
|
-
break
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
if (validMutations.length === 0) {
|
|
157
|
-
return
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
if (validMutations.length > 500) {
|
|
162
|
-
triggerAll = true
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
if (!triggerAll) {
|
|
166
|
-
if (checkMutations) {
|
|
167
|
-
for (const mutation of validMutations) {
|
|
168
|
-
const element = mutation.target as Element
|
|
169
|
-
|
|
170
|
-
switch (mutation.type) {
|
|
171
|
-
case 'attributes':
|
|
172
|
-
triggerElements.push(element)
|
|
173
|
-
break
|
|
174
|
-
case 'childList':
|
|
175
|
-
for (const callback of callbacks) {
|
|
176
|
-
callback.addTriggerElements(triggerElements, element)
|
|
177
|
-
}
|
|
178
|
-
break
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
} else {
|
|
182
|
-
triggerAll = true
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
if ((triggerAll || triggerElements.length > 0) && !triggerFrame) {
|
|
187
|
-
triggerFrame = window.requestAnimationFrame(() => {
|
|
188
|
-
const elements = triggerAll ? undefined : triggerElements
|
|
189
|
-
triggerAll = false
|
|
190
|
-
triggerElements = []
|
|
191
|
-
triggerFrame = 0
|
|
192
|
-
|
|
193
|
-
callbacks.forEach((callback) => callback.trigger(elements))
|
|
194
|
-
})
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
function initialize() {
|
|
199
|
-
document.documentElement.hidden = false
|
|
200
|
-
triggerCallbacks()
|
|
201
|
-
|
|
202
|
-
new MutationObserver(triggerCallbacks).observe(document, {
|
|
203
|
-
attributes: true,
|
|
204
|
-
attributeFilter: [
|
|
205
|
-
'class',
|
|
206
|
-
'data-bsp-autosubmit',
|
|
207
|
-
'data-chart-type',
|
|
208
|
-
'data-code-type',
|
|
209
|
-
'data-internal-name',
|
|
210
|
-
'data-tab',
|
|
211
|
-
'name',
|
|
212
|
-
'rel',
|
|
213
|
-
'target',
|
|
214
|
-
],
|
|
215
|
-
attributeOldValue: true,
|
|
216
|
-
childList: true,
|
|
217
|
-
subtree: true,
|
|
218
|
-
})
|
|
219
|
-
}
|
|
220
|
-
|
|
1
|
+
import onFind from '../../../../util/onFind'
|
|
2
|
+
|
|
3
|
+
export type { CallbackFunction, Selectors } from '../../../../util/onFind'
|
|
4
|
+
|
|
5
|
+
// CMS zones whose internal DOM churn must never trigger or receive onFind
|
|
6
|
+
// callbacks (rich text editors, live displays, and other high-frequency
|
|
7
|
+
// mutation sources).
|
|
8
|
+
onFind.ignore(
|
|
9
|
+
'.CIG-wordCount',
|
|
10
|
+
'.ContentEdit-previewDisplay',
|
|
11
|
+
'.ContentLabel',
|
|
12
|
+
'.PreviewFrame-typeDisplay',
|
|
13
|
+
'.ProseMirrorToolbar',
|
|
14
|
+
'.ProseMirror',
|
|
15
|
+
'.ProseMirrorContainer',
|
|
16
|
+
'.ProseMirror-fullscreen-container',
|
|
17
|
+
'.ProseMirror-comments',
|
|
18
|
+
'.RichTextEditor',
|
|
19
|
+
'.WorkInProgressSaveStatus',
|
|
20
|
+
'#aria-live-container',
|
|
21
|
+
'.widget-urlsAutomatic',
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
// Hide the document until DOMContentLoaded, when the first full onFind pass
|
|
25
|
+
// is scheduled, to prevent a flash of unenhanced UI.
|
|
221
26
|
document.documentElement.hidden = true
|
|
222
27
|
|
|
223
28
|
if (document.readyState === 'loading') {
|
|
224
|
-
document.addEventListener('DOMContentLoaded',
|
|
29
|
+
document.addEventListener('DOMContentLoaded', () => {
|
|
30
|
+
document.documentElement.hidden = false
|
|
31
|
+
})
|
|
225
32
|
} else {
|
|
226
|
-
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
function onFind<E extends Element>(
|
|
230
|
-
root: ParentNode,
|
|
231
|
-
selectors: Selectors,
|
|
232
|
-
fn: CallbackFunction<E>,
|
|
233
|
-
): void
|
|
234
|
-
|
|
235
|
-
function onFind<E extends Element>(
|
|
236
|
-
selectors: Selectors,
|
|
237
|
-
fn: CallbackFunction<E>,
|
|
238
|
-
): void
|
|
239
|
-
|
|
240
|
-
function onFind<E extends Element>(
|
|
241
|
-
rootOrSelectors: ParentNode | Selectors,
|
|
242
|
-
selectorsOrFn: Selectors | CallbackFunction<E>,
|
|
243
|
-
fn?: CallbackFunction<E>,
|
|
244
|
-
): void {
|
|
245
|
-
let root: ParentNode
|
|
246
|
-
let selectors: Selectors
|
|
247
|
-
|
|
248
|
-
if (typeof fn !== 'undefined') {
|
|
249
|
-
root = rootOrSelectors as Element
|
|
250
|
-
selectors = selectorsOrFn as Selectors
|
|
251
|
-
} else {
|
|
252
|
-
root = document
|
|
253
|
-
selectors = rootOrSelectors as Selectors
|
|
254
|
-
fn = selectorsOrFn as CallbackFunction<E>
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
const callback = new Callback(root, selectors, fn)
|
|
258
|
-
callback.trigger()
|
|
259
|
-
callbacks.push(callback as Callback<Element>)
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
onFind.triggerCallbacks = triggerCallbacks
|
|
263
|
-
|
|
264
|
-
onFind.pause = () => {
|
|
265
|
-
triggerPaused = true
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
onFind.resume = () => {
|
|
269
|
-
triggerPaused = false
|
|
270
|
-
|
|
271
|
-
if (triggerOnResume) {
|
|
272
|
-
triggerOnResume = false
|
|
273
|
-
setTimeout(triggerCallbacks, 100)
|
|
274
|
-
}
|
|
33
|
+
document.documentElement.hidden = false
|
|
275
34
|
}
|
|
276
35
|
|
|
277
36
|
export default onFind
|