@pilotiq/pilotiq 0.9.0 → 0.11.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.
Files changed (55) hide show
  1. package/.turbo/turbo-build.log +2 -2
  2. package/CHANGELOG.md +168 -0
  3. package/dist/Pilotiq.d.ts +55 -0
  4. package/dist/Pilotiq.d.ts.map +1 -1
  5. package/dist/Pilotiq.js +21 -0
  6. package/dist/Pilotiq.js.map +1 -1
  7. package/dist/index.d.ts +1 -1
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js.map +1 -1
  10. package/dist/pageData/helpers.d.ts +19 -1
  11. package/dist/pageData/helpers.d.ts.map +1 -1
  12. package/dist/pageData/helpers.js +33 -0
  13. package/dist/pageData/helpers.js.map +1 -1
  14. package/dist/pageData/resourcePages.d.ts.map +1 -1
  15. package/dist/pageData/resourcePages.js +17 -2
  16. package/dist/pageData/resourcePages.js.map +1 -1
  17. package/dist/pageData.d.ts +1 -1
  18. package/dist/pageData.d.ts.map +1 -1
  19. package/dist/pageData.js +1 -1
  20. package/dist/pageData.js.map +1 -1
  21. package/dist/react/FormCollabBindingRegistry.d.ts +130 -0
  22. package/dist/react/FormCollabBindingRegistry.d.ts.map +1 -1
  23. package/dist/react/FormCollabBindingRegistry.js.map +1 -1
  24. package/dist/react/FormStateContext.d.ts +39 -1
  25. package/dist/react/FormStateContext.d.ts.map +1 -1
  26. package/dist/react/FormStateContext.js +126 -33
  27. package/dist/react/FormStateContext.js.map +1 -1
  28. package/dist/react/fields/BuilderInput.d.ts.map +1 -1
  29. package/dist/react/fields/BuilderInput.js +112 -10
  30. package/dist/react/fields/BuilderInput.js.map +1 -1
  31. package/dist/react/fields/RepeaterInput.d.ts.map +1 -1
  32. package/dist/react/fields/RepeaterInput.js +113 -10
  33. package/dist/react/fields/RepeaterInput.js.map +1 -1
  34. package/dist/react/formStateHelpers.d.ts +102 -0
  35. package/dist/react/formStateHelpers.d.ts.map +1 -1
  36. package/dist/react/formStateHelpers.js +234 -0
  37. package/dist/react/formStateHelpers.js.map +1 -1
  38. package/dist/react/index.d.ts +2 -2
  39. package/dist/react/index.d.ts.map +1 -1
  40. package/dist/react/index.js +1 -1
  41. package/dist/react/index.js.map +1 -1
  42. package/package.json +1 -1
  43. package/src/Pilotiq.ts +64 -0
  44. package/src/index.ts +2 -0
  45. package/src/pageData/helpers.ts +40 -1
  46. package/src/pageData/resourcePages.ts +17 -1
  47. package/src/pageData.test.ts +101 -0
  48. package/src/pageData.ts +1 -0
  49. package/src/react/FormCollabBindingRegistry.ts +129 -0
  50. package/src/react/FormStateContext.tsx +157 -34
  51. package/src/react/fields/BuilderInput.tsx +97 -8
  52. package/src/react/fields/RepeaterInput.tsx +97 -8
  53. package/src/react/formStateHelpers.test.ts +312 -0
  54. package/src/react/formStateHelpers.ts +246 -0
  55. package/src/react/index.ts +3 -0
@@ -227,4 +227,238 @@ export function readNestedValue(root, path) {
227
227
  }
228
228
  return cursor;
229
229
  }
