@pilotiq/pilotiq 0.10.0 → 0.12.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 (54) hide show
  1. package/.turbo/turbo-build.log +2 -2
  2. package/CHANGELOG.md +128 -0
  3. package/dist/react/AppShell.d.ts +1 -1
  4. package/dist/react/AppShell.d.ts.map +1 -1
  5. package/dist/react/AppShell.js +7 -1
  6. package/dist/react/AppShell.js.map +1 -1
  7. package/dist/react/CollabTextRendererRegistry.d.ts +75 -0
  8. package/dist/react/CollabTextRendererRegistry.d.ts.map +1 -0
  9. package/dist/react/CollabTextRendererRegistry.js +18 -0
  10. package/dist/react/CollabTextRendererRegistry.js.map +1 -0
  11. package/dist/react/CurrentUserContext.d.ts +39 -0
  12. package/dist/react/CurrentUserContext.d.ts.map +1 -0
  13. package/dist/react/CurrentUserContext.js +27 -0
  14. package/dist/react/CurrentUserContext.js.map +1 -0
  15. package/dist/react/FormCollabBindingRegistry.d.ts +161 -17
  16. package/dist/react/FormCollabBindingRegistry.d.ts.map +1 -1
  17. package/dist/react/FormCollabBindingRegistry.js.map +1 -1
  18. package/dist/react/FormStateContext.d.ts +39 -1
  19. package/dist/react/FormStateContext.d.ts.map +1 -1
  20. package/dist/react/FormStateContext.js +126 -33
  21. package/dist/react/FormStateContext.js.map +1 -1
  22. package/dist/react/fields/BuilderInput.d.ts.map +1 -1
  23. package/dist/react/fields/BuilderInput.js +112 -10
  24. package/dist/react/fields/BuilderInput.js.map +1 -1
  25. package/dist/react/fields/MarkdownInput.d.ts.map +1 -1
  26. package/dist/react/fields/MarkdownInput.js +60 -1
  27. package/dist/react/fields/MarkdownInput.js.map +1 -1
  28. package/dist/react/fields/RepeaterInput.d.ts.map +1 -1
  29. package/dist/react/fields/RepeaterInput.js +113 -10
  30. package/dist/react/fields/RepeaterInput.js.map +1 -1
  31. package/dist/react/fields/TextLikeInput.d.ts.map +1 -1
  32. package/dist/react/fields/TextLikeInput.js +83 -6
  33. package/dist/react/fields/TextLikeInput.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 +4 -2
  39. package/dist/react/index.d.ts.map +1 -1
  40. package/dist/react/index.js +3 -1
  41. package/dist/react/index.js.map +1 -1
  42. package/package.json +5 -5
  43. package/src/react/AppShell.tsx +11 -1
  44. package/src/react/CollabTextRendererRegistry.ts +84 -0
  45. package/src/react/CurrentUserContext.tsx +50 -0
  46. package/src/react/FormCollabBindingRegistry.ts +160 -17
  47. package/src/react/FormStateContext.tsx +157 -34
  48. package/src/react/fields/BuilderInput.tsx +97 -8
  49. package/src/react/fields/MarkdownInput.tsx +118 -1
  50. package/src/react/fields/RepeaterInput.tsx +97 -8
  51. package/src/react/fields/TextLikeInput.tsx +129 -5
  52. package/src/react/formStateHelpers.test.ts +312 -0
  53. package/src/react/formStateHelpers.ts +246 -0
  54. package/src/react/index.ts +15 -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,GA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I,QAAQ;gBAAE,SAAS,CAAC,KAAoB,EAAE,GAAG,CAAC,CAAA;QACpE,CAAC;IACH,CAAC;IAED,SAAS,UAAU,CAAC,MAAe,EAAE,GAAgB;QACnD,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,15 @@ 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 { registerCollabTextRenderer, getCollabTextRenderer, type CollabTextRenderer, type CollabTextRendererProps, } from './CollabTextRendererRegistry.js';
12
+ export { registerFormCollabBinding, getFormCollabBinding, type FormCollabBinding, type FormCollabBindingFactory, type FormCollabBindingFactoryArgs, type TextBinding, type TextDelta, type RowsEvent, type RowBindingApi, } from './FormCollabBindingRegistry.js';
12
13
  export { registerFieldPresenceComponent, getFieldPresenceComponent, type FieldPresenceProps, } from './FieldPresenceRegistry.js';
13
14
  export { registerFieldFocusReporter, getFieldFocusReporter, type FieldFocusReporter, type FieldFocusEvent, } from './FieldFocusReporterRegistry.js';
