@x12i/catalox 2.0.1 → 2.0.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.
Files changed (2) hide show
  1. package/README.md +21 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -76,6 +76,7 @@ Metadata:
76
76
  - `catalogAdapters/{adapterId}` (mongo/api adapter definitions)
77
77
  - `catalogMappings/{mappingId}` (field mapping specs)
78
78
  - `catalogDescriptors/{catalogId}` (**descriptor metadata** for generic consumption)
79
+ - `catalogRendererSnippets/{catalogId}:{surface}` (**stored TSX/JSX snippets** for list/item rendering)
79
80
  - `catalogReferences/{referenceId}` (standardized reference records)
80
81
 
81
82
  Data:
@@ -210,7 +211,9 @@ Catalog descriptors can include optional UI metadata for generic presentation la
210
211
 
211
212
  - `filterSpec`: declarative filter configuration (built on `FieldSource`)
212
213
  - `presentationSpec`: declarative layout + view/edit semantics (grid/list/cards/form)
213
- - `customRenderer`: escape hatch that assigns a host-resolved JSX component (by registry key) and passes a stable render-map contract
214
+ - `customRenderer`: escape hatch that assigns either:
215
+ - a host-resolved JSX component (by registry key), or
216
+ - a separately-stored TSX/JSX snippet reference (`snippetRef`)
214
217
 
215
218
  Custom renderer contracts:
216
219
 
@@ -219,6 +222,23 @@ Custom renderer contracts:
219
222
 
220
223
  Important: host presentation layers are responsible for resolving `FieldSource` lookups (cross-catalog enums/refs) and populating `resolvedSources` for renderers.
221
224
 
225
+ #### Stored JSX/TSX renderer snippets (optional)
226
+
227
+ In addition to `customRenderer.{list|item}.component`, descriptors may specify:
228
+
229
+ - `customRenderer.list.snippetRef` or `customRenderer.item.snippetRef`
230
+
231
+ Snippets are stored separately in Firestore:
232
+
233
+ - `catalogRendererSnippets/{catalogId}:{surface}` where `surface` is `list` or `item`
234
+
235
+ This package includes a small set of opt-in helpers for snippet compilation/validation:
236
+
237
+ - `transpileJsxToModuleSource(...)`: TSX/JSX → ESM module source (string)
238
+ - `typecheckRendererSnippetIo(...)` (optional): best-effort TypeScript validation that a snippet’s default export matches the list/item render-map I/O contract
239
+ - `unsafeCreateRendererFunction(...)`: **UNSAFE** runtime evaluation of transpiled code
240
+ - `renderRendererToHtml(...)`: best-effort HTML rendering if `react` + `react-dom` are installed
241
+
222
242
  ### What you need persisted for “generic consumption”
223
243
 
224
244
  To let consumers operate *purely* from `appId` with no hardcoded catalog registrations, Catalox relies on these being present in Firestore:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@x12i/catalox",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "Catalox: Firebase-native catalog metadata + unification package.",
5
5
  "license": "MIT",
6
6
  "private": false,