230
+ /**
231
+ * Phase F.5 — parse a dotted form-field name into row-array coordinates
232
+ * when it matches a Repeater or Builder row-leaf shape; return `null`
233
+ * otherwise. Used by `FormStateProvider` to route row-leaf writes
234
+ * through `FormCollabBinding.setRow` instead of skipping them.
235
+ *
236
+ * `tags.0.label` → { arrayName: 'tags', index: 0, fieldName: 'label' } (Repeater)
237
+ * `blocks.0.data.body` → { arrayName: 'blocks', index: 0, fieldName: 'body' } (Builder)
238
+ * `tags.0.__id` → null (row identity — handled by addRow / reorderRows)
239
+ * `blocks.0.type` → null (Builder block discriminator — not a user field)
240
+ * `foo` → null (top-level field — top-level binding.set path)
241
+ * `tags.notnum.label` → null (malformed)
242
+ *
243
+ * Nested Repeaters / Builders (e.g. `articles.0.comments.1.body`) are
244
+ * out of scope v1 — they return `null` here too. F.5b's binding impl
245
+ * therefore never sees them and they continue to ride the local-state
246
+ * path until a future phase opens the door.
247
+ */
248
+ export function parseRowFieldPath(path) {
249
+ const segments = path.split('.');
250
+ if (segments.length === 3) {
251
+ const [arrayName, idxRaw, fieldName] = segments;
252
+ if (!/^\d+$/.test(idxRaw))
253
+ return null;
254
+ if (!arrayName || !fieldName)
255
+ return null;
256
+ if (fieldName === '__id' || fieldName === 'type')
257
+ return null;
258
+ return { arrayName, index: Number(idxRaw), fieldName };
259
+ }
260
+ if (segments.length === 4 && segments[2] === 'data') {
261
+ const [arrayName, idxRaw, , fieldName] = segments;
262
+ if (!/^\d+$/.test(idxRaw))
263
+ return null;
264
+ if (!arrayName || !fieldName)
265
+ return null;
266
+ return { arrayName, index: Number(idxRaw), fieldName };
267
+ }
268
+ return null;
269
+ }
270
+ /**
271
+ * Phase F.5 — resolve the stable `__id` of the row at `arrayName[index]`
272
+ * from a flat dotted-path values map. The renderer mints `__id` on every
273
+ * row insert (UUID for new / DB PK for relationship-backed) so callers
274
+ * here are looking up an id that already exists; returns `null` only
275
+ * when the row hasn't been registered yet (e.g. the binding observed a
276
+ * remote insert before the local renderer rebuilt its row map).
277
+ *
278
+ * The lookup always reads from the flat shape (`${arrayName}.${index}.__id`)
279
+ * since both `FormStateProvider`'s `valuesRef` and server-resolve responses
280
+ * use flat dotted-path keys.
281
+ */
282
+ export function rowIdAtIndex(values, arrayName, index) {
283
+ const flat = values[`${arrayName}.${index}.__id`];
284
+ if (typeof flat === 'string' && flat.length > 0)
285
+ return flat;
286
+ return null;
287
+ }
288
+ /**
289
+ * Phase F2 — returns `true` iff the named field has explicitly opted out
290
+ * of realtime collab via `Field.collab(false)`. Sparse meta — absent =
291
+ * inherit the panel default (collab on). Walks the form meta tree the
292
+ * same way `findFieldMeta` does. Cheap (one map lookup per write).
293
+ *
294
+ * Exposed so `routeBindingWrite` can compose against it from this
295
+ * module instead of FormStateContext's private helper.
296
+ */
297
+ export function fieldOptsOutOfCollab(formMeta, name) {
298
+ const meta = findFieldMeta(formMeta, name);
299
+ return meta?.collab === false;
300
+ }
301
+ /**
302
+ * Phase F.5 — route a single (name, value) write through the collab
303
+ * binding by name shape:
304
+ *
305
+ * - top-level name → `binding.set(name, value)` (F2 path)
306
+ * - row leaf → `binding.setRow(arrayName, rowId, fieldName, value)`
307
+ * when the binding implements F.5; falls through
308
+ * to no-op otherwise (v1 skip-on-dot behaviour).
309
+ *
310
+ * Skips when no binding is registered or the field opted out via
311
+ * `.collab(false)`. `valuesForLookup` supplies the rowId map — pass the
312
+ * latest snapshot the caller has access to (`valuesRef.current` for
313
+ * local writes; merged `valuesRef + serverValues` for server-resolve).
314
+ *
315
+ * Shared between `setValue` (local edits) and the server-resolve overlay
316
+ * inside `performLivePost` so both routing decisions stay in lockstep.
317
+ */
318
+ export function routeBindingWrite(binding, formMeta, valuesForLookup, name, value) {
319
+ if (!binding)
320
+ return;
321
+ if (formMeta && fieldOptsOutOfCollab(formMeta, name))
322
+ return;
323
+ if (!name.includes('.')) {
324
+ binding.set(name, value);
325
+ return;
326
+ }
327
+ if (!binding.setRow)
328
+ return; // pre-F.5 binding — row leaves stay local
329
+ const parsed = parseRowFieldPath(name);
330
+ if (!parsed)
331
+ return; // nested-Repeater / malformed — out of scope v1
332
+ const rowId = rowIdAtIndex(valuesForLookup, parsed.arrayName, parsed.index);
333
+ if (!rowId)
334
+ return; // row not yet stamped — local-only until id lands
335
+ binding.setRow(parsed.arrayName, rowId, parsed.fieldName, value);
336
+ }
337
+ /**
338
+ * Phase F.5 — walk a form's meta tree for top-level Repeater / Builder
339
+ * field names. Used by `FormStateProvider` to build the per-array
340
+ * `RowBindingApi` map from a single meta walk at binding mount.
341
+ *
342
+ * Stops at the array boundary itself — we want the array's own field
343
+ * name, not the inner-row fields inside it (which address through
344
+ * `setRow`'s dotted-path routing, not through their own row bindings).
345
+ * Skips fields opted out via `.collab(false)` so the array is left on
346
+ * the v1 local-state path.
347
+ */
348
+ export function collectRowArrayFieldNames(formMeta) {
349
+ const out = [];
350
+ walk(formMeta);
351
+ return out;
352
+ function walk(node) {
353
+ if (node.type === 'field') {
354
+ const fieldType = node['fieldType'];
355
+ if (fieldType === 'repeater' || fieldType === 'builder') {
356
+ if (node.collab !== false) {
357
+ const name = String(node['name'] ?? '');
358
+ if (name)
359
+ out.push(name);
360
+ }
361
+ // Don't descend — inner row fields address through dotted-path
362
+ // routing, not their own row bindings.
363
+ return;
364
+ }
365
+ }
366
+ const children = node.children;
367
+ if (Array.isArray(children)) {
368
+ for (const child of children)
369
+ walk(child);
370
+ }
371
+ }
372
+ }
373
+ /**
374
+ * Phase F.5c — text-shaped fieldTypes whose row-leaf values should be
375
+ * routed through `Y.Text` instead of `Y.Map` LWW. Mirrors the same
376
+ * allowlist `@pilotiq-pro/collab`'s top-level binding uses; consumers
377
+ * registering character-level CRDT for additional plain-text-shaped
378
+ * fields update both copies in lockstep until a cross-repo shared
379
+ * constants module exists.
380
+ */
381
+ const ROW_TEXT_FIELD_TYPES = new Set([
382
+ 'text', 'textarea', 'email', 'slug', 'markdown',
383
+ ]);
384
+ /**
385
+ * Phase F.5c — per-Repeater/Builder set of inner-field names that
386
+ * carry text-shaped leaves eligible for character-level CRDT. Drives
387
+ * `useFieldState(dottedName).textBinding` resolution: only fields in
388
+ * the per-array set go through `binding.getRowTextBinding`; everything
389
+ * else stays on row-level Y.Map LWW.
390
+ *
391
+ * Repeater rows expose their schema directly under `meta.children`;
392
+ * Builder rows nest schemas under `meta.blocks[i].template`. The
393
+ * walker descends through every block's template so a `markdown` leaf
394
+ * inside any block-type lands in the array's allowlist. Nested
395
+ * Repeaters / Builders inside row schemas are out of scope v1 (their
396
+ * dotted paths are 5+ segments and `parseRowFieldPath` rejects them).
397
+ */
398
+ export function collectRowTextLeavesByArray(formMeta) {
399
+ const out = new Map();
400
+ walkTop(formMeta);
401
+ return out;
402
+ function walkTop(node) {
403
+ if (node.type === 'field') {
404
+ const fieldType = String(node['fieldType'] ?? '');
405
+ if (fieldType === 'repeater' || fieldType === 'builder') {
406
+ if (node.collab === false)
407
+ return;
408
+ const name = String(node['name'] ?? '');
409
+ if (!name)
410
+ return;
411
+ const set = new Set();
412
+ // Repeater's `toMeta()` emits the row schema under `template` (not
413
+ // `children` — that's per-resolved-row). Builder nests row schemas
414
+ // under `blocks[i].template`. Reading `children` here pre-fix gave
415
+ // every Repeater an empty text-leaf set → row text never CRDT'd.
416
+ if (fieldType === 'repeater')
417
+ walkRow(node.template, set);
418
+ else
419
+ walkBlocks(node.blocks, set);
420
+ if (set.size > 0)
421
+ out.set(name, set);
422
+ return;
423
+ }
424
+ }
425
+ const children = node.children;
426
+ if (Array.isArray(children)) {
427
+ for (const child of children)
428
+ walkTop(child);
429
+ }
430
+ }
431
+ function walkRow(children, set) {
432
+ if (!Array.isArray(children))
433
+ return;
434
+ for (const child of children)
435
+ walkRowEl(child, set);
436
+ }
437
+ function walkRowEl(node, set) {
438
+ if (node.type === 'field') {
439
+ const fieldType = String(node['fieldType'] ?? '');
440
+ if (fieldType === 'repeater' || fieldType === 'builder')
441
+ return; // nested array
442
+ if (node.collab === false)
443
+ return;
444
+ const name = String(node['name'] ?? '');
445
+ if (name && ROW_TEXT_FIELD_TYPES.has(fieldType))
446
+ set.add(name);
447
+ return;
448
+ }
449
+ const children = node.children;
450
+ if (Array.isArray(children)) {
451
+ for (const child of children)
452
+ walkRowEl(child, set);
453
+ }
454
+ }
455
+ function walkBlocks(blocks, set) {
456
+ if (!Array.isArray(blocks))
457
+ return;
458
+ for (const block of blocks) {
459
+ const tpl = block.template;
460
+ walkRow(tpl, set);
461
+ }
462
+ }
463
+ }
230
464
  //# sourceMappingURL=formStateHelpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"formStateHelpers.js","sourceRoot":"","sources":["../../src/react/formStateHelpers.ts"],"names":[],"mappings":"AAEA;;sEAEsE;AACtE,MAAM,UAAU,oBAAoB,CAAC,QAAqB;IACxD,MAAM,GAAG,GAA4B,EAAE,CAAA;IACvC,gEAAgE;IAChE,mEAAmE;IACnE,sEAAsE;IACtE,sEAAsE;IACtE,4BAA4B;IAC5B,UAAU,CAAC,QAAQ,EAAE,CAAC,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nD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;YAAE,OAAM;QAClC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YAC3B,MAAM,GAAG,GAAI,KAAgC,CAAC,QAAQ,CAAA;YACtD,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;QACnB,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -8,14 +8,14 @@ export { PendingSuggestionsContext, usePendingSuggestions, usePendingSuggestions
