diff --git a/README.MD b/README.MD index e17e136..cc87d99 100644 --- a/README.MD +++ b/README.MD @@ -71,16 +71,16 @@ Just use it as a regular svelte component: ``` -#### HTML +#### HTML / Web Component Use the custom HTML element `cookie-consent-banner`: ```html - - + + +``` +#### HTML / Web Components + +```html + + + +``` \ No newline at end of file diff --git a/src/lib/Banner.svelte b/src/lib/Banner.svelte index 4e641f7..5dc5d58 100644 --- a/src/lib/Banner.svelte +++ b/src/lib/Banner.svelte @@ -15,19 +15,7 @@ cookieConfig: { attribute: 'cookie-config', type: 'Object' }, shown: { attribute: 'shown', type: 'Boolean' }, choices: { attribute: 'choices', type: 'Object' } - }, - extend: cec => { - return class extends cec { - constructor () { - super() - this.emitConsent = (name) => { - this.dispatchEvent( - new CustomEvent(name) - ) - } - } - } - } + } }} /> @@ -39,8 +27,6 @@ const dispatch = createEventDispatcher() - export let emitConsent - /** * @type {string|undefined|null} */ @@ -175,7 +161,6 @@ } if (agreed) { dispatch(t) - emitConsent(t) } }) shown = false