@alipay/ams-checkout 2.0.25 → 2.0.27
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/ams-checkout.js +3 -3
- package/dist/ams-checkout.min.js +1 -1
- package/esm/config/index.js +1 -1
- package/esm/core/component/element/elementController/index.js +4 -3
- package/esm/core/component/element/modernElementController/index.d.ts +1 -1
- package/esm/core/component/element/modernElementController/index.js +71 -62
- package/esm/core/component/element/type.d.ts +2 -2
- package/esm/foundation/service/log/keys.js +4 -0
- package/esm/index.d.ts +6 -7
- package/esm/index.js +9 -14
- package/esm/modern/index.js +1 -1
- package/esm/modern/sdk/elements/appearanceRules.d.ts +59 -0
- package/esm/modern/tools.js +1 -1
- package/esm/tsdoc-metadata.json +1 -1
- package/esm/util/logger.js +1 -1
- package/package.json +12 -12
- package/types.d.ts +193 -32
- package/types.untrimmed.d.ts +193 -32
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { PickAppearance } from '@antintl/opensdk-core';
|
|
2
|
+
/** Semantic states accepted by the merchant selector grammar. */
|
|
3
|
+
type AppearanceRuleState = 'hover' | 'focus' | 'focus-visible' | 'active' | 'disabled' | 'loading' | 'selected' | 'checked' | 'expanded' | 'invalid' | 'success' | 'error';
|
|
4
|
+
/** Controlled pseudo-class accepted by the merchant selector grammar. */
|
|
5
|
+
type AppearanceRulePseudoClass = 'autofill';
|
|
6
|
+
/** Controlled pseudo-element accepted by the merchant selector grammar. */
|
|
7
|
+
type AppearanceRulePseudoElement = 'placeholder' | 'selection';
|
|
8
|
+
/**
|
|
9
|
+
* Optional state or controlled pseudo suffix on one alias.
|
|
10
|
+
*/
|
|
11
|
+
export type AppearanceRuleScopeSuffix = '' | `:${AppearanceRuleState | AppearanceRulePseudoClass}` | `::${AppearanceRulePseudoElement}`;
|
|
12
|
+
/** One merchant alias with an optional semantic suffix. */
|
|
13
|
+
export type AppearanceRuleSelector<RuleAlias extends string> = `${RuleAlias}${AppearanceRuleScopeSuffix}`;
|
|
14
|
+
/** Paint-only property names exposed by the SDK contract. */
|
|
15
|
+
export type AppearancePaintProperty = 'color' | 'WebkitTextFillColor' | 'textDecorationColor' | 'textDecorationLine' | 'textDecorationStyle' | 'textShadow' | 'backgroundColor' | 'borderColor' | 'borderTopColor' | 'borderRightColor' | 'borderBottomColor' | 'borderLeftColor' | 'borderRadius' | 'borderTopLeftRadius' | 'borderTopRightRadius' | 'borderBottomRightRadius' | 'borderBottomLeftRadius' | 'borderStyle' | 'boxShadow' | 'fill' | 'stroke' | 'fillOpacity' | 'strokeOpacity' | 'strokeWidth' | 'outlineColor' | 'outlineStyle' | 'outlineWidth' | 'outlineOffset' | 'caretColor' | 'accentColor';
|
|
16
|
+
/** Controlled layout longhands intersected with the concrete Part at runtime. */
|
|
17
|
+
export type AppearanceLayoutProperty = 'marginTop' | 'marginRight' | 'marginBottom' | 'marginLeft' | 'paddingTop' | 'paddingRight' | 'paddingBottom' | 'paddingLeft' | 'height';
|
|
18
|
+
/** Exact official spacing Token accepted by controlled margin and padding. */
|
|
19
|
+
export type AppearanceSpacingToken = `var(--spacing-${'base' | 'none' | '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl'})`;
|
|
20
|
+
/** Runtime-constrained non-negative integer pixel value for spacing longhands. */
|
|
21
|
+
export type AppearanceSpacingValue = '0' | `${number}px` | AppearanceSpacingToken;
|
|
22
|
+
/** Paint declarations accepted before WebApp and Components runtime validation. */
|
|
23
|
+
type AppearancePaintDeclarations = Partial<Record<Exclude<AppearancePaintProperty, 'fillOpacity' | 'strokeOpacity' | 'strokeWidth' | 'textDecorationStyle' | 'outlineStyle'>, string> & Record<'fillOpacity' | 'strokeOpacity' | 'strokeWidth', string | number> & {
|
|
24
|
+
textDecorationStyle: '-moz-initial' | 'inherit' | 'initial' | 'revert' | 'revert-layer' | 'unset' | 'dashed' | 'dotted' | 'double' | 'solid' | 'wavy';
|
|
25
|
+
outlineStyle: '-moz-initial' | 'inherit' | 'initial' | 'revert' | 'revert-layer' | 'unset' | 'auto' | 'dashed' | 'dotted' | 'double' | 'groove' | 'inset' | 'none' | 'outset' | 'ridge' | 'solid';
|
|
26
|
+
}>;
|
|
27
|
+
/** Target-level layout declarations admitted before runtime capability intersection. */
|
|
28
|
+
export type AppearanceLayoutDeclarations = {
|
|
29
|
+
[Property in Exclude<AppearanceLayoutProperty, 'height'>]?: AppearanceSpacingValue;
|
|
30
|
+
} & {
|
|
31
|
+
/** Exact integer-pixel enum allocated by the target contract. */
|
|
32
|
+
readonly height?: `${number}px`;
|
|
33
|
+
};
|
|
34
|
+
/** Paint declarations plus controlled typography and target-level layout fields. */
|
|
35
|
+
type AppearanceRuleDeclarations = AppearancePaintDeclarations & AppearanceLayoutDeclarations & {
|
|
36
|
+
/** Single font family identifier admitted only for authorized targets at runtime. */
|
|
37
|
+
readonly fontFamily?: string;
|
|
38
|
+
/** Integer pixel size admitted only for authorized text targets at runtime. */
|
|
39
|
+
readonly fontSize?: `${number}px`;
|
|
40
|
+
/** Controlled font weight admitted only for authorized text targets at runtime. */
|
|
41
|
+
readonly fontWeight?: 400 | 500 | 600 | 700;
|
|
42
|
+
/** Controlled font style admitted only for authorized text targets at runtime. */
|
|
43
|
+
readonly fontStyle?: 'normal' | 'italic';
|
|
44
|
+
};
|
|
45
|
+
/** Builds an Antom appearance type with the restricted Rules declaration contract. */
|
|
46
|
+
export type PickAntomAppearance<T extends Record<string, any>> = PickAppearance<T, AppearanceRuleDeclarations>;
|
|
47
|
+
type AppearanceRulesAppConfig = {
|
|
48
|
+
appearance?: {
|
|
49
|
+
rules?: unknown;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Resets stored Rules before the core deep merge handles an explicit empty patch.
|
|
54
|
+
*
|
|
55
|
+
* @param currentConfig - Current complete SDK configuration.
|
|
56
|
+
* @param update - Merchant configuration patch being merged.
|
|
57
|
+
*/
|
|
58
|
+
export declare function prepareAppearanceRulesUpdate(currentConfig: AppearanceRulesAppConfig, update: AppearanceRulesAppConfig): void;
|
|
59
|
+
export {};
|