@nyaruka/temba-components 0.91.1 → 0.91.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/build.yml +4 -4
- package/.github/workflows/publish.yml +1 -1
- package/CHANGELOG.md +13 -0
- package/dist/temba-components.js +6 -1
- package/dist/temba-components.js.map +1 -1
- package/out-tsc/src/templates/TemplateEditor.js +9 -1
- package/out-tsc/src/templates/TemplateEditor.js.map +1 -1
- package/package.json +1 -1
- package/screenshots/truth/templates/default.png +0 -0
- package/screenshots/truth/templates/french.png +0 -0
- package/src/templates/TemplateEditor.ts +11 -1
|
@@ -7,11 +7,11 @@ jobs:
|
|
|
7
7
|
runs-on: ubuntu-latest
|
|
8
8
|
steps:
|
|
9
9
|
- name: Set Timezone
|
|
10
|
-
uses: szenius/set-timezone@
|
|
10
|
+
uses: szenius/set-timezone@v2.0
|
|
11
11
|
with:
|
|
12
12
|
timezoneLinux: "UTC"
|
|
13
13
|
- name: Checkout (GitHub)
|
|
14
|
-
uses: actions/checkout@
|
|
14
|
+
uses: actions/checkout@v4
|
|
15
15
|
- run: docker network create --driver bridge textit_default
|
|
16
16
|
- name: Build and run dev container task
|
|
17
17
|
uses: devcontainers/ci@v0.3
|
|
@@ -23,13 +23,13 @@ jobs:
|
|
|
23
23
|
|
|
24
24
|
- name: Upload artifacts
|
|
25
25
|
if: failure()
|
|
26
|
-
uses: actions/upload-artifact@
|
|
26
|
+
uses: actions/upload-artifact@v4
|
|
27
27
|
with:
|
|
28
28
|
name: screenshots
|
|
29
29
|
path: screenshots/
|
|
30
30
|
|
|
31
31
|
- name: Upload coverage to Codecov
|
|
32
|
-
uses: codecov/codecov-action@
|
|
32
|
+
uses: codecov/codecov-action@v4
|
|
33
33
|
with:
|
|
34
34
|
token: ${{secrets.CODECOV_TOKEN}}
|
|
35
35
|
files: coverage/lcov.info
|
package/CHANGELOG.md
CHANGED
|
@@ -4,8 +4,21 @@ All notable changes to this project will be documented in this file. Dates are d
|
|
|
4
4
|
|
|
5
5
|
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
6
6
|
|
|
7
|
+
#### [v0.91.3](https://github.com/nyaruka/temba-components/compare/v0.91.2...v0.91.3)
|
|
8
|
+
|
|
9
|
+
- Update screenshots for template editor [`73d5788`](https://github.com/nyaruka/temba-components/commit/73d578820ee600eaab82fee2b22156856b69cbee)
|
|
10
|
+
|
|
11
|
+
#### [v0.91.2](https://github.com/nyaruka/temba-components/compare/v0.91.1...v0.91.2)
|
|
12
|
+
|
|
13
|
+
> 10 June 2024
|
|
14
|
+
|
|
15
|
+
- Fix for empty content [`#433`](https://github.com/nyaruka/temba-components/pull/433)
|
|
16
|
+
- Bump github actions versions [`#432`](https://github.com/nyaruka/temba-components/pull/432)
|
|
17
|
+
|
|
7
18
|
#### [v0.91.1](https://github.com/nyaruka/temba-components/compare/v0.91.0...v0.91.1)
|
|
8
19
|
|
|
20
|
+
> 7 June 2024
|
|
21
|
+
|
|
9
22
|
#### [v0.91.0](https://github.com/nyaruka/temba-components/compare/v0.90.0...v0.91.0)
|
|
10
23
|
|
|
11
24
|
> 7 June 2024
|
package/dist/temba-components.js
CHANGED
|
@@ -7701,6 +7701,10 @@ background: #ccc;
|
|
|
7701
7701
|
align-items: center;
|
|
7702
7702
|
}
|
|
7703
7703
|
|
|
7704
|
+
.button .content {
|
|
7705
|
+
margin-bottom: 0;
|
|
7706
|
+
}
|
|
7707
|
+
|
|
7704
7708
|
.button .display {
|
|
7705
7709
|
margin-right: 0.5em;
|
|
7706
7710
|
background: #f9f9f9;
|
|
@@ -7724,8 +7728,9 @@ background: #ccc;
|
|
|
7724
7728
|
max-height: 50vh;
|
|
7725
7729
|
overflow-y: auto;
|
|
7726
7730
|
overflow-x: hidden;
|
|
7731
|
+
padding-bottom: 0;
|
|
7727
7732
|
}
|
|
7728
|
-
`}firstUpdated(t){super.firstUpdated(t)}updated(t){super.updated(t)}handleTemplateChanged(t){const e=this.selectedTemplate;this.selectedTemplate=t.target.values[0];const[i,o]=this.lang.split("-");this.selectedTemplate?this.selectedTemplate.translations.forEach((t=>{if(t.locale===this.lang||!o&&t.locale.split("-")[0]===i){this.translation=t;const i=new Array((t.variables||[]).length).fill("");e||this.variables&&this.variables.forEach(((t,e)=>{i[e]=t})),this.variables=i}})):this.translation=null,this.fireCustomEvent(Me.ContextChanged,{template:this.selectedTemplate,translation:this.translation,variables:this.variables})}handleAttachmentsChanged(t){const e=t.target,i=parseInt(e.getAttribute("index"));if(0===e.attachments.length)this.variables[i]="";else{const t=e.attachments[0];t.url&&t.content_type?this.variables[i]=`${t.content_type}:${t.url}`:this.variables[i]=""}this.fireContentChange()}handleVariableChanged(t){const e=t.target,i=parseInt(e.getAttribute("index"));this.variables[i]=e.value,this.fireContentChange()}fireContentChange(){this.fireCustomEvent(Me.ContentChanged,{template:this.selectedTemplate,translation:this.translation,variables:this.variables})}renderVariables(t){var e;const i=new RegExp(`{{(${Object.keys(t.variables||[]).join("|")})}}`,"g");let o=null;
|
|
7733
|
+
`}firstUpdated(t){super.firstUpdated(t)}updated(t){super.updated(t)}handleTemplateChanged(t){const e=this.selectedTemplate;this.selectedTemplate=t.target.values[0];const[i,o]=this.lang.split("-");this.selectedTemplate?this.selectedTemplate.translations.forEach((t=>{if(t.locale===this.lang||!o&&t.locale.split("-")[0]===i){this.translation=t;const i=new Array((t.variables||[]).length).fill("");e||this.variables&&this.variables.forEach(((t,e)=>{i[e]=t})),this.variables=i}})):this.translation=null,this.fireCustomEvent(Me.ContextChanged,{template:this.selectedTemplate,translation:this.translation,variables:this.variables})}handleAttachmentsChanged(t){const e=t.target,i=parseInt(e.getAttribute("index"));if(0===e.attachments.length)this.variables[i]="";else{const t=e.attachments[0];t.url&&t.content_type?this.variables[i]=`${t.content_type}:${t.url}`:this.variables[i]=""}this.fireContentChange()}handleVariableChanged(t){const e=t.target,i=parseInt(e.getAttribute("index"));this.variables[i]=e.value,this.fireContentChange()}fireContentChange(){this.fireCustomEvent(Me.ContentChanged,{template:this.selectedTemplate,translation:this.translation,variables:this.variables})}renderVariables(t){var e;const i=new RegExp(`{{(${Object.keys(t.variables||[]).join("|")})}}`,"g");let o=null,n=[];return t.content&&t.content.trim().length>0&&(n=(null===(e=t.content)||void 0===e?void 0:e.split(i))||[]),o=n.length>0?n.map(((e,i)=>{if(i%2==0)return j`<span class="text">${e}</span>`;const o=t.variables[e];return j`<temba-completion
|
|
7729
7734
|
class="variable"
|
|
7730
7735
|
type="text"
|
|
7731
7736
|
value=${o<this.variables.length?this.variables[o]:null}
|