Skip to content

[Story] Developer can style content types output differently per viewport #621

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 216 commits into from
Oct 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
216 commits
Select commit Hold shift + click to select a range
f06ee81
Implement inline styles conversion
omiroshnichenko Aug 27, 2020
cea60b0
Implement inline styles conversion
omiroshnichenko Aug 27, 2020
30eeef6
Implement inline styles conversion
omiroshnichenko Aug 27, 2020
91c59fb
magento/magento2-page-builder#558: Content Types Output Style Attribu…
bluemwhitew Aug 27, 2020
2f5e019
magento/magento2-page-builder#558: Content Types Output Style Attribu…
bluemwhitew Aug 27, 2020
90f7518
magento/magento2-page-builder#558: Content Types Output Style Attribu…
bluemwhitew Aug 27, 2020
0a44f7d
Implement inline styles conversion
omiroshnichenko Aug 28, 2020
5235ed5
Implement inline styles conversion
omiroshnichenko Aug 28, 2020
3dffe71
magento/magento2-page-builder#558: Content Types Output Style Attribu…
bluemwhitew Sep 9, 2020
3790cc3
magento/magento2-page-builder#558: Content Types Output Style Attribu…
bluemwhitew Sep 9, 2020
26ccd06
Implement inline styles conversion
omiroshnichenko Sep 9, 2020
1593f34
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 10, 2020
add184c
#558: Developer can style content types output differently per viewpo…
Sep 10, 2020
7666ea9
#558: Developer can style content types output differently per viewpo…
Sep 10, 2020
e923aa9
#558: Developer can style content types output differently per viewpo…
Sep 10, 2020
1e7b674
magento/magento2-page-builder#558: Content Types Output Style Attribu…
bluemwhitew Sep 10, 2020
12fe2e6
magento/magento2-page-builder#558: Content Types Output Style Attribu…
bluemwhitew Sep 10, 2020
1d127c4
#512: User edits cms block content in full-screen mode only - fix Pag…
Sep 11, 2020
bad3b77
#512: User edits cms block content in full-screen mode only - fix Pag…
Sep 11, 2020
5640327
#512: User edits cms block content in full-screen mode only - added f…
Sep 11, 2020
465936a
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 11, 2020
2e1674b
Merge branch '558_7_content-type-style-attribute-removal' of magento/…
hannahnida Sep 11, 2020
f771318
#512: User edits cms block content in full-screen mode only - added f…
Sep 11, 2020
b94c54c
Merge branch '558_7_content-type-style-attribute-removal' of github.c…
Sep 11, 2020
519f2ce
#512: User edits cms block content in full-screen mode only - added f…
Sep 14, 2020
3500da3
#512: User edits cms block content in full-screen mode only - added f…
Sep 14, 2020
e2a67b5
#512: User edits cms block content in full-screen mode only - added f…
Sep 14, 2020
f2b8ee1
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 14, 2020
1ca1c45
Merge branch '558_7_content-type-style-attribute-removal' of magento/…
hannahnida Sep 14, 2020
30ffcdb
magento/magento2-page-builder#558: Content Types Output Style Attribu…
bluemwhitew Sep 14, 2020
b293714
magento/magento2-page-builder#558: Content Types Output Style Attribu…
bluemwhitew Sep 14, 2020
f50a767
magento/magento2-page-builder#558: Content Types Output Style Attribu…
bluemwhitew Sep 14, 2020
c5f9154
magento/magento2-page-builder#558: Content Types Output Style Attribu…
bluemwhitew Sep 14, 2020
ad244d7
magento/magento2-page-builder#558: Content Types Output Style Attribu…
bluemwhitew Sep 15, 2020
4527f1e
magento/magento2-page-builder#558: Content Types Output Style Attribu…
bluemwhitew Sep 15, 2020
d25d73b
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 15, 2020
c6383f6
magento/magento2-page-builder#558: Content Types Output Style Attribu…
bluemwhitew Sep 15, 2020
a087265
#512: User edits cms block content in full-screen mode only - added f…
Sep 15, 2020
2c67267
Merge branch '558_7_content-type-style-attribute-removal' of github.c…
Sep 15, 2020
d4037da
#512: User edits cms block content in full-screen mode only - added f…
Sep 15, 2020
8c4f92b
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 15, 2020
341fc5f
Merge branch '558_7_content-type-style-attribute-removal' of magento/…
hannahnida Sep 15, 2020
a190d47
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 15, 2020
7588742
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 16, 2020
9ffe82c
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 16, 2020
6e92e05
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 16, 2020
d8f38ec
#512: User edits cms block content in full-screen mode only - added f…
Sep 16, 2020
94f1937
Merge branch '558_7_content-type-style-attribute-removal' of github.c…
Sep 16, 2020
e045144
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 16, 2020
12508e1
Merge branch '558_7_content-type-style-attribute-removal' of magento/…
hannahnida Sep 16, 2020
d38e03a
#558: Developer can style content types output differently per viewpo…
Sep 16, 2020
6beba6e
Merge branch '558_7_content-type-style-attribute-removal' of github.c…
Sep 16, 2020
6f9b933
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 16, 2020
2a3913b
Merge branch '558_7_content-type-style-attribute-removal' of magento/…
hannahnida Sep 16, 2020
d3bf58c
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 17, 2020
0845fda
#558: Developer can style content types output differently per viewpo…
Sep 17, 2020
adf748c
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 17, 2020
6f5e9e5
#558: Developer can style content types output differently per viewpo…
Sep 17, 2020
dda24fd
Merge branch '558_7_content-type-style-attribute-removal' of github.c…
Sep 17, 2020
8fa5415
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 17, 2020
5019e70
Merge branch '558_7_content-type-style-attribute-removal' of magento/…
hannahnida Sep 17, 2020
099cbe4
#558: Developer can style content types output differently per viewpo…
Sep 17, 2020
1a7e998
Merge branch '558_7_content-type-style-attribute-removal' of github.c…
Sep 17, 2020
033610c
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 17, 2020
d0de4d6
Merge branch '558_7_content-type-style-attribute-removal' of magento/…
hannahnida Sep 17, 2020
91394ca
#558: Developer can style content types output differently per viewpo…
Sep 17, 2020
834c178
Merge branch '558_7_content-type-style-attribute-removal' of github.c…
Sep 17, 2020
2f735ff
#558: Developer can style content types output differently per viewpo…
Sep 17, 2020
ac32a27
Merge branch 'csso-alternative' of github.com:magento/magento2-page-b…
omiroshnichenko Sep 17, 2020
3f1a669
magento/magento2-page-builder#558: Content Types Output Style Attribu…
omiroshnichenko Sep 17, 2020
dd198b1
magento/magento2-page-builder#558: Developer can style content types …
omiroshnichenko Sep 17, 2020
bebd78d
Merge branch 'develop' into csso-alternative
omiroshnichenko Sep 17, 2020
0df55d3
#558: Developer can style content types output differently per viewpo…
Sep 18, 2020
0ad829d
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 18, 2020
835bc6f
Merge branch '558_7_content-type-style-attribute-removal' of magento/…
hannahnida Sep 18, 2020
da1d78a
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 18, 2020
0a20b11
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 18, 2020
368d6fa
magento/magento2-page-builder#558: Content Types Output Style Attribu…
bluemwhitew Sep 21, 2020
a7ef850
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 21, 2020
a84e13b
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 21, 2020
5986421
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 21, 2020
06413f4
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 21, 2020
6ebd897
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 21, 2020
f01e927
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 21, 2020
9ebf618
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 21, 2020
e304bc8
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 21, 2020
016a421
#558: Developer can style content types output differently per viewpo…
Sep 21, 2020
275a918
Merge branch '558_7_content-type-style-attribute-removal' of github.c…
Sep 21, 2020
cdf6598
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 21, 2020
b90e33a
Merge branch '558_7_content-type-style-attribute-removal' of magento/…
hannahnida Sep 21, 2020
7079c53
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 21, 2020
fe069ed
magento/magento2-page-builder#558: Content Types Output Style Attribu…
bluemwhitew Sep 21, 2020
60343e5
Merge from `558_1_content-type-style-attribute-removal`
bluemwhitew Sep 21, 2020
043b358
magento/magento2-page-builder#558: Content Types Output Style Attribu…
bluemwhitew Sep 21, 2020
f88405d
magento/magento2-page-builder#558: Content Types Output Style Attribu…
bluemwhitew Sep 21, 2020
b2661d9
magento/magento2-page-builder#558: Content Types Output Style Attribu…
bluemwhitew Sep 22, 2020
1913e25
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 22, 2020
90d5d65
Merge branch '558_7_content-type-style-attribute-removal' of magento/…
hannahnida Sep 22, 2020
affbdf8
Merge branch 'csso-alternative' of magento/magento2-page-builder into…
hannahnida Sep 22, 2020
6276a69
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 22, 2020
6919d9b
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 22, 2020
69850db
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 22, 2020
0c3aa56
magento/magento2-page-builder#558: Content Types Output Style Attribu…
bluemwhitew Sep 22, 2020
b7557b4
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 22, 2020
5f336c4
magento/magento2-page-builder#558: Developer can style content types …
omiroshnichenko Sep 22, 2020
360b16b
magento/magento2-page-builder#558: Developer can style content types …
omiroshnichenko Sep 22, 2020
e73f2f6
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 23, 2020
b702259
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 23, 2020
6c6247a
Merge branch '558_7_content-type-style-attribute-removal' of magento/…
hannahnida Sep 23, 2020
08ce3d8
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 23, 2020
b0d8283
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 23, 2020
b3d74ca
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 23, 2020
9d9c94a
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 23, 2020
ec90886
magento/magento2-page-builder#558: Developer can style content types …
omiroshnichenko Sep 23, 2020
e878298
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 24, 2020
d5aa130
Merge branch '558_7_content-type-style-attribute-removal' of magento/…
hannahnida Sep 24, 2020
495bdbc
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 24, 2020
a4cf53c
magento/magento2-page-builder#558: Developer can style content types …
omiroshnichenko Sep 24, 2020
54816c7
magento/magento2-page-builder#558: Developer can style content types …
omiroshnichenko Sep 24, 2020
4e53b46
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 25, 2020
ccb7bf9
Merge branch '558_7_content-type-style-attribute-removal' of magento/…
hannahnida Sep 25, 2020
4a26db2
Merge branch 'develop' into csso-alternative
omiroshnichenko Sep 25, 2020
3ae0918
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 25, 2020
f1521bf
Merge branch 'csso-alternative' of magento/magento2-page-builder into…
hannahnida Sep 25, 2020
b3b12fc
magento/magento2-page-builder#558: Developer can style content types …
omiroshnichenko Sep 25, 2020
97ba1e1
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 28, 2020
70d3947
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 28, 2020
2d5dfd7
Merge from `csso-alternative`
bluemwhitew Sep 28, 2020
2d7d79d
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 28, 2020
e23d357
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 28, 2020
87984da
Merge pull request #623 from magento/558_1_content-type-style-attribu…
omiroshnichenko Sep 28, 2020
d03be4c
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 29, 2020
0b2027d
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 29, 2020
75fd2e2
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 29, 2020
315b79f
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 30, 2020
692c79e
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Sep 30, 2020
384d21e
magento/magento2-page-builder#558: Developer can style content types …
omiroshnichenko Sep 30, 2020
48c27e4
magento/magento2-page-builder#558: Developer can style content types …
omiroshnichenko Sep 30, 2020
33c7315
Merge branch '558_7_content-type-style-attribute-removal' of magento/…
hannahnida Oct 1, 2020
5ff3f0e
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Oct 1, 2020
41d0380
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Oct 1, 2020
eb2466b
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Oct 1, 2020
311e5eb
magento/magento2-page-builder#558: Developer can style content types …
omiroshnichenko Oct 1, 2020
4119df8
magento/magento2-page-builder#558: Content Types Output Style Attribu…
bluemwhitew Oct 1, 2020
b289592
Merge from `558_7_content-type-style-attribute-removal`
bluemwhitew Oct 1, 2020
e71e0bc
Testing Repository Permissions
bluemwhitew Oct 2, 2020
bd2a4b6
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Oct 2, 2020
47befcc
magento/magento2-page-builder#558: Content Types Output Style Attribu…
bluemwhitew Oct 2, 2020
e0c97ea
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Oct 2, 2020
8223496
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Oct 2, 2020
af554e4
magento/magento2-page-builder#558: Content Types Output Style Attribu…
bluemwhitew Oct 2, 2020
0674c0e
magento/magento2-page-builder#558: Content Types Output Style Attribu…
bluemwhitew Oct 2, 2020
db3118f
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Oct 5, 2020
4155a3e
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Oct 5, 2020
25eb396
Merge branch 'develop' into 558_7_content-type-style-attribute-removal
petrovsa Oct 8, 2020
a96c673
Changed names of groups, references on groups, added discription to n…
petrovsa Oct 8, 2020
1208f02
magento/magento2-page-builder#558: Developer can style content types …
petrovsa Oct 8, 2020
d38e3ee
magento/magento2-page-builder#558: Developer can style content types …
petrovsa Oct 9, 2020
6aa7d04
magento/magento2-page-builder#558: Developer can style content types …
petrovsa Oct 12, 2020
ea104a1
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Oct 12, 2020
ce5edc5
Merge branch '558_7_content-type-style-attribute-removal' of magento/…
hannahnida Oct 12, 2020
44f4e36
magento/magento2-page-builder#558: Developer can style content types …
hannahnida Oct 12, 2020
a943edb
magento/magento2-page-builder#558: Developer can style content types …
petrovsa Oct 13, 2020
63d3be1
Merge remote-tracking branch 'origin/558_7_content-type-style-attribu…
petrovsa Oct 13, 2020
e4e69b2
magento/magento2-page-builder#558: Developer can style content types …
petrovsa Oct 13, 2020
b691764
magento/magento2-page-builder#558: Developer can style content types …
petrovsa Oct 13, 2020
dbb18a7
magento/magento2-page-builder#558: Developer can style content types …
petrovsa Oct 13, 2020
17dc93f
magento/magento2-page-builder#558: Developer can style content types …
Oct 14, 2020
9f7910c
magento/magento2-page-builder#558: Developer can style content types …
Oct 14, 2020
0372e44
Merge pull request #1 from petrovsa/558_7_content-type-style-attribut…
hannahnida Oct 14, 2020
2290758
magento/magento2-page-builder#558: Developer can style content types …
Oct 14, 2020
87db6f8
Merge branch '558_7_content-type-style-attribute-removal' of github:h…
Oct 14, 2020
1a981c5
magento/magento2-page-builder#558: Developer can style content types …
Oct 14, 2020
98ffb69
magento/magento2-page-builder#558: Developer can style content types …
Oct 14, 2020
27ed05d
magento/magento2-page-builder#558: Developer can style content types …
Oct 14, 2020
34cdc5b
magento/magento2-page-builder#558: Developer can style content types …
Oct 15, 2020
c5327f6
magento/magento2-page-builder#558: Developer can style content types …
Oct 15, 2020
8c8739d
magento/magento2-page-builder#558: Developer can style content types …
petrovsa Oct 15, 2020
07fce5c
Merge remote-tracking branch 'origin/558_7_content-type-style-attribu…
petrovsa Oct 15, 2020
4c47ee4
magento/magento2-page-builder#558: Developer can style content types …
Oct 15, 2020
8a48ba1
Merge branch '558_7_content-type-style-attribute-removal' of hannahni…
Oct 15, 2020
81c2f87
magento/magento2-page-builder#558: Developer can style content types …
petrovsa Oct 15, 2020
430f9dd
magento/magento2-page-builder#558: Developer can style content types …
Oct 15, 2020
cfd6fdf
magento/magento2-page-builder#558: Developer can style content types …
petrovsa Oct 15, 2020
87f82b9
Merge branch '558_7_content-type-style-attribute-removal' of hannahni…
Oct 15, 2020
20a1ef3
Merge branch '558_7_content-type-style-attribute-removal' of hannahni…
Oct 15, 2020
95be745
magento/magento2-page-builder#558: Developer can style content types …
petrovsa Oct 15, 2020
f770475
Merge remote-tracking branch 'origin/558_7_content-type-style-attribu…
petrovsa Oct 15, 2020
da29659
magento/magento2-page-builder#558: Developer can style content types …
Oct 15, 2020
fbb9f8a
Merge branch '558_7_content-type-style-attribute-removal' of hannahni…
Oct 15, 2020
2150254
magento/magento2-page-builder#558: Developer can style content types …
petrovsa Oct 15, 2020
d087352
Merge remote-tracking branch 'origin/558_7_content-type-style-attribu…
petrovsa Oct 15, 2020
47bc784
magento/magento2-page-builder#558: Developer can style content types …
Oct 15, 2020
96d00fc
magento/magento2-page-builder#558: Developer can style content types …
petrovsa Oct 15, 2020
5b0016c
magento/magento2-page-builder#558: Developer can style content types …
Oct 15, 2020
c6866e0
Merge branch '558_7_content-type-style-attribute-removal' of hannahni…
Oct 15, 2020
18e9038
magento/magento2-page-builder#558: Developer can style content types …
Oct 15, 2020
301e5ce
magento/magento2-page-builder#558: Developer can style content types …
petrovsa Oct 16, 2020
6725818
magento/magento2-page-builder#558: Developer can style content types …
petrovsa Oct 16, 2020
6bd9471
magento/magento2-page-builder#558: Developer can style content types …
Oct 16, 2020
af675f6
magento/magento2-page-builder#558: Developer can style content types …
Oct 16, 2020
d338133
magento/magento2-page-builder#558: Developer can style content types …
Oct 16, 2020
13571cc
magento/magento2-page-builder#558: Developer can style content types …
petrovsa Oct 16, 2020
4053222
Merge branch 'develop' of github.com:magento/magento2-page-builder in…
omiroshnichenko Oct 19, 2020
aa85ff6
magento/magento2-page-builder#558: Developer can style content types…
omiroshnichenko Oct 19, 2020
92f4437
Merge pull request #2 from hannahnida/fix_unit_test
omiroshnichenko Oct 19, 2020
b0a71e6
magento/magento2-page-builder#558: Developer can style content types …
omiroshnichenko Oct 19, 2020
88e60f3
Merge pull request #651 from hannahnida/558_7_content-type-style-attr…
omiroshnichenko Oct 19, 2020
b730f27
magento/magento2-page-builder#558: Content Types Output Style Attribu…
bluemwhitew Oct 20, 2020
e40ceb0
magento/magento2-page-builder#558: Content Types Output Style Attribu…
bluemwhitew Oct 20, 2020
f5e2db7
magento/magento2-page-builder#558: Content Types Output Style Attribu…
bluemwhitew Oct 20, 2020
cb24d11
magento/magento2-page-builder#558: Developer can style content types…
omiroshnichenko Oct 20, 2020
577f293
Merge branch 'csso-alternative' of github.com:magento/magento2-page-b…
omiroshnichenko Oct 20, 2020
84c53ae
magento/magento2-page-builder#558: Content Types Output Style Attribu…
omiroshnichenko Oct 20, 2020
a242097
magento/magento2-page-builder#558: Content Types Output Style Attribu…
omiroshnichenko Oct 20, 2020
2b3b263
Merge pull request #656 from bluemwhitew/558_extending-mftf-tests
omiroshnichenko Oct 21, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ public function __toString(): string;
*/
public function createDocumentFragment(): DocumentFragmentInterface;

