@lancom/shared 0.0.62 → 0.0.66
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/assets/js/api/admin.js +332 -0
- package/assets/js/api/helpers.js +31 -0
- package/assets/js/api/index.js +162 -0
- package/assets/js/constants/colors.js +4 -0
- package/assets/js/constants/currencies.js +112 -0
- package/assets/js/constants/fonts.js +137 -0
- package/assets/js/constants/order.js +26 -0
- package/assets/js/constants/print-type.js +16 -0
- package/assets/js/constants/prints.js +17 -0
- package/assets/js/constants/product.js +11 -0
- package/assets/js/constants/sides.js +6 -0
- package/assets/js/constants/sizes.js +1 -0
- package/assets/js/constants/states.js +10 -0
- package/assets/js/models/print-area.js +72 -0
- package/assets/js/models/product-layers.js +108 -0
- package/assets/js/utils/breakpoints.js +67 -0
- package/assets/js/utils/cart.js +31 -0
- package/assets/js/utils/colors.js +71 -0
- package/assets/js/utils/copy-to-clipboard.js +10 -0
- package/assets/js/utils/custom-validation-rules.js +13 -0
- package/assets/js/utils/dom.js +12 -0
- package/assets/js/utils/event-bus.js +3 -0
- package/assets/js/utils/event-dispatcher.js +22 -0
- package/assets/js/utils/export-print-to-svg.js +97 -0
- package/assets/js/utils/fabric/files-loader.js +36 -0
- package/assets/js/utils/fabric/object-factory.js +50 -0
- package/assets/js/utils/fabric/selection-style.js +59 -0
- package/assets/js/utils/fabric/wireframe.js +143 -0
- package/assets/js/utils/fabric-helper.js +381 -0
- package/assets/js/utils/filters.js +87 -0
- package/assets/js/utils/fonts-helper.js +85 -0
- package/assets/js/utils/gtm.js +20 -0
- package/assets/js/utils/guid.js +3 -0
- package/assets/js/utils/news.js +10 -0
- package/assets/js/utils/order.js +73 -0
- package/assets/js/utils/pricing.js +5 -0
- package/assets/js/utils/prints.js +53 -0
- package/assets/js/utils/product.js +141 -0
- package/assets/js/utils/products-grouping/by-colors.js +23 -0
- package/assets/js/utils/products-grouping/by-design.js +49 -0
- package/assets/js/utils/products-grouping/by-prints.js +43 -0
- package/assets/js/utils/products-grouping/by-sku.js +18 -0
- package/assets/js/utils/products-grouping/index.js +7 -0
- package/assets/js/utils/products-grouping/prints-by-print-area.js +26 -0
- package/assets/js/utils/products-grouping/prints-by-size.js +20 -0
- package/assets/js/utils/products-grouping/sizes-by-price.js +21 -0
- package/assets/js/utils/quote.js +27 -0
- package/assets/js/utils/sizes.js +14 -0
- package/assets/scss/_common.scss +138 -0
- package/assets/scss/_reset.scss +50 -0
- package/assets/scss/_transitions.scss +472 -0
- package/assets/scss/main.scss +4 -0
- package/assets/scss/normalize/_index.scss +565 -0
- package/assets/scss/ui_kit/_buttons.scss +322 -0
- package/assets/scss/ui_kit/_forms.scss +625 -0
- package/assets/scss/ui_kit/_grid.scss +799 -0
- package/assets/scss/ui_kit/_index.scss +9 -0
- package/assets/scss/ui_kit/_modals.scss +64 -0
- package/assets/scss/ui_kit/_table.scss +90 -0
- package/assets/scss/ui_kit/_toast.scss +52 -0
- package/assets/scss/ui_kit/_tooltip.scss +131 -0
- package/assets/scss/ui_kit/_typography.scss +358 -0
- package/assets/scss/variables/_breakpoints.scss +12 -0
- package/assets/scss/variables/_index.scss +2 -0
- package/assets/scss/variables/_theme.scss +73 -0
- package/components/asides/contact_us/contact-us.scss +68 -0
- package/components/asides/contact_us/contact-us.vue +209 -0
- package/components/asides/menu/menu.scss +23 -0
- package/components/asides/menu/menu.vue +47 -0
- package/components/asides/offer_screen_printing/offer-screen-printing.scss +68 -0
- package/components/asides/offer_screen_printing/offer-screen-printing.vue +201 -0
- package/components/checkout/cart/cart.mixin.js +70 -0
- package/components/checkout/cart/cart.scss +115 -0
- package/components/checkout/cart/cart.vue +77 -0
- package/components/checkout/cart/cart_entities_group/cart-entities-group.mixin.js +114 -0
- package/components/checkout/cart/cart_entities_group/cart-entities-group.scss +74 -0
- package/components/checkout/cart/cart_entities_group/cart-entities-group.vue +82 -0
- package/components/checkout/cart/cart_entities_group/cart_entities_group_prints/cart-entities-group-prints.scss +29 -0
- package/components/checkout/cart/cart_entities_group/cart_entities_group_prints/cart-entities-group-prints.vue +75 -0
- package/components/checkout/cart/cart_entities_group/cart_entities_group_prints/cart_entities_group_print/cart-entities-group-print.scss +0 -0
- package/components/checkout/cart/cart_entities_group/cart_entities_group_prints/cart_entities_group_print/cart-entities-group-print.vue +88 -0
- package/components/checkout/cart/cart_entities_group/cart_entities_group_size_cell/cart-entities-group-size-cell.scss +23 -0
- package/components/checkout/cart/cart_entities_group/cart_entities_group_size_cell/cart-entities-group-size-cell.vue +91 -0
- package/components/checkout/cart/cart_entities_group_table/cart-entities-group-table.scss +7 -0
- package/components/checkout/cart/cart_entities_group_table/cart-entities-group-table.vue +57 -0
- package/components/checkout/cart/cart_entities_group_table/cart_entities_group_tr/cart-entities-group-tr.scss +10 -0
- package/components/checkout/cart/cart_entities_group_table/cart_entities_group_tr/cart-entities-group-tr.vue +100 -0
- package/components/checkout/cart/cart_entity/cart-entity.mixin.js +56 -0
- package/components/checkout/cart/cart_entity/cart-entity.scss +52 -0
- package/components/checkout/cart/cart_entity/cart-entity.vue +69 -0
- package/components/checkout/cart/cart_entity/cart_entity_color_simple_products/cart-entity-color-simple-products.mixin.js +83 -0
- package/components/checkout/cart/cart_entity/cart_entity_color_simple_products/cart-entity-color-simple-products.scss +96 -0
- package/components/checkout/cart/cart_entity/cart_entity_color_simple_products/cart-entity-color-simple-products.vue +89 -0
- package/components/checkout/cart/cart_entity/cart_entity_color_simple_products/cart_entity_color_simple_product/cart-entity-color-simple-product.scss +74 -0
- package/components/checkout/cart/cart_entity/cart_entity_color_simple_products/cart_entity_color_simple_product/cart-entity-color-simple-product.vue +129 -0
- package/components/checkout/cart/cart_entity/cart_entity_prints/cart-entity-prints.scss +65 -0
- package/components/checkout/cart/cart_entity/cart_entity_prints/cart-entity-prints.vue +72 -0
- package/components/checkout/cart/cart_entity/cart_entity_prints/cart_entity_print/cart-entity-print.scss +31 -0
- package/components/checkout/cart/cart_entity/cart_entity_prints/cart_entity_print/cart-entity-print.vue +102 -0
- package/components/checkout/cart/cart_price_info/cart-price-info.scss +0 -0
- package/components/checkout/cart/cart_price_info/cart-price-info.vue +66 -0
- package/components/checkout/cart/cart_quantity_errors/cart-quantity-errors.scss +8 -0
- package/components/checkout/cart/cart_quantity_errors/cart-quantity-errors.vue +32 -0
- package/components/checkout/order/address-form/address-form.scss +17 -0
- package/components/checkout/order/address-form/address-form.vue +301 -0
- package/components/checkout/order/order-billing-information/order-billing-information.scss +5 -0
- package/components/checkout/order/order-billing-information/order-billing-information.vue +68 -0
- package/components/checkout/order/order-checkout-method/order-checkout-method.scss +9 -0
- package/components/checkout/order/order-checkout-method/order-checkout-method.vue +102 -0
- package/components/checkout/order/order-payment-information/order-payment-information.scss +44 -0
- package/components/checkout/order/order-payment-information/order-payment-information.vue +166 -0
- package/components/checkout/order/order-review/order-review.scss +13 -0
- package/components/checkout/order/order-review/order-review.vue +127 -0
- package/components/checkout/order/order-shipping-information/order-shipping-information.scss +11 -0
- package/components/checkout/order/order-shipping-information/order-shipping-information.vue +50 -0
- package/components/checkout/order/order-shipping-method/order-shipping-method.scss +0 -0
- package/components/checkout/order/order-shipping-method/order-shipping-method.vue +67 -0
- package/components/checkout/order/order-success/order-success.scss +42 -0
- package/components/checkout/order/order-success/order-success.vue +41 -0
- package/components/checkout/order/order.scss +44 -0
- package/components/checkout/order/order.vue +145 -0
- package/components/checkout/payment/payment-cart/payment-cart.scss +53 -0
- package/components/checkout/payment/payment-cart/payment-cart.vue +196 -0
- package/components/checkout/payment/payment_failed/payment-failed.scss +19 -0
- package/components/checkout/payment/payment_failed/payment-failed.vue +41 -0
- package/components/checkout/payment/payment_success/payment-success.scss +19 -0
- package/components/checkout/payment/payment_success/payment-success.vue +40 -0
- package/components/common/breadcrumbs/breadcrumbs.scss +20 -0
- package/components/common/breadcrumbs/breadcrumbs.vue +65 -0
- package/components/common/breakpoint.vue +51 -0
- package/components/common/btn.vue +159 -0
- package/components/common/checkbox.vue +156 -0
- package/components/common/checked-icon.vue +48 -0
- package/components/common/color-picker.vue +108 -0
- package/components/common/file_uploader.vue +186 -0
- package/components/common/image_viewer/image-viewer.scss +139 -0
- package/components/common/image_viewer/image-viewer.vue +152 -0
- package/components/common/info-popover.vue +61 -0
- package/components/common/logo/logo.scss +16 -0
- package/components/common/logo/logo.vue +30 -0
- package/components/common/postcode_select/postcode-select.scss +8 -0
- package/components/common/postcode_select/postcode-select.vue +141 -0
- package/components/common/pricing_discounts_table/pricing-discounts-table.scss +5 -0
- package/components/common/pricing_discounts_table/pricing-discounts-table.vue +53 -0
- package/components/common/pricing_table/pricing-table.scss +8 -0
- package/components/common/pricing_table/pricing-table.vue +133 -0
- package/components/common/product_side_with_print/product-side-with-print.scss +19 -0
- package/components/common/product_side_with_print/product-side-with-print.vue +128 -0
- package/components/common/products_list_dropdown/products-list-dropdown.scss +0 -0
- package/components/common/products_list_dropdown/products-list-dropdown.vue +69 -0
- package/components/common/products_list_dropdown/products_list_dropdown_option/products-list-dropdown-option.scss +30 -0
- package/components/common/products_list_dropdown/products_list_dropdown_option/products-list-dropdown-option.vue +35 -0
- package/components/common/products_total_pricing/products-total-pricing.scss +12 -0
- package/components/common/products_total_pricing/products-total-pricing.vue +53 -0
- package/components/common/progress_steps/progress-steps.scss +169 -0
- package/components/common/progress_steps/progress-steps.vue +166 -0
- package/components/common/progress_steps/progress_steps_controls/progress-steps-controls.scss +0 -0
- package/components/common/progress_steps/progress_steps_controls/progress-steps-controls.vue +67 -0
- package/components/common/range/range.scss +51 -0
- package/components/common/range/range.vue +116 -0
- package/components/common/rich-text.vue +30 -0
- package/components/common/shops-multiselect.vue +46 -0
- package/components/common/single-item-price.vue +30 -0
- package/components/common/spinner.vue +73 -0
- package/components/common/stars-mark.vue +98 -0
- package/components/common/tabs.vue +174 -0
- package/components/common/toggle-content.vue +59 -0
- package/components/customer/customer.scss +9 -0
- package/components/customer/customer.vue +84 -0
- package/components/customer/customer_form/customer-form.scss +12 -0
- package/components/customer/customer_form/customer-form.vue +276 -0
- package/components/customer/customer_password/customer-password.scss +0 -0
- package/components/customer/customer_password/customer-password.vue +99 -0
- package/components/customer/recovery_form/recovery-form.scss +0 -0
- package/components/customer/recovery_form/recovery-form.vue +96 -0
- package/components/customer/signin_form/signin-form.scss +22 -0
- package/components/customer/signin_form/signin-form.vue +147 -0
- package/components/design/approve_design_header/approve-design-header.scss +71 -0
- package/components/design/approve_design_header/approve-design-header.vue +69 -0
- package/components/design/approve_design_prints/approve-design-prints.scss +76 -0
- package/components/design/approve_design_prints/approve-design-prints.vue +98 -0
- package/components/design/approve_design_tables/approve-design-tables.scss +47 -0
- package/components/design/approve_design_tables/approve-design-tables.vue +136 -0
- package/components/design/approve_design_tees/approve-design-tees.scss +87 -0
- package/components/design/approve_design_tees/approve-design-tees.vue +59 -0
- package/components/editor/editor.scss +42 -0
- package/components/editor/editor.vue +214 -0
- package/components/editor/editor_layers/editor-layers.scss +22 -0
- package/components/editor/editor_layers/editor-layers.vue +154 -0
- package/components/editor/editor_layers/editor_layer_forms/editor_layer_common_fields/editor-layer-common-fields.scss +37 -0
- package/components/editor/editor_layers/editor_layer_forms/editor_layer_common_fields/editor-layer-common-fields.vue +110 -0
- package/components/editor/editor_layers/editor_layer_forms/editor_layer_form_art/editor-layer-form-art.scss +7 -0
- package/components/editor/editor_layers/editor_layer_forms/editor_layer_form_art/editor-layer-form-art.vue +55 -0
- package/components/editor/editor_layers/editor_layer_forms/editor_layer_form_text/editor-layer-form-text.scss +49 -0
- package/components/editor/editor_layers/editor_layer_forms/editor_layer_form_text/editor-layer-form-text.vue +236 -0
- package/components/editor/editor_layers/editor_layer_forms/editor_layer_form_text/font-family_select/font-family-select.scss +147 -0
- package/components/editor/editor_layers/editor_layer_forms/editor_layer_form_text/font-family_select/font-family-select.vue +141 -0
- package/components/editor/editor_layers/editor_layer_forms/index.js +7 -0
- package/components/editor/editor_layers/editor_layers_layer/editor-layers-layer.scss +140 -0
- package/components/editor/editor_layers/editor_layers_layer/editor-layers-layer.vue +127 -0
- package/components/editor/editor_layers/editor_layers_toolbar/editor-layers-toolbar.scss +75 -0
- package/components/editor/editor_layers/editor_layers_toolbar/editor-layers-toolbar.vue +112 -0
- package/components/editor/editor_pricing/editor-pricing.scss +56 -0
- package/components/editor/editor_pricing/editor-pricing.vue +311 -0
- package/components/editor/editor_print_area_options/editor-print-area-options.scss +28 -0
- package/components/editor/editor_print_area_options/editor-print-area-options.vue +91 -0
- package/components/editor/editor_print_area_options/editor_print_area_option/editor-print-area-option.scss +28 -0
- package/components/editor/editor_print_area_options/editor_print_area_option/editor-print-area-option.vue +103 -0
- package/components/editor/editor_product_details/editor-product-details.scss +50 -0
- package/components/editor/editor_product_details/editor-product-details.vue +124 -0
- package/components/editor/editor_workspace/editor-workspace.scss +114 -0
- package/components/editor/editor_workspace/editor-workspace.vue +182 -0
- package/components/editor/editor_workspace/editor_workspace_side/editor-workspace-side.scss +110 -0
- package/components/editor/editor_workspace/editor_workspace_side/editor-workspace-side.vue +344 -0
- package/components/editor/mobile_editor_product_details/mobile-editor-product-details.scss +103 -0
- package/components/editor/mobile_editor_product_details/mobile-editor-product-details.vue +147 -0
- package/components/errors/404.vue +54 -0
- package/components/errors/500.vue +54 -0
- package/components/modals/cart_modal/cart-modal.scss +26 -0
- package/components/modals/cart_modal/cart-modal.vue +62 -0
- package/components/modals/confirmation_modal/confirmation-modal.scss +7 -0
- package/components/modals/confirmation_modal/confirmation-modal.vue +57 -0
- package/components/modals/editor_layers_templates/editor-layers-templates.scss +36 -0
- package/components/modals/editor_layers_templates/editor-layers-templates.vue +90 -0
- package/components/modals/failed_conversion_modal/failed-conversion-modal.scss +18 -0
- package/components/modals/failed_conversion_modal/failed-conversion-modal.vue +182 -0
- package/components/modals/order_modal/order-modal.scss +7 -0
- package/components/modals/order_modal/order-modal.vue +359 -0
- package/components/modals/payment_modal/payment-modal.scss +57 -0
- package/components/modals/payment_modal/payment-modal.vue +313 -0
- package/components/news/news.scss +77 -0
- package/components/news/news.vue +52 -0
- package/components/news/news_list/news-list.scss +24 -0
- package/components/news/news_list/news-list.vue +38 -0
- package/components/news/news_list_item/news-list-item.scss +84 -0
- package/components/news/news_list_item/news-list-item.vue +70 -0
- package/components/order/order_approval/order-approval.scss +15 -0
- package/components/order/order_approval/order-approval.vue +84 -0
- package/components/order/order_approval/order_approval_message/order-approval-message.scss +1 -0
- package/components/order/order_approval/order_approval_message/order-approval-message.vue +82 -0
- package/components/order/order_entity/order-entity.scss +25 -0
- package/components/order/order_entity/order-entity.vue +76 -0
- package/components/order/order_entity/order_entity_side_layers/order-entity-side-layers.scss +14 -0
- package/components/order/order_entity/order_entity_side_layers/order-entity-side-layers.vue +84 -0
- package/components/order/order_main_info/order-main-info.scss +11 -0
- package/components/order/order_main_info/order-main-info.vue +115 -0
- package/components/order/order_price/order-price.scss +8 -0
- package/components/order/order_price/order-price.vue +67 -0
- package/components/order/order_prints_groups/order-prints-groups.scss +14 -0
- package/components/order/order_prints_groups/order-prints-groups.vue +127 -0
- package/components/order/order_products_groups/order-products-groups.scss +11 -0
- package/components/order/order_products_groups/order-products-groups.vue +129 -0
- package/components/order/order_products_groups/order_products_group/order-products-group.scss +28 -0
- package/components/order/order_products_groups/order_products_group/order-products-group.vue +129 -0
- package/components/order/order_setup_groups/order-setup-groups.scss +7 -0
- package/components/order/order_setup_groups/order-setup-groups.vue +99 -0
- package/components/order/order_sku_groups/order-sku-groups.scss +7 -0
- package/components/order/order_sku_groups/order-sku-groups.vue +125 -0
- package/components/order/order_status/order-status.scss +12 -0
- package/components/order/order_status/order-status.vue +77 -0
- package/components/order/order_timeline/order-timeline.scss +15 -0
- package/components/order/order_timeline/order-timeline.vue +76 -0
- package/components/order/order_tracking_numbers/order-tracking-numbers.scss +34 -0
- package/components/order/order_tracking_numbers/order-tracking-numbers.vue +161 -0
- package/components/order/order_view/order-view.mixin.js +51 -0
- package/components/order/order_view/order-view.scss +52 -0
- package/components/order/order_view/order-view.vue +145 -0
- package/components/order/order_view/order_product_color_simple_products/order-product-color-simple-products.mixin.js +37 -0
- package/components/order/order_view/order_product_color_simple_products/order-product-color-simple-products.scss +95 -0
- package/components/order/order_view/order_product_color_simple_products/order-product-color-simple-products.vue +88 -0
- package/components/order/order_view/order_product_color_simple_products/order_product_color_simple_product/order-product-color-simple-product.scss +32 -0
- package/components/order/order_view/order_product_color_simple_products/order_product_color_simple_product/order-product-color-simple-product.vue +27 -0
- package/components/order/order_view/order_product_prints/order-product-prints.scss +67 -0
- package/components/order/order_view/order_product_prints/order-product-prints.vue +60 -0
- package/components/order/order_view/order_product_prints/order_product_print/order-product-print.scss +31 -0
- package/components/order/order_view/order_product_prints/order_product_print/order-product-print.vue +78 -0
- package/components/order/order_view/order_view_product/order-view-product.scss +29 -0
- package/components/order/order_view/order_view_product/order-view-product.vue +110 -0
- package/components/pages/customer/confirm_email/confirm-email.vue +52 -0
- package/components/pages/customer/create/create.vue +41 -0
- package/components/pages/customer/recovery/recovery.vue +51 -0
- package/components/pages/customer/settings/settings.vue +39 -0
- package/components/pages/customer/sign_in/sign-in.vue +31 -0
- package/components/pricing/pricing_digital_printing/pricing-digital-printing.scss +248 -0
- package/components/pricing/pricing_digital_printing/pricing-digital-printing.vue +293 -0
- package/components/pricing/pricing_example/pricing-example.scss +79 -0
- package/components/pricing/pricing_example/pricing-example.vue +104 -0
- package/components/pricing/pricing_garment/pricing-garment.scss +73 -0
- package/components/pricing/pricing_garment/pricing-garment.vue +92 -0
- package/components/pricing/pricing_how_we_calculate/pricing-how-we-calculate.scss +44 -0
- package/components/pricing/pricing_how_we_calculate/pricing-how-we-calculate.vue +96 -0
- package/components/pricing/pricing_main_section/pricing-main-section.scss +54 -0
- package/components/pricing/pricing_main_section/pricing-main-section.vue +61 -0
- package/components/pricing/pricing_print/discounts_table/discounts-table.scss +8 -0
- package/components/pricing/pricing_print/discounts_table/discounts-table.vue +91 -0
- package/components/pricing/pricing_print/pricing-print.scss +28 -0
- package/components/pricing/pricing_print/pricing-print.vue +58 -0
- package/components/pricing/pricing_screen_print/discounts_table/discounts-table.scss +14 -0
- package/components/pricing/pricing_screen_print/discounts_table/discounts-table.vue +78 -0
- package/components/pricing/pricing_screen_print/pricing-screen-print.scss +8 -0
- package/components/pricing/pricing_screen_print/pricing-screen-print.vue +38 -0
- package/components/pricing/pricing_screen_printing/pricing-screen-printing.scss +253 -0
- package/components/pricing/pricing_screen_printing/pricing-screen-printing.vue +339 -0
- package/components/product/layouts/product_colors_selector/product-colors-selector.scss +15 -0
- package/components/product/layouts/product_colors_selector/product-colors-selector.vue +55 -0
- package/components/product/layouts/product_colors_selector/product_colors_selector_options/product-colors-selector-options.scss +67 -0
- package/components/product/layouts/product_colors_selector/product_colors_selector_options/product-colors-selector-options.vue +76 -0
- package/components/product/layouts/product_fabric_and_size_info/product-fabric-and-size-info.scss +24 -0
- package/components/product/layouts/product_fabric_and_size_info/product-fabric-and-size-info.vue +58 -0
- package/components/product/layouts/product_gallery/product-gallery.scss +39 -0
- package/components/product/layouts/product_gallery/product-gallery.vue +79 -0
- package/components/product/layouts/product_labels_customization/product-labels-customization.scss +61 -0
- package/components/product/layouts/product_labels_customization/product-labels-customization.vue +147 -0
- package/components/product/layouts/product_main_info/product-main-info.scss +22 -0
- package/components/product/layouts/product_main_info/product-main-info.vue +79 -0
- package/components/product/layouts/product_model_measurements/product-model-measurements.scss +18 -0
- package/components/product/layouts/product_model_measurements/product-model-measurements.vue +66 -0
- package/components/product/layouts/product_packaging/product-packaging.scss +32 -0
- package/components/product/layouts/product_packaging/product-packaging.vue +99 -0
- package/components/product/layouts/product_size_table/product-size-table.scss +23 -0
- package/components/product/layouts/product_size_table/product-size-table.vue +73 -0
- package/components/product/layouts/product_tier_prices/product-tier-prices.scss +23 -0
- package/components/product/layouts/product_tier_prices/product-tier-prices.vue +74 -0
- package/components/product/product.scss +24 -0
- package/components/product/product.vue +80 -0
- package/components/product/product_color_image/product-color-image.scss +8 -0
- package/components/product/product_color_image/product-color-image.vue +34 -0
- package/components/product/product_color_thumbnails/product-color-thumbnails.scss +61 -0
- package/components/product/product_color_thumbnails/product-color-thumbnails.vue +67 -0
- package/components/product/product_info_tabs/product-info-tabs.scss +24 -0
- package/components/product/product_info_tabs/product-info-tabs.vue +63 -0
- package/components/product/product_price_range/product-price-range.scss +0 -0
- package/components/product/product_price_range/product-price-range.vue +79 -0
- package/components/product/product_prints_price_info/product-prints-price-info.scss +25 -0
- package/components/product/product_prints_price_info/product-prints-price-info.vue +36 -0
- package/components/product/product_prints_price_info/product_print_price_info/product-print-price-info.scss +46 -0
- package/components/product/product_prints_price_info/product_print_price_info/product-print-price-info.vue +130 -0
- package/components/product/product_reviews/add_review/add-review.scss +42 -0
- package/components/product/product_reviews/add_review/add-review.vue +185 -0
- package/components/product/product_reviews/add_review_modal/add-review-modal.scss +5 -0
- package/components/product/product_reviews/add_review_modal/add-review-modal.vue +35 -0
- package/components/product/product_reviews/product-reviews.scss +68 -0
- package/components/product/product_reviews/product-reviews.vue +76 -0
- package/components/product/product_reviews/product_review/product-review.scss +47 -0
- package/components/product/product_reviews/product_review/product-review.vue +56 -0
- package/components/product/product_size_selector/product-size-selector.scss +13 -0
- package/components/product/product_size_selector/product-size-selector.vue +75 -0
- package/components/product/product_size_selector/product_size_selector_color/product-size-selector-color.scss +50 -0
- package/components/product/product_size_selector/product_size_selector_color/product-size-selector-color.vue +66 -0
- package/components/product/product_size_selector/product_size_selector_color/product_size_selector_color_cell/product-size-selector-color-cell.scss +60 -0
- package/components/product/product_size_selector/product_size_selector_color/product_size_selector_color_cell/product-size-selector-color-cell.vue +125 -0
- package/components/product/product_sizes_info/product-sizes-info.scss +55 -0
- package/components/product/product_sizes_info/product-sizes-info.vue +100 -0
- package/components/product/simple_products_price_info/simple-products-price-info.scss +19 -0
- package/components/product/simple_products_price_info/simple-products-price-info.vue +37 -0
- package/components/products/product_list/product-list.scss +47 -0
- package/components/products/product_list/product-list.vue +78 -0
- package/components/products/product_list_product/product-list-product.scss +124 -0
- package/components/products/product_list_product/product-list-product.vue +113 -0
- package/components/products/products_aside/products-aside.scss +14 -0
- package/components/products/products_aside/products-aside.vue +81 -0
- package/components/products/products_attributes/products-attributes.scss +27 -0
- package/components/products/products_attributes/products-attributes.vue +43 -0
- package/components/products/products_attributes/products_attribute/products-attribute.scss +28 -0
- package/components/products/products_attributes/products_attribute/products-attribute.vue +56 -0
- package/components/products/products_autocomplete/products-autocomplete.scss +54 -0
- package/components/products/products_autocomplete/products-autocomplete.vue +87 -0
- package/components/products/products_autocomplete/products_autocomplete-item/products-autocomplete-item.scss +0 -0
- package/components/products/products_autocomplete/products_autocomplete-item/products-autocomplete-item.vue +22 -0
- package/components/products/products_brands/products-brands.scss +28 -0
- package/components/products/products_brands/products-brands.vue +58 -0
- package/components/products/products_catalog/products-catalog.scss +43 -0
- package/components/products/products_catalog/products-catalog.vue +58 -0
- package/components/products/products_colors/products-colors.scss +59 -0
- package/components/products/products_colors/products-colors.vue +73 -0
- package/components/products/products_filters/products-filters.scss +50 -0
- package/components/products/products_filters/products-filters.vue +91 -0
- package/components/products/products_link/products-link.scss +0 -0
- package/components/products/products_link/products-link.vue +56 -0
- package/components/products/products_tags/products-tags.scss +34 -0
- package/components/products/products_tags/products-tags.vue +53 -0
- package/components/products/products_types/products-types.scss +37 -0
- package/components/products/products_types/products-types.vue +65 -0
- package/components/quotes/quote_request/quote-request.scss +146 -0
- package/components/quotes/quote_request/quote-request.vue +404 -0
- package/components/quotes/quote_request_modal/quote-request-modal.scss +5 -0
- package/components/quotes/quote_request_modal/quote-request-modal.vue +27 -0
- package/components/quotes/quote_view/quote-view.mixin.js +52 -0
- package/components/quotes/quote_view/quote-view.scss +16 -0
- package/components/quotes/quote_view/quote-view.vue +79 -0
- package/components/quotes/quote_view/quote_option_view/quote-option-view.scss +10 -0
- package/components/quotes/quote_view/quote_option_view/quote-option-view.vue +56 -0
- package/components/quotes/quote_view/quote_product_color_simple_products/quote-product-color-simple-products.mixin.js +37 -0
- package/components/quotes/quote_view/quote_product_color_simple_products/quote-product-color-simple-products.scss +95 -0
- package/components/quotes/quote_view/quote_product_color_simple_products/quote-product-color-simple-products.vue +88 -0
- package/components/quotes/quote_view/quote_product_color_simple_products/quote_product_color_simple_product/quote-product-color-simple-product.scss +32 -0
- package/components/quotes/quote_view/quote_product_color_simple_products/quote_product_color_simple_product/quote-product-color-simple-product.vue +27 -0
- package/components/quotes/quote_view/quote_product_prints/quote-product-prints.scss +67 -0
- package/components/quotes/quote_view/quote_product_prints/quote-product-prints.vue +60 -0
- package/components/quotes/quote_view/quote_product_prints/quote_product_print/quote-product-print.scss +31 -0
- package/components/quotes/quote_view/quote_product_prints/quote_product_print/quote-product-print.vue +78 -0
- package/components/quotes/quote_view/quote_view_product/quote-view-product.scss +29 -0
- package/components/quotes/quote_view/quote_view_product/quote-view-product.vue +122 -0
- package/components/static_page/static-page.scss +11 -0
- package/components/static_page/static-page.vue +26 -0
- package/components/subscribe/subscribe.scss +23 -0
- package/components/subscribe/subscribe.vue +124 -0
- package/components/the_aside/the-aside.scss +79 -0
- package/components/the_aside/the-aside.vue +95 -0
- package/components/the_breadcrumbs/the-breadcrumbs.scss +36 -0
- package/components/the_breadcrumbs/the-breadcrumbs.vue +78 -0
- package/components/the_changes_saved_indicator/the-changes-saved-indicator.scss +60 -0
- package/components/the_changes_saved_indicator/the-changes-saved-indicator.vue +55 -0
- package/components/the_footer/the-footer.scss +96 -0
- package/components/the_footer/the-footer.vue +86 -0
- package/components/the_navbar/the-navbar.scss +43 -0
- package/components/the_navbar/the-navbar.vue +45 -0
- package/middleware/notAuthenticated.js +5 -0
- package/middleware/page-info.js +11 -0
- package/middleware/setVH.js +11 -0
- package/mixins/confirm.js +39 -0
- package/mixins/meta-info.js +93 -0
- package/mixins/modals.js +117 -0
- package/mixins/payment.js +84 -0
- package/mixins/product-preview.js +69 -0
- package/mixins/products-price.js +82 -0
- package/nuxt.config.js +119 -0
- package/package.json +14 -8
- package/pages/quotes/view/_id.js +20 -0
- package/plugins/aos-animation.js +39 -0
- package/plugins/aos.js +12 -0
- package/plugins/directives.js +10 -0
- package/plugins/error-handler.js +6 -0
- package/plugins/global-components.js +14 -0
- package/plugins/jsonld.js +4 -0
- package/plugins/save-state.js +38 -0
- package/plugins/vee-validate.js +20 -0
- package/plugins/vue-click-outside.js +4 -0
- package/plugins/vue-color.js +4 -0
- package/plugins/vue-fragment.js +4 -0
- package/plugins/vue-hummer.js +7 -0
- package/plugins/vue-js-modal.js +15 -0
- package/plugins/vue-multiselect.js +4 -0
- package/plugins/vue-recaptcha.js +18 -0
- package/plugins/vue-tables-2.js +6 -0
- package/plugins/vue-toastr.js +7 -0
- package/plugins/vue-tooltip.js +4 -0
- package/static/fonts/archivo_black.woff2 +0 -0
- package/static/fonts/open_sans_bold.woff2 +0 -0
- package/static/fonts/orbitron_medium.woff +0 -0
- package/static/icons/arrow-left.svg +3 -0
- package/static/icons/arrow-right.svg +3 -0
- package/static/icons/back_hoodie.svg +3 -0
- package/static/icons/back_hoodie_a3.svg +4 -0
- package/static/icons/back_hoodie_a4_v.svg +4 -0
- package/static/icons/back_hoodie_half_a4_h.svg +4 -0
- package/static/icons/back_hoodie_rect10_l.svg +4 -0
- package/static/icons/back_polo.svg +3 -0
- package/static/icons/back_polo_a3.svg +4 -0
- package/static/icons/back_polo_a4_v.svg +4 -0
- package/static/icons/back_polo_half_a4_h.svg +4 -0
- package/static/icons/back_polo_rect10_l.svg +4 -0
- package/static/icons/back_tee.svg +3 -0
- package/static/icons/back_tee_a3.svg +4 -0
- package/static/icons/back_tee_a4_v.svg +4 -0
- package/static/icons/back_tee_half_a4_h.svg +4 -0
- package/static/icons/back_tee_rect10_l.svg +4 -0
- package/static/icons/calc_delivery_price.svg +13 -0
- package/static/icons/calc_print_price.svg +17 -0
- package/static/icons/calc_tee_price.svg +5 -0
- package/static/icons/calc_total_price.svg +6 -0
- package/static/icons/delivery.svg +12 -0
- package/static/icons/error.svg +4 -0
- package/static/icons/front_hoodie.svg +3 -0
- package/static/icons/front_hoodie_a3.svg +4 -0
- package/static/icons/front_hoodie_a4_v.svg +4 -0
- package/static/icons/front_hoodie_half_a4_h.svg +4 -0
- package/static/icons/front_hoodie_rect10_l.svg +4 -0
- package/static/icons/front_polo.svg +3 -0
- package/static/icons/front_polo_a3.svg +4 -0
- package/static/icons/front_polo_a4_v.svg +4 -0
- package/static/icons/front_polo_half_a4_h.svg +4 -0
- package/static/icons/front_polo_rect10_l.svg +4 -0
- package/static/icons/front_tee.svg +3 -0
- package/static/icons/front_tee_a3.svg +4 -0
- package/static/icons/front_tee_a4_v.svg +4 -0
- package/static/icons/front_tee_half_a4_h.svg +4 -0
- package/static/icons/front_tee_rect10_l.svg +4 -0
- package/static/icons/garments.svg +4 -0
- package/static/icons/general.svg +25 -0
- package/static/icons/other.svg +8 -0
- package/static/icons/printing.svg +9 -0
- package/static/icons/product_hoodie.svg +4 -0
- package/static/icons/product_polo.svg +4 -0
- package/static/icons/product_tee.svg +4 -0
- package/static/icons/rotate.png +0 -0
- package/static/icons/star_gray.svg +3 -0
- package/static/icons/star_green.svg +3 -0
- package/static/icons/success.svg +4 -0
- package/static/images/american-express.svg +8 -0
- package/static/images/catalog_bg.png +0 -0
- package/static/images/check.svg +51 -0
- package/static/images/fonts-bengali-sprite.png +0 -0
- package/static/images/fonts-gujarati-sprite.png +0 -0
- package/static/images/fonts-hebrew-sprite.png +0 -0
- package/static/images/fonts-hindi-sprite.png +0 -0
- package/static/images/fonts-kannada-sprite.png +0 -0
- package/static/images/fonts-malyalam-sprite.png +0 -0
- package/static/images/fonts-marathi-sprite.png +0 -0
- package/static/images/fonts-oriya-sprite.png +0 -0
- package/static/images/fonts-sprite.png +0 -0
- package/static/images/fonts-tamil-sprite.png +0 -0
- package/static/images/fonts-telugu-sprite.png +0 -0
- package/static/images/jcb.svg +8 -0
- package/static/images/logo.png +0 -0
- package/static/images/logo.svg +13 -0
- package/static/images/maestro.svg +11 -0
- package/static/images/mastercard.svg +23 -0
- package/static/images/measurements_model.svg +9 -0
- package/static/images/packaging_quantity.svg +8 -0
- package/static/images/packaging_size.svg +6 -0
- package/static/images/packaging_weight.svg +4 -0
- package/static/images/paid.svg +5 -0
- package/static/images/paypal.svg +9 -0
- package/static/images/price_calc_example.png +0 -0
- package/static/images/pricing-header.png +0 -0
- package/static/images/pricing_garment_tee.png +0 -0
- package/static/images/tear-away-tag.svg +5 -0
- package/static/images/tee.svg +4 -0
- package/static/images/tee_label_1.svg +4 -0
- package/static/images/tee_label_2.svg +8 -0
- package/static/images/tee_size.svg +9 -0
- package/static/images/tee_with_1_label.svg +11 -0
- package/static/images/tee_with_2_labels.svg +13 -0
- package/static/images/tee_with_no_labels.svg +5 -0
- package/static/images/trasnparent-pattern.png +0 -0
- package/static/images/type_here.png +0 -0
- package/static/images/visa.svg +13 -0
- package/static/images/watermark.png +0 -0
- package/store/auth.js +70 -0
- package/store/cart.js +154 -0
- package/store/index.js +108 -0
- package/store/layers.js +28 -0
- package/store/order.js +55 -0
- package/store/page.js +22 -0
- package/store/product.js +373 -0
- package/store/products.js +91 -0
- package/store/quote.js +72 -0
- package/lib/module.js +0 -57
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
|
|
2
|
+
import { fabric } from 'fabric';
|
|
3
|
+
import FileSaver from 'file-saver';
|
|
4
|
+
import { getFontPath } from '@lancom/shared/assets/js/utils/fonts-helper';
|
|
5
|
+
import { PIXELS_PER_CM } from '@lancom/shared/assets/js/models/print-area';
|
|
6
|
+
import { createObject } from './fabric/object-factory';
|
|
7
|
+
|
|
8
|
+
const sizes = [];
|
|
9
|
+
|
|
10
|
+
export function convertPrintToSVG(entity, sideId) {
|
|
11
|
+
return new Promise(resolve => {
|
|
12
|
+
const svgSize = getSVGSize(entity, sideId);
|
|
13
|
+
const canvas = new fabric.Canvas(document.createElement('canvas'), { ...svgSize, uniScaleTransform: false });
|
|
14
|
+
|
|
15
|
+
const sideLayers = getSideLayers(entity, sideId);
|
|
16
|
+
Promise.all(
|
|
17
|
+
sideLayers
|
|
18
|
+
.map(layer => {
|
|
19
|
+
if (layer.type === 'art') {
|
|
20
|
+
layer.url = layer.url.replace('thumb', 'origin');
|
|
21
|
+
layer._width = layer.width;
|
|
22
|
+
delete layer.width;
|
|
23
|
+
delete layer.height;
|
|
24
|
+
}
|
|
25
|
+
return layer;
|
|
26
|
+
})
|
|
27
|
+
.map(l => createObject(l, true))
|
|
28
|
+
).then(objects => {
|
|
29
|
+
objects.forEach(object => {
|
|
30
|
+
const zoom = svgSize.width / object.layer.printAreaSize.width;
|
|
31
|
+
let artOriginZoom = 1;
|
|
32
|
+
if (object.layer.type === 'art') {
|
|
33
|
+
artOriginZoom *= object.layer._width / object.width;
|
|
34
|
+
}
|
|
35
|
+
object.top *= zoom;
|
|
36
|
+
object.left *= zoom;
|
|
37
|
+
object.scaleY *= zoom * artOriginZoom;
|
|
38
|
+
object.scaleX *= zoom * artOriginZoom;
|
|
39
|
+
canvas.add(object);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
let svg = canvas.toSVG();
|
|
43
|
+
svg = insertFontsStyleToSvg(sideLayers, svg);
|
|
44
|
+
resolve(svg);
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function exportPrintToSVG(entity, sideId) {
|
|
50
|
+
convertPrintToSVG(entity, sideId).then(svg => {
|
|
51
|
+
const blob = new Blob([svg], { type: 'image/svg+xml' });
|
|
52
|
+
FileSaver.saveAs(blob, `${sideId}-${entity.guid}.svg`);
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
function getSVGSize(entity, sideId) {
|
|
57
|
+
const printArea = getPrintArea(entity, sideId);
|
|
58
|
+
const printSize = sizes[printArea];
|
|
59
|
+
return {
|
|
60
|
+
width: printSize[0] * PIXELS_PER_CM,
|
|
61
|
+
height: printSize[1] * PIXELS_PER_CM
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function getPrintArea(entity, sideId) {
|
|
66
|
+
const printAreas = entity.printAreas || {};
|
|
67
|
+
return printAreas[sideId];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function getSideLayers(entity, sideId) {
|
|
71
|
+
return (entity.layers || []).filter(layer => layer.sideId === sideId);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function insertFontsStyleToSvg(layers, svg) {
|
|
75
|
+
const fonts = [];
|
|
76
|
+
layers.filter(layer => layer.type === 'text')
|
|
77
|
+
.forEach(layer => {
|
|
78
|
+
if (!fonts.includes()) {
|
|
79
|
+
fonts.push(layer.fontFamily);
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
const css = fonts.reduce((style, font) => {
|
|
84
|
+
const fontPath = getFontPath(font);
|
|
85
|
+
if (fontPath) {
|
|
86
|
+
style += `
|
|
87
|
+
@font-face {
|
|
88
|
+
font-family: '${font}';
|
|
89
|
+
src: url('${fontPath}') format('truetype');
|
|
90
|
+
}
|
|
91
|
+
`;
|
|
92
|
+
}
|
|
93
|
+
return style;
|
|
94
|
+
}, '');
|
|
95
|
+
|
|
96
|
+
return svg.replace('</defs>', `<style type="text/css"><![CDATA[${css}]]></style></defs>`);
|
|
97
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
|
|
2
|
+
import { loadFont } from '@lancom/shared/assets/js/utils/fonts-helper';
|
|
3
|
+
|
|
4
|
+
const cacheImages = {};
|
|
5
|
+
const cacheFonts = {};
|
|
6
|
+
|
|
7
|
+
class FilesLoader {
|
|
8
|
+
loadImage(url) {
|
|
9
|
+
return new Promise(resolve => {
|
|
10
|
+
if (cacheImages[url]) {
|
|
11
|
+
return resolve(cacheImages[url]);
|
|
12
|
+
}
|
|
13
|
+
const img = new Image();
|
|
14
|
+
img.crossOrigin = 'anonymous';
|
|
15
|
+
img.addEventListener('load', () => {
|
|
16
|
+
cacheImages[url] = img;
|
|
17
|
+
resolve(img);
|
|
18
|
+
});
|
|
19
|
+
img.src = url;
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
loadFont(font) {
|
|
24
|
+
return new Promise(resolve => {
|
|
25
|
+
if (cacheFonts[font]) {
|
|
26
|
+
return resolve(cacheFonts[font]);
|
|
27
|
+
}
|
|
28
|
+
loadFont(font).then(() => {
|
|
29
|
+
cacheFonts[font] = true;
|
|
30
|
+
resolve(true);
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const filesLoader = new FilesLoader();
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
|
|
2
|
+
import { fabric } from 'fabric';
|
|
3
|
+
import { filesLoader } from './files-loader';
|
|
4
|
+
|
|
5
|
+
export function createObject(layer, isImageBase64) {
|
|
6
|
+
switch (layer.type) {
|
|
7
|
+
case 'art':
|
|
8
|
+
return createArt(layer, isImageBase64);
|
|
9
|
+
|
|
10
|
+
case 'text':
|
|
11
|
+
return createText(layer);
|
|
12
|
+
|
|
13
|
+
default:
|
|
14
|
+
return Promise.reject(new Error('Don\'t support this layer type'));
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function createText(layer) {
|
|
19
|
+
return filesLoader.loadFont(layer.fontFamily)
|
|
20
|
+
.then(() => {
|
|
21
|
+
const params = { ...layer, layer };
|
|
22
|
+
delete params.copy;
|
|
23
|
+
const copy = layer.copy.length ? layer.copy : '';
|
|
24
|
+
if (!layer.enableOutline) {
|
|
25
|
+
params.strokeWidth = 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return new fabric.IText(copy, params);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function createArt(layer, isImageBase64) {
|
|
33
|
+
return filesLoader.loadImage(layer.url)
|
|
34
|
+
.then(img => isImageBase64 ? getImageWithDataUrl(img) : Promise.resolve(img))
|
|
35
|
+
.then(img => new fabric.Image(img, { ...layer, layer }));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function getImageWithDataUrl(img) {
|
|
39
|
+
return new Promise(resolve => {
|
|
40
|
+
const canvas = document.createElement('canvas');
|
|
41
|
+
const ctx = canvas.getContext('2d');
|
|
42
|
+
canvas.width = img.width;
|
|
43
|
+
canvas.height = img.height;
|
|
44
|
+
ctx.drawImage(img, 0, 0);
|
|
45
|
+
|
|
46
|
+
const image = new Image();
|
|
47
|
+
image.addEventListener('load', () => resolve(image));
|
|
48
|
+
image.src = canvas.toDataURL();
|
|
49
|
+
});
|
|
50
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { fabric } from 'fabric';
|
|
2
|
+
|
|
3
|
+
let rotate;
|
|
4
|
+
|
|
5
|
+
export function loadRotateImage(cb = Function.prototype) {
|
|
6
|
+
const image = new Image();
|
|
7
|
+
image.src = '/icons/rotate.png';
|
|
8
|
+
image.onload = () => {
|
|
9
|
+
rotate = image;
|
|
10
|
+
cb();
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
fabric.Object.prototype.drawControls = function (ctx) {
|
|
15
|
+
if (!this.hasControls) {
|
|
16
|
+
return this;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const { x: width, y: height } = this._calculateCurrentDimensions();
|
|
20
|
+
const scaleOffset = this.cornerSize;
|
|
21
|
+
const left = -(width + scaleOffset) / 2;
|
|
22
|
+
const top = -(height + scaleOffset) / 2;
|
|
23
|
+
const methodName = this.transparentCorners ? 'stroke' : 'fill';
|
|
24
|
+
|
|
25
|
+
ctx.save();
|
|
26
|
+
|
|
27
|
+
ctx.strokeStyle = ctx.fillStyle = this.cornerColor;
|
|
28
|
+
if (!this.transparentCorners) {
|
|
29
|
+
ctx.strokeStyle = this.cornerStrokeColor;
|
|
30
|
+
}
|
|
31
|
+
this._setLineDash(ctx, this.cornerDashArray, null);
|
|
32
|
+
|
|
33
|
+
this._drawControl('tl', ctx, methodName, left, top);
|
|
34
|
+
this._drawControl('tr', ctx, methodName, left + width, top);
|
|
35
|
+
this._drawControl('bl', ctx, methodName, left, top + height);
|
|
36
|
+
this._drawControl('br', ctx, methodName, left + width, top + height);
|
|
37
|
+
|
|
38
|
+
if (!this.get('lockUniScaling')) {
|
|
39
|
+
this._drawControl('mt', ctx, methodName, left + width / 2, top);
|
|
40
|
+
this._drawControl('mb', ctx, methodName, left + width / 2, top + height);
|
|
41
|
+
this._drawControl('mr', ctx, methodName, left + width, top + height / 2);
|
|
42
|
+
this._drawControl('ml', ctx, methodName, left, top + height / 2);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (this.hasRotatingPoint) {
|
|
46
|
+
const rotateLeft = left + width / 2 - 4;
|
|
47
|
+
const rotateTop = top - this.rotatingPointOffset - 5;
|
|
48
|
+
const drawRotateIcon = () => ctx.drawImage(rotate, rotateLeft, rotateTop, 20, 20);
|
|
49
|
+
if (!rotate) {
|
|
50
|
+
loadRotateImage(drawRotateIcon);
|
|
51
|
+
} else {
|
|
52
|
+
drawRotateIcon();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
ctx.restore();
|
|
57
|
+
|
|
58
|
+
return this;
|
|
59
|
+
};
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
|
|
2
|
+
import { fabric } from 'fabric';
|
|
3
|
+
|
|
4
|
+
const sizes = [];
|
|
5
|
+
|
|
6
|
+
export const buildWireframe = ({ width, height, editor, area = 'a4_v', product }) => {
|
|
7
|
+
const layers = editor.getObjects();
|
|
8
|
+
const printAreaSize = layers[0].printAreaSize;
|
|
9
|
+
const group = new fabric.Group(layers);
|
|
10
|
+
const groupBounding = group.getBoundingRect();
|
|
11
|
+
const ratioX = (width / groupBounding.width) * 0.8;
|
|
12
|
+
const ratioY = (height / groupBounding.height) * 0.8;
|
|
13
|
+
const ratio = ratioX < ratioY ? ratioX : ratioY;
|
|
14
|
+
layers.forEach(layer => {
|
|
15
|
+
layer.set({ selectable: false });
|
|
16
|
+
});
|
|
17
|
+
const bounding = new fabric.Rect({
|
|
18
|
+
top: groupBounding.top,
|
|
19
|
+
left: groupBounding.left,
|
|
20
|
+
width: groupBounding.width * ratio,
|
|
21
|
+
height: groupBounding.height * ratio,
|
|
22
|
+
hasBorders: false,
|
|
23
|
+
hasControls: false,
|
|
24
|
+
lockMovementX: true,
|
|
25
|
+
lockMovementY: true,
|
|
26
|
+
evented: false,
|
|
27
|
+
strokeWidth: 2,
|
|
28
|
+
strokeDashArray: [8, 3],
|
|
29
|
+
stroke: '#343750',
|
|
30
|
+
fill: 'rgba(0, 0, 0, 0)',
|
|
31
|
+
selectable: false
|
|
32
|
+
});
|
|
33
|
+
group.scaleX = ratio;
|
|
34
|
+
group.scaleY = ratio;
|
|
35
|
+
group.set({
|
|
36
|
+
left: (width - (groupBounding.width * ratio)) / 2,
|
|
37
|
+
top: (height - (groupBounding.height * ratio)) / 2
|
|
38
|
+
});
|
|
39
|
+
bounding.set({
|
|
40
|
+
left: (width - (groupBounding.width * ratio)) / 2,
|
|
41
|
+
top: (height - (groupBounding.height * ratio)) / 2
|
|
42
|
+
});
|
|
43
|
+
const verticalLine = new fabric.Line(
|
|
44
|
+
[
|
|
45
|
+
bounding.left,
|
|
46
|
+
bounding.top + bounding.height,
|
|
47
|
+
bounding.left,
|
|
48
|
+
width
|
|
49
|
+
],
|
|
50
|
+
{
|
|
51
|
+
strokeWidth: 2,
|
|
52
|
+
strokeDashArray: [8, 3],
|
|
53
|
+
stroke: '#343750',
|
|
54
|
+
selectable: false
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
const horizontallLine = new fabric.Line(
|
|
58
|
+
[
|
|
59
|
+
bounding.left,
|
|
60
|
+
bounding.top + bounding.height,
|
|
61
|
+
0,
|
|
62
|
+
bounding.top + bounding.height
|
|
63
|
+
],
|
|
64
|
+
{
|
|
65
|
+
strokeWidth: 2,
|
|
66
|
+
strokeDashArray: [8, 3],
|
|
67
|
+
stroke: '#343750',
|
|
68
|
+
selectable: false
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
const getArrow = ([x1, y1, x2, y2], orientation) => {
|
|
72
|
+
const line = new fabric.Line(
|
|
73
|
+
[x1, y1, x2, y2],
|
|
74
|
+
{
|
|
75
|
+
strokeWidth: 2,
|
|
76
|
+
stroke: '#343750'
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
const triangle1 = new fabric.Triangle({
|
|
80
|
+
width: 16,
|
|
81
|
+
height: 20,
|
|
82
|
+
fill: '#343750',
|
|
83
|
+
left: orientation === 'v' ? x1 : x1 - 7.5,
|
|
84
|
+
top: orientation === 'v' ? y1 + 9.5 : y1 - 3,
|
|
85
|
+
angle: orientation === 'v' ? -90 : 0
|
|
86
|
+
});
|
|
87
|
+
const triangle2 = new fabric.Triangle({
|
|
88
|
+
width: 16,
|
|
89
|
+
height: 20,
|
|
90
|
+
fill: '#343750',
|
|
91
|
+
left: orientation === 'v' ? x2 + 3 : x2 + 9.5,
|
|
92
|
+
top: orientation === 'v' ? y2 - 7.5 : y2 + 3,
|
|
93
|
+
angle: orientation === 'v' ? 90 : 180
|
|
94
|
+
});
|
|
95
|
+
return new fabric.Group([line, triangle1, triangle2]);
|
|
96
|
+
};
|
|
97
|
+
const verticalArrow = getArrow([
|
|
98
|
+
bounding.left,
|
|
99
|
+
(bounding.top + bounding.height) + 20,
|
|
100
|
+
bounding.left + bounding.width,
|
|
101
|
+
(bounding.top + bounding.height) + 20
|
|
102
|
+
], 'v');
|
|
103
|
+
const horizontalArrow = getArrow([
|
|
104
|
+
bounding.left - 20,
|
|
105
|
+
bounding.top,
|
|
106
|
+
bounding.left - 20,
|
|
107
|
+
bounding.top + bounding.height
|
|
108
|
+
], 'h');
|
|
109
|
+
verticalArrow.set({ selectable: false });
|
|
110
|
+
horizontalArrow.set({ selectable: false });
|
|
111
|
+
const W = Math.round(groupBounding.width / printAreaSize.width * sizes[area][0]);
|
|
112
|
+
const H = Math.round(groupBounding.height / printAreaSize.height * sizes[area][1]);
|
|
113
|
+
const verticalSize = new fabric.Text(`H: ${H * 10}mm`, {
|
|
114
|
+
top: bounding.top + (bounding.height / 2),
|
|
115
|
+
left: 0,
|
|
116
|
+
fontSize: 22,
|
|
117
|
+
fill: '#343750',
|
|
118
|
+
fontFamily: 'poppins',
|
|
119
|
+
angle: -90,
|
|
120
|
+
selectable: false
|
|
121
|
+
});
|
|
122
|
+
const horizontalSize = new fabric.Text(`W: ${W * 10}mm`, {
|
|
123
|
+
top: (bounding.top + bounding.height) + 25,
|
|
124
|
+
left: bounding.left + (bounding.width / 2),
|
|
125
|
+
fontSize: 22,
|
|
126
|
+
fill: '#343750',
|
|
127
|
+
fontFamily: 'poppins',
|
|
128
|
+
selectable: false
|
|
129
|
+
});
|
|
130
|
+
verticalSize.set({
|
|
131
|
+
left: bounding.left - 25 - verticalSize.height
|
|
132
|
+
});
|
|
133
|
+
horizontalSize.set({
|
|
134
|
+
left: horizontalSize.left - horizontalSize.width / 2
|
|
135
|
+
});
|
|
136
|
+
editor.add(verticalLine);
|
|
137
|
+
editor.add(horizontallLine);
|
|
138
|
+
editor.add(verticalArrow);
|
|
139
|
+
editor.add(horizontalArrow);
|
|
140
|
+
editor.add(verticalSize);
|
|
141
|
+
editor.add(horizontalSize);
|
|
142
|
+
editor.add(bounding);
|
|
143
|
+
};
|