8
8
  export { registerPendingSuggestionApplier, getPendingSuggestionApplier, type PendingSuggestionApplier, } from './PendingSuggestionApplierRegistry.js';
9
9
  export { CollabRoomContext, useCollabRoom, type CollabRoom, } from './CollabRoomContext.js';
10
10
  export { registerCollabExtensions, getCollabExtensions, type CollabExtensionFactory, type CollabExtensionFactoryArgs, } from './CollabExtensionFactoryRegistry.js';
11
- export { registerFormCollabBinding, getFormCollabBinding, type FormCollabBinding, type FormCollabBindingFactory, type FormCollabBindingFactoryArgs, type TextBinding, type TextDelta, } from './FormCollabBindingRegistry.js';
11
+ export { registerFormCollabBinding, getFormCollabBinding, type FormCollabBinding, type FormCollabBindingFactory, type FormCollabBindingFactoryArgs, type TextBinding, type TextDelta, type RowsEvent, type RowBindingApi, } from './FormCollabBindingRegistry.js';
12
12
  export { registerFieldPresenceComponent, getFieldPresenceComponent, type FieldPresenceProps, } from './FieldPresenceRegistry.js';
13
13
  export { registerFieldFocusReporter, getFieldFocusReporter, type FieldFocusReporter, type FieldFocusEvent, } from './FieldFocusReporterRegistry.js';
