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
2c07fbd0
Commit
2c07fbd0
authored
Jun 25, 2025
by
Lin Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: handle the buttons type
parent
9f3e0c39
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
3 deletions
+20
-3
handlePageContent.ts
src/detect_section_selector_masters/handlePageContent.ts
+20
-3
No files found.
src/detect_section_selector_masters/handlePageContent.ts
View file @
2c07fbd0
...
@@ -27,7 +27,7 @@ function handleFullDiffNode(node: any, path: string[], output: any) {
...
@@ -27,7 +27,7 @@ function handleFullDiffNode(node: any, path: string[], output: any) {
if
(
node
.
type
===
"RichText"
)
{
if
(
node
.
type
===
"RichText"
)
{
const
getInlineColors
=
extractInlineColors
(
node
.
value
);
const
getInlineColors
=
extractInlineColors
(
node
.
value
);
output
.
result
.
push
({
output
.
result
.
push
({
type
:
'RichText'
,
type
:
"RichText"
,
path
:
path
.
join
(
'.'
),
path
:
path
.
join
(
'.'
),
inlineColors
:
getInlineColors
,
inlineColors
:
getInlineColors
,
id
:
node
.
id
||
null
id
:
node
.
id
||
null
...
@@ -40,7 +40,7 @@ function handleFullDiffNode(node: any, path: string[], output: any) {
...
@@ -40,7 +40,7 @@ function handleFullDiffNode(node: any, path: string[], output: any) {
const
items
=
node
.
components
.
block1
?.
items
||
[];
const
items
=
node
.
components
.
block1
?.
items
||
[];
items
.
filter
((
btn
:
any
)
=>
btn
.
type
===
"Button"
).
forEach
((
btn
:
any
)
=>
{
items
.
filter
((
btn
:
any
)
=>
btn
.
type
===
"Button"
).
forEach
((
btn
:
any
)
=>
{
output
.
result
.
push
({
output
.
result
.
push
({
type
:
'Button'
,
type
:
"Button"
,
path
:
path
.
join
(
'.'
),
path
:
path
.
join
(
'.'
),
color
:
btn
.
color
,
color
:
btn
.
color
,
backgroundSettings
:
btn
.
backgroundSettings
||
{},
backgroundSettings
:
btn
.
backgroundSettings
||
{},
...
@@ -52,7 +52,7 @@ function handleFullDiffNode(node: any, path: string[], output: any) {
...
@@ -52,7 +52,7 @@ function handleFullDiffNode(node: any, path: string[], output: any) {
// 检查当前节点是否为 Button
// 检查当前节点是否为 Button
if
(
node
.
type
===
"Button"
)
{
if
(
node
.
type
===
"Button"
)
{
output
.
result
.
push
({
output
.
result
.
push
({
type
:
'Button'
,
type
:
"Button"
,
path
:
path
.
join
(
'.'
),
path
:
path
.
join
(
'.'
),
color
:
node
.
color
,
color
:
node
.
color
,
backgroundSettings
:
node
.
backgroundSettings
||
{},
backgroundSettings
:
node
.
backgroundSettings
||
{},
...
@@ -434,6 +434,23 @@ function handlePartialDiffAndFix(node: any, path: string[], output: any, { secti
...
@@ -434,6 +434,23 @@ function handlePartialDiffAndFix(node: any, path: string[], output: any, { secti
}
}
}
}
// 检查当前节点是否为 Buttons,并将其内部每个 Button 当成独立 Button 处理
if
(
node
.
type
===
"Buttons"
)
{
// 直接获取 block1 下的 items 数组
const
items
=
node
.
components
.
block1
?.
items
||
[];
items
.
filter
((
btn
:
any
)
=>
btn
.
type
===
"Button"
).
forEach
((
btn
:
any
)
=>
{
if
((
btn
.
color
||
(
!
btn
.
color
&&
btn
.
hasOwnProperty
(
"backgroundSettings"
)))
&&
!
btn
.
backgroundSettings
?.
type
)
{
output
.
result
.
push
({
parentType
:
"Buttons"
,
type
:
"Button"
,
path
:
path
.
join
(
"."
),
id
:
btn
.
id
||
null
,
note
:
"The Button doesn't selected any option, like 'Use Default'、'Custom Color' or 'preset color'."
,
});
}
});
}
// 检查当前节点是否为 Button
// 检查当前节点是否为 Button
if
(
node
.
type
===
"Button"
)
{
if
(
node
.
type
===
"Button"
)
{
if
((
node
.
color
||
(
!
node
.
color
&&
node
.
hasOwnProperty
(
"backgroundSettings"
)))
&&
!
node
.
backgroundSettings
?.
type
)
{
if
((
node
.
color
||
(
!
node
.
color
&&
node
.
hasOwnProperty
(
"backgroundSettings"
)))
&&
!
node
.
backgroundSettings
?.
type
)
{
...
...
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