@hankchen/canvas-editor-vue 0.5.0 → 0.6.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/{canvas-CX1RdlFC.js → canvas-CptBzpwT.js} +7 -7
- package/dist/canvas.js +1 -1
- package/dist/index.js +12 -12
- package/dist/layer-panel/addMenu.d.ts +46 -14
- package/dist/layer-panel/index.d.ts +3 -2
- package/dist/{layer-panel-kOceTf8H.js → layer-panel-Cz-tmbJJ.js} +192 -192
- package/dist/layer-panel.js +1 -1
- package/dist/{property-panel-B32ZBQdf.js → property-panel-OBqd6D8W.js} +326 -322
- package/dist/property-panel.js +2 -2
- package/dist/shared/index.d.ts +10 -3
- package/dist/shared/shortcutsHelp.d.ts +4 -1
- package/dist/shared/useDataSourceSchema.d.ts +3 -1
- package/dist/shared/useDropdownMenu.d.ts +107 -2
- package/dist/shared/useExpressionDiagnostics.d.ts +11 -0
- package/dist/shared.js +7 -7
- package/dist/{status-bar-_PvEXyq8.js → status-bar-DCuK2R88.js} +67 -65
- package/dist/status-bar.js +1 -1
- package/dist/style.css +1 -1
- package/dist/{uploadFile-D1RY-ji0.js → uploadFile-DbB-KhII.js} +11 -7
- package/dist/useDataSourceSchema-CG9EGzwc.js +464 -0
- package/package.json +2 -2
- package/dist/useDataSourceSchema-CGbldbUj.js +0 -237
|
@@ -3,7 +3,7 @@ import { c as t, d as n, f as r, l as i, n as a, o, p as s, r as c, s as l, u }
|
|
|
3
3
|
import { i as d, n as f, o as p } from "./layerPath-uy2ywyld.js";
|
|
4
4
|
import { o as m, s as h } from "./popupPosition-Ck5Gsvjy.js";
|
|
5
5
|
import { c as g, n as _, r as v, s as y, t as b, u as x } from "./useTransientFeedback-CTjmMmFF.js";
|
|
6
|
-
import {
|
|
6
|
+
import { c as S, d as C, i as w, l as T, n as E, o as D, t as O, u as k } from "./uploadFile-DbB-KhII.js";
|
|
7
7
|
import { n as A, t as j } from "./useViewport-D9Ipevzs.js";
|
|
8
8
|
import { Fragment as M, computed as N, createBlock as P, createCommentVNode as F, createElementBlock as I, createElementVNode as L, createVNode as R, defineComponent as z, mergeProps as B, nextTick as V, normalizeClass as H, normalizeStyle as U, onBeforeUnmount as W, onMounted as ee, onScopeDispose as G, openBlock as K, ref as q, renderList as J, shallowRef as Y, toDisplayString as X, unref as Z, vModelText as te, vShow as ne, watch as Q, withDirectives as re, withKeys as ie, withModifiers as $ } from "vue";
|
|
9
9
|
var ae = e({
|
|
@@ -1247,16 +1247,16 @@ var ht = ["wrap"], gt = /*#__PURE__*/ x(/* @__PURE__ */ z({
|
|
|
1247
1247
|
getTextarea: () => i.value,
|
|
1248
1248
|
getHost: () => r.value?.parentElement ?? null,
|
|
1249
1249
|
getToolbar: () => a.value?.rootEl ?? null
|
|
1250
|
-
}), { editing: c, style: l, composing: u, toolbarStyle: d, toolbarTagStyle: f } = s, p = s.layout, h = N(() => p.value?.expressionMode === !0), { diagnostics: g, refresh: _ } =
|
|
1250
|
+
}), { editing: c, style: l, composing: u, toolbarStyle: d, toolbarTagStyle: f } = s, p = s.layout, h = N(() => p.value?.expressionMode === !0), { diagnostics: g, refresh: _ } = S({
|
|
1251
1251
|
target: i,
|
|
1252
1252
|
enabled: h
|
|
1253
|
-
}), v = N(() => h.value ?
|
|
1253
|
+
}), v = N(() => h.value ? D(g.value) : ""), { popup: y, accept: b } = T({
|
|
1254
1254
|
target: i,
|
|
1255
1255
|
enabled: h,
|
|
1256
1256
|
resolve: (e) => {
|
|
1257
1257
|
let t = n.editor.store.ui.dataSourceSchema, r = c.value;
|
|
1258
1258
|
if (t === null || r === null) return null;
|
|
1259
|
-
let i =
|
|
1259
|
+
let i = k(t, C(t, n.editor.store.doc, r));
|
|
1260
1260
|
return i === null ? null : i(e);
|
|
1261
1261
|
},
|
|
1262
1262
|
popupEl: () => o.value?.rootEl ?? null,
|
|
@@ -1389,10 +1389,10 @@ var ht = ["wrap"], gt = /*#__PURE__*/ x(/* @__PURE__ */ z({
|
|
|
1389
1389
|
w.push(E);
|
|
1390
1390
|
let D = new ResizeObserver(T);
|
|
1391
1391
|
D.observe(e), w.push(() => D.disconnect());
|
|
1392
|
-
let
|
|
1392
|
+
let k = ut(() => {
|
|
1393
1393
|
y.setDevicePixelRatio(window.devicePixelRatio), b();
|
|
1394
1394
|
});
|
|
1395
|
-
w.push(
|
|
1395
|
+
w.push(k);
|
|
1396
1396
|
let A = (t) => {
|
|
1397
1397
|
let n = e.getBoundingClientRect();
|
|
1398
1398
|
return {
|
|
@@ -1567,7 +1567,7 @@ var ht = ["wrap"], gt = /*#__PURE__*/ x(/* @__PURE__ */ z({
|
|
|
1567
1567
|
let r = e[t];
|
|
1568
1568
|
if (r) try {
|
|
1569
1569
|
let e = await C(r);
|
|
1570
|
-
await y.uploadImageAsLayer(await
|
|
1570
|
+
await y.uploadImageAsLayer(await O(r), {
|
|
1571
1571
|
at: {
|
|
1572
1572
|
x: n.x + t * vt,
|
|
1573
1573
|
y: n.y + t * vt
|
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-CptBzpwT.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 _, 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-
|
|
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-
|
|
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-CptBzpwT.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-Cz-tmbJJ.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-OBqd6D8W.js";
|
|
4
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 {
|
|
6
|
-
import {
|
|
7
|
-
import { i as
|
|
5
|
+
import { i as G, n as K, r as q, t as J } from "./resourceTemplate-cdcQtp9a.js";
|
|
6
|
+
import { c as Y, i as X, n as Z, s as Q, t as $ } from "./useTransientFeedback-CTjmMmFF.js";
|
|
7
|
+
import { c as ee, d as te, i as ne, l as re, n as ie, o as ae, r as oe, t as se, u as ce } from "./uploadFile-DbB-KhII.js";
|
|
8
8
|
import { n as le, t as ue } from "./usePathCompletion-Do17CQ6l.js";
|
|
9
9
|
import { n as de, t as fe } from "./useViewport-D9Ipevzs.js";
|
|
10
|
-
import {
|
|
11
|
-
import { n as
|
|
12
|
-
import { t as
|
|
13
|
-
import { n as
|
|
10
|
+
import { i as pe, n as me, r as he, t as ge } from "./useDataSourceSchema-CG9EGzwc.js";
|
|
11
|
+
import { n as _e, r as ve, t as ye } from "./status-bar-DCuK2R88.js";
|
|
12
|
+
import { t as be } from "./useShortcutsHelp-CsyarO2P.js";
|
|
13
|
+
import { n as xe, r as Se, t as Ce } from "./shared-wuupBoZg.js";
|
|
14
14
|
//#region src/index.ts
|
|
15
|
-
var
|
|
15
|
+
var we = "@hankchen/canvas-editor-vue";
|
|
16
16
|
//#endregion
|
|
17
|
-
export { _ as ADD_LAYER_MENU, S as ADD_MENU, w as ADD_RATIO_PRESET_MENU, v as ADD_TEXT_PRESET_MENU,
|
|
17
|
+
export { _ as ADD_LAYER_MENU, S as ADD_MENU, w as ADD_RATIO_PRESET_MENU, v as ADD_TEXT_PRESET_MENU, X as ARM_LAYER_CREATE_HINT, e as AlignFloatBar, F as CANVAS_FIELD_SECTIONS, n as CanvasSurface, a as ContextMenu, he as DropdownMenu, f as EditOverlayToolbar, V as ExpressionCompletionPopup, q as ExpressionPathPicker, D as FIELD_SECTIONS_BY_TYPE, oe as FONT_PICKER_KEY, l as FindBar, m as GuidesOverlay, Se as HelpDialog, E as IMAGE_UPLOAD_KEY, T as LayerPanel, we 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, ye as StatusBar, y as TemplateTableForm, c as TextEditingOverlay, R as applyCompletion, J as attachResourceTemplate, A as controlRegistry, u as createGizmoOverlayPainter, h as createRafScheduler, Q as detectShortcutPlatform, t as drawCreateRubberBand, s as drawFindMatches, p as drawSelectionGizmo, ce as expressionCompletionSource, ae as expressionDiagnosticHint, te as expressionFieldContext, j as fieldSectionsForPath, L as fieldSectionsForType, _e as formatLayerGeometry, ve as formatLayerPath, ne as injectFontPicker, N as injectImageUpload, Z as isEditableEventTarget, x as isUpperHalf, O as layerRoleAt, z as measureCursorAnchor, G as pathPickerEntries, H as placePopupInViewport, k as readField, le as rowsPathCompletionSource, ie as selectionFieldMergeKey, Y as shortcutActionLabel, K as stripResourceTemplate, se as uploadFileFromDom, ge as useDataSourceSchema, me as useDataSourceSchemaRejection, r as useDpr, pe as useDropdownMenu, re as useExpressionCompletion, ee as useExpressionDiagnostics, o as useFindSession, xe as useHistory, C as useLayerPanel, ue as usePathCompletion, P as usePropertyPanel, de as useSelection, Ce as useShortcuts, be as useShortcutsHelp, g as useTextEditing, $ as useTransientFeedback, fe as useViewport, i as watchDprChanges };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { LayerType, RatioPresetId, TextPresetId } from '@hankchen/canvas-editor';
|
|
2
|
-
/** 新增菜单项(spec §2.1):四类图层武装画拉(drag-create 工单 03);模板表带
|
|
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,34 +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
|
};
|
|
20
|
-
/**
|
|
25
|
+
/** 比例预设子项(工单 03 树形化):「图片层」二级条目数据面——形状说明灰字后缀
|
|
26
|
+
* (正方形/横向/纵向),free 档不入清单(ADR 0021「自由不经预设进入」) */
|
|
21
27
|
export type AddRatioPresetKind = {
|
|
22
28
|
kind: 'ratio-preset';
|
|
23
29
|
preset: RatioPresetId;
|
|
24
30
|
label: string;
|
|
31
|
+
/** 档位说明灰字后缀(底座 DropdownMenuItem.shortcut 同缝) */
|
|
32
|
+
shortcut: string;
|
|
25
33
|
title: string;
|
|
26
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
|
+
}>;
|
|
27
44
|
export declare const ADD_MENU: readonly AddMenuKind[];
|
|
28
|
-
/**
|
|
29
|
-
*
|
|
45
|
+
/** 文本预设三档(text-defaults 工单 02 引入,spec 决策 4):从内核 TEXT_PRESETS
|
|
46
|
+
* 派生(字号单一事实源,内核改档位文案自动跟随),v1 只定字号——字体缺口由
|
|
47
|
+
* 新层样式槽补;后缀 = 档位字号(40号/28号/16号,同源自派生不抄写) */
|
|
30
48
|
export declare const ADD_TEXT_PRESET_MENU: readonly AddTextPresetKind[];
|
|
31
|
-
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
49
|
+
/** 比例预设五档(image-ratio-preset 工单 02 引入;工单 03 树形化收二级,ADR 0021):
|
|
50
|
+
* 具名档从内核 RATIO_PRESETS 派生(比例与顺序单一事实源)——free 档不入清单
|
|
51
|
+
* (「自由」不经预设进入,一级图片层本体即自由);档位 id 即上屏文案,后缀 =
|
|
52
|
+
* 形状说明(同源自派生)。title 带比例说明与画拉提示;Shift 手势瞬时反转随档位
|
|
53
|
+
* 给反向提示(具名档按 Shift 临时自由) */
|
|
34
54
|
export declare const ADD_RATIO_PRESET_MENU: readonly AddRatioPresetKind[];
|
|
35
|
-
/**
|
|
36
|
-
*
|
|
37
|
-
* ADD_LAYER_MENU
|
|
38
|
-
|
|
55
|
+
/** 面板「+」树形序(工单 03,spec 决策 4):ADD_MENU 恒等派生基座上映射 children
|
|
56
|
+
* ——文本层挂文本预设三档、图片层挂比例具名五档,其余行原样(无二级);一级
|
|
57
|
+
* 与工具栏「+插入▾」同构。工具栏派生视图 ADD_LAYER_MENU = ADD_MENU 平铺不变
|
|
58
|
+
* (预设只属面板二级) */
|
|
59
|
+
export declare const PANEL_ADD_MENU: readonly PanelAddMenuEntry[];
|
|
39
60
|
/** 层型项视图(工具栏「+插入▾」消费,editor-top-toolbar 工单 03):ADD_MENU 的
|
|
40
61
|
* 四类图层项。template-table-drag-create 工单 03 起模板表项同序收入(spec 决策
|
|
41
|
-
* 5,四图层项后收尾)——视图 = ADD_MENU
|
|
42
|
-
*
|
|
62
|
+
* 5,四图层项后收尾)——视图 = ADD_MENU 全量恒等派生,工具栏与面板一级同序同
|
|
63
|
+
* 文案;分发差异(模板表项弹层表单、四图层项直接武装)归消费面(LayerPanel /
|
|
64
|
+
* 宿主);工具栏不加预设(spec 决策 5 豁免,类型面无 children 结构性保证) */
|
|
43
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;
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
* 图层面板域出口:图层面板组件、共享模板行路径表单(TemplateTableForm——面板菜单
|
|
3
3
|
* 与工具栏弹层共用,template-table-drag-create 工单 02)、订阅切片桥(useLayerPanel)
|
|
4
4
|
* 与新增菜单数据面(ADD_MENU/ADD_LAYER_MENU——工具栏「+插入▾」同源消费,
|
|
5
|
-
* editor-top-toolbar 工单 03
|
|
5
|
+
* editor-top-toolbar 工单 03;面板树形 PANEL_ADD_MENU 挂预设二级,preset-submenu
|
|
6
|
+
* 工单 03 两族预设清单面板专用且只入二级)。
|
|
6
7
|
*/
|
|
7
8
|
export { default as LayerPanel } from './LayerPanel';
|
|
8
9
|
export { default as TemplateTableForm } from './TemplateTableForm';
|
|
9
10
|
export { isUpperHalf, useLayerPanel, type LayerPanelBinding } from './useLayerPanel';
|
|
10
|
-
export { ADD_LAYER_MENU, ADD_MENU, ADD_RATIO_PRESET_MENU, ADD_TEXT_PRESET_MENU, PANEL_ADD_MENU, type AddMenuKind, type AddRatioPresetKind, 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';
|