14
14
  export { registerRecordWrapper, getRecordWrapper, type RecordWrapperProps, } from './RecordWrapperRegistry.js';
15
15
  export { RecordWrapperGate, type RecordWrapperGateProps, } from './RecordWrapperGate.js';
16
16
  export { parseRecordPageUrl, parseRecordEditUrl, type RecordPageIdentity, type RecordPageRole, type RecordEditIdentity, } from './parseRecordEditUrl.js';
17
17
  export { registerWidgetRenderer, getWidgetRenderer, type WidgetRendererProps, } from './widgetRegistry.js';
18
- export { FormStateProvider, useFieldState, useFormState, type FormStateApi, type FormStateProviderProps, type UseFieldStateResult, } from './FormStateContext.js';
18
+ export { FormStateProvider, useFieldState, useFormState, useRowBinding, type FormStateApi, type FormStateProviderProps, type UseFieldStateResult, } from './FormStateContext.js';
19
19
  export { parseFormDataToNested } from './formStateHelpers.js';
20
20
  export { NavigateProvider, useNavigate, type NavigateFn } from './navigate.js';
21
21
  export { ToasterProvider, useToast } from './Toaster.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,EACV,KAAK,eAAe,GACrB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,KAAK,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAChG,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,KAAK,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AACjH,OAAO,EACL,gCAAgC,EAChC,2BAA2B,EAC3B,KAAK,6BAA6B,GACnC,MAAM,uCAAuC,CAAA;AAC9C,OAAO,EACL,yBAAyB,EACzB,qBAAqB,EACrB,6BAA6B,EAC7B,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,GAC3B,MAAM,gCAAgC,CAAA;AACvC,OAAO,EACL,gCAAgC,EAChC,2BAA2B,EAC3B,KAAK,wBAAwB,GAC9B,MAAM,uCAAuC,CAAA;AAC9C,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,KAAK,UAAU,GAChB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,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{ RecordWrapperGate, } from './RecordWrapperGate.js';
