@djvlc/contracts-types 1.8.6 → 1.9.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/index.d.mts +138 -11
- package/dist/index.d.ts +138 -11
- package/dist/index.js +51 -0
- package/dist/index.mjs +48 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1468,7 +1468,12 @@ interface LoopConfig {
|
|
|
1468
1468
|
interface ComponentNode {
|
|
1469
1469
|
/** 节点唯一 ID(页面内唯一) */
|
|
1470
1470
|
id: UniqueId;
|
|
1471
|
-
/**
|
|
1471
|
+
/**
|
|
1472
|
+
* 组件标签名(Custom Element 格式,如 djvlc-button)
|
|
1473
|
+
*
|
|
1474
|
+
* 用于 `document.createElement(componentType)` 和 `customElements.get(componentType)`。
|
|
1475
|
+
* 命名规范:`djvlc-<name>`,全小写,必须包含连字符。
|
|
1476
|
+
*/
|
|
1472
1477
|
componentType: string;
|
|
1473
1478
|
/** 组件版本(锁定到具体版本) */
|
|
1474
1479
|
componentVersion: SemVer;
|
|
@@ -2067,6 +2072,95 @@ interface PageDraft {
|
|
|
2067
2072
|
updatedAt: ISODateTime;
|
|
2068
2073
|
}
|
|
2069
2074
|
|
|
2075
|
+
/**
|
|
2076
|
+
* 内置组件常量定义
|
|
2077
|
+
*
|
|
2078
|
+
* @description
|
|
2079
|
+
* 定义平台内置(bundled)的基础组件列表。
|
|
2080
|
+
* 这些组件随 Runtime 一起打包分发,不需要从 CDN 动态加载。
|
|
2081
|
+
*
|
|
2082
|
+
* 命名规范:
|
|
2083
|
+
* 所有组件统一使用 `djvlc-<name>` 格式,因为:
|
|
2084
|
+
* - 这是合法的 Custom Element 标签名(浏览器要求包含连字符)
|
|
2085
|
+
* - 全链路统一:PageSchema componentType / Manifest name / customElements.define()
|
|
2086
|
+
* - 无需在运行时做格式转换
|
|
2087
|
+
*
|
|
2088
|
+
* 使用方:
|
|
2089
|
+
* - Editor:硬编码识别基础组件,用于组件面板分区展示
|
|
2090
|
+
* - Platform:发布时生成 Manifest,自动填充 source: 'bundled'
|
|
2091
|
+
* - Runtime:启动时预注册,跳过 CDN 加载
|
|
2092
|
+
*
|
|
2093
|
+
* @example
|
|
2094
|
+
* ```typescript
|
|
2095
|
+
* import { BUILTIN_COMPONENT_NAMES, isBuiltinComponent } from '@djvlc/contracts-types';
|
|
2096
|
+
*
|
|
2097
|
+
* isBuiltinComponent('djvlc-button'); // true
|
|
2098
|
+
* isBuiltinComponent('djvlc-claim-card'); // false(业务组件不在内置列表)
|
|
2099
|
+
* ```
|
|
2100
|
+
*/
|
|
2101
|
+
/**
|
|
2102
|
+
* 组件来源
|
|
2103
|
+
*
|
|
2104
|
+
* - `bundled`: 内置组件,随 Runtime 打包,启动时直接可用
|
|
2105
|
+
* - `remote`: 远程组件,运行时从 CDN 动态加载
|
|
2106
|
+
*/
|
|
2107
|
+
type ComponentSource = 'bundled' | 'remote';
|
|
2108
|
+
/**
|
|
2109
|
+
* 组件命名前缀
|
|
2110
|
+
*
|
|
2111
|
+
* 所有组件(内置和远程)的 Custom Element 标签名前缀。
|
|
2112
|
+
* 格式:`djvlc-<name>`,符合 Custom Element 命名规范。
|
|
2113
|
+
*/
|
|
2114
|
+
declare const COMPONENT_TAG_PREFIX = "djvlc-";
|
|
2115
|
+
/**
|
|
2116
|
+
* 平台内置基础组件名称列表
|
|
2117
|
+
*
|
|
2118
|
+
* @description
|
|
2119
|
+
* 格式为 `djvlc-<name>`,可直接用于:
|
|
2120
|
+
* - `document.createElement('djvlc-button')`
|
|
2121
|
+
* - `customElements.get('djvlc-button')`
|
|
2122
|
+
* - PageSchema 的 `componentType` 字段
|
|
2123
|
+
* - Manifest 的 `name` 字段
|
|
2124
|
+
*
|
|
2125
|
+
* 这些组件是平台的基础能力,随 Runtime 一起构建和分发:
|
|
2126
|
+
* - 几乎每个页面都会用到,内置可避免重复加载
|
|
2127
|
+
* - 不需要走 Registry 解析和 CDN 下载流程
|
|
2128
|
+
* - 不可被 kill-switch 阻断(核心依赖)
|
|
2129
|
+
*
|
|
2130
|
+
* 注意:不列版本号,内置组件版本跟随 Runtime 版本。
|
|
2131
|
+
*/
|
|
2132
|
+
declare const BUILTIN_COMPONENT_NAMES: readonly ["djvlc-text", "djvlc-image", "djvlc-button", "djvlc-icon", "djvlc-link", "djvlc-divider", "djvlc-container", "djvlc-row", "djvlc-col", "djvlc-spacer", "djvlc-form", "djvlc-background-image", "djvlc-dialog", "djvlc-loading", "djvlc-empty"];
|
|
2133
|
+
/**
|
|
2134
|
+
* 内置组件名称类型(字面量联合类型)
|
|
2135
|
+
*/
|
|
2136
|
+
type BuiltinComponentName = (typeof BUILTIN_COMPONENT_NAMES)[number];
|
|
2137
|
+
/**
|
|
2138
|
+
* 判断组件是否为平台内置组件
|
|
2139
|
+
*
|
|
2140
|
+
* @param componentName - 组件标签名(如 `djvlc-button`)
|
|
2141
|
+
* @returns 是否为内置组件
|
|
2142
|
+
*
|
|
2143
|
+
* @example
|
|
2144
|
+
* ```typescript
|
|
2145
|
+
* isBuiltinComponent('djvlc-button'); // true
|
|
2146
|
+
* isBuiltinComponent('djvlc-claim-card'); // false
|
|
2147
|
+
* ```
|
|
2148
|
+
*/
|
|
2149
|
+
declare function isBuiltinComponent(componentName: string): componentName is BuiltinComponentName;
|
|
2150
|
+
/**
|
|
2151
|
+
* 根据组件名称获取组件来源
|
|
2152
|
+
*
|
|
2153
|
+
* @param componentName - 组件标签名
|
|
2154
|
+
* @returns 组件来源类型
|
|
2155
|
+
*
|
|
2156
|
+
* @example
|
|
2157
|
+
* ```typescript
|
|
2158
|
+
* getComponentSource('djvlc-button'); // 'bundled'
|
|
2159
|
+
* getComponentSource('djvlc-claim-card'); // 'remote'
|
|
2160
|
+
* ```
|
|
2161
|
+
*/
|
|
2162
|
+
declare function getComponentSource(componentName: string): ComponentSource;
|
|
2163
|
+
|
|
2070
2164
|
/**
|
|
2071
2165
|
* 页面快照类型(CDN 产物核心结构)
|
|
2072
2166
|
*
|
|
@@ -2170,12 +2264,31 @@ interface SnapshotComponentEntry {
|
|
|
2170
2264
|
name: string;
|
|
2171
2265
|
/** 组件版本 */
|
|
2172
2266
|
version: SemVer;
|
|
2267
|
+
/**
|
|
2268
|
+
* 组件来源
|
|
2269
|
+
*
|
|
2270
|
+
* - `bundled`: 内置组件,随 Runtime 打包,Runtime 启动时已注册
|
|
2271
|
+
* - `remote`: 远程组件,需从 CDN 动态加载
|
|
2272
|
+
*
|
|
2273
|
+
* Runtime 据此决定是否跳过 CDN 加载。
|
|
2274
|
+
*/
|
|
2275
|
+
source: ComponentSource;
|
|
2173
2276
|
/** SRI 完整性哈希 */
|
|
2174
2277
|
integrity: SHAIntegrity;
|
|
2175
|
-
/**
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2278
|
+
/**
|
|
2279
|
+
* CDN 资源基础 URL
|
|
2280
|
+
*
|
|
2281
|
+
* - `source: 'remote'` 时必填
|
|
2282
|
+
* - `source: 'bundled'` 时留空
|
|
2283
|
+
*/
|
|
2284
|
+
assetsUrl?: string;
|
|
2285
|
+
/**
|
|
2286
|
+
* 入口点
|
|
2287
|
+
*
|
|
2288
|
+
* - `source: 'remote'` 时必填
|
|
2289
|
+
* - `source: 'bundled'` 时可省略
|
|
2290
|
+
*/
|
|
2291
|
+
entrypoints?: {
|
|
2179
2292
|
/** JS 入口(相对于 assetsUrl) */
|
|
2180
2293
|
js: string;
|
|
2181
2294
|
/** CSS 入口(可选) */
|
|
@@ -3021,7 +3134,7 @@ type ComponentCategory = 'basic' | 'layout' | 'form' | 'display' | 'feedback' |
|
|
|
3021
3134
|
interface Component {
|
|
3022
3135
|
/** 组件 ID */
|
|
3023
3136
|
id: UniqueId;
|
|
3024
|
-
/**
|
|
3137
|
+
/** 组件名称(Custom Element 标签名,唯一标识,如 djvlc-button) */
|
|
3025
3138
|
name: string;
|
|
3026
3139
|
/** 组件显示名称 */
|
|
3027
3140
|
displayName: string;
|
|
@@ -3215,7 +3328,7 @@ interface ComponentMeta {
|
|
|
3215
3328
|
* 组件注册请求
|
|
3216
3329
|
*/
|
|
3217
3330
|
interface ComponentRegisterRequest {
|
|
3218
|
-
/**
|
|
3331
|
+
/** 组件名称(Custom Element 标签名,如 djvlc-button) */
|
|
3219
3332
|
name: string;
|
|
3220
3333
|
/** 组件版本 */
|
|
3221
3334
|
version: SemVer;
|
|
@@ -3278,7 +3391,7 @@ interface ComponentQueryParams {
|
|
|
3278
3391
|
* 组件版本查询项(用于 ResolveVersionsRequest)
|
|
3279
3392
|
*/
|
|
3280
3393
|
interface ComponentVersionQuery {
|
|
3281
|
-
/** 组件名称(如
|
|
3394
|
+
/** 组件名称(如 djvlc-button) */
|
|
3282
3395
|
name: string;
|
|
3283
3396
|
/** 版本范围(如 ^1.0.0, >=1.0.0, 1.2.3) */
|
|
3284
3397
|
versionRange: string;
|
|
@@ -4527,8 +4640,22 @@ interface ManifestItem {
|
|
|
4527
4640
|
name: string;
|
|
4528
4641
|
/** 锁定的版本号 */
|
|
4529
4642
|
version: SemVer;
|
|
4530
|
-
/**
|
|
4531
|
-
|
|
4643
|
+
/**
|
|
4644
|
+
* 组件来源
|
|
4645
|
+
*
|
|
4646
|
+
* - `bundled`: 内置组件,随 Runtime 打包,无需 CDN 加载
|
|
4647
|
+
* - `remote`: 远程组件,需从 CDN 动态加载
|
|
4648
|
+
*
|
|
4649
|
+
* Platform 在生成 Manifest 时,通过 `isBuiltinComponent()` 自动判定。
|
|
4650
|
+
*/
|
|
4651
|
+
source: ComponentSource;
|
|
4652
|
+
/**
|
|
4653
|
+
* 入口文件 URL
|
|
4654
|
+
*
|
|
4655
|
+
* - `source: 'remote'` 时必填,指向 CDN 上的组件入口 JS
|
|
4656
|
+
* - `source: 'bundled'` 时留空(内置组件无需 CDN 入口)
|
|
4657
|
+
*/
|
|
4658
|
+
entry?: string;
|
|
4532
4659
|
/** 样式文件 URL(可选) */
|
|
4533
4660
|
styleEntry?: string;
|
|
4534
4661
|
/** SRI 完整性哈希 */
|
|
@@ -5163,4 +5290,4 @@ declare const VERSION = "1.0.0";
|
|
|
5163
5290
|
*/
|
|
5164
5291
|
declare const PROTOCOL_VERSION = "1.0.0";
|
|
5165
5292
|
|
|
5166
|
-
export { type ABTestRolloutConfig, ALLOWED_FUNCTION_NAMES, ALL_BUILTIN_FUNCTIONS, ARRAY_FUNCTIONS, type ActionClientContext, type ActionDefinition, type ActionDefinitionVersion, type ActionExecuteRequest, type ActionExecuteResponse, type ActionExecutor, type ActionPolicy, type ActionRef, type ActionResult, type ActionSheetItem, type ActionSheetOptions, type ActionSheetResult, type ActionSpec, ActionType, type Activity, type ActivityPrecondition, type ActivityRule, type ActivityStatus, type ActivityType, type AggregationDataSourceConfig, type AggregationQueryItem, type AnyValueOrExpression, type ApiErrorResponse, type ApiResponse, type ApiSuccessResponse, type AppContext, AuditAction, type AuditConfig, type AuditLogEntry, type BackgroundConfig, type BaseActivityRule, type BlacklistRolloutConfig, type BlockedComponentInfo, type BlockedComponentItem, type BootstrapConfig, type BrowserCompat, type BuiltinActionType, CURRENT_ACTION_SPEC_VERSION, CURRENT_COMPONENT_META_VERSION, CURRENT_DATA_QUERY_SPEC_VERSION, CURRENT_SCHEMA_VERSION, type CacheConfig, type CacheLevel, type CanaryHealthCheck, type CanaryRolloutConfig, type CanaryStage, type CanvasType, type CapabilityDeclaration, type CapabilityName, type ChangeLog, type ChangeLogItem, type ClaimActivityRule, type ClaimPrize, type ClaimRecord, type ClaimState, type ClipboardApi, type CompatInfo, type Component, type ComponentCategory, type ComponentContext, type ComponentDependency, type ComponentIntegrity, type ComponentMeta, type ComponentNode, type ComponentQueryParams, type ComponentRegisterRequest, type ComponentStatus, type ComponentStatusChangeRequest, type ComponentVersion, type ComponentVersionQuery, type ConfirmOptions, type ConsecutiveReward, type CreateManifestRequest, type CreatePageRequest, type CreatePreviewTokenRequest, type CreateTemplateRequest, type CumulativeReward, DATE_FUNCTIONS, DEFAULT_EXPRESSION_VALIDATION_CONFIG, DEPENDENCY_PREFIX, type DataBinding, type DataBindingErrorConfig, type DataLoadStrategy, type DataQueryDefinition, type DataQueryDefinitionVersion, type DataQueryRequest, type DataQueryResponse, type DataQuerySpec, type DataSourceConfig, type DataSourceType, type DatabaseDataSourceConfig, type DeepReadonly, type DefinitionVersionDigest, type DefinitionsDigest, type DependencyPrefix, type DialogOptions, type DialogResult, type DjvlcError, type EditorComponent, type Environment, ErrorCategory, ErrorCode, ErrorCodeToHttpStatus, type ErrorMapping, ErrorMessages, type EventDeclaration, type EventHandler, type ExecutorContext, type ExecutorResult, type Expression, type ExpressionContext, type ExpressionContextTyped, type ExpressionDependency, type ExpressionEventContext, type ExpressionFunctionCategory, type ExpressionFunctionDefinition, type ExpressionLocal, type ExpressionMeta, type ExpressionType, type ExpressionValidationConfig, type ExpressionValidationError, type ExpressionValidationResult, type ExpressionValidationWarning, FORMAT_FUNCTIONS, type FallbackCondition, type FallbackConfig, type FeatureCondition, type FeatureRolloutConfig, type FieldPermission, type FieldPolicy, type FieldTransform, type FileIntegrity, type FunctionParamDefinition, type GraphQLDataSourceConfig, type HostApi, type HttpDataSourceConfig, type HttpRetryConfig, type I18nDetectionStrategy, type ISODateTime, type IdempotencyKeyStrategy, type IdempotencyRule, type IntegrityHash, type InternalDataSourceConfig, type InventoryConfig, type JsonObject, type JsonValue, type KillSwitchItem, LOGIC_FUNCTIONS, type LayoutConfig, type LayoutValues, type LoopConfig, type LotteryActivityRule, type LotteryCost, type LotteryPrize, type LotteryState, type Manifest, type ManifestEntry, type ManifestItem, type ManifestValidationError, type ManifestValidationResult, type ManifestValidationWarning, type MaskingConfig, type MaskingRule, type MaskingType, type MethodCategory, type MethodDeclaration, type MethodParam, NUMBER_FUNCTIONS, type NavigateOptions, type NodeStyleConfig, type OperatorInfo, type OpsConfig, type OrderByItem, PROTOCOL_VERSION, type PageAssetsJson, type PageBehaviorConfig, type PageConfig, type PageDraft, type PageI18nConfig, type PageInfo, type PageIntegrityJson, type PageLayoutConfig, type PageLifecycle, type PageManifest, type PageMeta, type PageResolveRequest, type PageResolveResponse, type PageResolveWithSnapshotResponse, type PageSEO, type PageSchema, type PageSnapshotJson, type PageSnapshotManifest, type PageSnapshotMeta, type PageSnapshotPage, type PageState, PageStatus, type PageStatusType, type PageStylesConfig, type PageVersion, type PaginatedResponse, type PaginationMeta, type PaginationParams, type ParamPermission, type ParticipationLimit, type PercentageRolloutConfig, type PityConfig, type Precondition, type PreconditionType, type PreviewImageOptions, type PreviewToken, type PreviewTokenValidationResult, type ProbabilityConfig, type PropDefinition, type PropFormat, type PropGroup, type PropType, type PropsSchema, type PublishCdnConfig, PublishChannel, type PublishConfig, type PublishEnvironment, type PublishNotificationConfig, type PublishRecord, type PublishRolloutConfig, PublishStatus, type QueryPermissions, type RateLimitDimension, type RateLimitItem, type RateLimitRule, type RequestContext, type ResolveVersionsRequest, type ResolvedComponent, type ResolvedManifest, type ResponsiveBreakpoints, type RetryPolicy, type RiskControlConfig, type RolloutConfig, type RolloutMatchRequest, type RolloutMatchResult, type RolloutStrategy, type RolloutStrategyConfig, type RolloutStrategyType, type RuntimeContext, type RuntimeSpec, type SHAIntegrity, STRING_FUNCTIONS, type ScanCodeResult, type SchemaVersion, type SemVer, type ShareOptions, type ShareResult, type SigninActivityRule, type SigninRecord, type SigninRewardRecord, type SigninState, type SlotCategory, type SlotDeclaration, type SnapshotComponentEntry, type StateFieldDefinition, type StorageApi, type StorageOptions, type StyleConfig, type StyleIsolation, type TemplateInfo, TemplateParseError, type TemplateParseMode, type ThemeConfig, type TimeWindowRolloutConfig, type ToastOptions, type TrackEvent, type URLString, UTILITY_FUNCTIONS, type UniqueId, type UpdatePageRequest, type UpdateTemplateRequest, type UpsertRolloutRequest, type UserActivityState, type UserContext, VERSION, type ValidationRule, type VersionDiff, type VersionInfo, VersionStatus, type VersionStatusType, type ViewportConfig, type WhitelistRolloutConfig, bindingRef, createDjvlcError, createExpressionContext, createLoopLocal, dep, isDjvlcError, localRef, stateRef, template };
|
|
5293
|
+
export { type ABTestRolloutConfig, ALLOWED_FUNCTION_NAMES, ALL_BUILTIN_FUNCTIONS, ARRAY_FUNCTIONS, type ActionClientContext, type ActionDefinition, type ActionDefinitionVersion, type ActionExecuteRequest, type ActionExecuteResponse, type ActionExecutor, type ActionPolicy, type ActionRef, type ActionResult, type ActionSheetItem, type ActionSheetOptions, type ActionSheetResult, type ActionSpec, ActionType, type Activity, type ActivityPrecondition, type ActivityRule, type ActivityStatus, type ActivityType, type AggregationDataSourceConfig, type AggregationQueryItem, type AnyValueOrExpression, type ApiErrorResponse, type ApiResponse, type ApiSuccessResponse, type AppContext, AuditAction, type AuditConfig, type AuditLogEntry, BUILTIN_COMPONENT_NAMES, type BackgroundConfig, type BaseActivityRule, type BlacklistRolloutConfig, type BlockedComponentInfo, type BlockedComponentItem, type BootstrapConfig, type BrowserCompat, type BuiltinActionType, type BuiltinComponentName, COMPONENT_TAG_PREFIX, CURRENT_ACTION_SPEC_VERSION, CURRENT_COMPONENT_META_VERSION, CURRENT_DATA_QUERY_SPEC_VERSION, CURRENT_SCHEMA_VERSION, type CacheConfig, type CacheLevel, type CanaryHealthCheck, type CanaryRolloutConfig, type CanaryStage, type CanvasType, type CapabilityDeclaration, type CapabilityName, type ChangeLog, type ChangeLogItem, type ClaimActivityRule, type ClaimPrize, type ClaimRecord, type ClaimState, type ClipboardApi, type CompatInfo, type Component, type ComponentCategory, type ComponentContext, type ComponentDependency, type ComponentIntegrity, type ComponentMeta, type ComponentNode, type ComponentQueryParams, type ComponentRegisterRequest, type ComponentSource, type ComponentStatus, type ComponentStatusChangeRequest, type ComponentVersion, type ComponentVersionQuery, type ConfirmOptions, type ConsecutiveReward, type CreateManifestRequest, type CreatePageRequest, type CreatePreviewTokenRequest, type CreateTemplateRequest, type CumulativeReward, DATE_FUNCTIONS, DEFAULT_EXPRESSION_VALIDATION_CONFIG, DEPENDENCY_PREFIX, type DataBinding, type DataBindingErrorConfig, type DataLoadStrategy, type DataQueryDefinition, type DataQueryDefinitionVersion, type DataQueryRequest, type DataQueryResponse, type DataQuerySpec, type DataSourceConfig, type DataSourceType, type DatabaseDataSourceConfig, type DeepReadonly, type DefinitionVersionDigest, type DefinitionsDigest, type DependencyPrefix, type DialogOptions, type DialogResult, type DjvlcError, type EditorComponent, type Environment, ErrorCategory, ErrorCode, ErrorCodeToHttpStatus, type ErrorMapping, ErrorMessages, type EventDeclaration, type EventHandler, type ExecutorContext, type ExecutorResult, type Expression, type ExpressionContext, type ExpressionContextTyped, type ExpressionDependency, type ExpressionEventContext, type ExpressionFunctionCategory, type ExpressionFunctionDefinition, type ExpressionLocal, type ExpressionMeta, type ExpressionType, type ExpressionValidationConfig, type ExpressionValidationError, type ExpressionValidationResult, type ExpressionValidationWarning, FORMAT_FUNCTIONS, type FallbackCondition, type FallbackConfig, type FeatureCondition, type FeatureRolloutConfig, type FieldPermission, type FieldPolicy, type FieldTransform, type FileIntegrity, type FunctionParamDefinition, type GraphQLDataSourceConfig, type HostApi, type HttpDataSourceConfig, type HttpRetryConfig, type I18nDetectionStrategy, type ISODateTime, type IdempotencyKeyStrategy, type IdempotencyRule, type IntegrityHash, type InternalDataSourceConfig, type InventoryConfig, type JsonObject, type JsonValue, type KillSwitchItem, LOGIC_FUNCTIONS, type LayoutConfig, type LayoutValues, type LoopConfig, type LotteryActivityRule, type LotteryCost, type LotteryPrize, type LotteryState, type Manifest, type ManifestEntry, type ManifestItem, type ManifestValidationError, type ManifestValidationResult, type ManifestValidationWarning, type MaskingConfig, type MaskingRule, type MaskingType, type MethodCategory, type MethodDeclaration, type MethodParam, NUMBER_FUNCTIONS, type NavigateOptions, type NodeStyleConfig, type OperatorInfo, type OpsConfig, type OrderByItem, PROTOCOL_VERSION, type PageAssetsJson, type PageBehaviorConfig, type PageConfig, type PageDraft, type PageI18nConfig, type PageInfo, type PageIntegrityJson, type PageLayoutConfig, type PageLifecycle, type PageManifest, type PageMeta, type PageResolveRequest, type PageResolveResponse, type PageResolveWithSnapshotResponse, type PageSEO, type PageSchema, type PageSnapshotJson, type PageSnapshotManifest, type PageSnapshotMeta, type PageSnapshotPage, type PageState, PageStatus, type PageStatusType, type PageStylesConfig, type PageVersion, type PaginatedResponse, type PaginationMeta, type PaginationParams, type ParamPermission, type ParticipationLimit, type PercentageRolloutConfig, type PityConfig, type Precondition, type PreconditionType, type PreviewImageOptions, type PreviewToken, type PreviewTokenValidationResult, type ProbabilityConfig, type PropDefinition, type PropFormat, type PropGroup, type PropType, type PropsSchema, type PublishCdnConfig, PublishChannel, type PublishConfig, type PublishEnvironment, type PublishNotificationConfig, type PublishRecord, type PublishRolloutConfig, PublishStatus, type QueryPermissions, type RateLimitDimension, type RateLimitItem, type RateLimitRule, type RequestContext, type ResolveVersionsRequest, type ResolvedComponent, type ResolvedManifest, type ResponsiveBreakpoints, type RetryPolicy, type RiskControlConfig, type RolloutConfig, type RolloutMatchRequest, type RolloutMatchResult, type RolloutStrategy, type RolloutStrategyConfig, type RolloutStrategyType, type RuntimeContext, type RuntimeSpec, type SHAIntegrity, STRING_FUNCTIONS, type ScanCodeResult, type SchemaVersion, type SemVer, type ShareOptions, type ShareResult, type SigninActivityRule, type SigninRecord, type SigninRewardRecord, type SigninState, type SlotCategory, type SlotDeclaration, type SnapshotComponentEntry, type StateFieldDefinition, type StorageApi, type StorageOptions, type StyleConfig, type StyleIsolation, type TemplateInfo, TemplateParseError, type TemplateParseMode, type ThemeConfig, type TimeWindowRolloutConfig, type ToastOptions, type TrackEvent, type URLString, UTILITY_FUNCTIONS, type UniqueId, type UpdatePageRequest, type UpdateTemplateRequest, type UpsertRolloutRequest, type UserActivityState, type UserContext, VERSION, type ValidationRule, type VersionDiff, type VersionInfo, VersionStatus, type VersionStatusType, type ViewportConfig, type WhitelistRolloutConfig, bindingRef, createDjvlcError, createExpressionContext, createLoopLocal, dep, getComponentSource, isBuiltinComponent, isDjvlcError, localRef, stateRef, template };
|
package/dist/index.d.ts
CHANGED
|
@@ -1468,7 +1468,12 @@ interface LoopConfig {
|
|
|
1468
1468
|
interface ComponentNode {
|
|
1469
1469
|
/** 节点唯一 ID(页面内唯一) */
|
|
1470
1470
|
id: UniqueId;
|
|
1471
|
-
/**
|
|
1471
|
+
/**
|
|
1472
|
+
* 组件标签名(Custom Element 格式,如 djvlc-button)
|
|
1473
|
+
*
|
|
1474
|
+
* 用于 `document.createElement(componentType)` 和 `customElements.get(componentType)`。
|
|
1475
|
+
* 命名规范:`djvlc-<name>`,全小写,必须包含连字符。
|
|
1476
|
+
*/
|
|
1472
1477
|
componentType: string;
|
|
1473
1478
|
/** 组件版本(锁定到具体版本) */
|
|
1474
1479
|
componentVersion: SemVer;
|
|
@@ -2067,6 +2072,95 @@ interface PageDraft {
|
|
|
2067
2072
|
updatedAt: ISODateTime;
|
|
2068
2073
|
}
|
|
2069
2074
|
|
|
2075
|
+
/**
|
|
2076
|
+
* 内置组件常量定义
|
|
2077
|
+
*
|
|
2078
|
+
* @description
|
|
2079
|
+
* 定义平台内置(bundled)的基础组件列表。
|
|
2080
|
+
* 这些组件随 Runtime 一起打包分发,不需要从 CDN 动态加载。
|
|
2081
|
+
*
|
|
2082
|
+
* 命名规范:
|
|
2083
|
+
* 所有组件统一使用 `djvlc-<name>` 格式,因为:
|
|
2084
|
+
* - 这是合法的 Custom Element 标签名(浏览器要求包含连字符)
|
|
2085
|
+
* - 全链路统一:PageSchema componentType / Manifest name / customElements.define()
|
|
2086
|
+
* - 无需在运行时做格式转换
|
|
2087
|
+
*
|
|
2088
|
+
* 使用方:
|
|
2089
|
+
* - Editor:硬编码识别基础组件,用于组件面板分区展示
|
|
2090
|
+
* - Platform:发布时生成 Manifest,自动填充 source: 'bundled'
|
|
2091
|
+
* - Runtime:启动时预注册,跳过 CDN 加载
|
|
2092
|
+
*
|
|
2093
|
+
* @example
|
|
2094
|
+
* ```typescript
|
|
2095
|
+
* import { BUILTIN_COMPONENT_NAMES, isBuiltinComponent } from '@djvlc/contracts-types';
|
|
2096
|
+
*
|
|
2097
|
+
* isBuiltinComponent('djvlc-button'); // true
|
|
2098
|
+
* isBuiltinComponent('djvlc-claim-card'); // false(业务组件不在内置列表)
|
|
2099
|
+
* ```
|
|
2100
|
+
*/
|
|
2101
|
+
/**
|
|
2102
|
+
* 组件来源
|
|
2103
|
+
*
|
|
2104
|
+
* - `bundled`: 内置组件,随 Runtime 打包,启动时直接可用
|
|
2105
|
+
* - `remote`: 远程组件,运行时从 CDN 动态加载
|
|
2106
|
+
*/
|
|
2107
|
+
type ComponentSource = 'bundled' | 'remote';
|
|
2108
|
+
/**
|
|
2109
|
+
* 组件命名前缀
|
|
2110
|
+
*
|
|
2111
|
+
* 所有组件(内置和远程)的 Custom Element 标签名前缀。
|
|
2112
|
+
* 格式:`djvlc-<name>`,符合 Custom Element 命名规范。
|
|
2113
|
+
*/
|
|
2114
|
+
declare const COMPONENT_TAG_PREFIX = "djvlc-";
|
|
2115
|
+
/**
|
|
2116
|
+
* 平台内置基础组件名称列表
|
|
2117
|
+
*
|
|
2118
|
+
* @description
|
|
2119
|
+
* 格式为 `djvlc-<name>`,可直接用于:
|
|
2120
|
+
* - `document.createElement('djvlc-button')`
|
|
2121
|
+
* - `customElements.get('djvlc-button')`
|
|
2122
|
+
* - PageSchema 的 `componentType` 字段
|
|
2123
|
+
* - Manifest 的 `name` 字段
|
|
2124
|
+
*
|
|
2125
|
+
* 这些组件是平台的基础能力,随 Runtime 一起构建和分发:
|
|
2126
|
+
* - 几乎每个页面都会用到,内置可避免重复加载
|
|
2127
|
+
* - 不需要走 Registry 解析和 CDN 下载流程
|
|
2128
|
+
* - 不可被 kill-switch 阻断(核心依赖)
|
|
2129
|
+
*
|
|
2130
|
+
* 注意:不列版本号,内置组件版本跟随 Runtime 版本。
|
|
2131
|
+
*/
|
|
2132
|
+
declare const BUILTIN_COMPONENT_NAMES: readonly ["djvlc-text", "djvlc-image", "djvlc-button", "djvlc-icon", "djvlc-link", "djvlc-divider", "djvlc-container", "djvlc-row", "djvlc-col", "djvlc-spacer", "djvlc-form", "djvlc-background-image", "djvlc-dialog", "djvlc-loading", "djvlc-empty"];
|
|
2133
|
+
/**
|
|
2134
|
+
* 内置组件名称类型(字面量联合类型)
|
|
2135
|
+
*/
|
|
2136
|
+
type BuiltinComponentName = (typeof BUILTIN_COMPONENT_NAMES)[number];
|
|
2137
|
+
/**
|
|
2138
|
+
* 判断组件是否为平台内置组件
|
|
2139
|
+
*
|
|
2140
|
+
* @param componentName - 组件标签名(如 `djvlc-button`)
|
|
2141
|
+
* @returns 是否为内置组件
|
|
2142
|
+
*
|
|
2143
|
+
* @example
|
|
2144
|
+
* ```typescript
|
|
2145
|
+
* isBuiltinComponent('djvlc-button'); // true
|
|
2146
|
+
* isBuiltinComponent('djvlc-claim-card'); // false
|
|
2147
|
+
* ```
|
|
2148
|
+
*/
|
|
2149
|
+
declare function isBuiltinComponent(componentName: string): componentName is BuiltinComponentName;
|
|
2150
|
+
/**
|
|
2151
|
+
* 根据组件名称获取组件来源
|
|
2152
|
+
*
|
|
2153
|
+
* @param componentName - 组件标签名
|
|
2154
|
+
* @returns 组件来源类型
|
|
2155
|
+
*
|
|
2156
|
+
* @example
|
|
2157
|
+
* ```typescript
|
|
2158
|
+
* getComponentSource('djvlc-button'); // 'bundled'
|
|
2159
|
+
* getComponentSource('djvlc-claim-card'); // 'remote'
|
|
2160
|
+
* ```
|
|
2161
|
+
*/
|
|
2162
|
+
declare function getComponentSource(componentName: string): ComponentSource;
|
|
2163
|
+
|
|
2070
2164
|
/**
|
|
2071
2165
|
* 页面快照类型(CDN 产物核心结构)
|
|
2072
2166
|
*
|
|
@@ -2170,12 +2264,31 @@ interface SnapshotComponentEntry {
|
|
|
2170
2264
|
name: string;
|
|
2171
2265
|
/** 组件版本 */
|
|
2172
2266
|
version: SemVer;
|
|
2267
|
+
/**
|
|
2268
|
+
* 组件来源
|
|
2269
|
+
*
|
|
2270
|
+
* - `bundled`: 内置组件,随 Runtime 打包,Runtime 启动时已注册
|
|
2271
|
+
* - `remote`: 远程组件,需从 CDN 动态加载
|
|
2272
|
+
*
|
|
2273
|
+
* Runtime 据此决定是否跳过 CDN 加载。
|
|
2274
|
+
*/
|
|
2275
|
+
source: ComponentSource;
|
|
2173
2276
|
/** SRI 完整性哈希 */
|
|
2174
2277
|
integrity: SHAIntegrity;
|
|
2175
|
-
/**
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2278
|
+
/**
|
|
2279
|
+
* CDN 资源基础 URL
|
|
2280
|
+
*
|
|
2281
|
+
* - `source: 'remote'` 时必填
|
|
2282
|
+
* - `source: 'bundled'` 时留空
|
|
2283
|
+
*/
|
|
2284
|
+
assetsUrl?: string;
|
|
2285
|
+
/**
|
|
2286
|
+
* 入口点
|
|
2287
|
+
*
|
|
2288
|
+
* - `source: 'remote'` 时必填
|
|
2289
|
+
* - `source: 'bundled'` 时可省略
|
|
2290
|
+
*/
|
|
2291
|
+
entrypoints?: {
|
|
2179
2292
|
/** JS 入口(相对于 assetsUrl) */
|
|
2180
2293
|
js: string;
|
|
2181
2294
|
/** CSS 入口(可选) */
|
|
@@ -3021,7 +3134,7 @@ type ComponentCategory = 'basic' | 'layout' | 'form' | 'display' | 'feedback' |
|
|
|
3021
3134
|
interface Component {
|
|
3022
3135
|
/** 组件 ID */
|
|
3023
3136
|
id: UniqueId;
|
|
3024
|
-
/**
|
|
3137
|
+
/** 组件名称(Custom Element 标签名,唯一标识,如 djvlc-button) */
|
|
3025
3138
|
name: string;
|
|
3026
3139
|
/** 组件显示名称 */
|
|
3027
3140
|
displayName: string;
|
|
@@ -3215,7 +3328,7 @@ interface ComponentMeta {
|
|
|
3215
3328
|
* 组件注册请求
|
|
3216
3329
|
*/
|
|
3217
3330
|
interface ComponentRegisterRequest {
|
|
3218
|
-
/**
|
|
3331
|
+
/** 组件名称(Custom Element 标签名,如 djvlc-button) */
|
|
3219
3332
|
name: string;
|
|
3220
3333
|
/** 组件版本 */
|
|
3221
3334
|
version: SemVer;
|
|
@@ -3278,7 +3391,7 @@ interface ComponentQueryParams {
|
|
|
3278
3391
|
* 组件版本查询项(用于 ResolveVersionsRequest)
|
|
3279
3392
|
*/
|
|
3280
3393
|
interface ComponentVersionQuery {
|
|
3281
|
-
/** 组件名称(如
|
|
3394
|
+
/** 组件名称(如 djvlc-button) */
|
|
3282
3395
|
name: string;
|
|
3283
3396
|
/** 版本范围(如 ^1.0.0, >=1.0.0, 1.2.3) */
|
|
3284
3397
|
versionRange: string;
|
|
@@ -4527,8 +4640,22 @@ interface ManifestItem {
|
|
|
4527
4640
|
name: string;
|
|
4528
4641
|
/** 锁定的版本号 */
|
|
4529
4642
|
version: SemVer;
|
|
4530
|
-
/**
|
|
4531
|
-
|
|
4643
|
+
/**
|
|
4644
|
+
* 组件来源
|
|
4645
|
+
*
|
|
4646
|
+
* - `bundled`: 内置组件,随 Runtime 打包,无需 CDN 加载
|
|
4647
|
+
* - `remote`: 远程组件,需从 CDN 动态加载
|
|
4648
|
+
*
|
|
4649
|
+
* Platform 在生成 Manifest 时,通过 `isBuiltinComponent()` 自动判定。
|
|
4650
|
+
*/
|
|
4651
|
+
source: ComponentSource;
|
|
4652
|
+
/**
|
|
4653
|
+
* 入口文件 URL
|
|
4654
|
+
*
|
|
4655
|
+
* - `source: 'remote'` 时必填,指向 CDN 上的组件入口 JS
|
|
4656
|
+
* - `source: 'bundled'` 时留空(内置组件无需 CDN 入口)
|
|
4657
|
+
*/
|
|
4658
|
+
entry?: string;
|
|
4532
4659
|
/** 样式文件 URL(可选) */
|
|
4533
4660
|
styleEntry?: string;
|
|
4534
4661
|
/** SRI 完整性哈希 */
|
|
@@ -5163,4 +5290,4 @@ declare const VERSION = "1.0.0";
|
|
|
5163
5290
|
*/
|
|
5164
5291
|
declare const PROTOCOL_VERSION = "1.0.0";
|
|
5165
5292
|
|
|
5166
|
-
export { type ABTestRolloutConfig, ALLOWED_FUNCTION_NAMES, ALL_BUILTIN_FUNCTIONS, ARRAY_FUNCTIONS, type ActionClientContext, type ActionDefinition, type ActionDefinitionVersion, type ActionExecuteRequest, type ActionExecuteResponse, type ActionExecutor, type ActionPolicy, type ActionRef, type ActionResult, type ActionSheetItem, type ActionSheetOptions, type ActionSheetResult, type ActionSpec, ActionType, type Activity, type ActivityPrecondition, type ActivityRule, type ActivityStatus, type ActivityType, type AggregationDataSourceConfig, type AggregationQueryItem, type AnyValueOrExpression, type ApiErrorResponse, type ApiResponse, type ApiSuccessResponse, type AppContext, AuditAction, type AuditConfig, type AuditLogEntry, type BackgroundConfig, type BaseActivityRule, type BlacklistRolloutConfig, type BlockedComponentInfo, type BlockedComponentItem, type BootstrapConfig, type BrowserCompat, type BuiltinActionType, CURRENT_ACTION_SPEC_VERSION, CURRENT_COMPONENT_META_VERSION, CURRENT_DATA_QUERY_SPEC_VERSION, CURRENT_SCHEMA_VERSION, type CacheConfig, type CacheLevel, type CanaryHealthCheck, type CanaryRolloutConfig, type CanaryStage, type CanvasType, type CapabilityDeclaration, type CapabilityName, type ChangeLog, type ChangeLogItem, type ClaimActivityRule, type ClaimPrize, type ClaimRecord, type ClaimState, type ClipboardApi, type CompatInfo, type Component, type ComponentCategory, type ComponentContext, type ComponentDependency, type ComponentIntegrity, type ComponentMeta, type ComponentNode, type ComponentQueryParams, type ComponentRegisterRequest, type ComponentStatus, type ComponentStatusChangeRequest, type ComponentVersion, type ComponentVersionQuery, type ConfirmOptions, type ConsecutiveReward, type CreateManifestRequest, type CreatePageRequest, type CreatePreviewTokenRequest, type CreateTemplateRequest, type CumulativeReward, DATE_FUNCTIONS, DEFAULT_EXPRESSION_VALIDATION_CONFIG, DEPENDENCY_PREFIX, type DataBinding, type DataBindingErrorConfig, type DataLoadStrategy, type DataQueryDefinition, type DataQueryDefinitionVersion, type DataQueryRequest, type DataQueryResponse, type DataQuerySpec, type DataSourceConfig, type DataSourceType, type DatabaseDataSourceConfig, type DeepReadonly, type DefinitionVersionDigest, type DefinitionsDigest, type DependencyPrefix, type DialogOptions, type DialogResult, type DjvlcError, type EditorComponent, type Environment, ErrorCategory, ErrorCode, ErrorCodeToHttpStatus, type ErrorMapping, ErrorMessages, type EventDeclaration, type EventHandler, type ExecutorContext, type ExecutorResult, type Expression, type ExpressionContext, type ExpressionContextTyped, type ExpressionDependency, type ExpressionEventContext, type ExpressionFunctionCategory, type ExpressionFunctionDefinition, type ExpressionLocal, type ExpressionMeta, type ExpressionType, type ExpressionValidationConfig, type ExpressionValidationError, type ExpressionValidationResult, type ExpressionValidationWarning, FORMAT_FUNCTIONS, type FallbackCondition, type FallbackConfig, type FeatureCondition, type FeatureRolloutConfig, type FieldPermission, type FieldPolicy, type FieldTransform, type FileIntegrity, type FunctionParamDefinition, type GraphQLDataSourceConfig, type HostApi, type HttpDataSourceConfig, type HttpRetryConfig, type I18nDetectionStrategy, type ISODateTime, type IdempotencyKeyStrategy, type IdempotencyRule, type IntegrityHash, type InternalDataSourceConfig, type InventoryConfig, type JsonObject, type JsonValue, type KillSwitchItem, LOGIC_FUNCTIONS, type LayoutConfig, type LayoutValues, type LoopConfig, type LotteryActivityRule, type LotteryCost, type LotteryPrize, type LotteryState, type Manifest, type ManifestEntry, type ManifestItem, type ManifestValidationError, type ManifestValidationResult, type ManifestValidationWarning, type MaskingConfig, type MaskingRule, type MaskingType, type MethodCategory, type MethodDeclaration, type MethodParam, NUMBER_FUNCTIONS, type NavigateOptions, type NodeStyleConfig, type OperatorInfo, type OpsConfig, type OrderByItem, PROTOCOL_VERSION, type PageAssetsJson, type PageBehaviorConfig, type PageConfig, type PageDraft, type PageI18nConfig, type PageInfo, type PageIntegrityJson, type PageLayoutConfig, type PageLifecycle, type PageManifest, type PageMeta, type PageResolveRequest, type PageResolveResponse, type PageResolveWithSnapshotResponse, type PageSEO, type PageSchema, type PageSnapshotJson, type PageSnapshotManifest, type PageSnapshotMeta, type PageSnapshotPage, type PageState, PageStatus, type PageStatusType, type PageStylesConfig, type PageVersion, type PaginatedResponse, type PaginationMeta, type PaginationParams, type ParamPermission, type ParticipationLimit, type PercentageRolloutConfig, type PityConfig, type Precondition, type PreconditionType, type PreviewImageOptions, type PreviewToken, type PreviewTokenValidationResult, type ProbabilityConfig, type PropDefinition, type PropFormat, type PropGroup, type PropType, type PropsSchema, type PublishCdnConfig, PublishChannel, type PublishConfig, type PublishEnvironment, type PublishNotificationConfig, type PublishRecord, type PublishRolloutConfig, PublishStatus, type QueryPermissions, type RateLimitDimension, type RateLimitItem, type RateLimitRule, type RequestContext, type ResolveVersionsRequest, type ResolvedComponent, type ResolvedManifest, type ResponsiveBreakpoints, type RetryPolicy, type RiskControlConfig, type RolloutConfig, type RolloutMatchRequest, type RolloutMatchResult, type RolloutStrategy, type RolloutStrategyConfig, type RolloutStrategyType, type RuntimeContext, type RuntimeSpec, type SHAIntegrity, STRING_FUNCTIONS, type ScanCodeResult, type SchemaVersion, type SemVer, type ShareOptions, type ShareResult, type SigninActivityRule, type SigninRecord, type SigninRewardRecord, type SigninState, type SlotCategory, type SlotDeclaration, type SnapshotComponentEntry, type StateFieldDefinition, type StorageApi, type StorageOptions, type StyleConfig, type StyleIsolation, type TemplateInfo, TemplateParseError, type TemplateParseMode, type ThemeConfig, type TimeWindowRolloutConfig, type ToastOptions, type TrackEvent, type URLString, UTILITY_FUNCTIONS, type UniqueId, type UpdatePageRequest, type UpdateTemplateRequest, type UpsertRolloutRequest, type UserActivityState, type UserContext, VERSION, type ValidationRule, type VersionDiff, type VersionInfo, VersionStatus, type VersionStatusType, type ViewportConfig, type WhitelistRolloutConfig, bindingRef, createDjvlcError, createExpressionContext, createLoopLocal, dep, isDjvlcError, localRef, stateRef, template };
|
|
5293
|
+
export { type ABTestRolloutConfig, ALLOWED_FUNCTION_NAMES, ALL_BUILTIN_FUNCTIONS, ARRAY_FUNCTIONS, type ActionClientContext, type ActionDefinition, type ActionDefinitionVersion, type ActionExecuteRequest, type ActionExecuteResponse, type ActionExecutor, type ActionPolicy, type ActionRef, type ActionResult, type ActionSheetItem, type ActionSheetOptions, type ActionSheetResult, type ActionSpec, ActionType, type Activity, type ActivityPrecondition, type ActivityRule, type ActivityStatus, type ActivityType, type AggregationDataSourceConfig, type AggregationQueryItem, type AnyValueOrExpression, type ApiErrorResponse, type ApiResponse, type ApiSuccessResponse, type AppContext, AuditAction, type AuditConfig, type AuditLogEntry, BUILTIN_COMPONENT_NAMES, type BackgroundConfig, type BaseActivityRule, type BlacklistRolloutConfig, type BlockedComponentInfo, type BlockedComponentItem, type BootstrapConfig, type BrowserCompat, type BuiltinActionType, type BuiltinComponentName, COMPONENT_TAG_PREFIX, CURRENT_ACTION_SPEC_VERSION, CURRENT_COMPONENT_META_VERSION, CURRENT_DATA_QUERY_SPEC_VERSION, CURRENT_SCHEMA_VERSION, type CacheConfig, type CacheLevel, type CanaryHealthCheck, type CanaryRolloutConfig, type CanaryStage, type CanvasType, type CapabilityDeclaration, type CapabilityName, type ChangeLog, type ChangeLogItem, type ClaimActivityRule, type ClaimPrize, type ClaimRecord, type ClaimState, type ClipboardApi, type CompatInfo, type Component, type ComponentCategory, type ComponentContext, type ComponentDependency, type ComponentIntegrity, type ComponentMeta, type ComponentNode, type ComponentQueryParams, type ComponentRegisterRequest, type ComponentSource, type ComponentStatus, type ComponentStatusChangeRequest, type ComponentVersion, type ComponentVersionQuery, type ConfirmOptions, type ConsecutiveReward, type CreateManifestRequest, type CreatePageRequest, type CreatePreviewTokenRequest, type CreateTemplateRequest, type CumulativeReward, DATE_FUNCTIONS, DEFAULT_EXPRESSION_VALIDATION_CONFIG, DEPENDENCY_PREFIX, type DataBinding, type DataBindingErrorConfig, type DataLoadStrategy, type DataQueryDefinition, type DataQueryDefinitionVersion, type DataQueryRequest, type DataQueryResponse, type DataQuerySpec, type DataSourceConfig, type DataSourceType, type DatabaseDataSourceConfig, type DeepReadonly, type DefinitionVersionDigest, type DefinitionsDigest, type DependencyPrefix, type DialogOptions, type DialogResult, type DjvlcError, type EditorComponent, type Environment, ErrorCategory, ErrorCode, ErrorCodeToHttpStatus, type ErrorMapping, ErrorMessages, type EventDeclaration, type EventHandler, type ExecutorContext, type ExecutorResult, type Expression, type ExpressionContext, type ExpressionContextTyped, type ExpressionDependency, type ExpressionEventContext, type ExpressionFunctionCategory, type ExpressionFunctionDefinition, type ExpressionLocal, type ExpressionMeta, type ExpressionType, type ExpressionValidationConfig, type ExpressionValidationError, type ExpressionValidationResult, type ExpressionValidationWarning, FORMAT_FUNCTIONS, type FallbackCondition, type FallbackConfig, type FeatureCondition, type FeatureRolloutConfig, type FieldPermission, type FieldPolicy, type FieldTransform, type FileIntegrity, type FunctionParamDefinition, type GraphQLDataSourceConfig, type HostApi, type HttpDataSourceConfig, type HttpRetryConfig, type I18nDetectionStrategy, type ISODateTime, type IdempotencyKeyStrategy, type IdempotencyRule, type IntegrityHash, type InternalDataSourceConfig, type InventoryConfig, type JsonObject, type JsonValue, type KillSwitchItem, LOGIC_FUNCTIONS, type LayoutConfig, type LayoutValues, type LoopConfig, type LotteryActivityRule, type LotteryCost, type LotteryPrize, type LotteryState, type Manifest, type ManifestEntry, type ManifestItem, type ManifestValidationError, type ManifestValidationResult, type ManifestValidationWarning, type MaskingConfig, type MaskingRule, type MaskingType, type MethodCategory, type MethodDeclaration, type MethodParam, NUMBER_FUNCTIONS, type NavigateOptions, type NodeStyleConfig, type OperatorInfo, type OpsConfig, type OrderByItem, PROTOCOL_VERSION, type PageAssetsJson, type PageBehaviorConfig, type PageConfig, type PageDraft, type PageI18nConfig, type PageInfo, type PageIntegrityJson, type PageLayoutConfig, type PageLifecycle, type PageManifest, type PageMeta, type PageResolveRequest, type PageResolveResponse, type PageResolveWithSnapshotResponse, type PageSEO, type PageSchema, type PageSnapshotJson, type PageSnapshotManifest, type PageSnapshotMeta, type PageSnapshotPage, type PageState, PageStatus, type PageStatusType, type PageStylesConfig, type PageVersion, type PaginatedResponse, type PaginationMeta, type PaginationParams, type ParamPermission, type ParticipationLimit, type PercentageRolloutConfig, type PityConfig, type Precondition, type PreconditionType, type PreviewImageOptions, type PreviewToken, type PreviewTokenValidationResult, type ProbabilityConfig, type PropDefinition, type PropFormat, type PropGroup, type PropType, type PropsSchema, type PublishCdnConfig, PublishChannel, type PublishConfig, type PublishEnvironment, type PublishNotificationConfig, type PublishRecord, type PublishRolloutConfig, PublishStatus, type QueryPermissions, type RateLimitDimension, type RateLimitItem, type RateLimitRule, type RequestContext, type ResolveVersionsRequest, type ResolvedComponent, type ResolvedManifest, type ResponsiveBreakpoints, type RetryPolicy, type RiskControlConfig, type RolloutConfig, type RolloutMatchRequest, type RolloutMatchResult, type RolloutStrategy, type RolloutStrategyConfig, type RolloutStrategyType, type RuntimeContext, type RuntimeSpec, type SHAIntegrity, STRING_FUNCTIONS, type ScanCodeResult, type SchemaVersion, type SemVer, type ShareOptions, type ShareResult, type SigninActivityRule, type SigninRecord, type SigninRewardRecord, type SigninState, type SlotCategory, type SlotDeclaration, type SnapshotComponentEntry, type StateFieldDefinition, type StorageApi, type StorageOptions, type StyleConfig, type StyleIsolation, type TemplateInfo, TemplateParseError, type TemplateParseMode, type ThemeConfig, type TimeWindowRolloutConfig, type ToastOptions, type TrackEvent, type URLString, UTILITY_FUNCTIONS, type UniqueId, type UpdatePageRequest, type UpdateTemplateRequest, type UpsertRolloutRequest, type UserActivityState, type UserContext, VERSION, type ValidationRule, type VersionDiff, type VersionInfo, VersionStatus, type VersionStatusType, type ViewportConfig, type WhitelistRolloutConfig, bindingRef, createDjvlcError, createExpressionContext, createLoopLocal, dep, getComponentSource, isBuiltinComponent, isDjvlcError, localRef, stateRef, template };
|
package/dist/index.js
CHANGED
|
@@ -1155,6 +1155,53 @@ function template(templateString, fallback) {
|
|
|
1155
1155
|
// src/component/meta.ts
|
|
1156
1156
|
var CURRENT_COMPONENT_META_VERSION = "1.0.0";
|
|
1157
1157
|
|
|
1158
|
+
// src/component/builtin.ts
|
|
1159
|
+
var COMPONENT_TAG_PREFIX = "djvlc-";
|
|
1160
|
+
var BUILTIN_COMPONENT_NAMES = [
|
|
1161
|
+
// ---- 基础组件 (basic) ----
|
|
1162
|
+
"djvlc-text",
|
|
1163
|
+
// 文本
|
|
1164
|
+
"djvlc-image",
|
|
1165
|
+
// 图片
|
|
1166
|
+
"djvlc-button",
|
|
1167
|
+
// 按钮
|
|
1168
|
+
"djvlc-icon",
|
|
1169
|
+
// 图标
|
|
1170
|
+
"djvlc-link",
|
|
1171
|
+
// 链接
|
|
1172
|
+
"djvlc-divider",
|
|
1173
|
+
// 分割线
|
|
1174
|
+
// ---- 布局组件 (layout) ----
|
|
1175
|
+
"djvlc-container",
|
|
1176
|
+
// 容器
|
|
1177
|
+
"djvlc-row",
|
|
1178
|
+
// 行(栅格)
|
|
1179
|
+
"djvlc-col",
|
|
1180
|
+
// 列(栅格)
|
|
1181
|
+
"djvlc-spacer",
|
|
1182
|
+
// 间距
|
|
1183
|
+
// ---- 表单组件 (form) ----
|
|
1184
|
+
"djvlc-form",
|
|
1185
|
+
// 表单容器
|
|
1186
|
+
// ---- 展示组件 (display) ----
|
|
1187
|
+
"djvlc-background-image",
|
|
1188
|
+
// 背景图
|
|
1189
|
+
// ---- 反馈组件 (feedback) ----
|
|
1190
|
+
"djvlc-dialog",
|
|
1191
|
+
// 弹窗
|
|
1192
|
+
"djvlc-loading",
|
|
1193
|
+
// 加载
|
|
1194
|
+
"djvlc-empty"
|
|
1195
|
+
// 空状态
|
|
1196
|
+
];
|
|
1197
|
+
var BUILTIN_SET = new Set(BUILTIN_COMPONENT_NAMES);
|
|
1198
|
+
function isBuiltinComponent(componentName) {
|
|
1199
|
+
return BUILTIN_SET.has(componentName);
|
|
1200
|
+
}
|
|
1201
|
+
function getComponentSource(componentName) {
|
|
1202
|
+
return isBuiltinComponent(componentName) ? "bundled" : "remote";
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1158
1205
|
// src/action/types.ts
|
|
1159
1206
|
var ActionType = /* @__PURE__ */ ((ActionType2) => {
|
|
1160
1207
|
ActionType2["CLAIM"] = "claim";
|
|
@@ -1185,6 +1232,8 @@ exports.ALL_BUILTIN_FUNCTIONS = ALL_BUILTIN_FUNCTIONS;
|
|
|
1185
1232
|
exports.ARRAY_FUNCTIONS = ARRAY_FUNCTIONS;
|
|
1186
1233
|
exports.ActionType = ActionType;
|
|
1187
1234
|
exports.AuditAction = AuditAction;
|
|
1235
|
+
exports.BUILTIN_COMPONENT_NAMES = BUILTIN_COMPONENT_NAMES;
|
|
1236
|
+
exports.COMPONENT_TAG_PREFIX = COMPONENT_TAG_PREFIX;
|
|
1188
1237
|
exports.CURRENT_ACTION_SPEC_VERSION = CURRENT_ACTION_SPEC_VERSION;
|
|
1189
1238
|
exports.CURRENT_COMPONENT_META_VERSION = CURRENT_COMPONENT_META_VERSION;
|
|
1190
1239
|
exports.CURRENT_DATA_QUERY_SPEC_VERSION = CURRENT_DATA_QUERY_SPEC_VERSION;
|
|
@@ -1213,6 +1262,8 @@ exports.createDjvlcError = createDjvlcError;
|
|
|
1213
1262
|
exports.createExpressionContext = createExpressionContext;
|
|
1214
1263
|
exports.createLoopLocal = createLoopLocal;
|
|
1215
1264
|
exports.dep = dep;
|
|
1265
|
+
exports.getComponentSource = getComponentSource;
|
|
1266
|
+
exports.isBuiltinComponent = isBuiltinComponent;
|
|
1216
1267
|
exports.isDjvlcError = isDjvlcError;
|
|
1217
1268
|
exports.localRef = localRef;
|
|
1218
1269
|
exports.stateRef = stateRef;
|
package/dist/index.mjs
CHANGED
|
@@ -1153,6 +1153,53 @@ function template(templateString, fallback) {
|
|
|
1153
1153
|
// src/component/meta.ts
|
|
1154
1154
|
var CURRENT_COMPONENT_META_VERSION = "1.0.0";
|
|
1155
1155
|
|
|
1156
|
+
// src/component/builtin.ts
|
|
1157
|
+
var COMPONENT_TAG_PREFIX = "djvlc-";
|
|
1158
|
+
var BUILTIN_COMPONENT_NAMES = [
|
|
1159
|
+
// ---- 基础组件 (basic) ----
|
|
1160
|
+
"djvlc-text",
|
|
1161
|
+
// 文本
|
|
1162
|
+
"djvlc-image",
|
|
1163
|
+
// 图片
|
|
1164
|
+
"djvlc-button",
|
|
1165
|
+
// 按钮
|
|
1166
|
+
"djvlc-icon",
|
|
1167
|
+
// 图标
|
|
1168
|
+
"djvlc-link",
|
|
1169
|
+
// 链接
|
|
1170
|
+
"djvlc-divider",
|
|
1171
|
+
// 分割线
|
|
1172
|
+
// ---- 布局组件 (layout) ----
|
|
1173
|
+
"djvlc-container",
|
|
1174
|
+
// 容器
|
|
1175
|
+
"djvlc-row",
|
|
1176
|
+
// 行(栅格)
|
|
1177
|
+
"djvlc-col",
|
|
1178
|
+
// 列(栅格)
|
|
1179
|
+
"djvlc-spacer",
|
|
1180
|
+
// 间距
|
|
1181
|
+
// ---- 表单组件 (form) ----
|
|
1182
|
+
"djvlc-form",
|
|
1183
|
+
// 表单容器
|
|
1184
|
+
// ---- 展示组件 (display) ----
|
|
1185
|
+
"djvlc-background-image",
|
|
1186
|
+
// 背景图
|
|
1187
|
+
// ---- 反馈组件 (feedback) ----
|
|
1188
|
+
"djvlc-dialog",
|
|
1189
|
+
// 弹窗
|
|
1190
|
+
"djvlc-loading",
|
|
1191
|
+
// 加载
|
|
1192
|
+
"djvlc-empty"
|
|
1193
|
+
// 空状态
|
|
1194
|
+
];
|
|
1195
|
+
var BUILTIN_SET = new Set(BUILTIN_COMPONENT_NAMES);
|
|
1196
|
+
function isBuiltinComponent(componentName) {
|
|
1197
|
+
return BUILTIN_SET.has(componentName);
|
|
1198
|
+
}
|
|
1199
|
+
function getComponentSource(componentName) {
|
|
1200
|
+
return isBuiltinComponent(componentName) ? "bundled" : "remote";
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1156
1203
|
// src/action/types.ts
|
|
1157
1204
|
var ActionType = /* @__PURE__ */ ((ActionType2) => {
|
|
1158
1205
|
ActionType2["CLAIM"] = "claim";
|
|
@@ -1178,4 +1225,4 @@ var CURRENT_DATA_QUERY_SPEC_VERSION = "1.0.0";
|
|
|
1178
1225
|
var VERSION = "1.0.0";
|
|
1179
1226
|
var PROTOCOL_VERSION = "1.0.0";
|
|
1180
1227
|
|
|
1181
|
-
export { ALLOWED_FUNCTION_NAMES, ALL_BUILTIN_FUNCTIONS, ARRAY_FUNCTIONS, ActionType, AuditAction, CURRENT_ACTION_SPEC_VERSION, CURRENT_COMPONENT_META_VERSION, CURRENT_DATA_QUERY_SPEC_VERSION, CURRENT_SCHEMA_VERSION, DATE_FUNCTIONS, DEFAULT_EXPRESSION_VALIDATION_CONFIG, DEPENDENCY_PREFIX, ErrorCategory, ErrorCode, ErrorCodeToHttpStatus, ErrorMessages, FORMAT_FUNCTIONS, LOGIC_FUNCTIONS, NUMBER_FUNCTIONS, PROTOCOL_VERSION, PageStatus, PublishChannel, PublishStatus, STRING_FUNCTIONS, TemplateParseError, UTILITY_FUNCTIONS, VERSION, VersionStatus, bindingRef, createDjvlcError, createExpressionContext, createLoopLocal, dep, isDjvlcError, localRef, stateRef, template };
|
|
1228
|
+
export { ALLOWED_FUNCTION_NAMES, ALL_BUILTIN_FUNCTIONS, ARRAY_FUNCTIONS, ActionType, AuditAction, BUILTIN_COMPONENT_NAMES, COMPONENT_TAG_PREFIX, CURRENT_ACTION_SPEC_VERSION, CURRENT_COMPONENT_META_VERSION, CURRENT_DATA_QUERY_SPEC_VERSION, CURRENT_SCHEMA_VERSION, DATE_FUNCTIONS, DEFAULT_EXPRESSION_VALIDATION_CONFIG, DEPENDENCY_PREFIX, ErrorCategory, ErrorCode, ErrorCodeToHttpStatus, ErrorMessages, FORMAT_FUNCTIONS, LOGIC_FUNCTIONS, NUMBER_FUNCTIONS, PROTOCOL_VERSION, PageStatus, PublishChannel, PublishStatus, STRING_FUNCTIONS, TemplateParseError, UTILITY_FUNCTIONS, VERSION, VersionStatus, bindingRef, createDjvlcError, createExpressionContext, createLoopLocal, dep, getComponentSource, isBuiltinComponent, isDjvlcError, localRef, stateRef, template };
|