@pilotiq/pilotiq 0.13.0 → 0.14.0
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/.turbo/turbo-build.log +2 -2
- package/CHANGELOG.md +19 -0
- package/dist/Page.d.ts +40 -0
- package/dist/Page.d.ts.map +1 -1
- package/dist/Page.js +32 -0
- package/dist/Page.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/pageData/helpers.d.ts +16 -0
- package/dist/pageData/helpers.d.ts.map +1 -1
- package/dist/pageData/helpers.js +61 -1
- package/dist/pageData/helpers.js.map +1 -1
- package/dist/pageData/navigation.d.ts +15 -1
- package/dist/pageData/navigation.d.ts.map +1 -1
- package/dist/pageData/navigation.js +15 -0
- package/dist/pageData/navigation.js.map +1 -1
- package/dist/pageData.d.ts +1 -1
- package/dist/pageData.d.ts.map +1 -1
- package/dist/pageData.js +1 -1
- package/dist/pageData.js.map +1 -1
- package/dist/react/AppShell.d.ts +5 -0
- package/dist/react/AppShell.d.ts.map +1 -1
- package/dist/react/AppShell.js +2 -1
- package/dist/react/AppShell.js.map +1 -1
- package/dist/react/CustomPageWrapperGate.d.ts +33 -0
- package/dist/react/CustomPageWrapperGate.d.ts.map +1 -0
- package/dist/react/CustomPageWrapperGate.js +50 -0
- package/dist/react/CustomPageWrapperGate.js.map +1 -0
- package/dist/react/CustomPageWrapperRegistry.d.ts +34 -0
- package/dist/react/CustomPageWrapperRegistry.d.ts.map +1 -0
- package/dist/react/CustomPageWrapperRegistry.js +19 -0
- package/dist/react/CustomPageWrapperRegistry.js.map +1 -0
- package/dist/react/FormCollabBindingRegistry.d.ts +16 -0
- package/dist/react/FormCollabBindingRegistry.d.ts.map +1 -1
- package/dist/react/FormCollabBindingRegistry.js.map +1 -1
- package/dist/react/FormStateContext.d.ts.map +1 -1
- package/dist/react/FormStateContext.js +8 -1
- package/dist/react/FormStateContext.js.map +1 -1
- package/dist/react/fields/BuilderInput.d.ts.map +1 -1
- package/dist/react/fields/BuilderInput.js +64 -40
- package/dist/react/fields/BuilderInput.js.map +1 -1
- package/dist/react/fields/RepeaterInput.d.ts.map +1 -1
- package/dist/react/fields/RepeaterInput.js +78 -43
- package/dist/react/fields/RepeaterInput.js.map +1 -1
- package/dist/react/fields/repeaterReconcile.d.ts +66 -0
- package/dist/react/fields/repeaterReconcile.d.ts.map +1 -0
- package/dist/react/fields/repeaterReconcile.js +96 -0
- package/dist/react/fields/repeaterReconcile.js.map +1 -0
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +2 -0
- package/dist/react/index.js.map +1 -1
- package/dist/react/schemaRenderer/form/FormRenderer.d.ts.map +1 -1
- package/dist/react/schemaRenderer/form/FormRenderer.js +10 -0
- package/dist/react/schemaRenderer/form/FormRenderer.js.map +1 -1
- package/package.json +1 -1
- package/src/Page.test.ts +64 -0
- package/src/Page.ts +60 -0
- package/src/index.ts +1 -1
- package/src/pageData/helpers.ts +55 -1
- package/src/pageData/navigation.ts +31 -1
- package/src/pageData.test.ts +109 -0
- package/src/pageData.ts +1 -0
- package/src/react/AppShell.tsx +12 -1
- package/src/react/CustomPageWrapperGate.tsx +69 -0
- package/src/react/CustomPageWrapperRegistry.ts +45 -0
- package/src/react/FormCollabBindingRegistry.ts +17 -0
- package/src/react/FormStateContext.tsx +8 -1
- package/src/react/fields/BuilderInput.tsx +53 -29
- package/src/react/fields/RepeaterInput.tsx +66 -32
- package/src/react/fields/repeaterReconcile.test.ts +114 -0
- package/src/react/fields/repeaterReconcile.ts +104 -0
- package/src/react/index.ts +10 -0
- package/src/react/schemaRenderer/form/FormRenderer.tsx +10 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Phase A of the `Repeater.relationship` PK-switch reconciliation
|
|
3
|
+
* (see `pilotiq-pro/docs/plans/repeater-relationship-pk-switch.md`).
|
|
4
|
+
*
|
|
5
|
+
* When a parent form submit creates new relationship-backed rows, the
|
|
6
|
+
* server assigns each child a DB primary key — but the row's `__id` in
|
|
7
|
+
* the row CRDT is still the renderer-minted UUID from the local session.
|
|
8
|
+
* After redirect, the submitting tab's pageData carries `__id = String(pk)`
|
|
9
|
+
* while CRDT still has the UUID, so the renderer ends up showing the
|
|
10
|
+
* same row twice (DB PK from initialRows + orphan UUID from CRDT).
|
|
11
|
+
*
|
|
12
|
+
* Phase A fix: the submitting tab marks itself for a one-shot CRDT
|
|
13
|
+
* reconcile on the next mount via a per-formId sessionStorage flag.
|
|
14
|
+
* `RepeaterInput` / `BuilderInput` read the flag on mount and, when set,
|
|
15
|
+
* snapshot the row CRDT after a short settle (waiting for WS sync) and
|
|
16
|
+
* reconcile against `initialRows` — removing orphan CRDT rows not in
|
|
17
|
+
* the form's authoritative data, and adding missing CRDT rows (rare,
|
|
18
|
+
* happens when the row was DB-seeded outside the collab session).
|
|
19
|
+
*
|
|
20
|
+
* The flag is scoped per-tab via sessionStorage, so other peers' tabs
|
|
21
|
+
* never run the reconciler — preserving their in-flight edits.
|
|
22
|
+
*
|
|
23
|
+
* Phase B (server-side rename via the @rudderjs/sync Y.Doc seam) will
|
|
24
|
+
* extend this to other peers without requiring them to reload.
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* Called by `FormRenderer` on submit success. Records that this tab
|
|
28
|
+
* has just persisted the form, so the next mount of any Repeater /
|
|
29
|
+
* Builder under the same form runs the PK-switch reconciler. No-op
|
|
30
|
+
* when `formId` is empty or `sessionStorage` is unavailable (SSR).
|
|
31
|
+
*/
|
|
32
|
+
export declare function markSubmitForReconcile(formId: string): void;
|
|
33
|
+
/**
|
|
34
|
+
* Called by `RepeaterInput` / `BuilderInput` on mount. Returns `true`
|
|
35
|
+
* iff the form was just submitted in this tab AND clears the flag so
|
|
36
|
+
* subsequent mounts no-op. Idempotent across multiple Repeater/Builder
|
|
37
|
+
* fields on the same form — the FIRST reader clears the flag, so
|
|
38
|
+
* siblings see `false`. To avoid that, both fields call this helper at
|
|
39
|
+
* the same mount tick — for v1 we accept the limitation: only the first
|
|
40
|
+
* Repeater on the form runs the reconciler; siblings don't.
|
|
41
|
+
*
|
|
42
|
+
* If a future need surfaces (multiple relationship-backed Repeaters on
|
|
43
|
+
* the same form), switch to a per-field flag keyed by `formId.fieldName`
|
|
44
|
+
* or have the FormRenderer dispatch a custom event instead.
|
|
45
|
+
*/
|
|
46
|
+
export declare function consumeReconcileFlag(formId: string): boolean;
|
|
47
|
+
export interface ReconcileInputs {
|
|
48
|
+
/** Current CRDT row id order (post-WS-sync). */
|
|
49
|
+
current: readonly string[];
|
|
50
|
+
/** Authoritative row id list from server-rendered initialRows. */
|
|
51
|
+
authoritative: readonly string[];
|
|
52
|
+
}
|
|
53
|
+
export interface ReconcilePlan {
|
|
54
|
+
/** Row ids present in CRDT but not in initialRows — orphan UUIDs. */
|
|
55
|
+
toRemove: string[];
|
|
56
|
+
/** Row ids present in initialRows but not in CRDT — DB rows not yet
|
|
57
|
+
* in the room (rare; only happens when DB was seeded outside collab). */
|
|
58
|
+
toAdd: string[];
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Pure helper: compute the symmetric difference. Exported separately so
|
|
62
|
+
* unit tests don't need a DOM / sessionStorage shim to verify the
|
|
63
|
+
* reconciliation arithmetic.
|
|
64
|
+
*/
|
|
65
|
+
export declare function computeReconcilePlan({ current, authoritative }: ReconcileInputs): ReconcilePlan;
|
|
66
|
+
//# sourceMappingURL=repeaterReconcile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repeaterReconcile.d.ts","sourceRoot":"","sources":["../../../src/react/fields/repeaterReconcile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAQH;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAS3D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAW5D;AAED,MAAM,WAAW,eAAe;IAC9B,gDAAgD;IAChD,OAAO,EAAS,SAAS,MAAM,EAAE,CAAA;IACjC,kEAAkE;IAClE,aAAa,EAAG,SAAS,MAAM,EAAE,CAAA;CAClC;AAED,MAAM,WAAW,aAAa;IAC5B,qEAAqE;IACrE,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB;8EAC0E;IAC1E,KAAK,EAAK,MAAM,EAAE,CAAA;CACnB;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,EAAE,eAAe,GAAG,aAAa,CAQ/F"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Phase A of the `Repeater.relationship` PK-switch reconciliation
|
|
3
|
+
* (see `pilotiq-pro/docs/plans/repeater-relationship-pk-switch.md`).
|
|
4
|
+
*
|
|
5
|
+
* When a parent form submit creates new relationship-backed rows, the
|
|
6
|
+
* server assigns each child a DB primary key — but the row's `__id` in
|
|
7
|
+
* the row CRDT is still the renderer-minted UUID from the local session.
|
|
8
|
+
* After redirect, the submitting tab's pageData carries `__id = String(pk)`
|
|
9
|
+
* while CRDT still has the UUID, so the renderer ends up showing the
|
|
10
|
+
* same row twice (DB PK from initialRows + orphan UUID from CRDT).
|
|
11
|
+
*
|
|
12
|
+
* Phase A fix: the submitting tab marks itself for a one-shot CRDT
|
|
13
|
+
* reconcile on the next mount via a per-formId sessionStorage flag.
|
|
14
|
+
* `RepeaterInput` / `BuilderInput` read the flag on mount and, when set,
|
|
15
|
+
* snapshot the row CRDT after a short settle (waiting for WS sync) and
|
|
16
|
+
* reconcile against `initialRows` — removing orphan CRDT rows not in
|
|
17
|
+
* the form's authoritative data, and adding missing CRDT rows (rare,
|
|
18
|
+
* happens when the row was DB-seeded outside the collab session).
|
|
19
|
+
*
|
|
20
|
+
* The flag is scoped per-tab via sessionStorage, so other peers' tabs
|
|
21
|
+
* never run the reconciler — preserving their in-flight edits.
|
|
22
|
+
*
|
|
23
|
+
* Phase B (server-side rename via the @rudderjs/sync Y.Doc seam) will
|
|
24
|
+
* extend this to other peers without requiring them to reload.
|
|
25
|
+
*/
|
|
26
|
+
const STORAGE_PREFIX = 'pilotiq.repeaterReconcile.';
|
|
27
|
+
function storageKey(formId) {
|
|
28
|
+
return STORAGE_PREFIX + formId;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Called by `FormRenderer` on submit success. Records that this tab
|
|
32
|
+
* has just persisted the form, so the next mount of any Repeater /
|
|
33
|
+
* Builder under the same form runs the PK-switch reconciler. No-op
|
|
34
|
+
* when `formId` is empty or `sessionStorage` is unavailable (SSR).
|
|
35
|
+
*/
|
|
36
|
+
export function markSubmitForReconcile(formId) {
|
|
37
|
+
if (!formId)
|
|
38
|
+
return;
|
|
39
|
+
if (typeof sessionStorage === 'undefined')
|
|
40
|
+
return;
|
|
41
|
+
try {
|
|
42
|
+
sessionStorage.setItem(storageKey(formId), '1');
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
// Quota exceeded / disabled — silently skip. Reconciliation is
|
|
46
|
+
// an optimization, not a correctness requirement.
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Called by `RepeaterInput` / `BuilderInput` on mount. Returns `true`
|
|
51
|
+
* iff the form was just submitted in this tab AND clears the flag so
|
|
52
|
+
* subsequent mounts no-op. Idempotent across multiple Repeater/Builder
|
|
53
|
+
* fields on the same form — the FIRST reader clears the flag, so
|
|
54
|
+
* siblings see `false`. To avoid that, both fields call this helper at
|
|
55
|
+
* the same mount tick — for v1 we accept the limitation: only the first
|
|
56
|
+
* Repeater on the form runs the reconciler; siblings don't.
|
|
57
|
+
*
|
|
58
|
+
* If a future need surfaces (multiple relationship-backed Repeaters on
|
|
59
|
+
* the same form), switch to a per-field flag keyed by `formId.fieldName`
|
|
60
|
+
* or have the FormRenderer dispatch a custom event instead.
|
|
61
|
+
*/
|
|
62
|
+
export function consumeReconcileFlag(formId) {
|
|
63
|
+
if (!formId)
|
|
64
|
+
return false;
|
|
65
|
+
if (typeof sessionStorage === 'undefined')
|
|
66
|
+
return false;
|
|
67
|
+
try {
|
|
68
|
+
const v = sessionStorage.getItem(storageKey(formId));
|
|
69
|
+
if (v !== '1')
|
|
70
|
+
return false;
|
|
71
|
+
sessionStorage.removeItem(storageKey(formId));
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
catch {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Pure helper: compute the symmetric difference. Exported separately so
|
|
80
|
+
* unit tests don't need a DOM / sessionStorage shim to verify the
|
|
81
|
+
* reconciliation arithmetic.
|
|
82
|
+
*/
|
|
83
|
+
export function computeReconcilePlan({ current, authoritative }) {
|
|
84
|
+
const currentSet = new Set(current);
|
|
85
|
+
const authSet = new Set(authoritative);
|
|
86
|
+
const toRemove = [];
|
|
87
|
+
const toAdd = [];
|
|
88
|
+
for (const id of current)
|
|
89
|
+
if (!authSet.has(id))
|
|
90
|
+
toRemove.push(id);
|
|
91
|
+
for (const id of authoritative)
|
|
92
|
+
if (!currentSet.has(id))
|
|
93
|
+
toAdd.push(id);
|
|
94
|
+
return { toRemove, toAdd };
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=repeaterReconcile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repeaterReconcile.js","sourceRoot":"","sources":["../../../src/react/fields/repeaterReconcile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,MAAM,cAAc,GAAG,4BAA4B,CAAA;AAEnD,SAAS,UAAU,CAAC,MAAc;IAChC,OAAO,cAAc,GAAG,MAAM,CAAA;AAChC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAA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AAE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YAAE,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IACvE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAA;AAC5B,CAAC"}
|
package/dist/react/index.d.ts
CHANGED
|
@@ -14,6 +14,8 @@ export { registerFieldPresenceComponent, getFieldPresenceComponent, type FieldPr
|
|
|
14
14
|
export { registerFieldFocusReporter, getFieldFocusReporter, type FieldFocusReporter, type FieldFocusEvent, } from './FieldFocusReporterRegistry.js';
|
|
15
15
|
export { registerRecordWrapper, getRecordWrapper, type RecordWrapperProps, } from './RecordWrapperRegistry.js';
|
|
16
16
|
export { RecordWrapperGate, type RecordWrapperGateProps, } from './RecordWrapperGate.js';
|
|
17
|
+
export { registerCustomPageWrapper, getCustomPageWrapper, type CustomPageWrapperProps, } from './CustomPageWrapperRegistry.js';
|
|
18
|
+
export { CustomPageWrapperGate, type CustomPageWrapperGateProps, type PageCollabMap, } from './CustomPageWrapperGate.js';
|
|
17
19
|
export { parseRecordPageUrl, parseRecordEditUrl, type RecordPageIdentity, type RecordPageRole, type RecordEditIdentity, } from './parseRecordEditUrl.js';
|
|
18
20
|
export { registerWidgetRenderer, getWidgetRenderer, type WidgetRendererProps, } from './widgetRegistry.js';
|
|
19
21
|
export { FormStateProvider, useFieldState, useFormState, useRowBinding, type FormStateApi, type FormStateProviderProps, type UseFieldStateResult, } from './FormStateContext.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAA;AAC5D,OAAO,EACL,yBAAyB,EACzB,oBAAoB,EACpB,UAAU,EACV,KAAK,iBAAiB,GACvB,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EACL,cAAc,EACd,KAAK,mBAAmB,EACxB,UAAU,EAC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L,YAAY,EACZ,KAAK,iBAAiB,GACvB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAY,oBAAoB,CAAA;AACxD,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,GAC1B,MAAM,wBAAwB,CAAA;AAE/B,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,KAAK,WAAW,GACjB,MAAM,yBAAyB,CAAA;AAEhC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,SAAS,EAAE,MAAW,gBAAgB,CAAA;AAE/C,OAAO,EACL,eAAe,EACf,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,GAC3B,MAAM,sBAAsB,CAAA;AAC7B,YAAY,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAG7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAGlD,OAAO,EAAE,QAAQ,IAAI,UAAU,EAAE,KAAK,aAAa,IAAI,eAAe,EAAE,MAAM,eAAe,CAAA"}
|
package/dist/react/index.js
CHANGED
|
@@ -14,6 +14,8 @@ export { registerFieldPresenceComponent, getFieldPresenceComponent, } from './Fi
|
|
|
14
14
|
export { registerFieldFocusReporter, getFieldFocusReporter, } from './FieldFocusReporterRegistry.js';
|
|
15
15
|
export { registerRecordWrapper, getRecordWrapper, } from './RecordWrapperRegistry.js';
|
|
16
16
|
export { RecordWrapperGate, } from './RecordWrapperGate.js';
|
|
17
|
+
export { registerCustomPageWrapper, getCustomPageWrapper, } from './CustomPageWrapperRegistry.js';
|
|
18
|
+
export { CustomPageWrapperGate, } from './CustomPageWrapperGate.js';
|
|
17
19
|
export { parseRecordPageUrl, parseRecordEditUrl, } from './parseRecordEditUrl.js';
|
|
18
20
|
export { registerWidgetRenderer, getWidgetRenderer, } from './widgetRegistry.js';
|
|
19
21
|
export { FormStateProvider, useFieldState, useFormState, useRowBinding, } from './FormStateContext.js';
|
package/dist/react/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAsB,MAAM,eAAe,CAAA;AAC5D,OAAO,EACL,yBAAyB,EACzB,oBAAoB,EACpB,UAAU,GAEX,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EACL,cAAc,EAEd,UAAU,GAEX,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAA2B,MAAM,eAAe,CAAA;AAChG,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAA4B,MAAM,6BAA6B,CAAA;AACjH,OAAO,EACL,gCAAgC,EAChC,2BAA2B,GAE5B,MAAM,uCAAuC,CAAA;AAC9C,OAAO,EACL,yBAAyB,EACzB,qBAAqB,EACrB,6BAA6B,GAI9B,MAAM,gCAAgC,CAAA;AACvC,OAAO,EACL,gCAAgC,EAChC,2BAA2B,GAE5B,MAAM,uCAAuC,CAAA;AAC9C,OAAO,EACL,iBAAiB,EACjB,aAAa,GAEd,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EACL,wBAAwB,EACxB,mBAAmB,GAGpB,MAAM,qCAAqC,CAAA;AAC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C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;
|
|
1
|
+
{"version":3,"file":"FormRenderer.d.ts","sourceRoot":"","sources":["../../../../src/react/schemaRenderer/form/FormRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAA;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAY7D,KAAK,aAAa,GAAG,CAAC,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,CAAA;AAExE;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,EAC3B,EAAE,EACF,aAAa,GACd,EAAE;IACD,EAAE,EAAE,WAAW,CAAA;IACf,aAAa,EAAE,aAAa,CAAA;CAC7B,2CA0JA;AAyBD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAU,WAAW,EAC1B,KAAK,EAAU,MAAM,EACrB,MAAM,EAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACtC,MAAM,EAAS,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EACvC,aAAa,EAAE,aAAa,GAC3B,KAAK,CAAC,SAAS,CAejB"}
|
|
@@ -5,6 +5,7 @@ import { useCollabRoom } from '../../CollabRoomContext.js';
|
|
|
5
5
|
import { getFormCollabBinding } from '../../FormCollabBindingRegistry.js';
|
|
6
6
|
import { useNavigate } from '../../navigate.js';
|
|
7
7
|
import { useToast } from '../../Toaster.js';
|
|
8
|
+
import { markSubmitForReconcile } from '../../fields/repeaterReconcile.js';
|
|
8
9
|
import { renderField } from './renderField.js';
|
|
9
10
|
/**
|
|
10
11
|
* Top-level `<form>` element. Owns:
|
|
@@ -91,6 +92,15 @@ export function FormRenderer({ el, renderElement, }) {
|
|
|
91
92
|
return;
|
|
92
93
|
}
|
|
93
94
|
// Success — drain notifications and SPA-navigate to the redirect.
|
|
95
|
+
//
|
|
96
|
+
// Before navigating, mark this tab for the relationship-backed
|
|
97
|
+
// Repeater/Builder PK-switch reconciler. The next mount of any
|
|
98
|
+
// child Repeater/Builder under this formId will run a one-shot
|
|
99
|
+
// CRDT reconcile to drop orphan UUIDs whose rows just persisted
|
|
100
|
+
// under a fresh DB PK. See
|
|
101
|
+
// `pilotiq-pro/docs/plans/repeater-relationship-pk-switch.md`
|
|
102
|
+
// (Phase A).
|
|
103
|
+
markSubmitForReconcile(formId);
|
|
94
104
|
const notifs = data.notifications;
|
|
95
105
|
if (notifs && notifs.length > 0)
|
|
96
106
|
for (const n of notifs)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormRenderer.js","sourceRoot":"","sources":["../../../../src/react/schemaRenderer/form/FormRenderer.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAG/C,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC1F,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAA;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAM9C;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,YAAY,CAAC,EAC3B,EAAE,EACF,aAAa,GAId;IACC,MAAM,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAA;IACzC,MAAM,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC,CAAC,WAAW,EAAE,CAAA;IAC3D,MAAM,MAAM,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM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,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CAC3B,YAAW,SAAS,EAAC,0BAA0B,YAAE,GAAG,IAA5C,CAAC,CAAgD,CAC1D,CAAC,KAJM,KAAK,CAKT,CACP,CAAA;IACH,CAAC;IACD,OAAO,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;AACpC,CAAC;AAED,SAAS,oBAAoB,CAC3B,EAAe,EACf,KAAa,EACb,KAAc,EACd,aAA4B;IAE5B,4EAA4E;IAC5E,gFAAgF;IAChF,MAAM,QAAQ,GAAgB,KAAK,KAAK,SAAS;QAC/C,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE;QAChC,CAAC,CAAC,EAAE,CAAA;IACN,OAAO,WAAW,CAAC,QAAQ,EAAE,KAAK,EAAE,aAAa,CAAC,CAAA;AACpD,CAAC"}
|
package/package.json
CHANGED
package/src/Page.test.ts
CHANGED
|
@@ -47,4 +47,68 @@ describe('Page (extension hooks)', () => {
|
|
|
47
47
|
assert.equal(meta.slug, 'analytics')
|
|
48
48
|
assert.equal(meta.mode, 'custom')
|
|
49
49
|
})
|
|
50
|
+
|
|
51
|
+
describe('collab opt-in', () => {
|
|
52
|
+
it('omitted static collab → getResolvedCollabConfig returns null', () => {
|
|
53
|
+
class MyPage extends Page {}
|
|
54
|
+
assert.equal(MyPage.getResolvedCollabConfig(), null)
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
it('static collab = null → null (explicit opt-out)', () => {
|
|
58
|
+
class MyPage extends Page {
|
|
59
|
+
static override collab = null
|
|
60
|
+
}
|
|
61
|
+
assert.equal(MyPage.getResolvedCollabConfig(), null)
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
it('static collab = { room } → defaults presence to true', () => {
|
|
65
|
+
class Settings extends Page {
|
|
66
|
+
static override collab = { room: 'settings-general' }
|
|
67
|
+
}
|
|
68
|
+
assert.deepEqual(Settings.getResolvedCollabConfig(), {
|
|
69
|
+
room: 'settings-general',
|
|
70
|
+
presence: true,
|
|
71
|
+
})
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
it('object form can suppress presence', () => {
|
|
75
|
+
class Settings extends Page {
|
|
76
|
+
static override collab = { room: 'settings', presence: false }
|
|
77
|
+
}
|
|
78
|
+
assert.deepEqual(Settings.getResolvedCollabConfig(), {
|
|
79
|
+
room: 'settings',
|
|
80
|
+
presence: false,
|
|
81
|
+
})
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
it('returns null when room is empty or missing', () => {
|
|
85
|
+
// Defensive runtime checks — TS rejects `room: ''` and missing-`room`
|
|
86
|
+
// at config time; force the bad shapes through `as never` so the
|
|
87
|
+
// resolver path is still covered.
|
|
88
|
+
class A extends Page {
|
|
89
|
+
static override collab = { room: '' } as never
|
|
90
|
+
}
|
|
91
|
+
class B extends Page {
|
|
92
|
+
static override collab = {} as never
|
|
93
|
+
}
|
|
94
|
+
assert.equal(A.getResolvedCollabConfig(), null)
|
|
95
|
+
assert.equal(B.getResolvedCollabConfig(), null)
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
it('resource-bound default pages ignore collab even when set', () => {
|
|
99
|
+
class ArticleResource extends Resource {
|
|
100
|
+
static override label = 'Articles'
|
|
101
|
+
}
|
|
102
|
+
class EditArticle extends Page {
|
|
103
|
+
static override slug = 'articles/edit'
|
|
104
|
+
static override label = 'Edit Article'
|
|
105
|
+
static override collab = { room: 'should-be-ignored' }
|
|
106
|
+
static override getResource() { return ArticleResource }
|
|
107
|
+
static override getMode() { return 'edit' as const }
|
|
108
|
+
}
|
|
109
|
+
// Resource-bound pages must route collab through Resource.collab,
|
|
110
|
+
// not Page.collab — otherwise both gates would fire on the same URL.
|
|
111
|
+
assert.equal(EditArticle.getResolvedCollabConfig(), null)
|
|
112
|
+
})
|
|
113
|
+
})
|
|
50
114
|
})
|
package/src/Page.ts
CHANGED
|
@@ -4,6 +4,34 @@ import type { ResourceClass, NavigationBadgeColor, NavigationBadgeHandler } from
|
|
|
4
4
|
import type { ClusterClass } from './Cluster.js'
|
|
5
5
|
import { type IconValue, serializeIcon } from './icons/types.js'
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Per-custom-page collab configuration. Custom pages have no record id
|
|
9
|
+
* to derive a room from, so `room` is required and must be supplied as
|
|
10
|
+
* a literal string (e.g. `'team-settings'`). The plugin reads this off
|
|
11
|
+
* the panel-level `pageCollab` map and uses it to seed the page's
|
|
12
|
+
* Y.Doc.
|
|
13
|
+
*
|
|
14
|
+
* room — literal room identifier; namespaced internally so two
|
|
15
|
+
* pages with the same `room` literal collide deliberately.
|
|
16
|
+
* presence — when false, suppress the awareness layer (focus chips,
|
|
17
|
+
* cursor positions) while keeping value-sync. Defaults to true.
|
|
18
|
+
*
|
|
19
|
+
* Field-level `.collab(false)` always wins per field. Resource-bound
|
|
20
|
+
* default pages (List/Create/Edit/View) ignore this — record-scoped
|
|
21
|
+
* collab is governed by `Resource.collab`.
|
|
22
|
+
*/
|
|
23
|
+
export interface PageCollabConfig {
|
|
24
|
+
room: string
|
|
25
|
+
presence: boolean
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Raw shape accepted by `static collab` before normalization. Unlike
|
|
29
|
+
* `Resource.collab` there is no `true` shorthand — `room` is required. */
|
|
30
|
+
export type PageCollabInput = {
|
|
31
|
+
room: string
|
|
32
|
+
presence?: boolean
|
|
33
|
+
}
|
|
34
|
+
|
|
7
35
|
/**
|
|
8
36
|
* Discriminator the framework uses for default rendering, route generation,
|
|
9
37
|
* and breadcrumbs. `'custom'` is for standalone Pages that don't belong to
|
|
@@ -107,6 +135,38 @@ export class Page {
|
|
|
107
135
|
return this._schemaDef !== undefined || this.schema !== Page.schema
|
|
108
136
|
}
|
|
109
137
|
|
|
138
|
+
// ─── Realtime collab opt-in ────────────────────────────────
|
|
139
|
+
// Per-page opt-in for custom Pages. Resource-bound default pages
|
|
140
|
+
// (List/Create/Edit/View) ignore this — record-scoped collab is
|
|
141
|
+
// governed by `Resource.collab`. Set on a custom Page subclass to
|
|
142
|
+
// mount the plugin-registered custom-page wrapper around its content
|
|
143
|
+
// area at runtime.
|
|
144
|
+
|
|
145
|
+
/** Enable collab on this custom page. `room` is required (no recordId
|
|
146
|
+
* to derive one from). Omitting `static collab` keeps the page
|
|
147
|
+
* collab-free even when the `@pilotiq-pro/collab` plugin is installed. */
|
|
148
|
+
static collab: PageCollabInput | null = null
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Normalize `static collab` into the canonical wire shape, or return
|
|
152
|
+
* `null` when the page has not opted in. Centralizes the `presence`
|
|
153
|
+
* default. Resource-bound default pages always return `null` here —
|
|
154
|
+
* use `Resource.collab` for those.
|
|
155
|
+
*
|
|
156
|
+
* Result lands on `panelInfo().pageCollab[slug]`; the gate reads it to
|
|
157
|
+
* decide whether to mount the custom-page wrapper.
|
|
158
|
+
*/
|
|
159
|
+
static getResolvedCollabConfig(): PageCollabConfig | null {
|
|
160
|
+
if (this.getMode() !== 'custom') return null
|
|
161
|
+
const raw = this.collab
|
|
162
|
+
if (raw === null || raw === undefined) return null
|
|
163
|
+
if (typeof raw.room !== 'string' || raw.room.length === 0) return null
|
|
164
|
+
return {
|
|
165
|
+
room: raw.room,
|
|
166
|
+
presence: raw.presence ?? true,
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
110
170
|
/** Plan #10: authorization. Custom pages get a single `canAccess` gate
|
|
111
171
|
* (no per-record predicates — pages are too freeform to assume a
|
|
112
172
|
* record concept). Resource-bound default page subclasses can still
|
package/src/index.ts
CHANGED
|
@@ -83,7 +83,7 @@ export {
|
|
|
83
83
|
} from './RelationManager.js'
|
|
84
84
|
export { Global, type GlobalPages, type GlobalClass } from './Global.js'
|
|
85
85
|
export { Cluster, type ClusterClass } from './Cluster.js'
|
|
86
|
-
export { Page, type PageMeta, type PageMode } from './Page.js'
|
|
86
|
+
export { Page, type PageMeta, type PageMode, type PageCollabConfig, type PageCollabInput } from './Page.js'
|
|
87
87
|
export {
|
|
88
88
|
// Page base classes — extend these to bind a Page to a Resource.
|
|
89
89
|
ListPage, CreatePage, EditPage, ViewPage,
|
package/src/pageData/helpers.ts
CHANGED
|
@@ -388,7 +388,61 @@ export async function applyFillPipeline<R>(
|
|
|
388
388
|
const after = form.getMutateFormDataAfterFill()
|
|
389
389
|
if (after) values = await after(values, { values, record })
|
|
390
390
|
|
|
391
|
-
return values
|
|
391
|
+
return normalizeArrayFieldStrings(form, values)
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* Walk the form for Repeater / Builder field names whose value on `values`
|
|
396
|
+
* is a JSON string (the shape a `String?` column produces when records are
|
|
397
|
+
* seeded outside the pilotiq save path — raw SQL, migrations, imports).
|
|
398
|
+
* Pilotiq's save path stringifies these arrays via `coerceFormValues`, but
|
|
399
|
+
* the load path doesn't auto-parse — so a fresh `String?` column lands here
|
|
400
|
+
* as a string, then `resolveRepeaterRows` sees `Array.isArray(string) === false`
|
|
401
|
+
* and falls through to empty rows on first paint. The collab path is
|
|
402
|
+
* symmetric: the string lands in the form-data Y.Map, `migrateLegacyArrays`
|
|
403
|
+
* sees `Array.isArray(string) === false`, and silently skips migration.
|
|
404
|
+
*
|
|
405
|
+
* Parse defensively — anything that doesn't deserialize to an array is left
|
|
406
|
+
* verbatim so a stray non-JSON string doesn't get clobbered. Non-string
|
|
407
|
+
* values pass through untouched (already-array, null, undefined, number).
|
|
408
|
+
*/
|
|
409
|
+
export function normalizeArrayFieldStrings<R>(
|
|
410
|
+
form: Form<R>,
|
|
411
|
+
values: Record<string, unknown>,
|
|
412
|
+
): Record<string, unknown> {
|
|
413
|
+
const arrayFieldNames = collectArrayFieldNames(form.getChildren() ?? [])
|
|
414
|
+
if (arrayFieldNames.length === 0) return values
|
|
415
|
+
let out: Record<string, unknown> | null = null
|
|
416
|
+
for (const name of arrayFieldNames) {
|
|
417
|
+
const raw = values[name]
|
|
418
|
+
if (typeof raw !== 'string') continue
|
|
419
|
+
let parsed: unknown
|
|
420
|
+
try { parsed = JSON.parse(raw) } catch { continue }
|
|
421
|
+
if (!Array.isArray(parsed)) continue
|
|
422
|
+
if (!out) out = { ...values }
|
|
423
|
+
out[name] = parsed
|
|
424
|
+
}
|
|
425
|
+
return out ?? values
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
/** Walk the form's children for top-level Repeater + Builder field names.
|
|
429
|
+
* Stops at array-row boundaries — nested Repeater/Builder fields live
|
|
430
|
+
* inside their parent's inner schema and aren't top-level form fields. */
|
|
431
|
+
function collectArrayFieldNames(elements: ReadonlyArray<Element>): string[] {
|
|
432
|
+
const out: string[] = []
|
|
433
|
+
const walk = (els: ReadonlyArray<Element>): void => {
|
|
434
|
+
for (const el of els) {
|
|
435
|
+
if (isRepeaterField(el) || isBuilderField(el)) {
|
|
436
|
+
const name = (el as RepeaterField | BuilderField).name
|
|
437
|
+
if (name) out.push(name)
|
|
438
|
+
continue
|
|
439
|
+
}
|
|
440
|
+
const children = el.getChildren()
|
|
441
|
+
if (children && children.length > 0) walk(children)
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
walk(elements)
|
|
445
|
+
return out
|
|
392
446
|
}
|
|
393
447
|
|
|
394
448
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Pilotiq, PilotiqConfig } from '../Pilotiq.js'
|
|
2
|
-
import type { Page } from '../Page.js'
|
|
2
|
+
import type { Page, PageCollabConfig } from '../Page.js'
|
|
3
3
|
import type { ResourceClass, NavigationBadgeColor, ResourceCollabConfig } from '../Resource.js'
|
|
4
4
|
import type { GlobalClass } from '../Global.js'
|
|
5
5
|
import type { ClusterClass } from '../Cluster.js'
|
|
@@ -223,6 +223,34 @@ function buildRecordCollabMap(cfg: Readonly<PilotiqConfig>): RecordCollabMap | u
|
|
|
223
223
|
return Object.keys(map).length > 0 ? map : undefined
|
|
224
224
|
}
|
|
225
225
|
|
|
226
|
+
/**
|
|
227
|
+
* Per-custom-page collab opt-in map, keyed by the page's URL slug
|
|
228
|
+
* (cluster-prefixed for clustered pages). `CustomPageWrapperGate`
|
|
229
|
+
* reads this to decide whether to mount the plugin-registered
|
|
230
|
+
* custom-page wrapper (collab room, audit trail, …) around the page
|
|
231
|
+
* content area.
|
|
232
|
+
*
|
|
233
|
+
* Resource-bound default pages (List/Create/Edit/View) never appear
|
|
234
|
+
* here — `Page.getResolvedCollabConfig()` returns `null` for them.
|
|
235
|
+
* Record-scoped collab is governed by `Resource.collab` and lands on
|
|
236
|
+
* `recordCollab`.
|
|
237
|
+
*/
|
|
238
|
+
export type PageCollabMap = Record<string, PageCollabConfig>
|
|
239
|
+
|
|
240
|
+
function pageSlugForGate(P: typeof Page): string {
|
|
241
|
+
const slug = P.getSlug()
|
|
242
|
+
return P.cluster ? `${P.cluster.getSlug()}/${slug}` : slug
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
function buildPageCollabMap(cfg: Readonly<PilotiqConfig>): PageCollabMap | undefined {
|
|
246
|
+
const map: PageCollabMap = {}
|
|
247
|
+
for (const P of cfg.pages) {
|
|
248
|
+
const collab = P.getResolvedCollabConfig()
|
|
249
|
+
if (collab) map[pageSlugForGate(P)] = collab
|
|
250
|
+
}
|
|
251
|
+
return Object.keys(map).length > 0 ? map : undefined
|
|
252
|
+
}
|
|
253
|
+
|
|
226
254
|
export async function panelInfo(
|
|
227
255
|
pilotiq: Pilotiq,
|
|
228
256
|
req?: unknown,
|
|
@@ -240,6 +268,7 @@ export async function panelInfo(
|
|
|
240
268
|
])
|
|
241
269
|
const databaseNotifications = buildDatabaseNotificationsMeta(cfg, user)
|
|
242
270
|
const recordCollab = buildRecordCollabMap(cfg)
|
|
271
|
+
const pageCollab = buildPageCollabMap(cfg)
|
|
243
272
|
// AI suggestion mode — sparse: omit when 'auto' (the default) so the
|
|
244
273
|
// wire shape stays minimal for panels that don't opt into review mode.
|
|
245
274
|
// Plugin clients (e.g. @pilotiq-pro/ai's `AiClientToolBindings`) read
|
|
@@ -256,6 +285,7 @@ export async function panelInfo(
|
|
|
256
285
|
...(databaseNotifications ? { databaseNotifications } : {}),
|
|
257
286
|
...(rightSidebar ? { rightSidebar } : {}),
|
|
258
287
|
...(recordCollab ? { recordCollab } : {}),
|
|
288
|
+
...(pageCollab ? { pageCollab } : {}),
|
|
259
289
|
...(Object.keys(renderHooks).length > 0 ? { renderHooks } : {}),
|
|
260
290
|
...(aiSuggestionsMode !== 'auto' ? { aiSuggestionsMode } : {}),
|
|
261
291
|
}
|