@dxtmisha/scripts 0.11.8 → 1.1.0

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 (335) hide show
  1. package/CHANGELOG.md +77 -0
  2. package/ai-resources/componentMaterials.md +19 -0
  3. package/ai-resources/componentPrompt.md +381 -0
  4. package/ai-resources/componentWiki.md +13 -0
  5. package/bin/arguments.ts +168 -0
  6. package/bin/build-packages.ts +34 -3
  7. package/bin/build-publish-packages.ts +12 -2
  8. package/bin/design-component.ts +7 -1
  9. package/bin/design-constructor.ts +22 -3
  10. package/bin/design-figma.ts +26 -4
  11. package/bin/design-flags.ts +14 -2
  12. package/bin/design-library.ts +7 -1
  13. package/bin/design-package.ts +29 -5
  14. package/bin/design-prompt.ts +27 -3
  15. package/bin/design-screenshot.ts +12 -2
  16. package/bin/design-types-save.ts +32 -5
  17. package/bin/design-types.ts +32 -6
  18. package/bin/design-ui.ts +21 -3
  19. package/bin/design-wiki-storm.ts +11 -3
  20. package/dist/AiZAi-BiLAcdFy.js +232 -0
  21. package/dist/PropertiesConfig-BKZz_FWW.js +262 -0
  22. package/{src/config.ts → dist/config.d.ts} +185 -158
  23. package/dist/config.js +20 -0
  24. package/dist/figmaApiTypes-CArSsNW8.js +6 -0
  25. package/dist/library-ai.d.ts +482 -0
  26. package/dist/library-ai.js +2 -0
  27. package/dist/library-figma.d.ts +462 -0
  28. package/dist/library-figma.js +75 -0
  29. package/dist/library-ui.d.ts +586 -0
  30. package/dist/library-ui.js +3760 -0
  31. package/dist/library.d.ts +4910 -0
  32. package/dist/library.js +1568 -0
  33. package/dist/propertyTypes-C64u6rT3.js +236 -0
  34. package/package.json +76 -27
  35. package/bin/ai-doc.ts +0 -7
  36. package/bin/build-functional.ts +0 -5
  37. package/bin/design-component-wiki.ts +0 -11
  38. package/src/classes/Ai/AiAbstract.ts +0 -242
  39. package/src/classes/Ai/AiClaude.ts +0 -26
  40. package/src/classes/Ai/AiClaudeAgent.ts +0 -16
  41. package/src/classes/Ai/AiClaudeAgentLite.ts +0 -86
  42. package/src/classes/Ai/AiClaudeCli.ts +0 -24
  43. package/src/classes/Ai/AiClaudeCliLite.ts +0 -108
  44. package/src/classes/Ai/AiClaudeLite.ts +0 -112
  45. package/src/classes/Ai/AiDoc.ts +0 -81
  46. package/src/classes/Ai/AiDocItem.ts +0 -27
  47. package/src/classes/Ai/AiDocItemAbstract.ts +0 -209
  48. package/src/classes/Ai/AiDocItemClasses.ts +0 -27
  49. package/src/classes/Ai/AiDocItemComposables.ts +0 -20
  50. package/src/classes/Ai/AiDocType.ts +0 -45
  51. package/src/classes/Ai/AiGoogle.ts +0 -26
  52. package/src/classes/Ai/AiGoogleCli.ts +0 -24
  53. package/src/classes/Ai/AiGoogleCliLite.ts +0 -108
  54. package/src/classes/Ai/AiGoogleLite.ts +0 -78
  55. package/src/classes/Ai/AiOpenAi.ts +0 -26
  56. package/src/classes/Ai/AiOpenAiLite.ts +0 -107
  57. package/src/classes/Ai/AiZAi.ts +0 -17
  58. package/src/classes/Ai/AiZAiLite.ts +0 -77
  59. package/src/classes/Ai/ApiTmp.ts +0 -43
  60. package/src/classes/BrowserItem.ts +0 -408
  61. package/src/classes/Build/BuildFunctional.ts +0 -54
  62. package/src/classes/Build/BuildPackages.ts +0 -137
  63. package/src/classes/Build/BuildPublishPackages.ts +0 -105
  64. package/src/classes/BuildItem.ts +0 -187
  65. package/src/classes/Component/ComponentCreator.ts +0 -45
  66. package/src/classes/Component/ComponentItem.ts +0 -161
  67. package/src/classes/Component/ComponentWiki.ts +0 -258
  68. package/src/classes/Component/ComponentWikiFile.ts +0 -138
  69. package/src/classes/Design/DesignCommand.ts +0 -243
  70. package/src/classes/Design/DesignComponent.ts +0 -824
  71. package/src/classes/Design/DesignConstructor.ts +0 -222
  72. package/src/classes/Design/DesignConstructors.ts +0 -101
  73. package/src/classes/Design/DesignFigma.ts +0 -61
  74. package/src/classes/Design/DesignFlags.ts +0 -215
  75. package/src/classes/Design/DesignReplace.ts +0 -672
  76. package/src/classes/Design/DesignScreenshot.ts +0 -140
  77. package/src/classes/Design/DesignStructure.ts +0 -201
  78. package/src/classes/Design/DesignStructureClasses.ts +0 -105
  79. package/src/classes/Design/DesignStructureItemAbstract.ts +0 -52
  80. package/src/classes/Design/DesignStructureRead.ts +0 -349
  81. package/src/classes/Design/DesignStructureStyles.ts +0 -45
  82. package/src/classes/Design/DesignTypes.ts +0 -94
  83. package/src/classes/Design/DesignTypesAi.ts +0 -135
  84. package/src/classes/Design/DesignTypesDescription.ts +0 -121
  85. package/src/classes/Design/DesignTypesMake.ts +0 -460
  86. package/src/classes/Design/DesignTypesMcp.ts +0 -90
  87. package/src/classes/Design/DesignTypesPrompts.ts +0 -332
  88. package/src/classes/Design/DesignTypescript.ts +0 -244
  89. package/src/classes/Design/DesignUi.ts +0 -143
  90. package/src/classes/Design/DesignWiki.ts +0 -52
  91. package/src/classes/Design/DesignWikiStorm.ts +0 -95
  92. package/src/classes/Design/DesignWikiStormItem.ts +0 -316
  93. package/src/classes/FigmaApi.ts +0 -190
  94. package/src/classes/Git/GitRead.ts +0 -261
  95. package/src/classes/Library/LibraryAiMcpItem.ts +0 -67
  96. package/src/classes/Library/LibraryAiPrompt.ts +0 -268
  97. package/src/classes/Library/LibraryAiPromptItem.ts +0 -331
  98. package/src/classes/Library/LibraryAiWiki.ts +0 -127
  99. package/src/classes/Library/LibraryAiWikiItem.ts +0 -79
  100. package/src/classes/Library/LibraryExport.ts +0 -167
  101. package/src/classes/Library/LibraryFlags.ts +0 -62
  102. package/src/classes/Library/LibraryItems.ts +0 -138
  103. package/src/classes/Library/LibraryList.ts +0 -189
  104. package/src/classes/Library/LibraryMedia.ts +0 -139
  105. package/src/classes/Library/LibraryPlugin.ts +0 -73
  106. package/src/classes/Library/LibraryTypes.ts +0 -130
  107. package/src/classes/Package/PackageFile.ts +0 -154
  108. package/src/classes/Package/PackageInit.ts +0 -54
  109. package/src/classes/Package/PackageItem.ts +0 -329
  110. package/src/classes/Properties/Properties.ts +0 -175
  111. package/src/classes/Properties/PropertiesCache.ts +0 -248
  112. package/src/classes/Properties/PropertiesConfig.ts +0 -213
  113. package/src/classes/Properties/PropertiesConvector.ts +0 -52
  114. package/src/classes/Properties/PropertiesFile.ts +0 -522
  115. package/src/classes/Properties/PropertiesImport.ts +0 -182
  116. package/src/classes/Properties/PropertiesItems.ts +0 -605
  117. package/src/classes/Properties/PropertiesKeys.ts +0 -121
  118. package/src/classes/Properties/PropertiesMain.ts +0 -138
  119. package/src/classes/Properties/PropertiesPalette.ts +0 -149
  120. package/src/classes/Properties/PropertiesPath.ts +0 -193
  121. package/src/classes/Properties/PropertiesScss.ts +0 -261
  122. package/src/classes/Properties/PropertiesSeparator.ts +0 -118
  123. package/src/classes/Properties/PropertiesSettings.ts +0 -104
  124. package/src/classes/Properties/PropertiesStandard.ts +0 -180
  125. package/src/classes/Properties/PropertiesTool.ts +0 -80
  126. package/src/classes/Properties/PropertiesTypes.ts +0 -147
  127. package/src/classes/Properties/PropertiesValues.ts +0 -75
  128. package/src/classes/Properties/PropertiesWrap.ts +0 -187
  129. package/src/classes/Properties/convector/convectorColor.ts +0 -27
  130. package/src/classes/Properties/convector/convectorFontFamilies.ts +0 -18
  131. package/src/classes/Properties/convector/convectorShadow.ts +0 -61
  132. package/src/classes/Properties/convector/convectorTypography.ts +0 -19
  133. package/src/classes/Properties/to/PropertiesToAbstract.ts +0 -51
  134. package/src/classes/Properties/to/PropertiesToAnimate.ts +0 -59
  135. package/src/classes/Properties/to/PropertiesToClass.ts +0 -49
  136. package/src/classes/Properties/to/PropertiesToClone.ts +0 -114
  137. package/src/classes/Properties/to/PropertiesToComponent.ts +0 -52
  138. package/src/classes/Properties/to/PropertiesToDrag.ts +0 -231
  139. package/src/classes/Properties/to/PropertiesToDuplicate.ts +0 -165
  140. package/src/classes/Properties/to/PropertiesToFull.ts +0 -36
  141. package/src/classes/Properties/to/PropertiesToLink.ts +0 -259
  142. package/src/classes/Properties/to/PropertiesToMedia.ts +0 -187
  143. package/src/classes/Properties/to/PropertiesToMulti.ts +0 -101
  144. package/src/classes/Properties/to/PropertiesToNone.ts +0 -46
  145. package/src/classes/Properties/to/PropertiesToPalette.ts +0 -241
  146. package/src/classes/Properties/to/PropertiesToProperty.ts +0 -31
  147. package/src/classes/Properties/to/PropertiesToRemove.ts +0 -33
  148. package/src/classes/Properties/to/PropertiesToReplace.ts +0 -77
  149. package/src/classes/Properties/to/PropertiesToRoot.ts +0 -40
  150. package/src/classes/Properties/to/PropertiesToSimilar.ts +0 -128
  151. package/src/classes/Properties/to/PropertiesToSort.ts +0 -146
  152. package/src/classes/Properties/to/PropertiesToState.ts +0 -65
  153. package/src/classes/Properties/to/PropertiesToStyle.ts +0 -52
  154. package/src/classes/Properties/to/PropertiesToSub.ts +0 -95
  155. package/src/classes/Properties/to/PropertiesToSubclass.ts +0 -76
  156. package/src/classes/Properties/to/PropertiesToVar.ts +0 -194
  157. package/src/classes/Properties/to/PropertiesToVariable.ts +0 -176
  158. package/src/classes/Styles/Styles.ts +0 -247
  159. package/src/classes/Styles/StylesClasses.ts +0 -86
  160. package/src/classes/Styles/StylesProperties.ts +0 -197
  161. package/src/classes/Styles/StylesRoot.ts +0 -103
  162. package/src/classes/Styles/StylesTool.ts +0 -112
  163. package/src/classes/Styles/to/StylesToAbstract.ts +0 -93
  164. package/src/classes/Styles/to/StylesToAnimate.ts +0 -19
  165. package/src/classes/Styles/to/StylesToClass.ts +0 -25
  166. package/src/classes/Styles/to/StylesToClassFull.ts +0 -19
  167. package/src/classes/Styles/to/StylesToContainer.ts +0 -24
  168. package/src/classes/Styles/to/StylesToMedia.ts +0 -19
  169. package/src/classes/Styles/to/StylesToProperty.ts +0 -123
  170. package/src/classes/Styles/to/StylesToRoot.ts +0 -14
  171. package/src/classes/Styles/to/StylesToSelector.ts +0 -71
  172. package/src/classes/Styles/to/StylesToVar.ts +0 -105
  173. package/src/classes/Styles/to/StylesToVirtual.ts +0 -33
  174. package/src/composables/useAi.ts +0 -38
  175. package/src/demo/ai.ts +0 -10
  176. package/src/functions/getComponentPaths.ts +0 -13
  177. package/src/functions/getConfigAi.ts +0 -14
  178. package/src/functions/getConstructorProperties.ts +0 -54
  179. package/src/functions/getDirname.ts +0 -17
  180. package/src/functions/getNameDirByPaths.ts +0 -16
  181. package/src/functions/getPackageJson.ts +0 -19
  182. package/src/functions/hasNativeDirname.ts +0 -8
  183. package/src/functions/run.ts +0 -47
  184. package/src/functions/toPathStandardSep.ts +0 -14
  185. package/src/library-ai.ts +0 -10
  186. package/src/library.ts +0 -73
  187. package/src/media/ai/ai-doc-types.ts +0 -21
  188. package/src/media/properties/css.ts +0 -634
  189. package/src/media/properties/cssSelector.ts +0 -74
  190. package/src/media/properties/cssVirtual.ts +0 -12
  191. package/src/media/properties/listSort.ts +0 -113
  192. package/src/media/properties/style.ts +0 -81
  193. package/src/media/templates/component/DesignComponent.mdx +0 -30
  194. package/src/media/templates/component/DesignComponent.stories.ts +0 -34
  195. package/src/media/templates/component/DesignComponent.vue +0 -54
  196. package/src/media/templates/component/DesignComponentAiWiki.vue +0 -25
  197. package/src/media/templates/component/index.ts +0 -13
  198. package/src/media/templates/component/props.ts +0 -27
  199. package/src/media/templates/component/styleToken.scss +0 -17
  200. package/src/media/templates/component/wiki.ts +0 -13
  201. package/src/media/templates/component/wikiData.ts +0 -28
  202. package/src/media/templates/componentDoc/ComponentDoc.vue +0 -26
  203. package/src/media/templates/componentDoc/index.ts +0 -12
  204. package/src/media/templates/componentDoc/materials/README.md +0 -8
  205. package/src/media/templates/componentDoc/materials/prompt.md +0 -38
  206. package/src/media/templates/componentDoc/subcomponents/_.gitignore.txt +0 -0
  207. package/src/media/templates/componentDoc/types.ts +0 -15
  208. package/src/media/templates/componentDoc/wiki/ComponentDoc.mdx +0 -13
  209. package/src/media/templates/componentDoc/wiki/ComponentDoc.stories.ts +0 -24
  210. package/src/media/templates/componentDoc/wiki/prompt.md +0 -41
  211. package/src/media/templates/constructors/Constructors.ts +0 -33
  212. package/src/media/templates/constructors/ConstructorsDesign.tsx +0 -129
  213. package/src/media/templates/constructors/basicTypes.ts +0 -0
  214. package/src/media/templates/constructors/index.ts +0 -5
  215. package/src/media/templates/constructors/props.ts +0 -28
  216. package/src/media/templates/constructors/style.scss +0 -5
  217. package/src/media/templates/constructors/types.ts +0 -47
  218. package/src/media/templates/packages/figma/README.md +0 -1
  219. package/src/media/templates/packages/figma/_.gitignore.txt +0 -29
  220. package/src/media/templates/packages/figma/ai.sample.config.ts +0 -2
  221. package/src/media/templates/packages/figma/design.config.json +0 -3
  222. package/src/media/templates/packages/figma/index.html +0 -12
  223. package/src/media/templates/packages/figma/manifest.json +0 -25
  224. package/src/media/templates/packages/figma/package.json +0 -37
  225. package/src/media/templates/packages/figma/src/App.vue +0 -9
  226. package/src/media/templates/packages/figma/src/classes/_.gitignore.txt +0 -1
  227. package/src/media/templates/packages/figma/src/code.ts +0 -16
  228. package/src/media/templates/packages/figma/src/components/_.gitignore.txt +0 -1
  229. package/src/media/templates/packages/figma/src/composables/_.gitignore.txt +0 -1
  230. package/src/media/templates/packages/figma/src/config.ts +0 -0
  231. package/src/media/templates/packages/figma/src/functions/_.gitignore.txt +0 -1
  232. package/src/media/templates/packages/figma/src/library.ts +0 -0
  233. package/src/media/templates/packages/figma/src/main.ts +0 -4
  234. package/src/media/templates/packages/figma/src/media/_.gitignore.txt +0 -1
  235. package/src/media/templates/packages/figma/src/storybook/_.gitignore.txt +0 -1
  236. package/src/media/templates/packages/figma/src/types/_.gitignore.txt +0 -1
  237. package/src/media/templates/packages/figma/src/vite-env.d.ts +0 -1
  238. package/src/media/templates/packages/figma/tsconfig.app.json +0 -12
  239. package/src/media/templates/packages/figma/tsconfig.json +0 -7
  240. package/src/media/templates/packages/figma/tsconfig.node.json +0 -8
  241. package/src/media/templates/packages/figma/vite.config.ts +0 -7
  242. package/src/media/templates/packages/library/README.md +0 -1
  243. package/src/media/templates/packages/library/_.gitignore.txt +0 -27
  244. package/src/media/templates/packages/library/ai-description.md +0 -15
  245. package/src/media/templates/packages/library/design.config.json +0 -3
  246. package/src/media/templates/packages/library/index.html +0 -12
  247. package/src/media/templates/packages/library/materials/README.md +0 -8
  248. package/src/media/templates/packages/library/materials/prompt.md +0 -45
  249. package/src/media/templates/packages/library/package.json +0 -46
  250. package/src/media/templates/packages/library/src/App.vue +0 -8
  251. package/src/media/templates/packages/library/src/classes/_.gitignore.txt +0 -1
  252. package/src/media/templates/packages/library/src/components/_.gitignore.txt +0 -1
  253. package/src/media/templates/packages/library/src/composables/_.gitignore.txt +0 -1
  254. package/src/media/templates/packages/library/src/functions/_.gitignore.txt +0 -1
  255. package/src/media/templates/packages/library/src/library.ts +0 -0
  256. package/src/media/templates/packages/library/src/main.ts +0 -6
  257. package/src/media/templates/packages/library/src/style.scss +0 -0
  258. package/src/media/templates/packages/library/src/types/_.gitignore.txt +0 -1
  259. package/src/media/templates/packages/library/src/vite-env.d.ts +0 -1
  260. package/src/media/templates/packages/library/tsconfig.app.json +0 -11
  261. package/src/media/templates/packages/library/tsconfig.json +0 -7
  262. package/src/media/templates/packages/library/tsconfig.node.json +0 -7
  263. package/src/media/templates/packages/library/vite.config.ts +0 -14
  264. package/src/media/templates/packages/nitro/README.md +0 -1
  265. package/src/media/templates/packages/nitro/_.gitignore.txt +0 -28
  266. package/src/media/templates/packages/nitro/index.html +0 -2
  267. package/src/media/templates/packages/nitro/package.json +0 -25
  268. package/src/media/templates/packages/nitro/server/plugins/ui-plugin.ts +0 -7
  269. package/src/media/templates/packages/nitro/server/routes/api/hello.ts +0 -13
  270. package/src/media/templates/packages/nitro/src/App.vue +0 -10
  271. package/src/media/templates/packages/nitro/src/assets/_.gitignore.txt +0 -0
  272. package/src/media/templates/packages/nitro/src/components/_.gitignore.txt +0 -0
  273. package/src/media/templates/packages/nitro/src/composables/_.gitignore.txt +0 -0
  274. package/src/media/templates/packages/nitro/src/entry-client.ts +0 -13
  275. package/src/media/templates/packages/nitro/src/entry-server.ts +0 -29
  276. package/src/media/templates/packages/nitro/src/main.ts +0 -14
  277. package/src/media/templates/packages/nitro/src/pages/HomePage.vue +0 -8
  278. package/src/media/templates/packages/nitro/src/router.ts +0 -11
  279. package/src/media/templates/packages/nitro/src/style.scss +0 -0
  280. package/src/media/templates/packages/nitro/src/templates/main.html +0 -21
  281. package/src/media/templates/packages/nitro/src/vite-env.d.ts +0 -11
  282. package/src/media/templates/packages/nitro/tsconfig.app.json +0 -14
  283. package/src/media/templates/packages/nitro/tsconfig.json +0 -7
  284. package/src/media/templates/packages/nitro/tsconfig.node.json +0 -12
  285. package/src/media/templates/packages/nitro/vite.config.ts +0 -17
  286. package/src/media/templates/packages/project/README.md +0 -1
  287. package/src/media/templates/packages/project/_.gitignore.txt +0 -28
  288. package/src/media/templates/packages/project/design.config.json +0 -3
  289. package/src/media/templates/packages/project/index.html +0 -12
  290. package/src/media/templates/packages/project/materials/README.md +0 -8
  291. package/src/media/templates/packages/project/materials/prompt.md +0 -41
  292. package/src/media/templates/packages/project/package.json +0 -13
  293. package/src/media/templates/packages/project/public/_.gitignore.txt +0 -0
  294. package/src/media/templates/packages/project/src/App.vue +0 -12
  295. package/src/media/templates/packages/project/src/assets/_.gitignore.txt +0 -0
  296. package/src/media/templates/packages/project/src/components/_.gitignore.txt +0 -0
  297. package/src/media/templates/packages/project/src/composables/_.gitignore.txt +0 -0
  298. package/src/media/templates/packages/project/src/main.ts +0 -6
  299. package/src/media/templates/packages/project/src/style.scss +0 -0
  300. package/src/media/templates/packages/project/src/vite-env.d.ts +0 -1
  301. package/src/media/templates/packages/project/tsconfig.app.json +0 -11
  302. package/src/media/templates/packages/project/tsconfig.json +0 -7
  303. package/src/media/templates/packages/project/tsconfig.node.json +0 -7
  304. package/src/media/templates/packages/project/vite.config.ts +0 -7
  305. package/src/media/templates/prompts/aiCodeGlobalPrompt.en.md +0 -22
  306. package/src/media/templates/prompts/aiCodeGlobalPrompt.ru.md +0 -21
  307. package/src/media/templates/prompts/aiCodeVuePrompt.en.md +0 -17
  308. package/src/media/templates/prompts/aiCodeVuePrompt.ru.md +0 -17
  309. package/src/media/templates/prompts/aiDocClassPrompt.en.txt +0 -63
  310. package/src/media/templates/prompts/aiDocClassPrompt.ru.txt +0 -63
  311. package/src/media/templates/prompts/aiDocComposablePrompt.en.txt +0 -67
  312. package/src/media/templates/prompts/aiDocComposablePrompt.ru.txt +0 -67
  313. package/src/media/templates/prompts/aiDocFunctionPrompt.en.txt +0 -57
  314. package/src/media/templates/prompts/aiDocFunctionPrompt.ru.txt +0 -57
  315. package/src/media/templates/prompts/componentPrompt.en.txt +0 -182
  316. package/src/media/templates/prompts/componentPrompt.ru.txt +0 -182
  317. package/src/media/templates/prompts/demoClassEn.mdx +0 -111
  318. package/src/media/templates/prompts/demoClassRu.mdx +0 -111
  319. package/src/media/templates/prompts/demoComponentEn.mdx +0 -282
  320. package/src/media/templates/prompts/demoComponentRu.mdx +0 -282
  321. package/src/media/templates/prompts/demoComposableEn.mdx +0 -103
  322. package/src/media/templates/prompts/demoComposableRu.mdx +0 -103
  323. package/src/media/templates/prompts/demoDocEn.mdx +0 -30
  324. package/src/media/templates/prompts/demoDocRu.mdx +0 -30
  325. package/src/media/templates/viteComponentTemplateConfig.ts +0 -14
  326. package/src/types/aiTypes.ts +0 -19
  327. package/src/types/configTypes.ts +0 -69
  328. package/src/types/designTypes.ts +0 -167
  329. package/src/types/figmaApiTypes.ts +0 -337
  330. package/src/types/gitTypes.ts +0 -59
  331. package/src/types/libraryTypes.ts +0 -49
  332. package/src/types/propertyTypes.ts +0 -586
  333. package/src/types/screenshotTypes.ts +0 -55
  334. package/src/types/webTypes.ts +0 -134
  335. package/src/vite-env.d.ts +0 -1
