@futurebrand/dev-tools 2.5.3 → 2.5.4
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.
|
@@ -11,7 +11,7 @@ class FigmaAPI {
|
|
|
11
11
|
return id;
|
|
12
12
|
}
|
|
13
13
|
async getVariables(pageId) {
|
|
14
|
-
const { variables } = await this.state.fetchApi(`/figma/${pageId}/
|
|
14
|
+
const { variables } = await this.state.fetchApi(`/figma/${pageId}/variables`);
|
|
15
15
|
return variables;
|
|
16
16
|
}
|
|
17
17
|
async getBlocks(pageId, canvasId) {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const files_1 = require("../../../../utils/files");
|
|
4
3
|
const inquirer_1 = require("inquirer");
|
|
5
|
-
const generator_1 = require("../generator");
|
|
6
4
|
const api_1 = require("./api");
|
|
7
5
|
class FigmaModule {
|
|
8
6
|
state;
|
|
@@ -26,11 +24,11 @@ class FigmaModule {
|
|
|
26
24
|
const defaultBlocks = [];
|
|
27
25
|
const nextProject = data.projects.find((project) => project.type === 'next.js');
|
|
28
26
|
for (const block of blocks) {
|
|
29
|
-
const tempFolder = await (0, files_1.getTempFilePath)(generator_1.GENERATOR_FOLDER_NAME, block.name);
|
|
30
|
-
if (await (0, files_1.verifyPath)(tempFolder)) {
|
|
31
|
-
continue;
|
|
32
|
-
}
|
|
33
27
|
if (nextProject) {
|
|
28
|
+
const alreadyGenerated = await this.state.file.verifyBlockAlreadyGenerated(block.name, nextProject);
|
|
29
|
+
if (alreadyGenerated) {
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
34
32
|
const alreadyExist = await this.state.file.verifyBlockAlreadyExists(nextProject, block.name);
|
|
35
33
|
if (alreadyExist) {
|
|
36
34
|
continue;
|
|
@@ -97,9 +97,15 @@ class AIState {
|
|
|
97
97
|
this.data.blocks = blocks;
|
|
98
98
|
}
|
|
99
99
|
setVariables(variables) {
|
|
100
|
+
if (!this.data) {
|
|
101
|
+
throw new Error('AI State not initialized');
|
|
102
|
+
}
|
|
100
103
|
this.data.variables = variables;
|
|
101
104
|
}
|
|
102
105
|
setColors(colors) {
|
|
106
|
+
if (!this.data) {
|
|
107
|
+
throw new Error('AI State not initialized');
|
|
108
|
+
}
|
|
103
109
|
this.data.colors = colors;
|
|
104
110
|
}
|
|
105
111
|
setBlockGenerated(blockName, generated = true) {
|