@hankchen/canvas-editor-vue 0.6.0 → 0.7.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/{useDataSourceSchema-YV8g-lo0.js → DropdownMenu-CeUNKMDQ.js} +70 -78
- package/dist/ExpressionPathPicker-DchGsK70.js +739 -0
- package/dist/{canvas-CX1RdlFC.js → canvas-D3fFnBqG.js} +526 -527
- package/dist/canvas.js +1 -1
- package/dist/index.js +14 -15
- package/dist/layer-panel/TemplateTableForm.d.ts +1 -27
- package/dist/{layer-panel-Cd1e8xNB.js → layer-panel-BouAYiDq.js} +231 -257
- package/dist/layer-panel.js +1 -1
- package/dist/property-panel/PropertyField.d.ts +9 -2
- package/dist/property-panel/fieldSchema.d.ts +16 -10
- package/dist/property-panel/fields/RowsPathField.d.ts +17 -0
- package/dist/property-panel/fields/index.d.ts +1 -0
- package/dist/property-panel/usePropertyPanel.d.ts +11 -2
- package/dist/{property-panel-B32ZBQdf.js → property-panel-DJQJzioT.js} +403 -341
- package/dist/property-panel.js +2 -2
- package/dist/resourceTemplate-D-DKEo7Z.js +33 -0
- package/dist/shared/ExpressionPathPicker.d.ts +9 -2
- package/dist/shared/index.d.ts +13 -10
- package/dist/shared/pathPickerModel.d.ts +16 -3
- package/dist/shared/popupPosition.d.ts +2 -2
- package/dist/shared/rowsPathPickerSource.d.ts +15 -0
- package/dist/shared/useDataSourceSchema.d.ts +9 -1
- package/dist/shared/useExpressionDiagnostics.d.ts +11 -0
- package/dist/{shared-wuupBoZg.js → shared-CRDKDSpa.js} +22 -22
- package/dist/shared.js +9 -10
- package/dist/{status-bar-XMVbRLY9.js → status-bar-DBf5kIXY.js} +69 -67
- package/dist/status-bar.js +1 -1
- package/dist/style.css +1 -1
- package/dist/uploadFile-mXJVPEzm.js +653 -0
- package/dist/{useTransientFeedback-CTjmMmFF.js → useTransientFeedback-BN_O7V2w.js} +43 -28
- package/package.json +2 -2
- package/dist/popupPosition-Ck5Gsvjy.js +0 -526
- package/dist/resourceTemplate-cdcQtp9a.js +0 -246
- package/dist/shared/rowsPathCompletionSource.d.ts +0 -3
- package/dist/shared/usePathCompletion.d.ts +0 -18
- package/dist/uploadFile-D1RY-ji0.js +0 -516
- package/dist/usePathCompletion-Do17CQ6l.js +0 -220
package/dist/property-panel.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as e, c as t, d as n, f as r, i, l as a, n as o, o as s, r as c, s as l, t as u, u as d } from "./property-panel-
|
|
2
|
-
import { i as f, r as p } from "./uploadFile-
|
|
1
|
+
import { a as e, c as t, d as n, f as r, i, l as a, n as o, o as s, r as c, s as l, t as u, u as d } from "./property-panel-DJQJzioT.js";
|
|
2
|
+
import { i as f, r as p } from "./uploadFile-mXJVPEzm.js";
|
|
3
3
|
export { l as CANVAS_FIELD_SECTIONS, t as FIELD_SECTIONS_BY_TYPE, p as FONT_PICKER_KEY, e as IMAGE_UPLOAD_KEY, o as PropertyField, u as PropertyPanel, i as controlRegistry, a as fieldSectionsForPath, d as fieldSectionsForType, f as injectFontPicker, s as injectImageUpload, n as layerRoleAt, r as readField, c as usePropertyPanel };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { f as e } from "./ExpressionPathPicker-DchGsK70.js";
|
|
2
|
+
//#region ../canvas-editor/src/shared/resourcePath.ts
|
|
3
|
+
function t(e, t) {
|
|
4
|
+
return {
|
|
5
|
+
kind: t,
|
|
6
|
+
start: 0,
|
|
7
|
+
end: e.length,
|
|
8
|
+
at: {
|
|
9
|
+
start: 0,
|
|
10
|
+
end: e.length
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function n(n) {
|
|
15
|
+
let r = n.endsWith("\n") ? n.slice(0, -1) : n, i = /^\{\{([^{}]*)\}\}$/.exec(r);
|
|
16
|
+
if (i === null) return [t(n, "resource_not_single_ref")];
|
|
17
|
+
let a = e(i[1] ?? "");
|
|
18
|
+
return a === "" ? [t(n, "empty_fragment")] : a.includes("(") ? [t(n, "resource_function_call")] : [];
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/shared/resourceTemplate.ts
|
|
22
|
+
function r(t) {
|
|
23
|
+
if (n(t).length > 0) return null;
|
|
24
|
+
let r = t.endsWith("\n") ? t.slice(0, -1) : t, i = /^\{\{([^{}]*)\}\}$/.exec(r)?.[1];
|
|
25
|
+
if (i === void 0) return null;
|
|
26
|
+
let a = e(i);
|
|
27
|
+
return a === "" ? null : a;
|
|
28
|
+
}
|
|
29
|
+
function i(e) {
|
|
30
|
+
return `{{${e}}}`;
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { r as n, n as r, i as t };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CompletionSource } from './completion';
|
|
2
|
+
import { PathPickerMode } from './pathPickerModel';
|
|
2
3
|
type __VLS_Props = {
|
|
3
4
|
/** 裸点路径原文(壳已拆 `{{}}`;存量违例拆不动时壳原样透传,只读回显) */
|
|
4
5
|
modelValue: string;
|
|
@@ -10,13 +11,19 @@ type __VLS_Props = {
|
|
|
10
11
|
ariaLabel?: string;
|
|
11
12
|
/** 空值占位文案 */
|
|
12
13
|
placeholder?: string;
|
|
14
|
+
/**
|
|
15
|
+
* 终点形态(rows-path-picker 工单 02,spec D3):'resource' = 叶子终点
|
|
16
|
+
* (缺省,资源面既有调用零改动);'rowsPath' = 数组终点(仅数组可选、
|
|
17
|
+
* 对象只下钻、空态提示行)。判定矩阵归 pathPickerModel,壳全共享。
|
|
18
|
+
*/
|
|
19
|
+
mode?: PathPickerMode;
|
|
13
20
|
};
|
|
14
21
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
15
|
-
change: (path: string) => any;
|
|
16
22
|
"update:modelValue": (path: string) => any;
|
|
23
|
+
change: (path: string) => any;
|
|
17
24
|
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
18
|
-
onChange?: ((path: string) => any) | undefined;
|
|
19
25
|
"onUpdate:modelValue"?: ((path: string) => any) | undefined;
|
|
26
|
+
onChange?: ((path: string) => any) | undefined;
|
|
20
27
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
21
28
|
rootRef: HTMLDivElement;
|
|
22
29
|
toggleButton: HTMLButtonElement;
|
package/dist/shared/index.d.ts
CHANGED
|
@@ -8,14 +8,18 @@
|
|
|
8
8
|
* (呈现件 + 开合逻辑 composable;工具栏三下拉内建触发钮直用,状态栏缩放菜单/
|
|
9
9
|
* 面板+经 #trigger/#body 受控插槽迁移消费——issues/05)与表达式补全五件(数据
|
|
10
10
|
* 契约/锚点测量/浮层控件/上下文判定与候选源适配——属性面板与画布文本
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
11
|
+
* 编辑两域共用;rows-path-completion 的裸路径补全控件 usePathCompletion 与
|
|
12
|
+
* rowsPathCompletionSource 手输源随 rowsPath 作者面纯点选化零消费方,已于
|
|
13
|
+
* rows-path-picker 工单 05 整体退役)与点选器候选源组装
|
|
14
|
+
* rowsPathPickerSource(rows-path-picker 工单 02:剪枝枚举件适配,供选择器
|
|
15
|
+
* mode='rowsPath' 消费——工单 04 起建表表单与右键轻表单两入口同源)与 schema
|
|
16
|
+
* 声明切片桥 useDataSourceSchema(工单 04 自 status-bar
|
|
17
|
+
* 收口——状态栏读数段、建表表单与右键菜单门态多域共用)与字体清单注入缝 fontPicker(
|
|
16
18
|
* edit-overlay-toolbar 工单 04 自属性面板域迁入——面板字体控件与编辑浮层工具条
|
|
17
19
|
* 字体段两域共用)与字段权威写 mergeKey 约定 mergeKey(面板与工具条双入口同键
|
|
18
|
-
* 合并的格式单点)与资源表达式级联路径选择器 ExpressionPathPicker +
|
|
20
|
+
* 合并的格式单点)与资源表达式级联路径选择器 ExpressionPathPicker + 候选模型
|
|
21
|
+
* pathPickerModel(rows-path-picker 工单 02 起带终点形态分叉 mode:resource
|
|
22
|
+
* 叶子终点缺省 / rowsPath 数组终点,可激活/可下钻判定矩阵归模型)+ `{{}}` 拆装
|
|
19
23
|
* 纯函数 resourceTemplate + 弹层视口定位纯函数 popupPosition(resource-expression-
|
|
20
24
|
* single-ref 工单 05/06:资源内容字段的作者面 = 纯菜单点选,垂直翻转/钳制定位
|
|
21
25
|
* 两浮层与选择器菜单共用)。
|
|
@@ -39,14 +43,13 @@ export { measureCursorAnchor, type CompletionAnchor } from './completionAnchor';
|
|
|
39
43
|
export { expressionCompletionSource, expressionFieldContext, type ExpressionFieldContext, } from './expressionContext';
|
|
40
44
|
export { useExpressionCompletion, type ExpressionCompletionState } from './useExpressionCompletion';
|
|
41
45
|
export { expressionDiagnosticHint, useExpressionDiagnostics } from './useExpressionDiagnostics';
|
|
42
|
-
export {
|
|
43
|
-
export { rowsPathCompletionSource } from './rowsPathCompletionSource';
|
|
46
|
+
export { rowsPathPickerSource, rowsPathValueDrifts } from './rowsPathPickerSource';
|
|
44
47
|
export { attachResourceTemplate, stripResourceTemplate } from './resourceTemplate';
|
|
45
|
-
export { pathPickerEntries, type PathPickerEntry } from './pathPickerModel';
|
|
48
|
+
export { pathPickerEntries, type PathPickerEntry, type PathPickerMode } from './pathPickerModel';
|
|
46
49
|
export { placePopupInViewport, POPUP_GAP, POPUP_MARGIN, type PopupAnchorBox, type PopupViewportPosition, } from './popupPosition';
|
|
47
50
|
export { useHistory, type HistoryAvailability } from './useHistory';
|
|
48
51
|
export { useSelection } from './useSelection';
|
|
49
|
-
export { useDataSourceSchema } from './useDataSourceSchema';
|
|
52
|
+
export { DATA_SOURCE_GATE_HINT, useDataSourceSchema, useDataSourceSchemaRejection } from './useDataSourceSchema';
|
|
50
53
|
export { useShortcuts } from './useShortcuts';
|
|
51
54
|
export { useShortcutsHelp, type ShortcutsHelp } from './useShortcutsHelp';
|
|
52
55
|
export { useTransientFeedback, type TransientFeedback } from './useTransientFeedback';
|
|
@@ -1,11 +1,24 @@
|
|
|
1
1
|
import { CompletionItem, CompletionSource } from './completion';
|
|
2
|
-
/**
|
|
2
|
+
/** 选择器终点形态(rows-path-picker 工单 02):'resource' = 叶子终点(缺省),'rowsPath' = 数组终点 */
|
|
3
|
+
export type PathPickerMode = 'resource' | 'rowsPath';
|
|
4
|
+
/** 一条菜单条目:完整点路径 + 候选元信息 + 终点形态判定(两 mode 矩阵见模块头) */
|
|
3
5
|
export interface PathPickerEntry {
|
|
4
6
|
/** 提交/下钻的完整点路径(缺 path 的候选不构成条目——选择器的 v-model 面就是它) */
|
|
5
7
|
readonly path: string;
|
|
6
8
|
/** 候选元信息(segment/type/description/title,展示回落归组件) */
|
|
7
9
|
readonly item: CompletionItem;
|
|
10
|
+
/** 点选下钻进入下一层(resource = 探层非空;rowsPath = 对象中间站) */
|
|
8
11
|
readonly drillable: boolean;
|
|
12
|
+
/** 点选提交(resource = 叶子即 !drillable;rowsPath = 数组终点,D3 唯一可点终点) */
|
|
13
|
+
readonly activatable: boolean;
|
|
9
14
|
}
|
|
10
|
-
/** 取一层候选(kind
|
|
11
|
-
export declare function pathPickerEntries(source: CompletionSource, prefix: string): readonly PathPickerEntry[];
|
|
15
|
+
/** 取一层候选(kind 过滤后,mode 定可激活/可下钻判定矩阵);候选源 null 态(语法错/降级)= 空层 */
|
|
16
|
+
export declare function pathPickerEntries(source: CompletionSource, prefix: string, mode?: PathPickerMode): readonly PathPickerEntry[];
|
|
17
|
+
/** 菜单行面包屑分隔符(工单 06 展示词汇单点):前缀与现段名之间的连接符 */
|
|
18
|
+
export declare const PATH_PICKER_BREADCRUMB_SEPARATOR = "\u203A";
|
|
19
|
+
/**
|
|
20
|
+
* 菜单行面包屑前缀(工单 06):path 去尾段——下钻行在段名前弱化显示已积累
|
|
21
|
+
* 路径(点选途中完整落点随时可见),根层行(无父段)空串(组件不渲染前缀,
|
|
22
|
+
* 呈现维持纯段名不变)。纯派生 Node 可测,拆分呈现归组件模板。
|
|
23
|
+
*/
|
|
24
|
+
export declare function pathPickerParentPrefix(path: string): string;
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
*
|
|
8
8
|
* 实测缺陷(工单 06 背景,example 开发轨 2026-10-14):浮层恒锚光标下方无翻转
|
|
9
9
|
* 钳制,资源字段居面板底部——候选大半截出屏鼠标不可点。两控件(useExpression
|
|
10
|
-
* Completion / usePathCompletion
|
|
11
|
-
*
|
|
10
|
+
* Completion / 已退役的 usePathCompletion,rows-path-picker 工单 05)的私有
|
|
11
|
+
* clampToViewport 与本函数合并为单点,路径选择器菜单(工单 05)同函数消费。
|
|
12
12
|
*
|
|
13
13
|
* 高/宽度量不到(0——首帧未渲染/降级):按「放得下/原锚放」处理,不误翻转不
|
|
14
14
|
* 误收口(首开路径由调用方延一拍补量)。纯几何、零 DOM、Node 可测。
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ExpressionSchemaNode } from '@hankchen/canvas-editor';
|
|
2
|
+
import { CompletionSource } from './completion';
|
|
3
|
+
/** 「行数组」徽标展示文案(rowsPath 面的展示词汇单点):点选器组件徽标映射共用 */
|
|
4
|
+
export declare const ROWS_PATH_ARRAY_BADGE = "\u884C\u6570\u7EC4";
|
|
5
|
+
export declare function rowsPathPickerSource(startSchema: ExpressionSchemaNode | null): CompletionSource | null;
|
|
6
|
+
/**
|
|
7
|
+
* 已提交 rowsPath 的漂移判定(rows-path-picker 工单 03,spec D2):属性面板把
|
|
8
|
+
* 「schema 变更后已选路径枚举不出」呈现为回显标红(菜单照常可开可重选),判定
|
|
9
|
+
* 收口此纯函数(Node 可测)。语义按 spec 钉定面复用补全枚举器——
|
|
10
|
+
* `enumerateRowsPathCandidates === null`(途经漂移/数组内下钻/畸形)或终点非数组
|
|
11
|
+
* (标量/对象落点、空值、尾点残形——枚举候选里寻不到该路径的数组终点条目)。
|
|
12
|
+
* 作用于已提交值,无输入期概念;起点 null(未绑声明/判别降级)= 门态不判漂移
|
|
13
|
+
* (弱提示替代标红,D1)。
|
|
14
|
+
*/
|
|
15
|
+
export declare function rowsPathValueDrifts(startSchema: ExpressionSchemaNode | null, value: string): boolean;
|
|
@@ -1,3 +1,11 @@
|
|
|
1
1
|
import { ComputedRef } from 'vue';
|
|
2
|
-
import { EditorSession, ExpressionSchemaNode } from '@hankchen/canvas-editor';
|
|
2
|
+
import { DataSourceSchemaRejection, EditorSession, ExpressionSchemaNode } from '@hankchen/canvas-editor';
|
|
3
|
+
/**
|
|
4
|
+
* 数据源声明门提示(rows-path-picker 工单 04,spec D1):未绑 schema 时建表面
|
|
5
|
+
* 菜单项的置灰悬停文案——面板「+」菜单模板表项与右键「转为模板表」项两处门态
|
|
6
|
+
* 共用的展示词汇单点(「行数组」徽标同门先例,文案不进数据契约)。
|
|
7
|
+
*/
|
|
8
|
+
export declare const DATA_SOURCE_GATE_HINT = "\u5148\u7ED1\u5B9A\u6570\u636E\u6E90";
|
|
3
9
|
export declare function useDataSourceSchema(editor: EditorSession): ComputedRef<ExpressionSchemaNode | null>;
|
|
10
|
+
/** 声明拒绝详情桥(声明被拒呈现面,2b):null = 未注入/已编译/已清除 */
|
|
11
|
+
export declare function useDataSourceSchemaRejection(editor: EditorSession): ComputedRef<DataSourceSchemaRejection | null>;
|
|
@@ -2,6 +2,17 @@ import { ComputedRef, MaybeRefOrGetter, Ref } from 'vue';
|
|
|
2
2
|
import { ExpressionFragmentDiagnostic } from '@hankchen/canvas-editor';
|
|
3
3
|
/** 诊断汇总文案:多处取首条 kind 带计数;无诊断返回空串 */
|
|
4
4
|
export declare function expressionDiagnosticHint(diagnostics: readonly ExpressionFragmentDiagnostic[]): string;
|
|
5
|
+
/**
|
|
6
|
+
* 资源字段绑定门引导(resource-expression-single-ref 呈现面):资源字段表达式态
|
|
7
|
+
* 未注入数据源声明 → 选择器无菜单(引用以声明为门)——弱提示行说明缺席原因。
|
|
8
|
+
*/
|
|
9
|
+
export declare const RESOURCE_BINDING_HINT = "\u7ED1\u5B9A\u6570\u636E\u6E90\u540E\u53EF\u9009\u62E9\u5B57\u6BB5";
|
|
10
|
+
/**
|
|
11
|
+
* 资源单值门的提示文案(ADR 0020 呈现面):门是内容引用约束,不是语法错——
|
|
12
|
+
* 不走「表达式语法错误」框架,按修复通道在场与否给动作指引(菜单点选是资源面
|
|
13
|
+
* 唯一写入口);违例 kind(拼接/函数/字面残留)只进诊断面,呈现统一按通道分流。
|
|
14
|
+
*/
|
|
15
|
+
export declare function resourceDiagnosticHint(hasSource: boolean): string;
|
|
5
16
|
export declare function useExpressionDiagnostics(options: {
|
|
6
17
|
/** 宿主输入元素(textarea/input),模板 ref 传入 */
|
|
7
18
|
target: Ref<HTMLTextAreaElement | HTMLInputElement | null>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as e, f as t, g as n, h as r, l as i, m as a, n as o, p as s, s as c, t as l, u } from "./useTransientFeedback-BN_O7V2w.js";
|
|
2
2
|
import { t as d } from "./useShortcutsHelp-CsyarO2P.js";
|
|
3
3
|
import { Fragment as f, Teleport as p, computed as m, createBlock as h, createCommentVNode as g, createElementBlock as _, createElementVNode as v, defineComponent as y, onBeforeUnmount as b, onScopeDispose as x, openBlock as S, renderList as C, shallowRef as w, toDisplayString as T, unref as E, watch as D, withModifiers as O } from "vue";
|
|
4
4
|
//#region src/shared/HelpDialog.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -11,18 +11,18 @@ var k = {
|
|
|
11
11
|
}, A = { class: "cn-help__header" }, j = { class: "cn-help__body" }, M = ["data-help-group"], N = { class: "cn-help__section-title" }, P = { class: "cn-help__list" }, F = { class: "cn-help__label" }, I = { class: "cn-help__keys" }, L = {
|
|
12
12
|
class: "cn-help__section",
|
|
13
13
|
"data-help-interactions": ""
|
|
14
|
-
}, R = { class: "cn-help__list" }, z = { class: "cn-help__label" }, B = { class: "cn-help__keys" }, V = /*#__PURE__*/
|
|
14
|
+
}, R = { class: "cn-help__list" }, z = { class: "cn-help__label" }, B = { class: "cn-help__keys" }, V = /*#__PURE__*/ s(/* @__PURE__ */ y({
|
|
15
15
|
__name: "HelpDialog",
|
|
16
16
|
props: {
|
|
17
|
-
bindings: { default: () =>
|
|
17
|
+
bindings: { default: () => r },
|
|
18
18
|
platform: {}
|
|
19
19
|
},
|
|
20
|
-
setup(
|
|
21
|
-
let
|
|
20
|
+
setup(n) {
|
|
21
|
+
let r = n, { open: a, close: o } = d(), s = m(() => r.platform ?? u()), c = m(() => i.map((t) => ({
|
|
22
22
|
group: t,
|
|
23
23
|
label: e[t],
|
|
24
|
-
bindings:
|
|
25
|
-
})).filter((e) => e.bindings.length > 0)),
|
|
24
|
+
bindings: r.bindings.filter((e) => e.group === t)
|
|
25
|
+
})).filter((e) => e.bindings.length > 0)), l = [
|
|
26
26
|
{
|
|
27
27
|
gesture: "Ctrl/⌘ + 滚轮",
|
|
28
28
|
text: "缩放画布(以指针为中心,5%–800%)"
|
|
@@ -53,22 +53,22 @@ var k = {
|
|
|
53
53
|
}
|
|
54
54
|
];
|
|
55
55
|
function y(e) {
|
|
56
|
-
e.key === "Escape" &&
|
|
56
|
+
e.key === "Escape" && o();
|
|
57
57
|
}
|
|
58
|
-
return D(
|
|
58
|
+
return D(a, (e) => {
|
|
59
59
|
e ? window.addEventListener("keydown", y) : window.removeEventListener("keydown", y);
|
|
60
|
-
}), b(() => window.removeEventListener("keydown", y)), (e,
|
|
60
|
+
}), b(() => window.removeEventListener("keydown", y)), (e, n) => (S(), h(p, { to: "body" }, [E(a) ? (S(), _("div", {
|
|
61
61
|
key: 0,
|
|
62
62
|
class: "cn-help",
|
|
63
63
|
"data-help-overlay": "",
|
|
64
|
-
onPointerdown:
|
|
65
|
-
}, [v("div", k, [v("header", A, [
|
|
64
|
+
onPointerdown: n[1] ||= O((...e) => E(o) && E(o)(...e), ["self"])
|
|
65
|
+
}, [v("div", k, [v("header", A, [n[2] ||= v("h2", { class: "cn-help__title" }, "快捷键", -1), v("button", {
|
|
66
66
|
type: "button",
|
|
67
67
|
class: "cn-help__close",
|
|
68
68
|
"data-help-close": "",
|
|
69
69
|
"aria-label": "关闭快捷键帮助",
|
|
70
|
-
onClick:
|
|
71
|
-
}, " ✕ ")]), v("div", j, [(S(!0), _(f, null, C(
|
|
70
|
+
onClick: n[0] ||= (...e) => E(o) && E(o)(...e)
|
|
71
|
+
}, " ✕ ")]), v("div", j, [(S(!0), _(f, null, C(c.value, (e) => (S(), _("section", {
|
|
72
72
|
key: e.group,
|
|
73
73
|
class: "cn-help__section",
|
|
74
74
|
"data-help-group": e.group
|
|
@@ -76,7 +76,7 @@ var k = {
|
|
|
76
76
|
key: `${e.action}:${e.combo.key}`,
|
|
77
77
|
class: "cn-help__row",
|
|
78
78
|
"data-help-shortcut": ""
|
|
79
|
-
}, [v("span", F, T(e.label), 1), v("kbd", I, T(E(
|
|
79
|
+
}, [v("span", F, T(e.label), 1), v("kbd", I, T(E(t)(e.combo, s.value)), 1)]))), 128))])], 8, M))), 128)), v("section", L, [n[3] ||= v("h3", { class: "cn-help__section-title" }, "内置交互", -1), v("ul", R, [(S(), _(f, null, C(l, (e) => v("li", {
|
|
80
80
|
key: e.gesture,
|
|
81
81
|
class: "cn-help__row",
|
|
82
82
|
"data-help-interaction": ""
|
|
@@ -96,10 +96,10 @@ function H(e) {
|
|
|
96
96
|
}
|
|
97
97
|
//#endregion
|
|
98
98
|
//#region src/shared/useShortcuts.ts
|
|
99
|
-
var U = new Set(Object.keys(
|
|
99
|
+
var U = new Set(Object.keys(a));
|
|
100
100
|
function W(e) {
|
|
101
|
-
let t = d(),
|
|
102
|
-
let
|
|
101
|
+
let t = d(), r = l(), i = (i) => {
|
|
102
|
+
let a = n({
|
|
103
103
|
key: i.key,
|
|
104
104
|
mod: i.ctrlKey || i.metaKey,
|
|
105
105
|
shift: i.shiftKey,
|
|
@@ -107,14 +107,14 @@ function W(e) {
|
|
|
107
107
|
code: i.code,
|
|
108
108
|
composing: i.isComposing || i.keyCode === 229,
|
|
109
109
|
editing: e.store.ui.editing !== null,
|
|
110
|
-
editableTarget:
|
|
110
|
+
editableTarget: o(i.target)
|
|
111
111
|
});
|
|
112
|
-
if (
|
|
113
|
-
if (i.preventDefault(),
|
|
112
|
+
if (a !== null) {
|
|
113
|
+
if (i.preventDefault(), a === "helpShortcuts") {
|
|
114
114
|
t.toggle();
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
117
|
-
e.executeShortcut(
|
|
117
|
+
e.executeShortcut(a), U.has(a) && r.show(c);
|
|
118
118
|
}
|
|
119
119
|
};
|
|
120
120
|
window.addEventListener("keydown", i), x(() => window.removeEventListener("keydown", i), !0);
|
package/dist/shared.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { a as e,
|
|
2
|
-
import {
|
|
3
|
-
import { a as
|
|
4
|
-
import { i as x,
|
|
5
|
-
import { n as
|
|
6
|
-
import { n as
|
|
7
|
-
import {
|
|
8
|
-
import { t as
|
|
9
|
-
|
|
10
|
-
export { c as ARM_LAYER_CREATE_HINT, k as DropdownMenu, r as ExpressionCompletionPopup, C as ExpressionPathPicker, v as FONT_PICKER_KEY, P as HelpDialog, o as POPUP_GAP, n as POPUP_MARGIN, a as PanelIcon, e as applyCompletion, w as attachResourceTemplate, u as detectShortcutPlatform, p as expressionCompletionSource, f as expressionDiagnosticHint, h as expressionFieldContext, m as injectFontPicker, l as isEditableEventTarget, t as measureCursorAnchor, x as pathPickerEntries, i as placePopupInViewport, T as rowsPathCompletionSource, g as selectionFieldMergeKey, s as shortcutActionLabel, S as stripResourceTemplate, b as uploadFileFromDom, j as useDataSourceSchema, A as useDropdownMenu, y as useExpressionCompletion, _ as useExpressionDiagnostics, N as useHistory, E as usePathCompletion, D as useSelection, F as useShortcuts, M as useShortcutsHelp, d as useTransientFeedback, O as useViewport };
|
|
1
|
+
import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "./ExpressionPathPicker-DchGsK70.js";
|
|
2
|
+
import { n as c, t as l } from "./resourceTemplate-D-DKEo7Z.js";
|
|
3
|
+
import { a as u, d, i as f, n as p, o as m, s as h, t as g, u as _ } from "./useTransientFeedback-BN_O7V2w.js";
|
|
4
|
+
import { c as v, d as y, f as b, i as x, l as S, m as C, n as w, o as T, p as E, r as D, t as O, u as k } from "./uploadFile-mXJVPEzm.js";
|
|
5
|
+
import { n as A, t as j } from "./useViewport-D9Ipevzs.js";
|
|
6
|
+
import { n as M, t as N } from "./DropdownMenu-CeUNKMDQ.js";
|
|
7
|
+
import { t as P } from "./useShortcutsHelp-CsyarO2P.js";
|
|
8
|
+
import { n as F, r as I, t as L } from "./shared-CRDKDSpa.js";
|
|
9
|
+
export { h as ARM_LAYER_CREATE_HINT, f as DATA_SOURCE_GATE_HINT, N as DropdownMenu, C as ExpressionCompletionPopup, s as ExpressionPathPicker, D as FONT_PICKER_KEY, I as HelpDialog, r as POPUP_GAP, a as POPUP_MARGIN, t as PanelIcon, y as applyCompletion, l as attachResourceTemplate, _ as detectShortcutPlatform, b as expressionCompletionSource, T as expressionDiagnosticHint, E as expressionFieldContext, x as injectFontPicker, p as isEditableEventTarget, k as measureCursorAnchor, e as pathPickerEntries, n as placePopupInViewport, i as rowsPathPickerSource, o as rowsPathValueDrifts, w as selectionFieldMergeKey, d as shortcutActionLabel, c as stripResourceTemplate, O as uploadFileFromDom, u as useDataSourceSchema, m as useDataSourceSchemaRejection, M as useDropdownMenu, S as useExpressionCompletion, v as useExpressionDiagnostics, F as useHistory, A as useSelection, L as useShortcuts, P as useShortcutsHelp, g as useTransientFeedback, j as useViewport };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { a as e } from "./layerPath-uy2ywyld.js";
|
|
2
|
-
import {
|
|
3
|
-
import { n as
|
|
4
|
-
import {
|
|
5
|
-
import { t as
|
|
6
|
-
import { Fragment as
|
|
2
|
+
import { a as t, d as n, o as r, p as i, t as a, u as o } from "./useTransientFeedback-BN_O7V2w.js";
|
|
3
|
+
import { n as s, t as c } from "./useViewport-D9Ipevzs.js";
|
|
4
|
+
import { t as l } from "./DropdownMenu-CeUNKMDQ.js";
|
|
5
|
+
import { t as u } from "./useShortcutsHelp-CsyarO2P.js";
|
|
6
|
+
import { Fragment as d, computed as f, createCommentVNode as p, createElementBlock as m, createElementVNode as h, createVNode as g, defineComponent as _, onScopeDispose as v, openBlock as y, shallowRef as b, toDisplayString as x, unref as S, withCtx as C } from "vue";
|
|
7
7
|
//#region src/status-bar/layerPathLabel.ts
|
|
8
|
-
function
|
|
8
|
+
function w(e) {
|
|
9
9
|
let t = `图层 ${String(e[1])}`;
|
|
10
10
|
for (let n = 2; n < e.length; n += 1) {
|
|
11
11
|
let r = e[n];
|
|
@@ -19,7 +19,7 @@ function C(e) {
|
|
|
19
19
|
}
|
|
20
20
|
//#endregion
|
|
21
21
|
//#region src/status-bar/layerGeometryLabel.ts
|
|
22
|
-
var
|
|
22
|
+
var T = {
|
|
23
23
|
"top-left": "左上",
|
|
24
24
|
top: "中上",
|
|
25
25
|
"top-right": "右上",
|
|
@@ -30,49 +30,49 @@ var w = {
|
|
|
30
30
|
bottom: "中下",
|
|
31
31
|
"bottom-right": "右下"
|
|
32
32
|
};
|
|
33
|
-
function
|
|
34
|
-
return `x=${Math.round(e.x)} y=${Math.round(e.y)} · ${Math.round(t.width)}×${Math.round(t.height)} · ${
|
|
33
|
+
function E(e, t) {
|
|
34
|
+
return `x=${Math.round(e.x)} y=${Math.round(e.y)} · ${Math.round(t.width)}×${Math.round(t.height)} · ${T[e.anchor]}锚`;
|
|
35
35
|
}
|
|
36
36
|
//#endregion
|
|
37
37
|
//#region src/status-bar/useDoc.ts
|
|
38
|
-
function
|
|
39
|
-
let t =
|
|
38
|
+
function D(e) {
|
|
39
|
+
let t = b(e.store.doc), n = e.subscribe((n) => {
|
|
40
40
|
n.scope === "doc" && (t.value = e.store.doc);
|
|
41
41
|
});
|
|
42
|
-
return
|
|
42
|
+
return v(n, !0), f(() => t.value);
|
|
43
43
|
}
|
|
44
44
|
//#endregion
|
|
45
45
|
//#region src/status-bar/StatusBar.vue?vue&type=script&setup=true&lang.ts
|
|
46
|
-
var
|
|
46
|
+
var O = {
|
|
47
47
|
class: "cn-statusbar",
|
|
48
48
|
role: "status",
|
|
49
49
|
"aria-label": "编辑器状态栏"
|
|
50
|
-
},
|
|
50
|
+
}, k = [
|
|
51
51
|
"aria-expanded",
|
|
52
52
|
"onClick",
|
|
53
53
|
"onKeydown"
|
|
54
|
-
],
|
|
54
|
+
], A = {
|
|
55
55
|
class: "cn-statusbar__segment",
|
|
56
56
|
"data-selection": ""
|
|
57
|
-
},
|
|
57
|
+
}, j = {
|
|
58
58
|
class: "cn-statusbar__segment cn-statusbar__segment--pending",
|
|
59
59
|
"data-pending": ""
|
|
60
|
-
},
|
|
60
|
+
}, M = {
|
|
61
61
|
class: "cn-statusbar__segment",
|
|
62
62
|
"data-geometry": ""
|
|
63
|
-
},
|
|
63
|
+
}, N = {
|
|
64
64
|
class: "cn-statusbar__segment",
|
|
65
65
|
"data-resource": ""
|
|
66
|
-
},
|
|
66
|
+
}, P = {
|
|
67
67
|
class: "cn-statusbar__segment",
|
|
68
68
|
"data-save": ""
|
|
69
|
-
},
|
|
69
|
+
}, F = {
|
|
70
70
|
class: "cn-statusbar__segment",
|
|
71
71
|
"data-schema": ""
|
|
72
|
-
},
|
|
72
|
+
}, I = {
|
|
73
73
|
class: "cn-statusbar__segment",
|
|
74
74
|
"data-feedback": ""
|
|
75
|
-
},
|
|
75
|
+
}, L = /*#__PURE__*/ i(/* @__PURE__ */ _({
|
|
76
76
|
__name: "StatusBar",
|
|
77
77
|
props: {
|
|
78
78
|
editor: {},
|
|
@@ -82,58 +82,60 @@ var D = {
|
|
|
82
82
|
feedback: { default: "" }
|
|
83
83
|
},
|
|
84
84
|
setup(i) {
|
|
85
|
-
let
|
|
86
|
-
let e =
|
|
87
|
-
return e === null ? "未选中图层" :
|
|
88
|
-
}),
|
|
89
|
-
let t =
|
|
85
|
+
let _ = i, v = c(_.editor), b = s(_.editor), T = D(_.editor), L = t(_.editor), R = r(_.editor), z = f(() => Math.round(v.value.zoom * 100)), B = f(() => {
|
|
86
|
+
let e = b.value;
|
|
87
|
+
return e === null ? "未选中图层" : w(e);
|
|
88
|
+
}), V = f(() => {
|
|
89
|
+
let t = b.value, n = T.value;
|
|
90
90
|
if (t === null || n === null) return null;
|
|
91
|
-
let r = e(n, t), i =
|
|
92
|
-
return !r || !i ? null :
|
|
93
|
-
}),
|
|
94
|
-
let e =
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
91
|
+
let r = e(n, t), i = _.editor.layerBoxAt(t);
|
|
92
|
+
return !r || !i ? null : E(r.position, i);
|
|
93
|
+
}), H = f(() => {
|
|
94
|
+
let e = L.value;
|
|
95
|
+
if (e !== null) return `schema 已注入顶层 ${e.properties?.size ?? 0} 键`;
|
|
96
|
+
let t = R.value;
|
|
97
|
+
return t === null ? "schema 未注入" : `schema 声明被拒:${t.detail}`;
|
|
98
|
+
}), { toggle: U } = u(), W = `快捷键帮助(${n("helpShortcuts", o())})`, G = a(), K = f(() => _.feedback === "" ? G.message.value : _.feedback);
|
|
99
|
+
function q(e) {
|
|
100
|
+
let { width: t, height: n } = _.editor.getSurfaceSize();
|
|
101
|
+
_.editor.zoomAt(t / 2, n / 2, v.value.zoom * e);
|
|
100
102
|
}
|
|
101
|
-
let
|
|
103
|
+
let J = f(() => [
|
|
102
104
|
{
|
|
103
105
|
label: "100%",
|
|
104
106
|
dataAttrs: { "data-zoom-100": "" },
|
|
105
|
-
run: () =>
|
|
107
|
+
run: () => _.editor.resetZoom()
|
|
106
108
|
},
|
|
107
109
|
{
|
|
108
110
|
label: "适应画布",
|
|
109
111
|
dataAttrs: { "data-zoom-fit": "" },
|
|
110
|
-
run: () =>
|
|
112
|
+
run: () => _.editor.fitToSurface()
|
|
111
113
|
},
|
|
112
114
|
{
|
|
113
115
|
label: "适应选区",
|
|
114
116
|
dataAttrs: { "data-zoom-fit-selection": "" },
|
|
115
|
-
run: () =>
|
|
117
|
+
run: () => _.editor.fitToSelection()
|
|
116
118
|
},
|
|
117
119
|
{
|
|
118
120
|
label: "放大",
|
|
119
121
|
title: "放大(以视口中心为锚)",
|
|
120
122
|
dataAttrs: { "data-zoom-in": "" },
|
|
121
|
-
run: () =>
|
|
123
|
+
run: () => q(1.25)
|
|
122
124
|
},
|
|
123
125
|
{
|
|
124
126
|
label: "缩小",
|
|
125
127
|
title: "缩小(以视口中心为锚)",
|
|
126
128
|
dataAttrs: { "data-zoom-out": "" },
|
|
127
|
-
run: () =>
|
|
129
|
+
run: () => q(1 / 1.25)
|
|
128
130
|
}
|
|
129
131
|
]);
|
|
130
|
-
return (e, t) => (
|
|
131
|
-
|
|
132
|
+
return (e, t) => (y(), m("footer", O, [
|
|
133
|
+
g(l, {
|
|
132
134
|
label: "缩放",
|
|
133
135
|
direction: "up",
|
|
134
|
-
items:
|
|
136
|
+
items: J.value
|
|
135
137
|
}, {
|
|
136
|
-
trigger:
|
|
138
|
+
trigger: C(({ open: e, toggle: t, triggerRef: n, onKeydown: r }) => [h("button", {
|
|
137
139
|
ref: n,
|
|
138
140
|
type: "button",
|
|
139
141
|
class: "cn-statusbar__segment cn-statusbar__zoom-trigger",
|
|
@@ -143,53 +145,53 @@ var D = {
|
|
|
143
145
|
title: "缩放",
|
|
144
146
|
onClick: t,
|
|
145
147
|
onKeydown: r
|
|
146
|
-
},
|
|
148
|
+
}, x(z.value) + "% ", 41, k)]),
|
|
147
149
|
_: 1
|
|
148
150
|
}, 8, ["items"]),
|
|
149
|
-
t[6] ||=
|
|
151
|
+
t[6] ||= h("span", {
|
|
150
152
|
class: "cn-statusbar__divider",
|
|
151
153
|
"aria-hidden": "true"
|
|
152
154
|
}, null, -1),
|
|
153
|
-
|
|
154
|
-
|
|
155
|
+
h("span", A, x(B.value), 1),
|
|
156
|
+
_.pendingCount > 0 ? (y(), m(d, { key: 0 }, [t[1] ||= h("span", {
|
|
155
157
|
class: "cn-statusbar__divider",
|
|
156
158
|
"aria-hidden": "true"
|
|
157
|
-
}, null, -1),
|
|
158
|
-
|
|
159
|
+
}, null, -1), h("span", j, " 物化中 " + x(_.pendingCount), 1)], 64)) : p("", !0),
|
|
160
|
+
V.value === null ? p("", !0) : (y(), m(d, { key: 1 }, [t[2] ||= h("span", {
|
|
159
161
|
class: "cn-statusbar__divider",
|
|
160
162
|
"aria-hidden": "true"
|
|
161
|
-
}, null, -1),
|
|
162
|
-
|
|
163
|
+
}, null, -1), h("span", M, x(V.value), 1)], 64)),
|
|
164
|
+
_.resourceNote === "" ? p("", !0) : (y(), m(d, { key: 2 }, [t[3] ||= h("span", {
|
|
163
165
|
class: "cn-statusbar__divider",
|
|
164
166
|
"aria-hidden": "true"
|
|
165
|
-
}, null, -1),
|
|
166
|
-
|
|
167
|
+
}, null, -1), h("span", N, x(_.resourceNote), 1)], 64)),
|
|
168
|
+
_.saveState === void 0 ? p("", !0) : (y(), m(d, { key: 3 }, [t[4] ||= h("span", {
|
|
167
169
|
class: "cn-statusbar__divider",
|
|
168
170
|
"aria-hidden": "true"
|
|
169
|
-
}, null, -1),
|
|
170
|
-
t[7] ||=
|
|
171
|
+
}, null, -1), h("span", P, x(_.saveState === "dirty" ? "● 未保存" : "○ 已保存"), 1)], 64)),
|
|
172
|
+
t[7] ||= h("span", {
|
|
171
173
|
class: "cn-statusbar__divider",
|
|
172
174
|
"aria-hidden": "true"
|
|
173
175
|
}, null, -1),
|
|
174
|
-
|
|
175
|
-
|
|
176
|
+
h("span", F, x(H.value), 1),
|
|
177
|
+
K.value === "" ? p("", !0) : (y(), m(d, { key: 4 }, [t[5] ||= h("span", {
|
|
176
178
|
class: "cn-statusbar__divider",
|
|
177
179
|
"aria-hidden": "true"
|
|
178
|
-
}, null, -1),
|
|
179
|
-
t[8] ||=
|
|
180
|
+
}, null, -1), h("span", I, x(K.value), 1)], 64)),
|
|
181
|
+
t[8] ||= h("span", {
|
|
180
182
|
class: "cn-statusbar__divider",
|
|
181
183
|
"aria-hidden": "true"
|
|
182
184
|
}, null, -1),
|
|
183
|
-
|
|
185
|
+
h("button", {
|
|
184
186
|
type: "button",
|
|
185
187
|
class: "cn-statusbar__segment cn-statusbar__help",
|
|
186
188
|
"data-help": "",
|
|
187
189
|
"aria-haspopup": "dialog",
|
|
188
|
-
title:
|
|
189
|
-
onClick: t[0] ||= (...e) =>
|
|
190
|
+
title: W,
|
|
191
|
+
onClick: t[0] ||= (...e) => S(U) && S(U)(...e)
|
|
190
192
|
}, " 快捷键 ")
|
|
191
193
|
]));
|
|
192
194
|
}
|
|
193
|
-
}), [["__scopeId", "data-v-
|
|
195
|
+
}), [["__scopeId", "data-v-ea2a5856"]]);
|
|
194
196
|
//#endregion
|
|
195
|
-
export {
|
|
197
|
+
export { E as n, w as r, L as t };
|
package/dist/status-bar.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, r as t, t as n } from "./status-bar-
|
|
1
|
+
import { n as e, r as t, t as n } from "./status-bar-DBf5kIXY.js";
|
|
2
2
|
export { n as StatusBar, e as formatLayerGeometry, t as formatLayerPath };
|