Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: encheres-immo/auction-widget
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: @encheres-immo/[email protected]
Choose a base ref
...
head repository: encheres-immo/auction-widget
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 19 commits
  • 35 files changed
  • 3 contributors

Commits on Jan 24, 2025

  1. fix(auth): remove params from redirect url (#53)

    * fix(auth): remove params from redirect url
    fixes #52
    
    * fix test
    
    * add test
    goulvenclech authored Jan 24, 2025

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    087dcf5 View commit details
  2. feat(auth): reuse access token (#56)

    fixes #47 & add prefix to console logs
    goulvenclech authored Jan 24, 2025
    Copy the full SHA
    d258d9a View commit details

Commits on Jan 27, 2025

  1. feat(BidForm): dynamically update visibility (#57)

    * feat(BidForm): dinamically update visibility
    
    * typo
    goulvenclech authored Jan 27, 2025
    Copy the full SHA
    5ff5c88 View commit details
  2. update minor deps

    goulvenclech committed Jan 27, 2025
    Copy the full SHA
    27ee4b9 View commit details

Commits on Jan 28, 2025

  1. feat: allow-user-registration allows to create an account (#58)

    * feat: allow-user-registration allows to create an account
    Fixes #51
    
    * changeset
    goulvenclech authored Jan 28, 2025
    Copy the full SHA
    47af2eb View commit details
  2. misc: source map & npm files (#59)

    goulvenclech authored Jan 28, 2025
    Copy the full SHA
    5d8a8db View commit details
  3. hotfix(auth): typo in registration url

    goulvenclech committed Jan 28, 2025
    Copy the full SHA
    46c0abd View commit details
  4. [ci] release (#54)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    github-actions[bot] and github-actions[bot] authored Jan 28, 2025
    Copy the full SHA
    f705782 View commit details

Commits on Jan 29, 2025

  1. fix(auth): registration link client id

    goulvenclech committed Jan 29, 2025
    Copy the full SHA
    94ce534 View commit details

Commits on Jan 30, 2025

  1. [ci] release (#60)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    github-actions[bot] and github-actions[bot] authored Jan 30, 2025
    Copy the full SHA
    8f2a08b View commit details

Commits on Feb 13, 2025

  1. Fix(bid history): dynamic after auction start (#61)

    * fix(BidHistory): dynamic after auction start
    
    * changeset
    goulvenclech authored Feb 13, 2025
    Copy the full SHA
    8defdd5 View commit details
  2. [ci] release (#62)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    github-actions[bot] and github-actions[bot] authored Feb 13, 2025
    Copy the full SHA
    7fab5a9 View commit details

Commits on Feb 19, 2025

  1. fix(style): icons display on chrome and safari

    goulvenclech committed Feb 19, 2025
    Copy the full SHA
    f3b2472 View commit details

Commits on Feb 20, 2025

  1. fix(BidForm): bid input default value update (#64)

    goulvenclech authored Feb 20, 2025
    Copy the full SHA
    30761e6 View commit details
  2. [ci] release (#63)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    github-actions[bot] and github-actions[bot] authored Feb 20, 2025
    Copy the full SHA
    2428538 View commit details

Commits on Mar 5, 2025

  1. feat(auction-widget): update using auction status (#65)

    * use status instead of clock
    
    * add test fast bid buttons labels
    
    * okay i made a banger
    
    * changeset
    goulvenclech authored Mar 5, 2025
    Copy the full SHA
    5c3c0f4 View commit details
  2. update deps

    goulvenclech committed Mar 5, 2025
    Copy the full SHA
    b16720f View commit details

Commits on Mar 6, 2025

  1. feat(aution_widget): dynamic update on status and form (#68)

    goulvenclech authored Mar 6, 2025
    Copy the full SHA
    fa03b35 View commit details
  2. [ci] release (#66)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    github-actions[bot] and github-actions[bot] authored Mar 6, 2025
    Copy the full SHA
    23c4538 View commit details
Showing with 2,378 additions and 1,446 deletions.
  1. +2 −2 example/package.json
  2. +1 −1 package.json
  3. +45 −0 packages/auction-widget/CHANGELOG.md
  4. +4 −4 packages/auction-widget/README.md
  5. +6 −1 packages/auction-widget/assets/app.css
  6. +1 −0 packages/auction-widget/esbuild.config.mjs
  7. +15 −9 packages/auction-widget/package.json
  8. +31 −27 packages/auction-widget/src/App.tsx
  9. +44 −79 packages/auction-widget/src/AuctionInfos.tsx
  10. +19 −10 packages/auction-widget/src/BidForm.tsx
  11. +83 −63 packages/auction-widget/src/BidHistory.tsx
  12. +23 −8 packages/auction-widget/src/ParticipateBox.tsx
  13. +11 −5 packages/auction-widget/src/RegistrationStatus.tsx
  14. +134 −0 packages/auction-widget/src/hooks/useAuctionTimer.ts
  15. +8 −16 packages/auction-widget/src/utils.tsx
  16. +137 −4 packages/auction-widget/tests/AuctionInfos.test.tsx
  17. +286 −9 packages/auction-widget/tests/BidForm.test.tsx
  18. +37 −4 packages/auction-widget/tests/BidHistory.test.tsx
  19. +26 −2 packages/auction-widget/tests/ParticipateBox.test.tsx
  20. +144 −2 packages/auction-widget/tests/RegistrationStatus.test.tsx
  21. +1 −0 packages/auction-widget/tests/test-utils.ts
  22. +2 −1 packages/auction-widget/tsconfig.json
  23. +3 −0 packages/auction-widget/vitest.config.ts
  24. +24 −0 packages/widget-client/CHANGELOG.md
  25. +9 −4 packages/widget-client/index.ts
  26. +10 −5 packages/widget-client/package.json
  27. +6 −5 packages/widget-client/src/auctions.ts
  28. +44 −11 packages/widget-client/src/auth.ts
  29. +2 −2 packages/widget-client/src/bids.ts
  30. +8 −4 packages/widget-client/tests/auction.test.ts
  31. +58 −9 packages/widget-client/tests/auth.test.ts
  32. +8 −2 packages/widget-client/tests/bids.test.ts
  33. +2 −1 packages/widget-client/tsconfig.json
  34. +1 −0 packages/widget-client/types.ts
  35. +1,143 −1,156 pnpm-lock.yaml
4 changes: 2 additions & 2 deletions example/package.json
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
"dependencies": {
"@astrojs/check": "^0.9.4",
"@encheres-immo/auction-widget": "workspace:*",
"astro": "^5.1.5",
"typescript": "^5.7.3"
"astro": "^5.4.2",
"typescript": "^5.8.2"
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -12,6 +12,6 @@
"pnpm": ">=8.0.0"
},
"dependencies": {
"@changesets/cli": "^2.27.10"
"@changesets/cli": "^2.28.1"
}
}
45 changes: 45 additions & 0 deletions packages/auction-widget/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,50 @@
# @encheres-immo/auction-widget

## 0.6.4

### Patch Changes

- 5c3c0f4: Fixed a bug where auction informations were not always updated dynamically. Also, performance improvements.
- Updated dependencies [5c3c0f4]
- @encheres-immo/widget-client@0.6.0

## 0.6.3

### Patch Changes

- f3b2472: Fixed a bug where icons were not displayed correctly on Chrome and Safari. Thanks @Princesseuh !
- 30761e6: Fixed a bug where the bid input's default value was not updated correctly when new bids were placed.

## 0.6.2

### Patch Changes

- 8defdd5: Fixed a bug not dynamically updating the bid history at auction start.

## 0.6.1

### Patch Changes

- Updated dependencies [94ce534]
- @encheres-immo/widget-client@0.5.1

## 0.6.0

### Minor Changes

- d258d9a: Added automatic reconnection for recently logged-in users.
- 47af2eb: Added a link to create an account when `allow-user-registration` is set to `true`. If false, the agent's contact information will be displayed instead.

### Patch Changes

- 5ff5c88: Fixed a bug where the bid form visibility was not dynamically updated when the auction started or ended.
- 5d8a8db: Added source map for better debugging, and reduced package size when downloaded from npm. Should not affect behaviour and performance in usage.
- Updated dependencies [d258d9a]
- Updated dependencies [5d8a8db]
- Updated dependencies [47af2eb]
- Updated dependencies [087dcf5]
- @encheres-immo/widget-client@0.5.0

## 0.5.0

### Minor Changes
8 changes: 4 additions & 4 deletions packages/auction-widget/README.md
Original file line number Diff line number Diff line change
@@ -69,10 +69,10 @@ Alternatively, you can retrieve your property from a CRM by replacing `property-

You can enable or disable features of the widget by setting the corresponding attributes on the HTML tag. Here are the available features:

| Attribute | Default | Description |
| ------------------------- | ------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `allow-user-registration` | `true` | Display a button to allow users to register for the auction—This registration must be accepted by the agent later, or the user will not be able to place bids. If set to `false`, agent's contact information will be displayed instead. |
| `tos-url` | `https://encheres-immo.com/cgu` | URL to your custom terms of service page for auctions, must be a valid URL and confirmed by Enchères Immo. |
| Attribute | Default | Description |
| ------------------------- | ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `allow-user-registration` | `true` | Display a button to allow users to create an account and register for the auction—This registration must be accepted by the agent later, or the user will not be able to place bids. If set to `false`, agent's contact information will be displayed instead. |
| `tos-url` | `https://encheres-immo.com/cgu` | URL to your custom terms of service page for auctions, must be a valid URL and confirmed by Enchères Immo. |

### Styling

7 changes: 6 additions & 1 deletion packages/auction-widget/assets/app.css
Original file line number Diff line number Diff line change
@@ -292,6 +292,10 @@
background-color: var(--auction-widget-dark-color);
}

.auction-widget-icon svg {
fill: currentColor;
}

#auction-widget-modal-title {
font-size: 1.125rem;
font-weight: 700;
@@ -452,7 +456,8 @@
*/
@layer auction-widget-base {
#auction-widget-box,
#auction-widget-box * {
#auction-widget-box *,
:not(svg|*) {
/* Reset all styles to their browser defaults */
all: revert;
/* Set here the styles that we want to herit from the host page */
1 change: 1 addition & 0 deletions packages/auction-widget/esbuild.config.mjs
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@ async function build() {
bundle: true,
outfile: "dist/auction-widget.js",
plugins: [solidPlugin()],
sourcemap: true,
};

if (!isDev) {
24 changes: 15 additions & 9 deletions packages/auction-widget/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "@encheres-immo/auction-widget",
"version": "0.5.0",
"version": "0.6.4",
"type": "module",
"description": "Bring our real-estate auction widget to your website, powered by SolidJS & Enchères Immo's API",
"scripts": {
"build": "node esbuild.config.mjs",
"watch": "node esbuild.config.mjs --watch",
"test": "vitest"
},
"license": "MIT",
@@ -16,23 +17,28 @@
".": "./dist/auction-widget.js",
"./dist/auction-widget.css": "./dist/auction-widget.css"
},
"files": [
"dist",
"README.md",
"CHANGELOG.md"
],
"devDependencies": {
"@solidjs/testing-library": "^0.8.10",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/user-event": "^14.5.2",
"babel-preset-solid": "^1.9.3",
"esbuild": "^0.24.2",
"@testing-library/user-event": "^14.6.1",
"babel-preset-solid": "^1.9.5",
"esbuild": "^0.25.0",
"esbuild-plugin-solid": "^0.6.0",
"prettier-plugin-tailwindcss": "^0.6.9",
"prettier-plugin-tailwindcss": "^0.6.11",
"solid-devtools": "^0.33.0",
"tslib": "^2.8.1",
"typescript": "^5.7.3",
"vite": "^6.0.7",
"vite-plugin-solid": "^2.11.0",
"typescript": "^5.8.2",
"vite": "^6.2.0",
"vite-plugin-solid": "^2.11.6",
"vitest": "^2.1.8"
},
"dependencies": {
"@encheres-immo/widget-client": "workspace:*",
"solid-js": "^1.9.4"
"solid-js": "^1.9.5"
}
}
58 changes: 31 additions & 27 deletions packages/auction-widget/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Component } from "solid-js";
import { createStore } from "solid-js/store";
import client from "@encheres-immo/widget-client";
import { Show, createSignal } from "solid-js";
import { Show, createSignal, onMount } from "solid-js";
import "../assets/app.css";

import AuctionInfos from "./AuctionInfos.jsx";
@@ -24,6 +24,7 @@ const [user, setUser] = createSignal<UserType | undefined>(undefined);
const [bids, setBids] = createStore<BidType[]>([]);
const [auction, setAuction] = createStore<AuctionType>({
id: "",
status: "draft",
startDate: 0,
endDate: 0,
startingPrice: 0,
@@ -59,31 +60,34 @@ const [auction, setAuction] = createStore<AuctionType>({
function refreshAuction(propertyInfo: PropertyInfoType) {
client.getNextAuctionById(propertyInfo).then((auction: AuctionType) => {
setAuction(auction);
setBids(auction.bids);

client
.subscribeToAuction(auction.id, (bid) => {
setBids([...bids, bid]);
// dispatch event for external integrations
const event = new CustomEvent("auction-widget:new_bid", {
detail: {
amount: bid.amount,
bidder: bid.userAnonymousId,
date: bid.createdAt,
},
});
document.getElementById("auction-widget")?.dispatchEvent(event);
// replace highest bid in auction
const newEndDate = bid.newEndDate || auction.endDate;
setAuction({
...auction,
highestBid: bid,
endDate: newEndDate,
// Don't try to subscribe to private auctions before user is logged in
// It won't break the app, but it will throw an error in the console
if (!auction?.isPrivate) {
setBids(auction.bids);
client
.subscribeToAuction(auction.id, (bid) => {
setBids([...bids, bid]);
// dispatch event for external integrations
const event = new CustomEvent("auction-widget:new_bid", {
detail: {
amount: bid.amount,
bidder: bid.userAnonymousId,
date: bid.createdAt,
},
});
document.getElementById("auction-widget")?.dispatchEvent(event);
// replace highest bid in auction and update end date if needed
const newEndDate = bid.newEndDate || auction.endDate;
setAuction({
...auction,
highestBid: bid,
endDate: newEndDate,
});
})
.catch((err: any) => {
console.error("Auction Widget: Error subscribing to auction.", err);
});
})
.catch((err: any) => {
console.error("Error subscribing to auction:", err);
});
}
});
}

@@ -145,9 +149,9 @@ const App: Component<{
allowUserRegistration={allowUserRegistration}
tosUrl={tosUrl}
/>
<RegistrationStatus isLogged={isLogged} auction={auction} />
<RegistrationStatus auction={auction} isLogged={isLogged} />
<BidForm auction={auction} isLogged={isLogged} />
<BidHistory bids={bids} auction={auction} user={user()} />
<BidHistory auction={auction} bids={bids} user={user()} />
</Show>
<Spritesheet />
</div>
Loading