@automattic/plans-grid-next 1.0.0 → 1.0.1
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/__mocks__/wpcom-proxy-request.js +3 -4
- package/dist/cjs/__mocks__/wpcom-proxy-request.js.map +1 -1
- package/dist/cjs/_shared.scss +9 -4
- package/dist/cjs/components/comparison-grid/index.js +18 -29
- package/dist/cjs/components/comparison-grid/index.js.map +1 -1
- package/dist/cjs/components/comparison-grid/index.stories.js +1 -0
- package/dist/cjs/components/comparison-grid/index.stories.js.map +1 -1
- package/dist/cjs/components/comparison-grid/style.scss +0 -17
- package/dist/cjs/components/dropdown-option.js +1 -1
- package/dist/cjs/components/features-grid/index.js +21 -6
- package/dist/cjs/components/features-grid/index.js.map +1 -1
- package/dist/cjs/components/features-grid/index.stories.js +1 -0
- package/dist/cjs/components/features-grid/index.stories.js.map +1 -1
- package/dist/cjs/components/features-grid/style.scss +2 -19
- package/dist/cjs/components/item.js +1 -2
- package/dist/cjs/components/item.js.map +1 -1
- package/dist/cjs/components/plan-button/style.scss +8 -7
- package/dist/cjs/components/plan-type-selector/hooks/use-interval-options.js +1 -1
- package/dist/cjs/components/plan-type-selector/hooks/use-interval-options.js.map +1 -1
- package/dist/cjs/components/plan-type-selector/hooks/use-max-discount.js +1 -1
- package/dist/cjs/components/plan-type-selector/hooks/use-max-discount.js.map +1 -1
- package/dist/cjs/components/plan-type-selector/hooks/use-max-discounts-for-plan-terms.js +1 -1
- package/dist/cjs/components/plan-type-selector/hooks/use-max-discounts-for-plan-terms.js.map +1 -1
- package/dist/cjs/components/plan-type-selector/style.scss +3 -1
- package/dist/cjs/components/shared/billing-timeframe/index.js +13 -5
- package/dist/cjs/components/shared/billing-timeframe/index.js.map +1 -1
- package/dist/cjs/components/shared/header-price/style.scss +2 -2
- package/dist/cjs/components/shared/storage/hooks/use-default-storage-option.js +1 -1
- package/dist/cjs/components/shared/storage/hooks/use-default-storage-option.js.map +1 -1
- package/dist/cjs/components/shared/storage/hooks/use-purchased-storage-add-on.js +1 -1
- package/dist/cjs/components/shared/storage/hooks/use-purchased-storage-add-on.js.map +1 -1
- package/dist/cjs/components/shared/storage/index.js +3 -2
- package/dist/cjs/components/shared/storage/index.js.map +1 -1
- package/dist/cjs/components/sticky-container.js +66 -6
- package/dist/cjs/components/sticky-container.js.map +1 -1
- package/dist/cjs/hooks/data-store/is-popular-plan.js +1 -2
- package/dist/cjs/hooks/data-store/is-popular-plan.js.map +1 -1
- package/dist/cjs/hooks/data-store/use-grid-plans-for-features-grid.js +14 -11
- package/dist/cjs/hooks/data-store/use-grid-plans-for-features-grid.js.map +1 -1
- package/dist/cjs/hooks/data-store/use-plan-billing-description.js +2 -2
- package/dist/cjs/hooks/data-store/use-plan-billing-description.js.map +1 -1
- package/dist/cjs/hooks/use-grid-size.js +2 -4
- package/dist/cjs/hooks/use-grid-size.js.map +1 -1
- package/dist/cjs/hooks/use-is-large-currency.js +1 -1
- package/dist/cjs/hooks/use-is-large-currency.js.map +1 -1
- package/dist/cjs/hooks/use-manage-tooltip-toggle.js +1 -2
- package/dist/cjs/hooks/use-manage-tooltip-toggle.js.map +1 -1
- package/dist/cjs/hooks/use-plan-pricing-info-from-grid-plans.js +1 -2
- package/dist/cjs/hooks/use-plan-pricing-info-from-grid-plans.js.map +1 -1
- package/dist/cjs/lib/get-plan-pricing-info-from-grid-plans.js +1 -2
- package/dist/cjs/lib/get-plan-pricing-info-from-grid-plans.js.map +1 -1
- package/dist/cjs/lib/is-same-plan.js +1 -2
- package/dist/cjs/lib/is-same-plan.js.map +1 -1
- package/dist/cjs/lib/sort-plan-properties.js +19 -32
- package/dist/cjs/lib/sort-plan-properties.js.map +1 -1
- package/dist/cjs/lib/touch-detect/index.js +1 -2
- package/dist/cjs/lib/touch-detect/index.js.map +1 -1
- package/dist/esm/_shared.scss +9 -4
- package/dist/esm/components/comparison-grid/index.js +18 -29
- package/dist/esm/components/comparison-grid/index.js.map +1 -1
- package/dist/esm/components/comparison-grid/index.stories.js +1 -0
- package/dist/esm/components/comparison-grid/index.stories.js.map +1 -1
- package/dist/esm/components/comparison-grid/style.scss +0 -17
- package/dist/esm/components/dropdown-option.js +1 -1
- package/dist/esm/components/features-grid/index.js +21 -6
- package/dist/esm/components/features-grid/index.js.map +1 -1
- package/dist/esm/components/features-grid/index.stories.js +1 -0
- package/dist/esm/components/features-grid/index.stories.js.map +1 -1
- package/dist/esm/components/features-grid/style.scss +2 -19
- package/dist/esm/components/plan-button/style.scss +8 -7
- package/dist/esm/components/plan-type-selector/style.scss +3 -1
- package/dist/esm/components/shared/billing-timeframe/index.js +14 -6
- package/dist/esm/components/shared/billing-timeframe/index.js.map +1 -1
- package/dist/esm/components/shared/header-price/style.scss +2 -2
- package/dist/esm/components/sticky-container.js +66 -5
- package/dist/esm/components/sticky-container.js.map +1 -1
- package/dist/esm/hooks/data-store/use-grid-plans-for-features-grid.js +14 -11
- package/dist/esm/hooks/data-store/use-grid-plans-for-features-grid.js.map +1 -1
- package/dist/esm/hooks/data-store/use-plan-billing-description.js +1 -1
- package/dist/esm/hooks/use-grid-size.js +0 -1
- package/dist/esm/hooks/use-grid-size.js.map +1 -1
- package/dist/esm/lib/sort-plan-properties.js +18 -30
- package/dist/esm/lib/sort-plan-properties.js.map +1 -1
- package/dist/tsconfig-cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/components/comparison-grid/index.d.ts +1 -1
- package/dist/types/components/comparison-grid/index.d.ts.map +1 -1
- package/dist/types/components/comparison-grid/index.stories.d.ts +3 -1
- package/dist/types/components/comparison-grid/index.stories.d.ts.map +1 -1
- package/dist/types/components/dropdown-option.d.ts +0 -1
- package/dist/types/components/dropdown-option.d.ts.map +1 -1
- package/dist/types/components/features-grid/client-logo-list/client-list.d.ts +0 -1
- package/dist/types/components/features-grid/client-logo-list/client-list.d.ts.map +1 -1
- package/dist/types/components/features-grid/client-logo-list/index.d.ts.map +1 -1
- package/dist/types/components/features-grid/index.d.ts.map +1 -1
- package/dist/types/components/features-grid/index.stories.d.ts +5 -1
- package/dist/types/components/features-grid/index.stories.d.ts.map +1 -1
- package/dist/types/components/plan-button/index.d.ts +10 -10
- package/dist/types/components/plan-button/index.d.ts.map +1 -1
- package/dist/types/components/plan-div-td-container.d.ts +0 -1
- package/dist/types/components/plan-div-td-container.d.ts.map +1 -1
- package/dist/types/components/plan-logo.d.ts +0 -1
- package/dist/types/components/plan-logo.d.ts.map +1 -1
- package/dist/types/components/plan-type-selector/components/interval-type-dropdown.d.ts +0 -1
- package/dist/types/components/plan-type-selector/components/interval-type-dropdown.d.ts.map +1 -1
- package/dist/types/components/plan-type-selector/components/interval-type-selector.d.ts +0 -1
- package/dist/types/components/plan-type-selector/components/interval-type-selector.d.ts.map +1 -1
- package/dist/types/components/plan-type-selector/hooks/use-max-discounts-for-plan-terms.d.ts.map +1 -1
- package/dist/types/components/popular-badge.d.ts +0 -1
- package/dist/types/components/popular-badge.d.ts.map +1 -1
- package/dist/types/components/shared/billing-timeframe/index.d.ts.map +1 -1
- package/dist/types/components/shared/header-price/header-price-context.d.ts +0 -1
- package/dist/types/components/shared/header-price/header-price-context.d.ts.map +1 -1
- package/dist/types/components/shared/storage/hooks/use-storage-string.d.ts +0 -1
- package/dist/types/components/shared/storage/hooks/use-storage-string.d.ts.map +1 -1
- package/dist/types/components/sticky-container.d.ts +22 -0
- package/dist/types/components/sticky-container.d.ts.map +1 -1
- package/dist/types/grid-context.d.ts +0 -1
- package/dist/types/grid-context.d.ts.map +1 -1
- package/dist/types/hooks/data-store/types.d.ts +1 -0
- package/dist/types/hooks/data-store/types.d.ts.map +1 -1
- package/dist/types/hooks/data-store/use-grid-plans-for-features-grid.d.ts +1 -1
- package/dist/types/hooks/data-store/use-grid-plans-for-features-grid.d.ts.map +1 -1
- package/dist/types/hooks/data-store/use-grid-plans.d.ts +1 -1
- package/dist/types/hooks/data-store/use-grid-plans.d.ts.map +1 -1
- package/dist/types/hooks/data-store/use-highlight-labels.d.ts +0 -1
- package/dist/types/hooks/data-store/use-highlight-labels.d.ts.map +1 -1
- package/dist/types/hooks/data-store/use-plan-billing-description.d.ts +0 -1
- package/dist/types/hooks/data-store/use-plan-billing-description.d.ts.map +1 -1
- package/dist/types/hooks/use-grid-size.d.ts +0 -1
- package/dist/types/hooks/use-grid-size.d.ts.map +1 -1
- package/dist/types/lib/get-plan-features-object.d.ts.map +1 -1
- package/dist/types/lib/sort-plan-properties.d.ts +1 -1
- package/dist/types/lib/sort-plan-properties.d.ts.map +1 -1
- package/dist/types/types.d.ts +1 -1
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +14 -14
- package/src/_shared.scss +9 -4
- package/src/components/comparison-grid/index.stories.tsx +1 -0
- package/src/components/comparison-grid/index.tsx +19 -33
- package/src/components/comparison-grid/style.scss +0 -17
- package/src/components/dropdown-option.tsx +1 -1
- package/src/components/features-grid/index.stories.tsx +1 -0
- package/src/components/features-grid/index.tsx +21 -9
- package/src/components/features-grid/style.scss +2 -19
- package/src/components/plan-button/style.scss +8 -7
- package/src/components/plan-type-selector/style.scss +3 -1
- package/src/components/shared/billing-timeframe/index.tsx +15 -7
- package/src/components/shared/header-price/style.scss +2 -2
- package/src/components/sticky-container.tsx +74 -3
- package/src/components/test/billing-timeframe.tsx +2 -2
- package/src/hooks/data-store/types.ts +1 -0
- package/src/hooks/data-store/use-grid-plans-for-features-grid.ts +14 -10
- package/src/hooks/data-store/use-plan-billing-description.tsx +1 -1
- package/src/hooks/use-grid-size.ts +0 -1
- package/src/lib/sort-plan-properties.ts +18 -37
- package/src/lib/test/sort-plan-properties.ts +50 -32
- package/src/types.ts +1 -0
|
@@ -45,11 +45,19 @@ const BillingTimeframe = ({ showRefundPeriod, planSlug }) => {
|
|
|
45
45
|
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { children: billingTimeframe }), (0, jsx_runtime_1.jsx)(DiscountPromotion, { children: planBillingDescription })] }));
|
|
46
46
|
}
|
|
47
47
|
if ((0, calypso_products_1.isWpcomEnterpriseGridPlan)(planSlug)) {
|
|
48
|
-
const price = (0, i18n_calypso_1.formatCurrency)(25000, 'USD');
|
|
49
|
-
return ((0, jsx_runtime_1.jsx)("div", {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
const price = (0, i18n_calypso_1.formatCurrency)(25000, 'USD', { stripZeros: true });
|
|
49
|
+
return ((0, jsx_runtime_1.jsx)("div", { children: (0, i18n_calypso_1.fixMe)({
|
|
50
|
+
text: 'Starts at {{b}}%(price)s{{/b}} annually',
|
|
51
|
+
newCopy: translate('Starts at {{b}}%(price)s{{/b}} annually', {
|
|
52
|
+
args: { price },
|
|
53
|
+
components: { b: (0, jsx_runtime_1.jsx)("b", {}) },
|
|
54
|
+
comment: 'Translators: the price is in US dollars for all users (US$25,000)',
|
|
55
|
+
}),
|
|
56
|
+
oldCopy: translate('Starts at {{b}}%(price)s{{/b}} yearly', {
|
|
57
|
+
args: { price },
|
|
58
|
+
components: { b: (0, jsx_runtime_1.jsx)("b", {}) },
|
|
59
|
+
comment: 'Translators: the price is in US dollars for all users (US$25,000)',
|
|
60
|
+
}),
|
|
53
61
|
}) }));
|
|
54
62
|
}
|
|
55
63
|
return ((0, jsx_runtime_1.jsxs)("div", { children: [description, (0, jsx_runtime_1.jsx)(RefundNotice, { showRefundPeriod: showRefundPeriod, planSlug: planSlug, billingPeriod: billingPeriod })] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/shared/billing-timeframe/index.tsx"],"names":[],"mappings":";;;;AAAA,mEAKsC;AACtC,qEAAqC;AACrC,+
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/shared/billing-timeframe/index.tsx"],"names":[],"mappings":";;;;AAAA,mEAKsC;AACtC,qEAAqC;AACrC,+CAAmE;AACnE,wDAA4D;AAC5D,k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I,UAAU,CAAC,eAAe,CAAE,EAC7C,CAAC;QACF,OAAO,CACN,4CACC,0CAAO,gBAAgB,GAAQ,EAC/B,uBAAC,iBAAiB,cAAG,sBAAsB,GAAsB,IAC5D,CACN,CAAC;IACH,CAAC;IAED,IAAK,IAAA,4CAAyB,EAAE,QAAQ,CAAE,EAAG,CAAC;QAC7C,MAAM,KAAK,GAAG,IAAA,6BAAc,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAE,CAAC;QAEnE,OAAO,CACN,0CACG,IAAA,oBAAK,EAAE;gBACR,IAAI,EAAE,yCAAyC;gBAC/C,OAAO,EAAE,SAAS,CAAE,yCAAyC,EAAE;oBAC9D,IAAI,EAAE,EAAE,KAAK,EAAE;oBACf,UAAU,EAAE,EAAE,CAAC,EAAE,+BAAK,EAAE;oBACxB,OAAO,EAAE,mEAAmE;iBAC5E,CAAE;gBACH,OAAO,EAAE,SAAS,CAAE,uCAAuC,EAAE;oBAC5D,IAAI,EAAE,EAAE,KAAK,EAAE;oBACf,UAAU,EAAE,EAAE,CAAC,EAAE,+BAAK,EAAE;oBACxB,OAAO,EAAE,mEAAmE;iBAC5E,CAAE;aACH,CAAE,GACE,CACN,CAAC;IACH,CAAC;IAED,OAAO,CACN,4CACG,WAAW,EACb,uBAAC,YAAY,IACZ,gBAAgB,EAAG,gBAAgB,EACnC,QAAQ,EAAG,QAAQ,EACnB,aAAa,EAAG,aAAa,GAC5B,IACG,CACN,CAAC;AACH,CAAC,CAAC;AAEF,kBAAe,gBAAgB,CAAC"}
|
|
@@ -76,9 +76,9 @@
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
.plans-grid-next-header-price__badge {
|
|
79
|
-
background-color: var(--studio-green-
|
|
79
|
+
background-color: var(--studio-green-5);
|
|
80
80
|
border-radius: 4px;
|
|
81
|
-
color: var(--studio-green-
|
|
81
|
+
color: var(--studio-green-80);
|
|
82
82
|
display: inline-block;
|
|
83
83
|
font-size: 0.75rem;
|
|
84
84
|
font-weight: 500;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = useDefaultStorageOption;
|
|
3
4
|
const tslib_1 = require("tslib");
|
|
4
5
|
const grid_context_1 = require("../../../../grid-context");
|
|
5
6
|
const constants_1 = require("../constants");
|
|
@@ -22,5 +23,4 @@ function useDefaultStorageOption({ planSlug, }) {
|
|
|
22
23
|
? purchasedStorageAddOn.addOnSlug
|
|
23
24
|
: planStorageFeatureSlug;
|
|
24
25
|
}
|
|
25
|
-
exports.default = useDefaultStorageOption;
|
|
26
26
|
//# sourceMappingURL=use-default-storage-option.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-default-storage-option.js","sourceRoot":"","sources":["../../../../../../src/components/shared/storage/hooks/use-default-storage-option.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-default-storage-option.js","sourceRoot":"","sources":["../../../../../../src/components/shared/storage/hooks/use-default-storage-option.ts"],"names":[],"mappings":";;AAgBA,0CAiBC;;AA/BD,2DAA+D;AAC/D,4CAAkE;AAClE,0GAAsE;AAMtE;;;;;GAKG;AACH,SAAwB,uBAAuB,CAAE,EAChD,QAAQ,GACD;IACP,MAAM,EAAE,cAAc,EAAE,GAAG,IAAA,kCAAmB,GAAE,CAAC;IACjD,MAAM,EACL,QAAQ,EAAE,EAAE,cAAc,EAAE,GAC5B,GAAG,cAAc,CAAE,QAAQ,CAAE,CAAC;IAC/B,MAAM,qBAAqB,GAAG,IAAA,sCAAwB,GAAE,CAAC;IACzD,MAAM,sBAAsB,GAAG,cAAc,EAAE,OAAO,EAAiC,CAAC;IAExF,IAAK,CAAE,qBAAqB,EAAG,CAAC;QAC/B,OAAO,sBAAsB,CAAC;IAC/B,CAAC;IAED,OAAO,8CAAkC,CAAC,QAAQ,CAAE,QAAQ,CAAE;QAC7D,CAAC,CAAG,qBAAqB,CAAC,SAAsC;QAChE,CAAC,CAAC,sBAAsB,CAAC;AAC3B,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = usePurchasedStorageAddOn;
|
|
3
4
|
const calypso_products_1 = require("@automattic/calypso-products");
|
|
4
5
|
const data_stores_1 = require("@automattic/data-stores");
|
|
5
6
|
const element_1 = require("@wordpress/element");
|
|
@@ -47,5 +48,4 @@ function usePurchasedStorageAddOn() {
|
|
|
47
48
|
return purchasedAddOn ?? null;
|
|
48
49
|
}, [spaceUpgradesPurchased, storageAddOns]);
|
|
49
50
|
}
|
|
50
|
-
exports.default = usePurchasedStorageAddOn;
|
|
51
51
|
//# sourceMappingURL=use-purchased-storage-add-on.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-purchased-storage-add-on.js","sourceRoot":"","sources":["../../../../../../src/components/shared/storage/hooks/use-purchased-storage-add-on.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"use-purchased-storage-add-on.js","sourceRoot":"","sources":["../../../../../../src/components/shared/storage/hooks/use-purchased-storage-add-on.ts"],"names":[],"mappings":";;AA8BA,2CAsBC;AApDD,mEAAiE;AACjE,yDAA4D;AAC5D,gDAA6C;AAC7C,2DAA+D;AAE/D,OAAO;AACP,sDAAsD;AACtD,sGAAsG;AACtG,2CAA2C;AAC3C,MAAM,mBAAmB,GAAG,CAAE,QAAgB,EAAmC,EAAE;IAClF,QAAS,QAAQ,EAAG,CAAC;QACpB,KAAK,EAAE;YACN,OAAO,oBAAM,CAAC,mBAAmB,CAAC;QACnC,KAAK,GAAG;YACP,OAAO,oBAAM,CAAC,oBAAoB,CAAC;QACpC,KAAK,GAAG;YACP,OAAO,oBAAM,CAAC,oBAAoB,CAAC;QACpC,KAAK,GAAG;YACP,OAAO,oBAAM,CAAC,oBAAoB,CAAC;QACpC,KAAK,GAAG;YACP,OAAO,oBAAM,CAAC,oBAAoB,CAAC;QACpC,KAAK,GAAG;YACP,OAAO,oBAAM,CAAC,oBAAoB,CAAC;QACpC,KAAK,GAAG;YACP,OAAO,oBAAM,CAAC,oBAAoB,CAAC;QACpC;YACC,OAAO,IAAI,CAAC;IACd,CAAC;AACF,CAAC,CAAC;AAEF,SAAwB,wBAAwB;IAC/C,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,kCAAmB,GAAE,CAAC;IACzC,MAAM,sBAAsB,GAAG,uBAAS,CAAC,6BAA6B,CAAE;QACvE,MAAM;QACN,WAAW,EAAE,oCAAiB;KAC9B,CAAE,CAAC;IACJ,MAAM,aAAa,GAAG,oBAAM,CAAC,gBAAgB,CAAE,EAAE,MAAM,EAAE,CAAE,CAAC;IAE5D,OAAO,IAAA,iBAAO,EAAE,GAAG,EAAE;QACpB,IAAK,CAAE,sBAAsB,EAAG,CAAC;YAChC,OAAO,IAAI,CAAC;QACb,CAAC;QAED,gGAAgG;QAChG,MAAM,kBAAkB,GAAG,mBAAmB,CAC7C,MAAM,CAAC,MAAM,CAAE,sBAAsB,CAAE,CAAE,CAAC,CAAE,CAAC,uBAAuB,CACpE,CAAC;QACF,MAAM,cAAc,GAAG,aAAa;aAClC,MAAM,CAAE,CAAE,KAAK,EAA8B,EAAE,CAAC,KAAK,KAAK,IAAI,CAAE,CAAC,sDAAsD;aACvH,IAAI,CAAE,CAAE,EAAE,SAAS,EAAE,EAAG,EAAE,CAAC,kBAAkB,KAAK,SAAS,CAAE,CAAC;QAChE,OAAO,cAAc,IAAI,IAAI,CAAC;IAC/B,CAAC,EAAE,CAAE,sBAAsB,EAAE,aAAa,CAAE,CAAE,CAAC;AAChD,CAAC"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PlanStorage = exports.useDefaultStorageOption = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
4
5
|
/**
|
|
5
6
|
* Hooks
|
|
6
7
|
*/
|
|
7
8
|
var use_default_storage_option_1 = require("./hooks/use-default-storage-option");
|
|
8
|
-
Object.defineProperty(exports, "useDefaultStorageOption", { enumerable: true, get: function () { return __importDefault(use_default_storage_option_1).default; } });
|
|
9
|
+
Object.defineProperty(exports, "useDefaultStorageOption", { enumerable: true, get: function () { return tslib_1.__importDefault(use_default_storage_option_1).default; } });
|
|
9
10
|
/**
|
|
10
11
|
* Components
|
|
11
12
|
*/
|
|
12
13
|
var plan_storage_1 = require("./components/plan-storage");
|
|
13
|
-
Object.defineProperty(exports, "PlanStorage", { enumerable: true, get: function () { return __importDefault(plan_storage_1).default; } });
|
|
14
|
+
Object.defineProperty(exports, "PlanStorage", { enumerable: true, get: function () { return tslib_1.__importDefault(plan_storage_1).default; } });
|
|
14
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/shared/storage/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/shared/storage/index.ts"],"names":[],"mappings":";;;;AAAA;;GAEG;AACH,iFAAwF;AAA/E,8JAAA,OAAO,OAA2B;AAE3C;;GAEG;AACH,0DAAmE;AAA1D,oIAAA,OAAO,OAAe"}
|
|
@@ -1,26 +1,86 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StickyContainer =
|
|
3
|
+
exports.StickyContainer = StickyContainer;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
const react_1 = require("@emotion/react");
|
|
7
7
|
const styled_1 = tslib_1.__importDefault(require("@emotion/styled"));
|
|
8
8
|
const clsx_1 = tslib_1.__importDefault(require("clsx"));
|
|
9
9
|
const react_2 = require("react");
|
|
10
|
-
const styles = ({ disabled, stickyOffset, zIndex, }) => disabled
|
|
10
|
+
const styles = ({ disabled, stickyOffset, stickyPadding, zIndex, }) => disabled
|
|
11
11
|
? ''
|
|
12
12
|
: (0, react_1.css) `
|
|
13
13
|
position: sticky;
|
|
14
|
-
top: ${stickyOffset + 'px'};
|
|
14
|
+
top: ${stickyOffset - stickyPadding + 'px'};
|
|
15
15
|
z-index: ${zIndex};
|
|
16
16
|
`;
|
|
17
17
|
const Container = styled_1.default.div `
|
|
18
18
|
${styles}
|
|
19
19
|
`;
|
|
20
|
+
/**
|
|
21
|
+
* Renders a sticky container.
|
|
22
|
+
*
|
|
23
|
+
* The following is an illustration on how the container's top property is calculated.
|
|
24
|
+
*
|
|
25
|
+
* +~~~~~~~~ stickyParent (where the container scrolls)
|
|
26
|
+
* stickyOffset ~~~~~~~~~~+ |
|
|
27
|
+
* (e.g. masterbar) | |
|
|
28
|
+
* v v
|
|
29
|
+
* +------#-----------------+
|
|
30
|
+
* | # |<~~~~~~~+~~~~~ stickyPadding
|
|
31
|
+
* | +----#--------------+ |
|
|
32
|
+
* | | # @ |<~+~~~~~ stickyParent's content area
|
|
33
|
+
* | | # @ | |
|
|
34
|
+
* | | # @ <~~~~~~~~+~~+~~~~~ the container's top
|
|
35
|
+
* | | # @ | | (= stickyOffset - stickyPadding)
|
|
36
|
+
* | | ============= | |
|
|
37
|
+
* | | ^ | |
|
|
38
|
+
* | | | | |
|
|
39
|
+
* | | +~~~~~~~~~~~~~+~~+~~~~~ the container
|
|
40
|
+
* | | | |
|
|
41
|
+
*/
|
|
20
42
|
function StickyContainer(props) {
|
|
21
43
|
const { stickyOffset = 0, zIndex = 2, stickyClass = '', element = 'div', disabled = false, children, } = props;
|
|
22
44
|
const stickyRef = (0, react_2.useRef)(null);
|
|
45
|
+
const [stickyParent, setStickyParent] = (0, react_2.useState)(null);
|
|
46
|
+
const [stickyPadding, setStickyPadding] = (0, react_2.useState)(0);
|
|
23
47
|
const [isStuck, setIsStuck] = (0, react_2.useState)(false);
|
|
48
|
+
/**
|
|
49
|
+
* Calculate the first scrollable parent and its padding-top.
|
|
50
|
+
*/
|
|
51
|
+
(0, react_2.useEffect)(() => {
|
|
52
|
+
if (!stickyRef.current || typeof getComputedStyle === 'undefined') {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
let scrollParent = stickyRef.current;
|
|
56
|
+
while (scrollParent) {
|
|
57
|
+
const style = getComputedStyle(scrollParent);
|
|
58
|
+
const overflowY = style.overflowY;
|
|
59
|
+
if (overflowY === 'auto' || overflowY === 'scroll' || overflowY === 'overlay') {
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
scrollParent = scrollParent.parentElement;
|
|
63
|
+
}
|
|
64
|
+
const receiveScrollParent = (el) => {
|
|
65
|
+
const styles = getComputedStyle(el);
|
|
66
|
+
const paddingTop = parseFloat(styles.paddingTop);
|
|
67
|
+
setStickyParent(scrollParent);
|
|
68
|
+
setStickyPadding(paddingTop);
|
|
69
|
+
};
|
|
70
|
+
if (scrollParent) {
|
|
71
|
+
scrollParent.style.position = 'relative';
|
|
72
|
+
receiveScrollParent(scrollParent);
|
|
73
|
+
if (typeof ResizeObserver !== 'undefined') {
|
|
74
|
+
const observer = new ResizeObserver(([parent]) => {
|
|
75
|
+
receiveScrollParent(parent.target);
|
|
76
|
+
});
|
|
77
|
+
observer.observe(scrollParent);
|
|
78
|
+
return () => {
|
|
79
|
+
observer.disconnect();
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}, []);
|
|
24
84
|
/**
|
|
25
85
|
* This effect sets the value of `isStuck` state when it detects that
|
|
26
86
|
* the element is sticky.
|
|
@@ -49,6 +109,7 @@ function StickyContainer(props) {
|
|
|
49
109
|
setIsStuck(entry.intersectionRatio < 1);
|
|
50
110
|
}
|
|
51
111
|
}, {
|
|
112
|
+
root: stickyParent,
|
|
52
113
|
rootMargin: `-${stickyOffset + 1}px 0px 0px 0px`,
|
|
53
114
|
threshold: [0, 1],
|
|
54
115
|
});
|
|
@@ -58,7 +119,7 @@ function StickyContainer(props) {
|
|
|
58
119
|
return () => {
|
|
59
120
|
observer.disconnect();
|
|
60
121
|
};
|
|
61
|
-
}, [disabled, stickyOffset]);
|
|
122
|
+
}, [disabled, stickyParent, stickyOffset, stickyPadding]);
|
|
62
123
|
const isStuckFinalState = !disabled && isStuck;
|
|
63
124
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_1.Global, { styles: (0, react_1.css) `
|
|
64
125
|
/**
|
|
@@ -68,7 +129,6 @@ function StickyContainer(props) {
|
|
|
68
129
|
.layout__content {
|
|
69
130
|
overflow: unset;
|
|
70
131
|
}
|
|
71
|
-
` }), (0, jsx_runtime_1.jsx)(Container, { ...props, as: element, ref: stickyRef, stickyOffset: stickyOffset, disabled: disabled, className: (0, clsx_1.default)({ [stickyClass]: isStuckFinalState }), zIndex: zIndex, children: children(isStuckFinalState) })] }));
|
|
132
|
+
` }), (0, jsx_runtime_1.jsx)(Container, { ...props, as: element, ref: stickyRef, stickyOffset: stickyOffset, stickyPadding: stickyPadding, disabled: disabled, className: (0, clsx_1.default)({ [stickyClass]: isStuckFinalState }), zIndex: zIndex, children: children(isStuckFinalState) })] }));
|
|
72
133
|
}
|
|
73
|
-
exports.StickyContainer = StickyContainer;
|
|
74
134
|
//# sourceMappingURL=sticky-container.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sticky-container.js","sourceRoot":"","sources":["../../../src/components/sticky-container.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sticky-container.js","sourceRoot":"","sources":["../../../src/components/sticky-container.tsx"],"names":[],"mappings":";;AAqFA,0CAmIC;;;AAxND,0CAA6C;AAC7C,qEAAqC;AACrC,wDAAwB;AACxB,iCAAkG;AAqClG,MAAM,MAAM,GAAG,CAAE,EAChB,QAAQ,EACR,YAAY,EACZ,aA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
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isPopularPlan =
|
|
3
|
+
exports.isPopularPlan = isPopularPlan;
|
|
4
4
|
const calypso_products_1 = require("@automattic/calypso-products");
|
|
5
5
|
function isPopularPlan(planSlug) {
|
|
6
6
|
return (0, calypso_products_1.isPremiumPlan)(planSlug) || (0, calypso_products_1.isWooExpressMediumPlan)(planSlug);
|
|
7
7
|
}
|
|
8
|
-
exports.isPopularPlan = isPopularPlan;
|
|
9
8
|
//# sourceMappingURL=is-popular-plan.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-popular-plan.js","sourceRoot":"","sources":["../../../../src/hooks/data-store/is-popular-plan.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"is-popular-plan.js","sourceRoot":"","sources":["../../../../src/hooks/data-store/is-popular-plan.ts"],"names":[],"mappings":";;AAEA,sCAEC;AAJD,mEAAqF;AAErF,SAAgB,aAAa,CAAE,QAAgB;IAC9C,OAAO,IAAA,gCAAa,EAAE,QAAQ,CAAE,IAAI,IAAA,yCAAsB,EAAE,QAAQ,CAAE,CAAC;AACxE,CAAC"}
|
|
@@ -4,7 +4,7 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const element_1 = require("@wordpress/element");
|
|
5
5
|
const use_grid_plans_1 = tslib_1.__importDefault(require("./use-grid-plans"));
|
|
6
6
|
const use_plan_features_for_grid_plans_1 = tslib_1.__importDefault(require("./use-plan-features-for-grid-plans"));
|
|
7
|
-
const useGridPlansForFeaturesGrid = ({ allFeaturesList, coupon, eligibleForFreeHostingTrial, hasRedeemedDomainCredit, hiddenPlans, intent, isDisplayingPlansNeededForFeature, isInSignup, isSubdomainNotGenerated, selectedFeature, selectedPlan, showLegacyStorageFeature, siteId, term, useCheckPlanAvailabilityForPurchase, useFreeTrialPlanSlugs, highlightLabelOverrides, isDomainOnlySite, reflectStorageSelectionInPlanPrices, }) => {
|
|
7
|
+
const useGridPlansForFeaturesGrid = ({ allFeaturesList, coupon, eligibleForFreeHostingTrial, hasRedeemedDomainCredit, hiddenPlans, hideCurrentPlan, intent, isDisplayingPlansNeededForFeature, isInSignup, isSubdomainNotGenerated, selectedFeature, selectedPlan, showLegacyStorageFeature, siteId, term, useCheckPlanAvailabilityForPurchase, useFreeTrialPlanSlugs, highlightLabelOverrides, isDomainOnlySite, reflectStorageSelectionInPlanPrices, }) => {
|
|
8
8
|
const gridPlans = (0, use_grid_plans_1.default)({
|
|
9
9
|
allFeaturesList,
|
|
10
10
|
coupon,
|
|
@@ -39,18 +39,21 @@ const useGridPlansForFeaturesGrid = ({ allFeaturesList, coupon, eligibleForFreeH
|
|
|
39
39
|
return null;
|
|
40
40
|
}
|
|
41
41
|
return gridPlans.reduce((acc, gridPlan) => {
|
|
42
|
-
if (gridPlan.isVisible) {
|
|
43
|
-
return
|
|
44
|
-
...acc,
|
|
45
|
-
{
|
|
46
|
-
...gridPlan,
|
|
47
|
-
features: planFeaturesForFeaturesGrid[gridPlan.planSlug],
|
|
48
|
-
},
|
|
49
|
-
];
|
|
42
|
+
if (!gridPlan.isVisible) {
|
|
43
|
+
return acc;
|
|
50
44
|
}
|
|
51
|
-
|
|
45
|
+
if (hideCurrentPlan && gridPlan.current) {
|
|
46
|
+
return acc;
|
|
47
|
+
}
|
|
48
|
+
return [
|
|
49
|
+
...acc,
|
|
50
|
+
{
|
|
51
|
+
...gridPlan,
|
|
52
|
+
features: planFeaturesForFeaturesGrid[gridPlan.planSlug],
|
|
53
|
+
},
|
|
54
|
+
];
|
|
52
55
|
}, []);
|
|
53
|
-
}, [gridPlans, planFeaturesForFeaturesGrid]);
|
|
56
|
+
}, [gridPlans, planFeaturesForFeaturesGrid, hideCurrentPlan]);
|
|
54
57
|
};
|
|
55
58
|
exports.default = useGridPlansForFeaturesGrid;
|
|
56
59
|
//# sourceMappingURL=use-grid-plans-for-features-grid.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-grid-plans-for-features-grid.js","sourceRoot":"","sources":["../../../../src/hooks/data-store/use-grid-plans-for-features-grid.ts"],"names":[],"mappings":";;;AAAA,gDAA6C;AAC7C,8EAA4C;AAC5C,kHAA6E;AAI7E,MAAM,2BAA2B,GAAG,CAAE,EACrC,eAAe,EACf,MAAM,EACN,2BAA2B,EAC3B,uBAAuB,EACvB,WAAW,EACX,MAAM,EACN,iCAAiC,EACjC,UAAU,EACV,uBAAuB,EACvB,eAAe,EACf,YAAY,EACZ,wBAAwB,EACxB,MAAM,EACN,IAAI,EACJ,mCAAmC,EACnC,qBAAqB,EACrB,uBAAuB,EACvB,gBAAgB,EAChB,mCAAmC,GACf,EAAsB,EAAE;IAC5C,MAAM,SAAS,GAAG,IAAA,wBAAY,EAAE;QAC/B,eAAe;QACf,MAAM;QACN,2BAA2B;QAC3B,uBAAuB;QACvB,WAAW;QACX,MAAM;QACN,iCAAiC;QACjC,uBAAuB;QACvB,eAAe;QACf,YAAY;QACZ,wBAAwB;QACxB,MAAM;QACN,IAAI;QACJ,mCAAmC;QACnC,qBAAqB;QACrB,uBAAuB;QACvB,gBAAgB;QAChB,mCAAmC;KACnC,CAAE,CAAC;IAEJ,MAAM,2BAA2B,GAAG,IAAA,0CAA2B,EAAE;QAChE,eAAe;QACf,SAAS,EAAE,SAAS,IAAI,EAAE;QAC1B,uBAAuB;QACvB,MAAM;QACN,UAAU;QACV,eAAe;QACf,wBAAwB;KACxB,CAAE,CAAC;IAEJ,OAAO,IAAA,iBAAO,EAAE,GAAG,EAAE;QACpB,IAAK,CAAE,SAAS,EAAG,CAAC;YACnB,OAAO,IAAI,CAAC;QACb,CAAC;QAED,OAAO,SAAS,CAAC,MAAM,CAAE,CAAE,GAAG,EAAE,QAAQ,EAAG,EAAE;YAC5C,IAAK,QAAQ,CAAC,SAAS,EAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"use-grid-plans-for-features-grid.js","sourceRoot":"","sources":["../../../../src/hooks/data-store/use-grid-plans-for-features-grid.ts"],"names":[],"mappings":";;;AAAA,gDAA6C;AAC7C,8EAA4C;AAC5C,kHAA6E;AAI7E,MAAM,2BAA2B,GAAG,CAAE,EACrC,eAAe,EACf,MAAM,EACN,2BAA2B,EAC3B,uBAAuB,EACvB,WAAW,EACX,eAAe,EACf,MAAM,EACN,iCAAiC,EACjC,UAAU,EACV,uBAAuB,EACvB,eAAe,EACf,YAAY,EACZ,wBAAwB,EACxB,MAAM,EACN,IAAI,EACJ,mCAAmC,EACnC,qBAAqB,EACrB,uBAAuB,EACvB,gBAAgB,EAChB,mCAAmC,GACf,EAAsB,EAAE;IAC5C,MAAM,SAAS,GAAG,IAAA,wBAAY,EAAE;QAC/B,eAAe;QACf,MAAM;QACN,2BAA2B;QAC3B,uBAAuB;QACvB,WAAW;QACX,MAAM;QACN,iCAAiC;QACjC,uBAAuB;QACvB,eAAe;QACf,YAAY;QACZ,wBAAwB;QACxB,MAAM;QACN,IAAI;QACJ,mCAAmC;QACnC,qBAAqB;QACrB,uBAAuB;QACvB,gBAAgB;QAChB,mCAAmC;KACnC,CAAE,CAAC;IAEJ,MAAM,2BAA2B,GAAG,IAAA,0CAA2B,EAAE;QAChE,eAAe;QACf,SAAS,EAAE,SAAS,IAAI,EAAE;QAC1B,uBAAuB;QACvB,MAAM;QACN,UAAU;QACV,eAAe;QACf,wBAAwB;KACxB,CAAE,CAAC;IAEJ,OAAO,IAAA,iBAAO,EAAE,GAAG,EAAE;QACpB,IAAK,CAAE,SAAS,EAAG,CAAC;YACnB,OAAO,IAAI,CAAC;QACb,CAAC;QAED,OAAO,SAAS,CAAC,MAAM,CAAE,CAAE,GAAG,EAAE,QAAQ,EAAG,EAAE;YAC5C,IAAK,CAAE,QAAQ,CAAC,SAAS,EAAG,CAAC;gBAC5B,OAAO,GAAG,CAAC;YACZ,CAAC;YACD,IAAK,eAAe,IAAI,QAAQ,CAAC,OAAO,EAAG,CAAC;gBAC3C,OAAO,GAAG,CAAC;YACZ,CAAC;YACD,OAAO;gBACN,GAAG,GAAG;gBACN;oBACC,GAAG,QAAQ;oBACX,QAAQ,EAAE,2BAA2B,CAAE,QAAQ,CAAC,QAAQ,CAAE;iBAC1D;aACD,CAAC;QACH,CAAC,EAAE,EAAgB,CAAE,CAAC;IACvB,CAAC,EAAE,CAAE,SAAS,EAAE,2BAA2B,EAAE,eAAe,CAAE,CAAE,CAAC;AAClE,CAAC,CAAC;AAEF,kBAAe,2BAA2B,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = usePlanBillingDescription;
|
|
3
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
5
|
const calypso_products_1 = require("@automattic/calypso-products");
|
|
5
6
|
const data_stores_1 = require("@automattic/data-stores");
|
|
@@ -34,7 +35,7 @@ function usePlanBillingDescription({ siteId, planSlug, pricing, isMonthlyPlan, c
|
|
|
34
35
|
: yearlyVariantPricing.originalPrice?.monthly;
|
|
35
36
|
if (yearlyVariantMaybeDiscountedPrice &&
|
|
36
37
|
yearlyVariantMaybeDiscountedPrice < originalPrice.monthly) {
|
|
37
|
-
return translate(
|
|
38
|
+
return translate('Save %(discountRate)s%% by paying annually', {
|
|
38
39
|
args: {
|
|
39
40
|
discountRate: Math.floor((100 * (originalPrice.monthly - yearlyVariantMaybeDiscountedPrice)) /
|
|
40
41
|
originalPrice.monthly),
|
|
@@ -212,5 +213,4 @@ function usePlanBillingDescription({ siteId, planSlug, pricing, isMonthlyPlan, c
|
|
|
212
213
|
}
|
|
213
214
|
return null;
|
|
214
215
|
}
|
|
215
|
-
exports.default = usePlanBillingDescription;
|
|
216
216
|
//# sourceMappingURL=use-plan-billing-description.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-plan-billing-description.js","sourceRoot":"","sources":["../../../../src/hooks/data-store/use-plan-billing-description.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-plan-billing-description.js","sourceRoot":"","sources":["../../../../src/hooks/data-store/use-plan-billing-description.tsx"],"names":[],"mappings":";;AA0BA,4CA0RC;;AApTD,mEAUsC;AACtC,yDAAgD;AAChD,+CAA4D;AAC5D,qDAAyD;AAazD,SAAwB,yBAAyB,CAAE,EAClD,MAAM,EACN,QAAQ,EACR,OAAO,EACP,aAAa,EACb,MAAM,EACN,mCAAmC,GACH;IAChC,MAAM,SAAS,GAAG,IAAA,2BAAY,GAAE,CAAC;IACjC,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;IAClG,MAAM,EAAE,mCAAmC,EAAE,GAAG,IAAA,kCAAmB,GAAE,CAAC;IACtE,MAAM,qBAAqB,GAAG,IAAA,4CAAyB,EAAE,QAAQ,EAAE,gCAAa,CAAE,CAAC;IAEnF,MAAM,oBAAoB,GAAG,mBAAK,CAAC,0BAA0B,CAAE;QAC9D,SAAS,EAAE,qBAAqB,CAAC,CAAC,CAAC,CAAE,qBAAqB,CAAE,CAAC,CAAC,CAAC,EAAE;QACjE,MAAM;QACN,MAAM;QACN,mCAAmC;QACnC,mCAAmC;KACnC,CAAE,EAAE,CAAE,qBAAqB,IAAI,EAAE,CAAE,CAAC;IAErC,IAAK,CAAE,OAAO,EAAG,CAAC;QACjB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,IACC,IAAA,kCAAe,EAAE,QAAQ,CAAE;QAC3B,IAAA,4CAAyB,EAAE,QAAQ,CAAE;QACrC,QAAQ,KAAK,6CAA0B,EACtC,CAAC;QACF,OAAO,IAAI,CAAC;IACb,CAAC;IAED,IACC,aAAa;QACb,aAAa,EAAE,OAAO;QACtB,oBAAoB;QACpB,CAAE,CAAE,UAAU,IAAI,UAAU,CAAC,eAAe,CAAE,EAC7C,CAAC;QACF,MAAM,iCAAi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AAE,EAAE,QAAQ,EAAE,yBAAyB,EAAE;gBAC7C,OAAO,EAAE,0CAA0C;aACnD,CAAE,CAAC;QACL,CAAC;QAED,IAAK,uCAAoB,KAAK,aAAa,EAAG,CAAC;YAC9C,OAAO,SAAS,CAAE,6DAA6D,EAAE;gBAChF,IAAI,EAAE,EAAE,QAAQ,EAAE,yBAAyB,EAAE;gBAC7C,OAAO,EAAE,0CAA0C;aACnD,CAAE,CAAC;QACL,CAAC;QAED,IAAK,wCAAqB,KAAK,aAAa,EAAG,CAAC;YAC/C,OAAO,SAAS,CAAE,+DAA+D,EAAE;gBAClF,IAAI,EAAE,EAAE,QAAQ,EAAE,yBAAyB,EAAE;gBAC7C,OAAO,EAAE,0CAA0C;aACnD,CAAE,CAAC;QACL,CAAC;IACF,CAAC;IAED,OAAO,IAAI,CAAC;AACb,CAAC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
3
|
+
exports.default = useGridSize;
|
|
4
4
|
const element_1 = require("@wordpress/element");
|
|
5
|
-
const resize_observer_polyfill_1 = tslib_1.__importDefault(require("resize-observer-polyfill"));
|
|
6
5
|
/**
|
|
7
6
|
* useGridSize returns the current grid size based on the width of the container
|
|
8
7
|
* and the breakpoints passed through as props.
|
|
@@ -13,7 +12,7 @@ function useGridSize({ containerRef, containerBreakpoints }) {
|
|
|
13
12
|
if (!containerRef.current) {
|
|
14
13
|
return;
|
|
15
14
|
}
|
|
16
|
-
const observer = new
|
|
15
|
+
const observer = new ResizeObserver(([entry]) => {
|
|
17
16
|
const { width } = entry.contentRect;
|
|
18
17
|
if (width) {
|
|
19
18
|
for (const [key, value] of [...containerBreakpoints].reverse()) {
|
|
@@ -29,5 +28,4 @@ function useGridSize({ containerRef, containerBreakpoints }) {
|
|
|
29
28
|
}, [containerRef, containerBreakpoints]);
|
|
30
29
|
return gridSize;
|
|
31
30
|
}
|
|
32
|
-
exports.default = useGridSize;
|
|
33
31
|
//# sourceMappingURL=use-grid-size.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-grid-size.js","sourceRoot":"","sources":["../../../src/hooks/use-grid-size.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-grid-size.js","sourceRoot":"","sources":["../../../src/hooks/use-grid-size.ts"],"names":[],"mappings":";;AAiBA,8BA2BC;AA5CD,gDAA+D;AAa/D;;;GAGG;AACH,SAAwB,WAAW,CAAE,EAAE,YAAY,EAAE,oBAAoB,EAAS;IACjF,MAAM,CAAE,QAAQ,EAAE,WAAW,CAAE,GAAG,IAAA,kBAAQ,EAAmB,IAAI,CAAE,CAAC;IAEpE,IAAA,yBAAe,EAAE,GAAG,EAAE;QACrB,IAAK,CAAE,YAAY,CAAC,OAAO,EAAG,CAAC;YAC9B,OAAO;QACR,CAAC;QAED,MAAM,QAAQ,GAAG,IAAI,cAAc,CAAE,CAAE,CAAE,KAAK,CAAE,EAAG,EAAE;YACpD,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC,WAAW,CAAC;YAEpC,IAAK,KAAK,EAAG,CAAC;gBACb,KAAM,MAAM,CAAE,GAAG,EAAE,KAAK,CAAE,IAAI,CAAE,GAAG,oBAAoB,CAAE,CAAC,OAAO,EAAE,EAAG,CAAC;oBACtE,IAAK,KAAK,IAAI,KAAK,EAAG,CAAC;wBACtB,WAAW,CAAE,GAAG,CAAE,CAAC;wBACnB,MAAM;oBACP,CAAC;gBACF,CAAC;YACF,CAAC;QACF,CAAC,CAAE,CAAC;QAEJ,QAAQ,CAAC,OAAO,CAAE,YAAY,CAAC,OAAO,CAAE,CAAC;QAEzC,OAAO,GAAG,EAAE,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;IACpC,CAAC,EAAE,CAAE,YAAY,EAAE,oBAAoB,CAAE,CAAE,CAAC;IAE5C,OAAO,QAAQ,CAAC;AACjB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = useIsLargeCurrency;
|
|
3
4
|
const element_1 = require("@wordpress/element");
|
|
4
5
|
const i18n_calypso_1 = require("i18n-calypso");
|
|
5
6
|
const LARGE_ADD_ON_CURRENCY_CHAR_THRESHOLD = 7;
|
|
@@ -65,5 +66,4 @@ function useIsLargeCurrency({ prices, isAddOn = false, currencyCode, ignoreWhite
|
|
|
65
66
|
const exceedsCombinedPriceThreshold = hasExceededCombinedPriceThreshold(displayPrices);
|
|
66
67
|
return isAddOn ? exceedsPriceThreshold : exceedsPriceThreshold || exceedsCombinedPriceThreshold;
|
|
67
68
|
}
|
|
68
|
-
exports.default = useIsLargeCurrency;
|
|
69
69
|
//# sourceMappingURL=use-is-large-currency.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-is-large-currency.js","sourceRoot":"","sources":["../../../src/hooks/use-is-large-currency.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"use-is-large-currency.js","sourceRoot":"","sources":["../../../src/hooks/use-is-large-currency.ts"],"names":[],"mappings":";;AAoEA,qCAsBC;AA1FD,gDAA6C;AAC7C,+CAA8C;AAC9C,MAAM,oCAAoC,GAAG,CAAC,CAAC;AAC/C,MAAM,6BAA6B,GAAG,CAAC,CAAC;AACxC,MAAM,sCAAsC,GAAG,CAAC,CAAC;AASjD,SAAS,gBAAgB,CAAE,YAAoB,EAAE,MAAiB,EAAE,gBAAgB,GAAG,KAAK;IAC3F;;;;OAIG;IAEH,OAAO,IAAA,iBAAO,EACb,GAAG,EAAE,CACJ,MAAM,EAAE,GAAG,CAAE,CAAE,KAAK,EAAG,EAAE;QACxB,MAAM,YAAY,GAAG,IAAA,6BAAc,EAAE,KAAK,EAAE,YAAY,EAAE;YACzD,UAAU,EAAE,IAAI;YAChB,cAAc,EAAE,IAAI;SACpB,CAAE,CAAC;QAEJ,OA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AAE,gBAAgB,CAAE,CAAC;IACjF,MAAM,qBAAqB,GAAG,yBAAyB,CAAE,aAAa,EAAE,OAAO,CAAE,CAAC;IAClF,MAAM,6BAA6B,GAAG,iCAAiC,CAAE,aAAa,CAAE,CAAC;IAEzF,OAAO,OAAO,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,qBAAqB,IAAI,6BAA6B,CAAC;AACjG,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useManageTooltipToggle =
|
|
3
|
+
exports.useManageTooltipToggle = useManageTooltipToggle;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const touch_detect_1 = require("../lib/touch-detect");
|
|
6
6
|
function useManageTooltipToggle() {
|
|
@@ -25,5 +25,4 @@ function useManageTooltipToggle() {
|
|
|
25
25
|
}, [isTouch]);
|
|
26
26
|
return [activeTooltipId, setActiveTooltipId];
|
|
27
27
|
}
|
|
28
|
-
exports.useManageTooltipToggle = useManageTooltipToggle;
|
|
29
28
|
//# sourceMappingURL=use-manage-tooltip-toggle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-manage-tooltip-toggle.js","sourceRoot":"","sources":["../../../src/hooks/use-manage-tooltip-toggle.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-manage-tooltip-toggle.js","sourceRoot":"","sources":["../../../src/hooks/use-manage-tooltip-toggle.ts"],"names":[],"mappings":";;AAGA,wDA0BC;AA7BD,iCAAsE;AACtE,sDAA+C;AAE/C,SAAgB,sBAAsB;IACrC,MAAM,CAAE,eAAe,EAAE,kBAAkB,CAAE,GAAG,IAAA,gBAAQ,EAAE,EAAE,CAAE,CAAC;IAC/D,MAAM,OAAO,GAAG,IAAA,uBAAQ,GAAE,CAAC;IAE3B,IAAA,iBAAS,EAAE,GAAG,EAAE;QACf,IAAK,CAAE,OAAO,EAAG,CAAC;YACjB,OAAO;QACR,CAAC;QAED,+EAA+E;QAC/E,yHAAyH;QACzH,MAAM,gBAAgB,GAAG,CAAE,KAAiB,EAAG,EAAE;YAChD,MAAM,WAAW,GAAG,KAAK,CAAC,MAAiB,CAAC;YAC5C,IAAK,CAAE,WAAW,CAAC,OAAO,CAAE,2CAA2C,CAAE,EAAG,CAAC;gBAC5E,kBAAkB,CAAE,EAAE,CAAE,CAAC;YAC1B,CAAC;QACF,CAAC,CAAC;QAEF,QAAQ,CAAC,gBAAgB,CAAE,YAAY,EAAE,gBAAgB,CAAE,CAAC;QAE5D,OAAO,GAAG,EAAE;YACX,QAAQ,CAAC,mBAAmB,CAAE,YAAY,EAAE,gBAAgB,CAAE,CAAC;QAChE,CAAC,CAAC;IACH,CAAC,EAAE,CAAE,OAAO,CAAE,CAAE,CAAC;IAEjB,OAAO,CAAE,eAAe,EAAE,kBAAkB,CAAE,CAAC;AAChD,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.usePlanPricingInfoFromGridPlans =
|
|
3
|
+
exports.usePlanPricingInfoFromGridPlans = usePlanPricingInfoFromGridPlans;
|
|
4
4
|
const element_1 = require("@wordpress/element");
|
|
5
5
|
function usePlanPricingInfoFromGridPlans({ gridPlans, returnMonthly = true, }) {
|
|
6
6
|
return (0, element_1.useMemo)(() => gridPlans.reduce((acc, gridPlan) => {
|
|
@@ -13,5 +13,4 @@ function usePlanPricingInfoFromGridPlans({ gridPlans, returnMonthly = true, }) {
|
|
|
13
13
|
};
|
|
14
14
|
}, { prices: [], currencyCode: 'USD' }), [gridPlans, returnMonthly]);
|
|
15
15
|
}
|
|
16
|
-
exports.usePlanPricingInfoFromGridPlans = usePlanPricingInfoFromGridPlans;
|
|
17
16
|
//# sourceMappingURL=use-plan-pricing-info-from-grid-plans.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-plan-pricing-info-from-grid-plans.js","sourceRoot":"","sources":["../../../src/hooks/use-plan-pricing-info-from-grid-plans.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-plan-pricing-info-from-grid-plans.js","sourceRoot":"","sources":["../../../src/hooks/use-plan-pricing-info-from-grid-plans.ts"],"names":[],"mappings":";;AAQA,0EA2BC;AAnCD,gDAA6C;AAQ7C,SAAgB,+BAA+B,CAAE,EAChD,SAAS,EACT,aAAa,GAAG,IAAI,GAIpB;IACA,OAAO,IAAA,iBAAO,EACb,GAAG,EAAE,CACJ,SAAS,CAAC,MAAM,CACf,CAAE,GAAgB,EAAE,QAAQ,EAAG,EAAE;QAChC,MAAM,EACL,OAAO,EAAE,EAAE,aAAa,EAAE,eAAe,EAAE,YAAY,EAAE,GACzD,GAAG,QAAQ,CAAC;QAEb,MAAM,oBAAoB,GAAG,aAAa,CAAE,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAE,IAAI,CAAC,CAAC;QACtF,MAAM,sBAAsB,GAAG,eAAe,CAAE,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAE,IAAI,CAAC,CAAC;QAE1F,OAAO;YACN,MAAM,EAAE,CAAE,GAAG,GAAG,CAAC,MAAM,EAAE,oBAAoB,EAAE,sBAAsB,CAAE;YACvE,YAAY,EAAE,YAAY,IAAI,GAAG,CAAC,YAAY;SAC9C,CAAC;IACH,CAAC,EACD,EAAE,MAAM,EAAE,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,CACnC,EACF,CAAE,SAAS,EAAE,aAAa,CAAE,CAC5B,CAAC;AACH,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getPlanPricingInfoFromGridPlans =
|
|
3
|
+
exports.getPlanPricingInfoFromGridPlans = getPlanPricingInfoFromGridPlans;
|
|
4
4
|
function getPlanPricingInfoFromGridPlans({ gridPlans, returnMonthly = true, }) {
|
|
5
5
|
return gridPlans.reduce((acc, gridPlan) => {
|
|
6
6
|
const { pricing: { originalPrice, discountedPrice, currencyCode }, } = gridPlan;
|
|
@@ -12,5 +12,4 @@ function getPlanPricingInfoFromGridPlans({ gridPlans, returnMonthly = true, }) {
|
|
|
12
12
|
};
|
|
13
13
|
}, { prices: [], currencyCode: 'USD' });
|
|
14
14
|
}
|
|
15
|
-
exports.getPlanPricingInfoFromGridPlans = getPlanPricingInfoFromGridPlans;
|
|
16
15
|
//# sourceMappingURL=get-plan-pricing-info-from-grid-plans.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-plan-pricing-info-from-grid-plans.js","sourceRoot":"","sources":["../../../src/lib/get-plan-pricing-info-from-grid-plans.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-plan-pricing-info-from-grid-plans.js","sourceRoot":"","sources":["../../../src/lib/get-plan-pricing-info-from-grid-plans.ts"],"names":[],"mappings":";;AAOA,0EAuBC;AAvBD,SAAgB,+BAA+B,CAAE,EAChD,SAAS,EACT,aAAa,GAAG,IAAI,GAIpB;IACA,OAAO,SAAS,CAAC,MAAM,CACtB,CAAE,GAAgB,EAAE,QAAQ,EAAG,EAAE;QAChC,MAAM,EACL,OAAO,EAAE,EAAE,aAAa,EAAE,eAAe,EAAE,YAAY,EAAE,GACzD,GAAG,QAAQ,CAAC;QAEb,MAAM,oBAAoB,GAAG,aAAa,CAAE,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAE,IAAI,CAAC,CAAC;QACtF,MAAM,sBAAsB,GAAG,eAAe,CAAE,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAE,IAAI,CAAC,CAAC;QAE1F,OAAO;YACN,MAAM,EAAE,CAAE,GAAG,GAAG,CAAC,MAAM,EAAE,oBAAoB,EAAE,sBAAsB,CAAE;YACvE,GAAG,CAAE,YAAY,IAAI,EAAE,YAAY,EAAE,CAAE;SACvC,CAAC;IACH,CAAC,EACD,EAAE,MAAM,EAAE,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,CACnC,CAAC;AACH,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isSamePlan =
|
|
3
|
+
exports.isSamePlan = isSamePlan;
|
|
4
4
|
const calypso_products_1 = require("@automattic/calypso-products");
|
|
5
5
|
function isSamePlan(currentSitePlanSlug, planSlug) {
|
|
6
6
|
// Handles matching variants of the free plan, like PLAN_P2_FREE and PLAN_JETPACK_FREE
|
|
@@ -8,5 +8,4 @@ function isSamePlan(currentSitePlanSlug, planSlug) {
|
|
|
8
8
|
? (0, calypso_products_1.isFreePlan)(planSlug)
|
|
9
9
|
: currentSitePlanSlug === planSlug;
|
|
10
10
|
}
|
|
11
|
-
exports.isSamePlan = isSamePlan;
|
|
12
11
|
//# sourceMappingURL=is-same-plan.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-same-plan.js","sourceRoot":"","sources":["../../../src/lib/is-same-plan.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"is-same-plan.js","sourceRoot":"","sources":["../../../src/lib/is-same-plan.ts"],"names":[],"mappings":";;AAEA,gCAKC;AAPD,mEAAoF;AAEpF,SAAgB,UAAU,CAAE,mBAA2B,EAAE,QAAkB;IAC1E,sFAAsF;IACtF,OAAO,mBAAmB,KAAK,4BAAS;QACvC,CAAC,CAAC,IAAA,6BAAU,EAAE,QAAQ,CAAE;QACxB,CAAC,CAAC,mBAAmB,KAAK,QAAQ,CAAC;AACrC,CAAC"}
|
|
@@ -1,39 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sortPlans =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
// Try to find the current paid plan in the plans list
|
|
9
|
-
if (currentSitePlanProductSlug && !(0, calypso_products_1.isFreePlan)(currentSitePlanProductSlug)) {
|
|
10
|
-
firstPlanIndex = gridPlans.findIndex((gridPlan) => {
|
|
11
|
-
return gridPlan.planSlug === currentSitePlanProductSlug;
|
|
12
|
-
});
|
|
3
|
+
exports.sortPlans = sortPlans;
|
|
4
|
+
function sortPlans(gridPlans, currentSitePlanProductSlug) {
|
|
5
|
+
// If we don't have plans to sort, return empty array
|
|
6
|
+
if (!gridPlans.length) {
|
|
7
|
+
return [];
|
|
13
8
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
// If we have a current site plan and we're on mobile, sort to prioritize it
|
|
10
|
+
if (currentSitePlanProductSlug) {
|
|
11
|
+
return [...gridPlans].sort((planA, planB) => {
|
|
12
|
+
// If planA is the current plan, it should come first (-1 moves it up)
|
|
13
|
+
if (planA.planSlug === currentSitePlanProductSlug) {
|
|
14
|
+
return -1;
|
|
15
|
+
}
|
|
16
|
+
// If planB is the current plan, it should come first (1 moves planA down)
|
|
17
|
+
if (planB.planSlug === currentSitePlanProductSlug) {
|
|
18
|
+
return 1;
|
|
19
|
+
}
|
|
20
|
+
// Otherwise, maintain original order
|
|
21
|
+
return 0;
|
|
18
22
|
});
|
|
19
|
-
// If the popular plan exists, on mobile, it will be second plan for comparison.
|
|
20
|
-
if (firstPlanIndex > 0 && isMobile) {
|
|
21
|
-
firstPlanIndex = firstPlanIndex - 1;
|
|
22
|
-
}
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
return gridPlans;
|
|
26
|
-
}
|
|
27
|
-
return [
|
|
28
|
-
// The first plan
|
|
29
|
-
gridPlans[firstPlanIndex],
|
|
30
|
-
// Rest of the plans in default order
|
|
31
|
-
...gridPlans.slice(firstPlanIndex + 1),
|
|
32
|
-
// Leftover plans (before the first plan) in descending order of value
|
|
33
|
-
...gridPlans.slice(0, firstPlanIndex).sort((planA, planB) => {
|
|
34
|
-
return ((planB?.pricing.originalPrice.full || 0) - (planA?.pricing.originalPrice.full || 0));
|
|
35
|
-
}),
|
|
36
|
-
].filter((gridPlan) => Boolean(gridPlan));
|
|
24
|
+
return [...gridPlans];
|
|
37
25
|
}
|
|
38
|
-
exports.sortPlans = sortPlans;
|
|
39
26
|
//# sourceMappingURL=sort-plan-properties.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sort-plan-properties.js","sourceRoot":"","sources":["../../../src/lib/sort-plan-properties.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sort-plan-properties.js","sourceRoot":"","sources":["../../../src/lib/sort-plan-properties.ts"],"names":[],"mappings":";;AAEA,8BAwBC;AAxBD,SAAgB,SAAS,CACxB,SAAqB,EACrB,0BAA0C;IAE1C,qDAAqD;IACrD,IAAK,CAAE,SAAS,CAAC,MAAM,EAAG,CAAC;QAC1B,OAAO,EAAE,CAAC;IACX,CAAC;IACD,4EAA4E;IAC5E,IAAK,0BAA0B,EAAG,CAAC;QAClC,OAAO,CAAE,GAAG,SAAS,CAAE,CAAC,IAAI,CAAE,CAAE,KAAK,EAAE,KAAK,EAAG,EAAE;YAChD,sEAAsE;YACtE,IAAK,KAAK,CAAC,QAAQ,KAAK,0BAA0B,EAAG,CAAC;gBACrD,OAAO,CAAC,CAAC,CAAC;YACX,CAAC;YACD,0EAA0E;YAC1E,IAAK,KAAK,CAAC,QAAQ,KAAK,0BAA0B,EAAG,CAAC;gBACrD,OAAO,CAAC,CAAC;YACV,CAAC;YACD,qCAAqC;YACrC,OAAO,CAAC,CAAC;QACV,CAAC,CAAE,CAAC;IACL,CAAC;IACD,OAAO,CAAE,GAAG,SAAS,CAAE,CAAC;AACzB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.hasTouch =
|
|
3
|
+
exports.hasTouch = hasTouch;
|
|
4
4
|
// eslint-disable-next-line inclusive-language/use-inclusive-words
|
|
5
5
|
/**
|
|
6
6
|
* This test is for touch events.
|
|
@@ -16,5 +16,4 @@ function hasTouch() {
|
|
|
16
16
|
return (window &&
|
|
17
17
|
('ontouchstart' in window || (window.DocumentTouch && document instanceof DocumentTouch)));
|
|
18
18
|
}
|
|
19
|
-
exports.hasTouch = hasTouch;
|
|
20
19
|
//# sourceMappingURL=index.js.map
|