@astryxdesign/cli 0.7.4 → 0.7.5-canary.1093026

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.
Files changed (208) hide show
  1. package/README.md +18 -18
  2. package/api/discover/_adapter.d.mts +1 -1
  3. package/api/experimental.d.mts +5 -0
  4. package/api/experimental.mjs +15 -0
  5. package/api/hook/list/list.d.mts +1 -1
  6. package/api/icon/_adapter.d.mts +3 -2
  7. package/api/icon/_adapter.mjs +16 -3
  8. package/api/icon/_authoring.d.mts +5 -1
  9. package/api/icon/_authoring.mjs +478 -63
  10. package/api/icon/_options.d.mts +11 -0
  11. package/api/icon/_options.mjs +39 -4
  12. package/api/icon/_records.d.mts +19 -0
  13. package/api/icon/_records.mjs +25 -0
  14. package/api/icon/add/add.d.mts +3 -3
  15. package/api/icon/add/add.mjs +227 -14
  16. package/api/icon/all-or-nothing.test.mjs +283 -0
  17. package/api/icon/detail/detail.mjs +2 -13
  18. package/api/icon/error-codes.test.mjs +14 -7
  19. package/api/icon/icon.d.mts +2 -2
  20. package/api/icon/icon.doc.mjs +30 -2
  21. package/api/icon/icon.mjs +57 -8
  22. package/api/icon/icon.test.mjs +133 -1
  23. package/api/icon/icon.type.d.mts +126 -1
  24. package/api/icon/icon.type.mjs +67 -3
  25. package/api/icon/iconAdd.doc.mjs +22 -6
  26. package/api/icon/iconMap.doc.mjs +24 -8
  27. package/api/icon/iconNewDefinition.doc.mjs +2 -2
  28. package/api/icon/iconNewSet.doc.mjs +30 -2
  29. package/api/icon/iconUse.doc.mjs +4 -1
  30. package/api/icon/map/map.d.mts +4 -4
  31. package/api/icon/map/map.mjs +134 -9
  32. package/api/icon/new-definition/new-definition.mjs +6 -2
  33. package/api/icon/new-set/new-set.mjs +2 -2
  34. package/api/icon/new-set/new-set.test.mjs +60 -10
  35. package/api/icon/option-pairs.test.mjs +368 -0
  36. package/api/icon/search/search.d.mts +10 -0
  37. package/api/icon/search/search.mjs +55 -14
  38. package/api/icon/use/use.mjs +2 -13
  39. package/api/integration/add-helpers.d.mts +15 -1
  40. package/api/integration/add-helpers.mjs +1 -1
  41. package/api/integration/validate-integration.type.d.mts +3 -2
  42. package/api/integration/validate-integration.type.mjs +3 -2
  43. package/api/render/_adapter.d.mts +28 -0
  44. package/api/render/_adapter.mjs +540 -0
  45. package/api/render/render.d.mts +15 -0
  46. package/api/render/render.doc.d.mts +9 -0
  47. package/api/render/render.doc.mjs +112 -0
  48. package/api/render/render.mjs +113 -0
  49. package/api/render/render.test.mjs +1155 -0
  50. package/api/render/render.type.d.mts +74 -0
  51. package/api/render/render.type.mjs +64 -0
  52. package/api/search/_result.d.mts +5 -5
  53. package/api/search/search.d.mts +1 -1
  54. package/api/template/template.type.d.mts +2 -1
  55. package/api/template/template.type.mjs +1 -1
  56. package/assets/discover/official-packages.json +4 -0
  57. package/assets/docs/tree/icon-definitions.doc.mjs +2 -2
  58. package/assets/docs/tree/icon-set-files.doc.mjs +1 -1
  59. package/assets/docs/tree/icon-sets.doc.mjs +50 -20
  60. package/assets/docs/tree/render-pages.doc.mjs +94 -0
  61. package/assets/icons/definitions/activity.doc.mjs +1 -1
  62. package/assets/icons/definitions/alignCenter.doc.mjs +9 -0
  63. package/assets/icons/definitions/alignEnd.doc.mjs +10 -0
  64. package/assets/icons/definitions/alignStart.doc.mjs +10 -0
  65. package/assets/icons/definitions/archive.doc.mjs +1 -1
  66. package/assets/icons/definitions/arrowsUpDown.doc.mjs +1 -1
  67. package/assets/icons/definitions/attach.doc.mjs +1 -1
  68. package/assets/icons/definitions/audio.doc.mjs +1 -1
  69. package/assets/icons/definitions/cart.doc.mjs +1 -1
  70. package/assets/icons/definitions/checkDouble.doc.mjs +1 -1
  71. package/assets/icons/definitions/chevronsLeft.doc.mjs +1 -1
  72. package/assets/icons/definitions/chevronsRight.doc.mjs +1 -1
  73. package/assets/icons/definitions/close.doc.mjs +1 -1
  74. package/assets/icons/definitions/collapse.doc.mjs +1 -1
  75. package/assets/icons/definitions/compose.doc.mjs +1 -1
  76. package/assets/icons/definitions/conversation.doc.mjs +1 -1
  77. package/assets/icons/definitions/copy.doc.mjs +1 -1
  78. package/assets/icons/definitions/cpu.doc.mjs +9 -0
  79. package/assets/icons/definitions/database.doc.mjs +1 -1
  80. package/assets/icons/definitions/desktop.doc.mjs +1 -1
  81. package/assets/icons/definitions/discount.doc.mjs +1 -1
  82. package/assets/icons/definitions/download.doc.mjs +1 -1
  83. package/assets/icons/definitions/emoji.doc.mjs +1 -1
  84. package/assets/icons/definitions/error.doc.mjs +1 -1
  85. package/assets/icons/definitions/expand.doc.mjs +1 -1
  86. package/assets/icons/definitions/experiment.doc.mjs +1 -1
  87. package/assets/icons/definitions/externalLink.doc.mjs +7 -1
  88. package/assets/icons/definitions/eyeSlash.doc.mjs +1 -1
  89. package/assets/icons/definitions/flipHorizontal.doc.mjs +9 -0
  90. package/assets/icons/definitions/flipVertical.doc.mjs +9 -0
  91. package/assets/icons/definitions/folderAdd.doc.mjs +1 -1
  92. package/assets/icons/definitions/gitBranch.doc.mjs +9 -0
  93. package/assets/icons/definitions/gitFork.doc.mjs +9 -0
  94. package/assets/icons/definitions/info.doc.mjs +1 -1
  95. package/assets/icons/definitions/location.doc.mjs +1 -1
  96. package/assets/icons/definitions/mention.doc.mjs +1 -1
  97. package/assets/icons/definitions/menu.doc.mjs +1 -1
  98. package/assets/icons/definitions/microphone.doc.mjs +1 -1
  99. package/assets/icons/definitions/mobile.doc.mjs +1 -1
  100. package/assets/icons/definitions/money.doc.mjs +1 -1
  101. package/assets/icons/definitions/moreHorizontal.doc.mjs +1 -1
  102. package/assets/icons/definitions/notificationActive.doc.mjs +1 -1
  103. package/assets/icons/definitions/notificationOff.doc.mjs +1 -1
  104. package/assets/icons/definitions/panelLeft.doc.mjs +10 -0
  105. package/assets/icons/definitions/panelRight.doc.mjs +10 -0
  106. package/assets/icons/definitions/raiseHand.doc.mjs +1 -1
  107. package/assets/icons/definitions/redo.doc.mjs +1 -1
  108. package/assets/icons/definitions/refresh.doc.mjs +1 -1
  109. package/assets/icons/definitions/rotate.doc.mjs +9 -0
  110. package/assets/icons/definitions/scale.doc.mjs +10 -0
  111. package/assets/icons/definitions/search.doc.mjs +1 -1
  112. package/assets/icons/definitions/send.doc.mjs +1 -1
  113. package/assets/icons/definitions/settings.doc.mjs +1 -1
  114. package/assets/icons/definitions/star.doc.mjs +1 -1
  115. package/assets/icons/definitions/stop.doc.mjs +1 -1
  116. package/assets/icons/definitions/success.doc.mjs +1 -1
  117. package/assets/icons/definitions/textCase.doc.mjs +9 -0
  118. package/assets/icons/definitions/thumbsDown.doc.mjs +1 -1
  119. package/assets/icons/definitions/thumbsUp.doc.mjs +1 -1
  120. package/assets/icons/definitions/trendDown.doc.mjs +7 -1
  121. package/assets/icons/definitions/trendUp.doc.mjs +1 -1
  122. package/assets/icons/definitions/undo.doc.mjs +1 -1
  123. package/assets/icons/definitions/upload.doc.mjs +1 -1
  124. package/assets/icons/definitions/userAdd.doc.mjs +1 -1
  125. package/assets/icons/definitions/warning.doc.mjs +1 -1
  126. package/assets/templates/blocks/components/Tokenizer/TokenizerClear.tsx +15 -14
  127. package/assets/templates/blocks/components/Tokenizer/TokenizerCreatable.tsx +30 -30
  128. package/assets/templates/blocks/components/Tokenizer/TokenizerEndContent.tsx +15 -14
  129. package/assets/templates/blocks/components/Tokenizer/TokenizerIcon.tsx +15 -14
  130. package/assets/templates/blocks/components/Tokenizer/TokenizerMaxEntries.tsx +17 -16
  131. package/assets/templates/blocks/components/Tokenizer/TokenizerOverflow.tsx +29 -29
  132. package/assets/templates/blocks/components/Tokenizer/TokenizerShowcase.tsx +9 -8
  133. package/assets/templates/blocks/components/Tokenizer/TokenizerStates.tsx +39 -41
  134. package/assets/templates/pages/canvas-editor/template.doc.mjs +9 -0
  135. package/assets/templates/pages/form-wizard-inline/template.doc.mjs +6 -1
  136. package/assets/templates/pages/table-comparison/template.doc.mjs +1 -0
  137. package/assets/templates/pages/table-tree/template.doc.mjs +3 -0
  138. package/authoring/debug/parse.d.mts +2 -2
  139. package/authoring/doctypes/icon-definition/icon-definition.doc.mjs +4 -4
  140. package/authoring/doctypes/icon-set/icon-set-data.doc.mjs +6 -0
  141. package/authoring/doctypes/icon-set/parse.d.mts +1 -0
  142. package/authoring/doctypes/icon-set/parse.mjs +1 -0
  143. package/authoring/doctypes/icon-set/type.ts +5 -0
  144. package/authoring/doctypes/template/template.doc.mjs +1 -1
  145. package/authoring/doctypes/template/type.ts +2 -1
  146. package/clients/cli/commands/doctor.mjs +16 -17
  147. package/clients/cli/commands/experimental/icon.mjs +167 -35
  148. package/clients/cli/commands/experimental/index.mjs +2 -0
  149. package/clients/cli/commands/experimental/render.mjs +113 -0
  150. package/clients/cli/commands/experimental-icon-add.doc.mjs +14 -4
  151. package/clients/cli/commands/experimental-icon-map.doc.mjs +12 -2
  152. package/clients/cli/commands/experimental-icon-new-definition.doc.mjs +1 -1
  153. package/clients/cli/commands/experimental-icon-new-set.doc.mjs +28 -1
  154. package/clients/cli/commands/experimental-icon.doc.mjs +18 -2
  155. package/clients/cli/commands/experimental-render.doc.mjs +60 -0
  156. package/clients/cli/commands/experimental.doc.mjs +4 -2
  157. package/clients/cli/commands/icon-authoring.test.mjs +1823 -13
  158. package/clients/cli/commands/icon-options-wiring.test.mjs +158 -0
  159. package/clients/cli/commands/icon.test.mjs +1 -1
  160. package/clients/cli/commands/template.mjs +4 -1
  161. package/clients/cli/commands/text-json-parity.test.mjs +46 -0
  162. package/clients/cli/index.mjs +1 -0
  163. package/foundation/discovery/component-discovery.d.mts +2 -1
  164. package/foundation/discovery/component-discovery.export-names.test.mjs +41 -0
  165. package/foundation/discovery/component-discovery.mjs +13 -7
  166. package/foundation/discovery/icon-set-checks.d.mts +43 -9
  167. package/foundation/discovery/icon-set-checks.mjs +296 -21
  168. package/foundation/discovery/icon-set-checks.test.mjs +125 -12
  169. package/foundation/discovery/icon-set-writer.d.mts +192 -3
  170. package/foundation/discovery/icon-set-writer.mjs +608 -34
  171. package/foundation/discovery/icon-set-writer.test.mjs +26 -0
  172. package/foundation/discovery/module-exports.mjs +82 -25
  173. package/foundation/discovery/module-exports.test.mjs +38 -1
  174. package/foundation/discovery/package-exports.d.mts +13 -0
  175. package/foundation/discovery/package-exports.mjs +40 -1
  176. package/foundation/discovery/template-icons.d.mts +6 -0
  177. package/foundation/discovery/template-icons.mjs +98 -10
  178. package/foundation/discovery/template-icons.test.mjs +103 -0
  179. package/foundation/doc-compiler/doc-loads.test.mjs +15 -0
  180. package/foundation/doc-compiler/tree.mjs +3 -1
  181. package/foundation/render/assets.d.mts +31 -0
  182. package/foundation/render/assets.mjs +102 -0
  183. package/foundation/render/component-map.d.mts +52 -0
  184. package/foundation/render/component-map.mjs +141 -0
  185. package/foundation/render/css-cut.d.mts +29 -0
  186. package/foundation/render/css-cut.mjs +144 -0
  187. package/foundation/render/embedded-files.d.mts +28 -0
  188. package/foundation/render/embedded-files.mjs +108 -0
  189. package/foundation/render/embedded-imports.d.mts +61 -0
  190. package/foundation/render/embedded-imports.mjs +315 -0
  191. package/foundation/render/html-reader.d.mts +37 -0
  192. package/foundation/render/html-reader.mjs +121 -0
  193. package/foundation/render/page-worker.d.mts +7 -0
  194. package/foundation/render/page-worker.mjs +519 -0
  195. package/foundation/render/rebuild.d.mts +19 -0
  196. package/foundation/render/rebuild.mjs +269 -0
  197. package/foundation/render/render-page.d.mts +85 -0
  198. package/foundation/render/render-page.mjs +612 -0
  199. package/foundation/render/render.test.mjs +117 -0
  200. package/foundation/render/source-block.d.mts +52 -0
  201. package/foundation/render/source-block.mjs +106 -0
  202. package/foundation/response/error-codes.d.mts +10 -1
  203. package/foundation/response/error-codes.doc.mjs +56 -0
  204. package/foundation/response/error-codes.mjs +61 -0
  205. package/foundation/response/response-types.doc.mjs +38 -1
  206. package/foundation/text/string-utils.mjs +33 -0
  207. package/foundation/text/string-utils.test.mjs +17 -0
  208. package/package.json +14 -9