/**
* Create new document element
*
* @param string $name
* @param string $value [optional]
* @return ElementInterface
*/
public function createElement(string $name, string $value = null);

/**
* Returns the first element matching the specified selector.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,28 @@

namespace Magento\PageBuilder\Model\Dom\Adapter;

use Gt\Dom\Element as GtDomElement;

/**
* Interface for Element wrappers
*/
interface ElementInterface
{
/**
* Return original element.
*
* @return GtDomElement
*/
public function getOriginalElement(): GtDomElement;

/**
* Adds new child at the end of the children.
*
* @param ElementInterface $element
* @return ElementInterface
*/
public function appendChild(ElementInterface $element): ElementInterface;

/**
* Returns true if the element would be selected by the specified selector string; otherwise, returns false.
*
Expand Down Expand Up @@ -45,6 +62,14 @@ public function closest(string $selectors): ?ElementInterface;
*/
public function getAttribute($name): ?string;

/**
* Removes the Specified Attribute
*
* @param string $name
* @return bool|null
*/
public function removeAttribute($name): ?bool;

/**
* Sets the value of the specified attribute
*
Expand Down
11 changes: 11 additions & 0 deletions app/code/Magento/PageBuilder/Model/Dom/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,17 @@ public function createDocumentFragment(): DocumentFragmentInterface
);
}

/**
* @inheritDoc
*/
public function createElement(string $name, string $value = null): ElementInterface
{
return $this->objectManager->create(
ElementInterface::class,
[ 'element' => $this->document->createElement($name, $value) ]
);
}

/**
* @inheritDoc
*/
Expand Down
27 changes: 27 additions & 0 deletions app/code/Magento/PageBuilder/Model/Dom/Element.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,25 @@ public function __construct(
$this->element = $element;
}

/**
* @inheritDoc
*/
public function getOriginalElement(): GtDomElement
{
return $this->element;
}

/**
* @inheritDoc
*/
public function appendChild(ElementInterface $element): ElementInterface
{
return $this->objectManager->create(
ElementInterface::class,
[ 'element' => $this->element->appendChild($element->getOriginalElement()) ]
);
}

/**
* @inheritDoc
*/
Expand Down Expand Up @@ -79,6 +98,14 @@ public function getAttribute($name): ?string
return $this->element->getAttribute($name);
}

