@hankchen/canvas-editor-vue 0.6.1 → 0.8.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.
Files changed (37) hide show
  1. package/dist/{useDataSourceSchema-CG9EGzwc.js → DropdownMenu-CeUNKMDQ.js} +70 -84
  2. package/dist/ExpressionPathPicker-DchGsK70.js +739 -0
  3. package/dist/{canvas-CptBzpwT.js → canvas-DuvO27sj.js} +506 -485
  4. package/dist/canvas.js +1 -1
  5. package/dist/index.js +14 -15
  6. package/dist/layer-panel/TemplateTableForm.d.ts +1 -27
  7. package/dist/{layer-panel-Cz-tmbJJ.js → layer-panel-BouAYiDq.js} +231 -257
  8. package/dist/layer-panel.js +1 -1
  9. package/dist/property-panel/PropertyField.d.ts +9 -2
  10. package/dist/property-panel/fieldSchema.d.ts +28 -10
  11. package/dist/property-panel/fields/RowsPathField.d.ts +17 -0
  12. package/dist/property-panel/fields/index.d.ts +1 -0
  13. package/dist/property-panel/fields/intrinsicSize.d.ts +9 -0
  14. package/dist/property-panel/usePropertyPanel.d.ts +11 -2
  15. package/dist/{property-panel-OBqd6D8W.js → property-panel-BkfqRva4.js} +371 -271
  16. package/dist/property-panel.js +2 -2
  17. package/dist/resourceTemplate-D-DKEo7Z.js +33 -0
  18. package/dist/shared/ExpressionPathPicker.d.ts +9 -2
  19. package/dist/shared/index.d.ts +13 -10
  20. package/dist/shared/pathPickerModel.d.ts +16 -3
  21. package/dist/shared/popupPosition.d.ts +2 -2
  22. package/dist/shared/rowsPathPickerSource.d.ts +15 -0
  23. package/dist/shared/useDataSourceSchema.d.ts +6 -0
  24. package/dist/{shared-wuupBoZg.js → shared-CRDKDSpa.js} +22 -22
  25. package/dist/shared.js +9 -10
  26. package/dist/{status-bar-DCuK2R88.js → status-bar-DBf5kIXY.js} +6 -6
  27. package/dist/status-bar.js +1 -1
  28. package/dist/style.css +1 -1
  29. package/dist/uploadFile-mXJVPEzm.js +653 -0
  30. package/dist/{useTransientFeedback-CTjmMmFF.js → useTransientFeedback-BN_O7V2w.js} +43 -28
  31. package/package.json +2 -2
  32. package/dist/popupPosition-Ck5Gsvjy.js +0 -526
  33. package/dist/resourceTemplate-cdcQtp9a.js +0 -246
  34. package/dist/shared/rowsPathCompletionSource.d.ts +0 -3
  35. package/dist/shared/usePathCompletion.d.ts +0 -18
  36. package/dist/uploadFile-DbB-KhII.js +0 -520
  37. package/dist/usePathCompletion-Do17CQ6l.js +0 -220
@@ -1,2 +1,2 @@
1
- import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c } from "./layer-panel-Cz-tmbJJ.js";
1
+ import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c } from "./layer-panel-BouAYiDq.js";
2
2
  export { e as ADD_LAYER_MENU, a as ADD_MENU, s as ADD_RATIO_PRESET_MENU, t as ADD_TEXT_PRESET_MENU, c as LayerPanel, r as PANEL_ADD_MENU, n as TemplateTableForm, i as isUpperHalf, o as useLayerPanel };