@@ -0,0 +1,74 @@
1
+ // @generated by scripts/sync-api-types.mjs from the JSDoc in api/**/*.mjs.
2
+ // DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
3
+
4
+ export type RenderOptions = {
5
+ /**
6
+ * - Folder relative paths resolve from (default: process.cwd()).
7
+ */
8
+ cwd?: string | undefined;
9
+ /**
10
+ * - The file to write. Rendering: an .html file (default: the page's name with .html). Reversing: a page module (default: inside a new folder beside the HTML file, named after it, such as `report-restored/`).
11
+ */
12
+ out?: string | undefined;
13
+ /**
14
+ * - Turn a rendered HTML file back into a page module.
15
+ */
16
+ reverse?: boolean | undefined;
17
+ /**
18
+ * - The rendered page's title (default: its first heading, else the file name). Rendering only.
19
+ */
20
+ title?: string | undefined;
21
+ /**
22
+ * - Replace the existing page module when reversing (never a protected file, and never a file other than the page, which always goes into a new folder). Rendering replaces an existing HTML file only when a render wrote it.
23
+ */
24
+ overwrite?: boolean | undefined;
25
+ };
26
+ /**
27
+ * Something the render noticed that may make the page differ from what its
28
+ * author meant.
29
+ */
30
+ export type RenderWarning = {
31
+ /**
32
+ * - What kind of problem.
33
+ */
34
+ code: "dropped-children" | "remote-asset" | "missing-asset" | "page-output" | "page-script" | "no-astryx-styles" | "chart-size" | "not-embedded";
35
+ /**
36
+ * - What happened and what to do, in one sentence.
37
+ */
38
+ message: string;
39
+ };
40
+ /**
41
+ * `astryx --json experimental render <page>`.
42
+ */
43
+ export type RenderPageResponse = {
44
+ type: "render.page";
45
+ data: {
46
+ input: string;
47
+ output: string;
48
+ bytes: number;
49
+ files: string[];
50
+ stylesheets: string[];
51
+ classes: number;
52
+ cssBytes: number;
53
+ images: number;
54
+ warnings: RenderWarning[];
55
+ };
56
+ };
57
+ /**
58
+ * `astryx --json experimental render --reverse <file.html>`.
59
+ */
60
+ export type RenderReverseResponse = {
61
+ type: "render.reverse";
62
+ data: {
63
+ input: string;
64
+ mode: "embedded" | "rebuilt";
65
+ output: string;
66
+ files: string[];
67
+ exact: boolean;
68
+ missing?: string[] | undefined;
69
+ components?: string[] | undefined;
70
+ elements?: number | undefined;
71
+ unknown?: string[] | undefined;
72
+ omitted?: string[] | undefined;
73
+ };
74
+ };
@@ -0,0 +1,64 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * @file Colocated types for `astryx experimental render`: the source of truth
5
+ * for its response shapes.
6
+ *
7
+ * @position api/render — typedefs for api/render/render.mjs
8
+ */
9
+
10
+ /**
11
+ * @experimental May change or be removed in a patch release.
12
+ * @typedef {object} RenderOptions
13
+ * @property {string} [cwd] - Folder relative paths resolve from (default: process.cwd()).
14
+ * @property {string} [out] - The file to write. Rendering: an .html file (default: the page's name with .html). Reversing: a page module (default: inside a new folder beside the HTML file, named after it, such as `report-restored/`).
15
+ * @property {boolean} [reverse] - Turn a rendered HTML file back into a page module.
16
+ * @property {string} [title] - The rendered page's title (default: its first heading, else the file name). Rendering only.
17
+ * @property {boolean} [overwrite] - Replace the existing page module when reversing (never a protected file, and never a file other than the page, which always goes into a new folder). Rendering replaces an existing HTML file only when a render wrote it.
18
+ */
19
+
20
+ /**
21
+ * Something the render noticed that may make the page differ from what its
22
+ * author meant.
23
+ * @experimental May change or be removed in a patch release.
24
+ * @typedef {object} RenderWarning
25
+ * @property {'dropped-children' | 'remote-asset' | 'missing-asset' | 'page-output' | 'page-script' | 'no-astryx-styles' | 'chart-size' | 'not-embedded'} code - What kind of problem.
26
+ * @property {string} message - What happened and what to do, in one sentence.
27
+ */
28
+
29
+ /**
30
+ * `astryx --json experimental render <page>`.
31
+ * @experimental May change or be removed in a patch release.
32
+ * @typedef {object} RenderPageResponse
33
+ * @property {'render.page'} type
34
+ * @property {object} data
35
+ * @property {string} data.input - The page module, relative to cwd when inside it.
36
+ * @property {string} data.output - The HTML file written.
37
+ * @property {number} data.bytes - Size of the HTML file.
38
+ * @property {string[]} data.files - Local files the page loaded (modules, stylesheets, images, JSON), relative to the folder that holds them all (the page's folder unless it imports from above it), page first; each is embedded so --reverse can give it back.
39
+ * @property {string[]} data.stylesheets - Package stylesheets that were cut to the rules the page uses and inlined.
40
+ * @property {number} data.classes - Distinct class names in the markup.
41
+ * @property {number} data.cssBytes - Size of the inlined CSS.
42
+ * @property {number} data.images - Local files inlined as data: URIs.
43
+ * @property {RenderWarning[]} data.warnings - Empty when nothing looked wrong.
44
+ */
45
+
46
+ /**
47
+ * `astryx --json experimental render --reverse <file.html>`.
48
+ * @experimental May change or be removed in a patch release.
49
+ * @typedef {object} RenderReverseResponse
50
+ * @property {'render.reverse'} type
51
+ * @property {object} data
52
+ * @property {string} data.input - The HTML file read.
53
+ * @property {'embedded' | 'rebuilt'} data.mode - `embedded`: the file carried its source, written back byte for byte. `rebuilt`: rebuilt from Astryx markup (text and layout only).
54
+ * @property {string} data.output - The page module written: `out`, or by default inside a new folder beside the HTML file named after it (`report.html` gives `report-restored/`).
55
+ * @property {string[]} data.files - Every file written, page first.
56
+ * @property {boolean} data.exact - Whether the page and every file it imports came back exactly as rendered.
57
+ * @property {string[]} [data.missing] - Embedded only: relative imports the file did not carry (files a render never embeds), so the restored page needs them before it renders.
58
+ * @property {string[]} [data.components] - Rebuilt only: the components the page uses.
59
+ * @property {number} [data.elements] - Rebuilt only: how many component elements were rebuilt.
60
+ * @property {string[]} [data.unknown] - Rebuilt only: Astryx class names no installed component claims; their content is kept as plain elements.
61
+ * @property {string[]} [data.omitted] - Rebuilt only: component kinds left out because the markup cannot give them back (such as icons).
62
+ */
63
+
64
+ export {};
@@ -17,7 +17,7 @@
17
17
  * (spec AST-081 FR3).
