Skip to content

Commit

Permalink
Displaying stencils while the components load (#76)
Browse files Browse the repository at this point in the history
* Displaying stencils while the components load

* Package version release.
  • Loading branch information
cesarParra authored Oct 27, 2023
1 parent fb8311c commit 1b78979
Show file tree
Hide file tree
Showing 14 changed files with 30 additions and 19 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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=04tDm0000011Mi4IAE)
[![Install Unlocked Package in Production](assets/btn-install-unlocked-package-production.png)](https://login.salesforce.com/packaging/installPackage.apexp?p0=04tDm0000011Mi4IAE)
[![Install Unlocked Package in a Sandbox](assets/btn-install-unlocked-package-sandbox.png)](https://test.salesforce.com/packaging/installPackage.apexp?p0=04tDm0000011Mi9IAE)
[![Install Unlocked Package in Production](assets/btn-install-unlocked-package-production.png)](https://login.salesforce.com/packaging/installPackage.apexp?p0=04tDm0000011Mi9IAE)

Install with SF CLI:

```shell
sf package install --apex-compile package --wait 20 --package 04tDm0000011Mi4IAE
sf package install --apex-compile package --wait 20 --package 04tDm0000011Mi9IAE
```

Install with SFDX CLI:

```shell
sfdx force:package:install --apexcompile package --wait 20 --package 04tDm0000011Mi4IAE
sfdx force:package:install --apexcompile package --wait 20 --package 04tDm0000011Mi9IAE
```

## Components
Expand Down
2 changes: 1 addition & 1 deletion expression-components/main/staticresources/tw/css/main.css

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<template>
<slot></slot>
<template lwc:if={loading}>
<div class="animate-pulse flex space-x-4 h-20">
<div class="flex-1 space-y-6 py-1">
<div class="bg-slate-200 rounded h-full"></div>
</div>
</div>
</template>
<template lwc:else>
<slot></slot>
</template>
<div if:true={cannotShowPreview}>
<c-alert type="warning" title="Unable to show preview"
message="To see a preview of the component, please provide a Preview Context ID when the Context URL Parameter is set.">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ import { LightningElement, api } from 'lwc';
export default class ExpressionElementContainer extends LightningElement {
@api cannotShowPreview = false;
@api error = null;
@api loading = false;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<c-expression-element-container cannot-show-preview={cannotShowPreview} error={error}>
<c-expression-element-container cannot-show-preview={cannotShowPreview} error={error} loading={loading}>
<div if:true={ready}>
<c-base-button action={computed} size="lg"></c-base-button>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<c-expression-element-container cannot-show-preview={cannotShowPreview} error={error}>
<c-expression-element-container cannot-show-preview={cannotShowPreview} error={error} loading={loading}>
<div lwc:if={ready} class="mx-auto max-w-7xl">
<div if:true={hasText} class="mx-auto max-w-2xl lg:mx-0">
<h2 if:true={computed.title} class="text-3xl font-bold tracking-tight text-dxp-text-contrast sm:text-4xl">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<c-expression-element-container cannot-show-preview={cannotShowPreview} error={error}>
<c-expression-element-container cannot-show-preview={cannotShowPreview} error={error} loading={loading}>
<div if:true={ready} class="relative isolate overflow-hidden bg-dxp-bg-root">
<div class={containerClasses}>
<div class={mainClasses}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<c-expression-element-container cannot-show-preview={cannotShowPreview} error={error}>
<c-expression-element-container cannot-show-preview={cannotShowPreview} error={error} loading={loading}>
<div if:true={ready} class="relative isolate overflow-hidden bg-dxp-bg-root">
<div class="bg-dxp-bg-root">
<div class="mx-auto max-w-7xl px-6 lg:px-8">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<c-expression-element-container cannot-show-preview={cannotShowPreview} error={error}>
<c-expression-element-container cannot-show-preview={cannotShowPreview} error={error} loading={loading}>
<header if:true={ready} class="inset-x-0 top-0 z-50">
<nav class="flex items-center justify-between p-6 lg:px-8" aria-label="Global">
<div class="flex lg:flex-1">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<c-expression-element-container cannot-show-preview={cannotShowPreview} error={error}>
<c-expression-element-container cannot-show-preview={cannotShowPreview} error={error} loading={loading}>
<div if:true={ready}>
<div class="mx-auto max-w-7xl px-6 lg:px-8">
<div if:true={hasText} class="mx-auto max-w-2xl sm:text-center">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<c-expression-element-container cannot-show-preview={cannotShowPreview} error={error}>
<c-expression-element-container cannot-show-preview={cannotShowPreview} error={error} loading={loading}>
<div if:true={ready}>
<div class="mx-auto max-w-7xl px-6 lg:px-8">
<div class="mx-auto max-w-4xl sm:text-center">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<c-expression-element-container cannot-show-preview={cannotShowPreview} error={error}>
<c-expression-element-container cannot-show-preview={cannotShowPreview} error={error} loading={loading}>
<div lwc:if={ready}>
<div class="mx-auto max-w-7xl">
<div class="mx-auto max-w-2xl lg:max-w-none">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<c-expression-element-container cannot-show-preview={cannotShowPreview} error={error}>
<c-expression-element-container cannot-show-preview={cannotShowPreview} error={error} loading={loading}>
<div if:true={ready} class={containerClasses}>
<span style={textStyle}>{computed}</span>
</div>
Expand Down
9 changes: 5 additions & 4 deletions sfdx-project.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
{
"path": "expression-components",
"package": "Expression Components",
"versionName": "Version 1.1",
"versionNumber": "1.1.0.NEXT",
"versionName": "Version 1.2",
"versionNumber": "1.2.0.NEXT",
"default": false,
"dependencies": [
{
Expand All @@ -35,6 +35,7 @@
"Expression (Unlocked)@1.24.0-1": "04tDm0000011MhkIAE",
"Expression [email protected]": "04tDm0000011MhpIAE",
"Expression (Unlocked)@1.25.0-2": "04tDm0000011MhzIAE",
"Expression [email protected]": "04tDm0000011Mi4IAE"
"Expression [email protected]": "04tDm0000011Mi4IAE",
"Expression [email protected]": "04tDm0000011Mi9IAE"
}
}
}

0 comments on commit 1b78979

Please sign in to comment.