Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jekuer committed Nov 17, 2023
1 parent 072150c commit 2de83ec
Show file tree
Hide file tree
Showing 9 changed files with 168 additions and 161 deletions.
12 changes: 6 additions & 6 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ module.exports = function (grunt) {
},
module_no_pro: {
src: jsCoreFilesToCombine,
dest: 'dist/module/no-pro.js',
dest: 'dist/module/no-pro/index.js',
options: {
stripBanners: true,
banner: "import { tzlib_get_ical_block, tzlib_get_offset, tzlib_get_timezones } from 'timezones-ical-library';\r\n",
Expand All @@ -182,7 +182,7 @@ module.exports = function (grunt) {
},
module_unstyle: {
src: jsCoreFilesToCombinePro,
dest: 'dist/module/unstyle.js',
dest: 'dist/module/unstyle/index.js',
options: {
stripBanners: true,
banner: "import { tzlib_get_ical_block, tzlib_get_offset, tzlib_get_timezones } from 'timezones-ical-library';\r\n",
Expand All @@ -192,7 +192,7 @@ module.exports = function (grunt) {
},
module_no_pro_unstyle: {
src: jsCoreFilesToCombine,
dest: 'dist/module/no-pro-unstyle.js',
dest: 'dist/module/no-pro-unstyle/index.js',
options: {
stripBanners: true,
banner: "import { tzlib_get_ical_block, tzlib_get_offset, tzlib_get_timezones } from 'timezones-ical-library';\r\n",
Expand All @@ -212,7 +212,7 @@ module.exports = function (grunt) {
},
commonJS_no_pro: {
src: jsCoreFilesToCombine,
dest: 'dist/commonjs/no-pro.js',
dest: 'dist/commonjs/no-pro/index.js',
options: {
stripBanners: true,
banner: "// eslint-disable-next-line @typescript-eslint/no-var-requires\r\nconst tzlibActions = require('timezones-ical-library');\r\n",
Expand All @@ -222,7 +222,7 @@ module.exports = function (grunt) {
},
commonJS_unstyle: {
src: jsCoreFilesToCombinePro,
dest: 'dist/commonjs/unstyle.js',
dest: 'dist/commonjs/unstyle/index.js',
options: {
stripBanners: true,
banner: "// eslint-disable-next-line @typescript-eslint/no-var-requires\r\nconst tzlibActions = require('timezones-ical-library');\r\n",
Expand All @@ -232,7 +232,7 @@ module.exports = function (grunt) {
},
commonJS_no_pro_unstyle: {
src: jsCoreFilesToCombine,
dest: 'dist/commonjs/no-pro-unstyle.js',
dest: 'dist/commonjs/no-pro-unstyle/index.js',
options: {
stripBanners: true,
banner: "// eslint-disable-next-line @typescript-eslint/no-var-requires\r\nconst tzlibActions = require('timezones-ical-library');\r\n",
Expand Down
2 changes: 1 addition & 1 deletion demo/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion demo/pages/advanced-use.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { atcb_action } from "add-to-calendar-button";
import { atcb_action } from "add-to-calendar-button/unstyle";
import { ArrowTopRightOnSquareIcon } from '@heroicons/vue/24/outline';
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import CodeBlock from "@/components/codeBlock.vue";
Expand Down
62 changes: 31 additions & 31 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
/* eslint-disable no-unused-vars */

// MODULES
// default
declare module 'add-to-calendar-button' {
export function atcb_action(config: ATCBActionEventConfig, triggerElement?: HTMLElement, keyboardTrigger?: boolean): Promise<string>;
export const i18nStrings: {
[key: string]: {
[key: string]: string;
};
};
export const cssStyles: {
[key: string]: string;
};
export function atcb_generate_ty(host: HTMLElement, data: object): null;
}

// no-pro
declare module 'add-to-calendar-button/no-pro' {
export function atcb_action(config: ATCBActionEventConfig, triggerElement?: HTMLElement, keyboardTrigger?: boolean): Promise<string>;
}

// unstyle
declare module 'add-to-calendar-button/unstyle' {
export function atcb_action(config: ATCBActionEventConfig, triggerElement?: HTMLElement, keyboardTrigger?: boolean): Promise<string>;
export function atcb_generate_ty(host: HTMLElement, data: object): null;
}

// no-pro-unstyle
declare module 'add-to-calendar-button/no-pro-unstyle' {
export function atcb_action(config: ATCBActionEventConfig, triggerElement?: HTMLElement, keyboardTrigger?: boolean): Promise<string>;
}

// INTERFACES
interface ATCBActionEventConfig {
proKey?: string;
Expand Down Expand Up @@ -82,34 +113,3 @@ interface EventDate {
export type CustomLabelsObjectType = {
[key: string]: string | null;
};

// MODULES
// default
declare module 'add-to-calendar-button' {
export const i18nStrings: {
[key: string]: {
[key: string]: string;
};
};
export const cssStyles: {
[key: string]: string;
};
export function atcb_generate_ty(host: HTMLElement, data: object): null;
export function atcb_action(config: ATCBActionEventConfig, triggerElement?: HTMLElement, keyboardTrigger?: boolean): string;
}

// no-pro
declare module 'add-to-calendar-button/no-pro' {
export function atcb_action(config: ATCBActionEventConfig, triggerElement?: HTMLElement, keyboardTrigger?: boolean): string;
}

// unstyle
declare module 'add-to-calendar-button/unstyle' {
export function atcb_generate_ty(host: HTMLElement, data: object): null;
export function atcb_action(config: ATCBActionEventConfig, triggerElement?: HTMLElement, keyboardTrigger?: boolean): string;
}

// no-pro-unstyle
declare module 'add-to-calendar-button/no-pro-unstyle' {
export function atcb_action(config: ATCBActionEventConfig, triggerElement?: HTMLElement, keyboardTrigger?: boolean): string;
}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "add-to-calendar-button",
"version": "2.5.0-next.1",
"version": "2.5.0-next.2",
"engines": {
"node": ">=16.18.1",
"npm": ">=8.19.2"
Expand All @@ -23,16 +23,16 @@
"require": "./dist/commonjs/index.js"
},
"./no-pro": {
"import": "./dist/module/no-pro.js",
"require": "./dist/commonjs/no-pro.js"
"import": "./dist/module/no-pro/index.js",
"require": "./dist/commonjs/no-pro/index.js"
},
"./unstyle": {
"import": "./dist/module/unstyle.js",
"require": "./dist/commonjs/unstyle.js"
"import": "./dist/module/unstyle/index.js",
"require": "./dist/commonjs/unstyle/index.js"
},
"./no-pro-unstyle": {
"import": "./dist/module/no-pro-unstyle.js",
"require": "./dist/commonjs/no-pro-unstyle.js"
"import": "./dist/module/no-pro-unstyle/index.js",
"require": "./dist/commonjs/no-pro-unstyle/index.js"
}
},
"types": "index.d.ts",
Expand Down
6 changes: 3 additions & 3 deletions src/atcb-decorate.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,14 @@ function atcb_decorate_data_options(data) {
// define the actual options to check
const theOptions = (function () {
if (atcbIsiOS() || data.fakeIOS) {
if (data.optionsIOS && data.optionsIOS.length > 0) {
if (data.optionsIOS) {
return data.optionsIOS;
}
if (data.optionsMobile && data.optionsMobile.length > 0) {
if (data.optionsMobile) {
return data.optionsMobile;
}
}
if ((atcbIsAndroid() || data.fakeMobile || data.fakeAndroid) && data.optionsMobile && data.optionsMobile.length > 0) {
if ((atcbIsAndroid() || data.fakeMobile || data.fakeAndroid) && data.optionsMobile) {
return data.optionsMobile;
}
return data.options || ['ical'];
Expand Down
Loading

0 comments on commit 2de83ec

Please sign in to comment.