@maxhealth.tech/prefab 0.3.6 → 0.3.8
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/CHANGELOG.md +39 -0
- package/README.md +4 -4
- package/dist/app.d.ts +19 -2
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +1 -8
- package/dist/app.js.map +1 -1
- package/dist/core/component-types.d.ts +15 -0
- package/dist/core/component-types.d.ts.map +1 -0
- package/dist/core/component-types.js +135 -0
- package/dist/core/component-types.js.map +1 -0
- package/dist/core/escape.d.ts +21 -0
- package/dist/core/escape.d.ts.map +1 -0
- package/dist/core/escape.js +30 -0
- package/dist/core/escape.js.map +1 -0
- package/dist/core/validate.d.ts.map +1 -1
- package/dist/core/validate.js +6 -36
- package/dist/core/validate.js.map +1 -1
- package/dist/core/version.d.ts +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/mcp/display.d.ts +11 -2
- package/dist/mcp/display.d.ts.map +1 -1
- package/dist/mcp/display.js.map +1 -1
- package/dist/mcp/resource.d.ts.map +1 -1
- package/dist/mcp/resource.js +3 -9
- package/dist/mcp/resource.js.map +1 -1
- package/dist/mcp/types.d.ts +52 -21
- package/dist/mcp/types.d.ts.map +1 -1
- package/dist/mcp/types.js +18 -3
- package/dist/mcp/types.js.map +1 -1
- package/dist/renderer/components/typography.d.ts.map +1 -1
- package/dist/renderer/components/typography.js +1 -8
- package/dist/renderer/components/typography.js.map +1 -1
- package/dist/renderer/engine.d.ts +8 -0
- package/dist/renderer/engine.d.ts.map +1 -1
- package/dist/renderer/engine.js +10 -0
- package/dist/renderer/engine.js.map +1 -1
- package/dist/renderer.auto.min.js +7 -7
- package/dist/renderer.min.js +10 -10
- package/dist/rx/collection.d.ts +4 -4
- package/dist/rx/collection.js +4 -4
- package/dist/rx/pipes.d.ts +12 -3
- package/dist/rx/pipes.d.ts.map +1 -1
- package/dist/rx/pipes.js +12 -3
- package/dist/rx/pipes.js.map +1 -1
- package/package.json +7 -1
package/dist/rx/collection.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```ts
|
|
9
|
-
* const patients = collection('patients',
|
|
9
|
+
* const patients = collection('patients', patientRows, { key: 'id' })
|
|
10
10
|
* const selectedId = signal('selectedPatientId', patients.firstKey())
|
|
11
11
|
* const selectedPatient = patients.by(selectedId)
|
|
12
12
|
* // selectedPatient.expr → "{{ patients | find:'id',selectedPatientId }}"
|
|
@@ -41,13 +41,13 @@ export declare class Ref<T = unknown> {
|
|
|
41
41
|
* Shorthand for `.dot(field).pipe(pipeName, ...args)`.
|
|
42
42
|
* Compiles to `{{ expr | dot:'field' | pipeName }}`.
|
|
43
43
|
*
|
|
44
|
-
* Use
|
|
45
|
-
* `ref.formatted('
|
|
44
|
+
* Use to format a nested field with any built-in or registered pipe:
|
|
45
|
+
* `ref.formatted('total', 'currency')` → `{{ ... | dot:'total' | currency }}`
|
|
46
46
|
*/
|
|
47
47
|
formatted(field: keyof T & string | string, pipeName: string, ...args: unknown[]): Rx;
|
|
48
48
|
/**
|
|
49
49
|
* Append a pipe filter to the ref expression.
|
|
50
|
-
* `ref.pipe('
|
|
50
|
+
* `ref.pipe('upper')` → `{{ expr | upper }}`
|
|
51
51
|
* `ref.pipe('date', 'long')` → `{{ expr | date:'long' }}`
|
|
52
52
|
*/
|
|
53
53
|
pipe(name: string, ...args: unknown[]): Rx;
|
package/dist/rx/collection.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```ts
|
|
9
|
-
* const patients = collection('patients',
|
|
9
|
+
* const patients = collection('patients', patientRows, { key: 'id' })
|
|
10
10
|
* const selectedId = signal('selectedPatientId', patients.firstKey())
|
|
11
11
|
* const selectedPatient = patients.by(selectedId)
|
|
12
12
|
* // selectedPatient.expr → "{{ patients | find:'id',selectedPatientId }}"
|
|
@@ -44,15 +44,15 @@ export class Ref {
|
|
|
44
44
|
* Shorthand for `.dot(field).pipe(pipeName, ...args)`.
|
|
45
45
|
* Compiles to `{{ expr | dot:'field' | pipeName }}`.
|
|
46
46
|
*
|
|
47
|
-
* Use
|
|
48
|
-
* `ref.formatted('
|
|
47
|
+
* Use to format a nested field with any built-in or registered pipe:
|
|
48
|
+
* `ref.formatted('total', 'currency')` → `{{ ... | dot:'total' | currency }}`
|
|
49
49
|
*/
|
|
50
50
|
formatted(field, pipeName, ...args) {
|
|
51
51
|
return this.dot(field).pipe(pipeName, ...args);
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
54
54
|
* Append a pipe filter to the ref expression.
|
|
55
|
-
* `ref.pipe('
|
|
55
|
+
* `ref.pipe('upper')` → `{{ expr | upper }}`
|
|
56
56
|
* `ref.pipe('date', 'long')` → `{{ expr | date:'long' }}`
|
|
57
57
|
*/
|
|
58
58
|
pipe(name, ...args) {
|
package/dist/rx/pipes.d.ts
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Custom pipe registry — extension point for
|
|
2
|
+
* Custom pipe registry — extension point for domain-specific formatters.
|
|
3
|
+
*
|
|
4
|
+
* prefab ships no domain formatters of its own. A companion module adds them by
|
|
5
|
+
* calling `registerPipe()` at import time, hand-written or emitted by a code
|
|
6
|
+
* generator for whatever schema the consumer works with. Write such pipes
|
|
7
|
+
* closure-free so they survive the `fn.toString()` → `new Function()` wire
|
|
8
|
+
* round-trip.
|
|
9
|
+
*
|
|
10
|
+
* Registering locally is also the CSP-safe path: `hydratePipe` skips eval for any
|
|
11
|
+
* name already in this registry, so a host whose CSP omits `'unsafe-eval'` can
|
|
12
|
+
* load the companion module through `rendererHtml({ scripts })` rather than
|
|
13
|
+
* relying on wire hydration.
|
|
3
14
|
*
|
|
4
|
-
* Companion packages (e.g. @maxhealth.tech/prefab-fhir) call
|
|
5
|
-
* `registerPipe()` at import time to add domain-specific formatters.
|
|
6
15
|
* Built-in pipes in applyFilter always take precedence over custom pipes.
|
|
7
16
|
*/
|
|
8
17
|
/** A pipe function receives the current value and optional arguments. */
|
package/dist/rx/pipes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipes.d.ts","sourceRoot":"","sources":["../../src/rx/pipes.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"pipes.d.ts","sourceRoot":"","sources":["../../src/rx/pipes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,yEAAyE;AACzE,MAAM,MAAM,MAAM,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAA;AAIpE;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAK3D;AAED,0EAA0E;AAC1E,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED,oEAAoE;AACpE,wBAAgB,SAAS,IAAI,MAAM,EAAE,CAEpC;AAED,+DAA+D;AAC/D,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE9D"}
|
package/dist/rx/pipes.js
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Custom pipe registry — extension point for
|
|
2
|
+
* Custom pipe registry — extension point for domain-specific formatters.
|
|
3
|
+
*
|
|
4
|
+
* prefab ships no domain formatters of its own. A companion module adds them by
|
|
5
|
+
* calling `registerPipe()` at import time, hand-written or emitted by a code
|
|
6
|
+
* generator for whatever schema the consumer works with. Write such pipes
|
|
7
|
+
* closure-free so they survive the `fn.toString()` → `new Function()` wire
|
|
8
|
+
* round-trip.
|
|
9
|
+
*
|
|
10
|
+
* Registering locally is also the CSP-safe path: `hydratePipe` skips eval for any
|
|
11
|
+
* name already in this registry, so a host whose CSP omits `'unsafe-eval'` can
|
|
12
|
+
* load the companion module through `rendererHtml({ scripts })` rather than
|
|
13
|
+
* relying on wire hydration.
|
|
3
14
|
*
|
|
4
|
-
* Companion packages (e.g. @maxhealth.tech/prefab-fhir) call
|
|
5
|
-
* `registerPipe()` at import time to add domain-specific formatters.
|
|
6
15
|
* Built-in pipes in applyFilter always take precedence over custom pipes.
|
|
7
16
|
*/
|
|
8
17
|
import { log } from '../core/logger.js';
|
package/dist/rx/pipes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipes.js","sourceRoot":"","sources":["../../src/rx/pipes.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"pipes.js","sourceRoot":"","sources":["../../src/rx/pipes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAKvC,MAAM,KAAK,GAAG,IAAI,GAAG,EAAkB,CAAA;AAEvC;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,IAAY,EAAE,EAAU;IACnD,IAAI,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC;QAC9C,GAAG,CAAC,IAAI,CAAC,SAAS,IAAI,iBAAiB,CAAC,CAAA;IAC1C,CAAC;IACD,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;AACrB,CAAC;AAED,0EAA0E;AAC1E,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;AAC3B,CAAC;AAED,oEAAoE;AACpE,MAAM,UAAU,SAAS;IACvB,OAAO,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,CAAA;AAC1B,CAAC;AAED,+DAA+D;AAC/D,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;AACxB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maxhealth.tech/prefab",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.8",
|
|
4
4
|
"description": "TypeScript declarative UI component library for MCP apps. Wire-compatible with Python prefab-ui.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -59,6 +59,8 @@
|
|
|
59
59
|
"typecheck": "tsc --noEmit",
|
|
60
60
|
"prepublishOnly": "bun run build",
|
|
61
61
|
"gen:skill": "bun run scripts/gen-skill-assets.ts",
|
|
62
|
+
"gen:types": "bun run scripts/gen-component-types.ts",
|
|
63
|
+
"check:docs": "bun run scripts/check-doc-examples.ts",
|
|
62
64
|
"docs:api": "typedoc && bun run scripts/fix-typedoc-vue.ts",
|
|
63
65
|
"predocs:dev": "bun run docs:api",
|
|
64
66
|
"docs:dev": "vitepress dev docs",
|
|
@@ -81,6 +83,10 @@
|
|
|
81
83
|
"type": "git",
|
|
82
84
|
"url": "git+https://github.com/Max-Health-Inc/prefab.git"
|
|
83
85
|
},
|
|
86
|
+
"homepage": "https://maxhealth.tech/prefab",
|
|
87
|
+
"bugs": {
|
|
88
|
+
"url": "https://github.com/Max-Health-Inc/prefab/issues"
|
|
89
|
+
},
|
|
84
90
|
"devDependencies": {
|
|
85
91
|
"@eslint/js": "^10.0.1",
|
|
86
92
|
"@happy-dom/global-registrator": "^20.11.1",
|