@@ -14,8 +14,9 @@ type __VLS_Props = {
14
14
  */
15
15
  locked?: boolean;
16
16
  /**
17
- * 补全候选源(面板按字段分发:data 门字段 = 表达式源,rowsPath 标记字段 =
18
- * 行相对源,工单 03);null = 未注入/无接线/降级(浮层恒闭)。
17
+ * 补全候选源(面板按字段分发:data 门 textarea 字段 = 表达式源;资源字段与
18
+ * rowsPath 点选器字段 = 选择器源,经 source 下发进控件);null = 未注入/
19
+ * 无接线/降级(浮层恒闭、选择器无菜单)。
19
20
  */
20
21
  completion?: CompletionSource | null;
21
22
  /** pair 子字段的禁用态替代显示(键 = 子字段绝对键);其他控件不传 */
@@ -30,6 +31,12 @@ type __VLS_Props = {
30
31
  * (缩略图角标,与画布失败标识同源);undefined = 无记录/不适用。
31
32
  */
32
33
  resourceStatus?: ResourceStatus;
34
+ /**
35
+ * rowsPath 控件的漂移态(rows-path-picker 工单 03,spec D2):面板按已提交
36
+ * 值判定(rowsPathDrifted)——true 时控件落 cn-field--invalid(红描边经
37
+ * fallthrough 到点选器展示框),菜单不受影响照常可开可重选。其他控件不下发。
38
+ */
39
+ drifted?: boolean;
33
40
  };
34
41
  declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
35
42
  input: (value: unknown) => any;
@@ -1,6 +1,6 @@
1
- import { Layer, LayerPath, LayerType, ResourceStatusMap } from '@hankchen/canvas-editor';
1
+ import { Canvas, CanvasBackground, Layer, LayerPath, LayerType, ResourceStatusMap } from '@hankchen/canvas-editor';
2
2
  /** 控件种类(与 controls.ts 的组件注册表一一对应) */
3
- export type FieldControl = 'number' | 'text' | 'textarea' | 'color' | 'select' | 'boolean' | 'pair' | 'anchor' | 'align' | 'padding' | 'border' | 'font' | 'imageSrc' | 'resourceValue';
3
+ export type FieldControl = 'number' | 'text' | 'textarea' | 'color' | 'select' | 'boolean' | 'pair' | 'anchor' | 'align' | 'padding' | 'border' | 'font' | 'imageSrc' | 'resourceValue' | 'rowsPath';
4
4
  /**
5
5
  * 自适应 prefix 钮描述(pair 子字段用):key 相对 pair 值对象上的布尔键;
6
6
  * 开启 → 本输入禁用。placeholder 是禁用态兜底占位(盒未解析时;正常路径面板
@@ -39,13 +39,6 @@ export interface FieldDef {
39
39
  * 禁拼接/函数),不走片段级扫描诊断。图片地址/二维码值两类声明。
40
40
  */
41
41
  readonly resource?: true;
42
- /**
43
- * 补全标记门(rows-path-completion 工单 03,D6):'rowsPath' = 裸路径补全
44
- * (usePathCompletion,候选源 = 面板 rowsPathSource)——不走 data 门
45
- * (rowsPath 是结构语义,表达式补全门不适用);缺省 = 无标记(data 门字段
46
- * 照走 useExpressionCompletion)。
47
- */
48
- readonly completion?: 'rowsPath';
49
42
  /** 输入框占位文案(text 控件透传) */
50
43
  readonly placeholder?: string;
51
44
  /**
@@ -65,6 +58,11 @@ export interface FieldDef {
65
58
  readonly nonEmpty?: boolean;
66
59
  /** select 取值域(领域常量原样引用,不自创缩写) */
67
60
  readonly domain?: readonly string[];
61
+ /**
62
+ * select 选项显示名(value → 标签,image-fit 工单 05「适配」):缺省 = 原值
63
+ * 显示。值仍提交 wire 原值,文案只呈现
64
+ */
65
+ readonly optionLabels?: Readonly<Record<string, string>>;
68
66
  readonly min?: number;
69
67
  readonly max?: number;
70
68
  readonly step?: number;
@@ -107,8 +105,28 @@ export declare function pairItemKey(field: FieldDef, item: FieldDef): readonly s
107
105
  * 不输出(不渲染空标题)。
108
106
  */
109
107
  export declare function fieldSectionsForPath(path: LayerPath, layer: Layer): readonly FieldSection[];
110
- /** 画布级字段组(未选中图层时):宽/高 */
108
+ /**
109
+ * 画布级字段组(未选中图层时):宽/高 + 背景区段(canvas-background 工单 04)。
110
+ * 背景字段键相对画布根(['background', color|image]),提交由面板折算回整对象
111
+ * 一步事务(usePropertyPanel);背景静态(spec Q3)——imageSrc 不带 data 标记,
112
+ * 无取值方式段、无表达式态,上传缝在静态态展开全形态。
113
+ */
111
114
  export declare const CANVAS_FIELD_SECTIONS: readonly FieldSection[];
115
+ /**
116
+ * 画布级读取视图(canvas-background 工单 04):background null(未设/清空态)投影
117
+ * 为全空值对象——背景字段否则被 readField 的 ok:false 过滤掉,清空后区段即消失、
118
+ * 无法再设置。已设背景原样透出(不拷贝不重整);未打开文档 null。
119
+ */
120
+ export declare function canvasFieldTarget(canvas: Canvas | null): Canvas | null;
121
+ /** 全空背景值对象(读取投影与提交折算共用的一份底形;kernel 归一门会再收口) */
122
+ export declare const EMPTY_CANVAS_BACKGROUND: CanvasBackground;
123
+ /**
124
+ * 图层级读取视图(image-fit 工单 05,canvasFieldTarget 同门):ImageLayer 的 fit
125
+ * 缺省态(wire 无键 = cover)投影为 cover——适配字段否则被 readField 的 ok:false
126
+ * 过滤掉,选中任一未声明的图片层「适配」行即消失。已声明(含未知值)与非图片层
127
+ * 原样透传(不拷贝不重整);投影只作用读侧,提交仍走 updateSpec 直写文档
128
+ */
129
+ export declare function layerFieldTarget(layer: Layer): Layer;
112
130
  export type FieldReadResult = {
113
131
  ok: true;
114
132
  value: unknown;
@@ -0,0 +1,17 @@
1
+ import { CompletionSource } from '../../shared/completion';
2
+ import { FieldDef } from '../fieldSchema';
3
+ type __VLS_Props = {
4
+ field: FieldDef;
5
+ modelValue: string;
6
+ /** 候选源(面板 rowsPathSource 注入缝);null = 未绑声明,无菜单只读回显 */
7
+ source?: CompletionSource | null;
8
+ disabled?: boolean;
9
+ };
10
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
11
+ input: (value: string) => any;
12
+ change: (value: string) => any;
13
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
14
+ onInput?: ((value: string) => any) | undefined;
15
+ onChange?: ((value: string) => any) | undefined;
16
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
17
+ export default _default;
@@ -11,6 +11,7 @@ export { default as FontField } from './FontField';
11
11
  export { default as NumberField } from './NumberField';
12
12
  export { default as PaddingField } from './PaddingField';
13
13
  export { default as PairField } from './PairField';
14
+ export { default as RowsPathField } from './RowsPathField';
14
15
  export { default as SelectField } from './SelectField';
15
16
  export { default as TextField } from './TextField';
16
17
  export { default as TextareaField } from './TextareaField';
@@ -0,0 +1,9 @@
1
+ /**
2
+ * 源图内在尺寸读数(image-fit 工单 05 搭车项,ADR 0023):像素 + 宽高比一行文本,
3
+ * 作者判断 cover/contain 的直接依据。纯函数零 DOM——缩略图 img 装载完成后由
4
+ * 控件以 naturalWidth/naturalHeight 调用,Node 无 DOM 环境可测。
5
+ */
6
+ /** 宽高比显示:整数比(约化后两侧 ≤32,如 16:9)优先,否则两位小数比(如 1.77:1) */
7
+ export declare function aspectRatioLabel(width: number, height: number): string;
8
+ /** 整行读数(「1920×1080 · 16:9」形态);非法尺寸(≤0/非有限值)返回 null 不渲染 */
9
+ export declare function intrinsicSizeLabel(width: number, height: number): string | null;
@@ -26,10 +26,19 @@ export interface PropertyPanelBinding {
26
26
  */
27
27
  readonly completionSource: ComputedRef<CompletionSource | null>;
28
28
  /**
29
- * rowsPath 标记字段的补全候选源(rows-path-completion 工单 03):起点三分流
30
- * + 枚举器组装,「行数组」文案在此置入;未注入/判别降级为 null(零弹层)。
29
+ * rowsPath 字段的级联点选候选源(rows-path-picker 工单 03):起点三分流判别
30
+ * (根层表 = 载荷根 schema;嵌套表 = 外层行 schema 行相对;判别降级 null)+
31
+ * 工单 01 剪枝枚举件按前缀供给(rowsPathPickerSource 组装,候选面剪枝至
32
+ * 「通往行数组的路径」)。起点 null = null 源(门态,菜单钮不渲染,spec D1)。
31
33
  */
32
34
  readonly rowsPathSource: ComputedRef<CompletionSource | null>;
35
+ /**
36
+ * 已提交 rowsPath 的漂移态(rows-path-picker 工单 03,spec D2):模板表选中
37
+ * 态下按起点三分流判已提交值——枚举不出或终点非数组 = true(回显标红,菜单
38
+ * 照常可开可重选);未绑声明/字段面外(非模板表目标)恒 false(门态弱提示
39
+ * 替代标红)。
40
+ */
41
+ readonly rowsPathDrifted: ComputedRef<boolean>;
33
42
  /** 锚点折叠区开合(store ui 分支投影,会话内记忆;工票 03) */
34
43
  readonly anchorExpanded: ComputedRef<boolean>;
35
44
  /**