@lukso/web-components 1.17.0 → 1.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/color-palette.cjs +236 -334
- package/dist/color-palette.d.ts +1 -1
- package/dist/color-palette.d.ts.map +1 -1
- package/dist/color-palette.js +236 -334
- package/dist/components/index.cjs +2 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +2 -2
- package/dist/components/lukso-button/index.cjs +6 -6
- package/dist/components/lukso-button/index.d.ts +7 -7
- package/dist/components/lukso-button/index.d.ts.map +1 -1
- package/dist/components/lukso-button/index.js +6 -6
- package/dist/components/lukso-card/index.cjs +7 -7
- package/dist/components/lukso-card/index.d.ts +5 -5
- package/dist/components/lukso-card/index.d.ts.map +1 -1
- package/dist/components/lukso-card/index.js +7 -7
- package/dist/components/lukso-icon/icons/add-photo.d.ts +1 -1
- package/dist/components/lukso-icon/icons/add-photo.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/arrow-down-lg.d.ts +1 -1
- package/dist/components/lukso-icon/icons/arrow-down-lg.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/arrow-down-sm.d.ts +1 -1
- package/dist/components/lukso-icon/icons/arrow-down-sm.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/arrow-left-lg.d.ts +1 -1
- package/dist/components/lukso-icon/icons/arrow-left-lg.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/arrow-left-sm.d.ts +1 -1
- package/dist/components/lukso-icon/icons/arrow-left-sm.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/arrow-right-lg.d.ts +1 -1
- package/dist/components/lukso-icon/icons/arrow-right-lg.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/arrow-right-sm.d.ts +1 -1
- package/dist/components/lukso-icon/icons/arrow-right-sm.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/arrow-up-lg.d.ts +1 -1
- package/dist/components/lukso-icon/icons/arrow-up-lg.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/arrow-up-sm.d.ts +1 -1
- package/dist/components/lukso-icon/icons/arrow-up-sm.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/barbell-outline.d.ts +1 -1
- package/dist/components/lukso-icon/icons/barbell-outline.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/bulb-outline.d.ts +1 -1
- package/dist/components/lukso-icon/icons/bulb-outline.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/camera.d.ts +1 -1
- package/dist/components/lukso-icon/icons/camera.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/clipboard.d.ts +1 -1
- package/dist/components/lukso-icon/icons/clipboard.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/clock.d.ts +1 -1
- package/dist/components/lukso-icon/icons/clock.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/close-lg.d.ts +1 -1
- package/dist/components/lukso-icon/icons/close-lg.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/close-sm.d.ts +1 -1
- package/dist/components/lukso-icon/icons/close-sm.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/cloud.d.ts +1 -1
- package/dist/components/lukso-icon/icons/cloud.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/compass-outline.d.ts +1 -1
- package/dist/components/lukso-icon/icons/compass-outline.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/complete-filled-fade-in.d.ts +1 -1
- package/dist/components/lukso-icon/icons/complete-filled-fade-in.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/complete-filled.d.ts +1 -1
- package/dist/components/lukso-icon/icons/complete-filled.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/complete-outline.d.ts +1 -1
- package/dist/components/lukso-icon/icons/complete-outline.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/connect.d.ts +1 -1
- package/dist/components/lukso-icon/icons/connect.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/connections.d.ts +1 -1
- package/dist/components/lukso-icon/icons/connections.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/contract-lock.d.ts +1 -1
- package/dist/components/lukso-icon/icons/contract-lock.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/contract-signed.d.ts +1 -1
- package/dist/components/lukso-icon/icons/contract-signed.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/controller.d.ts +1 -1
- package/dist/components/lukso-icon/icons/controller.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/copy.d.ts +1 -1
- package/dist/components/lukso-icon/icons/copy.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/cross-outline.d.ts +1 -1
- package/dist/components/lukso-icon/icons/cross-outline.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/desktop-sharp.d.ts +1 -1
- package/dist/components/lukso-icon/icons/desktop-sharp.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/dots.d.ts +1 -1
- package/dist/components/lukso-icon/icons/dots.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/edit.d.ts +1 -1
- package/dist/components/lukso-icon/icons/edit.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/error.d.ts +1 -1
- package/dist/components/lukso-icon/icons/error.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/eth-logo.d.ts +1 -1
- package/dist/components/lukso-icon/icons/eth-logo.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/expand.d.ts +1 -1
- package/dist/components/lukso-icon/icons/expand.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/extension.d.ts +1 -1
- package/dist/components/lukso-icon/icons/extension.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/eye-hide.d.ts +1 -1
- package/dist/components/lukso-icon/icons/eye-hide.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/eye-show.d.ts +1 -1
- package/dist/components/lukso-icon/icons/eye-show.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/filter.d.ts +1 -1
- package/dist/components/lukso-icon/icons/filter.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/fish-outline.d.ts +1 -1
- package/dist/components/lukso-icon/icons/fish-outline.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/flip.d.ts +1 -1
- package/dist/components/lukso-icon/icons/flip.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/globe.d.ts +1 -1
- package/dist/components/lukso-icon/icons/globe.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/google-color.d.ts +1 -1
- package/dist/components/lukso-icon/icons/google-color.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/hamburger.d.ts +1 -1
- package/dist/components/lukso-icon/icons/hamburger.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/infinite.d.ts +1 -1
- package/dist/components/lukso-icon/icons/infinite.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/information.d.ts +1 -1
- package/dist/components/lukso-icon/icons/information.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/key-outline.d.ts +1 -1
- package/dist/components/lukso-icon/icons/key-outline.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/link.d.ts +1 -1
- package/dist/components/lukso-icon/icons/link.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/link1.d.ts +1 -1
- package/dist/components/lukso-icon/icons/link1.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/link2.d.ts +1 -1
- package/dist/components/lukso-icon/icons/link2.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/link3.d.ts +1 -1
- package/dist/components/lukso-icon/icons/link3.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/link4.d.ts +1 -1
- package/dist/components/lukso-icon/icons/link4.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/loading.d.ts +1 -1
- package/dist/components/lukso-icon/icons/loading.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/location.d.ts +1 -1
- package/dist/components/lukso-icon/icons/location.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/locked.d.ts +1 -1
- package/dist/components/lukso-icon/icons/locked.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/login-2.d.ts +1 -1
- package/dist/components/lukso-icon/icons/login-2.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/login-3.d.ts +1 -1
- package/dist/components/lukso-icon/icons/login-3.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/login.d.ts +1 -1
- package/dist/components/lukso-icon/icons/login.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/logo-brave.d.ts +1 -1
- package/dist/components/lukso-icon/icons/logo-brave.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/logo-chrome.d.ts +1 -1
- package/dist/components/lukso-icon/icons/logo-chrome.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/logo-edge.d.ts +1 -1
- package/dist/components/lukso-icon/icons/logo-edge.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/logo-firefox.d.ts +1 -1
- package/dist/components/lukso-icon/icons/logo-firefox.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/logo-opera.d.ts +1 -1
- package/dist/components/lukso-icon/icons/logo-opera.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/logo-safari.d.ts +1 -1
- package/dist/components/lukso-icon/icons/logo-safari.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/lyx-logo.d.ts +1 -1
- package/dist/components/lukso-icon/icons/lyx-logo.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/mail.d.ts +1 -1
- package/dist/components/lukso-icon/icons/mail.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/menu-1.d.ts +1 -1
- package/dist/components/lukso-icon/icons/menu-1.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/menu-2.d.ts +1 -1
- package/dist/components/lukso-icon/icons/menu-2.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/migrate.d.ts +1 -1
- package/dist/components/lukso-icon/icons/migrate.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/minimize.d.ts +1 -1
- package/dist/components/lukso-icon/icons/minimize.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/network.d.ts +1 -1
- package/dist/components/lukso-icon/icons/network.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/notifications.d.ts +1 -1
- package/dist/components/lukso-icon/icons/notifications.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/phone-portrait-outline.d.ts +1 -1
- package/dist/components/lukso-icon/icons/phone-portrait-outline.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/pin.d.ts +1 -1
- package/dist/components/lukso-icon/icons/pin.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/play-filled.d.ts +1 -1
- package/dist/components/lukso-icon/icons/play-filled.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/play-outline.d.ts +1 -1
- package/dist/components/lukso-icon/icons/play-outline.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/plus.d.ts +1 -1
- package/dist/components/lukso-icon/icons/plus.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/profile-add.d.ts +1 -1
- package/dist/components/lukso-icon/icons/profile-add.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/profile-export.d.ts +1 -1
- package/dist/components/lukso-icon/icons/profile-export.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/profile-import.d.ts +1 -1
- package/dist/components/lukso-icon/icons/profile-import.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/profile-recovery-2.d.ts +1 -1
- package/dist/components/lukso-icon/icons/profile-recovery-2.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/profile-recovery.d.ts +1 -1
- package/dist/components/lukso-icon/icons/profile-recovery.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/profile-restore.d.ts +1 -1
- package/dist/components/lukso-icon/icons/profile-restore.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/profile.d.ts +1 -1
- package/dist/components/lukso-icon/icons/profile.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/progress-complete.d.ts +1 -1
- package/dist/components/lukso-icon/icons/progress-complete.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/progress-indicator.d.ts +1 -1
- package/dist/components/lukso-icon/icons/progress-indicator.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/pulse-dot.d.ts +1 -1
- package/dist/components/lukso-icon/icons/pulse-dot.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/qr-code.d.ts +1 -1
- package/dist/components/lukso-icon/icons/qr-code.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/relayer.d.ts +1 -1
- package/dist/components/lukso-icon/icons/relayer.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/reload.d.ts +1 -1
- package/dist/components/lukso-icon/icons/reload.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/return-down.d.ts +1 -1
- package/dist/components/lukso-icon/icons/return-down.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/return-left.d.ts +1 -1
- package/dist/components/lukso-icon/icons/return-left.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/return-right.d.ts +1 -1
- package/dist/components/lukso-icon/icons/return-right.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/return-up.d.ts +1 -1
- package/dist/components/lukso-icon/icons/return-up.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/search.d.ts +1 -1
- package/dist/components/lukso-icon/icons/search.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/settings.d.ts +1 -1
- package/dist/components/lukso-icon/icons/settings.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/smart-contract-doc.d.ts +1 -1
- package/dist/components/lukso-icon/icons/smart-contract-doc.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/smart-contract.d.ts +1 -1
- package/dist/components/lukso-icon/icons/smart-contract.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/spinner.d.ts +1 -1
- package/dist/components/lukso-icon/icons/spinner.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/star-filled.d.ts +1 -1
- package/dist/components/lukso-icon/icons/star-filled.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/star-outline.d.ts +1 -1
- package/dist/components/lukso-icon/icons/star-outline.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/step-dot.d.ts +1 -1
- package/dist/components/lukso-icon/icons/step-dot.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/step-progress.d.ts +1 -1
- package/dist/components/lukso-icon/icons/step-progress.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/steps.d.ts +1 -1
- package/dist/components/lukso-icon/icons/steps.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/tick.d.ts +1 -1
- package/dist/components/lukso-icon/icons/tick.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/timer-outline.d.ts +1 -1
- package/dist/components/lukso-icon/icons/timer-outline.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/transaction-receive.d.ts +1 -1
- package/dist/components/lukso-icon/icons/transaction-receive.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/transaction-send.d.ts +1 -1
- package/dist/components/lukso-icon/icons/transaction-send.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/transfer.d.ts +1 -1
- package/dist/components/lukso-icon/icons/transfer.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/trash.d.ts +1 -1
- package/dist/components/lukso-icon/icons/trash.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/turn-down.d.ts +1 -1
- package/dist/components/lukso-icon/icons/turn-down.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/turn-left.d.ts +1 -1
- package/dist/components/lukso-icon/icons/turn-left.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/turn-right.d.ts +1 -1
- package/dist/components/lukso-icon/icons/turn-right.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/turn-up.d.ts +1 -1
- package/dist/components/lukso-icon/icons/turn-up.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/unlocked.d.ts +1 -1
- package/dist/components/lukso-icon/icons/unlocked.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/wallet-outline.d.ts +1 -1
- package/dist/components/lukso-icon/icons/wallet-outline.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/warning-round.d.ts +1 -1
- package/dist/components/lukso-icon/icons/warning-round.d.ts.map +1 -1
- package/dist/components/lukso-icon/icons/warning-triangle.d.ts +1 -1
- package/dist/components/lukso-icon/icons/warning-triangle.d.ts.map +1 -1
- package/dist/components/lukso-icon/index.cjs +238 -238
- package/dist/components/lukso-icon/index.d.ts +3 -3
- package/dist/components/lukso-icon/index.d.ts.map +1 -1
- package/dist/components/lukso-icon/index.js +238 -238
- package/dist/components/lukso-input/index.cjs +23 -13
- package/dist/components/lukso-input/index.d.ts +8 -6
- package/dist/components/lukso-input/index.d.ts.map +1 -1
- package/dist/components/lukso-input/index.js +23 -13
- package/dist/components/lukso-modal/index.cjs +2 -2
- package/dist/components/lukso-modal/index.d.ts +2 -2
- package/dist/components/lukso-modal/index.d.ts.map +1 -1
- package/dist/components/lukso-modal/index.js +2 -2
- package/dist/components/lukso-navbar/index.cjs +4 -4
- package/dist/components/lukso-navbar/index.d.ts +3 -3
- package/dist/components/lukso-navbar/index.d.ts.map +1 -1
- package/dist/components/lukso-navbar/index.js +4 -4
- package/dist/components/lukso-profile/index.cjs +7 -7
- package/dist/components/lukso-profile/index.d.ts +3 -3
- package/dist/components/lukso-profile/index.d.ts.map +1 -1
- package/dist/components/lukso-profile/index.js +7 -7
- package/dist/components/lukso-progress/index.cjs +4 -4
- package/dist/components/lukso-progress/index.d.ts +2 -2
- package/dist/components/lukso-progress/index.d.ts.map +1 -1
- package/dist/components/lukso-progress/index.js +4 -4
- package/dist/components/lukso-sanitize/index.cjs +271 -366
- package/dist/components/lukso-sanitize/index.d.ts +1 -1
- package/dist/components/lukso-sanitize/index.d.ts.map +1 -1
- package/dist/components/lukso-sanitize/index.js +271 -366
- package/dist/components/lukso-tag/index.cjs +4 -4
- package/dist/components/lukso-tag/index.d.ts +2 -2
- package/dist/components/lukso-tag/index.d.ts.map +1 -1
- package/dist/components/lukso-tag/index.js +4 -4
- package/dist/components/lukso-terms/index.cjs +3 -3
- package/dist/components/lukso-terms/index.d.ts +1 -1
- package/dist/components/lukso-terms/index.d.ts.map +1 -1
- package/dist/components/lukso-terms/index.js +3 -3
- package/dist/components/lukso-test/index.cjs +3 -3
- package/dist/components/lukso-test/index.d.ts +1 -1
- package/dist/components/lukso-test/index.d.ts.map +1 -1
- package/dist/components/lukso-test/index.js +3 -3
- package/dist/components/lukso-username/index.cjs +8 -8
- package/dist/components/lukso-username/index.d.ts +2 -2
- package/dist/components/lukso-username/index.d.ts.map +1 -1
- package/dist/components/lukso-username/index.js +8 -8
- package/dist/components/lukso-wizard/index.cjs +7 -7
- package/dist/components/lukso-wizard/index.d.ts +3 -3
- package/dist/components/lukso-wizard/index.d.ts.map +1 -1
- package/dist/components/lukso-wizard/index.js +7 -7
- package/dist/index-72e2de9b.js +52 -0
- package/dist/index-8c1d1d13.cjs +59 -0
- package/dist/index.cjs +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/shared/tailwind-element/index.cjs +1 -1
- package/dist/shared/tailwind-element/index.d.ts.map +1 -1
- package/dist/shared/tailwind-element/index.js +1 -1
- package/dist/style-map-0750a4f6.cjs +12 -0
- package/dist/style-map-6dc1088b.js +10 -0
- package/package.json +1 -1
- package/tools/assets/fonts/index.cjs +1 -1
- package/tools/assets/fonts/index.d.ts.map +1 -1
- package/tools/assets/images/index.cjs +1 -1
- package/tools/assets/images/index.d.ts.map +1 -1
- package/tools/assets/index.cjs +1 -1
- package/tools/assets/index.d.ts.map +1 -1
- package/tools/{color-palette-bf5780ed.cjs → color-palette-18dd9e2f.cjs} +236 -334
- package/tools/{color-palette-a34f5d09.js → color-palette-2786d7c1.js} +236 -334
- package/tools/color-palette.cjs +1 -1
- package/tools/color-palette.d.ts +1 -1
- package/tools/color-palette.d.ts.map +1 -1
- package/tools/color-palette.js +1 -1
- package/tools/copy-assets.d.ts.map +1 -1
- package/tools/hsl-color-map.d.ts.map +1 -1
- package/tools/index.cjs +1 -1
- package/tools/index.d.ts.map +1 -1
- package/tools/index.js +1 -1
- package/tools/sass/index.d.ts.map +1 -1
- package/tools/slice-address.d.ts.map +1 -1
- package/tools/styles/index.cjs +1 -1
- package/tools/styles/index.d.ts.map +1 -1
- package/dist/index-0f13d58e.cjs +0 -67
- package/dist/index-7a686142.js +0 -59
- package/dist/shared/globals.d.ts +0 -5
- package/dist/style-map-0d95bd3c.cjs +0 -12
- package/dist/style-map-9d612f4e.js +0 -10
|
@@ -1,108 +1,31 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A, b as T, a as TailwindElement, x } from '../../index-72e2de9b.js';
|
|
2
2
|
import { i, t, b as e$1, e as e$2, a as e$3 } from '../../directive-9ec64c08.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @license
|
|
6
6
|
* Copyright 2017 Google LLC
|
|
7
7
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
8
|
-
*/class e extends i{constructor(i){if(super(i),this.
|
|
9
|
-
|
|
10
|
-
/*! @license DOMPurify
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function _isNativeReflectConstruct() {
|
|
32
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
33
|
-
if (Reflect.construct.sham) return false;
|
|
34
|
-
if (typeof Proxy === "function") return true;
|
|
35
|
-
|
|
36
|
-
try {
|
|
37
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
38
|
-
return true;
|
|
39
|
-
} catch (e) {
|
|
40
|
-
return false;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function _construct(Parent, args, Class) {
|
|
45
|
-
if (_isNativeReflectConstruct()) {
|
|
46
|
-
_construct = Reflect.construct;
|
|
47
|
-
} else {
|
|
48
|
-
_construct = function _construct(Parent, args, Class) {
|
|
49
|
-
var a = [null];
|
|
50
|
-
a.push.apply(a, args);
|
|
51
|
-
var Constructor = Function.bind.apply(Parent, a);
|
|
52
|
-
var instance = new Constructor();
|
|
53
|
-
if (Class) _setPrototypeOf(instance, Class.prototype);
|
|
54
|
-
return instance;
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
return _construct.apply(null, arguments);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function _toConsumableArray(arr) {
|
|
62
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
function _arrayWithoutHoles(arr) {
|
|
66
|
-
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function _iterableToArray(iter) {
|
|
70
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
74
|
-
if (!o) return;
|
|
75
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
76
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
77
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
78
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
79
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
function _arrayLikeToArray(arr, len) {
|
|
83
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
84
|
-
|
|
85
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
86
|
-
|
|
87
|
-
return arr2;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
function _nonIterableSpread() {
|
|
91
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
var hasOwnProperty = Object.hasOwnProperty,
|
|
95
|
-
setPrototypeOf = Object.setPrototypeOf,
|
|
96
|
-
isFrozen = Object.isFrozen,
|
|
97
|
-
getPrototypeOf = Object.getPrototypeOf,
|
|
98
|
-
getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
99
|
-
var freeze = Object.freeze,
|
|
100
|
-
seal = Object.seal,
|
|
101
|
-
create = Object.create; // eslint-disable-line import/no-mutable-exports
|
|
102
|
-
|
|
103
|
-
var _ref = typeof Reflect !== 'undefined' && Reflect,
|
|
104
|
-
apply = _ref.apply,
|
|
105
|
-
construct = _ref.construct;
|
|
8
|
+
*/class e extends i{constructor(i){if(super(i),this.et=A,i.type!==t.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(r){if(r===A||null==r)return this.ft=void 0,this.et=r;if(r===T)return r;if("string"!=typeof r)throw Error(this.constructor.directiveName+"() called with a non-string value");if(r===this.et)return this.ft;this.et=r;const s=[r];return s.raw=s,this.ft={_$litType$:this.constructor.resultType,strings:s,values:[]}}}e.directiveName="unsafeHTML",e.resultType=1;const o=e$1(e);
|
|
9
|
+
|
|
10
|
+
/*! @license DOMPurify 3.0.2 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.2/LICENSE */
|
|
11
|
+
|
|
12
|
+
const {
|
|
13
|
+
entries,
|
|
14
|
+
setPrototypeOf,
|
|
15
|
+
isFrozen,
|
|
16
|
+
getPrototypeOf,
|
|
17
|
+
getOwnPropertyDescriptor
|
|
18
|
+
} = Object;
|
|
19
|
+
let {
|
|
20
|
+
freeze,
|
|
21
|
+
seal,
|
|
22
|
+
create
|
|
23
|
+
} = Object; // eslint-disable-line import/no-mutable-exports
|
|
24
|
+
|
|
25
|
+
let {
|
|
26
|
+
apply,
|
|
27
|
+
construct
|
|
28
|
+
} = typeof Reflect !== 'undefined' && Reflect;
|
|
106
29
|
|
|
107
30
|
if (!apply) {
|
|
108
31
|
apply = function apply(fun, thisValue, args) {
|
|
@@ -124,21 +47,21 @@ if (!seal) {
|
|
|
124
47
|
|
|
125
48
|
if (!construct) {
|
|
126
49
|
construct = function construct(Func, args) {
|
|
127
|
-
return
|
|
50
|
+
return new Func(...args);
|
|
128
51
|
};
|
|
129
52
|
}
|
|
130
53
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
54
|
+
const arrayForEach = unapply(Array.prototype.forEach);
|
|
55
|
+
const arrayPop = unapply(Array.prototype.pop);
|
|
56
|
+
const arrayPush = unapply(Array.prototype.push);
|
|
57
|
+
const stringToLowerCase = unapply(String.prototype.toLowerCase);
|
|
58
|
+
const stringToString = unapply(String.prototype.toString);
|
|
59
|
+
const stringMatch = unapply(String.prototype.match);
|
|
60
|
+
const stringReplace = unapply(String.prototype.replace);
|
|
61
|
+
const stringIndexOf = unapply(String.prototype.indexOf);
|
|
62
|
+
const stringTrim = unapply(String.prototype.trim);
|
|
63
|
+
const regExpTest = unapply(RegExp.prototype.test);
|
|
64
|
+
const typeErrorCreate = unconstruct(TypeError);
|
|
142
65
|
function unapply(func) {
|
|
143
66
|
return function (thisArg) {
|
|
144
67
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
@@ -169,13 +92,13 @@ function addToSet(set, array, transformCaseFunc) {
|
|
|
169
92
|
setPrototypeOf(set, null);
|
|
170
93
|
}
|
|
171
94
|
|
|
172
|
-
|
|
95
|
+
let l = array.length;
|
|
173
96
|
|
|
174
97
|
while (l--) {
|
|
175
|
-
|
|
98
|
+
let element = array[l];
|
|
176
99
|
|
|
177
100
|
if (typeof element === 'string') {
|
|
178
|
-
|
|
101
|
+
const lcElement = transformCaseFunc(element);
|
|
179
102
|
|
|
180
103
|
if (lcElement !== element) {
|
|
181
104
|
// Config presets (e.g. tags.js, attrs.js) are immutable.
|
|
@@ -195,25 +118,20 @@ function addToSet(set, array, transformCaseFunc) {
|
|
|
195
118
|
/* Shallow clone an object */
|
|
196
119
|
|
|
197
120
|
function clone(object) {
|
|
198
|
-
|
|
199
|
-
var property;
|
|
121
|
+
const newObject = create(null);
|
|
200
122
|
|
|
201
|
-
for (property
|
|
202
|
-
|
|
203
|
-
newObject[property] = object[property];
|
|
204
|
-
}
|
|
123
|
+
for (const [property, value] of entries(object)) {
|
|
124
|
+
newObject[property] = value;
|
|
205
125
|
}
|
|
206
126
|
|
|
207
127
|
return newObject;
|
|
208
128
|
}
|
|
209
|
-
/*
|
|
210
|
-
*
|
|
211
|
-
* if the prop is function or getter and behaves
|
|
212
|
-
* accordingly. */
|
|
129
|
+
/* This method automatically checks if the prop is function
|
|
130
|
+
* or getter and behaves accordingly. */
|
|
213
131
|
|
|
214
132
|
function lookupGetter(object, prop) {
|
|
215
133
|
while (object !== null) {
|
|
216
|
-
|
|
134
|
+
const desc = getOwnPropertyDescriptor(object, prop);
|
|
217
135
|
|
|
218
136
|
if (desc) {
|
|
219
137
|
if (desc.get) {
|
|
@@ -236,44 +154,55 @@ function lookupGetter(object, prop) {
|
|
|
236
154
|
return fallbackValue;
|
|
237
155
|
}
|
|
238
156
|
|
|
239
|
-
|
|
157
|
+
const html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']); // SVG
|
|
240
158
|
|
|
241
|
-
|
|
242
|
-
|
|
159
|
+
const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);
|
|
160
|
+
const svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']); // List of SVG elements that are disallowed by default.
|
|
243
161
|
// We still need to know them so that we can do namespace
|
|
244
162
|
// checks properly in case one wants to add them to
|
|
245
163
|
// allow-list.
|
|
246
164
|
|
|
247
|
-
|
|
248
|
-
|
|
165
|
+
const svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'fedropshadow', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);
|
|
166
|
+
const mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover', 'mprescripts']); // Similarly to SVG, we want to know all MathML elements,
|
|
249
167
|
// even those that we disallow by default.
|
|
250
168
|
|
|
251
|
-
|
|
252
|
-
|
|
169
|
+
const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);
|
|
170
|
+
const text = freeze(['#text']);
|
|
253
171
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
172
|
+
const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'xmlns', 'slot']);
|
|
173
|
+
const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);
|
|
174
|
+
const mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);
|
|
175
|
+
const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);
|
|
258
176
|
|
|
259
|
-
|
|
177
|
+
const MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode
|
|
260
178
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
179
|
+
const ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm);
|
|
180
|
+
const TMPLIT_EXPR = seal(/\${[\w\W]*}/gm);
|
|
181
|
+
const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]/); // eslint-disable-line no-useless-escape
|
|
264
182
|
|
|
265
|
-
|
|
183
|
+
const ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape
|
|
266
184
|
|
|
267
|
-
|
|
185
|
+
const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i // eslint-disable-line no-useless-escape
|
|
268
186
|
);
|
|
269
|
-
|
|
270
|
-
|
|
187
|
+
const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
|
|
188
|
+
const ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g // eslint-disable-line no-control-regex
|
|
271
189
|
);
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
var
|
|
275
|
-
|
|
276
|
-
|
|
190
|
+
const DOCTYPE_NAME = seal(/^html$/i);
|
|
191
|
+
|
|
192
|
+
var EXPRESSIONS = /*#__PURE__*/Object.freeze({
|
|
193
|
+
__proto__: null,
|
|
194
|
+
MUSTACHE_EXPR: MUSTACHE_EXPR,
|
|
195
|
+
ERB_EXPR: ERB_EXPR,
|
|
196
|
+
TMPLIT_EXPR: TMPLIT_EXPR,
|
|
197
|
+
DATA_ATTR: DATA_ATTR,
|
|
198
|
+
ARIA_ATTR: ARIA_ATTR,
|
|
199
|
+
IS_ALLOWED_URI: IS_ALLOWED_URI,
|
|
200
|
+
IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,
|
|
201
|
+
ATTR_WHITESPACE: ATTR_WHITESPACE,
|
|
202
|
+
DOCTYPE_NAME: DOCTYPE_NAME
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
const getGlobal = () => typeof window === 'undefined' ? null : window;
|
|
277
206
|
/**
|
|
278
207
|
* Creates a no-op policy for internal use only.
|
|
279
208
|
* Don't export this function outside this module!
|
|
@@ -284,31 +213,33 @@ var getGlobal = function getGlobal() {
|
|
|
284
213
|
*/
|
|
285
214
|
|
|
286
215
|
|
|
287
|
-
|
|
288
|
-
if (
|
|
216
|
+
const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, document) {
|
|
217
|
+
if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {
|
|
289
218
|
return null;
|
|
290
219
|
} // Allow the callers to control the unique policy name
|
|
291
220
|
// by adding a data-tt-policy-suffix to the script element with the DOMPurify.
|
|
292
221
|
// Policy creation with duplicate names throws in Trusted Types.
|
|
293
222
|
|
|
294
223
|
|
|
295
|
-
|
|
296
|
-
|
|
224
|
+
let suffix = null;
|
|
225
|
+
const ATTR_NAME = 'data-tt-policy-suffix';
|
|
297
226
|
|
|
298
227
|
if (document.currentScript && document.currentScript.hasAttribute(ATTR_NAME)) {
|
|
299
228
|
suffix = document.currentScript.getAttribute(ATTR_NAME);
|
|
300
229
|
}
|
|
301
230
|
|
|
302
|
-
|
|
231
|
+
const policyName = 'dompurify' + (suffix ? '#' + suffix : '');
|
|
303
232
|
|
|
304
233
|
try {
|
|
305
234
|
return trustedTypes.createPolicy(policyName, {
|
|
306
|
-
createHTML
|
|
235
|
+
createHTML(html) {
|
|
307
236
|
return html;
|
|
308
237
|
},
|
|
309
|
-
|
|
238
|
+
|
|
239
|
+
createScriptURL(scriptUrl) {
|
|
310
240
|
return scriptUrl;
|
|
311
241
|
}
|
|
242
|
+
|
|
312
243
|
});
|
|
313
244
|
} catch (_) {
|
|
314
245
|
// Policy creation failed (most likely another DOMPurify script has
|
|
@@ -320,18 +251,16 @@ var _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes,
|
|
|
320
251
|
};
|
|
321
252
|
|
|
322
253
|
function createDOMPurify() {
|
|
323
|
-
|
|
254
|
+
let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
|
|
324
255
|
|
|
325
|
-
|
|
326
|
-
return createDOMPurify(root);
|
|
327
|
-
};
|
|
256
|
+
const DOMPurify = root => createDOMPurify(root);
|
|
328
257
|
/**
|
|
329
258
|
* Version label, exposed for easier checks
|
|
330
259
|
* if DOMPurify is up to date or not
|
|
331
260
|
*/
|
|
332
261
|
|
|
333
262
|
|
|
334
|
-
DOMPurify.version = '
|
|
263
|
+
DOMPurify.version = '3.0.2';
|
|
335
264
|
/**
|
|
336
265
|
* Array of elements that DOMPurify removed during sanitation.
|
|
337
266
|
* Empty if nothing was removed.
|
|
@@ -346,23 +275,26 @@ function createDOMPurify() {
|
|
|
346
275
|
return DOMPurify;
|
|
347
276
|
}
|
|
348
277
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
278
|
+
const originalDocument = window.document;
|
|
279
|
+
let {
|
|
280
|
+
document
|
|
281
|
+
} = window;
|
|
282
|
+
const {
|
|
283
|
+
DocumentFragment,
|
|
284
|
+
HTMLTemplateElement,
|
|
285
|
+
Node,
|
|
286
|
+
Element,
|
|
287
|
+
NodeFilter,
|
|
288
|
+
NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,
|
|
289
|
+
HTMLFormElement,
|
|
290
|
+
DOMParser,
|
|
291
|
+
trustedTypes
|
|
292
|
+
} = window;
|
|
293
|
+
const ElementPrototype = Element.prototype;
|
|
294
|
+
const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');
|
|
295
|
+
const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');
|
|
296
|
+
const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');
|
|
297
|
+
const getParentNode = lookupGetter(ElementPrototype, 'parentNode'); // As per issue #47, the web-components registry is inherited by a
|
|
366
298
|
// new document created via createHTMLDocument. As per the spec
|
|
367
299
|
// (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)
|
|
368
300
|
// a new empty registry is used when creating a template contents owner
|
|
@@ -370,42 +302,43 @@ function createDOMPurify() {
|
|
|
370
302
|
// is inherited.
|
|
371
303
|
|
|
372
304
|
if (typeof HTMLTemplateElement === 'function') {
|
|
373
|
-
|
|
305
|
+
const template = document.createElement('template');
|
|
374
306
|
|
|
375
307
|
if (template.content && template.content.ownerDocument) {
|
|
376
308
|
document = template.content.ownerDocument;
|
|
377
309
|
}
|
|
378
310
|
}
|
|
379
311
|
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
} catch (_) {}
|
|
394
|
-
|
|
395
|
-
var hooks = {};
|
|
312
|
+
const trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, originalDocument);
|
|
313
|
+
|
|
314
|
+
const emptyHTML = trustedTypesPolicy ? trustedTypesPolicy.createHTML('') : '';
|
|
315
|
+
const {
|
|
316
|
+
implementation,
|
|
317
|
+
createNodeIterator,
|
|
318
|
+
createDocumentFragment,
|
|
319
|
+
getElementsByTagName
|
|
320
|
+
} = document;
|
|
321
|
+
const {
|
|
322
|
+
importNode
|
|
323
|
+
} = originalDocument;
|
|
324
|
+
let hooks = {};
|
|
396
325
|
/**
|
|
397
326
|
* Expose whether this browser supports running the full DOMPurify.
|
|
398
327
|
*/
|
|
399
328
|
|
|
400
|
-
DOMPurify.isSupported = typeof getParentNode === 'function' && implementation && typeof implementation.createHTMLDocument !== 'undefined'
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
329
|
+
DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && typeof implementation.createHTMLDocument !== 'undefined';
|
|
330
|
+
const {
|
|
331
|
+
MUSTACHE_EXPR,
|
|
332
|
+
ERB_EXPR,
|
|
333
|
+
TMPLIT_EXPR,
|
|
334
|
+
DATA_ATTR,
|
|
335
|
+
ARIA_ATTR,
|
|
336
|
+
IS_SCRIPT_OR_DATA,
|
|
337
|
+
ATTR_WHITESPACE
|
|
338
|
+
} = EXPRESSIONS;
|
|
339
|
+
let {
|
|
340
|
+
IS_ALLOWED_URI: IS_ALLOWED_URI$1
|
|
341
|
+
} = EXPRESSIONS;
|
|
409
342
|
/**
|
|
410
343
|
* We consider the elements and attributes below to be safe. Ideally
|
|
411
344
|
* don't add any new ones but feel free to remove unwanted ones.
|
|
@@ -413,12 +346,12 @@ function createDOMPurify() {
|
|
|
413
346
|
|
|
414
347
|
/* allowed element names */
|
|
415
348
|
|
|
416
|
-
|
|
417
|
-
|
|
349
|
+
let ALLOWED_TAGS = null;
|
|
350
|
+
const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);
|
|
418
351
|
/* Allowed attribute names */
|
|
419
352
|
|
|
420
|
-
|
|
421
|
-
|
|
353
|
+
let ALLOWED_ATTR = null;
|
|
354
|
+
const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);
|
|
422
355
|
/*
|
|
423
356
|
* Configure how DOMPUrify should handle custom elements and their attributes as well as customized built-in elements.
|
|
424
357
|
* @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)
|
|
@@ -426,7 +359,7 @@ function createDOMPurify() {
|
|
|
426
359
|
* @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.
|
|
427
360
|
*/
|
|
428
361
|
|
|
429
|
-
|
|
362
|
+
let CUSTOM_ELEMENT_HANDLING = Object.seal(Object.create(null, {
|
|
430
363
|
tagNameCheck: {
|
|
431
364
|
writable: true,
|
|
432
365
|
configurable: false,
|
|
@@ -448,53 +381,57 @@ function createDOMPurify() {
|
|
|
448
381
|
}));
|
|
449
382
|
/* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */
|
|
450
383
|
|
|
451
|
-
|
|
384
|
+
let FORBID_TAGS = null;
|
|
452
385
|
/* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */
|
|
453
386
|
|
|
454
|
-
|
|
387
|
+
let FORBID_ATTR = null;
|
|
455
388
|
/* Decide if ARIA attributes are okay */
|
|
456
389
|
|
|
457
|
-
|
|
390
|
+
let ALLOW_ARIA_ATTR = true;
|
|
458
391
|
/* Decide if custom data attributes are okay */
|
|
459
392
|
|
|
460
|
-
|
|
393
|
+
let ALLOW_DATA_ATTR = true;
|
|
461
394
|
/* Decide if unknown protocols are okay */
|
|
462
395
|
|
|
463
|
-
|
|
396
|
+
let ALLOW_UNKNOWN_PROTOCOLS = false;
|
|
397
|
+
/* Decide if self-closing tags in attributes are allowed.
|
|
398
|
+
* Usually removed due to a mXSS issue in jQuery 3.0 */
|
|
399
|
+
|
|
400
|
+
let ALLOW_SELF_CLOSE_IN_ATTR = true;
|
|
464
401
|
/* Output should be safe for common template engines.
|
|
465
402
|
* This means, DOMPurify removes data attributes, mustaches and ERB
|
|
466
403
|
*/
|
|
467
404
|
|
|
468
|
-
|
|
405
|
+
let SAFE_FOR_TEMPLATES = false;
|
|
469
406
|
/* Decide if document with <html>... should be returned */
|
|
470
407
|
|
|
471
|
-
|
|
408
|
+
let WHOLE_DOCUMENT = false;
|
|
472
409
|
/* Track whether config is already set on this instance of DOMPurify. */
|
|
473
410
|
|
|
474
|
-
|
|
411
|
+
let SET_CONFIG = false;
|
|
475
412
|
/* Decide if all elements (e.g. style, script) must be children of
|
|
476
413
|
* document.body. By default, browsers might move them to document.head */
|
|
477
414
|
|
|
478
|
-
|
|
415
|
+
let FORCE_BODY = false;
|
|
479
416
|
/* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html
|
|
480
417
|
* string (or a TrustedHTML object if Trusted Types are supported).
|
|
481
418
|
* If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead
|
|
482
419
|
*/
|
|
483
420
|
|
|
484
|
-
|
|
421
|
+
let RETURN_DOM = false;
|
|
485
422
|
/* Decide if a DOM `DocumentFragment` should be returned, instead of a html
|
|
486
423
|
* string (or a TrustedHTML object if Trusted Types are supported) */
|
|
487
424
|
|
|
488
|
-
|
|
425
|
+
let RETURN_DOM_FRAGMENT = false;
|
|
489
426
|
/* Try to return a Trusted Type object instead of a string, return a string in
|
|
490
427
|
* case Trusted Types are not supported */
|
|
491
428
|
|
|
492
|
-
|
|
429
|
+
let RETURN_TRUSTED_TYPE = false;
|
|
493
430
|
/* Output should be free from DOM clobbering attacks?
|
|
494
431
|
* This sanitizes markups named with colliding, clobberable built-in DOM APIs.
|
|
495
432
|
*/
|
|
496
433
|
|
|
497
|
-
|
|
434
|
+
let SANITIZE_DOM = true;
|
|
498
435
|
/* Achieve full DOM Clobbering protection by isolating the namespace of named
|
|
499
436
|
* properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.
|
|
500
437
|
*
|
|
@@ -509,57 +446,57 @@ function createDOMPurify() {
|
|
|
509
446
|
* with a constant string, i.e., `user-content-`
|
|
510
447
|
*/
|
|
511
448
|
|
|
512
|
-
|
|
513
|
-
|
|
449
|
+
let SANITIZE_NAMED_PROPS = false;
|
|
450
|
+
const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';
|
|
514
451
|
/* Keep element content when removing element? */
|
|
515
452
|
|
|
516
|
-
|
|
453
|
+
let KEEP_CONTENT = true;
|
|
517
454
|
/* If a `Node` is passed to sanitize(), then performs sanitization in-place instead
|
|
518
455
|
* of importing it into a new Document and returning a sanitized copy */
|
|
519
456
|
|
|
520
|
-
|
|
457
|
+
let IN_PLACE = false;
|
|
521
458
|
/* Allow usage of profiles like html, svg and mathMl */
|
|
522
459
|
|
|
523
|
-
|
|
460
|
+
let USE_PROFILES = {};
|
|
524
461
|
/* Tags to ignore content of when KEEP_CONTENT is true */
|
|
525
462
|
|
|
526
|
-
|
|
527
|
-
|
|
463
|
+
let FORBID_CONTENTS = null;
|
|
464
|
+
const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);
|
|
528
465
|
/* Tags that are safe for data: URIs */
|
|
529
466
|
|
|
530
|
-
|
|
531
|
-
|
|
467
|
+
let DATA_URI_TAGS = null;
|
|
468
|
+
const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);
|
|
532
469
|
/* Attributes safe for values like "javascript:" */
|
|
533
470
|
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
471
|
+
let URI_SAFE_ATTRIBUTES = null;
|
|
472
|
+
const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);
|
|
473
|
+
const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
|
|
474
|
+
const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
|
|
475
|
+
const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
|
|
539
476
|
/* Document namespace */
|
|
540
477
|
|
|
541
|
-
|
|
542
|
-
|
|
478
|
+
let NAMESPACE = HTML_NAMESPACE;
|
|
479
|
+
let IS_EMPTY_INPUT = false;
|
|
543
480
|
/* Allowed XHTML+XML namespaces */
|
|
544
481
|
|
|
545
|
-
|
|
546
|
-
|
|
482
|
+
let ALLOWED_NAMESPACES = null;
|
|
483
|
+
const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);
|
|
547
484
|
/* Parsing of strict XHTML documents */
|
|
548
485
|
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
486
|
+
let PARSER_MEDIA_TYPE;
|
|
487
|
+
const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];
|
|
488
|
+
const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';
|
|
489
|
+
let transformCaseFunc;
|
|
553
490
|
/* Keep a reference to config to pass to hooks */
|
|
554
491
|
|
|
555
|
-
|
|
492
|
+
let CONFIG = null;
|
|
556
493
|
/* Ideally, do not touch anything below this line */
|
|
557
494
|
|
|
558
495
|
/* ______________________________________________ */
|
|
559
496
|
|
|
560
|
-
|
|
497
|
+
const formElement = document.createElement('form');
|
|
561
498
|
|
|
562
|
-
|
|
499
|
+
const isRegexOrFunction = function isRegexOrFunction(testValue) {
|
|
563
500
|
return testValue instanceof RegExp || testValue instanceof Function;
|
|
564
501
|
};
|
|
565
502
|
/**
|
|
@@ -570,14 +507,14 @@ function createDOMPurify() {
|
|
|
570
507
|
// eslint-disable-next-line complexity
|
|
571
508
|
|
|
572
509
|
|
|
573
|
-
|
|
510
|
+
const _parseConfig = function _parseConfig(cfg) {
|
|
574
511
|
if (CONFIG && CONFIG === cfg) {
|
|
575
512
|
return;
|
|
576
513
|
}
|
|
577
514
|
/* Shield configuration object from tampering */
|
|
578
515
|
|
|
579
516
|
|
|
580
|
-
if (!cfg ||
|
|
517
|
+
if (!cfg || typeof cfg !== 'object') {
|
|
581
518
|
cfg = {};
|
|
582
519
|
}
|
|
583
520
|
/* Shield configuration object from prototype pollution */
|
|
@@ -613,6 +550,8 @@ function createDOMPurify() {
|
|
|
613
550
|
|
|
614
551
|
ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false
|
|
615
552
|
|
|
553
|
+
ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true
|
|
554
|
+
|
|
616
555
|
SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false
|
|
617
556
|
|
|
618
557
|
WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false
|
|
@@ -633,8 +572,9 @@ function createDOMPurify() {
|
|
|
633
572
|
|
|
634
573
|
IN_PLACE = cfg.IN_PLACE || false; // Default false
|
|
635
574
|
|
|
636
|
-
IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI
|
|
575
|
+
IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;
|
|
637
576
|
NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;
|
|
577
|
+
CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};
|
|
638
578
|
|
|
639
579
|
if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {
|
|
640
580
|
CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;
|
|
@@ -659,7 +599,7 @@ function createDOMPurify() {
|
|
|
659
599
|
|
|
660
600
|
|
|
661
601
|
if (USE_PROFILES) {
|
|
662
|
-
ALLOWED_TAGS = addToSet({},
|
|
602
|
+
ALLOWED_TAGS = addToSet({}, [...text]);
|
|
663
603
|
ALLOWED_ATTR = [];
|
|
664
604
|
|
|
665
605
|
if (USE_PROFILES.html === true) {
|
|
@@ -744,21 +684,21 @@ function createDOMPurify() {
|
|
|
744
684
|
CONFIG = cfg;
|
|
745
685
|
};
|
|
746
686
|
|
|
747
|
-
|
|
748
|
-
|
|
687
|
+
const MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);
|
|
688
|
+
const HTML_INTEGRATION_POINTS = addToSet({}, ['foreignobject', 'desc', 'title', 'annotation-xml']); // Certain elements are allowed in both SVG and HTML
|
|
749
689
|
// namespace. We need to specify them explicitly
|
|
750
690
|
// so that they don't get erroneously deleted from
|
|
751
691
|
// HTML namespace.
|
|
752
692
|
|
|
753
|
-
|
|
693
|
+
const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);
|
|
754
694
|
/* Keep track of all possible SVG and MathML tags
|
|
755
695
|
* so that we can perform the namespace checks
|
|
756
696
|
* correctly. */
|
|
757
697
|
|
|
758
|
-
|
|
698
|
+
const ALL_SVG_TAGS = addToSet({}, svg$1);
|
|
759
699
|
addToSet(ALL_SVG_TAGS, svgFilters);
|
|
760
700
|
addToSet(ALL_SVG_TAGS, svgDisallowed);
|
|
761
|
-
|
|
701
|
+
const ALL_MATHML_TAGS = addToSet({}, mathMl$1);
|
|
762
702
|
addToSet(ALL_MATHML_TAGS, mathMlDisallowed);
|
|
763
703
|
/**
|
|
764
704
|
*
|
|
@@ -769,8 +709,8 @@ function createDOMPurify() {
|
|
|
769
709
|
* return. Return true otherwise.
|
|
770
710
|
*/
|
|
771
711
|
|
|
772
|
-
|
|
773
|
-
|
|
712
|
+
const _checkValidNamespace = function _checkValidNamespace(element) {
|
|
713
|
+
let parent = getParentNode(element); // In JSDOM, if we're inside shadow DOM, then parentNode
|
|
774
714
|
// can be null. We just simulate parent in this case.
|
|
775
715
|
|
|
776
716
|
if (!parent || !parent.tagName) {
|
|
@@ -780,8 +720,8 @@ function createDOMPurify() {
|
|
|
780
720
|
};
|
|
781
721
|
}
|
|
782
722
|
|
|
783
|
-
|
|
784
|
-
|
|
723
|
+
const tagName = stringToLowerCase(element.tagName);
|
|
724
|
+
const parentTagName = stringToLowerCase(parent.tagName);
|
|
785
725
|
|
|
786
726
|
if (!ALLOWED_NAMESPACES[element.namespaceURI]) {
|
|
787
727
|
return false;
|
|
@@ -861,7 +801,7 @@ function createDOMPurify() {
|
|
|
861
801
|
*/
|
|
862
802
|
|
|
863
803
|
|
|
864
|
-
|
|
804
|
+
const _forceRemove = function _forceRemove(node) {
|
|
865
805
|
arrayPush(DOMPurify.removed, {
|
|
866
806
|
element: node
|
|
867
807
|
});
|
|
@@ -870,11 +810,7 @@ function createDOMPurify() {
|
|
|
870
810
|
// eslint-disable-next-line unicorn/prefer-dom-node-remove
|
|
871
811
|
node.parentNode.removeChild(node);
|
|
872
812
|
} catch (_) {
|
|
873
|
-
|
|
874
|
-
node.outerHTML = emptyHTML;
|
|
875
|
-
} catch (_) {
|
|
876
|
-
node.remove();
|
|
877
|
-
}
|
|
813
|
+
node.remove();
|
|
878
814
|
}
|
|
879
815
|
};
|
|
880
816
|
/**
|
|
@@ -885,7 +821,7 @@ function createDOMPurify() {
|
|
|
885
821
|
*/
|
|
886
822
|
|
|
887
823
|
|
|
888
|
-
|
|
824
|
+
const _removeAttribute = function _removeAttribute(name, node) {
|
|
889
825
|
try {
|
|
890
826
|
arrayPush(DOMPurify.removed, {
|
|
891
827
|
attribute: node.getAttributeNode(name),
|
|
@@ -920,16 +856,16 @@ function createDOMPurify() {
|
|
|
920
856
|
*/
|
|
921
857
|
|
|
922
858
|
|
|
923
|
-
|
|
859
|
+
const _initDocument = function _initDocument(dirty) {
|
|
924
860
|
/* Create a HTML document */
|
|
925
|
-
|
|
926
|
-
|
|
861
|
+
let doc;
|
|
862
|
+
let leadingWhitespace;
|
|
927
863
|
|
|
928
864
|
if (FORCE_BODY) {
|
|
929
865
|
dirty = '<remove></remove>' + dirty;
|
|
930
866
|
} else {
|
|
931
867
|
/* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */
|
|
932
|
-
|
|
868
|
+
const matches = stringMatch(dirty, /^[\r\n\t ]+/);
|
|
933
869
|
leadingWhitespace = matches && matches[0];
|
|
934
870
|
}
|
|
935
871
|
|
|
@@ -938,7 +874,7 @@ function createDOMPurify() {
|
|
|
938
874
|
dirty = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + dirty + '</body></html>';
|
|
939
875
|
}
|
|
940
876
|
|
|
941
|
-
|
|
877
|
+
const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;
|
|
942
878
|
/*
|
|
943
879
|
* Use the DOMParser API by default, fallback later if needs be
|
|
944
880
|
* DOMParser not work for svg when has multiple root element.
|
|
@@ -961,7 +897,7 @@ function createDOMPurify() {
|
|
|
961
897
|
}
|
|
962
898
|
}
|
|
963
899
|
|
|
964
|
-
|
|
900
|
+
const body = doc.body || doc.documentElement;
|
|
965
901
|
|
|
966
902
|
if (dirty && leadingWhitespace) {
|
|
967
903
|
body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);
|
|
@@ -983,7 +919,7 @@ function createDOMPurify() {
|
|
|
983
919
|
*/
|
|
984
920
|
|
|
985
921
|
|
|
986
|
-
|
|
922
|
+
const _createIterator = function _createIterator(root) {
|
|
987
923
|
return createNodeIterator.call(root.ownerDocument || root, root, // eslint-disable-next-line no-bitwise
|
|
988
924
|
NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT, null, false);
|
|
989
925
|
};
|
|
@@ -995,7 +931,7 @@ function createDOMPurify() {
|
|
|
995
931
|
*/
|
|
996
932
|
|
|
997
933
|
|
|
998
|
-
|
|
934
|
+
const _isClobbered = function _isClobbered(elm) {
|
|
999
935
|
return elm instanceof HTMLFormElement && (typeof elm.nodeName !== 'string' || typeof elm.textContent !== 'string' || typeof elm.removeChild !== 'function' || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== 'function' || typeof elm.setAttribute !== 'function' || typeof elm.namespaceURI !== 'string' || typeof elm.insertBefore !== 'function' || typeof elm.hasChildNodes !== 'function');
|
|
1000
936
|
};
|
|
1001
937
|
/**
|
|
@@ -1006,8 +942,8 @@ function createDOMPurify() {
|
|
|
1006
942
|
*/
|
|
1007
943
|
|
|
1008
944
|
|
|
1009
|
-
|
|
1010
|
-
return
|
|
945
|
+
const _isNode = function _isNode(object) {
|
|
946
|
+
return typeof Node === 'object' ? object instanceof Node : object && typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string';
|
|
1011
947
|
};
|
|
1012
948
|
/**
|
|
1013
949
|
* _executeHook
|
|
@@ -1019,12 +955,12 @@ function createDOMPurify() {
|
|
|
1019
955
|
*/
|
|
1020
956
|
|
|
1021
957
|
|
|
1022
|
-
|
|
958
|
+
const _executeHook = function _executeHook(entryPoint, currentNode, data) {
|
|
1023
959
|
if (!hooks[entryPoint]) {
|
|
1024
960
|
return;
|
|
1025
961
|
}
|
|
1026
962
|
|
|
1027
|
-
arrayForEach(hooks[entryPoint],
|
|
963
|
+
arrayForEach(hooks[entryPoint], hook => {
|
|
1028
964
|
hook.call(DOMPurify, currentNode, data, CONFIG);
|
|
1029
965
|
});
|
|
1030
966
|
};
|
|
@@ -1040,8 +976,8 @@ function createDOMPurify() {
|
|
|
1040
976
|
*/
|
|
1041
977
|
|
|
1042
978
|
|
|
1043
|
-
|
|
1044
|
-
|
|
979
|
+
const _sanitizeElements = function _sanitizeElements(currentNode) {
|
|
980
|
+
let content;
|
|
1045
981
|
/* Execute a hook if present */
|
|
1046
982
|
|
|
1047
983
|
_executeHook('beforeSanitizeElements', currentNode, null);
|
|
@@ -1053,22 +989,14 @@ function createDOMPurify() {
|
|
|
1053
989
|
|
|
1054
990
|
return true;
|
|
1055
991
|
}
|
|
1056
|
-
/* Check if tagname contains Unicode */
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
if (regExpTest(/[\u0080-\uFFFF]/, currentNode.nodeName)) {
|
|
1060
|
-
_forceRemove(currentNode);
|
|
1061
|
-
|
|
1062
|
-
return true;
|
|
1063
|
-
}
|
|
1064
992
|
/* Now let's check the element's type and name */
|
|
1065
993
|
|
|
1066
994
|
|
|
1067
|
-
|
|
995
|
+
const tagName = transformCaseFunc(currentNode.nodeName);
|
|
1068
996
|
/* Execute a hook if present */
|
|
1069
997
|
|
|
1070
998
|
_executeHook('uponSanitizeElement', currentNode, {
|
|
1071
|
-
tagName
|
|
999
|
+
tagName,
|
|
1072
1000
|
allowedTags: ALLOWED_TAGS
|
|
1073
1001
|
});
|
|
1074
1002
|
/* Detect mXSS attempts abusing namespace confusion */
|
|
@@ -1079,14 +1007,6 @@ function createDOMPurify() {
|
|
|
1079
1007
|
|
|
1080
1008
|
return true;
|
|
1081
1009
|
}
|
|
1082
|
-
/* Mitigate a problem with templates inside select */
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
if (tagName === 'select' && regExpTest(/<template/i, currentNode.innerHTML)) {
|
|
1086
|
-
_forceRemove(currentNode);
|
|
1087
|
-
|
|
1088
|
-
return true;
|
|
1089
|
-
}
|
|
1090
1010
|
/* Remove element if anything forbids its presence */
|
|
1091
1011
|
|
|
1092
1012
|
|
|
@@ -1100,13 +1020,13 @@ function createDOMPurify() {
|
|
|
1100
1020
|
|
|
1101
1021
|
|
|
1102
1022
|
if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
|
|
1103
|
-
|
|
1104
|
-
|
|
1023
|
+
const parentNode = getParentNode(currentNode) || currentNode.parentNode;
|
|
1024
|
+
const childNodes = getChildNodes(currentNode) || currentNode.childNodes;
|
|
1105
1025
|
|
|
1106
1026
|
if (childNodes && parentNode) {
|
|
1107
|
-
|
|
1027
|
+
const childCount = childNodes.length;
|
|
1108
1028
|
|
|
1109
|
-
for (
|
|
1029
|
+
for (let i = childCount - 1; i >= 0; --i) {
|
|
1110
1030
|
parentNode.insertBefore(cloneNode(childNodes[i], true), getNextSibling(currentNode));
|
|
1111
1031
|
}
|
|
1112
1032
|
}
|
|
@@ -1124,6 +1044,8 @@ function createDOMPurify() {
|
|
|
1124
1044
|
|
|
1125
1045
|
return true;
|
|
1126
1046
|
}
|
|
1047
|
+
/* Make sure that older browsers don't get noscript mXSS */
|
|
1048
|
+
|
|
1127
1049
|
|
|
1128
1050
|
if ((tagName === 'noscript' || tagName === 'noembed') && regExpTest(/<\/no(script|embed)/i, currentNode.innerHTML)) {
|
|
1129
1051
|
_forceRemove(currentNode);
|
|
@@ -1136,9 +1058,9 @@ function createDOMPurify() {
|
|
|
1136
1058
|
if (SAFE_FOR_TEMPLATES && currentNode.nodeType === 3) {
|
|
1137
1059
|
/* Get the element's text content */
|
|
1138
1060
|
content = currentNode.textContent;
|
|
1139
|
-
content = stringReplace(content, MUSTACHE_EXPR
|
|
1140
|
-
content = stringReplace(content, ERB_EXPR
|
|
1141
|
-
content = stringReplace(content, TMPLIT_EXPR
|
|
1061
|
+
content = stringReplace(content, MUSTACHE_EXPR, ' ');
|
|
1062
|
+
content = stringReplace(content, ERB_EXPR, ' ');
|
|
1063
|
+
content = stringReplace(content, TMPLIT_EXPR, ' ');
|
|
1142
1064
|
|
|
1143
1065
|
if (currentNode.textContent !== content) {
|
|
1144
1066
|
arrayPush(DOMPurify.removed, {
|
|
@@ -1165,7 +1087,7 @@ function createDOMPurify() {
|
|
|
1165
1087
|
// eslint-disable-next-line complexity
|
|
1166
1088
|
|
|
1167
1089
|
|
|
1168
|
-
|
|
1090
|
+
const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {
|
|
1169
1091
|
/* Make sure attribute cannot clobber */
|
|
1170
1092
|
if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {
|
|
1171
1093
|
return false;
|
|
@@ -1176,7 +1098,7 @@ function createDOMPurify() {
|
|
|
1176
1098
|
We don't need to check the value; it's always URI safe. */
|
|
1177
1099
|
|
|
1178
1100
|
|
|
1179
|
-
if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR
|
|
1101
|
+
if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {
|
|
1180
1102
|
if ( // First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
1181
1103
|
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
1182
1104
|
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
@@ -1187,7 +1109,7 @@ function createDOMPurify() {
|
|
|
1187
1109
|
}
|
|
1188
1110
|
/* Check value is safe. First, is attr inert? If so, is safe */
|
|
1189
1111
|
|
|
1190
|
-
} else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE
|
|
1112
|
+
} else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if (!value) ; else {
|
|
1191
1113
|
return false;
|
|
1192
1114
|
}
|
|
1193
1115
|
|
|
@@ -1201,7 +1123,7 @@ function createDOMPurify() {
|
|
|
1201
1123
|
*/
|
|
1202
1124
|
|
|
1203
1125
|
|
|
1204
|
-
|
|
1126
|
+
const _basicCustomElementTest = function _basicCustomElementTest(tagName) {
|
|
1205
1127
|
return tagName.indexOf('-') > 0;
|
|
1206
1128
|
};
|
|
1207
1129
|
/**
|
|
@@ -1216,23 +1138,25 @@ function createDOMPurify() {
|
|
|
1216
1138
|
*/
|
|
1217
1139
|
|
|
1218
1140
|
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1141
|
+
const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {
|
|
1142
|
+
let attr;
|
|
1143
|
+
let value;
|
|
1144
|
+
let lcName;
|
|
1145
|
+
let l;
|
|
1224
1146
|
/* Execute a hook if present */
|
|
1225
1147
|
|
|
1226
1148
|
_executeHook('beforeSanitizeAttributes', currentNode, null);
|
|
1227
1149
|
|
|
1228
|
-
|
|
1150
|
+
const {
|
|
1151
|
+
attributes
|
|
1152
|
+
} = currentNode;
|
|
1229
1153
|
/* Check if we have attributes; if not we might have a text node */
|
|
1230
1154
|
|
|
1231
1155
|
if (!attributes) {
|
|
1232
1156
|
return;
|
|
1233
1157
|
}
|
|
1234
1158
|
|
|
1235
|
-
|
|
1159
|
+
const hookEvent = {
|
|
1236
1160
|
attrName: '',
|
|
1237
1161
|
attrValue: '',
|
|
1238
1162
|
keepAttr: true,
|
|
@@ -1243,9 +1167,10 @@ function createDOMPurify() {
|
|
|
1243
1167
|
|
|
1244
1168
|
while (l--) {
|
|
1245
1169
|
attr = attributes[l];
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1170
|
+
const {
|
|
1171
|
+
name,
|
|
1172
|
+
namespaceURI
|
|
1173
|
+
} = attr;
|
|
1249
1174
|
value = name === 'value' ? attr.value : stringTrim(attr.value);
|
|
1250
1175
|
lcName = transformCaseFunc(name);
|
|
1251
1176
|
/* Execute a hook if present */
|
|
@@ -1276,7 +1201,7 @@ function createDOMPurify() {
|
|
|
1276
1201
|
/* Work around a security issue in jQuery 3.0 */
|
|
1277
1202
|
|
|
1278
1203
|
|
|
1279
|
-
if (regExpTest(/\/>/i, value)) {
|
|
1204
|
+
if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value)) {
|
|
1280
1205
|
_removeAttribute(name, currentNode);
|
|
1281
1206
|
|
|
1282
1207
|
continue;
|
|
@@ -1285,14 +1210,14 @@ function createDOMPurify() {
|
|
|
1285
1210
|
|
|
1286
1211
|
|
|
1287
1212
|
if (SAFE_FOR_TEMPLATES) {
|
|
1288
|
-
value = stringReplace(value, MUSTACHE_EXPR
|
|
1289
|
-
value = stringReplace(value, ERB_EXPR
|
|
1290
|
-
value = stringReplace(value, TMPLIT_EXPR
|
|
1213
|
+
value = stringReplace(value, MUSTACHE_EXPR, ' ');
|
|
1214
|
+
value = stringReplace(value, ERB_EXPR, ' ');
|
|
1215
|
+
value = stringReplace(value, TMPLIT_EXPR, ' ');
|
|
1291
1216
|
}
|
|
1292
1217
|
/* Is `value` valid for this attribute? */
|
|
1293
1218
|
|
|
1294
1219
|
|
|
1295
|
-
|
|
1220
|
+
const lcTag = transformCaseFunc(currentNode.nodeName);
|
|
1296
1221
|
|
|
1297
1222
|
if (!_isValidAttribute(lcTag, lcName, value)) {
|
|
1298
1223
|
continue;
|
|
@@ -1312,7 +1237,7 @@ function createDOMPurify() {
|
|
|
1312
1237
|
/* Handle attributes that require Trusted Types */
|
|
1313
1238
|
|
|
1314
1239
|
|
|
1315
|
-
if (trustedTypesPolicy &&
|
|
1240
|
+
if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') {
|
|
1316
1241
|
if (namespaceURI) ; else {
|
|
1317
1242
|
switch (trustedTypes.getAttributeType(lcTag, lcName)) {
|
|
1318
1243
|
case 'TrustedHTML':
|
|
@@ -1351,10 +1276,10 @@ function createDOMPurify() {
|
|
|
1351
1276
|
*/
|
|
1352
1277
|
|
|
1353
1278
|
|
|
1354
|
-
|
|
1355
|
-
|
|
1279
|
+
const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {
|
|
1280
|
+
let shadowNode;
|
|
1356
1281
|
|
|
1357
|
-
|
|
1282
|
+
const shadowIterator = _createIterator(fragment);
|
|
1358
1283
|
/* Execute a hook if present */
|
|
1359
1284
|
|
|
1360
1285
|
|
|
@@ -1396,12 +1321,11 @@ function createDOMPurify() {
|
|
|
1396
1321
|
|
|
1397
1322
|
|
|
1398
1323
|
DOMPurify.sanitize = function (dirty) {
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
var returnNode;
|
|
1324
|
+
let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1325
|
+
let body;
|
|
1326
|
+
let importedNode;
|
|
1327
|
+
let currentNode;
|
|
1328
|
+
let returnNode;
|
|
1405
1329
|
/* Make sure we have a string to sanitize.
|
|
1406
1330
|
DO NOT return early, as this will return the wrong type if
|
|
1407
1331
|
the user has requested a DOM object rather than a string */
|
|
@@ -1426,20 +1350,10 @@ function createDOMPurify() {
|
|
|
1426
1350
|
}
|
|
1427
1351
|
}
|
|
1428
1352
|
}
|
|
1429
|
-
/*
|
|
1353
|
+
/* Return dirty HTML if DOMPurify cannot run */
|
|
1430
1354
|
|
|
1431
1355
|
|
|
1432
1356
|
if (!DOMPurify.isSupported) {
|
|
1433
|
-
if (_typeof(window.toStaticHTML) === 'object' || typeof window.toStaticHTML === 'function') {
|
|
1434
|
-
if (typeof dirty === 'string') {
|
|
1435
|
-
return window.toStaticHTML(dirty);
|
|
1436
|
-
}
|
|
1437
|
-
|
|
1438
|
-
if (_isNode(dirty)) {
|
|
1439
|
-
return window.toStaticHTML(dirty.outerHTML);
|
|
1440
|
-
}
|
|
1441
|
-
}
|
|
1442
|
-
|
|
1443
1357
|
return dirty;
|
|
1444
1358
|
}
|
|
1445
1359
|
/* Assign config vars */
|
|
@@ -1461,7 +1375,7 @@ function createDOMPurify() {
|
|
|
1461
1375
|
if (IN_PLACE) {
|
|
1462
1376
|
/* Do some early pre-sanitization to avoid unsafe root nodes */
|
|
1463
1377
|
if (dirty.nodeName) {
|
|
1464
|
-
|
|
1378
|
+
const tagName = transformCaseFunc(dirty.nodeName);
|
|
1465
1379
|
|
|
1466
1380
|
if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
|
|
1467
1381
|
throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');
|
|
@@ -1507,18 +1421,12 @@ function createDOMPurify() {
|
|
|
1507
1421
|
/* Get node iterator */
|
|
1508
1422
|
|
|
1509
1423
|
|
|
1510
|
-
|
|
1424
|
+
const nodeIterator = _createIterator(IN_PLACE ? dirty : body);
|
|
1511
1425
|
/* Now start iterating over the created document */
|
|
1512
1426
|
|
|
1513
1427
|
|
|
1514
1428
|
while (currentNode = nodeIterator.nextNode()) {
|
|
1515
|
-
/* Fix IE's strange behavior with manipulated textNodes #89 */
|
|
1516
|
-
if (currentNode.nodeType === 3 && currentNode === oldNode) {
|
|
1517
|
-
continue;
|
|
1518
|
-
}
|
|
1519
1429
|
/* Sanitize tags and elements */
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
1430
|
if (_sanitizeElements(currentNode)) {
|
|
1523
1431
|
continue;
|
|
1524
1432
|
}
|
|
@@ -1532,13 +1440,10 @@ function createDOMPurify() {
|
|
|
1532
1440
|
|
|
1533
1441
|
|
|
1534
1442
|
_sanitizeAttributes(currentNode);
|
|
1535
|
-
|
|
1536
|
-
oldNode = currentNode;
|
|
1537
1443
|
}
|
|
1538
|
-
|
|
1539
|
-
oldNode = null;
|
|
1540
1444
|
/* If we sanitized `dirty` in-place, return it. */
|
|
1541
1445
|
|
|
1446
|
+
|
|
1542
1447
|
if (IN_PLACE) {
|
|
1543
1448
|
return dirty;
|
|
1544
1449
|
}
|
|
@@ -1557,7 +1462,7 @@ function createDOMPurify() {
|
|
|
1557
1462
|
returnNode = body;
|
|
1558
1463
|
}
|
|
1559
1464
|
|
|
1560
|
-
if (ALLOWED_ATTR.shadowroot) {
|
|
1465
|
+
if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmod) {
|
|
1561
1466
|
/*
|
|
1562
1467
|
AdoptNode() is not used because internal state is not reset
|
|
1563
1468
|
(e.g. the past names map of a HTMLFormElement), this is safe
|
|
@@ -1571,7 +1476,7 @@ function createDOMPurify() {
|
|
|
1571
1476
|
return returnNode;
|
|
1572
1477
|
}
|
|
1573
1478
|
|
|
1574
|
-
|
|
1479
|
+
let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
|
|
1575
1480
|
/* Serialize doctype if allowed */
|
|
1576
1481
|
|
|
1577
1482
|
if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {
|
|
@@ -1581,9 +1486,9 @@ function createDOMPurify() {
|
|
|
1581
1486
|
|
|
1582
1487
|
|
|
1583
1488
|
if (SAFE_FOR_TEMPLATES) {
|
|
1584
|
-
serializedHTML = stringReplace(serializedHTML, MUSTACHE_EXPR
|
|
1585
|
-
serializedHTML = stringReplace(serializedHTML, ERB_EXPR
|
|
1586
|
-
serializedHTML = stringReplace(serializedHTML, TMPLIT_EXPR
|
|
1489
|
+
serializedHTML = stringReplace(serializedHTML, MUSTACHE_EXPR, ' ');
|
|
1490
|
+
serializedHTML = stringReplace(serializedHTML, ERB_EXPR, ' ');
|
|
1491
|
+
serializedHTML = stringReplace(serializedHTML, TMPLIT_EXPR, ' ');
|
|
1587
1492
|
}
|
|
1588
1493
|
|
|
1589
1494
|
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;
|
|
@@ -1630,8 +1535,8 @@ function createDOMPurify() {
|
|
|
1630
1535
|
_parseConfig({});
|
|
1631
1536
|
}
|
|
1632
1537
|
|
|
1633
|
-
|
|
1634
|
-
|
|
1538
|
+
const lcTag = transformCaseFunc(tag);
|
|
1539
|
+
const lcName = transformCaseFunc(attr);
|
|
1635
1540
|
return _isValidAttribute(lcTag, lcName, value);
|
|
1636
1541
|
};
|
|
1637
1542
|
/**
|
|
@@ -1719,7 +1624,7 @@ let LuksoSanitize = class extends TailwindElement {
|
|
|
1719
1624
|
return purify.sanitize(this.htmlContent, this.options);
|
|
1720
1625
|
}
|
|
1721
1626
|
render() {
|
|
1722
|
-
return
|
|
1627
|
+
return x`${o(this.sanitize())}`;
|
|
1723
1628
|
}
|
|
1724
1629
|
};
|
|
1725
1630
|
__decorateClass([
|