@@ -0,0 +1,462 @@
1
+ /**
2
+ * Class for downloading and processing design assets from Figma API.
3
+ * Serves as an abstraction for initializing SVG graphics and frame exports from specified Figma files.
4
+ *
5
+ * Класс для скачивания и обработки дизайн-ассетов из Figma API.
6
+ * Служит абстракцией для инициализации SVG-графики и экспорта кадров из указанных файлов Figma.
7
+ */
8
+ export declare class DesignFigma {
9
+ protected readonly fileKey: string;
10
+ protected readonly nodeId?: string | undefined;
11
+ protected readonly token: string;
12
+ /** Figma REST API client instance / Экземпляр клиента REST API Figma */
13
+ protected readonly api: FigmaApi;
14
+ /**
15
+ * Creates an instance of DesignFigma.
16
+ *
17
+ * Создает экземпляр DesignFigma.
18
+ * @param fileKey unique Figma file identifier / уникальный идентификатор файла Figma
19
+ * @param nodeId target node or frame identifier in Figma file / идентификатор целевого узла или кадра в файле Figma
20
+ * @param token Figma API access token / токен доступа к API Figma
21
+ */
22
+ constructor(fileKey: string, nodeId?: string | undefined, token?: string);
23
+ /**
24
+ * Executes the main workflow for retrieving and logging Figma design image assets.
25
+ *
26
+ * Выполняет основной процесс получения и логирования графических ассетов дизайна Figma.
27
+ */
28
+ make(): Promise<void>;
29
+ /**
30
+ * Requests SVG image export URLs for the specified node from Figma API.
31
+ *
32
+ * Запрашивает URL-адреса экспорта SVG-изображений для указанного узла через API Figma.
33
+ * @returns map of node IDs to SVG image URLs, or undefined on error / карта ID узлов к URL SVG-изображений или undefined в случае ошибки
34
+ */
35
+ initImage(): Promise<Record<string, string> | undefined>;
36
+ }
37
+
38
+ /**
39
+ * Class for interacting with the Figma REST API.
40
+ *
41
+ * Класс для взаимодействия с Figma REST API.
42
+ */
43
+ declare class FigmaApi {
44
+ protected token: string;
45
+ protected fileKey: string;
46
+ protected nodeId?: string | undefined;
47
+ /**
48
+ * Constructor for FigmaApi.
49
+ *
50
+ * Конструктор для FigmaApi.
51
+ * @param token Figma REST API access token / токен доступа к REST API Figma
52
+ * @param fileKey unique Figma file identifier / уникальный идентификатор файла Figma
53
+ * @param nodeId optional target node identifier / необязательный идентификатор целевого узла
54
+ */
55
+ constructor(token: string, fileKey: string, nodeId?: string | undefined);
56
+ /**
57
+ * Retrieves file content via the files endpoint.
58
+ *
59
+ * Получает содержимое файла через эндпоинт files.
60
+ * @param parameters query parameters / параметры запроса
61
+ * @returns file content or undefined / содержимое файла или undefined
62
+ */
63
+ files(parameters?: FigmaFilesParams): Promise<FigmaFilesResult | undefined>;
64
+ /**
65
+ * Retrieves specific nodes from the file via the fileNodes endpoint.
66
+ *
67
+ * Получает конкретные узлы из файла через эндпоинт fileNodes.
68
+ * @param parameters query parameters / параметры запроса
69
+ * @returns node data or undefined / данные узлов или undefined
70
+ */
71
+ fileNodes(parameters: FigmaFileNodesParams): Promise<FigmaFileNodesResult | undefined>;
72
+ /**
73
+ * Retrieves images for the file.
74
+ *
75
+ * Получает изображения для файла.
76
+ * @param parameters query parameters / параметры запроса
77
+ * @returns image data or undefined / данные изображения или undefined
78
+ */
79
+ fileImages(parameters: FigmaFileImagesParams): Promise<FigmaFileImagesResult | undefined>;
80
+ /**
81
+ * Retrieves specific nodes from the file via the fileStyles endpoint.
82
+ *
83
+ * Получает конкретные узлы из файла через эндпоинт fileStyles.
84
+ * @returns file styles data or undefined / данные стилей файла или undefined
85
+ */
86
+ fileStyles(): Promise<FigmaFileStylesResult | undefined>;
87
+ /**
88
+ * Retrieves specific style by key via the styles endpoint.
89
+ *
90
+ * Получает конкретный стиль по ключу через эндпоинт styles.
91
+ * @param key the style key / ключ стиля
92
+ * @returns style data or undefined / данные стиля или undefined
93
+ */
94
+ styles(key: string): Promise<FigmaStylesResult | undefined>;
95
+ /**
96
+ * Sets the API token.
97
+ *
98
+ * Устанавливает токен API.
99
+ * @param token the API token / токен API
100
+ * @returns this instance for chaining / этот экземпляр для цепочки вызовов
101
+ */
102
+ setToken(token: string): this;
103
+ /**
104
+ * Sets the file key.
105
+ *
106
+ * Устанавливает ключ файла.
107
+ * @param fileKey the file key / ключ файла
108
+ * @returns this instance for chaining / этот экземпляр для цепочки вызовов
109
+ */
110
+ setFileKey(fileKey: string): this;
111
+ /**
112
+ * Sets the node ID.
113
+ *
114
+ * Устанавливает ID узла.
115
+ * @param nodeId the node ID (optional) / ID узла (необязательно)
116
+ * @returns this instance for chaining / этот экземпляр для цепочки вызовов
117
+ */
118
+ setNodeId(nodeId?: string): this;
119
+ /**
120
+ * Constructs the request URL for the Figma API.
121
+ *
122
+ * Конструирует URL-адрес запроса для Figma API.
123
+ * @param method the API endpoint method / метод конечной точки API
124
+ * @param parameters additional parameters for the request / дополнительные параметры для запроса
125
+ * @param key the key for specific endpoints (e.g., styles) / ключ для конкретных эндпоинтов (например, styles)
126
+ * @returns the constructed URL / сконструированный URL
127
+ */
128
+ getUrl(method: FigmaApiEndpoint, parameters?: Record<string, any>, key?: string): string;
129
+ /**
130
+ * Generic fetch method for making API requests.
131
+ *
132
+ * Общий метод fetch для выполнения запросов к API.
133
+ * @param method the API endpoint method / метод конечной точки API
134
+ * @param parameters parameters for the request / параметры запроса
135
+ * @param key the key for specific endpoints (e.g., styles) / ключ для конкретных эндпоинтов (например, styles)
136
+ * @returns the response data or undefined / данные ответа или undefined
137
+ */
138
+ protected fetch(method: FigmaApiEndpoint, parameters?: Record<string, any>, key?: string): Promise<any>;
139
+ }
140
+
141
+ /**
142
+ * Figma REST API endpoints enum.
143
+ *
144
+ * Перечисление эндпоинтов Figma REST API.
145
+ */
146
+ declare enum FigmaApiEndpoint {
147
+ /** Get file content / Получить содержимое файла */
148
+ files = "files/:file_key",
149
+ /** Get specific nodes from a file / Получить конкретные узлы из файла */
150
+ fileNodes = "files/:file_key/nodes",
151
+ /** Get specific images from a file / Получить конкретные изображения из файла */
152
+ fileImages = "images/:file_key",
153
+ /** Get image fills from a file / Получить заливки изображений из файла */
154
+ fileImageFills = "files/:file_key/images",
155
+ /** Get file versions / Получить версии файла */
156
+ fileVersions = "files/:file_key/versions",
157
+ /** Get file comments / Получить комментарии файла */
158
+ fileComments = "files/:file_key/comments",
159
+ /** Get user information / Получить информацию о пользователе */
160
+ me = "me",
161
+ /** Get team projects / Получить проекты команды */
162
+ teamProjects = "teams/:team_id/projects",
163
+ /** Get project files / Получить файлы проекта */
164
+ projectFiles = "projects/:project_id/files",
165
+ /** Get component information / Получить информацию о компоненте */
166
+ components = "components/:key",
167
+ /** Get file components / Получить компоненты файла */
168
+ fileComponents = "files/:file_key/components",
169
+ /** Get team components / Получить компоненты команды */
170
+ teamComponents = "teams/:team_id/components",
171
+ /** Get component set information / Получить информацию о наборе компонентов */
172
+ componentSets = "component_sets/:key",
173
+ /** Get file component sets / Получить наборы компонентов файла */
174
+ fileComponentSets = "files/:file_key/component_sets",
175
+ /** Get team component sets / Получить наборы компонентов команды */
176
+ teamComponentSets = "teams/:team_id/component_sets",
177
+ /** Get style information / Получить информацию о стиле */
178
+ styles = "styles/:key",
179
+ /** Get file styles / Получить стили файла */
180
+ fileStyles = "files/:file_key/styles",
181
+ /** Get team styles / Получить стили команды */
182
+ teamStyles = "teams/:team_id/styles"
183
+ }
184
+
185
+ /**
186
+ * Parameters for the fileImages endpoint.
187
+ *
188
+ * Параметры для эндпоинта fileImages.
189
+ */
190
+ declare type FigmaFileImagesParams = {
191
+ /** A comma separated list of node IDs to render / Список ID узлов через запятую для рендеринга */
192
+ ids: string;
193
+ /** A number between 0.01 and 4, the image scaling factor / Число от 0.01 до 4, коэффициент масштабирования изображения */
194
+ scale?: number;
195
+ /** The image output format, as a string enum / Формат вывода изображения в виде строки enum */
196
+ format?: 'jpg' | 'png' | 'svg' | 'pdf';
197
+ /**
198
+ * Whether text elements are rendered as outlines (vector paths) or as <text> elements in SVGs /
199
+ * Визуализируются ли текстовые элементы как контуры (векторные контуры) или как элементы <text> в SVG
200
+ * @default true
201
+ */
202
+ svg_outline_text?: boolean;
203
+ /**
204
+ * Whether to include id attributes for all SVG elements. Adds the layer name to the id attribute of an svg element /
205
+ * Включать ли атрибуты id для всех элементов SVG. Добавляет имя слоя в атрибут id элемента svg
206
+ * @default false
207
+ */
208
+ svg_include_id?: boolean;
209
+ /**
210
+ * Whether to include node id attributes for all SVG elements. Adds the node id to a data-node-id attribute of an svg element /
211
+ * Включать ли атрибуты id узла для всех элементов SVG. Добавляет id узла в атрибут data-node-id элемента svg
212
+ * @default false
213
+ */
214
+ svg_include_node_id?: boolean;
215
+ /**
216
+ * Whether to simplify inside/outside strokes and use stroke attribute if possible instead of <mask> /
217
+ * Упрощать ли внутренние/внешние обводки и использовать атрибут stroke, если это возможно, вместо <mask>
218
+ * @default true
219
+ */
220
+ svg_simplify_stroke?: boolean;
221
+ /**
222
+ * Whether content that overlaps the node should be excluded from rendering /
223
+ * Должен ли контент, перекрывающий узел, быть исключен из рендеринга
224
+ * @default true
225
+ */
226
+ contents_only?: boolean;
227
+ /**
228
+ * Use the full dimensions of the node regardless of whether or not it is cropped or the space around it is empty /
229
+ * Использовать полные размеры узла независимо от того, обрезан он или пространство вокруг него пустое
230
+ * @default false
231
+ */
232
+ use_absolute_bounds?: boolean;
233
+ /** A specific version ID to use / Идентификатор конкретной версии для использования */
234
+ version?: string;
235
+ };
236
+
237
+ /**
238
+ * Result returned by the fileImages endpoint.
239
+ *
240
+ * Результат, возвращаемый эндпоинтом fileImages.
241
+ */
242
+ declare type FigmaFileImagesResult = {
243
+ /** Error message if the request failed / Сообщение об ошибке, если запрос не удался */
244
+ err: string | null;
245
+ /** A mapping from node IDs to URLs of the rendered images / Сопоставление ID узлов с URL-адресами отрендеренных изображений */
246
+ images: Record<string, string>;
247
+ /** Status code of the response / Код статуса ответа */
248
+ status: number;
249
+ };
250
+
251
+ /**
252
+ * Parameters for the fileNodes endpoint.
253
+ *
254
+ * Параметры для эндпоинта fileNodes.
255
+ */
256
+ declare type FigmaFileNodesParams = {
257
+ /** A comma separated list of node IDs to retrieve and convert / Список ID узлов через запятую для получения и преобразования */
258
+ ids: string;
259
+ /** A specific version ID to get / Идентификатор конкретной версии для получения */
260
+ version?: string;
261
+ /** How deep into the node tree to traverse / Насколько глубоко по дереву узлов нужно пройтись */
262
+ depth?: number;
263
+ /** Set to "paths" to export vector data / Установите "paths" для экспорта векторных данных */
264
+ geometry?: 'paths';
265
+ /** A comma separated list of plugin IDs to include their data / Список ID плагинов через запятую для включения их данных */
266
+ plugin_data?: string;
267
+ };
268
+
269
+ /**
270
+ * Result returned by the fileNodes endpoint.
271
+ *
272
+ * Результат, возвращаемый эндпоинтом fileNodes.
273
+ */
274
+ declare type FigmaFileNodesResult = {
275
+ /** File name / Название файла */
276
+ name: string;
277
+ /** User's role in the file / Роль пользователя в файле */
278
+ role: string;
279
+ /** Last modified date / Дата последнего изменения */
280
+ lastModified: string;
281
+ /** Editor type (figma or figjam) / Тип редактора (figma или figjam) */
282
+ editorType: string;
283
+ /** URL to the file thumbnail / URL миниатюры файла */
284
+ thumbnailUrl: string;
285
+ /** Error message if any / Сообщение об ошибке, если есть */
286
+ err?: string;
287
+ /** Map of node IDs to node data / Карта ID узлов и данных узлов */
288
+ nodes: Record<string, {
289
+ /** The root node of the requested subtree / Корневой узел запрошенного поддерева */
290
+ document: any;
291
+ /** Map of components used in the subtree / Карта компонентов, используемых в поддереве */
292
+ components: Record<string, any>;
293
+ /** Map of component sets used in the subtree / Карта наборов компонентов, используемых в поддереве */
294
+ componentSets: Record<string, any>;
295
+ /** Schema version / Версия схемы */
296
+ schemaVersion: number;
297
+ /** Map of styles used in the subtree / Карта стилей, используемых в поддереве */
298
+ styles: Record<string, any>;
299
+ }>;
300
+ };
301
+
302
+ /**
303
+ * Parameters for the files endpoint.
304
+ *
305
+ * Параметры для эндпоинта files.
306
+ */
307
+ declare type FigmaFilesParams = {
308
+ /** A specific version ID to get / Идентификатор конкретной версии для получения */
309
+ version?: string;
310
+ /** Comma separated list of nodes that you care about in the document / Список узлов через запятую, которые вас интересуют в документе */
311
+ ids?: string;
312
+ /** How deep into the document tree to traverse / Насколько глубоко по дереву документа нужно пройтись */
313
+ depth?: number;
314
+ /** Set to "paths" to export vector data / Установите "paths" для экспорта векторных данных */
315
+ geometry?: 'paths';
316
+ /** A comma separated list of plugin IDs to include their data / Список ID плагинов через запятую для включения их данных */
317
+ plugin_data?: string;
318
+ /**
319
+ * Returns branch metadata for the requested file /
320
+ * Возвращает метаданные ветки для запрошенного файла
321
+ * @default false
322
+ */
323
+ branch_data?: boolean;
324
+ };
325
+
326
+ /**
327
+ * Result returned by the files endpoint.
328
+ *
329
+ * Результат, возвращаемый эндпоинтом files.
330
+ */
331
+ declare type FigmaFilesResult = {
332
+ /** File name / Название файла */
333
+ name: string;
334
+ /** User's role in the file / Роль пользователя в файле */
335
+ role: string;
336
+ /** Last modified date / Дата последнего изменения */
337
+ lastModified: string;
338
+ /** Editor type (figma or figjam) / Тип редактора (figma или figjam) */
339
+ editorType: string;
340
+ /** URL to the file thumbnail / URL миниатюры файла */
341
+ thumbnailUrl: string;
342
+ /** Version ID / Идентификатор версии */
343
+ version: string;
344
+ /** The root node of the document / Корневой узел документа */
345
+ document: any;
346
+ /** Map of components used in the file / Карта компонентов, используемых в файле */
347
+ components: Record<string, any>;
348
+ /** Map of component sets used in the file / Карта наборов компонентов, используемых в файле */
349
+ componentSets: Record<string, any>;
350
+ /** Schema version / Версия схемы */
351
+ schemaVersion: number;
352
+ /** Map of styles used in the file / Карта стилей, используемых в файле */
353
+ styles: Record<string, any>;
354
+ /** Main file key if this is a branch / Ключ основного файла, если это ветка */
355
+ mainFileKey?: string;
356
+ /** List of branches for the file / Список веток для файла */
357
+ branches?: {
358
+ /** Branch key / Ключ ветки */
359
+ key: string;
360
+ /** Branch name / Название ветки */
361
+ name: string;
362
+ /** URL to the branch thumbnail / URL миниатюры ветки */
363
+ thumbnail_url: string;
364
+ /** Last modified date of the branch / Дата последнего изменения ветки */
365
+ last_modified: string;
366
+ /** Link access level / Уровень доступа по ссылке */
367
+ link_access: string;
368
+ }[];
369
+ };
370
+
371
+ /**
372
+ * Result returned by the fileStyles endpoint.
373
+ *
374
+ * Результат, возвращаемый эндпоинтом fileStyles.
375
+ */
376
+ declare type FigmaFileStylesResult = {
377
+ /** Status code of the response / Код статуса ответа */
378
+ status: number;
379
+ /** Whether an error occurred / Произошла ли ошибка */
380
+ error: boolean;
381
+ /** Metadata container / Контейнер метаданных */
382
+ meta: {
383
+ /** List of styles in the file / Список стилей в файле */
384
+ styles: {
385
+ /** The unique identifier of the style / Уникальный идентификатор стиля */
386
+ key: string;
387
+ /** The key of the file the style lives in / Ключ файла, в котором находится стиль */
388
+ file_key: string;
389
+ /** The node ID that corresponds to the style / ID узла, соответствующий стилю */
390
+ node_id: string;
391
+ /** The type of style (FILL, TEXT, EFFECT, or GRID) / Тип стиля (FILL, TEXT, EFFECT или GRID) */
392
+ style_type: 'FILL' | 'TEXT' | 'EFFECT' | 'GRID';
393
+ /** URL to a thumbnail image of the style / URL-адрес миниатюры стиля */
394
+ thumbnail_url: string;
395
+ /** Name of the style / Название стиля */
396
+ name: string;
397
+ /** Description of the style / Описание стиля */
398
+ description: string;
399
+ /** Date the style was last updated / Дата последнего обновления стиля */
400
+ updated_at: string;
401
+ /** Date the style was created / Дата создания стиля */
402
+ created_at: string;
403
+ /** A sortable string for the style's position / Строка для сортировки позиции стиля */
404
+ sort_position: string;
405
+ /** The user who created the style / Пользователь, создавший стиль */
406
+ user: {
407
+ /** User's ID / ID пользователя */
408
+ id: string;
409
+ /** User's handle / Никнейм пользователя */
410
+ handle: string;
411
+ /** URL to the user's avatar / URL-адрес аватара пользователя */
412
+ img_url: string;
413
+ };
414
+ }[];
415
+ };
416
+ };
417
+
418
+ /**
419
+ * Result returned by the styles endpoint.
420
+ *
421
+ * Результат, возвращаемый эндпоинтом styles.
422
+ */
423
+ declare type FigmaStylesResult = {
424
+ /** Status code of the response / Код статуса ответа */
425
+ status: number;
426
+ /** Whether an error occurred / Произошла ли ошибка */
427
+ error: boolean;
428
+ /** Metadata about the style / Метаданные о стиле */
429
+ meta: {
430
+ /** The unique identifier of the style / Уникальный идентификатор стиля */
431
+ key: string;
432
+ /** The key of the file the style lives in / Ключ файла, в котором находится стиль */
433
+ file_key: string;
434
+ /** The node ID that corresponds to the style / ID узла, соответствующий стилю */
435
+ node_id: string;
436
+ /** The type of style (FILL, TEXT, EFFECT, or GRID) / Тип стиля (FILL, TEXT, EFFECT или GRID) */
437
+ style_type: 'FILL' | 'TEXT' | 'EFFECT' | 'GRID';
438
+ /** URL to a thumbnail image of the style / URL-адрес миниатюры стиля */
439
+ thumbnail_url: string;
440
+ /** Name of the style / Название стиля */
441
+ name: string;
442
+ /** Description of the style / Описание стиля */
443
+ description: string;
444
+ /** Date the style was last updated / Дата последнего обновления стиля */
445
+ updated_at: string;
446
+ /** Date the style was created / Дата создания стиля */
447
+ created_at: string;
448
+ /** A sortable string for the style's position / Строка для сортировки позиции стиля */
449
+ sort_position: string;
450
+ /** The user who created the style / Пользователь, создавший стиль */
451
+ user: {
452
+ /** User's ID / ID пользователя */
453
+ id: string;
454
+ /** User's handle / Никнейм пользователя */
455
+ handle: string;
456
+ /** URL to the user's avatar / URL-адрес аватара пользователя */
457
+ img_url: string;
458
+ };
459
+ };
460
+ };
461
+
462
+ export { }
@@ -0,0 +1,75 @@
1
+ import { t as e } from "./PropertiesConfig-BKZz_FWW.js";
2
+ import { n as t, t as n } from "./figmaApiTypes-CArSsNW8.js";
3
+ //#region src/classes/FigmaApi.ts
4
+ var r = class {
5
+ token;
6
+ fileKey;
7
+ nodeId;
8
+ constructor(e, t, n) {
9
+ this.token = e, this.fileKey = t, this.nodeId = n;
10
+ }
11
+ async files(e = {}) {
12
+ return await this.fetch(t.files, e);
13
+ }
14
+ async fileNodes(e) {
15
+ return await this.fetch(t.fileNodes, e);
16
+ }
17
+ async fileImages(e) {
18
+ return await this.fetch(t.fileImages, e);
19
+ }
20
+ async fileStyles() {
21
+ return await this.fetch(t.fileStyles);
22
+ }
23
+ async styles(e) {
24
+ return await this.fetch(t.styles, void 0, e);
25
+ }
26
+ setToken(e) {
27
+ return this.token = e, this;
28
+ }
29
+ setFileKey(e) {
30
+ return this.fileKey = e, this;
31
+ }
32
+ setNodeId(e) {
33
+ return this.nodeId = e, this;
34
+ }
35
+ getUrl(e, t, r) {
36
+ let i = {}, a = e.replace(":file_key", this.fileKey).replace(":key", r ?? "");
37
+ this.nodeId && Object.assign(i, { "node-id": this.nodeId }), t && Object.assign(i, t);
38
+ let o = Object.keys(i).length > 0 ? `?${new URLSearchParams(i).toString()}` : "";
39
+ return `${n}${a}${o}`;
40
+ }
41
+ async fetch(e, t = {}, n) {
42
+ let r = this.getUrl(e, t, n), i = {
43
+ "X-Figma-Token": this.token,
44
+ "Content-Type": "application/json"
45
+ }, a = await fetch(r, {
46
+ method: "GET",
47
+ headers: i
48
+ });
49
+ if (a.ok) return a.json();
50
+ console.error(`Error fetching Figma API: ${a.status} ${a.statusText}`);
51
+ }
52
+ }, i = class {
53
+ fileKey;
54
+ nodeId;
55
+ token;
56
+ api;
57
+ constructor(t, n, i = e.getFigmaToken()) {
58
+ this.fileKey = t, this.nodeId = n, this.token = i, this.api = new r(i, t, n);
59
+ }
60
+ async make() {
61
+ console.log("Design Figma", await this.initImage());
62
+ }
63
+ async initImage() {
64
+ let e = await this.api.fileImages({
65
+ ids: this.nodeId,
66
+ format: "svg",
67
+ svg_outline_text: !1,
68
+ svg_include_id: !0,
69
+ svg_include_node_id: !0
70
+ });
71
+ if (!e?.err) return e?.images;
72
+ }
73
+ };
74
+ //#endregion
75
+ export { i as DesignFigma };