14
15
  export { registerRecordWrapper, getRecordWrapper, type RecordWrapperProps, } from './RecordWrapperRegistry.js';
15
16
  export { RecordWrapperGate, type RecordWrapperGateProps, } from './RecordWrapperGate.js';
16
17
  export { parseRecordPageUrl, parseRecordEditUrl, type RecordPageIdentity, type RecordPageRole, type RecordEditIdentity, } from './parseRecordEditUrl.js';
17
18
  export { registerWidgetRenderer, getWidgetRenderer, type WidgetRendererProps, } from './widgetRegistry.js';
18
- export { FormStateProvider, useFieldState, useFormState, type FormStateApi, type FormStateProviderProps, type UseFieldStateResult, } from './FormStateContext.js';
19
+ export { FormStateProvider, useFieldState, useFormState, useRowBinding, type FormStateApi, type FormStateProviderProps, type UseFieldStateResult, } from './FormStateContext.js';
19
20
  export { parseFormDataToNested } from './formStateHelpers.js';
20
21
  export { NavigateProvider, useNavigate, type NavigateFn } from './navigate.js';
21
22
  export { ToasterProvider, useToast } from './Toaster.js';
@@ -26,6 +27,7 @@ export { RightSidebar, type RightSidebarProps, } from './RightSidebar.js';
26
27
  export { RightSidebarTrigger } from './RightSidebarTrigger.js';
27
28
  export { SearchTrigger } from './SearchTrigger.js';
28
29
  export { useResizableWidth, clampPanelWidth, type UseResizableWidthOptions, type UseResizableWidthApi, } from './useResizableWidth.js';
30
+ export { CurrentUserProvider, useCurrentUser, type CurrentUser, } from './CurrentUserContext.js';
29
31
  export { ThemeProvider, useTheme } from './ThemeProvider.js';
30
32
  export { ThemeToggle } from './ThemeToggle.js';
31
33
  export { ThemeSettingsPage } from './ThemeSettingsPage.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;A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AM,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"}
@@ -8,6 +8,7 @@ export { PendingSuggestionsContext, usePendingSuggestions, usePendingSuggestions
8
8
  export { registerPendingSuggestionApplier, getPendingSuggestionApplier, } from './PendingSuggestionApplierRegistry.js';
9
9
  export { CollabRoomContext, useCollabRoom, } from './CollabRoomContext.js';
10
10
  export { registerCollabExtensions, getCollabExtensions, } from './CollabExtensionFactoryRegistry.js';
11
+ export { registerCollabTextRenderer, getCollabTextRenderer, } from './CollabTextRendererRegistry.js';
11
12
  export { registerFormCollabBinding, getFormCollabBinding, } from './FormCollabBindingRegistry.js';
12
13
  export { registerFieldPresenceComponent, getFieldPresenceComponent, } from './FieldPresenceRegistry.js';
13
14
  export { registerFieldFocusReporter, getFieldFocusReporter, } from './FieldFocusReporterRegistry.js';
@@ -15,7 +16,7 @@ export { registerRecordWrapper, getRecordWrapper, } from './RecordWrapperRegistr
15
16
  export { RecordWrapperGate, } from './RecordWrapperGate.js';
16
17
  export { parseRecordPageUrl, parseRecordEditUrl, } from './parseRecordEditUrl.js';
17
18
  export { registerWidgetRenderer, getWidgetRenderer, } from './widgetRegistry.js';
18
- export { FormStateProvider, useFieldState, useFormState, } from './FormStateContext.js';
19
+ export { FormStateProvider, useFieldState, useFormState, useRowBinding, } from './FormStateContext.js';
19
20
  export { parseFormDataToNested } from './formStateHelpers.js';
20
21
  export { NavigateProvider, useNavigate } from './navigate.js';
21
22
  export { ToasterProvider, useToast } from './Toaster.js';
@@ -26,6 +27,7 @@ export { RightSidebar, } from './RightSidebar.js';
26
27
  export { RightSidebarTrigger } from './RightSidebarTrigger.js';
27
28
  export { SearchTrigger } from './SearchTrigger.js';
28
29
  export { useResizableWidth, clampPanelWidth, } from './useResizableWidth.js';
30
+ export { CurrentUserProvider, useCurrentUser, } from './CurrentUserContext.js';
29
31
  export { ThemeProvider, useTheme } from './ThemeProvider.js';
30
32
  export { ThemeToggle } from './ThemeToggle.js';
31
33
  export { ThemeSettingsPage } from './ThemeSettingsPage.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,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B,MAAM,2BAA2B,CAAA;AAElC,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,uBAAuB,GAGxB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EACL,YAAY,GAEb,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,GAGhB,MAAM,wBAAwB,CAAA;AAE/B,OAAO,EACL,mBAAmB,EACnB,cAAc,GAEf,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,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.10.0",
3
+ "version": "0.12.0",
4
4
  "description": "View-based admin panel for RudderJS",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -81,10 +81,10 @@
81
81
  },
