Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
psd-parse-web
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
劳工
psd-parse-web
Commits
81d83998
Commit
81d83998
authored
Jun 11, 2020
by
任建锋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--
parent
53d8e362
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
157 additions
and
87 deletions
+157
-87
index.es.js
dist/index.es.js
+36
-18
index.es.js.map
dist/index.es.js.map
+1
-1
index.js
dist/index.js
+36
-18
index.js.map
dist/index.js.map
+1
-1
index.umd.js
dist/index.umd.js
+43
-25
index.umd.js.map
dist/index.umd.js.map
+1
-1
zeroing.js
src/zeroing.js
+39
-23
No files found.
dist/index.es.js
View file @
81d83998
...
...
@@ -86,7 +86,7 @@ async function execute(psdFile, options) {
let
viewRoot
=
{
name
:
path
.
basename
(
psdFile
.
name
,
'.psd'
),
type
:
'node
'
,
componentName
:
'Div
'
,
uuid
:
generateUUID
(),
};
...
...
@@ -99,10 +99,16 @@ async function execute(psdFile, options) {
await
walkNode
(
tree
,
async
function
(
node
,
parent
)
{
let
{
name
}
=
node
;
const
{
x
,
y
,
width
,
height
,
alpha
,
visible
,
origin
:
{
layer
,
layer
:
{
typeTool
,
solidColor
}}}
=
node
;
const
{
x
,
y
,
width
,
height
,
opacity
,
display
,
origin
:
{
layer
,
layer
:
{
typeTool
,
solidColor
}}}
=
node
;
//console.log('walk node:', name);
let
properties
=
{
width
,
height
,
alpha
,
visible
,
style
:{
width
,
height
,
opacity
,
display
,
},
attrs
:{
},
className
:
""
};
const
isSecondLayer
=
!
parent
.
origin
.
parent
;
...
...
@@ -171,7 +177,7 @@ async function execute(psdFile, options) {
value
=
0
;
}
}
properties
[
field
]
=
value
;
properties
.
style
[
field
]
=
value
;
}
}
}
...
...
@@ -187,24 +193,33 @@ async function execute(psdFile, options) {
};
let
dealLater
=
true
;
if
(
x
!==
0
)
{
properties
.
x
=
x
-
(
isSecondLayer
?
offset
.
x
:
0
);
properties
.
style
.
left
=
x
-
(
isSecondLayer
?
offset
.
x
:
0
);
}
if
(
y
!==
0
)
{
properties
.
y
=
y
-
(
isSecondLayer
?
offset
.
y
:
0
);
properties
.
style
.
top
=
y
-
(
isSecondLayer
?
offset
.
y
:
0
);
}
properties
.
style
.
position
=
"absolute"
;
viewNode
.
rect
=
{
x
:
properties
.
style
.
left
?
properties
.
style
.
left
:
0
,
y
:
properties
.
style
.
top
?
properties
.
style
.
top
:
0
,
width
:
properties
.
style
.
width
,
height
:
properties
.
style
.
height
};
if
(
typeTool
)
{
let
fontInfo
=
typeTool
();
properties
.
text
=
fontInfo
.
textValue
;
properties
.
attrs
.
text
=
fontInfo
.
textValue
;
const
sizes
=
fontInfo
.
sizes
();
const
colors
=
fontInfo
.
colors
();
properties
.
size
=
sizes
?
sizes
[
0
]
||
20
:
20
;
properties
.
s
tyle
.
fontS
ize
=
sizes
?
sizes
[
0
]
||
20
:
20
;
let
[
r
,
g
,
b
,
a
]
=
colors
[
0
];
properties
.
fillColor
=
`rgba(
${
r
}
,
${
g
}
,
${
b
}
,
${
a
/
255
}
)`
;
viewNode
.
type
=
'label'
;
console
.
log
(
"color"
,[
r
,
g
,
b
,
a
]);
properties
.
style
.
color
=
`rgba(
${
r
}
,
${
g
}
,
${
b
}
,
${
a
/
255
}
)`
;
viewNode
.
componentName
=
'Label'
;
dealLater
=
false
;
}
else
if
(
solidColor
&&
layer
.
vectorMask
)
{
let
paths
=
layer
.
vectorMask
().
paths
;
if
(
paths
[
2
].
numPoints
===
4
)
{
let
isRect
=
true
;
...
...
@@ -215,9 +230,9 @@ async function execute(psdFile, options) {
}
}
if
(
isRect
)
{
viewNode
.
type
=
'rect
'
;
viewNode
.
componentName
=
'Div
'
;
const
{
r
,
g
,
b
}
=
solidColor
();
properties
.
fill
Color
=
`rgba(
${
r
}
,
${
g
}
,
${
b
}
, 1)`
;
properties
.
style
.
background
Color
=
`rgba(
${
r
}
,
${
g
}
,
${
b
}
, 1)`
;
dealLater
=
false
;
}
}
...
...
@@ -225,9 +240,9 @@ async function execute(psdFile, options) {
if
(
dealLater
)
{
if
(
node
.
hasOwnProperty
(
'children'
))
{
viewNode
.
type
=
'node
'
;
viewNode
.
componentName
=
'Div
'
;
}
else
{
viewNode
.
type
=
'i
mage'
;
viewNode
.
componentName
=
'I
mage'
;
let
uuid
=
generateUUID
();
const
ext
=
'.png'
;
...
...
@@ -257,7 +272,7 @@ async function execute(psdFile, options) {
});
}
properties
.
source
=
'asset://'
+
uuid
;
properties
.
attrs
.
source
=
'asset://'
+
uuid
;
}
}
}
...
...
@@ -270,10 +285,13 @@ async function execute(psdFile, options) {
node
.
view
=
viewNode
;
});
console
.
log
(
psdFile
);
let
data
=
{
view
:
viewRoot
,
pluginVersion
:
"0.0.1"
,
reference
:
"psd"
,
fileName
:
psdFile
.
name
,
assets
,
view
:
viewRoot
,
};
let
dataString
=
JSON
.
stringify
(
data
);
...
...
dist/index.es.js.map
View file @
81d83998
This diff is collapsed.
Click to expand it.
dist/index.js
View file @
81d83998
...
...
@@ -92,7 +92,7 @@ async function execute(psdFile, options) {
let
viewRoot
=
{
name
:
path
.
basename
(
psdFile
.
name
,
'.psd'
),
type
:
'node
'
,
componentName
:
'Div
'
,
uuid
:
generateUUID
(),
};
...
...
@@ -105,10 +105,16 @@ async function execute(psdFile, options) {
await
walkNode
(
tree
,
async
function
(
node
,
parent
)
{
let
{
name
}
=
node
;
const
{
x
,
y
,
width
,
height
,
alpha
,
visible
,
origin
:
{
layer
,
layer
:
{
typeTool
,
solidColor
}}}
=
node
;
const
{
x
,
y
,
width
,
height
,
opacity
,
display
,
origin
:
{
layer
,
layer
:
{
typeTool
,
solidColor
}}}
=
node
;
//console.log('walk node:', name);
let
properties
=
{
width
,
height
,
alpha
,
visible
,
style
:{
width
,
height
,
opacity
,
display
,
},
attrs
:{
},
className
:
""
};
const
isSecondLayer
=
!
parent
.
origin
.
parent
;
...
...
@@ -177,7 +183,7 @@ async function execute(psdFile, options) {
value
=
0
;
}
}
properties
[
field
]
=
value
;
properties
.
style
[
field
]
=
value
;
}
}
}
...
...
@@ -193,24 +199,33 @@ async function execute(psdFile, options) {
};
let
dealLater
=
true
;
if
(
x
!==
0
)
{
properties
.
x
=
x
-
(
isSecondLayer
?
offset
.
x
:
0
);
properties
.
style
.
left
=
x
-
(
isSecondLayer
?
offset
.
x
:
0
);
}
if
(
y
!==
0
)
{
properties
.
y
=
y
-
(
isSecondLayer
?
offset
.
y
:
0
);
properties
.
style
.
top
=
y
-
(
isSecondLayer
?
offset
.
y
:
0
);
}
properties
.
style
.
position
=
"absolute"
;
viewNode
.
rect
=
{
x
:
properties
.
style
.
left
?
properties
.
style
.
left
:
0
,
y
:
properties
.
style
.
top
?
properties
.
style
.
top
:
0
,
width
:
properties
.
style
.
width
,
height
:
properties
.
style
.
height
};
if
(
typeTool
)
{
let
fontInfo
=
typeTool
();
properties
.
text
=
fontInfo
.
textValue
;
properties
.
attrs
.
text
=
fontInfo
.
textValue
;
const
sizes
=
fontInfo
.
sizes
();
const
colors
=
fontInfo
.
colors
();
properties
.
size
=
sizes
?
sizes
[
0
]
||
20
:
20
;
properties
.
s
tyle
.
fontS
ize
=
sizes
?
sizes
[
0
]
||
20
:
20
;
let
[
r
,
g
,
b
,
a
]
=
colors
[
0
];
properties
.
fillColor
=
`rgba(
${
r
}
,
${
g
}
,
${
b
}
,
${
a
/
255
}
)`
;
viewNode
.
type
=
'label'
;
console
.
log
(
"color"
,[
r
,
g
,
b
,
a
]);
properties
.
style
.
color
=
`rgba(
${
r
}
,
${
g
}
,
${
b
}
,
${
a
/
255
}
)`
;
viewNode
.
componentName
=
'Label'
;
dealLater
=
false
;
}
else
if
(
solidColor
&&
layer
.
vectorMask
)
{
let
paths
=
layer
.
vectorMask
().
paths
;
if
(
paths
[
2
].
numPoints
===
4
)
{
let
isRect
=
true
;
...
...
@@ -221,9 +236,9 @@ async function execute(psdFile, options) {
}
}
if
(
isRect
)
{
viewNode
.
type
=
'rect
'
;
viewNode
.
componentName
=
'Div
'
;
const
{
r
,
g
,
b
}
=
solidColor
();
properties
.
fill
Color
=
`rgba(
${
r
}
,
${
g
}
,
${
b
}
, 1)`
;
properties
.
style
.
background
Color
=
`rgba(
${
r
}
,
${
g
}
,
${
b
}
, 1)`
;
dealLater
=
false
;
}
}
...
...
@@ -231,9 +246,9 @@ async function execute(psdFile, options) {
if
(
dealLater
)
{
if
(
node
.
hasOwnProperty
(
'children'
))
{
viewNode
.
type
=
'node
'
;
viewNode
.
componentName
=
'Div
'
;
}
else
{
viewNode
.
type
=
'i
mage'
;
viewNode
.
componentName
=
'I
mage'
;
let
uuid
=
generateUUID
();
const
ext
=
'.png'
;
...
...
@@ -263,7 +278,7 @@ async function execute(psdFile, options) {
});
}
properties
.
source
=
'asset://'
+
uuid
;
properties
.
attrs
.
source
=
'asset://'
+
uuid
;
}
}
}
...
...
@@ -276,10 +291,13 @@ async function execute(psdFile, options) {
node
.
view
=
viewNode
;
});
console
.
log
(
psdFile
);
let
data
=
{
view
:
viewRoot
,
pluginVersion
:
"0.0.1"
,
reference
:
"psd"
,
fileName
:
psdFile
.
name
,
assets
,
view
:
viewRoot
,
};
let
dataString
=
JSON
.
stringify
(
data
);
...
...
dist/index.js.map
View file @
81d83998
This diff is collapsed.
Click to expand it.
dist/index.umd.js
View file @
81d83998
...
...
@@ -2,13 +2,13 @@
typeof
exports
===
'object'
&&
typeof
module
!==
'undefined'
?
factory
(
exports
,
require
(
'path'
),
require
(
'color'
),
require
(
'uuid/v4'
),
require
(
'object-hash'
),
require
(
'zlib'
))
:
typeof
define
===
'function'
&&
define
.
amd
?
define
([
'exports'
,
'path'
,
'color'
,
'uuid/v4'
,
'object-hash'
,
'zlib'
],
factory
)
:
(
global
=
global
||
self
,
factory
(
global
[
'psd-parse-web'
]
=
{},
global
.
path
,
global
.
color
,
global
.
generateUUID
,
global
.
hash
,
global
.
zlib
));
}(
this
,
function
(
exports
,
path
,
color
,
generateUUID
,
hash
,
zlib
)
{
'use strict'
;
}(
this
,
(
function
(
exports
,
path
,
color
,
generateUUID
,
hash
,
zlib
)
{
'use strict'
;
path
=
path
&&
path
.
hasOwnProperty
(
'default'
)
?
path
[
'default'
]
:
path
;
color
=
color
&&
color
.
hasOwnProperty
(
'default'
)
?
color
[
'default'
]
:
color
;
generateUUID
=
generateUUID
&&
generateUUID
.
hasOwnProperty
(
'default'
)
?
generateUUID
[
'default'
]
:
generateUUID
;
hash
=
hash
&&
hash
.
hasOwnProperty
(
'default'
)
?
hash
[
'default'
]
:
hash
;
zlib
=
zlib
&&
zlib
.
hasOwnProperty
(
'default'
)
?
zlib
[
'default'
]
:
zlib
;
path
=
path
&&
Object
.
prototype
.
hasOwnProperty
.
call
(
path
,
'default'
)
?
path
[
'default'
]
:
path
;
color
=
color
&&
Object
.
prototype
.
hasOwnProperty
.
call
(
color
,
'default'
)
?
color
[
'default'
]
:
color
;
generateUUID
=
generateUUID
&&
Object
.
prototype
.
hasOwnProperty
.
call
(
generateUUID
,
'default'
)
?
generateUUID
[
'default'
]
:
generateUUID
;
hash
=
hash
&&
Object
.
prototype
.
hasOwnProperty
.
call
(
hash
,
'default'
)
?
hash
[
'default'
]
:
hash
;
zlib
=
zlib
&&
Object
.
prototype
.
hasOwnProperty
.
call
(
zlib
,
'default'
)
?
zlib
[
'default'
]
:
zlib
;
/**
* Created by rockyl on 2019-08-09.
...
...
@@ -92,7 +92,7 @@
let
viewRoot
=
{
name
:
path
.
basename
(
psdFile
.
name
,
'.psd'
),
type
:
'node
'
,
componentName
:
'Div
'
,
uuid
:
generateUUID
(),
};
...
...
@@ -105,10 +105,16 @@
await
walkNode
(
tree
,
async
function
(
node
,
parent
)
{
let
{
name
}
=
node
;
const
{
x
,
y
,
width
,
height
,
alpha
,
visible
,
origin
:
{
layer
,
layer
:
{
typeTool
,
solidColor
}}}
=
node
;
const
{
x
,
y
,
width
,
height
,
opacity
,
display
,
origin
:
{
layer
,
layer
:
{
typeTool
,
solidColor
}}}
=
node
;
//console.log('walk node:', name);
let
properties
=
{
width
,
height
,
alpha
,
visible
,
style
:{
width
,
height
,
opacity
,
display
,
},
attrs
:{
},
className
:
""
};
const
isSecondLayer
=
!
parent
.
origin
.
parent
;
...
...
@@ -177,7 +183,7 @@
value
=
0
;
}
}
properties
[
field
]
=
value
;
properties
.
style
[
field
]
=
value
;
}
}
}
...
...
@@ -193,24 +199,33 @@
};
let
dealLater
=
true
;
if
(
x
!==
0
)
{
properties
.
x
=
x
-
(
isSecondLayer
?
offset
.
x
:
0
);
properties
.
style
.
left
=
x
-
(
isSecondLayer
?
offset
.
x
:
0
);
}
if
(
y
!==
0
)
{
properties
.
y
=
y
-
(
isSecondLayer
?
offset
.
y
:
0
);
properties
.
style
.
top
=
y
-
(
isSecondLayer
?
offset
.
y
:
0
);
}
properties
.
style
.
position
=
"absolute"
;
viewNode
.
rect
=
{
x
:
properties
.
style
.
left
?
properties
.
style
.
left
:
0
,
y
:
properties
.
style
.
top
?
properties
.
style
.
top
:
0
,
width
:
properties
.
style
.
width
,
height
:
properties
.
style
.
height
};
if
(
typeTool
)
{
let
fontInfo
=
typeTool
();
properties
.
text
=
fontInfo
.
textValue
;
properties
.
attrs
.
text
=
fontInfo
.
textValue
;
const
sizes
=
fontInfo
.
sizes
();
const
colors
=
fontInfo
.
colors
();
properties
.
size
=
sizes
?
sizes
[
0
]
||
20
:
20
;
properties
.
s
tyle
.
fontS
ize
=
sizes
?
sizes
[
0
]
||
20
:
20
;
let
[
r
,
g
,
b
,
a
]
=
colors
[
0
];
properties
.
fillColor
=
`rgba(
${
r
}
,
${
g
}
,
${
b
}
,
${
a
/
255
}
)`
;
viewNode
.
type
=
'label'
;
console
.
log
(
"color"
,[
r
,
g
,
b
,
a
]);
properties
.
style
.
color
=
`rgba(
${
r
}
,
${
g
}
,
${
b
}
,
${
a
/
255
}
)`
;
viewNode
.
componentName
=
'Label'
;
dealLater
=
false
;
}
else
if
(
solidColor
&&
layer
.
vectorMask
)
{
let
paths
=
layer
.
vectorMask
().
paths
;
if
(
paths
[
2
].
numPoints
===
4
)
{
let
isRect
=
true
;
...
...
@@ -221,9 +236,9 @@
}
}
if
(
isRect
)
{
viewNode
.
type
=
'rect
'
;
viewNode
.
componentName
=
'Div
'
;
const
{
r
,
g
,
b
}
=
solidColor
();
properties
.
fill
Color
=
`rgba(
${
r
}
,
${
g
}
,
${
b
}
, 1)`
;
properties
.
style
.
background
Color
=
`rgba(
${
r
}
,
${
g
}
,
${
b
}
, 1)`
;
dealLater
=
false
;
}
}
...
...
@@ -231,9 +246,9 @@
if
(
dealLater
)
{
if
(
node
.
hasOwnProperty
(
'children'
))
{
viewNode
.
type
=
'node
'
;
viewNode
.
componentName
=
'Div
'
;
}
else
{
viewNode
.
type
=
'i
mage'
;
viewNode
.
componentName
=
'I
mage'
;
let
uuid
=
generateUUID
();
const
ext
=
'.png'
;
...
...
@@ -263,7 +278,7 @@
});
}
properties
.
source
=
'asset://'
+
uuid
;
properties
.
attrs
.
source
=
'asset://'
+
uuid
;
}
}
}
...
...
@@ -276,10 +291,13 @@
node
.
view
=
viewNode
;
});
console
.
log
(
psdFile
);
let
data
=
{
view
:
viewRoot
,
pluginVersion
:
"0.0.1"
,
reference
:
"psd"
,
fileName
:
psdFile
.
name
,
assets
,
view
:
viewRoot
,
};
let
dataString
=
JSON
.
stringify
(
data
);
...
...
@@ -302,5 +320,5 @@
Object
.
defineProperty
(
exports
,
'__esModule'
,
{
value
:
true
});
}));
}))
)
;
//# sourceMappingURL=index.umd.js.map
dist/index.umd.js.map
View file @
81d83998
This diff is collapsed.
Click to expand it.
src/zeroing.js
View file @
81d83998
/**
* Created by r
ockyl on 2019-09-26
.
* Created by r
enjianfeng on 2020-06-11
.
*
* 导出
zeroing
的视图
* 导出
spark
的视图
*/
import
{
getTree
}
from
"./psd-tree"
;
...
...
@@ -33,7 +33,7 @@ export async function execute(psdFile, options) {
let
viewRoot
=
{
name
:
path
.
basename
(
psdFile
.
name
,
'.psd'
),
type
:
'node
'
,
componentName
:
'Div
'
,
uuid
:
generateUUID
(),
};
...
...
@@ -46,15 +46,19 @@ export async function execute(psdFile, options) {
await
walkNode
(
tree
,
async
function
(
node
,
parent
)
{
let
{
name
}
=
node
;
const
{
x
,
y
,
width
,
height
,
alpha
,
visible
,
origin
:
{
layer
,
layer
:
{
typeTool
,
solidColor
}}}
=
node
;
const
{
x
,
y
,
width
,
height
,
opacity
,
display
,
origin
:
{
layer
,
layer
:
{
typeTool
,
solidColor
}}}
=
node
;
//console.log('walk node:', name);
let
properties
=
{
width
,
height
,
alpha
,
visible
,
style
:{
width
,
height
,
opacity
,
display
,
},
attrs
:{
},
className
:
""
};
const
isSecondLayer
=
!
parent
.
origin
.
parent
;
const
{
width
:
parentWidth
,
height
:
parentHeight
}
=
parent
;
if
(
name
.
includes
(
'|'
))
{
try
{
let
arr
=
name
.
split
(
'|'
);
...
...
@@ -120,7 +124,7 @@ export async function execute(psdFile, options) {
value
=
0
;
}
}
properties
[
field
]
=
value
;
properties
.
style
[
field
]
=
value
;
}
}
}
...
...
@@ -136,24 +140,33 @@ export async function execute(psdFile, options) {
};
let
dealLater
=
true
;
if
(
x
!==
0
)
{
properties
.
x
=
x
-
(
isSecondLayer
?
offset
.
x
:
0
);
properties
.
style
.
left
=
x
-
(
isSecondLayer
?
offset
.
x
:
0
);
}
if
(
y
!==
0
)
{
properties
.
y
=
y
-
(
isSecondLayer
?
offset
.
y
:
0
);
properties
.
style
.
top
=
y
-
(
isSecondLayer
?
offset
.
y
:
0
);
}
properties
.
style
.
position
=
"absolute"
viewNode
.
rect
=
{
x
:
properties
.
style
.
left
?
properties
.
style
.
left
:
0
,
y
:
properties
.
style
.
top
?
properties
.
style
.
top
:
0
,
width
:
properties
.
style
.
width
,
height
:
properties
.
style
.
height
}
if
(
typeTool
)
{
let
fontInfo
=
typeTool
();
properties
.
text
=
fontInfo
.
textValue
;
properties
.
attrs
.
text
=
fontInfo
.
textValue
;
const
sizes
=
fontInfo
.
sizes
();
const
colors
=
fontInfo
.
colors
();
properties
.
size
=
sizes
?
sizes
[
0
]
||
20
:
20
;
properties
.
s
tyle
.
fontS
ize
=
sizes
?
sizes
[
0
]
||
20
:
20
;
let
[
r
,
g
,
b
,
a
]
=
colors
[
0
];
properties
.
fillColor
=
`rgba(
${
r
}
,
${
g
}
,
${
b
}
,
${
a
/
255
}
)`
;
viewNode
.
type
=
'label'
;
console
.
log
(
"color"
,[
r
,
g
,
b
,
a
])
properties
.
style
.
color
=
`rgba(
${
r
}
,
${
g
}
,
${
b
}
,
${
a
/
255
}
)`
;
viewNode
.
componentName
=
'Label'
;
dealLater
=
false
;
}
else
if
(
solidColor
&&
layer
.
vectorMask
)
{
let
paths
=
layer
.
vectorMask
().
paths
;
if
(
paths
[
2
].
numPoints
===
4
)
{
let
isRect
=
true
;
...
...
@@ -164,9 +177,9 @@ export async function execute(psdFile, options) {
}
}
if
(
isRect
)
{
viewNode
.
type
=
'rect
'
;
viewNode
.
componentName
=
'Div
'
;
const
{
r
,
g
,
b
}
=
solidColor
();
properties
.
fill
Color
=
`rgba(
${
r
}
,
${
g
}
,
${
b
}
, 1)`
;
properties
.
style
.
background
Color
=
`rgba(
${
r
}
,
${
g
}
,
${
b
}
, 1)`
;
dealLater
=
false
;
}
}
...
...
@@ -174,9 +187,9 @@ export async function execute(psdFile, options) {
if
(
dealLater
)
{
if
(
node
.
hasOwnProperty
(
'children'
))
{
viewNode
.
type
=
'node
'
;
viewNode
.
componentName
=
'Div
'
;
}
else
{
viewNode
.
type
=
'i
mage'
;
viewNode
.
componentName
=
'I
mage'
;
let
uuid
=
generateUUID
();
const
ext
=
'.png'
;
...
...
@@ -206,7 +219,7 @@ export async function execute(psdFile, options) {
});
}
properties
.
source
=
'asset://'
+
uuid
;
properties
.
attrs
.
source
=
'asset://'
+
uuid
;
}
}
}
...
...
@@ -219,10 +232,13 @@ export async function execute(psdFile, options) {
node
.
view
=
viewNode
;
});
console
.
log
(
psdFile
)
let
data
=
{
view
:
viewRoot
,
pluginVersion
:
"0.0.1"
,
reference
:
"psd"
,
fileName
:
psdFile
.
name
,
assets
,
view
:
viewRoot
,
};
let
dataString
=
JSON
.
stringify
(
data
);
...
...
@@ -236,6 +252,6 @@ export async function execute(psdFile, options) {
console
.
log
(
res
.
length
);
resolve
(
res
);
}
})
})
;
})
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment