@bjanczak/flex-fields/sdk/v1 using the public esbuild adapter. The
installed FLEX runtime provides the shared implementation. These APIs own resources;
they do not create application authorization or save a record automatically.
Public exports
createResourceScope()
button, handleClick and refreshPreview. Dispose in your
factory’s destroy(); partial initialization failure must dispose its scope too.
A scope owns the supplied resources; do not track a shared worker here if other
instances still need it. Disposal cannot interrupt already running code. Check the
owner before publishing asynchronous results.
createOwnedSubscriptions()
subscribe({ channel: callback }) returns a release function.
notify(channel, args = [], context = {}) sends notifications;
protectedBy(channel, args = [], context = {}) checks vetoes.
Use createLifecycleEvents() for the documented public guard convention where
true permits and false prevents your operation. dispose() removes all groups;
snapshot() reports retained subscription information.
createLifecycleEvents()
Each declaration uses
kind: 'notification' or 'guard', and validate(payload)
must return a synchronous boolean. subscribe(name, callback, { signal }) owns one
subscription. notify(name, detail) dispatches a notification;
allow(name, detail) checks guards. Guards must return strict synchronous booleans.
Invalid payloads, errors, asynchronous guards and recursive dispatch do not permit
an operation. Payload snapshots are shallow; validate and preserve nested data.
See events for a complete example.
createAssetSurface()
activate() prepares/resumes; suspend() retains parent assets; close() releases
this surface and its children but keeps the handle reusable; dispose() permanently
releases the registration. Read state and ready without assuming a previous
resolved activation is still current.
The fuller custom-surface guide shows hide/reopen,
suspension, nested surfaces, interruption and readiness failures. The API owns
assets; you own the dialog’s presentation, focus behavior and accessible controls.
Appearance helpers
UsecreateAppearanceNamespace('acme-summary'), then token(name), font(name),
keyframe(name) or svgId(instance, name). PHP’s AppearanceNamespace generates
the same names from identical UTF-8 inputs. The helper does not inject a stylesheet
or acquire a font; declare and publish those resources through your package.