82
82
  "devDependencies": {
83
83
  "@base-ui/react": "^1",
84
- "@rudderjs/contracts": "^1.3.0",
85
- "@rudderjs/core": "^1.1.2",
86
- "@rudderjs/router": "^1.1.2",
87
- "@rudderjs/view": "^1.0.1",
84
+ "@rudderjs/contracts": "^1.6.0",
85
+ "@rudderjs/core": "^1.1.4",
86
+ "@rudderjs/router": "^1.2.0",
87
+ "@rudderjs/view": "^1.1.0",
88
88
  "@types/node": "^20",
89
89
  "@types/react": "^19",
90
90
  "@types/sanitize-html": "^2.16.1",
@@ -16,6 +16,7 @@ import type { NavItem, UserMenuMeta, DatabaseNotificationsMeta, RightSidebarMeta
16
16
  import type { RenderHookMap } from '../RenderHook.js'
17
17
  import { RenderHookSlot } from './RenderHookSlot.js'
18
18
  import type { ComponentSlotRegistry } from './component-slots.js'
19
+ import { CurrentUserProvider } from './CurrentUserContext.js'
19
20
 
20
21
  export interface AppShellProps {
21
22
  panel: {
@@ -180,7 +181,16 @@ export function AppShell({ layout = 'sidebar', notifications, componentRegistry,
180
181
  props.basePath,
181
182
  )
182
183
 
183
- return wrapped
184
+ // `CurrentUserProvider` sits OUTSIDE the layout-provider chain so
185
+ // plugin-registered providers (e.g. `@pilotiq-pro/collab`'s
186
+ // CollabProvider, which threads the user into CollaborationCaret
187
+ // presence labels) can read the active user via `useCurrentUser()`.
188
+ // Value source mirrors what the top-right user dropdown renders.
189
+ return (
190
+ <CurrentUserProvider value={props.panel.userMenu?.user ?? null}>
191
+ {wrapped}
192
+ </CurrentUserProvider>
193
+ )
184
194
  }
185
195
 
186
196
  /**
@@ -0,0 +1,84 @@
1
+ import type { ComponentType } from 'react'
2
+
3
+ /**
4
+ * Module-level registry slot for the collab-aware plain-text editor renderer.
5
+ *
6
+ * Wiring posture (mirrors `CollabExtensionFactoryRegistry` /
7
+ * `FormCollabBindingRegistry`):
8
+ * - `@pilotiq/tiptap`'s `registerTiptap(...)` calls `registerCollabTextRenderer(...)`
9
+ * once at boot. The registered component closes over `@tiptap/*` imports so
10
+ * pilotiq core stays free of any tiptap peer dep — same posture as the
11
+ * existing rich-text renderer registry.
12
+ * - `TextLikeInput` checks for the registered component when a `<RecordCollabRoom>`
13
+ * is mounted up-tree AND the field hasn't opted out via `.collab(false)` AND
14
+ * the field has no `.mask()`. If present, the legacy `BoundTextInput`
15
+ * (Y.Text + `computeDelta` + heuristic `preserveCursor`) is bypassed in
16
+ * favour of a y-prosemirror-backed Tiptap editor that anchors selections to
17
+ * `Yjs.RelativePosition` — the architectural fix for the cursor-jump and
18
+ * two-peer concurrent-insert races documented in
19
+ * `docs/plans/text-fields-tiptap-backed-collab.md`.
20
+ *
21
+ * Wire props are deliberately framework-agnostic — the renderer doesn't take a
22
+ * `binding` since it consumes the room's `ydoc` directly via the existing
23
+ * `useCollabRoom()` + `getCollabExtensions()` plumbing on its own side. Core
24
+ * keeps the seam narrow: handler callbacks + DOM chrome only.
25
+ */
26
+ export interface CollabTextRendererProps {
27
+ /** Field name — drives the `Y.XmlFragment` selector inside the collab adapter. */
28
+ name: string
29
+ /** `true` for textarea-like (multiple paragraphs); `false` for input-like. */
30
+ multiline: boolean
31
+ /**
32
+ * Server-rendered default value. The renderer is expected to seed the
33
+ * `Y.XmlFragment` from this on first connect when the room has no
34
+ * persisted state for this field (i.e. brand-new record).
35
+ */
36
+ defaultValue: string
37
+ /** Optional placeholder hint. */
38
+ placeholder?: string
39
+ /** Disabled / read-only state. */
40
+ disabled?: boolean
41
+ /** Fired on every editor `update` with the editor's current plain text. */
42
+ onChange: (text: string) => void
43
+ /** Fired on editor blur — host wires this to live-onBlur trigger semantics. */
44
+ onBlur: () => void
45
+ /**
46
+ * Single-line submit — fired when `multiline: false` AND the user presses
47
+ * Enter. The renderer is expected to blur the editor after invoking this.
48
+ * Multiline mode ignores it (Enter inserts a paragraph instead).
49
+ */
50
+ onSubmit?: () => void
51
+ /**
52
+ * Tailwind className applied to the editor's contenteditable wrapper so the
53
+ * rendered editor matches the native `<input>` / `<textarea>` chrome it
54
+ * replaces. The host owns the styling — the adapter just forwards.
55
+ */
56
+ className?: string
57
+ /**
58
+ * Additional DOM attributes for the editor's contenteditable wrapper —
59
+ * typically `id`, `aria-*`, `autocomplete`, etc.
60
+ */
61
+ editorAttributes?: Record<string, string>
62
+ }
63
+
64
+ export type CollabTextRenderer = ComponentType<CollabTextRendererProps>
65
+
66
+ let _renderer: CollabTextRenderer | null = null
67
+
68
+ /**
69
+ * Register the collab plain-text editor component. Called once at boot by
70
+ * `@pilotiq/tiptap`'s `registerTiptap()` (or directly by an app that imports
71
+ * the renderer). Calling with `null` clears the registry — useful for tests.
72
+ *
73
+ * No-op behaviour when no renderer is registered: `TextLikeInput` falls back
74
+ * to the legacy `BoundTextInput` path (or the plain controlled / uncontrolled
75
+ * input when no collab room is mounted).
76
+ */
77
+ export function registerCollabTextRenderer(component: CollabTextRenderer | null): void {
78
+ _renderer = component
79
+ }
80
+
81
+ /** Returns the registered component, or `null` when no adapter is installed. */
82
+ export function getCollabTextRenderer(): CollabTextRenderer | null {
83
+ return _renderer
84
+ }
@@ -0,0 +1,50 @@
1
+ import { createContext, useContext, type ReactNode } from 'react'
2
+
3
+ /**
4
+ * Resolved identity of the user driving the current page. Mirrors the
5
+ * `UserMenuMeta.user` shape that `panelInfo()` ships to the renderer —
6
+ * whichever fields the `Pilotiq.user(req => …)` resolver populated.
7
+ *
8
+ * `null` is the no-user state: either the panel never wired a resolver,
9
+ * or the resolver returned `null` for this request. Consumers should
10
+ * gracefully fall back (no avatar, no presence label, etc.) rather than
11
+ * treating absence as an error.
12
+ */
13
+ export interface CurrentUser {
14
+ name?: string
15
+ email?: string
16
+ avatar?: string
17
+ }
18
+
19
+ const CurrentUserContext = createContext<CurrentUser | null>(null)
20
+
21
+ /**
22
+ * Mounted by `AppShell` around the layout-provider chain so plugins
23
+ * (collab user presence, audit-trail attribution, analytics
24
+ * client-side opt-outs, …) can read the active user via
25
+ * `useCurrentUser()` without prop-drilling through `panel`.
26
+ *
27
+ * Value source is `viewProps.panel.userMenu?.user` — the same shape the
28
+ * top-right dropdown renders. The provider sits OUTSIDE
29
+ * `layoutProviderRegistry` so plugin-registered layout providers can
30
+ * subscribe.
31
+ */
32
+ export function CurrentUserProvider({
33
+ value,
34
+ children,
35
+ }: {
36
+ value: CurrentUser | null
37
+ children: ReactNode
38
+ }): ReactNode {
39
+ return <CurrentUserContext.Provider value={value}>{children}</CurrentUserContext.Provider>
40
+ }
41
+
42
+ /**
43
+ * Read the active user inside any descendant of `<AppShell>`. Returns
44
+ * `null` outside an `AppShell` mount (defensive — keeps storybook /
45
+ * isolated-render tests from throwing) and when no user resolved for
46
+ * the request.
47
+ */
48
+ export function useCurrentUser(): CurrentUser | null {
49
+ return useContext(CurrentUserContext)
50
+ }