@elytracms/studio 0.0.99 → 0.0.100
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/convex/cms.ts +29 -2
- package/convex/records-column-transform.convex.test.ts +5 -3
- package/convex/records-one-write.convex.test.ts +218 -0
- package/convex/version-kind-stamping.test.ts +118 -0
- package/dist/components/records/record-rail.js +16 -5
- package/dist/components/records/record-rail.js.map +1 -1
- package/dist/lib/engine-version.d.ts +1 -1
- package/dist/lib/engine-version.js +1 -1
- package/dist/lib/engine-version.js.map +1 -1
- package/dist/lib/i18n/messages.de.js +1 -0
- package/dist/lib/i18n/messages.de.js.map +1 -1
- package/dist/lib/i18n/messages.en.d.ts +1 -0
- package/dist/lib/i18n/messages.en.js +1 -0
- package/dist/lib/i18n/messages.en.js.map +1 -1
- package/dist/lib/operations/cms-persistence.js +9 -15
- package/dist/lib/operations/cms-persistence.js.map +1 -1
- package/dist/lib/persistence/convex-adapter.d.ts +2 -0
- package/dist/lib/persistence/convex-adapter.js +67 -2
- package/dist/lib/persistence/convex-adapter.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { applyDocumentPatches, documentKey,
|
|
1
|
+
import { applyDocumentPatches, documentKey, expandValuePath, fieldPositionPatches, formatValuePath, isValuePathPrefix, readValueAt, selfTypeDocument, semanticValueEqual, touchedPaths, touchedPathsOfEntry, valuePathsOverlap, } from '@elytracms/core/cms-core';
|
|
2
2
|
import { createPersistQueue } from './persist-queue.js';
|
|
3
3
|
/** EC-686 — a decomposed alias is re-sent at most this often (each time a colleague wrote the document in between). */
|
|
4
4
|
const ALIAS_ATTEMPTS = 3;
|
|
@@ -231,22 +231,16 @@ function withAlias(document, alias) {
|
|
|
231
231
|
/**
|
|
232
232
|
* EC-686 item 1 — what a whole-document snapshot changed against the view it was made from,
|
|
233
233
|
* position by position: a `set` (or an `unset`, the value gone) of every field position —
|
|
234
|
-
* `values[f]`, `localized[l][f]` — whose value differs by THE equality
|
|
235
|
-
*
|
|
236
|
-
*
|
|
234
|
+
* `values[f]`, `localized[l][f]` — whose value differs by THE equality. Every value change of
|
|
235
|
+
* a document is one of these; its slot `alias` is the one key that is not.
|
|
236
|
+
*
|
|
237
|
+
* EC-703 (Codex round 6 F33): THE own-property per-position diff (`fieldPositionPatches`,
|
|
238
|
+
* cms-core — the one the publish strip reads too). This copy read `bucket.after[key]`, so a
|
|
239
|
+
* removed field named after an `Object.prototype` member became `set constructor = Object`
|
|
240
|
+
* and every later `documentOf` threw (measured).
|
|
237
241
|
*/
|
|
238
242
|
function positionPatches(view, snapshot) {
|
|
239
|
-
|
|
240
|
-
for (const bucket of documentValueBuckets(view, snapshot)) {
|
|
241
|
-
for (const key of new Set([...Object.keys(bucket.before), ...Object.keys(bucket.after)])) {
|
|
242
|
-
if (semanticValueEqual(bucket.before[key], bucket.after[key]))
|
|
243
|
-
continue;
|
|
244
|
-
const path = fieldPath(key, bucket.locale);
|
|
245
|
-
const value = bucket.after[key];
|
|
246
|
-
patches.push(value === undefined ? { op: 'unset', path } : { op: 'set', path, value });
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
return patches;
|
|
243
|
+
return fieldPositionPatches(view, snapshot);
|
|
250
244
|
}
|
|
251
245
|
export function createCmsPersister(options) {
|
|
252
246
|
const queue = createPersistQueue((error) => {
|