@hankchen/canvas-editor 0.6.0 → 0.7.1
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.ts +115 -69
- package/dist/index.js +119 -97
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -509,16 +509,20 @@ interface NextTextStyle {
|
|
|
509
509
|
}
|
|
510
510
|
/** 文本预设档位(CONTEXT「文本预设」词条):heading 40 / subheading 28 / body 16 */
|
|
511
511
|
type TextPresetId = 'heading' | 'subheading' | 'body';
|
|
512
|
+
/** 文本预设档位条目(评审整改 F2 查档返回面,RatioPreset 同形):具名 id + 档位字号 */
|
|
513
|
+
interface TextPreset {
|
|
514
|
+
readonly id: TextPresetId;
|
|
515
|
+
readonly fontSize: number;
|
|
516
|
+
}
|
|
512
517
|
/** 文本预设常量(spec 决策 4):v1 只定字号——字体缺口由新层样式槽补 */
|
|
513
|
-
declare const TEXT_PRESETS: readonly
|
|
514
|
-
id: TextPresetId;
|
|
515
|
-
fontSize: number;
|
|
516
|
-
}[];
|
|
518
|
+
declare const TEXT_PRESETS: readonly TextPreset[];
|
|
517
519
|
/** 新层样式槽初值:自工厂 TextLayer 形态派生(工厂缺省是单一事实源,槽跟着走) */
|
|
518
520
|
declare function defaultNextTextStyle(): NextTextStyle;
|
|
519
521
|
/**
|
|
520
522
|
* 建层比例档位(spec 决策 1/2):'free' = 自由钳(工厂行为兜底),其余五个具名
|
|
521
|
-
* 有理数比。v1
|
|
523
|
+
* 有理数比。v1 固定清单、无自定义输入。清单随建层比例槽退役保持不动
|
|
524
|
+
* (canvas-web-preset-submenu 工单 01,ADR 0021):free 仍是「自由」枚举值与
|
|
525
|
+
* Shift 语义引用,具名档由武装预设载荷(armedCreatePreset)一次性携带消费。
|
|
522
526
|
*/
|
|
523
527
|
type RatioPresetId = 'free' | '1:1' | '4:3' | '3:4' | '16:9' | '9:16';
|
|
524
528
|
/** 比例预设档位:具名 id + 有理数宽高比(free 档 ratio = null,即不钳) */
|
|
@@ -531,19 +535,24 @@ interface RatioPreset {
|
|
|
531
535
|
}
|
|
532
536
|
/** 比例预设常量六档(顺序即面板平铺序:自由在前,其余按惯例短比在前) */
|
|
533
537
|
declare const RATIO_PRESETS: readonly RatioPreset[];
|
|
534
|
-
/** 建层比例槽初值:自由(工厂画拉行为兜底) */
|
|
535
|
-
declare function defaultNextLayerRatio(): RatioPresetId;
|
|
536
538
|
/** 档位 → 钳制用有理数比:'free' → null(不钳),具名档 → {w, h} 副本 */
|
|
537
539
|
declare function ratioValue(id: RatioPresetId): {
|
|
538
540
|
w: number;
|
|
539
541
|
h: number;
|
|
540
542
|
} | null;
|
|
541
543
|
/**
|
|
542
|
-
*
|
|
543
|
-
*
|
|
544
|
-
*
|
|
544
|
+
* 层型预设档位查档(canvas-web-preset-submenu 评审整改 F2):武装/画拉会话载荷的
|
|
545
|
+
* 档位 id 按层型分流到对应清单单点查找——TextLayer 查 TEXT_PRESETS、ImageLayer 查
|
|
546
|
+
* RATIO_PRESETS,其余层型(无预设语义)与交叉类型(文本层带比例档/图片层带文本
|
|
547
|
+
* 档)在对方清单查无此档,返回 undefined(「未知 id = 不落载荷、武装照常」评审
|
|
548
|
+
* 口径的查表面)。session 建层管线的档位查找(armLayerCreate / endCreate)经此
|
|
549
|
+
* 消费,档比复制语义复用 ratioValue;presetId 收 string——store 载荷是 string
|
|
550
|
+
* 形态(ui 分支不翻译型),查档天然宽容(未知 id 查无)。重载让层型字面量收窄
|
|
551
|
+
* 返回面:TextLayer 只得文本档、ImageLayer 只得比例档。
|
|
545
552
|
*/
|
|
546
|
-
declare function
|
|
553
|
+
declare function findPresetEntry(type: LayerType, presetId: string): TextPreset | RatioPreset | undefined;
|
|
554
|
+
declare function findPresetEntry(type: 'TextLayer', presetId: string): TextPreset | undefined;
|
|
555
|
+
declare function findPresetEntry(type: 'ImageLayer', presetId: string): RatioPreset | undefined;
|
|
547
556
|
/**
|
|
548
557
|
* 死区点击缺省盒的比例派生(spec 决策 3):长边 200 定短边——短边 = round(长边
|
|
549
558
|
* × 短比)(Math.round 对正数 half-up:16:9 → 200×113)。自由档不进本函数
|
|
@@ -895,6 +904,14 @@ interface CreateGesture {
|
|
|
895
904
|
* (G 快捷键 V1 空表语义原样)。
|
|
896
905
|
*/
|
|
897
906
|
templateRowsPath?: string;
|
|
907
|
+
/**
|
|
908
|
+
* 建层预设载荷(canvas-web-preset-submenu 工单 01,ADR 0021):beginLayerCreate
|
|
909
|
+
* 时从 ui.armedCreatePreset 捕获(templateRowsPath 同门,会话内定死)——文本层
|
|
910
|
+
* 载荷命中 TEXT_PRESETS = 档位字号直接生效(不经新层样式槽);图片层载荷命中
|
|
911
|
+
* RATIO_PRESETS = 比例钳橡皮筋与死区缺省盒(Shift 瞬时反转源 = 本生效档)。
|
|
912
|
+
* undefined = 普通武装(文本按槽、图片恒自由)。
|
|
913
|
+
*/
|
|
914
|
+
preset?: string;
|
|
898
915
|
/** 起点场景坐标(两点正规化与死区判定基准) */
|
|
899
916
|
startScene: Point;
|
|
900
917
|
/** 当前指针场景坐标 */
|
|
@@ -941,6 +958,12 @@ interface FindSession {
|
|
|
941
958
|
replacement: string;
|
|
942
959
|
cursor: number;
|
|
943
960
|
}
|
|
961
|
+
/** 数据源声明拒绝详情(声明被拒呈现面,死端态整改 2b):reason 为声明期拒绝码、
|
|
962
|
+
* detail 为教学性明细(直取 parseExpressionSchema 拒绝面) */
|
|
963
|
+
interface DataSourceSchemaRejection {
|
|
964
|
+
reason: ExpressionSchemaRejectReason;
|
|
965
|
+
detail: string;
|
|
966
|
+
}
|
|
944
967
|
interface EditorUi {
|
|
945
968
|
viewport: Viewport;
|
|
946
969
|
/** 当前选中图层路径(数组路径,patch path 前缀);null = 无选择 */
|
|
@@ -965,6 +988,17 @@ interface EditorUi {
|
|
|
965
988
|
* 不进 wire(红线 3 延伸),beginLayerCreate 捕获进建层会话;openDocument 重置。
|
|
966
989
|
*/
|
|
967
990
|
armedCreateRowsPath: string;
|
|
991
|
+
/**
|
|
992
|
+
* 武装 token 的预设载荷(canvas-web-preset-submenu 工单 01,ADR 0021):预设
|
|
993
|
+
* 随武装一次性携带、不再写任何偏好槽——armedCreate === 'TextLayer' 且本载荷
|
|
994
|
+
* 命中 TEXT_PRESETS = 文本预设风味(endCreate 按档位字号直接生效,不经新层
|
|
995
|
+
* 样式槽);armedCreate === 'ImageLayer' 且本载荷命中 RATIO_PRESETS = 比例
|
|
996
|
+
* 预设风味(createTo 钳橡皮筋、endCreate 死区缺省盒)。空串 = 普通武装
|
|
997
|
+
* (文本按新层样式槽、图片恒自由),与 armedCreateRowsPath 同款空值语义。
|
|
998
|
+
* ui 瞬态载荷——不进 graph、不进 wire、不进 prefs(红线 3 延伸),
|
|
999
|
+
* beginLayerCreate 捕获进建层会话;openDocument 重置。
|
|
1000
|
+
*/
|
|
1001
|
+
armedCreatePreset: string;
|
|
968
1002
|
/** 进行中的画拉建层橡皮筋会话(拖拽期纯视觉,文档零变更);null = 无 */
|
|
969
1003
|
create: CreateGesture | null;
|
|
970
1004
|
/** 进行中的文本编辑会话;null = 非编辑态 */
|
|
@@ -986,18 +1020,10 @@ interface EditorUi {
|
|
|
986
1020
|
* 族字段的权威写(updateSpec 捕获)更新槽,建层(endCreate/addRootLayer)
|
|
987
1021
|
* 以槽值覆盖工厂缺省。与锚点折叠同款的面板偏好——openDocument 换文档不重
|
|
988
1022
|
* 置,永不进历史;随工程数据 prefs 桶跨会话持久(宿主通道,内核零 localStorage)。
|
|
1023
|
+
* 文本预设档不写槽(canvas-web-preset-submenu 工单 01,ADR 0021:预设随武装
|
|
1024
|
+
* 载荷一次性携带,槽只保留属性面板信号一种语义)。
|
|
989
1025
|
*/
|
|
990
1026
|
nextTextStyle: NextTextStyle;
|
|
991
|
-
/**
|
|
992
|
-
* 建层比例槽(image-ratio-preset 工单 01,CONTEXT「建层比例」词条):记忆
|
|
993
|
-
* 「下一个新建图片层用什么宽高比」的编辑器级偏好——六档、缺省自由,仅
|
|
994
|
-
* ImageLayer 消费(QR 恒方是层型硬钳,其余层型无此槽)。比例预设的应用 =
|
|
995
|
-
* 写槽再武装画拉(armLayerCreate),普通图片层项/快捷键 I 不带 preset、武装
|
|
996
|
-
* 后按槽值钳制——槽是唯一偏好源。与锚点折叠同款的面板偏好——openDocument
|
|
997
|
-
* 换文档不重置,永不进历史;随工程数据 prefs 桶跨会话持久(宿主通道,内核
|
|
998
|
-
* 零 localStorage)。
|
|
999
|
-
*/
|
|
1000
|
-
nextLayerRatio: RatioPresetId;
|
|
1001
1027
|
/**
|
|
1002
1028
|
* 数据源 schema 声明(content-completion 工单 03/08,D2 宿主随会话注入):
|
|
1003
1029
|
* 编译产物形状树或降级 null(根级结构性拒绝,注入期经
|
|
@@ -1007,6 +1033,14 @@ interface EditorUi {
|
|
|
1007
1033
|
* 文档不重置(声明随会话,重注入/清除走同一入口)。
|
|
1008
1034
|
*/
|
|
1009
1035
|
dataSourceSchema: ExpressionSchemaNode | null;
|
|
1036
|
+
/**
|
|
1037
|
+
* 数据源声明拒绝详情(声明被拒呈现面,死端态整改 2b):仅被拒注入在场——
|
|
1038
|
+
* reason/detail 直取 parseExpressionSchema 拒绝面(reserved_root_key /
|
|
1039
|
+
* invalid_schema / open_map_unsupported),宿主读数与绑定面据此区分「未注入」
|
|
1040
|
+
* 与「注入被拒」。只住会话态随 dataSourceSchema 同步置换:合法注入与清除
|
|
1041
|
+
* 归 null;不进 graph、不落 localStorage、不进 wire。
|
|
1042
|
+
*/
|
|
1043
|
+
dataSourceSchemaRejection: DataSourceSchemaRejection | null;
|
|
1010
1044
|
/**
|
|
1011
1045
|
* 参考线(ruler-guides-snap 工单 01,ADR 0012):使用者从标尺拖出的会话级
|
|
1012
1046
|
* 对位轴(水平/垂直、场景坐标)。零契约面——不进历史、不写 graph、保存零
|
|
@@ -1095,7 +1129,7 @@ declare class EditorStore {
|
|
|
1095
1129
|
get canRedo(): boolean;
|
|
1096
1130
|
/** 打开/替换文档:ui 选择/编辑/重命名会话与双向历史一并重置(新文档不继承旧路径/旧事务);
|
|
1097
1131
|
* 参考线/锁定集合/查找会话/建层武装与画拉会话随当次会话清空(对位轴/文档内容防护/
|
|
1098
|
-
*
|
|
1132
|
+
* 查询词/待命层型不跨文档),标尺显隐/锚点折叠/新层样式作为偏好保留 */
|
|
1099
1133
|
openDocument(canvas: Canvas): void;
|
|
1100
1134
|
/**
|
|
1101
1135
|
* 文档事务唯一入口:produceWithPatches 求新树,无变化即空转(不进历史不通知);
|
|
@@ -1128,10 +1162,11 @@ declare class EditorStore {
|
|
|
1128
1162
|
/**
|
|
1129
1163
|
* 建层武装置/解除(null,drag-create 工单 01);标量值等短路(重复武装同型
|
|
1130
1164
|
* 不通知)。rowsPath(template-table-drag-create 工单 01):模板表风味载荷
|
|
1131
|
-
*
|
|
1132
|
-
*
|
|
1165
|
+
* 与层型一体写;preset(canvas-web-preset-submenu 工单 01):预设载荷与层型
|
|
1166
|
+
* 一体写——同层型同载荷才短路(重复武装同型换载荷要更新),解除(null)
|
|
1167
|
+
* 一律清载荷(rowsPath 与 preset 双清)。
|
|
1133
1168
|
*/
|
|
1134
|
-
setArmedCreate(type: LayerType | null, rowsPath?: string): void;
|
|
1169
|
+
setArmedCreate(type: LayerType | null, rowsPath?: string, preset?: string): void;
|
|
1135
1170
|
/** 画拉橡皮筋会话开始/更新/结束(null);会话对象住 ui 分支,落库在 endCreate 单事务 */
|
|
1136
1171
|
setCreate(gesture: CreateGesture | null): void;
|
|
1137
1172
|
/** 文本编辑会话开始/结束(null);会话住 ui 分支,文本经 commitTextEdit 一次性落文档 */
|
|
@@ -1141,21 +1176,18 @@ declare class EditorStore {
|
|
|
1141
1176
|
/** 锚点折叠区开合:布尔值等短路(重复点击同一态不重绘) */
|
|
1142
1177
|
setAnchorExpanded(open: boolean): void;
|
|
1143
1178
|
/**
|
|
1144
|
-
* 新层样式槽逐字段合并(text-defaults 工单 01
|
|
1145
|
-
*
|
|
1179
|
+
* 新层样式槽逐字段合并(text-defaults 工单 01:捕获/prefs 恢复的统一写入口;
|
|
1180
|
+
* canvas-web-preset-submenu 工单 01 起预设不再写槽):patch 并入现值,五字段
|
|
1181
|
+
* 值等短路(重复写同值零通知),不进历史。
|
|
1146
1182
|
*/
|
|
1147
1183
|
setNextTextStyle(patch: Partial<NextTextStyle>): void;
|
|
1148
|
-
/**
|
|
1149
|
-
* 建层比例槽写入(image-ratio-preset 工单 01:比例预设应用 / prefs 恢复的
|
|
1150
|
-
* 统一写入口):值等短路(重复写同档零通知),仅 ui 通知、不进历史。
|
|
1151
|
-
*/
|
|
1152
|
-
setNextLayerRatio(id: RatioPresetId): void;
|
|
1153
1184
|
/**
|
|
1154
1185
|
* 数据源 schema 声明替换(归一产物或降级 null,校验收口在注入缝不在这里):
|
|
1155
|
-
*
|
|
1186
|
+
* 声明与拒绝详情成对置换(rejection 仅被拒注入在场,2b 呈现面),同引用且
|
|
1187
|
+
* 同拒绝态短路(重复注入同一归一产物不惊动订阅方);仅 ui 通知,不参与重绘
|
|
1156
1188
|
* 脏标(onStoreChange 对该分支短路)。
|
|
1157
1189
|
*/
|
|
1158
|
-
setDataSourceSchema(schema: ExpressionSchemaNode | null): void;
|
|
1190
|
+
setDataSourceSchema(schema: ExpressionSchemaNode | null, rejection?: DataSourceSchemaRejection | null): void;
|
|
1159
1191
|
/** 参考线列表替换(增删动作在会话门面收口);仅 ui 通知,不参与历史 */
|
|
1160
1192
|
setGuides(guides: readonly Guide[]): void;
|
|
1161
1193
|
/** 标尺显隐:布尔值等短路(重复置同态不重绘) */
|
|
@@ -1268,7 +1300,12 @@ declare function classifyEditorShortcut(input: EditorShortcutInput, bindings?: r
|
|
|
1268
1300
|
* 仍是内核唯一保存物。
|
|
1269
1301
|
*/
|
|
1270
1302
|
|
|
1271
|
-
/**
|
|
1303
|
+
/**
|
|
1304
|
+
* 快照格式版本:随格式演化单调递增;v1 = 1(宽容读贯彻,restore 不分支此值)。
|
|
1305
|
+
* prefs 桶的 nextLayerRatio 键已随 canvas-web-preset-submenu 工单 01(ADR 0021)
|
|
1306
|
+
* 退役:停写停读、版本不升——旧快照的该键由调用方按宽容读惯例整体忽略(键在
|
|
1307
|
+
* 载荷里多余但无害),加法演进同门前例(text-defaults 工单 01)。
|
|
1308
|
+
*/
|
|
1272
1309
|
declare const EDITOR_STATE_SCHEMA_VERSION = 1;
|
|
1273
1310
|
/** 帧作用域切片:当前打开画布的编辑器状态(工程数据快照的 frames[帧名] 值) */
|
|
1274
1311
|
interface CanvasEditorState {
|
|
@@ -1290,12 +1327,6 @@ interface EditorPrefsState {
|
|
|
1290
1327
|
* 由 applyEditorPrefs 宽容读兜底为现值(会话内即工厂缺省)。
|
|
1291
1328
|
*/
|
|
1292
1329
|
nextTextStyle: NextTextStyle;
|
|
1293
|
-
/**
|
|
1294
|
-
* 建层比例槽(image-ratio-preset 工单 01,CONTEXT「建层比例」词条):随 prefs
|
|
1295
|
-
* 桶跨会话持久(per-模板记忆,「自由」即显式重置档)。schemaVersion 不升——
|
|
1296
|
-
* 加法演进,旧快照缺字段或脏值由 applyEditorPrefs 宽容读回落 'free'。
|
|
1297
|
-
*/
|
|
1298
|
-
nextLayerRatio: RatioPresetId;
|
|
1299
1330
|
}
|
|
1300
1331
|
|
|
1301
1332
|
/**
|
|
@@ -1714,19 +1745,20 @@ declare class EditorSession {
|
|
|
1714
1745
|
/**
|
|
1715
1746
|
* 武装建层(面板新增项/层型快捷键的统一入口,CONTEXT「武装」词条):置 ui
|
|
1716
1747
|
* 分支待命层型,下一次画布按下即开画拉;建层提交或 Esc 即解除——一次性
|
|
1717
|
-
* 待命态,无粘性工具(spec 决策 2
|
|
1748
|
+
* 待命态,无粘性工具(spec 决策 2)。重复武装同型同载荷值等短路零通知。
|
|
1718
1749
|
*
|
|
1719
|
-
* preset(
|
|
1720
|
-
*
|
|
1721
|
-
*
|
|
1722
|
-
*
|
|
1723
|
-
* -
|
|
1724
|
-
*
|
|
1725
|
-
* -
|
|
1726
|
-
*
|
|
1750
|
+
* preset(canvas-web-preset-submenu 工单 01,ADR 0021):层型相关预设随武装
|
|
1751
|
+
* 载荷一次性携带、**不再写任何偏好槽**——命中档位把档位 id 写进
|
|
1752
|
+
* ui.armedCreatePreset(endCreate 落库一次性消费,取消路零残留);未知 id =
|
|
1753
|
+
* 不落载荷、武装照常(评审口径统一:「空转」只指载荷,武装层型本身仍合法)。
|
|
1754
|
+
* - TextLayer + 文本预设档:载荷命中 TEXT_PRESETS(endCreate 档位字号直接
|
|
1755
|
+
* 生效,不经新层样式槽——普通武装文本按槽的语义不受染指);
|
|
1756
|
+
* - ImageLayer + 比例预设档:载荷命中 RATIO_PRESETS('free' 档载荷行为等价
|
|
1757
|
+
* 自由;QR 恒方是层型硬钳、无比例语义,spec 豁免面);
|
|
1758
|
+
* - 交叉类型(文本层带比例档/图片层带文本档)各在对方清单查无此档、不落载荷。
|
|
1727
1759
|
*/
|
|
1728
1760
|
armLayerCreate(type: LayerType, preset?: TextPresetId | RatioPresetId): void;
|
|
1729
|
-
/**
|
|
1761
|
+
/** 解除建层武装(取消入口):仅清待命态(含模板表风味与预设载荷),零副作用。 */
|
|
1730
1762
|
cancelArmLayerCreate(): void;
|
|
1731
1763
|
/**
|
|
1732
1764
|
* 武装模板表建层(canvas-web-template-table-drag-create 工单 01,spec 决策 3):
|
|
@@ -1754,10 +1786,12 @@ declare class EditorSession {
|
|
|
1754
1786
|
* 全部可见根层供轴,copyMode 首移同门)。零文档事务:修正只进会话几何,
|
|
1755
1787
|
* 落库在 endCreate。
|
|
1756
1788
|
*
|
|
1757
|
-
*
|
|
1758
|
-
*
|
|
1759
|
-
*
|
|
1760
|
-
*
|
|
1789
|
+
* 建层预设档(canvas-web-preset-submenu 工单 01,ADR 0021,取代建层比例槽):
|
|
1790
|
+
* 仅 ImageLayer 按会话载荷档钳制(QR 层不传 ratio、恒方语义不动,两钳互斥;
|
|
1791
|
+
* 其余层型无比例语义);无载荷或 free 档 = 自由钳(普通武装恒自由)。
|
|
1792
|
+
* Shift 瞬时反转源 = 生效档(载荷档或自由):档具名按 Shift = 临时自由、
|
|
1793
|
+
* 生效档自由(含无载荷)按 Shift = 临时钳 1:1,按住生效松开还原(逐帧求位、
|
|
1794
|
+
* 不写载荷不改武装态,Figma 惯例的手势瞬时语义)。
|
|
1761
1795
|
*/
|
|
1762
1796
|
createTo(sceneX: number, sceneY: number, shift?: boolean): void;
|
|
1763
1797
|
/**
|
|
@@ -1766,24 +1800,29 @@ declare class EditorSession {
|
|
|
1766
1800
|
* - 死区外:单事务写入「createDefaultLayer 缺省形态 + position 左上角对准
|
|
1767
1801
|
* 橡皮筋矩形(含吸附修正)+ shape.width/height」并 insertRootLayerInDraft
|
|
1768
1802
|
* 置顶(priority min−1、push 数组尾)——尺寸取手势末态钳制结果(含 Shift
|
|
1769
|
-
*
|
|
1803
|
+
* 反转末态,钳制源 = 会话预设档,canvas-web-preset-submenu 工单 01);
|
|
1770
1804
|
* - 死区内(点击兜底,位移按 CREATE_DEAD_ZONE_SCREEN_PX 屏幕 px 随 zoom 折算,
|
|
1771
|
-
* ALT_DRAG_DEAD_ZONE_SCREEN_PX
|
|
1772
|
-
*
|
|
1773
|
-
*
|
|
1805
|
+
* ALT_DRAG_DEAD_ZONE_SCREEN_PX 同门):左上角对准点击点;尺寸按会话预设档
|
|
1806
|
+
* 派生缺省盒(ImageLayer 长边 200 定短边,自由/无载荷 = 工厂 200×150 现状;
|
|
1807
|
+
* 忽略 shift——无位移可供等比约束;其余层型保持工厂缺省)。
|
|
1774
1808
|
* 落库后自动选中新层并解除武装;返回新层路径(绑定层消费:文本层据此自动
|
|
1775
1809
|
* 进文本编辑,spec 决策 6)。无会话/无文档空转返回 null。点击兜底不产生
|
|
1776
1810
|
* 零尺寸层(缺省形态自带可见尺寸)。
|
|
1777
1811
|
*
|
|
1812
|
+
* 预设档一次性消费(canvas-web-preset-submenu 工单 01,ADR 0021):文本档
|
|
1813
|
+
* 字号直接生效(不经新层样式槽——字体/行高等槽外字段仍按槽,普通武装语义
|
|
1814
|
+
* 保留);图片档比供死区缺省盒派生。档位随会话捕获,落库后武装与载荷双清
|
|
1815
|
+
* (一次性语义,取消路零残留)。
|
|
1816
|
+
*
|
|
1778
1817
|
* 模板表风味(template-table-drag-create 工单 01):会话载荷 templateRowsPath
|
|
1779
1818
|
* 非空即分派 createTemplateTable 工厂(死区外 shape = 手势正规化矩形,死区内
|
|
1780
1819
|
* 缺省壳 400×120、左上角对准点击点);模板层不自动进文本编辑(文本层专属)。
|
|
1781
1820
|
*/
|
|
1782
1821
|
endCreate(): LayerPath | null;
|
|
1783
1822
|
/**
|
|
1784
|
-
* 取消画拉(Esc
|
|
1785
|
-
*
|
|
1786
|
-
*
|
|
1823
|
+
* 取消画拉(Esc 语义):清橡皮筋会话、命中轴回显与武装态(含模板表风味与
|
|
1824
|
+
* 预设载荷)——零文档写入、零历史步(拖拽期纯视觉因此取消零回退成本,spec
|
|
1825
|
+
* 决策 4)。幂等:无会话时仅解除武装(待命态 Esc 同走此口)。
|
|
1787
1826
|
*/
|
|
1788
1827
|
cancelCreate(): void;
|
|
1789
1828
|
/**
|
|
@@ -1869,16 +1908,18 @@ declare class EditorSession {
|
|
|
1869
1908
|
/**
|
|
1870
1909
|
* 只读偏好(保存 prefs 的读取口):与 store.ui 同源,给宿主一个不用下钻
|
|
1871
1910
|
* store 的口。读 = getEditorPrefs,写 = applyEditorPrefs,对称成对;帧切片
|
|
1872
|
-
* 走 restoreEditorState
|
|
1911
|
+
* 走 restoreEditorState,两不相混。建层比例(nextLayerRatio)已退役不在此
|
|
1912
|
+
* 带出(canvas-web-preset-submenu 工单 01,ADR 0021——预设随武装载荷一次性
|
|
1913
|
+
* 携带,prefs 停写)。
|
|
1873
1914
|
*/
|
|
1874
1915
|
getEditorPrefs(): EditorPrefsState;
|
|
1875
1916
|
/**
|
|
1876
1917
|
* 应用偏好(会话建立时一次性,跨会话恢复 prefs 的写入口):整体替换
|
|
1877
1918
|
* rulersVisible/anchorExpanded,不进历史;值等写入经 store 短路零通知。
|
|
1878
1919
|
* 新层样式(text-defaults 工单 01)走宽容读逐字段合并(pickNextTextStylePatch
|
|
1879
|
-
*
|
|
1880
|
-
* 工单 01
|
|
1881
|
-
*
|
|
1920
|
+
* 共享谓词——与捕获同门,缺字/类型不符保留现值)。旧快照的 nextLayerRatio
|
|
1921
|
+
* 遗留键宽容忽略(canvas-web-preset-submenu 工单 01:槽退役停读,载荷上多余
|
|
1922
|
+
* 的键无害;schemaVersion 加法演进)。
|
|
1882
1923
|
*/
|
|
1883
1924
|
applyEditorPrefs(prefs: EditorPrefsState): void;
|
|
1884
1925
|
/**
|
|
@@ -2022,8 +2063,11 @@ declare class EditorSession {
|
|
|
2022
2063
|
updateDataExpression(path: LayerPath, expression: string | null, options?: TransactOptions): void;
|
|
2023
2064
|
/**
|
|
2024
2065
|
* 数据字段取值方式切换(静态 ⇆ 表达式,工单 02 自面板收编内核):表达式现态
|
|
2025
|
-
* → 字面接管(updateData,值保持现镜像);静态现态 →
|
|
2026
|
-
*
|
|
2066
|
+
* → 字面接管(updateData,值保持现镜像);静态现态 → 打标,初值分内容面——
|
|
2067
|
+
* 文本层镜像原文(字面可含合法插值混排),资源层(Image/Qr)只镜像**已合法
|
|
2068
|
+
* 的单引用字面**(静态 ⇆ 表达式往返无损),违例字面(URL/拼接文案)落
|
|
2069
|
+
* 「未选择」空态不镜像——切换自身不得制造必违例初值(死端态整改条目 4;旧
|
|
2070
|
+
* 值可经撤销一步找回)。各为独立一步历史(无 mergeKey)。三内容层分派各取值
|
|
2027
2071
|
* 字段,表/行/格/悬空路径空转。
|
|
2028
2072
|
*
|
|
2029
2073
|
* 活标志防御路由(ADR 0019):路径即编辑中的层时只翻会话活标志(零文档变更
|
|
@@ -2031,6 +2075,8 @@ declare class EditorSession {
|
|
|
2031
2075
|
* 草稿;面板锁定段/pill 显式调用与宿主旁路调用都安全收敛到同一语义。
|
|
2032
2076
|
*/
|
|
2033
2077
|
toggleDataMode(path: LayerPath): void;
|
|
2078
|
+
/** 资源面切换初值:字面已是合法单引用(含空串为「未选择」)才镜像,违例落空态 */
|
|
2079
|
+
private resourceToggleInitial;
|
|
2034
2080
|
/**
|
|
2035
2081
|
* 内容写事务的统一形(会话内容独占工单 02):transact 落库 + 命中编辑层的
|
|
2036
2082
|
* 草稿接管收口——updateData/updateDataExpression/replaceOne/replaceAll 四个
|
|
@@ -3175,4 +3221,4 @@ declare function memoizeTextPolicies(policies?: TextLayoutPolicies, options?: Me
|
|
|
3175
3221
|
*/
|
|
3176
3222
|
declare const PACKAGE_NAME: "@hankchen/canvas-editor";
|
|
3177
3223
|
|
|
3178
|
-
export { ALIGN_CORNER_MARGIN_PX, ALT_DRAG_DEAD_ZONE_SCREEN_PX, ARM_CREATE_LAYER_TYPES, type AlignBoxGeometry, type AlignToCanvasMode, type AlignToCanvasOptions, type ArmCreateShortcutAction, CREATE_DEAD_ZONE_SCREEN_PX, type CanvasEditorState, type CreateGesture, type CreateRectResult, DATE_FORMAT_SUGGESTIONS, DEFAULT_EDITOR_SHORTCUTS, DEFAULT_ZOOM_BOUNDS, type DeletedLayerRef, type DocRecipe, type DragGesture, EDITOR_STATE_SCHEMA_VERSION, EXPRESSION_FUNCTIONS, type EditorChange, type EditorPrefsState, EditorSession, type EditorSessionOptions, type EditorShortcutAction, type EditorShortcutBinding, type EditorShortcutGroup, type EditorShortcutInput, EditorStore, type EditorUi, type ExpressionCallArg, type ExpressionCallErrorKind, type ExpressionCallParse, type ExpressionCallSlotContext, type ExpressionCandidate, type ExpressionCandidateQuery, type ExpressionCandidateResult, type ExpressionContextKind, type ExpressionErrorRange, type ExpressionFormatSuggestion, type ExpressionFragmentDiagnostic, type ExpressionFragmentErrorKind, type ExpressionFunctionMeta, type ExpressionPathHead, type ExpressionPathParse, type ExpressionScan, type ExpressionScanFragment, type ExpressionScanLiteral, type ExpressionScanOpen, type ExpressionScanPart, type ExpressionSchemaChildEntry, type ExpressionSchemaChildView, type ExpressionSchemaDiagnostic, type ExpressionSchemaDiagnosticCode, type ExpressionSchemaNode, type ExpressionSchemaParse, type ExpressionSchemaRejectReason, type ExpressionSyntaxError, type FindSession, type FindTextHit, FontCatalog, type FontCatalogEntry, type FrameScheduler, type Guide, type GuideOrientation, type HistoryStep, type HitTestOptions, type InvalidateTarget, type LayerOutlineNode, type LayerOutlineRole, type LayerPath, MAX_HISTORY_STEPS, type MemoTextPoliciesOptions, type MovedSubtreeRef, NUMBER_FUNCTION_SUGGESTIONS, type NextTextStyle, type OverlayPaintArgs, type OverlayPainter, PACKAGE_NAME, PAN_TO_BOX_MARGIN_PX, PASTE_OFFSET_PX, PHP_TRIM_CHARS, type Point, type ProportionalDrivingAxis, RATIO_PRESETS, RESIZE_HANDLES, RESIZE_HANDLE_HIT_PX, RESIZE_MIN_SIZE_PX, type RatioPreset, type RatioPresetId, type Rect, type ResizeAxes, type ResizeBoxGeometry, type ResizeBoxResult, type ResizeHandle, type ResourceStatus, type ResourceStatusMap, type RowsPathCandidate, type RowsPathCandidateResult, SNAP_THRESHOLD_SCREEN_PX, STYLE_FIELD_KEYS_BY_TYPE, type ShortcutCombo, type Size, type SnapAxis, type SnapAxisSource, type SnapBoxGeometry, type SnapPoints, type SnapResolution, type StyleSnapshot, TEXT_PRESETS, type TextEditLayout, type TextEditingSession, type TextPresetId, type TransactOptions, type UploadFile, type UploadHandler, UploadHandlerMissingError, type UploadImagePlacement, type Viewport, WHEEL_ZOOM_STEP, type WheelInput, type WheelIntent, type ZoomBounds, addRootLayerInDraft, addTableCellInDraft, addTableRowInDraft, addTemplateCellInDraft, alignToCanvasTarget, applyStyleFieldsInDraft, buildLayerOutline, canCopyLayerAt, canonicalizeTableSyncInDraft, captureStyleSnapshot, clampZoom, classifyEditorShortcut, classifyWheel, cloneLayerSubtree, convertTableToRowsInDraft, convertTableToTemplateInDraft, createDefaultLayer, createRubberBandRect, createTemplateTable,
|
|
3224
|
+
export { ALIGN_CORNER_MARGIN_PX, ALT_DRAG_DEAD_ZONE_SCREEN_PX, ARM_CREATE_LAYER_TYPES, type AlignBoxGeometry, type AlignToCanvasMode, type AlignToCanvasOptions, type ArmCreateShortcutAction, CREATE_DEAD_ZONE_SCREEN_PX, type CanvasEditorState, type CreateGesture, type CreateRectResult, DATE_FORMAT_SUGGESTIONS, DEFAULT_EDITOR_SHORTCUTS, DEFAULT_ZOOM_BOUNDS, type DataSourceSchemaRejection, type DeletedLayerRef, type DocRecipe, type DragGesture, EDITOR_STATE_SCHEMA_VERSION, EXPRESSION_FUNCTIONS, type EditorChange, type EditorPrefsState, EditorSession, type EditorSessionOptions, type EditorShortcutAction, type EditorShortcutBinding, type EditorShortcutGroup, type EditorShortcutInput, EditorStore, type EditorUi, type ExpressionCallArg, type ExpressionCallErrorKind, type ExpressionCallParse, type ExpressionCallSlotContext, type ExpressionCandidate, type ExpressionCandidateQuery, type ExpressionCandidateResult, type ExpressionContextKind, type ExpressionErrorRange, type ExpressionFormatSuggestion, type ExpressionFragmentDiagnostic, type ExpressionFragmentErrorKind, type ExpressionFunctionMeta, type ExpressionPathHead, type ExpressionPathParse, type ExpressionScan, type ExpressionScanFragment, type ExpressionScanLiteral, type ExpressionScanOpen, type ExpressionScanPart, type ExpressionSchemaChildEntry, type ExpressionSchemaChildView, type ExpressionSchemaDiagnostic, type ExpressionSchemaDiagnosticCode, type ExpressionSchemaNode, type ExpressionSchemaParse, type ExpressionSchemaRejectReason, type ExpressionSyntaxError, type FindSession, type FindTextHit, FontCatalog, type FontCatalogEntry, type FrameScheduler, type Guide, type GuideOrientation, type HistoryStep, type HitTestOptions, type InvalidateTarget, type LayerOutlineNode, type LayerOutlineRole, type LayerPath, MAX_HISTORY_STEPS, type MemoTextPoliciesOptions, type MovedSubtreeRef, NUMBER_FUNCTION_SUGGESTIONS, type NextTextStyle, type OverlayPaintArgs, type OverlayPainter, PACKAGE_NAME, PAN_TO_BOX_MARGIN_PX, PASTE_OFFSET_PX, PHP_TRIM_CHARS, type Point, type ProportionalDrivingAxis, RATIO_PRESETS, RESIZE_HANDLES, RESIZE_HANDLE_HIT_PX, RESIZE_MIN_SIZE_PX, type RatioPreset, type RatioPresetId, type Rect, type ResizeAxes, type ResizeBoxGeometry, type ResizeBoxResult, type ResizeHandle, type ResourceStatus, type ResourceStatusMap, type RowsPathCandidate, type RowsPathCandidateResult, SNAP_THRESHOLD_SCREEN_PX, STYLE_FIELD_KEYS_BY_TYPE, type ShortcutCombo, type Size, type SnapAxis, type SnapAxisSource, type SnapBoxGeometry, type SnapPoints, type SnapResolution, type StyleSnapshot, TEXT_PRESETS, type TextEditLayout, type TextEditingSession, type TextPreset, type TextPresetId, type TransactOptions, type UploadFile, type UploadHandler, UploadHandlerMissingError, type UploadImagePlacement, type Viewport, WHEEL_ZOOM_STEP, type WheelInput, type WheelIntent, type ZoomBounds, addRootLayerInDraft, addTableCellInDraft, addTableRowInDraft, addTemplateCellInDraft, alignToCanvasTarget, applyStyleFieldsInDraft, buildLayerOutline, canCopyLayerAt, canonicalizeTableSyncInDraft, captureStyleSnapshot, clampZoom, classifyEditorShortcut, classifyWheel, cloneLayerSubtree, convertTableToRowsInDraft, convertTableToTemplateInDraft, createDefaultLayer, createRubberBandRect, createTemplateTable, defaultNextTextStyle, defaultSizeForRatio, deleteLayerInDraft, enumerateExpressionCandidates, enumerateRowsPathCandidates, expressionCallSlotAtEnd, expressionDiagnostics, expressionFragmentAtCursor, findPresetEntry, fitRect, fitViewport, growRowToCellInDraft, handleResizesHeight, handleResizesWidth, hitTest, insertRootLayerAdjacentInDraft, insertRootLayerInDraft, isCallFragment, isImageContentUndrawn, isLayerPath, isLockedPath, isRootLayerPath, isRootPasteableType, isTemplateSubtreePath, layerBoxByPath, memoizeTextPolicies, moveGuard, moveRootLayerInDraft, moveTableCellInDraft, moveTableCellToRowInDraft, moveTableRowInDraft, moveTableRowToTableInDraft, nextZoomByWheel, normalizeExpressionSchemaSource, panBy, panToBox, parseExpressionCall, parseExpressionPath, parseExpressionSchema, pastePosition, pathStartsWith, pathsEqual, phpTrim, pickNextTextStylePatch, prepareRootPaste, proportionalDrivingAxis, ratioValue, readSpecField, remapPathAfterSplice, replaceHitsInDraft, resizableAxesAt, resizeBox, resizeBoxProportional, resizeHandleAt, resizeHandlePoint, resizeHandlesAt, resizeProportionalSnapPoints, resizeSnapPoints, resolveLayer, resolveRowSchema, resolveRowsPathStartSchema, resolveSnap, resolveSnapPoints, resourcePathDiagnostics, rootLayerOf, scanExpressionFragments, scanTextMatches, sceneToScreen, schemaChildEntries, schemaNodeAtPath, screenToScene, selectionParentPath, setCellAutoHeightInDraft, snapAxesFromBoxes, snapThresholdScene, snapViewportToPhysicalPixels, syncContentIntoCellInDraft, syncRowWidthInDraft, uploadDisplayName, visibleRootBoxes, writeSpecField, zoomAtPoint };
|