Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] arta estimates widget #14751

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
"styled-components": "^6.1.13"
},
"dependencies": {
"@artaio/arta-browser": "^2.13.0",
"@artsy/cohesion": "4.214.0",
"@artsy/commerce_helpers": "artsy/commerce_helpers",
"@artsy/detect-responsive-traits": "^0.1.0",
Expand Down Expand Up @@ -287,6 +288,7 @@
"chai": "4.0.0",
"chai-passport-strategy": "^3.0.0",
"concurrently": "^6.2.0",
"css-loader": "^7.1.2",
"csstype": "3.0.7",
"cypress": "10.7.0",
"danger": "^10.9.0",
Expand Down Expand Up @@ -335,7 +337,7 @@
"sinon": "1.17.7",
"size-plugin": "^3.0.0",
"storybook-states": "1.2.0",
"style-loader": "0.23.1",
"style-loader": "^4.0.0",
"swc-loader": "^0.2.3",
"terser-webpack-plugin": "5.1.3",
"time-fix-plugin": "^2.0.7",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import { ArtworkSidebarBiddingClosedMessageFragmentContainer } from "Apps/Artwor
import { lotIsClosed } from "Apps/Artwork/Utils/lotIsClosed"
import CheckmarkStrokeIcon from "@artsy/icons/CheckmarkStrokeIcon"
import CloseStrokeIcon from "@artsy/icons/CloseStrokeIcon"
import Arta from "@artaio/arta-browser"
// import { ArtaObject } from "@artaio/arta-browser/dist/MetadataTypes"

export interface ArtworkSidebarCurrentBidInfoProps {
artwork: ArtworkSidebarCurrentBidInfo_artwork$data
Expand Down Expand Up @@ -117,12 +119,38 @@ export const ArtworkSidebarCurrentBidInfo: React.FC<ArtworkSidebarCurrentBidInfo

const CurrentBid = currentBidChanged ? TextWithPulse : Text

//const objects: ArtaObject[] = [
// {
//height: 24,
//subtype: "painting_unframed",
//unit_of_measurement: "in",
//value_currency: "USD",
//value: 100.0,
//weight: 2,
//weight_unit: "lb",
//width: 36,
//},
// //]

//const origin = {
//address_line_1: "87 Richardson St",
//city: "Brooklyn",
//region: "NY",
//country: "US",
//postal_code: "11249",
// //}

//const requestSettings = {
//origin,
//objects,
// }
Arta.init("test")
//const estimate = Arta.estimate(requestSettings)

return (
<>
{dialogComponent}

<Spacer y={2} />

<Flex width="100%" flexDirection="row" justifyContent="space-between">
<Text variant="lg-display" pr={1}>
{bidsPresent ? "Current bid" : "Starting bid"}
Expand All @@ -149,7 +177,6 @@ export const ArtworkSidebarCurrentBidInfo: React.FC<ArtworkSidebarCurrentBidInfo
</CurrentBid>
</Flex>
</Flex>

{(bidText || myMaxBid) && (
<Flex width="100%" flexDirection="row" justifyContent="space-between">
{bidText && (
Expand All @@ -165,15 +192,12 @@ export const ArtworkSidebarCurrentBidInfo: React.FC<ArtworkSidebarCurrentBidInfo
)}
</Flex>
)}

{!!lotWatcherCount && (
<Text variant="xs" color="black100">
{lotWatcherCount} {lotWatcherCount === 1 ? "watcher" : "watchers"}
</Text>
)}

<Spacer y={2} />

{artwork.sale && artwork.sale.is_with_buyers_premium && (
<>
<Spacer y={1} />
Expand Down
11 changes: 9 additions & 2 deletions webpack/envs/clientDevelopmentConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ import webpack from "webpack"
import { basePath, webpackEnv } from "../webpackEnv"
import { splitChunks } from "../bundleSplitting"
import { sharedPlugins } from "../sharedPlugins"
import { babelLoader, ejsLoader, mjsLoader, swcLoader } from "../sharedLoaders"
import {
babelLoader,
ejsLoader,
mjsLoader,
swcLoader,
cssLoader,
} from "../sharedLoaders"

import {
cache,
Expand Down Expand Up @@ -48,10 +54,11 @@ export const clientDevelopmentConfig = () => {
webpackEnv.experimentalSWCCompiler ? swcLoader : babelLoader,
ejsLoader,
mjsLoader,
cssLoader,
],
},
optimization: {
runtimeChunk: "single", // Extract webpack runtime code into it's own file
runtimeChunk: "single", // Extract webpack runtime code into its own file
splitChunks,

// Webpack does extra algorithmic work to optimize the output for size and
Expand Down
6 changes: 3 additions & 3 deletions webpack/envs/clientProductionConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { WebpackManifestPlugin } from "webpack-manifest-plugin"
import { basePath } from "../webpackEnv"
import { sharedPlugins } from "../sharedPlugins"
import { splitChunks } from "../bundleSplitting"
import { babelLoader, ejsLoader, mjsLoader } from "../sharedLoaders"
import { babelLoader, ejsLoader, mjsLoader, cssLoader } from "../sharedLoaders"

import {
externals,
Expand All @@ -29,12 +29,12 @@ const clientProductionConfig = () => {
externals,
mode,
module: {
rules: [babelLoader, ejsLoader, mjsLoader],
rules: [babelLoader, ejsLoader, mjsLoader, cssLoader],
},
optimization: {
minimize: !process.env.WEBPACK_FAST_PROD_BUILD,
minimizer,
runtimeChunk: "single", // Extract webpack runtime code into it's own file
runtimeChunk: "single", // Extract webpack runtime code into its own file
splitChunks,
},
output: {
Expand Down
5 changes: 5 additions & 0 deletions webpack/sharedLoaders.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ export const babelLoader = {
],
}

export const cssLoader = {
test: /\.css$/i,
use: ["style-loader", "css-loader"],
}

export const ejsLoader = {
test: /\.ejs$/,
use: {
Expand Down
83 changes: 73 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@
"@jridgewell/gen-mapping" "^0.1.0"
"@jridgewell/trace-mapping" "^0.3.9"

"@artaio/arta-browser@^2.13.0":
version "2.13.0"
resolved "https://registry.yarnpkg.com/@artaio/arta-browser/-/arta-browser-2.13.0.tgz#38381330986ef4395a978c68bff9ff52a3895930"
integrity sha512-g0poWXzbLfzeNud30IwM6h0EGp2EQSuZ20mKpsc+KChhfM1R6w76pku1hG1I0zhIrJJhNq2DIHBPYWhZbK/lTQ==
dependencies:
preact "^10.11.3"

"@artsy/[email protected]":
version "4.214.0"
resolved "https://registry.yarnpkg.com/@artsy/cohesion/-/cohesion-4.214.0.tgz#e01d0e189427c94ad9aeade88fb959507a3122da"
Expand Down Expand Up @@ -9324,6 +9331,20 @@ css-loader@^5.0.1:
schema-utils "^3.0.0"
semver "^7.3.5"

css-loader@^7.1.2:
version "7.1.2"
resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-7.1.2.tgz#64671541c6efe06b0e22e750503106bdd86880f8"
integrity sha512-6WvYYn7l/XEGN8Xu2vWFt9nVzrCn39vKyTEFf/ExEyoksJjjSZV/0/35XPlMbpnr6VGhZIUg5yJrL8tGfes/FA==
dependencies:
icss-utils "^5.1.0"
postcss "^8.4.33"
postcss-modules-extract-imports "^3.1.0"
postcss-modules-local-by-default "^4.0.5"
postcss-modules-scope "^3.2.0"
postcss-modules-values "^4.0.0"
postcss-value-parser "^4.2.0"
semver "^7.5.4"

css-select@^1.1.0, css-select@~1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/css-select/-/css-select-1.2.0.tgz#2b3a110539c5355f1cd8d314623e870b121ec858"
Expand Down Expand Up @@ -18613,6 +18634,11 @@ picocolors@^1.0.1:
resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.0.tgz#5358b76a78cde483ba5cef6a9dc9671440b27d59"
integrity sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==

picocolors@^1.1.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b"
integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==

picomatch@^2.0.4, picomatch@^2.2.1:
version "2.2.2"
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad"
Expand Down Expand Up @@ -18783,6 +18809,11 @@ postcss-modules-extract-imports@^3.0.0:
resolved "https://registry.yarnpkg.com/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.0.0.tgz#cda1f047c0ae80c97dbe28c3e76a43b88025741d"
integrity sha512-bdHleFnP3kZ4NYDhuGlVK+CMrQ/pqUm8bx/oGL93K6gVwiclvX5x0n76fYMKuIGKzlABOy13zsvqjb0f92TEXw==

postcss-modules-extract-imports@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.1.0.tgz#b4497cb85a9c0c4b5aabeb759bb25e8d89f15002"
integrity sha512-k3kNe0aNFQDAZGbin48pL2VNidTF0w4/eASDsxlyspobzU3wZQLOGj7L9gfRe0Jo9/4uud09DsjFNH7winGv8Q==

postcss-modules-local-by-default@^3.0.2:
version "3.0.3"
resolved "https://registry.yarnpkg.com/postcss-modules-local-by-default/-/postcss-modules-local-by-default-3.0.3.tgz#bb14e0cc78279d504dbdcbfd7e0ca28993ffbbb0"
Expand All @@ -18802,6 +18833,15 @@ postcss-modules-local-by-default@^4.0.0:
postcss-selector-parser "^6.0.2"
postcss-value-parser "^4.1.0"

postcss-modules-local-by-default@^4.0.5:
version "4.0.5"
resolved "https://registry.yarnpkg.com/postcss-modules-local-by-default/-/postcss-modules-local-by-default-4.0.5.tgz#f1b9bd757a8edf4d8556e8d0f4f894260e3df78f"
integrity sha512-6MieY7sIfTK0hYfafw1OMEG+2bg8Q1ocHCpoWLqOKj3JXlKu4G7btkmM/B7lFubYkYWmRSPLZi5chid63ZaZYw==
dependencies:
icss-utils "^5.0.0"
postcss-selector-parser "^6.0.2"
postcss-value-parser "^4.1.0"

postcss-modules-scope@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/postcss-modules-scope/-/postcss-modules-scope-2.2.0.tgz#385cae013cc7743f5a7d7602d1073a89eaae62ee"
Expand All @@ -18817,6 +18857,13 @@ postcss-modules-scope@^3.0.0:
dependencies:
postcss-selector-parser "^6.0.4"

postcss-modules-scope@^3.2.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/postcss-modules-scope/-/postcss-modules-scope-3.2.0.tgz#a43d28289a169ce2c15c00c4e64c0858e43457d5"
integrity sha512-oq+g1ssrsZOsx9M96c5w8laRmvEu9C3adDSjI8oTcbfkrTE8hx/zfyobUoWIxaKPO8bt6S62kxpw5GqypEw1QQ==
dependencies:
postcss-selector-parser "^6.0.4"

postcss-modules-values@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/postcss-modules-values/-/postcss-modules-values-3.0.0.tgz#5b5000d6ebae29b4255301b4a3a54574423e7f10"
Expand Down Expand Up @@ -18855,6 +18902,11 @@ postcss-value-parser@^4.0.2, postcss-value-parser@^4.1.0:
resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz#443f6a20ced6481a2bda4fa8532a6e55d789a2cb"
integrity sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==

postcss-value-parser@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz#723c09920836ba6d3e5af019f92bc0971c02e514"
integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==

[email protected]:
version "8.4.38"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.38.tgz#b387d533baf2054288e337066d81c6bee9db9e0e"
Expand Down Expand Up @@ -18882,6 +18934,15 @@ postcss@^8.2.15:
picocolors "^1.0.0"
source-map-js "^1.0.2"

postcss@^8.4.33:
version "8.4.47"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.47.tgz#5bf6c9a010f3e724c503bf03ef7947dcb0fea365"
integrity sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ==
dependencies:
nanoid "^3.3.7"
picocolors "^1.1.0"
source-map-js "^1.2.1"

postgres-array@~2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/postgres-array/-/postgres-array-2.0.0.tgz#48f8fce054fbc69671999329b8834b772652d82e"
Expand Down Expand Up @@ -18941,6 +19002,11 @@ pprof-format@^2.0.6:
resolved "https://registry.yarnpkg.com/pprof-format/-/pprof-format-2.0.7.tgz#526e4361f8b37d16b2ec4bb0696b5292de5046a4"
integrity sha512-1qWaGAzwMpaXJP9opRa23nPnt2Egi7RMNoNBptEE/XwHbcn4fC2b/4U4bKc5arkGkIh2ZabpF2bEb+c5GNHEKA==

preact@^10.11.3:
version "10.24.3"
resolved "https://registry.yarnpkg.com/preact/-/preact-10.24.3.tgz#086386bd47071e3b45410ef20844c21e23828f64"
integrity sha512-Z2dPnBnMUfyQfSQ+GBdsGa16hz35YmLmtTLhM169uW944hYL6xzTYkJjC07j+Wosz733pMWx0fgON3JNw1jJQA==

prelude-ls@~1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
Expand Down Expand Up @@ -20835,7 +20901,7 @@ semver@^7.3.8:
dependencies:
lru-cache "^6.0.0"

semver@^7.5.2:
semver@^7.5.2, semver@^7.5.4:
version "7.6.3"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143"
integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==
Expand Down Expand Up @@ -21251,7 +21317,7 @@ source-map-js@^1.0.2:
resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c"
integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==

source-map-js@^1.2.0:
source-map-js@^1.2.0, source-map-js@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.1.tgz#1ce5650fddd87abc099eda37dcff024c2667ae46"
integrity sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==
Expand Down Expand Up @@ -21892,14 +21958,6 @@ strip-json-comments@~2.0.1:
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a"
integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo=

[email protected]:
version "0.23.1"
resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-0.23.1.tgz#cb9154606f3e771ab6c4ab637026a1049174d925"
integrity sha512-XK+uv9kWwhZMZ1y7mysB+zoihsEj4wneFWAS5qoiLwzW0WzSqMrrsIy+a3zkQJq0ipFtBpX5W3MqyRIBF/WFGg==
dependencies:
loader-utils "^1.1.0"
schema-utils "^1.0.0"

style-loader@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-1.3.0.tgz#828b4a3b3b7e7aa5847ce7bae9e874512114249e"
Expand All @@ -21916,6 +21974,11 @@ style-loader@^2.0.0:
loader-utils "^2.0.0"
schema-utils "^3.0.0"

style-loader@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-4.0.0.tgz#0ea96e468f43c69600011e0589cb05c44f3b17a5"
integrity sha512-1V4WqhhZZgjVAVJyt7TdDPZoPBPNHbekX4fWnCJL1yQukhCeZhJySUL+gL9y6sNdN95uEOS83Y55SqHcP7MzLA==

[email protected], style-to-object@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/style-to-object/-/style-to-object-0.3.0.tgz#b1b790d205991cc783801967214979ee19a76e46"
Expand Down