@repobit/dex-store-elements 1.5.2 → 1.6.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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,21 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.6.0](https://github.com/bitdefender/dex-core/compare/@repobit/dex-store-elements@1.5.3...@repobit/dex-store-elements@1.6.0) (2026-07-20)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **DEX-24668:** fixed trial links with duration
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## [1.5.3](https://github.com/bitdefender/dex-core/compare/@repobit/dex-store-elements@1.5.2...@repobit/dex-store-elements@1.5.3) (2026-07-17)
|
|
14
|
+
|
|
15
|
+
**Note:** Version bump only for package @repobit/dex-store-elements
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
6
21
|
## [1.5.2](https://github.com/bitdefender/dex-core/compare/@repobit/dex-store-elements@1.5.1...@repobit/dex-store-elements@1.5.2) (2026-07-16)
|
|
7
22
|
|
|
8
23
|
**Note:** Version bump only for package @repobit/dex-store-elements
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trialLink.js","sourceRoot":"","sources":["../../../../src/renders/attributes/trialLink.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAe,EAAE,GAAmB,EAAE,EAAE;IACtE,MAAM,EAAE,cAAc,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC;IACtC,IAAI,cAAc,KAAK,SAAS;QAAE,OAAO;IACzC,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC;IAC1B,IAAI,CAAC,MAAM;QAAE,OAAO;IAEpB,MAAM,IAAI,GAAG,aAAa,CAAC,EAAE,CAAC,CAAC;IAC/B,IAAI,CAAC,IAAI;QAAE,OAAO;IAElB,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,YAAY,
|
|
1
|
+
{"version":3,"file":"trialLink.js","sourceRoot":"","sources":["../../../../src/renders/attributes/trialLink.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAe,EAAE,GAAmB,EAAE,EAAE;IACtE,MAAM,EAAE,cAAc,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC;IACtC,IAAI,cAAc,KAAK,SAAS;QAAE,OAAO;IACzC,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC;IAC1B,IAAI,CAAC,MAAM;QAAE,OAAO;IAEpB,MAAM,IAAI,GAAG,aAAa,CAAC,EAAE,CAAC,CAAC;IAC/B,IAAI,CAAC,IAAI;QAAE,OAAO;IAElB,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,YAAY,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC;AACxD,CAAC,CAAC","sourcesContent":["import type { UnifiedContext } from '../context';\nimport { resolveAnchor } from './utilty';\n\nexport const handleTrialLink = (el: HTMLElement, ctx: UnifiedContext) => {\n const { storeTrialLink } = el.dataset;\n if (storeTrialLink === undefined) return;\n const option = ctx.option;\n if (!option) return;\n\n const link = resolveAnchor(el);\n if (!link) return;\n\n link.href = option.getTrialLink(storeTrialLink) || '';\n};\n"]}
|
|
@@ -16,7 +16,7 @@ export const toDSLContext = async ({ option, product, state, derived }) => {
|
|
|
16
16
|
},
|
|
17
17
|
links: {
|
|
18
18
|
buy: option.getBuyLink(),
|
|
19
|
-
trial: option.getTrialLink()
|
|
19
|
+
trial: (trialDuration) => option.getTrialLink(trialDuration)
|
|
20
20
|
},
|
|
21
21
|
devices: option.getDevices(),
|
|
22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CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAEvE,OAAO,SAAS,CAAC,IAAI,EAAE,KAAK,IAAI,EAAE,CAAe,CAAC;AACpD,CAAC,CAAC","sourcesContent":["import type { derivedContextType } from '@/contexts/context.derived';\nimport type { stateContextType } from '@/contexts/context.state';\nimport type { Product, ProductOption } from '@repobit/dex-store';\nimport deepmerge from 'deepmerge';\n\nexport type UnifiedContext = {\n option? : ProductOption | null;\n product?: Product | null;\n state? : stateContextType;\n derived?: derivedContextType | null;\n};\n\n// Context shape used by the DSL compilers\nexport type DSLContext = Record<string, unknown>;\n\nexport const toDSLContext = async ({ option, product, state, derived }: UnifiedContext): Promise<DSLContext> => {\n const optionCtx = option\n ? {\n price: {\n full : option.getPrice({ currency: true }),\n discounted : option.getDiscountedPrice({ currency: true }),\n fullMonthly : option.getPrice({ monthly: true, currency: true }),\n discountedMonthly: option.getDiscountedPrice({ monthly: true, currency: true })\n },\n discount: {\n percentage : option.getDiscount({ percentage: true, symbol: true }),\n percentageMonthly: option.getDiscount({ percentage: true, monthly: true, symbol: true }),\n value : option.getDiscount({ percentage: false, symbol: true }),\n valueMonthly : option.getDiscount({ percentage: false, monthly: true, symbol: true })\n },\n links: {\n buy : option.getBuyLink(),\n trial: (trialDuration: string) => option.getTrialLink(trialDuration)\n },\n devices : option.getDevices(),\n subscription: option.getSubscription()\n }\n : undefined;\n\n // derive product details from option when available\n const productCtx = product\n ? {\n id : product.getId(),\n campaign: product.getCampaign(),\n name : product.getName()\n }\n : option\n ? {\n id : option.getProduct().getId(),\n campaign: option.getProduct().getCampaign(),\n name : option.getProduct().getName()\n }\n : undefined;\n\n const stateCtx = state\n ? {\n price: {\n full: {\n min : state.price.min.fmt,\n max : state.price.max.fmt,\n monthly: {\n min: state.price.monthly.min.fmt,\n max: state.price.monthly.max.fmt\n }\n },\n discounted: {\n min : state.discountedPrice.min.fmt,\n max : state.discountedPrice.max.fmt,\n monthly: {\n min: state.discountedPrice.monthly.min.fmt,\n max: state.discountedPrice.monthly.max.fmt\n }\n }\n },\n discount: {\n percentage: {\n min : state.discount.percentage.min.fmt,\n max : state.discount.percentage.max.fmt,\n monthly: {\n min: state.discount.percentage.monthly.min.fmt,\n max: state.discount.percentage.monthly.max.fmt\n }\n },\n value: {\n min : state.discount.min.fmt,\n max : state.discount.max.fmt,\n monthly: {\n min: state.discount.monthly.min.fmt,\n max: state.discount.monthly.max.fmt\n }\n }\n }\n }\n : undefined;\n\n const base: Record<string, unknown> = {\n option : optionCtx,\n product: productCtx,\n state : stateCtx,\n ctx : stateCtx\n };\n\n const extra = derived ? await derived({ option, product, state }) : {};\n\n return deepmerge(base, extra || {}) as DSLContext;\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@repobit/dex-store-elements",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "HTML elements layer for pricings",
|
|
5
5
|
"author": "Buga Adrian Alexandru <abuga@bitdefender.com>",
|
|
6
6
|
"homepage": "https://github.com/bitdefender/dex-core#readme",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@lit/context": "^1.1.6",
|
|
54
54
|
"@lit/task": "^1.0.3",
|
|
55
|
-
"@repobit/dex-store": "1.
|
|
55
|
+
"@repobit/dex-store": "1.4.0",
|
|
56
56
|
"eta": "^4.5.1",
|
|
57
57
|
"nanomorph": "^5.4.3"
|
|
58
58
|
},
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
]
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "fda99147bdf326dcff5282da94327793181df84f"
|
|
67
67
|
}
|