@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.
- package/CHANGELOG.md +77 -0
- package/ai-resources/componentMaterials.md +19 -0
- package/ai-resources/componentPrompt.md +381 -0
- package/ai-resources/componentWiki.md +13 -0
- package/bin/arguments.ts +168 -0
- package/bin/build-packages.ts +34 -3
- package/bin/build-publish-packages.ts +12 -2
- package/bin/design-component.ts +7 -1
- package/bin/design-constructor.ts +22 -3
- package/bin/design-figma.ts +26 -4
- package/bin/design-flags.ts +14 -2
- package/bin/design-library.ts +7 -1
- package/bin/design-package.ts +29 -5
- package/bin/design-prompt.ts +27 -3
- package/bin/design-screenshot.ts +12 -2
- package/bin/design-types-save.ts +32 -5
- package/bin/design-types.ts +32 -6
- package/bin/design-ui.ts +21 -3
- package/bin/design-wiki-storm.ts +11 -3
- package/dist/AiZAi-BiLAcdFy.js +232 -0
- package/dist/PropertiesConfig-BKZz_FWW.js +262 -0
- package/{src/config.ts → dist/config.d.ts} +185 -158
- package/dist/config.js +20 -0
- package/dist/figmaApiTypes-CArSsNW8.js +6 -0
- package/dist/library-ai.d.ts +482 -0
- package/dist/library-ai.js +2 -0
- package/dist/library-figma.d.ts +462 -0
- package/dist/library-figma.js +75 -0
- package/dist/library-ui.d.ts +586 -0
- package/dist/library-ui.js +3760 -0
- package/dist/library.d.ts +4910 -0
- package/dist/library.js +1568 -0
- package/dist/propertyTypes-C64u6rT3.js +236 -0
- package/package.json +76 -27
- package/bin/ai-doc.ts +0 -7
- package/bin/build-functional.ts +0 -5
- package/bin/design-component-wiki.ts +0 -11
- package/src/classes/Ai/AiAbstract.ts +0 -242
- package/src/classes/Ai/AiClaude.ts +0 -26
- package/src/classes/Ai/AiClaudeAgent.ts +0 -16
- package/src/classes/Ai/AiClaudeAgentLite.ts +0 -86
- package/src/classes/Ai/AiClaudeCli.ts +0 -24
- package/src/classes/Ai/AiClaudeCliLite.ts +0 -108
- package/src/classes/Ai/AiClaudeLite.ts +0 -112
- package/src/classes/Ai/AiDoc.ts +0 -81
- package/src/classes/Ai/AiDocItem.ts +0 -27
- package/src/classes/Ai/AiDocItemAbstract.ts +0 -209
- package/src/classes/Ai/AiDocItemClasses.ts +0 -27
- package/src/classes/Ai/AiDocItemComposables.ts +0 -20
- package/src/classes/Ai/AiDocType.ts +0 -45
- package/src/classes/Ai/AiGoogle.ts +0 -26
- package/src/classes/Ai/AiGoogleCli.ts +0 -24
- package/src/classes/Ai/AiGoogleCliLite.ts +0 -108
- package/src/classes/Ai/AiGoogleLite.ts +0 -78
- package/src/classes/Ai/AiOpenAi.ts +0 -26
- package/src/classes/Ai/AiOpenAiLite.ts +0 -107
- package/src/classes/Ai/AiZAi.ts +0 -17
- package/src/classes/Ai/AiZAiLite.ts +0 -77
- package/src/classes/Ai/ApiTmp.ts +0 -43
- package/src/classes/BrowserItem.ts +0 -408
- package/src/classes/Build/BuildFunctional.ts +0 -54
- package/src/classes/Build/BuildPackages.ts +0 -137
- package/src/classes/Build/BuildPublishPackages.ts +0 -105
- package/src/classes/BuildItem.ts +0 -187
- package/src/classes/Component/ComponentCreator.ts +0 -45
- package/src/classes/Component/ComponentItem.ts +0 -161
- package/src/classes/Component/ComponentWiki.ts +0 -258
- package/src/classes/Component/ComponentWikiFile.ts +0 -138
- package/src/classes/Design/DesignCommand.ts +0 -243
- package/src/classes/Design/DesignComponent.ts +0 -824
- package/src/classes/Design/DesignConstructor.ts +0 -222
- package/src/classes/Design/DesignConstructors.ts +0 -101
- package/src/classes/Design/DesignFigma.ts +0 -61
- package/src/classes/Design/DesignFlags.ts +0 -215
- package/src/classes/Design/DesignReplace.ts +0 -672
- package/src/classes/Design/DesignScreenshot.ts +0 -140
- package/src/classes/Design/DesignStructure.ts +0 -201
- package/src/classes/Design/DesignStructureClasses.ts +0 -105
- package/src/classes/Design/DesignStructureItemAbstract.ts +0 -52
- package/src/classes/Design/DesignStructureRead.ts +0 -349
- package/src/classes/Design/DesignStructureStyles.ts +0 -45
- package/src/classes/Design/DesignTypes.ts +0 -94
- package/src/classes/Design/DesignTypesAi.ts +0 -135
- package/src/classes/Design/DesignTypesDescription.ts +0 -121
- package/src/classes/Design/DesignTypesMake.ts +0 -460
- package/src/classes/Design/DesignTypesMcp.ts +0 -90
- package/src/classes/Design/DesignTypesPrompts.ts +0 -332
- package/src/classes/Design/DesignTypescript.ts +0 -244
- package/src/classes/Design/DesignUi.ts +0 -143
- package/src/classes/Design/DesignWiki.ts +0 -52
- package/src/classes/Design/DesignWikiStorm.ts +0 -95
- package/src/classes/Design/DesignWikiStormItem.ts +0 -316
- package/src/classes/FigmaApi.ts +0 -190
- package/src/classes/Git/GitRead.ts +0 -261
- package/src/classes/Library/LibraryAiMcpItem.ts +0 -67
- package/src/classes/Library/LibraryAiPrompt.ts +0 -268
- package/src/classes/Library/LibraryAiPromptItem.ts +0 -331
- package/src/classes/Library/LibraryAiWiki.ts +0 -127
- package/src/classes/Library/LibraryAiWikiItem.ts +0 -79
- package/src/classes/Library/LibraryExport.ts +0 -167
- package/src/classes/Library/LibraryFlags.ts +0 -62
- package/src/classes/Library/LibraryItems.ts +0 -138
- package/src/classes/Library/LibraryList.ts +0 -189
- package/src/classes/Library/LibraryMedia.ts +0 -139
- package/src/classes/Library/LibraryPlugin.ts +0 -73
- package/src/classes/Library/LibraryTypes.ts +0 -130
- package/src/classes/Package/PackageFile.ts +0 -154
- package/src/classes/Package/PackageInit.ts +0 -54
- package/src/classes/Package/PackageItem.ts +0 -329
- package/src/classes/Properties/Properties.ts +0 -175
- package/src/classes/Properties/PropertiesCache.ts +0 -248
- package/src/classes/Properties/PropertiesConfig.ts +0 -213
- package/src/classes/Properties/PropertiesConvector.ts +0 -52
- package/src/classes/Properties/PropertiesFile.ts +0 -522
- package/src/classes/Properties/PropertiesImport.ts +0 -182
- package/src/classes/Properties/PropertiesItems.ts +0 -605
- package/src/classes/Properties/PropertiesKeys.ts +0 -121
- package/src/classes/Properties/PropertiesMain.ts +0 -138
- package/src/classes/Properties/PropertiesPalette.ts +0 -149
- package/src/classes/Properties/PropertiesPath.ts +0 -193
- package/src/classes/Properties/PropertiesScss.ts +0 -261
- package/src/classes/Properties/PropertiesSeparator.ts +0 -118
- package/src/classes/Properties/PropertiesSettings.ts +0 -104
- package/src/classes/Properties/PropertiesStandard.ts +0 -180
- package/src/classes/Properties/PropertiesTool.ts +0 -80
- package/src/classes/Properties/PropertiesTypes.ts +0 -147
- package/src/classes/Properties/PropertiesValues.ts +0 -75
- package/src/classes/Properties/PropertiesWrap.ts +0 -187
- package/src/classes/Properties/convector/convectorColor.ts +0 -27
- package/src/classes/Properties/convector/convectorFontFamilies.ts +0 -18
- package/src/classes/Properties/convector/convectorShadow.ts +0 -61
- package/src/classes/Properties/convector/convectorTypography.ts +0 -19
- package/src/classes/Properties/to/PropertiesToAbstract.ts +0 -51
- package/src/classes/Properties/to/PropertiesToAnimate.ts +0 -59
- package/src/classes/Properties/to/PropertiesToClass.ts +0 -49
- package/src/classes/Properties/to/PropertiesToClone.ts +0 -114
- package/src/classes/Properties/to/PropertiesToComponent.ts +0 -52
- package/src/classes/Properties/to/PropertiesToDrag.ts +0 -231
- package/src/classes/Properties/to/PropertiesToDuplicate.ts +0 -165
- package/src/classes/Properties/to/PropertiesToFull.ts +0 -36
- package/src/classes/Properties/to/PropertiesToLink.ts +0 -259
- package/src/classes/Properties/to/PropertiesToMedia.ts +0 -187
- package/src/classes/Properties/to/PropertiesToMulti.ts +0 -101
- package/src/classes/Properties/to/PropertiesToNone.ts +0 -46
- package/src/classes/Properties/to/PropertiesToPalette.ts +0 -241
- package/src/classes/Properties/to/PropertiesToProperty.ts +0 -31
- package/src/classes/Properties/to/PropertiesToRemove.ts +0 -33
- package/src/classes/Properties/to/PropertiesToReplace.ts +0 -77
- package/src/classes/Properties/to/PropertiesToRoot.ts +0 -40
- package/src/classes/Properties/to/PropertiesToSimilar.ts +0 -128
- package/src/classes/Properties/to/PropertiesToSort.ts +0 -146
- package/src/classes/Properties/to/PropertiesToState.ts +0 -65
- package/src/classes/Properties/to/PropertiesToStyle.ts +0 -52
- package/src/classes/Properties/to/PropertiesToSub.ts +0 -95
- package/src/classes/Properties/to/PropertiesToSubclass.ts +0 -76
- package/src/classes/Properties/to/PropertiesToVar.ts +0 -194
- package/src/classes/Properties/to/PropertiesToVariable.ts +0 -176
- package/src/classes/Styles/Styles.ts +0 -247
- package/src/classes/Styles/StylesClasses.ts +0 -86
- package/src/classes/Styles/StylesProperties.ts +0 -197
- package/src/classes/Styles/StylesRoot.ts +0 -103
- package/src/classes/Styles/StylesTool.ts +0 -112
- package/src/classes/Styles/to/StylesToAbstract.ts +0 -93
- package/src/classes/Styles/to/StylesToAnimate.ts +0 -19
- package/src/classes/Styles/to/StylesToClass.ts +0 -25
- package/src/classes/Styles/to/StylesToClassFull.ts +0 -19
- package/src/classes/Styles/to/StylesToContainer.ts +0 -24
- package/src/classes/Styles/to/StylesToMedia.ts +0 -19
- package/src/classes/Styles/to/StylesToProperty.ts +0 -123
- package/src/classes/Styles/to/StylesToRoot.ts +0 -14
- package/src/classes/Styles/to/StylesToSelector.ts +0 -71
- package/src/classes/Styles/to/StylesToVar.ts +0 -105
- package/src/classes/Styles/to/StylesToVirtual.ts +0 -33
- package/src/composables/useAi.ts +0 -38
- package/src/demo/ai.ts +0 -10
- package/src/functions/getComponentPaths.ts +0 -13
- package/src/functions/getConfigAi.ts +0 -14
- package/src/functions/getConstructorProperties.ts +0 -54
- package/src/functions/getDirname.ts +0 -17
- package/src/functions/getNameDirByPaths.ts +0 -16
- package/src/functions/getPackageJson.ts +0 -19
- package/src/functions/hasNativeDirname.ts +0 -8
- package/src/functions/run.ts +0 -47
- package/src/functions/toPathStandardSep.ts +0 -14
- package/src/library-ai.ts +0 -10
- package/src/library.ts +0 -73
- package/src/media/ai/ai-doc-types.ts +0 -21
- package/src/media/properties/css.ts +0 -634
- package/src/media/properties/cssSelector.ts +0 -74
- package/src/media/properties/cssVirtual.ts +0 -12
- package/src/media/properties/listSort.ts +0 -113
- package/src/media/properties/style.ts +0 -81
- package/src/media/templates/component/DesignComponent.mdx +0 -30
- package/src/media/templates/component/DesignComponent.stories.ts +0 -34
- package/src/media/templates/component/DesignComponent.vue +0 -54
- package/src/media/templates/component/DesignComponentAiWiki.vue +0 -25
- package/src/media/templates/component/index.ts +0 -13
- package/src/media/templates/component/props.ts +0 -27
- package/src/media/templates/component/styleToken.scss +0 -17
- package/src/media/templates/component/wiki.ts +0 -13
- package/src/media/templates/component/wikiData.ts +0 -28
- package/src/media/templates/componentDoc/ComponentDoc.vue +0 -26
- package/src/media/templates/componentDoc/index.ts +0 -12
- package/src/media/templates/componentDoc/materials/README.md +0 -8
- package/src/media/templates/componentDoc/materials/prompt.md +0 -38
- package/src/media/templates/componentDoc/subcomponents/_.gitignore.txt +0 -0
- package/src/media/templates/componentDoc/types.ts +0 -15
- package/src/media/templates/componentDoc/wiki/ComponentDoc.mdx +0 -13
- package/src/media/templates/componentDoc/wiki/ComponentDoc.stories.ts +0 -24
- package/src/media/templates/componentDoc/wiki/prompt.md +0 -41
- package/src/media/templates/constructors/Constructors.ts +0 -33
- package/src/media/templates/constructors/ConstructorsDesign.tsx +0 -129
- package/src/media/templates/constructors/basicTypes.ts +0 -0
- package/src/media/templates/constructors/index.ts +0 -5
- package/src/media/templates/constructors/props.ts +0 -28
- package/src/media/templates/constructors/style.scss +0 -5
- package/src/media/templates/constructors/types.ts +0 -47
- package/src/media/templates/packages/figma/README.md +0 -1
- package/src/media/templates/packages/figma/_.gitignore.txt +0 -29
- package/src/media/templates/packages/figma/ai.sample.config.ts +0 -2
- package/src/media/templates/packages/figma/design.config.json +0 -3
- package/src/media/templates/packages/figma/index.html +0 -12
- package/src/media/templates/packages/figma/manifest.json +0 -25
- package/src/media/templates/packages/figma/package.json +0 -37
- package/src/media/templates/packages/figma/src/App.vue +0 -9
- package/src/media/templates/packages/figma/src/classes/_.gitignore.txt +0 -1
- package/src/media/templates/packages/figma/src/code.ts +0 -16
- package/src/media/templates/packages/figma/src/components/_.gitignore.txt +0 -1
- package/src/media/templates/packages/figma/src/composables/_.gitignore.txt +0 -1
- package/src/media/templates/packages/figma/src/config.ts +0 -0
- package/src/media/templates/packages/figma/src/functions/_.gitignore.txt +0 -1
- package/src/media/templates/packages/figma/src/library.ts +0 -0
- package/src/media/templates/packages/figma/src/main.ts +0 -4
- package/src/media/templates/packages/figma/src/media/_.gitignore.txt +0 -1
- package/src/media/templates/packages/figma/src/storybook/_.gitignore.txt +0 -1
- package/src/media/templates/packages/figma/src/types/_.gitignore.txt +0 -1
- package/src/media/templates/packages/figma/src/vite-env.d.ts +0 -1
- package/src/media/templates/packages/figma/tsconfig.app.json +0 -12
- package/src/media/templates/packages/figma/tsconfig.json +0 -7
- package/src/media/templates/packages/figma/tsconfig.node.json +0 -8
- package/src/media/templates/packages/figma/vite.config.ts +0 -7
- package/src/media/templates/packages/library/README.md +0 -1
- package/src/media/templates/packages/library/_.gitignore.txt +0 -27
- package/src/media/templates/packages/library/ai-description.md +0 -15
- package/src/media/templates/packages/library/design.config.json +0 -3
- package/src/media/templates/packages/library/index.html +0 -12
- package/src/media/templates/packages/library/materials/README.md +0 -8
- package/src/media/templates/packages/library/materials/prompt.md +0 -45
- package/src/media/templates/packages/library/package.json +0 -46
- package/src/media/templates/packages/library/src/App.vue +0 -8
- package/src/media/templates/packages/library/src/classes/_.gitignore.txt +0 -1
- package/src/media/templates/packages/library/src/components/_.gitignore.txt +0 -1
- package/src/media/templates/packages/library/src/composables/_.gitignore.txt +0 -1
- package/src/media/templates/packages/library/src/functions/_.gitignore.txt +0 -1
- package/src/media/templates/packages/library/src/library.ts +0 -0
- package/src/media/templates/packages/library/src/main.ts +0 -6
- package/src/media/templates/packages/library/src/style.scss +0 -0
- package/src/media/templates/packages/library/src/types/_.gitignore.txt +0 -1
- package/src/media/templates/packages/library/src/vite-env.d.ts +0 -1
- package/src/media/templates/packages/library/tsconfig.app.json +0 -11
- package/src/media/templates/packages/library/tsconfig.json +0 -7
- package/src/media/templates/packages/library/tsconfig.node.json +0 -7
- package/src/media/templates/packages/library/vite.config.ts +0 -14
- package/src/media/templates/packages/nitro/README.md +0 -1
- package/src/media/templates/packages/nitro/_.gitignore.txt +0 -28
- package/src/media/templates/packages/nitro/index.html +0 -2
- package/src/media/templates/packages/nitro/package.json +0 -25
- package/src/media/templates/packages/nitro/server/plugins/ui-plugin.ts +0 -7
- package/src/media/templates/packages/nitro/server/routes/api/hello.ts +0 -13
- package/src/media/templates/packages/nitro/src/App.vue +0 -10
- package/src/media/templates/packages/nitro/src/assets/_.gitignore.txt +0 -0
- package/src/media/templates/packages/nitro/src/components/_.gitignore.txt +0 -0
- package/src/media/templates/packages/nitro/src/composables/_.gitignore.txt +0 -0
- package/src/media/templates/packages/nitro/src/entry-client.ts +0 -13
- package/src/media/templates/packages/nitro/src/entry-server.ts +0 -29
- package/src/media/templates/packages/nitro/src/main.ts +0 -14
- package/src/media/templates/packages/nitro/src/pages/HomePage.vue +0 -8
- package/src/media/templates/packages/nitro/src/router.ts +0 -11
- package/src/media/templates/packages/nitro/src/style.scss +0 -0
- package/src/media/templates/packages/nitro/src/templates/main.html +0 -21
- package/src/media/templates/packages/nitro/src/vite-env.d.ts +0 -11
- package/src/media/templates/packages/nitro/tsconfig.app.json +0 -14
- package/src/media/templates/packages/nitro/tsconfig.json +0 -7
- package/src/media/templates/packages/nitro/tsconfig.node.json +0 -12
- package/src/media/templates/packages/nitro/vite.config.ts +0 -17
- package/src/media/templates/packages/project/README.md +0 -1
- package/src/media/templates/packages/project/_.gitignore.txt +0 -28
- package/src/media/templates/packages/project/design.config.json +0 -3
- package/src/media/templates/packages/project/index.html +0 -12
- package/src/media/templates/packages/project/materials/README.md +0 -8
- package/src/media/templates/packages/project/materials/prompt.md +0 -41
- package/src/media/templates/packages/project/package.json +0 -13
- package/src/media/templates/packages/project/public/_.gitignore.txt +0 -0
- package/src/media/templates/packages/project/src/App.vue +0 -12
- package/src/media/templates/packages/project/src/assets/_.gitignore.txt +0 -0
- package/src/media/templates/packages/project/src/components/_.gitignore.txt +0 -0
- package/src/media/templates/packages/project/src/composables/_.gitignore.txt +0 -0
- package/src/media/templates/packages/project/src/main.ts +0 -6
- package/src/media/templates/packages/project/src/style.scss +0 -0
- package/src/media/templates/packages/project/src/vite-env.d.ts +0 -1
- package/src/media/templates/packages/project/tsconfig.app.json +0 -11
- package/src/media/templates/packages/project/tsconfig.json +0 -7
- package/src/media/templates/packages/project/tsconfig.node.json +0 -7
- package/src/media/templates/packages/project/vite.config.ts +0 -7
- package/src/media/templates/prompts/aiCodeGlobalPrompt.en.md +0 -22
- package/src/media/templates/prompts/aiCodeGlobalPrompt.ru.md +0 -21
- package/src/media/templates/prompts/aiCodeVuePrompt.en.md +0 -17
- package/src/media/templates/prompts/aiCodeVuePrompt.ru.md +0 -17
- package/src/media/templates/prompts/aiDocClassPrompt.en.txt +0 -63
- package/src/media/templates/prompts/aiDocClassPrompt.ru.txt +0 -63
- package/src/media/templates/prompts/aiDocComposablePrompt.en.txt +0 -67
- package/src/media/templates/prompts/aiDocComposablePrompt.ru.txt +0 -67
- package/src/media/templates/prompts/aiDocFunctionPrompt.en.txt +0 -57
- package/src/media/templates/prompts/aiDocFunctionPrompt.ru.txt +0 -57
- package/src/media/templates/prompts/componentPrompt.en.txt +0 -182
- package/src/media/templates/prompts/componentPrompt.ru.txt +0 -182
- package/src/media/templates/prompts/demoClassEn.mdx +0 -111
- package/src/media/templates/prompts/demoClassRu.mdx +0 -111
- package/src/media/templates/prompts/demoComponentEn.mdx +0 -282
- package/src/media/templates/prompts/demoComponentRu.mdx +0 -282
- package/src/media/templates/prompts/demoComposableEn.mdx +0 -103
- package/src/media/templates/prompts/demoComposableRu.mdx +0 -103
- package/src/media/templates/prompts/demoDocEn.mdx +0 -30
- package/src/media/templates/prompts/demoDocRu.mdx +0 -30
- package/src/media/templates/viteComponentTemplateConfig.ts +0 -14
- package/src/types/aiTypes.ts +0 -19
- package/src/types/configTypes.ts +0 -69
- package/src/types/designTypes.ts +0 -167
- package/src/types/figmaApiTypes.ts +0 -337
- package/src/types/gitTypes.ts +0 -59
- package/src/types/libraryTypes.ts +0 -49
- package/src/types/propertyTypes.ts +0 -586
- package/src/types/screenshotTypes.ts +0 -55
- package/src/types/webTypes.ts +0 -134
- package/src/vite-env.d.ts +0 -1
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
// export:none
|
|
2
|
-
|
|
3
|
-
import { toCamelCase } from '@dxtmisha/functional-basic'
|
|
4
|
-
|
|
5
|
-
import { PropertiesConfig } from './PropertiesConfig'
|
|
6
|
-
import { PropertiesTypes } from './PropertiesTypes'
|
|
7
|
-
|
|
8
|
-
import { type PropertyItem } from '../../types/propertyTypes'
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Parser and transformer for property key semantics.
|
|
12
|
-
* This static utility class handles the identification of special system keys (like metadata or internal references) and orchestrates the transformation of raw key names into normalized, context-aware tokens (e.g., prepending media types or converting to camelCase).
|
|
13
|
-
*
|
|
14
|
-
* Парсер и трансформер семантики ключей свойств.
|
|
15
|
-
* Этот статический вспомогательный класс обрабатывает идентификацию специальных системных ключей (таких как метаданные или внутренние ссылки) и координирует преобразование необработанных имен ключей в нормализованные токены с учетом контекста (например, добавление типов медиа или преобразование в camelCase).
|
|
16
|
-
*/
|
|
17
|
-
export class PropertiesKeys {
|
|
18
|
-
/**
|
|
19
|
-
* Identifies if a key is a protected system metadata key or an internal reference.
|
|
20
|
-
* Special keys include 'value', 'type', 'description', and any key starting with an underscore (internal engine states).
|
|
21
|
-
*
|
|
22
|
-
* Определяет, является ли ключ защищенным системным ключом метаданных или внутренней ссылкой.
|
|
23
|
-
* Специальные ключи включают 'value', 'type', 'description' и любой ключ, начинающийся с подчеркивания (внутренние состояния движка).
|
|
24
|
-
* @param key the key name to verify / название ключа для проверки
|
|
25
|
-
*/
|
|
26
|
-
static isSpecialKey(key: string | number): key is keyof PropertyItem {
|
|
27
|
-
return typeof key === 'string' && (
|
|
28
|
-
['value', 'type', 'description'].indexOf(key) !== -1
|
|
29
|
-
|| Boolean(key.match(/^_/))
|
|
30
|
-
)
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Checks whether the name is complete.
|
|
35
|
-
*
|
|
36
|
-
* Проверяет, является ли название полным.
|
|
37
|
-
* @param name key name/ название ключа
|
|
38
|
-
*/
|
|
39
|
-
static isFull(name: string): boolean {
|
|
40
|
-
return Boolean(name.match(/^=|\|=/))
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Checks if the property is suitable for splitting.
|
|
45
|
-
*
|
|
46
|
-
* Проверяет, подходит ли свойство для разделения.
|
|
47
|
-
* @param name property names/ названия свойств
|
|
48
|
-
* @private
|
|
49
|
-
*/
|
|
50
|
-
static isSeparator(name: string): boolean {
|
|
51
|
-
return Boolean(name.match(PropertiesConfig.getSeparator()))
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Normalizes a raw key name by removing metadata prefixes and applying casing rules.
|
|
56
|
-
* Strips internal type symbols and leading pipes, then optionally converts the result to camelCase (unless the name is a path separator).
|
|
57
|
-
*
|
|
58
|
-
* Нормализует необработанное имя ключа, удаляя префиксы метаданных и применяя правила регистра.
|
|
59
|
-
* Очищает внутренние символы типов и ведущие вертикальные черты, затем опционально преобразует результат в camelCase (если имя не является разделителем пути).
|
|
60
|
-
* @param name the raw key name / необработанное имя ключа
|
|
61
|
-
* @param camelCase whether to apply camelCase transformation / нужно ли применять преобразование в camelCase
|
|
62
|
-
*/
|
|
63
|
-
static getName(name: string, camelCase = true): string {
|
|
64
|
-
const newName = name
|
|
65
|
-
.replace(PropertiesTypes.getExpSymbols(), '$2')
|
|
66
|
-
.replace(/^[|]/, '')
|
|
67
|
-
|
|
68
|
-
if (
|
|
69
|
-
this.isSeparator(newName)
|
|
70
|
-
|| !camelCase
|
|
71
|
-
) {
|
|
72
|
-
return newName
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
return toCamelCase(newName)
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Transformed key name by its type.
|
|
80
|
-
*
|
|
81
|
-
* Преобразованное название ключа по его типу.
|
|
82
|
-
* @param key property name/ название свойства
|
|
83
|
-
* @param type property type/ тип свойства
|
|
84
|
-
*/
|
|
85
|
-
static reKey(
|
|
86
|
-
key: string,
|
|
87
|
-
type?: PropertyItem['_type']
|
|
88
|
-
): string {
|
|
89
|
-
const name = this.getName(key)
|
|
90
|
-
|
|
91
|
-
if (type) {
|
|
92
|
-
if (
|
|
93
|
-
PropertiesTypes.isMedia(type)
|
|
94
|
-
&& !name.match(/^media[A-Z]/)
|
|
95
|
-
) {
|
|
96
|
-
return toCamelCase(`${type}-${name}`)
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
if (
|
|
100
|
-
PropertiesTypes.isContainer(type)
|
|
101
|
-
&& !name.match(/^container[A-Z]/)
|
|
102
|
-
) {
|
|
103
|
-
return toCamelCase(`${type}-${name}`)
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
if (
|
|
107
|
-
PropertiesTypes.isScss(type)
|
|
108
|
-
) {
|
|
109
|
-
return `&${this.getName(key, false)}`
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
if (
|
|
113
|
-
PropertiesTypes.isRoot(type)
|
|
114
|
-
) {
|
|
115
|
-
return this.getName(key, false)
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
return name
|
|
120
|
-
}
|
|
121
|
-
}
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
// export:none
|
|
2
|
-
|
|
3
|
-
import { forEach, isFilled, isObjectNotArray } from '@dxtmisha/functional-basic'
|
|
4
|
-
|
|
5
|
-
import { PropertiesPath } from './PropertiesPath'
|
|
6
|
-
import { PropertiesTool } from './PropertiesTool'
|
|
7
|
-
|
|
8
|
-
import { PropertiesConvector } from './PropertiesConvector'
|
|
9
|
-
import { PropertiesStandard } from './PropertiesStandard'
|
|
10
|
-
import { PropertiesImport } from './PropertiesImport'
|
|
11
|
-
import { PropertiesSeparator } from './PropertiesSeparator'
|
|
12
|
-
import { PropertiesWrap } from './PropertiesWrap'
|
|
13
|
-
|
|
14
|
-
import type {
|
|
15
|
-
PropertyItem,
|
|
16
|
-
PropertyList
|
|
17
|
-
} from '../../types/propertyTypes'
|
|
18
|
-
|
|
19
|
-
const DIR_NAME = 'main'
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Orchestrator for global design token transformation.
|
|
23
|
-
* This class serves as the primary engine for loading, validating, and normalizing "main" tokens across all supported designs. It coordinates a multi-stage pipeline—including semantic conversion, reference import, and structural wrapping—to synthesize a unified property tree ready for consumption by external builders.
|
|
24
|
-
*
|
|
25
|
-
* Оркестратор глобальной трансформации токенов дизайна.
|
|
26
|
-
* Этот класс служит основным движком для загрузки, валидации и нормализации «основных» (main) токенов во всех поддерживаемых дизайнах. Он координирует многоэтапный конвейер — включая семантическую конвертацию, импорт ссылок и структурную обертку — для синтеза унифицированного дерева свойств, готового к использованию внешними строителями.
|
|
27
|
-
*/
|
|
28
|
-
export class PropertiesMain {
|
|
29
|
-
/**
|
|
30
|
-
* Constructor
|
|
31
|
-
* @param path object of the class for working with paths/ объект класса для работы с путями
|
|
32
|
-
*/
|
|
33
|
-
constructor(
|
|
34
|
-
private readonly path: PropertiesPath
|
|
35
|
-
) {
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Executes the full transformation pipeline for all main design tokens.
|
|
40
|
-
* Discovers token files via the path manager, then sequentially applies reading, conversion, standardization, link resolution, and structural wrapping for every design entry.
|
|
41
|
-
*
|
|
42
|
-
* Выполняет полный конвейер трансформации для всех основных токенов дизайна.
|
|
43
|
-
* Обнаруживает файлы токенов через менеджер путей, затем последовательно применяет чтение, конвертацию, стандартизацию, разрешение ссылок и структурную обертку для каждой записи дизайна.
|
|
44
|
-
*/
|
|
45
|
-
get(): PropertyList {
|
|
46
|
-
return this.path.toAll(DIR_NAME, (
|
|
47
|
-
path,
|
|
48
|
-
_,
|
|
49
|
-
design
|
|
50
|
-
) => {
|
|
51
|
-
let properties = PropertiesTool.readFile(design, path)
|
|
52
|
-
|
|
53
|
-
if (isFilled(properties)) {
|
|
54
|
-
PropertiesConvector.to(properties)
|
|
55
|
-
|
|
56
|
-
properties = PropertiesStandard.to({ [design]: properties })
|
|
57
|
-
|
|
58
|
-
if (path) {
|
|
59
|
-
properties = new PropertiesImport(properties, path).to()
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
if (PropertiesSeparator.is(properties)) {
|
|
63
|
-
properties = PropertiesSeparator.to(properties)
|
|
64
|
-
PropertiesWrap.to(properties)
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
return properties ?? {}
|
|
69
|
-
}) as PropertyList
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Synchronizes global tokens with a provided settings cluster.
|
|
74
|
-
* Retrieves the full set of main tokens and deeply merges internal state flags from the settings list into the corresponding nodes of the global tree.
|
|
75
|
-
*
|
|
76
|
-
* Синхронизирует глобальные токены с предоставленным кластером настроек.
|
|
77
|
-
* Получает полный набор основных токенов и глубоко объединяет флаги внутреннего состояния из списка настроек в соответствующие узлы глобального дерева.
|
|
78
|
-
* @param list the settings cluster to apply / кластер настроек для применения
|
|
79
|
-
*/
|
|
80
|
-
getBySettings(list: PropertyList): PropertyList {
|
|
81
|
-
const data = this.get()
|
|
82
|
-
|
|
83
|
-
forEach(list, (designItems, design) => {
|
|
84
|
-
const dataDesign = data?.[design]?.value
|
|
85
|
-
|
|
86
|
-
if (
|
|
87
|
-
dataDesign
|
|
88
|
-
&& isObjectNotArray(dataDesign)
|
|
89
|
-
&& isObjectNotArray(designItems.value)
|
|
90
|
-
) {
|
|
91
|
-
forEach(designItems.value, (componentItems, component) => {
|
|
92
|
-
const dataComponent = dataDesign?.[component]?.value
|
|
93
|
-
|
|
94
|
-
if (
|
|
95
|
-
dataComponent
|
|
96
|
-
&& isObjectNotArray(dataComponent)
|
|
97
|
-
&& isObjectNotArray(componentItems.value)
|
|
98
|
-
) {
|
|
99
|
-
forEach(componentItems.value, (item, name) => {
|
|
100
|
-
this.copySettings(
|
|
101
|
-
item,
|
|
102
|
-
dataComponent?.[name]
|
|
103
|
-
)
|
|
104
|
-
})
|
|
105
|
-
}
|
|
106
|
-
})
|
|
107
|
-
}
|
|
108
|
-
})
|
|
109
|
-
|
|
110
|
-
return data
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* We copy the settings.
|
|
115
|
-
*
|
|
116
|
-
* Копируем настройки.
|
|
117
|
-
* @param item element with settings/ элемент с настройками
|
|
118
|
-
* @param itemCopy element for copying settings/ элемент для копирования настроек
|
|
119
|
-
*/
|
|
120
|
-
protected copySettings(
|
|
121
|
-
item: PropertyItem,
|
|
122
|
-
itemCopy?: PropertyItem
|
|
123
|
-
): this {
|
|
124
|
-
if (itemCopy) {
|
|
125
|
-
forEach(item, (value, property: keyof PropertyItem) => {
|
|
126
|
-
if (
|
|
127
|
-
property.match(/^_/)
|
|
128
|
-
&& property in itemCopy
|
|
129
|
-
&& itemCopy[property] !== value
|
|
130
|
-
) {
|
|
131
|
-
itemCopy[property] = value as never
|
|
132
|
-
}
|
|
133
|
-
})
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
return this
|
|
137
|
-
}
|
|
138
|
-
}
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
// export:none
|
|
2
|
-
|
|
3
|
-
import { forEach, getColumn, isObjectNotArray, toCamelCase } from '@dxtmisha/functional-basic'
|
|
4
|
-
|
|
5
|
-
import { PropertiesItems } from './PropertiesItems'
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
PropertyCategory,
|
|
9
|
-
type PropertyItem,
|
|
10
|
-
PropertyKey,
|
|
11
|
-
type PropertyPaletteList,
|
|
12
|
-
type PropertyPaletteUsed,
|
|
13
|
-
PropertyType
|
|
14
|
-
} from '../../types/propertyTypes'
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Manager for design palette and color saturation.
|
|
18
|
-
* This class handles the extraction of available shade levels (saturation steps) and tracks the usage of palette colors across the design system. It facilitates the mapping between functional variables and their underlying palette definitions, ensuring that generated styles correctly reference the intended theme colors.
|
|
19
|
-
*
|
|
20
|
-
* Менеджер палитры дизайна и насыщенности цветов.
|
|
21
|
-
* Этот класс обрабатывает извлечение доступных уровней оттенков (шагов насыщенности) и отслеживает использование цветов палитры в системе дизайна. Он упрощает сопоставление функциональных переменных с их базовыми определениями в палитре, гарантируя, что сгенерированные стили правильно ссылаются на нужные цвета темы.
|
|
22
|
-
*/
|
|
23
|
-
export class PropertiesPalette {
|
|
24
|
-
/**
|
|
25
|
-
* Constructor
|
|
26
|
-
* @param items
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
constructor(private items: PropertiesItems) {
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Retrieves a list of available saturation levels (shades) grouped by design.
|
|
34
|
-
* Scans the token cluster for items categorized as 'shade' and returns their resolved value structures.
|
|
35
|
-
*
|
|
36
|
-
* Возвращает список доступных уровней насыщенности (оттенков), сгруппированных по дизайну.
|
|
37
|
-
* Сканирует кластер токенов на наличие элементов, классифицированных как 'shade', и возвращает их разрешенные структуры значений.
|
|
38
|
-
*/
|
|
39
|
-
getShade(): PropertyPaletteList {
|
|
40
|
-
return forEach(this.items.findCategory(PropertyCategory.shade), ({
|
|
41
|
-
design,
|
|
42
|
-
value
|
|
43
|
-
}) => {
|
|
44
|
-
if (isObjectNotArray(value)) {
|
|
45
|
-
return {
|
|
46
|
-
design,
|
|
47
|
-
value: getColumn(value, 'value')
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return undefined
|
|
52
|
-
}) as PropertyPaletteList
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Generates a report of all palette colors currently utilized in functional variables.
|
|
57
|
-
* Iterates through the entire property tree to identify variables referencing palette colors and maps them to their corresponding CSS variable names.
|
|
58
|
-
*
|
|
59
|
-
* Генерирует отчет обо всех цветах палитры, используемых в данный момент в функциональных переменных.
|
|
60
|
-
* Итерирует по всему дереву свойств для идентификации переменных, ссылающихся на цвета палитры, и сопоставляет их с соответствующими именами CSS-переменных.
|
|
61
|
-
*/
|
|
62
|
-
getUsed(): PropertyPaletteUsed[] {
|
|
63
|
-
const list = this.getList()
|
|
64
|
-
const data: PropertyPaletteUsed[] = []
|
|
65
|
-
|
|
66
|
-
this.items.each(({
|
|
67
|
-
design,
|
|
68
|
-
component,
|
|
69
|
-
value,
|
|
70
|
-
item,
|
|
71
|
-
parents
|
|
72
|
-
}) => {
|
|
73
|
-
if (
|
|
74
|
-
component
|
|
75
|
-
&& typeof value === 'string'
|
|
76
|
-
&& item?.[PropertyKey.variable] === PropertyType.var
|
|
77
|
-
&& item?.[PropertyKey.category] !== PropertyCategory.color
|
|
78
|
-
&& item?.[PropertyKey.name]
|
|
79
|
-
) {
|
|
80
|
-
const focusValue = this.getFocusUsed(list, design, component, value)
|
|
81
|
-
|
|
82
|
-
if (focusValue) {
|
|
83
|
-
const name = item[PropertyKey.name]
|
|
84
|
-
const code = data.find(code => code.name === name)
|
|
85
|
-
const theme = parents.find(parent => parent.item[PropertyKey.category] === 'theme')?.name || 'basic'
|
|
86
|
-
const color = `--${design}-palette-${toCamelCase(`${theme}-${focusValue.match(/\.([^.{}]+)}/)?.[1]}`)}`
|
|
87
|
-
|
|
88
|
-
if (code) {
|
|
89
|
-
code.value.push(color)
|
|
90
|
-
} else {
|
|
91
|
-
data.push({
|
|
92
|
-
name,
|
|
93
|
-
value: [color]
|
|
94
|
-
})
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
})
|
|
99
|
-
|
|
100
|
-
return data
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
getFocusUsed(
|
|
104
|
-
list: PropertyItem['value'][],
|
|
105
|
-
design: string,
|
|
106
|
-
component: string,
|
|
107
|
-
value: string
|
|
108
|
-
): string | undefined {
|
|
109
|
-
const data = this.items.getLink(
|
|
110
|
-
design,
|
|
111
|
-
component,
|
|
112
|
-
value
|
|
113
|
-
)
|
|
114
|
-
|
|
115
|
-
if (list.indexOf(data) !== -1) {
|
|
116
|
-
return value
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
const item = this.items.getInfo(data)
|
|
120
|
-
|
|
121
|
-
if (
|
|
122
|
-
item
|
|
123
|
-
&& item.design === design
|
|
124
|
-
&& typeof item.component === 'string'
|
|
125
|
-
&& typeof item.value === 'string'
|
|
126
|
-
) {
|
|
127
|
-
return this.getFocusUsed(
|
|
128
|
-
list,
|
|
129
|
-
item.design,
|
|
130
|
-
item.component,
|
|
131
|
-
item.value
|
|
132
|
-
)
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
return undefined
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* Getting a list of all colors.
|
|
140
|
-
*
|
|
141
|
-
* Получение списка всех цветов.
|
|
142
|
-
*/
|
|
143
|
-
private getList(): PropertyItem['value'][] {
|
|
144
|
-
return forEach(
|
|
145
|
-
this.items.findCategory(PropertyCategory.color),
|
|
146
|
-
({ value }) => value
|
|
147
|
-
)
|
|
148
|
-
}
|
|
149
|
-
}
|
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
// export:none
|
|
2
|
-
|
|
3
|
-
import { replaceRecursive, toKebabCase } from '@dxtmisha/functional-basic'
|
|
4
|
-
|
|
5
|
-
import { PropertiesConfig } from './PropertiesConfig'
|
|
6
|
-
import { PropertiesTool } from './PropertiesTool'
|
|
7
|
-
import { PropertiesFile } from './PropertiesFile'
|
|
8
|
-
import { PropertiesCache } from './PropertiesCache'
|
|
9
|
-
|
|
10
|
-
import {
|
|
11
|
-
type PropertyListOrData
|
|
12
|
-
} from '../../types/propertyTypes'
|
|
13
|
-
|
|
14
|
-
import { UI_DIRS_COMPONENTS, UI_DIRS_TOKENS } from '../../config'
|
|
15
|
-
|
|
16
|
-
export type PropertiesPathItem = {
|
|
17
|
-
design: string
|
|
18
|
-
paths?: string[]
|
|
19
|
-
pathsComponent?: string[]
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export type PropertiesPathList = PropertiesPathItem[]
|
|
23
|
-
|
|
24
|
-
const DIR_CACHE = 'read'
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Directory and path resolver for multi-design token environments.
|
|
28
|
-
* This class translates abstract design names into concrete filesystem paths for global tokens and component-specific settings. It coordinates the cross-platform path discovery flow and provided cached traversal mechanisms (`to`, `toAll`) to efficiently process token files across the entire project structure.
|
|
29
|
-
*
|
|
30
|
-
* Резолвер директорий и путей для сред с несколькими дизайнами токенов.
|
|
31
|
-
* Этот класс преобразует абстрактные названия дизайнов в конкретные пути файловой системы для глобальных токенов и настроек компонентов. Он координирует процесс обнаружения путей на разных платформах и предоставляет механизмы кэшированного обхода (`to`, `toAll`) для эффективной обработки файлов токенов во всей структуре проекта.
|
|
32
|
-
*/
|
|
33
|
-
export class PropertiesPath {
|
|
34
|
-
private readonly paths: PropertiesPathList
|
|
35
|
-
private readonly constructorType: boolean = false
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Constructor
|
|
39
|
-
* @param designs list of design names corresponding to folder names/
|
|
40
|
-
* список названий дизайнов, соответствующих названиям папок
|
|
41
|
-
*/
|
|
42
|
-
constructor(
|
|
43
|
-
private designs: string[]
|
|
44
|
-
) {
|
|
45
|
-
this.paths = []
|
|
46
|
-
|
|
47
|
-
designs.forEach((design) => {
|
|
48
|
-
this.paths.push({
|
|
49
|
-
design: toKebabCase(design),
|
|
50
|
-
paths: this.getDir(design),
|
|
51
|
-
pathsComponent: this.getDirComponents(design)
|
|
52
|
-
})
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
if (
|
|
56
|
-
this.paths?.[1]
|
|
57
|
-
&& PropertiesTool.isConstructor(this.paths?.[1].design)
|
|
58
|
-
) {
|
|
59
|
-
delete this.paths[1]
|
|
60
|
-
this.constructorType = true
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
isConstructor(): boolean {
|
|
65
|
-
return this.constructorType
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Returns the names of available designs.
|
|
70
|
-
*
|
|
71
|
-
* Возвращает названия доступных дизайнов.
|
|
72
|
-
*/
|
|
73
|
-
getDesigns(): string[] {
|
|
74
|
-
return this.designs
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Gets a list of available paths to the file of global component settings.
|
|
79
|
-
*
|
|
80
|
-
* Получает список доступных путей к файлу глобальных настроек компонента.
|
|
81
|
-
* @param name design name/ название дизайна
|
|
82
|
-
*/
|
|
83
|
-
getPath(name: string): PropertiesPathItem | undefined {
|
|
84
|
-
return this.paths.find(item => item.design === name)
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* List of available paths.
|
|
89
|
-
*
|
|
90
|
-
* Список доступных путей.
|
|
91
|
-
*/
|
|
92
|
-
getPaths(): PropertiesPathList {
|
|
93
|
-
return this.paths
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Executes a cached transformation for a specific design and token group.
|
|
98
|
-
* Resolves paths for the target design, executes the provided callback to process the data, and caches the result for future performance. Ideal for processing individual themes or component layers within a theme.
|
|
99
|
-
*
|
|
100
|
-
* Выполняет кэшированную трансформацию для конкретного дизайна и группы токенов.
|
|
101
|
-
* Разрешает пути для целевого дизайна, выполняет предоставленный callback для обработки данных и кэширует результат. Идеально подходит для обработки отдельных тем или слоев компонентов внутри темы.
|
|
102
|
-
* @param name unique name for the processing group (used as cache key) / уникальное имя группы обработки (используется как ключ кэша)
|
|
103
|
-
* @param design names of the design to process / названия дизайна для обработки
|
|
104
|
-
* @param callback function that receives resolved paths and returns processed data / функция, которая получает разрешенные пути и возвращает обработанные данные
|
|
105
|
-
*/
|
|
106
|
-
to(
|
|
107
|
-
name: string,
|
|
108
|
-
design: string,
|
|
109
|
-
callback: (
|
|
110
|
-
path: string[] | undefined,
|
|
111
|
-
pathsComponent: string[] | undefined,
|
|
112
|
-
design: string
|
|
113
|
-
) => PropertyListOrData
|
|
114
|
-
): PropertyListOrData {
|
|
115
|
-
return PropertiesCache.get<PropertyListOrData>([DIR_CACHE, name], `${name}-${design}`, () => {
|
|
116
|
-
let data: PropertyListOrData = {}
|
|
117
|
-
const item = this.getPath(design)
|
|
118
|
-
|
|
119
|
-
if (item) {
|
|
120
|
-
data = replaceRecursive(
|
|
121
|
-
data,
|
|
122
|
-
callback(
|
|
123
|
-
item.paths,
|
|
124
|
-
item.pathsComponent,
|
|
125
|
-
design
|
|
126
|
-
)
|
|
127
|
-
)
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
return data
|
|
131
|
-
})
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* Orchestrates a global cached transformation across all registered designs.
|
|
136
|
-
* Iterates through every design defined in the constructor, processes its tokens using the provided callback, and merges the results into a single unified property tree.
|
|
137
|
-
*
|
|
138
|
-
* Координирует глобальную кэшированную трансформацию для всех зарегистрированных дизайнов.
|
|
139
|
-
* Итерирует по каждому дизайну, определенному в конструкторе, обрабатывает его токены с помощью предоставленного callback и объединяет результаты в единое унифицированное дерево свойств.
|
|
140
|
-
* @param name unique name for the global processing group / уникальное имя глобальной группы обработки
|
|
141
|
-
* @param callback function for processing individual designs / функция для обработки отдельных дизайнов
|
|
142
|
-
*/
|
|
143
|
-
toAll(
|
|
144
|
-
name: string,
|
|
145
|
-
callback: (
|
|
146
|
-
path: string[] | undefined,
|
|
147
|
-
pathsComponent: string[] | undefined,
|
|
148
|
-
design: string
|
|
149
|
-
) => PropertyListOrData
|
|
150
|
-
): PropertyListOrData {
|
|
151
|
-
return PropertiesCache.get<PropertyListOrData>([DIR_CACHE], name, () => {
|
|
152
|
-
let data: PropertyListOrData = {}
|
|
153
|
-
|
|
154
|
-
this.designs.forEach((design) => {
|
|
155
|
-
data = replaceRecursive(data, this.to(name, design, callback))
|
|
156
|
-
})
|
|
157
|
-
|
|
158
|
-
return data
|
|
159
|
-
})
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* Returns the path to a file by design name.
|
|
164
|
-
*
|
|
165
|
-
* Возвращает путь к файлу по названию дизайна.
|
|
166
|
-
* @param name design name/ название дизайна
|
|
167
|
-
*/
|
|
168
|
-
private getDir(name: string): string[] | undefined {
|
|
169
|
-
if (PropertiesTool.isConstructor(name)) {
|
|
170
|
-
return undefined
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
return [PropertiesFile.getRoot(), ...UI_DIRS_TOKENS]
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
/**
|
|
177
|
-
* Returns the path to a file by design name.
|
|
178
|
-
*
|
|
179
|
-
* Возвращает путь к файлу по названию дизайна.
|
|
180
|
-
* @param name design name/ название дизайна
|
|
181
|
-
*/
|
|
182
|
-
private getDirComponents(name: string): string[] | undefined {
|
|
183
|
-
if (PropertiesTool.isConstructor(name)) {
|
|
184
|
-
return undefined
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
return [
|
|
188
|
-
PropertiesFile.getRoot(),
|
|
189
|
-
...UI_DIRS_COMPONENTS,
|
|
190
|
-
PropertiesConfig.getProjectName()
|
|
191
|
-
]
|
|
192
|
-
}
|
|
193
|
-
}
|