@dxtmisha/scripts 0.11.8 → 1.0.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 +57 -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 +12 -2
- 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 +22 -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-x3CInynJ.js +232 -0
- package/dist/PropertiesConfig-ChizwW5y.js +250 -0
- package/{src/config.ts → dist/config.d.ts} +179 -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 +4677 -0
- package/dist/library.js +1436 -0
- package/dist/propertyTypes-DflziKuR.js +236 -0
- package/package.json +69 -20
- 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,59 +0,0 @@
|
|
|
1
|
-
// export:none
|
|
2
|
-
|
|
3
|
-
import { forEach, isObjectNotArray } from '@dxtmisha/functional-basic'
|
|
4
|
-
|
|
5
|
-
import { PropertiesToAbstract } from './PropertiesToAbstract'
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
type PropertyItem,
|
|
9
|
-
type PropertyItemsItem,
|
|
10
|
-
PropertyKey,
|
|
11
|
-
PropertyType
|
|
12
|
-
} from '../../../types/propertyTypes'
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* A class for transforming animate.
|
|
16
|
-
*
|
|
17
|
-
* Класс для преобразования animate.
|
|
18
|
-
*/
|
|
19
|
-
export class PropertiesToAnimate extends PropertiesToAbstract {
|
|
20
|
-
protected readonly FILE_CACHE = '044-animate'
|
|
21
|
-
|
|
22
|
-
protected init(): void {
|
|
23
|
-
this.items
|
|
24
|
-
.findVariable(PropertyType.animate)
|
|
25
|
-
.forEach(({
|
|
26
|
-
name,
|
|
27
|
-
value,
|
|
28
|
-
item,
|
|
29
|
-
parents
|
|
30
|
-
}) => {
|
|
31
|
-
item[PropertyKey.name] = this.getName(this.items.getReName(name, item), item, parents)
|
|
32
|
-
|
|
33
|
-
if (isObjectNotArray(value)) {
|
|
34
|
-
forEach(value, (frame, code) => {
|
|
35
|
-
frame[PropertyKey.variable] = PropertyType.animateFrame
|
|
36
|
-
frame[PropertyKey.name] = frame?.[PropertyKey.index] ?? code
|
|
37
|
-
})
|
|
38
|
-
}
|
|
39
|
-
})
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* @param name base property name/ базовое название свойства
|
|
44
|
-
* @param item current element/ текущий элемент
|
|
45
|
-
* @param parents array of all ancestor properties along the tree from the top level/
|
|
46
|
-
* массив со всеми свойствами предков по дереву от верхнего уровня
|
|
47
|
-
*/
|
|
48
|
-
private getName(
|
|
49
|
-
name: string,
|
|
50
|
-
item: PropertyItem,
|
|
51
|
-
parents: PropertyItemsItem['parents']
|
|
52
|
-
) {
|
|
53
|
-
if (item?.[PropertyKey.fullName]) {
|
|
54
|
-
return name
|
|
55
|
-
} else {
|
|
56
|
-
return `${this.items.getParentsName(parents).join('-')}-${name}`
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
// export:none
|
|
2
|
-
|
|
3
|
-
import { PropertiesToAbstract } from './PropertiesToAbstract'
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
type PropertyItem,
|
|
7
|
-
type PropertyItemsItem,
|
|
8
|
-
PropertyKey,
|
|
9
|
-
PropertyType
|
|
10
|
-
} from '../../../types/propertyTypes'
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* A class for transforming class.
|
|
14
|
-
*
|
|
15
|
-
* Класс для преобразования class.
|
|
16
|
-
*/
|
|
17
|
-
export class PropertiesToClass extends PropertiesToAbstract {
|
|
18
|
-
protected readonly FILE_CACHE = '030-class'
|
|
19
|
-
|
|
20
|
-
protected init(): void {
|
|
21
|
-
this.items.findVariable(PropertyType.classType).forEach(({
|
|
22
|
-
name,
|
|
23
|
-
item,
|
|
24
|
-
parents
|
|
25
|
-
}) => {
|
|
26
|
-
item[PropertyKey.name] = this.getName(name, item, parents)
|
|
27
|
-
})
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* @param name base property name/ базовое название свойства
|
|
32
|
-
* @param item current element/ текущий элемент
|
|
33
|
-
* @param parents array of all ancestor properties along the tree from the top level/
|
|
34
|
-
* массив со всеми свойствами предков по дереву от верхнего уровня
|
|
35
|
-
*/
|
|
36
|
-
private getName(
|
|
37
|
-
name: string,
|
|
38
|
-
item: PropertyItem,
|
|
39
|
-
parents: PropertyItemsItem['parents']
|
|
40
|
-
): string {
|
|
41
|
-
const newName = this.items.getReName(name, item)
|
|
42
|
-
|
|
43
|
-
if (item?.[PropertyKey.fullName]) {
|
|
44
|
-
return `& .${newName}`
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
return `& .${parents?.[0]?.name}-${newName}`
|
|
48
|
-
}
|
|
49
|
-
}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
// export:none
|
|
2
|
-
|
|
3
|
-
import { forEach, isObjectNotArray } from '@dxtmisha/functional-basic'
|
|
4
|
-
|
|
5
|
-
import { PropertiesToAbstract } from './PropertiesToAbstract'
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
type PropertyItem,
|
|
9
|
-
PropertyKey,
|
|
10
|
-
PropertyType
|
|
11
|
-
} from '../../../types/propertyTypes'
|
|
12
|
-
|
|
13
|
-
const IGNORES: string[] = [
|
|
14
|
-
PropertyKey.value,
|
|
15
|
-
PropertyKey.settingClone
|
|
16
|
-
]
|
|
17
|
-
|
|
18
|
-
const IGNORES_TYPE: string[] = [
|
|
19
|
-
PropertyType.var,
|
|
20
|
-
PropertyType.property
|
|
21
|
-
]
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Class for duplicating configuration parameters to child elements.
|
|
25
|
-
*
|
|
26
|
-
* Класс для дублирования параметров настройки к дочерним элементам.
|
|
27
|
-
*/
|
|
28
|
-
export class PropertiesToClone extends PropertiesToAbstract {
|
|
29
|
-
protected readonly FILE_CACHE = '007-01-clone'
|
|
30
|
-
|
|
31
|
-
protected init(): void {
|
|
32
|
-
this.items.each(({
|
|
33
|
-
name,
|
|
34
|
-
item,
|
|
35
|
-
parent
|
|
36
|
-
}) => {
|
|
37
|
-
if (
|
|
38
|
-
parent
|
|
39
|
-
&& item?.[PropertyKey.settingClone]
|
|
40
|
-
) {
|
|
41
|
-
this.update(
|
|
42
|
-
item,
|
|
43
|
-
this.findItem(parent, name)
|
|
44
|
-
)
|
|
45
|
-
}
|
|
46
|
-
})
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Search in child elements for similar properties.
|
|
51
|
-
*
|
|
52
|
-
* Поиск в дочерних элементах похожих свойств.
|
|
53
|
-
* @param parent starting element for search/ начальный элемент для поиска
|
|
54
|
-
* @param name property name/ название свойства
|
|
55
|
-
*/
|
|
56
|
-
protected findItem(
|
|
57
|
-
parent: PropertyItem,
|
|
58
|
-
name: string
|
|
59
|
-
): PropertyItem[] {
|
|
60
|
-
const data: PropertyItem[] = []
|
|
61
|
-
|
|
62
|
-
if (isObjectNotArray(parent.value)) {
|
|
63
|
-
forEach(parent.value, (item, itemName) => {
|
|
64
|
-
if (
|
|
65
|
-
itemName === name
|
|
66
|
-
&& IGNORES_TYPE.indexOf(item?.type ?? '') < 0
|
|
67
|
-
) {
|
|
68
|
-
data.push(item)
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
data.push(...this.findItem(item, name))
|
|
72
|
-
})
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
return data
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Data update for selected elements.
|
|
80
|
-
*
|
|
81
|
-
* Обновление данных для выбранных элементов.
|
|
82
|
-
* @param original original element/ оригинальный элемент
|
|
83
|
-
* @param properties element for update/ элемент для обновления
|
|
84
|
-
*/
|
|
85
|
-
protected update(
|
|
86
|
-
original: PropertyItem,
|
|
87
|
-
properties: PropertyItem[]
|
|
88
|
-
) {
|
|
89
|
-
const originalValue = original.value
|
|
90
|
-
|
|
91
|
-
properties.forEach((property) => {
|
|
92
|
-
forEach(original, (value, index: keyof PropertyItem) => {
|
|
93
|
-
if (
|
|
94
|
-
index
|
|
95
|
-
&& !(index in property)
|
|
96
|
-
&& IGNORES.indexOf(index) < 0
|
|
97
|
-
) {
|
|
98
|
-
property[index] = value as never
|
|
99
|
-
}
|
|
100
|
-
})
|
|
101
|
-
|
|
102
|
-
if (
|
|
103
|
-
isObjectNotArray(originalValue)
|
|
104
|
-
&& isObjectNotArray(property.value)
|
|
105
|
-
) {
|
|
106
|
-
forEach(property.value, (item, index) => {
|
|
107
|
-
if (originalValue?.[index]) {
|
|
108
|
-
this.update(originalValue[index], [item])
|
|
109
|
-
}
|
|
110
|
-
})
|
|
111
|
-
}
|
|
112
|
-
})
|
|
113
|
-
}
|
|
114
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
// export:none
|
|
2
|
-
|
|
3
|
-
import { PropertiesToAbstract } from './PropertiesToAbstract'
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
type PropertyItem,
|
|
7
|
-
type PropertyItemsItem,
|
|
8
|
-
PropertyKey,
|
|
9
|
-
PropertyType
|
|
10
|
-
} from '../../../types/propertyTypes'
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* A class for transforming components.
|
|
14
|
-
*
|
|
15
|
-
* Класс для преобразования компонент.
|
|
16
|
-
*/
|
|
17
|
-
export class PropertiesToComponent extends PropertiesToAbstract {
|
|
18
|
-
protected readonly FILE_CACHE = '028-component'
|
|
19
|
-
|
|
20
|
-
protected init(): void {
|
|
21
|
-
this.items.findVariable([PropertyType.component, PropertyType.theme]).forEach(({
|
|
22
|
-
name,
|
|
23
|
-
item,
|
|
24
|
-
parents
|
|
25
|
-
}) => {
|
|
26
|
-
item[PropertyKey.name] = this.getName(this.items.getReName(name, item), item, parents)
|
|
27
|
-
})
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Name transformation for the component type.
|
|
32
|
-
*
|
|
33
|
-
* Преобразование имени для типа component.
|
|
34
|
-
* @param name base property name/ базовое название свойства
|
|
35
|
-
* @param item current element/ текущий элемент
|
|
36
|
-
* @param parents array of all ancestor properties along the tree from the top level/
|
|
37
|
-
* массив со всеми свойствами предков по дереву от верхнего уровня
|
|
38
|
-
*/
|
|
39
|
-
private getName(
|
|
40
|
-
name: string,
|
|
41
|
-
item: PropertyItem,
|
|
42
|
-
parents: PropertyItemsItem['parents']
|
|
43
|
-
): string {
|
|
44
|
-
const newName = this.items.getReName(name, item)
|
|
45
|
-
|
|
46
|
-
if (item?.[PropertyKey.fullName]) {
|
|
47
|
-
return `${newName}`
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return `${this.items.getParentsName(parents).join('-')}-${newName}`
|
|
51
|
-
}
|
|
52
|
-
}
|
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
// export:none
|
|
2
|
-
|
|
3
|
-
import { forEach, isFilled, isObjectNotArray } from '@dxtmisha/functional-basic'
|
|
4
|
-
|
|
5
|
-
import { PropertiesConfig } from '../PropertiesConfig'
|
|
6
|
-
import { PropertiesToAbstract } from './PropertiesToAbstract'
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
type PropertyItem,
|
|
10
|
-
type PropertyItemsItem,
|
|
11
|
-
type PropertyItemsParent,
|
|
12
|
-
PropertyKey
|
|
13
|
-
} from '../../../types/propertyTypes'
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Class for managing the translation of a property from one branch to another.
|
|
17
|
-
*
|
|
18
|
-
* Класс для управления переводом свойства из одной ветки в другую.
|
|
19
|
-
*/
|
|
20
|
-
export class PropertiesToDrag extends PropertiesToAbstract {
|
|
21
|
-
protected readonly FILE_CACHE = '007-03-drag'
|
|
22
|
-
|
|
23
|
-
protected init(): void {
|
|
24
|
-
this.read()
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Getting a list with basic settings.
|
|
29
|
-
*
|
|
30
|
-
* Получение списка с базовыми настройками.
|
|
31
|
-
* @param property property value/ значение свойства
|
|
32
|
-
*/
|
|
33
|
-
protected getDragSetting(
|
|
34
|
-
property: PropertyItemsItem
|
|
35
|
-
): Record<string, PropertyItem> | undefined {
|
|
36
|
-
const {
|
|
37
|
-
design,
|
|
38
|
-
component,
|
|
39
|
-
item
|
|
40
|
-
} = property
|
|
41
|
-
|
|
42
|
-
if (
|
|
43
|
-
component
|
|
44
|
-
&& item?.[PropertyKey.dragSetting]
|
|
45
|
-
) {
|
|
46
|
-
const dragSetting = item?.[PropertyKey.dragSetting]
|
|
47
|
-
const dragSettingList: Record<string, string> = typeof dragSetting === 'object' ? dragSetting : { _all: dragSetting }
|
|
48
|
-
const data: Record<string, PropertyItem> = {}
|
|
49
|
-
|
|
50
|
-
forEach(dragSettingList, (setting, name) => {
|
|
51
|
-
const itemSetting = this.items.getItem(
|
|
52
|
-
this.items.getLink(
|
|
53
|
-
design,
|
|
54
|
-
component,
|
|
55
|
-
setting
|
|
56
|
-
)
|
|
57
|
-
)
|
|
58
|
-
|
|
59
|
-
if (itemSetting) {
|
|
60
|
-
data[name] = {
|
|
61
|
-
...itemSetting,
|
|
62
|
-
value: {}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
})
|
|
66
|
-
|
|
67
|
-
if (Object.keys(data).length > 0) {
|
|
68
|
-
return data
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return undefined
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Beginning of data processing.
|
|
77
|
-
*
|
|
78
|
-
* Начало обработки данных.
|
|
79
|
-
* @param properties values for verification/ значения для проверки
|
|
80
|
-
*/
|
|
81
|
-
protected read(
|
|
82
|
-
properties?: PropertyItemsItem
|
|
83
|
-
) {
|
|
84
|
-
this.items.eachMainOnly(
|
|
85
|
-
(property) => {
|
|
86
|
-
const {
|
|
87
|
-
name,
|
|
88
|
-
item,
|
|
89
|
-
parent,
|
|
90
|
-
parents
|
|
91
|
-
} = property
|
|
92
|
-
|
|
93
|
-
const newParents = [
|
|
94
|
-
...parents,
|
|
95
|
-
{
|
|
96
|
-
name,
|
|
97
|
-
item
|
|
98
|
-
}
|
|
99
|
-
]
|
|
100
|
-
|
|
101
|
-
this.read({
|
|
102
|
-
...property,
|
|
103
|
-
parents: newParents
|
|
104
|
-
})
|
|
105
|
-
|
|
106
|
-
if (item?.[PropertyKey.drag]) {
|
|
107
|
-
const itemDragSetting = this.getDragSetting(property)
|
|
108
|
-
const itemDrag = this.drag(
|
|
109
|
-
newParents,
|
|
110
|
-
item,
|
|
111
|
-
itemDragSetting ?? {}
|
|
112
|
-
)
|
|
113
|
-
|
|
114
|
-
if (
|
|
115
|
-
parent
|
|
116
|
-
&& isObjectNotArray(parent.value)
|
|
117
|
-
&& itemDrag
|
|
118
|
-
&& this.toGo(item, itemDrag)
|
|
119
|
-
) {
|
|
120
|
-
delete parent.value[name]
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
},
|
|
124
|
-
properties
|
|
125
|
-
)
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* We get an object to transfer data.
|
|
130
|
-
*
|
|
131
|
-
* Получаем объект для переноса данных.
|
|
132
|
-
* @param parents list of ancestors/ список предков
|
|
133
|
-
* @param item starting element/ начальный элемент
|
|
134
|
-
* @param setting settings for new elements/ настройки для новых элементов
|
|
135
|
-
*/
|
|
136
|
-
protected drag(
|
|
137
|
-
parents: PropertyItemsParent[],
|
|
138
|
-
item: PropertyItem,
|
|
139
|
-
setting: Record<string, PropertyItem>
|
|
140
|
-
): PropertyItem | undefined {
|
|
141
|
-
const paths = item?.[PropertyKey.drag]?.split(PropertiesConfig.getSeparator()) ?? []
|
|
142
|
-
|
|
143
|
-
if (parents.length > 0) {
|
|
144
|
-
let focusParent = parents.length - 1
|
|
145
|
-
let focus: PropertyItem = (parents[focusParent] as PropertyItemsParent).item
|
|
146
|
-
let blockTop = false
|
|
147
|
-
|
|
148
|
-
paths.forEach((dir) => {
|
|
149
|
-
switch (dir) {
|
|
150
|
-
case '.':
|
|
151
|
-
if (!blockTop) {
|
|
152
|
-
focusParent = 0
|
|
153
|
-
focus = (parents[focusParent] as PropertyItemsParent).item
|
|
154
|
-
}
|
|
155
|
-
break
|
|
156
|
-
case '..':
|
|
157
|
-
if (!blockTop) {
|
|
158
|
-
if (--focusParent < 0) {
|
|
159
|
-
focusParent = 0
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
focus = (parents[focusParent] as PropertyItemsParent).item
|
|
163
|
-
}
|
|
164
|
-
break
|
|
165
|
-
default:
|
|
166
|
-
if (
|
|
167
|
-
focus
|
|
168
|
-
&& isObjectNotArray(focus.value)
|
|
169
|
-
) {
|
|
170
|
-
if (!(dir in focus.value)) {
|
|
171
|
-
focus.value[dir] = (setting?.[dir] ?? setting._all ?? { value: {} }) as PropertyItem
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
blockTop = true
|
|
175
|
-
focus = focus.value[dir] as PropertyItem
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
break
|
|
179
|
-
}
|
|
180
|
-
})
|
|
181
|
-
|
|
182
|
-
if (focus !== item) {
|
|
183
|
-
return focus
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
return undefined
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* Move elements to a new place.
|
|
192
|
-
*
|
|
193
|
-
* Перенести элементы на новое место.
|
|
194
|
-
* @param item starting element/ начальный элемент
|
|
195
|
-
* @param itemDrag place of transfer/ место переноса
|
|
196
|
-
*/
|
|
197
|
-
protected toGo(
|
|
198
|
-
item: PropertyItem,
|
|
199
|
-
itemDrag: PropertyItem
|
|
200
|
-
): boolean {
|
|
201
|
-
const itemDragValue = itemDrag.value
|
|
202
|
-
|
|
203
|
-
if (
|
|
204
|
-
isObjectNotArray(itemDragValue)
|
|
205
|
-
) {
|
|
206
|
-
if (isObjectNotArray(item.value)) {
|
|
207
|
-
forEach(item.value, (value, index) => {
|
|
208
|
-
if (!(itemDragValue?.[index])) {
|
|
209
|
-
itemDragValue[index] = value
|
|
210
|
-
} else if (!isFilled(itemDragValue[index].value)) {
|
|
211
|
-
itemDragValue[index].value = value.value
|
|
212
|
-
}
|
|
213
|
-
})
|
|
214
|
-
} else {
|
|
215
|
-
const index = item?.[PropertyKey.index]
|
|
216
|
-
|
|
217
|
-
if (index) {
|
|
218
|
-
if (!(itemDragValue?.[index])) {
|
|
219
|
-
itemDragValue[index] = item
|
|
220
|
-
} else if (!isFilled(itemDragValue[index].value)) {
|
|
221
|
-
itemDragValue[index].value = item.value
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
return true
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
return false
|
|
230
|
-
}
|
|
231
|
-
}
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
// export:none
|
|
2
|
-
|
|
3
|
-
import { forEach, getColumn, isObjectNotArray, toCamelCase } from '@dxtmisha/functional-basic'
|
|
4
|
-
|
|
5
|
-
import { PropertiesConfig } from '../PropertiesConfig'
|
|
6
|
-
import { PropertiesToAbstract } from './PropertiesToAbstract'
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
type PropertyItemsItem,
|
|
10
|
-
PropertyKey
|
|
11
|
-
} from '../../../types/propertyTypes'
|
|
12
|
-
|
|
13
|
-
type PropertiesDuplicateListItem = {
|
|
14
|
-
value: string
|
|
15
|
-
property: PropertyItemsItem
|
|
16
|
-
}
|
|
17
|
-
type PropertiesDuplicateList = Record<string, PropertiesDuplicateListItem>
|
|
18
|
-
type PropertiesDuplicateItem = {
|
|
19
|
-
value: string
|
|
20
|
-
properties: PropertiesDuplicateList
|
|
21
|
-
}
|
|
22
|
-
type PropertiesDuplicate = PropertiesDuplicateItem[]
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Class for searching for duplicate properties and highlighting them.
|
|
26
|
-
*
|
|
27
|
-
* Класс для поиска дублирующих свойств и выделения их.
|
|
28
|
-
*/
|
|
29
|
-
export class PropertiesToDuplicate extends PropertiesToAbstract {
|
|
30
|
-
protected readonly FILE_CACHE = '910-duplicate'
|
|
31
|
-
|
|
32
|
-
protected init(): void {
|
|
33
|
-
const list = this.initList()
|
|
34
|
-
const duplicate = this.initDuplicate(list)
|
|
35
|
-
|
|
36
|
-
forEach(duplicate, (item) => {
|
|
37
|
-
const name = this.getName(item.properties)
|
|
38
|
-
|
|
39
|
-
Object.values(item.properties).forEach((property) => {
|
|
40
|
-
property.property.item[PropertyKey.duplicate] = name
|
|
41
|
-
})
|
|
42
|
-
})
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Returns the name of the group for the selected values.
|
|
47
|
-
*
|
|
48
|
-
* Возвращает имя группы для выбранных значений.
|
|
49
|
-
* @param properties list of selected properties/ список выбранных свойств
|
|
50
|
-
*/
|
|
51
|
-
protected getName(
|
|
52
|
-
properties: PropertiesDuplicateItem['properties']
|
|
53
|
-
): string {
|
|
54
|
-
const list: Record<string, string[]> = {}
|
|
55
|
-
const data: string[] = []
|
|
56
|
-
|
|
57
|
-
Object.keys(properties).forEach((item) => {
|
|
58
|
-
let parentName: string = 'main'
|
|
59
|
-
|
|
60
|
-
item.split(PropertiesConfig.getSeparator()).forEach((name) => {
|
|
61
|
-
if (!(parentName in list)) {
|
|
62
|
-
list[parentName] = [name]
|
|
63
|
-
} else {
|
|
64
|
-
list[parentName]?.push(name)
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
parentName = name
|
|
68
|
-
})
|
|
69
|
-
})
|
|
70
|
-
|
|
71
|
-
Object.values(list).forEach((item) => {
|
|
72
|
-
item.forEach((name) => {
|
|
73
|
-
if (data.indexOf(name) === -1) {
|
|
74
|
-
data.push(name)
|
|
75
|
-
}
|
|
76
|
-
})
|
|
77
|
-
})
|
|
78
|
-
|
|
79
|
-
return toCamelCase(data.join('-'))
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Search for duplicate values.
|
|
84
|
-
*
|
|
85
|
-
* Поиск дублирующих значений.
|
|
86
|
-
* @param list list for search/ список для поиска
|
|
87
|
-
* @param valueDuplicate values for search/ значения для поиска
|
|
88
|
-
* @protected
|
|
89
|
-
*/
|
|
90
|
-
protected findDuplicate(
|
|
91
|
-
list: PropertiesDuplicateList,
|
|
92
|
-
valueDuplicate: string
|
|
93
|
-
): PropertiesDuplicateList {
|
|
94
|
-
const data: PropertiesDuplicateList = {}
|
|
95
|
-
|
|
96
|
-
forEach(list, (item, link) => {
|
|
97
|
-
const { value } = item
|
|
98
|
-
|
|
99
|
-
if (value === valueDuplicate) {
|
|
100
|
-
data[link] = item
|
|
101
|
-
}
|
|
102
|
-
})
|
|
103
|
-
|
|
104
|
-
return data
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Getting the full list of tree branches.
|
|
109
|
-
*
|
|
110
|
-
* Получение полного списка ветки дерева.
|
|
111
|
-
*/
|
|
112
|
-
protected initList(): PropertiesDuplicateList {
|
|
113
|
-
const data: PropertiesDuplicateList = {}
|
|
114
|
-
const separator = PropertiesConfig.getSeparator()
|
|
115
|
-
|
|
116
|
-
this.items.each((property) => {
|
|
117
|
-
if (
|
|
118
|
-
property?.design
|
|
119
|
-
&& property?.component
|
|
120
|
-
&& isObjectNotArray(property.value)
|
|
121
|
-
&& Object.keys(property.value).length >= 5
|
|
122
|
-
) {
|
|
123
|
-
const name = getColumn(property.parents, 'name').join(separator)
|
|
124
|
-
|
|
125
|
-
data[`${name}${separator}${property.name}`] = {
|
|
126
|
-
value: `${property.design}::${property.component}::${JSON.stringify(property.value)}`,
|
|
127
|
-
property
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
})
|
|
131
|
-
|
|
132
|
-
return data
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Search for duplicate values.
|
|
137
|
-
*
|
|
138
|
-
* Поиск дублирующих значений.
|
|
139
|
-
* @param list list for search/ список для поиска
|
|
140
|
-
*/
|
|
141
|
-
protected initDuplicate(
|
|
142
|
-
list: PropertiesDuplicateList
|
|
143
|
-
): PropertiesDuplicate {
|
|
144
|
-
const duplicate: string[] = []
|
|
145
|
-
const data: PropertiesDuplicate = []
|
|
146
|
-
|
|
147
|
-
forEach(list, ({ value }, link) => {
|
|
148
|
-
if (duplicate.indexOf(link) === -1) {
|
|
149
|
-
const properties = this.findDuplicate(list, value)
|
|
150
|
-
const keys = Object.keys(properties)
|
|
151
|
-
|
|
152
|
-
if (keys.length > 1) {
|
|
153
|
-
data.push({
|
|
154
|
-
value,
|
|
155
|
-
properties
|
|
156
|
-
})
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
duplicate.push(...keys)
|
|
160
|
-
}
|
|
161
|
-
})
|
|
162
|
-
|
|
163
|
-
return data
|
|
164
|
-
}
|
|
165
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
// export:none
|
|
2
|
-
|
|
3
|
-
import { PropertiesToAbstract } from './PropertiesToAbstract'
|
|
4
|
-
|
|
5
|
-
import { PropertyKey } from '../../../types/propertyTypes'
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* A class for transforming components.
|
|
9
|
-
*
|
|
10
|
-
* Класс для преобразования состояния.
|
|
11
|
-
*/
|
|
12
|
-
export class PropertiesToFull extends PropertiesToAbstract {
|
|
13
|
-
protected readonly FILE_CACHE = '018-full'
|
|
14
|
-
|
|
15
|
-
protected init(): void {
|
|
16
|
-
this.items.each(({
|
|
17
|
-
design,
|
|
18
|
-
component,
|
|
19
|
-
name,
|
|
20
|
-
value,
|
|
21
|
-
item
|
|
22
|
-
}) => {
|
|
23
|
-
if (component) {
|
|
24
|
-
item[PropertyKey.name] = this.items.getLinkToName(
|
|
25
|
-
design,
|
|
26
|
-
component,
|
|
27
|
-
this.items.getReName(name, item)
|
|
28
|
-
)
|
|
29
|
-
|
|
30
|
-
if (typeof value === 'string') {
|
|
31
|
-
item[PropertyKey.css] = this.items.getLinkToValue(design, component, value)
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
})
|
|
35
|
-
}
|
|
36
|
-
}
|