@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
|
@@ -4,9 +4,13 @@ import { renderSystemCard } from "../../registry/src/card.js";
|
|
|
4
4
|
import { searchRegistry } from "../../registry/src/search.js";
|
|
5
5
|
import { FrameworkMismatchError, UnshippedMemberError } from "../../cli/src/vue.js";
|
|
6
6
|
import { EscapingDirError, UnknownItemError, planInstall } from "../../cli/src/plan.js";
|
|
7
|
+
import { ADDRESS_POLICIES } from "../../registry/src/runtime-members.js";
|
|
8
|
+
import { compactTable, expandTable } from "../../registry/src/screen-table.js";
|
|
9
|
+
import { SPEC_ID } from "../../spec/src/schema.js";
|
|
7
10
|
import { readNativePackage } from "../../spec/src/emit-native.js";
|
|
8
11
|
import { DEFAULT_PATHS, errorsOf, fix as fix$1, verify, warningsOf } from "../../rules/src/verify.js";
|
|
9
12
|
import { validateSpec } from "../../spec/src/lawful.js";
|
|
13
|
+
import { composeRuntimeCard } from "../../registry/src/runtime-card.js";
|
|
10
14
|
import { submittedDocument } from "./submitted.js";
|
|
11
15
|
import { withClimb } from "./violations.js";
|
|
12
16
|
import { RefusedWriteError, UnfinishedInstallError, codeFrameworkIn, emitScreen, fixFile, install, installFrameworkOf, saveTheme, vocabularyFor } from "./write.js";
|
|
@@ -73,13 +77,42 @@ function getComponent(context, args) {
|
|
|
73
77
|
const wanted = fold(args.name);
|
|
74
78
|
const component = context.registry.components.find((entry) => fold(entry.name) === wanted);
|
|
75
79
|
if (!component) throw new UnknownComponentError(args.name, suggestionsFor(context, wanted));
|
|
76
|
-
|
|
80
|
+
const types = typesOf(context, component);
|
|
81
|
+
if (!args.source) return {
|
|
82
|
+
component,
|
|
83
|
+
types
|
|
84
|
+
};
|
|
77
85
|
return {
|
|
78
86
|
component,
|
|
87
|
+
types,
|
|
79
88
|
files: sourceOf(context, component)
|
|
80
89
|
};
|
|
81
90
|
}
|
|
82
91
|
/**
|
|
92
|
+
* The data types a member's printed prop types name, in the order they are
|
|
93
|
+
* first named, followed through each type's fields and each union's members.
|
|
94
|
+
*/
|
|
95
|
+
function typesOf(context, component) {
|
|
96
|
+
const catalogue = new Map(context.registry.dataTypes.map((type) => [type.name, type]));
|
|
97
|
+
const reached = /* @__PURE__ */ new Map();
|
|
98
|
+
const queue = [];
|
|
99
|
+
const read = (printed) => {
|
|
100
|
+
for (const name of printed.match(/\b[A-Z][A-Za-z0-9]*\b/g) ?? []) {
|
|
101
|
+
const type = catalogue.get(name);
|
|
102
|
+
if (type === void 0 || reached.has(name)) continue;
|
|
103
|
+
reached.set(name, type);
|
|
104
|
+
queue.push(type);
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
for (const prop of component.props) read(prop.type);
|
|
108
|
+
for (const part of component.parts) for (const prop of part.props) read(prop.type);
|
|
109
|
+
for (let next = queue.shift(); next !== void 0; next = queue.shift()) {
|
|
110
|
+
for (const name of next.union ?? []) read(name);
|
|
111
|
+
for (const field of next.fields) read(field.type);
|
|
112
|
+
}
|
|
113
|
+
return [...reached.values()];
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
83
116
|
* What to suggest when the name is wrong. A name is wrong in two ways.
|
|
84
117
|
*
|
|
85
118
|
* **A near miss**: `Dialogue`, `Combo`, `Datepicker`. A prefix or substring
|
|
@@ -138,6 +171,25 @@ function getInstallPlan(context, args) {
|
|
|
138
171
|
...framework === "react" ? {} : { framework }
|
|
139
172
|
});
|
|
140
173
|
}
|
|
174
|
+
/** The frameworks a screen is drawn in at run time: React's renderer, and `<poly-screen>` for every other. */
|
|
175
|
+
var RUNTIME_FRAMEWORKS = ["react", "elements"];
|
|
176
|
+
/** Arguments `get_system_card` cannot answer, with the sentence that says why. */
|
|
177
|
+
var SystemCardError = class extends Error {
|
|
178
|
+
constructor(message) {
|
|
179
|
+
super(`polymorph: ${message}`);
|
|
180
|
+
this.name = "SystemCardError";
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
/** The run-time table of each registry, made once: what `@polymorph/screen` ships, built from it. */
|
|
184
|
+
var TABLES = /* @__PURE__ */ new WeakMap();
|
|
185
|
+
function runtimeTable(registry) {
|
|
186
|
+
let table = TABLES.get(registry);
|
|
187
|
+
if (table === void 0) {
|
|
188
|
+
table = expandTable(compactTable(registry));
|
|
189
|
+
TABLES.set(registry, table);
|
|
190
|
+
}
|
|
191
|
+
return table;
|
|
192
|
+
}
|
|
141
193
|
/**
|
|
142
194
|
* The whole vocabulary compressed for a context window: a few thousand tokens,
|
|
143
195
|
* kept under the character budget in `packages/registry/src/card.test.ts`.
|
|
@@ -145,11 +197,34 @@ function getInstallPlan(context, args) {
|
|
|
145
197
|
* For a platform other than the web, the vocabulary section leaves out the
|
|
146
198
|
* members absent there and says how each adapted one renders. The card is the
|
|
147
199
|
* registry's own rendering either way (`renderSystemCard`).
|
|
200
|
+
*
|
|
201
|
+
* With `runtime`, the run-time card instead, composed by the registry from the
|
|
202
|
+
* table `@polymorph/screen` ships, which `expandTable(compactTable(registry))`
|
|
203
|
+
* is: the text `runtimeCard` returns for the same framework, members and
|
|
204
|
+
* addresses (`packages/mcp/src/verbs.test.ts` holds the two equal).
|
|
148
205
|
*/
|
|
149
206
|
function getSystemCard(context, args = {}) {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
207
|
+
if (args.runtime !== true) {
|
|
208
|
+
if (args.members !== void 0 || args.addresses !== void 0) throw new SystemCardError("`members` and `addresses` choose the run-time card: pass `runtime: true` with them");
|
|
209
|
+
return renderSystemCard(context.registry, {
|
|
210
|
+
platform: args.platform ?? "web",
|
|
211
|
+
framework: args.framework ?? "react"
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
if ((args.platform ?? "web") !== "web") throw new SystemCardError(`nothing draws a screen at run time on ${args.platform ?? ""}: a native screen is emitted from a spec at build time, so the run-time card is for the web`);
|
|
215
|
+
const framework = args.framework ?? "react";
|
|
216
|
+
if (!RUNTIME_FRAMEWORKS.includes(framework)) throw new SystemCardError(`${framework} has no run-time renderer of its own: a page in it draws with \`<poly-screen>\`, so its run-time card is \`elements\`’s`);
|
|
217
|
+
const table = runtimeTable(context.registry);
|
|
218
|
+
if (args.members !== void 0) {
|
|
219
|
+
const known = /* @__PURE__ */ new Set([...table.components.map((member) => member.name), ...table.exceptions.primitives.map((primitive) => primitive.name)]);
|
|
220
|
+
const unknown = args.members.filter((name) => !known.has(name));
|
|
221
|
+
if (unknown.length > 0) throw new SystemCardError(`no member called ${unknown.map((name) => `"${name}"`).join(", ")} — \`members\` names members and exception primitives, and a part comes with its member`);
|
|
222
|
+
}
|
|
223
|
+
return composeRuntimeCard(table, {
|
|
224
|
+
framework,
|
|
225
|
+
spec: SPEC_ID,
|
|
226
|
+
...args.members === void 0 ? {} : { members: args.members },
|
|
227
|
+
...args.addresses === void 0 ? {} : { addresses: args.addresses }
|
|
153
228
|
});
|
|
154
229
|
}
|
|
155
230
|
/**
|
|
@@ -414,4 +489,4 @@ function unwrappedCode(output, submitted) {
|
|
|
414
489
|
return output.slice(10, output.length - 13);
|
|
415
490
|
}
|
|
416
491
|
//#endregion
|
|
417
|
-
export { EscapingDirError, FRAMEWORKS, FrameworkMismatchError, PLATFORMS, RefusedWriteError, ScreenUnavailableError, UnfinishedInstallError, UnknownComponentError, UnknownItemError, UnshippedMemberError, VIEWPORTS, emitScreen, fix, fixFile, getComponent, getInstallPlan, getSystemCard, getThemeAxes, install, proposeTheme, renderScreen, saveTheme, searchComponents, validate, vocabulary };
|
|
492
|
+
export { ADDRESS_POLICIES, EscapingDirError, FRAMEWORKS, FrameworkMismatchError, PLATFORMS, RUNTIME_FRAMEWORKS, RefusedWriteError, ScreenUnavailableError, SystemCardError, UnfinishedInstallError, UnknownComponentError, UnknownItemError, UnshippedMemberError, VIEWPORTS, emitScreen, fix, fixFile, getComponent, getInstallPlan, getSystemCard, getThemeAxes, install, proposeTheme, renderScreen, saveTheme, searchComponents, validate, vocabulary };
|
|
@@ -17,7 +17,7 @@ import { DEFAULT_PATHS, errorsOf, fix, isStylesheet, warningsOf } from "../../ru
|
|
|
17
17
|
import { emitCheckedScreen, validateSpec } from "../../spec/src/lawful.js";
|
|
18
18
|
import { submittedDocument } from "./submitted.js";
|
|
19
19
|
import { withClimb } from "./violations.js";
|
|
20
|
-
import { existsSync, lstatSync, mkdirSync, readFileSync, realpathSync, writeFileSync } from "node:fs";
|
|
20
|
+
import { existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, realpathSync, writeFileSync } from "node:fs";
|
|
21
21
|
import { dirname, resolve, sep } from "node:path";
|
|
22
22
|
//#region ../mcp/src/write.ts
|
|
23
23
|
/** A write refused because of *where* it would go, or what it would overwrite. */
|
|
@@ -28,20 +28,100 @@ var RefusedWriteError = class extends Error {
|
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
30
|
/**
|
|
31
|
+
* What marks a directory as a native platform's repository: the file or the
|
|
32
|
+
* bundle the platform's own tools write at its root. A Swift package has
|
|
33
|
+
* `Package.swift`, an Xcode project a `.xcodeproj` or `.xcworkspace` bundle,
|
|
34
|
+
* and a Gradle build its settings or build script, which a module directory
|
|
35
|
+
* holds too.
|
|
36
|
+
*/
|
|
37
|
+
var NATIVE_MARKERS = {
|
|
38
|
+
ios: {
|
|
39
|
+
files: ["Package.swift"],
|
|
40
|
+
bundles: [".xcodeproj", ".xcworkspace"]
|
|
41
|
+
},
|
|
42
|
+
android: {
|
|
43
|
+
files: [
|
|
44
|
+
"settings.gradle",
|
|
45
|
+
"settings.gradle.kts",
|
|
46
|
+
"build.gradle",
|
|
47
|
+
"build.gradle.kts"
|
|
48
|
+
],
|
|
49
|
+
bundles: []
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
/** The native platforms whose markers a directory holds at its top, with the first one found. */
|
|
53
|
+
function nativeMarkers(path) {
|
|
54
|
+
let entries;
|
|
55
|
+
try {
|
|
56
|
+
entries = readdirSync(path);
|
|
57
|
+
} catch {
|
|
58
|
+
return [];
|
|
59
|
+
}
|
|
60
|
+
return Object.keys(NATIVE_MARKERS).flatMap((platform) => {
|
|
61
|
+
const { files, bundles } = NATIVE_MARKERS[platform];
|
|
62
|
+
const marker = entries.find((entry) => files.includes(entry) || bundles.some((suffix) => entry.endsWith(suffix)));
|
|
63
|
+
return marker === void 0 ? [] : [{
|
|
64
|
+
platform,
|
|
65
|
+
marker
|
|
66
|
+
}];
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
31
70
|
* The repository to write into, or the reason there is none.
|
|
32
71
|
*
|
|
33
|
-
* The
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
72
|
+
* The check guards against the most common mistake: an MCP client that starts
|
|
73
|
+
* its servers outside the repository, for example in a home directory.
|
|
74
|
+
* Vendored source written there is not an install, only stray files, and the
|
|
75
|
+
* tool cannot tell the difference without checking. So the directory itself
|
|
76
|
+
* must say what it is. A `package.json` marks a web project, and a page with
|
|
77
|
+
* no build has its install manifest instead. A native repository has neither:
|
|
78
|
+
* its `Package.swift`, Xcode project or Gradle build marks it, and it takes
|
|
79
|
+
* only the screens emitted for its own platform (`admitsScreen`), because a
|
|
80
|
+
* web tool reads the framework and the dependencies from a `package.json`.
|
|
81
|
+
* Only the directory is read, not its parents, so a project is the directory
|
|
82
|
+
* a person pointed the tools at.
|
|
38
83
|
*/
|
|
39
|
-
function
|
|
84
|
+
function markedProject(context) {
|
|
40
85
|
if (context.project === void 0) throw new RefusedWriteError("polymorph: this server has no project to write into — it was started read-only");
|
|
41
|
-
|
|
42
|
-
|
|
86
|
+
const path = context.project;
|
|
87
|
+
const web = existsSync(resolve(path, "package.json")) || existsSync(resolve(path, "polymorph.json"));
|
|
88
|
+
const native = web ? [] : nativeMarkers(path);
|
|
89
|
+
if (!web && native.length === 0) throw new RefusedWriteError(`polymorph: ${path} has no package.json or ${MANIFEST_FILE}, and no Package.swift, Xcode project or Gradle build, so it is not the repository to write into — start the server from your repository, or pass \`--project <path>\``);
|
|
90
|
+
return {
|
|
91
|
+
path,
|
|
92
|
+
web,
|
|
93
|
+
native
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
/** A native project's markers, for a sentence: `Package.swift`, or two joined by "and". */
|
|
97
|
+
var markersOf = (project) => project.native.map((entry) => entry.marker).join(" and ");
|
|
98
|
+
/**
|
|
99
|
+
* The project a tool that writes for the web writes into: `install`,
|
|
100
|
+
* `save_theme` and `fix_file`. A native repository is refused with what it
|
|
101
|
+
* takes instead.
|
|
102
|
+
*/
|
|
103
|
+
function projectOf(context, writes) {
|
|
104
|
+
const project = markedProject(context);
|
|
105
|
+
if (!project.web) throw new RefusedWriteError(`polymorph: ${project.path} holds ${markersOf(project)} and no package.json or ${MANIFEST_FILE}, so it takes only a screen emitted for ${project.native.map((entry) => `\`${entry.platform}\``).join(" or ")} — ${writes} belongs in a web project, which a package.json marks`);
|
|
106
|
+
return project.path;
|
|
43
107
|
}
|
|
44
108
|
/**
|
|
109
|
+
* Refuses a screen a native repository does not hold: a web screen, or a
|
|
110
|
+
* screen for the other phone platform. A web project takes every screen, a
|
|
111
|
+
* native one included, as it always has.
|
|
112
|
+
*/
|
|
113
|
+
function admitsScreen(project, native) {
|
|
114
|
+
if (project.web || project.native.some((entry) => entry.platform === native)) return;
|
|
115
|
+
const holds = `${project.path} holds ${markersOf(project)} and no package.json or ${MANIFEST_FILE}`;
|
|
116
|
+
const takes = project.native.map((entry) => `\`${entry.platform}\``).join(" or ");
|
|
117
|
+
throw new RefusedWriteError(native === void 0 ? `polymorph: ${holds}, so it takes only a screen emitted for ${takes} — a web screen is written into the web project whose package.json names the framework, and a screen for this repository is a spec whose \`platform\` is ${takes}` : `polymorph: ${holds}, so it takes only a screen emitted for ${takes}, and this spec is for \`${native}\`, whose screens ${NATIVE_HOMES[native]} holds`);
|
|
118
|
+
}
|
|
119
|
+
/** Where each phone platform's screens are written, for a refusal that names it. */
|
|
120
|
+
var NATIVE_HOMES = {
|
|
121
|
+
ios: "a Swift package or an Xcode project",
|
|
122
|
+
android: "a Gradle build"
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
45
125
|
* Whether the project is the checkout the vocabulary itself lives in.
|
|
46
126
|
*
|
|
47
127
|
* Compared as real paths. One directory reached through a symlink is still one
|
|
@@ -166,7 +246,8 @@ var NATIVE_LANGUAGES = {
|
|
|
166
246
|
* without reading the call.
|
|
167
247
|
*/
|
|
168
248
|
async function emitScreen(context, args) {
|
|
169
|
-
const
|
|
249
|
+
const marked = markedProject(context);
|
|
250
|
+
const project = marked.path;
|
|
170
251
|
const full = placed(project, args.path, "`path`");
|
|
171
252
|
const read = submittedDocument(args.spec);
|
|
172
253
|
if ("fatal" in read) return {
|
|
@@ -186,6 +267,7 @@ async function emitScreen(context, args) {
|
|
|
186
267
|
const nativeExtension = Object.entries(NATIVE_LANGUAGES).find(([, written]) => args.path.endsWith(EXTENSIONS[written]));
|
|
187
268
|
throw new RefusedWriteError(`polymorph: an emitted ${framework === "solid" && native === void 0 ? "Solid" : LANGUAGE_NAMES[language]} screen is a ${extension} file, and "${args.path}" is not one` + (nativeExtension === void 0 ? "" : ` — a ${EXTENSIONS[nativeExtension[1]]} file is emitted from a spec for \`${nativeExtension[0]}\``));
|
|
188
269
|
}
|
|
270
|
+
admitsScreen(marked, native);
|
|
189
271
|
const memberPackage = native === void 0 ? void 0 : readNativePackage(context.root, native);
|
|
190
272
|
const vocabulary = FRAMEWORK_VOCABULARY[framework];
|
|
191
273
|
const { ok, faults } = validateSpec(context.registry, document, {
|
|
@@ -391,7 +473,7 @@ function installFrameworkOf(context, asked) {
|
|
|
391
473
|
* "nothing happened", which would be false.
|
|
392
474
|
*/
|
|
393
475
|
function install(context, args) {
|
|
394
|
-
const project = projectOf(context);
|
|
476
|
+
const project = projectOf(context, "an install of web members");
|
|
395
477
|
if (holdsVocabulary(context, project)) throw new RefusedWriteError("polymorph: this project is in a checkout of polymorph itself, and an install would vendor the vocabulary into its own source — start the server from the repository that consumes it, or pass `--project <path>`");
|
|
396
478
|
const framework = installFrameworkOf(context, args.framework);
|
|
397
479
|
const plan = planInstall(context.registry, args.items, {
|
|
@@ -493,7 +575,7 @@ var DEFAULT_THEME_DIR = "design";
|
|
|
493
575
|
* add.
|
|
494
576
|
*/
|
|
495
577
|
function saveTheme(context, args) {
|
|
496
|
-
const project = projectOf(context);
|
|
578
|
+
const project = projectOf(context, "saving a system and a palette");
|
|
497
579
|
const dir = args.dir ?? "design";
|
|
498
580
|
placed(project, dir, "`dir`");
|
|
499
581
|
const admission = admitTheme({
|
|
@@ -623,7 +705,7 @@ var OWN_PARSER = /\.(?:vue|svelte|html)$/;
|
|
|
623
705
|
* `<button>` stays reported with a note saying why.
|
|
624
706
|
*/
|
|
625
707
|
async function fixFile(context, args) {
|
|
626
|
-
const project = projectOf(context);
|
|
708
|
+
const project = projectOf(context, "a fix of web source");
|
|
627
709
|
placed(project, args.path, "`path`");
|
|
628
710
|
if (!FIXABLE.test(args.path)) throw new RefusedWriteError(`polymorph: "${args.path}" is not something the red rules read — they read TypeScript and JavaScript source, Vue and Svelte components, Angular templates, and stylesheets`);
|
|
629
711
|
const source = current(project, args.path);
|
|
@@ -16,7 +16,7 @@ import { Spinner } from '../structure/Spinner'
|
|
|
16
16
|
import styles from '@polymorph/recipes/ai/artifact-pane.module.css'
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
* A side pane
|
|
19
|
+
* A side pane for one artifact a turn produced
|
|
20
20
|
* (`design/components/artifact-pane.md`). The artifact is too large for the
|
|
21
21
|
* thread: a file, a page, a table or a preview. The pane shows its name, its
|
|
22
22
|
* kind, the app's controls, and a switch between the views the app offers.
|
|
@@ -52,6 +52,8 @@ export interface ArtifactPaneProps {
|
|
|
52
52
|
meta?: string
|
|
53
53
|
/** Whether the artifact is still being written, which shows a spinner and sets `aria-busy`. */
|
|
54
54
|
streaming?: boolean
|
|
55
|
+
/** The status announced while streaming (default `{title}: still being written`), which apps pass to localize. */
|
|
56
|
+
streamingLabel?: string
|
|
55
57
|
/** The header's controls (copy, download, open), as `ghost/neutral/sm` Buttons. */
|
|
56
58
|
actions?: ReactNode
|
|
57
59
|
/** Shows the close button when supplied, and the app decides whether the pane stays mounted. */
|
|
@@ -85,6 +87,7 @@ export function ArtifactPane({
|
|
|
85
87
|
kind,
|
|
86
88
|
meta,
|
|
87
89
|
streaming = false,
|
|
90
|
+
streamingLabel,
|
|
88
91
|
actions,
|
|
89
92
|
onClose,
|
|
90
93
|
closeLabel = 'Close',
|
|
@@ -178,7 +181,7 @@ export function ArtifactPane({
|
|
|
178
181
|
<span className={styles.mark}>
|
|
179
182
|
{streaming ? (
|
|
180
183
|
// The spinner's accessible name is the pane's status text.
|
|
181
|
-
<Spinner size="sm" label={`${title}: still being written`} />
|
|
184
|
+
<Spinner size="sm" label={streamingLabel ?? `${title}: still being written`} />
|
|
182
185
|
) : (
|
|
183
186
|
<Icon name={kind === undefined ? 'artifact' : KIND_ICON[kind]} size="sm" />
|
|
184
187
|
)}
|
|
@@ -80,7 +80,10 @@ export interface PromptInputMessages {
|
|
|
80
80
|
remove: (name: string) => string
|
|
81
81
|
/** The status announced while a chip's file uploads. */
|
|
82
82
|
uploading: (name: string) => string
|
|
83
|
-
/**
|
|
83
|
+
/**
|
|
84
|
+
* The status announced while the suggestion list is open. Default: `{count} suggestions`,
|
|
85
|
+
* `1 suggestion` for one.
|
|
86
|
+
*/
|
|
84
87
|
suggestions?: (count: number) => string
|
|
85
88
|
/** The status while a trigger's options load. Default: `Loading suggestions…`. */
|
|
86
89
|
loadingSuggestions?: string
|
|
@@ -199,7 +202,7 @@ const DEFAULT_MESSAGES = {
|
|
|
199
202
|
attach: 'Attach',
|
|
200
203
|
remove: (name: string) => `Remove ${name}`,
|
|
201
204
|
uploading: (name: string) => `${name}: uploading`,
|
|
202
|
-
suggestions: (count: number) => `${count} suggestions
|
|
205
|
+
suggestions: (count: number) => (count === 1 ? '1 suggestion' : `${count} suggestions`),
|
|
203
206
|
loadingSuggestions: 'Loading suggestions…',
|
|
204
207
|
noSuggestions: 'No results',
|
|
205
208
|
} satisfies Required<PromptInputMessages>
|
|
@@ -147,6 +147,34 @@ export const states: ComponentStates = {
|
|
|
147
147
|
/>
|
|
148
148
|
),
|
|
149
149
|
},
|
|
150
|
+
|
|
151
|
+
/*
|
|
152
|
+
* The page before its numbers: each stat keeps its card and its label, and
|
|
153
|
+
* the chart draws its first-load skeleton.
|
|
154
|
+
*/
|
|
155
|
+
{
|
|
156
|
+
name: 'the numbers loading — each card keeps its label and its height',
|
|
157
|
+
render: () => (
|
|
158
|
+
<Dashboard
|
|
159
|
+
title="Overview"
|
|
160
|
+
stats={STATS.map((stat) => ({ ...stat, loading: true }))}
|
|
161
|
+
primary={
|
|
162
|
+
<Dashboard.Panel title="Ticket volume">
|
|
163
|
+
<LineChart
|
|
164
|
+
data={[]}
|
|
165
|
+
loading
|
|
166
|
+
series={[
|
|
167
|
+
{ key: 'opened', label: 'Opened' },
|
|
168
|
+
{ key: 'resolved', label: 'Resolved' },
|
|
169
|
+
]}
|
|
170
|
+
x={{ key: 'day', scale: 'time', label: 'Day' }}
|
|
171
|
+
label="Tickets opened and resolved by day"
|
|
172
|
+
/>
|
|
173
|
+
</Dashboard.Panel>
|
|
174
|
+
}
|
|
175
|
+
/>
|
|
176
|
+
),
|
|
177
|
+
},
|
|
150
178
|
],
|
|
151
179
|
|
|
152
180
|
requiredSelectors: [],
|
|
@@ -32,8 +32,8 @@ import { Input } from './Input'
|
|
|
32
32
|
import styles from '@polymorph/recipes/controls/color-input.module.css'
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
|
-
* A colour field
|
|
36
|
-
*
|
|
35
|
+
* A colour field with a hex entry and a picker (`design/components/color-input.md`). A swatch
|
|
36
|
+
* opens the picker popover, which is for choosing visually. It relates to
|
|
37
37
|
* colour as DatePicker relates to Calendar: the field works without the popup, and a keyboard user
|
|
38
38
|
* never has to open the picker plane.
|
|
39
39
|
*
|
|
@@ -47,6 +47,23 @@ import styles from '@polymorph/recipes/controls/color-input.module.css'
|
|
|
47
47
|
* because display modes in the control would be a product decision made inside the vocabulary.
|
|
48
48
|
*/
|
|
49
49
|
|
|
50
|
+
/**
|
|
51
|
+
* The picker's sliders in the host's words, the localization seam. Partial: an omitted word keeps
|
|
52
|
+
* React Aria's, which React Aria says in the page's locale.
|
|
53
|
+
*/
|
|
54
|
+
export interface ColorInputMessages {
|
|
55
|
+
/** The saturation and brightness plane's name. */
|
|
56
|
+
plane?: string
|
|
57
|
+
/** The plane's value text, given both channels. */
|
|
58
|
+
planeValue?: (saturation: number, brightness: number) => string
|
|
59
|
+
/** The hue rail's name. */
|
|
60
|
+
hue?: string
|
|
61
|
+
/** The alpha rail's name. */
|
|
62
|
+
alpha?: string
|
|
63
|
+
/** A rail's value text, given the rail's name and its value. */
|
|
64
|
+
railValue?: (name: string, value: number) => string
|
|
65
|
+
}
|
|
66
|
+
|
|
50
67
|
export interface ColorInputProps {
|
|
51
68
|
/** Lowercase hex: `#rrggbb`, or `#rrggbbaa` with `alpha`. */
|
|
52
69
|
value?: string
|
|
@@ -65,6 +82,8 @@ export interface ColorInputProps {
|
|
|
65
82
|
name?: string
|
|
66
83
|
/** Opens the picker on mount, for galleries and tests. Screens let the user open it. */
|
|
67
84
|
defaultOpen?: boolean
|
|
85
|
+
/** The picker's sliders' names and value texts in the host's words. */
|
|
86
|
+
messages?: ColorInputMessages
|
|
68
87
|
/** Set by FormField. Set it directly only when there is no visible label. */
|
|
69
88
|
'aria-label'?: string
|
|
70
89
|
'aria-labelledby'?: string
|
|
@@ -101,6 +120,7 @@ export function ColorInput({
|
|
|
101
120
|
id,
|
|
102
121
|
name,
|
|
103
122
|
defaultOpen,
|
|
123
|
+
messages,
|
|
104
124
|
'aria-label': ariaLabel,
|
|
105
125
|
'aria-labelledby': labelledBy,
|
|
106
126
|
'aria-describedby': describedBy,
|
|
@@ -206,6 +226,7 @@ export function ColorInput({
|
|
|
206
226
|
alpha={alpha}
|
|
207
227
|
disabled={disabled}
|
|
208
228
|
locale={locale}
|
|
229
|
+
messages={messages}
|
|
209
230
|
/>
|
|
210
231
|
</Popover>
|
|
211
232
|
</PopoverPanelMember>
|
|
@@ -252,9 +273,10 @@ interface PickerProps {
|
|
|
252
273
|
alpha: boolean
|
|
253
274
|
disabled: boolean
|
|
254
275
|
locale: string
|
|
276
|
+
messages: ColorInputMessages | undefined
|
|
255
277
|
}
|
|
256
278
|
|
|
257
|
-
function Picker({ color, onChange, alpha, disabled, locale }: PickerProps) {
|
|
279
|
+
function Picker({ color, onChange, alpha, disabled, locale, messages }: PickerProps) {
|
|
258
280
|
const areaState = useColorAreaState({
|
|
259
281
|
value: color,
|
|
260
282
|
onChange,
|
|
@@ -266,9 +288,11 @@ function Picker({ color, onChange, alpha, disabled, locale }: PickerProps) {
|
|
|
266
288
|
|
|
267
289
|
return (
|
|
268
290
|
<div className={styles.picker}>
|
|
269
|
-
<Plane state={areaState} disabled={disabled} />
|
|
270
|
-
<Rail state={hueState} channel="hue" disabled={disabled} />
|
|
271
|
-
{alpha ?
|
|
291
|
+
<Plane state={areaState} disabled={disabled} messages={messages} />
|
|
292
|
+
<Rail state={hueState} channel="hue" disabled={disabled} messages={messages} />
|
|
293
|
+
{alpha ? (
|
|
294
|
+
<Rail state={alphaState} channel="alpha" checker disabled={disabled} messages={messages} />
|
|
295
|
+
) : null}
|
|
272
296
|
</div>
|
|
273
297
|
)
|
|
274
298
|
}
|
|
@@ -277,9 +301,18 @@ function Picker({ color, onChange, alpha, disabled, locale }: PickerProps) {
|
|
|
277
301
|
* The saturation × brightness plane. React Aria returns the gradient, the thumb position and the
|
|
278
302
|
* RTL maths in its style props. The two hidden range inputs are its accessibility model: one tab
|
|
279
303
|
* stop per channel, with arrows moving both axes from either. The composite-field selector draws
|
|
280
|
-
* the ring on the thumb when either input has focus.
|
|
304
|
+
* the ring on the thumb when either input has focus. A host's `plane` and `planeValue` name and
|
|
305
|
+
* value both inputs; absent, React Aria's words stay.
|
|
281
306
|
*/
|
|
282
|
-
function Plane({
|
|
307
|
+
function Plane({
|
|
308
|
+
state,
|
|
309
|
+
disabled,
|
|
310
|
+
messages,
|
|
311
|
+
}: {
|
|
312
|
+
state: ColorAreaState
|
|
313
|
+
disabled: boolean
|
|
314
|
+
messages: ColorInputMessages | undefined
|
|
315
|
+
}) {
|
|
283
316
|
const containerRef = useRef<HTMLDivElement>(null)
|
|
284
317
|
const inputXRef = useRef<HTMLInputElement>(null)
|
|
285
318
|
const inputYRef = useRef<HTMLInputElement>(null)
|
|
@@ -287,6 +320,17 @@ function Plane({ state, disabled }: { state: ColorAreaState; disabled: boolean }
|
|
|
287
320
|
{ containerRef, inputXRef, inputYRef, isDisabled: disabled },
|
|
288
321
|
state,
|
|
289
322
|
)
|
|
323
|
+
const hostWords = {
|
|
324
|
+
...(messages?.plane === undefined ? {} : { 'aria-label': messages.plane }),
|
|
325
|
+
...(messages?.planeValue === undefined
|
|
326
|
+
? {}
|
|
327
|
+
: {
|
|
328
|
+
'aria-valuetext': messages.planeValue(
|
|
329
|
+
state.value.getChannelValue('saturation'),
|
|
330
|
+
state.value.getChannelValue('brightness'),
|
|
331
|
+
),
|
|
332
|
+
}),
|
|
333
|
+
}
|
|
290
334
|
|
|
291
335
|
return (
|
|
292
336
|
<div
|
|
@@ -306,8 +350,8 @@ function Plane({ state, disabled }: { state: ColorAreaState; disabled: boolean }
|
|
|
306
350
|
} as CSSProperties
|
|
307
351
|
}
|
|
308
352
|
>
|
|
309
|
-
<input ref={inputXRef} {...xInputProps} />
|
|
310
|
-
<input ref={inputYRef} {...yInputProps} />
|
|
353
|
+
<input ref={inputXRef} {...xInputProps} {...hostWords} />
|
|
354
|
+
<input ref={inputYRef} {...yInputProps} {...hostWords} />
|
|
311
355
|
</span>
|
|
312
356
|
</div>
|
|
313
357
|
)
|
|
@@ -316,25 +360,37 @@ function Plane({ state, disabled }: { state: ColorAreaState; disabled: boolean }
|
|
|
316
360
|
/**
|
|
317
361
|
* One channel as a rail: hue, or alpha over the checker. React Aria's track style carries the
|
|
318
362
|
* gradient. It is moved onto an inner layer so the checker, which the theme owns, can sit beneath
|
|
319
|
-
* the fade, which the colour model owns.
|
|
363
|
+
* the fade, which the colour model owns. A host's word for the channel names the rail, and its
|
|
364
|
+
* `railValue` values it; absent, React Aria's words stay.
|
|
320
365
|
*/
|
|
321
366
|
function Rail({
|
|
322
367
|
state,
|
|
323
368
|
channel,
|
|
324
369
|
checker = false,
|
|
325
370
|
disabled,
|
|
371
|
+
messages,
|
|
326
372
|
}: {
|
|
327
373
|
state: ColorSliderState
|
|
328
374
|
channel: 'hue' | 'alpha'
|
|
329
375
|
checker?: boolean
|
|
330
376
|
disabled: boolean
|
|
377
|
+
messages: ColorInputMessages | undefined
|
|
331
378
|
}) {
|
|
379
|
+
const { locale } = useLocale()
|
|
332
380
|
const trackRef = useRef<HTMLDivElement>(null)
|
|
333
381
|
const inputRef = useRef<HTMLInputElement>(null)
|
|
382
|
+
const name = messages?.[channel]
|
|
334
383
|
const { trackProps, thumbProps, inputProps } = useColorSlider(
|
|
335
|
-
{ channel, trackRef, inputRef, isDisabled: disabled },
|
|
384
|
+
{ channel, trackRef, inputRef, isDisabled: disabled, 'aria-label': name },
|
|
336
385
|
state,
|
|
337
386
|
)
|
|
387
|
+
const valueText =
|
|
388
|
+
messages?.railValue === undefined
|
|
389
|
+
? inputProps['aria-valuetext']
|
|
390
|
+
: messages.railValue(
|
|
391
|
+
name ?? state.value.getChannelName(channel, locale),
|
|
392
|
+
state.value.getChannelValue(channel),
|
|
393
|
+
)
|
|
338
394
|
const { background, ...trackStyle } = (trackProps.style ?? {}) as CSSProperties
|
|
339
395
|
|
|
340
396
|
return (
|
|
@@ -357,7 +413,7 @@ function Rail({
|
|
|
357
413
|
} as CSSProperties
|
|
358
414
|
}
|
|
359
415
|
>
|
|
360
|
-
<input ref={inputRef} {...inputProps} />
|
|
416
|
+
<input ref={inputRef} {...inputProps} aria-valuetext={valueText} />
|
|
361
417
|
</span>
|
|
362
418
|
</div>
|
|
363
419
|
)
|
|
@@ -19,7 +19,7 @@ import { Skeleton } from '../structure/Skeleton'
|
|
|
19
19
|
import styles from '@polymorph/recipes/controls/combobox.module.css'
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* Filtered single choice (`design/components/combobox.md`).
|
|
23
23
|
*
|
|
24
24
|
* Two libraries each do one job, and the boundary between them defines the design (the focus
|
|
25
25
|
* boundary in `design/components/README-substrates.md`). **React Aria owns the collection**:
|
|
@@ -60,16 +60,22 @@ export interface ComboboxMessages {
|
|
|
60
60
|
clear?: string
|
|
61
61
|
/** The async status while the list loads. Default: `Loading options…`. */
|
|
62
62
|
loadingOptions?: string
|
|
63
|
-
/** The async status naming the result count. Default: `{count} options
|
|
63
|
+
/** The async status naming the result count. Default: `{count} options`, `1 option` for one. */
|
|
64
64
|
options?: (count: number) => string
|
|
65
|
+
/**
|
|
66
|
+
* The list's accessible name, followed by the field's label where `aria-labelledby` names the
|
|
67
|
+
* field. Default: `Suggestions`, which React Aria says in the page's locale.
|
|
68
|
+
*/
|
|
69
|
+
list?: string
|
|
65
70
|
}
|
|
66
71
|
|
|
72
|
+
/** Every default but `list`'s, which is React Aria's word in the page's locale. */
|
|
67
73
|
const MESSAGES = {
|
|
68
74
|
showOptions: 'Show options',
|
|
69
75
|
clear: 'Clear',
|
|
70
76
|
loadingOptions: 'Loading options…',
|
|
71
|
-
options: (count: number) => `${count} options
|
|
72
|
-
} satisfies Required<ComboboxMessages
|
|
77
|
+
options: (count: number) => (count === 1 ? '1 option' : `${count} options`),
|
|
78
|
+
} satisfies Required<Omit<ComboboxMessages, 'list'>>
|
|
73
79
|
|
|
74
80
|
export interface ComboboxProps {
|
|
75
81
|
/** The *current* list. In async use, the app supplies a new list for each query. */
|
|
@@ -367,7 +373,9 @@ export function Combobox({
|
|
|
367
373
|
const popup = (
|
|
368
374
|
<>
|
|
369
375
|
<ComboboxListBox
|
|
370
|
-
options={
|
|
376
|
+
options={
|
|
377
|
+
say.list === undefined ? listBoxProps : { ...listBoxProps, 'aria-label': say.list }
|
|
378
|
+
}
|
|
371
379
|
state={state}
|
|
372
380
|
listBoxRef={listBoxRef}
|
|
373
381
|
onScroll={onLoadMore === undefined ? undefined : handleListScroll}
|
|
@@ -53,6 +53,8 @@ export interface DatePickerMessages extends CalendarMessages {
|
|
|
53
53
|
clear: string
|
|
54
54
|
/** The popup's accessible name. */
|
|
55
55
|
chooseDate: string
|
|
56
|
+
/** What an unfilled segment says as its value. Default: React Aria's `Empty`, in the locale. */
|
|
57
|
+
empty?: string
|
|
56
58
|
}
|
|
57
59
|
|
|
58
60
|
const DEFAULT_MESSAGES: DatePickerMessages = {
|
|
@@ -333,6 +335,7 @@ function DateField({
|
|
|
333
335
|
size={size}
|
|
334
336
|
disabled={disabled}
|
|
335
337
|
styles={segmentStyles}
|
|
338
|
+
empty={messages.empty}
|
|
336
339
|
/>
|
|
337
340
|
|
|
338
341
|
{name === undefined ? null : (
|