@hy-bricks/canvas 0.1.1 → 0.2.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 +1 -1
- package/dist/index.d.ts +35 -1
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1160,6 +1160,22 @@ declare type DeclValueType = 'string' | 'number' | 'boolean' | 'object' | 'array
|
|
|
1160
1160
|
|
|
1161
1161
|
export declare const DEFAULT_FIT_PADDING = 40;
|
|
1162
1162
|
|
|
1163
|
+
export declare function deriveComponentContract(source: DeriveComponentContractSource, opts?: DeriveComponentContractOptions): ComponentContract;
|
|
1164
|
+
|
|
1165
|
+
export declare interface DeriveComponentContractOptions {
|
|
1166
|
+
fallback?: ComponentContract;
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
export declare interface DeriveComponentContractSource {
|
|
1170
|
+
html: string;
|
|
1171
|
+
js: string;
|
|
1172
|
+
css?: string;
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
export declare function deriveComponentKind(source: DeriveComponentContractSource, opts?: {
|
|
1176
|
+
fallback?: ComponentKind;
|
|
1177
|
+
}): ComponentKind;
|
|
1178
|
+
|
|
1163
1179
|
export declare const DIVIDER_HIT_THICKNESS = 8;
|
|
1164
1180
|
|
|
1165
1181
|
export declare interface DocumentSource {
|
|
@@ -1253,6 +1269,8 @@ export declare interface EmitDecl {
|
|
|
1253
1269
|
highFrequency?: boolean;
|
|
1254
1270
|
}
|
|
1255
1271
|
|
|
1272
|
+
export declare function emptyComponentContract(): ComponentContract;
|
|
1273
|
+
|
|
1256
1274
|
export declare function emptyPageDocument(): PageDocument;
|
|
1257
1275
|
|
|
1258
1276
|
export declare function filterExistingIds(ids: readonly string[], instances: readonly PageInstance[]): string[];
|
|
@@ -1341,6 +1359,14 @@ getDataSourceSnapshot(): DataSourceSnapshot;
|
|
|
1341
1359
|
rootEl: HTMLDivElement;
|
|
1342
1360
|
}, any>;
|
|
1343
1361
|
|
|
1362
|
+
export declare interface HyperCardPageRendererExpose {
|
|
1363
|
+
data: {
|
|
1364
|
+
invalidateDataSource(sourceId?: string): void;
|
|
1365
|
+
getDataSourceSnapshot(): DataSourceSnapshot;
|
|
1366
|
+
} | null;
|
|
1367
|
+
binding: WirePageBindingsHandle | null;
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1344
1370
|
export declare interface InstanceDataInputMissingIssue extends BindingIssueBase {
|
|
1345
1371
|
code: 'required-data-input-missing';
|
|
1346
1372
|
instanceId: string;
|
|
@@ -1379,6 +1405,8 @@ export declare function isInstancePositionLocked(inst: LockedSubset): boolean;
|
|
|
1379
1405
|
|
|
1380
1406
|
export declare function isInstanceSizeLocked(inst: LockedSubset): boolean;
|
|
1381
1407
|
|
|
1408
|
+
export declare function isResizeHandleAllowed(parentMode: ContainerLayoutConfig['mode'] | undefined, handle: ResizeHandle, widthMode: LayoutBoxAxisMode | undefined, heightMode: LayoutBoxAxisMode | undefined): boolean;
|
|
1409
|
+
|
|
1382
1410
|
export declare function isV1Layout(layout: PageLayout | CanvasLayoutConfig | undefined): layout is CanvasLayoutConfig;
|
|
1383
1411
|
|
|
1384
1412
|
export declare interface LayoutBox {
|
|
@@ -1469,6 +1497,8 @@ export declare interface MethodDecl {
|
|
|
1469
1497
|
argsHint?: string;
|
|
1470
1498
|
}
|
|
1471
1499
|
|
|
1500
|
+
export declare function migrateGridCellsToLayoutItem(doc: PageDocument): PageDocument;
|
|
1501
|
+
|
|
1472
1502
|
export declare function migrateInstanceToLayoutBox(inst: PageInstance): PageInstance;
|
|
1473
1503
|
|
|
1474
1504
|
export declare function migrateLayoutV0ToV1(raw: PageLayout | CanvasLayoutConfig | undefined): CanvasLayoutConfig;
|
|
@@ -1509,6 +1539,8 @@ export declare type NormalizedPageBinding = (PageBindingBase & {
|
|
|
1509
1539
|
type: 'data';
|
|
1510
1540
|
});
|
|
1511
1541
|
|
|
1542
|
+
export declare function normalizeGridCells0Based(cells: NonNullable<GridContainerLayout['cells']>): NonNullable<GridContainerLayout['cells']>;
|
|
1543
|
+
|
|
1512
1544
|
export declare function normalizeInstanceSlotFields(inst: PageInstance): PageInstance;
|
|
1513
1545
|
|
|
1514
1546
|
export declare function normalizeKeyString(s: string): string;
|
|
@@ -1713,7 +1745,7 @@ declare interface Rect_2 {
|
|
|
1713
1745
|
|
|
1714
1746
|
export declare function registerDesignerHandle(canvasId: string, handle: CanvasHandle): void;
|
|
1715
1747
|
|
|
1716
|
-
export declare function renderLayoutBoxStyle(layoutBox: LayoutBox, zIndex: number, rotation: number | undefined, parentLayoutMode: ContainerLayoutConfig['mode'] | undefined): Record<string, string | number>;
|
|
1748
|
+
export declare function renderLayoutBoxStyle(layoutBox: LayoutBox, zIndex: number, rotation: number | undefined, parentLayoutMode: ContainerLayoutConfig['mode'] | undefined, parentSplitDirection?: 'horizontal' | 'vertical'): Record<string, string | number>;
|
|
1717
1749
|
|
|
1718
1750
|
export declare interface RenderScheduler {
|
|
1719
1751
|
register(instanceId: string, el: Element): void;
|
|
@@ -1849,6 +1881,7 @@ export declare interface SplitDividerDragState {
|
|
|
1849
1881
|
parentId: string | null;
|
|
1850
1882
|
dividerIndex: number | null;
|
|
1851
1883
|
startRatios: number[] | null;
|
|
1884
|
+
childIds: string[] | null;
|
|
1852
1885
|
parentAxisPx: number;
|
|
1853
1886
|
startPt: Point | null;
|
|
1854
1887
|
direction: 'horizontal' | 'vertical' | null;
|
|
@@ -1862,6 +1895,7 @@ export declare interface SplitDividerInteraction {
|
|
|
1862
1895
|
parentId: string;
|
|
1863
1896
|
dividerIndex: number;
|
|
1864
1897
|
startRatios: number[];
|
|
1898
|
+
childIds: string[];
|
|
1865
1899
|
parentAxisPx: number;
|
|
1866
1900
|
direction: 'horizontal' | 'vertical';
|
|
1867
1901
|
gap: number;
|