Skip to content
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

2.0.1 map enhancements #477

Merged
merged 17 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions assets/css/scss/_maps.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
.lsx-to-map-marker {
-webkit-box-align: start;
-ms-flex-align: start;
align-items: flex-start;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-ms-flex-flow: row nowrap;
flex-flow: row nowrap;
height: auto;
-webkit-box-pack: start;
-ms-flex-pack: start;
justify-content: flex-start;
padding: 5px 0;
width: 100%;

.lsx-to-map-marker-content {
-webkit-box-flex: 1;
-ms-flex-positive: 1;
flex-grow: 1;

&.content-area {
margin: 0;
}

.entry-content {
p {
margin-bottom: 0;
margin-top: 1.2rem;

> a.moretag:after {
color: inherit;
content: '\f178';
display: inline-block;
font-family: 'FontAwesome';
font-size: inherit;
margin-right: 5px;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
}
}
}

.lsx-to-map-marker-img {
margin-right: 15px;
max-width: 100px;
-ms-flex-negative: 0;
flex-shrink: 0;
}

.lsx-to-map-marker-title {
margin-bottom: 1.2rem;
margin-top: 0;
}
}
40 changes: 40 additions & 0 deletions assets/css/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/css/style.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions assets/css/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
@import 'scss/slider';
@import 'scss/collapse';
@import 'scss/modals';
@import 'scss/maps';

.lsx-itinerary-wrapper,
.lsx-units-wrapper {
Expand Down
Binary file removed assets/img/Typecalendar-icon.png
Binary file not shown.
Binary file removed assets/img/Typetours-icon.png
Binary file not shown.
Binary file removed assets/img/accommodation-type-TO-icon-black-20px.png
Binary file not shown.
Binary file removed assets/img/accommodation.png
Binary file not shown.
Binary file removed assets/img/activities.png
Binary file not shown.
Binary file removed assets/img/best-months-to-travel-TO-icon-black-20px.png
Binary file not shown.
Binary file removed assets/img/dates-travelled-icon-black-20px.png
Binary file not shown.
Binary file removed assets/img/duration-icon-black-20px.png
Binary file not shown.
Binary file removed assets/img/from-price-TO-icon-black-20px.png
Binary file not shown.
3 changes: 0 additions & 3 deletions assets/img/left-arrow-new.svg

This file was deleted.

Binary file removed assets/img/map-TO-icon-black-20px.png
Binary file not shown.
Binary file removed assets/img/mystery-man-square.png
Binary file not shown.
Binary file removed assets/img/mystery-man-wide.png
Binary file not shown.
Binary file removed assets/img/offers.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file removed assets/img/placeholders/placeholder-map-1170x400.jpg
Diff not rendered.
Binary file removed assets/img/placeholders/placeholder-map-350x350.jpg
Diff not rendered.
Binary file removed assets/img/placeholders/placeholder-map-400x400.jpg
Diff not rendered.
Binary file removed assets/img/placeholders/placeholder-page-350x350.jpg
Diff not rendered.
Binary file removed assets/img/placeholders/placeholder-page-360x168.jpg
Diff not rendered.
Binary file removed assets/img/placeholders/placeholder-page-750x350.jpg
Diff not rendered.
Binary file removed assets/img/placeholders/placeholder-page-general.jpg
Diff not rendered.
Diff not rendered.
Binary file removed assets/img/placeholders/placeholder-post-350x350.jpg
Diff not rendered.
Binary file removed assets/img/placeholders/placeholder-post-360x168.jpg
Diff not rendered.
Binary file removed assets/img/placeholders/placeholder-post-750x350.jpg
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file removed assets/img/placeholders/placeholder-team-350x350.jpg
Diff not rendered.
Binary file removed assets/img/placeholders/placeholder-team-360x168.jpg
Diff not rendered.
Binary file removed assets/img/placeholders/placeholder-team-750x350.jpg
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file removed assets/img/placeholders/placeholder-tour-360x168.jpg
Diff not rendered.
Binary file removed assets/img/placeholders/placeholder-tour-750x350.jpg
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file removed assets/img/restaurants.png
Diff not rendered.
69 changes: 68 additions & 1 deletion assets/js/blocks/general.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// metadata.bindings not handle correctly

wp.domReady(() => {

Expand Down Expand Up @@ -572,5 +571,73 @@ wp.domReady(() => {
renaming: false
}
});

// Price Block
wp.blocks.registerBlockVariation("core/group", {
name: "lsx-tour-operator/price",
title: "Price",
category: 'lsx-tour-operator',
icon: 'money-alt',
attributes: {
metadata: {
name: "Price",
},
align: "wide",
layout: {
type: "flex",
flexWrap: "nowrap",
},
className: "lsx-price-wrapper",
style: {
spacing: {
blockGap: "5px",
},
},
},
innerBlocks: [
[
"core/paragraph",
{
padding: {
top: "2px",
bottom: "2px",
},
typography: {
fontSize: "x-small",
},
content: "<strong>From:</strong>",
className: "has-x-small-font-size",
},
],
[
"core/paragraph",
{
metadata: {
bindings: {
content: {
source: "lsx/post-meta",
args: {
key: "price"
},
},
},
},
className: "amount has-primary-color has-text-color has-link-color",
padding: {
top: "2px",
bottom: "2px",
},
color: {
link: "primary-700",
text: "primary-700",
},
},
],
],
isDefault: false,
supports: {
renaming: false
}
});
});

119 changes: 119 additions & 0 deletions assets/js/blocks/maps.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
wp.domReady(() => {

// Map Block
wp.blocks.registerBlockVariation("core/group", {
name: "lsx-tour-operator/google-map",
title: "Google Map",
description: "Display a Google Map based on the current Tour Operator page.",
category: 'lsx-tour-operator',
icon: 'location-alt',
attributes: {
metadata: {
name: "Google Map",
},
className: "lsx-location-wrapper",
style: {
spacing: {
padding: {
top: 'var(--wp--preset--spacing--medium)',
bottom: 'var(--wp--preset--spacing--medium)',
left: 'var(--wp--preset--spacing--x-small)',
right: 'var(--wp--preset--spacing--x-small)'
},
margin: {
top: '0',
bottom: '0'
}
}
},
align: 'full',
layout: {
type: 'constrained'
},
tagName: "section"
},
innerBlocks: [
[
'core/group',
{
align: 'wide',
style: {
spacing: {
margin: { top: '0', bottom: '0' },
padding: { top: '0', bottom: 'var(--wp--preset--spacing--small)', left: '0', right: '0' },
blockGap: 'var(--wp--preset--spacing--small)'
}
},
metadata: {
name: "Title"
},
layout: { type: 'flex', flexWrap: 'nowrap' }
},
[
['core/separator', { style: { layout: { selfStretch: 'fill', flexSize: null } }, backgroundColor: 'primary' }],
['core/heading', { textAlign: 'center', content: 'Location' }],
['core/separator', { style: { layout: { selfStretch: 'fill', flexSize: null } }, backgroundColor: 'primary' }]
]
],
[
'core/group',
{
align: 'wide',
layout: { type: 'default' },
name: "Map Container",
metadata: {
name: "Map Container",
}
},
[
[
'core/cover',
{
url: lsxToEditor.assetsUrl + 'blocks/placeholder-map-1920x656.jpg',
dimRatio: 50,
customOverlayColor: '#e2f0f7',
isUserOverlayColor: false,
isDark: false,
layout: { type: 'constrained' },
className: "lsx-map-preview",
name: "Preview",
},
[
[
'core/paragraph',
{
align: 'center',
fontSize: 'large',
content: '<a href="#">Click here to display the map</a>',
className: 'has-text-align-center has-large-font-size'
}
]
]
],
[
'core/group',
{
align: 'wide',
layout: { type: 'default' },
className: "hidden",
metadata: {
name: "Map Details",
bindings: {
content: {
source: 'lsx/map',
type: 'google'
}
}
}
},
[]
]
]
]
],
isDefault: false,
/*supports: {
renaming: false
}*/
});
});
Loading
Loading