@nyaruka/temba-components 0.156.1 → 0.156.2
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/package.json
CHANGED
package/src/flow/Editor.ts
CHANGED
|
@@ -1717,12 +1717,16 @@ export class Editor extends RapidElement {
|
|
|
1717
1717
|
}
|
|
1718
1718
|
|
|
1719
1719
|
if (changes.has('showMessageTable') && !this.showMessageTable && this.plumber) {
|
|
1720
|
-
// Canvas was re-added to the DOM; rebind the plumber and repaint
|
|
1720
|
+
// Canvas was re-added to the DOM; rebind the plumber, listeners, and repaint
|
|
1721
1721
|
requestAnimationFrame(() => {
|
|
1722
1722
|
const canvas = this.querySelector('#canvas');
|
|
1723
1723
|
if (canvas) {
|
|
1724
1724
|
this.plumber.setContainer(canvas as HTMLElement);
|
|
1725
1725
|
this.plumber.repaintEverything();
|
|
1726
|
+
canvas.addEventListener('contextmenu', this.boundCanvasContextMenu);
|
|
1727
|
+
canvas.addEventListener('touchstart', this.boundCanvasTouchStart, {
|
|
1728
|
+
passive: false
|
|
1729
|
+
});
|
|
1726
1730
|
}
|
|
1727
1731
|
});
|
|
1728
1732
|
}
|
|
@@ -6072,13 +6076,6 @@ export class Editor extends RapidElement {
|
|
|
6072
6076
|
);
|
|
6073
6077
|
const hasTranslations = progress.total > 0;
|
|
6074
6078
|
const hasPendingTranslations = remainingTranslations > 0;
|
|
6075
|
-
const autoTranslateButtonLabel = this.autoTranslating
|
|
6076
|
-
? 'Stop Auto Translate'
|
|
6077
|
-
: 'Auto Translate';
|
|
6078
|
-
const showAutoTranslate = !isBaseSelected && hasPendingTranslations;
|
|
6079
|
-
const disableTranslationControls = Boolean(this.viewingRevision);
|
|
6080
|
-
const autoTranslateButtonDisabled =
|
|
6081
|
-
disableTranslationControls || (!this.autoTranslating && !hasTranslations);
|
|
6082
6079
|
|
|
6083
6080
|
return html`
|
|
6084
6081
|
<temba-floating-window
|
|
@@ -6116,25 +6113,13 @@ export class Editor extends RapidElement {
|
|
|
6116
6113
|
></temba-option>`
|
|
6117
6114
|
)}
|
|
6118
6115
|
</temba-select>
|
|
6119
|
-
${
|
|
6120
|
-
? html`<button
|
|
6121
|
-
class="auto-translate-button"
|
|
6122
|
-
type="button"
|
|
6123
|
-
?disabled=${autoTranslateButtonDisabled}
|
|
6124
|
-
@click=${this.handleAutoTranslateClick}
|
|
6125
|
-
>
|
|
6126
|
-
${autoTranslateButtonLabel}
|
|
6127
|
-
</button>`
|
|
6128
|
-
: ''}
|
|
6116
|
+
${''/* auto translate button hidden pending backend changes */}
|
|
6129
6117
|
</div>
|
|
6130
6118
|
<div
|
|
6131
6119
|
class="localization-progress ${isBaseSelected ? 'disabled' : ''}"
|
|
6132
6120
|
>
|
|
6133
6121
|
<div class="localization-progress-summary">
|
|
6134
|
-
${
|
|
6135
|
-
? html`<temba-loading units="3" size="8"></temba-loading>
|
|
6136
|
-
<span>Auto translating remaining text…</span>`
|
|
6137
|
-
: isBaseSelected
|
|
6122
|
+
${isBaseSelected
|
|
6138
6123
|
? html`<span
|
|
6139
6124
|
>Select a language to see translation progress.</span
|
|
6140
6125
|
>`
|
|
@@ -6146,11 +6131,7 @@ export class Editor extends RapidElement {
|
|
|
6146
6131
|
html`<span>${progress.localized} of ${progress.total} items translated</span>`
|
|
6147
6132
|
: html`<span>All items are translated.</span>`}
|
|
6148
6133
|
</div>
|
|
6149
|
-
${
|
|
6150
|
-
? html`<div class="auto-translate-error">
|
|
6151
|
-
${this.autoTranslateError}
|
|
6152
|
-
</div>`
|
|
6153
|
-
: ''}
|
|
6134
|
+
${''/* auto translate error hidden pending backend changes */}
|
|
6154
6135
|
<div class="localization-progress-bar-row">
|
|
6155
6136
|
<div
|
|
6156
6137
|
class="localization-progress-trigger"
|
|
@@ -6747,7 +6728,6 @@ export class Editor extends RapidElement {
|
|
|
6747
6728
|
|
|
6748
6729
|
return html`${style} ${this.renderIssuesWindow()}
|
|
6749
6730
|
${this.renderRevisionsWindow()} ${this.renderLocalizationWindow()}
|
|
6750
|
-
${this.renderAutoTranslateDialog()}
|
|
6751
6731
|
<div id="editor-container">
|
|
6752
6732
|
${this.renderToolbar()}
|
|
6753
6733
|
<div id="editor">
|
|
@@ -31,6 +31,7 @@ export const add_contact_groups: ActionConfig = {
|
|
|
31
31
|
valueKey: 'uuid',
|
|
32
32
|
nameKey: 'name',
|
|
33
33
|
placeholder: 'Search for groups...',
|
|
34
|
+
shouldExclude: (option: any) => !!option.query,
|
|
34
35
|
allowCreate: true,
|
|
35
36
|
createArbitraryOption: (input: string, options: any[]) => {
|
|
36
37
|
// Check if a label with this name already exists
|