@metamorph-labs/polymorph 1.0.18 → 1.0.19
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 +242 -0
- package/dist/design/systems/desktop.json +1 -1
- package/dist/design/systems/dew.json +1 -1
- package/dist/design/systems/flint.json +1 -1
- package/dist/design/systems/glassmorphic.json +1 -1
- package/dist/design/systems/harbor.json +1 -1
- package/dist/design/systems/journal.json +1 -1
- package/dist/design/systems/pastel.json +1 -1
- package/dist/design/systems/pebble.json +1 -1
- package/dist/design/systems/plain.json +1 -1
- package/dist/design/systems/pop.json +1 -1
- package/dist/design/systems/press.json +1 -1
- package/dist/packages/angular-ui/src/ai/ArtifactPane.ts +15 -4
- package/dist/packages/angular-ui/src/ai/PromptInput.ts +3 -1
- package/dist/packages/angular-ui/src/archetypes/Dashboard.ts +38 -20
- package/dist/packages/angular-ui/src/archetypes/dashboard.states.ts +52 -0
- package/dist/packages/angular-ui/src/controls/ColorInput.ts +62 -34
- package/dist/packages/angular-ui/src/controls/Combobox.ts +28 -7
- package/dist/packages/angular-ui/src/controls/DatePicker.ts +12 -11
- package/dist/packages/angular-ui/src/controls/DateRangePicker.ts +22 -17
- package/dist/packages/angular-ui/src/controls/DateRangePickerRangeCalendar.ts +3 -2
- package/dist/packages/angular-ui/src/controls/FileUpload.ts +18 -12
- package/dist/packages/angular-ui/src/controls/FileUploadRow.ts +24 -4
- package/dist/packages/angular-ui/src/controls/MultiSelect.ts +49 -12
- package/dist/packages/angular-ui/src/controls/NumberInput.ts +27 -3
- package/dist/packages/angular-ui/src/controls/PhoneInput.ts +9 -5
- package/dist/packages/angular-ui/src/controls/Select.ts +36 -7
- package/dist/packages/angular-ui/src/controls/TagInput.ts +61 -7
- package/dist/packages/angular-ui/src/controls/TimeInput.ts +15 -1
- package/dist/packages/angular-ui/src/controls/select.states.ts +79 -58
- package/dist/packages/angular-ui/src/overlays/Command.ts +50 -13
- package/dist/packages/angular-ui/src/overlays/CommandPanel.ts +11 -7
- package/dist/packages/angular-ui/src/overlays/ToastViewport.ts +1 -1
- package/dist/packages/angular-ui/src/structure/CodeBlock.ts +18 -4
- package/dist/packages/angular-ui/src/structure/Stat.ts +295 -84
- package/dist/packages/angular-ui/src/structure/stat.states.ts +116 -0
- package/dist/packages/cli/src/agents.js +4 -3
- package/dist/packages/cli/src/apply.js +43 -18
- package/dist/packages/cli/src/check.js +4 -0
- package/dist/packages/cli/src/cli.js +6 -2
- package/dist/packages/cli/src/elements.js +12 -2
- package/dist/packages/cli/src/emit.js +43 -8
- package/dist/packages/cli/src/readings.js +29 -3
- package/dist/packages/cli/src/skills/bridge.js +1197 -0
- package/dist/packages/cli/src/skills/facts.js +190 -0
- package/dist/packages/cli/src/skills/native.js +1580 -0
- package/dist/packages/cli/src/skills/rules.js +199 -0
- package/dist/packages/cli/src/skills/runtime.js +1020 -0
- package/dist/packages/cli/src/skills/screen-charts.js +334 -0
- package/dist/packages/cli/src/skills/screen-chat.js +247 -0
- package/dist/packages/cli/src/skills/screen-code.js +565 -0
- package/dist/packages/cli/src/skills/screen-rich-text.js +305 -0
- package/dist/packages/cli/src/skills/screen.js +378 -0
- package/dist/packages/cli/src/skills/setup-packages.js +307 -0
- package/dist/packages/cli/src/skills/setup.js +125 -0
- package/dist/packages/cli/src/skills/theme-documents.js +351 -0
- package/dist/packages/cli/src/skills/theme.js +208 -0
- package/dist/packages/cli/src/skills.js +13 -794
- package/dist/packages/cli/src/theme.js +42 -1
- package/dist/packages/cli/src/tool-verbs.js +19 -4
- package/dist/packages/cli/src/verbs.js +28 -2
- package/dist/packages/elements-ui/dist/cdn/chunks/{AppShellUserCard-0eCCnnN_.js → AppShellUserCard-XT4br4fr.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{AreaChart-DftfzLG0.js → AreaChart-CXNFfbJ8.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/ArtifactPane-Pr9_K2uM.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/{Avatar-DcdMgxgY.js → Avatar-3WXoBPLv.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{Avatar-DcuvZwe7.js → Avatar-BKqjM8qW.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{AvatarButton-D5XKVduu.js → AvatarButton-BasMQCSM.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{AvatarGroup-DgFwJUNO.js → AvatarGroup-COch2-O0.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{BarChart-myuR0aHc.js → BarChart-ugae8zfr.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{ChatMessage-CgQ1h_JP.js → ChatMessage-Bx4yrF2x.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/CodeBlock-B_e5ma3K.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/CodeBlock-Fgtr48Vb.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/ColorInput-CD7rsWRp.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/Combobox-CUw7z6TS.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/{Combobox-DB2FT7so.js → Combobox-hWIFU9X_.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/Command-BXgqRd3I.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/{ConfirmDialog-BtQOAHY2.js → ConfirmDialog-CAaBRKxl.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{Dashboard-ChMPH4_Q.js → Dashboard-DwNw5Wnd.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/DatePicker-DjqtswQR.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/DateRangePicker-LsXFHOzm.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/{DonutChart-BEK89BeL.js → DonutChart-DYXx6eTe.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/FileUpload-3gbZTSSx.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/{FormField-PlLLDKqc.js → FormField-Bvw4cLBc.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{FormField-C6L3vYp4.js → FormField-DzhcinED.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{FunnelChart-DVQz_gad.js → FunnelChart-D24XhrGw.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{Heading-fAcu6Vrw.js → Heading-Cvfyu8pc.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{Heading-CgzEi9OQ.js → Heading-XDJzlwt9.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{Heatmap-BRwR-n-V.js → Heatmap-BQoUS6gY.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{Hero-CV2YWeb4.js → Hero-CXuuFceS.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{Histogram-CCYwlinB.js → Histogram-DW_ZPHpR.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{LineChart-BH6Pq1P1.js → LineChart-kf-zlNWe.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{Markdown-DmZEch4i.js → Markdown-C3rjhIbt.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/ModeSwitch-DQ86CK9h.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/MultiSelect-DbSx9QtV.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/NumberInput-B4ZZOGLl.js +7 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/PhoneInput-BsMfbNi6.js +210 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/PromptInput-l_-zAXSZ.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/{RadarChart-Coje7Sb0.js → RadarChart-CwJAWRki.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{RichTextContent-CufjptHF.js → RichTextContent-D51UfuWk.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{RichTextInput-Dz7yBFUA.js → RichTextInput-B32fN_p9.js} +3 -3
- package/dist/packages/elements-ui/dist/cdn/chunks/{ScatterChart-Do5tQTC5.js → ScatterChart-Mps7l5-i.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/Select-CpsRP0NR.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/Stat-CXR6bP7X.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/Stat-DGcx2ZZq.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/TagInput-BhkLU4gE.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/TimeInput-r2jNTOLN.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/{Toast-CAYGbn7g.js → Toast-BTfcZn0I.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{ToastViewport-CFslglYc.js → ToastViewport-BBQMRCQT.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{ToolCall-DUCoKsoE.js → ToolCall-DNU5kk9_.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{Treemap-Bh3ruYGJ.js → Treemap-BV8TlZHB.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/agent-DfOqpL9c.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/api-DJBiUXxK.js +4 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/avatar.module-D4YdFevY.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/cap-DA71oFHt.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/{cartesian-I5uPfyqv.js → cartesian-CEn2lJCc.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/{chart-annotations.module-xUExw4pu.js → chart-annotations.module-hA_KO_Pe.js} +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/chart-brush.module-C_8txUW5.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/chart-twin.module-BpfyTQ9R.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/check-CHvc4yHL.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/css-vars-DeZ4TCna.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/draw-BiQ3Of6N.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/drawing-nhJNBahV.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/field-labels-Df5HuYC5.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/frame-CtTY4oCn.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/on-call-YKLF3-FH.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/runtime-QRQ3CjZg.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/series-uUg6_JtL.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/src-XnWjGSDr.js +67 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/toast-pwGvxH2T.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/urls-Qks0KJ_p.js +6 -0
- package/dist/packages/elements-ui/dist/cdn/chunks/webmcp-Dro53ATH.js +1 -0
- package/dist/packages/elements-ui/dist/cdn/polymorph-all.js +52 -50
- package/dist/packages/elements-ui/dist/cdn/polymorph.css +1 -1
- package/dist/packages/elements-ui/dist/cdn/polymorph.js +1 -1
- package/dist/packages/elements-ui/dist/cdn/prepaint.js +1 -1
- package/dist/packages/elements-ui/dist/cdn/themes/desktop.css +5 -4
- package/dist/packages/elements-ui/dist/cdn/themes/dew.css +5 -4
- package/dist/packages/elements-ui/dist/cdn/themes/flint.css +5 -4
- package/dist/packages/elements-ui/dist/cdn/themes/glassmorphic.css +5 -4
- package/dist/packages/elements-ui/dist/cdn/themes/harbor.css +5 -4
- package/dist/packages/elements-ui/dist/cdn/themes/journal.css +5 -4
- package/dist/packages/elements-ui/dist/cdn/themes/pastel.css +5 -4
- package/dist/packages/elements-ui/dist/cdn/themes/pebble.css +5 -4
- package/dist/packages/elements-ui/dist/cdn/themes/plain.css +5 -4
- package/dist/packages/elements-ui/dist/cdn/themes/pop.css +5 -4
- package/dist/packages/elements-ui/dist/cdn/themes/press.css +5 -4
- package/dist/packages/elements-ui/dist/cdn/themes/terminal.css +5 -4
- package/dist/packages/elements-ui/src/ai/ArtifactPane.ts +2 -0
- package/dist/packages/elements-ui/src/archetypes/dashboard.states.ts +9 -0
- package/dist/packages/elements-ui/src/controls/ColorInput.ts +2 -0
- package/dist/packages/elements-ui/src/controls/NumberInput.ts +2 -0
- package/dist/packages/elements-ui/src/controls/TagInput.ts +4 -0
- package/dist/packages/elements-ui/src/controls/TimeInput.ts +2 -0
- package/dist/packages/elements-ui/src/controls/select.states.ts +10 -0
- package/dist/packages/elements-ui/src/overlays/Command.ts +2 -0
- package/dist/packages/elements-ui/src/structure/CodeBlock.ts +5 -2
- package/dist/packages/elements-ui/src/structure/Stat.ts +6 -0
- package/dist/packages/elements-ui/src/structure/stat.states.ts +33 -0
- package/dist/packages/mcp/src/propose.js +92 -15
- package/dist/packages/mcp/src/server.js +19 -8
- package/dist/packages/mcp/src/tools.js +80 -5
- package/dist/packages/mcp/src/write.js +95 -13
- package/dist/packages/react-ui/src/ai/ArtifactPane.tsx +5 -2
- package/dist/packages/react-ui/src/ai/PromptInput.tsx +5 -2
- package/dist/packages/react-ui/src/archetypes/dashboard.states.tsx +28 -0
- package/dist/packages/react-ui/src/controls/ColorInput.tsx +69 -13
- package/dist/packages/react-ui/src/controls/Combobox.tsx +13 -5
- package/dist/packages/react-ui/src/controls/DatePicker.tsx +3 -0
- package/dist/packages/react-ui/src/controls/DateRangePicker.tsx +22 -5
- package/dist/packages/react-ui/src/controls/FileUpload.tsx +2 -0
- package/dist/packages/react-ui/src/controls/MultiSelect.tsx +30 -6
- package/dist/packages/react-ui/src/controls/NumberInput.tsx +19 -1
- package/dist/packages/react-ui/src/controls/PhoneInput.tsx +3 -3
- package/dist/packages/react-ui/src/controls/Select.tsx +59 -23
- package/dist/packages/react-ui/src/controls/TagInput.tsx +43 -10
- package/dist/packages/react-ui/src/controls/TimeInput.tsx +10 -0
- package/dist/packages/react-ui/src/controls/date-segments.tsx +16 -0
- package/dist/packages/react-ui/src/controls/select.states.tsx +13 -0
- package/dist/packages/react-ui/src/overlays/Command.tsx +23 -2
- package/dist/packages/react-ui/src/overlays/Toaster.tsx +2 -2
- package/dist/packages/react-ui/src/structure/CodeBlock.tsx +7 -3
- package/dist/packages/react-ui/src/structure/Stat.tsx +90 -13
- package/dist/packages/react-ui/src/structure/stat.states.tsx +68 -0
- package/dist/packages/recipes/src/ai/artifact-pane.module.css +4 -4
- package/dist/packages/recipes/src/controls/rich-text-input.module.css +1 -1
- package/dist/packages/recipes/src/structure/avatar.module.css +3 -1
- package/dist/packages/recipes/src/structure/heading.module.css +5 -4
- package/dist/packages/recipes/src/structure/hero.module.css +3 -1
- package/dist/packages/recipes/src/structure/stat.module.css +7 -0
- package/dist/packages/registry/src/card.js +4 -3
- package/dist/packages/registry/src/frameworks.js +28 -1
- package/dist/packages/registry/src/runtime-card.js +300 -0
- package/dist/packages/registry/src/runtime-members.js +176 -0
- package/dist/packages/registry/src/screen-table.js +166 -0
- package/dist/packages/rules/package.js +1 -1
- package/dist/packages/solid-ui/src/ai/ArtifactPane.tsx +11 -3
- package/dist/packages/solid-ui/src/ai/PromptInput.tsx +3 -1
- package/dist/packages/solid-ui/src/archetypes/Dashboard.tsx +3 -0
- package/dist/packages/solid-ui/src/archetypes/dashboard.states.tsx +39 -0
- package/dist/packages/solid-ui/src/controls/ColorInput.tsx +38 -17
- package/dist/packages/solid-ui/src/controls/Combobox.tsx +27 -6
- package/dist/packages/solid-ui/src/controls/DatePicker.tsx +12 -11
- package/dist/packages/solid-ui/src/controls/DateRangePicker.tsx +21 -16
- package/dist/packages/solid-ui/src/controls/DateRangePickerRangeCalendar.tsx +3 -4
- package/dist/packages/solid-ui/src/controls/FileUpload.tsx +1 -0
- package/dist/packages/solid-ui/src/controls/FileUploadRow.tsx +6 -0
- package/dist/packages/solid-ui/src/controls/MultiSelect.tsx +51 -11
- package/dist/packages/solid-ui/src/controls/NumberInput.tsx +21 -2
- package/dist/packages/solid-ui/src/controls/PhoneInput.tsx +8 -4
- package/dist/packages/solid-ui/src/controls/Select.tsx +37 -6
- package/dist/packages/solid-ui/src/controls/TagInput.tsx +26 -5
- package/dist/packages/solid-ui/src/controls/TimeInput.tsx +10 -1
- package/dist/packages/solid-ui/src/controls/select.states.tsx +18 -0
- package/dist/packages/solid-ui/src/overlays/Command.tsx +15 -2
- package/dist/packages/solid-ui/src/overlays/CommandPanel.tsx +7 -7
- package/dist/packages/solid-ui/src/overlays/ToastViewport.tsx +1 -1
- package/dist/packages/solid-ui/src/structure/CodeBlock.tsx +9 -5
- package/dist/packages/solid-ui/src/structure/Stat.tsx +86 -25
- package/dist/packages/solid-ui/src/structure/stat.states.tsx +73 -0
- package/dist/packages/svelte-ui/src/ai/ArtifactPane.svelte +8 -2
- package/dist/packages/svelte-ui/src/ai/PromptInput.svelte +3 -1
- package/dist/packages/svelte-ui/src/archetypes/Dashboard.svelte +3 -0
- package/dist/packages/svelte-ui/src/archetypes/dashboard.states.svelte +2 -0
- package/dist/packages/svelte-ui/src/controls/ColorInput.svelte +29 -8
- package/dist/packages/svelte-ui/src/controls/Combobox.svelte +26 -5
- package/dist/packages/svelte-ui/src/controls/DatePicker.svelte +7 -5
- package/dist/packages/svelte-ui/src/controls/DateRangePicker.svelte +15 -9
- package/dist/packages/svelte-ui/src/controls/DateRangePickerRangeCalendar.svelte +3 -2
- package/dist/packages/svelte-ui/src/controls/FileUpload.svelte +1 -0
- package/dist/packages/svelte-ui/src/controls/FileUploadRow.svelte +8 -1
- package/dist/packages/svelte-ui/src/controls/MultiSelect.svelte +36 -10
- package/dist/packages/svelte-ui/src/controls/NumberInput.svelte +14 -1
- package/dist/packages/svelte-ui/src/controls/PhoneInput.svelte +3 -3
- package/dist/packages/svelte-ui/src/controls/Select.svelte +20 -6
- package/dist/packages/svelte-ui/src/controls/TagInput.svelte +21 -3
- package/dist/packages/svelte-ui/src/controls/TimeInput.svelte +11 -1
- package/dist/packages/svelte-ui/src/controls/select.states.svelte +26 -24
- package/dist/packages/svelte-ui/src/overlays/Command.svelte +13 -1
- package/dist/packages/svelte-ui/src/overlays/CommandPanel.svelte +11 -6
- package/dist/packages/svelte-ui/src/overlays/ToastViewport.svelte +1 -1
- package/dist/packages/svelte-ui/src/structure/CodeBlock.svelte +7 -2
- package/dist/packages/svelte-ui/src/structure/Stat.svelte +70 -17
- package/dist/packages/svelte-ui/src/structure/stat.states.svelte +27 -0
- package/dist/packages/theme/src/admit.js +6 -3
- package/dist/packages/theme/src/color/resolve.js +19 -2
- package/dist/packages/theme/src/derive.js +13 -6
- package/dist/packages/theme/src/emit.js +1 -1
- package/dist/packages/theme/src/runtime.js +58 -0
- package/dist/packages/theme/src/seeds.js +30 -4
- package/dist/packages/theme/src/systems.js +1 -1
- package/dist/packages/theme/src/tokens.js +15 -6
- package/dist/packages/vue-ui/src/ai/ArtifactPane.vue +11 -2
- package/dist/packages/vue-ui/src/ai/PromptInput.vue +3 -1
- package/dist/packages/vue-ui/src/archetypes/Dashboard.vue +3 -0
- package/dist/packages/vue-ui/src/archetypes/dashboard.states.ts +49 -0
- package/dist/packages/vue-ui/src/controls/ColorInput.vue +33 -12
- package/dist/packages/vue-ui/src/controls/Combobox.vue +26 -5
- package/dist/packages/vue-ui/src/controls/DatePicker.vue +12 -11
- package/dist/packages/vue-ui/src/controls/DateRangePicker.vue +20 -15
- package/dist/packages/vue-ui/src/controls/DateRangePickerRangeCalendar.vue +3 -4
- package/dist/packages/vue-ui/src/controls/FileUpload.vue +1 -0
- package/dist/packages/vue-ui/src/controls/FileUploadRow.vue +6 -0
- package/dist/packages/vue-ui/src/controls/MultiSelect.vue +37 -10
- package/dist/packages/vue-ui/src/controls/NumberInput.vue +17 -1
- package/dist/packages/vue-ui/src/controls/PhoneInput.vue +7 -3
- package/dist/packages/vue-ui/src/controls/Select.vue +22 -7
- package/dist/packages/vue-ui/src/controls/TagInput.vue +21 -3
- package/dist/packages/vue-ui/src/controls/TimeInput.vue +10 -1
- package/dist/packages/vue-ui/src/controls/select.states.ts +17 -0
- package/dist/packages/vue-ui/src/overlays/Command.vue +13 -1
- package/dist/packages/vue-ui/src/overlays/CommandPanel.vue +7 -7
- package/dist/packages/vue-ui/src/overlays/ToastViewport.vue +1 -1
- package/dist/packages/vue-ui/src/structure/CodeBlock.vue +7 -2
- package/dist/packages/vue-ui/src/structure/Stat.vue +71 -18
- package/dist/packages/vue-ui/src/structure/stat.states.ts +67 -0
- package/dist/platforms/android/ui/src/generated/kotlin/dev/polymorph/ui/Contracts.kt +144 -33
- package/dist/platforms/android/ui/src/generated/kotlin/dev/polymorph/ui/Members.kt +17 -7
- package/dist/platforms/ios/Sources/PolymorphUI/Generated/Contracts.swift +204 -31
- package/dist/registry/registry.json +371 -75
- package/dist/screen/assets/{screen-CuQbskb8.css → screen-B22PTPwF.css} +1 -1
- package/dist/screen/assets/screen-Cpbh7XMb.js +372 -0
- package/dist/screen/screen.html +3 -3
- package/package.json +1 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/ArtifactPane-DsmRlr6d.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/CodeBlock-BqP8HZKM.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/CodeBlock-D8VARz0a.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/ColorInput-BrzZOVeL.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/Combobox-BiUq0h-w.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/Command-hmxVRdFg.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/DatePicker-C8prGbJ2.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/DateRangePicker-CO1ioqwN.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/FileUpload-HPQe-ttb.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/ModeSwitch-CerqbGv3.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/MultiSelect-CQq7jPgI.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/NumberInput-Dre9GwBy.js +0 -7
- package/dist/packages/elements-ui/dist/cdn/chunks/PhoneInput-D6_J6Es_.js +0 -210
- package/dist/packages/elements-ui/dist/cdn/chunks/PromptInput-BXcsUQ5W.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/Select-DxGQgv2q.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/Stat-FsMUWigK.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/Stat-WS8v6BQv.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/TagInput-D-uIQEGS.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/TimeInput-Dho571vA.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/agent-DBDk4wLH.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/api-B9sGZiYn.js +0 -4
- package/dist/packages/elements-ui/dist/cdn/chunks/avatar.module-CQwnWhWo.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/cap-Ct4k7zNC.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/chart-brush.module-DycBfben.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/chart-twin.module-Cks7VwS5.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/check-dOfCSYFA.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/draw-DclRgiWM.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/drawing-DjkZr0z8.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/frame-BSvl4y47.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/on-call-Jk1sYJc_.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/receivers-BpRfF6dV.js +0 -4
- package/dist/packages/elements-ui/dist/cdn/chunks/series-C_1TNd2n.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/src-Bub3C9YP.js +0 -67
- package/dist/packages/elements-ui/dist/cdn/chunks/toast-AarMGYJn.js +0 -1
- package/dist/packages/elements-ui/dist/cdn/chunks/webmcp-eEPzSqph.js +0 -1
- package/dist/screen/assets/screen-Clj2u6_s.js +0 -372
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
import { shippedParts, unionParts } from "./frameworks.js";
|
|
2
|
+
import { CONVENTION_PROPS, TIER_ORDER, TIER_TITLE, wrapped } from "./card-parts.js";
|
|
3
|
+
import { ADDRESS_KEYS, ADDRESS_SCHEMES, allowedMembers } from "./runtime-members.js";
|
|
4
|
+
//#region ../registry/src/runtime-card.ts
|
|
5
|
+
/**
|
|
6
|
+
* The ARIA hooks a member takes, written once as `aria-*` on a member that takes all four.
|
|
7
|
+
* The mark is not a word a document could hold as a key: a model that read `aria` in a
|
|
8
|
+
* member's line wrote a prop of that name, holding an object.
|
|
9
|
+
*/
|
|
10
|
+
var ARIA = [...CONVENTION_PROPS].filter((name) => name.startsWith("aria-"));
|
|
11
|
+
/** A type the vocabulary draws as a node: an element, a text, or a list of them. */
|
|
12
|
+
var NODE_TYPE = /^(?:React\.)?(?:ReactNode|ReactElement|ReactPortal)\b|^JSX\.Element\b/;
|
|
13
|
+
/** A React handler alias (`ReactEventHandler<T>`): a function of one DOM event, which an action does not receive. */
|
|
14
|
+
var EVENT_HANDLER_ALIAS = /^(?:React\.)?[A-Z]\w*EventHandler(?:<.*>)?$/s;
|
|
15
|
+
/** A ref, which an element holds in code and a document cannot write. */
|
|
16
|
+
var REF_TYPE = /^(?:React\.)?(?:Ref|RefObject|MutableRefObject|RefCallback)</;
|
|
17
|
+
/** A parameter a callback receives that a document's action cannot use: a DOM event or element. */
|
|
18
|
+
var DOM_PARAMETER = /(?:^|[^\w])(?:\w*Event|HTML\w*Element|Element)(?:<|$)/;
|
|
19
|
+
/** The text without the parentheses around all of it. */
|
|
20
|
+
function unwrap(text) {
|
|
21
|
+
let inner = text.trim();
|
|
22
|
+
while (inner.startsWith("(") && closing(inner, 0) === inner.length - 1) inner = inner.slice(1, -1).trim();
|
|
23
|
+
return inner;
|
|
24
|
+
}
|
|
25
|
+
/** The index of the bracket that closes the one at `open`, or -1. */
|
|
26
|
+
function closing(text, open) {
|
|
27
|
+
let depth = 0;
|
|
28
|
+
for (let at = open; at < text.length; at += 1) {
|
|
29
|
+
const char = text[at];
|
|
30
|
+
if ("(<{[".includes(char)) depth += 1;
|
|
31
|
+
else if (")}]".includes(char) || char === ">" && text[at - 1] !== "=") {
|
|
32
|
+
depth -= 1;
|
|
33
|
+
if (depth === 0) return at;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return -1;
|
|
37
|
+
}
|
|
38
|
+
/** The text split at each top-level comma. */
|
|
39
|
+
function commaParts(text) {
|
|
40
|
+
const parts = [];
|
|
41
|
+
let depth = 0;
|
|
42
|
+
let start = 0;
|
|
43
|
+
for (let at = 0; at < text.length; at += 1) {
|
|
44
|
+
const char = text[at];
|
|
45
|
+
if ("(<{[".includes(char)) depth += 1;
|
|
46
|
+
else if (")}]".includes(char) || char === ">" && text[at - 1] !== "=") depth -= 1;
|
|
47
|
+
else if (char === "," && depth === 0) {
|
|
48
|
+
parts.push(text.slice(start, at).trim());
|
|
49
|
+
start = at + 1;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
const last = text.slice(start).trim();
|
|
53
|
+
if (last !== "") parts.push(last);
|
|
54
|
+
return parts;
|
|
55
|
+
}
|
|
56
|
+
/** A function type as the card writes it, or `null` when the text is not one. */
|
|
57
|
+
function functionType(part, roles) {
|
|
58
|
+
const text = unwrap(part);
|
|
59
|
+
if (!text.startsWith("(")) return null;
|
|
60
|
+
const end = closing(text, 0);
|
|
61
|
+
if (end === -1) return null;
|
|
62
|
+
const rest = text.slice(end + 1).trim();
|
|
63
|
+
if (!rest.startsWith("=>")) return null;
|
|
64
|
+
return `(${commaParts(text.slice(1, end)).filter((parameter) => {
|
|
65
|
+
const colon = parameter.indexOf(":");
|
|
66
|
+
return colon === -1 || !DOM_PARAMETER.test(parameter.slice(colon + 1).trim());
|
|
67
|
+
}).join(", ")}) => ${cardType(rest.slice(2), roles)}`;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* A printed prop type as the card writes it: `undefined` left out, because
|
|
71
|
+
* `*` marks a required prop and `?` an optional field; an icon role union as
|
|
72
|
+
* `IconRole`, which the card lists once; `false | true` as `boolean`; a React
|
|
73
|
+
* node type as `node`; a callback without the DOM event it is handed, which
|
|
74
|
+
* an action does not receive; and the parts of a union joined by `|`, a
|
|
75
|
+
* function among them in parentheses.
|
|
76
|
+
*/
|
|
77
|
+
function cardType(printed, roles) {
|
|
78
|
+
const flat = printed.replace(/\s+/g, " ").trim().replace(/\?: ([^;{}]+?) \| undefined;/g, "?: $1;");
|
|
79
|
+
const whole = functionType(flat, roles);
|
|
80
|
+
if (whole !== null) return whole;
|
|
81
|
+
const parts = unionParts(flat);
|
|
82
|
+
if (parts.length === 0) return "undefined";
|
|
83
|
+
const literals = parts.filter((part) => /^"[^"]*"$/.test(part)).map((part) => part.slice(1, -1));
|
|
84
|
+
if (roles.size > 0 && literals.length === parts.length && literals.length === roles.size && literals.every((literal) => roles.has(literal))) return "IconRole";
|
|
85
|
+
const written = parts.map((part) => {
|
|
86
|
+
const bare = unwrap(part);
|
|
87
|
+
if (NODE_TYPE.test(bare)) return "node";
|
|
88
|
+
if (EVENT_HANDLER_ALIAS.test(bare)) return "() => void";
|
|
89
|
+
return functionType(bare, roles) ?? bare.replace(/^readonly /, "");
|
|
90
|
+
});
|
|
91
|
+
const boolean = written.includes("false") && written.includes("true");
|
|
92
|
+
const node = written.includes("node");
|
|
93
|
+
const kept = written.filter((part) => !(boolean && (part === "false" || part === "true")) && !(node && (part === "string" || part === "number")));
|
|
94
|
+
if (boolean) kept.unshift("boolean");
|
|
95
|
+
const distinct = [...new Set(kept)];
|
|
96
|
+
return distinct.map((part) => distinct.length > 1 && part.includes("=>") ? `(${part})` : part).join("|");
|
|
97
|
+
}
|
|
98
|
+
/** A function's printed result that is nothing: what an action returns. */
|
|
99
|
+
var NOTHING = /=> (?:void|undefined|Promise<(?:void|undefined)>)(?:\|(?:void|undefined|Promise<(?:void|undefined)>))*\)?$/;
|
|
100
|
+
/**
|
|
101
|
+
* `name: type`, `*` marking a required one; the four ARIA hooks as `aria-*`
|
|
102
|
+
* where all four are taken. A ref is left out, as a document cannot hold one,
|
|
103
|
+
* and so is a prop named in `omitted`. With `questions`, a function that
|
|
104
|
+
* returns a value is written `fn`: a data type's field of that kind cannot be
|
|
105
|
+
* given by a document at all, so its signature says nothing a document can
|
|
106
|
+
* use.
|
|
107
|
+
*/
|
|
108
|
+
function propList(props, roles, omitted, questions = false) {
|
|
109
|
+
const own = props.filter((prop) => !prop.name.includes(".") && !omitted.has(prop.name) && !unionParts(prop.type).every((part) => REF_TYPE.test(part)));
|
|
110
|
+
const names = new Set(own.map((prop) => prop.name));
|
|
111
|
+
const allAria = ARIA.every((name) => names.has(name));
|
|
112
|
+
const written = own.filter((prop) => !(allAria && ARIA.includes(prop.name))).map((prop) => {
|
|
113
|
+
const type = cardType(prop.type, roles);
|
|
114
|
+
const question = questions && isFunctionPrint(prop.type) && !NOTHING.test(type);
|
|
115
|
+
return `${prop.name}${prop.optional ? "" : "*"}: ${question ? "fn" : type}`;
|
|
116
|
+
});
|
|
117
|
+
return allAria ? [...written, "aria-*"] : written;
|
|
118
|
+
}
|
|
119
|
+
/** One member, then a line under it for each part the framework carries. */
|
|
120
|
+
function memberLines(member, framework, roles, omitted) {
|
|
121
|
+
const segments = propList(member.props, roles, omitted);
|
|
122
|
+
if (member.grid !== null) segments.push(`cells: ${Object.entries(member.grid).map(([variant, tones]) => `${variant}(${tones.join("|")})`).join(" ")}`);
|
|
123
|
+
const purpose = member.purpose === "" ? "" : ` — ${member.purpose}`;
|
|
124
|
+
const lines = [`- **${member.name}**${purpose}${segments.map((s) => ` · ${s}`).join("")}`];
|
|
125
|
+
for (const part of shippedParts(member, "web", framework)) {
|
|
126
|
+
const recorded = member.parts.find((candidate) => candidate.name === part.name);
|
|
127
|
+
if (recorded === void 0) continue;
|
|
128
|
+
const props = propList(recorded.props, roles, omitted);
|
|
129
|
+
lines.push(` - **${member.name}.${part.name}**${props.length === 0 ? "" : ` · ${props.join(" · ")}`}`);
|
|
130
|
+
}
|
|
131
|
+
return lines;
|
|
132
|
+
}
|
|
133
|
+
/** Whether a printed type is a function, alone or in a union with `undefined`: a callback, not data. */
|
|
134
|
+
function isFunctionPrint(printed) {
|
|
135
|
+
const flat = printed.replace(/\s+/g, " ").trim();
|
|
136
|
+
if (functionType(flat, /* @__PURE__ */ new Set()) !== null) return true;
|
|
137
|
+
const parts = unionParts(flat);
|
|
138
|
+
return parts.length > 0 && parts.every((part) => functionType(part, /* @__PURE__ */ new Set()) !== null || EVENT_HANDLER_ALIAS.test(unwrap(part)));
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* The data types section: each named data type the listed members' props
|
|
142
|
+
* take, the types those types' fields take, and so on, each printed once,
|
|
143
|
+
* sorted by name. A callback's parameters are not data a document writes,
|
|
144
|
+
* so a type only a callback names is left out. A type that is the props of
|
|
145
|
+
* a listed member (`StatProps`) points at the member's line.
|
|
146
|
+
*/
|
|
147
|
+
function dataTypeLines(vocabulary, listed, primitives, framework, roles, omitted) {
|
|
148
|
+
const catalogue = new Map((vocabulary.dataTypes ?? []).map((type) => [type.name, type]));
|
|
149
|
+
if (catalogue.size === 0) return [];
|
|
150
|
+
const reached = /* @__PURE__ */ new Set();
|
|
151
|
+
const queue = [];
|
|
152
|
+
const read = (printed) => {
|
|
153
|
+
if (isFunctionPrint(printed)) return;
|
|
154
|
+
for (const name of printed.match(/\b[A-Z][A-Za-z0-9]*\b/g) ?? []) if (catalogue.has(name) && !reached.has(name)) {
|
|
155
|
+
reached.add(name);
|
|
156
|
+
queue.push(name);
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
for (const member of listed) {
|
|
160
|
+
for (const prop of member.props) if (!prop.name.includes(".") && !omitted.has(prop.name)) read(prop.type);
|
|
161
|
+
for (const part of shippedParts(member, "web", framework)) {
|
|
162
|
+
const recorded = member.parts.find((candidate) => candidate.name === part.name);
|
|
163
|
+
for (const prop of recorded?.props ?? []) if (!omitted.has(prop.name)) read(prop.type);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
for (const primitive of primitives) for (const prop of primitive.props) if (!omitted.has(prop.name)) read(prop.type);
|
|
167
|
+
for (let next = queue.shift(); next !== void 0; next = queue.shift()) {
|
|
168
|
+
const type = catalogue.get(next);
|
|
169
|
+
for (const member of type?.union ?? []) read(member);
|
|
170
|
+
for (const field of type?.fields ?? []) if (!omitted.has(field.name)) read(field.type);
|
|
171
|
+
}
|
|
172
|
+
if (reached.size === 0) return [];
|
|
173
|
+
const members = new Set(listed.map((member) => member.name));
|
|
174
|
+
const lines = [...catalogue.values()].filter((type) => reached.has(type.name)).map((type) => {
|
|
175
|
+
const name = `**${type.name}${type.params.length === 0 ? "" : `<${type.params.join(", ")}>`}**`;
|
|
176
|
+
if (type.union !== void 0) return `- ${name} = ${type.union.join(" | ")}`;
|
|
177
|
+
const owner = type.name.endsWith("Props") ? type.name.slice(0, -5) : "";
|
|
178
|
+
if (members.has(owner)) return `- ${name} · the props of \`${owner}\``;
|
|
179
|
+
return `- ${name}${propList(type.fields, roles, omitted, true).map((field) => ` · ${field}`).join("")}`;
|
|
180
|
+
});
|
|
181
|
+
return [
|
|
182
|
+
"### Data types",
|
|
183
|
+
"",
|
|
184
|
+
...wrapped("A prop typed with one of these takes an object: write it as `{ \"$object\": { … } }` with the fields listed, `*` marking a required one, or bind the prop to an input that holds it. A `node` field takes an element. A function field cannot be written as a value: one shown by its signature returns nothing and takes a binding to an action input of that type; one shown as `fn` returns a value, and a document cannot give it.", 96),
|
|
185
|
+
"",
|
|
186
|
+
...lines,
|
|
187
|
+
""
|
|
188
|
+
];
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* The card's members section, for the members a host allows: a legend, the
|
|
192
|
+
* members tier by tier in the system card's reading order, the exception
|
|
193
|
+
* primitives, the data types their props take, and the icon roles when a
|
|
194
|
+
* member listed takes one.
|
|
195
|
+
*/
|
|
196
|
+
function renderRuntimeCard(vocabulary, options) {
|
|
197
|
+
const { framework, members } = options;
|
|
198
|
+
const omitted = options.addresses === "refused" ? ADDRESS_KEYS : /* @__PURE__ */ new Set();
|
|
199
|
+
const roles = new Set(vocabulary.icons.roles.map((role) => role.name));
|
|
200
|
+
const listed = vocabulary.components.filter((member) => members.has(member.name));
|
|
201
|
+
const out = [
|
|
202
|
+
"## Members",
|
|
203
|
+
"",
|
|
204
|
+
...wrapped(`One line per member: what it is for, then its props as \`name: type\`, \`*\` marking a required one, then its lawful variant × tone \`cells\`; a part (\`Member.Part\`) is a line under its member. \`node\` is an element, a text, or a list of them. A function type is a callback: bind it to an input of that type. \`aria-*\` stands for four props, each written under its own name (${ARIA.map((name) => `\`${name}\``).join(", ")}); no member has a prop named \`aria\`. A member takes no prop it does not list, and takes children only where it lists \`children\`.`, 96),
|
|
205
|
+
""
|
|
206
|
+
];
|
|
207
|
+
const tiers = [.../* @__PURE__ */ new Set([...TIER_ORDER, ...listed.map((member) => member.tier)])];
|
|
208
|
+
for (const tier of tiers) {
|
|
209
|
+
const inTier = listed.filter((member) => member.tier === tier);
|
|
210
|
+
if (inTier.length === 0) continue;
|
|
211
|
+
out.push(`### ${TIER_TITLE[tier] ?? tier}`, "");
|
|
212
|
+
for (const member of inTier) out.push(...memberLines(member, framework, roles, omitted));
|
|
213
|
+
out.push("");
|
|
214
|
+
}
|
|
215
|
+
const primitives = vocabulary.exceptions.primitives.filter((primitive) => members.has(primitive.name));
|
|
216
|
+
if (primitives.length > 0) {
|
|
217
|
+
out.push("### Declared exceptions", "");
|
|
218
|
+
for (const primitive of primitives) {
|
|
219
|
+
const props = propList(primitive.props, roles, omitted);
|
|
220
|
+
out.push(`- **${primitive.name}** (rung ${primitive.rung}) — ${primitive.purpose}` + props.map((prop) => ` · ${prop}`).join(""));
|
|
221
|
+
}
|
|
222
|
+
out.push("");
|
|
223
|
+
}
|
|
224
|
+
out.push(...dataTypeLines(vocabulary, listed, primitives, framework, roles, omitted));
|
|
225
|
+
if (out.some((line) => line.includes("IconRole"))) out.push("### Icon roles", "", ...wrapped(`An \`IconRole\` is a meaning, never a glyph name, and one of: ${vocabulary.icons.roles.map((role) => role.name).join(", ")}.`, 96), "");
|
|
226
|
+
return out.join("\n");
|
|
227
|
+
}
|
|
228
|
+
/** `a`, `a and b`, `a, b and c`, or with `or`. */
|
|
229
|
+
var listedText = (items, last = "and") => items.length <= 1 ? items.join("") : `${items.slice(0, -1).join(", ")} ${last} ${items.at(-1)}`;
|
|
230
|
+
var code = (text) => `\`${text}\``;
|
|
231
|
+
/** The opening: what the model is asked to do, and what it cannot do. */
|
|
232
|
+
var OPENING = [
|
|
233
|
+
"# Writing a screen",
|
|
234
|
+
"",
|
|
235
|
+
"You write one screen as a document that names members of a closed vocabulary, their props and",
|
|
236
|
+
"what they hold. The host draws it at once, in its own theme: every colour, space, size and motion",
|
|
237
|
+
"is the theme’s, so a document has no field for a style, a class or an expression. Choose members",
|
|
238
|
+
"and variants; bind content to the inputs the host hands the screen.",
|
|
239
|
+
""
|
|
240
|
+
].join("\n");
|
|
241
|
+
/**
|
|
242
|
+
* The output contract, for the members a host allows: what the answer is, and
|
|
243
|
+
* what the host does with each part of it at run time.
|
|
244
|
+
*/
|
|
245
|
+
function composeOutputContract(vocabulary, options) {
|
|
246
|
+
const allowed = allowedMembers(vocabulary, options);
|
|
247
|
+
const scopes = vocabulary.exceptions.primitives.filter((primitive) => allowed.has(primitive.name));
|
|
248
|
+
const patched = vocabulary.components.filter((member) => allowed.has(member.name)).filter((member) => member.props.some((prop) => prop.name === "patch")).map((member) => code(member.name));
|
|
249
|
+
const rungs = [...scopes.map((primitive) => `${code(primitive.name)} is rung ${primitive.rung}`), ...patched.length === 0 ? [] : [`a ${code("patch")} prop (on ${listedText(patched)}) is rung 3`]];
|
|
250
|
+
const addresses = listedText([...ADDRESS_KEYS].map(code));
|
|
251
|
+
const schemes = ADDRESS_SCHEMES.map(code);
|
|
252
|
+
const lines = [
|
|
253
|
+
"## What you write",
|
|
254
|
+
"",
|
|
255
|
+
`Answer with one document in the ${code(options.spec)} format, as JSON in one fenced \`json\``,
|
|
256
|
+
"block. The host draws it while it arrives, so write its keys in this order: `spec`, `name`,",
|
|
257
|
+
"`purpose`, `inputs`, and `root` last.",
|
|
258
|
+
"",
|
|
259
|
+
`- ${code("spec")} is ${code(JSON.stringify(options.spec))}. ${code("name")} is a PascalCase name for the screen that no member has.`,
|
|
260
|
+
` ${code("purpose")} is one sentence.`,
|
|
261
|
+
"- `inputs` lists what the host hands the screen, each `{ \"name\": …, \"type\": … }`. A data input is",
|
|
262
|
+
" named for a key of the host’s data, and its `type` is a TypeScript type (`string`, `Order[]`);",
|
|
263
|
+
" an input the host has no value for is empty. An input whose type is a function that returns",
|
|
264
|
+
" nothing (`(id: string) => void`) is an action: when a member calls it, the host is told its",
|
|
265
|
+
" name, its arguments and the value of every named control. Bind each callback prop the person",
|
|
266
|
+
" acts through to an action input of the callback’s type. A function that returns a value",
|
|
267
|
+
" (`(row: Row) => string`) is answered with an empty answer and the host is never told.",
|
|
268
|
+
"- `root` is an element: `{ \"component\": …, \"props\": { … }, \"children\": [ … ] }`, `props` and",
|
|
269
|
+
" `children` left out when empty. `component` is a member or a part (`Member.Part`) listed",
|
|
270
|
+
" above. Every prop goes inside `props`, and a member takes no prop and no child it does not list.",
|
|
271
|
+
" Write an element’s plain props before its props that hold elements, and `props` before",
|
|
272
|
+
" `children`: the screen is drawn as it is written, and an element is drawn once its plain",
|
|
273
|
+
" props are whole.",
|
|
274
|
+
"- A value is a string, a number, a boolean, `null`, an element, a list of values, a binding",
|
|
275
|
+
" `{ \"$\": \"input\" }` or `{ \"$\": \"input.field\" }`, or a structured object `{ \"$object\": { … } }`",
|
|
276
|
+
" (an option, a column). A binding names a declared input and is never an expression.",
|
|
277
|
+
"- There is no condition and no loop: every element is drawn whenever the screen is. Content that",
|
|
278
|
+
" is sometimes absent is a prop bound to an input that is empty while there is nothing to show.",
|
|
279
|
+
"- A control with a `name` reports its current value under that name with every action, so name",
|
|
280
|
+
" each field a person fills in. A name is used once in a screen: two forms on one screen name",
|
|
281
|
+
" their fields apart (`signInEmail`, `signUpEmail`), because one name holds one value.",
|
|
282
|
+
options.addresses === "refused" ? `- This host shows no link and loads nothing from an address: write no ${listedText([...ADDRESS_KEYS].map(code), "or")}, in a prop or a field.` : `- An address (${addresses}) is relative, a fragment, or ${schemes.slice(0, -1).join(", ")} or ${schemes.at(-1) ?? ""}.`
|
|
283
|
+
];
|
|
284
|
+
if (rungs.length > 0) lines.push(`- A declared exception: ${listedText(rungs)}. An element that is one carries`, " `\"exception\": { \"rung\": …, \"because\": \"…\" }`, the reason in four words or more; no other", " element has `exception`.");
|
|
285
|
+
return `${lines.join("\n")}\n`;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* The whole run-time card for the members a host allows: the opening, the
|
|
289
|
+
* members section and the output contract. Its default is every member the
|
|
290
|
+
* framework draws but those that host another library's code.
|
|
291
|
+
*/
|
|
292
|
+
function composeRuntimeCard(vocabulary, options) {
|
|
293
|
+
return `${OPENING}\n${renderRuntimeCard(vocabulary, {
|
|
294
|
+
framework: options.framework ?? "react",
|
|
295
|
+
members: allowedMembers(vocabulary, options),
|
|
296
|
+
...options.addresses === void 0 ? {} : { addresses: options.addresses }
|
|
297
|
+
})}\n${composeOutputContract(vocabulary, options)}`;
|
|
298
|
+
}
|
|
299
|
+
//#endregion
|
|
300
|
+
export { cardType, composeOutputContract, composeRuntimeCard, renderRuntimeCard };
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { DEFAULT_FRAMEWORK, unionParts } from "./frameworks.js";
|
|
2
|
+
//#region ../registry/src/runtime-members.ts
|
|
3
|
+
/**
|
|
4
|
+
* What a screen drawn at run time may use: which members, by the host's list
|
|
5
|
+
* or the framework's default, and which addresses.
|
|
6
|
+
*
|
|
7
|
+
* `@polymorph/screen` checks and draws a document by these rules, and the
|
|
8
|
+
* run-time card (`runtime-card.ts`) tells a model the same rules, so the card,
|
|
9
|
+
* the check and the walk cannot disagree. They live in the registry, below the
|
|
10
|
+
* screen package, because the MCP tool that prints the card reads the registry
|
|
11
|
+
* and may not depend on the screen package. The screen package re-exports
|
|
12
|
+
* each of them.
|
|
13
|
+
*
|
|
14
|
+
* This module reads no file and loads no vocabulary table, so the walk can
|
|
15
|
+
* import it (`@polymorph/registry/runtime-members`).
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* The members that host another library's code, which a host allows only by
|
|
19
|
+
* naming them in `members`. `ThirdParty` is the boundary around another
|
|
20
|
+
* library's component: drawn from a document, it would hold whatever the host
|
|
21
|
+
* puts there for it. A law in `packages/screen/src/parity.test.ts` holds that
|
|
22
|
+
* no other member takes markup, a script's address or an embed.
|
|
23
|
+
*/
|
|
24
|
+
var CODE_HOSTS = ["ThirdParty"];
|
|
25
|
+
/**
|
|
26
|
+
* The members that draw the links and pictures their own text writes, rather
|
|
27
|
+
* than an address in a prop: `Markdown` draws `[label](address)` as a link and
|
|
28
|
+
* `` as a picture. No prop carries those addresses, so a host
|
|
29
|
+
* that refuses addresses cannot refuse them one by one, and the member is left
|
|
30
|
+
* out. A law in `packages/screen/src/parity.test.ts` holds that no other
|
|
31
|
+
* member reads the Markdown parser.
|
|
32
|
+
*/
|
|
33
|
+
var ADDRESSES_FROM_TEXT = ["Markdown"];
|
|
34
|
+
/**
|
|
35
|
+
* The props and object keys that take an address: a link's target, a pager's
|
|
36
|
+
* previous and next windows, a picture or a recording, and a picture's set of
|
|
37
|
+
* files. A law in `packages/screen/src/parity.test.ts` holds every prop and
|
|
38
|
+
* data type field the vocabulary types as text and names or documents as an
|
|
39
|
+
* address to one of them.
|
|
40
|
+
*/
|
|
41
|
+
var ADDRESS_KEYS = /* @__PURE__ */ new Set([
|
|
42
|
+
"avatar",
|
|
43
|
+
"href",
|
|
44
|
+
"nextHref",
|
|
45
|
+
"previousHref",
|
|
46
|
+
"src",
|
|
47
|
+
"srcSet"
|
|
48
|
+
]);
|
|
49
|
+
/** The schemes an address may name. Anything else, and anything without a scheme that is not relative, is refused. */
|
|
50
|
+
var ADDRESS_SCHEMES = [
|
|
51
|
+
"http:",
|
|
52
|
+
"https:",
|
|
53
|
+
"mailto:",
|
|
54
|
+
"tel:"
|
|
55
|
+
];
|
|
56
|
+
/** Every address policy (`AddressPolicy`), the default first. */
|
|
57
|
+
var ADDRESS_POLICIES = ["allowed", "refused"];
|
|
58
|
+
/**
|
|
59
|
+
* The members a framework draws from a document when the host names none:
|
|
60
|
+
* every member and primitive the framework ships, without the code hosts and,
|
|
61
|
+
* in React, without a member React draws through a function.
|
|
62
|
+
*/
|
|
63
|
+
function defaultMembers(vocabulary, framework = DEFAULT_FRAMEWORK) {
|
|
64
|
+
const drawn = (entry) => entry.platforms["web"].status !== "absent" && entry.frameworks[framework].status !== "absent" && !CODE_HOSTS.includes(entry.name);
|
|
65
|
+
return [...vocabulary.components.filter((member) => drawn(member) && !(framework === "react" && member.call !== null)).map((member) => member.name), ...vocabulary.exceptions.primitives.filter(drawn).map((primitive) => primitive.name)];
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The members a screen may use, by name: the host's list, or the framework's
|
|
69
|
+
* default, without the members a host that refuses addresses cannot draw.
|
|
70
|
+
*/
|
|
71
|
+
function allowedMembers(vocabulary, options = {}) {
|
|
72
|
+
const listed = options.members ?? defaultMembers(vocabulary, options.framework);
|
|
73
|
+
if (options.addresses !== "refused") return new Set(listed);
|
|
74
|
+
return new Set(listed.filter((name) => addressNeed(vocabulary, name) === null));
|
|
75
|
+
}
|
|
76
|
+
var NEEDS = /* @__PURE__ */ new WeakMap();
|
|
77
|
+
function needsOf(vocabulary) {
|
|
78
|
+
let needs = NEEDS.get(vocabulary);
|
|
79
|
+
if (needs === void 0) {
|
|
80
|
+
needs = {
|
|
81
|
+
catalogue: new Map((vocabulary.dataTypes ?? []).map((type) => [type.name, type])),
|
|
82
|
+
members: /* @__PURE__ */ new Map(),
|
|
83
|
+
types: /* @__PURE__ */ new Map()
|
|
84
|
+
};
|
|
85
|
+
NEEDS.set(vocabulary, needs);
|
|
86
|
+
}
|
|
87
|
+
return needs;
|
|
88
|
+
}
|
|
89
|
+
/** A named type and its arguments: `DataTableColumn<Row>`, `Array<SelectOption>`. */
|
|
90
|
+
var NAMED = /^([A-Za-z_$][\w$]*)(?:<(.*)>)?$/s;
|
|
91
|
+
/** A union part without `readonly`, its list brackets and its parentheses: the type each item is. */
|
|
92
|
+
function itemType(part) {
|
|
93
|
+
let text = part.trim();
|
|
94
|
+
for (;;) {
|
|
95
|
+
const before = text;
|
|
96
|
+
if (text.startsWith("(") && text.endsWith(")")) text = text.slice(1, -1).trim();
|
|
97
|
+
text = text.replace(/^readonly\s+/, "");
|
|
98
|
+
if (text.endsWith("[]")) text = text.slice(0, -2).trim();
|
|
99
|
+
const named = NAMED.exec(text);
|
|
100
|
+
if (named !== null && (named[1] === "Array" || named[1] === "ReadonlyArray")) text = (named[2] ?? "").trim();
|
|
101
|
+
if (text === before) return text;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Where a printed type requires an address, as `Type.field`, or `null`: every
|
|
106
|
+
* part of its union, other than `null`, is a data type (or a list of one)
|
|
107
|
+
* whose required fields hold an address, directly or through another such
|
|
108
|
+
* type.
|
|
109
|
+
*/
|
|
110
|
+
function typeNeed(needs, printed, seen) {
|
|
111
|
+
const parts = unionParts(printed).filter((part) => part !== "null");
|
|
112
|
+
if (parts.length === 0) return null;
|
|
113
|
+
let first = null;
|
|
114
|
+
for (const part of parts) {
|
|
115
|
+
const name = NAMED.exec(itemType(part))?.[1];
|
|
116
|
+
const type = name === void 0 ? void 0 : needs.catalogue.get(name);
|
|
117
|
+
const need = type === void 0 ? null : dataTypeNeed(needs, type, seen);
|
|
118
|
+
if (need === null) return null;
|
|
119
|
+
first ??= need;
|
|
120
|
+
}
|
|
121
|
+
return first;
|
|
122
|
+
}
|
|
123
|
+
/** Where a data type requires an address, as `Type.field`, or `null`. A union needs one where each of its types does. */
|
|
124
|
+
function dataTypeNeed(needs, type, seen) {
|
|
125
|
+
if (needs.types.has(type.name)) return needs.types.get(type.name) ?? null;
|
|
126
|
+
if (seen.has(type.name)) return null;
|
|
127
|
+
const within = /* @__PURE__ */ new Set([...seen, type.name]);
|
|
128
|
+
let need = null;
|
|
129
|
+
if (type.union !== void 0) need = typeNeed(needs, type.union.join(" | "), within);
|
|
130
|
+
else for (const field of type.fields) {
|
|
131
|
+
if (field.optional) continue;
|
|
132
|
+
need = ADDRESS_KEYS.has(field.name) ? `${type.name}.${field.name}` : typeNeed(needs, field.type, within);
|
|
133
|
+
if (need !== null) break;
|
|
134
|
+
}
|
|
135
|
+
if (seen.size === 0) needs.types.set(type.name, need);
|
|
136
|
+
return need;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Why a member or an exception primitive cannot be drawn by a host that
|
|
140
|
+
* refuses addresses, as the end of a sentence about it, or `null` when it can:
|
|
141
|
+
*
|
|
142
|
+
* - a prop it requires takes an address (a Link's `href`), or a data type
|
|
143
|
+
* whose required fields hold one (a SectionNav's `items`, each with its
|
|
144
|
+
* `href`). The member is drawn for its address, and one drawn without it is
|
|
145
|
+
* a link that goes nowhere or a picture of nothing;
|
|
146
|
+
* - it draws the links and pictures its own text writes (`ADDRESSES_FROM_TEXT`).
|
|
147
|
+
*
|
|
148
|
+
* A member whose address props are optional is drawn without them. A name the
|
|
149
|
+
* vocabulary does not have needs nothing here; the validator reports it.
|
|
150
|
+
*/
|
|
151
|
+
function addressNeed(vocabulary, name) {
|
|
152
|
+
const needs = needsOf(vocabulary);
|
|
153
|
+
const known = needs.members.get(name);
|
|
154
|
+
if (known !== void 0) return known;
|
|
155
|
+
let need = null;
|
|
156
|
+
if (ADDRESSES_FROM_TEXT.includes(name)) need = "draws the links and pictures its text writes";
|
|
157
|
+
else {
|
|
158
|
+
const entry = vocabulary.components.find((member) => member.name === name) ?? vocabulary.exceptions.primitives.find((primitive) => primitive.name === name);
|
|
159
|
+
for (const prop of entry?.props ?? []) {
|
|
160
|
+
if (prop.optional || prop.name.includes(".")) continue;
|
|
161
|
+
if (ADDRESS_KEYS.has(prop.name)) {
|
|
162
|
+
need = `requires an address at \`${prop.name}\``;
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
const field = typeNeed(needs, prop.type, /* @__PURE__ */ new Set());
|
|
166
|
+
if (field !== null) {
|
|
167
|
+
need = `requires an address at \`${prop.name}\` (\`${field}\`)`;
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
needs.members.set(name, need);
|
|
173
|
+
return need;
|
|
174
|
+
}
|
|
175
|
+
//#endregion
|
|
176
|
+
export { ADDRESSES_FROM_TEXT, ADDRESS_KEYS, ADDRESS_POLICIES, ADDRESS_SCHEMES, CODE_HOSTS, addressNeed, allowedMembers, defaultMembers };
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { PLATFORMS } from "./platforms.js";
|
|
2
|
+
import { FRAMEWORKS, controlledProps } from "./frameworks.js";
|
|
3
|
+
import { optionsCarrier } from "./card-parts.js";
|
|
4
|
+
//#region ../registry/src/screen-table.ts
|
|
5
|
+
/** The name of a shell's file without its directory and extension: `TableRow`. */
|
|
6
|
+
var stem = (source) => source.slice(source.lastIndexOf("/") + 1).replace(/\.[^.]+$/, "");
|
|
7
|
+
/**
|
|
8
|
+
* The table in its compact form, from the registry. Deterministic, as the
|
|
9
|
+
* registry is: every list keeps the registry's order.
|
|
10
|
+
*/
|
|
11
|
+
function compactTable(registry) {
|
|
12
|
+
const types = [];
|
|
13
|
+
const index = /* @__PURE__ */ new Map();
|
|
14
|
+
const typeOf = (type) => {
|
|
15
|
+
const known = index.get(type);
|
|
16
|
+
if (known !== void 0) return known;
|
|
17
|
+
index.set(type, types.length);
|
|
18
|
+
types.push(type);
|
|
19
|
+
return types.length - 1;
|
|
20
|
+
};
|
|
21
|
+
const props = (list) => list.map((prop) => [
|
|
22
|
+
prop.name,
|
|
23
|
+
typeOf(prop.type),
|
|
24
|
+
prop.optional ? 1 : 0
|
|
25
|
+
]);
|
|
26
|
+
const platforms = (entries) => {
|
|
27
|
+
const kept = {};
|
|
28
|
+
for (const platform of PLATFORMS) {
|
|
29
|
+
const entry = entries[platform];
|
|
30
|
+
if (entry.status === "native") continue;
|
|
31
|
+
kept[platform] = entry.status === "absent" ? {
|
|
32
|
+
status: entry.status,
|
|
33
|
+
...entry.reason === void 0 ? {} : { reason: entry.reason },
|
|
34
|
+
...entry.substitute === void 0 ? {} : { substitute: entry.substitute }
|
|
35
|
+
} : { status: entry.status };
|
|
36
|
+
}
|
|
37
|
+
return Object.keys(kept).length === 0 ? void 0 : kept;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* A shell's files matter only where they can name a part: a member with
|
|
41
|
+
* parts in React, or a shell with more than its own file. Otherwise
|
|
42
|
+
* `shippedParts` answers with React's parts, which are none, either way.
|
|
43
|
+
*/
|
|
44
|
+
const frameworks = (entries, hasParts) => {
|
|
45
|
+
const kept = {};
|
|
46
|
+
for (const framework of FRAMEWORKS) {
|
|
47
|
+
const entry = entries[framework];
|
|
48
|
+
const sources = entry.shell?.sources ?? [];
|
|
49
|
+
const shell = hasParts || sources.length > 1 ? entry.shell : void 0;
|
|
50
|
+
if (entry.status === "native" && shell === void 0) continue;
|
|
51
|
+
kept[framework] = {
|
|
52
|
+
status: entry.status,
|
|
53
|
+
...entry.status === "absent" && entry.reason !== void 0 ? { reason: entry.reason } : {},
|
|
54
|
+
...shell === void 0 ? {} : { shell: { sources: shell.sources.map(stem) } }
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
return Object.keys(kept).length === 0 ? void 0 : kept;
|
|
58
|
+
};
|
|
59
|
+
const members = registry.components.map((component) => {
|
|
60
|
+
const platformEntries = platforms(component.platforms);
|
|
61
|
+
const frameworkEntries = frameworks(component.frameworks, component.parts.length > 0);
|
|
62
|
+
const call = optionsCarrier(component)?.name;
|
|
63
|
+
return {
|
|
64
|
+
name: component.name,
|
|
65
|
+
tier: component.tier,
|
|
66
|
+
purpose: component.purpose,
|
|
67
|
+
props: props(component.props),
|
|
68
|
+
...component.parts.length === 0 ? {} : { parts: component.parts.map((part) => ({
|
|
69
|
+
name: part.name,
|
|
70
|
+
props: props(part.props)
|
|
71
|
+
})) },
|
|
72
|
+
...component.grid === null ? {} : { grid: component.grid },
|
|
73
|
+
...platformEntries === void 0 ? {} : { platforms: platformEntries },
|
|
74
|
+
...frameworkEntries === void 0 ? {} : { frameworks: frameworkEntries },
|
|
75
|
+
...call === void 0 ? {} : { call }
|
|
76
|
+
};
|
|
77
|
+
});
|
|
78
|
+
const primitives = registry.exceptions.primitives.map((primitive) => {
|
|
79
|
+
const platformEntries = platforms(primitive.platforms);
|
|
80
|
+
const frameworkEntries = frameworks(primitive.frameworks, false);
|
|
81
|
+
return {
|
|
82
|
+
name: primitive.name,
|
|
83
|
+
rung: primitive.rung,
|
|
84
|
+
purpose: primitive.purpose,
|
|
85
|
+
props: props(primitive.props),
|
|
86
|
+
...platformEntries === void 0 ? {} : { platforms: platformEntries },
|
|
87
|
+
...frameworkEntries === void 0 ? {} : { frameworks: frameworkEntries }
|
|
88
|
+
};
|
|
89
|
+
});
|
|
90
|
+
const dataTypes = registry.dataTypes.map((type) => ({
|
|
91
|
+
name: type.name,
|
|
92
|
+
...type.params.length === 0 ? {} : { params: type.params },
|
|
93
|
+
...type.union === void 0 ? {} : { union: type.union },
|
|
94
|
+
fields: props(type.fields)
|
|
95
|
+
}));
|
|
96
|
+
return {
|
|
97
|
+
version: registry.version,
|
|
98
|
+
types,
|
|
99
|
+
members,
|
|
100
|
+
primitives,
|
|
101
|
+
roles: registry.icons.roles.map((role) => role.name),
|
|
102
|
+
trailing: [...registry.icons.trailing],
|
|
103
|
+
dataTypes
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
var NATIVE = { status: "native" };
|
|
107
|
+
/** The table from its compact form: every platform and framework keyed, every prop's type in place. */
|
|
108
|
+
function expandTable(compact) {
|
|
109
|
+
const props = (list) => list.map(([name, type, optional]) => ({
|
|
110
|
+
name,
|
|
111
|
+
type: compact.types[type] ?? "",
|
|
112
|
+
optional: optional === 1
|
|
113
|
+
}));
|
|
114
|
+
const platforms = (kept = {}) => Object.fromEntries(PLATFORMS.map((platform) => [platform, kept[platform] ?? NATIVE]));
|
|
115
|
+
const frameworks = (kept = {}) => Object.fromEntries(FRAMEWORKS.map((framework) => [framework, kept[framework] ?? NATIVE]));
|
|
116
|
+
const own = (list) => list.filter((prop) => !prop.name.includes("."));
|
|
117
|
+
return {
|
|
118
|
+
version: compact.version,
|
|
119
|
+
components: compact.members.map((member) => {
|
|
120
|
+
const memberProps = props(member.props);
|
|
121
|
+
return {
|
|
122
|
+
name: member.name,
|
|
123
|
+
tier: member.tier,
|
|
124
|
+
purpose: member.purpose,
|
|
125
|
+
props: memberProps,
|
|
126
|
+
parts: (member.parts ?? []).map((part) => {
|
|
127
|
+
const partProps = props(part.props);
|
|
128
|
+
return {
|
|
129
|
+
name: part.name,
|
|
130
|
+
props: partProps,
|
|
131
|
+
controlled: controlledProps(partProps)
|
|
132
|
+
};
|
|
133
|
+
}),
|
|
134
|
+
grid: member.grid ?? null,
|
|
135
|
+
platforms: platforms(member.platforms),
|
|
136
|
+
frameworks: frameworks(member.frameworks),
|
|
137
|
+
controlled: controlledProps(own(memberProps)),
|
|
138
|
+
call: member.call ?? null
|
|
139
|
+
};
|
|
140
|
+
}),
|
|
141
|
+
exceptions: { primitives: compact.primitives.map((primitive) => {
|
|
142
|
+
const primitiveProps = props(primitive.props);
|
|
143
|
+
return {
|
|
144
|
+
name: primitive.name,
|
|
145
|
+
rung: primitive.rung,
|
|
146
|
+
purpose: primitive.purpose,
|
|
147
|
+
props: primitiveProps,
|
|
148
|
+
platforms: platforms(primitive.platforms),
|
|
149
|
+
frameworks: frameworks(primitive.frameworks),
|
|
150
|
+
controlled: controlledProps(own(primitiveProps))
|
|
151
|
+
};
|
|
152
|
+
}) },
|
|
153
|
+
icons: {
|
|
154
|
+
roles: compact.roles.map((name) => ({ name })),
|
|
155
|
+
trailing: compact.trailing
|
|
156
|
+
},
|
|
157
|
+
dataTypes: compact.dataTypes.map((type) => ({
|
|
158
|
+
name: type.name,
|
|
159
|
+
params: type.params ?? [],
|
|
160
|
+
...type.union === void 0 ? {} : { union: type.union },
|
|
161
|
+
fields: props(type.fields)
|
|
162
|
+
}))
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
//#endregion
|
|
166
|
+
export { compactTable, expandTable };
|