@nyaruka/temba-components 0.156.14 → 0.156.16
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/CHANGELOG.md +18 -0
- package/dist/temba-components.js +157 -155
- package/dist/temba-components.js.map +1 -1
- package/package.json +1 -1
- package/src/flow/AutoTranslate.ts +104 -36
- package/src/flow/Editor.ts +14 -18
- package/src/flow/RevisionsWindow.ts +142 -36
- package/src/flow/flow-translations.ts +24 -1
- package/src/flow/revision-summary.ts +62 -0
- package/src/flow/types.ts +1 -2
- package/src/layout/Dialog.ts +1 -4
- package/src/store/AppState.ts +2 -0
- package/src/store/Store.ts +4 -0
- package/web-test-runner.config.mjs +7 -7
package/src/flow/types.ts
CHANGED
|
@@ -50,8 +50,7 @@ export const CONTEXT_MENU_SHORTCUTS: Record<FlowType, ContextMenuShortcut[]> = {
|
|
|
50
50
|
export const Features = {
|
|
51
51
|
AI: 'ai',
|
|
52
52
|
AIRTIME: 'airtime',
|
|
53
|
-
LOCATIONS: 'locations'
|
|
54
|
-
AUTO_TRANSLATE: 'auto_translate'
|
|
53
|
+
LOCATIONS: 'locations'
|
|
55
54
|
} as const;
|
|
56
55
|
|
|
57
56
|
export type Feature = (typeof Features)[keyof typeof Features];
|
package/src/layout/Dialog.ts
CHANGED
|
@@ -172,10 +172,7 @@ export class Dialog extends ResizeElement {
|
|
|
172
172
|
}
|
|
173
173
|
|
|
174
174
|
.dialog-footer {
|
|
175
|
-
background: var(
|
|
176
|
-
--dialog-footer-background,
|
|
177
|
-
var(--color-primary-light)
|
|
178
|
-
);
|
|
175
|
+
background: var(--dialog-footer-background, var(--color-primary-light));
|
|
179
176
|
padding: var(--dialog-footer-padding-top, 10px) 10px 10px;
|
|
180
177
|
display: flex;
|
|
181
178
|
flex-flow: row;
|
package/src/store/AppState.ts
CHANGED
|
@@ -185,6 +185,7 @@ export interface Activity {
|
|
|
185
185
|
|
|
186
186
|
export interface AppState {
|
|
187
187
|
features: string[];
|
|
188
|
+
brand: string;
|
|
188
189
|
|
|
189
190
|
flowDefinition: FlowDefinition;
|
|
190
191
|
flowInfo: FlowInfo;
|
|
@@ -265,6 +266,7 @@ export const zustand = createStore<AppState>()(
|
|
|
265
266
|
subscribeWithSelector(
|
|
266
267
|
immer((set, get) => ({
|
|
267
268
|
features: [] as string[],
|
|
269
|
+
brand: '',
|
|
268
270
|
languageNames: {},
|
|
269
271
|
canvasSize: { width: 0, height: 0 },
|
|
270
272
|
languageCode: '',
|
package/src/store/Store.ts
CHANGED
|
@@ -93,6 +93,9 @@ export class Store extends RapidElement {
|
|
|
93
93
|
@property({ type: String, attribute: 'shortcuts' })
|
|
94
94
|
shortcutsEndpoint: string;
|
|
95
95
|
|
|
96
|
+
@property({ type: String })
|
|
97
|
+
brand = '';
|
|
98
|
+
|
|
96
99
|
@property({ type: Object, attribute: false })
|
|
97
100
|
private schema: CompletionSchema;
|
|
98
101
|
|
|
@@ -154,6 +157,7 @@ export class Store extends RapidElement {
|
|
|
154
157
|
this.ready = false;
|
|
155
158
|
this.clearCache();
|
|
156
159
|
this.settings = JSON.parse(getCookie('settings') || '{}');
|
|
160
|
+
zustand.setState({ brand: this.brand });
|
|
157
161
|
|
|
158
162
|
/*
|
|
159
163
|
// This will create a shorthand unit
|
|
@@ -140,13 +140,13 @@ const checkScreenshot = async (filename, excluded, threshold) => {
|
|
|
140
140
|
});
|
|
141
141
|
};
|
|
142
142
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
143
|
+
// clear out any past tests once per process — clearing per-page would race
|
|
144
|
+
// with other concurrent pages that have already written test screenshots and
|
|
145
|
+
// are about to read them back, causing intermittent ENOENT failures.
|
|
146
|
+
rimraf.sync(path.resolve(SCREENSHOTS, DIFF));
|
|
147
|
+
rimraf.sync(path.resolve(SCREENSHOTS, TEST));
|
|
147
148
|
|
|
148
|
-
|
|
149
|
-
rimraf.sync(tests);
|
|
149
|
+
const wireScreenshots = async (page, context, wait, replaceScreenshots) => {
|
|
150
150
|
|
|
151
151
|
await page.exposeFunction(
|
|
152
152
|
'matchPageSnapshot',
|
|
@@ -335,7 +335,7 @@ const wireScreenshots = async (page, context, wait, replaceScreenshots) => {
|
|
|
335
335
|
|
|
336
336
|
export default {
|
|
337
337
|
rootDir: './',
|
|
338
|
-
files: '**/test/**/*.test.ts',
|
|
338
|
+
files: ['**/test/**/*.test.ts', '!**/test/utils.test.ts'],
|
|
339
339
|
nodeResolve: true,
|
|
340
340
|
concurrency: 4,
|
|
341
341
|
filterBrowserLogs(log) {
|