@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
|
@@ -2,111 +2,34 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const shared_tailwindElement_index = require('../../index-
|
|
5
|
+
const shared_tailwindElement_index = require('../../index-8c1d1d13.cjs');
|
|
6
6
|
const directive = require('../../directive-db00f5fb.cjs');
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* @license
|
|
10
10
|
* Copyright 2017 Google LLC
|
|
11
11
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
12
|
-
*/class e extends directive.i{constructor(i){if(super(i),this.
|
|
13
|
-
|
|
14
|
-
/*! @license DOMPurify
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function _isNativeReflectConstruct() {
|
|
36
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
37
|
-
if (Reflect.construct.sham) return false;
|
|
38
|
-
if (typeof Proxy === "function") return true;
|
|
39
|
-
|
|
40
|
-
try {
|
|
41
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
42
|
-
return true;
|
|
43
|
-
} catch (e) {
|
|
44
|
-
return false;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function _construct(Parent, args, Class) {
|
|
49
|
-
if (_isNativeReflectConstruct()) {
|
|
50
|
-
_construct = Reflect.construct;
|
|
51
|
-
} else {
|
|
52
|
-
_construct = function _construct(Parent, args, Class) {
|
|
53
|
-
var a = [null];
|
|
54
|
-
a.push.apply(a, args);
|
|
55
|
-
var Constructor = Function.bind.apply(Parent, a);
|
|
56
|
-
var instance = new Constructor();
|
|
57
|
-
if (Class) _setPrototypeOf(instance, Class.prototype);
|
|
58
|
-
return instance;
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
return _construct.apply(null, arguments);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
function _toConsumableArray(arr) {
|
|
66
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function _arrayWithoutHoles(arr) {
|
|
70
|
-
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
function _iterableToArray(iter) {
|
|
74
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
78
|
-
if (!o) return;
|
|
79
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
80
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
81
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
82
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
83
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
function _arrayLikeToArray(arr, len) {
|
|
87
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
88
|
-
|
|
89
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
90
|
-
|
|
91
|
-
return arr2;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
function _nonIterableSpread() {
|
|
95
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
var hasOwnProperty = Object.hasOwnProperty,
|
|
99
|
-
setPrototypeOf = Object.setPrototypeOf,
|
|
100
|
-
isFrozen = Object.isFrozen,
|
|
101
|
-
getPrototypeOf = Object.getPrototypeOf,
|
|
102
|
-
getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
103
|
-
var freeze = Object.freeze,
|
|
104
|
-
seal = Object.seal,
|
|
105
|
-
create = Object.create; // eslint-disable-line import/no-mutable-exports
|
|
106
|
-
|
|
107
|
-
var _ref = typeof Reflect !== 'undefined' && Reflect,
|
|
108
|
-
apply = _ref.apply,
|
|
109
|
-
construct = _ref.construct;
|
|
12
|
+
*/class e extends directive.i{constructor(i){if(super(i),this.et=shared_tailwindElement_index.A,i.type!==directive.t.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(r){if(r===shared_tailwindElement_index.A||null==r)return this.ft=void 0,this.et=r;if(r===shared_tailwindElement_index.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=directive.e$2(e);
|
|
13
|
+
|
|
14
|
+
/*! @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 */
|
|
15
|
+
|
|
16
|
+
const {
|
|
17
|
+
entries,
|
|
18
|
+
setPrototypeOf,
|
|
19
|
+
isFrozen,
|
|
20
|
+
getPrototypeOf,
|
|
21
|
+
getOwnPropertyDescriptor
|
|
22
|
+
} = Object;
|
|
23
|
+
let {
|
|
24
|
+
freeze,
|
|
25
|
+
seal,
|
|
26
|
+
create
|
|
27
|
+
} = Object; // eslint-disable-line import/no-mutable-exports
|
|
28
|
+
|
|
29
|
+
let {
|
|
30
|
+
apply,
|
|
31
|
+
construct
|
|
32
|
+
} = typeof Reflect !== 'undefined' && Reflect;
|
|
110
33
|
|
|
111
34
|
if (!apply) {
|
|
112
35
|
apply = function apply(fun, thisValue, args) {
|
|
@@ -128,21 +51,21 @@ if (!seal) {
|
|
|
128
51
|
|
|
129
52
|
if (!construct) {
|
|
130
53
|
construct = function construct(Func, args) {
|
|
131
|
-
return
|
|
54
|
+
return new Func(...args);
|
|
132
55
|
};
|
|
133
56
|
}
|
|
134
57
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
58
|
+
const arrayForEach = unapply(Array.prototype.forEach);
|
|
59
|
+
const arrayPop = unapply(Array.prototype.pop);
|
|
60
|
+
const arrayPush = unapply(Array.prototype.push);
|
|
61
|
+
const stringToLowerCase = unapply(String.prototype.toLowerCase);
|
|
62
|
+
const stringToString = unapply(String.prototype.toString);
|
|
63
|
+
const stringMatch = unapply(String.prototype.match);
|
|
64
|
+
const stringReplace = unapply(String.prototype.replace);
|
|
65
|
+
const stringIndexOf = unapply(String.prototype.indexOf);
|
|
66
|
+
const stringTrim = unapply(String.prototype.trim);
|
|
67
|
+
const regExpTest = unapply(RegExp.prototype.test);
|
|
68
|
+
const typeErrorCreate = unconstruct(TypeError);
|
|
146
69
|
function unapply(func) {
|
|
147
70
|
return function (thisArg) {
|
|
148
71
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
@@ -173,13 +96,13 @@ function addToSet(set, array, transformCaseFunc) {
|
|
|
173
96
|
setPrototypeOf(set, null);
|
|
174
97
|
}
|
|
175
98
|
|
|
176
|
-
|
|
99
|
+
let l = array.length;
|
|
177
100
|
|
|
178
101
|
while (l--) {
|
|
179
|
-
|
|
102
|
+
let element = array[l];
|
|
180
103
|
|
|
181
104
|
if (typeof element === 'string') {
|
|
182
|
-
|
|
105
|
+
const lcElement = transformCaseFunc(element);
|
|
183
106
|
|
|
184
107
|
if (lcElement !== element) {
|
|
185
108
|
// Config presets (e.g. tags.js, attrs.js) are immutable.
|
|
@@ -199,25 +122,20 @@ function addToSet(set, array, transformCaseFunc) {
|
|
|
199
122
|
/* Shallow clone an object */
|
|
200
123
|
|
|
201
124
|
function clone(object) {
|
|
202
|
-
|
|
203
|
-
var property;
|
|
125
|
+
const newObject = create(null);
|
|
204
126
|
|
|
205
|
-
for (property
|
|
206
|
-
|
|
207
|
-
newObject[property] = object[property];
|
|
208
|
-
}
|
|
127
|
+
for (const [property, value] of entries(object)) {
|
|
128
|
+
newObject[property] = value;
|
|
209
129
|
}
|
|
210
130
|
|
|
211
131
|
return newObject;
|
|
212
132
|
}
|
|
213
|
-
/*
|
|
214
|
-
*
|
|
215
|
-
* if the prop is function or getter and behaves
|
|
216
|
-
* accordingly. */
|
|
133
|
+
/* This method automatically checks if the prop is function
|
|
134
|
+
* or getter and behaves accordingly. */
|
|
217
135
|
|
|
218
136
|
function lookupGetter(object, prop) {
|
|
219
137
|
while (object !== null) {
|
|
220
|
-
|
|
138
|
+
const desc = getOwnPropertyDescriptor(object, prop);
|
|
221
139
|
|
|
222
140
|
if (desc) {
|
|
223
141
|
if (desc.get) {
|
|
@@ -240,44 +158,55 @@ function lookupGetter(object, prop) {
|
|
|
240
158
|
return fallbackValue;
|
|
241
159
|
}
|
|
242
160
|
|
|
243
|
-
|
|
161
|
+
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
|
|
244
162
|
|
|
245
|
-
|
|
246
|
-
|
|
163
|
+
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']);
|
|
164
|
+
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.
|
|
247
165
|
// We still need to know them so that we can do namespace
|
|
248
166
|
// checks properly in case one wants to add them to
|
|
249
167
|
// allow-list.
|
|
250
168
|
|
|
251
|
-
|
|
252
|
-
|
|
169
|
+
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']);
|
|
170
|
+
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,
|
|
253
171
|
// even those that we disallow by default.
|
|
254
172
|
|
|
255
|
-
|
|
256
|
-
|
|
173
|
+
const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);
|
|
174
|
+
const text = freeze(['#text']);
|
|
257
175
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
176
|
+
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']);
|
|
177
|
+
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']);
|
|
178
|
+
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']);
|
|
179
|
+
const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);
|
|
262
180
|
|
|
263
|
-
|
|
181
|
+
const MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode
|
|
264
182
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
183
|
+
const ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm);
|
|
184
|
+
const TMPLIT_EXPR = seal(/\${[\w\W]*}/gm);
|
|
185
|
+
const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]/); // eslint-disable-line no-useless-escape
|
|
268
186
|
|
|
269
|
-
|
|
187
|
+
const ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape
|
|
270
188
|
|
|
271
|
-
|
|
189
|
+
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
|
|
272
190
|
);
|
|
273
|
-
|
|
274
|
-
|
|
191
|
+
const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
|
|
192
|
+
const ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g // eslint-disable-line no-control-regex
|
|
275
193
|
);
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
var
|
|
279
|
-
|
|
280
|
-
|
|
194
|
+
const DOCTYPE_NAME = seal(/^html$/i);
|
|
195
|
+
|
|
196
|
+
var EXPRESSIONS = /*#__PURE__*/Object.freeze({
|
|
197
|
+
__proto__: null,
|
|
198
|
+
MUSTACHE_EXPR: MUSTACHE_EXPR,
|
|
199
|
+
ERB_EXPR: ERB_EXPR,
|
|
200
|
+
TMPLIT_EXPR: TMPLIT_EXPR,
|
|
201
|
+
DATA_ATTR: DATA_ATTR,
|
|
202
|
+
ARIA_ATTR: ARIA_ATTR,
|
|
203
|
+
IS_ALLOWED_URI: IS_ALLOWED_URI,
|
|
204
|
+
IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,
|
|
205
|
+
ATTR_WHITESPACE: ATTR_WHITESPACE,
|
|
206
|
+
DOCTYPE_NAME: DOCTYPE_NAME
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
const getGlobal = () => typeof window === 'undefined' ? null : window;
|
|
281
210
|
/**
|
|
282
211
|
* Creates a no-op policy for internal use only.
|
|
283
212
|
* Don't export this function outside this module!
|
|
@@ -288,31 +217,33 @@ var getGlobal = function getGlobal() {
|
|
|
288
217
|
*/
|
|
289
218
|
|
|
290
219
|
|
|
291
|
-
|
|
292
|
-
if (
|
|
220
|
+
const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, document) {
|
|
221
|
+
if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {
|
|
293
222
|
return null;
|
|
294
223
|
} // Allow the callers to control the unique policy name
|
|
295
224
|
// by adding a data-tt-policy-suffix to the script element with the DOMPurify.
|
|
296
225
|
// Policy creation with duplicate names throws in Trusted Types.
|
|
297
226
|
|
|
298
227
|
|
|
299
|
-
|
|
300
|
-
|
|
228
|
+
let suffix = null;
|
|
229
|
+
const ATTR_NAME = 'data-tt-policy-suffix';
|
|
301
230
|
|
|
302
231
|
if (document.currentScript && document.currentScript.hasAttribute(ATTR_NAME)) {
|
|
303
232
|
suffix = document.currentScript.getAttribute(ATTR_NAME);
|
|
304
233
|
}
|
|
305
234
|
|
|
306
|
-
|
|
235
|
+
const policyName = 'dompurify' + (suffix ? '#' + suffix : '');
|
|
307
236
|
|
|
308
237
|
try {
|
|
309
238
|
return trustedTypes.createPolicy(policyName, {
|
|
310
|
-
createHTML
|
|
239
|
+
createHTML(html) {
|
|
311
240
|
return html;
|
|
312
241
|
},
|
|
313
|
-
|
|
242
|
+
|
|
243
|
+
createScriptURL(scriptUrl) {
|
|
314
244
|
return scriptUrl;
|
|
315
245
|
}
|
|
246
|
+
|
|
316
247
|
});
|
|
317
248
|
} catch (_) {
|
|
318
249
|
// Policy creation failed (most likely another DOMPurify script has
|
|
@@ -324,18 +255,16 @@ var _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes,
|
|
|
324
255
|
};
|
|
325
256
|
|
|
326
257
|
function createDOMPurify() {
|
|
327
|
-
|
|
258
|
+
let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
|
|
328
259
|
|
|
329
|
-
|
|
330
|
-
return createDOMPurify(root);
|
|
331
|
-
};
|
|
260
|
+
const DOMPurify = root => createDOMPurify(root);
|
|
332
261
|
/**
|
|
333
262
|
* Version label, exposed for easier checks
|
|
334
263
|
* if DOMPurify is up to date or not
|
|
335
264
|
*/
|
|
336
265
|
|
|
337
266
|
|
|
338
|
-
DOMPurify.version = '
|
|
267
|
+
DOMPurify.version = '3.0.2';
|
|
339
268
|
/**
|
|
340
269
|
* Array of elements that DOMPurify removed during sanitation.
|
|
341
270
|
* Empty if nothing was removed.
|
|
@@ -350,23 +279,26 @@ function createDOMPurify() {
|
|
|
350
279
|
return DOMPurify;
|
|
351
280
|
}
|
|
352
281
|
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
282
|
+
const originalDocument = window.document;
|
|
283
|
+
let {
|
|
284
|
+
document
|
|
285
|
+
} = window;
|
|
286
|
+
const {
|
|
287
|
+
DocumentFragment,
|
|
288
|
+
HTMLTemplateElement,
|
|
289
|
+
Node,
|
|
290
|
+
Element,
|
|
291
|
+
NodeFilter,
|
|
292
|
+
NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,
|
|
293
|
+
HTMLFormElement,
|
|
294
|
+
DOMParser,
|
|
295
|
+
trustedTypes
|
|
296
|
+
} = window;
|
|
297
|
+
const ElementPrototype = Element.prototype;
|
|
298
|
+
const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');
|
|
299
|
+
const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');
|
|
300
|
+
const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');
|
|
301
|
+
const getParentNode = lookupGetter(ElementPrototype, 'parentNode'); // As per issue #47, the web-components registry is inherited by a
|
|
370
302
|
// new document created via createHTMLDocument. As per the spec
|
|
371
303
|
// (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)
|
|
372
304
|
// a new empty registry is used when creating a template contents owner
|
|
@@ -374,42 +306,43 @@ function createDOMPurify() {
|
|
|
374
306
|
// is inherited.
|
|
375
307
|
|
|
376
308
|
if (typeof HTMLTemplateElement === 'function') {
|
|
377
|
-
|
|
309
|
+
const template = document.createElement('template');
|
|
378
310
|
|
|
379
311
|
if (template.content && template.content.ownerDocument) {
|
|
380
312
|
document = template.content.ownerDocument;
|
|
381
313
|
}
|
|
382
314
|
}
|
|
383
315
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
} catch (_) {}
|
|
398
|
-
|
|
399
|
-
var hooks = {};
|
|
316
|
+
const trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, originalDocument);
|
|
317
|
+
|
|
318
|
+
const emptyHTML = trustedTypesPolicy ? trustedTypesPolicy.createHTML('') : '';
|
|
319
|
+
const {
|
|
320
|
+
implementation,
|
|
321
|
+
createNodeIterator,
|
|
322
|
+
createDocumentFragment,
|
|
323
|
+
getElementsByTagName
|
|
324
|
+
} = document;
|
|
325
|
+
const {
|
|
326
|
+
importNode
|
|
327
|
+
} = originalDocument;
|
|
328
|
+
let hooks = {};
|
|
400
329
|
/**
|
|
401
330
|
* Expose whether this browser supports running the full DOMPurify.
|
|
402
331
|
*/
|
|
403
332
|
|
|
404
|
-
DOMPurify.isSupported = typeof getParentNode === 'function' && implementation && typeof implementation.createHTMLDocument !== 'undefined'
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
333
|
+
DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && typeof implementation.createHTMLDocument !== 'undefined';
|
|
334
|
+
const {
|
|
335
|
+
MUSTACHE_EXPR,
|
|
336
|
+
ERB_EXPR,
|
|
337
|
+
TMPLIT_EXPR,
|
|
338
|
+
DATA_ATTR,
|
|
339
|
+
ARIA_ATTR,
|
|
340
|
+
IS_SCRIPT_OR_DATA,
|
|
341
|
+
ATTR_WHITESPACE
|
|
342
|
+
} = EXPRESSIONS;
|
|
343
|
+
let {
|
|
344
|
+
IS_ALLOWED_URI: IS_ALLOWED_URI$1
|
|
345
|
+
} = EXPRESSIONS;
|
|
413
346
|
/**
|
|
414
347
|
* We consider the elements and attributes below to be safe. Ideally
|
|
415
348
|
* don't add any new ones but feel free to remove unwanted ones.
|
|
@@ -417,12 +350,12 @@ function createDOMPurify() {
|
|
|
417
350
|
|
|
418
351
|
/* allowed element names */
|
|
419
352
|
|
|
420
|
-
|
|
421
|
-
|
|
353
|
+
let ALLOWED_TAGS = null;
|
|
354
|
+
const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);
|
|
422
355
|
/* Allowed attribute names */
|
|
423
356
|
|
|
424
|
-
|
|
425
|
-
|
|
357
|
+
let ALLOWED_ATTR = null;
|
|
358
|
+
const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);
|
|
426
359
|
/*
|
|
427
360
|
* Configure how DOMPUrify should handle custom elements and their attributes as well as customized built-in elements.
|
|
428
361
|
* @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)
|
|
@@ -430,7 +363,7 @@ function createDOMPurify() {
|
|
|
430
363
|
* @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.
|
|
431
364
|
*/
|
|
432
365
|
|
|
433
|
-
|
|
366
|
+
let CUSTOM_ELEMENT_HANDLING = Object.seal(Object.create(null, {
|
|
434
367
|
tagNameCheck: {
|
|
435
368
|
writable: true,
|
|
436
369
|
configurable: false,
|
|
@@ -452,53 +385,57 @@ function createDOMPurify() {
|
|
|
452
385
|
}));
|
|
453
386
|
/* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */
|
|
454
387
|
|
|
455
|
-
|
|
388
|
+
let FORBID_TAGS = null;
|
|
456
389
|
/* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */
|
|
457
390
|
|
|
458
|
-
|
|
391
|
+
let FORBID_ATTR = null;
|
|
459
392
|
/* Decide if ARIA attributes are okay */
|
|
460
393
|
|
|
461
|
-
|
|
394
|
+
let ALLOW_ARIA_ATTR = true;
|
|
462
395
|
/* Decide if custom data attributes are okay */
|
|
463
396
|
|
|
464
|
-
|
|
397
|
+
let ALLOW_DATA_ATTR = true;
|
|
465
398
|
/* Decide if unknown protocols are okay */
|
|
466
399
|
|
|
467
|
-
|
|
400
|
+
let ALLOW_UNKNOWN_PROTOCOLS = false;
|
|
401
|
+
/* Decide if self-closing tags in attributes are allowed.
|
|
402
|
+
* Usually removed due to a mXSS issue in jQuery 3.0 */
|
|
403
|
+
|
|
404
|
+
let ALLOW_SELF_CLOSE_IN_ATTR = true;
|
|
468
405
|
/* Output should be safe for common template engines.
|
|
469
406
|
* This means, DOMPurify removes data attributes, mustaches and ERB
|
|
470
407
|
*/
|
|
471
408
|
|
|
472
|
-
|
|
409
|
+
let SAFE_FOR_TEMPLATES = false;
|
|
473
410
|
/* Decide if document with <html>... should be returned */
|
|
474
411
|
|
|
475
|
-
|
|
412
|
+
let WHOLE_DOCUMENT = false;
|
|
476
413
|
/* Track whether config is already set on this instance of DOMPurify. */
|
|
477
414
|
|
|
478
|
-
|
|
415
|
+
let SET_CONFIG = false;
|
|
479
416
|
/* Decide if all elements (e.g. style, script) must be children of
|
|
480
417
|
* document.body. By default, browsers might move them to document.head */
|
|
481
418
|
|
|
482
|
-
|
|
419
|
+
let FORCE_BODY = false;
|
|
483
420
|
/* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html
|
|
484
421
|
* string (or a TrustedHTML object if Trusted Types are supported).
|
|
485
422
|
* If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead
|
|
486
423
|
*/
|
|
487
424
|
|
|
488
|
-
|
|
425
|
+
let RETURN_DOM = false;
|
|
489
426
|
/* Decide if a DOM `DocumentFragment` should be returned, instead of a html
|
|
490
427
|
* string (or a TrustedHTML object if Trusted Types are supported) */
|
|
491
428
|
|
|
492
|
-
|
|
429
|
+
let RETURN_DOM_FRAGMENT = false;
|
|
493
430
|
/* Try to return a Trusted Type object instead of a string, return a string in
|
|
494
431
|
* case Trusted Types are not supported */
|
|
495
432
|
|
|
496
|
-
|
|
433
|
+
let RETURN_TRUSTED_TYPE = false;
|
|
497
434
|
/* Output should be free from DOM clobbering attacks?
|
|
498
435
|
* This sanitizes markups named with colliding, clobberable built-in DOM APIs.
|
|
499
436
|
*/
|
|
500
437
|
|
|
501
|
-
|
|
438
|
+
let SANITIZE_DOM = true;
|
|
502
439
|
/* Achieve full DOM Clobbering protection by isolating the namespace of named
|
|
503
440
|
* properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.
|
|
504
441
|
*
|
|
@@ -513,57 +450,57 @@ function createDOMPurify() {
|
|
|
513
450
|
* with a constant string, i.e., `user-content-`
|
|
514
451
|
*/
|
|
515
452
|
|
|
516
|
-
|
|
517
|
-
|
|
453
|
+
let SANITIZE_NAMED_PROPS = false;
|
|
454
|
+
const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';
|
|
518
455
|
/* Keep element content when removing element? */
|
|
519
456
|
|
|
520
|
-
|
|
457
|
+
let KEEP_CONTENT = true;
|
|
521
458
|
/* If a `Node` is passed to sanitize(), then performs sanitization in-place instead
|
|
522
459
|
* of importing it into a new Document and returning a sanitized copy */
|
|
523
460
|
|
|
524
|
-
|
|
461
|
+
let IN_PLACE = false;
|
|
525
462
|
/* Allow usage of profiles like html, svg and mathMl */
|
|
526
463
|
|
|
527
|
-
|
|
464
|
+
let USE_PROFILES = {};
|
|
528
465
|
/* Tags to ignore content of when KEEP_CONTENT is true */
|
|
529
466
|
|
|
530
|
-
|
|
531
|
-
|
|
467
|
+
let FORBID_CONTENTS = null;
|
|
468
|
+
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']);
|
|
532
469
|
/* Tags that are safe for data: URIs */
|
|
533
470
|
|
|
534
|
-
|
|
535
|
-
|
|
471
|
+
let DATA_URI_TAGS = null;
|
|
472
|
+
const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);
|
|
536
473
|
/* Attributes safe for values like "javascript:" */
|
|
537
474
|
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
475
|
+
let URI_SAFE_ATTRIBUTES = null;
|
|
476
|
+
const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);
|
|
477
|
+
const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
|
|
478
|
+
const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
|
|
479
|
+
const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
|
|
543
480
|
/* Document namespace */
|
|
544
481
|
|
|
545
|
-
|
|
546
|
-
|
|
482
|
+
let NAMESPACE = HTML_NAMESPACE;
|
|
483
|
+
let IS_EMPTY_INPUT = false;
|
|
547
484
|
/* Allowed XHTML+XML namespaces */
|
|
548
485
|
|
|
549
|
-
|
|
550
|
-
|
|
486
|
+
let ALLOWED_NAMESPACES = null;
|
|
487
|
+
const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);
|
|
551
488
|
/* Parsing of strict XHTML documents */
|
|
552
489
|
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
490
|
+
let PARSER_MEDIA_TYPE;
|
|
491
|
+
const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];
|
|
492
|
+
const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';
|
|
493
|
+
let transformCaseFunc;
|
|
557
494
|
/* Keep a reference to config to pass to hooks */
|
|
558
495
|
|
|
559
|
-
|
|
496
|
+
let CONFIG = null;
|
|
560
497
|
/* Ideally, do not touch anything below this line */
|
|
561
498
|
|
|
562
499
|
/* ______________________________________________ */
|
|
563
500
|
|
|
564
|
-
|
|
501
|
+
const formElement = document.createElement('form');
|
|
565
502
|
|
|
566
|
-
|
|
503
|
+
const isRegexOrFunction = function isRegexOrFunction(testValue) {
|
|
567
504
|
return testValue instanceof RegExp || testValue instanceof Function;
|
|
568
505
|
};
|
|
569
506
|
/**
|
|
@@ -574,14 +511,14 @@ function createDOMPurify() {
|
|
|
574
511
|
// eslint-disable-next-line complexity
|
|
575
512
|
|
|
576
513
|
|
|
577
|
-
|
|
514
|
+
const _parseConfig = function _parseConfig(cfg) {
|
|
578
515
|
if (CONFIG && CONFIG === cfg) {
|
|
579
516
|
return;
|
|
580
517
|
}
|
|
581
518
|
/* Shield configuration object from tampering */
|
|
582
519
|
|
|
583
520
|
|
|
584
|
-
if (!cfg ||
|
|
521
|
+
if (!cfg || typeof cfg !== 'object') {
|
|
585
522
|
cfg = {};
|
|
586
523
|
}
|
|
587
524
|
/* Shield configuration object from prototype pollution */
|
|
@@ -617,6 +554,8 @@ function createDOMPurify() {
|
|
|
617
554
|
|
|
618
555
|
ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false
|
|
619
556
|
|
|
557
|
+
ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true
|
|
558
|
+
|
|
620
559
|
SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false
|
|
621
560
|
|
|
622
561
|
WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false
|
|
@@ -637,8 +576,9 @@ function createDOMPurify() {
|
|
|
637
576
|
|
|
638
577
|
IN_PLACE = cfg.IN_PLACE || false; // Default false
|
|
639
578
|
|
|
640
|
-
IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI
|
|
579
|
+
IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;
|
|
641
580
|
NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;
|
|
581
|
+
CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};
|
|
642
582
|
|
|
643
583
|
if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {
|
|
644
584
|
CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;
|
|
@@ -663,7 +603,7 @@ function createDOMPurify() {
|
|
|
663
603
|
|
|
664
604
|
|
|
665
605
|
if (USE_PROFILES) {
|
|
666
|
-
ALLOWED_TAGS = addToSet({},
|
|
606
|
+
ALLOWED_TAGS = addToSet({}, [...text]);
|
|
667
607
|
ALLOWED_ATTR = [];
|
|
668
608
|
|
|
669
609
|
if (USE_PROFILES.html === true) {
|
|
@@ -748,21 +688,21 @@ function createDOMPurify() {
|
|
|
748
688
|
CONFIG = cfg;
|
|
749
689
|
};
|
|
750
690
|
|
|
751
|
-
|
|
752
|
-
|
|
691
|
+
const MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);
|
|
692
|
+
const HTML_INTEGRATION_POINTS = addToSet({}, ['foreignobject', 'desc', 'title', 'annotation-xml']); // Certain elements are allowed in both SVG and HTML
|
|
753
693
|
// namespace. We need to specify them explicitly
|
|
754
694
|
// so that they don't get erroneously deleted from
|
|
755
695
|
// HTML namespace.
|
|
756
696
|
|
|
757
|
-
|
|
697
|
+
const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);
|
|
758
698
|
/* Keep track of all possible SVG and MathML tags
|
|
759
699
|
* so that we can perform the namespace checks
|
|
760
700
|
* correctly. */
|
|
761
701
|
|
|
762
|
-
|
|
702
|
+
const ALL_SVG_TAGS = addToSet({}, svg$1);
|
|
763
703
|
addToSet(ALL_SVG_TAGS, svgFilters);
|
|
764
704
|
addToSet(ALL_SVG_TAGS, svgDisallowed);
|
|
765
|
-
|
|
705
|
+
const ALL_MATHML_TAGS = addToSet({}, mathMl$1);
|
|
766
706
|
addToSet(ALL_MATHML_TAGS, mathMlDisallowed);
|
|
767
707
|
/**
|
|
768
708
|
*
|
|
@@ -773,8 +713,8 @@ function createDOMPurify() {
|
|
|
773
713
|
* return. Return true otherwise.
|
|
774
714
|
*/
|
|
775
715
|
|
|
776
|
-
|
|
777
|
-
|
|
716
|
+
const _checkValidNamespace = function _checkValidNamespace(element) {
|
|
717
|
+
let parent = getParentNode(element); // In JSDOM, if we're inside shadow DOM, then parentNode
|
|
778
718
|
// can be null. We just simulate parent in this case.
|
|
779
719
|
|
|
780
720
|
if (!parent || !parent.tagName) {
|
|
@@ -784,8 +724,8 @@ function createDOMPurify() {
|
|
|
784
724
|
};
|
|
785
725
|
}
|
|
786
726
|
|
|
787
|
-
|
|
788
|
-
|
|
727
|
+
const tagName = stringToLowerCase(element.tagName);
|
|
728
|
+
const parentTagName = stringToLowerCase(parent.tagName);
|
|
789
729
|
|
|
790
730
|
if (!ALLOWED_NAMESPACES[element.namespaceURI]) {
|
|
791
731
|
return false;
|
|
@@ -865,7 +805,7 @@ function createDOMPurify() {
|
|
|
865
805
|
*/
|
|
866
806
|
|
|
867
807
|
|
|
868
|
-
|
|
808
|
+
const _forceRemove = function _forceRemove(node) {
|
|
869
809
|
arrayPush(DOMPurify.removed, {
|
|
870
810
|
element: node
|
|
871
811
|
});
|
|
@@ -874,11 +814,7 @@ function createDOMPurify() {
|
|
|
874
814
|
// eslint-disable-next-line unicorn/prefer-dom-node-remove
|
|
875
815
|
node.parentNode.removeChild(node);
|
|
876
816
|
} catch (_) {
|
|
877
|
-
|
|
878
|
-
node.outerHTML = emptyHTML;
|
|
879
|
-
} catch (_) {
|
|
880
|
-
node.remove();
|
|
881
|
-
}
|
|
817
|
+
node.remove();
|
|
882
818
|
}
|
|
883
819
|
};
|
|
884
820
|
/**
|
|
@@ -889,7 +825,7 @@ function createDOMPurify() {
|
|
|
889
825
|
*/
|
|
890
826
|
|
|
891
827
|
|
|
892
|
-
|
|
828
|
+
const _removeAttribute = function _removeAttribute(name, node) {
|
|
893
829
|
try {
|
|
894
830
|
arrayPush(DOMPurify.removed, {
|
|
895
831
|
attribute: node.getAttributeNode(name),
|
|
@@ -924,16 +860,16 @@ function createDOMPurify() {
|
|
|
924
860
|
*/
|
|
925
861
|
|
|
926
862
|
|
|
927
|
-
|
|
863
|
+
const _initDocument = function _initDocument(dirty) {
|
|
928
864
|
/* Create a HTML document */
|
|
929
|
-
|
|
930
|
-
|
|
865
|
+
let doc;
|
|
866
|
+
let leadingWhitespace;
|
|
931
867
|
|
|
932
868
|
if (FORCE_BODY) {
|
|
933
869
|
dirty = '<remove></remove>' + dirty;
|
|
934
870
|
} else {
|
|
935
871
|
/* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */
|
|
936
|
-
|
|
872
|
+
const matches = stringMatch(dirty, /^[\r\n\t ]+/);
|
|
937
873
|
leadingWhitespace = matches && matches[0];
|
|
938
874
|
}
|
|
939
875
|
|
|
@@ -942,7 +878,7 @@ function createDOMPurify() {
|
|
|
942
878
|
dirty = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + dirty + '</body></html>';
|
|
943
879
|
}
|
|
944
880
|
|
|
945
|
-
|
|
881
|
+
const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;
|
|
946
882
|
/*
|
|
947
883
|
* Use the DOMParser API by default, fallback later if needs be
|
|
948
884
|
* DOMParser not work for svg when has multiple root element.
|
|
@@ -965,7 +901,7 @@ function createDOMPurify() {
|
|
|
965
901
|
}
|
|
966
902
|
}
|
|
967
903
|
|
|
968
|
-
|
|
904
|
+
const body = doc.body || doc.documentElement;
|
|
969
905
|
|
|
970
906
|
if (dirty && leadingWhitespace) {
|
|
971
907
|
body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);
|
|
@@ -987,7 +923,7 @@ function createDOMPurify() {
|
|
|
987
923
|
*/
|
|
988
924
|
|
|
989
925
|
|
|
990
|
-
|
|
926
|
+
const _createIterator = function _createIterator(root) {
|
|
991
927
|
return createNodeIterator.call(root.ownerDocument || root, root, // eslint-disable-next-line no-bitwise
|
|
992
928
|
NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT, null, false);
|
|
993
929
|
};
|
|
@@ -999,7 +935,7 @@ function createDOMPurify() {
|
|
|
999
935
|
*/
|
|
1000
936
|
|
|
1001
937
|
|
|
1002
|
-
|
|
938
|
+
const _isClobbered = function _isClobbered(elm) {
|
|
1003
939
|
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');
|
|
1004
940
|
};
|
|
1005
941
|
/**
|
|
@@ -1010,8 +946,8 @@ function createDOMPurify() {
|
|
|
1010
946
|
*/
|
|
1011
947
|
|
|
1012
948
|
|
|
1013
|
-
|
|
1014
|
-
return
|
|
949
|
+
const _isNode = function _isNode(object) {
|
|
950
|
+
return typeof Node === 'object' ? object instanceof Node : object && typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string';
|
|
1015
951
|
};
|
|
1016
952
|
/**
|
|
1017
953
|
* _executeHook
|
|
@@ -1023,12 +959,12 @@ function createDOMPurify() {
|
|
|
1023
959
|
*/
|
|
1024
960
|
|
|
1025
961
|
|
|
1026
|
-
|
|
962
|
+
const _executeHook = function _executeHook(entryPoint, currentNode, data) {
|
|
1027
963
|
if (!hooks[entryPoint]) {
|
|
1028
964
|
return;
|
|
1029
965
|
}
|
|
1030
966
|
|
|
1031
|
-
arrayForEach(hooks[entryPoint],
|
|
967
|
+
arrayForEach(hooks[entryPoint], hook => {
|
|
1032
968
|
hook.call(DOMPurify, currentNode, data, CONFIG);
|
|
1033
969
|
});
|
|
1034
970
|
};
|
|
@@ -1044,8 +980,8 @@ function createDOMPurify() {
|
|
|
1044
980
|
*/
|
|
1045
981
|
|
|
1046
982
|
|
|
1047
|
-
|
|
1048
|
-
|
|
983
|
+
const _sanitizeElements = function _sanitizeElements(currentNode) {
|
|
984
|
+
let content;
|
|
1049
985
|
/* Execute a hook if present */
|
|
1050
986
|
|
|
1051
987
|
_executeHook('beforeSanitizeElements', currentNode, null);
|
|
@@ -1057,22 +993,14 @@ function createDOMPurify() {
|
|
|
1057
993
|
|
|
1058
994
|
return true;
|
|
1059
995
|
}
|
|
1060
|
-
/* Check if tagname contains Unicode */
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
if (regExpTest(/[\u0080-\uFFFF]/, currentNode.nodeName)) {
|
|
1064
|
-
_forceRemove(currentNode);
|
|
1065
|
-
|
|
1066
|
-
return true;
|
|
1067
|
-
}
|
|
1068
996
|
/* Now let's check the element's type and name */
|
|
1069
997
|
|
|
1070
998
|
|
|
1071
|
-
|
|
999
|
+
const tagName = transformCaseFunc(currentNode.nodeName);
|
|
1072
1000
|
/* Execute a hook if present */
|
|
1073
1001
|
|
|
1074
1002
|
_executeHook('uponSanitizeElement', currentNode, {
|
|
1075
|
-
tagName
|
|
1003
|
+
tagName,
|
|
1076
1004
|
allowedTags: ALLOWED_TAGS
|
|
1077
1005
|
});
|
|
1078
1006
|
/* Detect mXSS attempts abusing namespace confusion */
|
|
@@ -1083,14 +1011,6 @@ function createDOMPurify() {
|
|
|
1083
1011
|
|
|
1084
1012
|
return true;
|
|
1085
1013
|
}
|
|
1086
|
-
/* Mitigate a problem with templates inside select */
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
if (tagName === 'select' && regExpTest(/<template/i, currentNode.innerHTML)) {
|
|
1090
|
-
_forceRemove(currentNode);
|
|
1091
|
-
|
|
1092
|
-
return true;
|
|
1093
|
-
}
|
|
1094
1014
|
/* Remove element if anything forbids its presence */
|
|
1095
1015
|
|
|
1096
1016
|
|
|
@@ -1104,13 +1024,13 @@ function createDOMPurify() {
|
|
|
1104
1024
|
|
|
1105
1025
|
|
|
1106
1026
|
if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
|
|
1107
|
-
|
|
1108
|
-
|
|
1027
|
+
const parentNode = getParentNode(currentNode) || currentNode.parentNode;
|
|
1028
|
+
const childNodes = getChildNodes(currentNode) || currentNode.childNodes;
|
|
1109
1029
|
|
|
1110
1030
|
if (childNodes && parentNode) {
|
|
1111
|
-
|
|
1031
|
+
const childCount = childNodes.length;
|
|
1112
1032
|
|
|
1113
|
-
for (
|
|
1033
|
+
for (let i = childCount - 1; i >= 0; --i) {
|
|
1114
1034
|
parentNode.insertBefore(cloneNode(childNodes[i], true), getNextSibling(currentNode));
|
|
1115
1035
|
}
|
|
1116
1036
|
}
|
|
@@ -1128,6 +1048,8 @@ function createDOMPurify() {
|
|
|
1128
1048
|
|
|
1129
1049
|
return true;
|
|
1130
1050
|
}
|
|
1051
|
+
/* Make sure that older browsers don't get noscript mXSS */
|
|
1052
|
+
|
|
1131
1053
|
|
|
1132
1054
|
if ((tagName === 'noscript' || tagName === 'noembed') && regExpTest(/<\/no(script|embed)/i, currentNode.innerHTML)) {
|
|
1133
1055
|
_forceRemove(currentNode);
|
|
@@ -1140,9 +1062,9 @@ function createDOMPurify() {
|
|
|
1140
1062
|
if (SAFE_FOR_TEMPLATES && currentNode.nodeType === 3) {
|
|
1141
1063
|
/* Get the element's text content */
|
|
1142
1064
|
content = currentNode.textContent;
|
|
1143
|
-
content = stringReplace(content, MUSTACHE_EXPR
|
|
1144
|
-
content = stringReplace(content, ERB_EXPR
|
|
1145
|
-
content = stringReplace(content, TMPLIT_EXPR
|
|
1065
|
+
content = stringReplace(content, MUSTACHE_EXPR, ' ');
|
|
1066
|
+
content = stringReplace(content, ERB_EXPR, ' ');
|
|
1067
|
+
content = stringReplace(content, TMPLIT_EXPR, ' ');
|
|
1146
1068
|
|
|
1147
1069
|
if (currentNode.textContent !== content) {
|
|
1148
1070
|
arrayPush(DOMPurify.removed, {
|
|
@@ -1169,7 +1091,7 @@ function createDOMPurify() {
|
|
|
1169
1091
|
// eslint-disable-next-line complexity
|
|
1170
1092
|
|
|
1171
1093
|
|
|
1172
|
-
|
|
1094
|
+
const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {
|
|
1173
1095
|
/* Make sure attribute cannot clobber */
|
|
1174
1096
|
if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {
|
|
1175
1097
|
return false;
|
|
@@ -1180,7 +1102,7 @@ function createDOMPurify() {
|
|
|
1180
1102
|
We don't need to check the value; it's always URI safe. */
|
|
1181
1103
|
|
|
1182
1104
|
|
|
1183
|
-
if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR
|
|
1105
|
+
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]) {
|
|
1184
1106
|
if ( // First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
1185
1107
|
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
1186
1108
|
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
@@ -1191,7 +1113,7 @@ function createDOMPurify() {
|
|
|
1191
1113
|
}
|
|
1192
1114
|
/* Check value is safe. First, is attr inert? If so, is safe */
|
|
1193
1115
|
|
|
1194
|
-
} else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE
|
|
1116
|
+
} 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 {
|
|
1195
1117
|
return false;
|
|
1196
1118
|
}
|
|
1197
1119
|
|
|
@@ -1205,7 +1127,7 @@ function createDOMPurify() {
|
|
|
1205
1127
|
*/
|
|
1206
1128
|
|
|
1207
1129
|
|
|
1208
|
-
|
|
1130
|
+
const _basicCustomElementTest = function _basicCustomElementTest(tagName) {
|
|
1209
1131
|
return tagName.indexOf('-') > 0;
|
|
1210
1132
|
};
|
|
1211
1133
|
/**
|
|
@@ -1220,23 +1142,25 @@ function createDOMPurify() {
|
|
|
1220
1142
|
*/
|
|
1221
1143
|
|
|
1222
1144
|
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1145
|
+
const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {
|
|
1146
|
+
let attr;
|
|
1147
|
+
let value;
|
|
1148
|
+
let lcName;
|
|
1149
|
+
let l;
|
|
1228
1150
|
/* Execute a hook if present */
|
|
1229
1151
|
|
|
1230
1152
|
_executeHook('beforeSanitizeAttributes', currentNode, null);
|
|
1231
1153
|
|
|
1232
|
-
|
|
1154
|
+
const {
|
|
1155
|
+
attributes
|
|
1156
|
+
} = currentNode;
|
|
1233
1157
|
/* Check if we have attributes; if not we might have a text node */
|
|
1234
1158
|
|
|
1235
1159
|
if (!attributes) {
|
|
1236
1160
|
return;
|
|
1237
1161
|
}
|
|
1238
1162
|
|
|
1239
|
-
|
|
1163
|
+
const hookEvent = {
|
|
1240
1164
|
attrName: '',
|
|
1241
1165
|
attrValue: '',
|
|
1242
1166
|
keepAttr: true,
|
|
@@ -1247,9 +1171,10 @@ function createDOMPurify() {
|
|
|
1247
1171
|
|
|
1248
1172
|
while (l--) {
|
|
1249
1173
|
attr = attributes[l];
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1174
|
+
const {
|
|
1175
|
+
name,
|
|
1176
|
+
namespaceURI
|
|
1177
|
+
} = attr;
|
|
1253
1178
|
value = name === 'value' ? attr.value : stringTrim(attr.value);
|
|
1254
1179
|
lcName = transformCaseFunc(name);
|
|
1255
1180
|
/* Execute a hook if present */
|
|
@@ -1280,7 +1205,7 @@ function createDOMPurify() {
|
|
|
1280
1205
|
/* Work around a security issue in jQuery 3.0 */
|
|
1281
1206
|
|
|
1282
1207
|
|
|
1283
|
-
if (regExpTest(/\/>/i, value)) {
|
|
1208
|
+
if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value)) {
|
|
1284
1209
|
_removeAttribute(name, currentNode);
|
|
1285
1210
|
|
|
1286
1211
|
continue;
|
|
@@ -1289,14 +1214,14 @@ function createDOMPurify() {
|
|
|
1289
1214
|
|
|
1290
1215
|
|
|
1291
1216
|
if (SAFE_FOR_TEMPLATES) {
|
|
1292
|
-
value = stringReplace(value, MUSTACHE_EXPR
|
|
1293
|
-
value = stringReplace(value, ERB_EXPR
|
|
1294
|
-
value = stringReplace(value, TMPLIT_EXPR
|
|
1217
|
+
value = stringReplace(value, MUSTACHE_EXPR, ' ');
|
|
1218
|
+
value = stringReplace(value, ERB_EXPR, ' ');
|
|
1219
|
+
value = stringReplace(value, TMPLIT_EXPR, ' ');
|
|
1295
1220
|
}
|
|
1296
1221
|
/* Is `value` valid for this attribute? */
|
|
1297
1222
|
|
|
1298
1223
|
|
|
1299
|
-
|
|
1224
|
+
const lcTag = transformCaseFunc(currentNode.nodeName);
|
|
1300
1225
|
|
|
1301
1226
|
if (!_isValidAttribute(lcTag, lcName, value)) {
|
|
1302
1227
|
continue;
|
|
@@ -1316,7 +1241,7 @@ function createDOMPurify() {
|
|
|
1316
1241
|
/* Handle attributes that require Trusted Types */
|
|
1317
1242
|
|
|
1318
1243
|
|
|
1319
|
-
if (trustedTypesPolicy &&
|
|
1244
|
+
if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') {
|
|
1320
1245
|
if (namespaceURI) ; else {
|
|
1321
1246
|
switch (trustedTypes.getAttributeType(lcTag, lcName)) {
|
|
1322
1247
|
case 'TrustedHTML':
|
|
@@ -1355,10 +1280,10 @@ function createDOMPurify() {
|
|
|
1355
1280
|
*/
|
|
1356
1281
|
|
|
1357
1282
|
|
|
1358
|
-
|
|
1359
|
-
|
|
1283
|
+
const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {
|
|
1284
|
+
let shadowNode;
|
|
1360
1285
|
|
|
1361
|
-
|
|
1286
|
+
const shadowIterator = _createIterator(fragment);
|
|
1362
1287
|
/* Execute a hook if present */
|
|
1363
1288
|
|
|
1364
1289
|
|
|
@@ -1400,12 +1325,11 @@ function createDOMPurify() {
|
|
|
1400
1325
|
|
|
1401
1326
|
|
|
1402
1327
|
DOMPurify.sanitize = function (dirty) {
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
var returnNode;
|
|
1328
|
+
let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1329
|
+
let body;
|
|
1330
|
+
let importedNode;
|
|
1331
|
+
let currentNode;
|
|
1332
|
+
let returnNode;
|
|
1409
1333
|
/* Make sure we have a string to sanitize.
|
|
1410
1334
|
DO NOT return early, as this will return the wrong type if
|
|
1411
1335
|
the user has requested a DOM object rather than a string */
|
|
@@ -1430,20 +1354,10 @@ function createDOMPurify() {
|
|
|
1430
1354
|
}
|
|
1431
1355
|
}
|
|
1432
1356
|
}
|
|
1433
|
-
/*
|
|
1357
|
+
/* Return dirty HTML if DOMPurify cannot run */
|
|
1434
1358
|
|
|
1435
1359
|
|
|
1436
1360
|
if (!DOMPurify.isSupported) {
|
|
1437
|
-
if (_typeof(window.toStaticHTML) === 'object' || typeof window.toStaticHTML === 'function') {
|
|
1438
|
-
if (typeof dirty === 'string') {
|
|
1439
|
-
return window.toStaticHTML(dirty);
|
|
1440
|
-
}
|
|
1441
|
-
|
|
1442
|
-
if (_isNode(dirty)) {
|
|
1443
|
-
return window.toStaticHTML(dirty.outerHTML);
|
|
1444
|
-
}
|
|
1445
|
-
}
|
|
1446
|
-
|
|
1447
1361
|
return dirty;
|
|
1448
1362
|
}
|
|
1449
1363
|
/* Assign config vars */
|
|
@@ -1465,7 +1379,7 @@ function createDOMPurify() {
|
|
|
1465
1379
|
if (IN_PLACE) {
|
|
1466
1380
|
/* Do some early pre-sanitization to avoid unsafe root nodes */
|
|
1467
1381
|
if (dirty.nodeName) {
|
|
1468
|
-
|
|
1382
|
+
const tagName = transformCaseFunc(dirty.nodeName);
|
|
1469
1383
|
|
|
1470
1384
|
if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
|
|
1471
1385
|
throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');
|
|
@@ -1511,18 +1425,12 @@ function createDOMPurify() {
|
|
|
1511
1425
|
/* Get node iterator */
|
|
1512
1426
|
|
|
1513
1427
|
|
|
1514
|
-
|
|
1428
|
+
const nodeIterator = _createIterator(IN_PLACE ? dirty : body);
|
|
1515
1429
|
/* Now start iterating over the created document */
|
|
1516
1430
|
|
|
1517
1431
|
|
|
1518
1432
|
while (currentNode = nodeIterator.nextNode()) {
|
|
1519
|
-
/* Fix IE's strange behavior with manipulated textNodes #89 */
|
|
1520
|
-
if (currentNode.nodeType === 3 && currentNode === oldNode) {
|
|
1521
|
-
continue;
|
|
1522
|
-
}
|
|
1523
1433
|
/* Sanitize tags and elements */
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
1434
|
if (_sanitizeElements(currentNode)) {
|
|
1527
1435
|
continue;
|
|
1528
1436
|
}
|
|
@@ -1536,13 +1444,10 @@ function createDOMPurify() {
|
|
|
1536
1444
|
|
|
1537
1445
|
|
|
1538
1446
|
_sanitizeAttributes(currentNode);
|
|
1539
|
-
|
|
1540
|
-
oldNode = currentNode;
|
|
1541
1447
|
}
|
|
1542
|
-
|
|
1543
|
-
oldNode = null;
|
|
1544
1448
|
/* If we sanitized `dirty` in-place, return it. */
|
|
1545
1449
|
|
|
1450
|
+
|
|
1546
1451
|
if (IN_PLACE) {
|
|
1547
1452
|
return dirty;
|
|
1548
1453
|
}
|
|
@@ -1561,7 +1466,7 @@ function createDOMPurify() {
|
|
|
1561
1466
|
returnNode = body;
|
|
1562
1467
|
}
|
|
1563
1468
|
|
|
1564
|
-
if (ALLOWED_ATTR.shadowroot) {
|
|
1469
|
+
if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmod) {
|
|
1565
1470
|
/*
|
|
1566
1471
|
AdoptNode() is not used because internal state is not reset
|
|
1567
1472
|
(e.g. the past names map of a HTMLFormElement), this is safe
|
|
@@ -1575,7 +1480,7 @@ function createDOMPurify() {
|
|
|
1575
1480
|
return returnNode;
|
|
1576
1481
|
}
|
|
1577
1482
|
|
|
1578
|
-
|
|
1483
|
+
let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
|
|
1579
1484
|
/* Serialize doctype if allowed */
|
|
1580
1485
|
|
|
1581
1486
|
if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {
|
|
@@ -1585,9 +1490,9 @@ function createDOMPurify() {
|
|
|
1585
1490
|
|
|
1586
1491
|
|
|
1587
1492
|
if (SAFE_FOR_TEMPLATES) {
|
|
1588
|
-
serializedHTML = stringReplace(serializedHTML, MUSTACHE_EXPR
|
|
1589
|
-
serializedHTML = stringReplace(serializedHTML, ERB_EXPR
|
|
1590
|
-
serializedHTML = stringReplace(serializedHTML, TMPLIT_EXPR
|
|
1493
|
+
serializedHTML = stringReplace(serializedHTML, MUSTACHE_EXPR, ' ');
|
|
1494
|
+
serializedHTML = stringReplace(serializedHTML, ERB_EXPR, ' ');
|
|
1495
|
+
serializedHTML = stringReplace(serializedHTML, TMPLIT_EXPR, ' ');
|
|
1591
1496
|
}
|
|
1592
1497
|
|
|
1593
1498
|
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;
|
|
@@ -1634,8 +1539,8 @@ function createDOMPurify() {
|
|
|
1634
1539
|
_parseConfig({});
|
|
1635
1540
|
}
|
|
1636
1541
|
|
|
1637
|
-
|
|
1638
|
-
|
|
1542
|
+
const lcTag = transformCaseFunc(tag);
|
|
1543
|
+
const lcName = transformCaseFunc(attr);
|
|
1639
1544
|
return _isValidAttribute(lcTag, lcName, value);
|
|
1640
1545
|
};
|
|
1641
1546
|
/**
|
|
@@ -1723,7 +1628,7 @@ exports.LuksoSanitize = class LuksoSanitize extends shared_tailwindElement_index
|
|
|
1723
1628
|
return purify.sanitize(this.htmlContent, this.options);
|
|
1724
1629
|
}
|
|
1725
1630
|
render() {
|
|
1726
|
-
return shared_tailwindElement_index.
|
|
1631
|
+
return shared_tailwindElement_index.x`${o(this.sanitize())}`;
|
|
1727
1632
|
}
|
|
1728
1633
|
};
|
|
1729
1634
|
__decorateClass([
|