/**
* @inheritDoc
*/
public function removeAttribute($name): ?bool
{
return $this->element->removeAttribute($name);
}

/**
* @inheritDoc
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

declare(strict_types = 1);

namespace Magento\PageBuilder\Setup\Converters;

use Magento\Framework\DB\DataConverter\DataConverterInterface;
use Magento\PageBuilder\Model\Dom\Adapter\ElementInterface;
use Magento\PageBuilder\Model\Dom\HtmlDocumentFactory;

/**
* Convert Inline Styles to Internal
*/
class PageBuilderStripStyles implements DataConverterInterface
{
private const BODY_ID = 'html-body';
private const DATA_ATTRIBUTE = 'data-pb-style';
private const QUERY_SELECTOR = '[style]';

/**
* @var HtmlDocumentFactory
*/
private $htmlDocumentFactory;

/**
* @param HtmlDocumentFactory $htmlDocumentFactory
*/
public function __construct(HtmlDocumentFactory $htmlDocumentFactory)
{
$this->htmlDocumentFactory = $htmlDocumentFactory;
}

/**
* Generates `mageUtils.uniqueid()` Naming Convention
*
* @return string
*/
private function generateDataAttribute(): string
{
return \strtoupper(\uniqid());
}

/**
* Converts Inline Styles to Internal Styles
*
* @param array $styleMap
* @return string
*/
private function generateInternalStyles(array $styleMap): string
{
$output = '';

foreach ($styleMap as $selector => $styles) {
$output .= '#' . self::BODY_ID . ' [' . self::DATA_ATTRIBUTE . '="' . $selector . '"]';
$output .= '{' . $styles . '}';
}

return $output;
}

/**
* @inheritDoc
*/
public function convert($value): string
{
$document = $this->htmlDocumentFactory->create([ 'document' => $value ]);
$body = $document->querySelector('body');
$nodes = $document->querySelectorAll(self::QUERY_SELECTOR);

if ($nodes->count() > 0) {
$styleMap = [];

foreach ($nodes as $node) {
/* @var ElementInterface $node */
$styleAttr = $node->getAttribute('style');

if ($styleAttr) {
$generatedDataAttribute = $this->generateDataAttribute();
$node->setAttribute(self::DATA_ATTRIBUTE, $generatedDataAttribute);
$styleMap[$generatedDataAttribute] = $styleAttr; // Amend Array for Internal Style Generation
$node->removeAttribute('style');
}
}

if (count($styleMap) > 0) {
// Style Block Generation
$style = $document->createElement(
'style',
$this->generateInternalStyles($styleMap)
);
$body->appendChild($style);

return $document->stripHtmlWrapperTags();
} else {
return $value;
}
}

return $value;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

declare(strict_types = 1);

namespace Magento\PageBuilder\Setup\Patch\Data;

use Magento\Framework\DB\FieldDataConversionException;
use Magento\Framework\Setup\Patch\DataPatchInterface;
use Magento\PageBuilder\Setup\Converters\PageBuilderStripStyles;
use Magento\PageBuilder\Setup\UpgradeContentHelper;

/**
* Patch Upgrade Mechanism for Converting Inline Styles to Internal
*/
class UpgradePageBuilderStripStyles implements DataPatchInterface
{
/**
* @var UpgradeContentHelper
*/
private $helper;

/**
* @param UpgradeContentHelper $helper
*/
public function __construct(UpgradeContentHelper $helper)
{
$this->helper = $helper;
}

/**
* Upgrade
*
* @return void
* @throws FieldDataConversionException
*/
public function apply(): void
{
$this->helper->upgrade([
PageBuilderStripStyles::class
]);
}

/**
* @inheritdoc
*/
public function getAliases(): array
{
return [];
}

/**
* @inheritdoc
*/
public static function getDependencies(): array
{
return [];
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="ValidateAdvancedConfigurationAllOptionsActionGroup">
<annotations>
<description value="Validates styles from Advanced configuration in content type settings"/>
</annotations>
<arguments>
<argument name="page" defaultValue=""/>
<argument name="alignment" defaultValue="PageBuilderAdvancedAlignmentPropertyDefault"/>
<argument name="border" defaultValue="PageBuilderAdvancedBorderPropertyNone"/>
<argument name="borderColor" defaultValue=""/>
<argument name="borderWidth" defaultValue="PageBuilderAdvancedBorderWidthPropertyDefault"/>
<argument name="borderRadius" defaultValue="PageBuilderAdvancedBorderRadiusDefaultProperty"/>
<argument name="cssClasses" defaultValue=""/>
<argument name="margin" defaultValue="PageBuilderMarginsPropertyDefault"/>
<argument name="padding" defaultValue="PageBuilderPaddingPropertyDefault"/>
<argument name="index" defaultValue="1" type="string"/>
</arguments>
<waitForElementVisible selector="{{page.base(index)}}" stepKey="waitForElementVisible"/>
<executeJS function="return window.getComputedStyle(document.evaluate('{{page.advancedConfigurationPath(index)}}', document.body).iterateNext()).textAlign" stepKey="grabAlignmentValue"/>
<assertEquals stepKey="assertAlignment">
<expectedResult type="string">{{alignment.value}}</expectedResult>
<actualResult type="variable">grabAlignmentValue</actualResult>
</assertEquals>
<executeJS function="return window.getComputedStyle(document.evaluate('{{page.advancedConfigurationPath(index)}}', document.body).iterateNext()).borderStyle" stepKey="grabBorderStyleValue"/>
<assertEquals stepKey="assertBorderStyle">
<expectedResult type="string">{{border.value}}</expectedResult>
<actualResult type="variable">grabBorderStyleValue</actualResult>
</assertEquals>
<executeJS function="return window.getComputedStyle(document.evaluate('{{page.advancedConfigurationPath(index)}}', document.body).iterateNext()).borderColor" stepKey="grabBorderColorValue"/>
<assertEquals stepKey="assertBorderColor">
<expectedResult type="string">{{borderColor.rgb}}</expectedResult>
<actualResult type="variable">grabBorderColorValue</actualResult>
</assertEquals>
<executeJS function="return window.getComputedStyle(document.evaluate('{{page.advancedConfigurationPath(index)}}', document.body).iterateNext()).borderWidth.replace(&quot;px&quot;, &quot;&quot;)" stepKey="grabBorderWidthValue"/>
<assertEquals stepKey="assertBorderWidth">
<expectedResult type="string">{{borderWidth.value}}</expectedResult>
<actualResult type="variable">grabBorderWidthValue</actualResult>
</assertEquals>
<executeJS function="return window.getComputedStyle(document.evaluate('{{page.advancedConfigurationPath(index)}}', document.body).iterateNext()).borderRadius.replace(/px/g, &quot;&quot;)" stepKey="grabBorderRadiusValue"/>
<assertEquals stepKey="assertBorderRadius">
<expectedResult type="string">{{borderRadius.value}}</expectedResult>
<actualResult type="variable">grabBorderRadiusValue</actualResult>
</assertEquals>
<waitForElementVisible selector="{{page.cssClasses(index, cssClasses.value)}}" stepKey="waitForCSSClassesVisible"/>
<executeJS function="return window.getComputedStyle(document.evaluate('{{page.advancedConfigurationPath(index)}}', document.body).iterateNext()).margin.replace(/px/g, &quot;&quot;)" stepKey="grabMarginValue"/>
<assertEquals stepKey="assertMargin">
<expectedResult type="string">{{margin.value}}</expectedResult>
<actualResult type="variable">grabMarginValue</actualResult>
</assertEquals>
<executeJS function="return window.getComputedStyle(document.evaluate('{{page.advancedConfigurationPath(index)}}', document.body).iterateNext()).padding.replace(/px/g, &quot;&quot;)" stepKey="grabPaddingValue"/>
<assertEquals stepKey="assertPadding">
<expectedResult type="string">{{padding.value}}</expectedResult>
<actualResult type="variable">grabPaddingValue</actualResult>
</assertEquals>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="ValidateAdvancedConfigurationNotSetActionGroup" extends="ValidateAdvancedConfigurationWithAllUpdatedNotVisibleActionGroup">
<annotations>
<description value="Validates Advanced configuration was not set"/>
</annotations>
<waitForElementVisible selector="{{page.noCssClasses(index)}}" stepKey="waitForCSSClasses"/>
<remove keyForRemoval="dontSeeCSSClasses"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="ValidateAdvancedConfigurationWithAlignmentActionGroup" extends="ValidateAdvancedConfigurationAllOptionsActionGroup">
<annotations>
<description value="Validates styles from Advanced configuration in without border and css classes"/>
</annotations>
<executeJS function="return window.getComputedStyle(document.evaluate('{{page.advancedConfigurationPath(index)}}', document.body).iterateNext()).color" stepKey="grabColorValue" after="grabBorderColorValue"/>
<remove keyForRemoval="assertBorderColor"/>
<assertEquals stepKey="assertNoBorderColor" after="grabColorValue">
<expectedResult type="variable">grabBorderColorValue</expectedResult>
<actualResult type="variable">grabColorValue</actualResult>
</assertEquals>
<remove keyForRemoval="waitForCSSClassesVisible"/>
<waitForElementVisible selector="{{page.noCssClasses(index)}}" stepKey="waitForNoCSSClassesVisible" after="grabBorderRadiusValue"/>
</actionGroup>
</actionGroups>
Loading