@zh-xx/antu 0.11.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.
- package/assets/viewer.html +49 -49
- package/bin/antu-mcp.mjs +61 -61
- package/bin/antu.mjs +55 -55
- package/embed/antu-embed.d.ts +11 -0
- package/embed/antu-embed.js +26278 -25975
- package/examples/agent/fact/1-minimal.en.json +8 -11
- package/examples/agent/fact/1-minimal.zh-CN.json +34 -9
- package/examples/agent/fact/2-single-actor.en.json +4 -30
- package/examples/agent/fact/2-single-actor.zh-CN.json +22 -10
- package/examples/agent/fact/{3-groups.en.json → 3-sides.en.json} +9 -9
- package/examples/agent/fact/{3-groups.zh-CN.json → 3-sides.zh-CN.json} +9 -9
- package/examples/agent/fact/4-one-side-several.en.json +44 -0
- package/examples/agent/fact/4-one-side-several.zh-CN.json +44 -0
- package/examples/agent/fact/5-duration.en.json +31 -8
- package/examples/agent/fact/5-duration.zh-CN.json +31 -8
- package/examples/agent/fact/6-sources.en.json +51 -12
- package/examples/agent/fact/6-sources.zh-CN.json +51 -12
- package/examples/agent/fact/7-undated.en.json +26 -9
- package/examples/agent/fact/7-undated.zh-CN.json +26 -9
- package/examples/fact/fang-yuan-loan-and-conflict.en.json +7 -66
- package/examples/fact/fang-yuan-loan-and-conflict.zh-CN.json +6 -29
- package/examples/fact/gym-membership-face-scan.en.json +1 -6
- package/examples/fact/gym-membership-face-scan.zh-CN.json +1 -6
- package/examples/fact/lin-fang-v-zhao-lei-private-lending.en.json +6 -19
- package/examples/fact/lin-fang-v-zhao-lei-private-lending.zh-CN.json +6 -19
- package/examples/fact/marketplace-platform-liability.en.json +5 -24
- package/examples/fact/marketplace-platform-liability.zh-CN.json +5 -24
- package/examples/fact/neighbour-corridor-charging.en.json +3 -25
- package/examples/fact/neighbour-corridor-charging.zh-CN.json +3 -25
- package/examples/fact/sample-construction-payment.en.json +8 -82
- package/examples/fact/sample-construction-payment.zh-CN.json +7 -25
- package/examples/fact/sample-four-parties-four-slots.en.json +8 -81
- package/examples/fact/sample-four-parties-four-slots.zh-CN.json +5 -22
- package/examples/fact/sample-no-groups.en.json +1 -1
- package/examples/fact/sample-no-groups.zh-CN.json +1 -1
- package/examples/fact/sample-three-slots.en.json +3 -15
- package/examples/fact/sample-three-slots.zh-CN.json +3 -15
- package/examples/fact/sample-two-actors-one-side.en.json +4 -23
- package/examples/fact/sample-two-actors-one-side.zh-CN.json +4 -23
- package/examples/fact/sample-two-parties-each-side.en.json +7 -34
- package/examples/fact/sample-two-parties-each-side.zh-CN.json +7 -34
- package/lib/chunks/report-BbG7HCJA.mjs +1462 -0
- package/lib/html.mjs +5 -5
- package/lib/validate.d.ts +9 -0
- package/lib/validate.mjs +5 -5
- package/package.json +1 -1
- package/server.json +2 -2
- package/spec/agent/fact/guide.md +38 -38
- package/examples/agent/fact/4-views.en.json +0 -44
- package/examples/agent/fact/4-views.zh-CN.json +0 -44
- package/lib/chunks/report-BV3j2cS_.mjs +0 -1462
package/embed/antu-embed.d.ts
CHANGED
|
@@ -55,6 +55,8 @@ export interface MountOptions {
|
|
|
55
55
|
ui?: { header?: boolean; capsule?: boolean; minimap?: boolean; zoom?: boolean }
|
|
56
56
|
/** Where the reader's choices are kept: 'none' (default) while mounted only, 'local' in the viewer page's localStorage key, or the host's store */
|
|
57
57
|
prefs?: 'none' | 'local' | AntuPrefsStore
|
|
58
|
+
/** How it opens, ahead of the reader's stored choices (the reader can still change it). An unknown key or a wrong value: `mount` throws. */
|
|
59
|
+
initial?: { headerFolded?: boolean }
|
|
58
60
|
onEvent?: (event: AntuEvent) => void
|
|
59
61
|
}
|
|
60
62
|
|
|
@@ -67,6 +69,12 @@ export interface AntuHandle {
|
|
|
67
69
|
setKind(kind: string): boolean
|
|
68
70
|
setTheme(theme: AntuTheme): boolean
|
|
69
71
|
setLang(lang: AntuLang): boolean
|
|
72
|
+
/** Pin the card of the item `id`, as a reader's click would (a `select` event follows); `null` unpins. False when no card of it is drawn in this kind. */
|
|
73
|
+
select(id: string | null): boolean
|
|
74
|
+
/** Move the view to the item `id`, keeping the zoom unless it would not show it. False when it is not drawn in this kind. */
|
|
75
|
+
focus(id: string): boolean
|
|
76
|
+
/** Ring these items in the theme's colour until called again; `[]` clears. Ids that name no item are passed over. */
|
|
77
|
+
highlight(ids: string[]): void
|
|
70
78
|
fitView(): void
|
|
71
79
|
/** The PNG the page's own export makes (no label card, a white margin), not saved anywhere. Waits until the spec now mounted is drawn; rejects (with `errors`) while it is not valid. */
|
|
72
80
|
exportPng(options?: { pixelRatio?: number }): Promise<Blob>
|
|
@@ -80,5 +88,8 @@ export function mount(element: HTMLElement, spec: AntuSpec, options?: MountOptio
|
|
|
80
88
|
/** Check a spec the way the diagram checks it before drawing; each error names its field */
|
|
81
89
|
export function validate(spec: unknown): { ok: boolean; errors: string[] }
|
|
82
90
|
|
|
91
|
+
/** Repair what is inconsistent in the marks of a spec but not in its content (a procedure's main line); the input is not modified, `changes` says what was done */
|
|
92
|
+
export function normalize(spec: unknown): { spec: unknown; changes: string[] }
|
|
93
|
+
|
|
83
94
|
/** The kinds a type can be drawn in, the first being the one it opens in */
|
|
84
95
|
export function kindsOf(type: string): string[]
|