@gem-sdk/core 1.0.0
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/components/AddOn.js +18 -0
- package/dist/cjs/components/ComponentWrapper.js +45 -0
- package/dist/cjs/components/ComponentWrapperPreview.js +58 -0
- package/dist/cjs/components/Empty.js +7 -0
- package/dist/cjs/components/Render.js +28 -0
- package/dist/cjs/components/RenderBlock.js +21 -0
- package/dist/cjs/components/RenderPreview.js +28 -0
- package/dist/cjs/components/RenderSection.js +19 -0
- package/dist/cjs/contexts/AddonContext.js +25 -0
- package/dist/cjs/contexts/BuilderComponent.js +30 -0
- package/dist/cjs/contexts/BuilderContext.js +29 -0
- package/dist/cjs/contexts/BuilderPreviewContext.js +353 -0
- package/dist/cjs/contexts/CartLineContext.js +24 -0
- package/dist/cjs/contexts/CollectionContext.js +24 -0
- package/dist/cjs/contexts/ProductContext.js +126 -0
- package/dist/cjs/contexts/ProductListContext.js +24 -0
- package/dist/cjs/contexts/SectionContext.js +49 -0
- package/dist/cjs/contexts/ShopContext.js +43 -0
- package/dist/cjs/graphql/fragments/analytic.generated.js +11 -0
- package/dist/cjs/graphql/fragments/collection-detail.generated.js +13 -0
- package/dist/cjs/graphql/fragments/collection-product.generated.js +26 -0
- package/dist/cjs/graphql/fragments/data-seo.generated.js +11 -0
- package/dist/cjs/graphql/fragments/media.generated.js +14 -0
- package/dist/cjs/graphql/fragments/product-little.generated.js +25 -0
- package/dist/cjs/graphql/fragments/product-option-value.generated.js +13 -0
- package/dist/cjs/graphql/fragments/product-option.generated.js +14 -0
- package/dist/cjs/graphql/fragments/product.generated.js +33 -0
- package/dist/cjs/graphql/fragments/published-custom-section.generated.js +12 -0
- package/dist/cjs/graphql/fragments/published-page-section.generated.js +11 -0
- package/dist/cjs/graphql/fragments/published-theme-page.generated.js +27 -0
- package/dist/cjs/graphql/fragments/published-theme-style.generated.js +11 -0
- package/dist/cjs/graphql/fragments/selected-option.generated.js +11 -0
- package/dist/cjs/graphql/fragments/variant.generated.js +35 -0
- package/dist/cjs/graphql/queries/collection-detail-filter.generated.js +34 -0
- package/dist/cjs/graphql/queries/collection.generated.js +52 -0
- package/dist/cjs/graphql/queries/preview-page.generated.js +23 -0
- package/dist/cjs/graphql/queries/product-little-detail.generated.js +24 -0
- package/dist/cjs/graphql/queries/product-medias.generated.js +29 -0
- package/dist/cjs/graphql/queries/product-variants.generated.js +33 -0
- package/dist/cjs/graphql/queries/products.generated.js +41 -0
- package/dist/cjs/graphql/queries/published-theme-pages.generated.js +23 -0
- package/dist/cjs/graphql/queries/storeProperty.generated.js +12 -0
- package/dist/cjs/helpers/GlobalEvent.js +17 -0
- package/dist/cjs/helpers/background.js +104 -0
- package/dist/cjs/helpers/borders.js +138 -0
- package/dist/cjs/helpers/clone-deep.js +5 -0
- package/dist/cjs/helpers/cls.js +20 -0
- package/dist/cjs/helpers/colors.js +157 -0
- package/dist/cjs/helpers/compose-advance-style.js +132 -0
- package/dist/cjs/helpers/constant.js +17 -0
- package/dist/cjs/helpers/css-variable.js +7 -0
- package/dist/cjs/helpers/email.js +11 -0
- package/dist/cjs/helpers/flatten-connection.js +10 -0
- package/dist/cjs/helpers/fpixel.js +29 -0
- package/dist/cjs/helpers/get-resonsive-value.js +32 -0
- package/dist/cjs/helpers/get-shortname.js +92 -0
- package/dist/cjs/helpers/gtag.js +48 -0
- package/dist/cjs/helpers/is-browser.js +9 -0
- package/dist/cjs/helpers/is-defined.js +7 -0
- package/dist/cjs/helpers/is-empty-children.js +12 -0
- package/dist/cjs/helpers/layout.js +17 -0
- package/dist/cjs/helpers/load-script.js +32 -0
- package/dist/cjs/helpers/make-style.js +99 -0
- package/dist/cjs/helpers/normalize-builder-data.js +17 -0
- package/dist/cjs/helpers/prefetch-queries.js +68 -0
- package/dist/cjs/helpers/product.js +35 -0
- package/dist/cjs/helpers/queries/get-collection.js +173 -0
- package/dist/cjs/helpers/queries/get-product-by-slug.js +99 -0
- package/dist/cjs/helpers/queries/get-product.js +113 -0
- package/dist/cjs/helpers/queries/get-products.js +135 -0
- package/dist/cjs/helpers/radius.js +91 -0
- package/dist/cjs/helpers/shadow.js +48 -0
- package/dist/cjs/helpers/size.js +20 -0
- package/dist/cjs/helpers/spacing.js +45 -0
- package/dist/cjs/helpers/tiktokpixel.js +17 -0
- package/dist/cjs/helpers/typography.js +7 -0
- package/dist/cjs/hooks/cart/use-add-to-cart.js +20 -0
- package/dist/cjs/hooks/cart/use-cart-data.js +26 -0
- package/dist/cjs/hooks/cart/use-cart-discount-codes-update.js +20 -0
- package/dist/cjs/hooks/cart/use-cart-note-update.js +20 -0
- package/dist/cjs/hooks/cart/use-create-cart.js +22 -0
- package/dist/cjs/hooks/cart/use-remove-cart-item.js +20 -0
- package/dist/cjs/hooks/cart/use-update-cart-item.js +20 -0
- package/dist/cjs/hooks/shop/use-collection-query.js +16 -0
- package/dist/cjs/hooks/shop/use-product-query.js +16 -0
- package/dist/cjs/hooks/shop/use-products-query.js +16 -0
- package/dist/cjs/hooks/shop.js +80 -0
- package/dist/cjs/hooks/use-current-device.js +23 -0
- package/dist/cjs/hooks/use-lazy-video.js +15 -0
- package/dist/cjs/hooks/useCartId.js +36 -0
- package/dist/cjs/hooks/useCartLine.js +11 -0
- package/dist/cjs/hooks/useCartUI.js +42 -0
- package/dist/cjs/hooks/useCollection.js +9 -0
- package/dist/cjs/hooks/useFetchHandle.js +13 -0
- package/dist/cjs/hooks/useFormatMoney.js +17 -0
- package/dist/cjs/hooks/useIsomorphicLayoutEffect.js +10 -0
- package/dist/cjs/hooks/useLoadScript.js +30 -0
- package/dist/cjs/hooks/useMoney.js +52 -0
- package/dist/cjs/hooks/usePrevious.js +17 -0
- package/dist/cjs/hooks/useProduct.js +90 -0
- package/dist/cjs/hooks/useProductList.js +21 -0
- package/dist/cjs/hooks/useSuspenseFetch.js +24 -0
- package/dist/cjs/hooks/useSwatchesOptions.js +39 -0
- package/dist/cjs/index.js +229 -0
- package/dist/cjs/types/global-style.js +7 -0
- package/dist/cjs/types/shop.js +2 -0
- package/dist/esm/components/AddOn.js +14 -0
- package/dist/esm/components/ComponentWrapper.js +40 -0
- package/dist/esm/components/ComponentWrapperPreview.js +54 -0
- package/dist/esm/components/Empty.js +3 -0
- package/dist/esm/components/Render.js +24 -0
- package/dist/esm/components/RenderBlock.js +17 -0
- package/dist/esm/components/RenderPreview.js +24 -0
- package/dist/esm/components/RenderSection.js +15 -0
- package/dist/esm/contexts/AddonContext.js +21 -0
- package/dist/esm/contexts/BuilderComponent.js +27 -0
- package/dist/esm/contexts/BuilderContext.js +26 -0
- package/dist/esm/contexts/BuilderPreviewContext.js +350 -0
- package/dist/esm/contexts/CartLineContext.js +21 -0
- package/dist/esm/contexts/CollectionContext.js +20 -0
- package/dist/esm/contexts/ProductContext.js +123 -0
- package/dist/esm/contexts/ProductListContext.js +20 -0
- package/dist/esm/contexts/SectionContext.js +45 -0
- package/dist/esm/contexts/ShopContext.js +40 -0
- package/dist/esm/graphql/fragments/analytic.generated.js +9 -0
- package/dist/esm/graphql/fragments/collection-detail.generated.js +11 -0
- package/dist/esm/graphql/fragments/collection-product.generated.js +24 -0
- package/dist/esm/graphql/fragments/data-seo.generated.js +9 -0
- package/dist/esm/graphql/fragments/media.generated.js +12 -0
- package/dist/esm/graphql/fragments/product-little.generated.js +23 -0
- package/dist/esm/graphql/fragments/product-option-value.generated.js +11 -0
- package/dist/esm/graphql/fragments/product-option.generated.js +12 -0
- package/dist/esm/graphql/fragments/product.generated.js +31 -0
- package/dist/esm/graphql/fragments/published-custom-section.generated.js +10 -0
- package/dist/esm/graphql/fragments/published-page-section.generated.js +9 -0
- package/dist/esm/graphql/fragments/published-theme-page.generated.js +25 -0
- package/dist/esm/graphql/fragments/published-theme-style.generated.js +9 -0
- package/dist/esm/graphql/fragments/selected-option.generated.js +9 -0
- package/dist/esm/graphql/fragments/variant.generated.js +33 -0
- package/dist/esm/graphql/queries/collection-detail-filter.generated.js +32 -0
- package/dist/esm/graphql/queries/collection.generated.js +50 -0
- package/dist/esm/graphql/queries/preview-page.generated.js +21 -0
- package/dist/esm/graphql/queries/product-little-detail.generated.js +22 -0
- package/dist/esm/graphql/queries/product-medias.generated.js +27 -0
- package/dist/esm/graphql/queries/product-variants.generated.js +31 -0
- package/dist/esm/graphql/queries/products.generated.js +38 -0
- package/dist/esm/graphql/queries/published-theme-pages.generated.js +21 -0
- package/dist/esm/graphql/queries/storeProperty.generated.js +10 -0
- package/dist/esm/helpers/GlobalEvent.js +13 -0
- package/dist/esm/helpers/background.js +102 -0
- package/dist/esm/helpers/borders.js +133 -0
- package/dist/esm/helpers/clone-deep.js +3 -0
- package/dist/esm/helpers/cls.js +18 -0
- package/dist/esm/helpers/colors.js +145 -0
- package/dist/esm/helpers/compose-advance-style.js +130 -0
- package/dist/esm/helpers/constant.js +13 -0
- package/dist/esm/helpers/css-variable.js +5 -0
- package/dist/esm/helpers/email.js +6 -0
- package/dist/esm/helpers/flatten-connection.js +8 -0
- package/dist/esm/helpers/fpixel.js +25 -0
- package/dist/esm/helpers/get-resonsive-value.js +28 -0
- package/dist/esm/helpers/get-shortname.js +90 -0
- package/dist/esm/helpers/gtag.js +45 -0
- package/dist/esm/helpers/is-browser.js +5 -0
- package/dist/esm/helpers/is-defined.js +5 -0
- package/dist/esm/helpers/is-empty-children.js +7 -0
- package/dist/esm/helpers/layout.js +15 -0
- package/dist/esm/helpers/load-script.js +30 -0
- package/dist/esm/helpers/make-style.js +91 -0
- package/dist/esm/helpers/normalize-builder-data.js +15 -0
- package/dist/esm/helpers/prefetch-queries.js +66 -0
- package/dist/esm/helpers/product.js +32 -0
- package/dist/esm/helpers/queries/get-collection.js +170 -0
- package/dist/esm/helpers/queries/get-product-by-slug.js +97 -0
- package/dist/esm/helpers/queries/get-product.js +109 -0
- package/dist/esm/helpers/queries/get-products.js +133 -0
- package/dist/esm/helpers/radius.js +86 -0
- package/dist/esm/helpers/shadow.js +45 -0
- package/dist/esm/helpers/size.js +18 -0
- package/dist/esm/helpers/spacing.js +42 -0
- package/dist/esm/helpers/tiktokpixel.js +15 -0
- package/dist/esm/helpers/typography.js +5 -0
- package/dist/esm/hooks/cart/use-add-to-cart.js +18 -0
- package/dist/esm/hooks/cart/use-cart-data.js +24 -0
- package/dist/esm/hooks/cart/use-cart-discount-codes-update.js +18 -0
- package/dist/esm/hooks/cart/use-cart-note-update.js +18 -0
- package/dist/esm/hooks/cart/use-create-cart.js +20 -0
- package/dist/esm/hooks/cart/use-remove-cart-item.js +18 -0
- package/dist/esm/hooks/cart/use-update-cart-item.js +18 -0
- package/dist/esm/hooks/shop/use-collection-query.js +14 -0
- package/dist/esm/hooks/shop/use-product-query.js +14 -0
- package/dist/esm/hooks/shop/use-products-query.js +14 -0
- package/dist/esm/hooks/shop.js +68 -0
- package/dist/esm/hooks/use-current-device.js +21 -0
- package/dist/esm/hooks/use-lazy-video.js +13 -0
- package/dist/esm/hooks/useCartId.js +32 -0
- package/dist/esm/hooks/useCartLine.js +7 -0
- package/dist/esm/hooks/useCartUI.js +38 -0
- package/dist/esm/hooks/useCollection.js +7 -0
- package/dist/esm/hooks/useFetchHandle.js +11 -0
- package/dist/esm/hooks/useFormatMoney.js +13 -0
- package/dist/esm/hooks/useIsomorphicLayoutEffect.js +6 -0
- package/dist/esm/hooks/useLoadScript.js +26 -0
- package/dist/esm/hooks/useMoney.js +48 -0
- package/dist/esm/hooks/usePrevious.js +15 -0
- package/dist/esm/hooks/useProduct.js +78 -0
- package/dist/esm/hooks/useProductList.js +16 -0
- package/dist/esm/hooks/useSuspenseFetch.js +20 -0
- package/dist/esm/hooks/useSwatchesOptions.js +35 -0
- package/dist/esm/index.js +82 -0
- package/dist/esm/types/global-style.js +4 -0
- package/dist/esm/types/shop.js +1 -0
- package/dist/types/index.d.ts +7393 -0
- package/package.json +50 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var publishedThemePage_generated = require('../fragments/published-theme-page.generated.js');
|
|
4
|
+
var publishedPageSection_generated = require('../fragments/published-page-section.generated.js');
|
|
5
|
+
var publishedCustomSection_generated = require('../fragments/published-custom-section.generated.js');
|
|
6
|
+
var dataSeo_generated = require('../fragments/data-seo.generated.js');
|
|
7
|
+
var publishedThemeStyle_generated = require('../fragments/published-theme-style.generated.js');
|
|
8
|
+
var analytic_generated = require('../fragments/analytic.generated.js');
|
|
9
|
+
|
|
10
|
+
const PreviewPageDocument = `
|
|
11
|
+
query previewPage($handleURL: String, $pageType: PublishedThemePageType!) {
|
|
12
|
+
previewPage(handleURL: $handleURL, pageType: $pageType) {
|
|
13
|
+
...PublishedThemePageSelect
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
${publishedThemePage_generated.PublishedThemePageSelect}
|
|
17
|
+
${publishedPageSection_generated.PublishedPageSectionSelect}
|
|
18
|
+
${publishedCustomSection_generated.PublishedCustomSectionSelect}
|
|
19
|
+
${dataSeo_generated.DataSeoSelect}
|
|
20
|
+
${publishedThemeStyle_generated.PublishedThemeStyleSelect}
|
|
21
|
+
${analytic_generated.AnalyticSelect}`;
|
|
22
|
+
|
|
23
|
+
exports.PreviewPageDocument = PreviewPageDocument;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var productLittle_generated = require('../fragments/product-little.generated.js');
|
|
4
|
+
var productOption_generated = require('../fragments/product-option.generated.js');
|
|
5
|
+
var productOptionValue_generated = require('../fragments/product-option-value.generated.js');
|
|
6
|
+
var media_generated = require('../fragments/media.generated.js');
|
|
7
|
+
|
|
8
|
+
const ProductLittleDetailDocument = `
|
|
9
|
+
query productLittleDetail($orderBy: ProductOrder, $where: ProductWhereInput) {
|
|
10
|
+
product: products(first: 1, orderBy: $orderBy, where: $where) {
|
|
11
|
+
edges {
|
|
12
|
+
cursor
|
|
13
|
+
node {
|
|
14
|
+
...ProductLittleSelect
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
${productLittle_generated.ProductLittleSelect}
|
|
20
|
+
${productOption_generated.ProductOptionSelect}
|
|
21
|
+
${productOptionValue_generated.ProductOptionValueSelect}
|
|
22
|
+
${media_generated.MediaSelect}`;
|
|
23
|
+
|
|
24
|
+
exports.ProductLittleDetailDocument = ProductLittleDetailDocument;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var media_generated = require('../fragments/media.generated.js');
|
|
4
|
+
|
|
5
|
+
const ProductMediasDocument = `
|
|
6
|
+
query productMedias($firstMedia: Int = 50, $afterMedia: Cursor, $orderBy: ProductOrder, $where: ProductWhereInput) {
|
|
7
|
+
medias: products(first: 1, orderBy: $orderBy, where: $where) {
|
|
8
|
+
edges {
|
|
9
|
+
node {
|
|
10
|
+
id
|
|
11
|
+
medias(first: $firstMedia, after: $afterMedia) {
|
|
12
|
+
edges {
|
|
13
|
+
cursor
|
|
14
|
+
node {
|
|
15
|
+
...MediaSelect
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
pageInfo {
|
|
19
|
+
hasNextPage
|
|
20
|
+
endCursor
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
${media_generated.MediaSelect}`;
|
|
28
|
+
|
|
29
|
+
exports.ProductMediasDocument = ProductMediasDocument;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var variant_generated = require('../fragments/variant.generated.js');
|
|
4
|
+
var selectedOption_generated = require('../fragments/selected-option.generated.js');
|
|
5
|
+
var media_generated = require('../fragments/media.generated.js');
|
|
6
|
+
|
|
7
|
+
const ProductVariantsDocument = `
|
|
8
|
+
query productVariants($firstVariant: Int = 100, $afterVariant: Cursor, $orderBy: ProductOrder, $where: ProductWhereInput, $first: Int = 1) {
|
|
9
|
+
variants: products(first: $first, orderBy: $orderBy, where: $where) {
|
|
10
|
+
edges {
|
|
11
|
+
node {
|
|
12
|
+
id
|
|
13
|
+
variants(first: $firstVariant, after: $afterVariant) {
|
|
14
|
+
edges {
|
|
15
|
+
cursor
|
|
16
|
+
node {
|
|
17
|
+
...VariantSelect
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
pageInfo {
|
|
21
|
+
hasNextPage
|
|
22
|
+
endCursor
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
${variant_generated.VariantSelect}
|
|
30
|
+
${selectedOption_generated.SelectedOptionSelect}
|
|
31
|
+
${media_generated.MediaSelect}`;
|
|
32
|
+
|
|
33
|
+
exports.ProductVariantsDocument = ProductVariantsDocument;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var product_generated = require('../fragments/product.generated.js');
|
|
4
|
+
var productLittle_generated = require('../fragments/product-little.generated.js');
|
|
5
|
+
var productOption_generated = require('../fragments/product-option.generated.js');
|
|
6
|
+
var productOptionValue_generated = require('../fragments/product-option-value.generated.js');
|
|
7
|
+
var media_generated = require('../fragments/media.generated.js');
|
|
8
|
+
var variant_generated = require('../fragments/variant.generated.js');
|
|
9
|
+
var selectedOption_generated = require('../fragments/selected-option.generated.js');
|
|
10
|
+
|
|
11
|
+
const ProductsEdgeDetail = `
|
|
12
|
+
fragment ProductsEdgeDetail on ProductEdge {
|
|
13
|
+
cursor
|
|
14
|
+
node {
|
|
15
|
+
...ProductSelect
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
`;
|
|
19
|
+
const ProductsDocument = `
|
|
20
|
+
query products($first: Int, $where: ProductWhereInput, $firstMedia: Int, $orderBy: ProductOrder, $after: Cursor, $firstVariant: Int, $afterVariant: Cursor, $afterMedia: Cursor) {
|
|
21
|
+
products(first: $first, where: $where, orderBy: $orderBy, after: $after) {
|
|
22
|
+
edges {
|
|
23
|
+
...ProductsEdgeDetail
|
|
24
|
+
}
|
|
25
|
+
pageInfo {
|
|
26
|
+
endCursor
|
|
27
|
+
hasNextPage
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
${ProductsEdgeDetail}
|
|
32
|
+
${product_generated.ProductSelect}
|
|
33
|
+
${productLittle_generated.ProductLittleSelect}
|
|
34
|
+
${productOption_generated.ProductOptionSelect}
|
|
35
|
+
${productOptionValue_generated.ProductOptionValueSelect}
|
|
36
|
+
${media_generated.MediaSelect}
|
|
37
|
+
${variant_generated.VariantSelect}
|
|
38
|
+
${selectedOption_generated.SelectedOptionSelect}`;
|
|
39
|
+
|
|
40
|
+
exports.ProductsDocument = ProductsDocument;
|
|
41
|
+
exports.ProductsEdgeDetail = ProductsEdgeDetail;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var publishedThemePage_generated = require('../fragments/published-theme-page.generated.js');
|
|
4
|
+
var publishedPageSection_generated = require('../fragments/published-page-section.generated.js');
|
|
5
|
+
var publishedCustomSection_generated = require('../fragments/published-custom-section.generated.js');
|
|
6
|
+
var dataSeo_generated = require('../fragments/data-seo.generated.js');
|
|
7
|
+
var publishedThemeStyle_generated = require('../fragments/published-theme-style.generated.js');
|
|
8
|
+
var analytic_generated = require('../fragments/analytic.generated.js');
|
|
9
|
+
|
|
10
|
+
const PublishedThemePagesDocument = `
|
|
11
|
+
query publishedThemePages($slug: String, $slugType: PublishedThemePageType!) {
|
|
12
|
+
publishedThemePages(slug: $slug, slugType: $slugType) {
|
|
13
|
+
...PublishedThemePageSelect
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
${publishedThemePage_generated.PublishedThemePageSelect}
|
|
17
|
+
${publishedPageSection_generated.PublishedPageSectionSelect}
|
|
18
|
+
${publishedCustomSection_generated.PublishedCustomSectionSelect}
|
|
19
|
+
${dataSeo_generated.DataSeoSelect}
|
|
20
|
+
${publishedThemeStyle_generated.PublishedThemeStyleSelect}
|
|
21
|
+
${analytic_generated.AnalyticSelect}`;
|
|
22
|
+
|
|
23
|
+
exports.PublishedThemePagesDocument = PublishedThemePagesDocument;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const globalEvent = {
|
|
6
|
+
subscribe(callback) {
|
|
7
|
+
document.addEventListener('onDispatch', (e) => callback(e.detail));
|
|
8
|
+
},
|
|
9
|
+
dispatch(data) {
|
|
10
|
+
document.dispatchEvent(new CustomEvent('onDispatch', { detail: data }));
|
|
11
|
+
},
|
|
12
|
+
remove(callback) {
|
|
13
|
+
document.removeEventListener('onDispatch', callback);
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
exports.default = globalEvent;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var colors = require('./colors.js');
|
|
4
|
+
var makeStyle = require('./make-style.js');
|
|
5
|
+
|
|
6
|
+
const getStyleBackgroundByDevice = (background) => {
|
|
7
|
+
if (!background) {
|
|
8
|
+
return {};
|
|
9
|
+
}
|
|
10
|
+
return {
|
|
11
|
+
...getStyleBgColor(background),
|
|
12
|
+
...getStyleBgImage(background),
|
|
13
|
+
...getStyleBgPosition(background),
|
|
14
|
+
...getStyleBgSize(background),
|
|
15
|
+
...getStyleBgRepeat(background),
|
|
16
|
+
...getStyleBgAttachment(background),
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
const getStyleBgColor = (background) => {
|
|
20
|
+
const bgColor = {
|
|
21
|
+
desktop: getBgColorByDevice(background, 'desktop'),
|
|
22
|
+
tablet: getBgColorByDevice(background, 'tablet'),
|
|
23
|
+
mobile: getBgColorByDevice(background, 'mobile'),
|
|
24
|
+
};
|
|
25
|
+
return makeStyle.makeStyleResponsive('bgc', bgColor);
|
|
26
|
+
};
|
|
27
|
+
const getBgColorByDevice = (background, device) => {
|
|
28
|
+
return getColor(background?.[device]?.color);
|
|
29
|
+
};
|
|
30
|
+
const getColor = (color) => {
|
|
31
|
+
if (!color) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
if (colors.isColor(color?.toString())) {
|
|
35
|
+
return color;
|
|
36
|
+
}
|
|
37
|
+
return `var(--g-c-${color})`;
|
|
38
|
+
};
|
|
39
|
+
const getStyleBgImage = (background) => {
|
|
40
|
+
const bgImage = {
|
|
41
|
+
// desktop:
|
|
42
|
+
// background.desktop?.type === 'color' ? 'none' : getBgImageByDevice(background, 'desktop'),
|
|
43
|
+
// tablet: background.tablet?.type === 'color' ? 'none' : getBgImageByDevice(background, 'tablet'),
|
|
44
|
+
// mobile: background.mobile?.type === 'color' ? 'none' : getBgImageByDevice(background, 'mobile'),
|
|
45
|
+
desktop: getBgImageByDevice(background, 'desktop'),
|
|
46
|
+
tablet: getBgImageByDevice(background, 'tablet'),
|
|
47
|
+
mobile: getBgImageByDevice(background, 'mobile'),
|
|
48
|
+
};
|
|
49
|
+
return makeStyle.makeStyleResponsive('bgi', bgImage);
|
|
50
|
+
};
|
|
51
|
+
const getBgImageByDevice = (background, device) => {
|
|
52
|
+
const imageByDevice = background?.[device]?.image?.src;
|
|
53
|
+
if (typeof imageByDevice === 'string') {
|
|
54
|
+
return `url(${imageByDevice})`;
|
|
55
|
+
}
|
|
56
|
+
return;
|
|
57
|
+
};
|
|
58
|
+
const getStyleBgPosition = (background) => {
|
|
59
|
+
const bgPosition = {
|
|
60
|
+
desktop: getBgPositionByDevice(background, 'desktop'),
|
|
61
|
+
tablet: getBgPositionByDevice(background, 'tablet'),
|
|
62
|
+
mobile: getBgPositionByDevice(background, 'mobile'),
|
|
63
|
+
};
|
|
64
|
+
return makeStyle.makeStyleResponsive('bgp', bgPosition);
|
|
65
|
+
};
|
|
66
|
+
const getBgPositionByDevice = (background, device) => {
|
|
67
|
+
const positionByDevice = background?.[device]?.position;
|
|
68
|
+
return positionByDevice && `${positionByDevice.x}% ${positionByDevice.y}%`;
|
|
69
|
+
};
|
|
70
|
+
const getStyleBgSize = (background) => {
|
|
71
|
+
const bgSize = {
|
|
72
|
+
desktop: getBgSizeByDevice(background, 'desktop'),
|
|
73
|
+
tablet: getBgSizeByDevice(background, 'tablet'),
|
|
74
|
+
mobile: getBgSizeByDevice(background, 'mobile'),
|
|
75
|
+
};
|
|
76
|
+
return makeStyle.makeStyleResponsive('bgs', bgSize);
|
|
77
|
+
};
|
|
78
|
+
const getBgSizeByDevice = (background, device) => {
|
|
79
|
+
return background?.[device]?.size;
|
|
80
|
+
};
|
|
81
|
+
const getStyleBgRepeat = (background) => {
|
|
82
|
+
const bgRepeat = {
|
|
83
|
+
desktop: getBgRepeatByDevice(background, 'desktop'),
|
|
84
|
+
tablet: getBgRepeatByDevice(background, 'tablet'),
|
|
85
|
+
mobile: getBgRepeatByDevice(background, 'mobile'),
|
|
86
|
+
};
|
|
87
|
+
return makeStyle.makeStyleResponsive('bgr', bgRepeat);
|
|
88
|
+
};
|
|
89
|
+
const getBgRepeatByDevice = (background, device) => {
|
|
90
|
+
return background?.[device]?.repeat;
|
|
91
|
+
};
|
|
92
|
+
const getStyleBgAttachment = (background) => {
|
|
93
|
+
const bgAttachment = {
|
|
94
|
+
desktop: getBgAttachmentByDevice(background, 'desktop'),
|
|
95
|
+
tablet: getBgAttachmentByDevice(background, 'tablet'),
|
|
96
|
+
mobile: getBgAttachmentByDevice(background, 'mobile'),
|
|
97
|
+
};
|
|
98
|
+
return makeStyle.makeStyleResponsive('bga', bgAttachment);
|
|
99
|
+
};
|
|
100
|
+
const getBgAttachmentByDevice = (background, device) => {
|
|
101
|
+
return background?.[device]?.attachment;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
exports.getStyleBackgroundByDevice = getStyleBackgroundByDevice;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var colors = require('./colors.js');
|
|
4
|
+
var makeStyle = require('./make-style.js');
|
|
5
|
+
|
|
6
|
+
const handleConvertBorderStyle = (value) => {
|
|
7
|
+
if (!value)
|
|
8
|
+
return undefined;
|
|
9
|
+
if ('desktop' in value || 'tablet' in value || 'mobile' in value) {
|
|
10
|
+
const data = value;
|
|
11
|
+
const newVal = {
|
|
12
|
+
desktop: {
|
|
13
|
+
normal: data.desktop?.normal?.border,
|
|
14
|
+
hover: data.desktop?.hover?.border,
|
|
15
|
+
focus: data.desktop?.focus?.border,
|
|
16
|
+
},
|
|
17
|
+
tablet: {
|
|
18
|
+
normal: data.tablet?.normal?.border,
|
|
19
|
+
hover: data.tablet?.hover?.border,
|
|
20
|
+
focus: data.tablet?.focus?.border,
|
|
21
|
+
},
|
|
22
|
+
mobile: {
|
|
23
|
+
normal: data.mobile?.normal?.border,
|
|
24
|
+
hover: data.mobile?.hover?.border,
|
|
25
|
+
focus: data.mobile?.focus?.border,
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
return makeStyle.makeStyleResponsiveState('bs', newVal);
|
|
29
|
+
}
|
|
30
|
+
const data = value;
|
|
31
|
+
const newVal = {
|
|
32
|
+
normal: data?.normal?.border,
|
|
33
|
+
hover: data?.hover?.border,
|
|
34
|
+
focus: data?.focus?.border,
|
|
35
|
+
};
|
|
36
|
+
return makeStyle.makeStyleState('bs', newVal);
|
|
37
|
+
};
|
|
38
|
+
const handleConvertBorderWidth = (value) => {
|
|
39
|
+
if (!value)
|
|
40
|
+
return undefined;
|
|
41
|
+
if ('desktop' in value || 'tablet' in value || 'mobile' in value) {
|
|
42
|
+
const data = value;
|
|
43
|
+
const newVal = {
|
|
44
|
+
desktop: {
|
|
45
|
+
normal: data.desktop?.normal?.width,
|
|
46
|
+
hover: data.desktop?.hover?.width,
|
|
47
|
+
focus: data.desktop?.focus?.width,
|
|
48
|
+
},
|
|
49
|
+
tablet: {
|
|
50
|
+
normal: data.tablet?.normal?.width,
|
|
51
|
+
hover: data.tablet?.hover?.width,
|
|
52
|
+
focus: data.tablet?.focus?.width,
|
|
53
|
+
},
|
|
54
|
+
mobile: {
|
|
55
|
+
normal: data.mobile?.normal?.width,
|
|
56
|
+
hover: data.mobile?.hover?.width,
|
|
57
|
+
focus: data.mobile?.focus?.width,
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
return makeStyle.makeStyleResponsiveState('bw', newVal);
|
|
61
|
+
}
|
|
62
|
+
const data = value;
|
|
63
|
+
const newVal = {
|
|
64
|
+
normal: data?.normal?.width,
|
|
65
|
+
hover: data?.hover?.width,
|
|
66
|
+
focus: data?.focus?.width,
|
|
67
|
+
};
|
|
68
|
+
return makeStyle.makeStyleState('bw', newVal);
|
|
69
|
+
};
|
|
70
|
+
const handleConvertBorderColor = (value) => {
|
|
71
|
+
if (!value)
|
|
72
|
+
return undefined;
|
|
73
|
+
if ('desktop' in value || 'tablet' in value || 'mobile' in value) {
|
|
74
|
+
const data = value;
|
|
75
|
+
const newVal = {
|
|
76
|
+
desktop: {
|
|
77
|
+
normal: data.desktop?.normal?.color,
|
|
78
|
+
hover: data.desktop?.hover?.color,
|
|
79
|
+
focus: data.desktop?.focus?.color,
|
|
80
|
+
},
|
|
81
|
+
tablet: {
|
|
82
|
+
normal: data.tablet?.normal?.color,
|
|
83
|
+
hover: data.tablet?.hover?.color,
|
|
84
|
+
focus: data.tablet?.focus?.color,
|
|
85
|
+
},
|
|
86
|
+
mobile: {
|
|
87
|
+
normal: data.mobile?.normal?.color,
|
|
88
|
+
hover: data.mobile?.hover?.color,
|
|
89
|
+
focus: data.mobile?.focus?.color,
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
return colors.getGlobalColorStateResponsiveStyle('bc', newVal);
|
|
93
|
+
}
|
|
94
|
+
const data = value;
|
|
95
|
+
const newVal = {
|
|
96
|
+
normal: data?.normal?.color,
|
|
97
|
+
hover: data?.hover?.color,
|
|
98
|
+
focus: data?.focus?.color,
|
|
99
|
+
};
|
|
100
|
+
return colors.getGlobalColorStateStyle('bc', newVal);
|
|
101
|
+
};
|
|
102
|
+
const handleConvertClassColor = (value) => {
|
|
103
|
+
if (!value)
|
|
104
|
+
return undefined;
|
|
105
|
+
if ('desktop' in value || 'tablet' in value || 'mobile' in value) {
|
|
106
|
+
const data = value;
|
|
107
|
+
const newVal = {
|
|
108
|
+
desktop: {
|
|
109
|
+
normal: data.desktop?.normal?.color,
|
|
110
|
+
hover: data.desktop?.hover?.color,
|
|
111
|
+
focus: data.desktop?.focus?.color,
|
|
112
|
+
},
|
|
113
|
+
tablet: {
|
|
114
|
+
normal: data.tablet?.normal?.color,
|
|
115
|
+
hover: data.tablet?.hover?.color,
|
|
116
|
+
focus: data.tablet?.focus?.color,
|
|
117
|
+
},
|
|
118
|
+
mobile: {
|
|
119
|
+
normal: data.mobile?.normal?.color,
|
|
120
|
+
hover: data.mobile?.hover?.color,
|
|
121
|
+
focus: data.mobile?.focus?.color,
|
|
122
|
+
},
|
|
123
|
+
};
|
|
124
|
+
return colors.getGlobalColorStateResponsiveClass('border', newVal);
|
|
125
|
+
}
|
|
126
|
+
const data = value;
|
|
127
|
+
const newVal = {
|
|
128
|
+
normal: data?.normal?.color,
|
|
129
|
+
hover: data?.hover?.color,
|
|
130
|
+
focus: data?.focus?.color,
|
|
131
|
+
};
|
|
132
|
+
return colors.getGlobalColorStateClass('border', newVal);
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
exports.handleConvertBorderColor = handleConvertBorderColor;
|
|
136
|
+
exports.handleConvertBorderStyle = handleConvertBorderStyle;
|
|
137
|
+
exports.handleConvertBorderWidth = handleConvertBorderWidth;
|
|
138
|
+
exports.handleConvertClassColor = handleConvertClassColor;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function toVal(mix) {
|
|
4
|
+
if (typeof mix === 'string') {
|
|
5
|
+
return mix;
|
|
6
|
+
}
|
|
7
|
+
else if (typeof mix === 'object' && mix !== null) {
|
|
8
|
+
return Object.keys(mix)
|
|
9
|
+
.filter((key) => mix[key])
|
|
10
|
+
.join(' ');
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
function cls(...classes) {
|
|
17
|
+
return classes.map(toVal).filter(Boolean).join(' ');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
exports.cls = cls;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var isDefined = require('./is-defined.js');
|
|
4
|
+
var constant = require('./constant.js');
|
|
5
|
+
|
|
6
|
+
const getGlobalColorCSSProp = (color) => {
|
|
7
|
+
return getSingleColorVariable(color);
|
|
8
|
+
};
|
|
9
|
+
const getGlobalColorClass = (type, color) => {
|
|
10
|
+
if (typeof color !== 'string' ||
|
|
11
|
+
!color ||
|
|
12
|
+
color?.startsWith('#') ||
|
|
13
|
+
color?.startsWith('rgb') ||
|
|
14
|
+
color?.startsWith('hsl') ||
|
|
15
|
+
color?.startsWith('transparent'))
|
|
16
|
+
return '';
|
|
17
|
+
return `${type}-g-${color}`;
|
|
18
|
+
};
|
|
19
|
+
const getGlobalColorResponsiveClass = (type, data) => {
|
|
20
|
+
if (!data)
|
|
21
|
+
return '';
|
|
22
|
+
return Object.entries(data)
|
|
23
|
+
.map(([device, value]) => {
|
|
24
|
+
if (device === 'desktop') {
|
|
25
|
+
return getGlobalColorClass(type, value);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
return `${device}:${getGlobalColorClass(type, value)}`;
|
|
29
|
+
}
|
|
30
|
+
})
|
|
31
|
+
.join(' ');
|
|
32
|
+
};
|
|
33
|
+
const getGlobalColorStateClass = (type, data) => {
|
|
34
|
+
if (!data)
|
|
35
|
+
return '';
|
|
36
|
+
return Object.entries(data)
|
|
37
|
+
.map(([state, value]) => {
|
|
38
|
+
if (state === 'normal') {
|
|
39
|
+
return getGlobalColorClass(type, value);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
return `${state}:${getGlobalColorClass(type, value)}`;
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
.join(' ');
|
|
46
|
+
};
|
|
47
|
+
const getGlobalColorStateResponsiveClass = (type, data) => {
|
|
48
|
+
if (!data)
|
|
49
|
+
return '';
|
|
50
|
+
return Object.entries(data)
|
|
51
|
+
.map(([device, objectState]) => {
|
|
52
|
+
if (device === 'desktop') {
|
|
53
|
+
return Object.entries(objectState)
|
|
54
|
+
.map(([state, value]) => {
|
|
55
|
+
if (state === 'normal') {
|
|
56
|
+
return getGlobalColorClass(type, value);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
return `${state}:${getGlobalColorClass(type, value)}`;
|
|
60
|
+
}
|
|
61
|
+
})
|
|
62
|
+
.join(' ');
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
return Object.entries(objectState)
|
|
66
|
+
.map(([state, value]) => {
|
|
67
|
+
if (state === 'normal') {
|
|
68
|
+
return `${device}:${getGlobalColorClass(type, value)}`;
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
return `${device}:${state}:${getGlobalColorClass(type, value)}`;
|
|
72
|
+
}
|
|
73
|
+
})
|
|
74
|
+
.join(' ');
|
|
75
|
+
}
|
|
76
|
+
})
|
|
77
|
+
.join(' ');
|
|
78
|
+
};
|
|
79
|
+
const getGlobalColorResponsiveStyle = (type, data) => {
|
|
80
|
+
if (!data)
|
|
81
|
+
return {};
|
|
82
|
+
return Object.fromEntries(Object.entries(data).map(([device, value]) => {
|
|
83
|
+
if (device === 'desktop') {
|
|
84
|
+
return [`--${type}`, getSingleColorVariable(value)];
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
return [`--${type}-${device}`, getSingleColorVariable(value)];
|
|
88
|
+
}
|
|
89
|
+
}));
|
|
90
|
+
};
|
|
91
|
+
const getGlobalColorStateStyle = (type, data) => {
|
|
92
|
+
if (!data)
|
|
93
|
+
return {};
|
|
94
|
+
return Object.fromEntries(Object.entries(data)
|
|
95
|
+
.map(([state, value]) => {
|
|
96
|
+
if (state === 'active')
|
|
97
|
+
return [];
|
|
98
|
+
return [`-${constant.stateMapping?.[state]}-${type}`, getSingleColorVariable(value)];
|
|
99
|
+
})
|
|
100
|
+
.filter(isDefined.isDefined));
|
|
101
|
+
};
|
|
102
|
+
const getGlobalColorStateResponsiveStyle = (type, data) => {
|
|
103
|
+
if (!data)
|
|
104
|
+
return {};
|
|
105
|
+
return Object.entries(data)
|
|
106
|
+
.map(([device, objectState]) => {
|
|
107
|
+
if (device === 'desktop') {
|
|
108
|
+
return Object.fromEntries(Object.entries(objectState)
|
|
109
|
+
.map(([state, value]) => {
|
|
110
|
+
if (state === 'active')
|
|
111
|
+
return [];
|
|
112
|
+
return [`-${constant.stateMapping[state]}-${type}`, getSingleColorVariable(value)];
|
|
113
|
+
})
|
|
114
|
+
.filter(isDefined.isDefined));
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
return Object.fromEntries(Object.entries(objectState)
|
|
118
|
+
.map(([state, value]) => {
|
|
119
|
+
if (state === 'active')
|
|
120
|
+
return [];
|
|
121
|
+
return [`-${constant.stateMapping[state]}-${type}-${device}`, getSingleColorVariable(value)];
|
|
122
|
+
})
|
|
123
|
+
.filter(isDefined.isDefined));
|
|
124
|
+
}
|
|
125
|
+
})
|
|
126
|
+
.reduce((acc, curr) => ({ ...acc, ...curr }), {});
|
|
127
|
+
};
|
|
128
|
+
const getSingleColorVariable = (color) => {
|
|
129
|
+
if (!color)
|
|
130
|
+
return undefined;
|
|
131
|
+
if (isColor(color))
|
|
132
|
+
return color;
|
|
133
|
+
return `var(--g-c-${color}, ${color})`;
|
|
134
|
+
};
|
|
135
|
+
function isColor(color) {
|
|
136
|
+
return (color?.startsWith('#') ||
|
|
137
|
+
color?.startsWith('rgb') ||
|
|
138
|
+
color?.startsWith('hsl') ||
|
|
139
|
+
color?.startsWith('transparent'));
|
|
140
|
+
}
|
|
141
|
+
const getGlobalColorStyle = (data) => {
|
|
142
|
+
if (!data)
|
|
143
|
+
return {};
|
|
144
|
+
return { '--c': getSingleColorVariable(data) };
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
exports.getGlobalColorCSSProp = getGlobalColorCSSProp;
|
|
148
|
+
exports.getGlobalColorClass = getGlobalColorClass;
|
|
149
|
+
exports.getGlobalColorResponsiveClass = getGlobalColorResponsiveClass;
|
|
150
|
+
exports.getGlobalColorResponsiveStyle = getGlobalColorResponsiveStyle;
|
|
151
|
+
exports.getGlobalColorStateClass = getGlobalColorStateClass;
|
|
152
|
+
exports.getGlobalColorStateResponsiveClass = getGlobalColorStateResponsiveClass;
|
|
153
|
+
exports.getGlobalColorStateResponsiveStyle = getGlobalColorStateResponsiveStyle;
|
|
154
|
+
exports.getGlobalColorStateStyle = getGlobalColorStateStyle;
|
|
155
|
+
exports.getGlobalColorStyle = getGlobalColorStyle;
|
|
156
|
+
exports.getSingleColorVariable = getSingleColorVariable;
|
|
157
|
+
exports.isColor = isColor;
|