add-to-calendar-button 1.6.4 → 1.7.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/Gruntfile.js CHANGED
@@ -1,7 +1,7 @@
1
1
  const npmDelimiter = /\/\/ START INIT[\s\S]*?\/\/ END INIT/gm
2
2
 
3
3
  function process(content, exportPhrase) {
4
- return content.replace(npmDelimiter, `${exportPhrase} { atcb_init };`);
4
+ return content.replace(npmDelimiter, `${exportPhrase} { atcb_action, atcb_init };`);
5
5
  }
6
6
  module.exports = function(grunt) {
7
7
 
package/README.md CHANGED
@@ -1,36 +1,44 @@
1
- # Your next Add-to-Calendar Button
1
+ # 📅 Your next Add-to-Calendar Button!
2
2
  ![Add-to-Calendar Button](https://github.com/jekuer/add-to-calendar-button/blob/main/repo_image.png?raw=true)
3
3
 
4
- _A convenient JavaScript snippet, which lets you create beautiful buttons, where people can add events to their calendars._
4
+ _A convenient JavaScript snippet, which lets you create beautiful buttons, where people can add events to their calendars._
5
5
 
6
+ ![#1 Product of the Day on ProductHunt](https://api.producthunt.com/widgets/embed-image/v1/top-post-badge.svg?post_id=319458&theme=dark&period=daily)
6
7
 
7
- ## Use case // Who this is for
8
+ <br /><br />
9
+
10
+ ## 😎 Use case // Who this is for
8
11
 
9
12
  This is for everybody, who wants to include a button at his/her website or app, which enables users to easily add a specific event to their calendars.
10
13
  It's main goal is to keep this process as easy as possible. Simply define your button configuration via JSON and everything else is automatically generated by the script.
11
14
  It is for this simple use case. No strings attached.
12
15
 
16
+ <br />
13
17
 
14
- ## Background // Why this repo exists
18
+ ## 🔎 Background // Why this repo exists
15
19
 
16
20
  While building a personal wedding page, I was confronted with the task to include a button, where invited people could save the event to their calendars.
17
21
  I did not want to build this from scratch (first) and therefore started the usual web research.
18
22
  Unfortunately, all I found where some extremely outdated code snippets, which did not really fit all the modern systems and calendar tools.
19
- Beside that, there was only the solution by AddEvent.com - all over the place. I was looking at CodePen and all I found where thousands of pens, which basically only included the AddEvent tool.
23
+ Beside that, there was only the solution by AddEvent.com - all over the place. I was looking at CodePen and all I found where thousands of pens, which basically only included the AddEvent tool.
24
+
20
25
  The problems with AddEvent.com:
21
26
  * it holds tons of features, which I did not need. I do not want to track my button. I just want it to work.
22
27
  * it limits the free tier to 50 event adds per month (consider the wedding case - this is way too less).
23
- * it brings some data privacy issues, since you basically send your users to their service.
24
- * the UX/UI is not ideal (imho).
25
- *Bottom line:* Pay for features, which I do not need - at additional privacy "cost" - that made me create this solution (for you).
28
+ * it brings some data privacy issues, since you basically send your users to their service. GDPR alert!
29
+ * the UX/UI is not ideal (imho).
26
30
 
31
+ **Bottom line:** Paying for features, which I did not need - at additional privacy concerns - that made me create this solution (for you).
27
32
 
28
- ## DEMO
33
+ <br />
34
+
35
+ ## ▶️ Demo
29
36
 
30
37
  See [jekuer.github.io/add-to-calendar-button](https://jekuer.github.io/add-to-calendar-button/) for a live demo.
31
38
 
39
+ <br />
32
40
 
33
- ## Features
41
+ ## Features
34
42
 
35
43
  * Simple and convenient integration of multiple buttons - configure them directly within the HTML code.
36
44
  * Optimized UX (for desktop and mobile) - adjustable.
@@ -41,13 +49,14 @@ See [jekuer.github.io/add-to-calendar-button](https://jekuer.github.io/add-to-ca
41
49
  * Microsoft 365, Outlook, and Teams.
42
50
  * Automatically generated iCal/ics files (for all other calendars, like Apple).
43
51
  * Timed and all-day events.
44
- * Translatable labels and dynamic.
45
- * Well documented code, to easily understand the processes.
52
+ * Translatable labels and dynamic dates.
53
+ * Well documented code, to easily understand the processes and build on top of it.
46
54
 
47
55
  ![Demo Screenshot](https://github.com/jekuer/add-to-calendar-button/blob/main/demo.gif?raw=true)
48
56
 
57
+ <br />
49
58
 
50
- ## Setup
59
+ ## 🌱 Setup
51
60
 
52
61
  ### Option 1: simple
53
62
 
@@ -59,18 +68,19 @@ See [jekuer.github.io/add-to-calendar-button](https://jekuer.github.io/add-to-ca
59
68
 
60
69
  ### Option 2: npm
61
70
 
62
- 1. Requires Node.js, npm, and a project, which builds on it (e.g. React or Angular).
71
+ 1. Requires Node, npm, and a project, which builds on it (e.g. React or Angular).
63
72
  2. Run **`npm install add-to-calendar-button`**.
64
- 3. Import the module into your project/component. For example with Angular/React: `import { atcb_init } from 'add-to-calendar-button';`.
65
- 4. Init the js after the DOM has been loaded. To determine the right moment and execute, ...
73
+ 3. Import the module into your project/component. For example with Angular/React: `import { atcb_action, atcb_init } from 'add-to-calendar-button';`.
74
+ 4. Either use `atcb_action` with your own buttons/forms/etc, or run `atcb_init` after the DOM has been loaded. To determine the right moment and execute, ...
66
75
  1. with Angular, you would use `ngAfterViewInit()` with `atcb_init();` (mind that, depending on your app, other hooks might be better);
67
76
  2. with React, you might want to include an event listener like `document.addEventListener('DOMContentLoaded', atcb_init, false);` or using hooks in a functional component like `useEffect(() => atcb_init());`
68
77
  5. Include the css. For example with Angular or React, add the following to the global style.css: `@import 'add-to-calendar-button/assets/css/atcb.min'`;
69
78
  6. Create your button as can be seen in the "Configuration" section below.
70
79
  7. That is it. The script takes care of all the rest. :)
71
80
 
81
+ <br />
72
82
 
73
- ## Configuration
83
+ ## 🎛️ Configuration
74
84
 
75
85
  A button can be easily created by placing a respective placeholder, wherever you want the button to appear.
76
86
  (The `style="display:none;"` theoretically is not necessary, but should be used for better compatibility.)
@@ -163,25 +173,57 @@ You can use startTime and endTime in the event block, but it is recommended to r
163
173
  </div>
164
174
  ```
165
175
 
166
- ### React example
176
+ ### `atcb_action` example with React
167
177
 
168
- A simpler method uses `JSON.stringify()` where you define your config in an external file or variable and then
169
- convert it to a string to be passed into the div.
178
+ If you can't or don't want to use `atcb_init`, you can use the `atcb_action` import with your own buttons or other elements/components. If you omit the second argument, the dropdown list will display as a modal in the middle of the viewport - in this case, add the "atcb_customTrigger" class to the submitting element for better keyboard support.
170
179
 
171
- ```js
172
- const AddToCalendar = () => {
180
+ This may work better with React and other frontend frameworks, but it misses the Schema.org and button specific functionalities.
173
181
 
174
- useEffect(() => atcb_init());
182
+ ```js
183
+ import React from 'react'
184
+ import { atcb_action } from 'add-to-calendar-button'
185
+
186
+ const atcb_action = () => {
187
+ const [name, setName] = React.useState('Some event')
188
+ return (
189
+ <form onSubmit={e => {
190
+ e.preventDefault()
191
+ atcb_action({
192
+ name,
193
+ startDate: "2022-01-14",
194
+ endDate: "2022-01-18",
195
+ options: ['Apple', 'Google', 'iCal', 'Microsoft365', 'Outlook.com', 'MicrosoftTeams', 'Yahoo'],
196
+ trigger: "click",
197
+ iCalFileName: "Reminder-Event",
198
+ })
199
+ }}>
200
+ <input value={name} onChange={setName} />
201
+ <input class="atcb_customTrigger" type="submit" value="save">
202
+ </form>
203
+ );
204
+ }
205
+ ```
175
206
 
176
- const event = { /* Event data */}
207
+ Alternatively, you could use `atcb_init` with a `useEffect` hook:
177
208
 
178
- return (
179
- <div className='atcb'>
180
- <script type="application/ld+json">
181
- {JSON.stringify(event)}
182
- </script>
183
- </div>
184
- );
209
+ ```js
210
+ import React from 'react'
211
+ import { atcb_init } from 'add-to-calendar-button'
212
+
213
+ const atcb_action = () => {
214
+ React.useEffect(atcb_init, [])
215
+ return (
216
+ <div className='atcb' style={{display: 'none'}}>
217
+ {JSON.stringify({
218
+ name: "Some event",
219
+ startDate: "2022-01-14",
220
+ endDate: "2022-01-18",
221
+ options: ['Apple', 'Google', 'iCal', 'Microsoft365', 'Outlook.com', 'MicrosoftTeams', 'Yahoo'],
222
+ trigger: "click",
223
+ iCalFileName: "Reminder-Event",
224
+ })}
225
+ </div>
226
+ );
185
227
  }
186
228
  ```
187
229
 
@@ -189,8 +231,8 @@ const AddToCalendar = () => {
189
231
 
190
232
  * The "label" is optional, but enables you to customize the button text. Default: "Add to Calendar".
191
233
  * Dates need to be formatted as YYYY-MM-DD ([ISO-8601](https://en.wikipedia.org/wiki/ISO_8601)).
192
- * You can also use the word "today" as date. It will then dynamically use the current day at click.
193
- * Add "+5" at the end of the date to dynamically add 5 days (or any other number). "2022-01-30+12" would generate the 11th of February 2022. This can be interesting, when combined with "today".
234
+ * You can also use the word "today" as date. It will then dynamically use the current day at click (not supported with schema.org style).
235
+ * Add "+5" at the end of the date to dynamically add 5 days (or any other number). "2022-01-30+12" would generate the 11th of February 2022. This can be interesting, when combined with "today".
194
236
  * Times need to be formatted as HH:MM.
195
237
  * Times are optional. If not set, the button generates all-day events.
196
238
  * 1 option is required. You can add as many as you want. The supported formats are listed above.
@@ -207,8 +249,9 @@ const AddToCalendar = () => {
207
249
  * Formatting a URL in the description like `[url]https://....[/url]` makes it clickable.
208
250
  * If you require line breaks within the description, use `\n` or `<br>`.
209
251
 
252
+ <br />
210
253
 
211
- ## Contributing
254
+ ## 🙌 Contributing
212
255
 
213
256
  Anyone is welcome to contribute, but mind the [guidelines](.github/CONTRIBUTING.md):
214
257
 
@@ -216,16 +259,19 @@ Anyone is welcome to contribute, but mind the [guidelines](.github/CONTRIBUTING.
216
259
  * [Feature requests](.github/CONTRIBUTING.md#features)
217
260
  * [Pull requests](.github/CONTRIBUTING.md#pull-requests)
218
261
 
219
- IMPORTANT NOTE: Run `npm install` and `npm run build` to create the minified js and css file, its sourcemap files as well as the npm_dist/ folder and content!
262
+ **IMPORTANT NOTE:** Run `npm install` and `npm run build` to create the minified js and css file, its sourcemap files as well as the npm_dist/ folder and content!
220
263
 
264
+ <br />
221
265
 
222
- ## License
266
+ ## 📃 License
223
267
 
224
268
  The code is available under the [MIT license (with “Commons Clause” License Condition v1.0)](LICENSE.txt).
225
269
 
270
+ <br />
226
271
 
227
- ## Changelog (without bug fixes)
272
+ ## Changelog (without minor changes and fixes)
228
273
 
274
+ * v1.7 : new code structure and options + tons of optimizations
229
275
  * v1.6 : supporting Microsoft Teams
230
276
  * v1.5 : update to date format and better accesibility
231
277
  * v1.4 : schema.org support (also changed some keys in the JSON!)
@@ -234,8 +280,10 @@ The code is available under the [MIT license (with “Commons Clause” License
234
280
  * v1.1 : npm functionality
235
281
  * v1.0 : initial release
236
282
 
283
+ <br />
237
284
 
238
- ## Kudos go to
239
- * [github.com/dudewheresmycode](https://github.com/dudewheresmycodee)
285
+ ## 💜 Kudos go to
240
286
  * [uxwing.com](https://uxwing.com)
241
- * all contributors!
287
+ * [Brian R (dudewheresmycode)](https://github.com/dudewheresmycode)
288
+ * [Chad Ostrowski (chadoh)](https://github.com/chadoh)
289
+ * ... and all other contributors!
@@ -3,7 +3,7 @@
3
3
  * Add-to-Calendar Button
4
4
  * ++++++++++++++++++++++
5
5
  *
6
- * Version: 1.6.4
6
+ * Version: 1.7.2
7
7
  * Creator: Jens Kuerschner (https://jenskuerschner.de)
8
8
  * Project: https://github.com/jekuer/add-to-calendar-button
9
9
  * License: MIT with “Commons Clause” License Condition v1.0
@@ -16,10 +16,12 @@
16
16
 
17
17
  .atcb_button_wrapper {
18
18
  display: inline-block;
19
+ padding: 5px;
19
20
  position: relative;
20
21
  }
21
22
 
22
23
  .atcb_button {
24
+ align-items: center;
23
25
  background: rgb(245, 245, 245);
24
26
  border: 1px solid rgb(210, 210, 210);
25
27
  border-radius: 6px;
@@ -27,11 +29,11 @@
27
29
  box-shadow: 1px 2px 10px 0px rgba(0,0,0,.4);
28
30
  color: rgb(51, 51, 51);
29
31
  cursor: pointer;
30
- display: inline-block;
32
+ display: flex;
33
+ font-family:Arial, Helvetica, sans-serif;
31
34
  font-size: 16px;
32
35
  font-weight: 600;
33
36
  line-height: 24px;
34
- margin: 10px auto;
35
37
  max-width: 300px;
36
38
  min-width: 150px;
37
39
  padding: 10px 16px 11px 16px;
@@ -45,6 +47,7 @@
45
47
  -webkit-tap-highlight-color: transparent;
46
48
  width: auto;
47
49
  }
50
+ .atcb_button:focus,
48
51
  .atcb_button:hover {
49
52
  background: rgb(255, 255, 255);
50
53
  }
@@ -54,22 +57,21 @@
54
57
  }
55
58
  }
56
59
 
57
- .atcb_button.active {
60
+ .atcb_button.atcb_active {
58
61
  background: rgb(255, 255, 255);
59
62
  border-radius: 6px 6px 3px 3px;
60
- -webkit-box-shadow: 1px 5px 15px 0px rgba(0,0,0,.5);
63
+ -webkit-box-shadow: 1px 5px 15px 0px rgba(0,0,0,.5);
61
64
  box-shadow: 1px 5px 15px 0px rgba(0,0,0,.5);
62
- margin: 7px auto 9px auto;
63
- padding: 12px 20px 13px 20px;
65
+ margin: -2px -4px;
66
+ padding: 12px 20px 13px 20px;
64
67
  z-index: 90;
65
68
  }
66
69
 
67
70
  .atcb_icon {
68
71
  height: 16px;
69
- display: inline-flex;
72
+ display: inline-block;
70
73
  margin-bottom: 4px;
71
74
  margin-right: 10px;
72
- vertical-align: middle;
73
75
  }
74
76
  .atcb_icon svg {
75
77
  height: 100%;
@@ -80,8 +82,8 @@
80
82
  .atcb_list {
81
83
  box-sizing: border-box;
82
84
  color: rgb(51, 51, 51);
83
- display: block;
84
- margin: -10px auto 0 auto;
85
+ display: block;
86
+ font-family:Arial, Helvetica, sans-serif;
85
87
  max-width: 100%;
86
88
  position: absolute;
87
89
  padding: 0 3px;
@@ -90,10 +92,20 @@
90
92
  -ms-user-select: none;
91
93
  user-select: none;
92
94
  width: 100%;
95
+ min-width: 10em;
93
96
  z-index: 80;
94
97
  }
95
98
 
99
+ .atcb_list.atcb_modal {
100
+ position: fixed;
101
+ width: 16em;
102
+ left: 50%;
103
+ top: 50%;
104
+ transform: translateY(-50%) translateX(-50%);
105
+ }
106
+
96
107
  .atcb_list_item {
108
+ align-items: center;
97
109
  background: rgb(250, 250, 250);
98
110
  border: 1px solid rgb(210, 210, 210);
99
111
  border-top: 0;
@@ -101,6 +113,7 @@
101
113
  box-shadow: 1px 2px 8px 0px rgba(0,0,0,.3);
102
114
  box-sizing: border-box;
103
115
  cursor: pointer;
116
+ display: flex;
104
117
  font-size: 16px;
105
118
  left: 50%;
106
119
  position: relative;
@@ -110,6 +123,7 @@
110
123
  touch-action: manipulation;
111
124
  -webkit-tap-highlight-color: transparent;
112
125
  }
126
+ .atcb_list_item:focus,
113
127
  .atcb_list_item:hover {
114
128
  background: rgb(255, 255, 255);
115
129
  -webkit-box-shadow: 1px 2px 10px 0px rgba(0,0,0,.4);
@@ -122,8 +136,12 @@
122
136
  }
123
137
  }
124
138
 
125
- .atcb_list_item:first-child {
126
- padding-top: 25px;
139
+ .atcb_list.atcb_generated_button .atcb_list_item:first-child {
140
+ padding-top: 20px;
141
+ }
142
+
143
+ .atcb_list:not(.atcb_generated_button) .atcb_list_item:first-child {
144
+ border-radius: 6px 6px 0 0;
127
145
  }
128
146
 
129
147
  .atcb_list_item:last-child {
@@ -133,6 +151,7 @@
133
151
 
134
152
  .atcb_list_item .atcb_icon {
135
153
  margin-right: 8px;
154
+ width: 18px;
136
155
  }
137
156
 
138
157
  .atcb_bgoverlay {
@@ -145,3 +164,6 @@
145
164
  width: 100%;
146
165
  z-index: 70;
147
166
  }
167
+ .atcb_bgoverlay.atcb_click:hover {
168
+ cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Cpath fill-rule='evenodd' d='M11.991.69a2.35 2.35 0 0 1 3.318-.009c.918.911.922 2.392.009 3.307l-4.009 4.014 4.013 4.018c.906.909.893 2.38-.027 3.287a2.35 2.35 0 0 1-3.307-.004l-3.985-3.99-3.993 3.997a2.35 2.35 0 0 1-3.318.009c-.918-.911-.922-2.392-.009-3.307l4.009-4.014L.678 3.98C-.228 3.072-.215 1.6.706.693a2.35 2.35 0 0 1 3.307.004l3.985 3.99z'/%3E%3C/svg%3E") 32 32, pointer;
169
+ }
@@ -1,2 +1,2 @@
1
- .atcb{display:none}.atcb_button_wrapper{display:inline-block;position:relative}.atcb_button{background:#f5f5f5;border:1px solid #d2d2d2;border-radius:6px;-webkit-box-shadow:1px 2px 10px 0 rgba(0,0,0,.4);box-shadow:1px 2px 10px 0 rgba(0,0,0,.4);color:#333;cursor:pointer;display:inline-block;font-size:16px;font-weight:600;line-height:24px;margin:10px auto;max-width:300px;min-width:150px;padding:10px 16px 11px 16px;position:relative;text-align:center;touch-action:manipulation;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;width:auto}.atcb_button:hover{background:#fff}@media only screen and (max-width:575px){.atcb_button{font-size:14px}}.atcb_button.active{background:#fff;border-radius:6px 6px 3px 3px;-webkit-box-shadow:1px 5px 15px 0 rgba(0,0,0,.5);box-shadow:1px 5px 15px 0 rgba(0,0,0,.5);margin:7px auto 9px auto;padding:12px 20px 13px 20px;z-index:90}.atcb_icon{height:16px;display:inline-flex;margin-bottom:4px;margin-right:10px;vertical-align:middle}.atcb_icon svg{height:100%;color:#333;width:auto}.atcb_list{box-sizing:border-box;color:#333;display:block;margin:-10px auto 0 auto;max-width:100%;position:absolute;padding:0 3px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:100%;z-index:80}.atcb_list_item{background:#fafafa;border:1px solid #d2d2d2;border-top:0;-webkit-box-shadow:1px 2px 8px 0 rgba(0,0,0,.3);box-shadow:1px 2px 8px 0 rgba(0,0,0,.3);box-sizing:border-box;cursor:pointer;font-size:16px;left:50%;position:relative;padding:12px 18px;text-align:left;transform:translate(-50%);touch-action:manipulation;-webkit-tap-highlight-color:transparent}.atcb_list_item:hover{background:#fff;-webkit-box-shadow:1px 2px 10px 0 rgba(0,0,0,.4);box-shadow:1px 2px 10px 0 rgba(0,0,0,.4);color:#000}@media only screen and (max-width:575px){.atcb_list_item{font-size:14px}}.atcb_list_item:first-child{padding-top:25px}.atcb_list_item:last-child{border-radius:0 0 6px 6px}.atcb_list_item .atcb_icon{margin-right:8px}.atcb_bgoverlay{background:rgba(20,20,20,.2);backdrop-filter:blur(2px);height:100%;left:0;position:fixed;top:0;width:100%;z-index:70}
1
+ .atcb{display:none}.atcb_button_wrapper{display:inline-block;padding:5px;position:relative}.atcb_button{align-items:center;background:#f5f5f5;border:1px solid #d2d2d2;border-radius:6px;-webkit-box-shadow:1px 2px 10px 0 rgba(0,0,0,.4);box-shadow:1px 2px 10px 0 rgba(0,0,0,.4);color:#333;cursor:pointer;display:flex;font-family:Arial,Helvetica,sans-serif;font-size:16px;font-weight:600;line-height:24px;max-width:300px;min-width:150px;padding:10px 16px 11px 16px;position:relative;text-align:center;touch-action:manipulation;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;width:auto}.atcb_button:focus,.atcb_button:hover{background:#fff}@media only screen and (max-width:575px){.atcb_button{font-size:14px}}.atcb_button.atcb_active{background:#fff;border-radius:6px 6px 3px 3px;-webkit-box-shadow:1px 5px 15px 0 rgba(0,0,0,.5);box-shadow:1px 5px 15px 0 rgba(0,0,0,.5);margin:-2px -4px;padding:12px 20px 13px 20px;z-index:90}.atcb_icon{height:16px;display:inline-block;margin-bottom:4px;margin-right:10px}.atcb_icon svg{height:100%;color:#333;width:auto}.atcb_list{box-sizing:border-box;color:#333;display:block;font-family:Arial,Helvetica,sans-serif;max-width:100%;position:absolute;padding:0 3px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:100%;min-width:10em;z-index:80}.atcb_list.atcb_modal{position:fixed;width:16em;left:50%;top:50%;transform:translateY(-50%) translateX(-50%)}.atcb_list_item{align-items:center;background:#fafafa;border:1px solid #d2d2d2;border-top:0;-webkit-box-shadow:1px 2px 8px 0 rgba(0,0,0,.3);box-shadow:1px 2px 8px 0 rgba(0,0,0,.3);box-sizing:border-box;cursor:pointer;display:flex;font-size:16px;left:50%;position:relative;padding:12px 18px;text-align:left;transform:translate(-50%);touch-action:manipulation;-webkit-tap-highlight-color:transparent}.atcb_list_item:focus,.atcb_list_item:hover{background:#fff;-webkit-box-shadow:1px 2px 10px 0 rgba(0,0,0,.4);box-shadow:1px 2px 10px 0 rgba(0,0,0,.4);color:#000}@media only screen and (max-width:575px){.atcb_list_item{font-size:14px}}.atcb_list.atcb_generated_button .atcb_list_item:first-child{padding-top:20px}.atcb_list:not(.atcb_generated_button) .atcb_list_item:first-child{border-radius:6px 6px 0 0}.atcb_list_item:last-child{border-radius:0 0 6px 6px}.atcb_list_item .atcb_icon{margin-right:8px;width:18px}.atcb_bgoverlay{background:rgba(20,20,20,.2);backdrop-filter:blur(2px);height:100%;left:0;position:fixed;top:0;width:100%;z-index:70}.atcb_bgoverlay.atcb_click:hover{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Cpath fill-rule='evenodd' d='M11.991.69a2.35 2.35 0 0 1 3.318-.009c.918.911.922 2.392.009 3.307l-4.009 4.014 4.013 4.018c.906.909.893 2.38-.027 3.287a2.35 2.35 0 0 1-3.307-.004l-3.985-3.99-3.993 3.997a2.35 2.35 0 0 1-3.318.009c-.918-.911-.922-2.392-.009-3.307l4.009-4.014L.678 3.98C-.228 3.072-.215 1.6.706.693a2.35 2.35 0 0 1 3.307.004l3.985 3.99z'/%3E%3C/svg%3E") 32 32,pointer}
2
2
  /*# sourceMappingURL=atcb.min.css.map */
@@ -1 +1 @@
1
- {"version":3,"sources":["assets\\css\\atcb.css"],"names":[],"mappings":"AAYA,MACE,QAAS,KAGX,qBACE,QAAS,aACT,SAAU,SAGZ,aACE,WAAY,QACZ,OAAQ,IAAI,MAAM,QAClB,cAAe,IACf,mBAAoB,IAAI,IAAI,KAAK,EAAI,eACrC,WAAY,IAAI,IAAI,KAAK,EAAI,eAC7B,MAAO,KACP,OAAQ,QACR,QAAS,aACT,UAAW,KACX,YAAa,IACb,YAAa,KACb,OAAQ,KAAK,KACb,UAAW,MACX,UAAW,MACX,QAAS,KAAK,KAAK,KAAK,KACxB,SAAU,SACV,WAAY,OACZ,aAAc,aACd,oBAAqB,KACrB,iBAAkB,KAClB,gBAAiB,KACjB,YAAa,KACb,4BAA6B,YAC7B,MAAO,KAET,mBACE,WAAY,KAEd,yCACE,aACE,UAAW,MAIf,oBACE,WAAY,KACZ,cAAe,IAAI,IAAI,IAAI,IAC3B,mBAAoB,IAAI,IAAI,KAAK,EAAI,eACrC,WAAY,IAAI,IAAI,KAAK,EAAI,eAC7B,OAAQ,IAAI,KAAK,IAAI,KACrB,QA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G3B,2BACE,cAAe,EAAE,EAAE,IAAI,IAIzB,2BACE,aAAc,IACd,MAAO,KAGT,gBACE,WAAY,kBACZ,gBAAiB,UACjB,OAAQ,KACR,KAAM,EACN,SAAU,MACV,IAAK,EACL,MAAO,KACP,QAAS,GAEX,iCACE,OAAQ,2cAA2c,GAAG,EAAE,CAAE"}
package/index.d.ts CHANGED
@@ -1,3 +1,28 @@
1
1
  declare module 'add-to-calendar-button' {
2
+ export type ISO8601Date = string;
3
+ export type ISO8601Time = string;
2
4
  export function atcb_init(): any;
5
+ export function atcb_action (
6
+ config: {
7
+ name?: string;
8
+ description?: string;
9
+ startDate: ISO8601Date | "today";
10
+ endDate: ISO8601Date;
11
+ startTime?: ISO8601Time;
12
+ endTime?: ISO8601Time;
13
+ location?: string;
14
+ options: ("Apple" | "Google" | "iCal" | "Microsoft365" | "MicrosoftTeams" | "Outlook.com" | "Yahoo")[],
15
+ timeZone?: string;
16
+ timeZoneOffset?: string;
17
+ iCalFileName?: string;
18
+ /**
19
+ * By default, the dropdown list will be opened on hover and closed as
20
+ * soon as you mouse over the background overlay. If you want it to
21
+ * instead close only when thebackground overlay is clicked, set this
22
+ * to `"click"`.
23
+ */
24
+ trigger?: "click";
25
+ },
26
+ placeBelow?: HTMLElement
27
+ ): void;
3
28
  }