@absolutejs/absolute 0.20.0-beta.16 → 0.20.0-beta.18
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/README.md +25 -0
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/build.js +35 -3
- package/dist/build.js.map +4 -4
- package/dist/cli/index.js +976 -722
- package/dist/dev/client/hmrClient.ts +9 -3
- package/dist/dev/client/syncDevtools.ts +237 -0
- package/dist/index.js +35 -3
- package/dist/index.js.map +4 -4
- package/dist/mobile/browser.js +110 -1
- package/dist/mobile/browser.js.map +6 -4
- package/dist/mobile/index.js +470 -125
- package/dist/mobile/index.js.map +12 -9
- package/dist/mobile/shellAuth.js +0 -8
- package/dist/mobile/shellSync.js +42 -0
- package/dist/src/mobile/browser.d.ts +1 -0
- package/dist/src/mobile/capacitorBundle.d.ts +4 -0
- package/dist/src/mobile/deviceCapabilities.d.ts +20 -0
- package/dist/src/mobile/index.d.ts +2 -0
- package/dist/src/mobile/syncRemediation.d.ts +10 -0
- package/dist/src/mobile/transport.d.ts +1 -0
- package/package.json +16 -13
package/README.md
CHANGED
|
@@ -202,6 +202,31 @@ for late UI subscribers, `checkForUpdate()` performs a passive check, and
|
|
|
202
202
|
`applyUpdate()` activates and reloads only after the user accepts. AbsoluteJS
|
|
203
203
|
does not silently replace a running application session.
|
|
204
204
|
|
|
205
|
+
### Native device capabilities
|
|
206
|
+
|
|
207
|
+
Application code uses one provider-neutral API in web pages and Capacitor apps:
|
|
208
|
+
|
|
209
|
+
```ts
|
|
210
|
+
import { clipboard, haptics, share } from '@absolutejs/devices';
|
|
211
|
+
|
|
212
|
+
await clipboard.writeText('Copied everywhere');
|
|
213
|
+
await share.share({ text: 'Shared everywhere', url: 'https://absolutejs.com' });
|
|
214
|
+
await haptics.impact('light');
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
`absolute mobile init` and `absolute mobile sync` discover these named value
|
|
218
|
+
imports, read the tested mappings published by `@absolutejs/devices-capacitor`,
|
|
219
|
+
and offer to install only the exact Capacitor plugins in use. The generated
|
|
220
|
+
shell wires them into the shared device facade; users do not import Capacitor,
|
|
221
|
+
edit Swift/Kotlin, or maintain native bootstrap code. Type-only imports and test
|
|
222
|
+
sources do not provision plugins. `absolute mobile doctor release` rejects a
|
|
223
|
+
missing or mismatched plugin before release.
|
|
224
|
+
|
|
225
|
+
Clipboard and Share use browser standards on the web and fail with normalized
|
|
226
|
+
errors when unavailable. Haptics uses vibration where supported and otherwise
|
|
227
|
+
safely becomes a no-op, because tactile feedback must never be required to
|
|
228
|
+
complete an action.
|
|
229
|
+
|
|
205
230
|
### Immutable production images
|
|
206
231
|
|
|
207
232
|
Build production assets and the server bundle while constructing the image,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
var __require = import.meta.require;
|
|
3
3
|
|
|
4
|
-
// .angular-partial-tmp-
|
|
4
|
+
// .angular-partial-tmp-1EnNiK/src/core/streamingSlotRegistrar.ts
|
|
5
5
|
var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
|
|
6
6
|
var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
|
|
7
7
|
var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
var __require = import.meta.require;
|
|
3
3
|
|
|
4
|
-
// .angular-partial-tmp-
|
|
4
|
+
// .angular-partial-tmp-1EnNiK/src/core/streamingSlotRegistrar.ts
|
|
5
5
|
var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
|
|
6
6
|
var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
|
|
7
7
|
var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
|
|
@@ -48,7 +48,7 @@ var warnMissingStreamingSlotCollector = (primitiveName) => {
|
|
|
48
48
|
getWarningController()?.maybeWarn(primitiveName);
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
-
// .angular-partial-tmp-
|
|
51
|
+
// .angular-partial-tmp-1EnNiK/src/core/streamingSlotRegistry.ts
|
|
52
52
|
var STREAMING_SLOT_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotAsyncLocalStorage");
|
|
53
53
|
var isObjectRecord2 = (value) => Boolean(value) && typeof value === "object";
|
|
54
54
|
var isAsyncLocalStorage = (value) => isObjectRecord2(value) && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function";
|
package/dist/build.js
CHANGED
|
@@ -12860,7 +12860,7 @@ var isTestSourcePath = (file) => {
|
|
|
12860
12860
|
};
|
|
12861
12861
|
|
|
12862
12862
|
// node_modules/@absolutejs/sync/dist/client/index.js
|
|
12863
|
-
var RUNTIME_TRANSPORT, host, isRegistry = (value) => typeof value === "object" && value !== null && Array.isArray(Reflect.get(value, "installations")), registry, SyncLocalDataPolicyError, SyncLocalStoreSchemaError, positiveVersion = (value, label) => {
|
|
12863
|
+
var RUNTIME_TRANSPORT, host, isRegistry = (value) => typeof value === "object" && value !== null && Array.isArray(Reflect.get(value, "installations")) && Array.isArray(Reflect.get(value, "clients")), registry, SyncLocalDataPolicyError, SyncLocalStoreSchemaError, positiveVersion = (value, label) => {
|
|
12864
12864
|
if (!Number.isSafeInteger(value) || value < 1)
|
|
12865
12865
|
throw new SyncLocalStoreSchemaError("INVALID_PLAN", `${label} must be a positive safe integer`);
|
|
12866
12866
|
return value;
|
|
@@ -12881,6 +12881,12 @@ var RUNTIME_TRANSPORT, host, isRegistry = (value) => typeof value === "object" &
|
|
|
12881
12881
|
}
|
|
12882
12882
|
for (const [index, rule] of (policy.mutations ?? []).entries()) {
|
|
12883
12883
|
validatePolicyMatch(rule.match, `${label}.mutations[${index}]`);
|
|
12884
|
+
if (rule.conflict !== undefined && rule.conflict.strategy !== "client-wins" && rule.conflict.strategy !== "manual" && rule.conflict.strategy !== "server-wins")
|
|
12885
|
+
throw new SyncLocalDataPolicyError("INVALID_POLICY", `${label}.mutations[${index}].conflict.strategy is invalid.`);
|
|
12886
|
+
if (rule.conflict?.maxAttempts !== undefined && (!Number.isSafeInteger(rule.conflict.maxAttempts) || rule.conflict.maxAttempts < 1))
|
|
12887
|
+
throw new SyncLocalDataPolicyError("INVALID_POLICY", `${label}.mutations[${index}].conflict.maxAttempts must be a positive safe integer.`);
|
|
12888
|
+
if (rule.conflict?.maxAttempts !== undefined && rule.conflict.strategy !== "client-wins")
|
|
12889
|
+
throw new SyncLocalDataPolicyError("INVALID_POLICY", `${label}.mutations[${index}].conflict.maxAttempts is only valid for client-wins.`);
|
|
12884
12890
|
if (rule.persistence === "memory-only" && rule.protection === "required")
|
|
12885
12891
|
throw new SyncLocalDataPolicyError("INVALID_POLICY", `${label}.mutations[${index}] cannot require at-rest protection when it is memory-only.`);
|
|
12886
12892
|
if (rule.sensitivity !== undefined && rule.sensitivity !== "public" && rule.protection !== "required" && rule.persistence !== "memory-only")
|
|
@@ -12946,7 +12952,11 @@ var init_client = __esm(() => {
|
|
|
12946
12952
|
const existing = host[RUNTIME_TRANSPORT];
|
|
12947
12953
|
if (isRegistry(existing))
|
|
12948
12954
|
return existing;
|
|
12949
|
-
|
|
12955
|
+
if (typeof existing === "object" && existing !== null && Array.isArray(Reflect.get(existing, "installations"))) {
|
|
12956
|
+
Reflect.set(existing, "clients", []);
|
|
12957
|
+
return existing;
|
|
12958
|
+
}
|
|
12959
|
+
const created = { clients: [], installations: [] };
|
|
12950
12960
|
Object.defineProperty(host, RUNTIME_TRANSPORT, {
|
|
12951
12961
|
configurable: false,
|
|
12952
12962
|
enumerable: false,
|
|
@@ -13134,6 +13144,7 @@ var object = (value) => typeof value === "object" && value !== null && !Array.is
|
|
|
13134
13144
|
const mutations = Array.isArray(mutationRules) ? mutationRules.map((entry, index) => {
|
|
13135
13145
|
const rule = requireObject(entry, id, `localData.mutations[${index}] must be an object.`);
|
|
13136
13146
|
const allowedRuleKeys = new Set([
|
|
13147
|
+
"conflict",
|
|
13137
13148
|
"match",
|
|
13138
13149
|
"onProtectionUnavailable",
|
|
13139
13150
|
"persistence",
|
|
@@ -13147,6 +13158,26 @@ var object = (value) => typeof value === "object" && value !== null && !Array.is
|
|
|
13147
13158
|
const sensitivity = unknownField(rule, "sensitivity");
|
|
13148
13159
|
const persistence = unknownField(rule, "persistence");
|
|
13149
13160
|
const onProtectionUnavailable = unknownField(rule, "onProtectionUnavailable");
|
|
13161
|
+
const declaredConflict = unknownField(rule, "conflict");
|
|
13162
|
+
let conflict;
|
|
13163
|
+
if (declaredConflict !== undefined) {
|
|
13164
|
+
const conflictRecord = requireObject(declaredConflict, id, `localData.mutations[${index}].conflict must be an object.`);
|
|
13165
|
+
const unsupportedConflictKey = Object.keys(conflictRecord).find((key) => key !== "maxAttempts" && key !== "strategy");
|
|
13166
|
+
if (unsupportedConflictKey)
|
|
13167
|
+
throw metadataError(id, `localData.mutations[${index}].conflict.${unsupportedConflictKey} is not supported.`);
|
|
13168
|
+
const strategy = unknownField(conflictRecord, "strategy");
|
|
13169
|
+
if (strategy !== "client-wins" && strategy !== "manual" && strategy !== "server-wins")
|
|
13170
|
+
throw metadataError(id, `localData.mutations[${index}].conflict.strategy is invalid.`);
|
|
13171
|
+
const maxAttempts = unknownField(conflictRecord, "maxAttempts");
|
|
13172
|
+
if (maxAttempts !== undefined && strategy !== "client-wins")
|
|
13173
|
+
throw metadataError(id, `localData.mutations[${index}].conflict.maxAttempts requires client-wins.`);
|
|
13174
|
+
conflict = {
|
|
13175
|
+
strategy,
|
|
13176
|
+
...maxAttempts === undefined ? {} : {
|
|
13177
|
+
maxAttempts: positiveVersion2(maxAttempts, id, `localData.mutations[${index}].conflict.maxAttempts`)
|
|
13178
|
+
}
|
|
13179
|
+
};
|
|
13180
|
+
}
|
|
13150
13181
|
if (protection !== undefined && protection !== "none" && protection !== "required")
|
|
13151
13182
|
throw metadataError(id, `localData.mutations[${index}].protection is invalid.`);
|
|
13152
13183
|
if (sensitivity !== undefined && sensitivity !== "public" && sensitivity !== "private" && sensitivity !== "secret")
|
|
@@ -13157,6 +13188,7 @@ var object = (value) => typeof value === "object" && value !== null && !Array.is
|
|
|
13157
13188
|
throw metadataError(id, `localData.mutations[${index}].persistence is invalid.`);
|
|
13158
13189
|
return {
|
|
13159
13190
|
match: nonEmpty(Reflect.get(rule, "match"), id, `localData.mutations[${index}].match`),
|
|
13191
|
+
...conflict ? { conflict } : {},
|
|
13160
13192
|
...sensitivity ? { sensitivity } : {},
|
|
13161
13193
|
...onProtectionUnavailable ? { onProtectionUnavailable } : {},
|
|
13162
13194
|
...persistence ? {
|
|
@@ -30022,5 +30054,5 @@ export {
|
|
|
30022
30054
|
build
|
|
30023
30055
|
};
|
|
30024
30056
|
|
|
30025
|
-
//# debugId=
|
|
30057
|
+
//# debugId=97F7FEF3814DEF7D64756E2164756E21
|
|
30026
30058
|
//# sourceMappingURL=build.js.map
|