@agilehub/agile-editor 1.7.0 → 1.8.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.
Files changed (42) hide show
  1. package/README.md +1 -0
  2. package/dist/agile-editor.css +1 -1
  3. package/dist/agile-editor.js +18075 -18079
  4. package/dist/i18n-DkkDy5cy.js +2813 -0
  5. package/dist/types/components/editor/courseware-dialog.vue.d.ts +3 -0
  6. package/dist/types/components/editor/smart-sheet-dialog.vue.d.ts +3 -0
  7. package/dist/types/components/editor/thousands-separator-dialog.vue.d.ts +3 -0
  8. package/dist/types/components/index.d.ts +2 -1
  9. package/dist/types/components/index.vue.d.ts +397 -19
  10. package/dist/types/components/menus/button.vue.d.ts +1 -1
  11. package/dist/types/components/menus/toolbar/insert/courseware.vue.d.ts +3 -0
  12. package/dist/types/components/menus/toolbar/insert/smart-sheet.vue.d.ts +3 -0
  13. package/dist/types/components/menus/toolbar/tools/thousands-separator.vue.d.ts +3 -0
  14. package/dist/types/components/preview-toolbar/index.vue.d.ts +2 -2
  15. package/dist/types/components/toolbar/classic.vue.d.ts +14 -14
  16. package/dist/types/components/toolbar/ribbon.vue.d.ts +14 -14
  17. package/dist/types/composables/i18n.d.ts +393 -15
  18. package/dist/types/extensions/bookmark-transaction.d.ts +6 -0
  19. package/dist/types/extensions/bubble-note.d.ts +1 -0
  20. package/dist/types/extensions/courseware/annotation-session.d.ts +4 -0
  21. package/dist/types/extensions/courseware/index.d.ts +49 -0
  22. package/dist/types/extensions/courseware/model.d.ts +20 -0
  23. package/dist/types/extensions/courseware/node-view.vue.d.ts +93 -0
  24. package/dist/types/extensions/courseware/reader.vue.d.ts +22 -0
  25. package/dist/types/extensions/smart-sheet/index.d.ts +47 -0
  26. package/dist/types/extensions/smart-sheet/model.d.ts +18 -0
  27. package/dist/types/extensions/smart-sheet/node-view.vue.d.ts +93 -0
  28. package/dist/types/extensions/smart-sheet/viewer.vue.d.ts +36 -0
  29. package/dist/types/extensions/thousands-separator.d.ts +60 -0
  30. package/dist/types/i18n.d.ts +393 -15
  31. package/dist/types/utils/bubble-note-icon.d.ts +1 -0
  32. package/dist/types/utils/document-formatting.d.ts +41 -37
  33. package/dist/types/utils/document-import.d.ts +2 -0
  34. package/dist/types/utils/html-element-id.d.ts +9 -2
  35. package/dist/types/utils/md5.d.ts +2 -0
  36. package/dist/types/utils/thousands-separator.d.ts +15 -0
  37. package/dist/viewer-BLXXdsVI.js +97 -0
  38. package/docs/FORMATTING_TEMPLATES.md +253 -250
  39. package/docs/FORMATTING_TEMPLATE_BUSINESS_GUIDE.md +536 -0
  40. package/docs/README.md +1 -0
  41. package/docs/configuration.md +25 -0
  42. package/package.json +165 -162
@@ -1,9 +1,16 @@
1
1
  import type { EditorState } from '@tiptap/pm/state';
2
+ import { Slice } from '@tiptap/pm/model';
2
3
  export declare const nodeTypesWithOwnId: Set<string>;
3
4
  export declare const nodeTypesWithoutHtmlId: Set<string>;
5
+ /** HTML 标签与菜单节点的并集,Set 保证重复定义的节点只生成一次 ID。 */
4
6
  export declare const htmlIdNodeTypes: string[];
7
+ export declare const globalHtmlIdNodeTypes: string[];
5
8
  export declare const htmlIdMarkTypes: string[];
