@yomotech/view-toolkit 1.0.35 → 1.0.37

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yomotech/view-toolkit",
3
- "version": "1.0.35",
3
+ "version": "1.0.37",
4
4
  "peerDependencies": {
5
5
  "@angular/cdk": "^21.0.0",
6
6
  "@angular/common": "^21.0.0",
@@ -73,7 +73,7 @@ declare class UtilityService {
73
73
  authParams: {
74
74
  pkce: boolean;
75
75
  issuer: any;
76
- scopes: any;
76
+ scopes: string[] | undefined;
77
77
  };
78
78
  };
79
79
  setOktaMobileCredential(environment: any): {
@@ -85,6 +85,8 @@ declare class UtilityService {
85
85
  responseType: any;
86
86
  pkceEnabled: any;
87
87
  };
88
+ /** OAuth scopes as the list okta-auth-js expects; undefined lets it use its default. */
89
+ private oauthScopeList;
88
90
  /** OAuth scope as the space separated string the OAuth2 plugin expects. */
89
91
  private oauthScope;
90
92
  setupStripePaymentForm(environment: any, form: any, onCardChange: (message: string) => void): Promise<void>;
@@ -131,8 +133,37 @@ declare class Couchdb {
131
133
  * classifying it as text would change the shape they receive.
132
134
  */
133
135
  private isTextFile;
136
+ /** Ids of the files under a folder of the project, e.g. listFiles(db, 'ssl/mobile/'). Empty on any error. */
137
+ listFiles(dbName: string, prefix: string): Promise<string[]>;
134
138
  private getDocumentUrl;
135
139
  private getDbUrl;
140
+ private isAttachmentMedia;
141
+ /** Signed links by "db/doc/name", reused until a minute before they run out. */
142
+ private mediaLinks;
143
+ /**
144
+ * A signed link for one media attachment (#145). A <video>/<audio src> sends no tenant header,
145
+ * so POST /media-token is asked with it instead - the same header every read already carries,
146
+ * nothing else is needed - and answers the path it signed plus a token for that one file
147
+ * (8 hours). The player then reads couchdb.yomotech.de<path>?token=... with Range itself.
148
+ */
149
+ getMediaStreamUrl(dbName: string, docId: string, name: string): Promise<string>;
150
+ /**
151
+ * What a media field holds, made playable: a URL (http, https, data, blob) stays as it is; a
152
+ * file name ("clip.mp4", also "Media/clip.mp4") is read from Media/ of the selected project -
153
+ * a signed link for an attachment, a data URL for an older Base64 document. '' when unknown.
154
+ */
155
+ resolveMediaSource(source: string): Promise<string>;
156
+ /** Media prepared at the start, by "db/name": an object URL (loaded whole) or a signed link. */
157
+ private preloadedMedia;
158
+ /**
159
+ * Prepares the project's video and audio at the start of the app, in the background (#145): only
160
+ * the files in environments/media.json - the media the pages use, written by the Designer on
161
+ * export; without that list nothing is preloaded. Per file the signed link; a file up to maxBytes
162
+ * (20 MB) is loaded whole and kept as an object URL, so Play starts at once and without network. A
163
+ * larger one keeps only the link. A failure is no error for the app: resolveMediaSource then asks
164
+ * for the link as before.
165
+ */
166
+ preloadProjectMedia(dbName: string, maxBytes?: number): Promise<void>;
136
167
  private getReadHeaders;
137
168
  private buildTenantHeaders;
138
169
  getImageSrcFromCouchDb(couchDbName: string, filePath: string): Promise<string>;
@@ -321,9 +352,9 @@ declare class CustomKeyboardService {
321
352
  declare class DateTimePickerService {
322
353
  private readonly keyboard;
323
354
  /** On the devices the date picker docks at the bottom like a keyboard; in a browser it drops down. */
324
- readonly isNativeMobile: boolean;
355
+ get isNativeMobile(): boolean;
325
356
  /** panelStyleClass of a date picker. */
326
- readonly datePanelClass: string;
357
+ get datePanelClass(): string;
327
358
  /** panelStyleClass of a time picker: compact and attached to its field everywhere. */
328
359
  readonly timePanelClass = "model-datepicker-panel model-timepicker-panel";
329
360
  /**
@@ -331,7 +362,7 @@ declare class DateTimePickerService {
331
362
  * wrapper around the panel, and a transformed wrapper becomes the reference of the panel's
332
363
  * position: fixed - the docked calendar flew up next to its field while closing.
333
364
  */
334
- readonly dockedMotion: {
365
+ get dockedMotion(): {
335
366
  disabled: boolean;
336
367
  } | undefined;
337
368
  private activePicker;
@@ -415,7 +446,6 @@ declare class CardComponent {
415
446
  private readonly remoteLists;
416
447
  /** Loaded lists by field reference. */
417
448
  remoteData: Record<string, any[]>;
418
- private readonly cardRemoteData;
419
449
  /** Current suggestions of an autocomplete by field reference. */
420
450
  remoteSuggestions: Record<string, any[]>;
421
451
  /** Loads every backend list the given layout nodes describe; dropdown/combobox get their items. */
@@ -516,27 +546,6 @@ declare class CardComponent {
516
546
  getMediaSource(layout: any, record: any): string;
517
547
  getMediaLabel(layout: any): string;
518
548
  getMediaKind(layout: any, record: any): 'image' | 'video' | 'audio' | 'pdf' | 'file';
519
- cardProperty(node: any): any;
520
- cardControlProperty(node: any): any;
521
- cardType(node: any): string;
522
- isSharedCardField(node: any): boolean;
523
- isCardGroup(node: any): boolean;
524
- isCardTitle(node: any, area: string): boolean;
525
- cardFieldValue(node: any, record?: any): any;
526
- cardFieldCaption(node: any): string;
527
- protectedCardValue(node: any, record: any, nested: boolean): string;
528
- private readonly emptyCardItems;
529
- cardFieldItems(node: any): any[] | undefined;
530
- cardGroupStyle(node: any): Record<string, any>;
531
- cardFieldWrapperStyle(node: any, nested: boolean, area: string): Record<string, any>;
532
- private readonly rendererFields;
533
- cardRendererField(node: any, area: string): any;
534
- private cardAccess;
535
- onCardFieldChange(node: any, value: any, record?: any, area?: string): void;
536
- onCardItemSelected(node: any, item: any, record?: any): void;
537
- private cardChangeQueued;
538
- private cardDestroyed;
539
- private scheduleCardDataChange;
540
549
  static ɵfac: i0.ɵɵFactoryDeclaration<CardComponent, never>;
541
550
  static ɵcmp: i0.ɵɵComponentDeclaration<CardComponent, "vl-card", never, { "itemInfo": { "alias": "itemInfo"; "required": false; }; "currentPage": { "alias": "currentPage"; "required": false; }; "pageSize": { "alias": "pageSize"; "required": false; }; "selectedLanguageInfo": { "alias": "selectedLanguageInfo"; "required": false; }; "mobileDisplay": { "alias": "mobileDisplay"; "required": false; }; "scrollPagination": { "alias": "scrollPagination"; "required": false; }; "pages": { "alias": "pages"; "required": false; }; "paginationMode": { "alias": "paginationMode"; "required": false; }; "paginationLoading": { "alias": "paginationLoading"; "required": false; }; }, { "cardButtonClick": "cardButtonClick"; "cardHeaderButtonClick": "cardHeaderButtonClick"; "linkDetails": "linkDetails"; "imageDetails": "imageDetails"; "onPageSizeChange": "onPageSizeChange"; "onPageChange": "onPageChange"; "cardDataChange": "cardDataChange"; }, never, never, true, never>;
542
551
  }
@@ -549,6 +558,15 @@ declare class FormComponent implements OnInit, OnChanges, AfterViewInit, OnDestr
549
558
  remoteSuggestions: Record<string, any[]>;
550
559
  /** Loads every backend list the given layout nodes describe; dropdown/combobox get their items. */
551
560
  loadRemoteLists(nodes: any[], propertySchema: any): Promise<void>;
561
+ /** Backend lists still on the way, by field reference. */
562
+ remoteLoading: Record<string, boolean>;
563
+ private lastRemoteQuery;
564
+ /**
565
+ * What an autocomplete shows when it has no entries: "loading" while its list is on the way,
566
+ * "no results" after - in the project's language (autocompleteLoading, autocompleteNoResults),
567
+ * English when the project has no text for it.
568
+ */
569
+ autocompleteEmptyText(node: any): string;
552
570
  /** (completeMethod) of an autocomplete with a backend list. */
553
571
  completeRemote(event: any, node: any): void;
554
572
  /** Date and time picker behaviour shared by all containers. */
@@ -823,7 +841,6 @@ declare class ModelComponent implements OnChanges, OnDestroy {
823
841
  resetRule(rule: any, formField: any): void;
824
842
  isRuleTriggered(rule: any, formField: any): boolean;
825
843
  applyDurationRule(rule: any, formField: any): void;
826
- private ruleClock;
827
844
  invokeSetformData(): void;
828
845
  invokeFormBtnClick(option: any, propertySchema: any, form: NgForm): void;
829
846
  checkValidty(form: NgForm): boolean;
@@ -832,11 +849,6 @@ declare class ModelComponent implements OnChanges, OnDestroy {
832
849
  getMediaSource(field: any): string;
833
850
  getMediaLabel(field: any): string;
834
851
  getMediaKind(field: any): 'image' | 'video' | 'audio' | 'pdf' | 'file';
835
- sharedErrorsVisible: boolean;
836
- sharedProperty(field: any): any;
837
- usesSharedField(field: any): boolean;
838
- private initializeSharedDefaults;
839
- onSharedFieldChange(field: any, value: any): void;
840
852
  static ɵfac: i0.ɵɵFactoryDeclaration<ModelComponent, never>;
841
853
  static ɵcmp: i0.ɵɵComponentDeclaration<ModelComponent, "vl-model", never, { "errorMessages": { "alias": "errorMessages"; "required": false; }; "modalItemInfo": { "alias": "modalItemInfo"; "required": false; }; "selectedLanguageInfo": { "alias": "selectedLanguageInfo"; "required": false; }; "userInfo": { "alias": "userInfo"; "required": false; }; "setFormDataHandler": { "alias": "setFormDataHandler"; "required": false; }; }, {}, never, never, true, never>;
842
854
  }
@@ -1250,6 +1262,11 @@ declare class CustomKeyboardDirective implements OnDestroy {
1250
1262
  static ɵdir: i0.ɵɵDirectiveDeclaration<CustomKeyboardDirective, "[vlCustomKeyboard]", never, { "keyboardType": { "alias": "vlCustomKeyboard"; "required": false; }; }, {}, never, never, true, never>;
1251
1263
  }
1252
1264
 
1265
+ /** Turns the toolkit keyboards on or off in a browser (the Designer's preview, Mobile/Tablet). */
1266
+ declare function setToolkitKeyboardOnWeb(on: boolean): void;
1267
+ /** Whether fields get the toolkit keyboards: on the devices always, in a browser when switched on. */
1268
+ declare function toolkitKeyboardActive(): boolean;
1269
+
1253
1270
  /**
1254
1271
  * The placeholder of the field `reference` in `propertySchema`, translated when the selected
1255
1272
  * language has an entry for it; empty when the project defines none.
@@ -1262,6 +1279,17 @@ declare class PlaceholderPipe implements PipeTransform {
1262
1279
  static ɵpipe: i0.ɵɵPipeDeclaration<PlaceholderPipe, "vlPlaceholder", true>;
1263
1280
  }
1264
1281
 
1282
+ /** [src]="source | vlMedia | async" - the same Promise for the same source, so no request loop. */
1283
+ declare class MediaSourcePipe implements PipeTransform {
1284
+ private couchdb;
1285
+ /** Kept one hour: a signed link lasts eight, a page lives shorter. */
1286
+ private static readonly known;
1287
+ constructor(couchdb: Couchdb);
1288
+ transform(source: string | null | undefined): Promise<string>;
1289
+ static ɵfac: i0.ɵɵFactoryDeclaration<MediaSourcePipe, never>;
1290
+ static ɵpipe: i0.ɵɵPipeDeclaration<MediaSourcePipe, "vlMedia", true>;
1291
+ }
1292
+
1265
1293
  interface RequestTimeoutMessages {
1266
1294
  requestSlow: string;
1267
1295
  requestStillSlow: string;
@@ -1331,5 +1359,13 @@ declare class RemoteListService {
1331
1359
  static ɵprov: i0.ɵɵInjectableDeclaration<RemoteListService>;
1332
1360
  }
1333
1361
 
1334
- export { AppVersionResetService, CardComponent, ConfigService, Couchdb, CustomKeyboardComponent, CustomKeyboardDirective, CustomKeyboardService, FormComponent, GridComponent, HeaderMenuComponent, LogsComponent, MobileKeycloakService, MobileOidcService, MobileOktaService, ModelComponent, NetworkLogService, NotificationService, PaginationComponent, PlaceholderPipe, REQUEST_STAGES, RemoteListService, RequestService, RequestTimeoutError, RequestTimeoutService, SIDE_DOCK_CLASS, SideMenuComponent, UtilityService, ViewToolkitModule, isNativeMobile, isNativePhone, normalizeCustomKeyboardType, resolveCustomKeyboardType, resolvePlaceholder, sideDockWidth, stagedRequest };
1362
+ /** Prefix of the forwarding path on the app's own origin. */
1363
+ declare const BACKEND_PROXY_PREFIX = "/api/proxy";
1364
+ /**
1365
+ * The address to call for a backend URL: unchanged on the devices and for relative URLs; in the web
1366
+ * https://p5w1.wilken.de/p5ws/x?y=1 becomes <origin>/api/proxy/p5w1.wilken.de/p5ws/x?y=1.
1367
+ */
1368
+ declare function backendUrl(url: string): string;
1369
+
1370
+ export { AppVersionResetService, BACKEND_PROXY_PREFIX, CardComponent, ConfigService, Couchdb, CustomKeyboardComponent, CustomKeyboardDirective, CustomKeyboardService, FormComponent, GridComponent, HeaderMenuComponent, LogsComponent, MediaSourcePipe, MobileKeycloakService, MobileOidcService, MobileOktaService, ModelComponent, NetworkLogService, NotificationService, PaginationComponent, PlaceholderPipe, REQUEST_STAGES, RemoteListService, RequestService, RequestTimeoutError, RequestTimeoutService, SIDE_DOCK_CLASS, SideMenuComponent, UtilityService, ViewToolkitModule, backendUrl, isNativeMobile, isNativePhone, normalizeCustomKeyboardType, resolveCustomKeyboardType, resolvePlaceholder, setToolkitKeyboardOnWeb, sideDockWidth, stagedRequest, toolkitKeyboardActive };
1335
1371
  export type { CustomKeyboardTarget, CustomKeyboardType, MobileAuthTokens, MobileOktaRefresh, MobileOktaTokens, OidcProvider, OidcRefresh, OidcTokens, RequestTimeoutMessages };