Changeset 3372199
- Timestamp:
- 10/03/2025 08:17:10 AM (6 months ago)
- Location:
- linear
- Files:
-
- 6 added
- 201 deleted
- 17 edited
- 43 copied
-
tags/3.0.9 (copied) (copied from linear/trunk)
-
tags/3.0.9/README.txt (copied) (copied from linear/trunk/README.txt) (2 diffs)
-
tags/3.0.9/admin-style.css (copied) (copied from linear/trunk/admin-style.css)
-
tags/3.0.9/blocks/buy-commissions/build-frontend/block.json (deleted)
-
tags/3.0.9/blocks/buy-commissions/build-frontend/index.js (deleted)
-
tags/3.0.9/blocks/buy-commissions/build/block.json (deleted)
-
tags/3.0.9/blocks/buy-commissions/build/index.asset.php (deleted)
-
tags/3.0.9/blocks/buy-commissions/build/index.css (deleted)
-
tags/3.0.9/blocks/buy-commissions/build/index.js (deleted)
-
tags/3.0.9/blocks/buy-commissions/build/style-index.css (deleted)
-
tags/3.0.9/blocks/buy-commissions/buy-commissions.php (deleted)
-
tags/3.0.9/blocks/buy-commissions/config.json (deleted)
-
tags/3.0.9/blocks/buy-commissions/readme.txt (deleted)
-
tags/3.0.9/blocks/buy-commissions/src/block.json (deleted)
-
tags/3.0.9/blocks/buy-commissions/src/edit.js (deleted)
-
tags/3.0.9/blocks/buy-commissions/src/editor.scss (deleted)
-
tags/3.0.9/blocks/buy-commissions/src/frontend/App.js (deleted)
-
tags/3.0.9/blocks/buy-commissions/src/frontend/components/Commission.js (deleted)
-
tags/3.0.9/blocks/buy-commissions/src/frontend/components/ErrorMessage.js (deleted)
-
tags/3.0.9/blocks/buy-commissions/src/frontend/components/Filters.js (deleted)
-
tags/3.0.9/blocks/buy-commissions/src/frontend/components/LoadMore.js (deleted)
-
tags/3.0.9/blocks/buy-commissions/src/frontend/components/NoCommissions.js (deleted)
-
tags/3.0.9/blocks/buy-commissions/src/frontend/components/NoResults.js (deleted)
-
tags/3.0.9/blocks/buy-commissions/src/frontend/components/OrderBy.js (deleted)
-
tags/3.0.9/blocks/buy-commissions/src/frontend/components/index.js (deleted)
-
tags/3.0.9/blocks/buy-commissions/src/frontend/config.js (deleted)
-
tags/3.0.9/blocks/buy-commissions/src/frontend/index.js (deleted)
-
tags/3.0.9/blocks/buy-commissions/src/frontend/loaders/ResultsLoader.js (deleted)
-
tags/3.0.9/blocks/buy-commissions/src/frontend/loaders/index.js (deleted)
-
tags/3.0.9/blocks/buy-commissions/src/frontend/utils/CommissionsFilterer.js (deleted)
-
tags/3.0.9/blocks/buy-commissions/src/frontend/utils/Context.js (deleted)
-
tags/3.0.9/blocks/buy-commissions/src/frontend/utils/LocaleHandler.js (deleted)
-
tags/3.0.9/blocks/buy-commissions/src/frontend/utils/URLParamsHandler.js (deleted)
-
tags/3.0.9/blocks/buy-commissions/src/frontend/utils/URLParamsPopulator.js (deleted)
-
tags/3.0.9/blocks/buy-commissions/src/frontend/utils/index.js (deleted)
-
tags/3.0.9/blocks/buy-commissions/src/frontend/wrappers/AppWrapper.js (deleted)
-
tags/3.0.9/blocks/buy-commissions/src/frontend/wrappers/CommissionsWrapper.js (deleted)
-
tags/3.0.9/blocks/buy-commissions/src/frontend/wrappers/FiltersWrapper.js (deleted)
-
tags/3.0.9/blocks/buy-commissions/src/frontend/wrappers/index.js (deleted)
-
tags/3.0.9/blocks/buy-commissions/src/index.js (deleted)
-
tags/3.0.9/blocks/buy-commissions/src/save.js (deleted)
-
tags/3.0.9/blocks/buy-commissions/src/scss/_commissions.scss (deleted)
-
tags/3.0.9/blocks/buy-commissions/src/scss/_error-message.scss (deleted)
-
tags/3.0.9/blocks/buy-commissions/src/style.scss (deleted)
-
tags/3.0.9/blocks/buy-commissions/utils.php (deleted)
-
tags/3.0.9/blocks/buy-commissions/webpack.frontend.js (deleted)
-
tags/3.0.9/blocks/listings/build-frontend/block.json (deleted)
-
tags/3.0.9/blocks/listings/build-frontend/index.js (deleted)
-
tags/3.0.9/blocks/listings/build/block.json (deleted)
-
tags/3.0.9/blocks/listings/build/index.asset.php (deleted)
-
tags/3.0.9/blocks/listings/build/index.css (deleted)
-
tags/3.0.9/blocks/listings/build/index.js (deleted)
-
tags/3.0.9/blocks/listings/build/style-index.css (deleted)
-
tags/3.0.9/blocks/listings/config.json (deleted)
-
tags/3.0.9/blocks/listings/listings.php (deleted)
-
tags/3.0.9/blocks/listings/readme.txt (deleted)
-
tags/3.0.9/blocks/listings/src/block.json (deleted)
-
tags/3.0.9/blocks/listings/src/edit.js (deleted)
-
tags/3.0.9/blocks/listings/src/editor.scss (deleted)
-
tags/3.0.9/blocks/listings/src/frontend/App.js (deleted)
-
tags/3.0.9/blocks/listings/src/frontend/components/ErrorMessage.js (deleted)
-
tags/3.0.9/blocks/listings/src/frontend/components/Filters.js (deleted)
-
tags/3.0.9/blocks/listings/src/frontend/components/Listing.js (deleted)
-
tags/3.0.9/blocks/listings/src/frontend/components/ListingsCount.js (deleted)
-
tags/3.0.9/blocks/listings/src/frontend/components/LoadMore.js (deleted)
-
tags/3.0.9/blocks/listings/src/frontend/components/NoListings.js (deleted)
-
tags/3.0.9/blocks/listings/src/frontend/components/NoResults.js (deleted)
-
tags/3.0.9/blocks/listings/src/frontend/components/OrderBy.js (deleted)
-
tags/3.0.9/blocks/listings/src/frontend/components/index.js (deleted)
-
tags/3.0.9/blocks/listings/src/frontend/config.js (deleted)
-
tags/3.0.9/blocks/listings/src/frontend/index.js (deleted)
-
tags/3.0.9/blocks/listings/src/frontend/loaders/ResultsLoader.js (deleted)
-
tags/3.0.9/blocks/listings/src/frontend/loaders/index.js (deleted)
-
tags/3.0.9/blocks/listings/src/frontend/utils/BaseFilterer.js (deleted)
-
tags/3.0.9/blocks/listings/src/frontend/utils/Context.js (deleted)
-
tags/3.0.9/blocks/listings/src/frontend/utils/ListingsFilterer.js (deleted)
-
tags/3.0.9/blocks/listings/src/frontend/utils/LocaleHandler.js (deleted)
-
tags/3.0.9/blocks/listings/src/frontend/utils/URLParamsHandler.js (deleted)
-
tags/3.0.9/blocks/listings/src/frontend/utils/URLParamsPopulator.js (deleted)
-
tags/3.0.9/blocks/listings/src/frontend/utils/index.js (deleted)
-
tags/3.0.9/blocks/listings/src/frontend/wrappers/AppWrapper.js (deleted)
-
tags/3.0.9/blocks/listings/src/frontend/wrappers/FiltersWrapper.js (deleted)
-
tags/3.0.9/blocks/listings/src/frontend/wrappers/ListingsWrapper.js (deleted)
-
tags/3.0.9/blocks/listings/src/frontend/wrappers/index.js (deleted)
-
tags/3.0.9/blocks/listings/src/index.js (deleted)
-
tags/3.0.9/blocks/listings/src/save.js (deleted)
-
tags/3.0.9/blocks/listings/src/scss/_error-message.scss (deleted)
-
tags/3.0.9/blocks/listings/src/scss/_listings.scss (deleted)
-
tags/3.0.9/blocks/listings/src/style.scss (deleted)
-
tags/3.0.9/blocks/listings/utils.php (deleted)
-
tags/3.0.9/blocks/listings/webpack.frontend.js (deleted)
-
tags/3.0.9/build (copied) (copied from linear/trunk/build)
-
tags/3.0.9/build/index-rtl.css (modified) (1 diff)
-
tags/3.0.9/build/index.asset.php (copied) (copied from linear/trunk/build/index.asset.php) (1 diff)
-
tags/3.0.9/build/index.css (modified) (1 diff)
-
tags/3.0.9/build/index.css.map (added)
-
tags/3.0.9/build/index.js (copied) (copied from linear/trunk/build/index.js) (1 diff)
-
tags/3.0.9/build/index.js.map (added)
-
tags/3.0.9/build/style-index-rtl.css (modified) (1 diff)
-
tags/3.0.9/build/style-index.css (modified) (1 diff)
-
tags/3.0.9/build/style-index.css.map (added)
-
tags/3.0.9/dist/admin-manifest.json (deleted)
-
tags/3.0.9/dist/admin.6a546fef4b8ef040d8da.css (deleted)
-
tags/3.0.9/dist/admin.b5d1122210d54c354778.js (deleted)
-
tags/3.0.9/dist/bg-dixu.png (deleted)
-
tags/3.0.9/dist/editor.31d6cfe0d16ae931b73c.css (deleted)
-
tags/3.0.9/dist/editor.31d6cfe0d16ae931b73c.js (deleted)
-
tags/3.0.9/dist/frontend-manifest.json (deleted)
-
tags/3.0.9/dist/frontend.92dc40afa8a8fe20d0c1.js (deleted)
-
tags/3.0.9/dist/frontend.92dc40afa8a8fe20d0c1.js.LICENSE.txt (deleted)
-
tags/3.0.9/dist/frontend.cdadff39433013609baa.css (deleted)
-
tags/3.0.9/dist/icon-360-view.svg (deleted)
-
tags/3.0.9/dist/icon-amenities.svg (deleted)
-
tags/3.0.9/dist/icon-arrow-next.svg (deleted)
-
tags/3.0.9/dist/icon-arrow-previous.svg (deleted)
-
tags/3.0.9/dist/icon-arrow-top-right.svg (deleted)
-
tags/3.0.9/dist/icon-avatar.svg (deleted)
-
tags/3.0.9/dist/icon-book.svg (deleted)
-
tags/3.0.9/dist/icon-building.svg (deleted)
-
tags/3.0.9/dist/icon-calendar.svg (deleted)
-
tags/3.0.9/dist/icon-caret-down.svg (deleted)
-
tags/3.0.9/dist/icon-coffee.svg (deleted)
-
tags/3.0.9/dist/icon-crane.svg (deleted)
-
tags/3.0.9/dist/icon-deposit.svg (deleted)
-
tags/3.0.9/dist/icon-dot.svg (deleted)
-
tags/3.0.9/dist/icon-download.svg (deleted)
-
tags/3.0.9/dist/icon-education.svg (deleted)
-
tags/3.0.9/dist/icon-envelope.svg (deleted)
-
tags/3.0.9/dist/icon-euro.svg (deleted)
-
tags/3.0.9/dist/icon-facebook.svg (deleted)
-
tags/3.0.9/dist/icon-faucet.svg (deleted)
-
tags/3.0.9/dist/icon-forest.svg (deleted)
-
tags/3.0.9/dist/icon-fullscreen.svg (deleted)
-
tags/3.0.9/dist/icon-ground-plan.svg (deleted)
-
tags/3.0.9/dist/icon-linkedin.svg (deleted)
-
tags/3.0.9/dist/icon-maximize.svg (deleted)
-
tags/3.0.9/dist/icon-messaging.svg (deleted)
-
tags/3.0.9/dist/icon-minimize.svg (deleted)
-
tags/3.0.9/dist/icon-open-house.svg (deleted)
-
tags/3.0.9/dist/icon-payment.svg (deleted)
-
tags/3.0.9/dist/icon-phone.svg (deleted)
-
tags/3.0.9/dist/icon-pipes.svg (deleted)
-
tags/3.0.9/dist/icon-play.svg (deleted)
-
tags/3.0.9/dist/icon-playground.svg (deleted)
-
tags/3.0.9/dist/icon-plot.svg (deleted)
-
tags/3.0.9/dist/icon-price-tag.svg (deleted)
-
tags/3.0.9/dist/icon-shopping-cart.svg (deleted)
-
tags/3.0.9/dist/icon-water.svg (deleted)
-
tags/3.0.9/dist/icon-whatsapp.svg (deleted)
-
tags/3.0.9/dist/icon-wrench.svg (deleted)
-
tags/3.0.9/dist/linear-logo-128x128.png (deleted)
-
tags/3.0.9/dist/linear-logo-256x256.png (deleted)
-
tags/3.0.9/dist/logo-nordea.svg (deleted)
-
tags/3.0.9/dist/map_bg.png (deleted)
-
tags/3.0.9/includes/class-linear-activator.php (copied) (copied from linear/trunk/includes/class-linear-activator.php)
-
tags/3.0.9/includes/class-linear-admin-notices.php (copied) (copied from linear/trunk/includes/class-linear-admin-notices.php)
-
tags/3.0.9/includes/class-linear-admin.php (copied) (copied from linear/trunk/includes/class-linear-admin.php)
-
tags/3.0.9/includes/class-linear-blocks.php (copied) (copied from linear/trunk/includes/class-linear-blocks.php)
-
tags/3.0.9/includes/class-linear-data-handler.php (copied) (copied from linear/trunk/includes/class-linear-data-handler.php)
-
tags/3.0.9/includes/class-linear-deactivator.php (copied) (copied from linear/trunk/includes/class-linear-deactivator.php)
-
tags/3.0.9/includes/class-linear-endpoints.php (copied) (copied from linear/trunk/includes/class-linear-endpoints.php) (3 diffs)
-
tags/3.0.9/includes/class-linear-hooks.php (copied) (copied from linear/trunk/includes/class-linear-hooks.php)
-
tags/3.0.9/includes/class-linear-i18n.php (copied) (copied from linear/trunk/includes/class-linear-i18n.php)
-
tags/3.0.9/includes/class-linear-loader.php (copied) (copied from linear/trunk/includes/class-linear-loader.php)
-
tags/3.0.9/includes/class-linear-middleware.php (copied) (copied from linear/trunk/includes/class-linear-middleware.php) (4 diffs)
-
tags/3.0.9/includes/class-linear-rewrites.php (copied) (copied from linear/trunk/includes/class-linear-rewrites.php)
-
tags/3.0.9/includes/class-linear-seo.php (copied) (copied from linear/trunk/includes/class-linear-seo.php) (1 diff)
-
tags/3.0.9/includes/class-linear-settings.php (copied) (copied from linear/trunk/includes/class-linear-settings.php)
-
tags/3.0.9/includes/class-linear-shortcodes.php (copied) (copied from linear/trunk/includes/class-linear-shortcodes.php)
-
tags/3.0.9/includes/class-linear-sitemaps.php (copied) (copied from linear/trunk/includes/class-linear-sitemaps.php)
-
tags/3.0.9/includes/class-linear-templater.php (copied) (copied from linear/trunk/includes/class-linear-templater.php) (2 diffs)
-
tags/3.0.9/includes/class-linear-tools.php (copied) (copied from linear/trunk/includes/class-linear-tools.php)
-
tags/3.0.9/includes/class-linear-upgrader.php (copied) (copied from linear/trunk/includes/class-linear-upgrader.php)
-
tags/3.0.9/includes/class-linear.php (copied) (copied from linear/trunk/includes/class-linear.php) (1 diff)
-
tags/3.0.9/includes/constants-and-labels.php (copied) (copied from linear/trunk/includes/constants-and-labels.php)
-
tags/3.0.9/includes/constants_and_labels.php (deleted)
-
tags/3.0.9/languages/linear-fi-142359afe5368146b6a928c8ee9681b3.json (copied) (copied from linear/trunk/languages/linear-fi-142359afe5368146b6a928c8ee9681b3.json)
-
tags/3.0.9/languages/linear-fi-24c2d740d7fc5e59b88f99449808a345.json (copied) (copied from linear/trunk/languages/linear-fi-24c2d740d7fc5e59b88f99449808a345.json)
-
tags/3.0.9/languages/linear-fi-50edcdc875161ecb26cc1171a49a627b.json (copied) (copied from linear/trunk/languages/linear-fi-50edcdc875161ecb26cc1171a49a627b.json)
-
tags/3.0.9/languages/linear-fi-6df155fdc63783a10bceecf2abb2dca2.json (copied) (copied from linear/trunk/languages/linear-fi-6df155fdc63783a10bceecf2abb2dca2.json)
-
tags/3.0.9/languages/linear-fi-7846dc747688c88991710f410b27d4a4.json (copied) (copied from linear/trunk/languages/linear-fi-7846dc747688c88991710f410b27d4a4.json)
-
tags/3.0.9/languages/linear-fi-9949614117209e599fd1c794d668c7f4.json (copied) (copied from linear/trunk/languages/linear-fi-9949614117209e599fd1c794d668c7f4.json)
-
tags/3.0.9/languages/linear-fi-ea1935cc5a71014add28225964a07048.json (copied) (copied from linear/trunk/languages/linear-fi-ea1935cc5a71014add28225964a07048.json)
-
tags/3.0.9/languages/linear-fi-f24585c8afc00981352d84bda2028e16.json (copied) (copied from linear/trunk/languages/linear-fi-f24585c8afc00981352d84bda2028e16.json)
-
tags/3.0.9/languages/linear-fi.l10n.php (copied) (copied from linear/trunk/languages/linear-fi.l10n.php)
-
tags/3.0.9/languages/linear-fi.mo (copied) (copied from linear/trunk/languages/linear-fi.mo)
-
tags/3.0.9/languages/linear-fi.po (copied) (copied from linear/trunk/languages/linear-fi.po)
-
tags/3.0.9/languages/linear.pot (copied) (copied from linear/trunk/languages/linear.pot)
-
tags/3.0.9/linear.php (copied) (copied from linear/trunk/linear.php) (2 diffs)
-
tags/3.0.9/src (copied) (copied from linear/trunk/src)
-
tags/3.0.9/style.css (copied) (copied from linear/trunk/style.css)
-
tags/3.0.9/templates/components/accordion.php (deleted)
-
tags/3.0.9/templates/components/bidding_label.php (deleted)
-
tags/3.0.9/templates/components/realtor.php (deleted)
-
tags/3.0.9/templates/components/share_links.php (deleted)
-
tags/3.0.9/templates/components/specification.php (deleted)
-
tags/3.0.9/templates/components/text.php (deleted)
-
tags/3.0.9/templates/components/text_area.php (deleted)
-
tags/3.0.9/templates/components/text_heading.php (deleted)
-
tags/3.0.9/templates/components/text_price.php (deleted)
-
tags/3.0.9/templates/components/text_rent_updated.php (deleted)
-
tags/3.0.9/templates/components/text_subheading.php (deleted)
-
tags/3.0.9/templates/helpers/comparator_is_sub_value.php (deleted)
-
tags/3.0.9/templates/helpers/compare_to_constant.php (deleted)
-
tags/3.0.9/templates/helpers/get_area_basis_value.php (deleted)
-
tags/3.0.9/templates/helpers/get_clean_array.php (deleted)
-
tags/3.0.9/templates/helpers/get_company_logo.php (deleted)
-
tags/3.0.9/templates/helpers/get_constant.php (deleted)
-
tags/3.0.9/templates/helpers/get_data_key.php (deleted)
-
tags/3.0.9/templates/helpers/get_data_value.php (deleted)
-
tags/3.0.9/templates/helpers/get_imploded_clean_array.php (deleted)
-
tags/3.0.9/templates/helpers/get_linear_locale.php (deleted)
-
tags/3.0.9/templates/helpers/get_linear_option_value.php (deleted)
-
tags/3.0.9/templates/helpers/get_listing_link.php (deleted)
-
tags/3.0.9/templates/helpers/get_locale_key.php (deleted)
-
tags/3.0.9/templates/helpers/get_locale_value.php (deleted)
-
tags/3.0.9/templates/helpers/get_maintenance_charge_value.php (deleted)
-
tags/3.0.9/templates/helpers/get_object_value.php (deleted)
-
tags/3.0.9/templates/helpers/get_presentation.php (deleted)
-
tags/3.0.9/templates/helpers/get_value.php (deleted)
-
tags/3.0.9/templates/helpers/get_youtube_video_embed_url.php (deleted)
-
tags/3.0.9/templates/helpers/get_youtube_video_image_url.php (deleted)
-
tags/3.0.9/templates/helpers/has_array_values.php (deleted)
-
tags/3.0.9/templates/helpers/has_value.php (deleted)
-
tags/3.0.9/templates/helpers/has_values.php (deleted)
-
tags/3.0.9/templates/helpers/icon.php (deleted)
-
tags/3.0.9/templates/helpers/map_value_labels.php (deleted)
-
tags/3.0.9/templates/helpers/maybe_get_constant.php (deleted)
-
tags/3.0.9/templates/helpers/output_component.php (deleted)
-
tags/3.0.9/templates/helpers/output_string.php (deleted)
-
tags/3.0.9/templates/helpers/scheme-parser.php (deleted)
-
tags/3.0.9/templates/helpers/transform_date.php (deleted)
-
tags/3.0.9/templates/helpers/transform_hex_to_rgba.php (deleted)
-
tags/3.0.9/templates/helpers/transform_key_to_value.php (deleted)
-
tags/3.0.9/templates/helpers/transform_keys_to_values.php (deleted)
-
tags/3.0.9/templates/helpers/transforms_hex_brightness.php (deleted)
-
tags/3.0.9/templates/linear-404.php (deleted)
-
tags/3.0.9/templates/linear-buy-commission.php (deleted)
-
tags/3.0.9/templates/linear-listing.php (deleted)
-
tags/3.0.9/templates/plain-listings.php (deleted)
-
tags/3.0.9/templates/sections/buy_commission_content.php (deleted)
-
tags/3.0.9/templates/sections/buy_commission_introduction.php (deleted)
-
tags/3.0.9/templates/sections/buy_commission_pre_title.php (deleted)
-
tags/3.0.9/templates/sections/buy_commission_realtor.php (deleted)
-
tags/3.0.9/templates/sections/listing_actions.php (deleted)
-
tags/3.0.9/templates/sections/listing_image-carousel.php (deleted)
-
tags/3.0.9/templates/sections/listing_introduction.php (deleted)
-
tags/3.0.9/templates/sections/listing_map.php (deleted)
-
tags/3.0.9/templates/sections/listing_pre-title.php (deleted)
-
tags/3.0.9/templates/single-listing.php (copied) (copied from linear/trunk/templates/single-listing.php)
-
tags/3.0.9/utils/assets.php (deleted)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/build/index-rtl.css (modified) (1 diff)
-
trunk/build/index.asset.php (modified) (1 diff)
-
trunk/build/index.css (modified) (1 diff)
-
trunk/build/index.css.map (added)
-
trunk/build/index.js (modified) (1 diff)
-
trunk/build/index.js.map (added)
-
trunk/build/style-index-rtl.css (modified) (1 diff)
-
trunk/build/style-index.css (modified) (1 diff)
-
trunk/build/style-index.css.map (added)
-
trunk/includes/class-linear-endpoints.php (modified) (3 diffs)
-
trunk/includes/class-linear-middleware.php (modified) (4 diffs)
-
trunk/includes/class-linear-seo.php (modified) (1 diff)
-
trunk/includes/class-linear-templater.php (modified) (2 diffs)
-
trunk/includes/class-linear.php (modified) (1 diff)
-
trunk/linear.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
linear/tags/3.0.9/README.txt
r3366394 r3372199 4 4 Requires at least: 6.2 5 5 Tested up to: 6.8.2 6 Stable tag: 3.0. 86 Stable tag: 3.0.9 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 53 53 54 54 == Changelog == 55 56 = 3.0.9 = 57 *Release date 2nd October 2025* 58 59 * Fix - Fixed faulty filter with SeoPress that caused unexpeced meta-data renders 60 * Tweak - Added option to 55 61 56 62 = 3.0.8 = -
linear/tags/3.0.9/build/index-rtl.css
r3338864 r3372199 1 .linear-embed{margin-right:auto;margin-left:auto;max-width:var(--wp--style--global--wide-size);width:100%} 2 3 1 /*!***************************************************************************************************************************************************************************************************************************************!*\ 2 !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/index.scss ***! 3 \***************************************************************************************************************************************************************************************************************************************/ 4 .linear-embed { 5 max-width: var(--wp--style--global--wide-size); 6 width: 100%; 7 margin-right: auto; 8 margin-left: auto; 9 } 10 /*!****************************************************************************************************************************************************************************************************************************************************************!*\ 11 !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/blocks/dynamic-listings/editor.scss ***! 12 \****************************************************************************************************************************************************************************************************************************************************************/ 13 /** 14 * Editor styles for the dynamic listings block 15 */ 16 /*!********************************************************************************************************************************************************************************************************************************************************!*\ 17 !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/blocks/listings/editor.scss ***! 18 \********************************************************************************************************************************************************************************************************************************************************/ 19 /** 20 * Editor styles for the dynamic listings block 21 */ -
linear/tags/3.0.9/build/index.asset.php
r3346339 r3372199 1 <?php return array('dependencies' => array('react', 'react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n', 'wp-notices'), 'version' => 'a b86a10b8260371c8b5c');1 <?php return array('dependencies' => array('react', 'react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n', 'wp-notices'), 'version' => 'ae2765d55c9099f875c7'); -
linear/tags/3.0.9/build/index.css
r3338864 r3372199 1 .linear-embed{margin-left:auto;margin-right:auto;max-width:var(--wp--style--global--wide-size);width:100%} 1 /*!***************************************************************************************************************************************************************************************************************************************!*\ 2 !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/index.scss ***! 3 \***************************************************************************************************************************************************************************************************************************************/ 4 .linear-embed { 5 max-width: var(--wp--style--global--wide-size); 6 width: 100%; 7 margin-left: auto; 8 margin-right: auto; 9 } 10 /*!****************************************************************************************************************************************************************************************************************************************************************!*\ 11 !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/blocks/dynamic-listings/editor.scss ***! 12 \****************************************************************************************************************************************************************************************************************************************************************/ 13 /** 14 * Editor styles for the dynamic listings block 15 */ 16 /*!********************************************************************************************************************************************************************************************************************************************************!*\ 17 !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/blocks/listings/editor.scss ***! 18 \********************************************************************************************************************************************************************************************************************************************************/ 19 /** 20 * Editor styles for the dynamic listings block 21 */ 2 22 3 23 /*# sourceMappingURL=index.css.map*/ -
linear/tags/3.0.9/build/index.js
r3346339 r3372199 1 (()=>{"use strict";var e,t={345:(e,t,n)=>{const i=window.wp.domReady;var l=n.n(i);const a=window.wp.element,r=window.wp.i18n,s=window.wp.components,o=window.wp.apiFetch;var d=n.n(o);const c=window.wp.notices,h=window.wp.data,u=e=>!!e&&!(e.length<5||!/^https?:\/\/.+/.test(e)),g=e=>!(!e||e.length<12),p=window.React,_=window.ReactJSXRuntime,x=()=>{const{removeNotice:e}=(0,h.useDispatch)(c.store),t=(0,h.useSelect)((e=>e(c.store).getNotices()));return 0===t.length?null:(0,_.jsx)(s.NoticeList,{notices:t,onRemove:e})},m=window.wp.coreData,b=({label:e,value:t,pages:n,onChange:i,help:l,showLink:a=!0,getLinkForLanguagePage:o,getTitleForLanguagePage:d})=>(0,_.jsxs)("div",{children:[(0,_.jsx)(s.SelectControl,{label:e,value:t,options:[{label:(0,r.__)("Select a page...","linear"),value:""},...n?n.map((e=>({label:e.title.raw,value:e.id}))):[]],onChange:i,help:l}),a&&t&&n&&o?(0,_.jsx)("div",{style:{marginTop:"5px"},children:(0,_.jsxs)("p",{children:[(0,r.__)("Link to page: ","linear"),(0,_.jsx)("a",{href:o(),target:"_blank",rel:"noopener noreferrer",children:d()})]})}):""]}),y=(e,t,n=null)=>{if(!e)return[];if(!t||!n)return e;const i=e.filter((e=>e.language===n));return i.length>0?i:e},j=(e,t,n=null)=>t?"object"!=typeof e?0:parseInt(e[n]||0,10):parseInt(e,10),v=(e,t,n,i=null)=>{const l=j(e,n,i);if(!l||!t)return"#";const a=t.find((e=>e.id===l));return a?a.link:"#"},f=(e,t,n,i=null)=>{const l=j(e,n,i);if(!l||!t)return"";const a=t.find((e=>e.id===l));return a?a.title.raw:""},w=({onClick:e,disabled:t})=>(0,_.jsx)(s.Button,{variant:"primary",onClick:e,__next40pxDefaultSize:!0,disabled:t,children:(0,r.__)("Save","linear")}),S=()=>{const{appUrl:e,setAppUrl:t,dataUrl:n,setDataUrl:i,clientSecret:l,setClientSecret:o,dynamicParentPages:S,setDynamicParentPages:k,renderingMethod:C,setRenderingMethod:P,shortcodeRenderingMethod:T,setShortcodeRenderingMethod:L,listingLeadsIntegration:R,setListingLeadsIntegration:I,featuredImage:A,setFeaturedImage:B,themeColor:E,setThemeColor:D,resultsPerPage:N,setResultsPerPage:O,customCss:H,setCustomCss:M,customCssSrc:U,setCustomCssSrc:W,additionalSettings:F,setAdditionalSettings:z,saveSettings:q}=(()=>{const[e,t]=(0,a.useState)(),[n,i]=(0,a.useState)(),[l,s]=(0,a.useState)(),[o,p]=(0,a.useState)([]),[_,x]=(0,a.useState)("inline"),[m,b]=(0,a.useState)("default"),[y,j]=(0,a.useState)(!1),[v,f]=(0,a.useState)(),[w,S]=(0,a.useState)(window.linear_admin_obj.theme_default_color||"#ed6a40"),[k,C]=(0,a.useState)(4),[P,T]=(0,a.useState)(""),[L,R]=(0,a.useState)(""),[I,A]=(0,a.useState)([]),B=window.linear_admin_obj.rest.nonce,{removeAllNotices:E,createSuccessNotice:D,createInfoNotice:N,createErrorNotice:O}=(0,h.useDispatch)(c.store),H=window.linear_admin_obj.rest.endpoints.options;if(H&&B)return(0,a.useEffect)((()=>{d()({path:H,method:"GET",headers:{"X-WP-Nonce":B}}).then((e=>{const n=e.options;t(n.app_url||""),i(n.data_url||""),s(n.client_secret||""),p(n.dynamic_parent_pages||[]),x(n.rendering_method||"inline"),b(n.shortcode_rendering_method||"default"),j(n.listing_leads_integration||!1),f(n.featured_image||""),S(n.theme_color||"#ed6a40"),C(n.results_per_page||4),T(n.custom_css||""),R(n.custom_css_src||""),A(n.additional_settings||[])})).catch((e=>{console.log(e),"rest_no_route"===e.code?O((0,r.__)("The REST API route is not set. Please check for plugin updates, and if that doesn't help, contact Linear support.","linear")):"rest_cannot_access"===e.code?O((0,r.__)("You do not have permission to access the REST API. Could there be something stopping this access?","linear")):e.data&&500===e.data.status?O((0,r.__)("The REST API encountered an internal server error. Please check if the WordPress Rest API is enabled.","linear")):O((0,r.__)("Failed to fetch settings. Please try refreshing this page to see if that helps.","linear"))}))}),[]),{appUrl:e,setAppUrl:t,dataUrl:n,setDataUrl:i,clientSecret:l,setClientSecret:s,dynamicParentPages:o,setDynamicParentPages:p,renderingMethod:_,setRenderingMethod:x,shortcodeRenderingMethod:m,setShortcodeRenderingMethod:b,listingLeadsIntegration:y,setListingLeadsIntegration:j,featuredImage:v,setFeaturedImage:f,themeColor:w,setThemeColor:S,resultsPerPage:k,setResultsPerPage:C,customCss:P,setCustomCss:T,customCssSrc:L,setCustomCssSrc:R,additionalSettings:I,setAdditionalSettings:A,saveSettings:()=>{E(),N((0,r.__)("Saving settings...","linear"));const t=e,i=n,a=l;return d()({path:H,method:"POST",headers:{"X-WP-Nonce":B},data:{app_url:e,data_url:n,client_secret:l,dynamic_parent_pages:o,rendering_method:_,shortcode_rendering_method:m,listing_leads_integration:y,featured_image:v,theme_color:w,results_per_page:k,custom_css:P,custom_css_src:L,additional_settings:I}}).then((()=>{E(),u(t)&&u(i)&&g(a)?D((0,r.__)("Settings saved.","linear")):O((0,r.__)("Settings saved, but some of the values are not valid. You may hence expect potential issues with the listings.","linear"))})).catch((e=>{E(),console.log(e),"rest_no_route"===e.code?O((0,r.__)("The REST API route is not set. Please check the plugin configuration.","linear")):"rest_cannot_access"===e.code?O((0,r.__)("You do not have permission to access the REST API.","linear")):e.data&&403===e.data.status?O((0,r.__)("The REST API encountered an permission error. Please check if the REST API is enabled.","linear")):e.data&&500===e.data.status?O((0,r.__)("The REST API encountered an internal server error. Please check if the REST API is enabled.","linear")):O((0,r.__)("Failed to save settings. Please try refreshing this page to see if that helps.","linear"))}))}}})(),[Y,$]=(0,a.useState)(!1),[G,J]=(0,a.useState)(["fi"]),{isMobile:X}=(()=>{const[e,t]=(0,p.useState)(window.innerWidth<=768),[n,i]=(0,p.useState)(window.innerWidth>768&&window.innerWidth<=1024);return(0,p.useEffect)((()=>{const e=()=>{t(window.innerWidth<=768),i(window.innerWidth>768&&window.innerWidth<=1024)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),{isMobile:e,isTablet:n}})(),V=window.linear_admin_obj.exception_rules||[];(0,a.useEffect)((()=>{(async()=>{try{const e=await fetch("/wp-json/linear/v3/languages",{headers:{"X-WP-Nonce":linear_admin_obj.rest.nonce}});if(!e.ok)throw new Error("Failed to fetch languages");const t=await e.json();J(t)}catch(e){console.error("Error fetching languages:",e);const t=[document.getElementsByTagName("html")[0].getAttribute("lang")||"fi"];J(t)}})()}),[]),(0,a.useEffect)((()=>{const e={};G.forEach((t=>{S[t]&&(e[t]=S[t])})),JSON.stringify(e)!==JSON.stringify(S)&&k(e)}),[G,S]);const K=(0,h.useSelect)((e=>e(m.store).getEntityRecords("postType","page",{per_page:-1,status:"publish"})),[]),Q={languageSection:{marginBottom:"20px",padding:"15px",backgroundColor:"#f9f9f9",borderRadius:"4px",border:"1px solid #e0e0e0"},languageTitle:{marginTop:"0",marginBottom:"10px",fontSize:"14px",fontWeight:"bold",textTransform:"capitalize"}},Z={padding:"10px",fontSize:"16px"},ee={borderColor:"red",backgroundColor:"#ffe6e6"},te={display:"flex",flexDirection:X?"column":"row",gap:X?"1rem":"2rem",width:"100%"},ne={flex:X?"1 1 100%":"1",minWidth:X?"100%":"0"};let ie="#";if(G.length>0){const e=G[0];ie=v(S,K,G,e)+"?guide"}return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(x,{}),(0,_.jsxs)(s.Panel,{children:[(0,_.jsxs)(s.PanelBody,{title:(0,r.__)("Setup","linear"),children:[(0,_.jsx)(s.PanelRow,{children:(0,_.jsx)("blockquote",{children:(0,_.jsxs)("div",{style:{flex:"1"},children:[(0,_.jsx)(s.__experimentalHeading,{level:4,children:(0,r.__)("App URL","linear")}),(0,_.jsx)("br",{}),(0,_.jsx)(s.TextControl,{value:e,onChange:e=>t(e),style:{...Z,...""===e||u(e)?{}:ee},placeholder:(0,r.__)("https://...","linear"),help:(0,r.__)("A source for listings view","linear")})]})})}),(0,_.jsx)(s.PanelRow,{children:(0,_.jsx)("blockquote",{children:(0,_.jsxs)("div",{style:{flex:"1"},children:[(0,_.jsx)(s.__experimentalHeading,{level:4,children:(0,r.__)("Data source URL","linear")}),(0,_.jsx)("br",{}),(0,_.jsx)(s.TextControl,{value:n,onChange:e=>i(e),style:{...Z,...""===n||u(n)?{}:ee},placeholder:(0,r.__)("https://...","linear"),help:(0,r.__)("Our main data-source","linear")})]})})}),(0,_.jsx)(s.PanelRow,{children:(0,_.jsx)("blockquote",{children:(0,_.jsxs)("div",{style:{flex:"1"},children:[(0,_.jsx)(s.__experimentalHeading,{level:4,children:(0,r.__)("Client secret","linear")}),(0,_.jsx)("br",{}),(0,_.jsx)(s.TextControl,{value:l,onChange:e=>o(e),style:{...Z,...""===l||g(l)?{}:ee},placeholder:"...",help:(0,r.__)("Linear should provide this for you","linear")})]})})}),(0,_.jsx)(s.PanelRow,{children:(0,_.jsx)("blockquote",{children:(0,_.jsxs)("div",{children:[(0,_.jsx)(s.__experimentalHeading,{level:4,children:(0,r.__)("Dynamic Parent Pages","linear")}),(0,_.jsx)("br",{}),(0,_.jsxs)("div",{style:{marginLeft:"0rem"},children:[(0,_.jsxs)("div",{style:{marginBottom:"15px"},children:[(0,_.jsx)("p",{children:(0,r.__)("We have to set a dynamic parent page for each language. This is the page that will be used to load the listings dynamically. You might want to create a page dedicated for this purpose, if you haven't already done that.","linear")}),V.includes("translatePress")&&(0,_.jsx)("p",{style:{fontWeight:"bold",textDecoration:"underline"},children:(0,r.__)("If you are using TranslatePress, you can only have one set dynamic parent page, but the content will be determed by the TranslatePress selected language.","linear")})]}),G.map((e=>(0,_.jsxs)("div",{style:Q.languageSection,children:[(0,_.jsx)("h3",{style:Q.languageTitle,children:e}),(0,_.jsx)(b,{label:(0,r.__)("Select any page to use as parent for","linear")+" "+e,value:j(S,G,e),pages:y(K,G,e),onChange:t=>k(((e,t,n,i=null,l=[])=>{const a=parseInt(e,10);if(!n)return a;const r="object"==typeof t?{...t}:{};return i&&(r[i]=a),l.includes("translatePress")&&n.forEach((e=>{r[e]=a})),r})(t,S,G,e,V)),getLinkForLanguagePage:()=>v(S,K,G,e),getTitleForLanguagePage:()=>f(S,K,G,e)})]},e))),(0,_.jsx)("div",{style:{marginTop:"15px",fontSize:"13px",fontStyle:"italic"},children:(0,r.__)("Changing parent pages will flush rewrite rules to ensure proper URL handling.","linear")})]})]})})}),(0,_.jsx)(s.PanelRow,{children:(0,_.jsx)("blockquote",{children:(0,_.jsxs)("div",{children:[(0,_.jsx)(s.__experimentalHeading,{level:4,children:(0,r.__)("Rendering method","linear")}),(0,_.jsx)("br",{}),(0,_.jsxs)("div",{style:te,children:[(0,_.jsx)("div",{style:ne,children:(0,_.jsx)(s.SelectControl,{value:C,options:[{label:(0,r.__)("Inline (default)","linear"),value:"inline"},{label:(0,r.__)("Shortcode","linear"),value:"shortcode"},{label:(0,r.__)("Gutenberg block","linear"),value:"gutenberg"}],onChange:e=>P(e),help:(0,r.__)("Decide on how you wish the content to be shown. If you have a custom WordPress solution, you might be better off by using the Shortcode option.","linear"),style:{flex:"1"}})}),(0,_.jsxs)("div",{style:ne,children:["inline"===C?(0,_.jsx)("p",{children:(0,r.__)("The content will be rendered inline after the page main content.","linear")}):"","shortcode"===C?(0,_.jsxs)("div",{children:[(0,_.jsx)("p",{children:(0,r.__)("The dynamic content will be rendered via a shortcode. You can place the shortcode anywhere on your selected page. That page will be used to dynamically load Linear listings.","linear")}),(0,_.jsxs)("p",{children:[(0,r.__)("The shortcode is:","linear")," ",(0,_.jsx)("code",{children:"[linear_listings_content]"})]})]}):"","gutenberg"===C?(0,_.jsxs)("div",{children:[(0,_.jsx)("p",{children:G.length>1?(0,r.__)('Please add the Gutenberg block "Linear dynamic listings" to the pages: ',"linear"):(0,r.__)('Please add the Gutenberg block "Linear dynamic listings" to the page: ',"linear")}),(0,_.jsx)("div",{style:{display:"flex",flexDirection:"column"},children:S&&Object.entries(S).reduce(((e,[t,n])=>(e.some((([e,t])=>t===n))||e.push([t,n]),e)),[]).map((([e,t])=>(0,_.jsx)("a",{href:v(S,K,G,e),children:f(S,K,G,e)},t)))})]}):""]}),"shortcode"===C?(0,_.jsx)("div",{style:ne,children:(0,_.jsx)(s.SelectControl,{label:(0,r.__)("Shortcode rendering method","linear"),value:T,options:[{label:(0,r.__)("Should render both single listings and a list of listings","linear"),value:"default"},{label:(0,r.__)("Should only render single listings","linear"),value:"single"}],onChange:e=>L(e),help:(0,r.__)("By default, we render both single listings and the list of listings in the same place. If you want to render only single listings, and provide the list listings via e.g. a shortcode or block, you can adjust this option.","linear"),style:{flex:"1"}})}):""]})]})})})]}),(0,_.jsxs)(s.PanelBody,{title:(0,r.__)("Global settings","linear"),children:[(0,_.jsx)("p",{children:(0,r.__)("These settings are automatically applied to all listings, but can be overwritten on a per-listing basis","linear")}),(0,_.jsx)(s.PanelRow,{children:(0,_.jsx)("blockquote",{children:(0,_.jsxs)("div",{style:{},children:[(0,_.jsx)(s.__experimentalHeading,{level:4,children:(0,r.__)("Contact form integration","linear")}),(0,_.jsx)("br",{}),(0,_.jsx)(s.ToggleControl,{checked:R,onChange:()=>I((e=>!e)),__nextHasNoMarginBottom:!0,help:(0,r.__)("In case you head Leads activates for your account, you can activate them for your listings with this toggle. If however not, please contact Linear and we will sort it out for you.","linear")})]})})}),(0,_.jsx)(s.PanelRow,{children:(0,_.jsx)("blockquote",{children:(0,_.jsxs)("div",{style:{flex:"1"},children:[(0,_.jsx)(s.__experimentalHeading,{level:4,children:(0,r.__)("Default results per page","linear")}),(0,_.jsx)("br",{}),(0,_.jsx)("input",{type:"number",value:N,onChange:e=>O(e.target.value),placeholder:(0,r.__)("4","linear"),style:{padding:"8px",fontSize:"14px"}})]})})}),(0,_.jsx)(s.PanelRow,{children:(0,_.jsx)("blockquote",{children:(0,_.jsxs)("div",{style:{width:"100%"},children:[(0,_.jsx)(s.__experimentalHeading,{level:4,children:(0,r.__)("Theme Color","linear")}),(0,_.jsx)("p",{children:(0,r.__)("Select a theme color to be used across the plugin.","linear")}),(0,_.jsxs)("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center",marginBottom:"1rem"},children:[(0,_.jsx)("span",{children:(0,r.__)("Selected Color:","linear")}),(0,_.jsx)("span",{style:{display:"inline-block",width:"20px",height:"20px",backgroundColor:E,border:"1px solid #ccc",marginLeft:"5px",borderRadius:"100px"}})]}),(0,_.jsx)(s.ColorPicker,{color:E,onChangeComplete:e=>D(e.hex),disableAlpha:!0})]})})}),(0,_.jsx)(s.PanelRow,{children:(0,_.jsx)("blockquote",{children:(0,_.jsxs)("div",{children:[(0,_.jsx)(s.__experimentalHeading,{level:4,children:(0,r.__)("Featured image","linear")}),(0,_.jsx)("p",{children:(0,r.__)("Select or upload an image to be used as the brand feature image. Most often this is the logo of the company.","linear")}),(0,_.jsx)(s.Button,{variant:"primary",onClick:()=>{const e=wp.media({title:"Select or Upload Media",button:{text:"Use this media"},multiple:!1});e.on("select",(function(){const t=e.state().get("selection").first().toJSON();B(t.url)})),e.open()},children:(0,r.__)("Select Image","linear")}),A&&(0,_.jsxs)("div",{style:{marginTop:"10px"},children:[(0,_.jsx)("img",{src:A,alt:(0,r.__)("Selected Image","linear"),style:{maxWidth:"100%",maxHeight:"120px",height:"auto",border:"1px solid #ccc"}}),(0,_.jsx)("br",{}),(0,_.jsx)(s.Button,{onClick:()=>B(""),variant:"link",isDestructive:!0,style:{marginTop:"10px"},children:(0,r.__)("Remove Image","linear")})]})]})})}),(0,_.jsx)(s.PanelRow,{children:(0,_.jsx)("blockquote",{children:(0,_.jsxs)("div",{style:{flex:"1"},children:[(0,_.jsx)(s.__experimentalHeading,{level:4,children:(0,r.__)("Custom CSS","linear")}),(0,_.jsx)("br",{}),(0,_.jsx)("textarea",{value:H,onChange:e=>M(e.target.value),placeholder:(0,r.__)("Enter your custom CSS here...","linear"),style:{width:"100%",padding:"8px",fontSize:"14px",minHeight:"100px"}})]})})}),(0,_.jsx)(s.PanelRow,{children:(0,_.jsx)("blockquote",{children:(0,_.jsxs)("div",{style:{flex:"1"},children:[(0,_.jsx)(s.__experimentalHeading,{level:4,children:(0,r.__)("Custom CSS source","linear")}),(0,_.jsx)("br",{}),(0,_.jsx)("input",{type:"string",value:U,onChange:e=>W(e.target.value),placeholder:window.location.origin+"/custom-styles.css",style:{width:"100%",padding:"8px",fontSize:"14px"}})]})})}),(0,_.jsx)(s.PanelRow,{children:(0,_.jsx)("blockquote",{children:(0,_.jsxs)("div",{style:{flex:"1"},children:[(0,_.jsx)(s.__experimentalHeading,{level:4,children:(0,r.__)("Additional global settings","linear")}),(0,_.jsx)("p",{children:(0,r.__)("You can define here other globally used settings. These can be overwritten on a per-listing basis, but are as default applied to all listings.","linear")}),ie&&(0,_.jsx)(s.Button,{variant:"primary",href:ie,style:{marginTop:"10px"},children:(0,r.__)("See available attributes","linear")}),(0,_.jsx)("br",{}),F&&Array.isArray(F)&&F.length>0&&(0,_.jsx)("div",{style:{marginTop:"10px"},children:F.map(((e,t)=>(0,_.jsxs)("div",{style:{display:"flex",alignItems:"center",marginBottom:"10px",gap:"10px"},children:[(0,_.jsx)(s.TextControl,{label:(0,r.__)("Key","linear"),value:e.key||"",onChange:e=>{const n=F.map(((n,i)=>i===t?{...n,key:e}:n));z(n)},placeholder:(0,r.__)("Enter key","linear"),style:{flex:"1"}}),(0,_.jsx)(s.TextControl,{label:(0,r.__)("Value","linear"),value:e.value||"",onChange:e=>{const n=F.map(((n,i)=>i===t?{...n,value:e}:n));z(n)},placeholder:(0,r.__)("Enter value","linear"),style:{flex:"1"}}),(0,_.jsx)(s.Button,{isDestructive:!0,onClick:()=>{z((e=>e.filter(((e,n)=>n!==t))))},children:(0,r.__)("Remove","linear")})]},e.id||`setting-${t}`)))}),(0,_.jsx)(s.Button,{variant:"primary",onClick:()=>{z([...F||[],{key:"",value:""}])},style:{marginTop:"10px"},children:(0,r.__)("Add additional setting","linear")})]})})})]})]}),(0,_.jsx)(w,{onClick:()=>{Y||($(!0),q(),window.scrollTo({top:0,behavior:"smooth"}),setTimeout((()=>{$(!1)}),3e3))},disabled:!(u(e)&&u(n)&&g(l)&&Object.keys(S).length)})]})},k=window.wp.blocks,C=window.wp.blockEditor,P=n.p+"images/linear_logo_orange.67bac2cc.png";let T=!1;window.linear_admin_obj&&linear_admin_obj.blocks&&void 0!==linear_admin_obj.blocks.dynamicListings&&(T=linear_admin_obj.blocks.dynamicListings),T&&(0,k.registerBlockType)("linear/dynamic-listings-content",{title:(0,r.__)("Linear dynamic listings content","linear"),description:(0,r.__)("Display dynamically Linear listings and single listings","linear"),category:"widgets",icon:{src:(0,a.createElement)("img",{src:P,style:{width:"20px",height:"20px"}})},supports:{html:!1},attributes:{attributesList:{type:"array",default:[]},className:{type:"string",default:""}},edit:function({attributes:e}){const t=(0,C.useBlockProps)(),n=P||window.linearPluginData?.assetsUrl+"linear_logo_orange.png",i=window.linear_admin_obj?.dynamic_parent_pages||{},l=Object.values(i)[0]+"?guide"||0,[o,d]=(0,a.useState)(e.attributesList||[]),c=e=>{d(e),setAttributes({attributesList:e})},h=(e,t,n)=>{const i=[...o];i[e][t]=n.replace("data-",""),c(i)};return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(C.InspectorControls,{children:(0,_.jsxs)(s.PanelBody,{title:(0,r.__)("Listings Settings","linear"),children:[(0,_.jsx)("p",{children:(0,r.__)("This block will display Linear listings on the frontend.","linear")}),(0,_.jsx)("p",{children:(0,r.__)("You can use attributes to modify both the visual identity as well as what listings are shown.","linear")}),(0,_.jsx)("h3",{children:(0,r.__)("Attributes","linear")}),(0,_.jsx)("p",{children:(0,r.__)('All attributes added here will become data-<Attribute Name>="<Attribute Value>". See all available attributes behind the link.',"linear")}),(0,_.jsx)(s.Button,{variant:"primary",href:l,target:"_blank",style:{marginTop:"10px",marginBottom:"10px"},children:(0,r.__)("See available attributes","linear")}),o.map(((e,t)=>(0,_.jsxs)("div",{style:{marginBottom:"10px"},children:[(0,_.jsx)(s.TextControl,{label:(0,r.__)("Attribute name","linear"),value:e.key,onChange:e=>h(t,"key",e),placeholder:(0,r.__)("eg. use-filters","linear")}),(0,_.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[(0,_.jsx)(s.TextControl,{label:(0,r.__)("Attribute value","linear"),value:e.value,onChange:e=>h(t,"value",e),placeholder:(0,r.__)("eg. false","linear"),style:{flex:"1",width:"100%"}}),(0,_.jsx)(s.Button,{isDestructive:!0,onClick:()=>(e=>{const t=o.filter(((t,n)=>n!==e));c(t)})(t),style:{padding:"0",background:"none",border:"none",color:"red",cursor:"pointer"},children:(0,_.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",width:"16",height:"16",fill:"red",children:(0,_.jsx)("path",{d:"M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"})})})]})]},t))),(0,_.jsx)(s.Button,{isPrimary:!0,onClick:()=>{c([...o,{key:"",value:""}])},style:{marginBottom:"10px"},children:(0,r.__)("Add attribute","linear")})]})}),(0,_.jsx)("div",{...t,children:(0,_.jsxs)("div",{className:"linear-block-preview",style:{backgroundImage:n?`url(${n})`:"none",backgroundSize:"400px",backgroundPosition:"300px 10px",backgroundRepeat:"no-repeat",padding:"2rem",paddingRight:"45%",border:"2px solid #ef7953",borderRadius:"10px",minHeight:"200px"},children:[(0,_.jsx)("h3",{children:(0,r.__)("Linear dynamic listings","linear")}),(0,_.jsx)("p",{children:(0,r.__)("This block displays a list of property listings using the Linear shortcode.","linear")}),(0,_.jsx)("p",{children:(0,r.__)("The actual content will be loaded on the frontend.","linear")})]})})]})},save:function({attributes:e}){return null}}),(0,k.registerBlockType)("linear/listings",{title:(0,r.__)("Linear listings","linear"),description:(0,r.__)("Display your Linear listings","linear"),category:"widgets",icon:{src:(0,a.createElement)("img",{src:P,style:{width:"20px",height:"20px"}})},supports:{html:!1},attributes:{attributesList:{type:"array",default:[]},className:{type:"string",default:""}},edit:function({attributes:e,setAttributes:t}){const n=(0,C.useBlockProps)(),i=P||window.linearPluginData?.assetsUrl+"linear_logo_orange.png",l=window.linear_admin_obj?.dynamic_parent_pages||{},o=Object.values(l)[0]+"?guide"||0,[d,c]=(0,a.useState)(e.attributesList||[]),h=e=>{c(e),t({attributesList:e})},u=(e,t,n)=>{const i=[...d];i[e][t]=n.replace("data-",""),h(i)};return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(C.InspectorControls,{children:(0,_.jsxs)(s.PanelBody,{title:(0,r.__)("Listings Settings","linear"),children:[(0,_.jsx)("p",{children:(0,r.__)("This block will display Linear listings on the frontend.","linear")}),(0,_.jsx)("p",{children:(0,r.__)("You can use attributes to modify both the visual identity as well as what listings are shown.","linear")}),(0,_.jsx)("h3",{children:(0,r.__)("Attributes","linear")}),(0,_.jsx)("p",{children:(0,r.__)('All attributes added here will become data-<Attribute Name>="<Attribute Value>". See all available attributes behind the link.',"linear")}),(0,_.jsx)(s.Button,{variant:"primary",href:o,target:"_blank",style:{marginTop:"10px",marginBottom:"10px"},children:(0,r.__)("See available attributes","linear")}),d.map(((e,t)=>(0,_.jsxs)("div",{style:{marginBottom:"10px"},children:[(0,_.jsx)(s.TextControl,{label:(0,r.__)("Attribute name","linear"),value:e.key,onChange:e=>u(t,"key",e),placeholder:(0,r.__)("eg. use-filters","linear")}),(0,_.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[(0,_.jsx)(s.TextControl,{label:(0,r.__)("Attribute value","linear"),value:e.value,onChange:e=>u(t,"value",e),placeholder:(0,r.__)("eg. false","linear"),style:{flex:"1",width:"100%"}}),(0,_.jsx)(s.Button,{isDestructive:!0,onClick:()=>(e=>{const t=d.filter(((t,n)=>n!==e));h(t)})(t),style:{padding:"0",background:"none",border:"none",color:"red",cursor:"pointer"},children:(0,_.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",width:"16",height:"16",fill:"red",children:(0,_.jsx)("path",{d:"M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"})})})]})]},t))),(0,_.jsx)(s.Button,{isPrimary:!0,onClick:()=>{h([...d,{key:"",value:""}])},style:{marginBottom:"10px"},children:(0,r.__)("Add attribute","linear")})]})}),(0,_.jsx)("div",{...n,children:(0,_.jsxs)("div",{className:"linear-block-preview",style:{backgroundImage:i?`url(${i})`:void 0,backgroundSize:"400px",backgroundPosition:"300px 10px",backgroundRepeat:"no-repeat",padding:"2rem",paddingRight:"45%",border:"2px solid #ef7953",borderRadius:"10px",minHeight:"200px"},children:[(0,_.jsx)("h2",{children:(0,r.__)("Linear Listings","linear")}),(0,_.jsx)("p",{children:(0,r.__)("This block displays a list of property listings.","linear")}),(0,_.jsx)("p",{children:(0,r.__)("The actual content will be loaded on the frontend.","linear")})]})})]})},save:function({attributes:e}){return null}}),l()((()=>{document.getElementById("linear-react-settings")&&(0,a.createRoot)(document.getElementById("linear-react-settings")).render((0,_.jsx)(S,{}))}))}},n={};function i(e){var l=n[e];if(void 0!==l)return l.exports;var a=n[e]={exports:{}};return t[e](a,a.exports,i),a.exports}i.m=t,e=[],i.O=(t,n,l,a)=>{if(!n){var r=1/0;for(c=0;c<e.length;c++){for(var[n,l,a]=e[c],s=!0,o=0;o<n.length;o++)(!1&a||r>=a)&&Object.keys(i.O).every((e=>i.O[e](n[o])))?n.splice(o--,1):(s=!1,a<r&&(r=a));if(s){e.splice(c--,1);var d=l();void 0!==d&&(t=d)}}return t}a=a||0;for(var c=e.length;c>0&&e[c-1][2]>a;c--)e[c]=e[c-1];e[c]=[n,l,a]},i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;i.g.importScripts&&(e=i.g.location+"");var t=i.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var l=n.length-1;l>-1&&(!e||!/^http(s?):/.test(e));)e=n[l--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=e})(),(()=>{var e={57:0,350:0};i.O.j=t=>0===e[t];var t=(t,n)=>{var l,a,[r,s,o]=n,d=0;if(r.some((t=>0!==e[t]))){for(l in s)i.o(s,l)&&(i.m[l]=s[l]);if(o)var c=o(i)}for(t&&t(n);d<r.length;d++)a=r[d],i.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return i.O(c)},n=globalThis.webpackChunk=globalThis.webpackChunk||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var l=i.O(void 0,[350],(()=>i(345)));l=i.O(l)})(); 1 /******/ (() => { // webpackBootstrap 2 /******/ "use strict"; 3 /******/ var __webpack_modules__ = ({ 4 5 /***/ "./src/assets/linear_logo_orange.png": 6 /*!*******************************************!*\ 7 !*** ./src/assets/linear_logo_orange.png ***! 8 \*******************************************/ 9 /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 10 11 module.exports = __webpack_require__.p + "images/linear_logo_orange.67bac2cc.png"; 12 13 /***/ }), 14 15 /***/ "./src/blocks/dynamic-listings/edit.js": 16 /*!*********************************************!*\ 17 !*** ./src/blocks/dynamic-listings/edit.js ***! 18 \*********************************************/ 19 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 20 21 __webpack_require__.r(__webpack_exports__); 22 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 23 /* harmony export */ "default": () => (/* binding */ Edit) 24 /* harmony export */ }); 25 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 26 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); 27 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); 28 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__); 29 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 30 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); 31 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 32 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__); 33 /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./editor.scss */ "./src/blocks/dynamic-listings/editor.scss"); 34 /* harmony import */ var _assets_linear_logo_orange_png__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../assets/linear_logo_orange.png */ "./src/assets/linear_logo_orange.png"); 35 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); 36 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__); 37 38 39 40 41 42 43 44 function Edit({ 45 attributes 46 }) { 47 const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)(); 48 const backgroundImage = _assets_linear_logo_orange_png__WEBPACK_IMPORTED_MODULE_5__ || window.linearPluginData?.assetsUrl + 'linear_logo_orange.png'; 49 const dynamicParentPages = window.linear_admin_obj?.dynamic_parent_pages || {}; 50 const firstDynamicParentPage = Object.values(dynamicParentPages)[0] + '?guide' || 0; 51 const [attributesList, setAttributesList] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(attributes.attributesList || []); 52 const updateAttributesList = newList => { 53 setAttributesList(newList); 54 setAttributes({ 55 attributesList: newList 56 }); 57 }; 58 const addKeyValuePair = () => { 59 updateAttributesList([...attributesList, { 60 key: '', 61 value: '' 62 }]); 63 }; 64 const updateKeyValuePair = (index, field, value) => { 65 const updatedList = [...attributesList]; 66 updatedList[index][field] = value.replace('data-', ''); 67 updateAttributesList(updatedList); 68 }; 69 const removeKeyValuePair = index => { 70 const updatedList = attributesList.filter((_, i) => i !== index); 71 updateAttributesList(updatedList); 72 }; 73 return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.Fragment, { 74 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InspectorControls, { 75 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.PanelBody, { 76 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Listings Settings', 'linear'), 77 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p", { 78 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('This block will display Linear listings on the frontend.', 'linear') 79 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p", { 80 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('You can use attributes to modify both the visual identity as well as what listings are shown.', 'linear') 81 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("h3", { 82 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Attributes', 'linear') 83 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p", { 84 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('All attributes added here will become data-<Attribute Name>="<Attribute Value>". See all available attributes behind the link.', 'linear') 85 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Button, { 86 variant: "primary", 87 href: firstDynamicParentPage, 88 target: "_blank", 89 style: { 90 marginTop: '10px', 91 marginBottom: '10px' 92 }, 93 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('See available attributes', 'linear') 94 }), attributesList.map((item, index) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div", { 95 style: { 96 marginBottom: '10px' 97 }, 98 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.TextControl, { 99 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Attribute name', 'linear'), 100 value: item.key, 101 onChange: value => updateKeyValuePair(index, 'key', value), 102 placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('eg. use-filters', 'linear') 103 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div", { 104 style: { 105 display: 'flex', 106 alignItems: 'center', 107 gap: '10px' 108 }, 109 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.TextControl, { 110 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Attribute value', 'linear'), 111 value: item.value, 112 onChange: value => updateKeyValuePair(index, 'value', value), 113 placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('eg. false', 'linear'), 114 style: { 115 flex: '1', 116 width: '100%' 117 } 118 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Button, { 119 isDestructive: true, 120 onClick: () => removeKeyValuePair(index), 121 style: { 122 padding: '0', 123 background: 'none', 124 border: 'none', 125 color: 'red', 126 cursor: 'pointer' 127 }, 128 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("svg", { 129 xmlns: "http://www.w3.org/2000/svg", 130 viewBox: "0 0 384 512", 131 width: "16", 132 height: "16", 133 fill: "red", 134 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("path", { 135 d: "M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z" 136 }) 137 }) 138 })] 139 })] 140 }, index)), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Button, { 141 isPrimary: true, 142 onClick: addKeyValuePair, 143 style: { 144 marginBottom: '10px' 145 }, 146 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add attribute', 'linear') 147 })] 148 }) 149 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", { 150 ...blockProps, 151 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div", { 152 className: "linear-block-preview", 153 style: { 154 backgroundImage: backgroundImage ? `url(${backgroundImage})` : 'none', 155 backgroundSize: '400px', 156 backgroundPosition: '300px 10px', 157 backgroundRepeat: 'no-repeat', 158 padding: '2rem', 159 paddingRight: '45%', 160 border: '2px solid #ef7953', 161 borderRadius: '10px', 162 minHeight: '200px' 163 }, 164 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("h3", { 165 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Linear dynamic listings', 'linear') 166 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p", { 167 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('This block displays a list of property listings using the Linear shortcode.', 'linear') 168 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p", { 169 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('The actual content will be loaded on the frontend.', 'linear') 170 })] 171 }) 172 })] 173 }); 174 } 175 176 /***/ }), 177 178 /***/ "./src/blocks/dynamic-listings/editor.scss": 179 /*!*************************************************!*\ 180 !*** ./src/blocks/dynamic-listings/editor.scss ***! 181 \*************************************************/ 182 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 183 184 __webpack_require__.r(__webpack_exports__); 185 // extracted by mini-css-extract-plugin 186 187 188 /***/ }), 189 190 /***/ "./src/blocks/dynamic-listings/index.js": 191 /*!**********************************************!*\ 192 !*** ./src/blocks/dynamic-listings/index.js ***! 193 \**********************************************/ 194 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 195 196 __webpack_require__.r(__webpack_exports__); 197 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 198 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__); 199 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 200 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); 201 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 202 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); 203 /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./edit */ "./src/blocks/dynamic-listings/edit.js"); 204 /* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./save */ "./src/blocks/dynamic-listings/save.js"); 205 /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./style.scss */ "./src/blocks/dynamic-listings/style.scss"); 206 /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./editor.scss */ "./src/blocks/dynamic-listings/editor.scss"); 207 /* harmony import */ var _assets_linear_logo_orange_png__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../assets/linear_logo_orange.png */ "./src/assets/linear_logo_orange.png"); 208 209 210 211 212 213 214 215 216 let renderBlock = false; 217 if (window.linear_admin_obj && linear_admin_obj.blocks && typeof linear_admin_obj.blocks.dynamicListings !== 'undefined') { 218 renderBlock = linear_admin_obj.blocks.dynamicListings; 219 } 220 if (renderBlock) { 221 (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)('linear/dynamic-listings-content', { 222 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Linear dynamic listings content', 'linear'), 223 description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Display dynamically Linear listings and single listings', 'linear'), 224 category: 'widgets', 225 icon: { 226 src: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.createElement)('img', { 227 src: _assets_linear_logo_orange_png__WEBPACK_IMPORTED_MODULE_7__, 228 style: { 229 width: '20px', 230 height: '20px' 231 } 232 }) 233 }, 234 supports: { 235 html: false 236 }, 237 attributes: { 238 attributesList: { 239 type: "array", 240 default: [] 241 }, 242 className: { 243 type: 'string', 244 default: '' 245 } 246 }, 247 edit: _edit__WEBPACK_IMPORTED_MODULE_3__["default"], 248 save: _save__WEBPACK_IMPORTED_MODULE_4__["default"] 249 }); 250 } 251 252 /***/ }), 253 254 /***/ "./src/blocks/dynamic-listings/save.js": 255 /*!*********************************************!*\ 256 !*** ./src/blocks/dynamic-listings/save.js ***! 257 \*********************************************/ 258 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 259 260 __webpack_require__.r(__webpack_exports__); 261 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 262 /* harmony export */ "default": () => (/* binding */ Save) 263 /* harmony export */ }); 264 function Save({ 265 attributes 266 }) { 267 return null; 268 } 269 270 /***/ }), 271 272 /***/ "./src/blocks/dynamic-listings/style.scss": 273 /*!************************************************!*\ 274 !*** ./src/blocks/dynamic-listings/style.scss ***! 275 \************************************************/ 276 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 277 278 __webpack_require__.r(__webpack_exports__); 279 // extracted by mini-css-extract-plugin 280 281 282 /***/ }), 283 284 /***/ "./src/blocks/listings/edit.js": 285 /*!*************************************!*\ 286 !*** ./src/blocks/listings/edit.js ***! 287 \*************************************/ 288 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 289 290 __webpack_require__.r(__webpack_exports__); 291 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 292 /* harmony export */ "default": () => (/* binding */ Edit) 293 /* harmony export */ }); 294 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 295 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); 296 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); 297 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__); 298 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 299 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); 300 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 301 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__); 302 /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./editor.scss */ "./src/blocks/listings/editor.scss"); 303 /* harmony import */ var _assets_linear_logo_orange_png__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../assets/linear_logo_orange.png */ "./src/assets/linear_logo_orange.png"); 304 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); 305 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__); 306 307 308 309 310 311 312 313 function Edit({ 314 attributes, 315 setAttributes 316 }) { 317 const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)(); 318 const backgroundImage = _assets_linear_logo_orange_png__WEBPACK_IMPORTED_MODULE_5__ || window.linearPluginData?.assetsUrl + 'linear_logo_orange.png'; 319 const dynamicParentPages = window.linear_admin_obj?.dynamic_parent_pages || {}; 320 const firstDynamicParentPage = Object.values(dynamicParentPages)[0] + '?guide' || 0; 321 const [attributesList, setAttributesList] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(attributes.attributesList || []); 322 const updateAttributesList = newList => { 323 setAttributesList(newList); 324 setAttributes({ 325 attributesList: newList 326 }); 327 }; 328 const addKeyValuePair = () => { 329 updateAttributesList([...attributesList, { 330 key: '', 331 value: '' 332 }]); 333 }; 334 const updateKeyValuePair = (index, field, value) => { 335 const updatedList = [...attributesList]; 336 updatedList[index][field] = value.replace('data-', ''); 337 updateAttributesList(updatedList); 338 }; 339 const removeKeyValuePair = index => { 340 const updatedList = attributesList.filter((_, i) => i !== index); 341 updateAttributesList(updatedList); 342 }; 343 return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.Fragment, { 344 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InspectorControls, { 345 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.PanelBody, { 346 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Listings Settings', 'linear'), 347 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p", { 348 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('This block will display Linear listings on the frontend.', 'linear') 349 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p", { 350 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('You can use attributes to modify both the visual identity as well as what listings are shown.', 'linear') 351 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("h3", { 352 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Attributes', 'linear') 353 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p", { 354 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('All attributes added here will become data-<Attribute Name>="<Attribute Value>". See all available attributes behind the link.', 'linear') 355 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Button, { 356 variant: "primary", 357 href: firstDynamicParentPage, 358 target: "_blank", 359 style: { 360 marginTop: '10px', 361 marginBottom: '10px' 362 }, 363 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('See available attributes', 'linear') 364 }), attributesList.map((item, index) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div", { 365 style: { 366 marginBottom: '10px' 367 }, 368 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.TextControl, { 369 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Attribute name', 'linear'), 370 value: item.key, 371 onChange: value => updateKeyValuePair(index, 'key', value), 372 placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('eg. use-filters', 'linear') 373 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div", { 374 style: { 375 display: 'flex', 376 alignItems: 'center', 377 gap: '10px' 378 }, 379 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.TextControl, { 380 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Attribute value', 'linear'), 381 value: item.value, 382 onChange: value => updateKeyValuePair(index, 'value', value), 383 placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('eg. false', 'linear'), 384 style: { 385 flex: '1', 386 width: '100%' 387 } 388 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Button, { 389 isDestructive: true, 390 onClick: () => removeKeyValuePair(index), 391 style: { 392 padding: '0', 393 background: 'none', 394 border: 'none', 395 color: 'red', 396 cursor: 'pointer' 397 }, 398 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("svg", { 399 xmlns: "http://www.w3.org/2000/svg", 400 viewBox: "0 0 384 512", 401 width: "16", 402 height: "16", 403 fill: "red", 404 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("path", { 405 d: "M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z" 406 }) 407 }) 408 })] 409 })] 410 }, index)), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Button, { 411 isPrimary: true, 412 onClick: addKeyValuePair, 413 style: { 414 marginBottom: '10px' 415 }, 416 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add attribute', 'linear') 417 })] 418 }) 419 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", { 420 ...blockProps, 421 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div", { 422 className: "linear-block-preview", 423 style: { 424 backgroundImage: backgroundImage ? `url(${backgroundImage})` : undefined, 425 backgroundSize: '400px', 426 backgroundPosition: '300px 10px', 427 backgroundRepeat: 'no-repeat', 428 padding: '2rem', 429 paddingRight: '45%', 430 border: '2px solid #ef7953', 431 borderRadius: '10px', 432 minHeight: '200px' 433 }, 434 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("h2", { 435 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Linear Listings', 'linear') 436 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p", { 437 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('This block displays a list of property listings.', 'linear') 438 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p", { 439 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('The actual content will be loaded on the frontend.', 'linear') 440 })] 441 }) 442 })] 443 }); 444 } 445 446 /***/ }), 447 448 /***/ "./src/blocks/listings/editor.scss": 449 /*!*****************************************!*\ 450 !*** ./src/blocks/listings/editor.scss ***! 451 \*****************************************/ 452 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 453 454 __webpack_require__.r(__webpack_exports__); 455 // extracted by mini-css-extract-plugin 456 457 458 /***/ }), 459 460 /***/ "./src/blocks/listings/index.js": 461 /*!**************************************!*\ 462 !*** ./src/blocks/listings/index.js ***! 463 \**************************************/ 464 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 465 466 __webpack_require__.r(__webpack_exports__); 467 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 468 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__); 469 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 470 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); 471 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 472 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); 473 /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./edit */ "./src/blocks/listings/edit.js"); 474 /* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./save */ "./src/blocks/listings/save.js"); 475 /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./style.scss */ "./src/blocks/listings/style.scss"); 476 /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./editor.scss */ "./src/blocks/listings/editor.scss"); 477 /* harmony import */ var _assets_linear_logo_orange_png__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../assets/linear_logo_orange.png */ "./src/assets/linear_logo_orange.png"); 478 479 480 481 482 483 484 485 486 (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)('linear/listings', { 487 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Linear listings', 'linear'), 488 description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Display your Linear listings', 'linear'), 489 category: 'widgets', 490 icon: { 491 src: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.createElement)('img', { 492 src: _assets_linear_logo_orange_png__WEBPACK_IMPORTED_MODULE_7__, 493 style: { 494 width: '20px', 495 height: '20px' 496 } 497 }) 498 }, 499 supports: { 500 html: false 501 }, 502 attributes: { 503 attributesList: { 504 type: "array", 505 default: [] 506 }, 507 className: { 508 type: 'string', 509 default: '' 510 } 511 }, 512 edit: _edit__WEBPACK_IMPORTED_MODULE_3__["default"], 513 save: _save__WEBPACK_IMPORTED_MODULE_4__["default"] 514 }); 515 516 /***/ }), 517 518 /***/ "./src/blocks/listings/save.js": 519 /*!*************************************!*\ 520 !*** ./src/blocks/listings/save.js ***! 521 \*************************************/ 522 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 523 524 __webpack_require__.r(__webpack_exports__); 525 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 526 /* harmony export */ "default": () => (/* binding */ Save) 527 /* harmony export */ }); 528 function Save({ 529 attributes 530 }) { 531 return null; 532 } 533 534 /***/ }), 535 536 /***/ "./src/blocks/listings/style.scss": 537 /*!****************************************!*\ 538 !*** ./src/blocks/listings/style.scss ***! 539 \****************************************/ 540 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 541 542 __webpack_require__.r(__webpack_exports__); 543 // extracted by mini-css-extract-plugin 544 545 546 /***/ }), 547 548 /***/ "./src/components/index.js": 549 /*!*********************************!*\ 550 !*** ./src/components/index.js ***! 551 \*********************************/ 552 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 553 554 __webpack_require__.r(__webpack_exports__); 555 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 556 /* harmony export */ SettingsPage: () => (/* reexport safe */ _settings_page__WEBPACK_IMPORTED_MODULE_0__.SettingsPage) 557 /* harmony export */ }); 558 /* harmony import */ var _settings_page__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./settings-page */ "./src/components/settings-page.jsx"); 559 560 561 /***/ }), 562 563 /***/ "./src/components/notices.jsx": 564 /*!************************************!*\ 565 !*** ./src/components/notices.jsx ***! 566 \************************************/ 567 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 568 569 __webpack_require__.r(__webpack_exports__); 570 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 571 /* harmony export */ Notices: () => (/* binding */ Notices) 572 /* harmony export */ }); 573 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 574 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); 575 /* harmony import */ var _wordpress_notices__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/notices */ "@wordpress/notices"); 576 /* harmony import */ var _wordpress_notices__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_notices__WEBPACK_IMPORTED_MODULE_1__); 577 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 578 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); 579 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); 580 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__); 581 582 583 584 585 const Notices = () => { 586 const { 587 removeNotice 588 } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.useDispatch)(_wordpress_notices__WEBPACK_IMPORTED_MODULE_1__.store); 589 const notices = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_wordpress_notices__WEBPACK_IMPORTED_MODULE_1__.store).getNotices()); 590 if (notices.length === 0) { 591 return null; 592 } 593 return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.NoticeList, { 594 notices: notices, 595 onRemove: removeNotice 596 }); 597 }; 598 599 600 /***/ }), 601 602 /***/ "./src/components/page-selector.jsx": 603 /*!******************************************!*\ 604 !*** ./src/components/page-selector.jsx ***! 605 \******************************************/ 606 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 607 608 __webpack_require__.r(__webpack_exports__); 609 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 610 /* harmony export */ PageSelector: () => (/* binding */ PageSelector) 611 /* harmony export */ }); 612 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 613 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); 614 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 615 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); 616 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); 617 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__); 618 619 620 621 const PageSelector = ({ 622 label, 623 value, 624 pages, 625 onChange, 626 help, 627 showLink = true, 628 getLinkForLanguagePage, 629 getTitleForLanguagePage 630 }) => { 631 return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", { 632 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.SelectControl, { 633 label: label, 634 value: value, 635 options: [{ 636 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Select a page...', 'linear'), 637 value: '' 638 }, ...(pages ? pages.map(page => ({ 639 label: page.title.raw, 640 value: page.id 641 })) : [])], 642 onChange: onChange, 643 help: help 644 }), showLink && value && pages && getLinkForLanguagePage ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", { 645 style: { 646 marginTop: '5px' 647 }, 648 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("p", { 649 children: [(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Link to page: ', 'linear'), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("a", { 650 href: getLinkForLanguagePage(), 651 target: "_blank", 652 rel: "noopener noreferrer", 653 children: getTitleForLanguagePage() 654 })] 655 }) 656 }) : ''] 657 }); 658 }; 659 660 661 /***/ }), 662 663 /***/ "./src/components/settings-page.jsx": 664 /*!******************************************!*\ 665 !*** ./src/components/settings-page.jsx ***! 666 \******************************************/ 667 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 668 669 __webpack_require__.r(__webpack_exports__); 670 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 671 /* harmony export */ SettingsPage: () => (/* binding */ SettingsPage) 672 /* harmony export */ }); 673 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 674 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); 675 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 676 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); 677 /* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../hooks */ "./src/hooks/index.js"); 678 /* harmony import */ var _notices__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./notices */ "./src/components/notices.jsx"); 679 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 680 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_4__); 681 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 682 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__); 683 /* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/core-data */ "@wordpress/core-data"); 684 /* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_6__); 685 /* harmony import */ var _utils_validators__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/validators */ "./src/utils/validators.js"); 686 /* harmony import */ var _page_selector__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./page-selector */ "./src/components/page-selector.jsx"); 687 /* harmony import */ var _utils_language_utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../utils/language-utils */ "./src/utils/language-utils.js"); 688 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); 689 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__); 690 691 692 693 694 695 696 // import { store as noticesStore } from '@wordpress/notices'; 697 698 699 700 701 // import { MessageControl } from './controls'; 702 703 /* 704 const SettingsTitle = () => { 705 return ( 706 <Heading level={ 1 }> 707 { __( 'Linear Announcement Bar', 'linear' ) } 708 </Heading> 709 ); 710 }; 711 */ 712 713 const SaveButton = ({ 714 onClick, 715 disabled 716 }) => { 717 return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Button, { 718 variant: "primary", 719 onClick: onClick, 720 __next40pxDefaultSize: true, 721 disabled: disabled, 722 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Save', 'linear') 723 }); 724 }; 725 const SettingsPage = () => { 726 const { 727 appUrl, 728 setAppUrl, 729 dataUrl, 730 setDataUrl, 731 clientSecret, 732 setClientSecret, 733 dynamicParentPages, 734 setDynamicParentPages, 735 renderingMethod, 736 setRenderingMethod, 737 shortcodeRenderingMethod, 738 setShortcodeRenderingMethod, 739 useTestData, 740 setUseTestData, 741 listingLeadsIntegration, 742 setListingLeadsIntegration, 743 featuredImage, 744 setFeaturedImage, 745 themeColor, 746 setThemeColor, 747 resultsPerPage, 748 setResultsPerPage, 749 customCss, 750 setCustomCss, 751 customCssSrc, 752 setCustomCssSrc, 753 additionalSettings, 754 setAdditionalSettings, 755 saveSettings 756 } = (0,_hooks__WEBPACK_IMPORTED_MODULE_2__.useSettings)(); 757 const [isSaving, setIsSaving] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useState)(false); 758 const [detectedLanguages, setDetectedLanguages] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useState)(['fi']); 759 const { 760 isMobile 761 } = (0,_hooks__WEBPACK_IMPORTED_MODULE_2__.useResponsive)(); 762 const exceptions = window.linear_admin_obj.exception_rules || []; 763 764 // Fetch available languages from the REST API 765 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useEffect)(() => { 766 const fetchLanguages = async () => { 767 try { 768 const response = await fetch('/wp-json/linear/v3/languages', { 769 headers: { 770 'X-WP-Nonce': linear_admin_obj.rest.nonce 771 } 772 }); 773 if (!response.ok) { 774 throw new Error('Failed to fetch languages'); 775 } 776 const languages = await response.json(); 777 setDetectedLanguages(languages); 778 } catch (error) { 779 console.error('Error fetching languages:', error); 780 const languages = [document.getElementsByTagName('html')[0].getAttribute('lang') || 'fi']; 781 setDetectedLanguages(languages); 782 } 783 }; 784 fetchLanguages(); 785 }, []); 786 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useEffect)(() => { 787 const cleanedPages = {}; 788 detectedLanguages.forEach(lang => { 789 if (dynamicParentPages[lang]) { 790 cleanedPages[lang] = dynamicParentPages[lang]; 791 } 792 }); 793 if (JSON.stringify(cleanedPages) !== JSON.stringify(dynamicParentPages)) { 794 setDynamicParentPages(cleanedPages); 795 } 796 }, [detectedLanguages, dynamicParentPages]); 797 const handleSaveSettings = () => { 798 if (isSaving) { 799 return; 800 } 801 setIsSaving(true); 802 saveSettings(); 803 window.scrollTo({ 804 top: 0, 805 behavior: 'smooth' 806 }); 807 808 // Stop save spamming 809 setTimeout(() => { 810 setIsSaving(false); 811 }, 3000); 812 }; 813 const pages = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => { 814 const query = { 815 per_page: -1, 816 status: 'publish' 817 }; 818 const fetchedPages = select(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_6__.store).getEntityRecords('postType', 'page', query); 819 return fetchedPages; 820 }, []); 821 const languageSelectorStyles = { 822 languageSection: { 823 marginBottom: '20px', 824 padding: '15px', 825 backgroundColor: '#f9f9f9', 826 borderRadius: '4px', 827 border: '1px solid #e0e0e0' 828 }, 829 languageTitle: { 830 marginTop: '0', 831 marginBottom: '10px', 832 fontSize: '14px', 833 fontWeight: 'bold', 834 textTransform: 'capitalize' 835 } 836 }; 837 const styleTextControl = { 838 padding: '10px', 839 fontSize: '16px' 840 }; 841 const styleTextControlError = { 842 borderColor: 'red', 843 backgroundColor: '#ffe6e6' 844 }; 845 const styleRenderMethodContainer = { 846 display: 'flex', 847 flexDirection: isMobile ? 'column' : 'row', 848 gap: isMobile ? '1rem' : '2rem', 849 width: '100%' 850 }; 851 const styleRenderMethodItem = { 852 flex: isMobile ? '1 1 100%' : '1', 853 minWidth: isMobile ? '100%' : '0' 854 }; 855 const openMediaLibrary = () => { 856 const mediaFrame = wp.media({ 857 title: 'Select or Upload Media', 858 button: { 859 text: 'Use this media' 860 }, 861 multiple: false 862 }); 863 mediaFrame.on('select', function () { 864 const attachment = mediaFrame.state().get('selection').first().toJSON(); 865 setFeaturedImage(attachment.url); 866 }); 867 mediaFrame.open(); 868 }; 869 let firstDynamicParentPage = '#'; 870 if (detectedLanguages.length > 0) { 871 const firstLanguage = detectedLanguages[0]; 872 firstDynamicParentPage = (0,_utils_language_utils__WEBPACK_IMPORTED_MODULE_9__.getLinkForLanguagePage)(dynamicParentPages, pages, detectedLanguages, firstLanguage) + '?guide'; 873 } 874 return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.Fragment, { 875 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_notices__WEBPACK_IMPORTED_MODULE_3__.Notices, {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Panel, { 876 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelBody, { 877 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Setup', 'linear'), 878 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelRow, { 879 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("blockquote", { 880 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 881 style: { 882 flex: '1' 883 }, 884 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHeading, { 885 level: 4, 886 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('App URL', 'linear') 887 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("br", {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.TextControl, { 888 value: appUrl, 889 onChange: value => setAppUrl(value), 890 style: { 891 ...styleTextControl, 892 ...(appUrl !== '' && !(0,_utils_validators__WEBPACK_IMPORTED_MODULE_7__.validateUrl)(appUrl) ? styleTextControlError : {}) 893 }, 894 placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('https://...', 'linear'), 895 help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('A source for listings view', 'linear') 896 })] 897 }) 898 }) 899 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelRow, { 900 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("blockquote", { 901 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 902 style: { 903 flex: '1' 904 }, 905 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHeading, { 906 level: 4, 907 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Data source URL', 'linear') 908 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("br", {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.TextControl, { 909 value: dataUrl, 910 onChange: value => setDataUrl(value), 911 style: { 912 ...styleTextControl, 913 ...(dataUrl !== '' && !(0,_utils_validators__WEBPACK_IMPORTED_MODULE_7__.validateUrl)(dataUrl) ? styleTextControlError : {}) 914 }, 915 placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('https://...', 'linear'), 916 help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Our main data-source', 'linear') 917 })] 918 }) 919 }) 920 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelRow, { 921 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("blockquote", { 922 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 923 style: { 924 flex: '1' 925 }, 926 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHeading, { 927 level: 4, 928 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Client secret', 'linear') 929 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("br", {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.TextControl, { 930 value: clientSecret, 931 onChange: value => setClientSecret(value), 932 style: { 933 ...styleTextControl, 934 ...(clientSecret !== '' && !(0,_utils_validators__WEBPACK_IMPORTED_MODULE_7__.validateClientSecret)(clientSecret) ? styleTextControlError : {}) 935 }, 936 placeholder: "...", 937 help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Linear should provide this for you', 'linear') 938 })] 939 }) 940 }) 941 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelRow, { 942 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("blockquote", { 943 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 944 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHeading, { 945 level: 4, 946 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Dynamic Parent Pages', 'linear') 947 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("br", {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 948 style: { 949 marginLeft: '0rem' 950 }, 951 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 952 style: { 953 marginBottom: '15px' 954 }, 955 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("p", { 956 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('We have to set a dynamic parent page for each language. This is the page that will be used to load the listings dynamically. You might want to create a page dedicated for this purpose, if you haven\'t already done that.', 'linear') 957 }), exceptions.includes('translatePress') && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("p", { 958 style: { 959 fontWeight: 'bold', 960 textDecoration: 'underline' 961 }, 962 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('If you are using TranslatePress, you can only have one set dynamic parent page, but the content will be determed by the TranslatePress selected language.', 'linear') 963 })] 964 }), detectedLanguages.map(lang => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 965 style: languageSelectorStyles.languageSection, 966 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("h3", { 967 style: languageSelectorStyles.languageTitle, 968 children: lang 969 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_page_selector__WEBPACK_IMPORTED_MODULE_8__.PageSelector, { 970 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Select any page to use as parent for', 'linear') + ' ' + lang, 971 value: (0,_utils_language_utils__WEBPACK_IMPORTED_MODULE_9__.getPageForLanguage)(dynamicParentPages, detectedLanguages, lang), 972 pages: (0,_utils_language_utils__WEBPACK_IMPORTED_MODULE_9__.getFilteredPages)(pages, detectedLanguages, lang), 973 onChange: value => setDynamicParentPages((0,_utils_language_utils__WEBPACK_IMPORTED_MODULE_9__.handlePageSelect)(value, dynamicParentPages, detectedLanguages, lang, exceptions)), 974 getLinkForLanguagePage: () => (0,_utils_language_utils__WEBPACK_IMPORTED_MODULE_9__.getLinkForLanguagePage)(dynamicParentPages, pages, detectedLanguages, lang), 975 getTitleForLanguagePage: () => (0,_utils_language_utils__WEBPACK_IMPORTED_MODULE_9__.getTitleForLanguagePage)(dynamicParentPages, pages, detectedLanguages, lang) 976 })] 977 }, lang)), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", { 978 style: { 979 marginTop: '15px', 980 fontSize: '13px', 981 fontStyle: 'italic' 982 }, 983 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Changing parent pages will flush rewrite rules to ensure proper URL handling.', 'linear') 984 })] 985 })] 986 }) 987 }) 988 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelRow, { 989 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("blockquote", { 990 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 991 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHeading, { 992 level: 4, 993 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Rendering method', 'linear') 994 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("br", {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 995 style: styleRenderMethodContainer, 996 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", { 997 style: styleRenderMethodItem, 998 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.SelectControl, { 999 value: renderingMethod, 1000 options: [{ 1001 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Inline (default)', 'linear'), 1002 value: 'inline' 1003 }, { 1004 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Shortcode', 'linear'), 1005 value: 'shortcode' 1006 }, { 1007 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Gutenberg block', 'linear'), 1008 value: 'gutenberg' 1009 }], 1010 onChange: value => setRenderingMethod(value), 1011 help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Decide on how you wish the content to be shown. If you have a custom WordPress solution, you might be better off by using the Shortcode option.', 'linear'), 1012 style: { 1013 flex: '1' 1014 } 1015 }) 1016 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 1017 style: styleRenderMethodItem, 1018 children: [renderingMethod === 'inline' ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("p", { 1019 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('The content will be rendered inline after the page main content.', 'linear') 1020 }) : '', renderingMethod === 'shortcode' ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 1021 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("p", { 1022 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('The dynamic content will be rendered via a shortcode. You can place the shortcode anywhere on your selected page. That page will be used to dynamically load Linear listings.', 'linear') 1023 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("p", { 1024 children: [(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('The shortcode is:', 'linear'), ' ', /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("code", { 1025 children: "[linear_listings_content]" 1026 })] 1027 })] 1028 }) : '', renderingMethod === 'gutenberg' ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 1029 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("p", { 1030 children: detectedLanguages.length > 1 ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Please add the Gutenberg block "Linear dynamic listings" to the pages: ', 'linear') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Please add the Gutenberg block "Linear dynamic listings" to the page: ', 'linear') 1031 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", { 1032 style: { 1033 display: 'flex', 1034 flexDirection: 'column' 1035 }, 1036 children: dynamicParentPages && Object.entries(dynamicParentPages).reduce((acc, [lang, id]) => { 1037 if (!acc.some(([_, existingId]) => existingId === id)) { 1038 acc.push([lang, id]); 1039 } 1040 return acc; 1041 }, []).map(([lang, id]) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("a", { 1042 href: (0,_utils_language_utils__WEBPACK_IMPORTED_MODULE_9__.getLinkForLanguagePage)(dynamicParentPages, pages, detectedLanguages, lang), 1043 children: (0,_utils_language_utils__WEBPACK_IMPORTED_MODULE_9__.getTitleForLanguagePage)(dynamicParentPages, pages, detectedLanguages, lang) 1044 }, id)) 1045 })] 1046 }) : ''] 1047 }), renderingMethod === 'shortcode' ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", { 1048 style: styleRenderMethodItem, 1049 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.SelectControl, { 1050 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Shortcode rendering method', 'linear'), 1051 value: shortcodeRenderingMethod, 1052 options: [{ 1053 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Should render both single listings and a list of listings', 'linear'), 1054 value: 'default' 1055 }, { 1056 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Should only render single listings', 'linear'), 1057 value: 'single' 1058 }], 1059 onChange: value => setShortcodeRenderingMethod(value), 1060 help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('By default, we render both single listings and the list of listings in the same place. If you want to render only single listings, and provide the list listings via e.g. a shortcode or block, you can adjust this option.', 'linear'), 1061 style: { 1062 flex: '1' 1063 } 1064 }) 1065 }) : ''] 1066 })] 1067 }) 1068 }) 1069 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelRow, { 1070 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("blockquote", { 1071 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 1072 style: {}, 1073 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHeading, { 1074 level: 4, 1075 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Use test data', 'linear') 1076 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("br", {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.ToggleControl, { 1077 checked: useTestData, 1078 onChange: () => setUseTestData(state => !state), 1079 __nextHasNoMarginBottom: true, 1080 help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('In case you are given credentials that are meant for testing purposes, you might need to enable this specific test-data mode', 'linear') 1081 })] 1082 }) 1083 }) 1084 })] 1085 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelBody, { 1086 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Global settings', 'linear'), 1087 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("p", { 1088 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('These settings are automatically applied to all listings, but can be overwritten on a per-listing basis', 'linear') 1089 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelRow, { 1090 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("blockquote", { 1091 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 1092 style: {}, 1093 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHeading, { 1094 level: 4, 1095 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Contact form integration', 'linear') 1096 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("br", {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.ToggleControl, { 1097 checked: listingLeadsIntegration, 1098 onChange: () => setListingLeadsIntegration(state => !state), 1099 __nextHasNoMarginBottom: true, 1100 help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('In case you have Leads activates for your account, you can activate them for your listings with this toggle. If however not, please contact Linear and we will sort it out for you.', 'linear') 1101 })] 1102 }) 1103 }) 1104 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelRow, { 1105 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("blockquote", { 1106 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 1107 style: { 1108 flex: '1' 1109 }, 1110 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHeading, { 1111 level: 4, 1112 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Default results per page', 'linear') 1113 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("br", {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("input", { 1114 type: "number", 1115 value: resultsPerPage, 1116 onChange: event => setResultsPerPage(event.target.value), 1117 placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('4', 'linear'), 1118 style: { 1119 padding: '8px', 1120 fontSize: '14px' 1121 } 1122 })] 1123 }) 1124 }) 1125 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelRow, { 1126 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("blockquote", { 1127 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 1128 style: { 1129 width: '100%' 1130 }, 1131 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHeading, { 1132 level: 4, 1133 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Theme Color', 'linear') 1134 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("p", { 1135 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Select a theme color to be used across the plugin.', 'linear') 1136 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 1137 style: { 1138 display: 'flex', 1139 gap: '0.5rem', 1140 alignItems: 'center', 1141 marginBottom: '1rem' 1142 }, 1143 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("span", { 1144 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Selected Color:', 'linear') 1145 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("span", { 1146 style: { 1147 display: 'inline-block', 1148 width: '20px', 1149 height: '20px', 1150 backgroundColor: themeColor, 1151 border: '1px solid #ccc', 1152 marginLeft: '5px', 1153 borderRadius: '100px' 1154 } 1155 })] 1156 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.ColorPicker, { 1157 color: themeColor, 1158 onChangeComplete: color => setThemeColor(color.hex), 1159 disableAlpha: true 1160 })] 1161 }) 1162 }) 1163 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelRow, { 1164 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("blockquote", { 1165 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 1166 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHeading, { 1167 level: 4, 1168 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Featured image', 'linear') 1169 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("p", { 1170 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Select or upload an image to be used as the brand feature image. Most often this is the logo of the company.', 'linear') 1171 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Button, { 1172 variant: "primary", 1173 onClick: openMediaLibrary, 1174 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Select Image', 'linear') 1175 }), featuredImage && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 1176 style: { 1177 marginTop: '10px' 1178 }, 1179 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("img", { 1180 src: featuredImage, 1181 alt: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Selected Image', 'linear'), 1182 style: { 1183 maxWidth: '100%', 1184 maxHeight: '120px', 1185 height: 'auto', 1186 border: '1px solid #ccc' 1187 } 1188 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("br", {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Button, { 1189 onClick: () => setFeaturedImage(''), 1190 variant: "link", 1191 isDestructive: true, 1192 style: { 1193 marginTop: '10px' 1194 }, 1195 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Remove Image', 'linear') 1196 })] 1197 })] 1198 }) 1199 }) 1200 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelRow, { 1201 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("blockquote", { 1202 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 1203 style: { 1204 flex: '1' 1205 }, 1206 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHeading, { 1207 level: 4, 1208 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Custom CSS', 'linear') 1209 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("br", {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("textarea", { 1210 value: customCss, 1211 onChange: event => setCustomCss(event.target.value), 1212 placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Enter your custom CSS here...', 'linear'), 1213 style: { 1214 width: '100%', 1215 padding: '8px', 1216 fontSize: '14px', 1217 minHeight: '100px' 1218 } 1219 })] 1220 }) 1221 }) 1222 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelRow, { 1223 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("blockquote", { 1224 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 1225 style: { 1226 flex: '1' 1227 }, 1228 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHeading, { 1229 level: 4, 1230 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Custom CSS source', 'linear') 1231 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("br", {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("input", { 1232 type: "string", 1233 value: customCssSrc, 1234 onChange: event => setCustomCssSrc(event.target.value), 1235 placeholder: window.location.origin + '/custom-styles.css', 1236 style: { 1237 width: '100%', 1238 padding: '8px', 1239 fontSize: '14px' 1240 } 1241 })] 1242 }) 1243 }) 1244 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelRow, { 1245 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("blockquote", { 1246 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 1247 style: { 1248 flex: '1' 1249 }, 1250 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHeading, { 1251 level: 4, 1252 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Additional global settings', 'linear') 1253 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("p", { 1254 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('You can define here other globally used settings. These can be overwritten on a per-listing basis, but are as default applied to all listings.', 'linear') 1255 }), firstDynamicParentPage && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Button, { 1256 variant: "primary", 1257 href: firstDynamicParentPage, 1258 style: { 1259 marginTop: '10px' 1260 }, 1261 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('See available attributes', 'linear') 1262 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("br", {}), additionalSettings && Array.isArray(additionalSettings) && additionalSettings.length > 0 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", { 1263 style: { 1264 marginTop: '10px' 1265 }, 1266 children: additionalSettings.map((item, index) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 1267 style: { 1268 display: 'flex', 1269 alignItems: 'center', 1270 marginBottom: '10px', 1271 gap: '10px' 1272 }, 1273 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.TextControl, { 1274 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Key', 'linear'), 1275 value: item.key || '', 1276 onChange: value => { 1277 const updatedSettings = additionalSettings.map((setting, i) => i === index ? { 1278 ...setting, 1279 key: value 1280 } : setting); 1281 setAdditionalSettings(updatedSettings); 1282 }, 1283 placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Enter key', 'linear'), 1284 style: { 1285 flex: '1' 1286 } 1287 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.TextControl, { 1288 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Value', 'linear'), 1289 value: item.value || '', 1290 onChange: value => { 1291 const updatedSettings = additionalSettings.map((setting, i) => i === index ? { 1292 ...setting, 1293 value: value 1294 } : setting); 1295 setAdditionalSettings(updatedSettings); 1296 }, 1297 placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Enter value', 'linear'), 1298 style: { 1299 flex: '1' 1300 } 1301 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Button, { 1302 isDestructive: true, 1303 onClick: () => { 1304 setAdditionalSettings(prevSettings => prevSettings.filter((_, i) => i !== index)); 1305 }, 1306 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Remove', 'linear') 1307 })] 1308 }, item.id || `setting-${index}`)) 1309 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Button, { 1310 variant: "primary", 1311 onClick: () => { 1312 const newItem = { 1313 key: '', 1314 value: '' 1315 }; 1316 setAdditionalSettings([...(additionalSettings || []), newItem]); 1317 }, 1318 style: { 1319 marginTop: '10px' 1320 }, 1321 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add additional setting', 'linear') 1322 })] 1323 }) 1324 }) 1325 })] 1326 })] 1327 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(SaveButton, { 1328 onClick: handleSaveSettings, 1329 disabled: !(0,_utils_validators__WEBPACK_IMPORTED_MODULE_7__.validateUrl)(appUrl) || !(0,_utils_validators__WEBPACK_IMPORTED_MODULE_7__.validateUrl)(dataUrl) || !(0,_utils_validators__WEBPACK_IMPORTED_MODULE_7__.validateClientSecret)(clientSecret) || !Object.keys(dynamicParentPages).length 1330 })] 1331 }); 1332 }; 1333 1334 1335 /***/ }), 1336 1337 /***/ "./src/hooks/index.js": 1338 /*!****************************!*\ 1339 !*** ./src/hooks/index.js ***! 1340 \****************************/ 1341 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 1342 1343 __webpack_require__.r(__webpack_exports__); 1344 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 1345 /* harmony export */ useResponsive: () => (/* reexport safe */ _use_responsive__WEBPACK_IMPORTED_MODULE_1__["default"]), 1346 /* harmony export */ useSettings: () => (/* reexport safe */ _use_settings__WEBPACK_IMPORTED_MODULE_0__["default"]) 1347 /* harmony export */ }); 1348 /* harmony import */ var _use_settings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./use-settings */ "./src/hooks/use-settings.js"); 1349 /* harmony import */ var _use_responsive__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./use-responsive */ "./src/hooks/use-responsive.js"); 1350 1351 1352 1353 /***/ }), 1354 1355 /***/ "./src/hooks/use-responsive.js": 1356 /*!*************************************!*\ 1357 !*** ./src/hooks/use-responsive.js ***! 1358 \*************************************/ 1359 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 1360 1361 __webpack_require__.r(__webpack_exports__); 1362 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 1363 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 1364 /* harmony export */ }); 1365 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); 1366 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); 1367 1368 const useResponsive = () => { 1369 const [isMobile, setIsMobile] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(window.innerWidth <= 768); 1370 const [isTablet, setIsTablet] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(window.innerWidth > 768 && window.innerWidth <= 1024); 1371 (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { 1372 const handleResize = () => { 1373 setIsMobile(window.innerWidth <= 768); 1374 setIsTablet(window.innerWidth > 768 && window.innerWidth <= 1024); 1375 }; 1376 window.addEventListener('resize', handleResize); 1377 return () => window.removeEventListener('resize', handleResize); 1378 }, []); 1379 return { 1380 isMobile, 1381 isTablet 1382 }; 1383 }; 1384 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (useResponsive); 1385 1386 /***/ }), 1387 1388 /***/ "./src/hooks/use-settings.js": 1389 /*!***********************************!*\ 1390 !*** ./src/hooks/use-settings.js ***! 1391 \***********************************/ 1392 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 1393 1394 __webpack_require__.r(__webpack_exports__); 1395 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 1396 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 1397 /* harmony export */ }); 1398 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 1399 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); 1400 /* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch"); 1401 /* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_1__); 1402 /* harmony import */ var _wordpress_notices__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/notices */ "@wordpress/notices"); 1403 /* harmony import */ var _wordpress_notices__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_notices__WEBPACK_IMPORTED_MODULE_2__); 1404 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 1405 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__); 1406 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 1407 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__); 1408 /* harmony import */ var _utils_validators__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/validators */ "./src/utils/validators.js"); 1409 1410 1411 1412 1413 1414 1415 const useSettings = () => { 1416 const [appUrl, setAppUrl] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(); 1417 const [dataUrl, setDataUrl] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(); 1418 const [clientSecret, setClientSecret] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(); 1419 const [dynamicParentPages, setDynamicParentPages] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)([]); 1420 const [renderingMethod, setRenderingMethod] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)('inline'); 1421 const [shortcodeRenderingMethod, setShortcodeRenderingMethod] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)('default'); 1422 const [useTestData, setUseTestData] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(false); 1423 const [listingLeadsIntegration, setListingLeadsIntegration] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(false); 1424 const [featuredImage, setFeaturedImage] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(); 1425 const [themeColor, setThemeColor] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(window.linear_admin_obj.theme_default_color || '#ed6a40'); 1426 const [resultsPerPage, setResultsPerPage] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(4); 1427 const [customCss, setCustomCss] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(''); 1428 const [customCssSrc, setCustomCssSrc] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(''); 1429 const [additionalSettings, setAdditionalSettings] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)([]); 1430 const nonce = window.linear_admin_obj.rest.nonce; 1431 const { 1432 removeAllNotices, 1433 createSuccessNotice, 1434 createInfoNotice, 1435 createErrorNotice 1436 } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_4__.useDispatch)(_wordpress_notices__WEBPACK_IMPORTED_MODULE_2__.store); 1437 const apiUrl = window.linear_admin_obj.rest.endpoints.options; 1438 if (!apiUrl || !nonce) { 1439 return; 1440 } 1441 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => { 1442 _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_1___default()({ 1443 path: apiUrl, 1444 method: 'GET', 1445 headers: { 1446 'X-WP-Nonce': nonce 1447 } 1448 }).then(response => { 1449 const parsedOptions = response.options; 1450 setAppUrl(parsedOptions.app_url || ''); 1451 setDataUrl(parsedOptions.data_url || ''); 1452 setClientSecret(parsedOptions.client_secret || ''); 1453 setDynamicParentPages(parsedOptions.dynamic_parent_pages || []); 1454 setRenderingMethod(parsedOptions.rendering_method || 'inline'); 1455 setShortcodeRenderingMethod(parsedOptions.shortcode_rendering_method || 'default'); 1456 setUseTestData(parsedOptions.use_test_data || false); 1457 setListingLeadsIntegration(parsedOptions.listing_leads_integration || false); 1458 setFeaturedImage(parsedOptions.featured_image || ''); 1459 setThemeColor(parsedOptions.theme_color || '#ed6a40'); 1460 setResultsPerPage(parsedOptions.results_per_page || 4); 1461 setCustomCss(parsedOptions.custom_css || ''); 1462 setCustomCssSrc(parsedOptions.custom_css_src || ''); 1463 setAdditionalSettings(parsedOptions.additional_settings || []); 1464 }).catch(error => { 1465 console.log(error); 1466 if (error.code === 'rest_no_route') { 1467 createErrorNotice((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("The REST API route is not set. Please check for plugin updates, and if that doesn't help, contact Linear support.", 'linear')); 1468 } else if (error.code === 'rest_cannot_access') { 1469 createErrorNotice((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('You do not have permission to access the REST API. Could there be something stopping this access?', 'linear')); 1470 } else if (error.data && error.data.status === 500) { 1471 createErrorNotice((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('The REST API encountered an internal server error. Please check if the WordPress Rest API is enabled.', 'linear')); 1472 } else { 1473 createErrorNotice((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Failed to fetch settings. Please try refreshing this page to see if that helps.', 'linear')); 1474 } 1475 }); 1476 }, []); 1477 const saveSettings = () => { 1478 removeAllNotices(); 1479 createInfoNotice((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Saving settings...', 'linear')); 1480 const savingAppUrl = appUrl; 1481 const savingDataUrl = dataUrl; 1482 const savingClientSecret = clientSecret; 1483 return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_1___default()({ 1484 path: apiUrl, 1485 method: 'POST', 1486 headers: { 1487 'X-WP-Nonce': nonce 1488 }, 1489 data: { 1490 app_url: appUrl, 1491 data_url: dataUrl, 1492 client_secret: clientSecret, 1493 dynamic_parent_pages: dynamicParentPages, 1494 rendering_method: renderingMethod, 1495 shortcode_rendering_method: shortcodeRenderingMethod, 1496 use_test_data: useTestData, 1497 listing_leads_integration: listingLeadsIntegration, 1498 featured_image: featuredImage, 1499 theme_color: themeColor, 1500 results_per_page: resultsPerPage, 1501 custom_css: customCss, 1502 custom_css_src: customCssSrc, 1503 additional_settings: additionalSettings 1504 } 1505 }).then(() => { 1506 removeAllNotices(); 1507 if (!(0,_utils_validators__WEBPACK_IMPORTED_MODULE_5__.validateUrl)(savingAppUrl) || !(0,_utils_validators__WEBPACK_IMPORTED_MODULE_5__.validateUrl)(savingDataUrl) || !(0,_utils_validators__WEBPACK_IMPORTED_MODULE_5__.validateClientSecret)(savingClientSecret)) { 1508 createErrorNotice((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Settings saved, but some of the values are not valid. You may hence expect potential issues with the listings.', 'linear')); 1509 } else { 1510 createSuccessNotice((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Settings saved.', 'linear')); 1511 } 1512 }).catch(error => { 1513 removeAllNotices(); 1514 console.log(error); 1515 if (error.code === 'rest_no_route') { 1516 createErrorNotice((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('The REST API route is not set. Please check the plugin configuration.', 'linear')); 1517 } else if (error.code === 'rest_cannot_access') { 1518 createErrorNotice((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('You do not have permission to access the REST API.', 'linear')); 1519 } else if (error.data && error.data.status === 403) { 1520 createErrorNotice((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('The REST API encountered an permission error. Please check if the REST API is enabled.', 'linear')); 1521 } else if (error.data && error.data.status === 500) { 1522 createErrorNotice((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('The REST API encountered an internal server error. Please check if the REST API is enabled.', 'linear')); 1523 } else { 1524 createErrorNotice((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Failed to save settings. Please try refreshing this page to see if that helps.', 'linear')); 1525 } 1526 }); 1527 }; 1528 return { 1529 appUrl, 1530 setAppUrl, 1531 dataUrl, 1532 setDataUrl, 1533 clientSecret, 1534 setClientSecret, 1535 dynamicParentPages, 1536 setDynamicParentPages, 1537 renderingMethod, 1538 setRenderingMethod, 1539 shortcodeRenderingMethod, 1540 setShortcodeRenderingMethod, 1541 useTestData, 1542 setUseTestData, 1543 listingLeadsIntegration, 1544 setListingLeadsIntegration, 1545 featuredImage, 1546 setFeaturedImage, 1547 themeColor, 1548 setThemeColor, 1549 resultsPerPage, 1550 setResultsPerPage, 1551 customCss, 1552 setCustomCss, 1553 customCssSrc, 1554 setCustomCssSrc, 1555 additionalSettings, 1556 setAdditionalSettings, 1557 saveSettings 1558 }; 1559 }; 1560 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (useSettings); 1561 1562 /***/ }), 1563 1564 /***/ "./src/index.js": 1565 /*!**********************!*\ 1566 !*** ./src/index.js ***! 1567 \**********************/ 1568 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 1569 1570 __webpack_require__.r(__webpack_exports__); 1571 /* harmony import */ var _index_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index.scss */ "./src/index.scss"); 1572 /* harmony import */ var _wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/dom-ready */ "@wordpress/dom-ready"); 1573 /* harmony import */ var _wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_1__); 1574 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 1575 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); 1576 /* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./components */ "./src/components/index.js"); 1577 /* harmony import */ var _blocks_dynamic_listings__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./blocks/dynamic-listings */ "./src/blocks/dynamic-listings/index.js"); 1578 /* harmony import */ var _blocks_listings__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./blocks/listings */ "./src/blocks/listings/index.js"); 1579 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); 1580 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__); 1581 1582 1583 1584 1585 1586 1587 1588 _wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_1___default()(() => { 1589 const rootElement = document.getElementById('linear-react-settings'); 1590 if (!rootElement) { 1591 return; 1592 } 1593 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.createRoot)(document.getElementById('linear-react-settings')).render(/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_components__WEBPACK_IMPORTED_MODULE_3__.SettingsPage, {})); 1594 }); 1595 1596 /***/ }), 1597 1598 /***/ "./src/index.scss": 1599 /*!************************!*\ 1600 !*** ./src/index.scss ***! 1601 \************************/ 1602 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 1603 1604 __webpack_require__.r(__webpack_exports__); 1605 // extracted by mini-css-extract-plugin 1606 1607 1608 /***/ }), 1609 1610 /***/ "./src/utils/language-utils.js": 1611 /*!*************************************!*\ 1612 !*** ./src/utils/language-utils.js ***! 1613 \*************************************/ 1614 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 1615 1616 __webpack_require__.r(__webpack_exports__); 1617 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 1618 /* harmony export */ getFilteredPages: () => (/* binding */ getFilteredPages), 1619 /* harmony export */ getLinkForLanguagePage: () => (/* binding */ getLinkForLanguagePage), 1620 /* harmony export */ getPageForLanguage: () => (/* binding */ getPageForLanguage), 1621 /* harmony export */ getTitleForLanguagePage: () => (/* binding */ getTitleForLanguagePage), 1622 /* harmony export */ handlePageSelect: () => (/* binding */ handlePageSelect) 1623 /* harmony export */ }); 1624 const getFilteredPages = (pages, detectedLanguages, langCode = null) => { 1625 if (!pages) return []; 1626 if (!detectedLanguages || !langCode) { 1627 return pages; 1628 } 1629 const returnablePages = pages.filter(page => page.language === langCode); 1630 if (returnablePages.length > 0) { 1631 return returnablePages; 1632 } 1633 return pages; 1634 }; 1635 const handlePageSelect = (value, currentValue, detectedLanguages, langCode = null, exceptions = []) => { 1636 // Convert value to integer 1637 const pageId = parseInt(value, 10); 1638 if (!detectedLanguages) { 1639 return pageId; 1640 } 1641 const newValue = typeof currentValue === 'object' ? { 1642 ...currentValue 1643 } : {}; 1644 if (langCode) { 1645 newValue[langCode] = pageId; 1646 } 1647 if (exceptions.includes('translatePress')) { 1648 detectedLanguages.forEach(language => { 1649 newValue[language] = pageId; 1650 }); 1651 } 1652 return newValue; 1653 }; 1654 const getPageForLanguage = (dynamicParentPages, detectedLanguages, langCode = null) => { 1655 if (!detectedLanguages) { 1656 return parseInt(dynamicParentPages, 10); 1657 } 1658 if (typeof dynamicParentPages !== 'object') { 1659 return 0; 1660 } 1661 return parseInt(dynamicParentPages[langCode] || 0, 10); 1662 }; 1663 const getLinkForLanguagePage = (dynamicParentPages, pages, detectedLanguages, langCode = null) => { 1664 const pageId = getPageForLanguage(dynamicParentPages, detectedLanguages, langCode); 1665 if (!pageId || !pages) return '#'; 1666 const page = pages.find(p => p.id === pageId); 1667 return page ? page.link : '#'; 1668 }; 1669 const getTitleForLanguagePage = (dynamicParentPages, pages, detectedLanguages, langCode = null) => { 1670 const pageId = getPageForLanguage(dynamicParentPages, detectedLanguages, langCode); 1671 if (!pageId || !pages) return ''; 1672 const page = pages.find(p => p.id === pageId); 1673 return page ? page.title.raw : ''; 1674 }; 1675 1676 /***/ }), 1677 1678 /***/ "./src/utils/validators.js": 1679 /*!*********************************!*\ 1680 !*** ./src/utils/validators.js ***! 1681 \*********************************/ 1682 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 1683 1684 __webpack_require__.r(__webpack_exports__); 1685 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 1686 /* harmony export */ validateClientSecret: () => (/* binding */ validateClientSecret), 1687 /* harmony export */ validateUrl: () => (/* binding */ validateUrl) 1688 /* harmony export */ }); 1689 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 1690 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); 1691 1692 const validateUrl = value => { 1693 if (!value) { 1694 return false; 1695 } 1696 if (value.length < 5 || !/^https?:\/\/.+/.test(value)) { 1697 return false; 1698 } 1699 return true; 1700 }; 1701 const validateClientSecret = value => { 1702 if (!value) { 1703 return false; 1704 } 1705 if (value.length < 12) { 1706 return false; 1707 } 1708 return true; 1709 }; 1710 1711 /***/ }), 1712 1713 /***/ "@wordpress/api-fetch": 1714 /*!**********************************!*\ 1715 !*** external ["wp","apiFetch"] ***! 1716 \**********************************/ 1717 /***/ ((module) => { 1718 1719 module.exports = window["wp"]["apiFetch"]; 1720 1721 /***/ }), 1722 1723 /***/ "@wordpress/block-editor": 1724 /*!*************************************!*\ 1725 !*** external ["wp","blockEditor"] ***! 1726 \*************************************/ 1727 /***/ ((module) => { 1728 1729 module.exports = window["wp"]["blockEditor"]; 1730 1731 /***/ }), 1732 1733 /***/ "@wordpress/blocks": 1734 /*!********************************!*\ 1735 !*** external ["wp","blocks"] ***! 1736 \********************************/ 1737 /***/ ((module) => { 1738 1739 module.exports = window["wp"]["blocks"]; 1740 1741 /***/ }), 1742 1743 /***/ "@wordpress/components": 1744 /*!************************************!*\ 1745 !*** external ["wp","components"] ***! 1746 \************************************/ 1747 /***/ ((module) => { 1748 1749 module.exports = window["wp"]["components"]; 1750 1751 /***/ }), 1752 1753 /***/ "@wordpress/core-data": 1754 /*!**********************************!*\ 1755 !*** external ["wp","coreData"] ***! 1756 \**********************************/ 1757 /***/ ((module) => { 1758 1759 module.exports = window["wp"]["coreData"]; 1760 1761 /***/ }), 1762 1763 /***/ "@wordpress/data": 1764 /*!******************************!*\ 1765 !*** external ["wp","data"] ***! 1766 \******************************/ 1767 /***/ ((module) => { 1768 1769 module.exports = window["wp"]["data"]; 1770 1771 /***/ }), 1772 1773 /***/ "@wordpress/dom-ready": 1774 /*!**********************************!*\ 1775 !*** external ["wp","domReady"] ***! 1776 \**********************************/ 1777 /***/ ((module) => { 1778 1779 module.exports = window["wp"]["domReady"]; 1780 1781 /***/ }), 1782 1783 /***/ "@wordpress/element": 1784 /*!*********************************!*\ 1785 !*** external ["wp","element"] ***! 1786 \*********************************/ 1787 /***/ ((module) => { 1788 1789 module.exports = window["wp"]["element"]; 1790 1791 /***/ }), 1792 1793 /***/ "@wordpress/i18n": 1794 /*!******************************!*\ 1795 !*** external ["wp","i18n"] ***! 1796 \******************************/ 1797 /***/ ((module) => { 1798 1799 module.exports = window["wp"]["i18n"]; 1800 1801 /***/ }), 1802 1803 /***/ "@wordpress/notices": 1804 /*!*********************************!*\ 1805 !*** external ["wp","notices"] ***! 1806 \*********************************/ 1807 /***/ ((module) => { 1808 1809 module.exports = window["wp"]["notices"]; 1810 1811 /***/ }), 1812 1813 /***/ "react": 1814 /*!************************!*\ 1815 !*** external "React" ***! 1816 \************************/ 1817 /***/ ((module) => { 1818 1819 module.exports = window["React"]; 1820 1821 /***/ }), 1822 1823 /***/ "react/jsx-runtime": 1824 /*!**********************************!*\ 1825 !*** external "ReactJSXRuntime" ***! 1826 \**********************************/ 1827 /***/ ((module) => { 1828 1829 module.exports = window["ReactJSXRuntime"]; 1830 1831 /***/ }) 1832 1833 /******/ }); 1834 /************************************************************************/ 1835 /******/ // The module cache 1836 /******/ var __webpack_module_cache__ = {}; 1837 /******/ 1838 /******/ // The require function 1839 /******/ function __webpack_require__(moduleId) { 1840 /******/ // Check if module is in cache 1841 /******/ var cachedModule = __webpack_module_cache__[moduleId]; 1842 /******/ if (cachedModule !== undefined) { 1843 /******/ return cachedModule.exports; 1844 /******/ } 1845 /******/ // Create a new module (and put it into the cache) 1846 /******/ var module = __webpack_module_cache__[moduleId] = { 1847 /******/ // no module.id needed 1848 /******/ // no module.loaded needed 1849 /******/ exports: {} 1850 /******/ }; 1851 /******/ 1852 /******/ // Execute the module function 1853 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); 1854 /******/ 1855 /******/ // Return the exports of the module 1856 /******/ return module.exports; 1857 /******/ } 1858 /******/ 1859 /******/ // expose the modules object (__webpack_modules__) 1860 /******/ __webpack_require__.m = __webpack_modules__; 1861 /******/ 1862 /************************************************************************/ 1863 /******/ /* webpack/runtime/chunk loaded */ 1864 /******/ (() => { 1865 /******/ var deferred = []; 1866 /******/ __webpack_require__.O = (result, chunkIds, fn, priority) => { 1867 /******/ if(chunkIds) { 1868 /******/ priority = priority || 0; 1869 /******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; 1870 /******/ deferred[i] = [chunkIds, fn, priority]; 1871 /******/ return; 1872 /******/ } 1873 /******/ var notFulfilled = Infinity; 1874 /******/ for (var i = 0; i < deferred.length; i++) { 1875 /******/ var [chunkIds, fn, priority] = deferred[i]; 1876 /******/ var fulfilled = true; 1877 /******/ for (var j = 0; j < chunkIds.length; j++) { 1878 /******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { 1879 /******/ chunkIds.splice(j--, 1); 1880 /******/ } else { 1881 /******/ fulfilled = false; 1882 /******/ if(priority < notFulfilled) notFulfilled = priority; 1883 /******/ } 1884 /******/ } 1885 /******/ if(fulfilled) { 1886 /******/ deferred.splice(i--, 1) 1887 /******/ var r = fn(); 1888 /******/ if (r !== undefined) result = r; 1889 /******/ } 1890 /******/ } 1891 /******/ return result; 1892 /******/ }; 1893 /******/ })(); 1894 /******/ 1895 /******/ /* webpack/runtime/compat get default export */ 1896 /******/ (() => { 1897 /******/ // getDefaultExport function for compatibility with non-harmony modules 1898 /******/ __webpack_require__.n = (module) => { 1899 /******/ var getter = module && module.__esModule ? 1900 /******/ () => (module['default']) : 1901 /******/ () => (module); 1902 /******/ __webpack_require__.d(getter, { a: getter }); 1903 /******/ return getter; 1904 /******/ }; 1905 /******/ })(); 1906 /******/ 1907 /******/ /* webpack/runtime/define property getters */ 1908 /******/ (() => { 1909 /******/ // define getter functions for harmony exports 1910 /******/ __webpack_require__.d = (exports, definition) => { 1911 /******/ for(var key in definition) { 1912 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 1913 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 1914 /******/ } 1915 /******/ } 1916 /******/ }; 1917 /******/ })(); 1918 /******/ 1919 /******/ /* webpack/runtime/global */ 1920 /******/ (() => { 1921 /******/ __webpack_require__.g = (function() { 1922 /******/ if (typeof globalThis === 'object') return globalThis; 1923 /******/ try { 1924 /******/ return this || new Function('return this')(); 1925 /******/ } catch (e) { 1926 /******/ if (typeof window === 'object') return window; 1927 /******/ } 1928 /******/ })(); 1929 /******/ })(); 1930 /******/ 1931 /******/ /* webpack/runtime/hasOwnProperty shorthand */ 1932 /******/ (() => { 1933 /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) 1934 /******/ })(); 1935 /******/ 1936 /******/ /* webpack/runtime/make namespace object */ 1937 /******/ (() => { 1938 /******/ // define __esModule on exports 1939 /******/ __webpack_require__.r = (exports) => { 1940 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 1941 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 1942 /******/ } 1943 /******/ Object.defineProperty(exports, '__esModule', { value: true }); 1944 /******/ }; 1945 /******/ })(); 1946 /******/ 1947 /******/ /* webpack/runtime/publicPath */ 1948 /******/ (() => { 1949 /******/ var scriptUrl; 1950 /******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + ""; 1951 /******/ var document = __webpack_require__.g.document; 1952 /******/ if (!scriptUrl && document) { 1953 /******/ if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') 1954 /******/ scriptUrl = document.currentScript.src; 1955 /******/ if (!scriptUrl) { 1956 /******/ var scripts = document.getElementsByTagName("script"); 1957 /******/ if(scripts.length) { 1958 /******/ var i = scripts.length - 1; 1959 /******/ while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src; 1960 /******/ } 1961 /******/ } 1962 /******/ } 1963 /******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration 1964 /******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic. 1965 /******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser"); 1966 /******/ scriptUrl = scriptUrl.replace(/^blob:/, "").replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/"); 1967 /******/ __webpack_require__.p = scriptUrl; 1968 /******/ })(); 1969 /******/ 1970 /******/ /* webpack/runtime/jsonp chunk loading */ 1971 /******/ (() => { 1972 /******/ // no baseURI 1973 /******/ 1974 /******/ // object to store loaded and loading chunks 1975 /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched 1976 /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded 1977 /******/ var installedChunks = { 1978 /******/ "index": 0, 1979 /******/ "./style-index": 0 1980 /******/ }; 1981 /******/ 1982 /******/ // no chunk on demand loading 1983 /******/ 1984 /******/ // no prefetching 1985 /******/ 1986 /******/ // no preloaded 1987 /******/ 1988 /******/ // no HMR 1989 /******/ 1990 /******/ // no HMR manifest 1991 /******/ 1992 /******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); 1993 /******/ 1994 /******/ // install a JSONP callback for chunk loading 1995 /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { 1996 /******/ var [chunkIds, moreModules, runtime] = data; 1997 /******/ // add "moreModules" to the modules object, 1998 /******/ // then flag all "chunkIds" as loaded and fire callback 1999 /******/ var moduleId, chunkId, i = 0; 2000 /******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { 2001 /******/ for(moduleId in moreModules) { 2002 /******/ if(__webpack_require__.o(moreModules, moduleId)) { 2003 /******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; 2004 /******/ } 2005 /******/ } 2006 /******/ if(runtime) var result = runtime(__webpack_require__); 2007 /******/ } 2008 /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); 2009 /******/ for(;i < chunkIds.length; i++) { 2010 /******/ chunkId = chunkIds[i]; 2011 /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { 2012 /******/ installedChunks[chunkId][0](); 2013 /******/ } 2014 /******/ installedChunks[chunkId] = 0; 2015 /******/ } 2016 /******/ return __webpack_require__.O(result); 2017 /******/ } 2018 /******/ 2019 /******/ var chunkLoadingGlobal = globalThis["webpackChunk"] = globalThis["webpackChunk"] || []; 2020 /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); 2021 /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); 2022 /******/ })(); 2023 /******/ 2024 /************************************************************************/ 2025 /******/ 2026 /******/ // startup 2027 /******/ // Load entry module and return exports 2028 /******/ // This entry module depends on other loaded chunks and execution need to be delayed 2029 /******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["./style-index"], () => (__webpack_require__("./src/index.js"))) 2030 /******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); 2031 /******/ 2032 /******/ })() 2033 ; 2034 //# sourceMappingURL=index.js.map -
linear/tags/3.0.9/build/style-index-rtl.css
r3338864 r3372199 1 2 1 /*!***************************************************************************************************************************************************************************************************************************************************************!*\ 2 !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/blocks/dynamic-listings/style.scss ***! 3 \***************************************************************************************************************************************************************************************************************************************************************/ 4 /** 5 * Frontend styles for the dynamic listings block 6 */ 7 /*!*******************************************************************************************************************************************************************************************************************************************************!*\ 8 !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/blocks/listings/style.scss ***! 9 \*******************************************************************************************************************************************************************************************************************************************************/ 10 /** 11 * Frontend styles for the dynamic listings block 12 */ -
linear/tags/3.0.9/build/style-index.css
r3338864 r3372199 1 /*!***************************************************************************************************************************************************************************************************************************************************************!*\ 2 !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/blocks/dynamic-listings/style.scss ***! 3 \***************************************************************************************************************************************************************************************************************************************************************/ 4 /** 5 * Frontend styles for the dynamic listings block 6 */ 7 /*!*******************************************************************************************************************************************************************************************************************************************************!*\ 8 !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/blocks/listings/style.scss ***! 9 \*******************************************************************************************************************************************************************************************************************************************************/ 10 /** 11 * Frontend styles for the dynamic listings block 12 */ 1 13 2 14 /*# sourceMappingURL=style-index.css.map*/ -
linear/tags/3.0.9/includes/class-linear-endpoints.php
r3341553 r3372199 171 171 'shortcode_rendering_method' => [ 172 172 'type' => 'string', 173 ], 174 'use_test_data' => [ 175 'type' => 'boolean', 173 176 ], 174 177 'listing_leads_integration' => [ … … 219 222 $rendering_method = isset( $options['rendering_method'] ) ? trim( (string) $options['rendering_method'] ) : ''; 220 223 $shortcode_rendering_method = isset( $options['shortcode_rendering_method'] ) ? trim( (string) $options['shortcode_rendering_method'] ) : ''; 224 $use_test_data = isset( $options['use_test_data'] ) ? (bool) $options['use_test_data'] : false; 221 225 $listing_leads_integration = isset( $options['listing_leads_integration'] ) ? $options['listing_leads_integration'] : false; 222 226 $featured_image = isset( $options['featured_image'] ) ? $options['featured_image'] : ''; … … 241 245 'rendering_method' => $rendering_method, 242 246 'shortcode_rendering_method' => $shortcode_rendering_method, 247 'use_test_data' => isset( $options['use_test_data'] ) ? (bool) $options['use_test_data'] : false, 243 248 'listing_leads_integration' => $listing_leads_integration, 244 249 'featured_image' => $featured_image, -
linear/tags/3.0.9/includes/class-linear-middleware.php
r3338864 r3372199 75 75 76 76 $dynamic_parent_pages = self::$linear->get_option( 'dynamic_parent_pages' ); 77 $env = self::$linear->get_option( 'use_test_data' ) ? 'dev' : 'prod'; 77 78 $linear_plugin_version = LINEAR_VERSION; 78 79 $dynamic_parent_pages_string = json_encode($dynamic_parent_pages); … … 80 81 $dynamic_parent_pages_string = str_replace([':', ','], ['-', '_'], $dynamic_parent_pages_string); 81 82 82 $listings_transient = 'linear_' . $linear_plugin_version . '_listings_' . substr($client_secret,0,10) . '_' . $dynamic_parent_pages_string . '_' . $lang ;83 $listings_transient_updater = 'linear_' . $linear_plugin_version . '_listings_updater_' . $lang ;83 $listings_transient = 'linear_' . $linear_plugin_version . '_listings_' . substr($client_secret,0,10) . '_' . $dynamic_parent_pages_string . '_' . $lang . '_' . $env; 84 $listings_transient_updater = 'linear_' . $linear_plugin_version . '_listings_updater_' . $lang . '_' . $env; 84 85 85 86 if( $response = get_transient( $listings_transient ) ){ … … 112 113 $parameters = []; 113 114 $parameters['langs'] = $lang; 114 $parameters['env'] = "prod";115 $parameters['env'] = $env; 115 116 116 117 $response = wp_remote_get( … … 144 145 $listings = $this->modify_listings( $response_data['data'], $lang ); 145 146 147 if( !$listings ){ 148 delete_transient( $listings_transient_updater ); 149 return new WP_Error( 'error', esc_html__( "API v3 middleware response missing listings", "linear" ) ); 150 } 151 146 152 set_transient( $listings_transient, $listings, 1800 ); 147 153 delete_transient( $listings_transient_updater ); 148 154 149 155 return $listings; 150 151 156 } 152 157 -
linear/tags/3.0.9/includes/class-linear-seo.php
r3338864 r3372199 159 159 }); 160 160 add_filter('seopress_social_og_desc', function ( $html ) use ( $description ) { 161 return esc_attr( $description ); 161 $html = '<meta property="og:description" content="' . esc_attr( $description ) . '" />'; 162 return $html; 162 163 }); 163 164 add_filter('seopress_social_twitter_card_thumb', function ( $html ) use ( $image_url ) { -
linear/tags/3.0.9/includes/class-linear-templater.php
r3366394 r3372199 216 216 $results_per_page = self::$linear->get_option('results_per_page'); 217 217 $featured_image = self::$linear->get_option( 'featured_image', '' ) ? self::$linear->get_option( 'featured_image', '' ) : ''; 218 $use_test_data = self::$linear->get_option('use_test_data'); 218 219 $listing_leads_integration = self::$linear->get_option('listing_leads_integration'); 219 220 $custom_css = self::$linear->get_option('custom_css'); … … 233 234 'results_per_page' => $results_per_page, 234 235 'logo' => $featured_image ? $featured_image : 'default', 236 'env' => $use_test_data ? 'dev' : 'prod', 235 237 'leads' => $listing_leads_integration ? 'true' : 'false', 236 238 'color' => $theme_color, -
linear/tags/3.0.9/includes/class-linear.php
r3366394 r3372199 48 48 $this->version = LINEAR_VERSION; 49 49 } else { 50 $this->version = '3.0. 8';50 $this->version = '3.0.9'; 51 51 } 52 52 $this->plugin_uid = 'linear'; -
linear/tags/3.0.9/linear.php
r3366394 r3372199 11 11 * Plugin URI: https://wordpress.org/plugins/linear/ 12 12 * Description: Linear listing system WordPress plugin. Enables you to easily display all your real estate listings on your website. 13 * Version: 3.0. 813 * Version: 3.0.9 14 14 * Author: Linear Oy 15 15 * Author URI: https://linear.fi … … 28 28 * Currently plugin version. (Semantic Versioning) 29 29 */ 30 define( 'LINEAR_VERSION', '3.0. 8' );30 define( 'LINEAR_VERSION', '3.0.9' ); 31 31 32 32 /** -
linear/trunk/README.txt
r3366394 r3372199 4 4 Requires at least: 6.2 5 5 Tested up to: 6.8.2 6 Stable tag: 3.0. 86 Stable tag: 3.0.9 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 53 53 54 54 == Changelog == 55 56 = 3.0.9 = 57 *Release date 2nd October 2025* 58 59 * Fix - Fixed faulty filter with SeoPress that caused unexpeced meta-data renders 60 * Tweak - Added option to 55 61 56 62 = 3.0.8 = -
linear/trunk/build/index-rtl.css
r3338864 r3372199 1 .linear-embed{margin-right:auto;margin-left:auto;max-width:var(--wp--style--global--wide-size);width:100%} 2 3 1 /*!***************************************************************************************************************************************************************************************************************************************!*\ 2 !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/index.scss ***! 3 \***************************************************************************************************************************************************************************************************************************************/ 4 .linear-embed { 5 max-width: var(--wp--style--global--wide-size); 6 width: 100%; 7 margin-right: auto; 8 margin-left: auto; 9 } 10 /*!****************************************************************************************************************************************************************************************************************************************************************!*\ 11 !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/blocks/dynamic-listings/editor.scss ***! 12 \****************************************************************************************************************************************************************************************************************************************************************/ 13 /** 14 * Editor styles for the dynamic listings block 15 */ 16 /*!********************************************************************************************************************************************************************************************************************************************************!*\ 17 !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/blocks/listings/editor.scss ***! 18 \********************************************************************************************************************************************************************************************************************************************************/ 19 /** 20 * Editor styles for the dynamic listings block 21 */ -
linear/trunk/build/index.asset.php
r3346339 r3372199 1 <?php return array('dependencies' => array('react', 'react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n', 'wp-notices'), 'version' => 'a b86a10b8260371c8b5c');1 <?php return array('dependencies' => array('react', 'react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n', 'wp-notices'), 'version' => 'ae2765d55c9099f875c7'); -
linear/trunk/build/index.css
r3338864 r3372199 1 .linear-embed{margin-left:auto;margin-right:auto;max-width:var(--wp--style--global--wide-size);width:100%} 1 /*!***************************************************************************************************************************************************************************************************************************************!*\ 2 !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/index.scss ***! 3 \***************************************************************************************************************************************************************************************************************************************/ 4 .linear-embed { 5 max-width: var(--wp--style--global--wide-size); 6 width: 100%; 7 margin-left: auto; 8 margin-right: auto; 9 } 10 /*!****************************************************************************************************************************************************************************************************************************************************************!*\ 11 !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/blocks/dynamic-listings/editor.scss ***! 12 \****************************************************************************************************************************************************************************************************************************************************************/ 13 /** 14 * Editor styles for the dynamic listings block 15 */ 16 /*!********************************************************************************************************************************************************************************************************************************************************!*\ 17 !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/blocks/listings/editor.scss ***! 18 \********************************************************************************************************************************************************************************************************************************************************/ 19 /** 20 * Editor styles for the dynamic listings block 21 */ 2 22 3 23 /*# sourceMappingURL=index.css.map*/ -
linear/trunk/build/index.js
r3346339 r3372199 1 (()=>{"use strict";var e,t={345:(e,t,n)=>{const i=window.wp.domReady;var l=n.n(i);const a=window.wp.element,r=window.wp.i18n,s=window.wp.components,o=window.wp.apiFetch;var d=n.n(o);const c=window.wp.notices,h=window.wp.data,u=e=>!!e&&!(e.length<5||!/^https?:\/\/.+/.test(e)),g=e=>!(!e||e.length<12),p=window.React,_=window.ReactJSXRuntime,x=()=>{const{removeNotice:e}=(0,h.useDispatch)(c.store),t=(0,h.useSelect)((e=>e(c.store).getNotices()));return 0===t.length?null:(0,_.jsx)(s.NoticeList,{notices:t,onRemove:e})},m=window.wp.coreData,b=({label:e,value:t,pages:n,onChange:i,help:l,showLink:a=!0,getLinkForLanguagePage:o,getTitleForLanguagePage:d})=>(0,_.jsxs)("div",{children:[(0,_.jsx)(s.SelectControl,{label:e,value:t,options:[{label:(0,r.__)("Select a page...","linear"),value:""},...n?n.map((e=>({label:e.title.raw,value:e.id}))):[]],onChange:i,help:l}),a&&t&&n&&o?(0,_.jsx)("div",{style:{marginTop:"5px"},children:(0,_.jsxs)("p",{children:[(0,r.__)("Link to page: ","linear"),(0,_.jsx)("a",{href:o(),target:"_blank",rel:"noopener noreferrer",children:d()})]})}):""]}),y=(e,t,n=null)=>{if(!e)return[];if(!t||!n)return e;const i=e.filter((e=>e.language===n));return i.length>0?i:e},j=(e,t,n=null)=>t?"object"!=typeof e?0:parseInt(e[n]||0,10):parseInt(e,10),v=(e,t,n,i=null)=>{const l=j(e,n,i);if(!l||!t)return"#";const a=t.find((e=>e.id===l));return a?a.link:"#"},f=(e,t,n,i=null)=>{const l=j(e,n,i);if(!l||!t)return"";const a=t.find((e=>e.id===l));return a?a.title.raw:""},w=({onClick:e,disabled:t})=>(0,_.jsx)(s.Button,{variant:"primary",onClick:e,__next40pxDefaultSize:!0,disabled:t,children:(0,r.__)("Save","linear")}),S=()=>{const{appUrl:e,setAppUrl:t,dataUrl:n,setDataUrl:i,clientSecret:l,setClientSecret:o,dynamicParentPages:S,setDynamicParentPages:k,renderingMethod:C,setRenderingMethod:P,shortcodeRenderingMethod:T,setShortcodeRenderingMethod:L,listingLeadsIntegration:R,setListingLeadsIntegration:I,featuredImage:A,setFeaturedImage:B,themeColor:E,setThemeColor:D,resultsPerPage:N,setResultsPerPage:O,customCss:H,setCustomCss:M,customCssSrc:U,setCustomCssSrc:W,additionalSettings:F,setAdditionalSettings:z,saveSettings:q}=(()=>{const[e,t]=(0,a.useState)(),[n,i]=(0,a.useState)(),[l,s]=(0,a.useState)(),[o,p]=(0,a.useState)([]),[_,x]=(0,a.useState)("inline"),[m,b]=(0,a.useState)("default"),[y,j]=(0,a.useState)(!1),[v,f]=(0,a.useState)(),[w,S]=(0,a.useState)(window.linear_admin_obj.theme_default_color||"#ed6a40"),[k,C]=(0,a.useState)(4),[P,T]=(0,a.useState)(""),[L,R]=(0,a.useState)(""),[I,A]=(0,a.useState)([]),B=window.linear_admin_obj.rest.nonce,{removeAllNotices:E,createSuccessNotice:D,createInfoNotice:N,createErrorNotice:O}=(0,h.useDispatch)(c.store),H=window.linear_admin_obj.rest.endpoints.options;if(H&&B)return(0,a.useEffect)((()=>{d()({path:H,method:"GET",headers:{"X-WP-Nonce":B}}).then((e=>{const n=e.options;t(n.app_url||""),i(n.data_url||""),s(n.client_secret||""),p(n.dynamic_parent_pages||[]),x(n.rendering_method||"inline"),b(n.shortcode_rendering_method||"default"),j(n.listing_leads_integration||!1),f(n.featured_image||""),S(n.theme_color||"#ed6a40"),C(n.results_per_page||4),T(n.custom_css||""),R(n.custom_css_src||""),A(n.additional_settings||[])})).catch((e=>{console.log(e),"rest_no_route"===e.code?O((0,r.__)("The REST API route is not set. Please check for plugin updates, and if that doesn't help, contact Linear support.","linear")):"rest_cannot_access"===e.code?O((0,r.__)("You do not have permission to access the REST API. Could there be something stopping this access?","linear")):e.data&&500===e.data.status?O((0,r.__)("The REST API encountered an internal server error. Please check if the WordPress Rest API is enabled.","linear")):O((0,r.__)("Failed to fetch settings. Please try refreshing this page to see if that helps.","linear"))}))}),[]),{appUrl:e,setAppUrl:t,dataUrl:n,setDataUrl:i,clientSecret:l,setClientSecret:s,dynamicParentPages:o,setDynamicParentPages:p,renderingMethod:_,setRenderingMethod:x,shortcodeRenderingMethod:m,setShortcodeRenderingMethod:b,listingLeadsIntegration:y,setListingLeadsIntegration:j,featuredImage:v,setFeaturedImage:f,themeColor:w,setThemeColor:S,resultsPerPage:k,setResultsPerPage:C,customCss:P,setCustomCss:T,customCssSrc:L,setCustomCssSrc:R,additionalSettings:I,setAdditionalSettings:A,saveSettings:()=>{E(),N((0,r.__)("Saving settings...","linear"));const t=e,i=n,a=l;return d()({path:H,method:"POST",headers:{"X-WP-Nonce":B},data:{app_url:e,data_url:n,client_secret:l,dynamic_parent_pages:o,rendering_method:_,shortcode_rendering_method:m,listing_leads_integration:y,featured_image:v,theme_color:w,results_per_page:k,custom_css:P,custom_css_src:L,additional_settings:I}}).then((()=>{E(),u(t)&&u(i)&&g(a)?D((0,r.__)("Settings saved.","linear")):O((0,r.__)("Settings saved, but some of the values are not valid. You may hence expect potential issues with the listings.","linear"))})).catch((e=>{E(),console.log(e),"rest_no_route"===e.code?O((0,r.__)("The REST API route is not set. Please check the plugin configuration.","linear")):"rest_cannot_access"===e.code?O((0,r.__)("You do not have permission to access the REST API.","linear")):e.data&&403===e.data.status?O((0,r.__)("The REST API encountered an permission error. Please check if the REST API is enabled.","linear")):e.data&&500===e.data.status?O((0,r.__)("The REST API encountered an internal server error. Please check if the REST API is enabled.","linear")):O((0,r.__)("Failed to save settings. Please try refreshing this page to see if that helps.","linear"))}))}}})(),[Y,$]=(0,a.useState)(!1),[G,J]=(0,a.useState)(["fi"]),{isMobile:X}=(()=>{const[e,t]=(0,p.useState)(window.innerWidth<=768),[n,i]=(0,p.useState)(window.innerWidth>768&&window.innerWidth<=1024);return(0,p.useEffect)((()=>{const e=()=>{t(window.innerWidth<=768),i(window.innerWidth>768&&window.innerWidth<=1024)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),{isMobile:e,isTablet:n}})(),V=window.linear_admin_obj.exception_rules||[];(0,a.useEffect)((()=>{(async()=>{try{const e=await fetch("/wp-json/linear/v3/languages",{headers:{"X-WP-Nonce":linear_admin_obj.rest.nonce}});if(!e.ok)throw new Error("Failed to fetch languages");const t=await e.json();J(t)}catch(e){console.error("Error fetching languages:",e);const t=[document.getElementsByTagName("html")[0].getAttribute("lang")||"fi"];J(t)}})()}),[]),(0,a.useEffect)((()=>{const e={};G.forEach((t=>{S[t]&&(e[t]=S[t])})),JSON.stringify(e)!==JSON.stringify(S)&&k(e)}),[G,S]);const K=(0,h.useSelect)((e=>e(m.store).getEntityRecords("postType","page",{per_page:-1,status:"publish"})),[]),Q={languageSection:{marginBottom:"20px",padding:"15px",backgroundColor:"#f9f9f9",borderRadius:"4px",border:"1px solid #e0e0e0"},languageTitle:{marginTop:"0",marginBottom:"10px",fontSize:"14px",fontWeight:"bold",textTransform:"capitalize"}},Z={padding:"10px",fontSize:"16px"},ee={borderColor:"red",backgroundColor:"#ffe6e6"},te={display:"flex",flexDirection:X?"column":"row",gap:X?"1rem":"2rem",width:"100%"},ne={flex:X?"1 1 100%":"1",minWidth:X?"100%":"0"};let ie="#";if(G.length>0){const e=G[0];ie=v(S,K,G,e)+"?guide"}return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(x,{}),(0,_.jsxs)(s.Panel,{children:[(0,_.jsxs)(s.PanelBody,{title:(0,r.__)("Setup","linear"),children:[(0,_.jsx)(s.PanelRow,{children:(0,_.jsx)("blockquote",{children:(0,_.jsxs)("div",{style:{flex:"1"},children:[(0,_.jsx)(s.__experimentalHeading,{level:4,children:(0,r.__)("App URL","linear")}),(0,_.jsx)("br",{}),(0,_.jsx)(s.TextControl,{value:e,onChange:e=>t(e),style:{...Z,...""===e||u(e)?{}:ee},placeholder:(0,r.__)("https://...","linear"),help:(0,r.__)("A source for listings view","linear")})]})})}),(0,_.jsx)(s.PanelRow,{children:(0,_.jsx)("blockquote",{children:(0,_.jsxs)("div",{style:{flex:"1"},children:[(0,_.jsx)(s.__experimentalHeading,{level:4,children:(0,r.__)("Data source URL","linear")}),(0,_.jsx)("br",{}),(0,_.jsx)(s.TextControl,{value:n,onChange:e=>i(e),style:{...Z,...""===n||u(n)?{}:ee},placeholder:(0,r.__)("https://...","linear"),help:(0,r.__)("Our main data-source","linear")})]})})}),(0,_.jsx)(s.PanelRow,{children:(0,_.jsx)("blockquote",{children:(0,_.jsxs)("div",{style:{flex:"1"},children:[(0,_.jsx)(s.__experimentalHeading,{level:4,children:(0,r.__)("Client secret","linear")}),(0,_.jsx)("br",{}),(0,_.jsx)(s.TextControl,{value:l,onChange:e=>o(e),style:{...Z,...""===l||g(l)?{}:ee},placeholder:"...",help:(0,r.__)("Linear should provide this for you","linear")})]})})}),(0,_.jsx)(s.PanelRow,{children:(0,_.jsx)("blockquote",{children:(0,_.jsxs)("div",{children:[(0,_.jsx)(s.__experimentalHeading,{level:4,children:(0,r.__)("Dynamic Parent Pages","linear")}),(0,_.jsx)("br",{}),(0,_.jsxs)("div",{style:{marginLeft:"0rem"},children:[(0,_.jsxs)("div",{style:{marginBottom:"15px"},children:[(0,_.jsx)("p",{children:(0,r.__)("We have to set a dynamic parent page for each language. This is the page that will be used to load the listings dynamically. You might want to create a page dedicated for this purpose, if you haven't already done that.","linear")}),V.includes("translatePress")&&(0,_.jsx)("p",{style:{fontWeight:"bold",textDecoration:"underline"},children:(0,r.__)("If you are using TranslatePress, you can only have one set dynamic parent page, but the content will be determed by the TranslatePress selected language.","linear")})]}),G.map((e=>(0,_.jsxs)("div",{style:Q.languageSection,children:[(0,_.jsx)("h3",{style:Q.languageTitle,children:e}),(0,_.jsx)(b,{label:(0,r.__)("Select any page to use as parent for","linear")+" "+e,value:j(S,G,e),pages:y(K,G,e),onChange:t=>k(((e,t,n,i=null,l=[])=>{const a=parseInt(e,10);if(!n)return a;const r="object"==typeof t?{...t}:{};return i&&(r[i]=a),l.includes("translatePress")&&n.forEach((e=>{r[e]=a})),r})(t,S,G,e,V)),getLinkForLanguagePage:()=>v(S,K,G,e),getTitleForLanguagePage:()=>f(S,K,G,e)})]},e))),(0,_.jsx)("div",{style:{marginTop:"15px",fontSize:"13px",fontStyle:"italic"},children:(0,r.__)("Changing parent pages will flush rewrite rules to ensure proper URL handling.","linear")})]})]})})}),(0,_.jsx)(s.PanelRow,{children:(0,_.jsx)("blockquote",{children:(0,_.jsxs)("div",{children:[(0,_.jsx)(s.__experimentalHeading,{level:4,children:(0,r.__)("Rendering method","linear")}),(0,_.jsx)("br",{}),(0,_.jsxs)("div",{style:te,children:[(0,_.jsx)("div",{style:ne,children:(0,_.jsx)(s.SelectControl,{value:C,options:[{label:(0,r.__)("Inline (default)","linear"),value:"inline"},{label:(0,r.__)("Shortcode","linear"),value:"shortcode"},{label:(0,r.__)("Gutenberg block","linear"),value:"gutenberg"}],onChange:e=>P(e),help:(0,r.__)("Decide on how you wish the content to be shown. If you have a custom WordPress solution, you might be better off by using the Shortcode option.","linear"),style:{flex:"1"}})}),(0,_.jsxs)("div",{style:ne,children:["inline"===C?(0,_.jsx)("p",{children:(0,r.__)("The content will be rendered inline after the page main content.","linear")}):"","shortcode"===C?(0,_.jsxs)("div",{children:[(0,_.jsx)("p",{children:(0,r.__)("The dynamic content will be rendered via a shortcode. You can place the shortcode anywhere on your selected page. That page will be used to dynamically load Linear listings.","linear")}),(0,_.jsxs)("p",{children:[(0,r.__)("The shortcode is:","linear")," ",(0,_.jsx)("code",{children:"[linear_listings_content]"})]})]}):"","gutenberg"===C?(0,_.jsxs)("div",{children:[(0,_.jsx)("p",{children:G.length>1?(0,r.__)('Please add the Gutenberg block "Linear dynamic listings" to the pages: ',"linear"):(0,r.__)('Please add the Gutenberg block "Linear dynamic listings" to the page: ',"linear")}),(0,_.jsx)("div",{style:{display:"flex",flexDirection:"column"},children:S&&Object.entries(S).reduce(((e,[t,n])=>(e.some((([e,t])=>t===n))||e.push([t,n]),e)),[]).map((([e,t])=>(0,_.jsx)("a",{href:v(S,K,G,e),children:f(S,K,G,e)},t)))})]}):""]}),"shortcode"===C?(0,_.jsx)("div",{style:ne,children:(0,_.jsx)(s.SelectControl,{label:(0,r.__)("Shortcode rendering method","linear"),value:T,options:[{label:(0,r.__)("Should render both single listings and a list of listings","linear"),value:"default"},{label:(0,r.__)("Should only render single listings","linear"),value:"single"}],onChange:e=>L(e),help:(0,r.__)("By default, we render both single listings and the list of listings in the same place. If you want to render only single listings, and provide the list listings via e.g. a shortcode or block, you can adjust this option.","linear"),style:{flex:"1"}})}):""]})]})})})]}),(0,_.jsxs)(s.PanelBody,{title:(0,r.__)("Global settings","linear"),children:[(0,_.jsx)("p",{children:(0,r.__)("These settings are automatically applied to all listings, but can be overwritten on a per-listing basis","linear")}),(0,_.jsx)(s.PanelRow,{children:(0,_.jsx)("blockquote",{children:(0,_.jsxs)("div",{style:{},children:[(0,_.jsx)(s.__experimentalHeading,{level:4,children:(0,r.__)("Contact form integration","linear")}),(0,_.jsx)("br",{}),(0,_.jsx)(s.ToggleControl,{checked:R,onChange:()=>I((e=>!e)),__nextHasNoMarginBottom:!0,help:(0,r.__)("In case you head Leads activates for your account, you can activate them for your listings with this toggle. If however not, please contact Linear and we will sort it out for you.","linear")})]})})}),(0,_.jsx)(s.PanelRow,{children:(0,_.jsx)("blockquote",{children:(0,_.jsxs)("div",{style:{flex:"1"},children:[(0,_.jsx)(s.__experimentalHeading,{level:4,children:(0,r.__)("Default results per page","linear")}),(0,_.jsx)("br",{}),(0,_.jsx)("input",{type:"number",value:N,onChange:e=>O(e.target.value),placeholder:(0,r.__)("4","linear"),style:{padding:"8px",fontSize:"14px"}})]})})}),(0,_.jsx)(s.PanelRow,{children:(0,_.jsx)("blockquote",{children:(0,_.jsxs)("div",{style:{width:"100%"},children:[(0,_.jsx)(s.__experimentalHeading,{level:4,children:(0,r.__)("Theme Color","linear")}),(0,_.jsx)("p",{children:(0,r.__)("Select a theme color to be used across the plugin.","linear")}),(0,_.jsxs)("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center",marginBottom:"1rem"},children:[(0,_.jsx)("span",{children:(0,r.__)("Selected Color:","linear")}),(0,_.jsx)("span",{style:{display:"inline-block",width:"20px",height:"20px",backgroundColor:E,border:"1px solid #ccc",marginLeft:"5px",borderRadius:"100px"}})]}),(0,_.jsx)(s.ColorPicker,{color:E,onChangeComplete:e=>D(e.hex),disableAlpha:!0})]})})}),(0,_.jsx)(s.PanelRow,{children:(0,_.jsx)("blockquote",{children:(0,_.jsxs)("div",{children:[(0,_.jsx)(s.__experimentalHeading,{level:4,children:(0,r.__)("Featured image","linear")}),(0,_.jsx)("p",{children:(0,r.__)("Select or upload an image to be used as the brand feature image. Most often this is the logo of the company.","linear")}),(0,_.jsx)(s.Button,{variant:"primary",onClick:()=>{const e=wp.media({title:"Select or Upload Media",button:{text:"Use this media"},multiple:!1});e.on("select",(function(){const t=e.state().get("selection").first().toJSON();B(t.url)})),e.open()},children:(0,r.__)("Select Image","linear")}),A&&(0,_.jsxs)("div",{style:{marginTop:"10px"},children:[(0,_.jsx)("img",{src:A,alt:(0,r.__)("Selected Image","linear"),style:{maxWidth:"100%",maxHeight:"120px",height:"auto",border:"1px solid #ccc"}}),(0,_.jsx)("br",{}),(0,_.jsx)(s.Button,{onClick:()=>B(""),variant:"link",isDestructive:!0,style:{marginTop:"10px"},children:(0,r.__)("Remove Image","linear")})]})]})})}),(0,_.jsx)(s.PanelRow,{children:(0,_.jsx)("blockquote",{children:(0,_.jsxs)("div",{style:{flex:"1"},children:[(0,_.jsx)(s.__experimentalHeading,{level:4,children:(0,r.__)("Custom CSS","linear")}),(0,_.jsx)("br",{}),(0,_.jsx)("textarea",{value:H,onChange:e=>M(e.target.value),placeholder:(0,r.__)("Enter your custom CSS here...","linear"),style:{width:"100%",padding:"8px",fontSize:"14px",minHeight:"100px"}})]})})}),(0,_.jsx)(s.PanelRow,{children:(0,_.jsx)("blockquote",{children:(0,_.jsxs)("div",{style:{flex:"1"},children:[(0,_.jsx)(s.__experimentalHeading,{level:4,children:(0,r.__)("Custom CSS source","linear")}),(0,_.jsx)("br",{}),(0,_.jsx)("input",{type:"string",value:U,onChange:e=>W(e.target.value),placeholder:window.location.origin+"/custom-styles.css",style:{width:"100%",padding:"8px",fontSize:"14px"}})]})})}),(0,_.jsx)(s.PanelRow,{children:(0,_.jsx)("blockquote",{children:(0,_.jsxs)("div",{style:{flex:"1"},children:[(0,_.jsx)(s.__experimentalHeading,{level:4,children:(0,r.__)("Additional global settings","linear")}),(0,_.jsx)("p",{children:(0,r.__)("You can define here other globally used settings. These can be overwritten on a per-listing basis, but are as default applied to all listings.","linear")}),ie&&(0,_.jsx)(s.Button,{variant:"primary",href:ie,style:{marginTop:"10px"},children:(0,r.__)("See available attributes","linear")}),(0,_.jsx)("br",{}),F&&Array.isArray(F)&&F.length>0&&(0,_.jsx)("div",{style:{marginTop:"10px"},children:F.map(((e,t)=>(0,_.jsxs)("div",{style:{display:"flex",alignItems:"center",marginBottom:"10px",gap:"10px"},children:[(0,_.jsx)(s.TextControl,{label:(0,r.__)("Key","linear"),value:e.key||"",onChange:e=>{const n=F.map(((n,i)=>i===t?{...n,key:e}:n));z(n)},placeholder:(0,r.__)("Enter key","linear"),style:{flex:"1"}}),(0,_.jsx)(s.TextControl,{label:(0,r.__)("Value","linear"),value:e.value||"",onChange:e=>{const n=F.map(((n,i)=>i===t?{...n,value:e}:n));z(n)},placeholder:(0,r.__)("Enter value","linear"),style:{flex:"1"}}),(0,_.jsx)(s.Button,{isDestructive:!0,onClick:()=>{z((e=>e.filter(((e,n)=>n!==t))))},children:(0,r.__)("Remove","linear")})]},e.id||`setting-${t}`)))}),(0,_.jsx)(s.Button,{variant:"primary",onClick:()=>{z([...F||[],{key:"",value:""}])},style:{marginTop:"10px"},children:(0,r.__)("Add additional setting","linear")})]})})})]})]}),(0,_.jsx)(w,{onClick:()=>{Y||($(!0),q(),window.scrollTo({top:0,behavior:"smooth"}),setTimeout((()=>{$(!1)}),3e3))},disabled:!(u(e)&&u(n)&&g(l)&&Object.keys(S).length)})]})},k=window.wp.blocks,C=window.wp.blockEditor,P=n.p+"images/linear_logo_orange.67bac2cc.png";let T=!1;window.linear_admin_obj&&linear_admin_obj.blocks&&void 0!==linear_admin_obj.blocks.dynamicListings&&(T=linear_admin_obj.blocks.dynamicListings),T&&(0,k.registerBlockType)("linear/dynamic-listings-content",{title:(0,r.__)("Linear dynamic listings content","linear"),description:(0,r.__)("Display dynamically Linear listings and single listings","linear"),category:"widgets",icon:{src:(0,a.createElement)("img",{src:P,style:{width:"20px",height:"20px"}})},supports:{html:!1},attributes:{attributesList:{type:"array",default:[]},className:{type:"string",default:""}},edit:function({attributes:e}){const t=(0,C.useBlockProps)(),n=P||window.linearPluginData?.assetsUrl+"linear_logo_orange.png",i=window.linear_admin_obj?.dynamic_parent_pages||{},l=Object.values(i)[0]+"?guide"||0,[o,d]=(0,a.useState)(e.attributesList||[]),c=e=>{d(e),setAttributes({attributesList:e})},h=(e,t,n)=>{const i=[...o];i[e][t]=n.replace("data-",""),c(i)};return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(C.InspectorControls,{children:(0,_.jsxs)(s.PanelBody,{title:(0,r.__)("Listings Settings","linear"),children:[(0,_.jsx)("p",{children:(0,r.__)("This block will display Linear listings on the frontend.","linear")}),(0,_.jsx)("p",{children:(0,r.__)("You can use attributes to modify both the visual identity as well as what listings are shown.","linear")}),(0,_.jsx)("h3",{children:(0,r.__)("Attributes","linear")}),(0,_.jsx)("p",{children:(0,r.__)('All attributes added here will become data-<Attribute Name>="<Attribute Value>". See all available attributes behind the link.',"linear")}),(0,_.jsx)(s.Button,{variant:"primary",href:l,target:"_blank",style:{marginTop:"10px",marginBottom:"10px"},children:(0,r.__)("See available attributes","linear")}),o.map(((e,t)=>(0,_.jsxs)("div",{style:{marginBottom:"10px"},children:[(0,_.jsx)(s.TextControl,{label:(0,r.__)("Attribute name","linear"),value:e.key,onChange:e=>h(t,"key",e),placeholder:(0,r.__)("eg. use-filters","linear")}),(0,_.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[(0,_.jsx)(s.TextControl,{label:(0,r.__)("Attribute value","linear"),value:e.value,onChange:e=>h(t,"value",e),placeholder:(0,r.__)("eg. false","linear"),style:{flex:"1",width:"100%"}}),(0,_.jsx)(s.Button,{isDestructive:!0,onClick:()=>(e=>{const t=o.filter(((t,n)=>n!==e));c(t)})(t),style:{padding:"0",background:"none",border:"none",color:"red",cursor:"pointer"},children:(0,_.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",width:"16",height:"16",fill:"red",children:(0,_.jsx)("path",{d:"M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"})})})]})]},t))),(0,_.jsx)(s.Button,{isPrimary:!0,onClick:()=>{c([...o,{key:"",value:""}])},style:{marginBottom:"10px"},children:(0,r.__)("Add attribute","linear")})]})}),(0,_.jsx)("div",{...t,children:(0,_.jsxs)("div",{className:"linear-block-preview",style:{backgroundImage:n?`url(${n})`:"none",backgroundSize:"400px",backgroundPosition:"300px 10px",backgroundRepeat:"no-repeat",padding:"2rem",paddingRight:"45%",border:"2px solid #ef7953",borderRadius:"10px",minHeight:"200px"},children:[(0,_.jsx)("h3",{children:(0,r.__)("Linear dynamic listings","linear")}),(0,_.jsx)("p",{children:(0,r.__)("This block displays a list of property listings using the Linear shortcode.","linear")}),(0,_.jsx)("p",{children:(0,r.__)("The actual content will be loaded on the frontend.","linear")})]})})]})},save:function({attributes:e}){return null}}),(0,k.registerBlockType)("linear/listings",{title:(0,r.__)("Linear listings","linear"),description:(0,r.__)("Display your Linear listings","linear"),category:"widgets",icon:{src:(0,a.createElement)("img",{src:P,style:{width:"20px",height:"20px"}})},supports:{html:!1},attributes:{attributesList:{type:"array",default:[]},className:{type:"string",default:""}},edit:function({attributes:e,setAttributes:t}){const n=(0,C.useBlockProps)(),i=P||window.linearPluginData?.assetsUrl+"linear_logo_orange.png",l=window.linear_admin_obj?.dynamic_parent_pages||{},o=Object.values(l)[0]+"?guide"||0,[d,c]=(0,a.useState)(e.attributesList||[]),h=e=>{c(e),t({attributesList:e})},u=(e,t,n)=>{const i=[...d];i[e][t]=n.replace("data-",""),h(i)};return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(C.InspectorControls,{children:(0,_.jsxs)(s.PanelBody,{title:(0,r.__)("Listings Settings","linear"),children:[(0,_.jsx)("p",{children:(0,r.__)("This block will display Linear listings on the frontend.","linear")}),(0,_.jsx)("p",{children:(0,r.__)("You can use attributes to modify both the visual identity as well as what listings are shown.","linear")}),(0,_.jsx)("h3",{children:(0,r.__)("Attributes","linear")}),(0,_.jsx)("p",{children:(0,r.__)('All attributes added here will become data-<Attribute Name>="<Attribute Value>". See all available attributes behind the link.',"linear")}),(0,_.jsx)(s.Button,{variant:"primary",href:o,target:"_blank",style:{marginTop:"10px",marginBottom:"10px"},children:(0,r.__)("See available attributes","linear")}),d.map(((e,t)=>(0,_.jsxs)("div",{style:{marginBottom:"10px"},children:[(0,_.jsx)(s.TextControl,{label:(0,r.__)("Attribute name","linear"),value:e.key,onChange:e=>u(t,"key",e),placeholder:(0,r.__)("eg. use-filters","linear")}),(0,_.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[(0,_.jsx)(s.TextControl,{label:(0,r.__)("Attribute value","linear"),value:e.value,onChange:e=>u(t,"value",e),placeholder:(0,r.__)("eg. false","linear"),style:{flex:"1",width:"100%"}}),(0,_.jsx)(s.Button,{isDestructive:!0,onClick:()=>(e=>{const t=d.filter(((t,n)=>n!==e));h(t)})(t),style:{padding:"0",background:"none",border:"none",color:"red",cursor:"pointer"},children:(0,_.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",width:"16",height:"16",fill:"red",children:(0,_.jsx)("path",{d:"M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"})})})]})]},t))),(0,_.jsx)(s.Button,{isPrimary:!0,onClick:()=>{h([...d,{key:"",value:""}])},style:{marginBottom:"10px"},children:(0,r.__)("Add attribute","linear")})]})}),(0,_.jsx)("div",{...n,children:(0,_.jsxs)("div",{className:"linear-block-preview",style:{backgroundImage:i?`url(${i})`:void 0,backgroundSize:"400px",backgroundPosition:"300px 10px",backgroundRepeat:"no-repeat",padding:"2rem",paddingRight:"45%",border:"2px solid #ef7953",borderRadius:"10px",minHeight:"200px"},children:[(0,_.jsx)("h2",{children:(0,r.__)("Linear Listings","linear")}),(0,_.jsx)("p",{children:(0,r.__)("This block displays a list of property listings.","linear")}),(0,_.jsx)("p",{children:(0,r.__)("The actual content will be loaded on the frontend.","linear")})]})})]})},save:function({attributes:e}){return null}}),l()((()=>{document.getElementById("linear-react-settings")&&(0,a.createRoot)(document.getElementById("linear-react-settings")).render((0,_.jsx)(S,{}))}))}},n={};function i(e){var l=n[e];if(void 0!==l)return l.exports;var a=n[e]={exports:{}};return t[e](a,a.exports,i),a.exports}i.m=t,e=[],i.O=(t,n,l,a)=>{if(!n){var r=1/0;for(c=0;c<e.length;c++){for(var[n,l,a]=e[c],s=!0,o=0;o<n.length;o++)(!1&a||r>=a)&&Object.keys(i.O).every((e=>i.O[e](n[o])))?n.splice(o--,1):(s=!1,a<r&&(r=a));if(s){e.splice(c--,1);var d=l();void 0!==d&&(t=d)}}return t}a=a||0;for(var c=e.length;c>0&&e[c-1][2]>a;c--)e[c]=e[c-1];e[c]=[n,l,a]},i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;i.g.importScripts&&(e=i.g.location+"");var t=i.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var l=n.length-1;l>-1&&(!e||!/^http(s?):/.test(e));)e=n[l--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=e})(),(()=>{var e={57:0,350:0};i.O.j=t=>0===e[t];var t=(t,n)=>{var l,a,[r,s,o]=n,d=0;if(r.some((t=>0!==e[t]))){for(l in s)i.o(s,l)&&(i.m[l]=s[l]);if(o)var c=o(i)}for(t&&t(n);d<r.length;d++)a=r[d],i.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return i.O(c)},n=globalThis.webpackChunk=globalThis.webpackChunk||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var l=i.O(void 0,[350],(()=>i(345)));l=i.O(l)})(); 1 /******/ (() => { // webpackBootstrap 2 /******/ "use strict"; 3 /******/ var __webpack_modules__ = ({ 4 5 /***/ "./src/assets/linear_logo_orange.png": 6 /*!*******************************************!*\ 7 !*** ./src/assets/linear_logo_orange.png ***! 8 \*******************************************/ 9 /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 10 11 module.exports = __webpack_require__.p + "images/linear_logo_orange.67bac2cc.png"; 12 13 /***/ }), 14 15 /***/ "./src/blocks/dynamic-listings/edit.js": 16 /*!*********************************************!*\ 17 !*** ./src/blocks/dynamic-listings/edit.js ***! 18 \*********************************************/ 19 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 20 21 __webpack_require__.r(__webpack_exports__); 22 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 23 /* harmony export */ "default": () => (/* binding */ Edit) 24 /* harmony export */ }); 25 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 26 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); 27 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); 28 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__); 29 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 30 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); 31 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 32 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__); 33 /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./editor.scss */ "./src/blocks/dynamic-listings/editor.scss"); 34 /* harmony import */ var _assets_linear_logo_orange_png__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../assets/linear_logo_orange.png */ "./src/assets/linear_logo_orange.png"); 35 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); 36 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__); 37 38 39 40 41 42 43 44 function Edit({ 45 attributes 46 }) { 47 const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)(); 48 const backgroundImage = _assets_linear_logo_orange_png__WEBPACK_IMPORTED_MODULE_5__ || window.linearPluginData?.assetsUrl + 'linear_logo_orange.png'; 49 const dynamicParentPages = window.linear_admin_obj?.dynamic_parent_pages || {}; 50 const firstDynamicParentPage = Object.values(dynamicParentPages)[0] + '?guide' || 0; 51 const [attributesList, setAttributesList] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(attributes.attributesList || []); 52 const updateAttributesList = newList => { 53 setAttributesList(newList); 54 setAttributes({ 55 attributesList: newList 56 }); 57 }; 58 const addKeyValuePair = () => { 59 updateAttributesList([...attributesList, { 60 key: '', 61 value: '' 62 }]); 63 }; 64 const updateKeyValuePair = (index, field, value) => { 65 const updatedList = [...attributesList]; 66 updatedList[index][field] = value.replace('data-', ''); 67 updateAttributesList(updatedList); 68 }; 69 const removeKeyValuePair = index => { 70 const updatedList = attributesList.filter((_, i) => i !== index); 71 updateAttributesList(updatedList); 72 }; 73 return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.Fragment, { 74 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InspectorControls, { 75 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.PanelBody, { 76 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Listings Settings', 'linear'), 77 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p", { 78 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('This block will display Linear listings on the frontend.', 'linear') 79 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p", { 80 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('You can use attributes to modify both the visual identity as well as what listings are shown.', 'linear') 81 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("h3", { 82 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Attributes', 'linear') 83 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p", { 84 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('All attributes added here will become data-<Attribute Name>="<Attribute Value>". See all available attributes behind the link.', 'linear') 85 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Button, { 86 variant: "primary", 87 href: firstDynamicParentPage, 88 target: "_blank", 89 style: { 90 marginTop: '10px', 91 marginBottom: '10px' 92 }, 93 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('See available attributes', 'linear') 94 }), attributesList.map((item, index) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div", { 95 style: { 96 marginBottom: '10px' 97 }, 98 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.TextControl, { 99 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Attribute name', 'linear'), 100 value: item.key, 101 onChange: value => updateKeyValuePair(index, 'key', value), 102 placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('eg. use-filters', 'linear') 103 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div", { 104 style: { 105 display: 'flex', 106 alignItems: 'center', 107 gap: '10px' 108 }, 109 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.TextControl, { 110 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Attribute value', 'linear'), 111 value: item.value, 112 onChange: value => updateKeyValuePair(index, 'value', value), 113 placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('eg. false', 'linear'), 114 style: { 115 flex: '1', 116 width: '100%' 117 } 118 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Button, { 119 isDestructive: true, 120 onClick: () => removeKeyValuePair(index), 121 style: { 122 padding: '0', 123 background: 'none', 124 border: 'none', 125 color: 'red', 126 cursor: 'pointer' 127 }, 128 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("svg", { 129 xmlns: "http://www.w3.org/2000/svg", 130 viewBox: "0 0 384 512", 131 width: "16", 132 height: "16", 133 fill: "red", 134 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("path", { 135 d: "M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z" 136 }) 137 }) 138 })] 139 })] 140 }, index)), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Button, { 141 isPrimary: true, 142 onClick: addKeyValuePair, 143 style: { 144 marginBottom: '10px' 145 }, 146 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add attribute', 'linear') 147 })] 148 }) 149 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", { 150 ...blockProps, 151 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div", { 152 className: "linear-block-preview", 153 style: { 154 backgroundImage: backgroundImage ? `url(${backgroundImage})` : 'none', 155 backgroundSize: '400px', 156 backgroundPosition: '300px 10px', 157 backgroundRepeat: 'no-repeat', 158 padding: '2rem', 159 paddingRight: '45%', 160 border: '2px solid #ef7953', 161 borderRadius: '10px', 162 minHeight: '200px' 163 }, 164 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("h3", { 165 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Linear dynamic listings', 'linear') 166 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p", { 167 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('This block displays a list of property listings using the Linear shortcode.', 'linear') 168 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p", { 169 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('The actual content will be loaded on the frontend.', 'linear') 170 })] 171 }) 172 })] 173 }); 174 } 175 176 /***/ }), 177 178 /***/ "./src/blocks/dynamic-listings/editor.scss": 179 /*!*************************************************!*\ 180 !*** ./src/blocks/dynamic-listings/editor.scss ***! 181 \*************************************************/ 182 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 183 184 __webpack_require__.r(__webpack_exports__); 185 // extracted by mini-css-extract-plugin 186 187 188 /***/ }), 189 190 /***/ "./src/blocks/dynamic-listings/index.js": 191 /*!**********************************************!*\ 192 !*** ./src/blocks/dynamic-listings/index.js ***! 193 \**********************************************/ 194 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 195 196 __webpack_require__.r(__webpack_exports__); 197 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 198 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__); 199 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 200 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); 201 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 202 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); 203 /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./edit */ "./src/blocks/dynamic-listings/edit.js"); 204 /* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./save */ "./src/blocks/dynamic-listings/save.js"); 205 /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./style.scss */ "./src/blocks/dynamic-listings/style.scss"); 206 /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./editor.scss */ "./src/blocks/dynamic-listings/editor.scss"); 207 /* harmony import */ var _assets_linear_logo_orange_png__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../assets/linear_logo_orange.png */ "./src/assets/linear_logo_orange.png"); 208 209 210 211 212 213 214 215 216 let renderBlock = false; 217 if (window.linear_admin_obj && linear_admin_obj.blocks && typeof linear_admin_obj.blocks.dynamicListings !== 'undefined') { 218 renderBlock = linear_admin_obj.blocks.dynamicListings; 219 } 220 if (renderBlock) { 221 (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)('linear/dynamic-listings-content', { 222 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Linear dynamic listings content', 'linear'), 223 description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Display dynamically Linear listings and single listings', 'linear'), 224 category: 'widgets', 225 icon: { 226 src: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.createElement)('img', { 227 src: _assets_linear_logo_orange_png__WEBPACK_IMPORTED_MODULE_7__, 228 style: { 229 width: '20px', 230 height: '20px' 231 } 232 }) 233 }, 234 supports: { 235 html: false 236 }, 237 attributes: { 238 attributesList: { 239 type: "array", 240 default: [] 241 }, 242 className: { 243 type: 'string', 244 default: '' 245 } 246 }, 247 edit: _edit__WEBPACK_IMPORTED_MODULE_3__["default"], 248 save: _save__WEBPACK_IMPORTED_MODULE_4__["default"] 249 }); 250 } 251 252 /***/ }), 253 254 /***/ "./src/blocks/dynamic-listings/save.js": 255 /*!*********************************************!*\ 256 !*** ./src/blocks/dynamic-listings/save.js ***! 257 \*********************************************/ 258 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 259 260 __webpack_require__.r(__webpack_exports__); 261 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 262 /* harmony export */ "default": () => (/* binding */ Save) 263 /* harmony export */ }); 264 function Save({ 265 attributes 266 }) { 267 return null; 268 } 269 270 /***/ }), 271 272 /***/ "./src/blocks/dynamic-listings/style.scss": 273 /*!************************************************!*\ 274 !*** ./src/blocks/dynamic-listings/style.scss ***! 275 \************************************************/ 276 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 277 278 __webpack_require__.r(__webpack_exports__); 279 // extracted by mini-css-extract-plugin 280 281 282 /***/ }), 283 284 /***/ "./src/blocks/listings/edit.js": 285 /*!*************************************!*\ 286 !*** ./src/blocks/listings/edit.js ***! 287 \*************************************/ 288 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 289 290 __webpack_require__.r(__webpack_exports__); 291 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 292 /* harmony export */ "default": () => (/* binding */ Edit) 293 /* harmony export */ }); 294 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 295 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); 296 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); 297 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__); 298 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 299 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); 300 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 301 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__); 302 /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./editor.scss */ "./src/blocks/listings/editor.scss"); 303 /* harmony import */ var _assets_linear_logo_orange_png__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../assets/linear_logo_orange.png */ "./src/assets/linear_logo_orange.png"); 304 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); 305 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__); 306 307 308 309 310 311 312 313 function Edit({ 314 attributes, 315 setAttributes 316 }) { 317 const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)(); 318 const backgroundImage = _assets_linear_logo_orange_png__WEBPACK_IMPORTED_MODULE_5__ || window.linearPluginData?.assetsUrl + 'linear_logo_orange.png'; 319 const dynamicParentPages = window.linear_admin_obj?.dynamic_parent_pages || {}; 320 const firstDynamicParentPage = Object.values(dynamicParentPages)[0] + '?guide' || 0; 321 const [attributesList, setAttributesList] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(attributes.attributesList || []); 322 const updateAttributesList = newList => { 323 setAttributesList(newList); 324 setAttributes({ 325 attributesList: newList 326 }); 327 }; 328 const addKeyValuePair = () => { 329 updateAttributesList([...attributesList, { 330 key: '', 331 value: '' 332 }]); 333 }; 334 const updateKeyValuePair = (index, field, value) => { 335 const updatedList = [...attributesList]; 336 updatedList[index][field] = value.replace('data-', ''); 337 updateAttributesList(updatedList); 338 }; 339 const removeKeyValuePair = index => { 340 const updatedList = attributesList.filter((_, i) => i !== index); 341 updateAttributesList(updatedList); 342 }; 343 return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.Fragment, { 344 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InspectorControls, { 345 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.PanelBody, { 346 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Listings Settings', 'linear'), 347 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p", { 348 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('This block will display Linear listings on the frontend.', 'linear') 349 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p", { 350 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('You can use attributes to modify both the visual identity as well as what listings are shown.', 'linear') 351 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("h3", { 352 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Attributes', 'linear') 353 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p", { 354 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('All attributes added here will become data-<Attribute Name>="<Attribute Value>". See all available attributes behind the link.', 'linear') 355 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Button, { 356 variant: "primary", 357 href: firstDynamicParentPage, 358 target: "_blank", 359 style: { 360 marginTop: '10px', 361 marginBottom: '10px' 362 }, 363 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('See available attributes', 'linear') 364 }), attributesList.map((item, index) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div", { 365 style: { 366 marginBottom: '10px' 367 }, 368 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.TextControl, { 369 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Attribute name', 'linear'), 370 value: item.key, 371 onChange: value => updateKeyValuePair(index, 'key', value), 372 placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('eg. use-filters', 'linear') 373 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div", { 374 style: { 375 display: 'flex', 376 alignItems: 'center', 377 gap: '10px' 378 }, 379 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.TextControl, { 380 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Attribute value', 'linear'), 381 value: item.value, 382 onChange: value => updateKeyValuePair(index, 'value', value), 383 placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('eg. false', 'linear'), 384 style: { 385 flex: '1', 386 width: '100%' 387 } 388 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Button, { 389 isDestructive: true, 390 onClick: () => removeKeyValuePair(index), 391 style: { 392 padding: '0', 393 background: 'none', 394 border: 'none', 395 color: 'red', 396 cursor: 'pointer' 397 }, 398 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("svg", { 399 xmlns: "http://www.w3.org/2000/svg", 400 viewBox: "0 0 384 512", 401 width: "16", 402 height: "16", 403 fill: "red", 404 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("path", { 405 d: "M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z" 406 }) 407 }) 408 })] 409 })] 410 }, index)), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Button, { 411 isPrimary: true, 412 onClick: addKeyValuePair, 413 style: { 414 marginBottom: '10px' 415 }, 416 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add attribute', 'linear') 417 })] 418 }) 419 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", { 420 ...blockProps, 421 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div", { 422 className: "linear-block-preview", 423 style: { 424 backgroundImage: backgroundImage ? `url(${backgroundImage})` : undefined, 425 backgroundSize: '400px', 426 backgroundPosition: '300px 10px', 427 backgroundRepeat: 'no-repeat', 428 padding: '2rem', 429 paddingRight: '45%', 430 border: '2px solid #ef7953', 431 borderRadius: '10px', 432 minHeight: '200px' 433 }, 434 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("h2", { 435 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Linear Listings', 'linear') 436 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p", { 437 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('This block displays a list of property listings.', 'linear') 438 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p", { 439 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('The actual content will be loaded on the frontend.', 'linear') 440 })] 441 }) 442 })] 443 }); 444 } 445 446 /***/ }), 447 448 /***/ "./src/blocks/listings/editor.scss": 449 /*!*****************************************!*\ 450 !*** ./src/blocks/listings/editor.scss ***! 451 \*****************************************/ 452 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 453 454 __webpack_require__.r(__webpack_exports__); 455 // extracted by mini-css-extract-plugin 456 457 458 /***/ }), 459 460 /***/ "./src/blocks/listings/index.js": 461 /*!**************************************!*\ 462 !*** ./src/blocks/listings/index.js ***! 463 \**************************************/ 464 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 465 466 __webpack_require__.r(__webpack_exports__); 467 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 468 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__); 469 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 470 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); 471 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 472 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); 473 /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./edit */ "./src/blocks/listings/edit.js"); 474 /* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./save */ "./src/blocks/listings/save.js"); 475 /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./style.scss */ "./src/blocks/listings/style.scss"); 476 /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./editor.scss */ "./src/blocks/listings/editor.scss"); 477 /* harmony import */ var _assets_linear_logo_orange_png__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../assets/linear_logo_orange.png */ "./src/assets/linear_logo_orange.png"); 478 479 480 481 482 483 484 485 486 (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)('linear/listings', { 487 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Linear listings', 'linear'), 488 description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Display your Linear listings', 'linear'), 489 category: 'widgets', 490 icon: { 491 src: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.createElement)('img', { 492 src: _assets_linear_logo_orange_png__WEBPACK_IMPORTED_MODULE_7__, 493 style: { 494 width: '20px', 495 height: '20px' 496 } 497 }) 498 }, 499 supports: { 500 html: false 501 }, 502 attributes: { 503 attributesList: { 504 type: "array", 505 default: [] 506 }, 507 className: { 508 type: 'string', 509 default: '' 510 } 511 }, 512 edit: _edit__WEBPACK_IMPORTED_MODULE_3__["default"], 513 save: _save__WEBPACK_IMPORTED_MODULE_4__["default"] 514 }); 515 516 /***/ }), 517 518 /***/ "./src/blocks/listings/save.js": 519 /*!*************************************!*\ 520 !*** ./src/blocks/listings/save.js ***! 521 \*************************************/ 522 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 523 524 __webpack_require__.r(__webpack_exports__); 525 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 526 /* harmony export */ "default": () => (/* binding */ Save) 527 /* harmony export */ }); 528 function Save({ 529 attributes 530 }) { 531 return null; 532 } 533 534 /***/ }), 535 536 /***/ "./src/blocks/listings/style.scss": 537 /*!****************************************!*\ 538 !*** ./src/blocks/listings/style.scss ***! 539 \****************************************/ 540 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 541 542 __webpack_require__.r(__webpack_exports__); 543 // extracted by mini-css-extract-plugin 544 545 546 /***/ }), 547 548 /***/ "./src/components/index.js": 549 /*!*********************************!*\ 550 !*** ./src/components/index.js ***! 551 \*********************************/ 552 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 553 554 __webpack_require__.r(__webpack_exports__); 555 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 556 /* harmony export */ SettingsPage: () => (/* reexport safe */ _settings_page__WEBPACK_IMPORTED_MODULE_0__.SettingsPage) 557 /* harmony export */ }); 558 /* harmony import */ var _settings_page__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./settings-page */ "./src/components/settings-page.jsx"); 559 560 561 /***/ }), 562 563 /***/ "./src/components/notices.jsx": 564 /*!************************************!*\ 565 !*** ./src/components/notices.jsx ***! 566 \************************************/ 567 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 568 569 __webpack_require__.r(__webpack_exports__); 570 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 571 /* harmony export */ Notices: () => (/* binding */ Notices) 572 /* harmony export */ }); 573 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 574 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); 575 /* harmony import */ var _wordpress_notices__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/notices */ "@wordpress/notices"); 576 /* harmony import */ var _wordpress_notices__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_notices__WEBPACK_IMPORTED_MODULE_1__); 577 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 578 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); 579 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); 580 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__); 581 582 583 584 585 const Notices = () => { 586 const { 587 removeNotice 588 } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.useDispatch)(_wordpress_notices__WEBPACK_IMPORTED_MODULE_1__.store); 589 const notices = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_wordpress_notices__WEBPACK_IMPORTED_MODULE_1__.store).getNotices()); 590 if (notices.length === 0) { 591 return null; 592 } 593 return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.NoticeList, { 594 notices: notices, 595 onRemove: removeNotice 596 }); 597 }; 598 599 600 /***/ }), 601 602 /***/ "./src/components/page-selector.jsx": 603 /*!******************************************!*\ 604 !*** ./src/components/page-selector.jsx ***! 605 \******************************************/ 606 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 607 608 __webpack_require__.r(__webpack_exports__); 609 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 610 /* harmony export */ PageSelector: () => (/* binding */ PageSelector) 611 /* harmony export */ }); 612 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 613 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); 614 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 615 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); 616 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); 617 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__); 618 619 620 621 const PageSelector = ({ 622 label, 623 value, 624 pages, 625 onChange, 626 help, 627 showLink = true, 628 getLinkForLanguagePage, 629 getTitleForLanguagePage 630 }) => { 631 return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", { 632 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.SelectControl, { 633 label: label, 634 value: value, 635 options: [{ 636 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Select a page...', 'linear'), 637 value: '' 638 }, ...(pages ? pages.map(page => ({ 639 label: page.title.raw, 640 value: page.id 641 })) : [])], 642 onChange: onChange, 643 help: help 644 }), showLink && value && pages && getLinkForLanguagePage ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", { 645 style: { 646 marginTop: '5px' 647 }, 648 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("p", { 649 children: [(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Link to page: ', 'linear'), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("a", { 650 href: getLinkForLanguagePage(), 651 target: "_blank", 652 rel: "noopener noreferrer", 653 children: getTitleForLanguagePage() 654 })] 655 }) 656 }) : ''] 657 }); 658 }; 659 660 661 /***/ }), 662 663 /***/ "./src/components/settings-page.jsx": 664 /*!******************************************!*\ 665 !*** ./src/components/settings-page.jsx ***! 666 \******************************************/ 667 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 668 669 __webpack_require__.r(__webpack_exports__); 670 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 671 /* harmony export */ SettingsPage: () => (/* binding */ SettingsPage) 672 /* harmony export */ }); 673 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 674 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); 675 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 676 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); 677 /* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../hooks */ "./src/hooks/index.js"); 678 /* harmony import */ var _notices__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./notices */ "./src/components/notices.jsx"); 679 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 680 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_4__); 681 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 682 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__); 683 /* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/core-data */ "@wordpress/core-data"); 684 /* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_6__); 685 /* harmony import */ var _utils_validators__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/validators */ "./src/utils/validators.js"); 686 /* harmony import */ var _page_selector__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./page-selector */ "./src/components/page-selector.jsx"); 687 /* harmony import */ var _utils_language_utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../utils/language-utils */ "./src/utils/language-utils.js"); 688 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); 689 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__); 690 691 692 693 694 695 696 // import { store as noticesStore } from '@wordpress/notices'; 697 698 699 700 701 // import { MessageControl } from './controls'; 702 703 /* 704 const SettingsTitle = () => { 705 return ( 706 <Heading level={ 1 }> 707 { __( 'Linear Announcement Bar', 'linear' ) } 708 </Heading> 709 ); 710 }; 711 */ 712 713 const SaveButton = ({ 714 onClick, 715 disabled 716 }) => { 717 return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Button, { 718 variant: "primary", 719 onClick: onClick, 720 __next40pxDefaultSize: true, 721 disabled: disabled, 722 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Save', 'linear') 723 }); 724 }; 725 const SettingsPage = () => { 726 const { 727 appUrl, 728 setAppUrl, 729 dataUrl, 730 setDataUrl, 731 clientSecret, 732 setClientSecret, 733 dynamicParentPages, 734 setDynamicParentPages, 735 renderingMethod, 736 setRenderingMethod, 737 shortcodeRenderingMethod, 738 setShortcodeRenderingMethod, 739 useTestData, 740 setUseTestData, 741 listingLeadsIntegration, 742 setListingLeadsIntegration, 743 featuredImage, 744 setFeaturedImage, 745 themeColor, 746 setThemeColor, 747 resultsPerPage, 748 setResultsPerPage, 749 customCss, 750 setCustomCss, 751 customCssSrc, 752 setCustomCssSrc, 753 additionalSettings, 754 setAdditionalSettings, 755 saveSettings 756 } = (0,_hooks__WEBPACK_IMPORTED_MODULE_2__.useSettings)(); 757 const [isSaving, setIsSaving] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useState)(false); 758 const [detectedLanguages, setDetectedLanguages] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useState)(['fi']); 759 const { 760 isMobile 761 } = (0,_hooks__WEBPACK_IMPORTED_MODULE_2__.useResponsive)(); 762 const exceptions = window.linear_admin_obj.exception_rules || []; 763 764 // Fetch available languages from the REST API 765 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useEffect)(() => { 766 const fetchLanguages = async () => { 767 try { 768 const response = await fetch('/wp-json/linear/v3/languages', { 769 headers: { 770 'X-WP-Nonce': linear_admin_obj.rest.nonce 771 } 772 }); 773 if (!response.ok) { 774 throw new Error('Failed to fetch languages'); 775 } 776 const languages = await response.json(); 777 setDetectedLanguages(languages); 778 } catch (error) { 779 console.error('Error fetching languages:', error); 780 const languages = [document.getElementsByTagName('html')[0].getAttribute('lang') || 'fi']; 781 setDetectedLanguages(languages); 782 } 783 }; 784 fetchLanguages(); 785 }, []); 786 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useEffect)(() => { 787 const cleanedPages = {}; 788 detectedLanguages.forEach(lang => { 789 if (dynamicParentPages[lang]) { 790 cleanedPages[lang] = dynamicParentPages[lang]; 791 } 792 }); 793 if (JSON.stringify(cleanedPages) !== JSON.stringify(dynamicParentPages)) { 794 setDynamicParentPages(cleanedPages); 795 } 796 }, [detectedLanguages, dynamicParentPages]); 797 const handleSaveSettings = () => { 798 if (isSaving) { 799 return; 800 } 801 setIsSaving(true); 802 saveSettings(); 803 window.scrollTo({ 804 top: 0, 805 behavior: 'smooth' 806 }); 807 808 // Stop save spamming 809 setTimeout(() => { 810 setIsSaving(false); 811 }, 3000); 812 }; 813 const pages = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => { 814 const query = { 815 per_page: -1, 816 status: 'publish' 817 }; 818 const fetchedPages = select(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_6__.store).getEntityRecords('postType', 'page', query); 819 return fetchedPages; 820 }, []); 821 const languageSelectorStyles = { 822 languageSection: { 823 marginBottom: '20px', 824 padding: '15px', 825 backgroundColor: '#f9f9f9', 826 borderRadius: '4px', 827 border: '1px solid #e0e0e0' 828 }, 829 languageTitle: { 830 marginTop: '0', 831 marginBottom: '10px', 832 fontSize: '14px', 833 fontWeight: 'bold', 834 textTransform: 'capitalize' 835 } 836 }; 837 const styleTextControl = { 838 padding: '10px', 839 fontSize: '16px' 840 }; 841 const styleTextControlError = { 842 borderColor: 'red', 843 backgroundColor: '#ffe6e6' 844 }; 845 const styleRenderMethodContainer = { 846 display: 'flex', 847 flexDirection: isMobile ? 'column' : 'row', 848 gap: isMobile ? '1rem' : '2rem', 849 width: '100%' 850 }; 851 const styleRenderMethodItem = { 852 flex: isMobile ? '1 1 100%' : '1', 853 minWidth: isMobile ? '100%' : '0' 854 }; 855 const openMediaLibrary = () => { 856 const mediaFrame = wp.media({ 857 title: 'Select or Upload Media', 858 button: { 859 text: 'Use this media' 860 }, 861 multiple: false 862 }); 863 mediaFrame.on('select', function () { 864 const attachment = mediaFrame.state().get('selection').first().toJSON(); 865 setFeaturedImage(attachment.url); 866 }); 867 mediaFrame.open(); 868 }; 869 let firstDynamicParentPage = '#'; 870 if (detectedLanguages.length > 0) { 871 const firstLanguage = detectedLanguages[0]; 872 firstDynamicParentPage = (0,_utils_language_utils__WEBPACK_IMPORTED_MODULE_9__.getLinkForLanguagePage)(dynamicParentPages, pages, detectedLanguages, firstLanguage) + '?guide'; 873 } 874 return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.Fragment, { 875 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_notices__WEBPACK_IMPORTED_MODULE_3__.Notices, {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Panel, { 876 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelBody, { 877 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Setup', 'linear'), 878 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelRow, { 879 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("blockquote", { 880 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 881 style: { 882 flex: '1' 883 }, 884 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHeading, { 885 level: 4, 886 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('App URL', 'linear') 887 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("br", {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.TextControl, { 888 value: appUrl, 889 onChange: value => setAppUrl(value), 890 style: { 891 ...styleTextControl, 892 ...(appUrl !== '' && !(0,_utils_validators__WEBPACK_IMPORTED_MODULE_7__.validateUrl)(appUrl) ? styleTextControlError : {}) 893 }, 894 placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('https://...', 'linear'), 895 help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('A source for listings view', 'linear') 896 })] 897 }) 898 }) 899 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelRow, { 900 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("blockquote", { 901 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 902 style: { 903 flex: '1' 904 }, 905 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHeading, { 906 level: 4, 907 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Data source URL', 'linear') 908 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("br", {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.TextControl, { 909 value: dataUrl, 910 onChange: value => setDataUrl(value), 911 style: { 912 ...styleTextControl, 913 ...(dataUrl !== '' && !(0,_utils_validators__WEBPACK_IMPORTED_MODULE_7__.validateUrl)(dataUrl) ? styleTextControlError : {}) 914 }, 915 placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('https://...', 'linear'), 916 help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Our main data-source', 'linear') 917 })] 918 }) 919 }) 920 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelRow, { 921 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("blockquote", { 922 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 923 style: { 924 flex: '1' 925 }, 926 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHeading, { 927 level: 4, 928 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Client secret', 'linear') 929 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("br", {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.TextControl, { 930 value: clientSecret, 931 onChange: value => setClientSecret(value), 932 style: { 933 ...styleTextControl, 934 ...(clientSecret !== '' && !(0,_utils_validators__WEBPACK_IMPORTED_MODULE_7__.validateClientSecret)(clientSecret) ? styleTextControlError : {}) 935 }, 936 placeholder: "...", 937 help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Linear should provide this for you', 'linear') 938 })] 939 }) 940 }) 941 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelRow, { 942 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("blockquote", { 943 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 944 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHeading, { 945 level: 4, 946 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Dynamic Parent Pages', 'linear') 947 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("br", {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 948 style: { 949 marginLeft: '0rem' 950 }, 951 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 952 style: { 953 marginBottom: '15px' 954 }, 955 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("p", { 956 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('We have to set a dynamic parent page for each language. This is the page that will be used to load the listings dynamically. You might want to create a page dedicated for this purpose, if you haven\'t already done that.', 'linear') 957 }), exceptions.includes('translatePress') && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("p", { 958 style: { 959 fontWeight: 'bold', 960 textDecoration: 'underline' 961 }, 962 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('If you are using TranslatePress, you can only have one set dynamic parent page, but the content will be determed by the TranslatePress selected language.', 'linear') 963 })] 964 }), detectedLanguages.map(lang => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 965 style: languageSelectorStyles.languageSection, 966 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("h3", { 967 style: languageSelectorStyles.languageTitle, 968 children: lang 969 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_page_selector__WEBPACK_IMPORTED_MODULE_8__.PageSelector, { 970 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Select any page to use as parent for', 'linear') + ' ' + lang, 971 value: (0,_utils_language_utils__WEBPACK_IMPORTED_MODULE_9__.getPageForLanguage)(dynamicParentPages, detectedLanguages, lang), 972 pages: (0,_utils_language_utils__WEBPACK_IMPORTED_MODULE_9__.getFilteredPages)(pages, detectedLanguages, lang), 973 onChange: value => setDynamicParentPages((0,_utils_language_utils__WEBPACK_IMPORTED_MODULE_9__.handlePageSelect)(value, dynamicParentPages, detectedLanguages, lang, exceptions)), 974 getLinkForLanguagePage: () => (0,_utils_language_utils__WEBPACK_IMPORTED_MODULE_9__.getLinkForLanguagePage)(dynamicParentPages, pages, detectedLanguages, lang), 975 getTitleForLanguagePage: () => (0,_utils_language_utils__WEBPACK_IMPORTED_MODULE_9__.getTitleForLanguagePage)(dynamicParentPages, pages, detectedLanguages, lang) 976 })] 977 }, lang)), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", { 978 style: { 979 marginTop: '15px', 980 fontSize: '13px', 981 fontStyle: 'italic' 982 }, 983 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Changing parent pages will flush rewrite rules to ensure proper URL handling.', 'linear') 984 })] 985 })] 986 }) 987 }) 988 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelRow, { 989 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("blockquote", { 990 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 991 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHeading, { 992 level: 4, 993 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Rendering method', 'linear') 994 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("br", {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 995 style: styleRenderMethodContainer, 996 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", { 997 style: styleRenderMethodItem, 998 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.SelectControl, { 999 value: renderingMethod, 1000 options: [{ 1001 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Inline (default)', 'linear'), 1002 value: 'inline' 1003 }, { 1004 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Shortcode', 'linear'), 1005 value: 'shortcode' 1006 }, { 1007 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Gutenberg block', 'linear'), 1008 value: 'gutenberg' 1009 }], 1010 onChange: value => setRenderingMethod(value), 1011 help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Decide on how you wish the content to be shown. If you have a custom WordPress solution, you might be better off by using the Shortcode option.', 'linear'), 1012 style: { 1013 flex: '1' 1014 } 1015 }) 1016 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 1017 style: styleRenderMethodItem, 1018 children: [renderingMethod === 'inline' ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("p", { 1019 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('The content will be rendered inline after the page main content.', 'linear') 1020 }) : '', renderingMethod === 'shortcode' ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 1021 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("p", { 1022 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('The dynamic content will be rendered via a shortcode. You can place the shortcode anywhere on your selected page. That page will be used to dynamically load Linear listings.', 'linear') 1023 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("p", { 1024 children: [(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('The shortcode is:', 'linear'), ' ', /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("code", { 1025 children: "[linear_listings_content]" 1026 })] 1027 })] 1028 }) : '', renderingMethod === 'gutenberg' ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 1029 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("p", { 1030 children: detectedLanguages.length > 1 ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Please add the Gutenberg block "Linear dynamic listings" to the pages: ', 'linear') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Please add the Gutenberg block "Linear dynamic listings" to the page: ', 'linear') 1031 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", { 1032 style: { 1033 display: 'flex', 1034 flexDirection: 'column' 1035 }, 1036 children: dynamicParentPages && Object.entries(dynamicParentPages).reduce((acc, [lang, id]) => { 1037 if (!acc.some(([_, existingId]) => existingId === id)) { 1038 acc.push([lang, id]); 1039 } 1040 return acc; 1041 }, []).map(([lang, id]) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("a", { 1042 href: (0,_utils_language_utils__WEBPACK_IMPORTED_MODULE_9__.getLinkForLanguagePage)(dynamicParentPages, pages, detectedLanguages, lang), 1043 children: (0,_utils_language_utils__WEBPACK_IMPORTED_MODULE_9__.getTitleForLanguagePage)(dynamicParentPages, pages, detectedLanguages, lang) 1044 }, id)) 1045 })] 1046 }) : ''] 1047 }), renderingMethod === 'shortcode' ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", { 1048 style: styleRenderMethodItem, 1049 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.SelectControl, { 1050 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Shortcode rendering method', 'linear'), 1051 value: shortcodeRenderingMethod, 1052 options: [{ 1053 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Should render both single listings and a list of listings', 'linear'), 1054 value: 'default' 1055 }, { 1056 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Should only render single listings', 'linear'), 1057 value: 'single' 1058 }], 1059 onChange: value => setShortcodeRenderingMethod(value), 1060 help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('By default, we render both single listings and the list of listings in the same place. If you want to render only single listings, and provide the list listings via e.g. a shortcode or block, you can adjust this option.', 'linear'), 1061 style: { 1062 flex: '1' 1063 } 1064 }) 1065 }) : ''] 1066 })] 1067 }) 1068 }) 1069 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelRow, { 1070 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("blockquote", { 1071 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 1072 style: {}, 1073 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHeading, { 1074 level: 4, 1075 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Use test data', 'linear') 1076 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("br", {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.ToggleControl, { 1077 checked: useTestData, 1078 onChange: () => setUseTestData(state => !state), 1079 __nextHasNoMarginBottom: true, 1080 help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('In case you are given credentials that are meant for testing purposes, you might need to enable this specific test-data mode', 'linear') 1081 })] 1082 }) 1083 }) 1084 })] 1085 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelBody, { 1086 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Global settings', 'linear'), 1087 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("p", { 1088 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('These settings are automatically applied to all listings, but can be overwritten on a per-listing basis', 'linear') 1089 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelRow, { 1090 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("blockquote", { 1091 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 1092 style: {}, 1093 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHeading, { 1094 level: 4, 1095 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Contact form integration', 'linear') 1096 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("br", {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.ToggleControl, { 1097 checked: listingLeadsIntegration, 1098 onChange: () => setListingLeadsIntegration(state => !state), 1099 __nextHasNoMarginBottom: true, 1100 help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('In case you have Leads activates for your account, you can activate them for your listings with this toggle. If however not, please contact Linear and we will sort it out for you.', 'linear') 1101 })] 1102 }) 1103 }) 1104 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelRow, { 1105 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("blockquote", { 1106 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 1107 style: { 1108 flex: '1' 1109 }, 1110 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHeading, { 1111 level: 4, 1112 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Default results per page', 'linear') 1113 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("br", {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("input", { 1114 type: "number", 1115 value: resultsPerPage, 1116 onChange: event => setResultsPerPage(event.target.value), 1117 placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('4', 'linear'), 1118 style: { 1119 padding: '8px', 1120 fontSize: '14px' 1121 } 1122 })] 1123 }) 1124 }) 1125 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelRow, { 1126 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("blockquote", { 1127 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 1128 style: { 1129 width: '100%' 1130 }, 1131 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHeading, { 1132 level: 4, 1133 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Theme Color', 'linear') 1134 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("p", { 1135 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Select a theme color to be used across the plugin.', 'linear') 1136 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 1137 style: { 1138 display: 'flex', 1139 gap: '0.5rem', 1140 alignItems: 'center', 1141 marginBottom: '1rem' 1142 }, 1143 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("span", { 1144 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Selected Color:', 'linear') 1145 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("span", { 1146 style: { 1147 display: 'inline-block', 1148 width: '20px', 1149 height: '20px', 1150 backgroundColor: themeColor, 1151 border: '1px solid #ccc', 1152 marginLeft: '5px', 1153 borderRadius: '100px' 1154 } 1155 })] 1156 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.ColorPicker, { 1157 color: themeColor, 1158 onChangeComplete: color => setThemeColor(color.hex), 1159 disableAlpha: true 1160 })] 1161 }) 1162 }) 1163 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelRow, { 1164 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("blockquote", { 1165 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 1166 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHeading, { 1167 level: 4, 1168 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Featured image', 'linear') 1169 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("p", { 1170 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Select or upload an image to be used as the brand feature image. Most often this is the logo of the company.', 'linear') 1171 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Button, { 1172 variant: "primary", 1173 onClick: openMediaLibrary, 1174 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Select Image', 'linear') 1175 }), featuredImage && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 1176 style: { 1177 marginTop: '10px' 1178 }, 1179 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("img", { 1180 src: featuredImage, 1181 alt: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Selected Image', 'linear'), 1182 style: { 1183 maxWidth: '100%', 1184 maxHeight: '120px', 1185 height: 'auto', 1186 border: '1px solid #ccc' 1187 } 1188 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("br", {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Button, { 1189 onClick: () => setFeaturedImage(''), 1190 variant: "link", 1191 isDestructive: true, 1192 style: { 1193 marginTop: '10px' 1194 }, 1195 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Remove Image', 'linear') 1196 })] 1197 })] 1198 }) 1199 }) 1200 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelRow, { 1201 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("blockquote", { 1202 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 1203 style: { 1204 flex: '1' 1205 }, 1206 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHeading, { 1207 level: 4, 1208 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Custom CSS', 'linear') 1209 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("br", {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("textarea", { 1210 value: customCss, 1211 onChange: event => setCustomCss(event.target.value), 1212 placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Enter your custom CSS here...', 'linear'), 1213 style: { 1214 width: '100%', 1215 padding: '8px', 1216 fontSize: '14px', 1217 minHeight: '100px' 1218 } 1219 })] 1220 }) 1221 }) 1222 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelRow, { 1223 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("blockquote", { 1224 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 1225 style: { 1226 flex: '1' 1227 }, 1228 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHeading, { 1229 level: 4, 1230 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Custom CSS source', 'linear') 1231 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("br", {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("input", { 1232 type: "string", 1233 value: customCssSrc, 1234 onChange: event => setCustomCssSrc(event.target.value), 1235 placeholder: window.location.origin + '/custom-styles.css', 1236 style: { 1237 width: '100%', 1238 padding: '8px', 1239 fontSize: '14px' 1240 } 1241 })] 1242 }) 1243 }) 1244 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelRow, { 1245 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("blockquote", { 1246 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 1247 style: { 1248 flex: '1' 1249 }, 1250 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHeading, { 1251 level: 4, 1252 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Additional global settings', 'linear') 1253 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("p", { 1254 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('You can define here other globally used settings. These can be overwritten on a per-listing basis, but are as default applied to all listings.', 'linear') 1255 }), firstDynamicParentPage && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Button, { 1256 variant: "primary", 1257 href: firstDynamicParentPage, 1258 style: { 1259 marginTop: '10px' 1260 }, 1261 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('See available attributes', 'linear') 1262 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("br", {}), additionalSettings && Array.isArray(additionalSettings) && additionalSettings.length > 0 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", { 1263 style: { 1264 marginTop: '10px' 1265 }, 1266 children: additionalSettings.map((item, index) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { 1267 style: { 1268 display: 'flex', 1269 alignItems: 'center', 1270 marginBottom: '10px', 1271 gap: '10px' 1272 }, 1273 children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.TextControl, { 1274 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Key', 'linear'), 1275 value: item.key || '', 1276 onChange: value => { 1277 const updatedSettings = additionalSettings.map((setting, i) => i === index ? { 1278 ...setting, 1279 key: value 1280 } : setting); 1281 setAdditionalSettings(updatedSettings); 1282 }, 1283 placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Enter key', 'linear'), 1284 style: { 1285 flex: '1' 1286 } 1287 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.TextControl, { 1288 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Value', 'linear'), 1289 value: item.value || '', 1290 onChange: value => { 1291 const updatedSettings = additionalSettings.map((setting, i) => i === index ? { 1292 ...setting, 1293 value: value 1294 } : setting); 1295 setAdditionalSettings(updatedSettings); 1296 }, 1297 placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Enter value', 'linear'), 1298 style: { 1299 flex: '1' 1300 } 1301 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Button, { 1302 isDestructive: true, 1303 onClick: () => { 1304 setAdditionalSettings(prevSettings => prevSettings.filter((_, i) => i !== index)); 1305 }, 1306 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Remove', 'linear') 1307 })] 1308 }, item.id || `setting-${index}`)) 1309 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Button, { 1310 variant: "primary", 1311 onClick: () => { 1312 const newItem = { 1313 key: '', 1314 value: '' 1315 }; 1316 setAdditionalSettings([...(additionalSettings || []), newItem]); 1317 }, 1318 style: { 1319 marginTop: '10px' 1320 }, 1321 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add additional setting', 'linear') 1322 })] 1323 }) 1324 }) 1325 })] 1326 })] 1327 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(SaveButton, { 1328 onClick: handleSaveSettings, 1329 disabled: !(0,_utils_validators__WEBPACK_IMPORTED_MODULE_7__.validateUrl)(appUrl) || !(0,_utils_validators__WEBPACK_IMPORTED_MODULE_7__.validateUrl)(dataUrl) || !(0,_utils_validators__WEBPACK_IMPORTED_MODULE_7__.validateClientSecret)(clientSecret) || !Object.keys(dynamicParentPages).length 1330 })] 1331 }); 1332 }; 1333 1334 1335 /***/ }), 1336 1337 /***/ "./src/hooks/index.js": 1338 /*!****************************!*\ 1339 !*** ./src/hooks/index.js ***! 1340 \****************************/ 1341 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 1342 1343 __webpack_require__.r(__webpack_exports__); 1344 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 1345 /* harmony export */ useResponsive: () => (/* reexport safe */ _use_responsive__WEBPACK_IMPORTED_MODULE_1__["default"]), 1346 /* harmony export */ useSettings: () => (/* reexport safe */ _use_settings__WEBPACK_IMPORTED_MODULE_0__["default"]) 1347 /* harmony export */ }); 1348 /* harmony import */ var _use_settings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./use-settings */ "./src/hooks/use-settings.js"); 1349 /* harmony import */ var _use_responsive__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./use-responsive */ "./src/hooks/use-responsive.js"); 1350 1351 1352 1353 /***/ }), 1354 1355 /***/ "./src/hooks/use-responsive.js": 1356 /*!*************************************!*\ 1357 !*** ./src/hooks/use-responsive.js ***! 1358 \*************************************/ 1359 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 1360 1361 __webpack_require__.r(__webpack_exports__); 1362 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 1363 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 1364 /* harmony export */ }); 1365 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); 1366 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); 1367 1368 const useResponsive = () => { 1369 const [isMobile, setIsMobile] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(window.innerWidth <= 768); 1370 const [isTablet, setIsTablet] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(window.innerWidth > 768 && window.innerWidth <= 1024); 1371 (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { 1372 const handleResize = () => { 1373 setIsMobile(window.innerWidth <= 768); 1374 setIsTablet(window.innerWidth > 768 && window.innerWidth <= 1024); 1375 }; 1376 window.addEventListener('resize', handleResize); 1377 return () => window.removeEventListener('resize', handleResize); 1378 }, []); 1379 return { 1380 isMobile, 1381 isTablet 1382 }; 1383 }; 1384 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (useResponsive); 1385 1386 /***/ }), 1387 1388 /***/ "./src/hooks/use-settings.js": 1389 /*!***********************************!*\ 1390 !*** ./src/hooks/use-settings.js ***! 1391 \***********************************/ 1392 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 1393 1394 __webpack_require__.r(__webpack_exports__); 1395 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 1396 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 1397 /* harmony export */ }); 1398 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 1399 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); 1400 /* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch"); 1401 /* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_1__); 1402 /* harmony import */ var _wordpress_notices__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/notices */ "@wordpress/notices"); 1403 /* harmony import */ var _wordpress_notices__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_notices__WEBPACK_IMPORTED_MODULE_2__); 1404 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 1405 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__); 1406 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 1407 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__); 1408 /* harmony import */ var _utils_validators__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/validators */ "./src/utils/validators.js"); 1409 1410 1411 1412 1413 1414 1415 const useSettings = () => { 1416 const [appUrl, setAppUrl] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(); 1417 const [dataUrl, setDataUrl] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(); 1418 const [clientSecret, setClientSecret] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(); 1419 const [dynamicParentPages, setDynamicParentPages] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)([]); 1420 const [renderingMethod, setRenderingMethod] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)('inline'); 1421 const [shortcodeRenderingMethod, setShortcodeRenderingMethod] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)('default'); 1422 const [useTestData, setUseTestData] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(false); 1423 const [listingLeadsIntegration, setListingLeadsIntegration] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(false); 1424 const [featuredImage, setFeaturedImage] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(); 1425 const [themeColor, setThemeColor] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(window.linear_admin_obj.theme_default_color || '#ed6a40'); 1426 const [resultsPerPage, setResultsPerPage] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(4); 1427 const [customCss, setCustomCss] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(''); 1428 const [customCssSrc, setCustomCssSrc] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(''); 1429 const [additionalSettings, setAdditionalSettings] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)([]); 1430 const nonce = window.linear_admin_obj.rest.nonce; 1431 const { 1432 removeAllNotices, 1433 createSuccessNotice, 1434 createInfoNotice, 1435 createErrorNotice 1436 } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_4__.useDispatch)(_wordpress_notices__WEBPACK_IMPORTED_MODULE_2__.store); 1437 const apiUrl = window.linear_admin_obj.rest.endpoints.options; 1438 if (!apiUrl || !nonce) { 1439 return; 1440 } 1441 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => { 1442 _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_1___default()({ 1443 path: apiUrl, 1444 method: 'GET', 1445 headers: { 1446 'X-WP-Nonce': nonce 1447 } 1448 }).then(response => { 1449 const parsedOptions = response.options; 1450 setAppUrl(parsedOptions.app_url || ''); 1451 setDataUrl(parsedOptions.data_url || ''); 1452 setClientSecret(parsedOptions.client_secret || ''); 1453 setDynamicParentPages(parsedOptions.dynamic_parent_pages || []); 1454 setRenderingMethod(parsedOptions.rendering_method || 'inline'); 1455 setShortcodeRenderingMethod(parsedOptions.shortcode_rendering_method || 'default'); 1456 setUseTestData(parsedOptions.use_test_data || false); 1457 setListingLeadsIntegration(parsedOptions.listing_leads_integration || false); 1458 setFeaturedImage(parsedOptions.featured_image || ''); 1459 setThemeColor(parsedOptions.theme_color || '#ed6a40'); 1460 setResultsPerPage(parsedOptions.results_per_page || 4); 1461 setCustomCss(parsedOptions.custom_css || ''); 1462 setCustomCssSrc(parsedOptions.custom_css_src || ''); 1463 setAdditionalSettings(parsedOptions.additional_settings || []); 1464 }).catch(error => { 1465 console.log(error); 1466 if (error.code === 'rest_no_route') { 1467 createErrorNotice((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("The REST API route is not set. Please check for plugin updates, and if that doesn't help, contact Linear support.", 'linear')); 1468 } else if (error.code === 'rest_cannot_access') { 1469 createErrorNotice((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('You do not have permission to access the REST API. Could there be something stopping this access?', 'linear')); 1470 } else if (error.data && error.data.status === 500) { 1471 createErrorNotice((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('The REST API encountered an internal server error. Please check if the WordPress Rest API is enabled.', 'linear')); 1472 } else { 1473 createErrorNotice((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Failed to fetch settings. Please try refreshing this page to see if that helps.', 'linear')); 1474 } 1475 }); 1476 }, []); 1477 const saveSettings = () => { 1478 removeAllNotices(); 1479 createInfoNotice((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Saving settings...', 'linear')); 1480 const savingAppUrl = appUrl; 1481 const savingDataUrl = dataUrl; 1482 const savingClientSecret = clientSecret; 1483 return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_1___default()({ 1484 path: apiUrl, 1485 method: 'POST', 1486 headers: { 1487 'X-WP-Nonce': nonce 1488 }, 1489 data: { 1490 app_url: appUrl, 1491 data_url: dataUrl, 1492 client_secret: clientSecret, 1493 dynamic_parent_pages: dynamicParentPages, 1494 rendering_method: renderingMethod, 1495 shortcode_rendering_method: shortcodeRenderingMethod, 1496 use_test_data: useTestData, 1497 listing_leads_integration: listingLeadsIntegration, 1498 featured_image: featuredImage, 1499 theme_color: themeColor, 1500 results_per_page: resultsPerPage, 1501 custom_css: customCss, 1502 custom_css_src: customCssSrc, 1503 additional_settings: additionalSettings 1504 } 1505 }).then(() => { 1506 removeAllNotices(); 1507 if (!(0,_utils_validators__WEBPACK_IMPORTED_MODULE_5__.validateUrl)(savingAppUrl) || !(0,_utils_validators__WEBPACK_IMPORTED_MODULE_5__.validateUrl)(savingDataUrl) || !(0,_utils_validators__WEBPACK_IMPORTED_MODULE_5__.validateClientSecret)(savingClientSecret)) { 1508 createErrorNotice((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Settings saved, but some of the values are not valid. You may hence expect potential issues with the listings.', 'linear')); 1509 } else { 1510 createSuccessNotice((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Settings saved.', 'linear')); 1511 } 1512 }).catch(error => { 1513 removeAllNotices(); 1514 console.log(error); 1515 if (error.code === 'rest_no_route') { 1516 createErrorNotice((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('The REST API route is not set. Please check the plugin configuration.', 'linear')); 1517 } else if (error.code === 'rest_cannot_access') { 1518 createErrorNotice((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('You do not have permission to access the REST API.', 'linear')); 1519 } else if (error.data && error.data.status === 403) { 1520 createErrorNotice((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('The REST API encountered an permission error. Please check if the REST API is enabled.', 'linear')); 1521 } else if (error.data && error.data.status === 500) { 1522 createErrorNotice((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('The REST API encountered an internal server error. Please check if the REST API is enabled.', 'linear')); 1523 } else { 1524 createErrorNotice((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Failed to save settings. Please try refreshing this page to see if that helps.', 'linear')); 1525 } 1526 }); 1527 }; 1528 return { 1529 appUrl, 1530 setAppUrl, 1531 dataUrl, 1532 setDataUrl, 1533 clientSecret, 1534 setClientSecret, 1535 dynamicParentPages, 1536 setDynamicParentPages, 1537 renderingMethod, 1538 setRenderingMethod, 1539 shortcodeRenderingMethod, 1540 setShortcodeRenderingMethod, 1541 useTestData, 1542 setUseTestData, 1543 listingLeadsIntegration, 1544 setListingLeadsIntegration, 1545 featuredImage, 1546 setFeaturedImage, 1547 themeColor, 1548 setThemeColor, 1549 resultsPerPage, 1550 setResultsPerPage, 1551 customCss, 1552 setCustomCss, 1553 customCssSrc, 1554 setCustomCssSrc, 1555 additionalSettings, 1556 setAdditionalSettings, 1557 saveSettings 1558 }; 1559 }; 1560 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (useSettings); 1561 1562 /***/ }), 1563 1564 /***/ "./src/index.js": 1565 /*!**********************!*\ 1566 !*** ./src/index.js ***! 1567 \**********************/ 1568 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 1569 1570 __webpack_require__.r(__webpack_exports__); 1571 /* harmony import */ var _index_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index.scss */ "./src/index.scss"); 1572 /* harmony import */ var _wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/dom-ready */ "@wordpress/dom-ready"); 1573 /* harmony import */ var _wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_1__); 1574 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 1575 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); 1576 /* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./components */ "./src/components/index.js"); 1577 /* harmony import */ var _blocks_dynamic_listings__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./blocks/dynamic-listings */ "./src/blocks/dynamic-listings/index.js"); 1578 /* harmony import */ var _blocks_listings__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./blocks/listings */ "./src/blocks/listings/index.js"); 1579 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); 1580 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__); 1581 1582 1583 1584 1585 1586 1587 1588 _wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_1___default()(() => { 1589 const rootElement = document.getElementById('linear-react-settings'); 1590 if (!rootElement) { 1591 return; 1592 } 1593 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.createRoot)(document.getElementById('linear-react-settings')).render(/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_components__WEBPACK_IMPORTED_MODULE_3__.SettingsPage, {})); 1594 }); 1595 1596 /***/ }), 1597 1598 /***/ "./src/index.scss": 1599 /*!************************!*\ 1600 !*** ./src/index.scss ***! 1601 \************************/ 1602 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 1603 1604 __webpack_require__.r(__webpack_exports__); 1605 // extracted by mini-css-extract-plugin 1606 1607 1608 /***/ }), 1609 1610 /***/ "./src/utils/language-utils.js": 1611 /*!*************************************!*\ 1612 !*** ./src/utils/language-utils.js ***! 1613 \*************************************/ 1614 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 1615 1616 __webpack_require__.r(__webpack_exports__); 1617 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 1618 /* harmony export */ getFilteredPages: () => (/* binding */ getFilteredPages), 1619 /* harmony export */ getLinkForLanguagePage: () => (/* binding */ getLinkForLanguagePage), 1620 /* harmony export */ getPageForLanguage: () => (/* binding */ getPageForLanguage), 1621 /* harmony export */ getTitleForLanguagePage: () => (/* binding */ getTitleForLanguagePage), 1622 /* harmony export */ handlePageSelect: () => (/* binding */ handlePageSelect) 1623 /* harmony export */ }); 1624 const getFilteredPages = (pages, detectedLanguages, langCode = null) => { 1625 if (!pages) return []; 1626 if (!detectedLanguages || !langCode) { 1627 return pages; 1628 } 1629 const returnablePages = pages.filter(page => page.language === langCode); 1630 if (returnablePages.length > 0) { 1631 return returnablePages; 1632 } 1633 return pages; 1634 }; 1635 const handlePageSelect = (value, currentValue, detectedLanguages, langCode = null, exceptions = []) => { 1636 // Convert value to integer 1637 const pageId = parseInt(value, 10); 1638 if (!detectedLanguages) { 1639 return pageId; 1640 } 1641 const newValue = typeof currentValue === 'object' ? { 1642 ...currentValue 1643 } : {}; 1644 if (langCode) { 1645 newValue[langCode] = pageId; 1646 } 1647 if (exceptions.includes('translatePress')) { 1648 detectedLanguages.forEach(language => { 1649 newValue[language] = pageId; 1650 }); 1651 } 1652 return newValue; 1653 }; 1654 const getPageForLanguage = (dynamicParentPages, detectedLanguages, langCode = null) => { 1655 if (!detectedLanguages) { 1656 return parseInt(dynamicParentPages, 10); 1657 } 1658 if (typeof dynamicParentPages !== 'object') { 1659 return 0; 1660 } 1661 return parseInt(dynamicParentPages[langCode] || 0, 10); 1662 }; 1663 const getLinkForLanguagePage = (dynamicParentPages, pages, detectedLanguages, langCode = null) => { 1664 const pageId = getPageForLanguage(dynamicParentPages, detectedLanguages, langCode); 1665 if (!pageId || !pages) return '#'; 1666 const page = pages.find(p => p.id === pageId); 1667 return page ? page.link : '#'; 1668 }; 1669 const getTitleForLanguagePage = (dynamicParentPages, pages, detectedLanguages, langCode = null) => { 1670 const pageId = getPageForLanguage(dynamicParentPages, detectedLanguages, langCode); 1671 if (!pageId || !pages) return ''; 1672 const page = pages.find(p => p.id === pageId); 1673 return page ? page.title.raw : ''; 1674 }; 1675 1676 /***/ }), 1677 1678 /***/ "./src/utils/validators.js": 1679 /*!*********************************!*\ 1680 !*** ./src/utils/validators.js ***! 1681 \*********************************/ 1682 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 1683 1684 __webpack_require__.r(__webpack_exports__); 1685 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 1686 /* harmony export */ validateClientSecret: () => (/* binding */ validateClientSecret), 1687 /* harmony export */ validateUrl: () => (/* binding */ validateUrl) 1688 /* harmony export */ }); 1689 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 1690 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); 1691 1692 const validateUrl = value => { 1693 if (!value) { 1694 return false; 1695 } 1696 if (value.length < 5 || !/^https?:\/\/.+/.test(value)) { 1697 return false; 1698 } 1699 return true; 1700 }; 1701 const validateClientSecret = value => { 1702 if (!value) { 1703 return false; 1704 } 1705 if (value.length < 12) { 1706 return false; 1707 } 1708 return true; 1709 }; 1710 1711 /***/ }), 1712 1713 /***/ "@wordpress/api-fetch": 1714 /*!**********************************!*\ 1715 !*** external ["wp","apiFetch"] ***! 1716 \**********************************/ 1717 /***/ ((module) => { 1718 1719 module.exports = window["wp"]["apiFetch"]; 1720 1721 /***/ }), 1722 1723 /***/ "@wordpress/block-editor": 1724 /*!*************************************!*\ 1725 !*** external ["wp","blockEditor"] ***! 1726 \*************************************/ 1727 /***/ ((module) => { 1728 1729 module.exports = window["wp"]["blockEditor"]; 1730 1731 /***/ }), 1732 1733 /***/ "@wordpress/blocks": 1734 /*!********************************!*\ 1735 !*** external ["wp","blocks"] ***! 1736 \********************************/ 1737 /***/ ((module) => { 1738 1739 module.exports = window["wp"]["blocks"]; 1740 1741 /***/ }), 1742 1743 /***/ "@wordpress/components": 1744 /*!************************************!*\ 1745 !*** external ["wp","components"] ***! 1746 \************************************/ 1747 /***/ ((module) => { 1748 1749 module.exports = window["wp"]["components"]; 1750 1751 /***/ }), 1752 1753 /***/ "@wordpress/core-data": 1754 /*!**********************************!*\ 1755 !*** external ["wp","coreData"] ***! 1756 \**********************************/ 1757 /***/ ((module) => { 1758 1759 module.exports = window["wp"]["coreData"]; 1760 1761 /***/ }), 1762 1763 /***/ "@wordpress/data": 1764 /*!******************************!*\ 1765 !*** external ["wp","data"] ***! 1766 \******************************/ 1767 /***/ ((module) => { 1768 1769 module.exports = window["wp"]["data"]; 1770 1771 /***/ }), 1772 1773 /***/ "@wordpress/dom-ready": 1774 /*!**********************************!*\ 1775 !*** external ["wp","domReady"] ***! 1776 \**********************************/ 1777 /***/ ((module) => { 1778 1779 module.exports = window["wp"]["domReady"]; 1780 1781 /***/ }), 1782 1783 /***/ "@wordpress/element": 1784 /*!*********************************!*\ 1785 !*** external ["wp","element"] ***! 1786 \*********************************/ 1787 /***/ ((module) => { 1788 1789 module.exports = window["wp"]["element"]; 1790 1791 /***/ }), 1792 1793 /***/ "@wordpress/i18n": 1794 /*!******************************!*\ 1795 !*** external ["wp","i18n"] ***! 1796 \******************************/ 1797 /***/ ((module) => { 1798 1799 module.exports = window["wp"]["i18n"]; 1800 1801 /***/ }), 1802 1803 /***/ "@wordpress/notices": 1804 /*!*********************************!*\ 1805 !*** external ["wp","notices"] ***! 1806 \*********************************/ 1807 /***/ ((module) => { 1808 1809 module.exports = window["wp"]["notices"]; 1810 1811 /***/ }), 1812 1813 /***/ "react": 1814 /*!************************!*\ 1815 !*** external "React" ***! 1816 \************************/ 1817 /***/ ((module) => { 1818 1819 module.exports = window["React"]; 1820 1821 /***/ }), 1822 1823 /***/ "react/jsx-runtime": 1824 /*!**********************************!*\ 1825 !*** external "ReactJSXRuntime" ***! 1826 \**********************************/ 1827 /***/ ((module) => { 1828 1829 module.exports = window["ReactJSXRuntime"]; 1830 1831 /***/ }) 1832 1833 /******/ }); 1834 /************************************************************************/ 1835 /******/ // The module cache 1836 /******/ var __webpack_module_cache__ = {}; 1837 /******/ 1838 /******/ // The require function 1839 /******/ function __webpack_require__(moduleId) { 1840 /******/ // Check if module is in cache 1841 /******/ var cachedModule = __webpack_module_cache__[moduleId]; 1842 /******/ if (cachedModule !== undefined) { 1843 /******/ return cachedModule.exports; 1844 /******/ } 1845 /******/ // Create a new module (and put it into the cache) 1846 /******/ var module = __webpack_module_cache__[moduleId] = { 1847 /******/ // no module.id needed 1848 /******/ // no module.loaded needed 1849 /******/ exports: {} 1850 /******/ }; 1851 /******/ 1852 /******/ // Execute the module function 1853 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); 1854 /******/ 1855 /******/ // Return the exports of the module 1856 /******/ return module.exports; 1857 /******/ } 1858 /******/ 1859 /******/ // expose the modules object (__webpack_modules__) 1860 /******/ __webpack_require__.m = __webpack_modules__; 1861 /******/ 1862 /************************************************************************/ 1863 /******/ /* webpack/runtime/chunk loaded */ 1864 /******/ (() => { 1865 /******/ var deferred = []; 1866 /******/ __webpack_require__.O = (result, chunkIds, fn, priority) => { 1867 /******/ if(chunkIds) { 1868 /******/ priority = priority || 0; 1869 /******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; 1870 /******/ deferred[i] = [chunkIds, fn, priority]; 1871 /******/ return; 1872 /******/ } 1873 /******/ var notFulfilled = Infinity; 1874 /******/ for (var i = 0; i < deferred.length; i++) { 1875 /******/ var [chunkIds, fn, priority] = deferred[i]; 1876 /******/ var fulfilled = true; 1877 /******/ for (var j = 0; j < chunkIds.length; j++) { 1878 /******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { 1879 /******/ chunkIds.splice(j--, 1); 1880 /******/ } else { 1881 /******/ fulfilled = false; 1882 /******/ if(priority < notFulfilled) notFulfilled = priority; 1883 /******/ } 1884 /******/ } 1885 /******/ if(fulfilled) { 1886 /******/ deferred.splice(i--, 1) 1887 /******/ var r = fn(); 1888 /******/ if (r !== undefined) result = r; 1889 /******/ } 1890 /******/ } 1891 /******/ return result; 1892 /******/ }; 1893 /******/ })(); 1894 /******/ 1895 /******/ /* webpack/runtime/compat get default export */ 1896 /******/ (() => { 1897 /******/ // getDefaultExport function for compatibility with non-harmony modules 1898 /******/ __webpack_require__.n = (module) => { 1899 /******/ var getter = module && module.__esModule ? 1900 /******/ () => (module['default']) : 1901 /******/ () => (module); 1902 /******/ __webpack_require__.d(getter, { a: getter }); 1903 /******/ return getter; 1904 /******/ }; 1905 /******/ })(); 1906 /******/ 1907 /******/ /* webpack/runtime/define property getters */ 1908 /******/ (() => { 1909 /******/ // define getter functions for harmony exports 1910 /******/ __webpack_require__.d = (exports, definition) => { 1911 /******/ for(var key in definition) { 1912 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 1913 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 1914 /******/ } 1915 /******/ } 1916 /******/ }; 1917 /******/ })(); 1918 /******/ 1919 /******/ /* webpack/runtime/global */ 1920 /******/ (() => { 1921 /******/ __webpack_require__.g = (function() { 1922 /******/ if (typeof globalThis === 'object') return globalThis; 1923 /******/ try { 1924 /******/ return this || new Function('return this')(); 1925 /******/ } catch (e) { 1926 /******/ if (typeof window === 'object') return window; 1927 /******/ } 1928 /******/ })(); 1929 /******/ })(); 1930 /******/ 1931 /******/ /* webpack/runtime/hasOwnProperty shorthand */ 1932 /******/ (() => { 1933 /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) 1934 /******/ })(); 1935 /******/ 1936 /******/ /* webpack/runtime/make namespace object */ 1937 /******/ (() => { 1938 /******/ // define __esModule on exports 1939 /******/ __webpack_require__.r = (exports) => { 1940 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 1941 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 1942 /******/ } 1943 /******/ Object.defineProperty(exports, '__esModule', { value: true }); 1944 /******/ }; 1945 /******/ })(); 1946 /******/ 1947 /******/ /* webpack/runtime/publicPath */ 1948 /******/ (() => { 1949 /******/ var scriptUrl; 1950 /******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + ""; 1951 /******/ var document = __webpack_require__.g.document; 1952 /******/ if (!scriptUrl && document) { 1953 /******/ if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') 1954 /******/ scriptUrl = document.currentScript.src; 1955 /******/ if (!scriptUrl) { 1956 /******/ var scripts = document.getElementsByTagName("script"); 1957 /******/ if(scripts.length) { 1958 /******/ var i = scripts.length - 1; 1959 /******/ while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src; 1960 /******/ } 1961 /******/ } 1962 /******/ } 1963 /******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration 1964 /******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic. 1965 /******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser"); 1966 /******/ scriptUrl = scriptUrl.replace(/^blob:/, "").replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/"); 1967 /******/ __webpack_require__.p = scriptUrl; 1968 /******/ })(); 1969 /******/ 1970 /******/ /* webpack/runtime/jsonp chunk loading */ 1971 /******/ (() => { 1972 /******/ // no baseURI 1973 /******/ 1974 /******/ // object to store loaded and loading chunks 1975 /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched 1976 /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded 1977 /******/ var installedChunks = { 1978 /******/ "index": 0, 1979 /******/ "./style-index": 0 1980 /******/ }; 1981 /******/ 1982 /******/ // no chunk on demand loading 1983 /******/ 1984 /******/ // no prefetching 1985 /******/ 1986 /******/ // no preloaded 1987 /******/ 1988 /******/ // no HMR 1989 /******/ 1990 /******/ // no HMR manifest 1991 /******/ 1992 /******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); 1993 /******/ 1994 /******/ // install a JSONP callback for chunk loading 1995 /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { 1996 /******/ var [chunkIds, moreModules, runtime] = data; 1997 /******/ // add "moreModules" to the modules object, 1998 /******/ // then flag all "chunkIds" as loaded and fire callback 1999 /******/ var moduleId, chunkId, i = 0; 2000 /******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { 2001 /******/ for(moduleId in moreModules) { 2002 /******/ if(__webpack_require__.o(moreModules, moduleId)) { 2003 /******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; 2004 /******/ } 2005 /******/ } 2006 /******/ if(runtime) var result = runtime(__webpack_require__); 2007 /******/ } 2008 /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); 2009 /******/ for(;i < chunkIds.length; i++) { 2010 /******/ chunkId = chunkIds[i]; 2011 /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { 2012 /******/ installedChunks[chunkId][0](); 2013 /******/ } 2014 /******/ installedChunks[chunkId] = 0; 2015 /******/ } 2016 /******/ return __webpack_require__.O(result); 2017 /******/ } 2018 /******/ 2019 /******/ var chunkLoadingGlobal = globalThis["webpackChunk"] = globalThis["webpackChunk"] || []; 2020 /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); 2021 /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); 2022 /******/ })(); 2023 /******/ 2024 /************************************************************************/ 2025 /******/ 2026 /******/ // startup 2027 /******/ // Load entry module and return exports 2028 /******/ // This entry module depends on other loaded chunks and execution need to be delayed 2029 /******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["./style-index"], () => (__webpack_require__("./src/index.js"))) 2030 /******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); 2031 /******/ 2032 /******/ })() 2033 ; 2034 //# sourceMappingURL=index.js.map -
linear/trunk/build/style-index-rtl.css
r3338864 r3372199 1 2 1 /*!***************************************************************************************************************************************************************************************************************************************************************!*\ 2 !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/blocks/dynamic-listings/style.scss ***! 3 \***************************************************************************************************************************************************************************************************************************************************************/ 4 /** 5 * Frontend styles for the dynamic listings block 6 */ 7 /*!*******************************************************************************************************************************************************************************************************************************************************!*\ 8 !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/blocks/listings/style.scss ***! 9 \*******************************************************************************************************************************************************************************************************************************************************/ 10 /** 11 * Frontend styles for the dynamic listings block 12 */ -
linear/trunk/build/style-index.css
r3338864 r3372199 1 /*!***************************************************************************************************************************************************************************************************************************************************************!*\ 2 !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/blocks/dynamic-listings/style.scss ***! 3 \***************************************************************************************************************************************************************************************************************************************************************/ 4 /** 5 * Frontend styles for the dynamic listings block 6 */ 7 /*!*******************************************************************************************************************************************************************************************************************************************************!*\ 8 !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/blocks/listings/style.scss ***! 9 \*******************************************************************************************************************************************************************************************************************************************************/ 10 /** 11 * Frontend styles for the dynamic listings block 12 */ 1 13 2 14 /*# sourceMappingURL=style-index.css.map*/ -
linear/trunk/includes/class-linear-endpoints.php
r3341553 r3372199 171 171 'shortcode_rendering_method' => [ 172 172 'type' => 'string', 173 ], 174 'use_test_data' => [ 175 'type' => 'boolean', 173 176 ], 174 177 'listing_leads_integration' => [ … … 219 222 $rendering_method = isset( $options['rendering_method'] ) ? trim( (string) $options['rendering_method'] ) : ''; 220 223 $shortcode_rendering_method = isset( $options['shortcode_rendering_method'] ) ? trim( (string) $options['shortcode_rendering_method'] ) : ''; 224 $use_test_data = isset( $options['use_test_data'] ) ? (bool) $options['use_test_data'] : false; 221 225 $listing_leads_integration = isset( $options['listing_leads_integration'] ) ? $options['listing_leads_integration'] : false; 222 226 $featured_image = isset( $options['featured_image'] ) ? $options['featured_image'] : ''; … … 241 245 'rendering_method' => $rendering_method, 242 246 'shortcode_rendering_method' => $shortcode_rendering_method, 247 'use_test_data' => isset( $options['use_test_data'] ) ? (bool) $options['use_test_data'] : false, 243 248 'listing_leads_integration' => $listing_leads_integration, 244 249 'featured_image' => $featured_image, -
linear/trunk/includes/class-linear-middleware.php
r3338864 r3372199 75 75 76 76 $dynamic_parent_pages = self::$linear->get_option( 'dynamic_parent_pages' ); 77 $env = self::$linear->get_option( 'use_test_data' ) ? 'dev' : 'prod'; 77 78 $linear_plugin_version = LINEAR_VERSION; 78 79 $dynamic_parent_pages_string = json_encode($dynamic_parent_pages); … … 80 81 $dynamic_parent_pages_string = str_replace([':', ','], ['-', '_'], $dynamic_parent_pages_string); 81 82 82 $listings_transient = 'linear_' . $linear_plugin_version . '_listings_' . substr($client_secret,0,10) . '_' . $dynamic_parent_pages_string . '_' . $lang ;83 $listings_transient_updater = 'linear_' . $linear_plugin_version . '_listings_updater_' . $lang ;83 $listings_transient = 'linear_' . $linear_plugin_version . '_listings_' . substr($client_secret,0,10) . '_' . $dynamic_parent_pages_string . '_' . $lang . '_' . $env; 84 $listings_transient_updater = 'linear_' . $linear_plugin_version . '_listings_updater_' . $lang . '_' . $env; 84 85 85 86 if( $response = get_transient( $listings_transient ) ){ … … 112 113 $parameters = []; 113 114 $parameters['langs'] = $lang; 114 $parameters['env'] = "prod";115 $parameters['env'] = $env; 115 116 116 117 $response = wp_remote_get( … … 144 145 $listings = $this->modify_listings( $response_data['data'], $lang ); 145 146 147 if( !$listings ){ 148 delete_transient( $listings_transient_updater ); 149 return new WP_Error( 'error', esc_html__( "API v3 middleware response missing listings", "linear" ) ); 150 } 151 146 152 set_transient( $listings_transient, $listings, 1800 ); 147 153 delete_transient( $listings_transient_updater ); 148 154 149 155 return $listings; 150 151 156 } 152 157 -
linear/trunk/includes/class-linear-seo.php
r3338864 r3372199 159 159 }); 160 160 add_filter('seopress_social_og_desc', function ( $html ) use ( $description ) { 161 return esc_attr( $description ); 161 $html = '<meta property="og:description" content="' . esc_attr( $description ) . '" />'; 162 return $html; 162 163 }); 163 164 add_filter('seopress_social_twitter_card_thumb', function ( $html ) use ( $image_url ) { -
linear/trunk/includes/class-linear-templater.php
r3366394 r3372199 216 216 $results_per_page = self::$linear->get_option('results_per_page'); 217 217 $featured_image = self::$linear->get_option( 'featured_image', '' ) ? self::$linear->get_option( 'featured_image', '' ) : ''; 218 $use_test_data = self::$linear->get_option('use_test_data'); 218 219 $listing_leads_integration = self::$linear->get_option('listing_leads_integration'); 219 220 $custom_css = self::$linear->get_option('custom_css'); … … 233 234 'results_per_page' => $results_per_page, 234 235 'logo' => $featured_image ? $featured_image : 'default', 236 'env' => $use_test_data ? 'dev' : 'prod', 235 237 'leads' => $listing_leads_integration ? 'true' : 'false', 236 238 'color' => $theme_color, -
linear/trunk/includes/class-linear.php
r3366394 r3372199 48 48 $this->version = LINEAR_VERSION; 49 49 } else { 50 $this->version = '3.0. 8';50 $this->version = '3.0.9'; 51 51 } 52 52 $this->plugin_uid = 'linear'; -
linear/trunk/linear.php
r3366394 r3372199 11 11 * Plugin URI: https://wordpress.org/plugins/linear/ 12 12 * Description: Linear listing system WordPress plugin. Enables you to easily display all your real estate listings on your website. 13 * Version: 3.0. 813 * Version: 3.0.9 14 14 * Author: Linear Oy 15 15 * Author URI: https://linear.fi … … 28 28 * Currently plugin version. (Semantic Versioning) 29 29 */ 30 define( 'LINEAR_VERSION', '3.0. 8' );30 define( 'LINEAR_VERSION', '3.0.9' ); 31 31 32 32 /**
Note: See TracChangeset
for help on using the changeset viewer.