@tstdl/base 0.90.70 → 0.90.72
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/dom/index.d.ts +1 -1
- package/dom/index.js +1 -1
- package/object-storage/object-storage.d.ts +1 -0
- package/object-storage/s3/s3.object-storage.js +2 -2
- package/package.json +3 -3
- package/signals/index.d.ts +1 -2
- package/signals/index.js +1 -2
- package/signals/operators/combine.d.ts +9 -0
- package/signals/operators/combine.js +9 -0
- package/signals/{defer.d.ts → operators/defer.d.ts} +1 -1
- package/signals/{defer.js → operators/defer.js} +1 -1
- package/signals/operators/index.d.ts +4 -0
- package/signals/operators/index.js +4 -0
- package/signals/operators/map.d.ts +2 -0
- package/signals/operators/map.js +4 -0
- package/signals/{switch-map.d.ts → operators/switch-map.d.ts} +1 -1
- package/signals/{switch-map.js → operators/switch-map.js} +1 -1
- package/signals/untracked-operator.d.ts +2 -2
- package/signals/untracked-operator.js +1 -1
- package/text/dynamic-text.model.d.ts +2 -2
- package/text/dynamic-text.model.js +5 -3
- /package/dom/{files-select.d.ts → file-select-dialog.d.ts} +0 -0
- /package/dom/{files-select.js → file-select-dialog.js} +0 -0
package/dom/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './file-select-dialog.js';
|
package/dom/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './file-select-dialog.js';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { resolveArgumentType, type Resolvable } from '../injector/interfaces.js';
|
|
2
2
|
import type { ObjectMetadata, ObjectStorageObject } from './object.js';
|
|
3
3
|
export type UploadObjectOptions = {
|
|
4
|
+
contentLength?: number;
|
|
4
5
|
metadata?: ObjectMetadata;
|
|
5
6
|
};
|
|
6
7
|
export type ObjectStorageArgument = string;
|
|
@@ -55,13 +55,13 @@ let S3ObjectStorage = class S3ObjectStorage extends ObjectStorage {
|
|
|
55
55
|
async uploadObject(key, content, options) {
|
|
56
56
|
const bucketKey = this.getBucketKey(key);
|
|
57
57
|
if (isUint8Array(content)) {
|
|
58
|
-
await this.client.putObject(this.bucket, bucketKey, Buffer.from(content), options?.metadata);
|
|
58
|
+
await this.client.putObject(this.bucket, bucketKey, Buffer.from(content), options?.contentLength, options?.metadata);
|
|
59
59
|
}
|
|
60
60
|
else {
|
|
61
61
|
const readable = Readable.fromWeb(content);
|
|
62
62
|
const errorPromise = new Promise((_, reject) => readable.on('error', reject));
|
|
63
63
|
await Promise.race([
|
|
64
|
-
this.client.putObject(this.bucket, bucketKey, readable, options?.metadata),
|
|
64
|
+
this.client.putObject(this.bucket, bucketKey, readable, options?.contentLength, options?.metadata),
|
|
65
65
|
errorPromise
|
|
66
66
|
]);
|
|
67
67
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tstdl/base",
|
|
3
|
-
"version": "0.90.
|
|
3
|
+
"version": "0.90.72",
|
|
4
4
|
"author": "Patrick Hein",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"luxon": "^3.4",
|
|
112
112
|
"reflect-metadata": "^0.2",
|
|
113
113
|
"rxjs": "^7.8",
|
|
114
|
-
"type-fest": "4.
|
|
114
|
+
"type-fest": "4.17"
|
|
115
115
|
},
|
|
116
116
|
"devDependencies": {
|
|
117
117
|
"@mxssfd/typedoc-theme": "1.1",
|
|
@@ -152,7 +152,7 @@
|
|
|
152
152
|
"playwright": "^1.43",
|
|
153
153
|
"preact": "^10.20",
|
|
154
154
|
"preact-render-to-string": "^6.4",
|
|
155
|
-
"undici": "^6.
|
|
155
|
+
"undici": "^6.14",
|
|
156
156
|
"urlpattern-polyfill": "^10.0"
|
|
157
157
|
},
|
|
158
158
|
"peerDependenciesMeta": {
|
package/signals/index.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
export * from './api.js';
|
|
2
2
|
export * from './computed-with-dependencies.js';
|
|
3
|
-
export * from './defer.js';
|
|
4
3
|
export * from './effect-with-dependencies.js';
|
|
4
|
+
export * from './operators/index.js';
|
|
5
5
|
export * from './pipe.js';
|
|
6
|
-
export * from './switch-map.js';
|
|
7
6
|
export * from './to-lazy-signal.js';
|
|
8
7
|
export * from './types.js';
|
|
9
8
|
export * from './untracked-operator.js';
|
package/signals/index.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
export * from './api.js';
|
|
2
2
|
export * from './computed-with-dependencies.js';
|
|
3
|
-
export * from './defer.js';
|
|
4
3
|
export * from './effect-with-dependencies.js';
|
|
4
|
+
export * from './operators/index.js';
|
|
5
5
|
export * from './pipe.js';
|
|
6
|
-
export * from './switch-map.js';
|
|
7
6
|
export * from './to-lazy-signal.js';
|
|
8
7
|
export * from './types.js';
|
|
9
8
|
export * from './untracked-operator.js';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Signal } from '../api.js';
|
|
2
|
+
import type { UnwrappedSignal } from '../types.js';
|
|
3
|
+
export type CombineInput = Signal<any>[];
|
|
4
|
+
export declare function combine<const T extends Signal<any>[]>(sources: T): Signal<{
|
|
5
|
+
[I in keyof T]: UnwrappedSignal<T[I]>;
|
|
6
|
+
}>;
|
|
7
|
+
export declare function combine<const T extends Record<any, Signal<any>>>(sources: T): Signal<{
|
|
8
|
+
[P in keyof T]: UnwrappedSignal<T[P]>;
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { mapObjectValues } from '../../utils/object/object.js';
|
|
2
|
+
import { isArray } from '../../utils/type-guards.js';
|
|
3
|
+
import { computed } from '../api.js';
|
|
4
|
+
export function combine(sources) {
|
|
5
|
+
const computation = isArray(sources)
|
|
6
|
+
? () => sources.map((source) => source())
|
|
7
|
+
: () => mapObjectValues(sources, (source) => source());
|
|
8
|
+
return computed(computation);
|
|
9
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type Signal } from '
|
|
1
|
+
import { type Signal } from '../api.js';
|
|
2
2
|
export declare function defer<T>(signalFactory: () => Signal<T>): Signal<T>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Signal } from '../api.js';
|
|
2
2
|
export declare function switchMap<T>(source: () => Signal<T>): Signal<T>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type
|
|
2
|
-
/**
|
|
1
|
+
import { type MonoTypeOperatorFunction } from 'rxjs';
|
|
2
|
+
/** Wraps observer in {@link untracked} */
|
|
3
3
|
export declare function runInUntracked<T>(): MonoTypeOperatorFunction<T>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
2
|
import { untracked } from './api.js';
|
|
3
|
-
/**
|
|
3
|
+
/** Wraps observer in {@link untracked} */
|
|
4
4
|
export function runInUntracked() {
|
|
5
5
|
return function runInUntracked(source) {
|
|
6
6
|
return new Observable((subscriber) => source.subscribe({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type
|
|
1
|
+
import { type Observable } from 'rxjs';
|
|
2
|
+
import { type Signal } from '../signals/api.js';
|
|
3
3
|
import type { PickBy, ReactiveValue, ReplaceKey } from '../types.js';
|
|
4
4
|
import type { LocalizableText } from './localizable-text.model.js';
|
|
5
5
|
import { LocalizationService } from './localization.service.js';
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { isObservable } from 'rxjs';
|
|
2
2
|
import { inject } from '../injector/inject.js';
|
|
3
3
|
import { computed, isSignal, toObservable, toSignal, untracked } from '../signals/api.js';
|
|
4
|
-
import { switchMap } from '../signals/switch-map.js';
|
|
4
|
+
import { switchMap } from '../signals/operators/switch-map.js';
|
|
5
5
|
import { runInUntracked } from '../signals/untracked-operator.js';
|
|
6
6
|
import { isString } from '../utils/type-guards.js';
|
|
7
7
|
import { LocalizationService } from './localization.service.js';
|
|
8
8
|
export const missingLocalizationKeyText = '[MISSING LOCALIZATION KEY]';
|
|
9
9
|
export function resolveDynamicText(text, localizationService = inject(LocalizationService)) {
|
|
10
|
-
const localizableTextSignal = isSignal(text)
|
|
11
|
-
|
|
10
|
+
const localizableTextSignal = isSignal(text)
|
|
11
|
+
? text
|
|
12
|
+
: isObservable(text)
|
|
13
|
+
? untracked(() => toSignal(text.pipe(runInUntracked()), { initialValue: missingLocalizationKeyText }))
|
|
12
14
|
: computed(() => text);
|
|
13
15
|
return switchMap(() => {
|
|
14
16
|
const localizableText = localizableTextSignal();
|
|
File without changes
|
|
File without changes
|