diff --git a/packages/demo-site/tpls/detail.ejs b/packages/demo-site/tpls/detail.ejs index ac13766ddf..f209b0f361 100644 --- a/packages/demo-site/tpls/detail.ejs +++ b/packages/demo-site/tpls/detail.ejs @@ -12,25 +12,26 @@ margin: 0 auto; } - - - + + +
-
+
- - + + + <% if (development) { %> diff --git a/packages/demo-site/tpls/index.ejs b/packages/demo-site/tpls/index.ejs index e53c63fa18..dfa30dec37 100644 --- a/packages/demo-site/tpls/index.ejs +++ b/packages/demo-site/tpls/index.ejs @@ -6,7 +6,7 @@ DEMO - +
-
+
- + diff --git a/packages/web-components/scripts/build-prod.js b/packages/web-components/scripts/build-prod.js index 3f5fa25972..6c97dec66e 100644 --- a/packages/web-components/scripts/build-prod.js +++ b/packages/web-components/scripts/build-prod.js @@ -38,26 +38,26 @@ return (async () => { const packages = [ { rollUpPackageName: 'search-widget', - exportName: 'ReapitSearchWidgetComponent', + exportName: 'ReapitSearchWidget', }, { - rollUpPackageName: 'appointment-bookings', - exportName: 'ReapitAppointmentBookingComponent', + rollUpPackageName: 'book-valuation-widget', + exportName: 'ReapitBookValuationWidget', }, { - rollUpPackageName: 'viewing-booking', - exportName: 'ReapitViewingBookingComponent', + rollUpPackageName: 'book-viewing-widget', + exportName: 'ReapitBookViewingWidget', }, { rollUpPackageName: 'themes', }, { - rollUpPackageName: 'property-detail', - exportName: 'ReapitPropertyDetailComponent', + rollUpPackageName: 'property-detail-widget', + exportName: 'ReapitPropertyDetailWidget', }, { - rollUpPackageName: 'login', - exportName: 'LoginWithReapitComponent', + rollUpPackageName: 'login-reapit-component', + exportName: 'LoginReapitComponent', }, ] const opts = { diff --git a/packages/web-components/scripts/build-serverless.js b/packages/web-components/scripts/build-serverless.js index 07ed97c1ef..a9b49f963f 100644 --- a/packages/web-components/scripts/build-serverless.js +++ b/packages/web-components/scripts/build-serverless.js @@ -6,7 +6,7 @@ const stage = yargs.argv.stage // relative to the root of web-components package const listServerlessYmlFiles = [ 'src/search-widget/server/serverless.yml', - 'src/appointment-planner/server/serverless.yml', + 'src/appointment-planner-component/server/serverless.yml', ] const buildServerlessList = () => { diff --git a/packages/web-components/scripts/release-serverless.js b/packages/web-components/scripts/release-serverless.js index bba553b9e4..8d994d6bad 100644 --- a/packages/web-components/scripts/release-serverless.js +++ b/packages/web-components/scripts/release-serverless.js @@ -6,7 +6,7 @@ const stage = yargs.argv.stage // relative to the root of web-components package const listServerlessYmlFiles = [ 'src/search-widget/server/serverless.yml', - 'src/appointment-planner/server/serverless.yml', + 'src/appointment-planner-component/tserver/serverless.yml', ] const deployServerlessList = () => { diff --git a/packages/web-components/scripts/rollup.config.appointment-bookings.js b/packages/web-components/scripts/rollup.config.book-valuation-widget.js similarity index 75% rename from packages/web-components/scripts/rollup.config.appointment-bookings.js rename to packages/web-components/scripts/rollup.config.book-valuation-widget.js index 3b0f605ffa..c6472072ee 100644 --- a/packages/web-components/scripts/rollup.config.appointment-bookings.js +++ b/packages/web-components/scripts/rollup.config.book-valuation-widget.js @@ -12,12 +12,12 @@ const production = !process.env.ROLLUP_WATCH export const baseConfigurationWithoutTheme = { ...baseConfig, - input: 'src/appointment-bookings/client/core/index.ts', - output: generateRollupOutput({ production, fileName: 'appointment-bookings', name: 'appointmentBookings' }), + input: 'src/book-valuation-widget/client/core/index.ts', + output: generateRollupOutput({ production, fileName: 'book-valuation-widget', name: 'bookValuationWidget' }), plugins: [ svelte({ dev: !production, - css: css => generateCssOutput({ css, fileName: 'appointment-bookings.css', production }), + css: css => generateCssOutput({ css, fileName: 'book-valuation-widget.css', production }), }), replace({ 'process.env.NODE_ENV': JSON.stringify(config.NODE_ENV), diff --git a/packages/web-components/scripts/rollup.config.viewing-booking.js b/packages/web-components/scripts/rollup.config.book-viewing-widget.js similarity index 76% rename from packages/web-components/scripts/rollup.config.viewing-booking.js rename to packages/web-components/scripts/rollup.config.book-viewing-widget.js index 846e90761d..fc238344ac 100644 --- a/packages/web-components/scripts/rollup.config.viewing-booking.js +++ b/packages/web-components/scripts/rollup.config.book-viewing-widget.js @@ -11,12 +11,12 @@ const production = !process.env.ROLLUP_WATCH export const baseConfigurationWithoutTheme = { ...baseConfig, - input: 'src/viewing-booking/client/core/index.ts', - output: generateRollupOutput({ production, fileName: 'viewing-booking', name: 'viewingBooking' }), + input: 'src/book-viewing-widget/client/core/index.ts', + output: generateRollupOutput({ production, fileName: 'book-viewing-widget', name: 'bookViewingWidget' }), plugins: [ svelte({ dev: !production, - css: css => generateCssOutput({ css, fileName: 'viewing-booking.css', production }), + css: css => generateCssOutput({ css, fileName: 'book-viewing-widget.css', production }), }), replace({ 'process.env.NODE_ENV': JSON.stringify(config.NODE_ENV), diff --git a/packages/web-components/scripts/rollup.config.demo-site.js b/packages/web-components/scripts/rollup.config.demo-site.js index bc03164567..1df25f2ad6 100644 --- a/packages/web-components/scripts/rollup.config.demo-site.js +++ b/packages/web-components/scripts/rollup.config.demo-site.js @@ -1,7 +1,9 @@ -import { baseConfigurationWithoutTheme as viewBookingBuidConfiguration } from './rollup.config.viewing-booking' -import { baseConfigurationWithoutTheme as appointmentBookingConfiguration } from './rollup.config.appointment-bookings' +import { baseConfigurationWithoutTheme as bookViewingWidgetConfiguration } from './rollup.config.book-viewing-widget' +// eslint-disable-next-line max-len +import { baseConfigurationWithoutTheme as bookValuationWidgetConfiguration } from './rollup.config.book-valuation-widget' import { baseConfigurationWithoutTheme as searchWidgetConfiguration } from './rollup.config.search-widget' -import { baseConfigurationWithoutTheme as propertyDetailConfiguration } from './rollup.config.property-detail' +// eslint-disable-next-line max-len +import { baseConfigurationWithoutTheme as propertyDetailWidgetConfiguration } from './rollup.config.property-detail-widget' import themeConfiguration from './rollup.config.themes' /** @@ -9,10 +11,10 @@ import themeConfiguration from './rollup.config.themes' */ const buildConfigurations = [ - propertyDetailConfiguration, + propertyDetailWidgetConfiguration, searchWidgetConfiguration, - viewBookingBuidConfiguration, - appointmentBookingConfiguration, + bookViewingWidgetConfiguration, + bookValuationWidgetConfiguration, themeConfiguration, ] diff --git a/packages/web-components/scripts/rollup.config.login.js b/packages/web-components/scripts/rollup.config.login-reapit-component.js similarity index 80% rename from packages/web-components/scripts/rollup.config.login.js rename to packages/web-components/scripts/rollup.config.login-reapit-component.js index 9a4cd47536..dfd9bc3616 100644 --- a/packages/web-components/scripts/rollup.config.login.js +++ b/packages/web-components/scripts/rollup.config.login-reapit-component.js @@ -9,8 +9,12 @@ const production = !process.env.ROLLUP_WATCH export const baseConfigurationWithoutTheme = { ...baseConfig, - input: 'src/login/index.ts', - output: generateRollupOutput({ production, fileName: 'login-with-reapit', name: 'login' }), + input: 'src/login-reapit-component/index.ts', + output: generateRollupOutput({ + production, + fileName: 'login-reapit-component', + name: 'loginReapitComponent', + }), plugins: [ replace({ 'process.env.NODE_ENV': JSON.stringify(config.NODE_ENV), diff --git a/packages/web-components/scripts/rollup.config.property-detail.js b/packages/web-components/scripts/rollup.config.property-detail-widget.js similarity index 86% rename from packages/web-components/scripts/rollup.config.property-detail.js rename to packages/web-components/scripts/rollup.config.property-detail-widget.js index 46b463356b..09fe31d8ad 100644 --- a/packages/web-components/scripts/rollup.config.property-detail.js +++ b/packages/web-components/scripts/rollup.config.property-detail-widget.js @@ -5,15 +5,15 @@ import path from 'path' import generateRollupOutput from './generate-rollup-output' import generateCssOutput from './generate-css-output' import themesConfiguration from './rollup.config.themes.js' -import { baseConfigurationWithoutTheme as viewBookinConfiguration } from './rollup.config.viewing-booking.js' +import { baseConfigurationWithoutTheme as viewBookinConfiguration } from './rollup.config.book-viewing-widget.js' const config = require(path.resolve(__dirname, '..', 'config.json')) const production = !process.env.ROLLUP_WATCH export const baseConfigurationWithoutTheme = { ...baseConfig, - input: 'src/property-detail/client/core/index.ts', - output: generateRollupOutput({ production, fileName: 'property-detail', name: 'propertyDetail' }), + input: 'src/property-detail-widget/client/core/index.ts', + output: generateRollupOutput({ production, fileName: 'property-detail-widget', name: 'propertyDetailWidget' }), plugins: [ replace({ 'process.env.NODE_ENV': JSON.stringify(config.NODE_ENV), @@ -24,7 +24,7 @@ export const baseConfigurationWithoutTheme = { }), svelte({ dev: !production, - css: css => generateCssOutput({ css, fileName: 'property-detail.css', production }), + css: css => generateCssOutput({ css, fileName: 'property-detail-widget.css', production }), }), ...baseConfig.plugins, ], diff --git a/packages/web-components/scripts/rollup.config.search-widget.js b/packages/web-components/scripts/rollup.config.search-widget.js index 89a30f5ac9..ddeb744983 100644 --- a/packages/web-components/scripts/rollup.config.search-widget.js +++ b/packages/web-components/scripts/rollup.config.search-widget.js @@ -1,5 +1,5 @@ import svelte from 'rollup-plugin-svelte' -import propertyDetailConfigurations from './rollup.config.property-detail' +import propertyDetailConfigurations from './rollup.config.property-detail-widget' import baseConfig from './rollup.config.base' import replace from '@rollup/plugin-replace' import path from 'path' diff --git a/packages/web-components/scripts/start-dev.js b/packages/web-components/scripts/start-dev.js index 65da73677a..8e680d0b8f 100644 --- a/packages/web-components/scripts/start-dev.js +++ b/packages/web-components/scripts/start-dev.js @@ -4,14 +4,14 @@ const path = require('path') const getMoveHtmlScript = packageName => { switch (packageName) { - case 'property-detail': - return 'mkdir -p ./public && cp ./src/property-detail/client/detail.html ./public/index.html' + case 'property-detail-widget': + return 'mkdir -p ./public && cp ./src/property-detail-widget/client/detail.html ./public/index.html' case 'search-widget': // eslint-disable-next-line max-len - return 'mkdir -p ./public && cp ./src/search-widget/client/index.html ./public/ && cp ./src/property-detail/client/detail.html ./public/' + return 'mkdir -p ./public && cp ./src/search-widget/client/index.html ./public/ && cp ./src/property-detail-widget/client/detail.html ./public/' case 'demo-site': return '' - case 'login': + case 'login-reapit-component': return `mkdir -p ./public && cp ./src/${packageName}/index.html ./public/` default: return `mkdir -p ./public && cp ./src/${packageName}/client/index.html ./public/` diff --git a/packages/web-components/src/appointment-bookings/client/core/index.ts b/packages/web-components/src/appointment-bookings/client/core/index.ts deleted file mode 100644 index 2bb4117a4c..0000000000 --- a/packages/web-components/src/appointment-bookings/client/core/index.ts +++ /dev/null @@ -1,33 +0,0 @@ -import AppointmentBooking from '../components/appointment-bookings.svelte' -import { AppointmentBookingInitializerTheme } from './theme' - -export interface AppointmentBookingInitializers { - theme: AppointmentBookingInitializerTheme - apiKey: string - // customerId: string - parentSelector: string - variant: 'VIEWING' | 'VALUATION' -} - -export const ReapitAppointmentBookingComponent = ({ - parentSelector, - theme, - variant, -}: // apiKey, -// variant, -AppointmentBookingInitializers) => - new AppointmentBooking({ - target: document.querySelector(parentSelector) || document.body, - props: { - theme, - // TODO - will need to reference later - // apiKey, - // customerId, - variant, - parentSelector, - }, - }) - -Object.defineProperty(window, 'ReapitAppointmentBookingComponent', { - value: ReapitAppointmentBookingComponent, -}) diff --git a/packages/web-components/src/appointment-bookings/client/index.html b/packages/web-components/src/appointment-bookings/client/index.html deleted file mode 100644 index f9547b513d..0000000000 --- a/packages/web-components/src/appointment-bookings/client/index.html +++ /dev/null @@ -1,49 +0,0 @@ - - - -DEMO - - - - - - - Book a viewing -
- -
- - Book a valuation -
- - - - - - - - diff --git a/packages/web-components/src/appointment-planner/client/components/__tests__/__snapshots__/appointment-planner.test.ts.snap b/packages/web-components/src/appointment-planner-component/client/components/__tests__/__snapshots__/appointment-planner-component.test.ts.snap similarity index 95% rename from packages/web-components/src/appointment-planner/client/components/__tests__/__snapshots__/appointment-planner.test.ts.snap rename to packages/web-components/src/appointment-planner-component/client/components/__tests__/__snapshots__/appointment-planner-component.test.ts.snap index 4c0dcf5a42..85a442da71 100644 --- a/packages/web-components/src/appointment-planner/client/components/__tests__/__snapshots__/appointment-planner.test.ts.snap +++ b/packages/web-components/src/appointment-planner-component/client/components/__tests__/__snapshots__/appointment-planner-component.test.ts.snap @@ -4,11 +4,11 @@ exports[`appointment bookings it matches a snapshot 1`] = `
diff --git a/packages/web-components/src/appointment-planner/client/components/date-cell.svelte b/packages/web-components/src/appointment-planner-component/client/components/date-cell.svelte similarity index 100% rename from packages/web-components/src/appointment-planner/client/components/date-cell.svelte rename to packages/web-components/src/appointment-planner-component/client/components/date-cell.svelte diff --git a/packages/web-components/src/appointment-planner/client/components/date-time-picker.svelte b/packages/web-components/src/appointment-planner-component/client/components/date-time-picker.svelte similarity index 100% rename from packages/web-components/src/appointment-planner/client/components/date-time-picker.svelte rename to packages/web-components/src/appointment-planner-component/client/components/date-time-picker.svelte diff --git a/packages/web-components/src/appointment-planner/client/components/time-cell.svelte b/packages/web-components/src/appointment-planner-component/client/components/time-cell.svelte similarity index 100% rename from packages/web-components/src/appointment-planner/client/components/time-cell.svelte rename to packages/web-components/src/appointment-planner-component/client/components/time-cell.svelte diff --git a/packages/web-components/src/appointment-planner/client/core/store/week-store/__tests__/derrived.test.ts b/packages/web-components/src/appointment-planner-component/client/core/store/week-store/__tests__/derrived.test.ts similarity index 100% rename from packages/web-components/src/appointment-planner/client/core/store/week-store/__tests__/derrived.test.ts rename to packages/web-components/src/appointment-planner-component/client/core/store/week-store/__tests__/derrived.test.ts diff --git a/packages/web-components/src/appointment-planner/client/core/store/week-store/__tests__/store.test.ts b/packages/web-components/src/appointment-planner-component/client/core/store/week-store/__tests__/store.test.ts similarity index 100% rename from packages/web-components/src/appointment-planner/client/core/store/week-store/__tests__/store.test.ts rename to packages/web-components/src/appointment-planner-component/client/core/store/week-store/__tests__/store.test.ts diff --git a/packages/web-components/src/appointment-planner/client/core/store/week-store/derrived.ts b/packages/web-components/src/appointment-planner-component/client/core/store/week-store/derrived.ts similarity index 100% rename from packages/web-components/src/appointment-planner/client/core/store/week-store/derrived.ts rename to packages/web-components/src/appointment-planner-component/client/core/store/week-store/derrived.ts diff --git a/packages/web-components/src/appointment-planner/client/core/store/week-store/index.ts b/packages/web-components/src/appointment-planner-component/client/core/store/week-store/index.ts similarity index 100% rename from packages/web-components/src/appointment-planner/client/core/store/week-store/index.ts rename to packages/web-components/src/appointment-planner-component/client/core/store/week-store/index.ts diff --git a/packages/web-components/src/appointment-planner/client/core/store/week-store/store.ts b/packages/web-components/src/appointment-planner-component/client/core/store/week-store/store.ts similarity index 100% rename from packages/web-components/src/appointment-planner/client/core/store/week-store/store.ts rename to packages/web-components/src/appointment-planner-component/client/core/store/week-store/store.ts diff --git a/packages/web-components/src/appointment-planner/server/api/__stubs__/appointments.ts b/packages/web-components/src/appointment-planner-component/server/api/__stubs__/appointments.ts similarity index 100% rename from packages/web-components/src/appointment-planner/server/api/__stubs__/appointments.ts rename to packages/web-components/src/appointment-planner-component/server/api/__stubs__/appointments.ts diff --git a/packages/web-components/src/appointment-planner/server/api/__tests__/get-appointment-slots.ts b/packages/web-components/src/appointment-planner-component/server/api/__tests__/get-appointment-slots.ts similarity index 100% rename from packages/web-components/src/appointment-planner/server/api/__tests__/get-appointment-slots.ts rename to packages/web-components/src/appointment-planner-component/server/api/__tests__/get-appointment-slots.ts diff --git a/packages/web-components/src/appointment-planner/server/api/__tests__/ping.ts b/packages/web-components/src/appointment-planner-component/server/api/__tests__/ping.ts similarity index 100% rename from packages/web-components/src/appointment-planner/server/api/__tests__/ping.ts rename to packages/web-components/src/appointment-planner-component/server/api/__tests__/ping.ts diff --git a/packages/web-components/src/appointment-planner/server/api/get-appointment-slots.ts b/packages/web-components/src/appointment-planner-component/server/api/get-appointment-slots.ts similarity index 100% rename from packages/web-components/src/appointment-planner/server/api/get-appointment-slots.ts rename to packages/web-components/src/appointment-planner-component/server/api/get-appointment-slots.ts diff --git a/packages/web-components/src/appointment-planner/server/api/ping.ts b/packages/web-components/src/appointment-planner-component/server/api/ping.ts similarity index 100% rename from packages/web-components/src/appointment-planner/server/api/ping.ts rename to packages/web-components/src/appointment-planner-component/server/api/ping.ts diff --git a/packages/web-components/src/appointment-planner/server/core/__tests__/index.ts b/packages/web-components/src/appointment-planner-component/server/core/__tests__/index.ts similarity index 100% rename from packages/web-components/src/appointment-planner/server/core/__tests__/index.ts rename to packages/web-components/src/appointment-planner-component/server/core/__tests__/index.ts diff --git a/packages/web-components/src/appointment-planner/server/core/__tests__/routes.ts b/packages/web-components/src/appointment-planner-component/server/core/__tests__/routes.ts similarity index 100% rename from packages/web-components/src/appointment-planner/server/core/__tests__/routes.ts rename to packages/web-components/src/appointment-planner-component/server/core/__tests__/routes.ts diff --git a/packages/web-components/src/appointment-planner/server/core/index.ts b/packages/web-components/src/appointment-planner-component/server/core/index.ts similarity index 100% rename from packages/web-components/src/appointment-planner/server/core/index.ts rename to packages/web-components/src/appointment-planner-component/server/core/index.ts diff --git a/packages/web-components/src/appointment-planner/server/core/routers.ts b/packages/web-components/src/appointment-planner-component/server/core/routers.ts similarity index 100% rename from packages/web-components/src/appointment-planner/server/core/routers.ts rename to packages/web-components/src/appointment-planner-component/server/core/routers.ts diff --git a/packages/web-components/src/appointment-planner/server/serverless.yml b/packages/web-components/src/appointment-planner-component/server/serverless.yml similarity index 96% rename from packages/web-components/src/appointment-planner/server/serverless.yml rename to packages/web-components/src/appointment-planner-component/server/serverless.yml index d5702b0408..cd0c90cfad 100644 --- a/packages/web-components/src/appointment-planner/server/serverless.yml +++ b/packages/web-components/src/appointment-planner-component/server/serverless.yml @@ -58,7 +58,7 @@ package: functions: searchWidgetHandler: - handler: src/appointment-planner/server/core/index.appointmentPlannerHandler + handler: src/appointment-planner-component/server/core/index.appointmentPlannerHandler events: - http: path: appointment-slots diff --git a/packages/web-components/src/appointment-bookings/client/components/__tests__/__snapshots__/appointment-bookings.test.ts.snap b/packages/web-components/src/book-valuation-widget/client/components/__tests__/__snapshots__/book-valuation-widget.test.ts.snap similarity index 54% rename from packages/web-components/src/appointment-bookings/client/components/__tests__/__snapshots__/appointment-bookings.test.ts.snap rename to packages/web-components/src/book-valuation-widget/client/components/__tests__/__snapshots__/book-valuation-widget.test.ts.snap index 302152d7de..3433285660 100644 --- a/packages/web-components/src/appointment-bookings/client/components/__tests__/__snapshots__/appointment-bookings.test.ts.snap +++ b/packages/web-components/src/book-valuation-widget/client/components/__tests__/__snapshots__/book-valuation-widget.test.ts.snap @@ -1,10 +1,10 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AppointmentBookings should match snapshot 1`] = ` +exports[`BookValuationWidget should match snapshot 1`] = `
diff --git a/packages/web-components/src/appointment-bookings/client/components/__tests__/__snapshots__/booking-confirmation-step3.test.ts.snap b/packages/web-components/src/book-valuation-widget/client/components/__tests__/__snapshots__/booking-confirmation-step3.test.ts.snap similarity index 100% rename from packages/web-components/src/appointment-bookings/client/components/__tests__/__snapshots__/booking-confirmation-step3.test.ts.snap rename to packages/web-components/src/book-valuation-widget/client/components/__tests__/__snapshots__/booking-confirmation-step3.test.ts.snap diff --git a/packages/web-components/src/appointment-bookings/client/components/__tests__/__snapshots__/form-step1.test.ts.snap b/packages/web-components/src/book-valuation-widget/client/components/__tests__/__snapshots__/form-step1.test.ts.snap similarity index 100% rename from packages/web-components/src/appointment-bookings/client/components/__tests__/__snapshots__/form-step1.test.ts.snap rename to packages/web-components/src/book-valuation-widget/client/components/__tests__/__snapshots__/form-step1.test.ts.snap diff --git a/packages/web-components/src/appointment-bookings/client/components/__tests__/appointment-bookings.test.ts b/packages/web-components/src/book-valuation-widget/client/components/__tests__/book-valuation-widget.test.ts similarity index 79% rename from packages/web-components/src/appointment-bookings/client/components/__tests__/appointment-bookings.test.ts rename to packages/web-components/src/book-valuation-widget/client/components/__tests__/book-valuation-widget.test.ts index 72e00249ca..4e08faf943 100644 --- a/packages/web-components/src/appointment-bookings/client/components/__tests__/appointment-bookings.test.ts +++ b/packages/web-components/src/book-valuation-widget/client/components/__tests__/book-valuation-widget.test.ts @@ -1,9 +1,9 @@ import { render } from '@testing-library/svelte' -import AppointmentBookings from '../appointment-bookings.svelte' +import BookValuationWidget from '../book-valuation-widget.svelte' const props = { theme: { - // appointment-bookings's specific styles + // book-valuation's specific styles dateCellHeaderBackgroundColor: '#ececec', timeCellBackgroundColor: '#dfdfdf', timeCellBackgroundColorHover: '#d3d3d3', @@ -32,12 +32,12 @@ const props = { desktop: '', }, }, - parentSelector: '#appointment-bookings', + parentSelector: '#book-valuation-widget', } -describe('AppointmentBookings', () => { +describe('BookValuationWidget', () => { it('should match snapshot', () => { - const { container } = render(AppointmentBookings, props) + const { container } = render(BookValuationWidget, props) expect(container).toMatchSnapshot() }) }) diff --git a/packages/web-components/src/appointment-bookings/client/components/__tests__/booking-confirmation-step3.test.ts b/packages/web-components/src/book-valuation-widget/client/components/__tests__/booking-confirmation-step3.test.ts similarity index 100% rename from packages/web-components/src/appointment-bookings/client/components/__tests__/booking-confirmation-step3.test.ts rename to packages/web-components/src/book-valuation-widget/client/components/__tests__/booking-confirmation-step3.test.ts diff --git a/packages/web-components/src/appointment-bookings/client/components/__tests__/form-step1.test.ts b/packages/web-components/src/book-valuation-widget/client/components/__tests__/form-step1.test.ts similarity index 100% rename from packages/web-components/src/appointment-bookings/client/components/__tests__/form-step1.test.ts rename to packages/web-components/src/book-valuation-widget/client/components/__tests__/form-step1.test.ts diff --git a/packages/web-components/src/appointment-bookings/client/components/appointment-bookings.svelte b/packages/web-components/src/book-valuation-widget/client/components/book-valuation-widget.svelte similarity index 78% rename from packages/web-components/src/appointment-bookings/client/components/appointment-bookings.svelte rename to packages/web-components/src/book-valuation-widget/client/components/book-valuation-widget.svelte index 59e93f4142..9efa565c61 100644 --- a/packages/web-components/src/appointment-bookings/client/components/appointment-bookings.svelte +++ b/packages/web-components/src/book-valuation-widget/client/components/book-valuation-widget.svelte @@ -3,9 +3,9 @@ import { onMount } from 'svelte' import ClickOutSide from '../../../common/components/click-out-side.svelte' import { resetCSS, generateThemeClasses } from '../../../common/styles' - import { generateAppointmentBookingThemeClasses } from '../core/theme' + import { generateBookValuationWidgetThemeClasses } from '../core/theme' import FormStep1 from './form-step1.svelte' - import PlannerStep2 from '../../../appointment-planner/client/components/appointment-planner.svelte' + import PlannerStep2 from '../../../appointment-planner-component/client/components/appointment-planner-component.svelte' import BookingConfirmationStep3 from './booking-confirmation-step3.svelte' import { handleSubmitFormStep2 } from '../handlers/submit-form-step2.ts' @@ -41,7 +41,7 @@ const themeClasses = { ...generateThemeClasses(theme, parentSelector), - ...generateAppointmentBookingThemeClasses(theme, parentSelector), + ...generateBookValuationWidgetThemeClasses(theme, parentSelector), } onMount(() => { @@ -50,7 +50,7 @@ - + {#if isModalOpen} -
+
-
+
{#if currentStep === 1} {/if} diff --git a/packages/web-components/src/appointment-bookings/client/components/booking-confirmation-step3.svelte b/packages/web-components/src/book-valuation-widget/client/components/booking-confirmation-step3.svelte similarity index 100% rename from packages/web-components/src/appointment-bookings/client/components/booking-confirmation-step3.svelte rename to packages/web-components/src/book-valuation-widget/client/components/booking-confirmation-step3.svelte diff --git a/packages/web-components/src/appointment-bookings/client/components/form-step1.svelte b/packages/web-components/src/book-valuation-widget/client/components/form-step1.svelte similarity index 100% rename from packages/web-components/src/appointment-bookings/client/components/form-step1.svelte rename to packages/web-components/src/book-valuation-widget/client/components/form-step1.svelte diff --git a/packages/web-components/src/appointment-bookings/client/core/__tests__/__snapshots__/index.test.ts.snap b/packages/web-components/src/book-valuation-widget/client/core/__tests__/__snapshots__/index.test.ts.snap similarity index 96% rename from packages/web-components/src/appointment-bookings/client/core/__tests__/__snapshots__/index.test.ts.snap rename to packages/web-components/src/book-valuation-widget/client/core/__tests__/__snapshots__/index.test.ts.snap index 91a5bed62f..f649ec886c 100644 --- a/packages/web-components/src/appointment-bookings/client/core/__tests__/__snapshots__/index.test.ts.snap +++ b/packages/web-components/src/book-valuation-widget/client/core/__tests__/__snapshots__/index.test.ts.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`ReapitAppointmentBookingComponent should match a snapshot 1`] = ` -Appointment_bookings { +exports[`ReapitBookValuationWidget should match a snapshot 1`] = ` +Book_valuation_widget { "$$": Object { "after_update": Array [], "before_update": Array [], diff --git a/packages/web-components/src/appointment-bookings/client/core/__tests__/index.test.ts b/packages/web-components/src/book-valuation-widget/client/core/__tests__/index.test.ts similarity index 86% rename from packages/web-components/src/appointment-bookings/client/core/__tests__/index.test.ts rename to packages/web-components/src/book-valuation-widget/client/core/__tests__/index.test.ts index c980b41c7c..be5c5246bc 100644 --- a/packages/web-components/src/appointment-bookings/client/core/__tests__/index.test.ts +++ b/packages/web-components/src/book-valuation-widget/client/core/__tests__/index.test.ts @@ -1,15 +1,15 @@ -import { ReapitAppointmentBookingComponent } from '../index' +import { ReapitBookValuationWidget } from '../index' -describe('ReapitAppointmentBookingComponent', () => { +describe('ReapitBookValuationWidget', () => { it('should match a snapshot', () => { expect( - ReapitAppointmentBookingComponent({ + ReapitBookValuationWidget({ variant: 'VALUATION', parentSelector: 'body', apiKey: 'test', theme: { navigateButtonColor: 'red', - // appointment-bookings's specific styles + // book-valuation's specific styles dateCellHeaderBackgroundColor: '#ececec', timeCellBackgroundColor: '#dfdfdf', timeCellBackgroundColorHover: '#d3d3d3', diff --git a/packages/web-components/src/book-valuation-widget/client/core/index.ts b/packages/web-components/src/book-valuation-widget/client/core/index.ts new file mode 100644 index 0000000000..10b0c89d54 --- /dev/null +++ b/packages/web-components/src/book-valuation-widget/client/core/index.ts @@ -0,0 +1,33 @@ +import BookValuationWidget from '../components/book-valuation-widget.svelte' +import { BookValuationWidgetInitializerTheme } from './theme' + +export interface BookValuationWidgetInitializers { + theme: BookValuationWidgetInitializerTheme + apiKey: string + // customerId: string + parentSelector: string + variant: 'VIEWING' | 'VALUATION' +} + +export const ReapitBookValuationWidget = ({ + parentSelector, + theme, + variant, +}: // apiKey, +// variant, +BookValuationWidgetInitializers) => + new BookValuationWidget({ + target: document.querySelector(parentSelector) || document.body, + props: { + theme, + // TODO - will need to reference later + // apiKey, + // customerId, + variant, + parentSelector, + }, + }) + +Object.defineProperty(window, 'ReapitBookValuationWidget', { + value: ReapitBookValuationWidget, +}) diff --git a/packages/web-components/src/appointment-bookings/client/core/store/form-store.ts b/packages/web-components/src/book-valuation-widget/client/core/store/form-store.ts similarity index 100% rename from packages/web-components/src/appointment-bookings/client/core/store/form-store.ts rename to packages/web-components/src/book-valuation-widget/client/core/store/form-store.ts diff --git a/packages/web-components/src/appointment-bookings/client/core/store/theme-store.ts b/packages/web-components/src/book-valuation-widget/client/core/store/theme-store.ts similarity index 66% rename from packages/web-components/src/appointment-bookings/client/core/store/theme-store.ts rename to packages/web-components/src/book-valuation-widget/client/core/store/theme-store.ts index 4b56e4461b..b6d59633bb 100644 --- a/packages/web-components/src/appointment-bookings/client/core/store/theme-store.ts +++ b/packages/web-components/src/book-valuation-widget/client/core/store/theme-store.ts @@ -1,7 +1,7 @@ import { writable } from 'svelte/store' -import { AppointmentBookingThemeClasses } from '../theme' +import { BookValuationWidgetThemeClasses } from '../theme' -export const themeStore = writable({ +export const themeStore = writable({ timeCell: '', svgNavigation: '', timeCellsContainer: '', diff --git a/packages/web-components/src/appointment-bookings/client/core/theme.ts b/packages/web-components/src/book-valuation-widget/client/core/theme.ts similarity index 93% rename from packages/web-components/src/appointment-bookings/client/core/theme.ts rename to packages/web-components/src/book-valuation-widget/client/core/theme.ts index 47352a3e65..5ad9898597 100644 --- a/packages/web-components/src/appointment-bookings/client/core/theme.ts +++ b/packages/web-components/src/book-valuation-widget/client/core/theme.ts @@ -1,7 +1,7 @@ import { css } from 'emotion' import { InitializerTheme } from '../../../common/styles/theme' -export interface AppointmentBookingThemeClasses { +export interface BookValuationWidgetThemeClasses { timeCell: string svgNavigation: string dateCellHeader: string @@ -15,7 +15,7 @@ export interface AppointmentBookingThemeClasses { formButtonSecondary: string } -export type AppointmentBookingInitializerTheme = InitializerTheme & { +export type BookValuationWidgetInitializerTheme = InitializerTheme & { timeCellBackgroundColor: string timeCellBackgroundColorHover: string navigateButtonColor: string @@ -26,7 +26,7 @@ export type AppointmentBookingInitializerTheme = InitializerTheme & { formButtonFontSize: string } -export const generateAppointmentBookingThemeClasses = ( +export const generateBookValuationWidgetThemeClasses = ( { basefontSize, primaryHeadingFontSize, @@ -41,7 +41,7 @@ export const generateAppointmentBookingThemeClasses = ( formLabelColor, formHrSeparatorFontColor, formButtonFontSize, - }: AppointmentBookingInitializerTheme, + }: BookValuationWidgetInitializerTheme, parentSelector: string, ) => { return { diff --git a/packages/web-components/src/appointment-bookings/client/handlers/__tests__/submit-form-step1.test.ts b/packages/web-components/src/book-valuation-widget/client/handlers/__tests__/submit-form-step1.test.ts similarity index 100% rename from packages/web-components/src/appointment-bookings/client/handlers/__tests__/submit-form-step1.test.ts rename to packages/web-components/src/book-valuation-widget/client/handlers/__tests__/submit-form-step1.test.ts diff --git a/packages/web-components/src/appointment-bookings/client/handlers/__tests__/submit-form-step2.test.ts b/packages/web-components/src/book-valuation-widget/client/handlers/__tests__/submit-form-step2.test.ts similarity index 100% rename from packages/web-components/src/appointment-bookings/client/handlers/__tests__/submit-form-step2.test.ts rename to packages/web-components/src/book-valuation-widget/client/handlers/__tests__/submit-form-step2.test.ts diff --git a/packages/web-components/src/appointment-bookings/client/handlers/__tests__/submit-form-step3.test.ts b/packages/web-components/src/book-valuation-widget/client/handlers/__tests__/submit-form-step3.test.ts similarity index 100% rename from packages/web-components/src/appointment-bookings/client/handlers/__tests__/submit-form-step3.test.ts rename to packages/web-components/src/book-valuation-widget/client/handlers/__tests__/submit-form-step3.test.ts diff --git a/packages/web-components/src/appointment-bookings/client/handlers/submit-form-step1.ts b/packages/web-components/src/book-valuation-widget/client/handlers/submit-form-step1.ts similarity index 100% rename from packages/web-components/src/appointment-bookings/client/handlers/submit-form-step1.ts rename to packages/web-components/src/book-valuation-widget/client/handlers/submit-form-step1.ts diff --git a/packages/web-components/src/appointment-bookings/client/handlers/submit-form-step2.ts b/packages/web-components/src/book-valuation-widget/client/handlers/submit-form-step2.ts similarity index 100% rename from packages/web-components/src/appointment-bookings/client/handlers/submit-form-step2.ts rename to packages/web-components/src/book-valuation-widget/client/handlers/submit-form-step2.ts diff --git a/packages/web-components/src/appointment-bookings/client/handlers/submit-form-step3.ts b/packages/web-components/src/book-valuation-widget/client/handlers/submit-form-step3.ts similarity index 100% rename from packages/web-components/src/appointment-bookings/client/handlers/submit-form-step3.ts rename to packages/web-components/src/book-valuation-widget/client/handlers/submit-form-step3.ts diff --git a/packages/web-components/src/book-valuation-widget/client/index.html b/packages/web-components/src/book-valuation-widget/client/index.html new file mode 100644 index 0000000000..e8345228fe --- /dev/null +++ b/packages/web-components/src/book-valuation-widget/client/index.html @@ -0,0 +1,37 @@ + + + +DEMO + + + + + + + Book a valuation +
+ + + + + + + + diff --git a/packages/web-components/src/appointment-bookings/client/styles/appointment-bookings.styles.ts b/packages/web-components/src/book-valuation-widget/client/styles/book-valuation-widget.styles.ts similarity index 100% rename from packages/web-components/src/appointment-bookings/client/styles/appointment-bookings.styles.ts rename to packages/web-components/src/book-valuation-widget/client/styles/book-valuation-widget.styles.ts diff --git a/packages/web-components/src/appointment-bookings/client/utils/__tests__/validator.test.ts b/packages/web-components/src/book-valuation-widget/client/utils/__tests__/validator.test.ts similarity index 100% rename from packages/web-components/src/appointment-bookings/client/utils/__tests__/validator.test.ts rename to packages/web-components/src/book-valuation-widget/client/utils/__tests__/validator.test.ts diff --git a/packages/web-components/src/appointment-bookings/client/utils/validator.ts b/packages/web-components/src/book-valuation-widget/client/utils/validator.ts similarity index 100% rename from packages/web-components/src/appointment-bookings/client/utils/validator.ts rename to packages/web-components/src/book-valuation-widget/client/utils/validator.ts diff --git a/packages/web-components/src/appointment-bookings/server/index.ts b/packages/web-components/src/book-valuation-widget/server/index.ts similarity index 100% rename from packages/web-components/src/appointment-bookings/server/index.ts rename to packages/web-components/src/book-valuation-widget/server/index.ts diff --git a/packages/web-components/src/viewing-booking/client/api/property.ts b/packages/web-components/src/book-viewing-widget/client/api/property.ts similarity index 100% rename from packages/web-components/src/viewing-booking/client/api/property.ts rename to packages/web-components/src/book-viewing-widget/client/api/property.ts diff --git a/packages/web-components/src/viewing-booking/client/components/__tests__/__snapshots__/viewing-booking.ts.snap b/packages/web-components/src/book-viewing-widget/client/components/__tests__/__snapshots__/book-viewing-widget.test.ts.snap similarity index 56% rename from packages/web-components/src/viewing-booking/client/components/__tests__/__snapshots__/viewing-booking.ts.snap rename to packages/web-components/src/book-viewing-widget/client/components/__tests__/__snapshots__/book-viewing-widget.test.ts.snap index 075b71ca89..83851ea848 100644 --- a/packages/web-components/src/viewing-booking/client/components/__tests__/__snapshots__/viewing-booking.ts.snap +++ b/packages/web-components/src/book-viewing-widget/client/components/__tests__/__snapshots__/book-viewing-widget.test.ts.snap @@ -1,10 +1,10 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`viewing-booking it matches a snapshot 1`] = ` +exports[`BookViewingWidget it matches a snapshot 1`] = `
diff --git a/packages/web-components/src/viewing-booking/client/components/__tests__/viewing-booking.ts b/packages/web-components/src/book-viewing-widget/client/components/__tests__/book-viewing-widget.test.ts similarity index 80% rename from packages/web-components/src/viewing-booking/client/components/__tests__/viewing-booking.ts rename to packages/web-components/src/book-viewing-widget/client/components/__tests__/book-viewing-widget.test.ts index 49869790b7..559578c5c4 100644 --- a/packages/web-components/src/viewing-booking/client/components/__tests__/viewing-booking.ts +++ b/packages/web-components/src/book-viewing-widget/client/components/__tests__/book-viewing-widget.test.ts @@ -1,11 +1,11 @@ -import ViewingBooking from '../viewing-booking.svelte' +import BookViewingWidget from '../book-viewing-widget.svelte' import { render } from '@testing-library/svelte' -describe('viewing-booking', () => { +describe('BookViewingWidget', () => { it('it matches a snapshot', () => { - const wrapper = render(ViewingBooking, { + const wrapper = render(BookViewingWidget, { apiKey: '', - parentSelector: '#appointment-bookings-viewing', + parentSelector: '#book-viewing-widget', theme: { baseBackgroundColor: '#f9fbfd', basefontSize: '14px', diff --git a/packages/web-components/src/viewing-booking/client/components/viewing-booking.svelte b/packages/web-components/src/book-viewing-widget/client/components/book-viewing-widget.svelte similarity index 83% rename from packages/web-components/src/viewing-booking/client/components/viewing-booking.svelte rename to packages/web-components/src/book-viewing-widget/client/components/book-viewing-widget.svelte index a434819458..c1684da44b 100644 --- a/packages/web-components/src/viewing-booking/client/components/viewing-booking.svelte +++ b/packages/web-components/src/book-viewing-widget/client/components/book-viewing-widget.svelte @@ -77,28 +77,28 @@ - +
@@ -156,20 +156,20 @@ {propertyData && propertyData.price}
-
+

To book a viewing, please enter your e-mail below.

- + {#if !correctEmail} - Please enter a valid e-mail address + Please enter a valid e-mail address {/if}
-
+
diff --git a/packages/web-components/src/viewing-booking/client/components/modal.svelte b/packages/web-components/src/book-viewing-widget/client/components/modal.svelte similarity index 100% rename from packages/web-components/src/viewing-booking/client/components/modal.svelte rename to packages/web-components/src/book-viewing-widget/client/components/modal.svelte diff --git a/packages/web-components/src/viewing-booking/client/core/__tests__/__snapshots__/index.ts.snap b/packages/web-components/src/book-viewing-widget/client/core/__tests__/__snapshots__/index.ts.snap similarity index 73% rename from packages/web-components/src/viewing-booking/client/core/__tests__/__snapshots__/index.ts.snap rename to packages/web-components/src/book-viewing-widget/client/core/__tests__/__snapshots__/index.ts.snap index c63c3a145f..0f5358d247 100644 --- a/packages/web-components/src/viewing-booking/client/core/__tests__/__snapshots__/index.ts.snap +++ b/packages/web-components/src/book-viewing-widget/client/core/__tests__/__snapshots__/index.ts.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`ReactViewingWidgetComponent test match snapshot 1`] = ` -Viewing_booking { +exports[`ReapitBookViewingWidget test match snapshot 1`] = ` +Book_viewing_widget { "$$": Object { "after_update": Array [], "before_update": Array [], @@ -19,21 +19,21 @@ Viewing_booking { "css-cb9zl5", true, Object { - "bodyText": "css-n0w2qa", - "button": "css-l8x1wu", - "formError": "css-1yx8977", + "bodyText": "css-1s7agtc", + "button": "css-530o6s", + "formError": "css-jk7gti", "globalStyles": "css-11c02ub", - "input": "css-1sj9ihm", - "offerBanner": "css-s4b31o", - "pagination": "css-1sys580", - "paginationActive": "css-1sys580", - "primaryHeading": "css-ayk9xy", - "primaryStrapline": "css-1d7j4w6", - "resultItem": "css-2mowv6", - "searchBox": "css-81h19r", - "secondaryHeading": "css-1qz6ie0", - "secondaryStrapline": "css-1kep8ws", - "selectedItem": "css-1w110sd", + "input": "css-1r0d1l7", + "offerBanner": "css-oj5n5b", + "pagination": "css-1p19gh5", + "paginationActive": "css-1p19gh5", + "primaryHeading": "css-188c796", + "primaryStrapline": "css-yhrhqb", + "resultItem": "css-qx9ywv", + "searchBox": "css-wj8gdl", + "secondaryHeading": "css-1i87i9v", + "secondaryStrapline": "css-1qajcp3", + "selectedItem": "css-5vflfd", }, [Function], [Function], @@ -60,7 +60,7 @@ Viewing_booking { }, "", "", - "#appointment-bookings-viewing", + "#book-viewing-widget", undefined, ], "dirty": Array [ diff --git a/packages/web-components/src/viewing-booking/client/core/__tests__/index.ts b/packages/web-components/src/book-viewing-widget/client/core/__tests__/index.ts similarity index 80% rename from packages/web-components/src/viewing-booking/client/core/__tests__/index.ts rename to packages/web-components/src/book-viewing-widget/client/core/__tests__/index.ts index b968d8be0e..e71a6b3c29 100644 --- a/packages/web-components/src/viewing-booking/client/core/__tests__/index.ts +++ b/packages/web-components/src/book-viewing-widget/client/core/__tests__/index.ts @@ -1,12 +1,12 @@ -import { ReapitViewingBookingComponent } from '../index' +import { ReapitBookViewingWidget } from '../index' -describe('ReactViewingWidgetComponent', () => { +describe('ReapitBookViewingWidget', () => { it('test match snapshot', () => { expect( - ReapitViewingBookingComponent({ + ReapitBookViewingWidget({ apiKey: '', customerId: '', - parentSelector: '#appointment-bookings-viewing', + parentSelector: '#book-viewing-widget', theme: { baseBackgroundColor: '#f9fbfd', basefontSize: '14px', diff --git a/packages/web-components/src/viewing-booking/client/core/__tests__/store.ts b/packages/web-components/src/book-viewing-widget/client/core/__tests__/store.ts similarity index 87% rename from packages/web-components/src/viewing-booking/client/core/__tests__/store.ts rename to packages/web-components/src/book-viewing-widget/client/core/__tests__/store.ts index 565af790ca..34c4fd7e60 100644 --- a/packages/web-components/src/viewing-booking/client/core/__tests__/store.ts +++ b/packages/web-components/src/book-viewing-widget/client/core/__tests__/store.ts @@ -1,4 +1,4 @@ -import viewingBookingStore from '../store' +import bookViewingWidgetStore from '../store' describe('store', () => { it('should return a default store', () => { @@ -30,7 +30,7 @@ describe('store', () => { formError: '', }, } - const unsubscribe = viewingBookingStore.subscribe(store => { + const unsubscribe = bookViewingWidgetStore.subscribe(store => { expect(store).toEqual(expected) }) unsubscribe() diff --git a/packages/web-components/src/viewing-booking/client/core/index.ts b/packages/web-components/src/book-viewing-widget/client/core/index.ts similarity index 58% rename from packages/web-components/src/viewing-booking/client/core/index.ts rename to packages/web-components/src/book-viewing-widget/client/core/index.ts index b0d46bbd0f..4acd8f96b2 100644 --- a/packages/web-components/src/viewing-booking/client/core/index.ts +++ b/packages/web-components/src/book-viewing-widget/client/core/index.ts @@ -1,4 +1,4 @@ -import ViewingBooking from '../components/viewing-booking.svelte' +import BookViewingWidget from '../components/book-viewing-widget.svelte' import { InitializerTheme } from '../../../common/styles/index' export interface PropertyData { @@ -6,20 +6,20 @@ export interface PropertyData { address: string price: string } -export interface ViewingBookingInitializers { +export interface BookViewingWidgetInitializers { theme: Partial apiKey: string customerId: string parentSelector: string } -export const ReapitViewingBookingComponent = ({ +export const ReapitBookViewingWidget = ({ parentSelector, apiKey, customerId, theme, -}: ViewingBookingInitializers) => { - return new ViewingBooking({ +}: BookViewingWidgetInitializers) => { + return new BookViewingWidget({ target: document.querySelector(parentSelector) || document.body, props: { theme, @@ -30,6 +30,6 @@ export const ReapitViewingBookingComponent = ({ }) } -Object.defineProperty(window, 'ReapitViewingBookingComponent', { - value: ReapitViewingBookingComponent, +Object.defineProperty(window, 'ReapitBookViewingWidget', { + value: ReapitBookViewingWidget, }) diff --git a/packages/web-components/src/viewing-booking/client/core/store.ts b/packages/web-components/src/book-viewing-widget/client/core/store.ts similarity index 73% rename from packages/web-components/src/viewing-booking/client/core/store.ts rename to packages/web-components/src/book-viewing-widget/client/core/store.ts index f75a94e24e..7b255b494a 100644 --- a/packages/web-components/src/viewing-booking/client/core/store.ts +++ b/packages/web-components/src/book-viewing-widget/client/core/store.ts @@ -1,9 +1,9 @@ import { writable, Writable } from 'svelte/store' -import { ViewingBookingInitializers, PropertyData } from './index' +import { BookViewingWidgetInitializers, PropertyData } from './index' import { ThemeClasses } from '../../../common/styles' -export interface ViewingBookingStore { - initializers: ViewingBookingInitializers +export interface BookViewingWidgetStore { + initializers: BookViewingWidgetInitializers themeClasses: ThemeClasses email: string @@ -11,7 +11,7 @@ export interface ViewingBookingStore { isLoading: boolean } -const viewBookingStore: Writable = writable({ +const bookViewingWigetStore: Writable = writable({ initializers: { apiKey: '', customerId: '', @@ -44,4 +44,4 @@ const viewBookingStore: Writable = writable({ }, }) -export default viewBookingStore +export default bookViewingWigetStore diff --git a/packages/web-components/src/viewing-booking/client/index.html b/packages/web-components/src/book-viewing-widget/client/index.html similarity index 60% rename from packages/web-components/src/viewing-booking/client/index.html rename to packages/web-components/src/book-viewing-widget/client/index.html index 70f94ca708..ca4c3ea639 100644 --- a/packages/web-components/src/viewing-booking/client/index.html +++ b/packages/web-components/src/book-viewing-widget/client/index.html @@ -7,9 +7,9 @@ href="https://fonts.googleapis.com/css?family=Montserrat|Open+Sans|Roboto|Roboto+Slab&display=swap" rel="stylesheet" /> - + + + + +
+ + + + + + diff --git a/packages/web-components/src/property-detail/server/index.ts b/packages/web-components/src/property-detail-widget/server/index.ts similarity index 100% rename from packages/web-components/src/property-detail/server/index.ts rename to packages/web-components/src/property-detail-widget/server/index.ts diff --git a/packages/web-components/src/property-detail/client/detail.html b/packages/web-components/src/property-detail/client/detail.html deleted file mode 100644 index 5983dd9fa4..0000000000 --- a/packages/web-components/src/property-detail/client/detail.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - DEMO - - - - - - - -
- - - - - - diff --git a/packages/web-components/src/search-widget/client/core/__tests__/__snapshots__/index.ts.snap b/packages/web-components/src/search-widget/client/core/__tests__/__snapshots__/index.ts.snap index 6ee1866e88..b0f23f2359 100644 --- a/packages/web-components/src/search-widget/client/core/__tests__/__snapshots__/index.ts.snap +++ b/packages/web-components/src/search-widget/client/core/__tests__/__snapshots__/index.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`ReapitSearchWidgetComponent should match a snapshot 1`] = ` +exports[`ReapitSearchWidget should match a snapshot 1`] = ` Search_widget { "$$": Object { "after_update": Array [], diff --git a/packages/web-components/src/search-widget/client/core/__tests__/index.ts b/packages/web-components/src/search-widget/client/core/__tests__/index.ts index e58fc53868..37c3174ea2 100644 --- a/packages/web-components/src/search-widget/client/core/__tests__/index.ts +++ b/packages/web-components/src/search-widget/client/core/__tests__/index.ts @@ -1,10 +1,10 @@ -import { ReapitSearchWidgetComponent } from '../index' +import { ReapitSearchWidget } from '../index' import { stubTheme } from '../../utils/__stubs__/theme' -describe('ReapitSearchWidgetComponent', () => { +describe('ReapitSearchWidget', () => { it('should match a snapshot', () => { expect( - ReapitSearchWidgetComponent({ + ReapitSearchWidget({ parentSelector: '#search-widget', apiKey: 'SOME_KEY', customerId: 'DEMO', diff --git a/packages/web-components/src/search-widget/client/core/index.ts b/packages/web-components/src/search-widget/client/core/index.ts index ab49e1f746..66719bf2f9 100644 --- a/packages/web-components/src/search-widget/client/core/index.ts +++ b/packages/web-components/src/search-widget/client/core/index.ts @@ -9,7 +9,7 @@ export interface SearchWidgeInitializers { detailPageUrl: string } -export const ReapitSearchWidgetComponent = ({ +export const ReapitSearchWidget = ({ parentSelector, apiKey, customerId, @@ -27,6 +27,6 @@ export const ReapitSearchWidgetComponent = ({ }, }) -Object.defineProperty(window, 'ReapitSearchWidgetComponent', { - value: ReapitSearchWidgetComponent, +Object.defineProperty(window, 'ReapitSearchWidget', { + value: ReapitSearchWidget, }) diff --git a/packages/web-components/src/search-widget/client/index.html b/packages/web-components/src/search-widget/client/index.html index c0dc120de9..2004811bc4 100644 --- a/packages/web-components/src/search-widget/client/index.html +++ b/packages/web-components/src/search-widget/client/index.html @@ -17,8 +17,8 @@