@web-ppt/edit-core 0.5.0-beta.1 → 0.5.0-beta.7
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/CHANGELOG.md +188 -0
- package/README.md +165 -22
- package/dist/alt-text.d.ts +5 -0
- package/dist/appearance/index.d.ts +12 -0
- package/dist/appearance/materialize.d.ts +4 -0
- package/dist/appearance/types.d.ts +26 -0
- package/dist/appearance/values.d.ts +9 -0
- package/dist/appearance.js +301 -0
- package/dist/cfb/index.d.ts +5 -0
- package/dist/cfb/read.d.ts +16 -0
- package/dist/cfb/write.d.ts +3 -0
- package/dist/cfb.js +208 -0
- package/dist/change-classification.d.ts +3 -3
- package/dist/chart/category-binding.d.ts +4 -0
- package/dist/chart/category-commands.d.ts +23 -0
- package/dist/chart/category-levels.d.ts +14 -0
- package/dist/chart/category-matrix.d.ts +2 -0
- package/dist/chart/category-value.d.ts +2 -0
- package/dist/chart/category-workbook.d.ts +13 -0
- package/dist/chart/commands.d.ts +28 -0
- package/dist/chart/context.d.ts +12 -0
- package/dist/chart/dataset-merge.d.ts +5 -0
- package/dist/chart/formula.d.ts +13 -0
- package/dist/chart/identity-frames.d.ts +4 -0
- package/dist/chart/identity-scopes.d.ts +6 -0
- package/dist/chart/identity.d.ts +24 -0
- package/dist/chart/index.d.ts +8 -0
- package/dist/chart/limits.d.ts +6 -0
- package/dist/chart/locator.d.ts +4 -0
- package/dist/chart/materialize.d.ts +7 -0
- package/dist/chart/ordering.d.ts +9 -0
- package/dist/chart/part-graph.d.ts +5 -0
- package/dist/chart/patch-validation.d.ts +3 -0
- package/dist/chart/plot-kinds.d.ts +2 -0
- package/dist/chart/projection.d.ts +8 -0
- package/dist/chart/save.d.ts +4 -0
- package/dist/chart/shared-added-plan.d.ts +19 -0
- package/dist/chart/shared-added-records.d.ts +8 -0
- package/dist/chart/shared-address.d.ts +5 -0
- package/dist/chart/shared-allocate.d.ts +7 -0
- package/dist/chart/shared-cache-codec.d.ts +5 -0
- package/dist/chart/shared-cache-identities.d.ts +3 -0
- package/dist/chart/shared-cache-migration.d.ts +7 -0
- package/dist/chart/shared-cache-save.d.ts +3 -0
- package/dist/chart/shared-cache-scopes.d.ts +13 -0
- package/dist/chart/shared-cache.d.ts +11 -0
- package/dist/chart/shared-category.d.ts +4 -0
- package/dist/chart/shared-cell.d.ts +9 -0
- package/dist/chart/shared-family.d.ts +26 -0
- package/dist/chart/shared-fields.d.ts +18 -0
- package/dist/chart/shared-graph.d.ts +19 -0
- package/dist/chart/shared-growth-space.d.ts +5 -0
- package/dist/chart/shared-inserted-cells.d.ts +14 -0
- package/dist/chart/shared-inserted-command.d.ts +7 -0
- package/dist/chart/shared-inserted-layout.d.ts +16 -0
- package/dist/chart/shared-inserted-project.d.ts +14 -0
- package/dist/chart/shared-inserted-records.d.ts +16 -0
- package/dist/chart/shared-inserted-save.d.ts +6 -0
- package/dist/chart/shared-joint-command.d.ts +9 -0
- package/dist/chart/shared-joint-records.d.ts +9 -0
- package/dist/chart/shared-record-axis.d.ts +25 -0
- package/dist/chart/shared-record-remove.d.ts +13 -0
- package/dist/chart/shared-record-stage.d.ts +2 -0
- package/dist/chart/shared-records.d.ts +2 -0
- package/dist/chart/shared-rows.d.ts +17 -0
- package/dist/chart/shared-runtime.d.ts +19 -0
- package/dist/chart/shared-save-plan.d.ts +4 -0
- package/dist/chart/shared-save.d.ts +3 -0
- package/dist/chart/shared-series.d.ts +6 -0
- package/dist/chart/shared-source-cache.d.ts +4 -0
- package/dist/chart/shared-topology.d.ts +9 -0
- package/dist/chart/shared-unresolved.d.ts +3 -0
- package/dist/chart/shared-validation.d.ts +6 -0
- package/dist/chart/shared-workbook-source.d.ts +6 -0
- package/dist/chart/shared-xy-command.d.ts +7 -0
- package/dist/chart/shared-xy-family.d.ts +16 -0
- package/dist/chart/shared-xy-project.d.ts +6 -0
- package/dist/chart/shared-xy-records.d.ts +23 -0
- package/dist/chart/shared-xy-save.d.ts +5 -0
- package/dist/chart/shared-xy-source.d.ts +39 -0
- package/dist/chart/shared.d.ts +13 -0
- package/dist/chart/source.d.ts +11 -0
- package/dist/chart/types.d.ts +86 -0
- package/dist/chart/validation.d.ts +24 -0
- package/dist/chart/workbook-range.d.ts +16 -0
- package/dist/chart/workbook-read.d.ts +7 -0
- package/dist/chart/workbook-write.d.ts +9 -0
- package/dist/chart/workbook.d.ts +25 -0
- package/dist/chart/xml-data.d.ts +14 -0
- package/dist/chart/xml-namespaces.d.ts +16 -0
- package/dist/chart-design/index.d.ts +10 -0
- package/dist/chart-design/types.d.ts +11 -0
- package/dist/chart-design/xml.d.ts +2 -0
- package/dist/chart-design.js +361 -0
- package/dist/chart-ex/index.d.ts +15 -0
- package/dist/chart-ex/workbook.d.ts +6 -0
- package/dist/chart-ex/xml.d.ts +14 -0
- package/dist/chart-ex.js +457 -0
- package/dist/chart-shared/index.d.ts +12 -0
- package/dist/chart-shared.js +1 -0
- package/dist/chart.js +1 -0
- package/dist/clipboard-links-GuPtqr1z.js +778 -0
- package/dist/clipboard-package.d.ts +4 -0
- package/dist/clipboard-source.d.ts +6 -2
- package/dist/clipboard-trees.d.ts +9 -0
- package/dist/collaboration-identity.d.ts +3 -0
- package/dist/commands/add-slide-identity.d.ts +4 -0
- package/dist/commands/bullet-image-resource.d.ts +11 -0
- package/dist/commands/clear-format.d.ts +4 -0
- package/dist/commands/common-object-slide-patch.d.ts +4 -0
- package/dist/commands/common-object-slide-types.d.ts +68 -0
- package/dist/commands/convert-to-custom-geometry.d.ts +4 -0
- package/dist/commands/direct-format-patches.d.ts +11 -5
- package/dist/commands/distribute-elements.d.ts +4 -0
- package/dist/commands/edit-table-grid.d.ts +10 -0
- package/dist/commands/element-alt-text.d.ts +8 -0
- package/dist/commands/element-arrangement.d.ts +17 -0
- package/dist/commands/element-effects.d.ts +1 -1
- package/dist/commands/element-fill.d.ts +1 -1
- package/dist/commands/element-geometry.d.ts +9 -0
- package/dist/commands/element-hierarchy.d.ts +6 -0
- package/dist/commands/element-image-content.d.ts +2 -2
- package/dist/commands/element-link.d.ts +1 -1
- package/dist/commands/element-name.d.ts +1 -1
- package/dist/commands/element-stroke.d.ts +1 -1
- package/dist/commands/element-table-style.d.ts +5 -0
- package/dist/commands/element-text.d.ts +1 -1
- package/dist/commands/element-transform.d.ts +2 -2
- package/dist/commands/frame-decomposition.d.ts +10 -0
- package/dist/commands/generated-creation-defaults.d.ts +4 -0
- package/dist/commands/geometry-types.d.ts +44 -0
- package/dist/commands/group-types.d.ts +24 -0
- package/dist/commands/group.d.ts +4 -0
- package/dist/commands/hierarchy-record.d.ts +5 -0
- package/dist/commands/image-resource.d.ts +8 -1
- package/dist/commands/insertion-host.d.ts +16 -0
- package/dist/commands/insertion-rect.d.ts +2 -0
- package/dist/commands/layout-property.d.ts +7 -0
- package/dist/commands/master-property.d.ts +5 -0
- package/dist/commands/master-text-style-types.d.ts +27 -0
- package/dist/commands/master-text-style.d.ts +7 -0
- package/dist/commands/paste-resources.d.ts +9 -5
- package/dist/commands/patch-apply.d.ts +3 -0
- package/dist/commands/patch-count.d.ts +1 -0
- package/dist/commands/patch-invalidation.d.ts +4 -0
- package/dist/commands/patch-stage.d.ts +4 -0
- package/dist/commands/patch.d.ts +4 -0
- package/dist/commands/record-clone.d.ts +3 -0
- package/dist/commands/record-override.d.ts +5 -0
- package/dist/commands/replace-image.d.ts +6 -1
- package/dist/commands/sections.d.ts +10 -0
- package/dist/commands/set-geometry.d.ts +4 -0
- package/dist/commands/set-preset.d.ts +5 -0
- package/dist/commands/set-table-style.d.ts +3 -0
- package/dist/commands/slide-property-types.d.ts +55 -5
- package/dist/commands/slide-size.d.ts +7 -0
- package/dist/commands/spid.d.ts +2 -1
- package/dist/commands/table-grid-patch.d.ts +12 -0
- package/dist/commands/table-style-types.d.ts +28 -0
- package/dist/commands/text-target.d.ts +3 -2
- package/dist/commands/theme-types.d.ts +47 -0
- package/dist/commands/theme.d.ts +9 -0
- package/dist/commands/types.d.ts +219 -17
- package/dist/commands/ungroup-source.d.ts +3 -0
- package/dist/commands/ungroup.d.ts +4 -0
- package/dist/comments/index.d.ts +35 -0
- package/dist/comments/save.d.ts +3 -0
- package/dist/comments/state.d.ts +10 -0
- package/dist/comments/xml.d.ts +12 -0
- package/dist/comments.js +782 -0
- package/dist/common-object-slide-types.d.ts +34 -0
- package/dist/custom-geometry-path.d.ts +3 -0
- package/dist/custom-geometry.d.ts +12 -0
- package/dist/data-validation.d.ts +1 -1
- package/dist/describe/budget.d.ts +3 -0
- package/dist/describe/index.d.ts +5 -0
- package/dist/describe/read.d.ts +4 -0
- package/dist/describe/types.d.ts +103 -0
- package/dist/describe.js +192 -0
- package/dist/design-dependencies.d.ts +8 -0
- package/dist/design-projection-package.d.ts +10 -0
- package/dist/design-target.d.ts +10 -0
- package/dist/design.d.ts +3 -0
- package/dist/document-extensions.d.ts +9 -0
- package/dist/document.d.ts +1 -1
- package/dist/dynamic-projection.d.ts +6 -0
- package/dist/edit-core.js +5680 -3413
- package/dist/editor.d.ts +19 -2
- package/dist/element-source.d.ts +11 -0
- package/dist/element-spids.d.ts +4 -0
- package/dist/extension-address-journal.d.ts +9 -0
- package/dist/extension-address-remap.d.ts +14 -0
- package/dist/extension-addresses.d.ts +20 -0
- package/dist/extension-copy-history.d.ts +7 -0
- package/dist/extension-copy.d.ts +16 -0
- package/dist/extension-migration-receipt.d.ts +34 -0
- package/dist/extension-recovery-context.d.ts +5 -0
- package/dist/extension-runtime.d.ts +64 -0
- package/dist/generate/comments.d.ts +3 -0
- package/dist/generate/compatibility-parts.d.ts +14 -0
- package/dist/generate/compatibility-references.d.ts +3 -0
- package/dist/generate/compatibility.d.ts +4 -0
- package/dist/generate/custom-geometry.d.ts +2 -0
- package/dist/generate/index.d.ts +13 -0
- package/dist/generate/links.d.ts +3 -0
- package/dist/generate/master-defaults.d.ts +4 -0
- package/dist/generate/materialize.d.ts +2 -0
- package/dist/generate/math.d.ts +3 -0
- package/dist/generate/media.d.ts +13 -0
- package/dist/generate/portable-clipboard.d.ts +4 -0
- package/dist/generate/projection-tree.d.ts +8 -0
- package/dist/generate/table.d.ts +4 -0
- package/dist/generate/template.d.ts +70 -0
- package/dist/generate/text-body.d.ts +2 -0
- package/dist/generate/text-effects.d.ts +5 -0
- package/dist/generate/text-override.d.ts +8 -0
- package/dist/generate/validation.d.ts +3 -0
- package/dist/generate/warp.d.ts +2 -0
- package/dist/generate.js +1464 -0
- package/dist/history.d.ts +11 -1
- package/dist/hyperlink.d.ts +2 -0
- package/dist/identities.d.ts +4 -0
- package/dist/identity-allocation.d.ts +12 -0
- package/dist/identity-watermark.d.ts +4 -0
- package/dist/image-content.d.ts +5 -2
- package/dist/image-resource-history.d.ts +2 -0
- package/dist/index-C2r7c6G6.js +714 -0
- package/dist/index-CYDvbiwF.js +1 -0
- package/dist/index.d.ts +43 -7
- package/dist/ink/index.d.ts +27 -0
- package/dist/ink/model.d.ts +4 -0
- package/dist/ink/save.d.ts +3 -0
- package/dist/ink/source.d.ts +7 -0
- package/dist/ink.js +324 -0
- package/dist/layout-assets.d.ts +3 -1
- package/dist/layout-projection.d.ts +19 -5
- package/dist/layout-state.d.ts +2 -0
- package/dist/layout-types.d.ts +42 -0
- package/dist/layout.d.ts +5 -0
- package/dist/lint/color.d.ts +5 -0
- package/dist/lint/index.d.ts +7 -0
- package/dist/lint/prompts.d.ts +3 -0
- package/dist/lint/report.d.ts +21 -0
- package/dist/lint/sampler-batch.d.ts +4 -0
- package/dist/lint/sampler-images.d.ts +2 -0
- package/dist/lint/sampler.d.ts +9 -0
- package/dist/lint/snapshot.d.ts +34 -0
- package/dist/lint/types.d.ts +67 -0
- package/dist/lint-sampler.js +187 -0
- package/dist/lint.js +659 -0
- package/dist/master-state.d.ts +3 -0
- package/dist/master-text-style-state.d.ts +3 -0
- package/dist/master-types.d.ts +55 -0
- package/dist/master.d.ts +5 -0
- package/dist/media/audio-icon.d.ts +2 -0
- package/dist/media/commands.d.ts +3 -0
- package/dist/media/index.d.ts +10 -0
- package/dist/media/markup.d.ts +10 -0
- package/dist/media/mp4-boxes.d.ts +12 -0
- package/dist/media/mp4-fragments.d.ts +8 -0
- package/dist/media/mp4-samples.d.ts +4 -0
- package/dist/media/mp4.d.ts +2 -0
- package/dist/media/poster.d.ts +2 -0
- package/dist/media/replace-poster.d.ts +3 -0
- package/dist/media/resource.d.ts +4 -0
- package/dist/media/source.d.ts +14 -0
- package/dist/media/types.d.ts +33 -0
- package/dist/media-properties.d.ts +4 -0
- package/dist/media.js +1630 -0
- package/dist/model-invariants-BM19JVxy.js +8980 -0
- package/dist/object-source.d.ts +11 -0
- package/dist/ole/container.d.ts +14 -0
- package/dist/ole/content.d.ts +94 -0
- package/dist/ole/index.d.ts +20 -0
- package/dist/ole/preview.d.ts +3 -0
- package/dist/ole/save.d.ts +2 -0
- package/dist/ole/state.d.ts +16 -0
- package/dist/ole.js +870 -0
- package/dist/opc/patch.d.ts +2 -0
- package/dist/opc.js +1 -1
- package/dist/paragraph-level.d.ts +11 -0
- package/dist/paragraph-property-schema.d.ts +5 -2
- package/dist/{patch-DO8497wO.js → patch-BwhfBbYE.js} +112 -95
- package/dist/patch-change.d.ts +4 -0
- package/dist/patch-events.d.ts +16 -0
- package/dist/ppt/appearance.d.ts +11 -0
- package/dist/ppt/binary.d.ts +20 -0
- package/dist/ppt/drawing.d.ts +18 -0
- package/dist/ppt/geometry.d.ts +4 -0
- package/dist/ppt/index.d.ts +12 -0
- package/dist/ppt/pictures.d.ts +11 -0
- package/dist/ppt/text.d.ts +9 -0
- package/dist/ppt.js +774 -0
- package/dist/preset-geometry.d.ts +6 -0
- package/dist/projection.d.ts +2 -0
- package/dist/query-BHLjWjnu.js +903 -0
- package/dist/recovery-identity.d.ts +3 -1
- package/dist/recovery-migrations.d.ts +3 -0
- package/dist/recovery.d.ts +3 -0
- package/dist/resize/index.d.ts +6 -0
- package/dist/resize/text.d.ts +4 -0
- package/dist/resize.js +5090 -0
- package/dist/retained-element-origins.d.ts +6 -0
- package/dist/run-property-fields.d.ts +12 -0
- package/dist/run-property-schema.d.ts +3 -1
- package/dist/run-style.d.ts +15 -0
- package/dist/save/alt-text.d.ts +4 -0
- package/dist/save/comments.d.ts +3 -0
- package/dist/save/effects.d.ts +2 -1
- package/dist/save/extension-availability.d.ts +3 -0
- package/dist/save/extension-elements.d.ts +26 -0
- package/dist/save/geometry.d.ts +5 -0
- package/dist/save/index.d.ts +6 -1
- package/dist/save/insertion.d.ts +7 -3
- package/dist/save/layout-properties.d.ts +4 -0
- package/dist/save/master-properties.d.ts +5 -0
- package/dist/save/notes.d.ts +2 -0
- package/dist/save/paragraph-overrides.d.ts +3 -0
- package/dist/save/run-overrides.d.ts +10 -0
- package/dist/save/shape-format.d.ts +3 -0
- package/dist/save/slide-parts.d.ts +1 -0
- package/dist/save/table-style-part.d.ts +11 -0
- package/dist/save/table.d.ts +5 -0
- package/dist/save/text-source-less.d.ts +6 -0
- package/dist/save/xfrm.d.ts +8 -2
- package/dist/save.js +502 -1480
- package/dist/sections.d.ts +8 -0
- package/dist/session-assets.d.ts +4 -0
- package/dist/slide-parts-D0o_DDhi.js +1331 -0
- package/dist/slide-size.d.ts +6 -0
- package/dist/smartart/drawing.d.ts +3 -0
- package/dist/smartart/index.d.ts +16 -0
- package/dist/smartart/model.d.ts +18 -0
- package/dist/smartart/save.d.ts +3 -0
- package/dist/smartart.js +604 -0
- package/dist/source-retention.d.ts +7 -0
- package/dist/space.d.ts +37 -0
- package/dist/table-cell.d.ts +7 -1
- package/dist/table-direct-markup.d.ts +7 -1
- package/dist/table-grid-projection.d.ts +6 -0
- package/dist/table-grid.d.ts +45 -0
- package/dist/table-invariants.d.ts +4 -0
- package/dist/table-rows.d.ts +2 -1
- package/dist/table-scale.d.ts +4 -0
- package/dist/table-style.d.ts +21 -0
- package/dist/templates/index.d.ts +4 -0
- package/dist/templates/recipes.d.ts +5 -0
- package/dist/templates/types.d.ts +17 -0
- package/dist/templates.js +543 -0
- package/dist/text-flatten.d.ts +6 -0
- package/dist/text-fragment.d.ts +5 -0
- package/dist/text-model.d.ts +8 -8
- package/dist/text-override-validation.d.ts +6 -2
- package/dist/text-selection.d.ts +4 -0
- package/dist/theme-projection.d.ts +8 -0
- package/dist/theme-xml.d.ts +3 -0
- package/dist/theme.d.ts +14 -0
- package/dist/types.d.ts +217 -8
- package/dist/xml/index.d.ts +1 -1
- package/dist/xml/nodes.d.ts +2 -2
- package/dist/xml/shape-ids.d.ts +3 -0
- package/dist/xml.js +19 -16
- package/package.json +77 -5
- package/schemas/describe.schema.json +479 -0
- package/schemas/lint.schema.json +145 -0
- package/dist/index-D4ZTaYOa.js +0 -706
- package/dist/insertion-DabLme_U.js +0 -5471
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface ChartCellRange {
|
|
2
|
+
readonly sheet: string;
|
|
3
|
+
readonly startColumn: number;
|
|
4
|
+
readonly startRow: number;
|
|
5
|
+
readonly endColumn: number;
|
|
6
|
+
readonly endRow: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function columnNumber(name: string): number;
|
|
9
|
+
export declare function columnName(value: number): string;
|
|
10
|
+
/** 只接受单工作表 A1 范围;外部引用、名称、3D 引用和并集一律拒绝。 */
|
|
11
|
+
export declare function parseChartFormula(formula: string | null): ChartCellRange | null;
|
|
12
|
+
export declare function chartFormula(range: ChartCellRange): string;
|
|
13
|
+
export declare function resizedChartFormula(formula: string | null, count: number): string | null;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { EditDoc, ElementId } from '../types';
|
|
2
|
+
import type { ChartIdentityScopes } from './identity-scopes';
|
|
3
|
+
/** 部件只保存一份数据;原框架的身份前缀按 OPC 定位持久化,避免重开时都变成首框架的身份。 */
|
|
4
|
+
export declare function chartIdentityScopes(doc: EditDoc, part: string, source: Uint8Array, owner: ElementId): ChartIdentityScopes | undefined;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface ChartIdentityScopes {
|
|
2
|
+
readonly prefix: string;
|
|
3
|
+
readonly frames: readonly (readonly [string, string])[];
|
|
4
|
+
}
|
|
5
|
+
export declare function readIdentityScopes(value: unknown): ChartIdentityScopes | undefined;
|
|
6
|
+
export declare function scopedIdentity(value: unknown, scope: ChartIdentityScopes | undefined, prefix: string): unknown;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { XmlElement } from '@web-ppt/edit-core/xml';
|
|
2
|
+
import type { ChartDatasetState, ChartPlotKind, ChartPointId, ChartSeriesId } from './types';
|
|
3
|
+
import type { ChartIdentityScopes } from './identity-scopes';
|
|
4
|
+
import type { CategoryOrientation } from './category-binding';
|
|
5
|
+
export declare const CHART_IDENTITY_URI = "urn:web-ppt:chart-data-identities:v1";
|
|
6
|
+
export interface ChartIdentityManifest {
|
|
7
|
+
readonly categoryOrientation?: CategoryOrientation;
|
|
8
|
+
readonly scopes?: ChartIdentityScopes;
|
|
9
|
+
readonly categories: readonly ChartPointId[];
|
|
10
|
+
readonly series: readonly {
|
|
11
|
+
readonly id: ChartSeriesId;
|
|
12
|
+
readonly points: readonly ChartPointId[];
|
|
13
|
+
}[];
|
|
14
|
+
readonly templates: readonly ChartIdentityTemplate[];
|
|
15
|
+
}
|
|
16
|
+
export interface ChartIdentityTemplate {
|
|
17
|
+
readonly id: ChartSeriesId;
|
|
18
|
+
readonly plotKind: ChartPlotKind;
|
|
19
|
+
readonly sourceIndex: number;
|
|
20
|
+
readonly points: readonly ChartPointId[];
|
|
21
|
+
readonly node: XmlElement;
|
|
22
|
+
}
|
|
23
|
+
export declare function readChartIdentityManifest(root: XmlElement, frameKey?: string, fallbackPrefix?: string): ChartIdentityManifest | null;
|
|
24
|
+
export declare function writeChartIdentityManifest(root: XmlElement, state: ChartDatasetState, physicalSeriesOrder?: readonly ChartSeriesId[], templates?: readonly ChartIdentityTemplate[], scopes?: ChartIdentityScopes): void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { EditDoc, ElementId } from '../types';
|
|
2
|
+
import type { ChartDataset, EditableChart } from './types';
|
|
3
|
+
export { chartDataEditor as createChartDataEditor } from './commands';
|
|
4
|
+
export { chartProjection } from './projection';
|
|
5
|
+
export type { ChartDataEditor } from './commands';
|
|
6
|
+
export type { ChartCategory, ChartDataBinding, ChartDataset, ChartFormulaBinding, ChartPlotKind, ChartPoint, ChartPointId, ChartSeries, ChartSeriesId, EditableChart, } from './types';
|
|
7
|
+
export declare function listEditableCharts(doc: EditDoc): EditableChart[];
|
|
8
|
+
export declare function queryChartData(doc: EditDoc, id: ElementId): ChartDataset;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const MAX_CHART_NAME = 32767;
|
|
2
|
+
export declare const MAX_CHART_IDENTITY = 512;
|
|
3
|
+
export declare const MAX_CHART_POINTS = 20000;
|
|
4
|
+
export declare const MAX_CHART_SERIES = 1024;
|
|
5
|
+
export declare const MAX_CHART_CELLS = 100000;
|
|
6
|
+
export declare const MAX_CATEGORY_LEVELS = 64;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { EditDoc, ElementId } from '../types';
|
|
2
|
+
export declare function chartFrameKey(doc: EditDoc, id: ElementId): string;
|
|
3
|
+
/** 图表身份由原 frame 的 spid + OPC 关系推导,默认编辑模型不为按需能力常驻字段。 */
|
|
4
|
+
export declare function chartPartForElement(doc: EditDoc, id: ElementId): string | null;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { XmlDocument } from '@web-ppt/edit-core/xml';
|
|
2
|
+
import type { ChartDatasetState } from './types';
|
|
3
|
+
import type { ChartIdentityScopes } from './identity-scopes';
|
|
4
|
+
export declare function materializeChartTree(source: string | Uint8Array, chartId: string, state: ChartDatasetState, frameKey?: string, scopes?: ChartIdentityScopes): XmlDocument;
|
|
5
|
+
export declare function materializeChartXml(source: string | Uint8Array, chartId: string, state: ChartDatasetState): string;
|
|
6
|
+
/** 编辑投影只消费当前图表方言;未知扩展仍原样保存,但不能以同名节点劫持屏幕数据。 */
|
|
7
|
+
export declare function materializeChartProjectionXml(source: string | Uint8Array, chartId: string, state: ChartDatasetState, frameKey?: string): string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FractionalIndex } from '../types';
|
|
2
|
+
interface OrderedChartRecord {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly order: FractionalIndex;
|
|
5
|
+
}
|
|
6
|
+
/** 并发插入可能得到相同分数序;稳定身份是跨副本必须共享的最终裁决。 */
|
|
7
|
+
export declare function compareChartOrder(left: OrderedChartRecord, right: OrderedChartRecord): number;
|
|
8
|
+
export declare function orderedChartRecords<T extends OrderedChartRecord>(values: Iterable<T>): T[];
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SlideElement } from '@web-ppt/core';
|
|
2
|
+
import type { EditDoc, ElementId } from '../types';
|
|
3
|
+
export declare function chartProjection(doc: EditDoc, id: ElementId): {
|
|
4
|
+
xml: string;
|
|
5
|
+
context: import("@web-ppt/core").ChartEnv;
|
|
6
|
+
part: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function projectChartElement(doc: EditDoc, id: ElementId, element: SlideElement): SlideElement;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ChartDatasetState, ChartSeriesId } from './types';
|
|
2
|
+
import type { SharedGroup } from './shared-graph';
|
|
3
|
+
import type { WorkbookCellValue } from './workbook-read';
|
|
4
|
+
import type { SharedSeriesRemovals } from './shared-series';
|
|
5
|
+
import type { AddedSeries } from './shared-added-records';
|
|
6
|
+
import type { InsertedResource } from './shared-inserted-project';
|
|
7
|
+
import type { XYResource } from './shared-xy-records';
|
|
8
|
+
export interface SharedSeriesGrowth extends InsertedResource, XYResource {
|
|
9
|
+
readonly addedSeries?: AddedSeries;
|
|
10
|
+
readonly rows?: Readonly<Record<string, unknown>>;
|
|
11
|
+
readonly series?: SharedSeriesRemovals;
|
|
12
|
+
}
|
|
13
|
+
export interface AddedSeriesPlan {
|
|
14
|
+
readonly part: string;
|
|
15
|
+
readonly id: ChartSeriesId;
|
|
16
|
+
readonly state: ChartDatasetState;
|
|
17
|
+
}
|
|
18
|
+
/** 物理列/行由整个工作簿统一分配;文档存储的身份和数值不会随并发插入挪动。 */
|
|
19
|
+
export declare function planAddedSeries(shared: SharedGroup, resource: SharedSeriesGrowth, baseline: ReadonlyMap<string, WorkbookCellValue>): AddedSeriesPlan[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ChartDatasetState } from './types';
|
|
2
|
+
import type { SharedGroup } from './shared-graph';
|
|
3
|
+
import type { CommandPatches, DocumentExtensionPatch } from '../commands/types';
|
|
4
|
+
export type AddedSeries = Readonly<Record<string, Readonly<Record<string, unknown>>>>;
|
|
5
|
+
export declare function addedSeriesCommand(source: ChartDatasetState, workbook: string, local: CommandPatches): CommandPatches | undefined;
|
|
6
|
+
export declare function decodeAddedSeries(state: ChartDatasetState, added: AddedSeries | undefined): Record<string, unknown> | undefined;
|
|
7
|
+
export declare function validateAddedSeries(shared: SharedGroup, added: unknown): void;
|
|
8
|
+
export declare function validateAddedSeriesPatch(shared: SharedGroup, patch: DocumentExtensionPatch): void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ChartFormulaBinding } from './types';
|
|
2
|
+
import type { WorkbookCellValue } from './workbook-read';
|
|
3
|
+
/** 单次规划共享全部预约和搜索额度,避免不同图表各自认领同一块空白。 */
|
|
4
|
+
export declare function sharedSeriesAllocator(reserved: Set<string>, baseline: ReadonlyMap<string, WorkbookCellValue>): (sheet: string, horizontal: boolean, start: number, count: number) => {
|
|
5
|
+
name: ChartFormulaBinding;
|
|
6
|
+
data: ChartFormulaBinding;
|
|
7
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ChartDatasetState } from './types';
|
|
2
|
+
import type { ExtensionPatch } from '../commands/types';
|
|
3
|
+
/** 来源身份用原生序号寻址;新增身份保留创建者分配的唯一 ID,不依赖任何框架的生命周期。 */
|
|
4
|
+
export declare function sharedCacheIdentityMap(source: ChartDatasetState): Record<string, string>;
|
|
5
|
+
export declare function sharedCacheCodec(source: ChartDatasetState, identities?: Readonly<Record<string, string>>): (patch: ExtensionPatch, encode: boolean) => ExtensionPatch;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { EditDoc } from '../types';
|
|
2
|
+
import type { DocumentExtensionPatch, Patch } from '../commands/types';
|
|
3
|
+
import type { ExtensionMigrationResolver } from '../extension-runtime';
|
|
4
|
+
import type { ChartDatasetState } from './types';
|
|
5
|
+
export declare function migrateLocalChartData(doc: EditDoc, pending?: readonly Patch[], resolve?: ExtensionMigrationResolver): DocumentExtensionPatch[];
|
|
6
|
+
/** 查询复用迁移规划器的身份校验;不调用协同时钟裁决器,也不安装地址或改写文档。 */
|
|
7
|
+
export declare function localChartMigrationReason(doc: EditDoc, source: ChartDatasetState, ids: readonly string[]): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { EditDoc, ElementRecord } from '../types';
|
|
2
|
+
/** 来源归属取自原生框架与复制出处;自定义新增 ID 即使同尾缀也不能被猜成来源记录。 */
|
|
3
|
+
export declare function sharedCacheScopeIds(doc: EditDoc, part: string, native: Readonly<Record<string, string>>, identities: Readonly<Record<string, string>>): (record: ElementRecord) => {
|
|
4
|
+
ids: {
|
|
5
|
+
[k: string]: string;
|
|
6
|
+
};
|
|
7
|
+
removed: {
|
|
8
|
+
id: string;
|
|
9
|
+
ids: {
|
|
10
|
+
[x: string]: string;
|
|
11
|
+
};
|
|
12
|
+
}[];
|
|
13
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { EditDoc, ElementId } from '../types';
|
|
2
|
+
import type { CommandPatches, DocumentExtensionPatch } from '../commands/types';
|
|
3
|
+
import type { ChartDatasetState } from './types';
|
|
4
|
+
export declare function sharedCacheSource(doc: EditDoc, part: string, allowLegacy?: boolean): ChartDatasetState | undefined;
|
|
5
|
+
export declare function ownsSharedCache(doc: EditDoc, id: ElementId): boolean;
|
|
6
|
+
export declare function sharedCacheTransactionsOnly(doc: EditDoc, id: ElementId): boolean;
|
|
7
|
+
export declare function validateSharedCachePatch(doc: EditDoc, patch: DocumentExtensionPatch): void;
|
|
8
|
+
export declare function sharedCacheOverrides(doc: EditDoc, source: ChartDatasetState): Record<string, unknown> | undefined;
|
|
9
|
+
export declare function sharedCacheFrameOverrides(doc: EditDoc, id: ElementId): unknown;
|
|
10
|
+
export declare function sharedCacheDataset(doc: EditDoc, id: ElementId, state: ChartDatasetState): ChartDatasetState;
|
|
11
|
+
export declare function sharedCacheCommand(doc: EditDoc, id: ElementId, local: CommandPatches): CommandPatches;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ChartDatasetState } from './types';
|
|
2
|
+
import type { WorkbookMap } from './workbook';
|
|
3
|
+
import type { SharedCellEdit } from './shared-cell';
|
|
4
|
+
export declare function sharedCategoryEdits(source: ChartDatasetState, before: ChartDatasetState, after: ChartDatasetState, parts: Readonly<Record<string, Uint8Array>>, map: WorkbookMap, touched: ReadonlySet<string>): Map<string, SharedCellEdit>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { WorkbookCellValue } from './workbook-read';
|
|
2
|
+
export type SharedCellEdit = {
|
|
3
|
+
readonly value: string | number | null;
|
|
4
|
+
} | {
|
|
5
|
+
readonly parent: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function decodeSharedCell(raw: unknown): SharedCellEdit;
|
|
8
|
+
/** 延续组保存为对组首的引用;并发改名因此不会把旧标签复制成第二份真值。 */
|
|
9
|
+
export declare function sharedCellValue(key: string, overrides: Readonly<Record<string, unknown>>, baseline: ReadonlyMap<string, WorkbookCellValue>): string | number | null;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { SharedGroup } from './shared-graph';
|
|
2
|
+
import type { ChartDatasetState } from './types';
|
|
3
|
+
import type { SharedXYAxisOwner } from './shared-xy-source';
|
|
4
|
+
export interface SharedCategoryFamily {
|
|
5
|
+
readonly key: string;
|
|
6
|
+
readonly sheet: string;
|
|
7
|
+
readonly horizontal: boolean;
|
|
8
|
+
readonly start: number;
|
|
9
|
+
readonly end: number;
|
|
10
|
+
readonly lanes: ReadonlySet<number>;
|
|
11
|
+
readonly keys: ReadonlySet<string>;
|
|
12
|
+
readonly charts: SharedGroup['charts'];
|
|
13
|
+
readonly positions: ReadonlyMap<string, ReadonlyMap<string, number>>;
|
|
14
|
+
readonly xyOwners: readonly SharedXYAxisOwner[];
|
|
15
|
+
readonly ranges: ReadonlyMap<string, {
|
|
16
|
+
readonly start: number;
|
|
17
|
+
readonly end: number;
|
|
18
|
+
}>;
|
|
19
|
+
readonly anchors: ReadonlySet<number>;
|
|
20
|
+
readonly numericLanes: ReadonlySet<number>;
|
|
21
|
+
}
|
|
22
|
+
/** 相交的数据单元格把视图组成一个记录轴;框架身份不会改变这个区域的所有权。 */
|
|
23
|
+
export declare function sharedCategoryFamily(shared: SharedGroup, id: string): SharedCategoryFamily;
|
|
24
|
+
export declare function sharedCategoryForXY(shared: SharedGroup, chartId: string, seriesId: string): SharedCategoryFamily | undefined;
|
|
25
|
+
export declare function sharedFamilyForState(shared: SharedGroup, state: ChartDatasetState): SharedCategoryFamily;
|
|
26
|
+
export declare function sharedFamilyByKey(shared: SharedGroup, key: string): SharedCategoryFamily;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ChartDatasetState } from './types';
|
|
2
|
+
export interface SharedCellField {
|
|
3
|
+
readonly key: string;
|
|
4
|
+
readonly path: readonly string[];
|
|
5
|
+
readonly value: string | number | null;
|
|
6
|
+
readonly kind: 'number' | 'text';
|
|
7
|
+
readonly nullable?: boolean;
|
|
8
|
+
readonly parent?: {
|
|
9
|
+
readonly level: number;
|
|
10
|
+
readonly raw: string | null;
|
|
11
|
+
readonly family: string;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
/** 混合图中的类别记录只拥有类别系列的数值;XY 系列按各自的记录轴增删。 */
|
|
15
|
+
export declare function sharedCategoryFields(state: ChartDatasetState, fields?: readonly SharedCellField[]): SharedCellField[];
|
|
16
|
+
/** 空缓存也保留公式所有权,分配新系列不能占用这些仍可恢复的区域。 */
|
|
17
|
+
export declare function sharedFormulaCells(state: ChartDatasetState): string[];
|
|
18
|
+
export declare function sharedCellFields(state: ChartDatasetState): SharedCellField[];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { EditDoc, ElementId } from '../types';
|
|
2
|
+
import type { ChartDatasetState } from './types';
|
|
3
|
+
import type { SharedCellField } from './shared-fields';
|
|
4
|
+
export { sharedChartTopology as nativeChartParts } from './shared-topology';
|
|
5
|
+
export interface SharedGroup {
|
|
6
|
+
readonly workbook: string;
|
|
7
|
+
readonly reason?: string;
|
|
8
|
+
readonly charts: readonly {
|
|
9
|
+
id: ElementId;
|
|
10
|
+
native?: true;
|
|
11
|
+
state: ChartDatasetState;
|
|
12
|
+
fields: readonly SharedCellField[];
|
|
13
|
+
}[];
|
|
14
|
+
}
|
|
15
|
+
export declare function hasSharedChartScopes(bytes: Uint8Array): boolean;
|
|
16
|
+
export declare function sharedWorkbookParts(doc: EditDoc): string[];
|
|
17
|
+
/** 所有权来自 OPC 部件图;没有当前框架的图表仍然是工作簿的原生消费者。 */
|
|
18
|
+
export declare function sharedGroupForWorkbook(doc: EditDoc, workbook: string): SharedGroup | undefined;
|
|
19
|
+
export declare function sharedGroupForFrame(doc: EditDoc, id: ElementId): SharedGroup | undefined;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { SharedGroup } from './shared-graph';
|
|
2
|
+
import type { InsertedResource } from './shared-inserted-project';
|
|
3
|
+
import type { XYResource } from './shared-xy-records';
|
|
4
|
+
/** 来源区域彼此独立,不代表扩展后仍独立;空格也不能同时分配给两条记录轴。 */
|
|
5
|
+
export declare function assertSharedGrowthSpace(shared: SharedGroup, resource: InsertedResource & XYResource): void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { SharedGroup } from './shared-graph';
|
|
2
|
+
import type { InsertedRows } from './shared-inserted-records';
|
|
3
|
+
export interface InsertedCellResource {
|
|
4
|
+
readonly insertions?: InsertedRows;
|
|
5
|
+
readonly cells?: Readonly<Record<string, unknown>>;
|
|
6
|
+
}
|
|
7
|
+
export declare const insertedCellKey: (id: string, lane: number | string) => string;
|
|
8
|
+
export declare function insertedCellReference(key: string): {
|
|
9
|
+
id: string;
|
|
10
|
+
lane: number;
|
|
11
|
+
} | undefined;
|
|
12
|
+
export declare function validateInsertedCellReference(shared: SharedGroup, target: string, parent: string, insertions?: InsertedRows): void;
|
|
13
|
+
/** 虚拟单元格只是引用解析图的节点,所有字面值仍只有文档中的一份记录。 */
|
|
14
|
+
export declare function insertedCellOverrides(shared: SharedGroup, resource: InsertedCellResource): Record<string, unknown>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { EditDoc } from '../types';
|
|
2
|
+
import type { CommandPatches } from '../commands/types';
|
|
3
|
+
import type { SharedGroup } from './shared-graph';
|
|
4
|
+
import type { InsertedResource } from './shared-inserted-project';
|
|
5
|
+
import type { WorkbookCellValue } from './workbook-read';
|
|
6
|
+
import type { SharedSeriesGrowth } from './shared-added-plan';
|
|
7
|
+
export declare function insertedCategoryCommand(doc: EditDoc, shared: SharedGroup, id: string, local: CommandPatches, origin: string, resource: InsertedResource & SharedSeriesGrowth, baseline: ReadonlyMap<string, WorkbookCellValue>): CommandPatches | undefined;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { SharedCategoryFamily } from './shared-family';
|
|
2
|
+
import type { InsertedRows } from './shared-inserted-records';
|
|
3
|
+
import type { RemovedCells } from './shared-rows';
|
|
4
|
+
import type { WorkbookCellValue } from './workbook-read';
|
|
5
|
+
import type { SharedGroup } from './shared-graph';
|
|
6
|
+
import type { SharedRecordAxis } from './shared-record-axis';
|
|
7
|
+
export declare function insertedRowLayout(family: SharedCategoryFamily, insertions: InsertedRows | undefined, removals?: RemovedCells): {
|
|
8
|
+
key: (lane: number, axis: number) => string;
|
|
9
|
+
records: readonly import("./shared-inserted-records").InsertedRow[];
|
|
10
|
+
active: import("./shared-inserted-records").InsertedRow[];
|
|
11
|
+
deleted: number[];
|
|
12
|
+
originalAxis: (axis: number) => number;
|
|
13
|
+
insertedAxis: (row: import("./shared-inserted-records").InsertedRow) => number;
|
|
14
|
+
end: number;
|
|
15
|
+
};
|
|
16
|
+
export declare function assertInsertedRoom(shared: SharedGroup, family: SharedRecordAxis, layout: Pick<ReturnType<typeof insertedRowLayout>, 'active' | 'deleted' | 'end' | 'key'>, baseline: ReadonlyMap<string, WorkbookCellValue>): void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ChartDatasetState } from './types';
|
|
2
|
+
import type { SharedGroup } from './shared-graph';
|
|
3
|
+
import type { InsertedRows } from './shared-inserted-records';
|
|
4
|
+
import { sharedFamilyForState } from './shared-family';
|
|
5
|
+
import type { RemovedCells } from './shared-rows';
|
|
6
|
+
import type { WorkbookCellValue } from './workbook-read';
|
|
7
|
+
import type { InsertedCellResource } from './shared-inserted-cells';
|
|
8
|
+
export interface InsertedResource extends InsertedCellResource {
|
|
9
|
+
readonly insertions?: InsertedRows;
|
|
10
|
+
readonly rows?: RemovedCells;
|
|
11
|
+
}
|
|
12
|
+
/** 插入顺序投影到每个视图的本地分数序;工作簿坐标只在保存边界派生。 */
|
|
13
|
+
export declare function projectInsertedCategories(shared: SharedGroup, state: ChartDatasetState, original: ChartDatasetState, resource: InsertedResource, baseline: ReadonlyMap<string, WorkbookCellValue>): void;
|
|
14
|
+
export declare function insertedCellLane(family: ReturnType<typeof sharedFamilyForState>, key: string): string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { DocumentExtensionPatch } from '../commands/types';
|
|
2
|
+
import type { SharedGroup } from './shared-graph';
|
|
3
|
+
import type { FractionalIndex } from '../types';
|
|
4
|
+
import type { SharedCategoryFamily } from './shared-family';
|
|
5
|
+
export interface InsertedRow {
|
|
6
|
+
readonly id: string;
|
|
7
|
+
readonly anchor: number;
|
|
8
|
+
readonly order: FractionalIndex;
|
|
9
|
+
readonly parent?: string | null;
|
|
10
|
+
readonly removed?: true;
|
|
11
|
+
readonly cells?: Readonly<Record<string, string | number | null>>;
|
|
12
|
+
}
|
|
13
|
+
export type InsertedRows = Readonly<Record<string, Readonly<Record<string, unknown>>>>;
|
|
14
|
+
export declare function validateInsertedPatch(shared: SharedGroup, patch: DocumentExtensionPatch): void;
|
|
15
|
+
export declare function validateInsertedRows(shared: SharedGroup, value: unknown): void;
|
|
16
|
+
export declare function insertedRows(family: Pick<SharedCategoryFamily, 'key'>, insertions: InsertedRows | undefined): InsertedRow[];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { EditDoc } from '../types';
|
|
2
|
+
import type { SharedGroup } from './shared-graph';
|
|
3
|
+
import type { InsertedResource } from './shared-inserted-project';
|
|
4
|
+
import type { WorkbookCellValue } from './workbook-read';
|
|
5
|
+
/** 全轴一次压紧或插入;所有视图回写同一组单元格,不能各自重排自己的子范围。 */
|
|
6
|
+
export declare function writeInsertedCategories(doc: EditDoc, shared: SharedGroup, resource: InsertedResource, baseline: ReadonlyMap<string, WorkbookCellValue>, write: (key: string, value: string | number | null) => void): void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { EditDoc } from '../types';
|
|
2
|
+
import type { CommandPatches } from '../commands/types';
|
|
3
|
+
import type { ChartPointId, ChartSeriesId } from './types';
|
|
4
|
+
import type { SharedGroup } from './shared-graph';
|
|
5
|
+
import type { SharedCategoryFamily } from './shared-family';
|
|
6
|
+
import type { InsertedResource } from './shared-inserted-project';
|
|
7
|
+
import type { SharedSeriesGrowth } from './shared-added-plan';
|
|
8
|
+
import type { WorkbookCellValue } from './workbook-read';
|
|
9
|
+
export declare function jointPointCommand(doc: EditDoc, shared: SharedGroup, family: SharedCategoryFamily, chartId: string, seriesId: ChartSeriesId, pointId: ChartPointId, local: CommandPatches, origin: string, resource: InsertedResource & SharedSeriesGrowth, baseline: ReadonlyMap<string, WorkbookCellValue>): CommandPatches;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SharedGroup } from './shared-graph';
|
|
2
|
+
import type { InsertedResource } from './shared-inserted-project';
|
|
3
|
+
import type { SharedXYFamily } from './shared-xy-family';
|
|
4
|
+
import type { XYAxisRecords } from './shared-xy-records';
|
|
5
|
+
/** XY 视图借用共同记录的布局;派生适配不向文档写入第二份结构状态。 */
|
|
6
|
+
export declare function jointXYRecords(shared: SharedGroup, resource: InsertedResource): Array<{
|
|
7
|
+
family: SharedXYFamily;
|
|
8
|
+
record: XYAxisRecords;
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface SharedRecordAxis {
|
|
2
|
+
readonly key: string;
|
|
3
|
+
readonly sheet: string;
|
|
4
|
+
readonly horizontal: boolean;
|
|
5
|
+
readonly start: number;
|
|
6
|
+
readonly end: number;
|
|
7
|
+
readonly lanes: ReadonlySet<number>;
|
|
8
|
+
readonly keys: ReadonlySet<string>;
|
|
9
|
+
readonly references?: ReadonlySet<string>;
|
|
10
|
+
}
|
|
11
|
+
interface AxisInsertion {
|
|
12
|
+
readonly id: string;
|
|
13
|
+
readonly anchor: number;
|
|
14
|
+
readonly removed?: true;
|
|
15
|
+
}
|
|
16
|
+
/** 来源坐标是身份;压紧和插入只改变派生坐标,不改写后续记录的寻址。 */
|
|
17
|
+
export declare function recordAxisLayout<T extends AxisInsertion>(family: SharedRecordAxis, records: readonly T[], removed: ReadonlySet<number>): {
|
|
18
|
+
records: readonly T[];
|
|
19
|
+
active: T[];
|
|
20
|
+
deleted: number[];
|
|
21
|
+
originalAxis: (axis: number) => number;
|
|
22
|
+
insertedAxis: (row: T) => number;
|
|
23
|
+
end: number;
|
|
24
|
+
};
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { EditDoc } from '../types';
|
|
2
|
+
import type { CommandPatches } from '../commands/types';
|
|
3
|
+
import type { SharedGroup } from './shared-graph';
|
|
4
|
+
import type { SharedCategoryFamily } from './shared-family';
|
|
5
|
+
import type { WorkbookCellValue } from './workbook-read';
|
|
6
|
+
interface Resource {
|
|
7
|
+
readonly rows?: Readonly<Record<string, unknown>>;
|
|
8
|
+
readonly cells?: Readonly<Record<string, unknown>>;
|
|
9
|
+
readonly heads?: Readonly<Record<string, Readonly<Record<string, unknown>>>>;
|
|
10
|
+
}
|
|
11
|
+
/** 删除一条来源记录,同时保留各层级视图的组首延续引用。 */
|
|
12
|
+
export declare function removeSharedRecord(doc: EditDoc, shared: SharedGroup, family: SharedCategoryFamily, position: number, origin: string, resource: Resource, baseline: ReadonlyMap<string, WorkbookCellValue>): CommandPatches;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ChartDatasetState } from './types';
|
|
2
|
+
import type { SharedGroup } from './shared';
|
|
3
|
+
import type { SharedCategoryFamily } from './shared-family';
|
|
4
|
+
export { sharedCellAddress } from './shared-address';
|
|
5
|
+
import type { WorkbookCellValue } from './workbook-read';
|
|
6
|
+
export interface RemovedCell {
|
|
7
|
+
readonly horizontal: boolean;
|
|
8
|
+
readonly end: number;
|
|
9
|
+
}
|
|
10
|
+
export type RemovedCells = Readonly<Record<string, unknown>>;
|
|
11
|
+
export declare function removedCell(raw: unknown): RemovedCell;
|
|
12
|
+
/** 原地址是记录身份,删除范围只描述物理压紧区域;其后的编辑不按当前显示行号重新寻址。 */
|
|
13
|
+
export declare function sharedRowPlan(shared: SharedGroup, id: string, categoryId: string, baseline: ReadonlyMap<string, WorkbookCellValue>): Map<string, RemovedCell>;
|
|
14
|
+
export declare function sharedRecordRemovalPlan(family: SharedCategoryFamily, position: number, baseline: ReadonlyMap<string, WorkbookCellValue>): Map<string, RemovedCell>;
|
|
15
|
+
export declare function sharedRowPlanForCell(shared: SharedGroup, key: string, baseline: ReadonlyMap<string, WorkbookCellValue>): Map<string, RemovedCell>;
|
|
16
|
+
export declare function shiftedCell(key: string, rows: RemovedCells, inclusive?: boolean): string;
|
|
17
|
+
export declare function projectSharedRows(state: ChartDatasetState, rows: RemovedCells | undefined): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { EditDoc, ElementId } from '../types';
|
|
2
|
+
import type { CommandPatches } from '../commands/types';
|
|
3
|
+
import type { ChartDatasetState } from './types';
|
|
4
|
+
import type { ChartIdentityScopes } from './identity-scopes';
|
|
5
|
+
export interface SharedChartRuntime {
|
|
6
|
+
readonly dataset: (doc: EditDoc, id: ElementId, state: ChartDatasetState) => ChartDatasetState;
|
|
7
|
+
readonly command: (doc: EditDoc, id: ElementId, local: CommandPatches, origin: string) => CommandPatches;
|
|
8
|
+
readonly active: (doc: EditDoc, workbook?: string) => boolean;
|
|
9
|
+
readonly owns: (doc: EditDoc, id: ElementId) => boolean;
|
|
10
|
+
readonly workbook?: (doc: EditDoc, id: ElementId) => boolean;
|
|
11
|
+
readonly overrides?: (doc: EditDoc, id: ElementId) => unknown;
|
|
12
|
+
readonly source?: (doc: EditDoc, id: ElementId, deferred: boolean, part: string | undefined, read: () => ChartDatasetState) => ChartDatasetState;
|
|
13
|
+
readonly identityScopes?: (doc: EditDoc, part: string, source: Uint8Array, id: ElementId) => ChartIdentityScopes | undefined;
|
|
14
|
+
}
|
|
15
|
+
export declare const sharedChartRuntime: () => SharedChartRuntime | undefined;
|
|
16
|
+
export declare const setSharedChartRuntime: (value: SharedChartRuntime) => void;
|
|
17
|
+
export declare const chartDatasetOverrides: (doc: EditDoc, id: ElementId) => unknown;
|
|
18
|
+
export declare const SHARED_CHART_REASON = "\u5171\u4EAB\u56FE\u8868\u6570\u636E\u9700\u8981\u52A0\u8F7D chart-shared \u7F16\u8F91\u5165\u53E3";
|
|
19
|
+
export declare function sharedDatasetState(doc: EditDoc, id: ElementId, state: ChartDatasetState): ChartDatasetState;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { EditDoc } from '../types';
|
|
2
|
+
import type { ChartDatasetState } from './types';
|
|
3
|
+
export type SharedSeriesRemovals = Readonly<Record<string, Readonly<Record<string, unknown>>>>;
|
|
4
|
+
export declare function projectSharedSeries(state: ChartDatasetState, removals: SharedSeriesRemovals | undefined): void;
|
|
5
|
+
/** 删除的是图表中的系列;只有全部原生视图都释放的单元格才可清空。 */
|
|
6
|
+
export declare function unusedSharedCells(doc: EditDoc, workbook: string): Set<string>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { EditDoc, ElementId } from '../types';
|
|
2
|
+
import type { ChartDatasetState } from './types';
|
|
3
|
+
/** 缓存只依赖不可变来源字节,编辑覆盖仍每次重新投影;保存后的原始基线也必须参与失效判断。 */
|
|
4
|
+
export declare function cachedSharedSource(doc: EditDoc, id: ElementId, deferred: boolean, nativePart: string | undefined, read: () => ChartDatasetState): ChartDatasetState;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { EditDoc, ElementId } from '../types';
|
|
2
|
+
import { nativeChartParts } from './part-graph';
|
|
3
|
+
interface ChartTopology extends ReturnType<typeof nativeChartParts> {
|
|
4
|
+
readonly frames: ReadonlyMap<string, readonly ElementId[]>;
|
|
5
|
+
readonly signature: string;
|
|
6
|
+
}
|
|
7
|
+
/** 结构补丁替换记录集合,保存替换来源包;数据覆盖不改变原生消费者关系。 */
|
|
8
|
+
export declare function sharedChartTopology(doc: EditDoc): ChartTopology;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { DocumentExtensionPatch } from '../commands/types';
|
|
2
|
+
import type { SharedGroup } from './shared';
|
|
3
|
+
import type { WorkbookCellValue } from './workbook-read';
|
|
4
|
+
export declare function validateSharedPatch(shared: SharedGroup, patch: DocumentExtensionPatch, baseline: ReadonlyMap<string, WorkbookCellValue>): void;
|
|
5
|
+
/** 恢复可先于按需扩展加载;投影和保存仍须校验完整覆盖,不能只信任在线补丁入口。 */
|
|
6
|
+
export declare function validateSharedOverrides(shared: SharedGroup, resource: unknown, baseline: ReadonlyMap<string, WorkbookCellValue>): void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { EditDoc } from '../types';
|
|
2
|
+
export declare function sharedWorkbookSource(doc: EditDoc, part: string): {
|
|
3
|
+
parts: Record<string, Uint8Array<ArrayBufferLike>>;
|
|
4
|
+
map: import("./workbook").WorkbookMap;
|
|
5
|
+
baseline: Map<string, import("./workbook-read").WorkbookCellValue>;
|
|
6
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { EditDoc } from '../types';
|
|
2
|
+
import type { CommandPatches } from '../commands/types';
|
|
3
|
+
import type { SharedGroup } from './shared-graph';
|
|
4
|
+
import type { WorkbookCellValue } from './workbook-read';
|
|
5
|
+
import type { XYResource } from './shared-xy-records';
|
|
6
|
+
import type { SharedSeriesGrowth } from './shared-added-plan';
|
|
7
|
+
export declare function sharedXYCommand(doc: EditDoc, shared: SharedGroup, id: string, local: CommandPatches, origin: string, resource: XYResource & SharedSeriesGrowth, baseline: ReadonlyMap<string, WorkbookCellValue>): CommandPatches | undefined;
|