@astryxdesign/cli 0.7.17-canary.gffd1fc0 → 0.7.17
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 +1877 -0
- package/README.md +90 -84
- package/api/build/_adapter.d.mts +51 -0
- package/api/build/_adapter.mjs +133 -7
- package/api/build/build.doc.mjs +3 -3
- package/api/build/build.mjs +23 -14
- package/api/build/build.type.d.mts +1 -1
- package/api/build/build.type.mjs +2 -2
- package/api/build/help/help.d.mts +15 -14
- package/api/build/help/help.mjs +65 -6
- package/api/build/kit/kit.mjs +1 -1
- package/api/build/kit/start.mjs +1 -1
- package/api/component/_adapter.d.mts +28 -4
- package/api/component/_adapter.mjs +79 -45
- package/api/component/component.d.mts +1 -1
- package/api/component/component.mjs +18 -7
- package/api/component/detail/showcase/showcase.mjs +19 -8
- package/api/discover/_adapter.d.mts +71 -8
- package/api/discover/_adapter.mjs +320 -69
- package/api/discover/_catalog-view.d.mts +22 -0
- package/api/discover/_catalog-view.mjs +30 -1
- package/api/discover/_icon-set-coverage.d.mts +22 -0
- package/api/discover/_icon-set-coverage.mjs +32 -0
- package/api/discover/detail/detail.d.mts +6 -3
- package/api/discover/detail/detail.mjs +14 -6
- package/api/discover/detail/doc/doc.mjs +1 -1
- package/api/discover/detail/item/item.d.mts +11 -1
- package/api/discover/detail/item/item.mjs +29 -8
- package/api/discover/discover.d.mts +36 -0
- package/api/discover/discover.doc.mjs +1 -1
- package/api/discover/discover.mjs +206 -29
- package/api/discover/discover.type.d.mts +33 -7
- package/api/discover/discover.type.mjs +21 -7
- package/api/discover/search/search.d.mts +22 -0
- package/api/discover/search/search.mjs +293 -70
- package/api/docs/_adapter.d.mts +92 -1
- package/api/docs/_adapter.mjs +264 -14
- package/api/docs/_entry-names.mjs +4 -3
- package/api/docs/docs.d.mts +4 -2
- package/api/docs/docs.doc.mjs +10 -0
- package/api/docs/docs.mjs +25 -5
- package/api/docs/docs.type.d.mts +48 -0
- package/api/docs/docs.type.mjs +26 -0
- package/api/docs/skills/skills.d.mts +51 -0
- package/api/docs/skills/skills.mjs +216 -0
- package/api/doctor/_adapter.d.mts +256 -10
- package/api/doctor/_adapter.mjs +1233 -51
- package/api/doctor/built-checks.d.mts +39 -3
- package/api/doctor/built-checks.mjs +203 -7
- package/api/doctor/doctor.d.mts +222 -10
- package/api/doctor/doctor.doc.mjs +4 -4
- package/api/doctor/doctor.mjs +1005 -43
- package/api/doctor/doctor.type.d.mts +6 -1
- package/api/doctor/doctor.type.mjs +3 -1
- package/api/doctor/theme-checks.d.mts +20 -1
- package/api/doctor/theme-checks.mjs +307 -7
- package/api/error.d.mts +12 -1
- package/api/error.mjs +18 -6
- package/api/icon/_adapter.d.mts +13 -2
- package/api/icon/_adapter.mjs +32 -16
- package/api/icon/_authoring.mjs +21 -7
- package/api/icon/_records.d.mts +3 -1
- package/api/icon/_records.mjs +30 -3
- package/api/icon/add/add.mjs +1 -1
- package/api/icon/definitions/definitions.mjs +19 -8
- package/api/icon/exportIconIndex.doc.mjs +1 -1
- package/api/icon/icon.doc.mjs +4 -4
- package/api/icon/icon.type.d.mts +80 -2
- package/api/icon/icon.type.mjs +40 -5
- package/api/icon/iconMap.doc.mjs +2 -2
- package/api/icon/list/list.mjs +7 -5
- package/api/icon/map/map.mjs +13 -4
- package/api/icon/rankIconIndex.doc.mjs +1 -1
- package/api/icon/search/icon-index.mjs +22 -9
- package/api/icon/search/search.d.mts +47 -3
- package/api/icon/search/search.mjs +306 -9
- package/api/init/_adapter.d.mts +97 -0
- package/api/init/_adapter.mjs +284 -15
- package/api/init/init.d.mts +3 -3
- package/api/init/init.doc.mjs +30 -6
- package/api/init/init.mjs +150 -11
- package/api/init/init.type.d.mts +102 -8
- package/api/init/init.type.mjs +44 -3
- package/api/init/remove/remove.d.mts +7 -4
- package/api/init/remove/remove.mjs +124 -26
- package/api/init/run/run.d.mts +48 -3
- package/api/init/run/run.mjs +444 -37
- package/api/integration/_adapter.d.mts +21 -4
- package/api/integration/_adapter.mjs +52 -6
- package/api/integration/integrationCheck.doc.mjs +1 -1
- package/api/integration/pack-check.d.mts +2 -1
- package/api/integration/pack-check.mjs +10 -18
- package/api/integration/validate-integration.d.mts +6 -3
- package/api/integration/validate-integration.mjs +86 -15
- package/api/integration/validate-integration.type.d.mts +12 -5
- package/api/integration/validate-integration.type.mjs +12 -5
- package/api/integration/validateIntegration.doc.mjs +4 -2
- package/api/render/_adapter.d.mts +6 -2
- package/api/render/_adapter.mjs +301 -51
- package/api/render/render.doc.d.mts +1 -1
- package/api/render/render.doc.mjs +20 -10
- package/api/render/render.mjs +16 -13
- package/api/render/render.type.d.mts +57 -10
- package/api/render/render.type.mjs +26 -13
- package/api/search/ORDERING.md +3 -3
- package/api/search/_adapter.d.mts +31 -0
- package/api/search/_adapter.mjs +107 -15
- package/api/search/_candidate-score.d.mts +12 -4
- package/api/search/_candidate-score.mjs +94 -16
- package/api/search/_cards.json +4 -1
- package/api/search/_entries.d.mts +8 -3
- package/api/search/_entries.mjs +109 -12
- package/api/search/_fit-order.d.mts +8 -4
- package/api/search/_fit-order.mjs +35 -7
- package/api/search/_gather-docs.mjs +85 -15
- package/api/search/_gather-templates.mjs +6 -0
- package/api/search/_icons.d.mts +50 -0
- package/api/search/_icons.mjs +85 -0
- package/api/search/_lexical.d.mts +14 -1
- package/api/search/_lexical.mjs +240 -12
- package/api/search/_main-searcher.mjs +13 -0
- package/api/search/_named-keywords.d.mts +6 -3
- package/api/search/_named-keywords.mjs +70 -19
- package/api/search/_order.d.mts +34 -1
- package/api/search/_order.mjs +156 -13
- package/api/search/_result.d.mts +30 -0
- package/api/search/_result.mjs +38 -0
- package/api/search/_score.d.mts +20 -6
- package/api/search/_score.mjs +96 -16
- package/api/search/_titles.d.mts +14 -0
- package/api/search/_titles.mjs +16 -3
- package/api/search/_words.d.mts +8 -0
- package/api/search/_words.mjs +26 -1
- package/api/search/search-index.mjs +23 -12
- package/api/search/search.d.mts +3 -1
- package/api/search/search.doc.mjs +5 -4
- package/api/search/search.mjs +69 -26
- package/api/search/search.type.d.mts +55 -1
- package/api/search/search.type.mjs +35 -1
- package/api/swizzle/_adapter.d.mts +1 -1
- package/api/swizzle/_adapter.mjs +1 -5
- package/api/swizzle/_moduleGraph.d.mts +0 -6
- package/api/swizzle/_moduleGraph.mjs +0 -12
- package/api/swizzle/copy/copy.mjs +1 -1
- package/api/template/_adapter.d.mts +46 -0
- package/api/template/_adapter.mjs +198 -2
- package/api/template/cdn/cdn.mjs +5 -3
- package/api/template/copy/copy.d.mts +12 -2
- package/api/template/copy/copy.mjs +95 -21
- package/api/template/show/show.d.mts +10 -3
- package/api/template/show/show.mjs +16 -4
- package/api/template/template.doc.mjs +3 -3
- package/api/template/template.mjs +55 -7
- package/api/template/template.type.d.mts +3 -0
- package/api/template/template.type.mjs +5 -2
- package/api/theme/_adapter.d.mts +28 -2
- package/api/theme/_adapter.mjs +675 -17
- package/api/theme/_app-provider.d.mts +42 -0
- package/api/theme/_app-provider.mjs +61 -27
- package/api/theme/_shared-source.d.mts +33 -0
- package/api/theme/_shared-source.mjs +348 -0
- package/api/theme/add/add.d.mts +3 -0
- package/api/theme/add/add.mjs +21 -4
- package/api/theme/build/build.d.mts +61 -30
- package/api/theme/build/build.mjs +552 -489
- package/api/theme/build/core-interception.d.mts +10 -0
- package/api/theme/build/core-interception.mjs +24 -0
- package/api/theme/build/family.mjs +4 -2
- package/api/theme/build/import-specifier.d.mts +14 -0
- package/api/theme/build/import-specifier.mjs +36 -0
- package/api/theme/build/input-fields.d.mts +9 -0
- package/api/theme/build/input-fields.mjs +155 -16
- package/api/theme/build/null-values.d.mts +22 -0
- package/api/theme/build/null-values.mjs +110 -21
- package/api/theme/build/radius-values.d.mts +18 -0
- package/api/theme/build/radius-values.mjs +76 -0
- package/api/theme/build/self-contained.mjs +32 -11
- package/api/theme/build/setting-effects.d.mts +254 -0
- package/api/theme/build/setting-effects.mjs +1065 -0
- package/api/theme/build/style-keys.d.mts +33 -0
- package/api/theme/build/style-keys.mjs +154 -0
- package/api/theme/build/theme-object.d.mts +47 -0
- package/api/theme/build/theme-object.mjs +144 -0
- package/api/theme/build/typography-values.mjs +7 -23
- package/api/theme/build/written-values.d.mts +18 -0
- package/api/theme/build/written-values.mjs +107 -31
- package/api/theme/eject/eject.mjs +6 -1
- package/api/theme/palette/generate/color.d.mts +41 -9
- package/api/theme/palette/generate/color.mjs +108 -39
- package/api/theme/palette/generate/generate.mjs +10 -0
- package/api/theme/palette/generate/generator.d.mts +45 -27
- package/api/theme/palette/generate/generator.mjs +347 -149
- package/api/theme/palette/generate/mapping.d.mts +456 -0
- package/api/theme/palette/generate/mapping.mjs +1903 -0
- package/api/theme/palette/generate/newer-recipe.d.mts +28 -0
- package/api/theme/palette/generate/newer-recipe.mjs +87 -0
- package/api/theme/palette/generate/types.d.mts +270 -0
- package/api/theme/palette/generate/types.mjs +123 -0
- package/api/theme/theme.d.mts +25 -4
- package/api/theme/theme.mjs +55 -5
- package/api/theme/theme.type.d.mts +71 -2
- package/api/theme/theme.type.mjs +37 -5
- package/api/theme/themeAdd.doc.mjs +3 -2
- package/api/theme/themeBuild.doc.mjs +4 -4
- package/api/theme/themeEject.doc.mjs +1 -1
- package/api/theme/themeRemove.doc.mjs +1 -1
- package/api/theme/themeTargets.doc.mjs +1 -1
- package/api/theme-edit/_catalog.d.mts +40 -0
- package/api/theme-edit/_catalog.mjs +101 -23
- package/api/theme-edit/_check.mjs +333 -79
- package/api/theme-edit/_color.d.mts +2 -60
- package/api/theme-edit/_color.mjs +33 -847
- package/api/theme-edit/_compiler.mjs +52 -0
- package/api/theme-edit/_context.d.mts +23 -3
- package/api/theme-edit/_context.mjs +173 -32
- package/api/theme-edit/_css.d.mts +4 -35
- package/api/theme-edit/_css.mjs +10 -91
- package/api/theme-edit/_edit.mjs +667 -87
- package/api/theme-edit/_how-question.d.mts +15 -0
- package/api/theme-edit/_how-question.mjs +2729 -179
- package/api/theme-edit/_how.mjs +62 -3
- package/api/theme-edit/_missed.d.mts +2 -1
- package/api/theme-edit/_missed.mjs +128 -29
- package/api/theme-edit/_normal.d.mts +22 -5
- package/api/theme-edit/_normal.mjs +95 -4
- package/api/theme-edit/_palette.d.mts +34 -74
- package/api/theme-edit/_palette.mjs +261 -1278
- package/api/theme-edit/_part-words.mjs +29 -6
- package/api/theme-edit/_parts.d.mts +16 -2
- package/api/theme-edit/_parts.mjs +161 -41
- package/api/theme-edit/_png.d.mts +24 -0
- package/api/theme-edit/_png.mjs +99 -0
- package/api/theme-edit/_preview-app.d.mts +16 -0
- package/api/theme-edit/_preview-app.mjs +52 -18
- package/api/theme-edit/_preview.d.mts +44 -26
- package/api/theme-edit/_preview.mjs +304 -89
- package/api/theme-edit/_project.d.mts +18 -2
- package/api/theme-edit/_project.mjs +27 -3
- package/api/theme-edit/_settings.d.mts +118 -1
- package/api/theme-edit/_settings.mjs +1336 -76
- package/api/theme-edit/_tables.d.mts +19 -11
- package/api/theme-edit/_tables.mjs +55 -37
- package/api/theme-edit/theme-edit.type.d.mts +20 -2
- package/api/theme-edit/theme-edit.type.mjs +9 -6
- package/api/upgrade/_adapter.d.mts +43 -4
- package/api/upgrade/_adapter.mjs +281 -8
- package/api/upgrade/run/run.mjs +4 -0
- package/api/upgrade/upgrade.mjs +1 -1
- package/api/upgrade/upgrade.type.d.mts +46 -7
- package/api/upgrade/upgrade.type.mjs +24 -9
- package/assets/codemods/registry.mjs +1 -0
- package/assets/codemods/transforms/next/index.mjs +1 -11
- package/assets/codemods/transforms/v0.7.17/index.mjs +28 -0
- package/assets/codemods/transforms/v0.7.17/migrate-item-swipe-actions-to-swipe.mjs +2160 -0
- package/assets/codemods/transforms/v0.7.17/preserve-chat-radius.mjs +515 -0
- package/assets/component-list.generated.json +1 -1
- package/assets/discover/official-packages.json +72 -0
- package/assets/docs/author-a-theme.doc.mjs +7 -4
- package/assets/docs/getting-started.doc.mjs +1 -1
- package/assets/docs/principles.doc.dense.mjs +1 -1
- package/assets/docs/principles.doc.mjs +1 -1
- package/assets/docs/principles.doc.zh.mjs +1 -1
- package/assets/docs/styling-overview.doc.mjs +5 -1
- package/assets/docs/tree/agent-guidance.doc.mjs +34 -3
- package/assets/docs/tree/check-the-props.doc.mjs +1 -1
- package/assets/docs/tree/checks.doc.mjs +2 -2
- package/assets/docs/tree/computer-integrations.doc.mjs +1 -1
- package/assets/docs/tree/doc-syntax.doc.mjs +1 -1
- package/assets/docs/tree/export-pages.doc.mjs +164 -0
- package/assets/docs/tree/fonts-and-assets.doc.mjs +1 -1
- package/assets/docs/tree/host-entry.doc.mjs +4 -0
- package/assets/docs/tree/i18n-library-integration.doc.mjs +7 -3
- package/assets/docs/tree/icon-definitions.doc.mjs +3 -3
- package/assets/docs/tree/icon-sets.doc.mjs +87 -11
- package/assets/docs/tree/layout.doc.mjs +16 -5
- package/assets/docs/tree/problems.doc.mjs +2 -2
- package/assets/docs/tree/responsive.doc.mjs +2 -2
- package/assets/docs/tree/scaffold.doc.mjs +1 -0
- package/assets/docs/tree/share-a-page.doc.mjs +14 -16
- package/assets/docs/tree/short-and-findable.doc.mjs +3 -3
- package/assets/docs/tree/skill-places.doc.mjs +91 -0
- package/assets/docs/tree/styling.doc.mjs +41 -3
- package/assets/docs/tree/template-grading-rubric.doc.mjs +1 -1
- package/assets/docs/tree/test-in-an-app.doc.mjs +1 -1
- package/assets/docs/tree/tokens-and-setup.doc.mjs +2 -4
- package/assets/docs/tree/tokens-color.doc.mjs +2 -2
- package/assets/docs/tree/tokens-radius.doc.mjs +1 -1
- package/assets/docs/tree/tokens.doc.mjs +32 -0
- package/assets/docs/tree/troubleshooting.doc.mjs +8 -0
- package/assets/docs/tree/typography.doc.mjs +31 -2
- package/assets/docs/tree/updates.doc.mjs +1 -1
- package/assets/docs/tree/versioning.doc.mjs +1 -1
- package/assets/docs/use-a-theme.doc.mjs +4 -0
- package/assets/docs/working-with-ai.doc.mjs +44 -9
- package/assets/docs-routes.generated.json +1 -1
- package/assets/docs.generated.json +2 -2
- package/assets/icons/definitions/alert.doc.mjs +9 -0
- package/assets/icons/definitions/alignBottom.doc.mjs +1 -0
- package/assets/icons/definitions/alignCenter.doc.mjs +1 -0
- package/assets/icons/definitions/alignEnd.doc.mjs +1 -0
- package/assets/icons/definitions/alignJustify.doc.mjs +1 -0
- package/assets/icons/definitions/alignMiddle.doc.mjs +1 -0
- package/assets/icons/definitions/alignStart.doc.mjs +1 -0
- package/assets/icons/definitions/alignTop.doc.mjs +1 -0
- package/assets/icons/definitions/arrowDown.doc.mjs +1 -0
- package/assets/icons/definitions/arrowLeft.doc.mjs +1 -0
- package/assets/icons/definitions/arrowRight.doc.mjs +1 -0
- package/assets/icons/definitions/arrowUp.doc.mjs +1 -0
- package/assets/icons/definitions/arrowsUpDown.doc.mjs +1 -0
- package/assets/icons/definitions/bank.doc.mjs +1 -0
- package/assets/icons/definitions/block.doc.mjs +9 -0
- package/assets/icons/definitions/bold.doc.mjs +1 -0
- package/assets/icons/definitions/bookmark.doc.mjs +1 -0
- package/assets/icons/definitions/bookmarkAdd.doc.mjs +1 -0
- package/assets/icons/definitions/cart.doc.mjs +1 -0
- package/assets/icons/definitions/channel.doc.mjs +9 -0
- package/assets/icons/definitions/check.doc.mjs +1 -0
- package/assets/icons/definitions/checkDouble.doc.mjs +1 -0
- package/assets/icons/definitions/checklist.doc.mjs +9 -0
- package/assets/icons/definitions/chevronDown.doc.mjs +1 -0
- package/assets/icons/definitions/chevronLeft.doc.mjs +1 -0
- package/assets/icons/definitions/chevronRight.doc.mjs +1 -0
- package/assets/icons/definitions/chevronUp.doc.mjs +1 -0
- package/assets/icons/definitions/chevronsLeft.doc.mjs +1 -0
- package/assets/icons/definitions/chevronsRight.doc.mjs +1 -0
- package/assets/icons/definitions/clipboard.doc.mjs +1 -0
- package/assets/icons/definitions/cloud.doc.mjs +1 -1
- package/assets/icons/definitions/collapse.doc.mjs +1 -0
- package/assets/icons/definitions/columnSettings.doc.mjs +9 -0
- package/assets/icons/definitions/compose.doc.mjs +1 -0
- package/assets/icons/definitions/conversation.doc.mjs +1 -0
- package/assets/icons/definitions/copy.doc.mjs +1 -0
- package/assets/icons/definitions/copyText.doc.mjs +9 -0
- package/assets/icons/definitions/cornerRadius.doc.mjs +1 -0
- package/assets/icons/definitions/create.doc.mjs +9 -0
- package/assets/icons/definitions/creditCard.doc.mjs +1 -0
- package/assets/icons/definitions/currency.doc.mjs +9 -0
- package/assets/icons/definitions/cut.doc.mjs +1 -0
- package/assets/icons/definitions/desktop.doc.mjs +1 -0
- package/assets/icons/definitions/discount.doc.mjs +1 -0
- package/assets/icons/definitions/document.doc.mjs +1 -0
- package/assets/icons/definitions/documentSearch.doc.mjs +1 -0
- package/assets/icons/definitions/download.doc.mjs +1 -0
- package/assets/icons/definitions/error.doc.mjs +1 -0
- package/assets/icons/definitions/exitFullScreen.doc.mjs +16 -0
- package/assets/icons/definitions/expand.doc.mjs +1 -0
- package/assets/icons/definitions/eye.doc.mjs +1 -0
- package/assets/icons/definitions/eyeSlash.doc.mjs +1 -0
- package/assets/icons/definitions/file.doc.mjs +1 -0
- package/assets/icons/definitions/flipHorizontal.doc.mjs +1 -0
- package/assets/icons/definitions/flipVertical.doc.mjs +1 -0
- package/assets/icons/definitions/folder.doc.mjs +1 -0
- package/assets/icons/definitions/folderAdd.doc.mjs +1 -0
- package/assets/icons/definitions/fullScreen.doc.mjs +16 -0
- package/assets/icons/definitions/globe.doc.mjs +1 -1
- package/assets/icons/definitions/groupRows.doc.mjs +9 -0
- package/assets/icons/definitions/halftone.doc.mjs +9 -0
- package/assets/icons/definitions/help.doc.mjs +9 -0
- package/assets/icons/definitions/house.doc.mjs +9 -0
- package/assets/icons/definitions/info.doc.mjs +1 -0
- package/assets/icons/definitions/italic.doc.mjs +1 -0
- package/assets/icons/definitions/listView.doc.mjs +9 -0
- package/assets/icons/definitions/lock.doc.mjs +1 -0
- package/assets/icons/definitions/lowercase.doc.mjs +1 -0
- package/assets/icons/definitions/mail.doc.mjs +1 -1
- package/assets/icons/definitions/media.doc.mjs +9 -0
- package/assets/icons/definitions/message.doc.mjs +2 -1
- package/assets/icons/definitions/mobile.doc.mjs +1 -0
- package/assets/icons/definitions/money.doc.mjs +1 -0
- package/assets/icons/definitions/moon.doc.mjs +1 -0
- package/assets/icons/definitions/moveToFolder.doc.mjs +9 -0
- package/assets/icons/definitions/notification.doc.mjs +1 -0
- package/assets/icons/definitions/notificationActive.doc.mjs +1 -0
- package/assets/icons/definitions/notificationOff.doc.mjs +1 -0
- package/assets/icons/definitions/paddingHorizontal.doc.mjs +1 -0
- package/assets/icons/definitions/paddingPerSide.doc.mjs +1 -0
- package/assets/icons/definitions/paddingVertical.doc.mjs +1 -0
- package/assets/icons/definitions/panelBottom.doc.mjs +1 -0
- package/assets/icons/definitions/panelLeft.doc.mjs +1 -0
- package/assets/icons/definitions/panelRight.doc.mjs +1 -0
- package/assets/icons/definitions/paste.doc.mjs +9 -0
- package/assets/icons/definitions/pause.doc.mjs +1 -0
- package/assets/icons/definitions/play.doc.mjs +1 -0
- package/assets/icons/definitions/radiusPerCorner.doc.mjs +1 -0
- package/assets/icons/definitions/redo.doc.mjs +1 -0
- package/assets/icons/definitions/review.doc.mjs +9 -0
- package/assets/icons/definitions/rotate.doc.mjs +1 -0
- package/assets/icons/definitions/rotateCounterclockwise.doc.mjs +1 -0
- package/assets/icons/definitions/scale.doc.mjs +1 -2
- package/assets/icons/definitions/schedule.doc.mjs +9 -0
- package/assets/icons/definitions/search.doc.mjs +1 -0
- package/assets/icons/definitions/send.doc.mjs +1 -0
- package/assets/icons/definitions/shoppingBag.doc.mjs +1 -0
- package/assets/icons/definitions/signal.doc.mjs +9 -0
- package/assets/icons/definitions/stop.doc.mjs +1 -0
- package/assets/icons/definitions/strikethrough.doc.mjs +1 -0
- package/assets/icons/definitions/success.doc.mjs +1 -0
- package/assets/icons/definitions/sun.doc.mjs +1 -0
- package/assets/icons/definitions/tablet.doc.mjs +1 -0
- package/assets/icons/definitions/team.doc.mjs +9 -0
- package/assets/icons/definitions/textCase.doc.mjs +2 -1
- package/assets/icons/definitions/textRegular.doc.mjs +1 -0
- package/assets/icons/definitions/thumbsDown.doc.mjs +1 -0
- package/assets/icons/definitions/thumbsUp.doc.mjs +1 -0
- package/assets/icons/definitions/transfer.doc.mjs +1 -0
- package/assets/icons/definitions/trendDown.doc.mjs +1 -0
- package/assets/icons/definitions/trendUp.doc.mjs +1 -0
- package/assets/icons/definitions/underline.doc.mjs +1 -0
- package/assets/icons/definitions/undo.doc.mjs +1 -0
- package/assets/icons/definitions/unlock.doc.mjs +1 -0
- package/assets/icons/definitions/upload.doc.mjs +1 -0
- package/assets/icons/definitions/uppercase.doc.mjs +1 -0
- package/assets/icons/definitions/user.doc.mjs +1 -0
- package/assets/icons/definitions/userAdd.doc.mjs +1 -0
- package/assets/icons/definitions/userCircle.doc.mjs +1 -0
- package/assets/icons/definitions/userRemove.doc.mjs +1 -0
- package/assets/icons/definitions/users.doc.mjs +1 -0
- package/assets/icons/definitions/verified.doc.mjs +9 -0
- package/assets/icons/definitions/wallet.doc.mjs +1 -0
- package/assets/icons/definitions/warning.doc.mjs +1 -0
- package/assets/icons/definitions/wrench.doc.mjs +1 -1
- package/assets/icons/installed-icon-set.doc.mjs +30 -0
- package/assets/icons/template-icons.json +661 -0
- package/assets/search-catalog.generated.json +2 -2
- package/assets/self-audit.generated.json +1 -1
- package/assets/templates/blocks/components/AppShell/AppShellShowcase.doc.mjs +0 -7
- package/assets/templates/blocks/components/AppShell/AppShellShowcase.tsx +8 -10
- package/assets/templates/blocks/components/AppShell/AppShellSideNavOnly.doc.mjs +0 -8
- package/assets/templates/blocks/components/AppShell/AppShellSideNavOnly.tsx +10 -8
- package/assets/templates/blocks/components/AppShell/AppShellTopNavOnly.doc.mjs +0 -1
- package/assets/templates/blocks/components/AppShell/AppShellTopNavOnly.tsx +4 -2
- package/assets/templates/blocks/components/AppShell/AppShellTopNavWithSideNav.doc.mjs +0 -8
- package/assets/templates/blocks/components/AppShell/AppShellTopNavWithSideNav.tsx +10 -8
- package/assets/templates/blocks/components/AppShell/AppShellWithBanner.doc.mjs +0 -8
- package/assets/templates/blocks/components/AppShell/AppShellWithBanner.tsx +10 -8
- package/assets/templates/blocks/components/AspectRatio/AspectRatioImageGallery.tsx +1 -1
- package/assets/templates/blocks/components/AspectRatio/AspectRatioWidescreen.tsx +1 -1
- package/assets/templates/blocks/components/AspectRatio/AspectRatioWithSkeleton.tsx +1 -1
- package/assets/templates/blocks/components/Avatar/AvatarInteractive.tsx +6 -1
- package/assets/templates/blocks/components/Avatar/AvatarShowcase.tsx +1 -1
- package/assets/templates/blocks/components/Avatar/AvatarTooltip.tsx +1 -1
- package/assets/templates/blocks/components/Avatar/AvatarWithStatus.tsx +1 -1
- package/assets/templates/blocks/components/AvatarStatusDot/AvatarStatusDotShowcase.tsx +1 -1
- package/assets/templates/blocks/components/AvatarStatusDot/AvatarStatusDotVariants.tsx +1 -1
- package/assets/templates/blocks/components/Badge/BadgeShowcase.tsx +2 -2
- package/assets/templates/blocks/components/Banner/BannerCollapsibleContent.tsx +14 -1
- package/assets/templates/blocks/components/Banner/BannerSectionVariant.tsx +10 -1
- package/assets/templates/blocks/components/Banner/BannerWithActionButton.tsx +25 -3
- package/assets/templates/blocks/components/BaseTypeahead/BaseTypeaheadCustomSearch.doc.mjs +0 -1
- package/assets/templates/blocks/components/BaseTypeahead/BaseTypeaheadCustomSearch.tsx +2 -2
- package/assets/templates/blocks/components/BaseTypeahead/BaseTypeaheadMenu.doc.mjs +0 -1
- package/assets/templates/blocks/components/BaseTypeahead/BaseTypeaheadMenu.tsx +1 -1
- package/assets/templates/blocks/components/BottomSheet/BottomSheetSnapPoints.doc.mjs +0 -8
- package/assets/templates/blocks/components/BottomSheet/BottomSheetSnapPoints.tsx +5 -5
- package/assets/templates/blocks/components/BreadcrumbItem/BreadcrumbItemShowcase.doc.mjs +0 -1
- package/assets/templates/blocks/components/BreadcrumbItem/BreadcrumbItemShowcase.tsx +1 -1
- package/assets/templates/blocks/components/Breadcrumbs/BreadcrumbsDeepHierarchy.doc.mjs +0 -1
- package/assets/templates/blocks/components/Breadcrumbs/BreadcrumbsDeepHierarchy.tsx +1 -1
- package/assets/templates/blocks/components/Breadcrumbs/BreadcrumbsWithIcons.doc.mjs +0 -1
- package/assets/templates/blocks/components/Breadcrumbs/BreadcrumbsWithIcons.tsx +2 -2
- package/assets/templates/blocks/components/Button/ButtonFloating.doc.mjs +0 -1
- package/assets/templates/blocks/components/Button/ButtonFloating.tsx +25 -2
- package/assets/templates/blocks/components/Button/ButtonShowcase.tsx +42 -4
- package/assets/templates/blocks/components/Button/ButtonSizeVariants.tsx +24 -2
- package/assets/templates/blocks/components/Button/ButtonVariants.tsx +28 -1
- package/assets/templates/blocks/components/Button/ButtonWithEndSlot.tsx +9 -0
- package/assets/templates/blocks/components/Button/ButtonWithIcon.doc.mjs +0 -6
- package/assets/templates/blocks/components/Button/ButtonWithIcon.tsx +35 -9
- package/assets/templates/blocks/components/ButtonGroup/ButtonGroupBasic.tsx +20 -3
- package/assets/templates/blocks/components/ButtonGroup/ButtonGroupFloating.tsx +16 -3
- package/assets/templates/blocks/components/ButtonGroup/ButtonGroupShowcase.doc.mjs +0 -6
- package/assets/templates/blocks/components/ButtonGroup/ButtonGroupShowcase.tsx +37 -8
- package/assets/templates/blocks/components/Center/CenterHorizontal.doc.mjs +0 -8
- package/assets/templates/blocks/components/Center/CenterHorizontal.tsx +23 -5
- package/assets/templates/blocks/components/Center/CenterInsideACard.doc.mjs +0 -1
- package/assets/templates/blocks/components/Center/CenterInsideACard.tsx +1 -1
- package/assets/templates/blocks/components/ChatComposer/ChatComposerFlat.doc.mjs +0 -5
- package/assets/templates/blocks/components/ChatComposer/ChatComposerFlat.tsx +8 -3
- package/assets/templates/blocks/components/ChatComposer/ChatComposerFooterActions.doc.mjs +0 -5
- package/assets/templates/blocks/components/ChatComposer/ChatComposerFooterActions.tsx +8 -3
- package/assets/templates/blocks/components/ChatComposer/ChatComposerFullFeatured.doc.mjs +0 -7
- package/assets/templates/blocks/components/ChatComposer/ChatComposerFullFeatured.tsx +10 -7
- package/assets/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerShowcase.doc.mjs +0 -1
- package/assets/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerShowcase.tsx +2 -2
- package/assets/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerWithProgress.doc.mjs +0 -1
- package/assets/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerWithProgress.tsx +3 -3
- package/assets/templates/blocks/components/ChatMessageMetadata/ChatMessageMetadataFooter.doc.mjs +0 -6
- package/assets/templates/blocks/components/ChatMessageMetadata/ChatMessageMetadataFooter.tsx +9 -9
- package/assets/templates/blocks/components/ChatMessageMetadata/ChatMessageMetadataShowcase.doc.mjs +0 -6
- package/assets/templates/blocks/components/ChatMessageMetadata/ChatMessageMetadataShowcase.tsx +10 -10
- package/assets/templates/blocks/components/ChatSendButton/ChatSendButtonCustomIcon.doc.mjs +0 -6
- package/assets/templates/blocks/components/ChatSendButton/ChatSendButtonCustomIcon.tsx +8 -5
- package/assets/templates/blocks/components/ChatSendButton/ChatSendButtonShowcase.doc.mjs +0 -1
- package/assets/templates/blocks/components/ChatSendButton/ChatSendButtonShowcase.tsx +1 -1
- package/assets/templates/blocks/components/ChatSystemMessage/ChatSystemMessageStatusUpdates.doc.mjs +0 -5
- package/assets/templates/blocks/components/ChatSystemMessage/ChatSystemMessageStatusUpdates.tsx +7 -7
- package/assets/templates/blocks/components/ChatSystemMessage/ChatSystemMessageWithIcon.doc.mjs +0 -6
- package/assets/templates/blocks/components/ChatSystemMessage/ChatSystemMessageWithIcon.tsx +7 -7
- package/assets/templates/blocks/components/CodeBlock/CodeBlockTerminal.tsx +1 -1
- package/assets/templates/blocks/components/ContextMenu/ContextMenuBottomSheet.doc.mjs +0 -6
- package/assets/templates/blocks/components/ContextMenu/ContextMenuBottomSheet.tsx +7 -7
- package/assets/templates/blocks/components/DropdownMenu/DropdownMenuBottomSheet.doc.mjs +0 -6
- package/assets/templates/blocks/components/DropdownMenu/DropdownMenuBottomSheet.tsx +7 -7
- package/assets/templates/blocks/components/DropdownMenu/DropdownMenuNoChevron.doc.mjs +0 -1
- package/assets/templates/blocks/components/DropdownMenu/DropdownMenuNoChevron.tsx +2 -2
- package/assets/templates/blocks/components/EmptyState/EmptyStateActions.doc.mjs +0 -1
- package/assets/templates/blocks/components/EmptyState/EmptyStateActions.tsx +2 -2
- package/assets/templates/blocks/components/EmptyState/EmptyStateCompact.doc.mjs +0 -1
- package/assets/templates/blocks/components/EmptyState/EmptyStateCompact.tsx +1 -1
- package/assets/templates/blocks/components/EmptyState/EmptyStateContainer.doc.mjs +0 -1
- package/assets/templates/blocks/components/EmptyState/EmptyStateContainer.tsx +2 -2
- package/assets/templates/blocks/components/EmptyState/EmptyStateShowcase.doc.mjs +0 -1
- package/assets/templates/blocks/components/EmptyState/EmptyStateShowcase.tsx +2 -2
- package/assets/templates/blocks/components/Grid/GridShowcase.tsx +1 -1
- package/assets/templates/blocks/components/GridSpan/GridSpanColumns.tsx +1 -1
- package/assets/templates/blocks/components/GridSpan/GridSpanShowcase.tsx +1 -1
- package/assets/templates/blocks/components/Heading/HeadingTruncation.tsx +3 -2
- package/assets/templates/blocks/components/Hooks/useClipboardHookUsage.tsx +1 -1
- package/assets/templates/blocks/components/Hooks/useContainerRevealHookUsage.doc.mjs +0 -1
- package/assets/templates/blocks/components/Hooks/useContainerRevealHookUsage.tsx +38 -19
- package/assets/templates/blocks/components/Hooks/useGridFocusHookUsage.tsx +6 -6
- package/assets/templates/blocks/components/Hooks/useHotkeysHookUsage.tsx +1 -1
- package/assets/templates/blocks/components/Hooks/useInputContainerHookUsage.doc.mjs +0 -1
- package/assets/templates/blocks/components/Hooks/useInputContainerHookUsage.tsx +2 -2
- package/assets/templates/blocks/components/Hooks/useKeyboardHintHookUsage.doc.mjs +0 -1
- package/assets/templates/blocks/components/Hooks/useKeyboardHintHookUsage.tsx +2 -2
- package/assets/templates/blocks/components/Hooks/useListFocusHookUsage.tsx +8 -1
- package/assets/templates/blocks/components/Hooks/useOverflowHookUsage.tsx +17 -6
- package/assets/templates/blocks/components/Hooks/useStreamingTextHookUsage.tsx +1 -1
- package/assets/templates/blocks/components/Hooks/useTreeFocusHookUsage.doc.mjs +0 -1
- package/assets/templates/blocks/components/Hooks/useTreeFocusHookUsage.tsx +1 -1
- package/assets/templates/blocks/components/HoverCard/HoverCardInteractiveContent.doc.mjs +0 -1
- package/assets/templates/blocks/components/HoverCard/HoverCardInteractiveContent.tsx +1 -1
- package/assets/templates/blocks/components/HoverCard/HoverCardProfileHoverCard.doc.mjs +0 -1
- package/assets/templates/blocks/components/HoverCard/HoverCardProfileHoverCard.tsx +1 -1
- package/assets/templates/blocks/components/Icon/useIconHookUsage.doc.mjs +0 -5
- package/assets/templates/blocks/components/Icon/useIconHookUsage.tsx +7 -7
- package/assets/templates/blocks/components/IconButton/IconButtonActionBar.tsx +11 -0
- package/assets/templates/blocks/components/IconButton/IconButtonFloating.doc.mjs +0 -1
- package/assets/templates/blocks/components/IconButton/IconButtonFloating.tsx +25 -2
- package/assets/templates/blocks/components/IconButton/IconButtonShowcase.tsx +3 -0
- package/assets/templates/blocks/components/IconButton/IconButtonTooltipIconButton.tsx +5 -0
- package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider02Overrides.doc.mjs +3 -3
- package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider02Overrides.tsx +36 -13
- package/assets/templates/blocks/components/Item/ItemDocumentTabs.doc.mjs +0 -1
- package/assets/templates/blocks/components/Item/ItemDocumentTabs.tsx +4 -4
- package/assets/templates/blocks/components/Item/ItemShowcase.doc.mjs +0 -1
- package/assets/templates/blocks/components/Item/ItemShowcase.tsx +7 -3
- package/assets/templates/blocks/components/Layout/LayoutBasicCardLayout.tsx +14 -2
- package/assets/templates/blocks/components/Layout/LayoutContentWidth.tsx +14 -2
- package/assets/templates/blocks/components/Layout/LayoutFullBleedContent.tsx +8 -1
- package/assets/templates/blocks/components/Layout/LayoutShowcase.tsx +8 -1
- package/assets/templates/blocks/components/Layout/LayoutSidebarLayout.tsx +14 -2
- package/assets/templates/blocks/components/LinkProvider/LinkProviderCustomLink.tsx +3 -1
- package/assets/templates/blocks/components/Markdown/MarkdownShowcase.tsx +1 -1
- package/assets/templates/blocks/components/MediaTheme/MediaThemeImageOverlay.tsx +18 -4
- package/assets/templates/blocks/components/MediaTheme/MediaThemeLightScrim.tsx +11 -3
- package/assets/templates/blocks/components/MediaTheme/MediaThemeShowcase.tsx +27 -5
- package/assets/templates/blocks/components/MobileNav/MobileNavBasicMobileNav.doc.mjs +0 -7
- package/assets/templates/blocks/components/MobileNav/MobileNavBasicMobileNav.tsx +5 -9
- package/assets/templates/blocks/components/MobileNav/MobileNavEndSideMobileNav.doc.mjs +0 -1
- package/assets/templates/blocks/components/MobileNav/MobileNavEndSideMobileNav.tsx +2 -2
- package/assets/templates/blocks/components/MobileNav/MobileNavWithoutTitleMobileNav.doc.mjs +0 -1
- package/assets/templates/blocks/components/MobileNav/MobileNavWithoutTitleMobileNav.tsx +1 -1
- package/assets/templates/blocks/components/MoreMenu/MoreMenuBottomSheet.doc.mjs +0 -6
- package/assets/templates/blocks/components/MoreMenu/MoreMenuBottomSheet.tsx +15 -15
- package/assets/templates/blocks/components/MoreMenu/MoreMenuWithDividers.doc.mjs +0 -5
- package/assets/templates/blocks/components/MoreMenu/MoreMenuWithDividers.tsx +4 -8
- package/assets/templates/blocks/components/MoreMenu/MoreMenuWithSections.doc.mjs +0 -5
- package/assets/templates/blocks/components/MoreMenu/MoreMenuWithSections.tsx +4 -8
- package/assets/templates/blocks/components/MultiSelector/useMultiComboboxHookUsage.doc.mjs +0 -1
- package/assets/templates/blocks/components/MultiSelector/useMultiComboboxHookUsage.tsx +1 -1
- package/assets/templates/blocks/components/OverflowList/OverflowListCappedToolbar.tsx +38 -2
- package/assets/templates/blocks/components/OverflowList/OverflowListCollapseFromStartList.tsx +17 -5
- package/assets/templates/blocks/components/OverflowList/OverflowListOverflowDropdownActions.tsx +46 -7
- package/assets/templates/blocks/components/OverflowList/OverflowListShowcase.tsx +45 -5
- package/assets/templates/blocks/components/Overlay/OverlayHoverReveal.tsx +14 -1
- package/assets/templates/blocks/components/Overlay/OverlayShowcase.tsx +10 -1
- package/assets/templates/blocks/components/Overlay/useOverlayHookUsage.tsx +12 -1
- package/assets/templates/blocks/components/Pagination/PaginationDotsCarousel.doc.mjs +0 -1
- package/assets/templates/blocks/components/Pagination/PaginationDotsCarousel.tsx +1 -1
- package/assets/templates/blocks/components/Popover/PopoverBottomSheetAlternative.doc.mjs +0 -1
- package/assets/templates/blocks/components/Popover/PopoverBottomSheetAlternative.tsx +1 -1
- package/assets/templates/blocks/components/Resizable/ResizableShowcase.tsx +12 -2
- package/assets/templates/blocks/components/Resizable/ResizableSidebar.tsx +1 -1
- package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaInlineRail.tsx +1 -1
- package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaOverscrollChaining.tsx +1 -1
- package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaShowcase.tsx +1 -1
- package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaStickyGroupHeaders.tsx +1 -1
- package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaStickyPassthrough.tsx +1 -1
- package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaTwoAxisBoard.tsx +1 -1
- package/assets/templates/blocks/components/Section/SectionWashHighlight.doc.mjs +0 -1
- package/assets/templates/blocks/components/Section/SectionWashHighlight.tsx +10 -2
- package/assets/templates/blocks/components/Selector/SelectorOptionDescriptions.doc.mjs +0 -1
- package/assets/templates/blocks/components/Selector/SelectorOptionDescriptions.tsx +3 -3
- package/assets/templates/blocks/components/SelectorOption/SelectorOptionShowcase.doc.mjs +0 -1
- package/assets/templates/blocks/components/SelectorOption/SelectorOptionShowcase.tsx +1 -1
- package/assets/templates/blocks/components/Stack/StackAlignment.tsx +50 -6
- package/assets/templates/blocks/components/Stack/StackDirections.tsx +1 -1
- package/assets/templates/blocks/components/Stack/StackFillItem.tsx +10 -1
- package/assets/templates/blocks/components/Step/StepContent.tsx +13 -4
- package/assets/templates/blocks/components/Step/StepIndicator.tsx +3 -2
- package/assets/templates/blocks/components/Step/StepShowcase.tsx +1 -1
- package/assets/templates/blocks/components/Step/StepStates.tsx +3 -2
- package/assets/templates/blocks/components/Stepper/StepperCustomContent.tsx +18 -14
- package/assets/templates/blocks/components/Stepper/StepperOnTrackHorizontal.tsx +1 -1
- package/assets/templates/blocks/components/Table/TableInCard.tsx +1 -1
- package/assets/templates/blocks/components/Table/TableShowcase.tsx +1 -1
- package/assets/templates/blocks/components/TextArea/TextAreaWithIcon.doc.mjs +0 -1
- package/assets/templates/blocks/components/TextArea/TextAreaWithIcon.tsx +2 -2
- package/assets/templates/blocks/components/TextInput/TextInputIcon.doc.mjs +0 -1
- package/assets/templates/blocks/components/TextInput/TextInputIcon.tsx +3 -7
- package/assets/templates/blocks/components/TextInput/TextInputSearch.doc.mjs +0 -1
- package/assets/templates/blocks/components/TextInput/TextInputSearch.tsx +3 -3
- package/assets/templates/blocks/components/Theme/ThemeApply.tsx +8 -1
- package/assets/templates/blocks/components/Theme/ThemeNested.tsx +11 -1
- package/assets/templates/blocks/components/Theme/ThemeShowcase.tsx +26 -3
- package/assets/templates/blocks/components/Theme/ThemeSwitcher.tsx +8 -1
- package/assets/templates/blocks/components/ToggleButton/ToggleButtonColor.doc.mjs +0 -11
- package/assets/templates/blocks/components/ToggleButton/ToggleButtonColor.tsx +5 -5
- package/assets/templates/blocks/components/ToggleButton/ToggleButtonGroup.doc.mjs +0 -9
- package/assets/templates/blocks/components/ToggleButton/ToggleButtonGroup.tsx +5 -9
- package/assets/templates/blocks/components/ToggleButton/ToggleButtonIconSwap.doc.mjs +0 -6
- package/assets/templates/blocks/components/ToggleButton/ToggleButtonIconSwap.tsx +6 -6
- package/assets/templates/blocks/components/ToggleButton/ToggleButtonLabel.doc.mjs +0 -6
- package/assets/templates/blocks/components/ToggleButton/ToggleButtonLabel.tsx +3 -3
- package/assets/templates/blocks/components/ToggleButton/ToggleButtonShowcase.doc.mjs +0 -6
- package/assets/templates/blocks/components/ToggleButton/ToggleButtonShowcase.tsx +6 -6
- package/assets/templates/blocks/components/ToggleButton/ToggleButtonStates.doc.mjs +0 -1
- package/assets/templates/blocks/components/ToggleButton/ToggleButtonStates.tsx +2 -2
- package/assets/templates/blocks/components/Token/TokenIcon.doc.mjs +0 -6
- package/assets/templates/blocks/components/Token/TokenIcon.tsx +3 -3
- package/assets/templates/blocks/components/Token/TokenShowcase.doc.mjs +0 -1
- package/assets/templates/blocks/components/Token/TokenShowcase.tsx +1 -1
- package/assets/templates/blocks/components/Tokenizer/TokenizerEndContent.tsx +14 -1
- package/assets/templates/blocks/components/Tokenizer/TokenizerIcon.doc.mjs +0 -1
- package/assets/templates/blocks/components/Tokenizer/TokenizerIcon.tsx +2 -2
- package/assets/templates/blocks/components/Toolbar/ToolbarBulkActions.doc.mjs +0 -1
- package/assets/templates/blocks/components/Toolbar/ToolbarBulkActions.tsx +36 -3
- package/assets/templates/blocks/components/Toolbar/ToolbarCardHeader.doc.mjs +0 -1
- package/assets/templates/blocks/components/Toolbar/ToolbarCardHeader.tsx +4 -3
- package/assets/templates/blocks/components/Toolbar/ToolbarSizes.doc.mjs +0 -1
- package/assets/templates/blocks/components/Toolbar/ToolbarSizes.tsx +3 -3
- package/assets/templates/blocks/components/Toolbar/ToolbarTableFilter.doc.mjs +0 -1
- package/assets/templates/blocks/components/Toolbar/ToolbarTableFilter.tsx +8 -3
- package/assets/templates/blocks/components/Toolbar/ToolbarThreeSlot.doc.mjs +0 -1
- package/assets/templates/blocks/components/Toolbar/ToolbarThreeSlot.tsx +6 -2
- package/assets/templates/blocks/components/Toolbar/ToolbarWithTabs.doc.mjs +0 -1
- package/assets/templates/blocks/components/Toolbar/ToolbarWithTabs.tsx +11 -2
- package/assets/templates/blocks/components/Tooltip/TooltipActionBarTooltips.tsx +33 -3
- package/assets/templates/blocks/components/TopNav/TopNavCenteredNavigation.doc.mjs +0 -1
- package/assets/templates/blocks/components/TopNav/TopNavCenteredNavigation.tsx +2 -2
- package/assets/templates/blocks/components/TopNav/TopNavEnterpriseDashboard.doc.mjs +0 -6
- package/assets/templates/blocks/components/TopNav/TopNavEnterpriseDashboard.tsx +7 -7
- package/assets/templates/blocks/components/TopNav/TopNavHoverMenu.doc.mjs +0 -8
- package/assets/templates/blocks/components/TopNav/TopNavHoverMenu.tsx +14 -9
- package/assets/templates/blocks/components/TopNav/TopNavMegaMenu.doc.mjs +0 -8
- package/assets/templates/blocks/components/TopNav/TopNavMegaMenu.tsx +11 -11
- package/assets/templates/blocks/components/TopNav/TopNavMultipleDropdowns.doc.mjs +0 -5
- package/assets/templates/blocks/components/TopNav/TopNavMultipleDropdowns.tsx +4 -8
- package/assets/templates/blocks/components/TopNav/TopNavShowcase.doc.mjs +0 -5
- package/assets/templates/blocks/components/TopNav/TopNavShowcase.tsx +8 -4
- package/assets/templates/blocks/components/TopNav/TopNavWithLogo.doc.mjs +0 -1
- package/assets/templates/blocks/components/TopNav/TopNavWithLogo.tsx +7 -2
- package/assets/templates/blocks/components/TopNavItem/TopNavItemShowcase.tsx +1 -1
- package/assets/templates/blocks/components/TopNavMegaMenu/TopNavMegaMenuBasic.doc.mjs +0 -1
- package/assets/templates/blocks/components/TopNavMegaMenu/TopNavMegaMenuBasic.tsx +4 -4
- package/assets/templates/blocks/components/TopNavMegaMenu/TopNavMegaMenuShowcase.doc.mjs +0 -7
- package/assets/templates/blocks/components/TopNavMegaMenu/TopNavMegaMenuShowcase.tsx +12 -12
- package/assets/templates/blocks/components/TopNavMegaMenuItem/TopNavMegaMenuItemBasic.doc.mjs +0 -1
- package/assets/templates/blocks/components/TopNavMegaMenuItem/TopNavMegaMenuItemBasic.tsx +2 -2
- package/assets/templates/blocks/components/TopNavMenu/TopNavMenuBasic.doc.mjs +0 -1
- package/assets/templates/blocks/components/TopNavMenu/TopNavMenuBasic.tsx +4 -4
- package/assets/templates/blocks/components/TopNavMenu/TopNavMenuShowcase.doc.mjs +0 -6
- package/assets/templates/blocks/components/TopNavMenu/TopNavMenuShowcase.tsx +11 -8
- package/assets/templates/blocks/components/TreeList/TreeListFileTreeWithIcons.doc.mjs +0 -1
- package/assets/templates/blocks/components/TreeList/TreeListFileTreeWithIcons.tsx +4 -4
- package/assets/templates/blocks/components/TreeList/TreeListInteractiveSettings.doc.mjs +0 -1
- package/assets/templates/blocks/components/TreeList/TreeListInteractiveSettings.tsx +6 -3
- package/assets/templates/blocks/components/Typeahead/TypeaheadSearchField.doc.mjs +0 -1
- package/assets/templates/blocks/components/Typeahead/TypeaheadSearchField.tsx +2 -2
- package/assets/templates/blocks/components/VisuallyHidden/VisuallyHiddenShowcase.doc.mjs +0 -6
- package/assets/templates/blocks/components/VisuallyHidden/VisuallyHiddenShowcase.tsx +30 -7
- package/assets/templates/blocks/components/VisuallyHidden/VisuallyHiddenSupplementaryContext.doc.mjs +0 -1
- package/assets/templates/blocks/components/VisuallyHidden/VisuallyHiddenSupplementaryContext.tsx +4 -1
- package/assets/templates/components.generated.json +1 -1
- package/assets/templates/pages/ai-chat/page.tsx +19 -15
- package/assets/templates/pages/ai-chat/template.doc.mjs +0 -9
- package/assets/templates/pages/ai-chat-landing/page.tsx +16 -16
- package/assets/templates/pages/ai-chat-landing/template.doc.mjs +0 -11
- package/assets/templates/pages/blank/page.tsx +4 -2
- package/assets/templates/pages/canvas-editor/page.tsx +200 -110
- package/assets/templates/pages/canvas-editor/template.doc.mjs +0 -46
- package/assets/templates/pages/centered-hero/page.tsx +2 -2
- package/assets/templates/pages/centered-hero/template.doc.mjs +0 -1
- package/assets/templates/pages/checkout-wizard/page.tsx +31 -18
- package/assets/templates/pages/checkout-wizard/template.doc.mjs +0 -7
- package/assets/templates/pages/classic-gallery/page.tsx +1 -1
- package/assets/templates/pages/contact-form/page.tsx +15 -10
- package/assets/templates/pages/contact-form/template.doc.mjs +0 -5
- package/assets/templates/pages/course-detail/page.tsx +10 -10
- package/assets/templates/pages/course-detail/template.doc.mjs +0 -11
- package/assets/templates/pages/dashboard/page.tsx +37 -19
- package/assets/templates/pages/dashboard/template.doc.mjs +0 -6
- package/assets/templates/pages/dashboard-alert-rail/page.tsx +16 -14
- package/assets/templates/pages/dashboard-alert-rail/template.doc.mjs +0 -8
- package/assets/templates/pages/dashboard-cohort-funnel/page.tsx +14 -16
- package/assets/templates/pages/dashboard-cohort-funnel/template.doc.mjs +0 -7
- package/assets/templates/pages/dashboard-comparison/page.tsx +17 -12
- package/assets/templates/pages/dashboard-comparison/template.doc.mjs +0 -8
- package/assets/templates/pages/dashboard-composition/page.tsx +40 -23
- package/assets/templates/pages/dashboard-composition/template.doc.mjs +0 -1
- package/assets/templates/pages/dashboard-progress/page.tsx +105 -109
- package/assets/templates/pages/dashboard-progress/template.doc.mjs +0 -7
- package/assets/templates/pages/dashboard-scorecard/page.tsx +74 -37
- package/assets/templates/pages/dashboard-scorecard/template.doc.mjs +0 -7
- package/assets/templates/pages/detail-page/page.tsx +28 -11
- package/assets/templates/pages/detail-page/template.doc.mjs +0 -10
- package/assets/templates/pages/documentation/page.tsx +11 -4
- package/assets/templates/pages/documentation-design/page.tsx +39 -12
- package/assets/templates/pages/documentation-design/template.doc.mjs +0 -5
- package/assets/templates/pages/documentation-technical/page.tsx +8 -6
- package/assets/templates/pages/documentation-technical/template.doc.mjs +0 -5
- package/assets/templates/pages/editor/page.tsx +70 -48
- package/assets/templates/pages/editor/template.doc.mjs +0 -26
- package/assets/templates/pages/file-explorer/page.tsx +19 -19
- package/assets/templates/pages/file-explorer/template.doc.mjs +0 -15
- package/assets/templates/pages/form-two-column/page.tsx +1 -1
- package/assets/templates/pages/form-wizard/page.tsx +12 -5
- package/assets/templates/pages/form-wizard-dialog/page.tsx +6 -2
- package/assets/templates/pages/form-wizard-inline/page.tsx +16 -12
- package/assets/templates/pages/form-wizard-inline/template.doc.mjs +0 -6
- package/assets/templates/pages/form-wizard-vertical/page.tsx +21 -24
- package/assets/templates/pages/form-wizard-vertical/template.doc.mjs +0 -13
- package/assets/templates/pages/gallery-hero/page.tsx +2 -2
- package/assets/templates/pages/gallery-hero/template.doc.mjs +0 -1
- package/assets/templates/pages/ide/page.tsx +12 -7
- package/assets/templates/pages/ide/template.doc.mjs +0 -5
- package/assets/templates/pages/incident-console/page.tsx +4 -4
- package/assets/templates/pages/incident-console/template.doc.mjs +0 -1
- package/assets/templates/pages/kanban-board/page.tsx +128 -47
- package/assets/templates/pages/kanban-board/template.doc.mjs +0 -11
- package/assets/templates/pages/library/page.tsx +34 -64
- package/assets/templates/pages/library/template.doc.mjs +0 -1
- package/assets/templates/pages/login/page.tsx +6 -4
- package/assets/templates/pages/login/template.doc.mjs +0 -1
- package/assets/templates/pages/login-card/page.tsx +6 -4
- package/assets/templates/pages/login-card/template.doc.mjs +0 -1
- package/assets/templates/pages/login-split/page.tsx +6 -5
- package/assets/templates/pages/login-split/template.doc.mjs +0 -1
- package/assets/templates/pages/login-sso/page.tsx +6 -6
- package/assets/templates/pages/login-sso/template.doc.mjs +0 -1
- package/assets/templates/pages/messaging-shell/page.tsx +14 -14
- package/assets/templates/pages/messaging-shell/template.doc.mjs +0 -9
- package/assets/templates/pages/mixed-gallery/page.tsx +1 -1
- package/assets/templates/pages/payment-form/page.tsx +50 -29
- package/assets/templates/pages/payment-form/template.doc.mjs +0 -6
- package/assets/templates/pages/product-detail/page.tsx +21 -9
- package/assets/templates/pages/product-detail/template.doc.mjs +0 -1
- package/assets/templates/pages/product-gallery/page.tsx +3 -3
- package/assets/templates/pages/product-gallery/template.doc.mjs +0 -1
- package/assets/templates/pages/settings/page.tsx +35 -14
- package/assets/templates/pages/settings/template.doc.mjs +0 -1
- package/assets/templates/pages/settings-dialog/page.tsx +96 -93
- package/assets/templates/pages/settings-dialog/template.doc.mjs +0 -53
- package/assets/templates/pages/settings-sidebar/page.tsx +74 -36
- package/assets/templates/pages/settings-sidebar/template.doc.mjs +0 -16
- package/assets/templates/pages/shell-nav/page.tsx +32 -20
- package/assets/templates/pages/shell-nav/template.doc.mjs +0 -6
- package/assets/templates/pages/shell-side-nav/page.tsx +23 -22
- package/assets/templates/pages/shell-side-nav/template.doc.mjs +0 -11
- package/assets/templates/pages/shell-top-nav/page.tsx +13 -13
- package/assets/templates/pages/shell-top-nav/template.doc.mjs +0 -19
- package/assets/templates/pages/side-gallery/page.tsx +5 -2
- package/assets/templates/pages/table/page.tsx +21 -21
- package/assets/templates/pages/table/template.doc.mjs +0 -10
- package/assets/templates/pages/table-collapsible/page.tsx +8 -8
- package/assets/templates/pages/table-collapsible/template.doc.mjs +0 -6
- package/assets/templates/pages/table-comparison/page.tsx +23 -23
- package/assets/templates/pages/table-comparison/template.doc.mjs +0 -14
- package/assets/templates/pages/table-filter/page.tsx +75 -47
- package/assets/templates/pages/table-filter/template.doc.mjs +0 -19
- package/assets/templates/pages/table-grouped/page.tsx +39 -17
- package/assets/templates/pages/table-grouped/template.doc.mjs +0 -11
- package/assets/templates/pages/table-inbox/page.tsx +147 -65
- package/assets/templates/pages/table-inbox/template.doc.mjs +0 -17
- package/assets/templates/pages/table-page/page.tsx +3 -6
- package/assets/templates/pages/table-page/template.doc.mjs +0 -1
- package/assets/templates/pages/table-tree/page.tsx +35 -35
- package/assets/templates/pages/table-tree/template.doc.mjs +0 -15
- package/assets/templates/pages/theme-showcase/page.tsx +48 -43
- package/assets/templates/pages/theme-showcase/template.doc.mjs +0 -19
- package/assets/templates/pages/work-item-detail/page.tsx +60 -33
- package/assets/templates/pages/work-item-detail/template.doc.mjs +0 -12
- package/assets/templates/themes/butter/butterPaletteRefs.generated.ts +12 -12
- package/assets/templates/themes/butter/butterTheme.ts +244 -10
- package/assets/templates/themes/chocolate/chocolateTheme.ts +81 -10
- package/assets/templates/themes/gothic/gothicPaletteRefs.generated.ts +3 -3
- package/assets/templates/themes/gothic/gothicTheme.ts +126 -4
- package/assets/templates/themes/matcha/matchaPaletteRefs.generated.ts +8 -8
- package/assets/templates/themes/matcha/matchaTheme.ts +58 -14
- package/assets/templates/themes/neutral/neutralTheme.ts +45 -0
- package/assets/templates/themes/stone/stonePaletteRefs.generated.ts +3 -3
- package/assets/templates/themes/stone/stoneTheme.ts +101 -10
- package/assets/templates/themes/y2k/y2kPaletteRefs.generated.ts +9 -9
- package/assets/templates/themes/y2k/y2kTheme.ts +257 -14
- package/assets/theme.template.ts +17 -7
- package/authoring/config/config.doc.mjs +8 -1
- package/authoring/config/parse.mjs +15 -0
- package/authoring/config/skill-places.d.mts +23 -0
- package/authoring/config/skill-places.mjs +35 -0
- package/authoring/config/type.ts +20 -3
- package/authoring/debug/parse.d.mts +1 -1
- package/authoring/debug/type.ts +4 -0
- package/authoring/discover/parse.d.mts +4 -3
- package/authoring/discover/parse.mjs +76 -41
- package/authoring/discover/type.ts +9 -1
- package/authoring/doctypes/_schema.d.mts +36 -16
- package/authoring/doctypes/_schema.mjs +29 -0
- package/authoring/doctypes/base/type.ts +19 -0
- package/authoring/doctypes/command/command.doc.mjs +6 -0
- package/authoring/doctypes/command/type.ts +7 -0
- package/authoring/doctypes/component/component.doc.mjs +1 -1
- package/authoring/doctypes/icon-definition/icon-definition.doc.mjs +17 -1
- package/authoring/doctypes/icon-definition/parse.mjs +12 -0
- package/authoring/doctypes/icon-definition/type.ts +18 -0
- package/authoring/doctypes/reference/reference.doc.mjs +13 -0
- package/authoring/doctypes/reference/skill.d.mts +29 -0
- package/authoring/doctypes/reference/skill.mjs +56 -0
- package/authoring/doctypes/reference/type.ts +19 -0
- package/authoring/gap-report/parse.d.mts +1 -1
- package/authoring/integration/integration.doc.mjs +8 -0
- package/authoring/integration/schema.d.mts +21 -3
- package/authoring/integration/schema.mjs +25 -5
- package/authoring/integration/type.ts +14 -0
- package/clients/cli/build-id.generated.json +1 -1
- package/clients/cli/commands/build.doc.mjs +1 -1
- package/clients/cli/commands/build.mjs +20 -14
- package/clients/cli/commands/component.doc.mjs +3 -1
- package/clients/cli/commands/component.mjs +21 -6
- package/clients/cli/commands/discover.doc.mjs +2 -2
- package/clients/cli/commands/discover.mjs +112 -9
- package/clients/cli/commands/docs.doc.mjs +17 -10
- package/clients/cli/commands/docs.mjs +112 -191
- package/clients/cli/commands/doctor-integration-validate.doc.mjs +4 -2
- package/clients/cli/commands/doctor.doc.mjs +3 -1
- package/clients/cli/commands/doctor.mjs +16 -3
- package/clients/cli/commands/experimental/export.mjs +64 -0
- package/clients/cli/commands/experimental/icon.mjs +387 -229
- package/clients/cli/commands/experimental/import.mjs +70 -0
- package/clients/cli/commands/experimental/index.mjs +152 -13
- package/clients/cli/commands/experimental/render-output.mjs +242 -0
- package/clients/cli/commands/experimental/theme.mjs +69 -23
- package/clients/cli/commands/experimental-export.doc.mjs +73 -0
- package/clients/cli/commands/experimental-icon-add.doc.mjs +1 -1
- package/clients/cli/commands/experimental-icon-map.doc.mjs +4 -1
- package/clients/cli/commands/experimental-icon-new-definition.doc.mjs +4 -1
- package/clients/cli/commands/experimental-icon-new-set.doc.mjs +4 -1
- package/clients/cli/commands/experimental-icon-use.doc.mjs +1 -1
- package/clients/cli/commands/experimental-icon.doc.mjs +1 -1
- package/clients/cli/commands/experimental-import.doc.mjs +53 -0
- package/clients/cli/commands/experimental-theme-add.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-compile.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +7 -2
- package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme.doc.mjs +1 -1
- package/clients/cli/commands/experimental.doc.mjs +4 -4
- package/clients/cli/commands/init.doc.mjs +63 -31
- package/clients/cli/commands/integration-check.doc.mjs +1 -1
- package/clients/cli/commands/mcp.doc.mjs +57 -0
- package/clients/cli/commands/mcp.mjs +51 -0
- package/clients/cli/commands/search.mjs +78 -9
- package/clients/cli/commands/template.doc.mjs +14 -5
- package/clients/cli/commands/template.mjs +21 -2
- package/clients/cli/commands/theme-add.doc.mjs +6 -2
- package/clients/cli/commands/theme-build.doc.mjs +1 -1
- package/clients/cli/commands/theme-remove.doc.mjs +1 -1
- package/clients/cli/commands/theme-targets.doc.mjs +1 -1
- package/clients/cli/commands/theme.mjs +86 -5
- package/clients/cli/commands/upgrade.doc.mjs +2 -1
- package/clients/cli/commands.generated.json +1 -1
- package/clients/cli/formatters/index.mjs +52 -6
- package/clients/cli/index.mjs +44 -37
- package/clients/cli/lib/cli-error.mjs +20 -10
- package/clients/cli/lib/component-format.mjs +167 -74
- package/clients/cli/lib/define-command.mjs +92 -4
- package/clients/cli/lib/hook-format.mjs +28 -24
- package/clients/cli/lib/json-shim.mjs +61 -4
- package/clients/cli/lib/manifest.mjs +9 -1
- package/clients/cli/lib/mcp-server.mjs +286 -0
- package/clients/cli/lib/mcp-tools.mjs +405 -0
- package/clients/cli/lib/other-cli-words.mjs +99 -0
- package/clients/cli/lib/renamed-commands.mjs +21 -0
- package/clients/cli/lib/root-args.mjs +10 -3
- package/clients/cli/lib/stray-option.mjs +79 -1
- package/clients/cli/lib/unknown-command.mjs +406 -13
- package/clients/cli/manifest.generated.json +1 -1
- package/clients/cli/run.mjs +27 -0
- package/foundation/agent-docs/agent-doc-state.d.mts +20 -2
- package/foundation/agent-docs/agent-doc-state.mjs +71 -4
- package/foundation/agent-docs/agent-docs.d.mts +79 -5
- package/foundation/agent-docs/agent-docs.mjs +137 -10
- package/foundation/agent-docs/computer-agent-text.d.mts +28 -14
- package/foundation/agent-docs/computer-agent-text.mjs +85 -172
- package/foundation/agent-docs/folder-scope.d.mts +51 -0
- package/foundation/agent-docs/folder-scope.mjs +86 -0
- package/foundation/agent-docs/managed-skill-file.d.mts +115 -0
- package/foundation/agent-docs/managed-skill-file.mjs +224 -0
- package/foundation/agent-docs/skill-place-files.d.mts +119 -0
- package/foundation/agent-docs/skill-place-files.mjs +374 -0
- package/foundation/agent-docs/skill-places.d.mts +139 -0
- package/foundation/agent-docs/skill-places.mjs +321 -0
- package/foundation/color/css-color.d.mts +150 -0
- package/foundation/color/css-color.mjs +960 -0
- package/foundation/config/config-path.d.mts +2 -2
- package/foundation/config/config-path.mjs +5 -6
- package/foundation/config/config-writer.d.mts +5 -1
- package/foundation/config/config-writer.mjs +20 -4
- package/foundation/config/project.d.mts +8 -5
- package/foundation/config/project.mjs +35 -17
- package/foundation/config/theme-state.d.mts +13 -0
- package/foundation/config/theme-state.mjs +28 -0
- package/foundation/debug/event.d.mts +2 -1
- package/foundation/debug/event.mjs +2 -1
- package/foundation/discovery/button-actions.d.mts +220 -0
- package/foundation/discovery/button-actions.mjs +1527 -0
- package/foundation/discovery/cli-self-docs.d.mts +7 -0
- package/foundation/discovery/cli-self-docs.mjs +67 -6
- package/foundation/discovery/color-modes.d.mts +14 -0
- package/foundation/discovery/color-modes.mjs +53 -0
- package/foundation/discovery/command-pointers.d.mts +21 -4
- package/foundation/discovery/command-pointers.mjs +25 -4
- package/foundation/discovery/component-discovery.d.mts +10 -0
- package/foundation/discovery/component-discovery.mjs +99 -43
- package/foundation/discovery/component-replacement.d.mts +8 -0
- package/foundation/discovery/component-replacement.mjs +13 -0
- package/foundation/discovery/core-augmentation-points.d.mts +90 -0
- package/foundation/discovery/core-augmentation-points.mjs +1030 -0
- package/foundation/discovery/core-component-views.d.mts +15 -0
- package/foundation/discovery/core-component-views.mjs +176 -0
- package/foundation/discovery/core-elements.d.mts +29 -0
- package/foundation/discovery/core-elements.mjs +57 -0
- package/foundation/discovery/core-prop-types.d.mts +65 -0
- package/foundation/discovery/core-prop-types.mjs +221 -0
- package/foundation/discovery/core-props.d.mts +33 -0
- package/foundation/discovery/core-props.mjs +64 -0
- package/foundation/discovery/doc-types.d.mts +10 -42
- package/foundation/discovery/doc-types.mjs +26 -7
- package/foundation/discovery/docs-discovery.d.mts +33 -2
- package/foundation/discovery/docs-discovery.mjs +149 -72
- package/foundation/discovery/docs-section-key.d.mts +21 -1
- package/foundation/discovery/docs-section-key.mjs +57 -19
- package/foundation/discovery/hook-discovery.d.mts +2 -0
- package/foundation/discovery/hook-discovery.mjs +6 -5
- package/foundation/discovery/icon-definition-discovery.d.mts +155 -3
- package/foundation/discovery/icon-definition-discovery.mjs +197 -5
- package/foundation/discovery/icon-imports.d.mts +66 -0
- package/foundation/discovery/icon-imports.mjs +225 -0
- package/foundation/discovery/icon-ranking.d.mts +118 -4
- package/foundation/discovery/icon-ranking.mjs +453 -59
- package/foundation/discovery/icon-set-checks.d.mts +2 -0
- package/foundation/discovery/icon-set-checks.mjs +16 -2
- package/foundation/discovery/icon-set-discovery.d.mts +68 -2
- package/foundation/discovery/icon-set-discovery.mjs +124 -23
- package/foundation/discovery/icon-set-writer.d.mts +9 -13
- package/foundation/discovery/icon-set-writer.mjs +89 -36
- package/foundation/discovery/integration-skills.d.mts +62 -0
- package/foundation/discovery/integration-skills.mjs +116 -0
- package/foundation/discovery/module-exports.d.mts +8 -0
- package/foundation/discovery/module-exports.mjs +20 -21
- package/foundation/discovery/name-roots.d.mts +5 -0
- package/foundation/discovery/name-roots.mjs +11 -0
- package/foundation/discovery/package-exports.d.mts +22 -0
- package/foundation/discovery/package-exports.mjs +44 -3
- package/foundation/discovery/project-typescript.d.mts +5 -1
- package/foundation/discovery/project-typescript.mjs +8 -2
- package/foundation/discovery/prop-drift.d.mts +16 -0
- package/foundation/discovery/prop-drift.mjs +154 -3
- package/foundation/discovery/replacement-aliases.d.mts +51 -0
- package/foundation/discovery/replacement-aliases.mjs +95 -0
- package/foundation/discovery/runner-allowlist.d.mts +2 -1
- package/foundation/discovery/runner-allowlist.mjs +3 -1
- package/foundation/discovery/runner-commands.mjs +1 -0
- package/foundation/discovery/stored-component-list.mjs +34 -2
- package/foundation/discovery/template-adapter.d.mts +27 -1
- package/foundation/discovery/template-adapter.mjs +221 -10
- package/foundation/discovery/template-destination.d.mts +14 -6
- package/foundation/discovery/template-destination.mjs +42 -8
- package/foundation/discovery/template-icon-meanings.d.mts +7 -2
- package/foundation/discovery/template-icon-meanings.mjs +52 -12
- package/foundation/discovery/template-icons.d.mts +46 -3
- package/foundation/discovery/template-icons.mjs +72 -109
- package/foundation/discovery/template-needs.d.mts +34 -5
- package/foundation/discovery/template-needs.mjs +164 -22
- package/foundation/discovery/template-placeholders.d.mts +149 -0
- package/foundation/discovery/template-placeholders.mjs +463 -0
- package/foundation/discovery/template-source-tree.d.mts +6 -3
- package/foundation/discovery/template-source-tree.mjs +8 -5
- package/foundation/discovery/theme-discovery.d.mts +8 -0
- package/foundation/discovery/theme-discovery.mjs +23 -6
- package/foundation/discovery/theme-imports.d.mts +1 -3
- package/foundation/discovery/theme-imports.mjs +5 -30
- package/foundation/doc-compiler/compile.mjs +6 -8
- package/foundation/doc-compiler/doc-syntax.d.mts +25 -1
- package/foundation/doc-compiler/doc-syntax.mjs +85 -10
- package/foundation/doc-compiler/doc-text.d.mts +52 -0
- package/foundation/doc-compiler/doc-text.mjs +176 -0
- package/foundation/doc-compiler/links.d.mts +8 -2
- package/foundation/doc-compiler/links.mjs +27 -6
- package/foundation/doc-compiler/read.d.mts +1 -1
- package/foundation/doc-compiler/stored-docs.d.mts +14 -3
- package/foundation/doc-compiler/stored-docs.mjs +12 -6
- package/foundation/env/cli-command.d.mts +68 -10
- package/foundation/env/cli-command.mjs +116 -22
- package/foundation/env/package-manager.d.mts +33 -2
- package/foundation/env/package-manager.mjs +68 -6
- package/foundation/env/project-scope.d.mts +9 -0
- package/foundation/env/project-scope.mjs +28 -2
- package/foundation/env/user-dirs.d.mts +14 -0
- package/foundation/env/user-dirs.mjs +34 -1
- package/foundation/env/user-settings.d.mts +15 -0
- package/foundation/env/user-settings.mjs +56 -2
- package/foundation/fonts/font-stylesheet.d.mts +11 -0
- package/foundation/fonts/font-stylesheet.mjs +62 -7
- package/foundation/fs/cache-eviction.d.mts +7 -5
- package/foundation/fs/cache-eviction.mjs +20 -13
- package/foundation/fs/empty-folder.d.mts +12 -0
- package/foundation/fs/empty-folder.mjs +30 -0
- package/foundation/fs/file-protection.d.mts +11 -0
- package/foundation/fs/file-protection.mjs +49 -3
- package/foundation/fs/gather-cache.d.mts +14 -7
- package/foundation/fs/gather-cache.mjs +163 -67
- package/foundation/fs/import-url.d.mts +7 -5
- package/foundation/fs/import-url.mjs +7 -5
- package/foundation/fs/jiti-cache.d.mts +47 -26
- package/foundation/fs/jiti-cache.mjs +222 -130
- package/foundation/fs/loaded-files.d.mts +15 -1
- package/foundation/fs/loaded-files.mjs +40 -3
- package/foundation/fs/module-loader.d.mts +3 -1
- package/foundation/fs/module-loader.mjs +85 -5
- package/foundation/fs/path-safety.d.mts +1 -0
- package/foundation/fs/path-safety.mjs +2 -0
- package/foundation/fs/read-record.mjs +9 -5
- package/foundation/fs/relative-specifier.d.mts +10 -0
- package/foundation/fs/relative-specifier.mjs +28 -0
- package/foundation/integrations/computer-integrations.mjs +11 -10
- package/foundation/integrations/icon-features.d.mts +63 -0
- package/foundation/integrations/icon-features.mjs +54 -0
- package/foundation/integrations/integration-warnings.d.mts +10 -0
- package/foundation/integrations/integration-warnings.mjs +12 -3
- package/foundation/integrations/integrations.d.mts +16 -2
- package/foundation/integrations/integrations.mjs +50 -8
- package/foundation/integrations/may-have-integrations.mjs +7 -6
- package/foundation/integrations/provider-resolution.mjs +19 -2
- package/foundation/integrations/validate-contributions.d.mts +13 -3
- package/foundation/integrations/validate-contributions.mjs +64 -13
- package/foundation/release/agent-text-worker.mjs +33 -1
- package/foundation/release/cache.d.mts +48 -3
- package/foundation/release/cache.mjs +196 -20
- package/foundation/release/choose.d.mts +5 -2
- package/foundation/release/choose.mjs +54 -4
- package/foundation/release/global-state.mjs +10 -2
- package/foundation/release/handoff.mjs +7 -1
- package/foundation/release/notices.d.mts +97 -9
- package/foundation/release/notices.mjs +421 -59
- package/foundation/release/project.d.mts +21 -4
- package/foundation/release/project.mjs +74 -42
- package/foundation/release/run-context.d.mts +6 -0
- package/foundation/release/run-context.mjs +9 -0
- package/foundation/render/assets.d.mts +7 -0
- package/foundation/render/assets.mjs +30 -17
- package/foundation/render/charts.d.mts +11 -10
- package/foundation/render/charts.mjs +112 -1
- package/foundation/render/class-alias.d.mts +23 -0
- package/foundation/render/class-alias.mjs +333 -0
- package/foundation/render/client-bundle.d.mts +183 -0
- package/foundation/render/client-bundle.mjs +1026 -0
- package/foundation/render/component-map.mjs +1 -1
- package/foundation/render/css-cut.d.mts +26 -0
- package/foundation/render/css-cut.mjs +344 -2
- package/foundation/render/cut-short.d.mts +7 -1
- package/foundation/render/cut-short.mjs +46 -6
- package/foundation/render/dropped-text.d.mts +43 -0
- package/foundation/render/dropped-text.mjs +90 -0
- package/foundation/render/embedded-files.d.mts +24 -1
- package/foundation/render/embedded-files.mjs +41 -4
- package/foundation/render/embedded-imports.d.mts +72 -12
- package/foundation/render/embedded-imports.mjs +206 -70
- package/foundation/render/esbuild-dependency.d.mts +14 -0
- package/foundation/render/esbuild-dependency.mjs +41 -0
- package/foundation/render/file-header.d.mts +7 -2
- package/foundation/render/file-header.mjs +19 -10
- package/foundation/render/html-reader.d.mts +36 -17
- package/foundation/render/html-reader.mjs +239 -32
- package/foundation/render/image-attributes.d.mts +25 -0
- package/foundation/render/image-attributes.mjs +33 -0
- package/foundation/render/markup-edits.mjs +1 -1
- package/foundation/render/package-resolve-hooks.d.mts +54 -0
- package/foundation/render/package-resolve-hooks.mjs +144 -0
- package/foundation/render/page-host.mjs +1 -1
- package/foundation/render/page-worker.mjs +1307 -107
- package/foundation/render/picture-chrome.mjs +54 -29
- package/foundation/render/picture-playwright.mjs +78 -42
- package/foundation/render/picture-window.d.mts +44 -5
- package/foundation/render/picture-window.mjs +265 -19
- package/foundation/render/rebuild.mjs +2 -2
- package/foundation/render/remote-images.d.mts +83 -0
- package/foundation/render/remote-images.mjs +384 -0
- package/foundation/render/render-page.d.mts +219 -8
- package/foundation/render/render-page.mjs +1702 -165
- package/foundation/render/restore-folder.d.mts +13 -0
- package/foundation/render/restore-folder.mjs +30 -0
- package/foundation/render/served-packages.d.mts +14 -1
- package/foundation/render/served-packages.mjs +50 -6
- package/foundation/render/share-checks.d.mts +35 -0
- package/foundation/render/share-checks.mjs +95 -0
- package/foundation/render/source-block.d.mts +14 -3
- package/foundation/render/source-block.mjs +44 -9
- package/foundation/render/srcset.d.mts +32 -0
- package/foundation/render/srcset.mjs +64 -0
- package/foundation/render/ts-paths.d.mts +52 -1
- package/foundation/render/ts-paths.mjs +114 -4
- package/foundation/render/value-uses.d.mts +43 -0
- package/foundation/render/value-uses.mjs +110 -0
- package/foundation/response/error-codes.d.mts +2 -1
- package/foundation/response/error-codes.doc.mjs +16 -10
- package/foundation/response/error-codes.mjs +19 -8
- package/foundation/response/json.d.mts +0 -15
- package/foundation/response/json.mjs +1 -51
- package/foundation/response/response-types.doc.mjs +28 -17
- package/foundation/runtime/css-tree.d.mts +16 -0
- package/foundation/runtime/css-tree.mjs +46 -3
- package/foundation/runtime/lazy-dependencies.d.mts +7 -0
- package/foundation/runtime/lazy-dependencies.mjs +25 -3
- package/foundation/runtime/locked-versions.d.mts +4 -2
- package/foundation/runtime/locked-versions.mjs +18 -10
- package/foundation/runtime/package-root.d.mts +25 -0
- package/foundation/runtime/package-root.mjs +48 -0
- package/foundation/runtime/word-table.d.mts +18 -0
- package/foundation/runtime/word-table.mjs +33 -0
- package/foundation/suggest/other-command.d.mts +23 -0
- package/foundation/suggest/other-command.mjs +49 -5
- package/foundation/text/default-variant.d.mts +20 -0
- package/foundation/text/default-variant.mjs +24 -0
- package/foundation/text/definition-coverage.d.mts +21 -0
- package/foundation/text/definition-coverage.mjs +20 -0
- package/foundation/text/icon-id.d.mts +20 -0
- package/foundation/text/icon-id.mjs +40 -0
- package/foundation/text/icon-set-next.d.mts +26 -0
- package/foundation/text/icon-set-next.mjs +37 -0
- package/foundation/text/string-utils.mjs +14 -41
- package/foundation/text/suggest-order.d.mts +10 -4
- package/foundation/text/suggest-order.mjs +20 -13
- package/package.json +8 -6
- package/assets/codemods/transforms/next/migrate-item-swipe-actions-to-swipe.mjs +0 -394
- package/assets/docs/tree/render-pages.doc.mjs +0 -135
- package/clients/cli/commands/experimental/render.mjs +0 -154
- package/clients/cli/commands/experimental-render.doc.mjs +0 -73
|
@@ -0,0 +1,1065 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file The theme settings a build writes that do not show as written,
|
|
5
|
+
* read from the component rules Core generates for the theme (the CSS the
|
|
6
|
+
* browser gets).
|
|
7
|
+
*
|
|
8
|
+
* A declaration of the theme is one its sources write (its own file and
|
|
9
|
+
* the local themes it extends; the caller says where). It does not show as written when another rule of the theme
|
|
10
|
+
* layer that reaches the same element sets the same property (or a
|
|
11
|
+
* shorthand over it, or a longhand of it) to another value and wins there,
|
|
12
|
+
* by specificity or, at equal specificity, by coming later:
|
|
13
|
+
* - `hidden`: the other rule reaches every element and state the setting
|
|
14
|
+
* reaches, so it never shows (a shorthand after its own longhand in one
|
|
15
|
+
* rule, a same-weight rule later, a more specific rule of the same
|
|
16
|
+
* situation);
|
|
17
|
+
* - `loses`: the other rule reaches a narrower situation (a variant, a
|
|
18
|
+
* state), where the setting does not show;
|
|
19
|
+
* - `collides`: neither situation holds the other, and where both reach
|
|
20
|
+
* one element, the cascade decides which shows, by order or weight
|
|
21
|
+
* rather than by what the theme says. Reported for the setting whichever
|
|
22
|
+
* way it ends (`wins` tells), since a reorder flips it.
|
|
23
|
+
*
|
|
24
|
+
* Rules in different conditions (a color mode's ancestors, a media query)
|
|
25
|
+
* are compared only with rules of the same conditions or none.
|
|
26
|
+
*
|
|
27
|
+
* @position api/theme/build — one reader for `theme build`, and through it
|
|
28
|
+
* the editor's build, show and doctor
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
import {
|
|
32
|
+
coversProperty,
|
|
33
|
+
cssTree,
|
|
34
|
+
keptCssTreeAnswer,
|
|
35
|
+
longhandsOf,
|
|
36
|
+
} from '../../../foundation/runtime/css-tree.mjs';
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @typedef {object} RuleSide
|
|
40
|
+
* @property {string} part - the part (its class without the `astryx-` prefix)
|
|
41
|
+
* @property {string} key - the style key: `base`, a state (`selected`) or `prop:value` pairs joined with `+`
|
|
42
|
+
* @property {string | null} state - the pseudo-classes the rule adds (`:hover`), or null
|
|
43
|
+
* @property {string | null} element - the pseudo-element it styles (`::before`), or null
|
|
44
|
+
* @property {string[]} conditions - the rule's other conditions: ancestors and media queries, as written
|
|
45
|
+
* @property {string} property - the property, as written
|
|
46
|
+
* @property {string} value - the value, as written
|
|
47
|
+
* @property {'theme' | 'extended'} from - whether the setting's own source writes it, or a theme that source extends (or Core) does
|
|
48
|
+
* @property {string} signature - what tells the rule's situation from others (`blockPaths` keys)
|
|
49
|
+
*/
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @typedef {{
|
|
53
|
+
* kind: 'hidden' | 'loses' | 'collides',
|
|
54
|
+
* wins: boolean,
|
|
55
|
+
* by: RuleSide & {path: string[] | null},
|
|
56
|
+
* why: string,
|
|
57
|
+
* }} SettingRival - one rule that keeps a setting from showing as written,
|
|
58
|
+
* and how
|
|
59
|
+
*/
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* @typedef {RuleSide & {
|
|
63
|
+
* path: string[] | null,
|
|
64
|
+
* kind: 'hidden' | 'loses' | 'collides',
|
|
65
|
+
* wins: boolean,
|
|
66
|
+
* by: RuleSide & {path: string[] | null},
|
|
67
|
+
* against: SettingRival[],
|
|
68
|
+
* why: string,
|
|
69
|
+
* }} SettingEffectIssue
|
|
70
|
+
*/
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* @typedef {object} Decl
|
|
74
|
+
* @property {string} selector
|
|
75
|
+
* @property {string} property
|
|
76
|
+
* @property {string} value
|
|
77
|
+
* @property {boolean} important
|
|
78
|
+
* @property {number} order
|
|
79
|
+
* @property {number} rule - which rule of the stylesheet it is in
|
|
80
|
+
* @property {Situation} at
|
|
81
|
+
*/
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* @typedef {object} Situation
|
|
85
|
+
* @property {string} part
|
|
86
|
+
* @property {Map<string, string | null>} attrs - attribute name to value (null: present)
|
|
87
|
+
* @property {string[]} states - pseudo-classes and other subject conditions, as written
|
|
88
|
+
* @property {string} element - the pseudo-element the rule styles (`::before`), or empty for the element itself
|
|
89
|
+
* @property {string[]} conditions - zero-weight and ancestor conditions, and media queries, as written
|
|
90
|
+
* @property {[number, number, number]} specificity
|
|
91
|
+
*/
|
|
92
|
+
|
|
93
|
+
const PART_CLASS = /^astryx-(.+)$/;
|
|
94
|
+
|
|
95
|
+
/** @param {any} node @returns {string} */
|
|
96
|
+
const text = node => cssTree().generate(node);
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* The specificity of a selector node list, by Selectors Level 4.
|
|
100
|
+
* @param {any[]} nodes
|
|
101
|
+
* @returns {[number, number, number]}
|
|
102
|
+
*/
|
|
103
|
+
function specificityOf(nodes) {
|
|
104
|
+
/** @type {[number, number, number]} */
|
|
105
|
+
const s = [0, 0, 0];
|
|
106
|
+
for (const n of nodes) {
|
|
107
|
+
if (n.type === 'IdSelector') s[0]++;
|
|
108
|
+
else if (n.type === 'ClassSelector' || n.type === 'AttributeSelector')
|
|
109
|
+
s[1]++;
|
|
110
|
+
else if (n.type === 'TypeSelector' && n.name !== '*') s[2]++;
|
|
111
|
+
else if (n.type === 'PseudoElementSelector') s[2]++;
|
|
112
|
+
else if (n.type === 'PseudoClassSelector') {
|
|
113
|
+
const name = n.name.toLowerCase();
|
|
114
|
+
if (name === 'where') continue;
|
|
115
|
+
const list = selectorsIn(n);
|
|
116
|
+
if (['is', 'not', 'has', 'matches'].includes(name)) {
|
|
117
|
+
const most = list.map(specificityOf).sort(compare).at(-1);
|
|
118
|
+
if (most) add(s, most);
|
|
119
|
+
} else if (/^nth-(last-)?child$/.test(name) && list.length) {
|
|
120
|
+
s[1]++;
|
|
121
|
+
const most = list.map(specificityOf).sort(compare).at(-1);
|
|
122
|
+
if (most) add(s, most);
|
|
123
|
+
} else s[1]++;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return s;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/** @param {[number, number, number]} a @param {[number, number, number]} b */
|
|
130
|
+
const add = (a, b) => {
|
|
131
|
+
a[0] += b[0];
|
|
132
|
+
a[1] += b[1];
|
|
133
|
+
a[2] += b[2];
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
/** @param {[number, number, number]} a @param {[number, number, number]} b */
|
|
137
|
+
const compare = (a, b) => a[0] - b[0] || a[1] - b[1] || a[2] - b[2];
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* The selectors inside a pseudo-class's argument, each as its node list.
|
|
141
|
+
* @param {any} node
|
|
142
|
+
* @returns {any[][]}
|
|
143
|
+
*/
|
|
144
|
+
function selectorsIn(node) {
|
|
145
|
+
/** @type {any[][]} */
|
|
146
|
+
const out = [];
|
|
147
|
+
const visit = (/** @type {any} */ n) => {
|
|
148
|
+
if (!n) return;
|
|
149
|
+
if (n.type === 'Selector') out.push(n.children.toArray());
|
|
150
|
+
else if (n.children?.toArray) for (const c of n.children.toArray()) visit(c);
|
|
151
|
+
};
|
|
152
|
+
for (const c of node.children?.toArray?.() ?? []) visit(c);
|
|
153
|
+
return out;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* The situation a selector reaches: its part, the attributes and states its
|
|
158
|
+
* subject requires, and the rest as conditions. Null for a selector that
|
|
159
|
+
* reaches no part.
|
|
160
|
+
* @param {any[]} nodes
|
|
161
|
+
* @param {string[]} media
|
|
162
|
+
* @returns {Situation | null}
|
|
163
|
+
*/
|
|
164
|
+
function situationOf(nodes, media) {
|
|
165
|
+
let lastCombinator = -1;
|
|
166
|
+
nodes.forEach((n, i) => {
|
|
167
|
+
if (n.type === 'Combinator') lastCombinator = i;
|
|
168
|
+
});
|
|
169
|
+
const subject = nodes.slice(lastCombinator + 1);
|
|
170
|
+
/** @type {Situation} */
|
|
171
|
+
const at = {
|
|
172
|
+
part: '',
|
|
173
|
+
attrs: new Map(),
|
|
174
|
+
states: [],
|
|
175
|
+
element: '',
|
|
176
|
+
conditions: [...media],
|
|
177
|
+
specificity: specificityOf(nodes),
|
|
178
|
+
};
|
|
179
|
+
if (lastCombinator >= 0)
|
|
180
|
+
at.conditions.push(text({type: 'Selector', children: listOf(nodes.slice(0, lastCombinator))}));
|
|
181
|
+
/** @param {any[]} compound */
|
|
182
|
+
const read = compound => {
|
|
183
|
+
for (const n of compound) {
|
|
184
|
+
if (n.type === 'ClassSelector') {
|
|
185
|
+
const m = PART_CLASS.exec(n.name);
|
|
186
|
+
if (m && !at.part) at.part = m[1];
|
|
187
|
+
else at.states.push(text(n));
|
|
188
|
+
} else if (n.type === 'AttributeSelector') {
|
|
189
|
+
const value = n.value
|
|
190
|
+
? n.value.type === 'String'
|
|
191
|
+
? n.value.value
|
|
192
|
+
: text(n.value)
|
|
193
|
+
: null;
|
|
194
|
+
at.attrs.set(n.name.name, value);
|
|
195
|
+
} else if (n.type === 'PseudoClassSelector') {
|
|
196
|
+
const name = n.name.toLowerCase();
|
|
197
|
+
const list = selectorsIn(n);
|
|
198
|
+
if (
|
|
199
|
+
name === 'is' &&
|
|
200
|
+
list.length === 1 &&
|
|
201
|
+
!list[0].some(c => c.type === 'Combinator')
|
|
202
|
+
)
|
|
203
|
+
read(list[0]);
|
|
204
|
+
else if (name === 'where') at.conditions.push(text(n));
|
|
205
|
+
else at.states.push(text(n));
|
|
206
|
+
} else if (n.type === 'PseudoElementSelector') at.element += text(n);
|
|
207
|
+
else at.states.push(text(n));
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
read(subject);
|
|
211
|
+
return at.part ? at : null;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/** @param {any[]} nodes */
|
|
215
|
+
function listOf(nodes) {
|
|
216
|
+
const {List} = cssTree();
|
|
217
|
+
const list = new List();
|
|
218
|
+
for (const n of nodes) list.appendData(n);
|
|
219
|
+
return list;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/** The media conditions Core wraps a themed `:active` in (the press model). */
|
|
223
|
+
const COARSE_POINTER = new Set(['(pointer:coarse)', 'notalland(pointer:coarse)']);
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Every declaration of a list of rules, in cascade order, with the
|
|
227
|
+
* situation its selector reaches (one per selector of a list).
|
|
228
|
+
* @param {string[]} rules
|
|
229
|
+
* @returns {Decl[]}
|
|
230
|
+
*/
|
|
231
|
+
export function declarationsOf(rules) {
|
|
232
|
+
const csstree = cssTree();
|
|
233
|
+
const ast = csstree.parse(rules.join('\n'), {
|
|
234
|
+
parseValue: false,
|
|
235
|
+
parseCustomProperty: false,
|
|
236
|
+
});
|
|
237
|
+
/** @type {Decl[]} */
|
|
238
|
+
const out = [];
|
|
239
|
+
let order = 0;
|
|
240
|
+
let rule = 0;
|
|
241
|
+
/** @param {any} node @param {string[]} media @param {boolean} [coarse] */
|
|
242
|
+
const walk = (node, media, coarse = false) => {
|
|
243
|
+
for (const child of node.children?.toArray?.() ?? []) {
|
|
244
|
+
if (child.type === 'Atrule') {
|
|
245
|
+
const prelude = child.prelude ? text(child.prelude) : '';
|
|
246
|
+
// A themed `:active` is one setting Core writes twice: as `:active`
|
|
247
|
+
// off a coarse pointer, and under one as its press attribute. The
|
|
248
|
+
// first is read as plain `:active`; the press copy is skipped.
|
|
249
|
+
const bare = prelude.replace(/\s+/g, '');
|
|
250
|
+
if (child.name === 'media' && COARSE_POINTER.has(bare)) {
|
|
251
|
+
if (child.block) walk(child.block, media, bare === '(pointer:coarse)');
|
|
252
|
+
continue;
|
|
253
|
+
}
|
|
254
|
+
if (child.block)
|
|
255
|
+
walk(child.block, [...media, `@${child.name} ${prelude}`.trim()], coarse);
|
|
256
|
+
continue;
|
|
257
|
+
}
|
|
258
|
+
if (child.type !== 'Rule' || child.prelude?.type !== 'SelectorList')
|
|
259
|
+
continue;
|
|
260
|
+
if (coarse && text(child.prelude).includes('[data-astryx-press')) continue;
|
|
261
|
+
const selectors = child.prelude.children.toArray();
|
|
262
|
+
rule++;
|
|
263
|
+
for (const d of child.block.children.toArray()) {
|
|
264
|
+
if (d.type !== 'Declaration') continue;
|
|
265
|
+
order++;
|
|
266
|
+
const value = String(
|
|
267
|
+
d.value?.type === 'Raw' ? d.value.value : text(d.value),
|
|
268
|
+
).trim();
|
|
269
|
+
for (const sel of selectors) {
|
|
270
|
+
const at = situationOf(sel.children.toArray(), media);
|
|
271
|
+
if (!at) continue;
|
|
272
|
+
out.push({
|
|
273
|
+
selector: text(sel),
|
|
274
|
+
property: d.property.toLowerCase(),
|
|
275
|
+
value,
|
|
276
|
+
important: Boolean(d.important),
|
|
277
|
+
order,
|
|
278
|
+
rule,
|
|
279
|
+
at,
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
};
|
|
285
|
+
walk(ast, []);
|
|
286
|
+
return out;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* The declarations of a list of rules (declarationsOf), kept between runs by
|
|
291
|
+
* the rules' text (keptCssTreeAnswer), so a build of an unchanged theme reads
|
|
292
|
+
* them back and loads no css-tree. A situation's attributes are kept as their
|
|
293
|
+
* entries, in order, and read back into a Map.
|
|
294
|
+
* @param {string[]} rules
|
|
295
|
+
* @returns {Decl[]}
|
|
296
|
+
*/
|
|
297
|
+
function keptDeclarationsOf(rules) {
|
|
298
|
+
return keptCssTreeAnswer('theme-rule-declarations', rules, list =>
|
|
299
|
+
declarationsOf(list).map(d => ({
|
|
300
|
+
...d,
|
|
301
|
+
at: {...d.at, attrs: [...d.at.attrs]},
|
|
302
|
+
})),
|
|
303
|
+
).map(d => ({...d, at: {...d.at, attrs: new Map(d.at.attrs)}}));
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* The style key a situation's attributes name (`base` with none).
|
|
308
|
+
* @param {Situation} at
|
|
309
|
+
*/
|
|
310
|
+
function keyOf(at) {
|
|
311
|
+
const pairs = [...at.attrs].map(([name, value]) => {
|
|
312
|
+
const prop = name
|
|
313
|
+
.replace(/^data-/, '')
|
|
314
|
+
.replace(/-([a-z0-9])/g, (_, c) => c.toUpperCase());
|
|
315
|
+
return value == null || value === prop ? prop : `${prop}:${value}`;
|
|
316
|
+
});
|
|
317
|
+
return pairs.length ? pairs.join('+') : 'base';
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Whether `b`'s situation holds wherever `a`'s does (`b` asks nothing `a`
|
|
322
|
+
* does not).
|
|
323
|
+
* @param {Situation} a
|
|
324
|
+
* @param {Situation} b
|
|
325
|
+
* @param {boolean} [conditions] whether `b`'s other conditions count too
|
|
326
|
+
*/
|
|
327
|
+
function within(a, b, conditions = true) {
|
|
328
|
+
for (const [name, value] of b.attrs)
|
|
329
|
+
if (!a.attrs.has(name) || a.attrs.get(name) !== value) return false;
|
|
330
|
+
return (
|
|
331
|
+
b.states.every(s => a.states.includes(s)) &&
|
|
332
|
+
(!conditions || b.conditions.every(c => a.conditions.includes(c)))
|
|
333
|
+
);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* The selectors a zero-weight `:not()` condition rules out (the guard Core
|
|
338
|
+
* adds to a hover rule rules out a disabled control).
|
|
339
|
+
* @param {string} condition
|
|
340
|
+
* @returns {string[]}
|
|
341
|
+
*/
|
|
342
|
+
function ruledOut(condition) {
|
|
343
|
+
const m = /^:where\(:not\((.*)\)\)$/.exec(condition);
|
|
344
|
+
return m ? splitList(m[1]) : [];
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/** @param {string} list */
|
|
348
|
+
function splitList(list) {
|
|
349
|
+
/** @type {string[]} */
|
|
350
|
+
const out = [];
|
|
351
|
+
let depth = 0;
|
|
352
|
+
let start = 0;
|
|
353
|
+
for (let i = 0; i < list.length; i++) {
|
|
354
|
+
const c = list[i];
|
|
355
|
+
if (c === '(' || c === '[') depth++;
|
|
356
|
+
else if (c === ')' || c === ']') depth--;
|
|
357
|
+
else if (c === ',' && depth === 0) {
|
|
358
|
+
out.push(list.slice(start, i).trim());
|
|
359
|
+
start = i + 1;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
out.push(list.slice(start).trim());
|
|
363
|
+
return out.filter(Boolean);
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* Whether `b` asks for a state or an attribute `a` does not.
|
|
368
|
+
* @param {Situation} a
|
|
369
|
+
* @param {Situation} b
|
|
370
|
+
*/
|
|
371
|
+
function addsState(a, b) {
|
|
372
|
+
return (
|
|
373
|
+
b.states.some(st => !a.states.includes(st)) ||
|
|
374
|
+
[...b.attrs].some(([name]) => !a.attrs.has(name))
|
|
375
|
+
);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* Whether `b` is a variant of `a`'s part at rest or in `a`'s state: an
|
|
380
|
+
* attribute it adds is a visual prop with a value (`variant:primary`, a
|
|
381
|
+
* row's parity), not only a runtime state (`selected`, `disabled`), and it
|
|
382
|
+
* adds no other state.
|
|
383
|
+
* @param {Situation} a
|
|
384
|
+
* @param {Situation} b
|
|
385
|
+
*/
|
|
386
|
+
function variantRival(a, b) {
|
|
387
|
+
const added = [...b.attrs].filter(([name]) => !a.attrs.has(name));
|
|
388
|
+
return (
|
|
389
|
+
added.some(
|
|
390
|
+
([name, value]) => value != null && value !== name.replace(/^data-/, ''),
|
|
391
|
+
) && b.states.every(st => a.states.includes(st))
|
|
392
|
+
);
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Whether a property is one of Core's private variables (`--_…`,
|
|
397
|
+
* `--astryx-…`): Core's own plumbing (a card's padding sides), written for
|
|
398
|
+
* a setting, never a setting itself.
|
|
399
|
+
* @param {string} property
|
|
400
|
+
*/
|
|
401
|
+
const privateVariable = property => /^--(?:_|astryx-)/.test(property);
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* Whether a situation's attributes hold a prop named for the property, so
|
|
405
|
+
* the rule carries the choice made where the part is used.
|
|
406
|
+
* @param {string} property
|
|
407
|
+
* @param {Situation} at
|
|
408
|
+
*/
|
|
409
|
+
function choiceAtUse(property, at) {
|
|
410
|
+
for (const name of at.attrs.keys()) {
|
|
411
|
+
const prop = name.replace(/^data-/, '');
|
|
412
|
+
if (property === prop || property.endsWith(`-${prop}`)) return true;
|
|
413
|
+
}
|
|
414
|
+
return false;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* Whether one element can be in both situations at once. Two sets of
|
|
419
|
+
* other conditions are compared only when equal, or when one has none.
|
|
420
|
+
* @param {Situation} a
|
|
421
|
+
* @param {Situation} b
|
|
422
|
+
*/
|
|
423
|
+
function meet(a, b) {
|
|
424
|
+
// A pseudo-element (`::before`) is a box of its own.
|
|
425
|
+
if (a.part !== b.part || a.element !== b.element) return false;
|
|
426
|
+
for (const [name, value] of b.attrs)
|
|
427
|
+
if (a.attrs.has(name) && a.attrs.get(name) !== value) return false;
|
|
428
|
+
const cond = (/** @type {Situation} */ s) =>
|
|
429
|
+
s.conditions.filter(c => !ruledOut(c).length);
|
|
430
|
+
const ca = cond(a);
|
|
431
|
+
const cb = cond(b);
|
|
432
|
+
if (
|
|
433
|
+
ca.length &&
|
|
434
|
+
cb.length &&
|
|
435
|
+
!(ca.every(c => cb.includes(c)) || cb.every(c => ca.includes(c)))
|
|
436
|
+
)
|
|
437
|
+
return false;
|
|
438
|
+
// A guard ruling out a state meets no rule of that state.
|
|
439
|
+
/** @param {Situation} x @param {Situation} y */
|
|
440
|
+
const excludes = (x, y) =>
|
|
441
|
+
x.conditions.some(c => {
|
|
442
|
+
const out = ruledOut(c);
|
|
443
|
+
return y.states.some(
|
|
444
|
+
s =>
|
|
445
|
+
out.includes(s) ||
|
|
446
|
+
/^:is\((.*)\)$/.test(s) &&
|
|
447
|
+
splitList(s.slice(4, -1)).every(i => out.includes(i)),
|
|
448
|
+
);
|
|
449
|
+
});
|
|
450
|
+
return !excludes(a, b) && !excludes(b, a);
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
/** @param {Decl} d @param {'theme' | 'extended'} from @returns {RuleSide} */
|
|
454
|
+
function side(d, from) {
|
|
455
|
+
return {
|
|
456
|
+
part: d.at.part,
|
|
457
|
+
key: keyOf(d.at),
|
|
458
|
+
state: d.at.states.length ? d.at.states.join('') : null,
|
|
459
|
+
element: d.at.element || null,
|
|
460
|
+
conditions: d.at.conditions,
|
|
461
|
+
property: d.property,
|
|
462
|
+
value: d.value,
|
|
463
|
+
from,
|
|
464
|
+
signature: signatureOf(d.at),
|
|
465
|
+
};
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
/** @param {RuleSide} s */
|
|
469
|
+
const situationText = s =>
|
|
470
|
+
`${s.part}${s.element ?? ''}${s.key === 'base' ? '' : ` ${s.key}`}${s.state ? ` ${s.state}` : ''}`;
|
|
471
|
+
|
|
472
|
+
/**
|
|
473
|
+
* The theme's settings that do not show as written.
|
|
474
|
+
* @param {string[]} rules - the theme's component rules, as Core generates them
|
|
475
|
+
* @param {(at: RuleSide) => {path: string[], layer: number} | null} writtenAt -
|
|
476
|
+
* where the theme's sources write a declaration: its key path, and which
|
|
477
|
+
* source (0 for the theme's own file, then each theme it extends, in
|
|
478
|
+
* order); null for one no source of the theme writes (Core adds it, or
|
|
479
|
+
* an installed theme it extends holds it)
|
|
480
|
+
* @param {{skip?: (at: RuleSide) => boolean}} [options] - `skip`: a rule
|
|
481
|
+
* that takes no part (one whose selector nothing matches)
|
|
482
|
+
* @returns {SettingEffectIssue[]}
|
|
483
|
+
*/
|
|
484
|
+
export function settingEffectIssues(rules, writtenAt, {skip} = {}) {
|
|
485
|
+
const decls = keptDeclarationsOf(rules).filter(
|
|
486
|
+
d => !skip?.(side(d, 'theme')),
|
|
487
|
+
);
|
|
488
|
+
/** @type {Map<Decl, {path: string[], layer: number} | null>} */
|
|
489
|
+
const written = new Map();
|
|
490
|
+
const writtenOf = (/** @type {Decl} */ d) => {
|
|
491
|
+
if (!written.has(d)) written.set(d, writtenAt(side(d, 'theme')));
|
|
492
|
+
return written.get(d) ?? null;
|
|
493
|
+
};
|
|
494
|
+
const layerOf = (/** @type {Decl} */ d) => writtenOf(d)?.layer ?? Infinity;
|
|
495
|
+
/** @type {Map<string, Decl[]>} */
|
|
496
|
+
const byPart = new Map();
|
|
497
|
+
for (const d of decls) {
|
|
498
|
+
const list = byPart.get(d.at.part) ?? [];
|
|
499
|
+
list.push(d);
|
|
500
|
+
byPart.set(d.at.part, list);
|
|
501
|
+
}
|
|
502
|
+
const rank = {hidden: 0, loses: 1, collides: 2};
|
|
503
|
+
/** @type {Map<string, SettingEffectIssue>} */
|
|
504
|
+
const found = new Map();
|
|
505
|
+
/**
|
|
506
|
+
* How a rule `b` keeps the setting `a` from showing as written, or null.
|
|
507
|
+
* @param {Decl} a @param {Decl} b @param {number} layer
|
|
508
|
+
*/
|
|
509
|
+
const against = (a, b, layer) => {
|
|
510
|
+
if (b === a || b.value === a.value || !meet(a.at, b.at)) return null;
|
|
511
|
+
// A rule for a prop named for the property (a Text `size` for
|
|
512
|
+
// font-size, a `weight` for font-weight, a `color` for color) is the
|
|
513
|
+
// choice made where the part is used: it is meant to win.
|
|
514
|
+
if (choiceAtUse(a.property, b.at)) return null;
|
|
515
|
+
const whole =
|
|
516
|
+
b.property === a.property || coversProperty(b.property, a.property);
|
|
517
|
+
// A longhand of the setting's shorthand refines it; only one the
|
|
518
|
+
// theme did not write (the extended theme's, or Core's) takes part
|
|
519
|
+
// of it away.
|
|
520
|
+
const part = !whole && longhandsOf(a.property).has(b.property);
|
|
521
|
+
if (!whole && !part) return null;
|
|
522
|
+
/** @type {'theme' | 'extended'} */
|
|
523
|
+
const theirs = layerOf(b) === layer ? 'theme' : 'extended';
|
|
524
|
+
if (part && theirs === 'theme') return null;
|
|
525
|
+
const weight = compare(b.at.specificity, a.at.specificity);
|
|
526
|
+
const bWins =
|
|
527
|
+
b.important !== a.important
|
|
528
|
+
? b.important
|
|
529
|
+
: weight > 0 || (weight === 0 && b.order > a.order);
|
|
530
|
+
const covers = within(a.at, b.at);
|
|
531
|
+
// Narrower: wherever the two meet, `b` asks for more (a variant, a
|
|
532
|
+
// state); a condition only `a` has (its color mode) leaves `b` the
|
|
533
|
+
// narrower there.
|
|
534
|
+
const narrower = !covers && within(b.at, a.at, false);
|
|
535
|
+
/** @type {'hidden' | 'loses' | 'collides' | null} */
|
|
536
|
+
let kind = null;
|
|
537
|
+
if (bWins)
|
|
538
|
+
kind =
|
|
539
|
+
covers && whole ? 'hidden' : covers || narrower ? 'loses' : 'collides';
|
|
540
|
+
// A setting that wins only by coming later, where an extended rule
|
|
541
|
+
// of its weight reaches another situation of the same element.
|
|
542
|
+
else if (
|
|
543
|
+
weight === 0 &&
|
|
544
|
+
!covers &&
|
|
545
|
+
!narrower &&
|
|
546
|
+
a.important === b.important
|
|
547
|
+
)
|
|
548
|
+
kind = 'collides';
|
|
549
|
+
if (!kind) return null;
|
|
550
|
+
// A rule that adds a runtime state (`:hover`, `selected`) and no visual
|
|
551
|
+
// prop is that state's own look: a resting setting is not meant to show
|
|
552
|
+
// there, whoever wrote the rule.
|
|
553
|
+
if (kind !== 'hidden' && addsState(a.at, b.at) && !variantRival(a.at, b.at))
|
|
554
|
+
return null;
|
|
555
|
+
// Where both hold, a rule of the theme for that very situation (the
|
|
556
|
+
// variant's own hover, or the variant's own value in the setting's
|
|
557
|
+
// color mode) says what shows there: nothing collides or loses.
|
|
558
|
+
if (
|
|
559
|
+
(kind === 'collides' || kind === 'loses') &&
|
|
560
|
+
settledWhereBoth(a, b, layer)
|
|
561
|
+
)
|
|
562
|
+
return null;
|
|
563
|
+
// The same source's rule of a narrower situation (a variant's own
|
|
564
|
+
// color), or of another state (disabled over focused, selected over
|
|
565
|
+
// hovered), is that source saying what shows there: only one that
|
|
566
|
+
// hides the setting everywhere, or a variant of it that beats it where
|
|
567
|
+
// both hold (a striped row's fill over the whole-row hover), counts.
|
|
568
|
+
if (
|
|
569
|
+
theirs === 'theme' &&
|
|
570
|
+
(kind === 'loses' ||
|
|
571
|
+
(kind === 'collides' && (!bWins || !variantRival(a.at, b.at))))
|
|
572
|
+
)
|
|
573
|
+
return null;
|
|
574
|
+
return {kind, wins: !bWins, theirs, weight, part};
|
|
575
|
+
};
|
|
576
|
+
/**
|
|
577
|
+
* Whether a rule of the theme (`a`'s source or one nearer) reaches
|
|
578
|
+
* exactly where `a` and `b` both hold, sets the property and wins there
|
|
579
|
+
* over `b`.
|
|
580
|
+
* @param {Decl} a @param {Decl} b @param {number} layer
|
|
581
|
+
*/
|
|
582
|
+
const settledWhereBoth = (a, b, layer) => {
|
|
583
|
+
/** @type {Situation} */
|
|
584
|
+
const both = {
|
|
585
|
+
...a.at,
|
|
586
|
+
attrs: new Map([...a.at.attrs, ...b.at.attrs]),
|
|
587
|
+
states: [...new Set([...a.at.states, ...b.at.states])],
|
|
588
|
+
conditions: [...new Set([...a.at.conditions, ...b.at.conditions])],
|
|
589
|
+
};
|
|
590
|
+
return (byPart.get(a.at.part) ?? []).some(c => {
|
|
591
|
+
if (c === a || c === b || layerOf(c) > layer) return false;
|
|
592
|
+
if (c.at.element !== a.at.element) return false;
|
|
593
|
+
if (c.property !== a.property && !coversProperty(c.property, a.property))
|
|
594
|
+
return false;
|
|
595
|
+
if (!within(both, c.at)) return false;
|
|
596
|
+
const weight = compare(c.at.specificity, b.at.specificity);
|
|
597
|
+
return weight > 0 || (weight === 0 && c.order > b.order);
|
|
598
|
+
});
|
|
599
|
+
};
|
|
600
|
+
for (const a of decls) {
|
|
601
|
+
const layer = layerOf(a);
|
|
602
|
+
if (layer === Infinity || privateVariable(a.property)) continue;
|
|
603
|
+
const rivals = byPart.get(a.at.part) ?? [];
|
|
604
|
+
// A setting a nearer source hides everywhere it reaches (the theme's
|
|
605
|
+
// own file over a theme it extends) is that source's choice: none of
|
|
606
|
+
// its other rivals keeps anything from showing.
|
|
607
|
+
if (
|
|
608
|
+
rivals.some(
|
|
609
|
+
b =>
|
|
610
|
+
layerOf(b) < layer &&
|
|
611
|
+
against(a, b, layerOf(b))?.kind === 'hidden',
|
|
612
|
+
)
|
|
613
|
+
)
|
|
614
|
+
continue;
|
|
615
|
+
const mine = {...side(a, 'theme'), path: writtenOf(a)?.path ?? null};
|
|
616
|
+
const id = `${mine.part}\u0000${mine.element}\u0000${mine.key}\u0000${mine.state}\u0000${mine.conditions.join(' ')}\u0000${mine.property}`;
|
|
617
|
+
for (const b of rivals) {
|
|
618
|
+
// A source nearer the theme overriding one it extends says what
|
|
619
|
+
// shows: only the same source, or one the theme extends, counts.
|
|
620
|
+
if (layerOf(b) < layer) continue;
|
|
621
|
+
const how = against(a, b, layer);
|
|
622
|
+
if (!how) continue;
|
|
623
|
+
const by = {...side(b, how.theirs), path: writtenOf(b)?.path ?? null};
|
|
624
|
+
const entry = {
|
|
625
|
+
kind: how.kind,
|
|
626
|
+
wins: how.wins,
|
|
627
|
+
by,
|
|
628
|
+
why: whyOf(how.kind, how.wins, mine, by, how.weight, how.part),
|
|
629
|
+
};
|
|
630
|
+
const prev = found.get(id);
|
|
631
|
+
// Every rule that keeps it from showing is listed; the most severe
|
|
632
|
+
// leads.
|
|
633
|
+
if (!prev) found.set(id, {...mine, ...entry, against: [entry]});
|
|
634
|
+
else {
|
|
635
|
+
prev.against.push(entry);
|
|
636
|
+
if (rank[entry.kind] < rank[prev.kind]) Object.assign(prev, entry);
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
return [...found.values()];
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
/**
|
|
644
|
+
* @param {'hidden' | 'loses' | 'collides'} kind
|
|
645
|
+
* @param {boolean} wins
|
|
646
|
+
* @param {RuleSide} mine
|
|
647
|
+
* @param {RuleSide & {path?: string[] | null}} theirs
|
|
648
|
+
* @param {number} weight
|
|
649
|
+
* @param {boolean} part - the other rule sets one longhand of the setting's shorthand
|
|
650
|
+
*/
|
|
651
|
+
function whyOf(kind, wins, mine, theirs, weight, part) {
|
|
652
|
+
const whose =
|
|
653
|
+
theirs.from === 'extended' ? 'the theme it extends, or Core' : 'this theme';
|
|
654
|
+
const where = theirs.path
|
|
655
|
+
? pathText(theirs.path.slice(0, -1))
|
|
656
|
+
: situationText(theirs);
|
|
657
|
+
const other = `${theirs.property}: ${theirs.value} (${where}, from ${whose})`;
|
|
658
|
+
const same = theirs.property === mine.property;
|
|
659
|
+
const sets = same
|
|
660
|
+
? 'sets it again'
|
|
661
|
+
: part
|
|
662
|
+
? `sets ${theirs.property}, part of ${mine.property}`
|
|
663
|
+
: `sets ${mine.property} through ${theirs.property}`;
|
|
664
|
+
if (kind === 'hidden')
|
|
665
|
+
return `never shows: ${other} ${sets}${weight > 0 ? ' with a more specific selector' : ' later at the same weight'}`;
|
|
666
|
+
if (kind === 'loses')
|
|
667
|
+
return `does not show on ${situationText(theirs)}: ${other} ${sets} there`;
|
|
668
|
+
return wins
|
|
669
|
+
? `shows on ${situationText(theirs)} only because it comes later than ${other}, at the same weight`
|
|
670
|
+
: `does not show where ${situationText(theirs)} also holds: ${other} ${sets} and wins ${weight > 0 ? 'by a more specific selector' : 'by coming later'}`;
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
/** @param {string} key */
|
|
674
|
+
const keyAccess = key =>
|
|
675
|
+
/^[A-Za-z_$][\w$]*$/.test(key) ? `.${key}` : `[${JSON.stringify(key)}]`;
|
|
676
|
+
|
|
677
|
+
/**
|
|
678
|
+
* A key path as a theme source reads: `components.tab.selected`.
|
|
679
|
+
* @param {string[]} keys
|
|
680
|
+
*/
|
|
681
|
+
const pathText = keys =>
|
|
682
|
+
keys[0] + keys.slice(1).map(keyAccess).join('');
|
|
683
|
+
|
|
684
|
+
/**
|
|
685
|
+
* Where a side is written in a theme's source: its part, style key and
|
|
686
|
+
* state block.
|
|
687
|
+
* @param {{part: string, key: string, state: string | null, element?: string | null}} s
|
|
688
|
+
*/
|
|
689
|
+
export const settingPath = s => {
|
|
690
|
+
// A pseudo-element ends the block key, after any state (`:hover::before`).
|
|
691
|
+
const nested = `${s.state ?? ''}${s.element ?? ''}`;
|
|
692
|
+
return `components${keyAccess(s.part)}${keyAccess(s.key)}${nested ? keyAccess(nested) : ''}`;
|
|
693
|
+
};
|
|
694
|
+
|
|
695
|
+
/**
|
|
696
|
+
* A property as a theme source writes it: camelCase, a vendor prefix
|
|
697
|
+
* capitalized (-webkit-line-clamp is WebkitLineClamp), a custom property
|
|
698
|
+
* as it is.
|
|
699
|
+
* @param {string} property
|
|
700
|
+
*/
|
|
701
|
+
const camel = property =>
|
|
702
|
+
property.startsWith('--')
|
|
703
|
+
? property
|
|
704
|
+
: property
|
|
705
|
+
.replace(/^-([a-z])/, (_, c) => c.toUpperCase())
|
|
706
|
+
.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
|
|
707
|
+
|
|
708
|
+
/**
|
|
709
|
+
* The key both situations hold in: every prop and state either names.
|
|
710
|
+
* @param {string} a @param {string} b
|
|
711
|
+
*/
|
|
712
|
+
function bothKeys(a, b) {
|
|
713
|
+
const pairs = new Set(
|
|
714
|
+
[a, b].flatMap(k => (k === 'base' ? [] : k.split('+'))),
|
|
715
|
+
);
|
|
716
|
+
return pairs.size ? [...pairs].join('+') : 'base';
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
/**
|
|
720
|
+
* A rule as a build reports it: its part, pseudo-element, style key,
|
|
721
|
+
* state, other conditions, the property and value it sets, whether the
|
|
722
|
+
* setting's own source writes it (`theme`) or a theme that source extends,
|
|
723
|
+
* or Core (`extended`), and the key path a source writes it at (null when
|
|
724
|
+
* no source of the theme does).
|
|
725
|
+
* @typedef {{part: string, element: string | null, key: string, state: string | null, conditions: string[], property: string, value: string, from: 'theme' | 'extended', path: string[] | null}} SettingRuleEntry
|
|
726
|
+
*/
|
|
727
|
+
|
|
728
|
+
/**
|
|
729
|
+
* A setting the browser does not show as written, as a build reports it:
|
|
730
|
+
* the setting (as a rule), `kind` and `wins` for the rule that keeps it
|
|
731
|
+
* from showing most (`by`), `why` in words, every such rule in `against`
|
|
732
|
+
* (each `{kind, wins, by, why}`), the message and the change that makes it
|
|
733
|
+
* show (`fix`).
|
|
734
|
+
* @typedef {Omit<SettingRuleEntry, 'from' | 'path'> & {
|
|
735
|
+
* path: string[],
|
|
736
|
+
* kind: 'hidden' | 'loses' | 'collides',
|
|
737
|
+
* wins: boolean,
|
|
738
|
+
* by: SettingRuleEntry,
|
|
739
|
+
* why: string,
|
|
740
|
+
* against: Array<{kind: 'hidden' | 'loses' | 'collides', wins: boolean, by: SettingRuleEntry, why: string}>,
|
|
741
|
+
* message: string,
|
|
742
|
+
* fix: string,
|
|
743
|
+
* }} SettingIssueEntry
|
|
744
|
+
*/
|
|
745
|
+
|
|
746
|
+
/**
|
|
747
|
+
* A rule as reported, without what only the reader uses.
|
|
748
|
+
* @param {RuleSide & {path?: string[] | null}} r
|
|
749
|
+
* @returns {SettingRuleEntry}
|
|
750
|
+
*/
|
|
751
|
+
const ruleEntry = r => ({
|
|
752
|
+
part: r.part,
|
|
753
|
+
element: r.element,
|
|
754
|
+
key: r.key,
|
|
755
|
+
state: r.state,
|
|
756
|
+
conditions: r.conditions,
|
|
757
|
+
property: r.property,
|
|
758
|
+
value: r.value,
|
|
759
|
+
from: r.from,
|
|
760
|
+
path: r.path ?? null,
|
|
761
|
+
});
|
|
762
|
+
|
|
763
|
+
/**
|
|
764
|
+
* The issues as a build reports them: one per setting (a color-mode block
|
|
765
|
+
* Core writes three ways is one), each with the source path it is written
|
|
766
|
+
* at, its message and the change that makes it show as written.
|
|
767
|
+
* @param {SettingEffectIssue[]} issues
|
|
768
|
+
* @returns {SettingIssueEntry[]}
|
|
769
|
+
*/
|
|
770
|
+
export function settingIssueEntries(issues) {
|
|
771
|
+
/** @type {Map<string, SettingIssueEntry>} */
|
|
772
|
+
const out = new Map();
|
|
773
|
+
for (const issue of issues) {
|
|
774
|
+
// One per setting: by where its source writes it (a color-mode block
|
|
775
|
+
// Core writes three ways shares that), else by its situation.
|
|
776
|
+
const id = [
|
|
777
|
+
issue.path?.join('\u0001') ?? issue.conditions.join(' '),
|
|
778
|
+
issue.part,
|
|
779
|
+
issue.key,
|
|
780
|
+
issue.state,
|
|
781
|
+
issue.element,
|
|
782
|
+
issue.property,
|
|
783
|
+
issue.value,
|
|
784
|
+
issue.kind,
|
|
785
|
+
issue.by.key,
|
|
786
|
+
issue.by.state,
|
|
787
|
+
issue.by.property,
|
|
788
|
+
].join('\u0000');
|
|
789
|
+
if (out.has(id)) continue;
|
|
790
|
+
const blockOf = (/** @type {{path?: string[] | null}} */ x) =>
|
|
791
|
+
x.path ? pathText(x.path.slice(0, -1)) : null;
|
|
792
|
+
const at = blockOf(issue) ?? settingPath(issue);
|
|
793
|
+
// A fix for a setting of one color mode (`@light`) names a block of that
|
|
794
|
+
// mode, so following it writes nothing in the other.
|
|
795
|
+
const mode = issue.path?.find(k => /^@(?:light|dark)$/.test(k)) ?? null;
|
|
796
|
+
/** @param {string[]} keys - components, part, key, then the rest */
|
|
797
|
+
const inMode = keys =>
|
|
798
|
+
mode && !keys.includes(mode)
|
|
799
|
+
? [...keys.slice(0, 3), mode, ...keys.slice(3)]
|
|
800
|
+
: keys;
|
|
801
|
+
/** @param {{part: string, key: string, state: string | null, element?: string | null, path?: string[] | null}} x */
|
|
802
|
+
const blockKeys = x =>
|
|
803
|
+
x.path
|
|
804
|
+
? x.path.slice(0, -1)
|
|
805
|
+
: [
|
|
806
|
+
'components',
|
|
807
|
+
x.part,
|
|
808
|
+
x.key,
|
|
809
|
+
...(x.state || x.element ? [`${x.state ?? ''}${x.element ?? ''}`] : []),
|
|
810
|
+
];
|
|
811
|
+
const by = pathText(inMode(blockKeys(issue.by)));
|
|
812
|
+
const prop = camel(issue.property);
|
|
813
|
+
const other = camel(issue.by.property);
|
|
814
|
+
let fix;
|
|
815
|
+
if (issue.kind === 'hidden')
|
|
816
|
+
fix =
|
|
817
|
+
by === at
|
|
818
|
+
? `write ${prop} after ${other} in ${at}, or give its value in ${other}`
|
|
819
|
+
: issue.by.signature === issue.signature
|
|
820
|
+
? other === prop
|
|
821
|
+
? `${by} builds the same rule as ${at}, later, and sets ${prop} again: write them as one block, with the ${prop} you want`
|
|
822
|
+
: `${by} builds the same rule as ${at}, later: write them as one block, with ${prop} after ${other}`
|
|
823
|
+
: `set ${prop} in ${by} instead: that rule wins everywhere this one reaches`;
|
|
824
|
+
else if (issue.kind === 'loses')
|
|
825
|
+
fix = `set ${prop} in ${by} too: that rule wins there`;
|
|
826
|
+
else {
|
|
827
|
+
const both = pathText(
|
|
828
|
+
inMode(
|
|
829
|
+
blockKeys({
|
|
830
|
+
part: issue.part,
|
|
831
|
+
key: bothKeys(issue.key, issue.by.key),
|
|
832
|
+
state:
|
|
833
|
+
[...new Set([issue.state, issue.by.state].filter(Boolean))].join(
|
|
834
|
+
'',
|
|
835
|
+
) || null,
|
|
836
|
+
element: issue.element,
|
|
837
|
+
}),
|
|
838
|
+
),
|
|
839
|
+
);
|
|
840
|
+
fix = `set ${prop} in ${both}, so one rule says what shows when both hold`;
|
|
841
|
+
}
|
|
842
|
+
const {from: _from, path: _path, ...setting} = ruleEntry(issue);
|
|
843
|
+
out.set(id, {
|
|
844
|
+
...setting,
|
|
845
|
+
path: issue.path ?? [
|
|
846
|
+
'components',
|
|
847
|
+
issue.part,
|
|
848
|
+
issue.key,
|
|
849
|
+
...(issue.state || issue.element
|
|
850
|
+
? [`${issue.state ?? ''}${issue.element ?? ''}`]
|
|
851
|
+
: []),
|
|
852
|
+
prop,
|
|
853
|
+
],
|
|
854
|
+
kind: issue.kind,
|
|
855
|
+
wins: issue.wins,
|
|
856
|
+
by: ruleEntry(issue.by),
|
|
857
|
+
why: issue.why,
|
|
858
|
+
against: issue.against.map(r => ({
|
|
859
|
+
kind: r.kind,
|
|
860
|
+
wins: r.wins,
|
|
861
|
+
by: ruleEntry(r.by),
|
|
862
|
+
why: r.why,
|
|
863
|
+
})),
|
|
864
|
+
message: `${at}.${prop} (${issue.value}) ${issue.why}`,
|
|
865
|
+
fix,
|
|
866
|
+
});
|
|
867
|
+
}
|
|
868
|
+
return [...out.values()];
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
/**
|
|
872
|
+
* What tells one situation from another: its part, pseudo-element,
|
|
873
|
+
* attributes, states and other conditions.
|
|
874
|
+
* @param {Situation} at
|
|
875
|
+
*/
|
|
876
|
+
const signatureOf = at =>
|
|
877
|
+
JSON.stringify([
|
|
878
|
+
at.part,
|
|
879
|
+
at.element,
|
|
880
|
+
[...at.attrs].sort(),
|
|
881
|
+
[...at.states].sort(),
|
|
882
|
+
[...at.conditions].sort(),
|
|
883
|
+
]);
|
|
884
|
+
|
|
885
|
+
/** The custom property each block of a probe carries its own value in. */
|
|
886
|
+
const PROBE = '--astryx-setting-probe';
|
|
887
|
+
|
|
888
|
+
/** @param {{signature: string, property: string, value: string}} d */
|
|
889
|
+
const declarationKey = d => `${d.signature}\u0000${d.property}\u0000${d.value}`;
|
|
890
|
+
|
|
891
|
+
/**
|
|
892
|
+
* The style block of a theme's parts each declaration Core writes comes
|
|
893
|
+
* from: Core generates the parts again, every block carrying a probe value
|
|
894
|
+
* of its own beside its declarations, so each rule names its block. A
|
|
895
|
+
* declaration maps back to the blocks a source writes it in, however the
|
|
896
|
+
* key is spelled (`selected` and `selected:selected` build one selector,
|
|
897
|
+
* and each keeps its own declarations) and however Core writes it (a
|
|
898
|
+
* pressed state is two rules, a color mode three).
|
|
899
|
+
* @param {Record<string, Record<string, any>>} components - the theme's resolved parts
|
|
900
|
+
* @param {(components: Record<string, Record<string, any>>) => string[]} generate - Core's component rules for a map of parts
|
|
901
|
+
* @returns {Map<string, string[][]>} each declaration (situation, property, value) to the block paths that write it
|
|
902
|
+
*/
|
|
903
|
+
export function blockPaths(components, generate) {
|
|
904
|
+
/** @type {string[][]} */
|
|
905
|
+
const paths = [];
|
|
906
|
+
/** @param {any} block @param {string[]} at @param {boolean} modes */
|
|
907
|
+
const probe = (block, at, modes) => {
|
|
908
|
+
/** @type {Record<string, any>} */
|
|
909
|
+
const out = {};
|
|
910
|
+
if (block && typeof block === 'object')
|
|
911
|
+
for (const [k, v] of Object.entries(block)) {
|
|
912
|
+
if (v && typeof v === 'object' && k.startsWith(':'))
|
|
913
|
+
out[k] = probe(v, [...at, k], false);
|
|
914
|
+
else if (v && typeof v === 'object' && modes && (k === '@light' || k === '@dark'))
|
|
915
|
+
out[k] = probe(v, [...at, k], true);
|
|
916
|
+
else out[k] = v;
|
|
917
|
+
}
|
|
918
|
+
out[PROBE] = String(paths.push(at) - 1);
|
|
919
|
+
return out;
|
|
920
|
+
};
|
|
921
|
+
/** @type {Record<string, Record<string, any>>} */
|
|
922
|
+
const probes = {};
|
|
923
|
+
for (const [part, keys] of Object.entries(components ?? {})) {
|
|
924
|
+
if (!keys || typeof keys !== 'object') continue;
|
|
925
|
+
probes[part] = {};
|
|
926
|
+
for (const [key, block] of Object.entries(keys))
|
|
927
|
+
probes[part][key] = probe(block, ['components', part, key], true);
|
|
928
|
+
}
|
|
929
|
+
const decls = keptDeclarationsOf(generate(probes));
|
|
930
|
+
/** @type {Map<number, string[]>} */
|
|
931
|
+
const blockOfRule = new Map();
|
|
932
|
+
for (const d of decls)
|
|
933
|
+
if (d.property === PROBE) {
|
|
934
|
+
const at = paths[Number(d.value)];
|
|
935
|
+
if (at) blockOfRule.set(d.rule, at);
|
|
936
|
+
}
|
|
937
|
+
/** @type {Map<string, string[][]>} */
|
|
938
|
+
const out = new Map();
|
|
939
|
+
for (const d of decls) {
|
|
940
|
+
if (d.property === PROBE) continue;
|
|
941
|
+
const at = blockOfRule.get(d.rule);
|
|
942
|
+
if (!at) continue;
|
|
943
|
+
const key = declarationKey({...d, signature: signatureOf(d.at)});
|
|
944
|
+
const list = out.get(key) ?? [];
|
|
945
|
+
if (!list.some(p => p.join('\u0000') === at.join('\u0000'))) list.push(at);
|
|
946
|
+
out.set(key, list);
|
|
947
|
+
}
|
|
948
|
+
return out;
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
/**
|
|
952
|
+
* The key paths a theme source may write a declaration at, from the blocks
|
|
953
|
+
* that write it (`blockPaths`).
|
|
954
|
+
* @param {RuleSide} at
|
|
955
|
+
* @param {Map<string, string[][]>} blocks
|
|
956
|
+
* @returns {string[][]}
|
|
957
|
+
*/
|
|
958
|
+
export function declarationPaths(at, blocks) {
|
|
959
|
+
return (blocks.get(declarationKey(at)) ?? []).map(p => [
|
|
960
|
+
...p,
|
|
961
|
+
camel(at.property),
|
|
962
|
+
]);
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
|
|
966
|
+
/**
|
|
967
|
+
* Where a reported setting is written, as warnings say it: ` (line 12)`,
|
|
968
|
+
* ` (themes/base/base.theme.ts, line 12)` in a file other than the one
|
|
969
|
+
* built, or nothing when no line is known.
|
|
970
|
+
* @param {{line?: number | null, file?: string}} entry
|
|
971
|
+
*/
|
|
972
|
+
export const settingIssueLocation = entry =>
|
|
973
|
+
entry.line != null
|
|
974
|
+
? ` (${entry.file ? `${entry.file}, ` : ''}line ${entry.line})`
|
|
975
|
+
: '';
|
|
976
|
+
|
|
977
|
+
/**
|
|
978
|
+
* The note that stands for the settings a generated file writes that do not
|
|
979
|
+
* show as written: their count, the file and the tool that writes it, and
|
|
980
|
+
* where the full list is.
|
|
981
|
+
* @param {number} count
|
|
982
|
+
* @param {string} file - as the reader sees it
|
|
983
|
+
* @param {string} [by] - the tool the file's generated mark names
|
|
984
|
+
* @param {string} [listedBy] - what lists each setting (`--json` by default)
|
|
985
|
+
*/
|
|
986
|
+
export const generatedSettingNotice = (
|
|
987
|
+
count,
|
|
988
|
+
file,
|
|
989
|
+
by,
|
|
990
|
+
listedBy = '--json',
|
|
991
|
+
) => {
|
|
992
|
+
const one = count === 1;
|
|
993
|
+
return `${count} ${one ? 'setting' : 'settings'} that ${file} writes ${one ? 'does' : 'do'} not show as written; that file is generated, so fix ${one ? 'it' : 'them'} in its generator${by ? `, ${by}` : ''} (${listedBy} lists ${one ? 'it' : 'each'})`;
|
|
994
|
+
};
|
|
995
|
+
|
|
996
|
+
/**
|
|
997
|
+
* One note of a generated file's settings: the file, as the reader sees it,
|
|
998
|
+
* and the note's text.
|
|
999
|
+
* @typedef {{file: string, text: string}} GeneratedSettingNote
|
|
1000
|
+
*/
|
|
1001
|
+
|
|
1002
|
+
/**
|
|
1003
|
+
* The setting issues to name one by one, and one note per generated file
|
|
1004
|
+
* for the rest: a file that says a tool generates it is not where their fix
|
|
1005
|
+
* goes. `theme build` and `astryx doctor` both say them this way.
|
|
1006
|
+
* @template T
|
|
1007
|
+
* @param {Array<T & {file?: string | undefined}>} entries
|
|
1008
|
+
* @param {(file: string | undefined) => {by?: string} | null} generatedOf -
|
|
1009
|
+
* whether the file that writes an entry (undefined: the theme's own) is
|
|
1010
|
+
* generated, and by what
|
|
1011
|
+
* @param {(file: string | undefined) => string} shown - the file as the
|
|
1012
|
+
* reader sees it
|
|
1013
|
+
* @param {{listedBy?: string}} [options] - `listedBy`: what lists each
|
|
1014
|
+
* setting, as the note names it
|
|
1015
|
+
* @returns {{listed: Array<T & {file?: string | undefined}>, notes: GeneratedSettingNote[]}}
|
|
1016
|
+
*/
|
|
1017
|
+
export function splitGeneratedIssues(
|
|
1018
|
+
entries,
|
|
1019
|
+
generatedOf,
|
|
1020
|
+
shown,
|
|
1021
|
+
options = {},
|
|
1022
|
+
) {
|
|
1023
|
+
/** @type {Array<T & {file?: string | undefined}>} */
|
|
1024
|
+
const listed = [];
|
|
1025
|
+
/** @type {Map<string | undefined, {count: number, by?: string}>} */
|
|
1026
|
+
const generated = new Map();
|
|
1027
|
+
for (const entry of entries) {
|
|
1028
|
+
const mark = generatedOf(entry.file);
|
|
1029
|
+
if (!mark) {
|
|
1030
|
+
listed.push(entry);
|
|
1031
|
+
continue;
|
|
1032
|
+
}
|
|
1033
|
+
const seen = generated.get(entry.file);
|
|
1034
|
+
generated.set(entry.file, {count: (seen?.count ?? 0) + 1, by: mark.by});
|
|
1035
|
+
}
|
|
1036
|
+
return {
|
|
1037
|
+
listed,
|
|
1038
|
+
notes: [...generated].map(([file, {count, by}]) => ({
|
|
1039
|
+
file: shown(file),
|
|
1040
|
+
text: generatedSettingNotice(count, shown(file), by, options.listedBy),
|
|
1041
|
+
})),
|
|
1042
|
+
};
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
/**
|
|
1046
|
+
* The notes of several builds (a family's members, doctor's local themes)
|
|
1047
|
+
* as one note per generated file: a theme that extends a generated one
|
|
1048
|
+
* reports that file's settings too. Each with the labels of every build
|
|
1049
|
+
* that reported it, in order.
|
|
1050
|
+
* @param {Array<{label?: string, notes: GeneratedSettingNote[]}>} reports
|
|
1051
|
+
* @returns {Array<GeneratedSettingNote & {labels: string[]}>}
|
|
1052
|
+
*/
|
|
1053
|
+
export function generatedNotesByFile(reports) {
|
|
1054
|
+
/** @type {Map<string, GeneratedSettingNote & {labels: string[]}>} */
|
|
1055
|
+
const byFile = new Map();
|
|
1056
|
+
for (const {label, notes} of reports)
|
|
1057
|
+
for (const note of notes) {
|
|
1058
|
+
const seen = byFile.get(note.file);
|
|
1059
|
+
if (!seen)
|
|
1060
|
+
byFile.set(note.file, {...note, labels: label == null ? [] : [label]});
|
|
1061
|
+
else if (label != null && !seen.labels.includes(label))
|
|
1062
|
+
seen.labels.push(label);
|
|
1063
|
+
}
|
|
1064
|
+
return [...byFile.values()];
|
|
1065
|
+
}
|