@rulecms/widget-svelte 0.5.0 → 0.7.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.cjs +63 -13
- package/dist/index.d.ts +183 -13
- package/dist/index.js +3025 -2268
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -830,18 +830,7 @@ export declare function getOverlayLayerZIndex(baseZIndex: number, layerIndex: nu
|
|
|
830
830
|
|
|
831
831
|
export declare interface GetRuleCMSWidgetResponse {
|
|
832
832
|
success: boolean;
|
|
833
|
-
data:
|
|
834
|
-
widget: WidgetData;
|
|
835
|
-
childCollections: {
|
|
836
|
-
[key: string]: ChildCollection;
|
|
837
|
-
};
|
|
838
|
-
libraries?: ConfigLibrariesMap;
|
|
839
|
-
/**
|
|
840
|
-
* Project CSS variable catalog joined at GET time. Omitted when empty or
|
|
841
|
-
* when emission is off.
|
|
842
|
-
*/
|
|
843
|
-
cssVariables?: ProjectCssVariableDefinitions;
|
|
844
|
-
};
|
|
833
|
+
data: RuleCMSWidgetRawData;
|
|
845
834
|
}
|
|
846
835
|
|
|
847
836
|
export declare type GetWidgetKeyForCollection = {
|
|
@@ -1142,8 +1131,88 @@ export declare const pointerEventsAllowlist: readonly ["auto", "none"];
|
|
|
1142
1131
|
/** Transform raw widget API data into render-ready displayItemList + collections. */
|
|
1143
1132
|
export declare function prepareRuleCMSWidgetData(raw: RuleCMSWidgetRawData): RuleCMSWidgetData;
|
|
1144
1133
|
|
|
1134
|
+
declare const PROJECT_CSS_CLASS_LAYERS: readonly ["utilities", "components"];
|
|
1135
|
+
|
|
1136
|
+
declare const PROJECT_CSS_PROPERTY_SYNTAX_VALUES: readonly ["*", "<number>", "<integer>", "<length>", "<percentage>", "<length-percentage>", "<color>", "<angle>", "<time>", "<transform-function>", "<transform-list>"];
|
|
1137
|
+
|
|
1138
|
+
declare const PROJECT_WIDGET_CHROME_COLOR_SCHEME_VALUES: readonly ["light", "dark", "light dark"];
|
|
1139
|
+
|
|
1140
|
+
declare const PROJECT_WIDGET_CHROME_SCROLLBAR_WIDTH_VALUES: readonly ["auto", "thin", "none"];
|
|
1141
|
+
|
|
1142
|
+
declare type ProjectCssClassDefinitions = Record<string, string>;
|
|
1143
|
+
|
|
1144
|
+
declare type ProjectCssClassLayer = (typeof PROJECT_CSS_CLASS_LAYERS)[number];
|
|
1145
|
+
|
|
1146
|
+
declare type ProjectCssKeyframeDefinitions = Record<string, string>;
|
|
1147
|
+
|
|
1148
|
+
declare type ProjectCssPositionTryDefinitions = Record<string, string>;
|
|
1149
|
+
|
|
1150
|
+
declare type ProjectCssPropertyDefinition = {
|
|
1151
|
+
name: string;
|
|
1152
|
+
syntax: ProjectCssPropertySyntax;
|
|
1153
|
+
inherits: boolean;
|
|
1154
|
+
initialValue: string;
|
|
1155
|
+
};
|
|
1156
|
+
|
|
1157
|
+
declare type ProjectCssPropertySyntax = (typeof PROJECT_CSS_PROPERTY_SYNTAX_VALUES)[number];
|
|
1158
|
+
|
|
1145
1159
|
declare type ProjectCssVariableDefinitions = Record<string, string>;
|
|
1146
1160
|
|
|
1161
|
+
declare type ProjectFontFace = {
|
|
1162
|
+
family: string;
|
|
1163
|
+
cssVariable?: string;
|
|
1164
|
+
fallbacks?: string[];
|
|
1165
|
+
applyToWidget?: boolean;
|
|
1166
|
+
source: ProjectFontSource;
|
|
1167
|
+
palettes?: ProjectFontPalette[];
|
|
1168
|
+
};
|
|
1169
|
+
|
|
1170
|
+
declare type ProjectFontPalette = {
|
|
1171
|
+
name: string;
|
|
1172
|
+
overrideColors?: Array<{
|
|
1173
|
+
index: number;
|
|
1174
|
+
color: string;
|
|
1175
|
+
}>;
|
|
1176
|
+
applyToWidget?: boolean;
|
|
1177
|
+
};
|
|
1178
|
+
|
|
1179
|
+
declare type ProjectFontSource = {
|
|
1180
|
+
kind: 'stack-only';
|
|
1181
|
+
} | {
|
|
1182
|
+
kind: 'google';
|
|
1183
|
+
weights: number[];
|
|
1184
|
+
subsets?: string[];
|
|
1185
|
+
};
|
|
1186
|
+
|
|
1187
|
+
declare type ProjectThemeDefinition = {
|
|
1188
|
+
condition: ProjectThemeHostCondition;
|
|
1189
|
+
variables: Record<string, string>;
|
|
1190
|
+
};
|
|
1191
|
+
|
|
1192
|
+
declare type ProjectThemeHostCondition = {
|
|
1193
|
+
kind: 'prefers-color-scheme';
|
|
1194
|
+
value: 'dark' | 'light';
|
|
1195
|
+
} | {
|
|
1196
|
+
kind: 'html-class';
|
|
1197
|
+
value: 'dark';
|
|
1198
|
+
} | {
|
|
1199
|
+
kind: 'data-theme';
|
|
1200
|
+
value: 'dark' | 'light';
|
|
1201
|
+
};
|
|
1202
|
+
|
|
1203
|
+
declare type ProjectWidgetChrome = {
|
|
1204
|
+
colorScheme?: ProjectWidgetChromeColorScheme;
|
|
1205
|
+
selectionBackground?: string;
|
|
1206
|
+
selectionColor?: string;
|
|
1207
|
+
caretColor?: string;
|
|
1208
|
+
scrollbarColor?: string;
|
|
1209
|
+
scrollbarWidth?: ProjectWidgetChromeScrollbarWidth;
|
|
1210
|
+
};
|
|
1211
|
+
|
|
1212
|
+
declare type ProjectWidgetChromeColorScheme = (typeof PROJECT_WIDGET_CHROME_COLOR_SCHEME_VALUES)[number];
|
|
1213
|
+
|
|
1214
|
+
declare type ProjectWidgetChromeScrollbarWidth = (typeof PROJECT_WIDGET_CHROME_SCROLLBAR_WIDTH_VALUES)[number];
|
|
1215
|
+
|
|
1147
1216
|
/**
|
|
1148
1217
|
* Character used to join environmentId and resource key when generating published keys
|
|
1149
1218
|
*/
|
|
@@ -1303,17 +1372,64 @@ export declare interface RuleCMSWidgetContext {
|
|
|
1303
1372
|
libraryRegistry: ComponentLibraryRegistry;
|
|
1304
1373
|
}
|
|
1305
1374
|
|
|
1375
|
+
/** Render-ready widget payload after parsing API / fetch response. */
|
|
1306
1376
|
export declare interface RuleCMSWidgetData {
|
|
1307
1377
|
displayItemList: Items;
|
|
1308
1378
|
widgetCollections: {
|
|
1309
1379
|
[key: string]: WidgetCollection;
|
|
1310
1380
|
};
|
|
1381
|
+
/**
|
|
1382
|
+
* Platform-served library descriptors (optional; absent for configs that
|
|
1383
|
+
* only use the default library, and until the platform serves them).
|
|
1384
|
+
*/
|
|
1311
1385
|
libraries?: ConfigLibrariesMap;
|
|
1312
1386
|
/**
|
|
1313
1387
|
* Project CSS variable catalog joined onto the widget GET. Optional; omit
|
|
1314
|
-
* or `{}` when the project has none. Not stored on itemList.
|
|
1388
|
+
* or `{}` when the project has none. Not stored on itemList. Dropped when
|
|
1389
|
+
* `includeCssVariables` on the raw GET is `false`.
|
|
1315
1390
|
*/
|
|
1316
1391
|
cssVariables?: ProjectCssVariableDefinitions;
|
|
1392
|
+
/**
|
|
1393
|
+
* Project class-definition catalog joined onto the widget GET. Optional;
|
|
1394
|
+
* omit or `{}` when the project has none. Not stored on itemList. Dropped
|
|
1395
|
+
* when `includeClassDefinitions` on the raw GET is `false`.
|
|
1396
|
+
*/
|
|
1397
|
+
classDefinitions?: ProjectCssClassDefinitions;
|
|
1398
|
+
/**
|
|
1399
|
+
* Cascade layer to wrap class definitions. Dropped when
|
|
1400
|
+
* `includeClassLayer` on the raw GET is `false`.
|
|
1401
|
+
*/
|
|
1402
|
+
classLayer?: ProjectCssClassLayer;
|
|
1403
|
+
/**
|
|
1404
|
+
* Project font-face catalog joined onto the widget GET. Dropped when
|
|
1405
|
+
* `includeFontFaces` on the raw GET is `false`.
|
|
1406
|
+
*/
|
|
1407
|
+
fontFaces?: ProjectFontFace[];
|
|
1408
|
+
/**
|
|
1409
|
+
* Project keyframes catalog joined onto the widget GET. Dropped when
|
|
1410
|
+
* `includeKeyframes` on the raw GET is `false`.
|
|
1411
|
+
*/
|
|
1412
|
+
keyframes?: ProjectCssKeyframeDefinitions;
|
|
1413
|
+
/**
|
|
1414
|
+
* Project theme-override catalog joined onto the widget GET. Dropped when
|
|
1415
|
+
* `includeThemes` on the raw GET is `false`.
|
|
1416
|
+
*/
|
|
1417
|
+
themes?: ProjectThemeDefinition[];
|
|
1418
|
+
/**
|
|
1419
|
+
* Project typed `@property` catalog joined onto the widget GET. Dropped when
|
|
1420
|
+
* `includeCssProperties` on the raw GET is `false`.
|
|
1421
|
+
*/
|
|
1422
|
+
cssProperties?: ProjectCssPropertyDefinition[];
|
|
1423
|
+
/**
|
|
1424
|
+
* Project widget-root chrome joined onto the widget GET. Dropped when
|
|
1425
|
+
* `includeWidgetChrome` on the raw GET is `false`.
|
|
1426
|
+
*/
|
|
1427
|
+
widgetChrome?: ProjectWidgetChrome;
|
|
1428
|
+
/**
|
|
1429
|
+
* Project position-try catalog joined onto the widget GET. Dropped when
|
|
1430
|
+
* `includePositionTry` on the raw GET is `false`.
|
|
1431
|
+
*/
|
|
1432
|
+
positionTry?: ProjectCssPositionTryDefinitions;
|
|
1317
1433
|
}
|
|
1318
1434
|
|
|
1319
1435
|
export declare interface RuleCMSWidgetRawData {
|
|
@@ -1321,8 +1437,62 @@ export declare interface RuleCMSWidgetRawData {
|
|
|
1321
1437
|
childCollections: {
|
|
1322
1438
|
[key: string]: ChildCollection;
|
|
1323
1439
|
};
|
|
1440
|
+
/** Optional platform-served library descriptors (see RuleCMSWidgetData). */
|
|
1324
1441
|
libraries?: ConfigLibrariesMap;
|
|
1325
1442
|
cssVariables?: ProjectCssVariableDefinitions;
|
|
1443
|
+
/**
|
|
1444
|
+
* When `false`, do not emit the catalog even if `cssVariables` is present.
|
|
1445
|
+
* Missing means include (legacy payloads).
|
|
1446
|
+
*/
|
|
1447
|
+
includeCssVariables?: boolean;
|
|
1448
|
+
classDefinitions?: ProjectCssClassDefinitions;
|
|
1449
|
+
/**
|
|
1450
|
+
* When `false`, do not emit class definitions even if `classDefinitions` is
|
|
1451
|
+
* present. Missing means include (legacy payloads).
|
|
1452
|
+
*/
|
|
1453
|
+
includeClassDefinitions?: boolean;
|
|
1454
|
+
classLayer?: ProjectCssClassLayer;
|
|
1455
|
+
/**
|
|
1456
|
+
* When `false`, emit class definitions unlayered even if `classLayer` is
|
|
1457
|
+
* present. Missing means wrap when `classLayer` is set.
|
|
1458
|
+
*/
|
|
1459
|
+
includeClassLayer?: boolean;
|
|
1460
|
+
fontFaces?: ProjectFontFace[];
|
|
1461
|
+
/**
|
|
1462
|
+
* When `false`, do not emit fonts even if `fontFaces` is present.
|
|
1463
|
+
* Missing means include (legacy payloads).
|
|
1464
|
+
*/
|
|
1465
|
+
includeFontFaces?: boolean;
|
|
1466
|
+
keyframes?: ProjectCssKeyframeDefinitions;
|
|
1467
|
+
/**
|
|
1468
|
+
* When `false`, do not emit keyframes even if `keyframes` is present.
|
|
1469
|
+
* Missing means include (legacy payloads).
|
|
1470
|
+
*/
|
|
1471
|
+
includeKeyframes?: boolean;
|
|
1472
|
+
themes?: ProjectThemeDefinition[];
|
|
1473
|
+
/**
|
|
1474
|
+
* When `false`, do not emit theme overrides even if `themes` is present.
|
|
1475
|
+
* Missing means include (legacy payloads).
|
|
1476
|
+
*/
|
|
1477
|
+
includeThemes?: boolean;
|
|
1478
|
+
cssProperties?: ProjectCssPropertyDefinition[];
|
|
1479
|
+
/**
|
|
1480
|
+
* When `false`, do not emit typed CSS properties even if `cssProperties` is
|
|
1481
|
+
* present. Missing means include (legacy payloads).
|
|
1482
|
+
*/
|
|
1483
|
+
includeCssProperties?: boolean;
|
|
1484
|
+
widgetChrome?: ProjectWidgetChrome;
|
|
1485
|
+
/**
|
|
1486
|
+
* When `false`, do not emit widget chrome even if `widgetChrome` is present.
|
|
1487
|
+
* Missing means include (legacy payloads).
|
|
1488
|
+
*/
|
|
1489
|
+
includeWidgetChrome?: boolean;
|
|
1490
|
+
positionTry?: ProjectCssPositionTryDefinitions;
|
|
1491
|
+
/**
|
|
1492
|
+
* When `false`, do not emit position-try fallbacks even if `positionTry` is
|
|
1493
|
+
* present. Missing means include (legacy payloads).
|
|
1494
|
+
*/
|
|
1495
|
+
includePositionTry?: boolean;
|
|
1326
1496
|
}
|
|
1327
1497
|
|
|
1328
1498
|
export declare interface SourceComponentsPlugin {
|