Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ feat: implement URL encoding and new cookieAttributes prop #25

Merged
merged 9 commits into from
Sep 25, 2023
30 changes: 15 additions & 15 deletions packages/cookie-consent-banner-react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,21 @@ npm i @porscheofficial/cookie-consent-banner-react --S

### Properties

| Property (React) | Default | Type | Description |
| :------------------------------------------ | :------------------------------ | :--------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
| `availableCategories` | `[]` | `CategoryItem[]` | Provide the available Categories. See Real World example |
| `cookieDomain` | `document.location.hostname` | `string` | |
| `cookieName` | `"cookies_accepted_categories"` | `string` | |
| `disableResetSiteCookiesOnConsentWithdrawn` | `false` | `boolean` | Prevent cookies from being deleted automatically if consent of the user changed. |
| `disableSlideInAnimation` | `false` | `boolean` | Disable slide-in animation of banner (See #7) |
| `headline` | `undefined` | `string` | |
| `btnLabelAcceptAndContinue` | `undefined` | `string` | |
| `btnLabelAllAndContinue` | `undefined` | `string` | |
| `btnLabelOnlyEssentialAndContinue` | `undefined` | `string` | |
| `btnLabelPersistSelectionAndContinue` | `undefined` | `string` | |
| `contentSettingsDescription` | `undefined` | `string` | |
| `handlePreferencesRestored` | `undefined` | `({ acceptedCategories, }: { acceptedCategories: string[]; }) => void` |
| `handlePreferencesUpdated` | `undefined` | `({ acceptedCategories, }: { acceptedCategories: string[]; }) => void` | |
| Property (React) | Default | Type | Description |
| :------------------------------------------ | :---------------------------------------------------------- | :--------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `availableCategories` | `[]` | `CategoryItem[]` | Provide the available Categories. See Real World example |
| `cookieAttributes` | `{path: "/",expires: 7,domain: document.location.hostname}` | [`CookieAttributes`](./src/components/cookie-consent-banner/types.ts) | Customization of the cookie attributes for the consent cookie (`expires` can either be a number of days or a `Date` object). |
| `cookieName` | `"cookies_accepted_categories"` | `string` | |
| `disableResetSiteCookiesOnConsentWithdrawn` | `false` | `boolean` | Prevent cookies from being deleted automatically if consent of the user changed. |
| `disableSlideInAnimation` | `false` | `boolean` | Disable slide-in animation of banner (See #7) |
| `headline` | `undefined` | `string` | |
| `btnLabelAcceptAndContinue` | `undefined` | `string` | |
| `btnLabelAllAndContinue` | `undefined` | `string` | |
| `btnLabelOnlyEssentialAndContinue` | `undefined` | `string` | |
| `btnLabelPersistSelectionAndContinue` | `undefined` | `string` | |
| `contentSettingsDescription` | `undefined` | `string` | |
| `handlePreferencesRestored` | `undefined` | `({ acceptedCategories, }: { acceptedCategories: string[]; }) => void` |
| `handlePreferencesUpdated` | `undefined` | `({ acceptedCategories, }: { acceptedCategories: string[]; }) => void` | |

### Events Dispatched by the Component

Expand Down
8 changes: 7 additions & 1 deletion packages/cookie-consent-banner/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@
},
"rules": {
"react/react-in-jsx-scope": "off",
"react/no-unknown-property": "off"
"react/no-unknown-property": "off",
"n/no-unpublished-import": [
"error",
{
"ignoreTypeImport": true
}
]
},
"plugins": ["eslint-plugin-html"]
}
26 changes: 13 additions & 13 deletions packages/cookie-consent-banner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,19 @@ npm i @porscheofficial/cookie-consent-banner --S

### Attributes

| Attribute (Web Component) | Default | Type | Description |
| :------------------------------------------------ | :------------------------------ | :--------------- | :------------------------------------------------------------------------------- |
| `available-categories` | `[]` | `CategoryItem[]` | Provide the available Categories. See Real World example |
| `cookie-domain` | `document.location.hostname` | `string` | |
| `cookie-name` | `"cookies_accepted_categories"` | `string` | |
| `disable-reset-site-cookies-on-consent-withdrawn` | `false` | `boolean` | Prevent cookies from being deleted automatically if consent of the user changed. |
| `disable-slide-in-animation` | `false` | `boolean` | Disable slide-in animation of banner (See #7) |
| `headline` | `undefined` | `string` | |
| `btn-label-accept-and-continue` | `undefined` | `string` | |
| `btn-label-select-all-and-continue` | `undefined` | `string` | |
| `btn-label-only-essential-and-continue` | `undefined` | `string` | |
| `btn-label-persist-selection-and-continue` | `undefined` | `string` |
| `content-settings-description` | `undefined` | `string` | |
| Attribute (Web Component) | Default | Type | Description |
| :------------------------------------------------ | :---------------------------------------------------------- | :-------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------- |
| `available-categories` | `[]` | `CategoryItem[]` | Provide the available Categories. See Real World example |
| `cookie-attributes` | `{path: "/",expires: 7,domain: document.location.hostname}` | [`CookieAttributes`](./src/components/cookie-consent-banner/types.ts) | Customization of the cookie attributes for the consent cookie (`expires` can either be a number of days or a `Date` object). |
| `cookie-name` | `"cookies_accepted_categories"` | `string` | |
| `disable-reset-site-cookies-on-consent-withdrawn` | `false` | `boolean` | Prevent cookies from being deleted automatically if consent of the user changed. |
| `disable-slide-in-animation` | `false` | `boolean` | Disable slide-in animation of banner (See #7) |
| `headline` | `undefined` | `string` | |
| `btn-label-accept-and-continue` | `undefined` | `string` | |
| `btn-label-select-all-and-continue` | `undefined` | `string` | |
| `btn-label-only-essential-and-continue` | `undefined` | `string` | |
| `btn-label-persist-selection-and-continue` | `undefined` | `string` |
| `content-settings-description` | `undefined` | `string` | |

### Events Dispatched by the Component

Expand Down
Loading
Loading