Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
Falcon
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
Walter Huang
Falcon
Commits
41b63eb9
Commit
41b63eb9
authored
Jun 25, 2025
by
Lin Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: diff buttons
parent
87397639
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
12 deletions
+15
-12
diffWithDeepDiff.ts
src/detect_section_selector_masters/diffWithDeepDiff.ts
+3
-1
handlePageContent.ts
src/detect_section_selector_masters/handlePageContent.ts
+12
-11
No files found.
src/detect_section_selector_masters/diffWithDeepDiff.ts
View file @
41b63eb9
...
...
@@ -31,7 +31,7 @@ const baselinePath = join(srcDir, baselineFile);
const
baselineData
=
JSON
.
parse
(
readFileSync
(
baselinePath
,
'utf-8'
));
// Fields to ignore during diff
const
ignoreFields
=
[
'pageUid'
,
'pageTitle'
,
'id'
];
const
ignoreFields
=
[
'pageUid'
,
'pageTitle'
,
'id'
,
'path'
];
selectedSelectors
.
filter
(
id
=>
Number
(
id
)
!==
baselineId
)
...
...
@@ -57,6 +57,8 @@ selectedSelectors
if
(
typeof
itemIdx
===
'number'
)
{
context
[
selectedLanguages
[
baselineId
]].
id
=
pageA
.
result
?.[
itemIdx
]?.
id
;
context
[
selectedLanguages
[
otherId
]].
id
=
pageB
.
result
?.[
itemIdx
]?.
id
;
context
[
selectedLanguages
[
baselineId
]].
path
=
pageA
.
result
?.[
itemIdx
]?.
path
;
context
[
selectedLanguages
[
otherId
]].
path
=
pageB
.
result
?.[
itemIdx
]?.
path
;
}
}
}
...
...
src/detect_section_selector_masters/handlePageContent.ts
View file @
41b63eb9
...
...
@@ -28,7 +28,7 @@ function handleFullDiffNode(node: any, path: string[], output: any) {
const
getInlineColors
=
extractInlineColors
(
node
.
value
).
join
(
','
);
output
.
result
.
push
({
RichText_type
:
"RichText"
,
RichText_
path
:
path
.
join
(
'.'
),
path
:
path
.
join
(
'.'
),
RichText_color
:
getInlineColors
,
id
:
node
.
id
||
null
});
...
...
@@ -41,7 +41,7 @@ function handleFullDiffNode(node: any, path: string[], output: any) {
items
.
filter
((
btn
:
any
)
=>
btn
.
type
===
"Button"
).
forEach
((
btn
:
any
)
=>
{
output
.
result
.
push
({
Button_type
:
"Button"
,
Button_
path
:
path
.
join
(
'.'
),
path
:
path
.
join
(
'.'
),
Button_color
:
btn
.
color
,
Button_backgroundSettings
:
btn
.
backgroundSettings
||
{},
id
:
btn
.
id
||
null
...
...
@@ -53,7 +53,7 @@ function handleFullDiffNode(node: any, path: string[], output: any) {
if
(
node
.
type
===
"Button"
)
{
output
.
result
.
push
({
Button_type
:
"Button"
,
Button_
path
:
path
.
join
(
'.'
),
path
:
path
.
join
(
'.'
),
Button_color
:
node
.
color
,
Button_backgroundSettings
:
node
.
backgroundSettings
||
{},
id
:
node
.
id
||
null
...
...
@@ -63,7 +63,7 @@ function handleFullDiffNode(node: any, path: string[], output: any) {
if
(
node
.
type
===
"SlideSettings"
&&
node
.
layout_config
?.
hasOwnProperty
(
"card"
))
{
output
.
result
.
push
({
featureList_type
:
'SlideSettings.layout_config.card'
,
featureList_
path
:
path
.
join
(
'.'
),
path
:
path
.
join
(
'.'
),
featureList_card
:
node
.
layout_config
.
card
,
featureList_card_color
:
node
.
layout_config
.
card_color
,
featureList_border
:
node
.
layout_config
.
border
,
...
...
@@ -82,14 +82,14 @@ function handleFullDiffNode(node: any, path: string[], output: any) {
output
.
result
.
push
({
Background_textColor_type
:
"Background.textColor"
,
Background_textColor
:
node
.
textColor
||
''
,
Background_textColor_
path
:
path
.
join
(
"."
),
path
:
path
.
join
(
"."
),
id
:
node
.
id
||
null
,
Background_textColor_note
:
"The background is image"
,
})
}
else
if
(
useVideo
)
{
output
.
result
.
push
({
Background_video_type
:
"Background.videoHtml"
,
Background_video_
path
:
path
.
join
(
"."
),
path
:
path
.
join
(
"."
),
id
:
node
.
id
||
null
,
Background_video_note
:
"The background is video"
,
})
...
...
@@ -97,7 +97,7 @@ function handleFullDiffNode(node: any, path: string[], output: any) {
output
.
result
.
push
({
Background_color_type
:
"BackgroundColor"
,
Background_color
:
node
.
backgroundColor
?.
value
||
''
,
Background_color_
path
:
path
.
join
(
"."
),
path
:
path
.
join
(
"."
),
id
:
node
.
id
||
null
,
Background_color_note
:
"The background is background color"
,
})
...
...
@@ -508,10 +508,11 @@ function parseJsonForStyles(
// 遍历子节点
if
(
node
.
components
&&
node
.
type
!==
"Buttons"
)
{
// Only traverse individual Button when no Buttons group is present
let
componentKeys
=
Object
.
keys
(
node
.
components
);
if
(
componentKeys
.
includes
(
'buttons'
)
&&
componentKeys
.
includes
(
'button1'
))
{
componentKeys
=
componentKeys
.
filter
(
k
=>
k
!==
'button1'
);
}
let
componentKeys
=
Object
.
keys
(
node
.
components
)
// skip 'button1' when 'buttons' group is present
.
filter
(
k
=>
!
(
k
===
'button1'
&&
node
.
components
.
buttons
))
// sort keys for deterministic traversal order
.
sort
();
componentKeys
.
forEach
((
key
)
=>
{
const
child
=
node
.
components
[
key
];
traverse
(
child
,
[...
path
,
`components.
${
key
}
`
]);
...
...
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