@astryxdesign/cli 0.7.18-canary.gfacee17 → 0.7.18
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 +185 -19
- package/README.md +19 -19
- package/api/component/_adapter.d.mts +2 -1
- package/api/component/_adapter.mjs +2 -1
- package/api/docs/_adapter.d.mts +6 -5
- package/api/docs/_adapter.mjs +36 -5
- package/api/doctor/_adapter.d.mts +6 -3
- package/api/doctor/_adapter.mjs +13 -5
- package/api/doctor/doctor.mjs +5 -5
- package/api/doctor/font-packages.d.mts +36 -0
- package/api/doctor/font-packages.mjs +124 -0
- package/api/doctor/theme-checks.mjs +110 -49
- package/api/experimental.d.mts +0 -2
- package/api/experimental.mjs +0 -12
- package/api/icon/_adapter.d.mts +2 -2
- package/api/icon/_adapter.mjs +6 -2
- package/api/icon/_authoring.mjs +22 -13
- package/api/icon/_default-look.mjs +15 -15
- package/api/icon/add/add.mjs +14 -9
- package/api/icon/icon.doc.mjs +7 -7
- package/api/icon/icon.type.d.mts +33 -33
- package/api/icon/icon.type.mjs +45 -45
- package/api/icon/iconAdd.doc.mjs +9 -10
- package/api/icon/iconMap.doc.mjs +11 -12
- package/api/icon/iconNewDefinition.doc.mjs +8 -8
- package/api/icon/iconNewSet.doc.mjs +5 -5
- package/api/icon/map/map.mjs +7 -7
- package/api/icon/use/use.mjs +4 -4
- package/api/init/run/run.mjs +0 -1
- package/api/integration/add-helpers.mjs +1 -1
- package/api/integration/validate-integration.type.d.mts +6 -6
- package/api/integration/validate-integration.type.mjs +6 -6
- package/api/render/_adapter.d.mts +5 -3
- package/api/render/_adapter.mjs +64 -4
- package/api/render/render.doc.mjs +9 -2
- package/api/render/render.mjs +5 -2
- package/api/render/render.type.d.mts +17 -0
- package/api/render/render.type.mjs +10 -0
- package/api/search/ORDERING.md +1 -1
- package/api/search/_candidate-score.mjs +20 -0
- package/api/search/_words.d.mts +8 -0
- package/api/search/_words.mjs +15 -0
- package/api/template/template.type.d.mts +2 -2
- package/api/template/template.type.mjs +2 -2
- package/api/theme/_adapter.mjs +19 -11
- package/api/theme/build/build.d.mts +19 -51
- package/api/theme/build/build.mjs +195 -189
- package/api/theme/build/font-warning.d.mts +19 -2
- package/api/theme/build/font-warning.mjs +46 -5
- package/api/theme/generateTonalPalette.doc.mjs +1 -1
- package/api/theme/palette/generate/derive-look.mjs +108 -37
- package/api/theme/palette/generate/mapping.mjs +2 -0
- package/api/theme/template/template.d.mts +0 -17
- package/api/theme/template/template.mjs +1 -42
- package/api/theme/theme.type.d.mts +5 -4
- package/api/theme/theme.type.mjs +5 -4
- package/api/theme/themePaletteGenerate.doc.mjs +1 -1
- package/api/theme/themeRemove.doc.mjs +1 -1
- package/assets/codemods/transforms/v0.7.0/preserve-bottom-sheet-content-padding.mjs +3 -1
- package/assets/component-list.generated.json +1 -1
- package/assets/discover/official-packages.json +26 -2
- package/assets/docs/author-a-theme.doc.mjs +6 -5
- package/assets/docs/browser-support.doc.mjs +1 -0
- package/assets/docs/icons.doc.mjs +8 -7
- package/assets/docs/motion.doc.mjs +46 -0
- package/assets/docs/theme.doc.dense.mjs +6 -17
- package/assets/docs/theme.doc.mjs +6 -16
- package/assets/docs/theme.doc.zh.mjs +6 -16
- package/assets/docs/tree/ci-and-containers.doc.mjs +1 -1
- package/assets/docs/tree/data-colors-in-renderers.doc.mjs +400 -0
- package/assets/docs/tree/font-setup.doc.mjs +30 -0
- package/assets/docs/tree/icon-sets.doc.mjs +2 -2
- package/assets/docs/tree/share-a-page.doc.mjs +1 -1
- package/assets/docs/tree/template-icons.doc.mjs +3 -3
- package/assets/docs/tree/tokens-color.doc.mjs +5 -0
- package/assets/docs/tree/tokens.doc.mjs +4 -3
- package/assets/docs/tree/updates.doc.mjs +1 -1
- package/assets/docs/tree/visualization.doc.mjs +30 -0
- package/assets/docs-routes.generated.json +1 -1
- package/assets/docs.generated.json +2 -2
- package/assets/icons/definitions/drag.doc.mjs +1 -0
- package/assets/search-catalog.generated.json +2 -2
- package/assets/self-audit.generated.json +1 -1
- package/assets/templates/blocks/components/Card/SelectableCardElevated.doc.mjs +1 -1
- package/assets/templates/blocks/components/Card/SelectableCardElevated.tsx +20 -10
- package/assets/templates/blocks/components/Card/SelectableCardShowcase.doc.mjs +1 -1
- package/assets/templates/blocks/components/Card/SelectableCardShowcase.tsx +36 -16
- package/assets/templates/blocks/components/ChatComposerInput/ChatComposerInputMentionTrigger.tsx +6 -0
- package/assets/templates/blocks/components/ChatComposerInput/ChatComposerInputMultipleTriggers.tsx +6 -0
- package/assets/templates/blocks/components/Hooks/useIndicatorFocusRingHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/Hooks/useIndicatorFocusRingHookUsage.tsx +63 -0
- package/assets/templates/blocks/components/Hooks/useLongPressHookUsage.doc.mjs +29 -0
- package/assets/templates/blocks/components/Hooks/useLongPressHookUsage.tsx +237 -0
- package/assets/templates/blocks/components/SideNav/SideNavShowcase.tsx +10 -72
- package/assets/templates/blocks/components/SideNav/SideNavWithHeaderMenu.doc.mjs +1 -1
- package/assets/templates/blocks/components/SideNav/SideNavWithHeaderMenu.tsx +7 -7
- package/assets/templates/blocks/components/Table/TableCustomRowTable.doc.mjs +14 -0
- package/assets/templates/blocks/components/Table/TableCustomRowTable.tsx +96 -0
- package/assets/templates/components.generated.json +1 -1
- package/assets/templates/pages/ai-chat-landing/page.tsx +4 -0
- package/assets/templates/pages/dashboard-scorecard/page.tsx +26 -7
- package/assets/templates/pages/editor/page.tsx +13 -3
- package/assets/templates/themes/butter/butterPaletteRefs.generated.ts +2 -2
- package/assets/templates/themes/butter/butterTheme.ts +12 -10
- package/assets/templates/themes/butter/icons.tsx +2 -0
- package/assets/templates/themes/chocolate/chocolateTheme.ts +1 -0
- package/assets/templates/themes/chocolate/icons.tsx +2 -0
- package/assets/templates/themes/gothic/gothicPaletteRefs.generated.ts +1 -1
- package/assets/templates/themes/gothic/gothicTheme.ts +1 -0
- package/assets/templates/themes/gothic/icons.tsx +2 -0
- package/assets/templates/themes/matcha/icons.tsx +2 -0
- package/assets/templates/themes/matcha/matchaPaletteRefs.generated.ts +2 -2
- package/assets/templates/themes/matcha/matchaTheme.ts +1 -0
- package/assets/templates/themes/neutral/icons.tsx +2 -0
- package/assets/templates/themes/neutral/neutralPaletteRefs.generated.ts +2 -2
- package/assets/templates/themes/neutral/neutralTheme.ts +1 -0
- package/assets/templates/themes/stone/icons.tsx +2 -0
- package/assets/templates/themes/stone/stonePaletteRefs.generated.ts +1 -1
- package/assets/templates/themes/stone/stoneTheme.ts +1 -0
- package/assets/templates/themes/y2k/icons.tsx +2 -0
- package/assets/templates/themes/y2k/y2kTheme.ts +1 -0
- package/assets/theme.template.ts +9 -5
- package/authoring/config/parse.mjs +1 -1
- package/authoring/doctypes/base/type.ts +2 -3
- package/authoring/doctypes/component/component.doc.mjs +1 -1
- package/authoring/doctypes/icon-set/icon-names.mjs +1 -0
- package/authoring/integration/integration.doc.mjs +1 -1
- package/authoring/integration/type.ts +1 -1
- package/clients/cli/build-id.generated.json +1 -1
- package/clients/cli/commands/doctor.mjs +2 -2
- package/clients/cli/commands/experimental/export.mjs +2 -1
- package/clients/cli/commands/experimental/icon.mjs +17 -17
- package/clients/cli/commands/experimental/index.mjs +0 -5
- package/clients/cli/commands/experimental/render-output.mjs +9 -0
- package/clients/cli/commands/experimental-export.doc.mjs +6 -0
- package/clients/cli/commands/experimental-icon-add.doc.mjs +8 -8
- package/clients/cli/commands/experimental-icon-map.doc.mjs +6 -6
- package/clients/cli/commands/experimental-icon-new-definition.doc.mjs +6 -6
- package/clients/cli/commands/experimental-icon-new-set.doc.mjs +3 -3
- package/clients/cli/commands/experimental-icon-use.doc.mjs +1 -1
- package/clients/cli/commands/experimental-icon.doc.mjs +6 -6
- package/clients/cli/commands/experimental.doc.mjs +2 -6
- package/clients/cli/commands/template.mjs +1 -1
- package/clients/cli/commands/theme-build.doc.mjs +8 -1
- package/clients/cli/commands/theme-palette-generate.doc.mjs +1 -1
- package/clients/cli/commands/theme-remove.doc.mjs +1 -1
- package/clients/cli/commands/theme.doc.mjs +1 -11
- package/clients/cli/commands/theme.mjs +110 -475
- package/clients/cli/commands.generated.json +1 -1
- package/clients/cli/index.mjs +4 -34
- package/clients/cli/lib/base-gate.mjs +2 -3
- package/clients/cli/lib/cli-error.mjs +8 -72
- package/clients/cli/lib/define-command.mjs +0 -19
- package/clients/cli/lib/json-shim.mjs +11 -633
- package/clients/cli/lib/manifest.mjs +0 -4
- package/clients/cli/lib/stray-option.mjs +1 -2
- package/clients/cli/manifest.generated.json +1 -1
- package/foundation/agent-docs/agent-docs.mjs +1 -1
- package/foundation/color/css-color.mjs +2 -3
- package/foundation/discovery/app-layout.d.mts +13 -0
- package/foundation/discovery/app-layout.mjs +35 -0
- package/foundation/discovery/cli-self-docs.mjs +4 -4
- package/foundation/discovery/fixture-refs.d.mts +51 -0
- package/foundation/discovery/fixture-refs.mjs +351 -0
- package/foundation/discovery/icon-definition-discovery.mjs +7 -7
- package/foundation/discovery/icon-ranking.mjs +2 -2
- package/foundation/discovery/icon-set-checks.mjs +6 -6
- package/foundation/discovery/icon-set-discovery.mjs +2 -2
- package/foundation/discovery/icon-set-writer.d.mts +24 -7
- package/foundation/discovery/icon-set-writer.mjs +75 -31
- package/foundation/discovery/static-descriptor.d.mts +49 -0
- package/foundation/discovery/static-descriptor.mjs +548 -0
- package/foundation/discovery/template-adapter.d.mts +0 -47
- package/foundation/discovery/template-adapter.mjs +1 -333
- package/foundation/discovery/theme-discovery.d.mts +6 -47
- package/foundation/discovery/theme-discovery.mjs +15 -537
- package/foundation/doc-compiler/bundle.mjs +2 -2
- package/foundation/doc-compiler/import.mjs +1 -1
- package/foundation/env/user-dirs.d.mts +5 -2
- package/foundation/env/user-dirs.mjs +12 -5
- package/foundation/fonts/next-font.d.mts +26 -0
- package/foundation/fonts/next-font.mjs +149 -0
- package/foundation/fs/empty-folder.mjs +2 -2
- package/foundation/fs/read-record.mjs +11 -4
- package/foundation/pictures/pictures.d.mts +152 -0
- package/foundation/pictures/pictures.mjs +565 -0
- package/foundation/release/folder-lock.mjs +3 -2
- package/foundation/render/cut-short.d.mts +2 -2
- package/foundation/render/cut-short.mjs +2 -2
- package/foundation/render/drawn-contrast.d.mts +2 -2
- package/foundation/render/drawn-contrast.mjs +2 -2
- package/foundation/render/font-probe.d.mts +2 -2
- package/foundation/render/font-probe.mjs +2 -2
- package/foundation/render/layers.mjs +1 -2
- package/foundation/render/package-resolve-hooks.d.mts +25 -5
- package/foundation/render/package-resolve-hooks.mjs +77 -14
- package/foundation/render/page-worker.mjs +24 -12
- package/foundation/render/part-boxes.d.mts +2 -3
- package/foundation/render/part-boxes.mjs +2 -3
- package/foundation/render/picture-chrome.mjs +18 -15
- package/foundation/render/picture-playwright.mjs +10 -7
- package/foundation/render/picture-window.d.mts +13 -0
- package/foundation/render/picture-window.mjs +31 -0
- package/foundation/render/render-page.d.mts +1 -1
- package/foundation/render/render-page.mjs +4 -5
- package/foundation/render/single-copy-hooks.d.mts +2 -0
- package/foundation/render/single-copy-hooks.mjs +2 -0
- package/foundation/response/error-codes.doc.mjs +14 -14
- package/foundation/response/error-codes.mjs +13 -13
- package/foundation/response/response-types.doc.mjs +8 -69
- package/foundation/runtime/css-tree.mjs +2 -2
- package/foundation/runtime/word-table.d.mts +1 -1
- package/foundation/runtime/word-table.mjs +1 -1
- package/foundation/suggest/other-command.d.mts +52 -15
- package/foundation/suggest/other-command.mjs +168 -45
- package/foundation/text/suggest-order.d.mts +7 -0
- package/foundation/text/suggest-order.mjs +1 -1
- package/package.json +7 -8
- package/api/theme-edit/_adapter.d.mts +0 -228
- package/api/theme-edit/_adapter.mjs +0 -2025
- package/api/theme-edit/_catalog.d.mts +0 -172
- package/api/theme-edit/_catalog.mjs +0 -806
- package/api/theme-edit/_check.d.mts +0 -391
- package/api/theme-edit/_check.mjs +0 -9370
- package/api/theme-edit/_color.d.mts +0 -135
- package/api/theme-edit/_color.mjs +0 -480
- package/api/theme-edit/_compiler.d.mts +0 -77
- package/api/theme-edit/_compiler.mjs +0 -1053
- package/api/theme-edit/_context.d.mts +0 -399
- package/api/theme-edit/_context.mjs +0 -1778
- package/api/theme-edit/_css.d.mts +0 -169
- package/api/theme-edit/_css.mjs +0 -1167
- package/api/theme-edit/_edit.d.mts +0 -167
- package/api/theme-edit/_edit.mjs +0 -11220
- package/api/theme-edit/_how-commands.d.mts +0 -315
- package/api/theme-edit/_how-commands.mjs +0 -1664
- package/api/theme-edit/_how-question.d.mts +0 -341
- package/api/theme-edit/_how-question.mjs +0 -33291
- package/api/theme-edit/_how-sides.d.mts +0 -22
- package/api/theme-edit/_how-sides.mjs +0 -173
- package/api/theme-edit/_how-steps.d.mts +0 -42
- package/api/theme-edit/_how-steps.mjs +0 -208
- package/api/theme-edit/_how-values.d.mts +0 -29
- package/api/theme-edit/_how-values.mjs +0 -111
- package/api/theme-edit/_how-words.d.mts +0 -15
- package/api/theme-edit/_how-words.mjs +0 -239
- package/api/theme-edit/_how.d.mts +0 -55
- package/api/theme-edit/_how.mjs +0 -2388
- package/api/theme-edit/_importers.d.mts +0 -38
- package/api/theme-edit/_importers.mjs +0 -188
- package/api/theme-edit/_marks.d.mts +0 -39
- package/api/theme-edit/_marks.mjs +0 -67
- package/api/theme-edit/_missed.d.mts +0 -56
- package/api/theme-edit/_missed.mjs +0 -1128
- package/api/theme-edit/_name-rule.d.mts +0 -11
- package/api/theme-edit/_name-rule.mjs +0 -12
- package/api/theme-edit/_normal.d.mts +0 -365
- package/api/theme-edit/_normal.mjs +0 -1978
- package/api/theme-edit/_overview.d.mts +0 -9
- package/api/theme-edit/_overview.mjs +0 -293
- package/api/theme-edit/_palette.d.mts +0 -616
- package/api/theme-edit/_palette.mjs +0 -2776
- package/api/theme-edit/_part-pieces.d.mts +0 -54
- package/api/theme-edit/_part-pieces.mjs +0 -179
- package/api/theme-edit/_part-words.d.mts +0 -39
- package/api/theme-edit/_part-words.mjs +0 -242
- package/api/theme-edit/_parts.d.mts +0 -402
- package/api/theme-edit/_parts.mjs +0 -2294
- package/api/theme-edit/_picture-traits.d.mts +0 -259
- package/api/theme-edit/_picture-traits.mjs +0 -1030
- package/api/theme-edit/_png.d.mts +0 -94
- package/api/theme-edit/_png.mjs +0 -479
- package/api/theme-edit/_preview-app.d.mts +0 -172
- package/api/theme-edit/_preview-app.mjs +0 -6430
- package/api/theme-edit/_preview.d.mts +0 -549
- package/api/theme-edit/_preview.mjs +0 -3264
- package/api/theme-edit/_project.d.mts +0 -207
- package/api/theme-edit/_project.mjs +0 -643
- package/api/theme-edit/_resolved.d.mts +0 -46
- package/api/theme-edit/_resolved.mjs +0 -800
- package/api/theme-edit/_set-line.d.mts +0 -29
- package/api/theme-edit/_set-line.mjs +0 -100
- package/api/theme-edit/_settings.d.mts +0 -2426
- package/api/theme-edit/_settings.mjs +0 -18435
- package/api/theme-edit/_tables.d.mts +0 -227
- package/api/theme-edit/_tables.mjs +0 -1128
- package/api/theme-edit/_text-looks.d.mts +0 -78
- package/api/theme-edit/_text-looks.mjs +0 -376
- package/api/theme-edit/_vet.d.mts +0 -50
- package/api/theme-edit/_vet.mjs +0 -166
- package/api/theme-edit/how/how.d.mts +0 -17
- package/api/theme-edit/how/how.mjs +0 -28
- package/api/theme-edit/new/new.d.mts +0 -11
- package/api/theme-edit/new/new.mjs +0 -22
- package/api/theme-edit/preview-add/preview-add.d.mts +0 -14
- package/api/theme-edit/preview-add/preview-add.mjs +0 -25
- package/api/theme-edit/preview-app/preview-app.d.mts +0 -13
- package/api/theme-edit/preview-app/preview-app.mjs +0 -24
- package/api/theme-edit/preview-list/preview-list.d.mts +0 -10
- package/api/theme-edit/preview-list/preview-list.mjs +0 -21
- package/api/theme-edit/preview-remove/preview-remove.d.mts +0 -12
- package/api/theme-edit/preview-remove/preview-remove.mjs +0 -23
- package/api/theme-edit/set/set.d.mts +0 -13
- package/api/theme-edit/set/set.mjs +0 -24
- package/api/theme-edit/show/show.d.mts +0 -13
- package/api/theme-edit/show/show.mjs +0 -24
- package/api/theme-edit/theme-edit.d.mts +0 -12
- package/api/theme-edit/theme-edit.mjs +0 -36
- package/api/theme-edit/theme-edit.type.d.mts +0 -730
- package/api/theme-edit/theme-edit.type.mjs +0 -342
- package/api/theme-edit/themeEditHow.doc.d.mts +0 -6
- package/api/theme-edit/themeEditHow.doc.mjs +0 -105
- package/api/theme-edit/themeEditNew.doc.d.mts +0 -5
- package/api/theme-edit/themeEditNew.doc.mjs +0 -112
- package/api/theme-edit/themeEditPreviewAdd.doc.d.mts +0 -6
- package/api/theme-edit/themeEditPreviewAdd.doc.mjs +0 -121
- package/api/theme-edit/themeEditPreviewApp.doc.d.mts +0 -6
- package/api/theme-edit/themeEditPreviewApp.doc.mjs +0 -87
- package/api/theme-edit/themeEditPreviewList.doc.d.mts +0 -6
- package/api/theme-edit/themeEditPreviewList.doc.mjs +0 -62
- package/api/theme-edit/themeEditPreviewRemove.doc.d.mts +0 -6
- package/api/theme-edit/themeEditPreviewRemove.doc.mjs +0 -96
- package/api/theme-edit/themeEditSet.doc.d.mts +0 -6
- package/api/theme-edit/themeEditSet.doc.mjs +0 -175
- package/api/theme-edit/themeEditShow.doc.d.mts +0 -6
- package/api/theme-edit/themeEditShow.doc.mjs +0 -118
- package/api/theme-edit/themeEditUndo.doc.d.mts +0 -6
- package/api/theme-edit/themeEditUndo.doc.mjs +0 -133
- package/api/theme-edit/undo/undo.d.mts +0 -13
- package/api/theme-edit/undo/undo.mjs +0 -24
- package/assets/preview-app/README.md +0 -6
- package/assets/preview-app/css.d.ts +0 -5
- package/assets/preview-app/gitignore +0 -4
- package/assets/preview-app/next.config.mjs +0 -12
- package/assets/preview-app/package.json +0 -24
- package/assets/preview-app/src/app/globals.css +0 -6
- package/assets/preview-app/src/app/layout.tsx +0 -21
- package/assets/preview-app/src/app/page.tsx +0 -94
- package/assets/preview-app/src/app/providers.tsx +0 -16
- package/assets/preview-app/tsconfig.json +0 -27
- package/clients/cli/commands/experimental/theme.mjs +0 -2990
- package/clients/cli/commands/experimental-theme-add.doc.mjs +0 -80
- package/clients/cli/commands/experimental-theme-compile.doc.mjs +0 -98
- package/clients/cli/commands/experimental-theme-editor-how.doc.mjs +0 -196
- package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +0 -174
- package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +0 -139
- package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +0 -77
- package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +0 -105
- package/clients/cli/commands/experimental-theme-editor.doc.mjs +0 -49
- package/clients/cli/commands/experimental-theme-eject.doc.mjs +0 -72
- package/clients/cli/commands/experimental-theme-list.doc.mjs +0 -49
- package/clients/cli/commands/experimental-theme-preview-add.doc.mjs +0 -88
- package/clients/cli/commands/experimental-theme-preview-app.doc.mjs +0 -61
- package/clients/cli/commands/experimental-theme-preview-list.doc.mjs +0 -48
- package/clients/cli/commands/experimental-theme-preview-remove.doc.mjs +0 -59
- package/clients/cli/commands/experimental-theme-preview.doc.mjs +0 -41
- package/clients/cli/commands/experimental-theme-remove.doc.mjs +0 -57
- package/clients/cli/commands/experimental-theme-targets.doc.mjs +0 -62
- package/clients/cli/commands/experimental-theme-template.doc.mjs +0 -63
- package/clients/cli/commands/experimental-theme-use.doc.mjs +0 -57
- package/clients/cli/commands/experimental-theme.doc.mjs +0 -60
- package/foundation/fonts/fontsource-families.generated.d.mts +0 -5
- package/foundation/fonts/fontsource-families.generated.mjs +0 -2110
package/api/icon/icon.type.mjs
CHANGED
|
@@ -40,16 +40,16 @@
|
|
|
40
40
|
* @property {string} export - The named export that draws the default variant.
|
|
41
41
|
* @property {string} import - The import line for the default variant.
|
|
42
42
|
* @property {string[]} words - Terms a person might search for.
|
|
43
|
-
* @property {string[]} definitions - The icon
|
|
43
|
+
* @property {string[]} definitions - The icon meanings the set's `map` names this icon for.
|
|
44
44
|
* @property {IconVariantEntry[]} variants - Other variants.
|
|
45
45
|
*/
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
|
-
* A
|
|
48
|
+
* A meaning in the same group as another (its family of related
|
|
49
49
|
* meanings), so a reader picks the one that fits.
|
|
50
50
|
* @experimental May change or be removed in a patch release.
|
|
51
51
|
* @typedef {object} IconDefinitionRelative
|
|
52
|
-
* @property {string} definition - The related
|
|
52
|
+
* @property {string} definition - The related meaning's name.
|
|
53
53
|
* @property {string} description - What it means.
|
|
54
54
|
*/
|
|
55
55
|
|
|
@@ -57,9 +57,9 @@
|
|
|
57
57
|
* One ranked icon match. When the project picks a look and the match's set
|
|
58
58
|
* is in its list, `module`, `export`, and `import` draw that look; `look`
|
|
59
59
|
* is present when the icon does not have it. `relatives` is present when the
|
|
60
|
-
* groups of the
|
|
60
|
+
* groups of the meanings it draws have other members: those meanings,
|
|
61
61
|
* Astryx's and its set's own. In the `icon.search` answer, `meaningImport` is
|
|
62
|
-
* present when the set's `map` names the icon for a
|
|
62
|
+
* present when the set's `map` names the icon for a meaning: the import
|
|
63
63
|
* line that names the icon by that meaning
|
|
64
64
|
* (`import {TrashIcon as DeleteIcon} from '…'`).
|
|
65
65
|
* @experimental May change or be removed in a patch release.
|
|
@@ -67,15 +67,15 @@
|
|
|
67
67
|
*/
|
|
68
68
|
|
|
69
69
|
/**
|
|
70
|
-
* One Astryx icon
|
|
70
|
+
* One Astryx icon meaning that matches a query when no icon set is
|
|
71
71
|
* installed.
|
|
72
72
|
* @experimental May change or be removed in a patch release.
|
|
73
73
|
* @typedef {object} IconSearchDefinition
|
|
74
|
-
* @property {string} name - The
|
|
74
|
+
* @property {string} name - The meaning's name.
|
|
75
75
|
* @property {boolean} builtIn - Core draws it by name with no icon set.
|
|
76
|
-
* @property {string} description - What
|
|
77
|
-
* @property {string} [group] - Present when the
|
|
78
|
-
* @property {IconDefinitionRelative[]} [relatives] - Present when its group has other members: those
|
|
76
|
+
* @property {string} description - What it means.
|
|
77
|
+
* @property {string} [group] - Present when the meaning names one: the family of related meanings it belongs to.
|
|
78
|
+
* @property {IconDefinitionRelative[]} [relatives] - Present when its group has other members: those meanings, so a reader picks the one that fits.
|
|
79
79
|
*/
|
|
80
80
|
|
|
81
81
|
/**
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
* @property {number} data.matchCount - Every match, before `limit`.
|
|
89
89
|
* @property {IconMatchEntry[]} data.matches - The ranked matches, at most `limit`.
|
|
90
90
|
* @property {string} [data.reason] - Present when no icon set is installed: why nothing matches.
|
|
91
|
-
* @property {IconSearchDefinition[]} [data.definitions] - Present when no icon set is installed: the Astryx icon
|
|
91
|
+
* @property {IconSearchDefinition[]} [data.definitions] - Present when no icon set is installed: the Astryx icon meanings that match, built-in ones first, with the built-in that draws in place of a matching meaning Core does not draw (`help` brings `info`) unless a match ranked above it has none, at most `limit`.
|
|
92
92
|
* @property {string} [data.next] - Present when no icon set is installed: how to get one.
|
|
93
93
|
*/
|
|
94
94
|
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
* @property {number} iconCount
|
|
114
114
|
* @property {IconSetDefaultVariant | null} default
|
|
115
115
|
* @property {string[] | null} variants - The variants the set declares: named looks such as outline or solid; size comes from CSS.
|
|
116
|
-
* @property {IconSetCoverage} coverage - Which icon
|
|
116
|
+
* @property {IconSetCoverage} coverage - Which icon meanings the set's `map` covers.
|
|
117
117
|
* @property {boolean} project - Whether this is the project's icon set.
|
|
118
118
|
* @property {'main' | 'backup' | null} role - The set's place in the project's list: its main set, a backup, or not listed.
|
|
119
119
|
* @property {number | null} rank - The set's position in the list, the main set at 1; null when it is not listed.
|
|
@@ -121,12 +121,12 @@
|
|
|
121
121
|
*/
|
|
122
122
|
|
|
123
123
|
/**
|
|
124
|
-
* Which icon
|
|
124
|
+
* Which icon meanings one set's `map` covers.
|
|
125
125
|
* @experimental May change or be removed in a patch release.
|
|
126
126
|
* @typedef {object} IconSetCoverage
|
|
127
|
-
* @property {{mapped: number, total: number, missing: string[]}} builtIn - Built-in
|
|
128
|
-
* @property {{mapped: number, total: number}} astryx - Every Astryx
|
|
129
|
-
* @property {string[]} own - The
|
|
127
|
+
* @property {{mapped: number, total: number, missing: string[]}} builtIn - Built-in meanings: every set maps them all.
|
|
128
|
+
* @property {{mapped: number, total: number}} astryx - Every Astryx meaning, built in or not.
|
|
129
|
+
* @property {string[]} own - The meanings the set declares itself, in its `definitions` folder.
|
|
130
130
|
*/
|
|
131
131
|
|
|
132
132
|
/**
|
|
@@ -187,8 +187,8 @@
|
|
|
187
187
|
* @typedef {object} IconMapOptions
|
|
188
188
|
* @property {string} [cwd]
|
|
189
189
|
* @property {string} [set] - The set to edit, when the package ships several.
|
|
190
|
-
* @property {boolean} [remove] - Remove the
|
|
191
|
-
* @property {string | string[]} [pairs] - Many entries at once, as `<definition>=<icon>` pairs separated by commas or spaces; then no
|
|
190
|
+
* @property {boolean} [remove] - Remove the meaning's entry instead.
|
|
191
|
+
* @property {string | string[]} [pairs] - Many entries at once, as `<definition>=<icon>` pairs separated by commas or spaces; then no meaning or icon is passed. All are checked before any is written.
|
|
192
192
|
*/
|
|
193
193
|
|
|
194
194
|
/**
|
|
@@ -203,9 +203,9 @@
|
|
|
203
203
|
* @property {Array<{definition: string, icon: string, previous: string | null, changed: boolean}>} data.entries - Each pair, in order, and what it replaced.
|
|
204
204
|
* @property {boolean} data.changed - Whether the file was written.
|
|
205
205
|
* @property {{previous: string, module: string}} [data.moduleUpdate] - The data file's `module` before and after this command, when the package was renamed and the command wrote its new name.
|
|
206
|
-
* @property {Array<{key: string, definition: string}>} [data.replacedKeys] - Each `map` key that named a replaced icon
|
|
206
|
+
* @property {Array<{key: string, definition: string}>} [data.replacedKeys] - Each `map` key that named a replaced icon meaning; the command wrote it under the meaning that replaced it.
|
|
207
207
|
* @property {string[]} [data.files] - The generated module and its types, when its theme map was rewritten.
|
|
208
|
-
* @property {IconTemplateMeanings} [data.templateMeanings] - After a write: the icon
|
|
208
|
+
* @property {IconTemplateMeanings} [data.templateMeanings] - After a write: the icon meanings the bundled templates use that the set's `map` does not name. A copied template renders a placeholder for each in a project that uses this set.
|
|
209
209
|
*/
|
|
210
210
|
|
|
211
211
|
/**
|
|
@@ -222,9 +222,9 @@
|
|
|
222
222
|
* @property {string | null} data.previous - The icon id it replaced.
|
|
223
223
|
* @property {boolean} data.changed - Whether the file was written.
|
|
224
224
|
* @property {{previous: string, module: string}} [data.moduleUpdate] - The data file's `module` before and after this command, when the package was renamed and the command wrote its new name.
|
|
225
|
-
* @property {Array<{key: string, definition: string}>} [data.replacedKeys] - Each `map` key that named a replaced icon
|
|
225
|
+
* @property {Array<{key: string, definition: string}>} [data.replacedKeys] - Each `map` key that named a replaced icon meaning; the command wrote it under the meaning that replaced it.
|
|
226
226
|
* @property {string[]} [data.files] - The generated module and its types, when its theme map was rewritten.
|
|
227
|
-
* @property {IconTemplateMeanings} [data.templateMeanings] - After a write: the icon
|
|
227
|
+
* @property {IconTemplateMeanings} [data.templateMeanings] - After a write: the icon meanings the bundled templates use that the set's `map` does not name. A copied template renders a placeholder for each in a project that uses this set.
|
|
228
228
|
*/
|
|
229
229
|
|
|
230
230
|
/**
|
|
@@ -234,8 +234,8 @@
|
|
|
234
234
|
* @property {string} [cwd]
|
|
235
235
|
* @property {string} from - The module the icon is exported from: a package, a package subpath, or a relative path in this package.
|
|
236
236
|
* @property {string} [set] - The set to edit, when the package ships several.
|
|
237
|
-
* @property {string} [definition] - The icon
|
|
238
|
-
* @property {string} [newDefinition] - Add the set's own
|
|
237
|
+
* @property {string} [definition] - The icon meaning to map the icon to.
|
|
238
|
+
* @property {string} [newDefinition] - Add the set's own meaning with this name (camelCase, or kebab-case written as camelCase) and map the icon to it.
|
|
239
239
|
* @property {string} [description] - With `newDefinition`: what the icon is for.
|
|
240
240
|
* @property {string[]} [words] - With `newDefinition`: words people search for.
|
|
241
241
|
* @property {boolean} [useDefault] - The module's default export is the icon.
|
|
@@ -272,30 +272,30 @@
|
|
|
272
272
|
* @property {string} data.package
|
|
273
273
|
* @property {{id: string, export: string, module: string}} data.icon
|
|
274
274
|
* @property {string} [data.variant] - The variant, when the export was added as one.
|
|
275
|
-
* @property {string | null} data.definition - The
|
|
276
|
-
* @property {string} [data.newDefinition] - The set's own
|
|
275
|
+
* @property {string | null} data.definition - The meaning mapped to the icon.
|
|
276
|
+
* @property {string} [data.newDefinition] - The set's own meaning the command wrote.
|
|
277
277
|
* @property {string[]} data.files - Files written, relative to the package.
|
|
278
278
|
* @property {boolean} data.changed - Whether anything was written.
|
|
279
|
-
* @property {boolean} data.added - Whether the icon, its variant, its `map` entry, or a new
|
|
279
|
+
* @property {boolean} data.added - Whether the icon, its variant, its `map` entry, or a new meaning was added. False when the set already had them, even when `changed` is true because the command wrote a renamed package's new name.
|
|
280
280
|
* @property {{previous: string, module: string}} [data.moduleUpdate] - The data file's `module` before and after this command, when the package was renamed and the command wrote its new name.
|
|
281
281
|
* @property {string} [data.note] - What the package still needs, as text to copy: the entry line that exports the icon from the set's module, and the package.json `files` that publishes a `./` source.
|
|
282
|
-
* @property {IconTemplateMeanings} [data.templateMeanings] - After a write: the icon
|
|
282
|
+
* @property {IconTemplateMeanings} [data.templateMeanings] - After a write: the icon meanings the bundled templates use that the set's `map` does not name. A copied template renders a placeholder for each in a project that uses this set.
|
|
283
283
|
*/
|
|
284
284
|
|
|
285
285
|
/**
|
|
286
|
-
* One icon
|
|
286
|
+
* One icon meaning that fits an export.
|
|
287
287
|
* @experimental May change or be removed in a patch release.
|
|
288
288
|
* @typedef {object} IconDefinitionMatch
|
|
289
289
|
* @property {string} name
|
|
290
290
|
* @property {string} description
|
|
291
|
-
* @property {'astryx' | 'set'} source - Astryx's
|
|
291
|
+
* @property {'astryx' | 'set'} source - Astryx's meaning, or the set's own.
|
|
292
292
|
* @property {number} score
|
|
293
293
|
* @property {string} reason
|
|
294
294
|
* @property {string} command - The `experimental icon add` command that maps the icon to it.
|
|
295
295
|
*/
|
|
296
296
|
|
|
297
297
|
/**
|
|
298
|
-
* `astryx --json experimental icon add <Export> --from <module>` with no
|
|
298
|
+
* `astryx --json experimental icon add <Export> --from <module>` with no meaning.
|
|
299
299
|
* @experimental May change or be removed in a patch release.
|
|
300
300
|
* @typedef {object} IconDefinitionMatchesResponse
|
|
301
301
|
* @property {'icon.definitionMatches'} type
|
|
@@ -304,7 +304,7 @@
|
|
|
304
304
|
* @property {string} data.from
|
|
305
305
|
* @property {string} data.id - The id the icon would get.
|
|
306
306
|
* @property {IconDefinitionMatch[]} data.matches - At most 10, best first.
|
|
307
|
-
* @property {string | null} data.newDefinition - The command that adds the set's own
|
|
307
|
+
* @property {string | null} data.newDefinition - The command that adds the set's own meaning, when no match fits.
|
|
308
308
|
* @property {string} [data.variant] - When the set already has an icon for the export's glyph from another export of the library: the command that adds this export as that icon's variant.
|
|
309
309
|
*/
|
|
310
310
|
|
|
@@ -317,7 +317,7 @@
|
|
|
317
317
|
* @property {string} [set] - Keep one set, by name or `<package>/<set>`; with `definitions`, the set whose `map` they are checked against.
|
|
318
318
|
* @property {number} [limit] - Max matches (default 10).
|
|
319
319
|
* @property {boolean} [allIcons] - With `set` and no query: every icon of that set.
|
|
320
|
-
* @property {boolean} [definitions] - Every Astryx icon
|
|
320
|
+
* @property {boolean} [definitions] - Every Astryx icon meaning, and nothing else.
|
|
321
321
|
*/
|
|
322
322
|
|
|
323
323
|
/**
|
|
@@ -327,15 +327,15 @@
|
|
|
327
327
|
* @property {'icon.definitions'} type
|
|
328
328
|
* @property {object} data
|
|
329
329
|
* @property {string | null} data.set - The set `mapped` describes, as `<package>/<set>`: the one `set` names, else the project's main set, else the only set of the icon-set package the command runs in; null when there is none.
|
|
330
|
-
* @property {Array<{name: string, builtIn: boolean, description: string, words: string[], group?: string, replaces?: string, templates: number, mapped?: boolean, fallback?: string}>} data.definitions - Every Astryx icon
|
|
330
|
+
* @property {Array<{name: string, builtIn: boolean, description: string, words: string[], group?: string, replaces?: string, templates: number, mapped?: boolean, fallback?: string}>} data.definitions - Every Astryx icon meaning, by name; `builtIn` ones every set maps. `group`: the family of related meanings it belongs to, present when it names one. `replaces`: the older meaning it took the place of, whose name answers with it. `templates`: how many bundled templates use it. `mapped`: whether the set's `map` names it, present when `set` is not null. `fallback`: when it is not mapped, the meaning's fallback the set maps, which a template icon with it draws by.
|
|
331
331
|
*/
|
|
332
332
|
|
|
333
333
|
/**
|
|
334
|
-
* The icon
|
|
334
|
+
* The icon meanings the bundled templates use that a set's `map` does not
|
|
335
335
|
* name.
|
|
336
336
|
* @experimental May change or be removed in a patch release.
|
|
337
337
|
* @typedef {object} IconTemplateMeanings
|
|
338
|
-
* @property {Array<{definition: string, templates: number}>} unmapped - Each such
|
|
338
|
+
* @property {Array<{definition: string, templates: number}>} unmapped - Each such meaning and how many bundled templates use it, most used first, then by name, leaving out a meaning whose fallback the set maps; empty when the set maps them all.
|
|
339
339
|
*/
|
|
340
340
|
|
|
341
341
|
/**
|
|
@@ -347,7 +347,7 @@
|
|
|
347
347
|
* @property {string} data.set
|
|
348
348
|
* @property {string} data.package
|
|
349
349
|
* @property {number} data.iconCount
|
|
350
|
-
* @property {Array<{id: string, export: string, words: string[], definitions: string[]}>} data.icons - Every icon, by id, with the
|
|
350
|
+
* @property {Array<{id: string, export: string, words: string[], definitions: string[]}>} data.icons - Every icon, by id, with the meanings `map` names it for.
|
|
351
351
|
*/
|
|
352
352
|
|
|
353
353
|
/**
|
|
@@ -372,9 +372,9 @@
|
|
|
372
372
|
* @property {string} [cwd] - A directory inside the icon-set package.
|
|
373
373
|
* @property {boolean} [dryRun] - Return the receipt without writing.
|
|
374
374
|
* @property {string} [set] - The set, when the package ships several.
|
|
375
|
-
* @property {string} [description] - What an icon with this
|
|
375
|
+
* @property {string} [description] - What an icon with this meaning is for.
|
|
376
376
|
* @property {string[] | string} [words] - Words people search for; a string is split on commas.
|
|
377
|
-
* @property {string} [icon] - An icon id to map the
|
|
377
|
+
* @property {string} [icon] - An icon id to map the meaning to.
|
|
378
378
|
*/
|
|
379
379
|
|
|
380
380
|
/**
|
|
@@ -395,11 +395,11 @@
|
|
|
395
395
|
* @property {Array<{id: string, from: string, to: string}>} [moved] - On a refresh from a package root: the icons that read one file of that package (`from`) and now import from the root (`to`); each keeps its id, export, `map` entries, variants, and words.
|
|
396
396
|
* @property {{library: string, path: string}} [licenseNoticeMissing] - With `from`: the wrapped library (`name@version`) ships no license file to copy and the set has none. `path` is where to add a NOTICE file that names the library and its license; the CLI never writes it.
|
|
397
397
|
* @property {Array<{from: string, to: string}>} [renamed] - On a refresh: the icons whose id this release's id rule changes, matched by the export the library still has; each keeps its `map` entries, variants, and words.
|
|
398
|
-
* @property {Array<{definition: string, icon: string}>} [mapped] - With `from`: the `map` entries an icon with the
|
|
399
|
-
* @property {Array<{definition: string, icon: string, word: string}>} [suggestions] - With `from`: for each unmapped Astryx
|
|
398
|
+
* @property {Array<{definition: string, icon: string}>} [mapped] - With `from`: the `map` entries an icon with the meaning's exact name gives (on a refresh, every such entry, kept or new); check each.
|
|
399
|
+
* @property {Array<{definition: string, icon: string, word: string}>} [suggestions] - With `from`: for each unmapped Astryx meaning, up to three icons it might map to, best first: the meaning's name in another spelling or as another name of an icon, ids that start with it, an id or another name that is one of its words, then two-word ids that are a one-word word sized, shaped, or numbered (`grid-2x2`); never a negated form, the opposite direction, or an icon already mapped. `word` is the name or word that matched. Never written.
|
|
400
400
|
* @property {string[]} [notes] - What the author does next, including each change the package needs that the CLI never makes itself (its entry, peers, scripts), as text to copy.
|
|
401
|
-
* @property {{previous: string, module: string}} [moduleUpdate] - On a refresh, an update, or a new
|
|
402
|
-
* @property {IconTemplateMeanings} [templateMeanings] - From `iconNewSet()`, except in a dry run: the icon
|
|
401
|
+
* @property {{previous: string, module: string}} [moduleUpdate] - On a refresh, an update, or a new meaning with `icon`: the data file's `module` before and after this command, when the package was renamed and the command writes its new name.
|
|
402
|
+
* @property {IconTemplateMeanings} [templateMeanings] - From `iconNewSet()`, except in a dry run: the icon meanings the bundled templates use that the set's `map` does not name. A copied template renders a placeholder for each in a project that uses this set.
|
|
403
403
|
*/
|
|
404
404
|
|
|
405
405
|
/**
|
|
@@ -431,8 +431,8 @@
|
|
|
431
431
|
* @property {string} name - The set's name.
|
|
432
432
|
* @property {string} package - The integration package that ships the set.
|
|
433
433
|
* @property {import('../../authoring/doctypes/icon-set/type').IconSetData} data - The set's data file.
|
|
434
|
-
* @property {Array<{doc: Record<string, unknown>}>} definitions - The set's own icon
|
|
435
|
-
* @property {Array<{name: string, definition: string}>} [replacedDefinitions] - The old names of the set's own
|
|
434
|
+
* @property {Array<{doc: Record<string, unknown>}>} definitions - The set's own icon meanings.
|
|
435
|
+
* @property {Array<{name: string, definition: string}>} [replacedDefinitions] - The old names of the set's own meanings, each with the current meaning it answers with.
|
|
436
436
|
* @property {string} [look] - The look the folder's project draws the set in (`experimental.iconVariant`), when the set is in its list.
|
|
437
437
|
*/
|
|
438
438
|
|
package/api/icon/iconAdd.doc.mjs
CHANGED
|
@@ -10,10 +10,9 @@ export const doc = {
|
|
|
10
10
|
namespace: 'cli/api',
|
|
11
11
|
stability: 'experimental',
|
|
12
12
|
displayName: 'iconAdd()',
|
|
13
|
-
summary:
|
|
14
|
-
'Register one icon you chose from a library in the set being authored.',
|
|
13
|
+
summary: 'Add one icon you chose from a library to the set being authored.',
|
|
15
14
|
description:
|
|
16
|
-
"Run inside an icon-set package. The caller picks the export; the CLI never searches the library. It proves the export is a runtime component of `from` (a package, a package subpath, or a ./ path to a file inside this package), read without running it. With no
|
|
15
|
+
"Run inside an icon-set package. The caller picks the export; the CLI never searches the library. It proves the export is a runtime component of `from` (a package, a package subpath, or a ./ path to a file inside this package), read without running it. With no meaning it answers the icon meanings that fit the export, Astryx's and the set's own, and writes nothing. With `definition` it adds the icon (id from its name, `module` the source unless the set's own module already exports it, words from its name and the meaning) and maps the meaning to it. With `newDefinition` it first writes the set's own meaning file. A `variant` adds the export as that declared variant of an existing icon. With `variant`, `from`, and `all` and no export name, it adds that variant for every icon of the set whose id an export of `from` has, in one write. Running it again changes nothing. Experimental: it may change or be removed in a patch release.",
|
|
17
16
|
importPath: '@astryxdesign/cli/api',
|
|
18
17
|
signature:
|
|
19
18
|
'iconAdd(exportName: string | undefined, options: IconAddOptions): Promise<IconAddResponse | IconDefinitionMatchesResponse | IconAddVariantsResponse>',
|
|
@@ -47,13 +46,13 @@ export const doc = {
|
|
|
47
46
|
{
|
|
48
47
|
name: 'options.definition',
|
|
49
48
|
type: 'string',
|
|
50
|
-
description: 'The icon
|
|
49
|
+
description: 'The icon meaning to map the icon to.',
|
|
51
50
|
},
|
|
52
51
|
{
|
|
53
52
|
name: 'options.newDefinition',
|
|
54
53
|
type: 'string',
|
|
55
54
|
description:
|
|
56
|
-
"Add the set's own
|
|
55
|
+
"Add the set's own meaning with this name, in camelCase (`aiHelper`) or kebab-case (`ai-helper`), then map the icon to it.",
|
|
57
56
|
},
|
|
58
57
|
{
|
|
59
58
|
name: 'options.description',
|
|
@@ -99,7 +98,7 @@ export const doc = {
|
|
|
99
98
|
{
|
|
100
99
|
type: 'icon.add',
|
|
101
100
|
description:
|
|
102
|
-
"The icon
|
|
101
|
+
"The icon added, the meaning mapped, and the files written. `templateMeanings.unmapped` lists the icon meanings the bundled templates use that the set's `map` does not name, each with its template count, most used first.",
|
|
103
102
|
},
|
|
104
103
|
{
|
|
105
104
|
type: 'icon.addVariants',
|
|
@@ -109,17 +108,17 @@ export const doc = {
|
|
|
109
108
|
{
|
|
110
109
|
type: 'icon.definitionMatches',
|
|
111
110
|
description:
|
|
112
|
-
'Without a
|
|
111
|
+
'Without a meaning: the meanings that fit the export, and the commands that add it.',
|
|
113
112
|
},
|
|
114
113
|
],
|
|
115
114
|
throws: [
|
|
116
115
|
{
|
|
117
116
|
code: 'ERR_NOT_FOUND',
|
|
118
|
-
when: 'the module does not export the name, the
|
|
117
|
+
when: 'the module does not export the name, the meaning is unknown, or `set` names no set in the package or one that is withdrawn (with why)',
|
|
119
118
|
},
|
|
120
119
|
{
|
|
121
120
|
code: 'ERR_INVALID_ARGUMENT',
|
|
122
|
-
when: "the export is data rather than a component, a new
|
|
121
|
+
when: "the export is data rather than a component, a new meaning is named like an Astryx one, or the variant is not one the set declares, is the look each icon's own export already draws, or is no look word of a library whose export names carry look words, or `id` starts with a digit",
|
|
123
122
|
},
|
|
124
123
|
{code: 'ERR_FILE_EXISTS', when: 'another icon already has the id'},
|
|
125
124
|
{
|
|
@@ -149,7 +148,7 @@ export const doc = {
|
|
|
149
148
|
],
|
|
150
149
|
examples: [
|
|
151
150
|
{
|
|
152
|
-
label: 'Which
|
|
151
|
+
label: 'Which meanings fit',
|
|
153
152
|
code: "await iconAdd('Bin', {from: '@acme/glyph-library'});",
|
|
154
153
|
},
|
|
155
154
|
{
|
package/api/icon/iconMap.doc.mjs
CHANGED
|
@@ -10,10 +10,9 @@ export const doc = {
|
|
|
10
10
|
namespace: 'cli/api',
|
|
11
11
|
stability: 'experimental',
|
|
12
12
|
displayName: 'iconMap()',
|
|
13
|
-
summary:
|
|
14
|
-
'Register which icon of the set being authored draws an icon definition.',
|
|
13
|
+
summary: 'Map an icon meaning to an icon of the set being authored.',
|
|
15
14
|
description:
|
|
16
|
-
"Run inside an icon-set package. Sets `map[definition] = icon` in the set's data file, or removes the entry. The
|
|
15
|
+
"Run inside an icon-set package. Sets `map[definition] = icon` in the set's data file, or removes the entry. The meaning must be Astryx's or one the set declares, named by its name or kebab id. The icon must be in the set, named by its id, its export name in any case, or another name its library exports it as (`trash-2` or `Trash2`), never by one word of its id; the entry records its id. The file is written in one fixed shape, `map` keys sorted. `integration check` suggests these commands for meanings the set has a fitting icon for. Experimental: it may change or be removed in a patch release.",
|
|
17
16
|
importPath: '@astryxdesign/cli/api',
|
|
18
17
|
signature:
|
|
19
18
|
'iconMap(definition: string | undefined, icon?: string, options?: IconMapOptions): Promise<IconMapResponse | IconMapManyResponse>',
|
|
@@ -22,7 +21,7 @@ export const doc = {
|
|
|
22
21
|
{
|
|
23
22
|
name: 'definition',
|
|
24
23
|
type: 'string | undefined',
|
|
25
|
-
description: 'The icon
|
|
24
|
+
description: 'The icon meaning. Omit with `options.pairs`.',
|
|
26
25
|
required: false,
|
|
27
26
|
},
|
|
28
27
|
{
|
|
@@ -44,32 +43,32 @@ export const doc = {
|
|
|
44
43
|
{
|
|
45
44
|
name: 'options.remove',
|
|
46
45
|
type: 'boolean',
|
|
47
|
-
description: "Remove the
|
|
46
|
+
description: "Remove the meaning's entry.",
|
|
48
47
|
default: 'false',
|
|
49
48
|
},
|
|
50
49
|
{
|
|
51
50
|
name: 'options.pairs',
|
|
52
51
|
type: 'string | string[]',
|
|
53
52
|
description:
|
|
54
|
-
'Many entries at once: `<definition>=<icon>` pairs separated by commas or spaces, with no
|
|
53
|
+
'Many entries at once: `<definition>=<icon>` pairs separated by commas or spaces, with no meaning or icon argument; each icon is named as the icon argument is. Every pair is checked before any is written.',
|
|
55
54
|
},
|
|
56
55
|
],
|
|
57
56
|
returns: [
|
|
58
57
|
{
|
|
59
58
|
type: 'icon.mapMany',
|
|
60
59
|
description:
|
|
61
|
-
"With pairs: the set, the data file, each entry with the icon it replaced, and whether the file changed; `replacedKeys` lists each `map` key that named a replaced
|
|
60
|
+
"With pairs: the set, the data file, each entry with the icon it replaced, and whether the file changed; `replacedKeys` lists each `map` key that named a replaced meaning and was written under its successor's name. `templateMeanings.unmapped` lists the icon meanings the bundled templates use that the set's `map` does not name, each with its template count, most used first.",
|
|
62
61
|
},
|
|
63
62
|
{
|
|
64
63
|
type: 'icon.map',
|
|
65
64
|
description:
|
|
66
|
-
"The set, the data file, the
|
|
65
|
+
"The set, the data file, the meaning, the icon now mapped, the icon it replaced, and whether the file changed; `replacedKeys` lists each `map` key that named a replaced meaning and was written under its successor's name. `templateMeanings.unmapped` lists the icon meanings the bundled templates use that the set's `map` does not name, each with its template count, most used first.",
|
|
67
66
|
},
|
|
68
67
|
],
|
|
69
68
|
throws: [
|
|
70
69
|
{
|
|
71
70
|
code: 'ERR_NOT_FOUND',
|
|
72
|
-
when: 'the
|
|
71
|
+
when: 'the meaning is unknown, the set has no such icon, or `set` names no set in the package or one that is withdrawn (with why)',
|
|
73
72
|
},
|
|
74
73
|
{
|
|
75
74
|
code: 'ERR_INVALID_ARGUMENT',
|
|
@@ -77,7 +76,7 @@ export const doc = {
|
|
|
77
76
|
},
|
|
78
77
|
{
|
|
79
78
|
code: 'ERR_INVALID_OPTION',
|
|
80
|
-
when: '`pairs` is given with a
|
|
79
|
+
when: '`pairs` is given with a meaning, an icon, or `remove`, or `remove` with an icon',
|
|
81
80
|
},
|
|
82
81
|
{
|
|
83
82
|
code: 'ERR_PROJECT_REQUIRED',
|
|
@@ -85,7 +84,7 @@ export const doc = {
|
|
|
85
84
|
},
|
|
86
85
|
{
|
|
87
86
|
code: 'ERR_MISSING_ARGUMENT',
|
|
88
|
-
when: 'the
|
|
87
|
+
when: 'the meaning is missing, or the icon without `remove`',
|
|
89
88
|
},
|
|
90
89
|
{
|
|
91
90
|
code: 'ERR_PATH_TRAVERSAL',
|
|
@@ -97,7 +96,7 @@ export const doc = {
|
|
|
97
96
|
},
|
|
98
97
|
],
|
|
99
98
|
examples: [
|
|
100
|
-
{label: 'Map a
|
|
99
|
+
{label: 'Map a meaning', code: "await iconMap('delete', 'trash');"},
|
|
101
100
|
{
|
|
102
101
|
label: 'Remove an entry',
|
|
103
102
|
code: "await iconMap('delete', undefined, {remove: true});",
|
|
@@ -8,9 +8,9 @@ export const doc = {
|
|
|
8
8
|
namespace: 'cli/api',
|
|
9
9
|
stability: 'experimental',
|
|
10
10
|
displayName: 'iconNewDefinition()',
|
|
11
|
-
summary: "Add one of an icon set's own icon
|
|
11
|
+
summary: "Add one of an icon set's own icon meanings.",
|
|
12
12
|
description:
|
|
13
|
-
"Run inside an icon-set package. Writes `<set>/definitions/<name>.doc.mjs`, a strongly typed IconDefinitionDoc with the description and words, and, with `icon`, the set's `map` entry for it. A name Astryx already has is refused: map to Astryx's
|
|
13
|
+
"Run inside an icon-set package. Writes `<set>/definitions/<name>.doc.mjs`, a strongly typed IconDefinitionDoc with the description and words, and, with `icon`, the set's `map` entry for it. A name Astryx already has is refused: map to Astryx's icon meaning instead. The file is never overwritten, and a write that fails is undone. Experimental: it may change or be removed in a patch release.",
|
|
14
14
|
importPath: '@astryxdesign/cli/api',
|
|
15
15
|
signature:
|
|
16
16
|
'iconNewDefinition(name: string, options?: IconNewDefinitionOptions): Promise<IconNewDefinitionResponse>',
|
|
@@ -20,13 +20,13 @@ export const doc = {
|
|
|
20
20
|
name: 'name',
|
|
21
21
|
type: 'string',
|
|
22
22
|
description:
|
|
23
|
-
'The
|
|
23
|
+
'The meaning name, in camelCase (`rocketLaunch`) or kebab-case (`rocket-launch`); it is written in camelCase.',
|
|
24
24
|
required: true,
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
name: 'options.description',
|
|
28
28
|
type: 'string',
|
|
29
|
-
description: 'One sentence on what an icon with this
|
|
29
|
+
description: 'One sentence on what an icon with this meaning is for.',
|
|
30
30
|
required: true,
|
|
31
31
|
},
|
|
32
32
|
{
|
|
@@ -38,7 +38,7 @@ export const doc = {
|
|
|
38
38
|
{
|
|
39
39
|
name: 'options.icon',
|
|
40
40
|
type: 'string',
|
|
41
|
-
description: 'An icon id in the set to map the
|
|
41
|
+
description: 'An icon id in the set to map the meaning to.',
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
44
|
name: 'options.set',
|
|
@@ -73,7 +73,7 @@ export const doc = {
|
|
|
73
73
|
code: 'ERR_MISSING_ARGUMENT',
|
|
74
74
|
when: 'the description or words are missing',
|
|
75
75
|
},
|
|
76
|
-
{code: 'ERR_FILE_EXISTS', when:
|
|
76
|
+
{code: 'ERR_FILE_EXISTS', when: "the icon meaning's file already exists"},
|
|
77
77
|
{
|
|
78
78
|
code: 'ERR_NOT_FOUND',
|
|
79
79
|
when: 'the package ships no icon set, `set` names no set in it or one that is withdrawn (with why), or the set has no such icon',
|
|
@@ -88,12 +88,12 @@ export const doc = {
|
|
|
88
88
|
},
|
|
89
89
|
{
|
|
90
90
|
code: 'ERR_WRITE_FAILED',
|
|
91
|
-
when:
|
|
91
|
+
when: "the icon meaning's file or the data file cannot be written; every write before it is undone",
|
|
92
92
|
},
|
|
93
93
|
],
|
|
94
94
|
examples: [
|
|
95
95
|
{
|
|
96
|
-
label: 'Add and map a
|
|
96
|
+
label: 'Add and map a meaning',
|
|
97
97
|
code: "await iconNewDefinition('random', {description: 'Pick something at random.', words: ['dice', 'shuffle', 'chance'], icon: 'dice-5'});",
|
|
98
98
|
},
|
|
99
99
|
],
|
|
@@ -10,7 +10,7 @@ export const doc = {
|
|
|
10
10
|
displayName: 'iconNewSet()',
|
|
11
11
|
summary: 'Add an icon set to an integration package.',
|
|
12
12
|
description:
|
|
13
|
-
"Creates an integration manifest when the package has none, writes the set directory with its strongly typed same-stem IconSetDoc and a starter data file (schemaVersion 1, module set to the package name, no icons and an empty map yet), and the set's generated module with its declaration file and an empty themeIcons theme map; with from, it wraps a library's icons into them, records the installed library and version as the data file's source, copies the library's license notices into the set, uses the library's license, maps each Astryx
|
|
13
|
+
"Creates an integration manifest when the package has none, writes the set directory with its strongly typed same-stem IconSetDoc and a starter data file (schemaVersion 1, module set to the package name, no icons and an empty map yet), and the set's generated module with its declaration file and an empty themeIcons theme map; with from, it wraps a library's icons into them, records the installed library and version as the data file's source, copies the library's license notices into the set, uses the library's license, maps each Astryx meaning whose name is an icon id, and returns up to three likely icons for each other meaning as suggestions (by its name, its words, and the other names the library gives an icon; never a part of a word, a negated form, or the opposite direction), never written. A library whose export names end in style, size and weight words gives one icon per glyph, named without those words, in the look the default variant names, else the library's usual default (outline, regular, the middle weight). With adapter, it declares the data file's adapter, so `from` also wraps a library's data exports through it. Over an existing set with icons, `from` refreshes it (the first `from` into a set with no icons creates them); without `from`, `variants`, `defaultVariant`, `displayName` and `description` update it in place and leave its icons, map and generated module unchanged (a variant an icon has must stay declared, and a set with icons keeps its default variant). It declares the manifest's `experimental.iconSets` root on first use, and includes the manifest and root in package.json files when the package already uses an allowlist. It never writes the package's entry, exports, main, types, files list, peers, or scripts: its notes name each change the package needs as text to copy. Every path is confined to the package, and an existing set is changed only as above. Experimental: it may change or be removed in a patch release.",
|
|
14
14
|
importPath: '@astryxdesign/cli/api',
|
|
15
15
|
signature:
|
|
16
16
|
'iconNewSet(name: string, options?: IconNewSetOptions): Promise<IconNewSetResponse>',
|
|
@@ -62,7 +62,7 @@ export const doc = {
|
|
|
62
62
|
name: 'options.defaultVariant',
|
|
63
63
|
type: 'string',
|
|
64
64
|
description:
|
|
65
|
-
"With variants: the variant each icon's own export draws, written to the data file's default. In a library whose export names
|
|
65
|
+
"With variants: the variant each icon's own export draws, written to the data file's default. In a library whose export names carry look words, it must be one of the library's look words, and when absent it is the look the icons' exports draw (with from and no icons yet, the library's usual default), which variants must list. Otherwise, when absent, an existing set keeps its default while variants declares it; a set without icons takes the first variant, and a set with icons and none declared needs it. Without from, a set with icons refuses a default other than the look they draw; when its icons' export names carry no look words, it refuses one other than its declared default with from too.",
|
|
66
66
|
},
|
|
67
67
|
{
|
|
68
68
|
name: 'options.displayName',
|
|
@@ -81,17 +81,17 @@ export const doc = {
|
|
|
81
81
|
{
|
|
82
82
|
type: 'icon.newSet',
|
|
83
83
|
description:
|
|
84
|
-
"What it wrote: the manifest root, the files, and what to do next. Except in a dry run, `templateMeanings.unmapped` lists the icon
|
|
84
|
+
"What it wrote: the manifest root, the files, and what to do next. Except in a dry run, `templateMeanings.unmapped` lists the icon meanings the bundled templates use that the set's `map` does not name, each with its template count, most used first.",
|
|
85
85
|
},
|
|
86
86
|
],
|
|
87
87
|
throws: [
|
|
88
88
|
{
|
|
89
89
|
code: 'ERR_INVALID_ARGUMENT',
|
|
90
|
-
when: 'the name is not lowercase kebab-case, package.json has no name, or a variant name or the default variant is invalid; the default variant is no look word of a library whose export names
|
|
90
|
+
when: 'the name is not lowercase kebab-case, package.json has no name, or a variant name or the default variant is invalid; the default variant is no look word of a library whose export names carry look words; or the default variant would change on a set that has icons: without `from` (wrap the library again with `from` and `defaultVariant`), or with or without it when the export names of its icons carry no look words (add it as a variant instead)',
|
|
91
91
|
},
|
|
92
92
|
{
|
|
93
93
|
code: 'ERR_INVALID_OPTION',
|
|
94
|
-
when: '`exclude` is given without `from`, or `defaultVariant` without `variants`; `variants` leave out the default variant: the look the icons draw in a library whose export names
|
|
94
|
+
when: '`exclude` is given without `from`, or `defaultVariant` without `variants`; `variants` leave out the default variant: the look the icons draw in a library whose export names carry look words, or the declared default of a set with icons whose export names carry no look words; or such a set declares no default and `defaultVariant` names none',
|
|
95
95
|
},
|
|
96
96
|
{
|
|
97
97
|
code: 'ERR_FILE_EXISTS',
|
package/api/icon/map/map.mjs
CHANGED
|
@@ -64,11 +64,11 @@ export async function iconMap(definition, icon, options = {}) {
|
|
|
64
64
|
const result = await authoring(async () => {
|
|
65
65
|
if (typeof definition !== 'string' || definition.trim() === '') {
|
|
66
66
|
throw new AstryxError(
|
|
67
|
-
'Name the icon
|
|
67
|
+
'Name the icon meaning to map',
|
|
68
68
|
[
|
|
69
69
|
{
|
|
70
70
|
name: 'astryx docs cli/experimental/icon-definitions',
|
|
71
|
-
reason: 'every icon
|
|
71
|
+
reason: 'every icon meaning',
|
|
72
72
|
},
|
|
73
73
|
],
|
|
74
74
|
ERROR_CODES.ERR_MISSING_ARGUMENT,
|
|
@@ -94,14 +94,14 @@ export async function iconMap(definition, icon, options = {}) {
|
|
|
94
94
|
} else {
|
|
95
95
|
if (!mappableDefinitions(set).has(definition)) {
|
|
96
96
|
throw new AstryxError(
|
|
97
|
-
`"${definition}" is not an icon
|
|
97
|
+
`"${definition}" is not an icon meaning.`,
|
|
98
98
|
[
|
|
99
99
|
...closestNames(definition, [...mappableDefinitions(set)]).map(
|
|
100
|
-
name => ({name, reason: 'a known icon
|
|
100
|
+
name => ({name, reason: 'a known icon meaning'}),
|
|
101
101
|
),
|
|
102
102
|
{
|
|
103
103
|
name: `astryx experimental icon new-definition ${definition} --set ${set.name}`,
|
|
104
|
-
reason: 'add it as your own
|
|
104
|
+
reason: 'add it as your own meaning',
|
|
105
105
|
},
|
|
106
106
|
],
|
|
107
107
|
ERROR_CODES.ERR_NOT_FOUND,
|
|
@@ -210,10 +210,10 @@ async function mapMany({cwd, selector, pairs}) {
|
|
|
210
210
|
const id = iconIdIn(set, match[2]) ?? match[2];
|
|
211
211
|
if (!known.has(name)) {
|
|
212
212
|
throw new AstryxError(
|
|
213
|
-
`"${name}" is not an icon
|
|
213
|
+
`"${name}" is not an icon meaning. Nothing was written.`,
|
|
214
214
|
closestNames(name, [...known]).map(each => ({
|
|
215
215
|
name: each,
|
|
216
|
-
reason: 'a known icon
|
|
216
|
+
reason: 'a known icon meaning',
|
|
217
217
|
})),
|
|
218
218
|
ERROR_CODES.ERR_NOT_FOUND,
|
|
219
219
|
);
|
package/api/icon/use/use.mjs
CHANGED
|
@@ -77,21 +77,21 @@ function checkVariant(main, selector, backups, variant) {
|
|
|
77
77
|
const fallback = main.data.default?.variant;
|
|
78
78
|
throw new AstryxError(
|
|
79
79
|
declared.length === 0
|
|
80
|
-
? `Icon set "${iconSetKey(main)}" declares no variants, so it takes no --variant.`
|
|
80
|
+
? `Icon set "${iconSetKey(main)}" declares no variants: it draws one look, so it takes no --variant.`
|
|
81
81
|
: `Icon set "${iconSetKey(main)}" declares no "${variant}" variant. Its variants: ${declared.join(', ')}.`,
|
|
82
82
|
declared.length === 0
|
|
83
83
|
? [
|
|
84
84
|
{
|
|
85
85
|
name: iconUseCommand(selector, backups),
|
|
86
|
-
reason: 'use it
|
|
86
|
+
reason: 'use it in its one look',
|
|
87
87
|
},
|
|
88
88
|
]
|
|
89
89
|
: declared.map(each => ({
|
|
90
90
|
name: iconUseCommand(selector, backups, each),
|
|
91
91
|
reason:
|
|
92
92
|
each === fallback
|
|
93
|
-
? `its default
|
|
94
|
-
: `its ${each}
|
|
93
|
+
? `its default look, ${each}`
|
|
94
|
+
: `its ${each} look`,
|
|
95
95
|
})),
|
|
96
96
|
ERROR_CODES.ERR_INVALID_ARGUMENT,
|
|
97
97
|
);
|
package/api/init/run/run.mjs
CHANGED
|
@@ -108,7 +108,6 @@ export function getNextSteps(invocation, cwd = process.cwd()) {
|
|
|
108
108
|
" import { themes, defaultThemeSlug } from './astryx-themes'",
|
|
109
109
|
' <Theme theme={themes[defaultThemeSlug]}>...</Theme>',
|
|
110
110
|
` Extend an imported theme to customize it. Run \`${invocation} theme eject <slug>\` only to fork source.`,
|
|
111
|
-
` To make or change a theme: the experimental theme editor, \`${invocation} experimental theme editor new <name> --like neutral\` (then editor set / editor how).`,
|
|
112
111
|
` 5. ${invocation} --help for all commands`,
|
|
113
112
|
'',
|
|
114
113
|
];
|
|
@@ -387,7 +387,7 @@ export function applyWrites(plans) {
|
|
|
387
387
|
staged.push({...plan, temporary, original, mode});
|
|
388
388
|
}
|
|
389
389
|
|
|
390
|
-
// Under a folder lock
|
|
390
|
+
// Under a folder lock, a run that lost the lock
|
|
391
391
|
// while it was stopped publishes nothing. Outside a lock this does
|
|
392
392
|
// nothing.
|
|
393
393
|
stillHolds();
|