cronofy-elements
Advanced tools
Comparing version 1.7.6 to 1.7.8
@@ -177,2 +177,10 @@ require("@babel/polyfill"); | ||
app.get("/agenda", async (req, res) => { | ||
const agenda_token = await getData(baseUrl, agendaTokenOptions); | ||
return res.render("agenda", { | ||
agenda_token: agenda_token.element_token.token, | ||
api_domain: apiDomain | ||
}); | ||
}); | ||
app.get("/integration", async (req, res) => { | ||
@@ -200,2 +208,24 @@ const availability_token = await getData( | ||
app.get("/crossbrowser", async (req, res) => { | ||
const availability_token = await getData( | ||
baseUrl, | ||
availabilityViewerTokenOptions | ||
); | ||
const agenda_token = await getData(baseUrl, agendaTokenOptions); | ||
const rules_token = await getData(baseUrl, rulesTokenOptions); | ||
const slot_picker_token = await getData(baseUrl, slotPickerTokenOptions); | ||
const cal_sync_token = await getData(baseUrl, calendarSyncTokenOptions); | ||
return res.render("crossbrowser", { | ||
agenda_token: agenda_token.element_token.token, | ||
availability_token: availability_token.element_token.token, | ||
rules_token: rules_token.element_token.token, | ||
slot_picker_token: slot_picker_token.element_token.token, | ||
cal_sync_token: cal_sync_token.element_token.token, | ||
api_domain: apiDomain, | ||
app_domain: appDomain, | ||
sub: env.LIVE_SUB, | ||
client_id: env.CLIENT_ID | ||
}); | ||
}); | ||
app.get("/slot-picker", async (req, res) => { | ||
@@ -202,0 +232,0 @@ const slot_picker_token = await getData(baseUrl, slotPickerTokenOptions); |
{ | ||
"name": "cronofy-elements", | ||
"version": "1.7.6", | ||
"version": "1.7.8", | ||
"description": "Fast track scheduling with Cronofy's embeddable UI Elements", | ||
@@ -9,5 +9,8 @@ "main": "build/npm/CronofyElements.js", | ||
"build": "webpack --mode=production", | ||
"dev": "webpack --mode=development --watch", | ||
"build_compat": "webpack --config compat.config.js --mode=production", | ||
"build_dev": "webpack --mode=development", | ||
"build_dev_compat": "webpack --config compat.config.js --mode=development", | ||
"build_server": "babel --presets @babel/preset-env demo/server.js --out-file build/server.js", | ||
"dev": "webpack --mode=development --watch", | ||
"dev_compat": "webpack --config compat.config.js --mode=development --watch", | ||
"serve": "npm run build_server && node build/server.js", | ||
@@ -53,3 +56,4 @@ "copy": "copyfiles -f build/CronofyElements.v$npm_package_version.js build/npm", | ||
"react-select": "^2.4.2", | ||
"react-transition-group": "^2.6.0" | ||
"react-transition-group": "^2.6.0", | ||
"whatwg-fetch": "^3.0.0" | ||
}, | ||
@@ -56,0 +60,0 @@ "devDependencies": { |
@@ -16,2 +16,3 @@ import React, { useContext } from "react"; | ||
display: flex; | ||
flex-shrink: 0; | ||
margin-right: 20px; | ||
@@ -25,2 +26,3 @@ `} | ||
height: 20px; | ||
flex-shrink: 0; | ||
border: 1px solid ${theme.colors.hairline}; | ||
@@ -27,0 +29,0 @@ margin-right: 10px; |
@@ -0,1 +1,2 @@ | ||
import moment from "moment-timezone"; | ||
import { | ||
@@ -55,4 +56,3 @@ parseToken, | ||
if (typeof options.tzid === "undefined") { | ||
const sniffedTimezone = Intl.DateTimeFormat().resolvedOptions() | ||
.timeZone; | ||
const sniffedTimezone = moment.tz.guess(); | ||
options.tzid = sniffedTimezone; | ||
@@ -59,0 +59,0 @@ options.customtzid = false; |
@@ -1,2 +0,2 @@ | ||
import moment from "moment"; | ||
import moment from "moment-timezone"; | ||
@@ -703,3 +703,3 @@ const today = moment(new Date()); | ||
export const availability_rules = new Promise(function(resolve, reject) { | ||
const sniffedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone; | ||
const sniffedTimezone = moment.tz.guess(); | ||
resolve({ | ||
@@ -706,0 +706,0 @@ availability_rule: { |
@@ -60,4 +60,4 @@ import moment from "moment-timezone"; | ||
const localEnd = `${day}T${convertUTCToLocal(endTime, tzid)}`; | ||
const UTCStart = moment(localStart, "YYYY-MM-DDTHH:mm").utc(); | ||
const UTCEnd = moment(localEnd, "YYYY-MM-DDTHH:mm").utc(); | ||
const UTCStart = moment.tz(localStart, "YYYY-MM-DDTHH:mm", tzid).utc(); | ||
const UTCEnd = moment.tz(localEnd, "YYYY-MM-DDTHH:mm", tzid).utc(); | ||
@@ -64,0 +64,0 @@ const is24Hours = startTime === endTime; |
@@ -0,1 +1,3 @@ | ||
import moment from "moment-timezone"; | ||
import { parseAgendaOptions } from "../src/js/helpers/init.Agenda"; | ||
@@ -222,3 +224,3 @@ import { parseAvailabilityRulesOptions } from "../src/js/helpers/init.AvailabilityRules"; | ||
describe("Parsing AvailabilityViewer options", () => { | ||
const sniffedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone; | ||
const sniffedTimezone = moment.tz.guess(); | ||
@@ -225,0 +227,0 @@ it("works when all options are declared", () => { |
@@ -20,3 +20,3 @@ const webpack = require("webpack"); | ||
filename: | ||
argv.mode !== "production" | ||
argv.mode === "development" | ||
? `CronofyElements.dev.js` | ||
@@ -33,3 +33,3 @@ : `CronofyElements.${gitRevisionPlugin.version()}.js`, | ||
parallel: true, | ||
sourceMap: argv.mode !== "production" // set to true if you want JS source maps | ||
sourceMap: argv.mode === "development" // set to true if you want JS source maps | ||
}), | ||
@@ -44,2 +44,3 @@ new OptimizeCSSAssetsPlugin({}) | ||
loader: "babel-loader", | ||
exclude: /@babel(?:\/|\\{1,2})runtime|core-js/, | ||
options: { | ||
@@ -51,6 +52,13 @@ presets: [ | ||
{ | ||
sourceMap: argv.mode !== "production" | ||
sourceMap: argv.mode === "development" | ||
} | ||
], | ||
["@babel/preset-env", { targets: { ie: "11" } }] | ||
[ | ||
"@babel/preset-env", | ||
{ | ||
useBuiltIns: "entry", | ||
corejs: "3.0.0", | ||
targets: { ie: "11" } | ||
} | ||
] | ||
], | ||
@@ -142,3 +150,3 @@ plugins: [ | ||
new BundleAnalyzerPlugin({ | ||
analyzerMode: argv.mode !== "production" ? "server" : "disabled", // server | static | disabled | ||
analyzerMode: argv.mode === "development" ? "server" : "disabled", // server | static | disabled | ||
analyzerPort: 8181 | ||
@@ -145,0 +153,0 @@ }), |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
2433646
230
45
13
20469
+ Addedwhatwg-fetch@^3.0.0
+ Addedwhatwg-fetch@3.6.20(transitive)