@salla.sa/twilight-components 2.14.599 → 2.14.600
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{filepond-Dk1cJoJp.js → filepond-DVmQ7csb.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-Bg4PCTUm.js → filepond-plugin-file-poster-DMSpzTqe.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-DmqmRxXK.js → filepond-plugin-file-validate-size-D_ptbEIk.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-BKd2QnuC.js → filepond-plugin-file-validate-type-0yFqmcfN.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-BIPbEbnk.js → filepond-plugin-image-edit-E7sYYAWn.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-eQvkwjqa.js → filepond-plugin-image-exif-orientation-DbrEAQoa.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-Ba8K6ft0.js → filepond-plugin-image-preview-DO_tpcG1.js} +1 -1
- package/dist/cjs/{index-Bm1Ew-5K.js → index-Bw9ZFzBG.js} +2 -2
- package/dist/cjs/{intlTelInput-MWwwr9Td.js → intlTelInput-DxYQu3W_.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/salla-accordion-body_2.cjs.entry.js +4 -4
- package/dist/cjs/salla-accordion_6.cjs.entry.js +2 -2
- package/dist/cjs/salla-add-product-button_5.cjs.entry.js +1 -1
- package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
- package/dist/cjs/salla-alert_2.cjs.entry.js +2 -2
- package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-applied-filters.cjs.entry.js +1 -1
- package/dist/cjs/salla-apps-icons.cjs.entry.js +50 -19
- package/dist/cjs/salla-attachment-view_9.cjs.entry.js +22 -13
- package/dist/cjs/salla-badge.cjs.entry.js +2 -2
- package/dist/cjs/salla-basket-gap.cjs.entry.js +1 -1
- package/dist/cjs/salla-bullet-delivery_3.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-summary-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-comment-factors.cjs.entry.js +1 -1
- package/dist/cjs/salla-comment-form_9.cjs.entry.js +1 -1
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-contacts.cjs.entry.js +60 -29
- package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
- package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
- package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
- package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
- package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters.cjs.entry.js +1 -1
- package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
- package/dist/cjs/salla-gift-card-redeem_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
- package/dist/cjs/salla-hook.cjs.entry.js +1 -1
- package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
- package/dist/cjs/salla-installment.cjs.entry.js +1 -1
- package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
- package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-banner_10.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
- package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-map_3.cjs.entry.js +1 -1
- package/dist/cjs/salla-menu.cjs.entry.js +1 -1
- package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
- package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
- package/dist/cjs/salla-notification-item_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-cancel.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-options-modal.cjs.entry.js +5 -5
- package/dist/cjs/salla-order-shipments.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-totals-card.cjs.entry.js +49 -7
- package/dist/cjs/salla-orders.cjs.entry.js +1 -1
- package/dist/cjs/salla-payments.cjs.entry.js +1 -1
- package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
- package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
- package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
- package/dist/cjs/salla-products-slider.cjs.entry.js +1 -1
- package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
- package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +1 -1
- package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-review-factors-tags.cjs.entry.js +1 -1
- package/dist/cjs/salla-review-order-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
- package/dist/cjs/salla-search-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-search.cjs.entry.js +12 -2
- package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
- package/dist/cjs/salla-social.cjs.entry.js +1 -1
- package/dist/cjs/salla-tab-content_3.cjs.entry.js +24 -8
- package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
- package/dist/cjs/salla-verify.cjs.entry.js +1 -1
- package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
- package/dist/cjs/salla-wishlist-actions.cjs.entry.js +1 -1
- package/dist/cjs/salla-wishlist-summary.cjs.entry.js +1 -1
- package/dist/cjs/ssr-helpers-BjD2_F8m.js +48 -0
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/cjs/{vanilla-picker-BpuzEJnJ.js → vanilla-picker-CcRVM0uV.js} +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/salla-accordion/salla-accordion-body.js +1 -1
- package/dist/collection/components/salla-accordion/salla-accordion-head.js +2 -2
- package/dist/collection/components/salla-accordion/salla-accordion.js +1 -1
- package/dist/collection/components/salla-alert/salla-alert.js +1 -1
- package/dist/collection/components/salla-apps-icons/salla-apps-icons.css +3 -0
- package/dist/collection/components/salla-apps-icons/salla-apps-icons.js +108 -32
- package/dist/collection/components/salla-apps-icons/salla-apps-icons.types.js +1 -0
- package/dist/collection/components/salla-badge/salla-badge.js +1 -1
- package/dist/collection/components/salla-booking-field/salla-booking-field.js +21 -6
- package/dist/collection/components/salla-contacts/salla-contacts.js +114 -37
- package/dist/collection/components/salla-contacts/salla-contacts.types.js +1 -0
- package/dist/collection/components/salla-datetime-picker/salla-datetime-picker.js +1 -1
- package/dist/collection/components/salla-order-options-modal/salla-order-options-modal.js +4 -4
- package/dist/collection/components/salla-order-totals-card/salla-order-totals-card.js +76 -7
- package/dist/collection/components/salla-search/salla-search.js +11 -1
- package/dist/collection/components/salla-tabs/salla-tab-content.js +9 -2
- package/dist/collection/components/salla-tabs/salla-tabs.js +36 -8
- package/dist/collection/utils/ssr-helpers.js +105 -0
- package/dist/components/index.js +2 -2
- package/dist/components/salla-accordion-body2.js +1 -1
- package/dist/components/salla-accordion-head2.js +2 -2
- package/dist/components/salla-accordion2.js +1 -1
- package/dist/components/salla-alert.js +1 -1
- package/dist/components/salla-apps-icons.js +53 -20
- package/dist/components/salla-badge2.js +1 -1
- package/dist/components/salla-booking-field2.js +12 -3
- package/dist/components/salla-contacts.js +62 -30
- package/dist/components/salla-order-options-modal2.js +4 -4
- package/dist/components/salla-order-totals-card.js +50 -6
- package/dist/components/salla-search.js +11 -1
- package/dist/components/salla-tab-content2.js +8 -1
- package/dist/components/salla-tabs2.js +17 -7
- package/dist/components/ssr-helpers.js +46 -0
- package/dist/docs.json +255 -34
- package/dist/esm/{filepond-3PnWp9w_.js → filepond-CMtCLsIc.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-DmoyhYlz.js → filepond-plugin-file-poster-OjOFU-jw.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-CFkn2RRt.js → filepond-plugin-file-validate-size-BFCz_KY1.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-pyAPn10a.js → filepond-plugin-file-validate-type-BaPcxnrR.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-B5Rfgqvi.js → filepond-plugin-image-edit-D_tfXMIg.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-DK15iBED.js → filepond-plugin-image-exif-orientation-DS2k4xg9.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-BIW0XW_M.js → filepond-plugin-image-preview-B6bJkNCH.js} +1 -1
- package/dist/esm/{index-CwwxD-7C.js → index-C670SYee.js} +2 -2
- package/dist/esm/{intlTelInput-DYJOvh3V.js → intlTelInput-BUOxAmWZ.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/salla-accordion-body_2.entry.js +4 -4
- package/dist/esm/salla-accordion_6.entry.js +2 -2
- package/dist/esm/salla-add-product-button_5.entry.js +1 -1
- package/dist/esm/salla-advertisement.entry.js +1 -1
- package/dist/esm/salla-alert_2.entry.js +2 -2
- package/dist/esm/salla-app-install-alert.entry.js +1 -1
- package/dist/esm/salla-applied-filters.entry.js +1 -1
- package/dist/esm/salla-apps-icons.entry.js +50 -19
- package/dist/esm/salla-attachment-view_9.entry.js +22 -13
- package/dist/esm/salla-badge.entry.js +2 -2
- package/dist/esm/salla-basket-gap.entry.js +1 -1
- package/dist/esm/salla-bullet-delivery_3.entry.js +1 -1
- package/dist/esm/salla-cart-coupons.entry.js +1 -1
- package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
- package/dist/esm/salla-cart-summary-card.entry.js +1 -1
- package/dist/esm/salla-cashback-banner.entry.js +1 -1
- package/dist/esm/salla-comment-factors.entry.js +1 -1
- package/dist/esm/salla-comment-form_9.entry.js +1 -1
- package/dist/esm/salla-conditional-offer.entry.js +1 -1
- package/dist/esm/salla-contacts.entry.js +60 -29
- package/dist/esm/salla-cookies-bar.entry.js +1 -1
- package/dist/esm/salla-count-down.entry.js +1 -1
- package/dist/esm/salla-custom-fields.entry.js +1 -1
- package/dist/esm/salla-delivery-promise.entry.js +1 -1
- package/dist/esm/salla-edit-order-button.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +1 -1
- package/dist/esm/salla-filters.entry.js +1 -1
- package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
- package/dist/esm/salla-gift-card-redeem_2.entry.js +1 -1
- package/dist/esm/salla-gifting.entry.js +1 -1
- package/dist/esm/salla-hook.entry.js +1 -1
- package/dist/esm/salla-infinite-scroll.entry.js +1 -1
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-list-tile.entry.js +1 -1
- package/dist/esm/salla-localization-modal.entry.js +1 -1
- package/dist/esm/salla-login-modal.entry.js +1 -1
- package/dist/esm/salla-loyalty-banner_10.entry.js +1 -1
- package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
- package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
- package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm/salla-loyalty.entry.js +1 -1
- package/dist/esm/salla-maintenance-alert.entry.js +1 -1
- package/dist/esm/salla-map_3.entry.js +1 -1
- package/dist/esm/salla-menu.entry.js +1 -1
- package/dist/esm/salla-metadata.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
- package/dist/esm/salla-next-order-coupon.entry.js +1 -1
- package/dist/esm/salla-notification-item_2.entry.js +1 -1
- package/dist/esm/salla-offer-modal.entry.js +1 -1
- package/dist/esm/salla-offer.entry.js +1 -1
- package/dist/esm/salla-order-branch.entry.js +1 -1
- package/dist/esm/salla-order-cancel.entry.js +1 -1
- package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
- package/dist/esm/salla-order-details-options.entry.js +1 -1
- package/dist/esm/salla-order-details.entry.js +1 -1
- package/dist/esm/salla-order-edit-item.entry.js +1 -1
- package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
- package/dist/esm/salla-order-edit.entry.js +1 -1
- package/dist/esm/salla-order-options-modal.entry.js +5 -5
- package/dist/esm/salla-order-shipments.entry.js +1 -1
- package/dist/esm/salla-order-summary.entry.js +1 -1
- package/dist/esm/salla-order-totals-card.entry.js +49 -7
- package/dist/esm/salla-orders.entry.js +1 -1
- package/dist/esm/salla-payments.entry.js +1 -1
- package/dist/esm/salla-placeholder.entry.js +1 -1
- package/dist/esm/salla-price-range.entry.js +1 -1
- package/dist/esm/salla-product-card-embed.entry.js +1 -1
- package/dist/esm/salla-product-card.entry.js +1 -1
- package/dist/esm/salla-product-size-guide.entry.js +1 -1
- package/dist/esm/salla-products-list.entry.js +1 -1
- package/dist/esm/salla-products-slider.entry.js +1 -1
- package/dist/esm/salla-quick-order.entry.js +1 -1
- package/dist/esm/salla-rating-modal-v2.entry.js +1 -1
- package/dist/esm/salla-rating-modal.entry.js +1 -1
- package/dist/esm/salla-review-factors-tags.entry.js +1 -1
- package/dist/esm/salla-review-order-item.entry.js +1 -1
- package/dist/esm/salla-scopes.entry.js +1 -1
- package/dist/esm/salla-search-product-card.entry.js +1 -1
- package/dist/esm/salla-search.entry.js +12 -2
- package/dist/esm/salla-skeleton.entry.js +1 -1
- package/dist/esm/salla-social-share.entry.js +1 -1
- package/dist/esm/salla-social.entry.js +1 -1
- package/dist/esm/salla-tab-content_3.entry.js +24 -8
- package/dist/esm/salla-tiered-offer.entry.js +1 -1
- package/dist/esm/salla-trust-badges.entry.js +1 -1
- package/dist/esm/salla-user-menu.entry.js +1 -1
- package/dist/esm/salla-user-profile.entry.js +1 -1
- package/dist/esm/salla-user-settings.entry.js +1 -1
- package/dist/esm/salla-verify.entry.js +1 -1
- package/dist/esm/salla-wallet.entry.js +1 -1
- package/dist/esm/salla-wishlist-actions.entry.js +1 -1
- package/dist/esm/salla-wishlist-summary.entry.js +1 -1
- package/dist/esm/ssr-helpers-BJN-DTdN.js +46 -0
- package/dist/esm/twilight.js +3 -3
- package/dist/esm/{vanilla-picker-BzVn0xEV.js → vanilla-picker-vQxevRSA.js} +1 -1
- package/dist/twilight/{p-114e4228.entry.js → p-0116fc35.entry.js} +1 -1
- package/dist/twilight/{p-db1e0bc6.entry.js → p-02946cf5.entry.js} +1 -1
- package/dist/twilight/{p-0ba03206.entry.js → p-07453f6c.entry.js} +1 -1
- package/dist/twilight/{p-2b5242cb.entry.js → p-0c6290e0.entry.js} +1 -1
- package/dist/twilight/{p-6d61d93c.entry.js → p-0cb5d9c6.entry.js} +1 -1
- package/dist/twilight/{p-1b25ea2a.entry.js → p-0f68e660.entry.js} +1 -1
- package/dist/twilight/{p-c98d1097.entry.js → p-132d9742.entry.js} +1 -1
- package/dist/twilight/p-157873ee.entry.js +4 -0
- package/dist/twilight/{p-dda47e56.entry.js → p-161fce7a.entry.js} +1 -1
- package/dist/twilight/{p-3243ab6e.entry.js → p-167a9c58.entry.js} +1 -1
- package/dist/twilight/{p-76ca3445.entry.js → p-19b7fccb.entry.js} +1 -1
- package/dist/twilight/{p-7148dbad.entry.js → p-19d9b193.entry.js} +1 -1
- package/dist/twilight/{p-065f2937.entry.js → p-1c75de1e.entry.js} +1 -1
- package/dist/twilight/p-1c7999c9.entry.js +4 -0
- package/dist/twilight/{p-fe7751a8.entry.js → p-1ea04494.entry.js} +1 -1
- package/dist/twilight/{p-62dc337d.entry.js → p-1f3d5e3e.entry.js} +1 -1
- package/dist/twilight/{p-20f98a45.entry.js → p-22fc1505.entry.js} +1 -1
- package/dist/twilight/{p-07817ae8.entry.js → p-27d94a42.entry.js} +1 -1
- package/dist/twilight/{p-49bba37d.entry.js → p-2a865b0b.entry.js} +1 -1
- package/dist/twilight/{p-925ba8ce.entry.js → p-2bb95112.entry.js} +1 -1
- package/dist/twilight/{p-d6886b07.entry.js → p-2d8d9829.entry.js} +1 -1
- package/dist/twilight/{p-c282869e.entry.js → p-2df4e63a.entry.js} +1 -1
- package/dist/twilight/{p-b2ff66ed.entry.js → p-316be8a7.entry.js} +1 -1
- package/dist/twilight/{p-f310c72e.entry.js → p-321022f5.entry.js} +1 -1
- package/dist/twilight/{p-93d284c4.entry.js → p-34ab84e2.entry.js} +1 -1
- package/dist/twilight/{p-c892e962.entry.js → p-36ddb8db.entry.js} +1 -1
- package/dist/twilight/{p-25fb1508.entry.js → p-3b45e21a.entry.js} +1 -1
- package/dist/twilight/{p-f5693509.entry.js → p-3eface57.entry.js} +1 -1
- package/dist/twilight/{p-1fd1c0a3.entry.js → p-46334bbe.entry.js} +1 -1
- package/dist/twilight/{p-18e75544.entry.js → p-4678b6d7.entry.js} +1 -1
- package/dist/twilight/{p-62c985bc.entry.js → p-4ea3a8a1.entry.js} +1 -1
- package/dist/twilight/{p-a6594c68.entry.js → p-56d064c0.entry.js} +1 -1
- package/dist/twilight/{p-f51e9549.entry.js → p-57768c0e.entry.js} +1 -1
- package/dist/twilight/{p-651db82c.entry.js → p-57ddfcfe.entry.js} +1 -1
- package/dist/twilight/{p-6e7433f2.entry.js → p-60e920c6.entry.js} +1 -1
- package/dist/twilight/{p-bc5b70e9.entry.js → p-62690afe.entry.js} +1 -1
- package/dist/twilight/{p-8d99e9d1.entry.js → p-6339c31f.entry.js} +1 -1
- package/dist/twilight/{p-62373e96.entry.js → p-660271f5.entry.js} +1 -1
- package/dist/twilight/{p-14b1b664.entry.js → p-6b28397a.entry.js} +1 -1
- package/dist/twilight/{p-067ad44c.entry.js → p-6bacaa30.entry.js} +1 -1
- package/dist/twilight/{p-0b0c9ecb.entry.js → p-6cfb6628.entry.js} +1 -1
- package/dist/twilight/{p-56c77026.entry.js → p-6cffd732.entry.js} +1 -1
- package/dist/twilight/{p-b7dfb1f1.entry.js → p-6eb365f3.entry.js} +1 -1
- package/dist/twilight/{p-0253bf71.entry.js → p-73125aab.entry.js} +1 -1
- package/dist/twilight/{p-f5026adf.entry.js → p-73189ed2.entry.js} +1 -1
- package/dist/twilight/{p-8aa29666.entry.js → p-744c8337.entry.js} +1 -1
- package/dist/twilight/{p-2db00d46.entry.js → p-82430d31.entry.js} +1 -1
- package/dist/twilight/{p-d8cf239a.entry.js → p-8359286c.entry.js} +1 -1
- package/dist/twilight/{p-4ca3b245.entry.js → p-84ed92e9.entry.js} +1 -1
- package/dist/twilight/p-84ee1884.entry.js +4 -0
- package/dist/twilight/{p-bcbb4a03.entry.js → p-87feddeb.entry.js} +1 -1
- package/dist/twilight/{p-afd47a18.entry.js → p-8d119291.entry.js} +1 -1
- package/dist/twilight/{p-96154a67.entry.js → p-8f1789f7.entry.js} +1 -1
- package/dist/twilight/{p-d01c4ba8.entry.js → p-90765c65.entry.js} +1 -1
- package/dist/twilight/{p-46c8b068.entry.js → p-94f18d97.entry.js} +1 -1
- package/dist/twilight/p-9a7da6d0.entry.js +4 -0
- package/dist/twilight/{p-84912a5a.entry.js → p-9ab10a2f.entry.js} +1 -1
- package/dist/twilight/{p-c84e619a.entry.js → p-9ace9fc5.entry.js} +1 -1
- package/dist/twilight/{p-79ce9e95.entry.js → p-9b9c2adf.entry.js} +1 -1
- package/dist/twilight/p-BJN-DTdN.js +4 -0
- package/dist/twilight/{p-CwwxD-7C.js → p-C670SYee.js} +1 -1
- package/dist/twilight/{p-CntnRJCa.js → p-CcijNXaY.js} +1 -1
- package/dist/twilight/{p-CYeysHdt.js → p-D-pGRpnm.js} +1 -1
- package/dist/twilight/{p-DzBc32wK.js → p-D33qIToB.js} +1 -1
- package/dist/twilight/{p-B8yyit_i.js → p-DEtbzT0x.js} +1 -1
- package/dist/twilight/{p-CaabLwI1.js → p-DIJHCILO.js} +1 -1
- package/dist/twilight/{p-Bb9AkvT4.js → p-DOJsGUE-.js} +1 -1
- package/dist/twilight/{p-DHXSZjVo.js → p-DYkb22mH.js} +1 -1
- package/dist/twilight/{p-FcjN5vEx.js → p-Kqe2HSSB.js} +1 -1
- package/dist/twilight/{p-e1fb95cb.entry.js → p-af525459.entry.js} +1 -1
- package/dist/twilight/{p-f38d6c1b.entry.js → p-afc17688.entry.js} +1 -1
- package/dist/twilight/{p-8e91da09.entry.js → p-b124899c.entry.js} +1 -1
- package/dist/twilight/{p-dc090987.entry.js → p-b13efdf9.entry.js} +1 -1
- package/dist/twilight/{p-ac8a7743.entry.js → p-b2da9ea7.entry.js} +1 -1
- package/dist/twilight/{p-0889368b.entry.js → p-b3f0b7e3.entry.js} +1 -1
- package/dist/twilight/{p-659e00b7.entry.js → p-b40466ae.entry.js} +1 -1
- package/dist/twilight/p-b59eab4f.entry.js +4 -0
- package/dist/twilight/{p-0bff8609.entry.js → p-b6674eab.entry.js} +1 -1
- package/dist/twilight/{p-261aff22.entry.js → p-b7f5a180.entry.js} +1 -1
- package/dist/twilight/p-bf95f806.entry.js +4 -0
- package/dist/twilight/{p-b7c815f7.entry.js → p-c6f677aa.entry.js} +1 -1
- package/dist/twilight/{p-4ebee06a.entry.js → p-c7728312.entry.js} +1 -1
- package/dist/twilight/{p-aaac2388.entry.js → p-c840c67c.entry.js} +1 -1
- package/dist/twilight/{p-509b04c7.entry.js → p-cba57487.entry.js} +1 -1
- package/dist/twilight/{p-ee2a5db7.entry.js → p-ccd75cf6.entry.js} +1 -1
- package/dist/twilight/{p-7f653481.entry.js → p-ce8bdea8.entry.js} +1 -1
- package/dist/twilight/{p-e248f0d0.entry.js → p-d2b41e2d.entry.js} +1 -1
- package/dist/twilight/{p-c4f92bae.entry.js → p-d897273e.entry.js} +1 -1
- package/dist/twilight/{p-83e1c586.entry.js → p-d923ecda.entry.js} +1 -1
- package/dist/twilight/{p-f1d5ebf4.entry.js → p-da9b84ee.entry.js} +1 -1
- package/dist/twilight/p-de0ce00a.entry.js +4 -0
- package/dist/twilight/{p-cce07c4c.entry.js → p-dfcb0978.entry.js} +1 -1
- package/dist/twilight/{p-6fa1498b.entry.js → p-dff87ddc.entry.js} +1 -1
- package/dist/twilight/{p-55399fed.entry.js → p-e1b853b2.entry.js} +1 -1
- package/dist/twilight/{p-1c191c15.entry.js → p-e4ba8208.entry.js} +1 -1
- package/dist/twilight/{p-f4d52f9b.entry.js → p-e506fbee.entry.js} +1 -1
- package/dist/twilight/{p-f580d024.entry.js → p-e80bc0ce.entry.js} +1 -1
- package/dist/twilight/{p-10418cc0.entry.js → p-e8f7ed7b.entry.js} +1 -1
- package/dist/twilight/{p-6d47b269.entry.js → p-ea4e6f55.entry.js} +1 -1
- package/dist/twilight/{p-6b2f6957.entry.js → p-ea82cbb3.entry.js} +1 -1
- package/dist/twilight/{p-2213f6eb.entry.js → p-ef9567bd.entry.js} +1 -1
- package/dist/twilight/{p-e4ed760b.entry.js → p-f106d1e8.entry.js} +1 -1
- package/dist/twilight/{p-c7a491ef.entry.js → p-f37cc89b.entry.js} +1 -1
- package/dist/twilight/p-f52c49c8.entry.js +4 -0
- package/dist/twilight/{p-89bba634.entry.js → p-f5f448b7.entry.js} +1 -1
- package/dist/twilight/{p-DFj0n9Nh.js → p-r8T0WY8a.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-apps-icons/salla-apps-icons.d.ts +26 -13
- package/dist/types/components/salla-apps-icons/salla-apps-icons.types.d.ts +4 -0
- package/dist/types/components/salla-booking-field/salla-booking-field.d.ts +5 -1
- package/dist/types/components/salla-contacts/salla-contacts.d.ts +26 -14
- package/dist/types/components/salla-contacts/salla-contacts.types.d.ts +7 -0
- package/dist/types/components/salla-order-totals-card/interfaces.d.ts +27 -0
- package/dist/types/components/salla-order-totals-card/salla-order-totals-card.d.ts +12 -4
- package/dist/types/components/salla-search/salla-search.d.ts +3 -1
- package/dist/types/components/salla-tabs/salla-tab-content.d.ts +3 -2
- package/dist/types/components/salla-tabs/salla-tabs.d.ts +8 -3
- package/dist/types/components.d.ts +90 -22
- package/dist/types/utils/ssr-helpers.d.ts +73 -0
- package/package.json +5 -5
- package/dist/twilight/p-1f561241.entry.js +0 -4
- package/dist/twilight/p-27df0290.entry.js +0 -4
- package/dist/twilight/p-2f04343f.entry.js +0 -4
- package/dist/twilight/p-3de0b3ae.entry.js +0 -4
- package/dist/twilight/p-89fddf1e.entry.js +0 -4
- package/dist/twilight/p-a743a10a.entry.js +0 -4
- package/dist/twilight/p-f345a77d.entry.js +0 -4
- package/dist/twilight/p-f8b428cb.entry.js +0 -4
|
@@ -3,21 +3,62 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { h, Host } from "@stencil/core";
|
|
5
5
|
export class SallaOrderTotalsCard {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
// `amounts` wins over the legacy `order` whenever both are set
|
|
7
|
+
refreshSummary() {
|
|
8
|
+
if (this.amounts) {
|
|
9
|
+
this.setSummaryFromAmounts(this.amounts);
|
|
10
|
+
}
|
|
11
|
+
else if (this.order) {
|
|
12
|
+
this.setSummaryFromOrder(this.order);
|
|
9
13
|
}
|
|
10
14
|
else {
|
|
11
15
|
this.summary = undefined;
|
|
12
16
|
}
|
|
13
17
|
}
|
|
18
|
+
handleAmountsChange() {
|
|
19
|
+
this.refreshSummary();
|
|
20
|
+
}
|
|
21
|
+
handleOrderChange() {
|
|
22
|
+
this.refreshSummary();
|
|
23
|
+
}
|
|
14
24
|
async componentWillLoad() {
|
|
15
25
|
await Salla.onReady();
|
|
16
|
-
|
|
17
|
-
|
|
26
|
+
this.refreshSummary();
|
|
27
|
+
}
|
|
28
|
+
normalizeAmounts(value) {
|
|
29
|
+
const parsed = typeof value === 'string' ? JSON.parse(value) : value;
|
|
30
|
+
return {
|
|
31
|
+
sub_total: parsed.sub_total,
|
|
32
|
+
total: parsed.total,
|
|
33
|
+
shipping_cost: parsed.shipping_cost,
|
|
34
|
+
cod_cost: parsed.cash_on_delivery,
|
|
35
|
+
paid_amount: parsed.paid_amount,
|
|
36
|
+
remaining_amount: parsed.remaining_amount,
|
|
37
|
+
refund_amount: parsed.refund_amount,
|
|
38
|
+
options: parsed.options,
|
|
39
|
+
options_total: parsed.options_total,
|
|
40
|
+
tax: parsed.tax
|
|
41
|
+
? {
|
|
42
|
+
percent: typeof parsed.tax.percent === 'string' ? parseFloat(parsed.tax.percent) : parsed.tax.percent,
|
|
43
|
+
amount: parsed.tax.amount,
|
|
44
|
+
}
|
|
45
|
+
: undefined,
|
|
46
|
+
discounts: parsed.discounts?.map((d) => ({
|
|
47
|
+
name: d.title,
|
|
48
|
+
discount: typeof d.discount === 'string' ? parseFloat(d.discount) : d.discount,
|
|
49
|
+
})),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
setSummaryFromAmounts(value) {
|
|
53
|
+
try {
|
|
54
|
+
this.summary = this.normalizeAmounts(value);
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
salla.logger.error('Failed to parse amounts data', error);
|
|
58
|
+
this.summary = undefined;
|
|
18
59
|
}
|
|
19
60
|
}
|
|
20
|
-
|
|
61
|
+
setSummaryFromOrder(value) {
|
|
21
62
|
try {
|
|
22
63
|
const parsedValue = typeof value === 'string' ? JSON.parse(value) : value;
|
|
23
64
|
this.summary = parsedValue;
|
|
@@ -72,6 +113,31 @@ export class SallaOrderTotalsCard {
|
|
|
72
113
|
}
|
|
73
114
|
static get properties() {
|
|
74
115
|
return {
|
|
116
|
+
"amounts": {
|
|
117
|
+
"type": "string",
|
|
118
|
+
"attribute": "amounts",
|
|
119
|
+
"mutable": false,
|
|
120
|
+
"complexType": {
|
|
121
|
+
"original": "string | Amounts",
|
|
122
|
+
"resolved": "Amounts | string",
|
|
123
|
+
"references": {
|
|
124
|
+
"Amounts": {
|
|
125
|
+
"location": "import",
|
|
126
|
+
"path": "./interfaces",
|
|
127
|
+
"id": "src/components/salla-order-totals-card/interfaces.ts::Amounts"
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
"required": false,
|
|
132
|
+
"optional": true,
|
|
133
|
+
"docs": {
|
|
134
|
+
"tags": [],
|
|
135
|
+
"text": "Order totals object (new schema). Accepts a JSON string or object with amounts."
|
|
136
|
+
},
|
|
137
|
+
"getter": false,
|
|
138
|
+
"setter": false,
|
|
139
|
+
"reflect": false
|
|
140
|
+
},
|
|
75
141
|
"order": {
|
|
76
142
|
"type": "string",
|
|
77
143
|
"attribute": "order",
|
|
@@ -91,7 +157,7 @@ export class SallaOrderTotalsCard {
|
|
|
91
157
|
"optional": true,
|
|
92
158
|
"docs": {
|
|
93
159
|
"tags": [],
|
|
94
|
-
"text": "
|
|
160
|
+
"text": "Legacy order object for backward compatibility. Prefer using `amounts` instead."
|
|
95
161
|
},
|
|
96
162
|
"getter": false,
|
|
97
163
|
"setter": false,
|
|
@@ -106,6 +172,9 @@ export class SallaOrderTotalsCard {
|
|
|
106
172
|
}
|
|
107
173
|
static get watchers() {
|
|
108
174
|
return [{
|
|
175
|
+
"propName": "amounts",
|
|
176
|
+
"methodName": "handleAmountsChange"
|
|
177
|
+
}, {
|
|
109
178
|
"propName": "order",
|
|
110
179
|
"methodName": "handleOrderChange"
|
|
111
180
|
}];
|
|
@@ -69,12 +69,22 @@ export class SallaSearch {
|
|
|
69
69
|
Helper.saveProductSource('search');
|
|
70
70
|
this.commitSearchHistory(this.search_term);
|
|
71
71
|
salla.event.emit('salla-search::product.clicked', [{ product, position }]);
|
|
72
|
+
this.modal?.close();
|
|
72
73
|
},
|
|
73
74
|
recommendationClick: (term, source) => {
|
|
74
75
|
salla.event.emit('salla-search::recommendation.clicked', { term, source });
|
|
75
76
|
},
|
|
76
77
|
};
|
|
77
|
-
|
|
78
|
+
}
|
|
79
|
+
connectedCallback() {
|
|
80
|
+
this.searchOpenListener = () => this.open();
|
|
81
|
+
salla.event.on('search::open', this.searchOpenListener);
|
|
82
|
+
}
|
|
83
|
+
disconnectedCallback() {
|
|
84
|
+
if (this.searchOpenListener) {
|
|
85
|
+
salla.event.off('search::open', this.searchOpenListener);
|
|
86
|
+
this.searchOpenListener = undefined;
|
|
87
|
+
}
|
|
78
88
|
}
|
|
79
89
|
async open() {
|
|
80
90
|
if (!this.hasLoadedPopularSearches) {
|
|
@@ -19,6 +19,12 @@ export class SallaTabContent {
|
|
|
19
19
|
name: this.name
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
+
componentWillLoad() {
|
|
23
|
+
const parent = this.host.closest('salla-tabs');
|
|
24
|
+
if (parent?.activeTab === this.name) {
|
|
25
|
+
this.isSelected = true;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
22
28
|
unselect() {
|
|
23
29
|
this.isSelected = false;
|
|
24
30
|
}
|
|
@@ -30,7 +36,7 @@ export class SallaTabContent {
|
|
|
30
36
|
's-tabs-content': true,
|
|
31
37
|
's-tabs-content-selected': this.isSelected
|
|
32
38
|
};
|
|
33
|
-
return (h("div", { key: '
|
|
39
|
+
return (h("div", { key: '251a33f54b1a8bb0fc4a424de86fe9e443ef6cf1', class: classes }, h("slot", { key: 'f7244cb7f510b7bde6ff34a64ef4ce043392b4fa' })));
|
|
34
40
|
}
|
|
35
41
|
static get is() { return "salla-tab-content"; }
|
|
36
42
|
static get originalStyleUrls() {
|
|
@@ -58,7 +64,7 @@ export class SallaTabContent {
|
|
|
58
64
|
"optional": false,
|
|
59
65
|
"docs": {
|
|
60
66
|
"tags": [],
|
|
61
|
-
"text": "Set name of the tab content. Mainly used as a key to
|
|
67
|
+
"text": "Set name of the tab content. Mainly used as a key to synchronize the content with its respective header."
|
|
62
68
|
},
|
|
63
69
|
"getter": false,
|
|
64
70
|
"setter": false,
|
|
@@ -92,4 +98,5 @@ export class SallaTabContent {
|
|
|
92
98
|
}
|
|
93
99
|
};
|
|
94
100
|
}
|
|
101
|
+
static get elementRef() { return "host"; }
|
|
95
102
|
}
|
|
@@ -9,18 +9,26 @@ import { h } from "@stencil/core";
|
|
|
9
9
|
export class SallaTabs {
|
|
10
10
|
constructor() {
|
|
11
11
|
/**
|
|
12
|
-
* Background color
|
|
12
|
+
* Background color for the tabs header section. Accepts any CSS color value.
|
|
13
13
|
*/
|
|
14
14
|
this.backgroundColor = undefined;
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* Whether to display tabs in a vertical layout. Default is false (horizontal layout).
|
|
17
17
|
*/
|
|
18
18
|
this.vertical = false;
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
componentDidLoad() {
|
|
21
21
|
this.createGroup().then(() => {
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
if (this.activeTab) {
|
|
23
|
+
const group = this.tabGroup.find(g => g.header.name === this.activeTab);
|
|
24
|
+
if (group) {
|
|
25
|
+
this.selectGroup(group);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
const [group] = this.tabGroup;
|
|
30
|
+
this.selectGroup(group);
|
|
31
|
+
}
|
|
24
32
|
});
|
|
25
33
|
}
|
|
26
34
|
onSelectedTab(event) {
|
|
@@ -49,8 +57,9 @@ export class SallaTabs {
|
|
|
49
57
|
group.content.selected();
|
|
50
58
|
}
|
|
51
59
|
render() {
|
|
60
|
+
const headerStyle = this.backgroundColor ? { 'background-color': this.backgroundColor } : {};
|
|
52
61
|
return [
|
|
53
|
-
h("div", { key: '
|
|
62
|
+
h("div", { key: 'd6f4e42f48cc3275f210718af56ff2fbbdb3e4a2', class: "s-tabs" }, h("div", { key: 'cdc798c1408536a3d56797b9bba071b246c01bbe', class: "s-tabs-header", style: headerStyle }, h("slot", { key: '7ba75a8985d78246faeef7c491452a5b82dbfa21', name: "header" })), h("div", { key: '0672eb44f6664cc3926a9780718f818f3b1ff507', class: "s-tabs-content-wrapper" }, h("slot", { key: '761a54a862372d9546763c814cc96ccb802f9b64', name: "content" })))
|
|
54
63
|
];
|
|
55
64
|
}
|
|
56
65
|
static get is() { return "salla-tabs"; }
|
|
@@ -79,7 +88,7 @@ export class SallaTabs {
|
|
|
79
88
|
"optional": false,
|
|
80
89
|
"docs": {
|
|
81
90
|
"tags": [],
|
|
82
|
-
"text": "Background color"
|
|
91
|
+
"text": "Background color for the tabs header section. Accepts any CSS color value."
|
|
83
92
|
},
|
|
84
93
|
"getter": false,
|
|
85
94
|
"setter": false,
|
|
@@ -99,12 +108,31 @@ export class SallaTabs {
|
|
|
99
108
|
"optional": false,
|
|
100
109
|
"docs": {
|
|
101
110
|
"tags": [],
|
|
102
|
-
"text": "
|
|
111
|
+
"text": "Whether to display tabs in a vertical layout. Default is false (horizontal layout)."
|
|
103
112
|
},
|
|
104
113
|
"getter": false,
|
|
105
114
|
"setter": false,
|
|
106
115
|
"reflect": false,
|
|
107
116
|
"defaultValue": "false"
|
|
117
|
+
},
|
|
118
|
+
"activeTab": {
|
|
119
|
+
"type": "string",
|
|
120
|
+
"attribute": "active-tab",
|
|
121
|
+
"mutable": false,
|
|
122
|
+
"complexType": {
|
|
123
|
+
"original": "string",
|
|
124
|
+
"resolved": "string",
|
|
125
|
+
"references": {}
|
|
126
|
+
},
|
|
127
|
+
"required": false,
|
|
128
|
+
"optional": true,
|
|
129
|
+
"docs": {
|
|
130
|
+
"tags": [],
|
|
131
|
+
"text": "Initial active tab name for SSR. When provided, child components (salla-tab-header/salla-tab-content)\nwill use this value to set their initial active state. If not provided, first tab becomes active after hydration."
|
|
132
|
+
},
|
|
133
|
+
"getter": false,
|
|
134
|
+
"setter": false,
|
|
135
|
+
"reflect": false
|
|
108
136
|
}
|
|
109
137
|
};
|
|
110
138
|
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* SSR Helper Utilities
|
|
6
|
+
* These utilities provide a clean, reusable pattern for handling SSR-safe value resolution
|
|
7
|
+
* across components. The pattern: use provided prop value -> fallback to SDK when available -> use default.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Resolves a value using the SSR-safe pattern:
|
|
11
|
+
* 1. If prop value is provided, use it directly
|
|
12
|
+
* 2. If prop not provided and salla SDK is available, use SDK getter
|
|
13
|
+
* 3. If prop not provided and salla SDK not available (SSR), use fallback
|
|
14
|
+
*
|
|
15
|
+
* @param propValue - The value provided via component prop (can be undefined)
|
|
16
|
+
* @param sdkGetter - Function to get value from SDK when available
|
|
17
|
+
* @param fallback - Default value when neither prop nor SDK is available
|
|
18
|
+
* @returns The resolved value
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* // Simple config value
|
|
22
|
+
* const color = getSdkValueOrFallback(
|
|
23
|
+
* this.color,
|
|
24
|
+
* () => salla.config.get('theme.color.primary', '#5dd5c4'),
|
|
25
|
+
* '#5dd5c4'
|
|
26
|
+
* );
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* // With async SDK call
|
|
30
|
+
* const title = getSdkValueOrFallback(
|
|
31
|
+
* this.title,
|
|
32
|
+
* () => salla.lang.get('common.titles.products'),
|
|
33
|
+
* 'Products'
|
|
34
|
+
* );
|
|
35
|
+
*/
|
|
36
|
+
export function getSdkValueOrFallback(propValue, sdkGetter, fallback) {
|
|
37
|
+
if (propValue !== undefined && propValue !== null) {
|
|
38
|
+
return propValue;
|
|
39
|
+
}
|
|
40
|
+
if (typeof salla !== 'undefined') {
|
|
41
|
+
return sdkGetter();
|
|
42
|
+
}
|
|
43
|
+
return fallback;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Async version for SDK calls that require onReady or async operations.
|
|
47
|
+
* Automatically calls salla.onReady() before executing sdkGetter.
|
|
48
|
+
*
|
|
49
|
+
* @param propValue - The value provided via component prop
|
|
50
|
+
* @param sdkGetter - Function to get value from SDK (onReady is called automatically)
|
|
51
|
+
* @param fallback - Default value when neither prop nor SDK is available
|
|
52
|
+
* @returns Promise resolving to the value
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* const color = await getSdkValueOrFallbackAsync(
|
|
56
|
+
* this.color,
|
|
57
|
+
* () => salla.config.get('theme.color.primary', '#5dd5c4'),
|
|
58
|
+
* '#5dd5c4'
|
|
59
|
+
* );
|
|
60
|
+
*/
|
|
61
|
+
export async function getSdkValueOrFallbackAsync(propValue, sdkGetter, fallback) {
|
|
62
|
+
if (propValue !== undefined && propValue !== null) {
|
|
63
|
+
return propValue;
|
|
64
|
+
}
|
|
65
|
+
if (typeof salla !== 'undefined') {
|
|
66
|
+
await salla.onReady();
|
|
67
|
+
return await sdkGetter();
|
|
68
|
+
}
|
|
69
|
+
return fallback;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* SSR-safe check for salla SDK availability.
|
|
73
|
+
* Returns true in client-side context where salla is loaded.
|
|
74
|
+
*
|
|
75
|
+
* @returns boolean indicating if salla SDK is available
|
|
76
|
+
*/
|
|
77
|
+
export function isSallaSdkAvailable() {
|
|
78
|
+
return typeof salla !== 'undefined';
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Persists the active scope to both salla.storage and a cookie (same structure),
|
|
82
|
+
* so the scope is readable server-side. Use this everywhere the scope changes to
|
|
83
|
+
* keep storage and cookie in sync.
|
|
84
|
+
*
|
|
85
|
+
* @param scope - The scope object to persist (e.g. { type, id, ... })
|
|
86
|
+
*/
|
|
87
|
+
export function setScope(scope) {
|
|
88
|
+
salla.storage.set('scope', scope);
|
|
89
|
+
if (typeof document !== 'undefined') {
|
|
90
|
+
document.cookie = `scope=${encodeURIComponent(JSON.stringify(scope))}; path=/; max-age=31536000; SameSite=Lax`;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* SSR-safe document.dir access.
|
|
95
|
+
* Returns the document direction or fallback.
|
|
96
|
+
*
|
|
97
|
+
* @param fallback - Default direction ('rtl' or 'ltr')
|
|
98
|
+
* @returns The direction value
|
|
99
|
+
*/
|
|
100
|
+
export function getDocumentDir(fallback = 'rtl') {
|
|
101
|
+
if (typeof document !== 'undefined' && document.dir) {
|
|
102
|
+
return document.dir;
|
|
103
|
+
}
|
|
104
|
+
return fallback;
|
|
105
|
+
}
|