@pilotiq/pilotiq 0.8.1 → 0.8.2
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 +44 -0
- package/dist/react/FieldFocusReporterRegistry.d.ts +29 -0
- package/dist/react/FieldFocusReporterRegistry.d.ts.map +1 -0
- package/dist/react/FieldFocusReporterRegistry.js +14 -0
- package/dist/react/FieldFocusReporterRegistry.js.map +1 -0
- package/dist/react/FieldPresenceRegistry.d.ts +38 -0
- package/dist/react/FieldPresenceRegistry.d.ts.map +1 -0
- package/dist/react/FieldPresenceRegistry.js +14 -0
- package/dist/react/FieldPresenceRegistry.js.map +1 -0
- package/dist/react/fields/FieldShell.d.ts.map +1 -1
- package/dist/react/fields/FieldShell.js +27 -3
- package/dist/react/fields/FieldShell.js.map +1 -1
- 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/package.json +1 -1
- package/src/react/FieldFocusReporterRegistry.ts +37 -0
- package/src/react/FieldPresenceRegistry.ts +46 -0
- package/src/react/fields/FieldShell.tsx +39 -2
- package/src/react/index.ts +11 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
> @pilotiq/pilotiq@0.8.
|
|
2
|
+
> @pilotiq/pilotiq@0.8.2 build /home/runner/work/pilotiq/pilotiq/packages/pilotiq
|
|
3
3
|
> tsc -p tsconfig.build.json && pnpm run copy-assets
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @pilotiq/pilotiq@0.8.
|
|
6
|
+
> @pilotiq/pilotiq@0.8.2 copy-assets /home/runner/work/pilotiq/pilotiq/packages/pilotiq
|
|
7
7
|
> mkdir -p dist/styles && cp -R src/styles/*.css dist/styles/
|
|
8
8
|
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,49 @@
|
|
|
1
1
|
# @pilotiq/pilotiq
|
|
2
2
|
|
|
3
|
+
## 0.8.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 0304569: feat(pilotiq): per-field presence slot + focus reporter (Phase F4)
|
|
8
|
+
|
|
9
|
+
Two new module-singleton registry slots + `FieldShell` wiring — the
|
|
10
|
+
open-core scaffolding pro collab plugins (e.g. `@pilotiq-pro/collab`)
|
|
11
|
+
plug into to render "who's editing this field" indicators.
|
|
12
|
+
|
|
13
|
+
### Registries (exported from `@pilotiq/pilotiq/react`)
|
|
14
|
+
|
|
15
|
+
- **`registerFieldPresenceComponent(C)`** / **`getFieldPresenceComponent()`** —
|
|
16
|
+
module slot for a React component that renders next to each field's
|
|
17
|
+
label. Receives `{ fieldName, formId }`. Components own the awareness
|
|
18
|
+
lookup (typically via `useCollabRoom()` from `@pilotiq-pro/collab`'s
|
|
19
|
+
`useFieldPresence` hook); pilotiq core stays Yjs-free.
|
|
20
|
+
- **`registerFieldFocusReporter(reporter)`** / **`getFieldFocusReporter()`** —
|
|
21
|
+
module slot for `{ onFocus, onBlur }` callbacks. `FieldShell` invokes
|
|
22
|
+
them on capture-phase focus / blur events for every controlled input;
|
|
23
|
+
the collab plugin mirrors the local user's focus into a `focusField`
|
|
24
|
+
awareness key so peers can render their chip rails.
|
|
25
|
+
|
|
26
|
+
### `FieldShell` integration
|
|
27
|
+
|
|
28
|
+
- Mounts the registered chip component inside the `<label>` via
|
|
29
|
+
`{PresenceChip && <PresenceChip fieldName={name} formId={formId} />}`.
|
|
30
|
+
- Wires `onFocusCapture` / `onBlurCapture` on the outer wrapper `<div>`
|
|
31
|
+
so any inner input (including custom NodeViews — Select / Date /
|
|
32
|
+
Slider) emits focus events through one shared dispatch.
|
|
33
|
+
- Both slots gated on `meta.collab !== false` AND non-dotted-path
|
|
34
|
+
name (Q3 from the F-plan: `.collab(false)` opts the field out of
|
|
35
|
+
the collab layer entirely — no presence chip AND no awareness leak
|
|
36
|
+
about which field the local user is editing).
|
|
37
|
+
|
|
38
|
+
### Tested
|
|
39
|
+
|
|
40
|
+
- All 2938 pilotiq tests pass.
|
|
41
|
+
- Two-window smoke test (playground): focusing `title` in window A
|
|
42
|
+
paints a colored dot next to `title`'s label in window B; clicking
|
|
43
|
+
through `title` → `status` → `excerpt` moves the dot in lockstep;
|
|
44
|
+
blurring clears it. Pairs cleanly with the Phase F3 value sync —
|
|
45
|
+
one ydoc, one provider, two registry surfaces consumed.
|
|
46
|
+
|
|
3
47
|
## 0.8.1
|
|
4
48
|
|
|
5
49
|
### Patch Changes
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Module-level slot for focus / blur callbacks dispatched by pilotiq's
|
|
3
|
+
* `FieldShell`. A collab plugin (e.g. `@pilotiq-pro/collab`) registers
|
|
4
|
+
* a reporter at boot; on every controlled-field focus / blur event,
|
|
5
|
+
* `FieldShell` calls the matching method with `{ fieldName, formId }`
|
|
6
|
+
* so the plugin can mirror the local user's focus state into Yjs
|
|
7
|
+
* awareness.
|
|
8
|
+
*
|
|
9
|
+
* `FieldShell` skips dispatching for fields opted out via
|
|
10
|
+
* `Field.collab(false)` AND for dotted-path names (Repeater rows stay
|
|
11
|
+
* out of F4 presence in v1) — so the reporter never sees those events.
|
|
12
|
+
*/
|
|
13
|
+
export interface FieldFocusEvent {
|
|
14
|
+
fieldName: string;
|
|
15
|
+
formId: string;
|
|
16
|
+
}
|
|
17
|
+
export interface FieldFocusReporter {
|
|
18
|
+
onFocus(event: FieldFocusEvent): void;
|
|
19
|
+
onBlur(event: FieldFocusEvent): void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Register the reporter. Called once at boot by the collab plugin.
|
|
23
|
+
* No-op when no plugin registers — `FieldShell` doesn't wire focus
|
|
24
|
+
* listeners.
|
|
25
|
+
*/
|
|
26
|
+
export declare function registerFieldFocusReporter(reporter: FieldFocusReporter): void;
|
|
27
|
+
/** Returns the registered reporter, or `null`. */
|
|
28
|
+
export declare function getFieldFocusReporter(): FieldFocusReporter | null;
|
|
29
|
+
//# sourceMappingURL=FieldFocusReporterRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldFocusReporterRegistry.d.ts","sourceRoot":"","sources":["../../src/react/FieldFocusReporterRegistry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAK,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,CAAA;IACrC,MAAM,CAAC,KAAK,EAAE,eAAe,GAAI,IAAI,CAAA;CACtC;AAID;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,kBAAkB,GAAG,IAAI,CAE7E;AAED,kDAAkD;AAClD,wBAAgB,qBAAqB,IAAI,kBAAkB,GAAG,IAAI,CAEjE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
let _reporter = null;
|
|
2
|
+
/**
|
|
3
|
+
* Register the reporter. Called once at boot by the collab plugin.
|
|
4
|
+
* No-op when no plugin registers — `FieldShell` doesn't wire focus
|
|
5
|
+
* listeners.
|
|
6
|
+
*/
|
|
7
|
+
export function registerFieldFocusReporter(reporter) {
|
|
8
|
+
_reporter = reporter;
|
|
9
|
+
}
|
|
10
|
+
/** Returns the registered reporter, or `null`. */
|
|
11
|
+
export function getFieldFocusReporter() {
|
|
12
|
+
return _reporter;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=FieldFocusReporterRegistry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldFocusReporterRegistry.js","sourceRoot":"","sources":["../../src/react/FieldFocusReporterRegistry.ts"],"names":[],"mappings":"AAsBA,IAAI,SAAS,GAA8B,IAAI,CAAA;AAE/C;;;;GAIG;AACH,MAAM,UAAU,0BAA0B,CAAC,QAA4B;IACrE,SAAS,GAAG,QAAQ,CAAA;AACtB,CAAC;AAED,kDAAkD;AAClD,MAAM,UAAU,qBAAqB;IACnC,OAAO,SAAS,CAAA;AAClB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Props the per-field presence chip receives from `FieldShell` when a
|
|
4
|
+
* `@pilotiq-pro/collab`-style plugin has registered a component.
|
|
5
|
+
*
|
|
6
|
+
* The chip subscribes to the active collab room's awareness state and
|
|
7
|
+
* renders colored avatars / dots for every remote user currently
|
|
8
|
+
* focused on this field. Pilotiq core renders it alongside the field's
|
|
9
|
+
* label; the component owns the awareness lookup so pilotiq stays
|
|
10
|
+
* Yjs-free.
|
|
11
|
+
*
|
|
12
|
+
* Mounted only when:
|
|
13
|
+
*
|
|
14
|
+
* - A collab plugin has registered a component via
|
|
15
|
+
* `registerFieldPresenceComponent(...)`,
|
|
16
|
+
* - The field hasn't opted out via `Field.collab(false)`, and
|
|
17
|
+
* - The field has a stable `name` (dotted-path Repeater rows skip
|
|
18
|
+
* presence in v1 — Phase F.5 work).
|
|
19
|
+
*/
|
|
20
|
+
export interface FieldPresenceProps {
|
|
21
|
+
/** Top-level field name. Dotted-path names are skipped by `FieldShell`. */
|
|
22
|
+
fieldName: string;
|
|
23
|
+
/**
|
|
24
|
+
* Stable form identifier — same value the form's `FormStateProvider`
|
|
25
|
+
* uses. Lets the chip scope presence by form when multiple forms
|
|
26
|
+
* render on the same record (action modals, etc.).
|
|
27
|
+
*/
|
|
28
|
+
formId: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Register a component that renders inside `FieldShell`'s label area
|
|
32
|
+
* for every controlled field. Called once at boot by a collab plugin.
|
|
33
|
+
* No-op when no plugin registers — `FieldShell` skips the slot.
|
|
34
|
+
*/
|
|
35
|
+
export declare function registerFieldPresenceComponent(C: ComponentType<FieldPresenceProps>): void;
|
|
36
|
+
/** Returns the registered presence component, or `null`. */
|
|
37
|
+
export declare function getFieldPresenceComponent(): ComponentType<FieldPresenceProps> | null;
|
|
38
|
+
//# sourceMappingURL=FieldPresenceRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldPresenceRegistry.d.ts","sourceRoot":"","sources":["../../src/react/FieldPresenceRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAE1C;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,kBAAkB;IACjC,2EAA2E;IAC3E,SAAS,EAAE,MAAM,CAAA;IACjB;;;;OAIG;IACH,MAAM,EAAK,MAAM,CAAA;CAClB;AAID;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,CAAC,EAAE,aAAa,CAAC,kBAAkB,CAAC,GAAG,IAAI,CAEzF;AAED,4DAA4D;AAC5D,wBAAgB,yBAAyB,IAAI,aAAa,CAAC,kBAAkB,CAAC,GAAG,IAAI,CAEpF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
let _component = null;
|
|
2
|
+
/**
|
|
3
|
+
* Register a component that renders inside `FieldShell`'s label area
|
|
4
|
+
* for every controlled field. Called once at boot by a collab plugin.
|
|
5
|
+
* No-op when no plugin registers — `FieldShell` skips the slot.
|
|
6
|
+
*/
|
|
7
|
+
export function registerFieldPresenceComponent(C) {
|
|
8
|
+
_component = C;
|
|
9
|
+
}
|
|
10
|
+
/** Returns the registered presence component, or `null`. */
|
|
11
|
+
export function getFieldPresenceComponent() {
|
|
12
|
+
return _component;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=FieldPresenceRegistry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldPresenceRegistry.js","sourceRoot":"","sources":["../../src/react/FieldPresenceRegistry.ts"],"names":[],"mappings":"AA+BA,IAAI,UAAU,GAA6C,IAAI,CAAA;AAE/D;;;;GAIG;AACH,MAAM,UAAU,8BAA8B,CAAC,CAAoC;IACjF,UAAU,GAAG,CAAC,CAAA;AAChB,CAAC;AAED,4DAA4D;AAC5D,MAAM,UAAU,yBAAyB;IACvC,OAAO,UAAU,CAAA;AACnB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldShell.d.ts","sourceRoot":"","sources":["../../../src/react/fields/FieldShell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwC,MAAM,OAAO,CAAA;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"FieldShell.d.ts","sourceRoot":"","sources":["../../../src/react/fields/FieldShell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwC,MAAM,OAAO,CAAA;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AA8B1D;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAS,WAAW,CAAA;IACtB,IAAI,EAAO,MAAM,CAAA;IACjB,KAAK,EAAM,MAAM,CAAA;IACjB,QAAQ,EAAG,OAAO,CAAA;IAClB,QAAQ,EAAG,KAAK,CAAC,SAAS,CAAA;IAC1B;;;0DAGsD;IACtD,MAAM,CAAC,EAAI,KAAK,CAAC,SAAS,CAAA;IAC1B;0EACsE;IACtE,KAAK,CAAC,EAAK,KAAK,CAAC,SAAS,CAAA;IAC1B;gEAC4D;IAC5D,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC5B;AAED,wBAAgB,UAAU,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,eAAe,GAAG,KAAK,CAAC,YAAY,CAiLjI"}
|
|
@@ -5,6 +5,8 @@ import { usePendingSuggestions, usePendingSuggestionsForField } from '../Pending
|
|
|
5
5
|
import { getPendingSuggestionOverlay } from '../PendingSuggestionOverlayRegistry.js';
|
|
6
6
|
import { registerPendingSuggestionApplier } from '../PendingSuggestionApplierRegistry.js';
|
|
7
7
|
import { FormIdContext, useFieldState } from '../FormStateContext.js';
|
|
8
|
+
import { getFieldPresenceComponent } from '../FieldPresenceRegistry.js';
|
|
9
|
+
import { getFieldFocusReporter } from '../FieldFocusReporterRegistry.js';
|
|
8
10
|
/**
|
|
9
11
|
* Field types whose visible state is driven by React (not by a matching
|
|
10
12
|
* `[name]` DOM input). Each registers its own applier inside the field
|
|
@@ -102,7 +104,20 @@ export function FieldShell({ el, name, label, required, children, before, after,
|
|
|
102
104
|
const labelClass = hiddenLabel
|
|
103
105
|
? 'sr-only'
|
|
104
106
|
: 'text-sm font-medium leading-none';
|
|
105
|
-
|
|
107
|
+
// Phase F4 — presence chip + focus reporter slots. The chip mounts
|
|
108
|
+
// alongside the label so remote-focus indicators don't shift the
|
|
109
|
+
// input geometry; the focus reporter sits on the outer wrapper using
|
|
110
|
+
// capture-phase listeners so any inner-input focus event flows
|
|
111
|
+
// through. Both slots are gated on `meta.collab !== false` (Q3 from
|
|
112
|
+
// the F-plan — opted-out fields are fully invisible to the collab
|
|
113
|
+
// layer) AND on the field having a stable top-level name (dotted-path
|
|
114
|
+
// Repeater rows skip presence in v1 — Phase F.5).
|
|
115
|
+
const collabOptedOut = el['collab'] === false;
|
|
116
|
+
const dottedName = name.includes('.');
|
|
117
|
+
const presenceSlotEligible = !collabOptedOut && !dottedName;
|
|
118
|
+
const PresenceChip = presenceSlotEligible ? getFieldPresenceComponent() : null;
|
|
119
|
+
const focusReporter = presenceSlotEligible ? getFieldFocusReporter() : null;
|
|
120
|
+
const labelEl = label !== '' ? (_jsxs("label", { htmlFor: name, className: labelClass, children: [label, required && _jsx("span", { className: "text-destructive ml-0.5", children: "*" }), labelSlot, PresenceChip && _jsx(PresenceChip, { fieldName: name, formId: formId ?? '' })] })) : null;
|
|
106
121
|
const hasDecoration = !!(prefix || suffix || before || after);
|
|
107
122
|
const input = hasDecoration
|
|
108
123
|
? (_jsxs("div", { className: "flex items-center gap-2", children: [before, prefix && _jsx(Decoration, { content: prefix, side: "prefix" }), _jsx("div", { className: "flex-1 min-w-0", children: children }), suffix && _jsx(Decoration, { content: suffix, side: "suffix" }), after] }))
|
|
@@ -116,10 +131,19 @@ export function FieldShell({ el, name, label, required, children, before, after,
|
|
|
116
131
|
// `defaultValue` and silently undoing the approved write right after
|
|
117
132
|
// the overlay closes.
|
|
118
133
|
const inputBlock = (_jsxs(_Fragment, { children: [_jsx("div", { className: overlayNode !== null ? 'hidden' : 'contents', "aria-hidden": overlayNode !== null, children: input }), overlayNode] }));
|
|
134
|
+
// Capture-phase focus / blur dispatch — runs even when the inner
|
|
135
|
+
// input is wrapped in custom NodeViews (Select / Date / Slider). One
|
|
136
|
+
// wrapper-level handler covers every controlled input in the tree.
|
|
137
|
+
const onFocusCapture = focusReporter
|
|
138
|
+
? () => focusReporter.onFocus({ fieldName: name, formId: formId ?? '' })
|
|
139
|
+
: undefined;
|
|
140
|
+
const onBlurCapture = focusReporter
|
|
141
|
+
? () => focusReporter.onBlur({ fieldName: name, formId: formId ?? '' })
|
|
142
|
+
: undefined;
|
|
119
143
|
if (inline) {
|
|
120
|
-
return (_jsxs("div", { className: "flex items-baseline gap-3", ...wrapperAttrs, children: [labelEl && _jsx("div", { className: "min-w-32 pt-2", children: labelEl }), _jsxs("div", { className: "min-w-0 flex-1", children: [inputBlock, helperText && (_jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: helperText }))] })] }));
|
|
144
|
+
return (_jsxs("div", { className: "flex items-baseline gap-3", ...wrapperAttrs, ...(onFocusCapture ? { onFocusCapture } : {}), ...(onBlurCapture ? { onBlurCapture } : {}), children: [labelEl && _jsx("div", { className: "min-w-32 pt-2", children: labelEl }), _jsxs("div", { className: "min-w-0 flex-1", children: [inputBlock, helperText && (_jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: helperText }))] })] }));
|
|
121
145
|
}
|
|
122
|
-
return (_jsxs("div", { className: "flex flex-col gap-1.5", ...wrapperAttrs, children: [labelEl, inputBlock, helperText && (_jsx("p", { className: "text-xs text-muted-foreground", children: helperText }))] }));
|
|
146
|
+
return (_jsxs("div", { className: "flex flex-col gap-1.5", ...wrapperAttrs, ...(onFocusCapture ? { onFocusCapture } : {}), ...(onBlurCapture ? { onBlurCapture } : {}), children: [labelEl, inputBlock, helperText && (_jsx("p", { className: "text-xs text-muted-foreground", children: helperText }))] }));
|
|
123
147
|
}
|
|
124
148
|
/**
|
|
125
149
|
* Best-effort DOM apply for forms without a `<FormStateProvider>` (i.e.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldShell.js","sourceRoot":"","sources":["../../../src/react/fields/FieldShell.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAE5D,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,qBAAqB,EAAE,6BAA6B,EAA0B,MAAM,iCAAiC,CAAA;AAC9H,OAAO,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAA;AACpF,OAAO,EAAE,gCAAgC,EAAiC,MAAM,wCAAwC,CAAA;AACxH,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"FieldShell.js","sourceRoot":"","sources":["../../../src/react/fields/FieldShell.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAE5D,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,qBAAqB,EAAE,6BAA6B,EAA0B,MAAM,iCAAiC,CAAA;AAC9H,OAAO,EAAE,2BAA2B,EAAE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AAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,CAAA;AACvC,CAAC;AAED,SAAS,UAAU,CAAC,EAAE,OAAO,EAAE,IAAI,EAGlC;IACC,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAChC,OAAO,CACL,eAAM,SAAS,EAAC,wCAAwC,eAAY,IAAI,YACrE,OAAO,GACH,CACR,CAAA;IACH,CAAC;IACD,OAAO,KAAC,cAAc,IAAC,IAAI,EAAE,OAAO,CAAC,IAAI,GAAI,CAAA;AAC/C,CAAC;AAED,SAAS,cAAc,CAAC,EAAE,IAAI,EAAoB;IAChD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAwG,CAAA;IACjI,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAA;IACtB,OAAO,KAAC,IAAI,IAAC,SAAS,EAAC,uCAAuC,iBAAa,MAAM,GAAG,CAAA;AACtF,CAAC"}
|
package/dist/react/index.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ export { registerPendingSuggestionApplier, getPendingSuggestionApplier, type Pen
|
|
|
9
9
|
export { CollabRoomContext, useCollabRoom, type CollabRoom, } from './CollabRoomContext.js';
|
|
10
10
|
export { registerCollabExtensions, getCollabExtensions, type CollabExtensionFactory, type CollabExtensionFactoryArgs, } from './CollabExtensionFactoryRegistry.js';
|
|
11
11
|
export { registerFormCollabBinding, getFormCollabBinding, type FormCollabBinding, type FormCollabBindingFactory, type FormCollabBindingFactoryArgs, } from './FormCollabBindingRegistry.js';
|
|
12
|
+
export { registerFieldPresenceComponent, getFieldPresenceComponent, type FieldPresenceProps, } from './FieldPresenceRegistry.js';
|
|
13
|
+
export { registerFieldFocusReporter, getFieldFocusReporter, type FieldFocusReporter, type FieldFocusEvent, } from './FieldFocusReporterRegistry.js';
|
|
12
14
|
export { registerRecordWrapper, getRecordWrapper, type RecordWrapperProps, } from './RecordWrapperRegistry.js';
|
|
13
15
|
export { RecordWrapperGate, type RecordWrapperGateProps, } from './RecordWrapperGate.js';
|
|
14
16
|
export { parseRecordEditUrl, type RecordEditIdentity } from './parseRecordEditUrl.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,EACL,wBAAwB,EACxB,mBAAmB,EACnB,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,GAChC,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EACL,yBAAyB,EACzB,oBAAoB,EACpB,KAAK,iBAAiB,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wB,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
|
@@ -9,6 +9,8 @@ export { registerPendingSuggestionApplier, getPendingSuggestionApplier, } from '
|
|
|
9
9
|
export { CollabRoomContext, useCollabRoom, } from './CollabRoomContext.js';
|
|
10
10
|
export { registerCollabExtensions, getCollabExtensions, } from './CollabExtensionFactoryRegistry.js';
|
|
11
11
|
export { registerFormCollabBinding, getFormCollabBinding, } from './FormCollabBindingRegistry.js';
|
|
12
|
+
export { registerFieldPresenceComponent, getFieldPresenceComponent, } from './FieldPresenceRegistry.js';
|
|
13
|
+
export { registerFieldFocusReporter, getFieldFocusReporter, } from './FieldFocusReporterRegistry.js';
|
|
12
14
|
export { registerRecordWrapper, getRecordWrapper, } from './RecordWrapperRegistry.js';
|
|
13
15
|
export { RecordWrapperGate, } from './RecordWrapperGate.js';
|
|
14
16
|
export { parseRecordEditUrl } from './parseRecordEditUrl.js';
|
package/dist/react/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"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@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Module-level slot for focus / blur callbacks dispatched by pilotiq's
|
|
3
|
+
* `FieldShell`. A collab plugin (e.g. `@pilotiq-pro/collab`) registers
|
|
4
|
+
* a reporter at boot; on every controlled-field focus / blur event,
|
|
5
|
+
* `FieldShell` calls the matching method with `{ fieldName, formId }`
|
|
6
|
+
* so the plugin can mirror the local user's focus state into Yjs
|
|
7
|
+
* awareness.
|
|
8
|
+
*
|
|
9
|
+
* `FieldShell` skips dispatching for fields opted out via
|
|
10
|
+
* `Field.collab(false)` AND for dotted-path names (Repeater rows stay
|
|
11
|
+
* out of F4 presence in v1) — so the reporter never sees those events.
|
|
12
|
+
*/
|
|
13
|
+
export interface FieldFocusEvent {
|
|
14
|
+
fieldName: string
|
|
15
|
+
formId: string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface FieldFocusReporter {
|
|
19
|
+
onFocus(event: FieldFocusEvent): void
|
|
20
|
+
onBlur(event: FieldFocusEvent): void
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
let _reporter: FieldFocusReporter | null = null
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Register the reporter. Called once at boot by the collab plugin.
|
|
27
|
+
* No-op when no plugin registers — `FieldShell` doesn't wire focus
|
|
28
|
+
* listeners.
|
|
29
|
+
*/
|
|
30
|
+
export function registerFieldFocusReporter(reporter: FieldFocusReporter): void {
|
|
31
|
+
_reporter = reporter
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Returns the registered reporter, or `null`. */
|
|
35
|
+
export function getFieldFocusReporter(): FieldFocusReporter | null {
|
|
36
|
+
return _reporter
|
|
37
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { ComponentType } from 'react'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Props the per-field presence chip receives from `FieldShell` when a
|
|
5
|
+
* `@pilotiq-pro/collab`-style plugin has registered a component.
|
|
6
|
+
*
|
|
7
|
+
* The chip subscribes to the active collab room's awareness state and
|
|
8
|
+
* renders colored avatars / dots for every remote user currently
|
|
9
|
+
* focused on this field. Pilotiq core renders it alongside the field's
|
|
10
|
+
* label; the component owns the awareness lookup so pilotiq stays
|
|
11
|
+
* Yjs-free.
|
|
12
|
+
*
|
|
13
|
+
* Mounted only when:
|
|
14
|
+
*
|
|
15
|
+
* - A collab plugin has registered a component via
|
|
16
|
+
* `registerFieldPresenceComponent(...)`,
|
|
17
|
+
* - The field hasn't opted out via `Field.collab(false)`, and
|
|
18
|
+
* - The field has a stable `name` (dotted-path Repeater rows skip
|
|
19
|
+
* presence in v1 — Phase F.5 work).
|
|
20
|
+
*/
|
|
21
|
+
export interface FieldPresenceProps {
|
|
22
|
+
/** Top-level field name. Dotted-path names are skipped by `FieldShell`. */
|
|
23
|
+
fieldName: string
|
|
24
|
+
/**
|
|
25
|
+
* Stable form identifier — same value the form's `FormStateProvider`
|
|
26
|
+
* uses. Lets the chip scope presence by form when multiple forms
|
|
27
|
+
* render on the same record (action modals, etc.).
|
|
28
|
+
*/
|
|
29
|
+
formId: string
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
let _component: ComponentType<FieldPresenceProps> | null = null
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Register a component that renders inside `FieldShell`'s label area
|
|
36
|
+
* for every controlled field. Called once at boot by a collab plugin.
|
|
37
|
+
* No-op when no plugin registers — `FieldShell` skips the slot.
|
|
38
|
+
*/
|
|
39
|
+
export function registerFieldPresenceComponent(C: ComponentType<FieldPresenceProps>): void {
|
|
40
|
+
_component = C
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Returns the registered presence component, or `null`. */
|
|
44
|
+
export function getFieldPresenceComponent(): ComponentType<FieldPresenceProps> | null {
|
|
45
|
+
return _component
|
|
46
|
+
}
|
|
@@ -5,6 +5,8 @@ import { usePendingSuggestions, usePendingSuggestionsForField, type PendingSugge
|
|
|
5
5
|
import { getPendingSuggestionOverlay } from '../PendingSuggestionOverlayRegistry.js'
|
|
6
6
|
import { registerPendingSuggestionApplier, type PendingSuggestionApplier } from '../PendingSuggestionApplierRegistry.js'
|
|
7
7
|
import { FormIdContext, useFieldState } from '../FormStateContext.js'
|
|
8
|
+
import { getFieldPresenceComponent } from '../FieldPresenceRegistry.js'
|
|
9
|
+
import { getFieldFocusReporter } from '../FieldFocusReporterRegistry.js'
|
|
8
10
|
|
|
9
11
|
/**
|
|
10
12
|
* Field types whose visible state is driven by React (not by a matching
|
|
@@ -140,10 +142,25 @@ export function FieldShell({ el, name, label, required, children, before, after,
|
|
|
140
142
|
const labelClass = hiddenLabel
|
|
141
143
|
? 'sr-only'
|
|
142
144
|
: 'text-sm font-medium leading-none'
|
|
145
|
+
// Phase F4 — presence chip + focus reporter slots. The chip mounts
|
|
146
|
+
// alongside the label so remote-focus indicators don't shift the
|
|
147
|
+
// input geometry; the focus reporter sits on the outer wrapper using
|
|
148
|
+
// capture-phase listeners so any inner-input focus event flows
|
|
149
|
+
// through. Both slots are gated on `meta.collab !== false` (Q3 from
|
|
150
|
+
// the F-plan — opted-out fields are fully invisible to the collab
|
|
151
|
+
// layer) AND on the field having a stable top-level name (dotted-path
|
|
152
|
+
// Repeater rows skip presence in v1 — Phase F.5).
|
|
153
|
+
const collabOptedOut = (el as { collab?: boolean })['collab'] === false
|
|
154
|
+
const dottedName = name.includes('.')
|
|
155
|
+
const presenceSlotEligible = !collabOptedOut && !dottedName
|
|
156
|
+
const PresenceChip = presenceSlotEligible ? getFieldPresenceComponent() : null
|
|
157
|
+
const focusReporter = presenceSlotEligible ? getFieldFocusReporter() : null
|
|
158
|
+
|
|
143
159
|
const labelEl = label !== '' ? (
|
|
144
160
|
<label htmlFor={name} className={labelClass}>
|
|
145
161
|
{label}{required && <span className="text-destructive ml-0.5">*</span>}
|
|
146
162
|
{labelSlot}
|
|
163
|
+
{PresenceChip && <PresenceChip fieldName={name} formId={formId ?? ''} />}
|
|
147
164
|
</label>
|
|
148
165
|
) : null
|
|
149
166
|
|
|
@@ -177,9 +194,24 @@ export function FieldShell({ el, name, label, required, children, before, after,
|
|
|
177
194
|
</>
|
|
178
195
|
)
|
|
179
196
|
|
|
197
|
+
// Capture-phase focus / blur dispatch — runs even when the inner
|
|
198
|
+
// input is wrapped in custom NodeViews (Select / Date / Slider). One
|
|
199
|
+
// wrapper-level handler covers every controlled input in the tree.
|
|
200
|
+
const onFocusCapture = focusReporter
|
|
201
|
+
? () => focusReporter.onFocus({ fieldName: name, formId: formId ?? '' })
|
|
202
|
+
: undefined
|
|
203
|
+
const onBlurCapture = focusReporter
|
|
204
|
+
? () => focusReporter.onBlur({ fieldName: name, formId: formId ?? '' })
|
|
205
|
+
: undefined
|
|
206
|
+
|
|
180
207
|
if (inline) {
|
|
181
208
|
return (
|
|
182
|
-
<div
|
|
209
|
+
<div
|
|
210
|
+
className="flex items-baseline gap-3"
|
|
211
|
+
{...wrapperAttrs}
|
|
212
|
+
{...(onFocusCapture ? { onFocusCapture } : {})}
|
|
213
|
+
{...(onBlurCapture ? { onBlurCapture } : {})}
|
|
214
|
+
>
|
|
183
215
|
{labelEl && <div className="min-w-32 pt-2">{labelEl}</div>}
|
|
184
216
|
<div className="min-w-0 flex-1">
|
|
185
217
|
{inputBlock}
|
|
@@ -192,7 +224,12 @@ export function FieldShell({ el, name, label, required, children, before, after,
|
|
|
192
224
|
}
|
|
193
225
|
|
|
194
226
|
return (
|
|
195
|
-
<div
|
|
227
|
+
<div
|
|
228
|
+
className="flex flex-col gap-1.5"
|
|
229
|
+
{...wrapperAttrs}
|
|
230
|
+
{...(onFocusCapture ? { onFocusCapture } : {})}
|
|
231
|
+
{...(onBlurCapture ? { onBlurCapture } : {})}
|
|
232
|
+
>
|
|
196
233
|
{labelEl}
|
|
197
234
|
{inputBlock}
|
|
198
235
|
{helperText && (
|
package/src/react/index.ts
CHANGED
|
@@ -50,6 +50,17 @@ export {
|
|
|
50
50
|
type FormCollabBindingFactory,
|
|
51
51
|
type FormCollabBindingFactoryArgs,
|
|
52
52
|
} from './FormCollabBindingRegistry.js'
|
|
53
|
+
export {
|
|
54
|
+
registerFieldPresenceComponent,
|
|
55
|
+
getFieldPresenceComponent,
|
|
56
|
+
type FieldPresenceProps,
|
|
57
|
+
} from './FieldPresenceRegistry.js'
|
|
58
|
+
export {
|
|
59
|
+
registerFieldFocusReporter,
|
|
60
|
+
getFieldFocusReporter,
|
|
61
|
+
type FieldFocusReporter,
|
|
62
|
+
type FieldFocusEvent,
|
|
63
|
+
} from './FieldFocusReporterRegistry.js'
|
|
53
64
|
export {
|
|
54
65
|
registerRecordWrapper,
|
|
55
66
|
getRecordWrapper,
|