18
18
  */
19
19
  export function toResult(c: Candidate, score: number, reason: string, matchedTerms: number, queryTerms: number, outside?: boolean): {
20
- domain: "component" | "hook" | "theme" | "doc" | "template";
20
+ domain: "template" | "component" | "hook" | "theme" | "doc";
21
21
  name: string;
22
22
  package: string | undefined;
23
23
  score: number;
@@ -26,7 +26,7 @@ export function toResult(c: Candidate, score: number, reason: string, matchedTer
26
26
  } | {
27
27
  import: string | undefined;
28
28
  command: string;
29
- domain: "component" | "hook" | "theme" | "doc" | "template";
29
+ domain: "template" | "component" | "hook" | "theme" | "doc";
30
30
  name: string;
31
31
  package: string | undefined;
32
32
  score: number;
@@ -38,7 +38,7 @@ export function toResult(c: Candidate, score: number, reason: string, matchedTer
38
38
  command: string;
39
39
  section?: string | undefined;
40
40
  name: string;
41
- domain: "component" | "hook" | "theme" | "doc" | "template";
41
+ domain: "template" | "component" | "hook" | "theme" | "doc";
42
42
  package: string | undefined;
43
43
  score: number;
44
44
  reason: string;
@@ -47,7 +47,7 @@ export function toResult(c: Candidate, score: number, reason: string, matchedTer
47
47
  displayName: string | undefined;
48
48
  kind: "page" | "block" | undefined;
49
49
  command: string;
50
- domain: "component" | "hook" | "theme" | "doc" | "template";
50
+ domain: "template" | "component" | "hook" | "theme" | "doc";
51
51
  name: string;
52
52
  package: string | undefined;
53
53
  score: number;
@@ -56,7 +56,7 @@ export function toResult(c: Candidate, score: number, reason: string, matchedTer
56
56
  } | {
57
57
  displayName: string | undefined;
58
58
  command: string;
59
- domain: "component" | "hook" | "theme" | "doc" | "template";
59
+ domain: "template" | "component" | "hook" | "theme" | "doc";
60
60
  name: string;
61
61
  package: string | undefined;
62
62
  score: number;
@@ -13,7 +13,7 @@
13
13
  */
14
14
  export function search(query: string, options?: {
15
15
  cwd?: string | undefined;
16
- type?: "component" | "hook" | "theme" | "doc" | "template" | undefined;
16
+ type?: "template" | "component" | "hook" | "theme" | "doc" | undefined;
17
17
  limit?: number | undefined;
18
18
  }): Promise<import("./search.type.mjs").SearchResponse>;
19
19
  /**
@@ -131,7 +131,7 @@ export type TemplateIconsReport = {
131
131
  */
132
132
  reason: string;
133
133
  /**
134
- * Icons rewritten to the project's set, and the rule that chose each one: a reviewed `exact` or `strong` match, or the icon the set's `map` names for the icon definition the template declares.
134
+ * Icons rewritten to the project's set, and the rule that chose each one: a reviewed `exact` or `strong` match, or the icon the set's `map` names for the icon definition the template declares. `dropped` names the library's sizing props (`size`, `strokeWidth`, `absoluteStrokeWidth`) removed from the icon's elements: an icon set's icons take their size from CSS.
135
135
  */
136
136
  mapped: Array<{
137
137
  source: {
@@ -146,6 +146,7 @@ export type TemplateIconsReport = {
146
146
  export: string;
147
147
  };
148
148
  by: "match" | "definition";
149
+ dropped?: string[];
149
150
  }>;
150
151
  /**
151
152
  * Icons left as the template wrote them, with why, and a `likely` reviewed match as a suggestion when the project set has one. Every declared key is mapped or kept; `module` is null for a key the template does not import, and `export` is `default` for a default import and `*` for a namespace import.
@@ -96,7 +96,7 @@
96
96
  * @property {'selected' | 'none' | 'ambiguous' | 'missing' | 'withdrawn'} status The project's icon-set state.
97
97
  * @property {string | null} set The project's icon set as `<package>/<set>`, when selected.
98
98
  * @property {string} reason Why the project has that set, or none.
99
- * @property {Array<{source: {module: string, export: string}, target: {set: string, package: string, id: string, module: string, export: string}, by: 'match' | 'definition'}>} mapped Icons rewritten to the project's set, and the rule that chose each one: a reviewed `exact` or `strong` match, or the icon the set's `map` names for the icon definition the template declares.
99
+ * @property {Array<{source: {module: string, export: string}, target: {set: string, package: string, id: string, module: string, export: string}, by: 'match' | 'definition', dropped?: string[]}>} mapped Icons rewritten to the project's set, and the rule that chose each one: a reviewed `exact` or `strong` match, or the icon the set's `map` names for the icon definition the template declares. `dropped` names the library's sizing props (`size`, `strokeWidth`, `absoluteStrokeWidth`) removed from the icon's elements: an icon set's icons take their size from CSS.
100
100
  * @property {Array<{module: string | null, export: string, reason: string, suggestion?: {set: string, id: string, module: string, export: string, confidence: 'likely'}}>} kept Icons left as the template wrote them, with why, and a `likely` reviewed match as a suggestion when the project set has one. Every declared key is mapped or kept; `module` is null for a key the template does not import, and `export` is `default` for a default import and `*` for a namespace import.
101
101
  */
102
102
 
@@ -144,6 +144,10 @@
144
144
  "kind": "component",
145
145
  "name": "LogStream"
146
146
  },
147
+ {
148
+ "kind": "component",
149
+ "name": "MobilePowerSearch"
150
+ },
147
151
  {
148
152
  "kind": "component",
149
153
  "name": "MobileTokenizer"
@@ -18,7 +18,7 @@ export const docs = {
18
18
  stability: 'experimental',
19
19
  title: 'Icon definitions',
20
20
  summary:
21
- 'Experimental. Every icon definition: what an icon stands for, and the shared name icon sets map their icons to.',
21
+ 'Every icon definition: what an icon stands for, and the shared name icon sets map their icons to.',
22
22
  keywords: [
23
23
  'icon definition',
24
24
  'icon definitions',
@@ -42,7 +42,7 @@ export const docs = {
42
42
  blocks: [
43
43
  {
44
44
  type: 'prose',
45
- text: "An icon definition is one thing an icon stands for, such as `close` or `delete`. Every icon set registers its icons against definitions in its data file's `map`, and templates are written against definitions, so a project that switches icon sets gets the same definition from the new set. Built-in definitions are the shared names Core renders; every set maps them. A set may add its own definitions; in a project that sets `experimental.iconSet`, they are listed here with the package that ships them. `astryx experimental icon <definition>` finds the icon each installed set draws for it. Icon definitions are experimental: they may change or be removed in a patch release.",
45
+ text: "An icon definition is one thing an icon stands for, such as `close` or `delete`. Every icon set registers its icons against definitions in its data file's `map`, and templates are written against definitions, so a project that switches icon sets gets the same definition from the new set. Built-in definitions, marked [built-in], are the shared names Core renders (the semantic icon names in `astryx docs icons`); every set maps them, and `integration check` fails until it does. The others are optional: map each one your library draws. `map` keys a definition by its camelCase name, shown after the id (`eyeSlash`); `experimental icon map` and `--pairs` take either spelling. A set may add its own definitions; in a project that sets `experimental.iconSet`, they are listed here with the package that ships them. `astryx experimental icon <definition>` finds the icon each installed set draws for it. Icon definitions are experimental: they may change or be removed in a patch release.",
46
46
  },
47
47
  ],
48
48
  };
@@ -28,6 +28,6 @@ export const docs = {
28
28
  'IconDefinitionDoc',
29
29
  ],
30
30
  description:
31
- 'Experimental. Every field of the files an icon set is made of: the descriptor, the data file, and an icon definition.',
31
+ 'Every field of the files an icon set is made of: the descriptor, the data file, and an icon definition.',
32
32
  sections: await buildExperimentalAuthoringSections(),
33
33
  };
@@ -24,7 +24,7 @@ export const docs = {
24
24
  'integration icons',
25
25
  ],
26
26
  description:
27
- 'Experimental. Ship an icon set: register each icon against an icon definition, so apps find icons by meaning and templates use your icons.',
27
+ 'Ship an icon set: register each icon against an icon definition, so apps find icons by meaning and templates use your icons.',
28
28
  sections: [
29
29
  {
30
30
  id: 'experimental',
@@ -42,7 +42,7 @@ export const docs = {
42
42
  content: [
43
43
  {
44
44
  type: 'prose',
45
- text: 'Astryx keeps a list of icon definitions: one file per meaning, like `close` or `delete` (`astryx docs cli/experimental/icon-definitions`). An icon set registers which of its icons draws each definition, in the `map` of its data file. Templates say which definition each of their icons draws, so a project that uses your set gets your icon for every definition you map. Every set maps the built-in definitions, the names Core renders itself.',
45
+ text: 'Astryx keeps a list of icon definitions: one file per meaning, like `close` or `delete` (`astryx docs cli/experimental/icon-definitions`). An icon set registers which of its icons draws each definition, in the `map` of its data file; one icon may draw several definitions (`file` and `document` can both be your `document` icon). Templates say which definition each of their icons draws, so a project that uses your set gets your icon for every definition you map. Every set maps the built-in definitions, the names Core renders itself.',
46
46
  },
47
47
  {
48
48
  type: 'prose',
@@ -61,7 +61,11 @@ export const docs = {
61
61
  },
62
62
  {
63
63
  type: 'prose',
64
- text: "`outline.doc.mjs` is the descriptor: name, display name, description, and `license`, the SPDX license of the artwork (it starts as your package's own). `outline.icons.json` starts with no icons and an empty `map`; its `module` is your package name. `outline.generated.js` is the set's generated module, with its declaration file `outline.generated.d.ts`: the CLI writes both, and every icon and the theme map are exports of it. Every field is in {@link schema:icon-set-doc} and {@link schema:icon-set-data}.",
64
+ text: "`outline.doc.mjs` is the descriptor: name, display name and description (`--display-name`, `--description`), and `license`, the SPDX license of the artwork (it starts as your package's own). `outline.icons.json` starts with no icons and an empty `map`; its `module` is your package name. `outline.generated.js` is the set's generated module, with its declaration file `outline.generated.d.ts`: the CLI writes both, and every icon and the theme map are exports of it. Every field is in {@link schema:icon-set-doc} and {@link schema:icon-set-data}.",
65
+ },
66
+ {
67
+ type: 'prose',
68
+ text: "The set's icons import from your package by name, so your package's entry must re-export the generated module. The command writes only the set's own files: your entry, `exports`, `main`, `types`, `files`, peers, and scripts are yours, and the receipt names each change to make as text to copy. For an entry file in the package (and the declaration file package.json names) that is the line `export * from './icon-sets/outline/outline.generated.js';`, relative to it; for a package with no entry, `index.js` and `index.d.ts` with that line and the package.json `main`, `types`, and `exports` that name them; for a built or CommonJS entry, the line to add to the source it is built from. `integration check` names the same change until you make it, and the receipt also names the peers and the `typecheck` script to add. `integration check --strict` type-checks the set's doc files with your package's TypeScript; the receipt says when it is missing (`npm install -D typescript@6`).",
65
69
  },
66
70
  ],
67
71
  },
@@ -71,7 +75,7 @@ export const docs = {
71
75
  content: [
72
76
  {
73
77
  type: 'prose',
74
- text: 'Pick an icon from the library and ask which definitions fit it. Nothing is written yet:',
78
+ text: 'Pick an icon from the library and ask which definitions fit it. Nothing is written yet. To read every icon a set already has, one line each with its words and the definitions it draws, run `astryx experimental icon --set <set> --all-icons`; `astryx experimental icon <set>/<id>` reads one, or says the id does not exist:',
75
79
  },
76
80
  {
77
81
  type: 'code',
@@ -98,11 +102,11 @@ export const docs = {
98
102
  {
99
103
  type: 'code',
100
104
  lang: 'bash',
101
- code: "astryx experimental icon add RotateCw --from @acme/glyph-library --new-definition rotate --description 'Rotate an image or shape.' --words turn,spin",
105
+ code: "astryx experimental icon add Dice5 --from @acme/glyph-library --new-definition random --description 'Pick something at random.' --words dice,shuffle,chance",
102
106
  },
103
107
  {
104
108
  type: 'prose',
105
- text: '`experimental icon map <definition> <icon>` points a definition at an icon the set already has, and `--remove` drops an entry. `experimental icon new-definition <name> --description ... --words ... --icon <id>` adds your own definition for an icon you already have.',
109
+ text: '`experimental icon map <definition> <icon>` points a definition at an icon the set already has (a definition is named in camelCase, `eyeSlash`, or by the kebab id the definitions list shows, `eye-slash`; an icon by its id, its export name in any case, or another name its library exports it as, such as `trash-2`, never by one word of its id), `experimental icon map --pairs close=x-mark,search=magnifying-glass` writes many entries at once (checked together, all or none; an entry the map already has is replaced, and the receipt shows what it was), and `--remove` drops an entry. `experimental icon new-definition <name> --description ... --words ... --icon <id>` adds your own definition for an icon you already have. `experimental icon --definitions` lists every Astryx definition, built in or not, with its words (`--json` for a script).',
106
110
  },
107
111
  ],
108
112
  },
@@ -117,11 +121,29 @@ export const docs = {
117
121
  },
118
122
  {
119
123
  type: 'prose',
120
- text: "Every component the library exports becomes an icon (an alias of one component is recorded once), named `<Name>Icon`, and `map` is filled only where a definition's name or one of its words is an icon's id. Run it again after a library release to refresh the icons; `map` entries whose icon still exists are kept, and the receipt names any that lost theirs.",
124
+ text: "Every component the library exports becomes an icon (an alias of one component is recorded once), named `<Name>Icon`, with an id from its name (`Squares2X2Icon` is `squares-2x2`: a dimension stays one word). `map` is filled only where a definition's name is an icon's id (`delete` → icon `delete`), and the receipt lists those entries under Mapped by name: a library can draw another meaning under the same name (one library's `delete` is a backspace key), so check each. An icon whose id is only one of a definition's words (`trash` for `delete`) may mean something else in this library, so the receipt lists it under Suggestions, with the `experimental icon map <definition> <icon>` command for each, and writes nothing for it: check the meaning, then run the ones that fit. Run it again after a library release to refresh the icons that library supplies; `map` entries whose icon still exists are kept, and the receipt names any icon the library dropped, any icon `--exclude` left out, and the `map` entries each took with it. Icons you added from your own files or another library are left as they are. An icon you already have is known by the library export it re-exports, so it keeps its export name exactly, its `map` entries, variants, and words, even when a newer CLI spells its id differently or your `--exclude` lets a library prefix come off new ids; the receipt lists each changed id under `renamed`. A refresh with `--dry-run` writes nothing and prints the Mapped by name and Suggestions lists again; `--display-name` and `--description` on a refresh rewrite the descriptor. Variants added with `add --variant … --all` are kept too; run that `add` again to pick up icons the release added. `experimental icon --list` shows how many definitions the set maps.",
125
+ },
126
+ {
127
+ type: 'prose',
128
+ text: "With a package or package subpath, it also records the installed library and version as the data file's `source`, so `integration check` warns when your dependency moves to another version; copies the library's LICENSE (and NOTICE) files into the set directory; and sets the descriptor's `license` to the library's. A set you started without `--from` gets the same the first time a refresh records its source, unless you already changed `license`: a `license` you set is kept (the receipt names the library's), and every later refresh keeps it too. Your package.json `license` is never changed. Edit `license` when the artwork's license differs from the library's package license.",
121
129
  },
122
130
  {
123
131
  type: 'prose',
124
- text: 'A library whose icons are data (objects or SVG strings) has no components to find: create the set, declare an `adapter` in its data file (see library shapes), and run the command again; every data export then becomes an icon through the adapter. When every icon export shares a leading word, such as `feather` in `featherEye` and `featherSun`, ids and export names leave it out: `featherEye` becomes id `eye`, exported as `EyeIcon`. The prefix is read over icon-like exports only: SCREAMING_CASE constants (`README`, `VERSION`), number and boolean exports, and, next to components or icon objects, plain strings are never icons. Leave out any other export that is not an icon with `--exclude meta,version`. `experimental icon add` reads the prefix the same way, and reuses the icon an export already has, so its commands need no `--id`.',
132
+ text: 'A library with a module per style supplies variants. Declare them when you create the set, then add a variant for every icon in one run:',
133
+ },
134
+ {
135
+ type: 'code',
136
+ lang: 'bash',
137
+ code: `astryx experimental icon new-set heroicons --from @heroicons/react/24/outline --variants outline,solid --default-variant outline --description 'Heroicons, outline and solid.'
138
+ astryx experimental icon add --variant solid --from @heroicons/react/24/solid --all`,
139
+ },
140
+ {
141
+ type: 'prose',
142
+ text: "A library that redraws its artwork for small sizes (Heroicons' 20px mini and 16px micro) ships each of those as its own set in its own package (their export names match the 24px ones), not as variants: a variant's size comes from CSS. `--variants` lists the variants; `--default-variant` names the one each icon's own export draws (the first variant when omitted). `--all` adds the variant for every icon whose id an export of `--from` has (`TrashIcon` in the solid module becomes `TrashSolidIcon`, the solid variant of `trash`), and the receipt lists the icons the module has no export for. Running it again changes nothing.",
143
+ },
144
+ {
145
+ type: 'prose',
146
+ text: 'A library whose icons are data (objects or SVG strings) has no components to find: create the set, declare an `adapter` in its data file (see library shapes), and run the command again; every data export then becomes an icon through the adapter. When every icon export shares a leading word, such as `feather` in `featherEye` and `featherSun`, ids and export names leave it out: `featherEye` becomes id `eye`, exported as `EyeIcon`. The prefix is read over icon-like exports only: SCREAMING_CASE constants (`README`, `VERSION`), number and boolean exports, and, next to components or icon objects, plain strings are never icons. Components named `…Provider` or `…Context` are never icons either. Leave out any other export that is not an icon with `--exclude meta,version`: the data file keeps the list in `exclude`, so a refresh leaves them out too. When a library exports one icon under several names (`Trash2` and `Trash`), the icon is recorded once and its other names become words, so `experimental icon trash-2` finds it and `experimental icon map delete trash-2` maps it. `experimental icon add` reads the prefix the same way, and reuses the icon an export already has, so its commands need no `--id`.',
125
147
  },
126
148
  ],
127
149
  },
@@ -146,7 +168,7 @@ export const docs = {
146
168
  },
147
169
  {
148
170
  type: 'prose',
149
- text: "`experimental icon add` writes the set's generated module (`generated` in the data file) and its declaration file, which re-exports each component's own types and types each adapted icon as `ComponentType<SVGProps<SVGSVGElement>>`. Add one line to the file your package's entry points at, and to its types; the receipt names it:",
171
+ text: "`experimental icon add` writes the set's generated module (`generated` in the data file) and its declaration file, which re-exports each component's own types and types each adapted icon as `ComponentType<SVGProps<SVGSVGElement>>`. Add this line to your package's entry and its types; `experimental icon new-set` names the exact line and file in its receipt (see add an icon set):",
150
172
  },
151
173
  {
152
174
  type: 'code',
@@ -155,7 +177,7 @@ export const docs = {
155
177
  },
156
178
  {
157
179
  type: 'prose',
158
- text: 'An optional render test you can copy:',
180
+ text: "An optional render test you can copy. Save it inside your package directory and run it there, since it imports your package by name through its `exports`, and install `react-dom` first (`npm install -D react-dom`). A library may add its own classes beside yours, so it checks the class list. A library that sets `width` and `height` attributes (24, say) still fills its box: CSS sizing, such as the `Icon` component's, overrides SVG size attributes.",
159
181
  },
160
182
  {
161
183
  type: 'code',
@@ -167,7 +189,7 @@ import * as icons from '@acme/icons';
167
189
  for (const [name, Icon] of Object.entries(icons)) {
168
190
  if (!name.endsWith('Icon')) continue;
169
191
  const html = renderToStaticMarkup(createElement(Icon, {className: 'x'}));
170
- if (!html.includes('class="x"')) throw new Error(\`\${name} drops className\`);
192
+ if (!/class="([^"]* )?x( [^"]*)?"/.test(html)) throw new Error(\`\${name} drops className\`);
171
193
  if (!html.includes('currentColor')) throw new Error(\`\${name} has a fixed color\`);
172
194
  }`,
173
195
  },
@@ -191,7 +213,7 @@ for (const [name, Icon] of Object.entries(icons)) {
191
213
  ],
192
214
  [
193
215
  'A subpath per style',
194
- '`experimental icon add Bin --from @acme/glyph-library/solid --id bin --variant solid` (a variant of an icon you added; the set must declare it in `variants`)',
216
+ '`experimental icon add --variant solid --from @acme/glyph-library/solid --all` for every icon at once, or `experimental icon add Bin --from @acme/glyph-library/solid --id bin --variant solid` for one (the set must declare the variant: `new-set --variants`)',
195
217
  ],
196
218
  [
197
219
  'One file per icon, default export',
@@ -207,7 +229,7 @@ for (const [name, Icon] of Object.entries(icons)) {
207
229
  ],
208
230
  [
209
231
  'Your own component files',
210
- '`experimental icon add Rocket --from ./src/icons/rocket.js --definition rocket`',
232
+ "`experimental icon add Rocket --from ./src/icons/rocket.js --definition rocket`, and `--id rocket --variant solid` for its other looks. The file exports a component named as written (no library prefix is taken off), with a declaration file beside it (`rocket.d.ts`) or written in TypeScript, since the set's types re-export its own; when package.json lists `files` and none covers it, the receipt names the `files` array that publishes its folder.",
211
233
  ],
212
234
  ],
213
235
  },
@@ -258,7 +280,7 @@ export const brand = defineTheme({name: 'brand', icons: themeIcons});`,
258
280
  content: [
259
281
  {
260
282
  type: 'prose',
261
- text: "`astryx integration check` reads the set without running your icons. An unmapped built-in definition is an error that names the definition's description and words, so you or your agent can pick the icon; the message suggests an `experimental icon map` command only when one of your icons has the definition's name or one of its words as its whole id, and never guesses. Its icon-set codes:",
283
+ text: "`astryx integration check` reads the set without running your icons. An unmapped built-in definition is an error that names the definition's description and words and the `experimental icon map <definition> <icon id>` command that fixes it, so you or your agent can pick the icon. It names a search of your set (`experimental icon <word> --set <set>`) only when that search finds icons, and suggests one icon: the first of the suggestions `experimental icon new-set` gives for that definition. It never matches part of a word, and never writes a suggestion. Its icon-set codes:",
262
284
  },
263
285
  {
264
286
  type: 'list',
@@ -286,7 +308,7 @@ export const brand = defineTheme({name: 'brand', icons: themeIcons});`,
286
308
  },
287
309
  {
288
310
  type: 'prose',
289
- text: 'Errors fail the check. Warnings fail only with `--strict`. A set that maps every built-in definition and every definition it declares passes `--strict`, which integrations run in their build ({@link generic:checks}). The flow, start to finish: `experimental icon new-set` → `integration check` → `experimental icon add` (or `experimental icon map`) for each definition it lists → `integration check` passes.',
311
+ text: 'Errors fail the check. Warnings fail only with `--strict`. A set that maps every built-in definition and every definition it declares passes `--strict`, which integrations run in their build ({@link generic:checks}). The flow, start to finish: `experimental icon new-set` → `npm install -D typescript@6` when the receipt asks → `integration check` → `experimental icon add` (or `experimental icon map`) for each definition it lists → `integration check` passes.',
290
312
  },
291
313
  ],
292
314
  },
@@ -299,8 +321,12 @@ export const brand = defineTheme({name: 'brand', icons: themeIcons});`,
299
321
  style: 'unordered',
300
322
  items: [
301
323
  'Run `astryx integration verify` yourself before publishing. Do not put it in `prepublishOnly`: under `npm publish --dry-run` its own `npm pack` becomes a dry run too, and it checks nothing.',
302
- "Declare `@astryxdesign/cli` as an optional peer (`peerDependenciesMeta`). A required peer an app cannot satisfy makes npm remove the app's CLI without a word. Icon sets are experimental, so no version range promises them: any CLI release that has `astryx experimental icon` reads a set, and the format may change in a patch release. A CLI without it reads `experimental` as a manifest key it does not know: `astryx doctor` there warns that your package was published against a newer Astryx CLI, other commands print a one-line nudge to run it, and your icons, icon definitions, and template icon mapping do not appear ({@link generic:versioning}).",
303
- 'Your package needs `react` (the theme map and adapter use it): declare it as a peer, as Core does.',
324
+ "Declare `@astryxdesign/cli` as an optional peer (`peerDependenciesMeta`). A required peer an app cannot satisfy makes npm remove the app's CLI without a word. Icon sets are experimental, so no version range promises them, and the format may change in a patch release. A CLI reads a set only when it knows every key the set's data file uses: a key it does not know withdraws the set, naming the key. `exclude` is read only by a CLI whose data-file reference lists it ({@link schema:icon-set-data}); a set without `exclude` is read by every CLI that has `astryx experimental icon`. A CLI without it reads `experimental` as a manifest key it does not know: `astryx doctor` there warns that your package was published against a newer Astryx CLI, other commands print a one-line nudge to run it, and your icons, icon definitions, and template icon mapping do not appear ({@link generic:versioning}).",
325
+ "Every built-in definition needs an icon, because Core renders it. When your library has no icon with that exact meaning, map the closest one, or add your own artwork as a component file in your package (`experimental icon add <Name> --from ./src/icons/<name>.js --definition <definition>`; a ./ path is named as written). Artwork you draw is yours: note its license beside the library's, for example in a NOTICE file in the set directory.",
326
+ 'The generated declaration file imports React types, so declare `@types/react` as an optional peer for TypeScript users.',
327
+ 'Keep the wrapped library in `dependencies`: your generated module re-exports its components, so apps get it with your package, and `integration check` compares its range with the version the data file records.',
328
+ "`integration check --strict` type-checks the set's doc files; it does not type-check the generated declaration file against React's types. Run `tsc` with `@types/react` installed to check those.",
329
+ 'Your package needs `react` (the theme map and adapter use it) as a peer, as Core does. The `experimental icon new-set` receipt names the peers your package.json does not declare yet, as the JSON to add: `react` (`>=18`), and `@types/react` and `@astryxdesign/cli` (from the release that wrote the set) as optional peers; and the `typecheck` script (`astryx integration check --strict`) when there is none.',
304
330
  ],
305
331
  },
306
332
  ],
@@ -329,7 +355,11 @@ astryx experimental icon use outline # make it the project's icon set`,
329
355
  },
330
356
  {
331
357
  type: 'prose',
332
- text: "A template declares, in its descriptor's `icons`, the definition each imported icon draws (`{TrashIcon: 'delete'}`). Once the project sets `experimental.iconSet` in astryx.config (`experimental icon use` writes it), each declared icon becomes the set's icon for that definition. An icon the set does not map keeps its original import, and the copy reports every icon as mapped or kept. Nothing is guessed from names.",
358
+ text: "A template declares, in its descriptor's `icons`, the definition each imported icon draws (`{TrashIcon: 'delete'}`). Once the project sets `experimental.iconSet` in astryx.config (`experimental icon use` writes it), each declared icon becomes the set's icon for that definition. An icon the set does not map keeps its original import, and the copy reports every icon as mapped or kept. Nothing is guessed from names. A mapped icon loses its library's sizing props (`size`, `strokeWidth`, `absoluteStrokeWidth`), since a set's icons take their size from CSS; the report names them as `dropped`. Comments on a rewritten import line are kept.",
359
+ },
360
+ {
361
+ type: 'prose',
362
+ text: "Each `icons` key is the name the template imports from its module, not a local alias. When a template imports the same name from two modules, such as `TrashIcon` from a library's outline and solid modules, one key covers both: both draw the same definition. Each then becomes the project set's variant of the same name when its module belongs to an installed set that declares the variant (so solid stays solid), else the set's default.",
333
363
  },
334
364
  ],
335
365
  },
@@ -363,11 +393,11 @@ astryx experimental icon use outline # make it the project's icon set`,
363
393
  ],
364
394
  [
365
395
  '`astryx doctor`',
366
- 'The `icon-sets` check: fails when `experimental.iconSet` names a set that is not installed or was withdrawn (an invalid set, or one whose module does not resolve), saying why, and warns when two packages ship a set by that name or a set was withdrawn.',
396
+ 'In an app, the `icon-sets` check: fails when `experimental.iconSet` names a set that is not installed or was withdrawn (an invalid set, or one whose module does not resolve), saying why, and warns when two packages ship a set by that name or a set was withdrawn. In your icon-set package, check with `astryx integration check` instead: plain `doctor` diagnoses an app.',
367
397
  ],
368
398
  [
369
399
  'JSON types',
370
- '`icon.search`, `icon.detail`, `icon.list`, `icon.use`, `icon.map`, `icon.add`, `icon.definitionMatches`, `icon.newSet`, and `icon.newDefinition`, from the matching `astryx experimental icon` command.',
400
+ '`icon.search`, `icon.detail`, `icon.list`, `icon.setIcons`, `icon.definitions`, `icon.use`, `icon.map`, `icon.mapMany`, `icon.add`, `icon.addVariants`, `icon.definitionMatches`, `icon.newSet`, and `icon.newDefinition`, from the matching `astryx experimental icon` command.',
371
401
  ],
372
402
  ],
373
403
  },
@@ -0,0 +1,94 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * @file `astryx docs cli/experimental/render-pages`: turn a page into one
5
+ * self-contained HTML file to share or embed, and turn that file back into
6
+ * the page.
7
+ */
8
+
9
+ /** @type {import('@astryxdesign/cli/authoring').ReferenceDoc} */
10
+ export const docs = {
11
+ type: 'generic',
12
+ name: 'render-pages',
13
+ placement: {parent: 'namespace:experimental', slot: 'guides', order: 20},
14
+ stability: 'experimental',
15
+ title: 'Pages as one HTML file',
16
+ category: 'guide',
17
+ keywords: [
18
+ 'render',
19
+ 'static html',
20
+ 'single file',
21
+ 'artifact',
22
+ 'share a page',
23
+ 'snapshot',
24
+ 'embed',
25
+ 'sandboxed iframe',
26
+ 'reverse',
27
+ ],
28
+ description:
29
+ 'Experimental. Render a page to one self-contained HTML file for sharing or embedding, and get the page back from it.',
30
+ sections: [
31
+ {
32
+ id: 'experimental',
33
+ title: 'Experimental',
34
+ content: [
35
+ {
36
+ type: 'prose',
37
+ text: 'This command is experimental, as everything under `astryx docs cli/experimental` is: its options, its output file and its JSON may still change. Nothing else in the CLI changes because it exists.',
38
+ },
39
+ ],
40
+ },
41
+ {
42
+ id: 'make-a-file',
43
+ title: 'Make a file to share',
44
+ content: [
45
+ {
46
+ type: 'prose',
47
+ text: 'Build the page with Astryx components as usual, then render it. The page module needs a default export; it renders on your machine with the React and Astryx packages your project installed.',
48
+ },
49
+ {
50
+ type: 'code',
51
+ lang: 'bash',
52
+ code: 'astryx experimental render src/app/page.tsx --out page.html',
53
+ },
54
+ {
55
+ type: 'prose',
56
+ text: 'The result is ONE file with nothing beside it: the markup, only the CSS rules the page uses (from Core and from any stylesheet it imports, such as a theme), the page\u2019s own StyleX styles, and local images as data: URIs. It runs no script and loads nothing from the network, so it opens from disk, attaches to a message, and displays inside a sandboxed frame that blocks network and script. Colors follow the viewer\u2019s light or dark setting, and a `data-theme` of `light` or `dark` on the root element picks one. The file also carries the source of the page and of every local module, stylesheet, JSON file and image it imports, so whoever you share it with can read that code; keep secrets out of what the page imports.',
57
+ },
58
+ {
59
+ type: 'prose',
60
+ text: 'What it cannot keep: anything that needs a browser while running. State, effects, click handlers and data loaded after the first paint are gone, and a chart sized by its container is empty, so give charts a fixed size. Read browser-only values such as window inside an effect, or the render stops with ERR_RENDER_BROWSER_API.',
61
+ },
62
+ ],
63
+ },
64
+ {
65
+ id: 'warnings',
66
+ title: 'Read the warnings',
67
+ content: [
68
+ {
69
+ type: 'prose',
70
+ text: 'Each warning names something that may look different from what you meant, and what to change. The most common is a component that ignores its children: `<ListItem>Save</ListItem>` renders an empty row because ListItem takes `label="Save"`. Others flag remote images (a sandboxed viewer cannot load them; save the image next to the page and import it), a `<script>`, `<link>` or `<iframe>` the page itself renders (the file promises to run and load nothing, so remove them), missing images, and output the page printed while rendering.',
71
+ },
72
+ ],
73
+ },
74
+ {
75
+ id: 'get-it-back',
76
+ title: 'Get the page back',
77
+ content: [
78
+ {
79
+ type: 'code',
80
+ lang: 'bash',
81
+ code: 'astryx experimental render --reverse page.html --out page.tsx',
82
+ },
83
+ {
84
+ type: 'prose',
85
+ text: 'Every rendered file carries its source, so this writes the page back byte for byte; edit it and render again. A file whose source block was removed but whose markup came from Astryx components is rebuilt from that markup instead: the components, their recorded props and the text come back, while styling, icons and behavior do not, so treat it as a starting point. HTML that was never an Astryx page is refused with ERR_RENDER_NOT_ASTRYX; describe the page to `astryx build` to start one.',
86
+ },
87
+ {
88
+ type: 'prose',
89
+ text: 'It writes the page, the modules, stylesheets and JSON files the page reaches through its own imports, and the images, fonts and media the render carried (however the page named them, as long as their bytes really are one): each goes where the page\'s relative imports find it from wherever you put the page, and a file the page imports through a path alias (`@/components/Header`) goes where your project\'s `tsconfig.json` or `jsconfig.json` alias points. Every file but the page goes inside the one new folder the restore creates (the topmost folder on the page\'s path that does not exist yet), never into a folder that already exists: a page that imports other files comes back into a new folder (`--out restored/app/page.tsx`), and a file it imports through a path alias comes back only when that alias points inside the new folder. Nor does it write a file that a test, story or benchmark runner would run by its default patterns (Jest, Vitest, Bun, AVA, Playwright, Storybook, Cypress and `node --test`: names such as `*.test.*`, `*.spec.*`, `*_test.*`, `*-test.*`, `*.bench.*`, `*.stories.*`, `*.cy.*`, and anything under `test/`, `tests/` or `__tests__/`), judged from the repository root (every folder above the file up to it), else the topmost folder with a package.json. Restored files are the sender\'s code: read them before you run or import them. Without `--out`, everything comes back into a new folder beside the HTML file, named after it (`page.html` comes back into `page-restored/`). A received file that carries anything else (a file the page never imports, a dotfile, `package.json`, a tool configuration, a path that leaves the folder) is refused with nothing written. An existing file is never replaced unless you pass `--overwrite`, and the refusal names every one; a generated, vendored or ignored file, and any path through a symbolic link, is not written even then. Add `--json` for the result as data: what was written, how big it is, and every warning.',
90
+ },
91
+ ],
92
+ },
93
+ ],
94
+ };
@@ -5,5 +5,5 @@ export default {
5
5
  type: 'icon-definition',
6
6
  name: 'activity',
7
7
  description: 'Activity or live status over time.',
8
- words: ['pulse', 'monitor', 'live'],
8
+ words: ['pulse', 'live'],
9
9
  };
@@ -0,0 +1,9 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @type {import('@astryxdesign/cli/authoring').IconDefinitionDoc} */
4
+ export default {
5
+ type: 'icon-definition',
6
+ name: 'alignCenter',
7
+ description: 'Center text or items.',
8
+ words: ['center align', 'centre', 'text align'],
9
+ };
@@ -0,0 +1,10 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @type {import('@astryxdesign/cli/authoring').IconDefinitionDoc} */
4
+ export default {
5
+ type: 'icon-definition',
6
+ name: 'alignEnd',
7
+ description:
8
+ 'Align text or items to the end edge: the right in a left-to-right layout, the left in a right-to-left one.',
9
+ words: ['align end', 'right align', 'justify right', 'text align'],
10
+ };
@@ -0,0 +1,10 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @type {import('@astryxdesign/cli/authoring').IconDefinitionDoc} */
4
+ export default {
5
+ type: 'icon-definition',
6
+ name: 'alignStart',
7
+ description:
8
+ 'Align text or items to the start edge: the left in a left-to-right layout, the right in a right-to-left one.',
9
+ words: ['align start', 'left align', 'justify left', 'text align'],
10
+ };
@@ -5,5 +5,5 @@ export default {
5
5
  type: 'icon-definition',
6
6
  name: 'archive',
7
7
  description: 'Archive an item.',
8
- words: ['store', 'box'],
8
+ words: ['box', 'stash'],
9
9
  };