6
- export declare const ensureHtmlElementIds: (state: EditorState, range?: {
9
+ export declare const globalHtmlIdMarkTypes: string[];
10
+ export declare const stripPastedHtmlElementIds: (slice: Slice) => Slice;
11
+ type HtmlIdRange = {
7
12
  from: number;
8
13
  to: number;
9
- }) => import("@tiptap/pm/state").Transaction;
14
+ };
15
+ export declare const ensureHtmlElementIds: (state: EditorState, ranges?: HtmlIdRange | HtmlIdRange[]) => import("@tiptap/pm/state").Transaction;
16
+ export {};
@@ -0,0 +1,2 @@
1
+ /** Computes a stable lowercase MD5 digest for non-security identifiers. */
2
+ export declare const md5: (value: string) => string;
@@ -0,0 +1,15 @@
1
+ export type ThousandsSeparator = 'space' | 'comma';
2
+ export interface ThousandsFormatOptions {
3
+ separator?: ThousandsSeparator;
4
+ groupSize?: number;
5
+ }
6
+ export declare const DEFAULT_THOUSANDS_SEPARATOR: ThousandsSeparator;
7
+ export declare const DEFAULT_THOUSANDS_GROUP_SIZE = 3;
8
+ export declare const MIN_THOUSANDS_GROUP_SIZE = 1;
9
+ export declare const MAX_THOUSANDS_GROUP_SIZE = 6;
10
+ export declare const normalizeThousandsSeparator: (value: unknown) => ThousandsSeparator;
11
+ export declare const normalizeThousandsGroupSize: (value: unknown) => number;
12
+ /** 去除已有千分位分隔符,并校验为单个整数或小数。 */
13
+ export declare const normalizeThousandsNumber: (value: unknown) => string;
14
+ /** 按指定分隔符和分组位数格式化数字。 */
15
+ export declare const formatThousandsNumber: (value: unknown, options?: ThousandsFormatOptions) => string;
@@ -0,0 +1,97 @@
1
+ /**
2
+ * @agilehub/agile-editor 1.8.1
3
+ * @license Apache-2.0
4
+ * @author undefined undefined
5
+ * @see undefined
6
+ **/
7
+ import "./agile-editor.css";
8
+ import { a as e, n as t } from "./i18n-DkkDy5cy.js";
9
+ import { createBlock as n, createElementBlock as r, createElementVNode as i, createVNode as a, defineComponent as o, guardReactiveProps as s, markRaw as c, normalizeProps as l, onMounted as u, openBlock as d, ref as f, renderSlot as p, resolveDynamicComponent as m, shallowRef as h, toDisplayString as g, unref as _, withCtx as v } from "vue";
10
+ //#region src/extensions/smart-sheet/viewer.vue?vue&type=script&setup=true&lang.ts
11
+ var y = { class: "agile-smart-sheet-viewer" }, b = {
12
+ key: 0,
13
+ class: "agile-smart-sheet-viewer-state"
14
+ }, x = {
15
+ key: 1,
16
+ class: "agile-smart-sheet-viewer-state is-error",
17
+ role: "alert"
18
+ }, S = {
19
+ key: 3,
20
+ class: "agile-smart-sheet-viewer-state is-error",
21
+ role: "alert"
22
+ }, C = /* @__PURE__ */ o({
23
+ __name: "viewer",
24
+ props: {
25
+ src: {},
26
+ fileName: { default: "" },
27
+ editable: {
28
+ type: Boolean,
29
+ default: !0
30
+ },
31
+ recalc: {
32
+ type: Boolean,
33
+ default: !0
34
+ }
35
+ },
36
+ emits: [
37
+ "ready",
38
+ "error",
39
+ "cell-change",
40
+ "dirty-change"
41
+ ],
42
+ setup(o, { expose: C, emit: w }) {
43
+ let T = w, E = h(null), D = f(null), O = f(!0), k = f(""), A = async () => {
44
+ O.value = !0, k.value = "";
45
+ try {
46
+ let [e] = await Promise.all([import("ooxml-excel-editor"), Promise.resolve({ })]);
47
+ E.value = c(e.ExcelViewer);
48
+ } catch (e) {
49
+ k.value = e instanceof Error ? e.message : t("insert.smartSheet.loadFailed"), T("error", k.value);
50
+ } finally {
51
+ O.value = !1;
52
+ }
53
+ }, j = (e) => {
54
+ T("ready", e);
55
+ }, M = (e) => {
56
+ let n = e instanceof Error ? e.message : String(e || t("insert.smartSheet.loadFailed"));
57
+ T("error", n);
58
+ };
59
+ return u(A), C({
60
+ getViewer: () => D.value,
61
+ isDirty: () => {
62
+ var e, t;
63
+ return !!((e = D.value) != null && (t = e.isDirty) != null && t.call(e));
64
+ }
65
+ }), (c, u) => {
66
+ let f = e;
67
+ return d(), r("div", y, [_(O) ? (d(), r("div", b, [a(f, {
68
+ name: "loading",
69
+ class: "loading-icon"
70
+ }), i("span", null, g(_(t)("insert.smartSheet.loading")), 1)])) : _(k) ? (d(), r("div", x, [a(f, { name: "image-failed" }), i("span", null, g(_(k)), 1)])) : E.value ? (d(), n(m(E.value), {
71
+ key: 2,
72
+ ref_key: "viewerRef",
73
+ ref: D,
74
+ src: o.src,
75
+ "file-name": o.fileName,
76
+ editable: o.editable,
77
+ recalc: o.recalc,
78
+ "export-progress": !0,
79
+ style: { height: "100%" },
80
+ onRendered: j,
81
+ onError: M,
82
+ onCellChange: u[0] || (u[0] = (e) => T("cell-change", e)),
83
+ onDirtyChange: u[1] || (u[1] = (e) => T("dirty-change", !!(e != null && e.dirty)))
84
+ }, {
85
+ header: v((e) => [p(c.$slots, "header", l(s(e)))]),
86
+ _: 3
87
+ }, 40, [
88
+ "src",
89
+ "file-name",
90
+ "editable",
91
+ "recalc"
92
+ ])) : (d(), r("div", S, [a(f, { name: "image-failed" }), i("span", null, g(_(t)("insert.smartSheet.loadFailed")), 1)]))]);
93
+ };
94
+ }
95
+ });
96
+ //#endregion
97
+ export { C as default };