@hankchen/canvas-editor-vue 0.4.0 → 0.6.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/{canvas-DqQislJ_.js → canvas-CX1RdlFC.js} +3 -3
- package/dist/canvas.js +1 -1
- package/dist/index.js +15 -15
- package/dist/layer-panel/LayerPanel.d.ts +1 -27
- package/dist/layer-panel/TemplateTableForm.d.ts +38 -0
- package/dist/layer-panel/addMenu.d.ts +56 -12
- package/dist/layer-panel/index.d.ts +7 -3
- package/dist/{layer-panel-DskyCgF5.js → layer-panel-Cd1e8xNB.js} +341 -255
- package/dist/layer-panel.js +2 -2
- package/dist/shared/index.d.ts +9 -2
- package/dist/shared/shortcutsHelp.d.ts +4 -1
- package/dist/shared/useDropdownMenu.d.ts +107 -2
- package/dist/shared.js +1 -1
- package/dist/{status-bar-_PvEXyq8.js → status-bar-XMVbRLY9.js} +1 -1
- package/dist/status-bar.js +1 -1
- package/dist/style.css +1 -1
- package/dist/useDataSourceSchema-YV8g-lo0.js +458 -0
- package/package.json +2 -2
- package/dist/useDataSourceSchema-CGbldbUj.js +0 -237
|
@@ -1469,10 +1469,10 @@ var ht = ["wrap"], gt = /*#__PURE__*/ x(/* @__PURE__ */ z({
|
|
|
1469
1469
|
};
|
|
1470
1470
|
else if (N.mode === "resize") {
|
|
1471
1471
|
let t = F(e);
|
|
1472
|
-
y.resizeTo(t.x, t.y);
|
|
1472
|
+
y.resizeTo(t.x, t.y, e.shiftKey);
|
|
1473
1473
|
} else if (N.mode === "create") {
|
|
1474
1474
|
let t = F(e);
|
|
1475
|
-
y.createTo(t.x, t.y);
|
|
1475
|
+
y.createTo(t.x, t.y, e.shiftKey);
|
|
1476
1476
|
} else {
|
|
1477
1477
|
let t = F(e);
|
|
1478
1478
|
y.dragTo(t.x, t.y);
|
|
@@ -1626,7 +1626,7 @@ var ht = ["wrap"], gt = /*#__PURE__*/ x(/* @__PURE__ */ z({
|
|
|
1626
1626
|
x.value ? (K(), I("div", _t, [...n[0] ||= [L("span", { class: "cn-surface__drop-hint-text" }, "松开以上传图片", -1)]])) : F("", !0)
|
|
1627
1627
|
], 6));
|
|
1628
1628
|
}
|
|
1629
|
-
}), [["__scopeId", "data-v-
|
|
1629
|
+
}), [["__scopeId", "data-v-2327ee46"]]);
|
|
1630
1630
|
//#endregion
|
|
1631
1631
|
//#region src/canvas/guideSnap.ts
|
|
1632
1632
|
function bt(e, t, n, r) {
|
package/dist/canvas.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as e, a as t, c as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, o as d, p as f, r as p, s as m, t as h, u as g } from "./canvas-
|
|
1
|
+
import { _ as e, a as t, c as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, o as d, p as f, r as p, s as m, t as h, u as g } from "./canvas-CX1RdlFC.js";
|
|
2
2
|
export { e as AlignFloatBar, n as CanvasSurface, a as ContextMenu, f as EditOverlayToolbar, l as FindBar, m as GuidesOverlay, d as Ruler, c as TextEditingOverlay, u as createGizmoOverlayPainter, h as createRafScheduler, t as drawCreateRubberBand, s as drawFindMatches, p as drawSelectionGizmo, r as useDpr, o as useFindSession, g as useTextEditing, i as watchDprChanges };
|
package/dist/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { _ as e, a as t, c as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, o as d, p as f, r as p, s as m, t as h, u as g } from "./canvas-
|
|
2
|
-
import { a as _,
|
|
3
|
-
import { a as
|
|
4
|
-
import { a as
|
|
5
|
-
import { c as
|
|
6
|
-
import { a as
|
|
7
|
-
import { i as
|
|
8
|
-
import { n as
|
|
9
|
-
import { n as
|
|
10
|
-
import { n as
|
|
11
|
-
import { n as
|
|
12
|
-
import { t as
|
|
13
|
-
import { n as
|
|
1
|
+
import { _ as e, a as t, c as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, o as d, p as f, r as p, s as m, t as h, u as g } from "./canvas-CX1RdlFC.js";
|
|
2
|
+
import { a as _, c as v, i as y, l as b, n as x, o as S, r as C, s as w, t as T } from "./layer-panel-Cd1e8xNB.js";
|
|
3
|
+
import { a as E, c as D, d as O, f as k, i as A, l as j, n as M, o as N, r as P, s as F, t as I, u as L } from "./property-panel-B32ZBQdf.js";
|
|
4
|
+
import { a as R, i as z, n as B, o as V, r as H, s as U, t as W } from "./popupPosition-Ck5Gsvjy.js";
|
|
5
|
+
import { c as G, i as K, n as q, s as J, t as Y } from "./useTransientFeedback-CTjmMmFF.js";
|
|
6
|
+
import { a as X, c as Z, i as Q, l as $, n as ee, o as te, r as ne, s as re, t as ie } from "./uploadFile-D1RY-ji0.js";
|
|
7
|
+
import { i as ae, n as oe, r as se, t as ce } from "./resourceTemplate-cdcQtp9a.js";
|
|
8
|
+
import { n as le, t as ue } from "./usePathCompletion-Do17CQ6l.js";
|
|
9
|
+
import { n as de, t as fe } from "./useViewport-D9Ipevzs.js";
|
|
10
|
+
import { n as pe, r as me, t as he } from "./useDataSourceSchema-YV8g-lo0.js";
|
|
11
|
+
import { n as ge, r as _e, t as ve } from "./status-bar-XMVbRLY9.js";
|
|
12
|
+
import { t as ye } from "./useShortcutsHelp-CsyarO2P.js";
|
|
13
|
+
import { n as be, r as xe, t as Se } from "./shared-wuupBoZg.js";
|
|
14
14
|
//#region src/index.ts
|
|
15
|
-
var
|
|
15
|
+
var Ce = "@hankchen/canvas-editor-vue";
|
|
16
16
|
//#endregion
|
|
17
|
-
export {
|
|
17
|
+
export { _ as ADD_LAYER_MENU, S as ADD_MENU, w as ADD_RATIO_PRESET_MENU, v as ADD_TEXT_PRESET_MENU, K as ARM_LAYER_CREATE_HINT, e as AlignFloatBar, F as CANVAS_FIELD_SECTIONS, n as CanvasSurface, a as ContextMenu, pe as DropdownMenu, f as EditOverlayToolbar, V as ExpressionCompletionPopup, se as ExpressionPathPicker, D as FIELD_SECTIONS_BY_TYPE, ne as FONT_PICKER_KEY, l as FindBar, m as GuidesOverlay, xe as HelpDialog, E as IMAGE_UPLOAD_KEY, T as LayerPanel, Ce as PACKAGE_NAME, b as PANEL_ADD_MENU, W as POPUP_GAP, B as POPUP_MARGIN, U as PanelIcon, M as PropertyField, I as PropertyPanel, d as Ruler, ve as StatusBar, y as TemplateTableForm, c as TextEditingOverlay, R as applyCompletion, ce as attachResourceTemplate, A as controlRegistry, u as createGizmoOverlayPainter, h as createRafScheduler, J as detectShortcutPlatform, t as drawCreateRubberBand, s as drawFindMatches, p as drawSelectionGizmo, Z as expressionCompletionSource, X as expressionDiagnosticHint, $ as expressionFieldContext, j as fieldSectionsForPath, L as fieldSectionsForType, ge as formatLayerGeometry, _e as formatLayerPath, Q as injectFontPicker, N as injectImageUpload, q as isEditableEventTarget, x as isUpperHalf, O as layerRoleAt, z as measureCursorAnchor, ae as pathPickerEntries, H as placePopupInViewport, k as readField, le as rowsPathCompletionSource, ee as selectionFieldMergeKey, G as shortcutActionLabel, oe as stripResourceTemplate, ie as uploadFileFromDom, he as useDataSourceSchema, r as useDpr, me as useDropdownMenu, re as useExpressionCompletion, te as useExpressionDiagnostics, o as useFindSession, be as useHistory, C as useLayerPanel, ue as usePathCompletion, P as usePropertyPanel, de as useSelection, Se as useShortcuts, ye as useShortcutsHelp, g as useTextEditing, Y as useTransientFeedback, fe as useViewport, i as watchDprChanges };
|
|
@@ -2,31 +2,5 @@ import { EditorSession } from '@hankchen/canvas-editor';
|
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
editor: EditorSession;
|
|
4
4
|
};
|
|
5
|
-
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
6
|
-
rowsPathInputEl: HTMLInputElement;
|
|
7
|
-
pathPopupRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
8
|
-
state: import('..').ExpressionCompletionState;
|
|
9
|
-
}> & Readonly<{
|
|
10
|
-
onSelect?: ((index: number) => any) | undefined;
|
|
11
|
-
}>, {
|
|
12
|
-
rootEl: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
|
|
13
|
-
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
14
|
-
select: (index: number) => any;
|
|
15
|
-
}, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
|
16
|
-
rootRef: HTMLDivElement;
|
|
17
|
-
}, any, import('vue').ComponentProvideOptions, {
|
|
18
|
-
P: {};
|
|
19
|
-
B: {};
|
|
20
|
-
D: {};
|
|
21
|
-
C: {};
|
|
22
|
-
M: {};
|
|
23
|
-
Defaults: {};
|
|
24
|
-
}, Readonly<{
|
|
25
|
-
state: import('..').ExpressionCompletionState;
|
|
26
|
-
}> & Readonly<{
|
|
27
|
-
onSelect?: ((index: number) => any) | undefined;
|
|
28
|
-
}>, {
|
|
29
|
-
rootEl: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
|
|
30
|
-
}, {}, {}, {}, {}> | null;
|
|
31
|
-
}, HTMLElement>;
|
|
5
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLElement>;
|
|
32
6
|
export default _default;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { EditorSession } from '@hankchen/canvas-editor';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
editor: EditorSession;
|
|
4
|
+
};
|
|
5
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
6
|
+
cancel: () => any;
|
|
7
|
+
confirm: (rowsPath: string) => any;
|
|
8
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
9
|
+
onCancel?: (() => any) | undefined;
|
|
10
|
+
onConfirm?: ((rowsPath: string) => any) | undefined;
|
|
11
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
12
|
+
rowsPathInputEl: HTMLInputElement;
|
|
13
|
+
pathPopupRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
14
|
+
state: import('..').ExpressionCompletionState;
|
|
15
|
+
}> & Readonly<{
|
|
16
|
+
onSelect?: ((index: number) => any) | undefined;
|
|
17
|
+
}>, {
|
|
18
|
+
rootEl: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
|
|
19
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
20
|
+
select: (index: number) => any;
|
|
21
|
+
}, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
|
22
|
+
rootRef: HTMLDivElement;
|
|
23
|
+
}, any, import('vue').ComponentProvideOptions, {
|
|
24
|
+
P: {};
|
|
25
|
+
B: {};
|
|
26
|
+
D: {};
|
|
27
|
+
C: {};
|
|
28
|
+
M: {};
|
|
29
|
+
Defaults: {};
|
|
30
|
+
}, Readonly<{
|
|
31
|
+
state: import('..').ExpressionCompletionState;
|
|
32
|
+
}> & Readonly<{
|
|
33
|
+
onSelect?: ((index: number) => any) | undefined;
|
|
34
|
+
}>, {
|
|
35
|
+
rootEl: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
|
|
36
|
+
}, {}, {}, {}, {}> | null;
|
|
37
|
+
}, HTMLDivElement>;
|
|
38
|
+
export default _default;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { LayerType, TextPresetId } from '@hankchen/canvas-editor';
|
|
2
|
-
/** 新增菜单项(spec §2.1):四类图层武装画拉(drag-create 工单 03);模板表带
|
|
1
|
+
import { LayerType, RatioPresetId, TextPresetId } from '@hankchen/canvas-editor';
|
|
2
|
+
/** 新增菜单项(spec §2.1):四类图层武装画拉(drag-create 工单 03);模板表带
|
|
3
|
+
* rowsPath 必填表单。层型项不带 children——工具栏派生视图 ADD_LAYER_MENU 的
|
|
4
|
+
* 类型面天然平铺(预设只属面板二级) */
|
|
3
5
|
export type AddMenuKind = {
|
|
4
6
|
kind: 'layer';
|
|
5
7
|
type: LayerType;
|
|
@@ -10,22 +12,64 @@ export type AddMenuKind = {
|
|
|
10
12
|
label: string;
|
|
11
13
|
title: string;
|
|
12
14
|
};
|
|
13
|
-
/**
|
|
15
|
+
/** 文本预设子项(工单 03 树形化):「文本层」二级条目数据面——档位说明灰字后缀
|
|
16
|
+
* 走底座 shortcut 槽(字号「40号」式),分发(armLayerCreate 带 preset)归消费面 */
|
|
14
17
|
export type AddTextPresetKind = {
|
|
15
18
|
kind: 'text-preset';
|
|
16
19
|
preset: TextPresetId;
|
|
17
20
|
label: string;
|
|
21
|
+
/** 档位说明灰字后缀(底座 DropdownMenuItem.shortcut 同缝) */
|
|
22
|
+
shortcut: string;
|
|
18
23
|
title: string;
|
|
19
24
|
};
|
|
25
|
+
/** 比例预设子项(工单 03 树形化):「图片层」二级条目数据面——形状说明灰字后缀
|
|
26
|
+
* (正方形/横向/纵向),free 档不入清单(ADR 0021「自由不经预设进入」) */
|
|
27
|
+
export type AddRatioPresetKind = {
|
|
28
|
+
kind: 'ratio-preset';
|
|
29
|
+
preset: RatioPresetId;
|
|
30
|
+
label: string;
|
|
31
|
+
/** 档位说明灰字后缀(底座 DropdownMenuItem.shortcut 同缝) */
|
|
32
|
+
shortcut: string;
|
|
33
|
+
title: string;
|
|
34
|
+
};
|
|
35
|
+
/** 面板树形条目(工单 03):层型项可携预设二级 children(文本/图片两行),模板表
|
|
36
|
+
* 沿 AddMenuKind 原形态(表单入口非预设宿主) */
|
|
37
|
+
export type PanelAddMenuEntry = (Extract<AddMenuKind, {
|
|
38
|
+
kind: 'layer';
|
|
39
|
+
}> & {
|
|
40
|
+
children?: readonly (AddTextPresetKind | AddRatioPresetKind)[];
|
|
41
|
+
}) | Extract<AddMenuKind, {
|
|
42
|
+
kind: 'template-table';
|
|
43
|
+
}>;
|
|
20
44
|
export declare const ADD_MENU: readonly AddMenuKind[];
|
|
21
|
-
/**
|
|
22
|
-
*
|
|
45
|
+
/** 文本预设三档(text-defaults 工单 02 引入,spec 决策 4):从内核 TEXT_PRESETS
|
|
46
|
+
* 派生(字号单一事实源,内核改档位文案自动跟随),v1 只定字号——字体缺口由
|
|
47
|
+
* 新层样式槽补;后缀 = 档位字号(40号/28号/16号,同源自派生不抄写) */
|
|
23
48
|
export declare const ADD_TEXT_PRESET_MENU: readonly AddTextPresetKind[];
|
|
24
|
-
/**
|
|
25
|
-
*
|
|
26
|
-
|
|
49
|
+
/** 比例预设五档(image-ratio-preset 工单 02 引入;工单 03 树形化收二级,ADR 0021):
|
|
50
|
+
* 具名档从内核 RATIO_PRESETS 派生(比例与顺序单一事实源)——free 档不入清单
|
|
51
|
+
* (「自由」不经预设进入,一级图片层本体即自由);档位 id 即上屏文案,后缀 =
|
|
52
|
+
* 形状说明(同源自派生)。title 带比例说明与画拉提示;Shift 手势瞬时反转随档位
|
|
53
|
+
* 给反向提示(具名档按 Shift 临时自由) */
|
|
54
|
+
export declare const ADD_RATIO_PRESET_MENU: readonly AddRatioPresetKind[];
|
|
55
|
+
/** 面板「+」树形序(工单 03,spec 决策 4):ADD_MENU 恒等派生基座上映射 children
|
|
56
|
+
* ——文本层挂文本预设三档、图片层挂比例具名五档,其余行原样(无二级);一级
|
|
57
|
+
* 与工具栏「+插入▾」同构。工具栏派生视图 ADD_LAYER_MENU = ADD_MENU 平铺不变
|
|
58
|
+
* (预设只属面板二级) */
|
|
59
|
+
export declare const PANEL_ADD_MENU: readonly PanelAddMenuEntry[];
|
|
27
60
|
/** 层型项视图(工具栏「+插入▾」消费,editor-top-toolbar 工单 03):ADD_MENU 的
|
|
28
|
-
*
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
61
|
+
* 四类图层项。template-table-drag-create 工单 03 起模板表项同序收入(spec 决策
|
|
62
|
+
* 5,四图层项后收尾)——视图 = ADD_MENU 全量恒等派生,工具栏与面板一级同序同
|
|
63
|
+
* 文案;分发差异(模板表项弹层表单、四图层项直接武装)归消费面(LayerPanel /
|
|
64
|
+
* 宿主);工具栏不加预设(spec 决策 5 豁免,类型面无 children 结构性保证) */
|
|
65
|
+
export declare const ADD_LAYER_MENU: readonly AddMenuKind[];
|
|
66
|
+
/**
|
|
67
|
+
* 武装建层瞬时提示·带档变体(canvas-web-preset-submenu 工单 03;评审整改 F1 自
|
|
68
|
+
* shared/shortcutsHelp 迁入):面板预设二级子项分发专用——「画拉建{层型}({档名})」
|
|
69
|
+
* 句式带档名让用户确认本次画拉吃的是哪一档(层型名与档名在分发点均已知,取自
|
|
70
|
+
* 本模块菜单常量,无需内核查询口),操作指引尾沿现句、复用 shared 的
|
|
71
|
+
* ARM_LAYER_CREATE_HINT 常量(文案单点仍在 shared,改句两处自动跟随);快捷键/
|
|
72
|
+
* 一级主体/工具栏三入口恒非预设语义,维持现句不变。消费面仅 LayerPanel 分发点
|
|
73
|
+
* (单域),按包落位规则不进 shared 出口。
|
|
74
|
+
*/
|
|
75
|
+
export declare function armLayerCreatePresetHint(layerLabel: string, presetLabel: string): string;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* 图层面板域出口:图层面板组件、共享模板行路径表单(TemplateTableForm——面板菜单
|
|
3
|
+
* 与工具栏弹层共用,template-table-drag-create 工单 02)、订阅切片桥(useLayerPanel)
|
|
4
|
+
* 与新增菜单数据面(ADD_MENU/ADD_LAYER_MENU——工具栏「+插入▾」同源消费,
|
|
5
|
+
* editor-top-toolbar 工单 03;面板树形 PANEL_ADD_MENU 挂预设二级,preset-submenu
|
|
6
|
+
* 工单 03 两族预设清单面板专用且只入二级)。
|
|
4
7
|
*/
|
|
5
8
|
export { default as LayerPanel } from './LayerPanel';
|
|
9
|
+
export { default as TemplateTableForm } from './TemplateTableForm';
|
|
6
10
|
export { isUpperHalf, useLayerPanel, type LayerPanelBinding } from './useLayerPanel';
|
|
7
|
-
export { ADD_LAYER_MENU, ADD_MENU, ADD_TEXT_PRESET_MENU, PANEL_ADD_MENU, type AddMenuKind, type AddTextPresetKind, } from './addMenu';
|
|
11
|
+
export { ADD_LAYER_MENU, ADD_MENU, ADD_RATIO_PRESET_MENU, ADD_TEXT_PRESET_MENU, PANEL_ADD_MENU, type AddMenuKind, type AddRatioPresetKind, type AddTextPresetKind, type PanelAddMenuEntry, } from './addMenu';
|