@nyaruka/temba-components 0.118.8 → 0.119.1
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 +15 -0
- package/dist/static/svg/index.svg +1 -1
- package/dist/temba-components.js +53 -58
- package/dist/temba-components.js.map +1 -1
- package/out-tsc/src/checkbox/Checkbox.js +6 -2
- package/out-tsc/src/checkbox/Checkbox.js.map +1 -1
- package/out-tsc/src/dialog/Dialog.js +12 -6
- package/out-tsc/src/dialog/Dialog.js.map +1 -1
- package/out-tsc/src/store/Store.js +3 -1
- package/out-tsc/src/store/Store.js.map +1 -1
- package/out-tsc/src/vectoricon/index.js +2 -1
- package/out-tsc/src/vectoricon/index.js.map +1 -1
- package/out-tsc/temba-modules.js +0 -2
- package/out-tsc/temba-modules.js.map +1 -1
- package/package.json +1 -1
- package/screenshots/truth/modax/form.png +0 -0
- package/screenshots/truth/modax/simple.png +0 -0
- package/src/checkbox/Checkbox.ts +7 -2
- package/src/dialog/Dialog.ts +15 -9
- package/src/store/Store.ts +4 -1
- package/src/vectoricon/index.ts +2 -1
- package/static/svg/index.svg +1 -1
- package/static/svg/packs/5-ai/anthropic.svg +5 -0
- package/static/svg/work/traced/anthropic.svg +1 -0
- package/static/svg/work/used/anthropic.svg +5 -0
- package/temba-modules.ts +0 -2
- package/out-tsc/src/remote/Remote.js +0 -37
- package/out-tsc/src/remote/Remote.js.map +0 -1
- package/out-tsc/src/remote/Remote.test.js +0 -12
- package/out-tsc/src/remote/Remote.test.js.map +0 -1
- package/src/remote/Remote.test.ts +0 -13
- package/src/remote/Remote.ts +0 -32
package/src/dialog/Dialog.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { property } from 'lit/decorators.js';
|
|
2
|
-
import { TemplateResult, html, css
|
|
2
|
+
import { TemplateResult, html, css } from 'lit';
|
|
3
3
|
import { Button } from '../button/Button';
|
|
4
4
|
import { CustomEventType } from '../interfaces';
|
|
5
5
|
import { styleMap } from 'lit-html/directives/style-map.js';
|
|
@@ -258,10 +258,9 @@ export class Dialog extends ResizeElement {
|
|
|
258
258
|
super();
|
|
259
259
|
}
|
|
260
260
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
if (changes.has('cancelButtonName') && this.cancelButtonName) {
|
|
261
|
+
private updateButtons() {
|
|
262
|
+
this.buttons = [];
|
|
263
|
+
if (this.cancelButtonName) {
|
|
265
264
|
this.buttons.push({
|
|
266
265
|
name: this.cancelButtonName,
|
|
267
266
|
type: ButtonType.SECONDARY,
|
|
@@ -269,16 +268,23 @@ export class Dialog extends ResizeElement {
|
|
|
269
268
|
});
|
|
270
269
|
}
|
|
271
270
|
|
|
272
|
-
if (
|
|
271
|
+
if (this.primaryButtonName) {
|
|
273
272
|
this.buttons.push({
|
|
274
273
|
name: this.primaryButtonName,
|
|
275
274
|
type: ButtonType.PRIMARY
|
|
276
275
|
});
|
|
277
276
|
}
|
|
277
|
+
this.requestUpdate();
|
|
278
278
|
}
|
|
279
279
|
|
|
280
|
-
public updated(
|
|
281
|
-
|
|
280
|
+
public updated(changes: Map<string, any>) {
|
|
281
|
+
super.updated(changes);
|
|
282
|
+
|
|
283
|
+
if (changes.has('cancelButtonName') || changes.has('primaryButtonName')) {
|
|
284
|
+
this.updateButtons();
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
if (changes.has('open')) {
|
|
282
288
|
const body = document.querySelector('body');
|
|
283
289
|
|
|
284
290
|
if (this.open) {
|
|
@@ -304,7 +310,7 @@ export class Dialog extends ResizeElement {
|
|
|
304
310
|
}
|
|
305
311
|
|
|
306
312
|
// make sure our buttons aren't in progress on show
|
|
307
|
-
if (this.open && !
|
|
313
|
+
if (this.open && !changes.get('open')) {
|
|
308
314
|
this.shadowRoot
|
|
309
315
|
.querySelectorAll('temba-button')
|
|
310
316
|
.forEach((button: Button) => {
|
package/src/store/Store.ts
CHANGED
|
@@ -421,6 +421,7 @@ export class Store extends RapidElement {
|
|
|
421
421
|
url: string,
|
|
422
422
|
options?: {
|
|
423
423
|
force?: boolean;
|
|
424
|
+
skipCache?: boolean;
|
|
424
425
|
controller?: AbortController;
|
|
425
426
|
headers?: { [key: string]: string };
|
|
426
427
|
}
|
|
@@ -436,7 +437,9 @@ export class Store extends RapidElement {
|
|
|
436
437
|
(response: WebResponse) => {
|
|
437
438
|
return new Promise<WebResponse>((resolve, reject) => {
|
|
438
439
|
if (response.status >= 200 && response.status <= 300) {
|
|
439
|
-
|
|
440
|
+
if (!options.skipCache) {
|
|
441
|
+
this.cache.set(url, response);
|
|
442
|
+
}
|
|
440
443
|
resolve(response);
|
|
441
444
|
} else {
|
|
442
445
|
reject('Status: ' + response.status);
|
package/src/vectoricon/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-duplicate-enum-values */
|
|
2
2
|
// for cache busting we dynamically generate a fingerprint, use yarn svg to update
|
|
3
|
-
export const SVG_FINGERPRINT = '
|
|
3
|
+
export const SVG_FINGERPRINT = 'c15822ec97a689add7c149188f6d16c6';
|
|
4
4
|
|
|
5
5
|
// only icons below are included in the sprite sheet
|
|
6
6
|
export enum Icon {
|
|
@@ -256,6 +256,7 @@ export enum Icon {
|
|
|
256
256
|
|
|
257
257
|
// ai
|
|
258
258
|
openai = 'openai',
|
|
259
|
+
anthropic = 'anthropic',
|
|
259
260
|
|
|
260
261
|
// demo
|
|
261
262
|
default = 'list',
|