16
16
  export { parseRecordPageUrl, parseRecordEditUrl, } from './parseRecordEditUrl.js';
17
17
  export { registerWidgetRenderer, getWidgetRenderer, } from './widgetRegistry.js';
18
- export { FormStateProvider, useFieldState, useFormState, } from './FormStateContext.js';
18
+ export { FormStateProvider, useFieldState, useFormState, useRowBinding, } from './FormStateContext.js';
19
19
  export { parseFormDataToNested } from './formStateHelpers.js';
20
20
  export { NavigateProvider, useNavigate } from './navigate.js';
21
21
  export { ToasterProvider, useToast } from './Toaster.js';
@@ -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;AAC5C,OAAO,EACL,yBAAyB,EACzB,oBAAoB,GAMrB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EACL,8BAA8B,EAC9B,yBAAyB,GAE1B,MAAM,4BAA4B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AE,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,GAKhB,MAAM,sBAAsB,CAAA;AAG7B,iHAAiH;AACjH,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAElD,mBAAmB;AACnB,OAAO,EAAE,QAAQ,IAAI,UAAU,EAAyC,MAAM,eAAe,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pilotiq/pilotiq",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "description": "View-based admin panel for RudderJS",
5
5
  "license": "MIT",
6
6
  "repository": {
package/src/Pilotiq.ts CHANGED
@@ -67,6 +67,44 @@ export interface PilotiqPlugin {
67
67
  */
68
68
  export type UserResolver = (req: unknown) => unknown | null | Promise<unknown | null>
69
69
 
70
+ /**
71
+ * Server-side hook handed to `Pilotiq.editPageHydrator(fn)`. The
72
+ * resource-edit data builder calls every registered hydrator after the
73
+ * standard fill pipeline (`loadRecord` → `mutateFormDataBeforeFill` →
74
+ * `fillFromRecord` → `mutateFormDataAfterFill` →
75
+ * `applyRelationshipRepeaterFill` → `applyRelationshipBuilderFill`) and
76
+ * merges each non-null return onto the form's default values.
77
+ *
78
+ * Multiple hydrators are walked in registration order; later hydrators
79
+ * override keys produced by earlier ones. A hydrator returning `null`
80
+ * (or throwing) is a pass-through — the DB row values survive intact.
81
+ *
82
+ * Designed for the SSR-from-Y.Doc consumer in `@pilotiq-pro/collab`:
83
+ * read persisted Y.Text + Y.Map values for the record and override the
84
+ * matching field defaults, killing the DB → Y.Doc value flicker on
85
+ * hydration. Other consumers (per-tenant overrides, A/B experiments,
86
+ * draft-snapshot resume) compose the same way.
87
+ *
88
+ * Pilotiq core stays Yjs-free — the hook's `Record<string, unknown>`
89
+ * return is opaque, so the collab consumer's Yjs imports stay confined
90
+ * to its own `/server` subpath.
91
+ */
92
+ export interface EditPageHydratorContext {
93
+ /** The Resource class being edited (server-side reference, not the
94
+ * serialized meta — gives access to `model`, `getSlug()`, etc.). */
95
+ resource: ResourceClass
96
+ /** Record id from the URL, stringified. */
97
+ recordId: string
98
+ /** Values produced by the fill pipeline so far — DB row → hooks →
99
+ * relationship fills. Hydrators read this to make merge decisions
100
+ * (e.g. "only override fields that have content in Y.Doc"). */
101
+ currentValues: Record<string, unknown>
102
+ }
103
+
104
+ export type EditPageHydrator = (
105
+ ctx: EditPageHydratorContext,
106
+ ) => Record<string, unknown> | null | Promise<Record<string, unknown> | null>
107
+
70
108
  /**
71
109
  * Upload configuration. Apps register an adapter via `Pilotiq.uploads({
72
110
  * adapter })`; the `_uploads` route hands every incoming file to it.
@@ -203,6 +241,11 @@ export interface PilotiqConfig {
203
241
  * separator + Sign-out entry. Without this, the menu shows custom
204
242
  * items (if any) and the user identity, but no sign-out affordance. */
205
243
  signOut?: SignOutConfig
244
+ /** Server-side hydrators applied after the fill pipeline on every
245
+ * resource edit page. Empty / unset → behaviour unchanged. See
246
+ * `EditPageHydrator` for the contract; plugins register via
247
+ * `panel.editPageHydrator(fn)`. */
248
+ editPageHydrators?: EditPageHydrator[]
206
249
  /** Database notifications — opt-in. Mounts the bell + 4 endpoints
207
250
  * (`_notifications` list / `:id/read` / `:id/unread` / `read-all`).
208
251
  * Reads rows from `@rudderjs/notification`'s `notification` table via
@@ -521,6 +564,27 @@ export class Pilotiq {
521
564
  return this
522
565
  }
523
566
 
567
+ /**
568
+ * Register a server-side hydrator that runs after the fill pipeline
569
+ * on every resource edit page. Each registered hydrator's non-null
570
+ * return merges onto the form's default values; multiple registrations
571
+ * are walked in registration order (later wins on key conflicts).
572
+ *
573
+ * panel.editPageHydrator(async ({ resource, recordId }) => {
574
+ * // override defaults for this record from your alt source
575
+ * return { title: await draftStore.read(resource.getSlug(), recordId) }
576
+ * })
577
+ *
578
+ * Plugins typically register from inside their `register(panel)` hook.
579
+ * Throwing or returning `null` is a pass-through — the DB row values
580
+ * survive. See `EditPageHydrator` for the full contract.
581
+ */
582
+ editPageHydrator(fn: EditPageHydrator): this {
583
+ if (!this.config.editPageHydrators) this.config.editPageHydrators = []
584
+ this.config.editPageHydrators.push(fn)
585
+ return this
586
+ }
587
+
524
588
  /**
525
589
  * Enable persistent database-backed notifications. Mounts the bell in
526
590
  * the panel chrome + a small set of `_notifications` endpoints. The
package/src/index.ts CHANGED
@@ -6,6 +6,8 @@ export {
6
6
  type UserResolver,
7
7
  type UploadConfig,
8
8
  type SignOutConfig,
9
+ type EditPageHydrator,
10
+ type EditPageHydratorContext,
9
11
  } from './Pilotiq.js'
10
12
  export {
11
13
  UserMenuItem,
@@ -1,4 +1,9 @@
1
- import type { Pilotiq, PilotiqConfig } from '../Pilotiq.js'
1
+ import type {
2
+ Pilotiq,
3
+ PilotiqConfig,
4
+ EditPageHydrator,
5
+ EditPageHydratorContext,
6
+ } from '../Pilotiq.js'
2
7
  import type { Page } from '../Page.js'
3
8
  import { Element } from '../schema/Element.js'
4
9
  import { Field } from '../fields/Field.js'
@@ -386,6 +391,40 @@ export async function applyFillPipeline<R>(
386
391
  return values
387
392
  }
388
393
 
394
+ /**
395
+ * Walk every hydrator registered via `Pilotiq.editPageHydrator(fn)` and
396
+ * merge non-null returns onto `currentValues`. Hydrators run sequentially
397
+ * in registration order; later returns override keys from earlier ones.
398
+ *
399
+ * Failure mode is permissive: a hydrator that throws or returns `null`
400
+ * contributes nothing; the page still renders against the fill-pipeline
401
+ * values it received. Errors emit a `console.warn` so the page isn't
402
+ * silently relying on missing data.
403
+ *
404
+ * Returns the merged overlay (NOT the final values). The caller composes
405
+ * the overlay onto the form via `form.withValues({ ...current, ...overlay })`
406
+ * — keeps the merge order explicit at the call site (overlay wins).
407
+ *
408
+ * Empty hydrators array / no overrides → returns `{}` so callers can
409
+ * skip the `withValues` call cheaply.
410
+ */
411
+ export async function applyEditPageHydrators(
412
+ hydrators: ReadonlyArray<EditPageHydrator>,
413
+ ctx: EditPageHydratorContext,
414
+ ): Promise<Record<string, unknown>> {
415
+ if (hydrators.length === 0) return {}
416
+ let overlay: Record<string, unknown> = {}
417
+ for (const fn of hydrators) {
418
+ try {
419
+ const result = await fn(ctx)
420
+ if (result && typeof result === 'object') overlay = { ...overlay, ...result }
421
+ } catch (err) {
422
+ console.warn('[pilotiq] editPageHydrator threw — falling back to fill-pipeline values', err)
423
+ }
424
+ }
425
+ return overlay
426
+ }
427
+
389
428
  /**
390
429
  * Walk the form's top-level Repeaters and replace `values[fieldName]`
391
430
  * with rows fetched from `parent.related(name)` for any
@@ -25,6 +25,7 @@ import {
25
25
  resourceViewBreadcrumbs,
26
26
  } from './breadcrumbs.js'
27
27
  import {
28
+ applyEditPageHydrators,
28
29
  applyFillPipeline,
29
30
  applyRelationshipBuilderFill,
30
31
  applyRelationshipRepeaterFill,
@@ -400,7 +401,22 @@ export async function resourceEditData(
400
401
  const values = await applyFillPipeline(form, record)
401
402
  const withRelations = await applyRelationshipRepeaterFill(form, values, record, R.model)
402
403
  const withBuilders = await applyRelationshipBuilderFill(form, withRelations, record, R.model)
403
- form.withValues(withBuilders)
404
+ // Hydrators run AFTER the standard fill pipeline so they overlay
405
+ // on top of DB-row + relationship-row values. Skipped on the
406
+ // prefill branch (validation-error round-trip) — overlaying there
407
+ // would clobber the user's just-submitted input that the page is
408
+ // re-displaying for them to fix.
409
+ const hydrators = cfg.editPageHydrators ?? []
410
+ const overlay = hydrators.length > 0
411
+ ? await applyEditPageHydrators(hydrators, {
412
+ resource: R,
413
+ recordId,
414
+ currentValues: withBuilders,
415
+ })
416
+ : {}
417
+ form.withValues(Object.keys(overlay).length > 0
418
+ ? { ...withBuilders, ...overlay }
419
+ : withBuilders)
404
420
  } else if (prefill?.values) {
405
421
  form.withValues(prefill.values)
406
422
  }
@@ -5,6 +5,7 @@ import { Form } from './elements/Form.js'
5
5
  import { ListTab } from './Tab.js'
6
6
  import { ListTabs } from './elements/ListTabs.js'
7
7
  import {
8
+ applyEditPageHydrators,
8
9
  applyFillPipeline,
9
10
  formCreateOptionData,
10
11
  formStateData,
@@ -1203,6 +1204,106 @@ describe('tagRichTextMentionUrls — nested Repeater + Builder rows', () => {
1203
1204
  })
1204
1205
  })
1205
1206
 
1207
+ describe('applyEditPageHydrators (Pilotiq.editPageHydrator)', () => {
1208
+ class Posts extends Resource { static override label = 'Posts' }
1209
+ const ctx = (currentValues: Record<string, unknown> = {}) => ({
1210
+ resource: Posts,
1211
+ recordId: '42',
1212
+ currentValues,
1213
+ })
1214
+
1215
+ it('empty hydrators array → empty overlay', async () => {
1216
+ const overlay = await applyEditPageHydrators([], ctx())
1217
+ assert.deepEqual(overlay, {})
1218
+ })
1219
+
1220
+ it('hydrator returning null → empty overlay', async () => {
1221
+ const overlay = await applyEditPageHydrators([
1222
+ async () => null,
1223
+ ], ctx())
1224
+ assert.deepEqual(overlay, {})
1225
+ })
1226
+
1227
+ it('hydrator returning a partial → overlay carries the keys', async () => {
1228
+ const overlay = await applyEditPageHydrators([
1229
+ async () => ({ title: 'Y-Title', body: 'Y-Body' }),
1230
+ ], ctx({ title: 'DB-Title', body: 'DB-Body', author: 'DB-Author' }))
1231
+ assert.deepEqual(overlay, { title: 'Y-Title', body: 'Y-Body' })
1232
+ })
1233
+
1234
+ it('two hydrators merge in registration order (later wins on conflict)', async () => {
1235
+ const overlay = await applyEditPageHydrators([
1236
+ async () => ({ title: 'first', shared: 'first-shared' }),
1237
+ async () => ({ body: 'second', shared: 'second-shared' }),
1238
+ ], ctx())
1239
+ assert.deepEqual(overlay, {
1240
+ title: 'first',
1241
+ body: 'second',
1242
+ shared: 'second-shared',
1243
+ })
1244
+ })
1245
+
1246
+ it('hydrator that throws is swallowed; siblings still contribute', async () => {
1247
+ // Stub console.warn so the test output stays clean; restore after.
1248
+ const originalWarn = console.warn
1249
+ let warned = false
1250
+ console.warn = (..._args: unknown[]) => { warned = true }
1251
+ try {
1252
+ const overlay = await applyEditPageHydrators([
1253
+ async () => { throw new Error('boom') },
1254
+ async () => ({ title: 'sibling-survived' }),
1255
+ ], ctx())
1256
+ assert.deepEqual(overlay, { title: 'sibling-survived' })
1257
+ assert.equal(warned, true, 'console.warn should fire for thrown hydrators')
1258
+ } finally {
1259
+ console.warn = originalWarn
1260
+ }
1261
+ })
1262
+
1263
+ it('hydrator returning a non-object is skipped', async () => {
1264
+ const overlay = await applyEditPageHydrators([
1265
+ // @ts-expect-error — deliberately exercising the runtime guard
1266
+ async () => 'not-an-object',
1267
+ async () => ({ title: 'real-result' }),
1268
+ ], ctx())
1269
+ assert.deepEqual(overlay, { title: 'real-result' })
1270
+ })
1271
+
1272
+ it('hydrator receives current fill-pipeline values via ctx.currentValues', async () => {
1273
+ let seen: Record<string, unknown> | undefined
1274
+ await applyEditPageHydrators([
1275
+ async (ctx) => { seen = ctx.currentValues; return null },
1276
+ ], ctx({ title: 'DB-Title', body: 'DB-Body' }))
1277
+ assert.deepEqual(seen, { title: 'DB-Title', body: 'DB-Body' })
1278
+ })
1279
+
1280
+ it('hydrator receives resource class + recordId in ctx', async () => {
1281
+ let seenResource: unknown
1282
+ let seenRecordId: unknown
1283
+ await applyEditPageHydrators([
1284
+ async (ctx) => { seenResource = ctx.resource; seenRecordId = ctx.recordId; return null },
1285
+ ], ctx())
1286
+ assert.equal(seenResource, Posts)
1287
+ assert.equal(seenRecordId, '42')
1288
+ })
1289
+ })
1290
+
1291
+ describe('Pilotiq.editPageHydrator builder method', () => {
1292
+ it('stores hydrators on the config in registration order', () => {
1293
+ const fn1 = async () => ({ a: 1 })
1294
+ const fn2 = async () => ({ b: 2 })
1295
+ const panel = Pilotiq.make('Admin')
1296
+ .editPageHydrator(fn1)
1297
+ .editPageHydrator(fn2)
1298
+ assert.deepEqual(panel.getConfig().editPageHydrators, [fn1, fn2])
1299
+ })
1300
+
1301
+ it('absent when no hydrator registered', () => {
1302
+ const panel = Pilotiq.make('Admin')
1303
+ assert.equal(panel.getConfig().editPageHydrators, undefined)
1304
+ })
1305
+ })
1306
+
1206
1307
  describe('panelInfo — recordCollab map (resource collab opt-in)', () => {
1207
1308
  it('absent when no resource opts in', async () => {
1208
1309
  class Posts extends Resource { static override label = 'Posts' }
package/src/pageData.ts CHANGED
@@ -22,6 +22,7 @@ export type { ServerDataMap } from './pageData/helpers.js'
22
22
  // Re-export the URL-tag helpers + fill pipeline + server-data resolver
23
23
  // for consumers that import them through `./pageData.js`.
24
24
  export {
25
+ applyEditPageHydrators,
25
26
  applyFillPipeline,
26
27
  applyRelationshipBuilderFill,
27
28
  applyRelationshipRepeaterFill,