From fb8311c4226f827978fe95bb583b28375510e5e8 Mon Sep 17 00:00:00 2001 From: Cesar Parra Date: Thu, 26 Oct 2023 19:35:38 -0400 Subject: [PATCH] Context references (#75) --- README.md | 16 +- .../main/staticresources/tw/css/main.css | 2 +- .../ui/components/base/lwc/alert/alert.html | 12 +- .../ui/components/base/lwc/alert/alert.js | 42 +++- .../expressionElementContainer.html | 11 + .../expressionElementContainer.js | 6 + .../expressionElementContainer.js-meta.xml | 7 + .../expressionSiteElement.js | 68 ++++++ .../expressionSiteElement.js-meta.xml | 7 + .../components/exposed/lwc/button/button.html | 11 +- .../components/exposed/lwc/button/button.js | 38 +--- .../exposed/lwc/button/button.js-meta.xml | 4 + .../exposed/lwc/features/features.html | 39 ++-- .../exposed/lwc/features/features.js | 37 +--- .../exposed/lwc/features/features.js-meta.xml | 4 + .../ui/components/exposed/lwc/hero/hero.html | 61 +++--- .../ui/components/exposed/lwc/hero/hero.js | 37 +--- .../exposed/lwc/hero/hero.js-meta.xml | 4 + .../components/exposed/lwc/logos/logos.html | 35 ++- .../ui/components/exposed/lwc/logos/logos.js | 34 +-- .../exposed/lwc/logos/logos.js-meta.xml | 4 + .../components/exposed/lwc/navBar/navBar.html | 120 +++++----- .../components/exposed/lwc/navBar/navBar.js | 37 +--- .../exposed/lwc/navBar/navBar.js-meta.xml | 4 + .../components/exposed/lwc/people/people.html | 66 +++--- .../components/exposed/lwc/people/people.js | 38 +--- .../exposed/lwc/people/people.js-meta.xml | 4 + .../lwc/pricingTable/pricingTable.html | 78 ++++--- .../exposed/lwc/pricingTable/pricingTable.js | 38 +--- .../lwc/pricingTable/pricingTable.js-meta.xml | 4 + .../components/exposed/lwc/stats/stats.html | 55 ++--- .../ui/components/exposed/lwc/stats/stats.js | 38 +--- .../exposed/lwc/stats/stats.js-meta.xml | 4 + .../exposed/lwc/textBlock/textBlock.html | 11 +- .../exposed/lwc/textBlock/textBlock.js | 34 +-- .../lwc/textBlock/textBlock.js-meta.xml | 4 + .../api/tests/CollectionFunctionsTest.cls | 2 +- .../main/api/tests/EvaluatorTest.cls | 10 + .../editor/lwc/functionLibrary/operators.js | 21 +- .../editor/staticresources/monaco/main.html | 206 +++++++++--------- .../main/src/interpreter/Parser.cls | 6 +- .../main/src/interpreter/Scanner.cls | 2 + .../src/interpreter/tests/ScannerTest.cls | 10 + package.json | 4 +- sfdx-project.json | 17 +- 45 files changed, 653 insertions(+), 639 deletions(-) create mode 100644 expression-components/main/ui/components/base/lwc/expressionElementContainer/expressionElementContainer.html create mode 100644 expression-components/main/ui/components/base/lwc/expressionElementContainer/expressionElementContainer.js create mode 100644 expression-components/main/ui/components/base/lwc/expressionElementContainer/expressionElementContainer.js-meta.xml create mode 100644 expression-components/main/ui/components/base/lwc/expressionSiteElement/expressionSiteElement.js create mode 100644 expression-components/main/ui/components/base/lwc/expressionSiteElement/expressionSiteElement.js-meta.xml diff --git a/README.md b/README.md index b9d6354a..da528bf2 100644 --- a/README.md +++ b/README.md @@ -25,19 +25,19 @@ Powerful formula-syntax evaluator for Apex and LWC. ### Unlocked Package (`expression` namespace) -[![Install Unlocked Package in a Sandbox](assets/btn-install-unlocked-package-sandbox.png)](https://test.salesforce.com/packaging/installPackage.apexp?p0=04tDm0000011MhkIAE) -[![Install Unlocked Package in Production](assets/btn-install-unlocked-package-production.png)](https://login.salesforce.com/packaging/installPackage.apexp?p0=04tDm0000011MhkIAE) +[![Install Unlocked Package in a Sandbox](assets/btn-install-unlocked-package-sandbox.png)](https://test.salesforce.com/packaging/installPackage.apexp?p0=04tDm0000011MhzIAE) +[![Install Unlocked Package in Production](assets/btn-install-unlocked-package-production.png)](https://login.salesforce.com/packaging/installPackage.apexp?p0=04tDm0000011MhzIAE) Install with SF CLI: ```shell -sf package install --apex-compile package --wait 20 --package 04tDm0000011MhkIAE +sf package install --apex-compile package --wait 20 --package 04tDm0000011MhzIAE ``` Install with SFDX CLI: ```shell -sfdx force:package:install --apexcompile package --wait 20 --package 04tDm0000011MhkIAE +sfdx force:package:install --apexcompile package --wait 20 --package 04tDm0000011MhzIAE ``` ### Direct Deployment to Salesforce @@ -1723,19 +1723,19 @@ by the `Expression` language. ### Unlocked Package (`expression` namespace) -[![Install Unlocked Package in a Sandbox](assets/btn-install-unlocked-package-sandbox.png)](https://test.salesforce.com/packaging/installPackage.apexp?p0=04tDm0000011MhpIAE) -[![Install Unlocked Package in Production](assets/btn-install-unlocked-package-production.png)](https://login.salesforce.com/packaging/installPackage.apexp?p0=04tDm0000011MhpIAE) +[![Install Unlocked Package in a Sandbox](assets/btn-install-unlocked-package-sandbox.png)](https://test.salesforce.com/packaging/installPackage.apexp?p0=04tDm0000011Mi4IAE) +[![Install Unlocked Package in Production](assets/btn-install-unlocked-package-production.png)](https://login.salesforce.com/packaging/installPackage.apexp?p0=04tDm0000011Mi4IAE) Install with SF CLI: ```shell -sf package install --apex-compile package --wait 20 --package 04tDm0000011MhpIAE +sf package install --apex-compile package --wait 20 --package 04tDm0000011Mi4IAE ``` Install with SFDX CLI: ```shell -sfdx force:package:install --apexcompile package --wait 20 --package 04tDm0000011MhpIAE +sfdx force:package:install --apexcompile package --wait 20 --package 04tDm0000011Mi4IAE ``` ## Components diff --git a/expression-components/main/staticresources/tw/css/main.css b/expression-components/main/staticresources/tw/css/main.css index ad7c2596..4449deea 100644 --- a/expression-components/main/staticresources/tw/css/main.css +++ b/expression-components/main/staticresources/tw/css/main.css @@ -1 +1 @@ -/*! tailwindcss v3.3.3 | MIT License | https://tailwindcss.com*/*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:initial}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:initial;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:initial}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}[multiple],[type=date],[type=datetime-local],[type=email],[type=month],[type=number],[type=password],[type=search],[type=tel],[type=text],[type=time],[type=url],[type=week],input:where(:not([type])),select,textarea{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border-color:#6b7280;border-width:1px;border-radius:0;padding:.5rem .75rem;font-size:1rem;line-height:1.5rem;--tw-shadow:0 0 #0000}[multiple]:focus,[type=date]:focus,[type=datetime-local]:focus,[type=email]:focus,[type=month]:focus,[type=number]:focus,[type=password]:focus,[type=search]:focus,[type=tel]:focus,[type=text]:focus,[type=time]:focus,[type=url]:focus,[type=week]:focus,input:where(:not([type])):focus,select:focus,textarea:focus{outline:2px solid #0000;outline-offset:2px;--tw-ring-inset:var(--tw-empty,/*!*/ /*!*/);--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#2563eb;--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-color:#2563eb}input::-moz-placeholder,textarea::-moz-placeholder{color:#6b7280;opacity:1}input::placeholder,textarea::placeholder{color:#6b7280;opacity:1}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-date-and-time-value{min-height:1.5em;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-meridiem-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-year-field{padding-top:0;padding-bottom:0}select{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");background-position:right .5rem center;background-repeat:no-repeat;background-size:1.5em 1.5em;padding-right:2.5rem;-webkit-print-color-adjust:exact;print-color-adjust:exact}[multiple],[size]:where(select:not([size="1"])){background-image:none;background-position:0 0;background-repeat:unset;background-size:initial;padding-right:.75rem;-webkit-print-color-adjust:unset;print-color-adjust:unset}[type=checkbox],[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;-webkit-print-color-adjust:exact;print-color-adjust:exact;display:inline-block;vertical-align:middle;background-origin:border-box;-webkit-user-select:none;-moz-user-select:none;user-select:none;flex-shrink:0;height:1rem;width:1rem;color:#2563eb;background-color:#fff;border-color:#6b7280;border-width:1px;--tw-shadow:0 0 #0000}[type=checkbox]{border-radius:0}[type=radio]{border-radius:100%}[type=checkbox]:focus,[type=radio]:focus{outline:2px solid #0000;outline-offset:2px;--tw-ring-inset:var(--tw-empty,/*!*/ /*!*/);--tw-ring-offset-width:2px;--tw-ring-offset-color:#fff;--tw-ring-color:#2563eb;--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}[type=checkbox]:checked,[type=radio]:checked{border-color:#0000;background-color:currentColor;background-size:100% 100%;background-position:50%;background-repeat:no-repeat}[type=checkbox]:checked{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 16 16'%3E%3Cpath d='M12.207 4.793a1 1 0 0 1 0 1.414l-5 5a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L6.5 9.086l4.293-4.293a1 1 0 0 1 1.414 0z'/%3E%3C/svg%3E")}[type=radio]:checked{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='3'/%3E%3C/svg%3E")}[type=checkbox]:checked:focus,[type=checkbox]:checked:hover,[type=checkbox]:indeterminate,[type=radio]:checked:focus,[type=radio]:checked:hover{border-color:#0000;background-color:currentColor}[type=checkbox]:indeterminate{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3E%3Cpath stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3E%3C/svg%3E");background-size:100% 100%;background-position:50%;background-repeat:no-repeat}[type=checkbox]:indeterminate:focus,[type=checkbox]:indeterminate:hover{border-color:#0000;background-color:currentColor}[type=file]{background:unset;border-color:inherit;border-width:0;border-radius:0;padding:0;font-size:unset;line-height:inherit}[type=file]:focus{outline:1px solid ButtonText;outline:1px auto -webkit-focus-ring-color}*,::backdrop,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border-width:0!important}.fixed{position:fixed!important}.relative{position:relative!important}.inset-0{inset:0!important}.inset-x-0{left:0!important;right:0!important}.inset-y-0{top:0!important;bottom:0!important}.right-0{right:0!important}.top-0{top:0!important}.isolate{isolation:isolate!important}.z-50{z-index:50!important}.order-first{order:-9999!important}.-m-1{margin:-.25rem!important}.-m-1\.5{margin:-.375rem!important}.-m-2{margin:-.5rem!important}.-m-2\.5{margin:-.625rem!important}.-mx-3{margin-left:-.75rem!important;margin-right:-.75rem!important}.-my-6{margin-top:-1.5rem!important;margin-bottom:-1.5rem!important}.mx-auto{margin-left:auto!important;margin-right:auto!important}.-mt-16{margin-top:-4rem!important}.mb-2{margin-bottom:.5rem!important}.ml-3{margin-left:.75rem!important}.mt-1{margin-top:.25rem!important}.mt-10{margin-top:2.5rem!important}.mt-16{margin-top:4rem!important}.mt-2{margin-top:.5rem!important}.mt-20{margin-top:5rem!important}.mt-4{margin-top:1rem!important}.mt-6{margin-top:1.5rem!important}.block{display:block!important}.flex{display:flex!important}.inline-flex{display:inline-flex!important}.flow-root{display:flow-root!important}.grid{display:grid!important}.hidden{display:none!important}.aspect-\[4\/5\]{aspect-ratio:4/5!important}.h-5{height:1.25rem!important}.h-6{height:1.5rem!important}.h-8{height:2rem!important}.max-h-12{max-height:3rem!important}.w-5{width:1.25rem!important}.w-52{width:13rem!important}.w-6{width:1.5rem!important}.w-\[76rem\]{width:76rem!important}.w-auto{width:auto!important}.w-full{width:100%!important}.max-w-2xl{max-width:42rem!important}.max-w-3xl{max-width:48rem!important}.max-w-4xl{max-width:56rem!important}.max-w-7xl{max-width:80rem!important}.max-w-lg{max-width:32rem!important}.max-w-sm{max-width:24rem!important}.max-w-xl{max-width:36rem!important}.flex-auto{flex:1 1 auto!important}.flex-none{flex:none!important}.flex-shrink-0{flex-shrink:0!important}.auto-cols-max{grid-auto-columns:max-content!important}.grid-flow-row{grid-auto-flow:row!important}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))!important}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))!important}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))!important}.flex-col{flex-direction:column!important}.place-content-center{place-content:center!important}.items-center{align-items:center!important}.items-baseline{align-items:baseline!important}.justify-center{justify-content:center!important}.justify-between{justify-content:space-between!important}.gap-6{gap:1.5rem!important}.gap-x-1{-moz-column-gap:.25rem!important;column-gap:.25rem!important}.gap-x-3{-moz-column-gap:.75rem!important;column-gap:.75rem!important}.gap-x-6{-moz-column-gap:1.5rem!important;column-gap:1.5rem!important}.gap-x-8{-moz-column-gap:2rem!important;column-gap:2rem!important}.gap-y-10{row-gap:2.5rem!important}.gap-y-16{row-gap:4rem!important}.gap-y-20{row-gap:5rem!important}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0!important;margin-top:calc(.5rem*(1 - var(--tw-space-y-reverse)))!important;margin-bottom:calc(.5rem*var(--tw-space-y-reverse))!important}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0!important;margin-top:calc(.75rem*(1 - var(--tw-space-y-reverse)))!important;margin-bottom:calc(.75rem*var(--tw-space-y-reverse))!important}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0!important;border-top-width:calc(1px*(1 - var(--tw-divide-y-reverse)))!important;border-bottom-width:calc(1px*var(--tw-divide-y-reverse))!important}.divide-gray-100>:not([hidden])~:not([hidden]){--tw-divide-opacity:1!important;border-color:rgb(243 244 246/var(--tw-divide-opacity))!important}.divide-gray-500\/10>:not([hidden])~:not([hidden]){border-color:#6b72801a!important}.overflow-hidden{overflow:hidden!important}.overflow-y-auto{overflow-y:auto!important}.rounded-2xl{border-radius:1rem!important}.rounded-lg{border-radius:.5rem!important}.rounded-md{border-radius:.375rem!important}.rounded-xl{border-radius:.75rem!important}.bg-dxp-bg-root{background-color:var(--dxp-g-root)!important}.bg-dxp-brand{background-color:var(--dxp-g-brand)!important}.bg-gray-900\/5{background-color:#1118270d!important}.bg-red-50{--tw-bg-opacity:1!important;background-color:rgb(254 242 242/var(--tw-bg-opacity))!important}.object-contain{-o-object-fit:contain!important;object-fit:contain!important}.object-cover{-o-object-fit:cover!important;object-fit:cover!important}.p-1{padding:.25rem!important}.p-1\.5{padding:.375rem!important}.p-2{padding:.5rem!important}.p-2\.5{padding:.625rem!important}.p-4{padding:1rem!important}.p-6{padding:1.5rem!important}.p-8{padding:2rem!important}.px-3{padding-left:.75rem!important;padding-right:.75rem!important}.px-3\.5{padding-left:.875rem!important;padding-right:.875rem!important}.px-6{padding-left:1.5rem!important;padding-right:1.5rem!important}.py-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.py-2\.5{padding-top:.625rem!important;padding-bottom:.625rem!important}.py-6{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.pt-16{padding-top:4rem!important}.text-left{text-align:left!important}.text-center{text-align:center!important}.text-right{text-align:right!important}.text-3xl{font-size:1.875rem!important;line-height:2.25rem!important}.text-4xl{font-size:2.25rem!important;line-height:2.5rem!important}.text-5xl{font-size:3rem!important;line-height:1!important}.text-base{font-size:1rem!important;line-height:1.5rem!important}.text-lg{font-size:1.125rem!important;line-height:1.75rem!important}.text-sm{font-size:.875rem!important;line-height:1.25rem!important}.font-bold{font-weight:700!important}.font-medium{font-weight:500!important}.font-semibold{font-weight:600!important}.leading-6{line-height:1.5rem!important}.leading-7{line-height:1.75rem!important}.leading-8{line-height:2rem!important}.tracking-tight{letter-spacing:-.025em!important}.text-dxp-brand{color:var(--dxp-g-brand)!important}.text-dxp-brand-foreground{color:var(--dxp-g-brand-contrast)!important}.text-dxp-text-contrast{color:var(--dxp-g-root-contrast)!important}.text-dxp-text-contrast-2{color:var(--dxp-g-root-contrast-2)!important}.text-dxp-text-contrast-3{color:var(--dxp-g-root-contrast-3)!important}.text-gray-600{--tw-text-opacity:1!important;color:rgb(75 85 99/var(--tw-text-opacity))!important}.text-gray-900{--tw-text-opacity:1!important;color:rgb(17 24 39/var(--tw-text-opacity))!important}.text-red-400{--tw-text-opacity:1!important;color:rgb(248 113 113/var(--tw-text-opacity))!important}.text-yellow-700{--tw-text-opacity:1!important;color:rgb(161 98 7/var(--tw-text-opacity))!important}.text-yellow-800{--tw-text-opacity:1!important;color:rgb(133 77 14/var(--tw-text-opacity))!important}.shadow-2xl{--tw-shadow:0 25px 50px -12px #00000040!important;--tw-shadow-colored:0 25px 50px -12px var(--tw-shadow-color)!important}.shadow-2xl,.shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)!important}.shadow-sm{--tw-shadow:0 1px 2px 0 #0000000d!important;--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)!important}.ring-1{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)!important;--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color)!important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)!important}.ring-inset{--tw-ring-inset:inset!important}.ring-gray-900\/10{--tw-ring-color:#1118271a!important}.hover\:bg-dxp-brand-1:hover{background-color:var(--dxp-g-brand-1)!important}.hover\:bg-gray-50:hover{--tw-bg-opacity:1!important;background-color:rgb(249 250 251/var(--tw-bg-opacity))!important}.hover\:no-underline:hover{text-decoration-line:none!important}.focus-visible\:outline:focus-visible{outline-style:solid!important}.focus-visible\:outline-2:focus-visible{outline-width:2px!important}.focus-visible\:outline-offset-2:focus-visible{outline-offset:2px!important}.focus-visible\:outline-dxp-brand-3:focus-visible{outline-color:var(--dxp-g-brand-3)!important}@media (min-width:640px){.sm\:mx-auto{margin-left:auto!important;margin-right:auto!important}.sm\:mt-24{margin-top:6rem!important}.sm\:max-w-5xl{max-width:64rem!important}.sm\:max-w-sm{max-width:24rem!important}.sm\:max-w-xl{max-width:36rem!important}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))!important}.sm\:gap-x-10{-moz-column-gap:2.5rem!important;column-gap:2.5rem!important}.sm\:text-center{text-align:center!important}.sm\:text-4xl{font-size:2.25rem!important;line-height:2.5rem!important}.sm\:text-5xl{font-size:3rem!important}.sm\:text-5xl,.sm\:text-6xl{line-height:1!important}.sm\:text-6xl{font-size:3.75rem!important}.sm\:ring-1{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)!important;--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color)!important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)!important}.sm\:ring-gray-900\/10{--tw-ring-color:#1118271a!important}}@media (min-width:768px){.md\:auto-cols-auto{grid-auto-columns:auto!important}.md\:grid-flow-col{grid-auto-flow:column!important}}@media (min-width:1024px){.lg\:-m-4{margin:-1rem!important}.lg\:-mx-8{margin-left:-2rem!important;margin-right:-2rem!important}.lg\:mx-0{margin-left:0!important;margin-right:0!important}.lg\:ml-10{margin-left:2.5rem!important}.lg\:mr-0{margin-right:0!important}.lg\:mt-0{margin-top:0!important}.lg\:flex{display:flex!important}.lg\:hidden{display:none!important}.lg\:max-w-4xl{max-width:56rem!important}.lg\:max-w-none{max-width:none!important}.lg\:max-w-xl{max-width:36rem!important}.lg\:flex-1{flex:1 1 0%!important}.lg\:flex-none{flex:none!important}.lg\:flex-shrink-0{flex-shrink:0!important}.lg\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))!important}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))!important}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))!important}.lg\:justify-end{justify-content:flex-end!important}.lg\:gap-x-12{-moz-column-gap:3rem!important;column-gap:3rem!important}.lg\:gap-x-8{-moz-column-gap:2rem!important;column-gap:2rem!important}.lg\:divide-x>:not([hidden])~:not([hidden]){--tw-divide-x-reverse:0!important;border-right-width:calc(1px*var(--tw-divide-x-reverse))!important;border-left-width:calc(1px*(1 - var(--tw-divide-x-reverse)))!important}.lg\:divide-y-0>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0!important;border-top-width:calc(0px*(1 - var(--tw-divide-y-reverse)))!important;border-bottom-width:calc(0px*var(--tw-divide-y-reverse))!important}.lg\:rounded-2xl{border-radius:1rem!important}.lg\:p-4{padding:1rem!important}.lg\:px-8{padding-left:2rem!important;padding-right:2rem!important}.lg\:pt-0{padding-top:0!important}.lg\:pt-8{padding-top:2rem!important}}@media (min-width:1280px){.xl\:-mx-4{margin-left:-1rem!important;margin-right:-1rem!important}.xl\:ml-32{margin-left:8rem!important}.xl\:max-w-none{max-width:none!important}.xl\:flex-row{flex-direction:row!important}.xl\:px-14{padding-left:3.5rem!important;padding-right:3.5rem!important}} \ No newline at end of file +/*! tailwindcss v3.3.3 | MIT License | https://tailwindcss.com*/*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:initial}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:initial;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:initial}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}[multiple],[type=date],[type=datetime-local],[type=email],[type=month],[type=number],[type=password],[type=search],[type=tel],[type=text],[type=time],[type=url],[type=week],input:where(:not([type])),select,textarea{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border-color:#6b7280;border-width:1px;border-radius:0;padding:.5rem .75rem;font-size:1rem;line-height:1.5rem;--tw-shadow:0 0 #0000}[multiple]:focus,[type=date]:focus,[type=datetime-local]:focus,[type=email]:focus,[type=month]:focus,[type=number]:focus,[type=password]:focus,[type=search]:focus,[type=tel]:focus,[type=text]:focus,[type=time]:focus,[type=url]:focus,[type=week]:focus,input:where(:not([type])):focus,select:focus,textarea:focus{outline:2px solid #0000;outline-offset:2px;--tw-ring-inset:var(--tw-empty,/*!*/ /*!*/);--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#2563eb;--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-color:#2563eb}input::-moz-placeholder,textarea::-moz-placeholder{color:#6b7280;opacity:1}input::placeholder,textarea::placeholder{color:#6b7280;opacity:1}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-date-and-time-value{min-height:1.5em;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-meridiem-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-year-field{padding-top:0;padding-bottom:0}select{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");background-position:right .5rem center;background-repeat:no-repeat;background-size:1.5em 1.5em;padding-right:2.5rem;-webkit-print-color-adjust:exact;print-color-adjust:exact}[multiple],[size]:where(select:not([size="1"])){background-image:none;background-position:0 0;background-repeat:unset;background-size:initial;padding-right:.75rem;-webkit-print-color-adjust:unset;print-color-adjust:unset}[type=checkbox],[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;-webkit-print-color-adjust:exact;print-color-adjust:exact;display:inline-block;vertical-align:middle;background-origin:border-box;-webkit-user-select:none;-moz-user-select:none;user-select:none;flex-shrink:0;height:1rem;width:1rem;color:#2563eb;background-color:#fff;border-color:#6b7280;border-width:1px;--tw-shadow:0 0 #0000}[type=checkbox]{border-radius:0}[type=radio]{border-radius:100%}[type=checkbox]:focus,[type=radio]:focus{outline:2px solid #0000;outline-offset:2px;--tw-ring-inset:var(--tw-empty,/*!*/ /*!*/);--tw-ring-offset-width:2px;--tw-ring-offset-color:#fff;--tw-ring-color:#2563eb;--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}[type=checkbox]:checked,[type=radio]:checked{border-color:#0000;background-color:currentColor;background-size:100% 100%;background-position:50%;background-repeat:no-repeat}[type=checkbox]:checked{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 16 16'%3E%3Cpath d='M12.207 4.793a1 1 0 0 1 0 1.414l-5 5a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L6.5 9.086l4.293-4.293a1 1 0 0 1 1.414 0z'/%3E%3C/svg%3E")}[type=radio]:checked{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='3'/%3E%3C/svg%3E")}[type=checkbox]:checked:focus,[type=checkbox]:checked:hover,[type=checkbox]:indeterminate,[type=radio]:checked:focus,[type=radio]:checked:hover{border-color:#0000;background-color:currentColor}[type=checkbox]:indeterminate{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3E%3Cpath stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3E%3C/svg%3E");background-size:100% 100%;background-position:50%;background-repeat:no-repeat}[type=checkbox]:indeterminate:focus,[type=checkbox]:indeterminate:hover{border-color:#0000;background-color:currentColor}[type=file]{background:unset;border-color:inherit;border-width:0;border-radius:0;padding:0;font-size:unset;line-height:inherit}[type=file]:focus{outline:1px solid ButtonText;outline:1px auto -webkit-focus-ring-color}*,::backdrop,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border-width:0!important}.fixed{position:fixed!important}.relative{position:relative!important}.inset-0{inset:0!important}.inset-x-0{left:0!important;right:0!important}.inset-y-0{top:0!important;bottom:0!important}.right-0{right:0!important}.top-0{top:0!important}.isolate{isolation:isolate!important}.z-50{z-index:50!important}.order-first{order:-9999!important}.-m-1{margin:-.25rem!important}.-m-1\.5{margin:-.375rem!important}.-m-2{margin:-.5rem!important}.-m-2\.5{margin:-.625rem!important}.-mx-3{margin-left:-.75rem!important;margin-right:-.75rem!important}.-my-6{margin-top:-1.5rem!important;margin-bottom:-1.5rem!important}.mx-auto{margin-left:auto!important;margin-right:auto!important}.-mt-16{margin-top:-4rem!important}.mb-2{margin-bottom:.5rem!important}.ml-3{margin-left:.75rem!important}.mt-1{margin-top:.25rem!important}.mt-10{margin-top:2.5rem!important}.mt-16{margin-top:4rem!important}.mt-2{margin-top:.5rem!important}.mt-20{margin-top:5rem!important}.mt-4{margin-top:1rem!important}.mt-6{margin-top:1.5rem!important}.block{display:block!important}.flex{display:flex!important}.inline-flex{display:inline-flex!important}.flow-root{display:flow-root!important}.grid{display:grid!important}.hidden{display:none!important}.aspect-\[4\/5\]{aspect-ratio:4/5!important}.h-5{height:1.25rem!important}.h-6{height:1.5rem!important}.h-8{height:2rem!important}.max-h-12{max-height:3rem!important}.w-5{width:1.25rem!important}.w-52{width:13rem!important}.w-6{width:1.5rem!important}.w-\[76rem\]{width:76rem!important}.w-auto{width:auto!important}.w-full{width:100%!important}.max-w-2xl{max-width:42rem!important}.max-w-3xl{max-width:48rem!important}.max-w-4xl{max-width:56rem!important}.max-w-7xl{max-width:80rem!important}.max-w-lg{max-width:32rem!important}.max-w-sm{max-width:24rem!important}.max-w-xl{max-width:36rem!important}.flex-auto{flex:1 1 auto!important}.flex-none{flex:none!important}.flex-shrink-0{flex-shrink:0!important}.auto-cols-max{grid-auto-columns:max-content!important}.grid-flow-row{grid-auto-flow:row!important}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))!important}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))!important}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))!important}.flex-col{flex-direction:column!important}.place-content-center{place-content:center!important}.items-center{align-items:center!important}.items-baseline{align-items:baseline!important}.justify-center{justify-content:center!important}.justify-between{justify-content:space-between!important}.gap-6{gap:1.5rem!important}.gap-x-1{-moz-column-gap:.25rem!important;column-gap:.25rem!important}.gap-x-3{-moz-column-gap:.75rem!important;column-gap:.75rem!important}.gap-x-6{-moz-column-gap:1.5rem!important;column-gap:1.5rem!important}.gap-x-8{-moz-column-gap:2rem!important;column-gap:2rem!important}.gap-y-10{row-gap:2.5rem!important}.gap-y-16{row-gap:4rem!important}.gap-y-20{row-gap:5rem!important}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0!important;margin-top:calc(.5rem*(1 - var(--tw-space-y-reverse)))!important;margin-bottom:calc(.5rem*var(--tw-space-y-reverse))!important}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0!important;margin-top:calc(.75rem*(1 - var(--tw-space-y-reverse)))!important;margin-bottom:calc(.75rem*var(--tw-space-y-reverse))!important}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0!important;border-top-width:calc(1px*(1 - var(--tw-divide-y-reverse)))!important;border-bottom-width:calc(1px*var(--tw-divide-y-reverse))!important}.divide-gray-100>:not([hidden])~:not([hidden]){--tw-divide-opacity:1!important;border-color:rgb(243 244 246/var(--tw-divide-opacity))!important}.divide-gray-500\/10>:not([hidden])~:not([hidden]){border-color:#6b72801a!important}.overflow-hidden{overflow:hidden!important}.overflow-y-auto{overflow-y:auto!important}.rounded-2xl{border-radius:1rem!important}.rounded-lg{border-radius:.5rem!important}.rounded-md{border-radius:.375rem!important}.rounded-xl{border-radius:.75rem!important}.bg-dxp-bg-root{background-color:var(--dxp-g-root)!important}.bg-dxp-brand{background-color:var(--dxp-g-brand)!important}.bg-gray-900\/5{background-color:#1118270d!important}.bg-red-50{background-color:rgb(254 242 242/var(--tw-bg-opacity))!important}.bg-red-50,.bg-yellow-50{--tw-bg-opacity:1!important}.bg-yellow-50{background-color:rgb(254 252 232/var(--tw-bg-opacity))!important}.object-contain{-o-object-fit:contain!important;object-fit:contain!important}.object-cover{-o-object-fit:cover!important;object-fit:cover!important}.p-1{padding:.25rem!important}.p-1\.5{padding:.375rem!important}.p-2{padding:.5rem!important}.p-2\.5{padding:.625rem!important}.p-4{padding:1rem!important}.p-6{padding:1.5rem!important}.p-8{padding:2rem!important}.px-3{padding-left:.75rem!important;padding-right:.75rem!important}.px-3\.5{padding-left:.875rem!important;padding-right:.875rem!important}.px-6{padding-left:1.5rem!important;padding-right:1.5rem!important}.py-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.py-2\.5{padding-top:.625rem!important;padding-bottom:.625rem!important}.py-6{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.pt-16{padding-top:4rem!important}.text-left{text-align:left!important}.text-center{text-align:center!important}.text-right{text-align:right!important}.text-3xl{font-size:1.875rem!important;line-height:2.25rem!important}.text-4xl{font-size:2.25rem!important;line-height:2.5rem!important}.text-5xl{font-size:3rem!important;line-height:1!important}.text-base{font-size:1rem!important;line-height:1.5rem!important}.text-lg{font-size:1.125rem!important;line-height:1.75rem!important}.text-sm{font-size:.875rem!important;line-height:1.25rem!important}.font-bold{font-weight:700!important}.font-medium{font-weight:500!important}.font-semibold{font-weight:600!important}.leading-6{line-height:1.5rem!important}.leading-7{line-height:1.75rem!important}.leading-8{line-height:2rem!important}.tracking-tight{letter-spacing:-.025em!important}.text-dxp-brand{color:var(--dxp-g-brand)!important}.text-dxp-brand-foreground{color:var(--dxp-g-brand-contrast)!important}.text-dxp-text-contrast{color:var(--dxp-g-root-contrast)!important}.text-dxp-text-contrast-2{color:var(--dxp-g-root-contrast-2)!important}.text-dxp-text-contrast-3{color:var(--dxp-g-root-contrast-3)!important}.text-gray-600{--tw-text-opacity:1!important;color:rgb(75 85 99/var(--tw-text-opacity))!important}.text-gray-900{--tw-text-opacity:1!important;color:rgb(17 24 39/var(--tw-text-opacity))!important}.text-red-400{color:rgb(248 113 113/var(--tw-text-opacity))!important}.text-red-400,.text-red-700{--tw-text-opacity:1!important}.text-red-700{color:rgb(185 28 28/var(--tw-text-opacity))!important}.text-red-800{--tw-text-opacity:1!important;color:rgb(153 27 27/var(--tw-text-opacity))!important}.text-yellow-400{--tw-text-opacity:1!important;color:rgb(250 204 21/var(--tw-text-opacity))!important}.text-yellow-700{--tw-text-opacity:1!important;color:rgb(161 98 7/var(--tw-text-opacity))!important}.text-yellow-800{--tw-text-opacity:1!important;color:rgb(133 77 14/var(--tw-text-opacity))!important}.shadow-2xl{--tw-shadow:0 25px 50px -12px #00000040!important;--tw-shadow-colored:0 25px 50px -12px var(--tw-shadow-color)!important}.shadow-2xl,.shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)!important}.shadow-sm{--tw-shadow:0 1px 2px 0 #0000000d!important;--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)!important}.ring-1{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)!important;--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color)!important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)!important}.ring-inset{--tw-ring-inset:inset!important}.ring-gray-900\/10{--tw-ring-color:#1118271a!important}.hover\:bg-dxp-brand-1:hover{background-color:var(--dxp-g-brand-1)!important}.hover\:bg-gray-50:hover{--tw-bg-opacity:1!important;background-color:rgb(249 250 251/var(--tw-bg-opacity))!important}.hover\:no-underline:hover{text-decoration-line:none!important}.focus-visible\:outline:focus-visible{outline-style:solid!important}.focus-visible\:outline-2:focus-visible{outline-width:2px!important}.focus-visible\:outline-offset-2:focus-visible{outline-offset:2px!important}.focus-visible\:outline-dxp-brand-3:focus-visible{outline-color:var(--dxp-g-brand-3)!important}@media (min-width:640px){.sm\:mx-auto{margin-left:auto!important;margin-right:auto!important}.sm\:mt-24{margin-top:6rem!important}.sm\:max-w-5xl{max-width:64rem!important}.sm\:max-w-sm{max-width:24rem!important}.sm\:max-w-xl{max-width:36rem!important}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))!important}.sm\:gap-x-10{-moz-column-gap:2.5rem!important;column-gap:2.5rem!important}.sm\:text-center{text-align:center!important}.sm\:text-4xl{font-size:2.25rem!important;line-height:2.5rem!important}.sm\:text-5xl{font-size:3rem!important}.sm\:text-5xl,.sm\:text-6xl{line-height:1!important}.sm\:text-6xl{font-size:3.75rem!important}.sm\:ring-1{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)!important;--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color)!important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)!important}.sm\:ring-gray-900\/10{--tw-ring-color:#1118271a!important}}@media (min-width:768px){.md\:auto-cols-auto{grid-auto-columns:auto!important}.md\:grid-flow-col{grid-auto-flow:column!important}}@media (min-width:1024px){.lg\:-m-4{margin:-1rem!important}.lg\:-mx-8{margin-left:-2rem!important;margin-right:-2rem!important}.lg\:mx-0{margin-left:0!important;margin-right:0!important}.lg\:ml-10{margin-left:2.5rem!important}.lg\:mr-0{margin-right:0!important}.lg\:mt-0{margin-top:0!important}.lg\:flex{display:flex!important}.lg\:hidden{display:none!important}.lg\:max-w-4xl{max-width:56rem!important}.lg\:max-w-none{max-width:none!important}.lg\:max-w-xl{max-width:36rem!important}.lg\:flex-1{flex:1 1 0%!important}.lg\:flex-none{flex:none!important}.lg\:flex-shrink-0{flex-shrink:0!important}.lg\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))!important}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))!important}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))!important}.lg\:justify-end{justify-content:flex-end!important}.lg\:gap-x-12{-moz-column-gap:3rem!important;column-gap:3rem!important}.lg\:gap-x-8{-moz-column-gap:2rem!important;column-gap:2rem!important}.lg\:divide-x>:not([hidden])~:not([hidden]){--tw-divide-x-reverse:0!important;border-right-width:calc(1px*var(--tw-divide-x-reverse))!important;border-left-width:calc(1px*(1 - var(--tw-divide-x-reverse)))!important}.lg\:divide-y-0>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0!important;border-top-width:calc(0px*(1 - var(--tw-divide-y-reverse)))!important;border-bottom-width:calc(0px*var(--tw-divide-y-reverse))!important}.lg\:rounded-2xl{border-radius:1rem!important}.lg\:p-4{padding:1rem!important}.lg\:px-8{padding-left:2rem!important;padding-right:2rem!important}.lg\:pt-0{padding-top:0!important}.lg\:pt-8{padding-top:2rem!important}}@media (min-width:1280px){.xl\:-mx-4{margin-left:-1rem!important;margin-right:-1rem!important}.xl\:ml-32{margin-left:8rem!important}.xl\:max-w-none{max-width:none!important}.xl\:flex-row{flex-direction:row!important}.xl\:px-14{padding-left:3.5rem!important;padding-right:3.5rem!important}} \ No newline at end of file diff --git a/expression-components/main/ui/components/base/lwc/alert/alert.html b/expression-components/main/ui/components/base/lwc/alert/alert.html index 40f916f1..437da9d3 100644 --- a/expression-components/main/ui/components/base/lwc/alert/alert.html +++ b/expression-components/main/ui/components/base/lwc/alert/alert.html @@ -1,18 +1,20 @@ diff --git a/expression-components/main/ui/components/base/lwc/alert/alert.js b/expression-components/main/ui/components/base/lwc/alert/alert.js index 0da48bb1..b0889d16 100644 --- a/expression-components/main/ui/components/base/lwc/alert/alert.js +++ b/expression-components/main/ui/components/base/lwc/alert/alert.js @@ -1,6 +1,46 @@ -import {api, LightningElement} from 'lwc'; +import { api, LightningElement } from 'lwc'; +import { classNames } from 'c/utils'; export default class Alert extends LightningElement { @api title; @api message; + /** + * The variant changes the appearance of the alert. + * Accepted variants include: + * - error + * - warning + */ + @api type; + + get containerClasses() { + return classNames( + 'rounded-md p-4', + {'bg-red-50': this.isError}, + {'bg-yellow-50': this.isWarning}, + ); + } + + get titleTextClasses() { + return classNames( + 'text-sm font-medium', + {'text-red-800': this.isError}, + {'text-yellow-800': this.isWarning}, + ); + } + + get messageTextClasses() { + return classNames( + 'mt-2 text-sm', + {'text-red-700': this.isError}, + {'text-yellow-700': this.isWarning}, + ); + } + + get isWarning() { + return this.type === 'warning'; + } + + get isError() { + return this.type === 'error'; + } } diff --git a/expression-components/main/ui/components/base/lwc/expressionElementContainer/expressionElementContainer.html b/expression-components/main/ui/components/base/lwc/expressionElementContainer/expressionElementContainer.html new file mode 100644 index 00000000..c0d6c69b --- /dev/null +++ b/expression-components/main/ui/components/base/lwc/expressionElementContainer/expressionElementContainer.html @@ -0,0 +1,11 @@ + diff --git a/expression-components/main/ui/components/base/lwc/expressionElementContainer/expressionElementContainer.js b/expression-components/main/ui/components/base/lwc/expressionElementContainer/expressionElementContainer.js new file mode 100644 index 00000000..3a160bf6 --- /dev/null +++ b/expression-components/main/ui/components/base/lwc/expressionElementContainer/expressionElementContainer.js @@ -0,0 +1,6 @@ +import { LightningElement, api } from 'lwc'; + +export default class ExpressionElementContainer extends LightningElement { + @api cannotShowPreview = false; + @api error = null; +} diff --git a/expression-components/main/ui/components/base/lwc/expressionElementContainer/expressionElementContainer.js-meta.xml b/expression-components/main/ui/components/base/lwc/expressionElementContainer/expressionElementContainer.js-meta.xml new file mode 100644 index 00000000..4a509bbf --- /dev/null +++ b/expression-components/main/ui/components/base/lwc/expressionElementContainer/expressionElementContainer.js-meta.xml @@ -0,0 +1,7 @@ + + + 58.0 + Expression Element Container + false + Expression Element Container + diff --git a/expression-components/main/ui/components/base/lwc/expressionSiteElement/expressionSiteElement.js b/expression-components/main/ui/components/base/lwc/expressionSiteElement/expressionSiteElement.js new file mode 100644 index 00000000..065b851e --- /dev/null +++ b/expression-components/main/ui/components/base/lwc/expressionSiteElement/expressionSiteElement.js @@ -0,0 +1,68 @@ +import TwElement from "c/twElement"; +import evaluate from '@salesforce/apex/FormulaEvaluatorUiController.evaluate'; +import { CurrentPageReference } from "lightning/navigation"; +import { wire } from "lwc"; + +export default class ExpressionSiteElement extends TwElement { + // These 4 need to be set by the extending class as `@api` properties. + contextUrlParam; + previewContextId; + expr; + respectSharing; + + currentPageReference; + computed; + error; + contextId = null + + @wire(CurrentPageReference) + setCurrentPageReference(currentPageReference) { + this.currentPageReference = currentPageReference; + if (this.contextUrlParam) { + this.contextId = this.isInBuilder ? this.previewContextId : this.currentPageReference.state[this.contextUrlParam]; + } + } + + @wire(evaluate, {recordId: '$contextId', formula: '$expr', respectSharing: '$respectSharing'}) + evaluate({error, data}) { + if (error) { + console.error(error); + this.error = error.body.message; + } else { + this.computed = data; + this.validate(); + } + } + + get loading() { + return !this.computed && !this.error; + } + + get hasError() { + return this.error; + } + + get ready() { + return !this.loading && !this.hasError && !this.cannotShowPreview; + } + + get isInBuilder() { + return this.currentPageReference?.state?.app === 'commeditor'; + } + + get cannotShowPreview() { + // If in the builder, and the contextUrlParam is set but the previewContextId is not, + // then we cannot show the preview. + if (!this.contextUrlParam) { + return false; + } + + if (this.isInBuilder) { + return !this.previewContextId; + } + + return false; + } + + validate() {} +} diff --git a/expression-components/main/ui/components/base/lwc/expressionSiteElement/expressionSiteElement.js-meta.xml b/expression-components/main/ui/components/base/lwc/expressionSiteElement/expressionSiteElement.js-meta.xml new file mode 100644 index 00000000..c24cfb54 --- /dev/null +++ b/expression-components/main/ui/components/base/lwc/expressionSiteElement/expressionSiteElement.js-meta.xml @@ -0,0 +1,7 @@ + + + 58.0 + Expression Site Element + false + Expression Site Element + diff --git a/expression-components/main/ui/components/exposed/lwc/button/button.html b/expression-components/main/ui/components/exposed/lwc/button/button.html index e21d207c..b85ac2bb 100644 --- a/expression-components/main/ui/components/exposed/lwc/button/button.html +++ b/expression-components/main/ui/components/exposed/lwc/button/button.html @@ -1,8 +1,7 @@ diff --git a/expression-components/main/ui/components/exposed/lwc/button/button.js b/expression-components/main/ui/components/exposed/lwc/button/button.js index a25cdb75..23a8403e 100644 --- a/expression-components/main/ui/components/exposed/lwc/button/button.js +++ b/expression-components/main/ui/components/exposed/lwc/button/button.js @@ -1,39 +1,13 @@ -import TwElement from "c/twElement"; -import evaluate from '@salesforce/apex/FormulaEvaluatorUiController.evaluate'; -import { api, wire } from "lwc"; +import ExpressionSiteElement from "c/expressionSiteElement"; +import { api } from "lwc"; -export default class Button extends TwElement { +export default class Button extends ExpressionSiteElement { + @api contextUrlParam; + @api previewContextId; @api expr; - @api centerItems; @api respectSharing; - computed; - error; - - @wire(evaluate, {recordId: '', formula: '$expr', respectSharing: '$respectSharing'}) - evaluate({error, data}) { - if (error) { - console.error(error); - this.error = error.body.message; - } else { - this.computed = data; - this._validate(); - } - } - - get loading() { - return !this.computed && !this.error; - } - - get hasError() { - return this.error; - } - - get ready() { - return !this.loading && !this.hasError; - } - - _validate() { + validate() { if (!this.computed) { return; } diff --git a/expression-components/main/ui/components/exposed/lwc/button/button.js-meta.xml b/expression-components/main/ui/components/exposed/lwc/button/button.js-meta.xml index 05c8cecb..a35011d4 100644 --- a/expression-components/main/ui/components/exposed/lwc/button/button.js-meta.xml +++ b/expression-components/main/ui/components/exposed/lwc/button/button.js-meta.xml @@ -10,6 +10,10 @@ + + -
-
-

- {computed.title} -

-

- {computed.description} -

+ +
+
+

+ {computed.title} +

+

+ {computed.description} +

+
+
+ +
-
- -
-
-
- -
+ diff --git a/expression-components/main/ui/components/exposed/lwc/features/features.js b/expression-components/main/ui/components/exposed/lwc/features/features.js index 0650acc9..fe5c1817 100644 --- a/expression-components/main/ui/components/exposed/lwc/features/features.js +++ b/expression-components/main/ui/components/exposed/lwc/features/features.js @@ -1,42 +1,17 @@ -import TwElement from "c/twElement"; -import evaluate from '@salesforce/apex/FormulaEvaluatorUiController.evaluate'; -import { api, wire } from "lwc"; +import ExpressionSiteElement from "c/expressionSiteElement"; +import { api } from "lwc"; -export default class Features extends TwElement { +export default class Features extends ExpressionSiteElement { + @api contextUrlParam; + @api previewContextId; @api expr; @api respectSharing; - computed; - error; - - @wire(evaluate, {recordId: '', formula: '$expr', respectSharing: '$respectSharing'}) - evaluate({error, data}) { - if (error) { - console.error(error); - this.error = error.body.message; - } else { - this.computed = data; - this._validate(); - } - } - - get loading() { - return !this.computed && !this.error; - } - - get hasError() { - return this.error; - } - - get ready() { - return !this.loading && !this.hasError; - } - get hasText() { return this.computed?.title || this.computed?.description; } - _validate() { + validate() { if (!this.computed) { return; } diff --git a/expression-components/main/ui/components/exposed/lwc/features/features.js-meta.xml b/expression-components/main/ui/components/exposed/lwc/features/features.js-meta.xml index fd9c6a31..04a8d10a 100644 --- a/expression-components/main/ui/components/exposed/lwc/features/features.js-meta.xml +++ b/expression-components/main/ui/components/exposed/lwc/features/features.js-meta.xml @@ -10,6 +10,10 @@ + + -
-
-
-

{computed.title}

-
- + +
+
+
+

+ {computed.title}

+
+ +
+
+ + +
+
+
+
+
+ Banner +
+
+
+
-
- - -
-
-
-
-
- Banner -
-
-
-
-
-
- -
+ diff --git a/expression-components/main/ui/components/exposed/lwc/hero/hero.js b/expression-components/main/ui/components/exposed/lwc/hero/hero.js index 2619c7d9..91ac13af 100644 --- a/expression-components/main/ui/components/exposed/lwc/hero/hero.js +++ b/expression-components/main/ui/components/exposed/lwc/hero/hero.js @@ -1,39 +1,14 @@ -import TwElement from "c/twElement"; -import evaluate from '@salesforce/apex/FormulaEvaluatorUiController.evaluate'; -import { api, wire } from "lwc"; +import ExpressionSiteElement from "c/expressionSiteElement"; +import { api } from "lwc"; import { classNames } from 'c/utils'; -export default class Hero extends TwElement { +export default class Hero extends ExpressionSiteElement { + @api contextUrlParam; + @api previewContextId; @api expr; @api centerItems; @api respectSharing; - computed; - error; - - @wire(evaluate, {recordId: '', formula: '$expr', respectSharing: '$respectSharing'}) - evaluate({error, data}) { - if (error) { - console.error(error); - this.error = error.body.message; - } else { - this.computed = data; - this._validate(); - } - } - - get loading() { - return !this.computed && !this.error; - } - - get hasError() { - return this.error; - } - - get ready() { - return !this.loading && !this.hasError; - } - get containerClasses() { return classNames( 'mx-auto max-w-7xl', @@ -60,7 +35,7 @@ export default class Hero extends TwElement { return this.computed && this.computed.bannerImage; } - _validate() { + validate() { if (!this.computed) { return; } diff --git a/expression-components/main/ui/components/exposed/lwc/hero/hero.js-meta.xml b/expression-components/main/ui/components/exposed/lwc/hero/hero.js-meta.xml index f6046e55..45bd87e4 100644 --- a/expression-components/main/ui/components/exposed/lwc/hero/hero.js-meta.xml +++ b/expression-components/main/ui/components/exposed/lwc/hero/hero.js-meta.xml @@ -10,6 +10,10 @@ + + -
-
-
-

{computed.title}

-
- + +
+
+
+

{computed.title}

+
+ +
+
+
-
-
-
-
- -
+ diff --git a/expression-components/main/ui/components/exposed/lwc/logos/logos.js b/expression-components/main/ui/components/exposed/lwc/logos/logos.js index cb9c8b4c..305249ca 100644 --- a/expression-components/main/ui/components/exposed/lwc/logos/logos.js +++ b/expression-components/main/ui/components/exposed/lwc/logos/logos.js @@ -1,38 +1,16 @@ -import TwElement from "c/twElement"; -import evaluate from '@salesforce/apex/FormulaEvaluatorUiController.evaluate'; -import { api, wire } from "lwc"; +import ExpressionSiteElement from "c/expressionSiteElement"; +import { api } from "lwc"; -export default class Logos extends TwElement { +export default class Logos extends ExpressionSiteElement { + @api contextUrlParam; + @api previewContextId; @api expr; @api respectSharing; computed; error; - @wire(evaluate, {recordId: '', formula: '$expr', respectSharing: '$respectSharing'}) - evaluate({error, data}) { - if (error) { - console.error(error); - this.error = error.body.message; - } else { - this.computed = data; - this._validate(); - } - } - - get loading() { - return !this.computed && !this.error; - } - - get hasError() { - return this.error; - } - - get ready() { - return !this.loading && !this.hasError; - } - - _validate() { + validate() { if (!this.computed) { return; } diff --git a/expression-components/main/ui/components/exposed/lwc/logos/logos.js-meta.xml b/expression-components/main/ui/components/exposed/lwc/logos/logos.js-meta.xml index fd4a43bb..4ea592c4 100644 --- a/expression-components/main/ui/components/exposed/lwc/logos/logos.js-meta.xml +++ b/expression-components/main/ui/components/exposed/lwc/logos/logos.js-meta.xml @@ -10,6 +10,10 @@ + + -
- -
-
- -
+ + diff --git a/expression-components/main/ui/components/exposed/lwc/navBar/navBar.js b/expression-components/main/ui/components/exposed/lwc/navBar/navBar.js index c09b6784..81191fbd 100644 --- a/expression-components/main/ui/components/exposed/lwc/navBar/navBar.js +++ b/expression-components/main/ui/components/exposed/lwc/navBar/navBar.js @@ -1,42 +1,15 @@ -import TwElement from "c/twElement"; -import evaluate from '@salesforce/apex/FormulaEvaluatorUiController.evaluate'; -import {api, wire} from "lwc"; +import ExpressionSiteElement from "c/expressionSiteElement"; +import { api } from "lwc"; -export default class NavBar extends TwElement { +export default class NavBar extends ExpressionSiteElement { + @api contextUrlParam; + @api previewContextId; @api expr; @api respectSharing; isOpen = false; - computed; - error; - - @wire(evaluate, {recordId: '', formula: '$expr', respectSharing: '$respectSharing'}) - evaluate({error, data}) { - if (error) { - console.error(error); - this.error = error.body.message; - } else { - this.computed = data; - } - } toggle() { this.isOpen = !this.isOpen; } - - callToAction() { - window.open(this.computed.callToAction.url, '_self'); - } - - get loading() { - return !this.computed && !this.error; - } - - get hasError() { - return this.error; - } - - get ready() { - return !this.loading && !this.hasError; - } } diff --git a/expression-components/main/ui/components/exposed/lwc/navBar/navBar.js-meta.xml b/expression-components/main/ui/components/exposed/lwc/navBar/navBar.js-meta.xml index 2f6d6148..2452bce8 100644 --- a/expression-components/main/ui/components/exposed/lwc/navBar/navBar.js-meta.xml +++ b/expression-components/main/ui/components/exposed/lwc/navBar/navBar.js-meta.xml @@ -10,6 +10,10 @@ + + -
-
-
-

- {computed.title} -

-

- {computed.description} -

-
-
    - -
-
-
-
- -
+
+ diff --git a/expression-components/main/ui/components/exposed/lwc/people/people.js b/expression-components/main/ui/components/exposed/lwc/people/people.js index 9b5388d3..69234bef 100644 --- a/expression-components/main/ui/components/exposed/lwc/people/people.js +++ b/expression-components/main/ui/components/exposed/lwc/people/people.js @@ -1,43 +1,17 @@ -import TwElement from "c/twElement"; -import evaluate from '@salesforce/apex/FormulaEvaluatorUiController.evaluate'; -import { api, wire } from "lwc"; -import { classNames } from 'c/utils'; +import ExpressionSiteElement from "c/expressionSiteElement"; +import { api } from "lwc"; -export default class People extends TwElement { +export default class People extends ExpressionSiteElement { + @api contextUrlParam; + @api previewContextId; @api expr; @api respectSharing; - computed; - error; - - @wire(evaluate, {recordId: '', formula: '$expr', respectSharing: '$respectSharing'}) - evaluate({error, data}) { - if (error) { - console.error(error); - this.error = error.body.message; - } else { - this.computed = data; - this._validate(); - } - } - get hasText() { return this.computed?.title || this.computed?.description; } - get loading() { - return !this.computed && !this.error; - } - - get hasError() { - return this.error; - } - - get ready() { - return !this.loading && !this.hasError; - } - - _validate() { + validate() { if (!this.computed) { return; } diff --git a/expression-components/main/ui/components/exposed/lwc/people/people.js-meta.xml b/expression-components/main/ui/components/exposed/lwc/people/people.js-meta.xml index 5d12e41a..ae406753 100644 --- a/expression-components/main/ui/components/exposed/lwc/people/people.js-meta.xml +++ b/expression-components/main/ui/components/exposed/lwc/people/people.js-meta.xml @@ -10,6 +10,10 @@ + + -
-
-
-

{computed.tag}

-

{computed.title}

-
-

- {computed.description} -

-
-
-
-
-
-
-
- -
+ diff --git a/expression-components/main/ui/components/exposed/lwc/pricingTable/pricingTable.js b/expression-components/main/ui/components/exposed/lwc/pricingTable/pricingTable.js index d287914e..8914ec68 100644 --- a/expression-components/main/ui/components/exposed/lwc/pricingTable/pricingTable.js +++ b/expression-components/main/ui/components/exposed/lwc/pricingTable/pricingTable.js @@ -1,27 +1,13 @@ -import TwElement from "c/twElement"; -import evaluate from '@salesforce/apex/FormulaEvaluatorUiController.evaluate'; -import execute from '@salesforce/apex/FormulaEvaluatorUiController.execute'; -import { api, wire } from "lwc"; +import ExpressionSiteElement from "c/expressionSiteElement"; +import { api } from "lwc"; import { classNames } from 'c/utils'; -export default class PricingTable extends TwElement { +export default class PricingTable extends ExpressionSiteElement { + @api contextUrlParam; + @api previewContextId; @api expr; @api respectSharing; - computed; - error; - - @wire(evaluate, {recordId: '', formula: '$expr', respectSharing: '$respectSharing'}) - evaluate({error, data}) { - if (error) { - console.error(error); - this.error = error.body.message; - } else { - this.computed = data; - this._validate(); - } - } - get gridClasses() { return classNames( 'isolate -mt-16 grid max-w-sm grid-cols-1 gap-y-16 divide-y divide-gray-100 ' + @@ -32,19 +18,7 @@ export default class PricingTable extends TwElement { ); } - get loading() { - return !this.computed && !this.error; - } - - get hasError() { - return this.error; - } - - get ready() { - return !this.loading && !this.hasError; - } - - _validate() { + validate() { if (!this.computed) { return; } diff --git a/expression-components/main/ui/components/exposed/lwc/pricingTable/pricingTable.js-meta.xml b/expression-components/main/ui/components/exposed/lwc/pricingTable/pricingTable.js-meta.xml index 4b5871fc..2799b5e5 100644 --- a/expression-components/main/ui/components/exposed/lwc/pricingTable/pricingTable.js-meta.xml +++ b/expression-components/main/ui/components/exposed/lwc/pricingTable/pricingTable.js-meta.xml @@ -10,6 +10,10 @@ + + -
-
-
-

- {computed.title} -

-

- -

-
-
+
+
+

+ {computed.title} +

+

+ +

+
+
- -
-
-
-
- -
+ + +
+
+
+ diff --git a/expression-components/main/ui/components/exposed/lwc/stats/stats.js b/expression-components/main/ui/components/exposed/lwc/stats/stats.js index 4cfefdc5..fa5e85f8 100644 --- a/expression-components/main/ui/components/exposed/lwc/stats/stats.js +++ b/expression-components/main/ui/components/exposed/lwc/stats/stats.js @@ -1,43 +1,17 @@ -import TwElement from "c/twElement"; -import evaluate from '@salesforce/apex/FormulaEvaluatorUiController.evaluate'; -import { api, wire } from "lwc"; -import { classNames } from 'c/utils'; +import ExpressionSiteElement from "c/expressionSiteElement"; +import { api } from "lwc"; -export default class Status extends TwElement { +export default class Status extends ExpressionSiteElement { + @api contextUrlParam; + @api previewContextId; @api expr; @api respectSharing; - computed; - error; - - @wire(evaluate, {recordId: '', formula: '$expr', respectSharing: '$respectSharing'}) - evaluate({error, data}) { - if (error) { - console.error(error); - this.error = error.body.message; - } else { - this.computed = data; - this._validate(); - } - } - get hasText() { return this.computed?.title || this.computed?.description; } - get loading() { - return !this.computed && !this.error; - } - - get hasError() { - return this.error; - } - - get ready() { - return !this.loading && !this.hasError; - } - - _validate() { + validate() { if (!this.computed) { return; } diff --git a/expression-components/main/ui/components/exposed/lwc/stats/stats.js-meta.xml b/expression-components/main/ui/components/exposed/lwc/stats/stats.js-meta.xml index aca60e26..4e91949a 100644 --- a/expression-components/main/ui/components/exposed/lwc/stats/stats.js-meta.xml +++ b/expression-components/main/ui/components/exposed/lwc/stats/stats.js-meta.xml @@ -10,6 +10,10 @@ + + -
- {computed} -
-
- -
+ +
+ {computed} +
+
diff --git a/expression-components/main/ui/components/exposed/lwc/textBlock/textBlock.js b/expression-components/main/ui/components/exposed/lwc/textBlock/textBlock.js index cc35ef01..84ba2dec 100644 --- a/expression-components/main/ui/components/exposed/lwc/textBlock/textBlock.js +++ b/expression-components/main/ui/components/exposed/lwc/textBlock/textBlock.js @@ -1,27 +1,15 @@ -import TwElement from "c/twElement"; -import evaluate from '@salesforce/apex/FormulaEvaluatorUiController.evaluate'; -import { api, wire } from "lwc"; +import ExpressionSiteElement from "c/expressionSiteElement"; +import { api } from "lwc"; import { classNames } from 'c/utils'; -export default class TextBlock extends TwElement { +export default class TextBlock extends ExpressionSiteElement { + @api contextUrlParam; + @api previewContextId; @api expr; @api respectSharing; @api textAlignment; @api color; - computed; - error; - - @wire(evaluate, {recordId: '', formula: '$expr', respectSharing: '$respectSharing'}) - evaluate({error, data}) { - if (error) { - console.error(error); - this.error = error.body.message; - } else { - this.computed = data; - } - } - get containerClasses() { return classNames( {'text-center': this.textAlignment === 'Center'}, @@ -33,16 +21,4 @@ export default class TextBlock extends TwElement { get textStyle() { return 'color: ' + this.color + ';"'; } - - get loading() { - return !this.computed && !this.error; - } - - get hasError() { - return this.error; - } - - get ready() { - return !this.loading && !this.hasError; - } } diff --git a/expression-components/main/ui/components/exposed/lwc/textBlock/textBlock.js-meta.xml b/expression-components/main/ui/components/exposed/lwc/textBlock/textBlock.js-meta.xml index a1dd469b..3f126d59 100644 --- a/expression-components/main/ui/components/exposed/lwc/textBlock/textBlock.js-meta.xml +++ b/expression-components/main/ui/components/exposed/lwc/textBlock/textBlock.js-meta.xml @@ -10,6 +10,10 @@ + + MAP({"Id": Id, "Name": Name})})'); + Object result = Evaluator.run('FETCH("ACCOUNT", ["Id", "Name"]) -> MAP({"Id": Id, "Name": Name})'); Assert.areEqual(1, ((List) result).size()); Assert.areEqual(account.Id, ((Map) ((List) result)[0]).get('Id')); diff --git a/expression-src/main/api/tests/EvaluatorTest.cls b/expression-src/main/api/tests/EvaluatorTest.cls index ad766bac..a629d875 100644 --- a/expression-src/main/api/tests/EvaluatorTest.cls +++ b/expression-src/main/api/tests/EvaluatorTest.cls @@ -849,4 +849,14 @@ private class EvaluatorTest { return 'Test'; } } + + @IsTest + private static void throwsExceptionIfThereAreMoreTokensAfterTheEndOfACompleteExpression() { + try { + Evaluator.run('1 + 1 1'); + Assert.fail('Expected exception'); + } catch (Exception e) { + Assert.isInstanceOfType(e, Exceptions.ParsingException.class); + } + } } diff --git a/expression-src/main/editor/lwc/functionLibrary/operators.js b/expression-src/main/editor/lwc/functionLibrary/operators.js index 21bdd8d3..e96545d8 100644 --- a/expression-src/main/editor/lwc/functionLibrary/operators.js +++ b/expression-src/main/editor/lwc/functionLibrary/operators.js @@ -31,7 +31,26 @@ export const operators = [ examples: [ "null" ] - } + }, + { + name: "List literal", + autoCompleteValue: "[]", + icon: "utility:list", + description: "Creates a list of values.", + examples: [ + "[1, 2, 3]", + "['a', 'b', 'c']", + ] + }, + { + name: "Map literal", + autoCompleteValue: "{}", + icon: "utility:merge_field", + description: "Creates a map of key-value pairs.", + examples: [ + '{"a": 1, "b": 2, "c": 3}' + ] + }, ] }, { diff --git a/expression-src/main/editor/staticresources/monaco/main.html b/expression-src/main/editor/staticresources/monaco/main.html index 1c187b14..588301fa 100644 --- a/expression-src/main/editor/staticresources/monaco/main.html +++ b/expression-src/main/editor/staticresources/monaco/main.html @@ -3,132 +3,134 @@
diff --git a/expression-src/main/src/interpreter/Parser.cls b/expression-src/main/src/interpreter/Parser.cls index 17489dd4..84df3ae6 100644 --- a/expression-src/main/src/interpreter/Parser.cls +++ b/expression-src/main/src/interpreter/Parser.cls @@ -7,7 +7,11 @@ public with sharing class Parser { } public Expr parse() { - return expression(); + Expr result = expression(); + if (!isAtEnd()) { + throw error(peek(), 'Unexpected character after end of expression.'); + } + return result; } private Expr equality() { diff --git a/expression-src/main/src/interpreter/Scanner.cls b/expression-src/main/src/interpreter/Scanner.cls index e488c60a..5273be30 100644 --- a/expression-src/main/src/interpreter/Scanner.cls +++ b/expression-src/main/src/interpreter/Scanner.cls @@ -189,6 +189,8 @@ public with sharing class Scanner { private Boolean match2(String str) { if (isAtEnd()) return false; + // Check that there are enough characters remaining before trying to match + if (current + 1 >= source.length()) return false; if (!source.substring(current, current + 2).equals(str)) return false; current += 2; diff --git a/expression-src/main/src/interpreter/tests/ScannerTest.cls b/expression-src/main/src/interpreter/tests/ScannerTest.cls index a043a1e3..1e214a09 100644 --- a/expression-src/main/src/interpreter/tests/ScannerTest.cls +++ b/expression-src/main/src/interpreter/tests/ScannerTest.cls @@ -184,4 +184,14 @@ private class ScannerTest { Assert.areEqual(TokenType.STRING_LITERAL_END, result[7].type); Assert.areEqual(TokenType.EOF, result[8].type); } + + @IsTest + static void match2DoesntGoBeyondEndOfInput() { + // Match2 tries to check if we are dealing with a ... or a single ., so since the key we + // are trying to access is only one character long, we need to make sure that it doesn't go + // beyond the end of the input. + String formula = '{"a": 1}.a'; + Object result = Evaluator.run(formula); + Assert.areEqual(1, result); + } } diff --git a/package.json b/package.json index d6f52623..339a8001 100644 --- a/package.json +++ b/package.json @@ -2,8 +2,8 @@ "name": "formula-evaluator", "private": true, "scripts": { - "scratch:create": "sf org create -f config/dev.json -a Expression --setdefaultusername", - "scratch:create:communities": "sf org create -f config/dev-communities.json -a Expression --setdefaultusername", + "scratch:create": "sf org create scratch -f config/dev.json -a Expression --set-default", + "scratch:create:communities": "sf org create scratch -f config/dev-communities.json -a Expression --set-default", "source:push": "sfdx force:source:push", "permset:assign": "sfdx force:user:permset:assign -n Expression_Admin", "start:dev": "npm run scratch:create && npm run source:push && npm run permset:assign", diff --git a/sfdx-project.json b/sfdx-project.json index 90fb2fa5..b8e38ca8 100644 --- a/sfdx-project.json +++ b/sfdx-project.json @@ -3,15 +3,15 @@ { "path": "expression-src", "package": "Expression (Unlocked)", - "versionName": "Version 1.24", - "versionNumber": "1.24.0.NEXT", + "versionName": "Version 1.25", + "versionNumber": "1.25.0.NEXT", "default": false }, { "path": "expression-components", "package": "Expression Components", - "versionName": "Version 1.0", - "versionNumber": "1.0.0.NEXT", + "versionName": "Version 1.1", + "versionNumber": "1.1.0.NEXT", "default": false, "dependencies": [ { @@ -32,10 +32,9 @@ "packageAliases": { "Expression (Unlocked)": "0HoDm000000XZKSKA4", "Expression Components": "0HoDm000000XZKhKAO", - "Expression Components@0.4.0-1": "04tDm0000011MgcIAE", - "Expression (Unlocked)@1.22.0-1": "04tDm0000011MhGIAU", - "Expression (Unlocked)@1.23.0-1": "04tDm0000011MhfIAE", "Expression (Unlocked)@1.24.0-1": "04tDm0000011MhkIAE", - "Expression Components@1.0.0-1": "04tDm0000011MhpIAE" + "Expression Components@1.0.0-1": "04tDm0000011MhpIAE", + "Expression (Unlocked)@1.25.0-2": "04tDm0000011MhzIAE", + "Expression Components@1.1.0-1": "04tDm0000011Mi4IAE" } -} \ No newline at end of file +}