@tebuto/react-booking-widget 1.0.0 → 1.0.2
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/CODE_OF_CONDUCT.md +128 -0
- package/README.md +49 -0
- package/SECURITY.md +5 -0
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/types.d.ts +15 -0
- package/package.json +2 -2
- package/.github/dependabot.yml +0 -13
- package/.github/workflows/branch.yaml +0 -70
- package/.github/workflows/publish.yaml +0 -43
- package/.husky/pre-commit +0 -2
- package/.vscode/extensions.json +0 -3
- package/.vscode/settings.json +0 -17
- package/biome.json +0 -66
- package/rollup.config.js +0 -33
- package/sonar-project.properties +0 -2
- package/src/components/TebutoBookingWidget.test.tsx +0 -62
- package/src/components/TebutoBookingWidget.tsx +0 -29
- package/src/components/index.ts +0 -1
- package/src/constants.ts +0 -3
- package/src/index.ts +0 -2
- package/src/types.ts +0 -6
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our
|
|
6
|
+
community a harassment-free experience for everyone, regardless of age, body
|
|
7
|
+
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
8
|
+
identity and expression, level of experience, education, socio-economic status,
|
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity
|
|
10
|
+
and orientation.
|
|
11
|
+
|
|
12
|
+
We pledge to act and interact in ways that contribute to an open, welcoming,
|
|
13
|
+
diverse, inclusive, and healthy community.
|
|
14
|
+
|
|
15
|
+
## Our Standards
|
|
16
|
+
|
|
17
|
+
Examples of behavior that contributes to a positive environment for our
|
|
18
|
+
community include:
|
|
19
|
+
|
|
20
|
+
* Demonstrating empathy and kindness toward other people
|
|
21
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
|
22
|
+
* Giving and gracefully accepting constructive feedback
|
|
23
|
+
* Accepting responsibility and apologizing to those affected by our mistakes,
|
|
24
|
+
and learning from the experience
|
|
25
|
+
* Focusing on what is best not just for us as individuals, but for the
|
|
26
|
+
overall community
|
|
27
|
+
|
|
28
|
+
Examples of unacceptable behavior include:
|
|
29
|
+
|
|
30
|
+
* The use of sexualized language or imagery, and sexual attention or
|
|
31
|
+
advances of any kind
|
|
32
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
33
|
+
* Public or private harassment
|
|
34
|
+
* Publishing others' private information, such as a physical or email
|
|
35
|
+
address, without their explicit permission
|
|
36
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
|
37
|
+
professional setting
|
|
38
|
+
|
|
39
|
+
## Enforcement Responsibilities
|
|
40
|
+
|
|
41
|
+
Community leaders are responsible for clarifying and enforcing our standards of
|
|
42
|
+
acceptable behavior and will take appropriate and fair corrective action in
|
|
43
|
+
response to any behavior that they deem inappropriate, threatening, offensive,
|
|
44
|
+
or harmful.
|
|
45
|
+
|
|
46
|
+
Community leaders have the right and responsibility to remove, edit, or reject
|
|
47
|
+
comments, commits, code, wiki edits, issues, and other contributions that are
|
|
48
|
+
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
|
49
|
+
decisions when appropriate.
|
|
50
|
+
|
|
51
|
+
## Scope
|
|
52
|
+
|
|
53
|
+
This Code of Conduct applies within all community spaces, and also applies when
|
|
54
|
+
an individual is officially representing the community in public spaces.
|
|
55
|
+
Examples of representing our community include using an official e-mail address,
|
|
56
|
+
posting via an official social media account, or acting as an appointed
|
|
57
|
+
representative at an online or offline event.
|
|
58
|
+
|
|
59
|
+
## Enforcement
|
|
60
|
+
|
|
61
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
62
|
+
reported to the community leaders responsible for enforcement by contacting
|
|
63
|
+
hello@tebuto.de.
|
|
64
|
+
All complaints will be reviewed and investigated promptly and fairly.
|
|
65
|
+
|
|
66
|
+
All community leaders are obligated to respect the privacy and security of the
|
|
67
|
+
reporter of any incident.
|
|
68
|
+
|
|
69
|
+
## Enforcement Guidelines
|
|
70
|
+
|
|
71
|
+
Community leaders will follow these Community Impact Guidelines in determining
|
|
72
|
+
the consequences for any action they deem in violation of this Code of Conduct:
|
|
73
|
+
|
|
74
|
+
### 1. Correction
|
|
75
|
+
|
|
76
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed
|
|
77
|
+
unprofessional or unwelcome in the community.
|
|
78
|
+
|
|
79
|
+
**Consequence**: A private, written warning from community leaders, providing
|
|
80
|
+
clarity around the nature of the violation and an explanation of why the
|
|
81
|
+
behavior was inappropriate. A public apology may be requested.
|
|
82
|
+
|
|
83
|
+
### 2. Warning
|
|
84
|
+
|
|
85
|
+
**Community Impact**: A violation through a single incident or series
|
|
86
|
+
of actions.
|
|
87
|
+
|
|
88
|
+
**Consequence**: A warning with consequences for continued behavior. No
|
|
89
|
+
interaction with the people involved, including unsolicited interaction with
|
|
90
|
+
those enforcing the Code of Conduct, for a specified period of time. This
|
|
91
|
+
includes avoiding interactions in community spaces as well as external channels
|
|
92
|
+
like social media. Violating these terms may lead to a temporary or
|
|
93
|
+
permanent ban.
|
|
94
|
+
|
|
95
|
+
### 3. Temporary Ban
|
|
96
|
+
|
|
97
|
+
**Community Impact**: A serious violation of community standards, including
|
|
98
|
+
sustained inappropriate behavior.
|
|
99
|
+
|
|
100
|
+
**Consequence**: A temporary ban from any sort of interaction or public
|
|
101
|
+
communication with the community for a specified period of time. No public or
|
|
102
|
+
private interaction with the people involved, including unsolicited interaction
|
|
103
|
+
with those enforcing the Code of Conduct, is allowed during this period.
|
|
104
|
+
Violating these terms may lead to a permanent ban.
|
|
105
|
+
|
|
106
|
+
### 4. Permanent Ban
|
|
107
|
+
|
|
108
|
+
**Community Impact**: Demonstrating a pattern of violation of community
|
|
109
|
+
standards, including sustained inappropriate behavior, harassment of an
|
|
110
|
+
individual, or aggression toward or disparagement of classes of individuals.
|
|
111
|
+
|
|
112
|
+
**Consequence**: A permanent ban from any sort of public interaction within
|
|
113
|
+
the community.
|
|
114
|
+
|
|
115
|
+
## Attribution
|
|
116
|
+
|
|
117
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|
118
|
+
version 2.0, available at
|
|
119
|
+
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
|
120
|
+
|
|
121
|
+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
|
122
|
+
enforcement ladder](https://github.com/mozilla/diversity).
|
|
123
|
+
|
|
124
|
+
[homepage]: https://www.contributor-covenant.org
|
|
125
|
+
|
|
126
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
|
127
|
+
https://www.contributor-covenant.org/faq. Translations are available at
|
|
128
|
+
https://www.contributor-covenant.org/translations.
|
package/README.md
CHANGED
|
@@ -12,3 +12,52 @@
|
|
|
12
12
|
<a href="https://github.com/jestjs/jest/actions/workflows/branch.yaml"><img alt="GitHub Actions Workflow Status" src="https://img.shields.io/github/actions/workflow/status/tebuto/react-booking-widget/.github%2Fworkflows%2Fbranch.yaml?label=CI&logo=GitHub"></a>
|
|
13
13
|
</div>
|
|
14
14
|
<hr />
|
|
15
|
+
|
|
16
|
+
## Table of Contents <!-- omit in toc -->
|
|
17
|
+
|
|
18
|
+
- [Installing](#installing)
|
|
19
|
+
- [Getting Started](#getting-started)
|
|
20
|
+
- [API Reference](#api-reference)
|
|
21
|
+
- [License](#license)
|
|
22
|
+
|
|
23
|
+
## Installing
|
|
24
|
+
|
|
25
|
+
This is a [Node.js](https://nodejs.org/en/) module available through the
|
|
26
|
+
[npm registry](https://www.npmjs.com/package/@tebuto/react-booking-widget).
|
|
27
|
+
|
|
28
|
+
Installation is done using the`npm install` command:
|
|
29
|
+
|
|
30
|
+
``` bash
|
|
31
|
+
npm install @tebuto/react-booking-widget
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Getting Started
|
|
35
|
+
|
|
36
|
+
You need an existing react project to use the Tebuto booking component, if you don't have one follow this [Guide](https://react.dev/learn/start-a-new-react-project) to create one.
|
|
37
|
+
|
|
38
|
+
Here's a basic example how the widget can be used:
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
import { TebutoBookingWidget } from '@tebuto/react-booking-widget'
|
|
42
|
+
|
|
43
|
+
const YourComponent = () => {
|
|
44
|
+
return <TebutoBookingWidget therapistUUID="<your-therapist-uuid>" />
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
You can obtain the therapist UUID from the [appointment settings](https://app.tebuto.de/einstellungen/termine). In the embedding section, click on the HTML button and use the value from the `data-therapist-uuid` attribute.
|
|
49
|
+
|
|
50
|
+
## API Reference
|
|
51
|
+
|
|
52
|
+
> **Note**: The values for the therapist UUID and the category IDs can be obtained from the HTML embedding option in the [appointment settings](https://app.tebuto.de/einstellungen/termine).
|
|
53
|
+
|
|
54
|
+
| Name | Description | Type | Required | Default |
|
|
55
|
+
| --------------- | --------------------------------------------------------------- | ---------- | -------- | ------------- |
|
|
56
|
+
| therapistUUID | A unique identifier for the therapist. | `string` | `Yes` | - |
|
|
57
|
+
| backgroundColor | The hex background color of the component. | `string` | `No` | `transparent` |
|
|
58
|
+
| border | Specifies the border style (e.g., `none`, `solid`, `dashed`). | `boolean` | `No` | `true` |
|
|
59
|
+
| categories | An array of appointment category IDs to be shown in the widget. | `number[]` | `No` | `[]` |
|
|
60
|
+
|
|
61
|
+
## License
|
|
62
|
+
|
|
63
|
+
[MIT](LICENSE)
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var t=require("react/jsx-runtime"),e=function(){return e=Object.assign||function(t){for(var e,r=1,o=arguments.length;r<o;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},e.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;function r(r){var o=r.config;return t.jsx("script",e({src:"https://widget.tebuto.de/booking-widget.js","data-therapist-uuid":o.therapistUUID},o.backgroundColor?{"data-background-color":o.backgroundColor}:{},o.categories?{"data-categories":o.categories.join(",")}:{},void 0!==o.border?{"data-border":o.border?"true":"false"}:{},{"data-testid":"tebuto-booking-widget-script"}))}exports.TebutoBookingWidget=function(e){var o=e.noScriptText,i=void 0===o?"Widget konnte nicht geladen werden. Möglicherweise ist Skripting im Browser deaktiviert.":o,n=function(t,e){var r={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(r[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(r[o[i]]=t[o[i]])}return r}(e,["noScriptText"]);return t.jsxs("div",{id:"tebuto-booking-widget","data-testid":"tebuto-booking-widget-container",children:[t.jsx(r,{config:n}),t.jsx("noscript",{"data-testid":"tebuto-booking-widget-noscript",children:i})]})};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../node_modules/.pnpm/@rollup+plugin-typescript@12.1.2_rollup@4.30.1_tslib@2.8.1_typescript@5.7.3/node_modules/tslib/tslib.es6.js","../../src/components/TebutoBookingWidget.tsx","../../src/constants.ts"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\r\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nvar ownKeys = function(o) {\r\n ownKeys = Object.getOwnPropertyNames || function (o) {\r\n var ar = [];\r\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\r\n return ar;\r\n };\r\n return ownKeys(o);\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n var r, s = 0;\r\n function next() {\r\n while (r = env.stack.pop()) {\r\n try {\r\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\r\n if (r.dispose) {\r\n var result = r.dispose.call(r.value);\r\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n else s |= 1;\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\r\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\r\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\r\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\r\n });\r\n }\r\n return path;\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __esDecorate: __esDecorate,\r\n __runInitializers: __runInitializers,\r\n __propKey: __propKey,\r\n __setFunctionName: __setFunctionName,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,\r\n};\r\n","import { JSX } from 'react'\nimport { TEBUTO_BOOKING_WIDGET_ID, TEBUTO_BOOKING_WIDGET_NO_SCRIPT_TEXT, TEBUTO_BOOKING_WIDGET_SCRIPT_URL } from '../constants'\nimport { TebutoBookingWidgetConfiguration } from '../types'\n\ntype TebutoBookingWidgetProps = {\n noScriptText?: string\n} & TebutoBookingWidgetConfiguration\n\nexport default function TebutoBookingWidget({ noScriptText = TEBUTO_BOOKING_WIDGET_NO_SCRIPT_TEXT, ...config }: TebutoBookingWidgetProps): JSX.Element {\n return (\n <div id={TEBUTO_BOOKING_WIDGET_ID} data-testid=\"tebuto-booking-widget-container\">\n <TebutoBookingWidgetScript config={config} />\n <noscript data-testid=\"tebuto-booking-widget-noscript\">{noScriptText}</noscript>\n </div>\n )\n}\n\nfunction TebutoBookingWidgetScript({ config }: { config: TebutoBookingWidgetConfiguration }): JSX.Element {\n return (\n <script\n src={TEBUTO_BOOKING_WIDGET_SCRIPT_URL}\n data-therapist-uuid={config.therapistUUID}\n {...(config.backgroundColor ? { 'data-background-color': config.backgroundColor } : {})}\n {...(config.categories ? { 'data-categories': config.categories.join(',') } : {})}\n {...(config.border !== undefined ? { 'data-border': config.border ? 'true' : 'false' } : {})}\n data-testid=\"tebuto-booking-widget-script\"\n />\n )\n}\n","export const TEBUTO_BOOKING_WIDGET_SCRIPT_URL = 'https://widget.tebuto.de/booking-widget.js'\nexport const TEBUTO_BOOKING_WIDGET_ID = 'tebuto-booking-widget'\nexport const TEBUTO_BOOKING_WIDGET_NO_SCRIPT_TEXT = 'Widget konnte nicht geladen werden. Möglicherweise ist Skripting im Browser deaktiviert.'\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","SuppressedError","TebutoBookingWidgetScript","_a","config","_jsx","jsx","src","therapistUUID","backgroundColor","categories","join","undefined","border","_b","noScriptText","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","__rest","_jsxs","id","children"],"mappings":"gDA+BWA,EAAW,WAQlB,OAPAA,EAAWC,OAAOC,QAAU,SAAkBC,GAC1C,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAII,KADTL,EAAIG,UAAUF,GACOJ,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,KAAIN,EAAEM,GAAKL,EAAEK,IAE9E,OAAON,CACV,EACMH,EAASa,MAAMC,KAAMP,UAChC,EAgSkD,mBAApBQ,iBAAiCA,gBCvT/D,SAASC,EAA0BC,GAAE,IAAAC,EAAMD,EAAAC,OACvC,OACIC,EACIC,IAAA,SAAApB,EAAA,CAAAqB,ICpBoC,6CDoBC,sBAChBH,EAAOI,eACvBJ,EAAOK,gBAAkB,CAAE,wBAAyBL,EAAOK,iBAAoB,CAAE,EACjFL,EAAOM,WAAa,CAAE,kBAAmBN,EAAOM,WAAWC,KAAK,MAAS,CAAA,OACvDC,IAAlBR,EAAOS,OAAuB,CAAE,cAAeT,EAAOS,OAAS,OAAS,SAAY,CAAA,iBAC7E,iCAGxB,6BApBwB,SAAoBV,GAAE,IAAAW,EAAAX,EAAAY,aAAAA,OAAeH,IAAAE,ECNT,6FDMkDV,EDkC/F,SAAgBd,EAAG0B,GACtB,IAAI3B,EAAI,CAAA,EACR,IAAK,IAAIM,KAAKL,EAAOH,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,IAAMqB,EAAEC,QAAQtB,GAAK,IAC9EN,EAAEM,GAAKL,EAAEK,IACb,GAAS,MAALL,GAAqD,mBAAjCH,OAAO+B,sBACtB,KAAI3B,EAAI,EAAb,IAAgBI,EAAIR,OAAO+B,sBAAsB5B,GAAIC,EAAII,EAAED,OAAQH,IAC3DyB,EAAEC,QAAQtB,EAAEJ,IAAM,GAAKJ,OAAOS,UAAUuB,qBAAqBrB,KAAKR,EAAGK,EAAEJ,MACvEF,EAAEM,EAAEJ,IAAMD,EAAEK,EAAEJ,IAF4B,CAItD,OAAOF,CACX,CC5C4C+B,CAAAjB,EAAA,CAAA,iBACxC,OACIkB,cAAKC,GCT2B,wBDSe,cAAA,kCAC3CC,SAAA,CAAAlB,EAAAC,IAACJ,EAAyB,CAACE,OAAQA,IACnCC,MAAsB,WAAA,CAAA,cAAA,0CAAkCU,MAGpE","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsxs as t,jsx as r}from"react/jsx-runtime";var e=function(){return e=Object.assign||function(t){for(var r,e=1,o=arguments.length;e<o;e++)for(var i in r=arguments[e])Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i]);return t},e.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;function o(e){var o=e.noScriptText,n=void 0===o?"Widget konnte nicht geladen werden. Möglicherweise ist Skripting im Browser deaktiviert.":o,a=function(t,r){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&r.indexOf(o)<0&&(e[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)r.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(e[o[i]]=t[o[i]])}return e}(e,["noScriptText"]);return t("div",{id:"tebuto-booking-widget","data-testid":"tebuto-booking-widget-container",children:[r(i,{config:a}),r("noscript",{"data-testid":"tebuto-booking-widget-noscript",children:n})]})}function i(t){var o=t.config;return r("script",e({src:"https://widget.tebuto.de/booking-widget.js","data-therapist-uuid":o.therapistUUID},o.backgroundColor?{"data-background-color":o.backgroundColor}:{},o.categories?{"data-categories":o.categories.join(",")}:{},void 0!==o.border?{"data-border":o.border?"true":"false"}:{},{"data-testid":"tebuto-booking-widget-script"}))}export{o as TebutoBookingWidget};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../node_modules/.pnpm/@rollup+plugin-typescript@12.1.2_rollup@4.30.1_tslib@2.8.1_typescript@5.7.3/node_modules/tslib/tslib.es6.js","../../src/components/TebutoBookingWidget.tsx","../../src/constants.ts"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\r\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nvar ownKeys = function(o) {\r\n ownKeys = Object.getOwnPropertyNames || function (o) {\r\n var ar = [];\r\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\r\n return ar;\r\n };\r\n return ownKeys(o);\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n var r, s = 0;\r\n function next() {\r\n while (r = env.stack.pop()) {\r\n try {\r\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\r\n if (r.dispose) {\r\n var result = r.dispose.call(r.value);\r\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n else s |= 1;\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\r\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\r\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\r\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\r\n });\r\n }\r\n return path;\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __esDecorate: __esDecorate,\r\n __runInitializers: __runInitializers,\r\n __propKey: __propKey,\r\n __setFunctionName: __setFunctionName,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,\r\n};\r\n","import { JSX } from 'react'\nimport { TEBUTO_BOOKING_WIDGET_ID, TEBUTO_BOOKING_WIDGET_NO_SCRIPT_TEXT, TEBUTO_BOOKING_WIDGET_SCRIPT_URL } from '../constants'\nimport { TebutoBookingWidgetConfiguration } from '../types'\n\ntype TebutoBookingWidgetProps = {\n noScriptText?: string\n} & TebutoBookingWidgetConfiguration\n\nexport default function TebutoBookingWidget({ noScriptText = TEBUTO_BOOKING_WIDGET_NO_SCRIPT_TEXT, ...config }: TebutoBookingWidgetProps): JSX.Element {\n return (\n <div id={TEBUTO_BOOKING_WIDGET_ID} data-testid=\"tebuto-booking-widget-container\">\n <TebutoBookingWidgetScript config={config} />\n <noscript data-testid=\"tebuto-booking-widget-noscript\">{noScriptText}</noscript>\n </div>\n )\n}\n\nfunction TebutoBookingWidgetScript({ config }: { config: TebutoBookingWidgetConfiguration }): JSX.Element {\n return (\n <script\n src={TEBUTO_BOOKING_WIDGET_SCRIPT_URL}\n data-therapist-uuid={config.therapistUUID}\n {...(config.backgroundColor ? { 'data-background-color': config.backgroundColor } : {})}\n {...(config.categories ? { 'data-categories': config.categories.join(',') } : {})}\n {...(config.border !== undefined ? { 'data-border': config.border ? 'true' : 'false' } : {})}\n data-testid=\"tebuto-booking-widget-script\"\n />\n )\n}\n","export const TEBUTO_BOOKING_WIDGET_SCRIPT_URL = 'https://widget.tebuto.de/booking-widget.js'\nexport const TEBUTO_BOOKING_WIDGET_ID = 'tebuto-booking-widget'\nexport const TEBUTO_BOOKING_WIDGET_NO_SCRIPT_TEXT = 'Widget konnte nicht geladen werden. Möglicherweise ist Skripting im Browser deaktiviert.'\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","SuppressedError","TebutoBookingWidget","_a","_b","noScriptText","undefined","config","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","__rest","_jsxs","id","children","_jsx","TebutoBookingWidgetScript","src","therapistUUID","backgroundColor","categories","join","border"],"mappings":"kDA+BO,IAAIA,EAAW,WAQlB,OAPAA,EAAWC,OAAOC,QAAU,SAAkBC,GAC1C,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAII,KADTL,EAAIG,UAAUF,GACOJ,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,KAAIN,EAAEM,GAAKL,EAAEK,IAE9E,OAAON,CACV,EACMH,EAASa,MAAMC,KAAMP,UAChC,EAgSkD,mBAApBQ,iBAAiCA,gBChUvC,SAAAC,EAAoBC,GAAE,IAAAC,EAAAD,EAAAE,aAAAA,OAAeC,IAAAF,ECNT,6FDMkDG,EDkC/F,SAAgBjB,EAAGkB,GACtB,IAAInB,EAAI,CAAA,EACR,IAAK,IAAIM,KAAKL,EAAOH,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,IAAMa,EAAEC,QAAQd,GAAK,IAC9EN,EAAEM,GAAKL,EAAEK,IACb,GAAS,MAALL,GAAqD,mBAAjCH,OAAOuB,sBACtB,KAAInB,EAAI,EAAb,IAAgBI,EAAIR,OAAOuB,sBAAsBpB,GAAIC,EAAII,EAAED,OAAQH,IAC3DiB,EAAEC,QAAQd,EAAEJ,IAAM,GAAKJ,OAAOS,UAAUe,qBAAqBb,KAAKR,EAAGK,EAAEJ,MACvEF,EAAEM,EAAEJ,IAAMD,EAAEK,EAAEJ,IAF4B,CAItD,OAAOF,CACX,CC5C4CuB,CAAAT,EAAA,CAAA,iBACxC,OACIU,SAAKC,GCT2B,wBDSe,cAAA,kCAC3CC,SAAA,CAAAC,EAACC,EAAyB,CAACV,OAAQA,IACnCS,EAAsB,WAAA,CAAA,cAAA,0CAAkCX,MAGpE,CAEA,SAASY,EAA0Bd,GAAE,IAAAI,EAAMJ,EAAAI,OACvC,OACIS,EACI,SAAA9B,EAAA,CAAAgC,ICpBoC,6CDoBC,sBAChBX,EAAOY,eACvBZ,EAAOa,gBAAkB,CAAE,wBAAyBb,EAAOa,iBAAoB,CAAE,EACjFb,EAAOc,WAAa,CAAE,kBAAmBd,EAAOc,WAAWC,KAAK,MAAS,CAAA,OACvDhB,IAAlBC,EAAOgB,OAAuB,CAAE,cAAehB,EAAOgB,OAAS,OAAS,SAAY,CAAA,iBAC7E,iCAGxB","x_google_ignoreList":[0]}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
|
|
3
|
+
type TebutoBookingWidgetConfiguration = {
|
|
4
|
+
therapistUUID: string;
|
|
5
|
+
backgroundColor?: string;
|
|
6
|
+
categories?: number[];
|
|
7
|
+
border?: boolean;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
type TebutoBookingWidgetProps = {
|
|
11
|
+
noScriptText?: string;
|
|
12
|
+
} & TebutoBookingWidgetConfiguration;
|
|
13
|
+
declare function TebutoBookingWidget({ noScriptText, ...config }: TebutoBookingWidgetProps): JSX.Element;
|
|
14
|
+
|
|
15
|
+
export { TebutoBookingWidget, type TebutoBookingWidgetConfiguration };
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tebuto/react-booking-widget",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "React Component for the Tebuto Booking Widget",
|
|
5
5
|
"author": "Tebuto GmbH",
|
|
6
6
|
"homepage": "https://tebuto.de",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"main": "dist/cjs/index.js",
|
|
9
9
|
"module": "dist/esm/index.js",
|
|
10
|
-
"types": "dist/
|
|
10
|
+
"types": "dist/types.d.ts",
|
|
11
11
|
"scripts": {
|
|
12
12
|
"test": "jest",
|
|
13
13
|
"build": "rollup -c --bundleConfigAsCjs",
|
package/.github/dependabot.yml
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
name: "Branch"
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- main
|
|
7
|
-
pull_request:
|
|
8
|
-
|
|
9
|
-
jobs:
|
|
10
|
-
tests:
|
|
11
|
-
name: Tests
|
|
12
|
-
runs-on: ubuntu-latest
|
|
13
|
-
steps:
|
|
14
|
-
- name: Checkout Repository
|
|
15
|
-
uses: actions/checkout@v4
|
|
16
|
-
|
|
17
|
-
- uses: pnpm/action-setup@v4
|
|
18
|
-
with:
|
|
19
|
-
version: 9
|
|
20
|
-
|
|
21
|
-
- uses: actions/setup-node@v4
|
|
22
|
-
with:
|
|
23
|
-
node-version: '22.x'
|
|
24
|
-
cache: 'pnpm'
|
|
25
|
-
cache-dependency-path: 'pnpm-lock.yaml'
|
|
26
|
-
|
|
27
|
-
- name: Install dependencies
|
|
28
|
-
run: |
|
|
29
|
-
pnpm install --frozen-lockfile
|
|
30
|
-
|
|
31
|
-
- name: Linting
|
|
32
|
-
run: pnpm run lint
|
|
33
|
-
|
|
34
|
-
- name: Tests
|
|
35
|
-
run: pnpm run test
|
|
36
|
-
|
|
37
|
-
scan:
|
|
38
|
-
name: SonarQube Scan
|
|
39
|
-
runs-on: ubuntu-latest
|
|
40
|
-
steps:
|
|
41
|
-
- name: Checkout Repository
|
|
42
|
-
uses: actions/checkout@v4
|
|
43
|
-
with:
|
|
44
|
-
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
|
45
|
-
|
|
46
|
-
- uses: pnpm/action-setup@v4
|
|
47
|
-
with:
|
|
48
|
-
version: 9
|
|
49
|
-
|
|
50
|
-
- uses: actions/setup-node@v4
|
|
51
|
-
with:
|
|
52
|
-
node-version: '22.x'
|
|
53
|
-
cache: 'pnpm'
|
|
54
|
-
|
|
55
|
-
- name: Install dependencies
|
|
56
|
-
run: |
|
|
57
|
-
pnpm install --frozen-lockfile
|
|
58
|
-
|
|
59
|
-
- name: Scan
|
|
60
|
-
uses: sonarsource/sonarqube-scan-action@v4
|
|
61
|
-
env:
|
|
62
|
-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
63
|
-
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
|
|
64
|
-
|
|
65
|
-
- name: Quality Gate
|
|
66
|
-
uses: sonarsource/sonarqube-quality-gate-action@v1
|
|
67
|
-
timeout-minutes: 5
|
|
68
|
-
env:
|
|
69
|
-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
70
|
-
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
name: Publish NPM Package
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
release:
|
|
5
|
-
types:
|
|
6
|
-
- published
|
|
7
|
-
|
|
8
|
-
jobs:
|
|
9
|
-
publish:
|
|
10
|
-
name: Publish to npm
|
|
11
|
-
runs-on: ubuntu-latest
|
|
12
|
-
permissions:
|
|
13
|
-
id-token: write # Required for provenance generation
|
|
14
|
-
contents: read
|
|
15
|
-
steps:
|
|
16
|
-
- name: Checkout Repository
|
|
17
|
-
uses: actions/checkout@v4
|
|
18
|
-
|
|
19
|
-
- uses: pnpm/action-setup@v4
|
|
20
|
-
with:
|
|
21
|
-
version: 9
|
|
22
|
-
|
|
23
|
-
- uses: actions/setup-node@v4
|
|
24
|
-
with:
|
|
25
|
-
node-version: '22.x'
|
|
26
|
-
cache: 'pnpm'
|
|
27
|
-
cache-dependency-path: 'pnpm-lock.yaml'
|
|
28
|
-
registry-url: 'https://registry.npmjs.org'
|
|
29
|
-
|
|
30
|
-
- name: Install dependencies
|
|
31
|
-
run: |
|
|
32
|
-
pnpm install --frozen-lockfile
|
|
33
|
-
|
|
34
|
-
- name: Linting
|
|
35
|
-
run: pnpm run lint
|
|
36
|
-
|
|
37
|
-
- name: Tests
|
|
38
|
-
run: pnpm run test
|
|
39
|
-
|
|
40
|
-
- name: Publish to npm
|
|
41
|
-
run: npm publish --provenance --access public
|
|
42
|
-
env:
|
|
43
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/.husky/pre-commit
DELETED
package/.vscode/extensions.json
DELETED
package/.vscode/settings.json
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"editor.defaultFormatter": "biomejs.biome",
|
|
3
|
-
"editor.codeActionsOnSave": {
|
|
4
|
-
"source.organizeImports.biome": "always",
|
|
5
|
-
"quickfix.biome": "always"
|
|
6
|
-
},
|
|
7
|
-
"files.insertFinalNewline": true,
|
|
8
|
-
"[typescript]": {
|
|
9
|
-
"editor.defaultFormatter": "biomejs.biome"
|
|
10
|
-
},
|
|
11
|
-
"[json]": {
|
|
12
|
-
"editor.defaultFormatter": "biomejs.biome"
|
|
13
|
-
},
|
|
14
|
-
"[typescriptreact]": {
|
|
15
|
-
"editor.defaultFormatter": "biomejs.biome"
|
|
16
|
-
}
|
|
17
|
-
}
|
package/biome.json
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://biomejs.dev/schemas/1.8.0/schema.json",
|
|
3
|
-
"organizeImports": {
|
|
4
|
-
"enabled": true
|
|
5
|
-
},
|
|
6
|
-
"formatter": {
|
|
7
|
-
"enabled": true,
|
|
8
|
-
"formatWithErrors": false,
|
|
9
|
-
"indentWidth": 4,
|
|
10
|
-
"indentStyle": "space",
|
|
11
|
-
"lineWidth": 120,
|
|
12
|
-
"ignore": ["node_modules/**", "dist/**"]
|
|
13
|
-
},
|
|
14
|
-
"linter": {
|
|
15
|
-
"enabled": true,
|
|
16
|
-
"rules": {
|
|
17
|
-
"recommended": true,
|
|
18
|
-
"style": {
|
|
19
|
-
"useImportType": "off",
|
|
20
|
-
"useNodejsImportProtocol": "off"
|
|
21
|
-
},
|
|
22
|
-
"complexity": {
|
|
23
|
-
"noForEach": "off",
|
|
24
|
-
"noBannedTypes": "off"
|
|
25
|
-
},
|
|
26
|
-
"suspicious": {
|
|
27
|
-
"noExplicitAny": "off",
|
|
28
|
-
"noThenProperty": "off",
|
|
29
|
-
"noArrayIndexKey": "off"
|
|
30
|
-
},
|
|
31
|
-
"a11y": {
|
|
32
|
-
"useKeyWithClickEvents": "off"
|
|
33
|
-
},
|
|
34
|
-
"correctness": {
|
|
35
|
-
"useExhaustiveDependencies": "off"
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
"ignore": ["node_modules/**", "dist/**"]
|
|
39
|
-
},
|
|
40
|
-
"javascript": {
|
|
41
|
-
"parser": {
|
|
42
|
-
"unsafeParameterDecoratorsEnabled": true
|
|
43
|
-
},
|
|
44
|
-
"formatter": {
|
|
45
|
-
"enabled": true,
|
|
46
|
-
"indentStyle": "space",
|
|
47
|
-
"indentWidth": 4,
|
|
48
|
-
"lineWidth": 180,
|
|
49
|
-
"arrowParentheses": "asNeeded",
|
|
50
|
-
"trailingCommas": "none",
|
|
51
|
-
"quoteStyle": "single",
|
|
52
|
-
"semicolons": "asNeeded"
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
"json": {
|
|
56
|
-
"formatter": {
|
|
57
|
-
"enabled": true,
|
|
58
|
-
"indentStyle": "space",
|
|
59
|
-
"indentWidth": 4,
|
|
60
|
-
"lineWidth": 180
|
|
61
|
-
},
|
|
62
|
-
"parser": {
|
|
63
|
-
"allowComments": true
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
package/rollup.config.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import commonjs from '@rollup/plugin-commonjs'
|
|
2
|
-
import resolve from '@rollup/plugin-node-resolve'
|
|
3
|
-
import terser from '@rollup/plugin-terser'
|
|
4
|
-
import typescript from '@rollup/plugin-typescript'
|
|
5
|
-
import dts from 'rollup-plugin-dts'
|
|
6
|
-
import peerDepsExternal from 'rollup-plugin-peer-deps-external'
|
|
7
|
-
|
|
8
|
-
const packageJson = require('./package.json')
|
|
9
|
-
|
|
10
|
-
export default [
|
|
11
|
-
{
|
|
12
|
-
input: 'src/index.ts',
|
|
13
|
-
output: [
|
|
14
|
-
{
|
|
15
|
-
file: packageJson.main,
|
|
16
|
-
format: 'cjs',
|
|
17
|
-
sourcemap: true
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
file: packageJson.module,
|
|
21
|
-
format: 'esm',
|
|
22
|
-
sourcemap: true
|
|
23
|
-
}
|
|
24
|
-
],
|
|
25
|
-
plugins: [peerDepsExternal(), resolve(), commonjs(), typescript({ tsconfig: './tsconfig.json' }), terser()],
|
|
26
|
-
external: ['react', 'react-dom']
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
input: 'src/index.ts',
|
|
30
|
-
output: [{ file: 'dist/types.d.ts', format: 'es' }],
|
|
31
|
-
plugins: [dts.default()]
|
|
32
|
-
}
|
|
33
|
-
]
|
package/sonar-project.properties
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { render, screen } from '@testing-library/react'
|
|
2
|
-
import { TEBUTO_BOOKING_WIDGET_NO_SCRIPT_TEXT, TEBUTO_BOOKING_WIDGET_SCRIPT_URL } from '../constants'
|
|
3
|
-
import TebutoBookingWidget from './TebutoBookingWidget'
|
|
4
|
-
|
|
5
|
-
describe('TebutoBookingWidget', () => {
|
|
6
|
-
const therapistUUID = '9fddab56-5dd5-4bc4-b1bd-3b1d52eb952f'
|
|
7
|
-
|
|
8
|
-
it('should add a script tag to load the Tebuto Booking Widget to the page head', () => {
|
|
9
|
-
render(<TebutoBookingWidget therapistUUID={therapistUUID} />)
|
|
10
|
-
|
|
11
|
-
const container = screen.getByTestId<HTMLDivElement>('tebuto-booking-widget-container')
|
|
12
|
-
|
|
13
|
-
expect(container).not.toBeNull()
|
|
14
|
-
expect(container.childNodes).toHaveLength(2)
|
|
15
|
-
|
|
16
|
-
// @ts-expect-error ts(2339)
|
|
17
|
-
expect(container.childNodes[0].attributes['data-testid'].value).toBe('tebuto-booking-widget-script')
|
|
18
|
-
// @ts-expect-error ts(2339)
|
|
19
|
-
expect(container.childNodes[1].attributes['data-testid'].value).toBe('tebuto-booking-widget-noscript')
|
|
20
|
-
|
|
21
|
-
const script = screen.getByTestId<HTMLScriptElement>('tebuto-booking-widget-script')
|
|
22
|
-
expect(script).not.toBeNull()
|
|
23
|
-
expect(script.src).toBe(TEBUTO_BOOKING_WIDGET_SCRIPT_URL)
|
|
24
|
-
expect(script.getAttribute('data-therapist-uuid')).toBe(therapistUUID)
|
|
25
|
-
|
|
26
|
-
const noscript = screen.getByTestId('tebuto-booking-widget-noscript')
|
|
27
|
-
expect(noscript).not.toBeNull()
|
|
28
|
-
expect(noscript.textContent).toBe(TEBUTO_BOOKING_WIDGET_NO_SCRIPT_TEXT)
|
|
29
|
-
})
|
|
30
|
-
|
|
31
|
-
it('should set the "data-background-color" attribute of the script tag to the value of the "backgroundColor" prop', () => {
|
|
32
|
-
const backgroundColor = '#ffffff'
|
|
33
|
-
render(<TebutoBookingWidget therapistUUID={therapistUUID} backgroundColor={backgroundColor} />)
|
|
34
|
-
|
|
35
|
-
const script = screen.getByTestId('tebuto-booking-widget-script')
|
|
36
|
-
expect(script.getAttribute('data-background-color')).toBe(backgroundColor)
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
it('should set the "data-border" attribute of the script tag to the value of the "border" prop', () => {
|
|
40
|
-
const border = false
|
|
41
|
-
render(<TebutoBookingWidget therapistUUID={therapistUUID} border={border} />)
|
|
42
|
-
|
|
43
|
-
const script = screen.getByTestId('tebuto-booking-widget-script')
|
|
44
|
-
expect(script.getAttribute('data-border')).toBe(border.toString())
|
|
45
|
-
})
|
|
46
|
-
|
|
47
|
-
it('should set the "data-categories" attribute of the script tag to the value of the "categories" prop', () => {
|
|
48
|
-
const categories = [1, 2, 3]
|
|
49
|
-
render(<TebutoBookingWidget therapistUUID={therapistUUID} categories={categories} />)
|
|
50
|
-
|
|
51
|
-
const script = screen.getByTestId('tebuto-booking-widget-script')
|
|
52
|
-
expect(script.getAttribute('data-categories')).toBe(categories.join(','))
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
it('should set the noscript text to the value of the "noScriptText" prop', () => {
|
|
56
|
-
const noScriptText = 'This is the noscript text'
|
|
57
|
-
render(<TebutoBookingWidget therapistUUID={therapistUUID} noScriptText={noScriptText} />)
|
|
58
|
-
|
|
59
|
-
const noscript = screen.getByTestId('tebuto-booking-widget-noscript')
|
|
60
|
-
expect(noscript.textContent).toBe(noScriptText)
|
|
61
|
-
})
|
|
62
|
-
})
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { JSX } from 'react'
|
|
2
|
-
import { TEBUTO_BOOKING_WIDGET_ID, TEBUTO_BOOKING_WIDGET_NO_SCRIPT_TEXT, TEBUTO_BOOKING_WIDGET_SCRIPT_URL } from '../constants'
|
|
3
|
-
import { TebutoBookingWidgetConfiguration } from '../types'
|
|
4
|
-
|
|
5
|
-
type TebutoBookingWidgetProps = {
|
|
6
|
-
noScriptText?: string
|
|
7
|
-
} & TebutoBookingWidgetConfiguration
|
|
8
|
-
|
|
9
|
-
export default function TebutoBookingWidget({ noScriptText = TEBUTO_BOOKING_WIDGET_NO_SCRIPT_TEXT, ...config }: TebutoBookingWidgetProps): JSX.Element {
|
|
10
|
-
return (
|
|
11
|
-
<div id={TEBUTO_BOOKING_WIDGET_ID} data-testid="tebuto-booking-widget-container">
|
|
12
|
-
<TebutoBookingWidgetScript config={config} />
|
|
13
|
-
<noscript data-testid="tebuto-booking-widget-noscript">{noScriptText}</noscript>
|
|
14
|
-
</div>
|
|
15
|
-
)
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function TebutoBookingWidgetScript({ config }: { config: TebutoBookingWidgetConfiguration }): JSX.Element {
|
|
19
|
-
return (
|
|
20
|
-
<script
|
|
21
|
-
src={TEBUTO_BOOKING_WIDGET_SCRIPT_URL}
|
|
22
|
-
data-therapist-uuid={config.therapistUUID}
|
|
23
|
-
{...(config.backgroundColor ? { 'data-background-color': config.backgroundColor } : {})}
|
|
24
|
-
{...(config.categories ? { 'data-categories': config.categories.join(',') } : {})}
|
|
25
|
-
{...(config.border !== undefined ? { 'data-border': config.border ? 'true' : 'false' } : {})}
|
|
26
|
-
data-testid="tebuto-booking-widget-script"
|
|
27
|
-
/>
|
|
28
|
-
)
|
|
29
|
-
}
|
package/src/components/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './TebutoBookingWidget'
|
package/src/constants.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export const TEBUTO_BOOKING_WIDGET_SCRIPT_URL = 'https://widget.tebuto.de/booking-widget.js'
|
|
2
|
-
export const TEBUTO_BOOKING_WIDGET_ID = 'tebuto-booking-widget'
|
|
3
|
-
export const TEBUTO_BOOKING_WIDGET_NO_SCRIPT_TEXT = 'Widget konnte nicht geladen werden. Möglicherweise ist Skripting im Browser deaktiviert.'
|
package/src/index.ts
DELETED