ducjs 1.0.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/LICENSE +21 -0
- package/README.md +42 -0
- package/dist/flatbuffers/duc/alternate-units.d.ts +21 -0
- package/dist/flatbuffers/duc/alternate-units.js +66 -0
- package/dist/flatbuffers/duc/angular-unit-system.d.ts +17 -0
- package/dist/flatbuffers/duc/angular-unit-system.js +50 -0
- package/dist/flatbuffers/duc/angular-units-format.d.ts +7 -0
- package/dist/flatbuffers/duc/angular-units-format.js +10 -0
- package/dist/flatbuffers/duc/axis.d.ts +5 -0
- package/dist/flatbuffers/duc/axis.js +8 -0
- package/dist/flatbuffers/duc/bezier-mirroring.d.ts +5 -0
- package/dist/flatbuffers/duc/bezier-mirroring.js +8 -0
- package/dist/flatbuffers/duc/blending.d.ts +9 -0
- package/dist/flatbuffers/duc/blending.js +12 -0
- package/dist/flatbuffers/duc/block-attachment.d.ts +4 -0
- package/dist/flatbuffers/duc/block-attachment.js +7 -0
- package/dist/flatbuffers/duc/boolean-operation.d.ts +6 -0
- package/dist/flatbuffers/duc/boolean-operation.js +9 -0
- package/dist/flatbuffers/duc/bound-element.d.ts +17 -0
- package/dist/flatbuffers/duc/bound-element.js +48 -0
- package/dist/flatbuffers/duc/checkpoint.d.ts +22 -0
- package/dist/flatbuffers/duc/checkpoint.js +75 -0
- package/dist/flatbuffers/duc/column-layout.d.ts +22 -0
- package/dist/flatbuffers/duc/column-layout.js +72 -0
- package/dist/flatbuffers/duc/column-type.d.ts +5 -0
- package/dist/flatbuffers/duc/column-type.js +8 -0
- package/dist/flatbuffers/duc/custom-hatch-pattern.d.ts +23 -0
- package/dist/flatbuffers/duc/custom-hatch-pattern.js +71 -0
- package/dist/flatbuffers/duc/datum-bracket-style.d.ts +5 -0
- package/dist/flatbuffers/duc/datum-bracket-style.js +8 -0
- package/dist/flatbuffers/duc/datum-reference.d.ts +17 -0
- package/dist/flatbuffers/duc/datum-reference.js +49 -0
- package/dist/flatbuffers/duc/datum-target-type.d.ts +6 -0
- package/dist/flatbuffers/duc/datum-target-type.js +9 -0
- package/dist/flatbuffers/duc/decimal-separator.d.ts +4 -0
- package/dist/flatbuffers/duc/decimal-separator.js +7 -0
- package/dist/flatbuffers/duc/delta.d.ts +20 -0
- package/dist/flatbuffers/duc/delta.js +64 -0
- package/dist/flatbuffers/duc/dictionary-entry.d.ts +17 -0
- package/dist/flatbuffers/duc/dictionary-entry.js +49 -0
- package/dist/flatbuffers/duc/dimension-baseline-data.d.ts +14 -0
- package/dist/flatbuffers/duc/dimension-baseline-data.js +40 -0
- package/dist/flatbuffers/duc/dimension-bindings.d.ts +17 -0
- package/dist/flatbuffers/duc/dimension-bindings.js +50 -0
- package/dist/flatbuffers/duc/dimension-continue-data.d.ts +14 -0
- package/dist/flatbuffers/duc/dimension-continue-data.js +40 -0
- package/dist/flatbuffers/duc/dimension-definition-points.d.ts +21 -0
- package/dist/flatbuffers/duc/dimension-definition-points.js +64 -0
- package/dist/flatbuffers/duc/dimension-ext-line-style.d.ts +18 -0
- package/dist/flatbuffers/duc/dimension-ext-line-style.js +57 -0
- package/dist/flatbuffers/duc/dimension-fit-rule.d.ts +6 -0
- package/dist/flatbuffers/duc/dimension-fit-rule.js +9 -0
- package/dist/flatbuffers/duc/dimension-fit-style.d.ts +19 -0
- package/dist/flatbuffers/duc/dimension-fit-style.js +58 -0
- package/dist/flatbuffers/duc/dimension-line-style.d.ts +16 -0
- package/dist/flatbuffers/duc/dimension-line-style.js +49 -0
- package/dist/flatbuffers/duc/dimension-symbol-style.d.ts +22 -0
- package/dist/flatbuffers/duc/dimension-symbol-style.js +72 -0
- package/dist/flatbuffers/duc/dimension-text-placement.d.ts +5 -0
- package/dist/flatbuffers/duc/dimension-text-placement.js +8 -0
- package/dist/flatbuffers/duc/dimension-tolerance-style.d.ts +24 -0
- package/dist/flatbuffers/duc/dimension-tolerance-style.js +71 -0
- package/dist/flatbuffers/duc/dimension-type.d.ts +15 -0
- package/dist/flatbuffers/duc/dimension-type.js +18 -0
- package/dist/flatbuffers/duc/dimension-units-format.d.ts +7 -0
- package/dist/flatbuffers/duc/dimension-units-format.js +10 -0
- package/dist/flatbuffers/duc/dimension-validation-rules.d.ts +25 -0
- package/dist/flatbuffers/duc/dimension-validation-rules.js +74 -0
- package/dist/flatbuffers/duc/duc-arrow-element.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-arrow-element.js +49 -0
- package/dist/flatbuffers/duc/duc-block-attribute-definition-entry.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-block-attribute-definition-entry.js +44 -0
- package/dist/flatbuffers/duc/duc-block-attribute-definition.d.ts +22 -0
- package/dist/flatbuffers/duc/duc-block-attribute-definition.js +64 -0
- package/dist/flatbuffers/duc/duc-block-duplication-array.d.ts +19 -0
- package/dist/flatbuffers/duc/duc-block-duplication-array.js +64 -0
- package/dist/flatbuffers/duc/duc-block-instance-element.d.ts +30 -0
- package/dist/flatbuffers/duc/duc-block-instance-element.js +94 -0
- package/dist/flatbuffers/duc/duc-block.d.ts +34 -0
- package/dist/flatbuffers/duc/duc-block.js +111 -0
- package/dist/flatbuffers/duc/duc-common-style.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-common-style.js +44 -0
- package/dist/flatbuffers/duc/duc-dimension-element.d.ts +45 -0
- package/dist/flatbuffers/duc/duc-dimension-element.js +120 -0
- package/dist/flatbuffers/duc/duc-dimension-style.d.ts +28 -0
- package/dist/flatbuffers/duc/duc-dimension-style.js +76 -0
- package/dist/flatbuffers/duc/duc-doc-element.d.ts +33 -0
- package/dist/flatbuffers/duc/duc-doc-element.js +95 -0
- package/dist/flatbuffers/duc/duc-doc-style.d.ts +19 -0
- package/dist/flatbuffers/duc/duc-doc-style.js +52 -0
- package/dist/flatbuffers/duc/duc-element-base.d.ts +88 -0
- package/dist/flatbuffers/duc/duc-element-base.js +269 -0
- package/dist/flatbuffers/duc/duc-element-styles-base.d.ts +30 -0
- package/dist/flatbuffers/duc/duc-element-styles-base.js +103 -0
- package/dist/flatbuffers/duc/duc-ellipse-element.d.ts +22 -0
- package/dist/flatbuffers/duc/duc-ellipse-element.js +73 -0
- package/dist/flatbuffers/duc/duc-embeddable-element.d.ts +14 -0
- package/dist/flatbuffers/duc/duc-embeddable-element.js +41 -0
- package/dist/flatbuffers/duc/duc-external-file-data.d.ts +27 -0
- package/dist/flatbuffers/duc/duc-external-file-data.js +92 -0
- package/dist/flatbuffers/duc/duc-external-file-entry.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-external-file-entry.js +44 -0
- package/dist/flatbuffers/duc/duc-feature-control-frame-element.d.ts +31 -0
- package/dist/flatbuffers/duc/duc-feature-control-frame-element.js +89 -0
- package/dist/flatbuffers/duc/duc-feature-control-frame-style.d.ts +25 -0
- package/dist/flatbuffers/duc/duc-feature-control-frame-style.js +68 -0
- package/dist/flatbuffers/duc/duc-frame-element.d.ts +14 -0
- package/dist/flatbuffers/duc/duc-frame-element.js +41 -0
- package/dist/flatbuffers/duc/duc-free-draw-element.d.ts +52 -0
- package/dist/flatbuffers/duc/duc-free-draw-element.js +154 -0
- package/dist/flatbuffers/duc/duc-free-draw-ends.d.ts +18 -0
- package/dist/flatbuffers/duc/duc-free-draw-ends.js +56 -0
- package/dist/flatbuffers/duc/duc-global-state.d.ts +37 -0
- package/dist/flatbuffers/duc/duc-global-state.js +121 -0
- package/dist/flatbuffers/duc/duc-group.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-group.js +44 -0
- package/dist/flatbuffers/duc/duc-hatch-style.d.ts +28 -0
- package/dist/flatbuffers/duc/duc-hatch-style.js +79 -0
- package/dist/flatbuffers/duc/duc-head.d.ts +19 -0
- package/dist/flatbuffers/duc/duc-head.js +57 -0
- package/dist/flatbuffers/duc/duc-image-element.d.ts +35 -0
- package/dist/flatbuffers/duc/duc-image-element.js +91 -0
- package/dist/flatbuffers/duc/duc-image-filter.d.ts +15 -0
- package/dist/flatbuffers/duc/duc-image-filter.js +48 -0
- package/dist/flatbuffers/duc/duc-layer-overrides.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-layer-overrides.js +44 -0
- package/dist/flatbuffers/duc/duc-layer.d.ts +21 -0
- package/dist/flatbuffers/duc/duc-layer.js +59 -0
- package/dist/flatbuffers/duc/duc-leader-element.d.ts +22 -0
- package/dist/flatbuffers/duc/duc-leader-element.js +60 -0
- package/dist/flatbuffers/duc/duc-leader-style.d.ts +30 -0
- package/dist/flatbuffers/duc/duc-leader-style.js +87 -0
- package/dist/flatbuffers/duc/duc-line-reference.d.ts +15 -0
- package/dist/flatbuffers/duc/duc-line-reference.js +43 -0
- package/dist/flatbuffers/duc/duc-line.d.ts +15 -0
- package/dist/flatbuffers/duc/duc-line.js +43 -0
- package/dist/flatbuffers/duc/duc-linear-element-base.d.ts +38 -0
- package/dist/flatbuffers/duc/duc-linear-element-base.js +124 -0
- package/dist/flatbuffers/duc/duc-linear-element.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-linear-element.js +49 -0
- package/dist/flatbuffers/duc/duc-local-state.d.ts +68 -0
- package/dist/flatbuffers/duc/duc-local-state.js +206 -0
- package/dist/flatbuffers/duc/duc-mermaid-element.d.ts +23 -0
- package/dist/flatbuffers/duc/duc-mermaid-element.js +65 -0
- package/dist/flatbuffers/duc/duc-parametric-element.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-parametric-element.js +44 -0
- package/dist/flatbuffers/duc/duc-path.d.ts +26 -0
- package/dist/flatbuffers/duc/duc-path.js +69 -0
- package/dist/flatbuffers/duc/duc-pdf-element.d.ts +17 -0
- package/dist/flatbuffers/duc/duc-pdf-element.js +49 -0
- package/dist/flatbuffers/duc/duc-plot-element.d.ts +19 -0
- package/dist/flatbuffers/duc/duc-plot-element.js +52 -0
- package/dist/flatbuffers/duc/duc-plot-style.d.ts +14 -0
- package/dist/flatbuffers/duc/duc-plot-style.js +41 -0
- package/dist/flatbuffers/duc/duc-point-binding.d.ts +26 -0
- package/dist/flatbuffers/duc/duc-point-binding.js +73 -0
- package/dist/flatbuffers/duc/duc-point.d.ts +18 -0
- package/dist/flatbuffers/duc/duc-point.js +57 -0
- package/dist/flatbuffers/duc/duc-polygon-element.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-polygon-element.js +49 -0
- package/dist/flatbuffers/duc/duc-rectangle-element.d.ts +14 -0
- package/dist/flatbuffers/duc/duc-rectangle-element.js +41 -0
- package/dist/flatbuffers/duc/duc-region.d.ts +19 -0
- package/dist/flatbuffers/duc/duc-region.js +51 -0
- package/dist/flatbuffers/duc/duc-stack-base.d.ts +27 -0
- package/dist/flatbuffers/duc/duc-stack-base.js +78 -0
- package/dist/flatbuffers/duc/duc-stack-element-base.d.ts +23 -0
- package/dist/flatbuffers/duc/duc-stack-element-base.js +65 -0
- package/dist/flatbuffers/duc/duc-stack-like-styles.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-stack-like-styles.js +48 -0
- package/dist/flatbuffers/duc/duc-table-auto-size.d.ts +15 -0
- package/dist/flatbuffers/duc/duc-table-auto-size.js +48 -0
- package/dist/flatbuffers/duc/duc-table-cell-entry.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-table-cell-entry.js +44 -0
- package/dist/flatbuffers/duc/duc-table-cell-span.d.ts +15 -0
- package/dist/flatbuffers/duc/duc-table-cell-span.js +48 -0
- package/dist/flatbuffers/duc/duc-table-cell-style.d.ts +22 -0
- package/dist/flatbuffers/duc/duc-table-cell-style.js +59 -0
- package/dist/flatbuffers/duc/duc-table-cell.d.ts +27 -0
- package/dist/flatbuffers/duc/duc-table-cell.js +72 -0
- package/dist/flatbuffers/duc/duc-table-column-entry.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-table-column-entry.js +44 -0
- package/dist/flatbuffers/duc/duc-table-column.d.ts +18 -0
- package/dist/flatbuffers/duc/duc-table-column.js +51 -0
- package/dist/flatbuffers/duc/duc-table-element.d.ts +51 -0
- package/dist/flatbuffers/duc/duc-table-element.js +167 -0
- package/dist/flatbuffers/duc/duc-table-row-entry.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-table-row-entry.js +44 -0
- package/dist/flatbuffers/duc/duc-table-row.d.ts +18 -0
- package/dist/flatbuffers/duc/duc-table-row.js +51 -0
- package/dist/flatbuffers/duc/duc-table-style.d.ts +23 -0
- package/dist/flatbuffers/duc/duc-table-style.js +65 -0
- package/dist/flatbuffers/duc/duc-text-dynamic-dictionary-source.d.ts +14 -0
- package/dist/flatbuffers/duc/duc-text-dynamic-dictionary-source.js +40 -0
- package/dist/flatbuffers/duc/duc-text-dynamic-element-source.d.ts +17 -0
- package/dist/flatbuffers/duc/duc-text-dynamic-element-source.js +49 -0
- package/dist/flatbuffers/duc/duc-text-dynamic-part.d.ts +22 -0
- package/dist/flatbuffers/duc/duc-text-dynamic-part.js +58 -0
- package/dist/flatbuffers/duc/duc-text-dynamic-source-data.d.ts +9 -0
- package/dist/flatbuffers/duc/duc-text-dynamic-source-data.js +26 -0
- package/dist/flatbuffers/duc/duc-text-dynamic-source.d.ts +19 -0
- package/dist/flatbuffers/duc/duc-text-dynamic-source.js +58 -0
- package/dist/flatbuffers/duc/duc-text-element.d.ts +33 -0
- package/dist/flatbuffers/duc/duc-text-element.js +94 -0
- package/dist/flatbuffers/duc/duc-text-style.d.ts +44 -0
- package/dist/flatbuffers/duc/duc-text-style.js +128 -0
- package/dist/flatbuffers/duc/duc-ucs.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-ucs.js +49 -0
- package/dist/flatbuffers/duc/duc-view.d.ts +24 -0
- package/dist/flatbuffers/duc/duc-view.js +71 -0
- package/dist/flatbuffers/duc/duc-viewport-element.d.ts +36 -0
- package/dist/flatbuffers/duc/duc-viewport-element.js +102 -0
- package/dist/flatbuffers/duc/duc-viewport-style.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-viewport-style.js +49 -0
- package/dist/flatbuffers/duc/duc-xray-element.d.ts +23 -0
- package/dist/flatbuffers/duc/duc-xray-element.js +66 -0
- package/dist/flatbuffers/duc/duc-xray-style.d.ts +17 -0
- package/dist/flatbuffers/duc/duc-xray-style.js +49 -0
- package/dist/flatbuffers/duc/dynamic-snap-settings.d.ts +17 -0
- package/dist/flatbuffers/duc/dynamic-snap-settings.js +56 -0
- package/dist/flatbuffers/duc/element-background.d.ts +14 -0
- package/dist/flatbuffers/duc/element-background.js +41 -0
- package/dist/flatbuffers/duc/element-content-base.d.ts +29 -0
- package/dist/flatbuffers/duc/element-content-base.js +80 -0
- package/dist/flatbuffers/duc/element-content-preference.d.ts +8 -0
- package/dist/flatbuffers/duc/element-content-preference.js +11 -0
- package/dist/flatbuffers/duc/element-stroke.d.ts +24 -0
- package/dist/flatbuffers/duc/element-stroke.js +66 -0
- package/dist/flatbuffers/duc/element-wrapper.d.ts +16 -0
- package/dist/flatbuffers/duc/element-wrapper.js +49 -0
- package/dist/flatbuffers/duc/element.d.ts +49 -0
- package/dist/flatbuffers/duc/element.js +106 -0
- package/dist/flatbuffers/duc/exported-data-state.d.ts +87 -0
- package/dist/flatbuffers/duc/exported-data-state.js +290 -0
- package/dist/flatbuffers/duc/fcfbetween-modifier.d.ts +17 -0
- package/dist/flatbuffers/duc/fcfbetween-modifier.js +48 -0
- package/dist/flatbuffers/duc/fcfdatum-definition.d.ts +16 -0
- package/dist/flatbuffers/duc/fcfdatum-definition.js +43 -0
- package/dist/flatbuffers/duc/fcfdatum-style.d.ts +14 -0
- package/dist/flatbuffers/duc/fcfdatum-style.js +41 -0
- package/dist/flatbuffers/duc/fcfframe-modifiers.d.ts +22 -0
- package/dist/flatbuffers/duc/fcfframe-modifiers.js +65 -0
- package/dist/flatbuffers/duc/fcflayout-style.d.ts +17 -0
- package/dist/flatbuffers/duc/fcflayout-style.js +56 -0
- package/dist/flatbuffers/duc/fcfprojected-zone-modifier.d.ts +13 -0
- package/dist/flatbuffers/duc/fcfprojected-zone-modifier.js +40 -0
- package/dist/flatbuffers/duc/fcfsegment-row.d.ts +17 -0
- package/dist/flatbuffers/duc/fcfsegment-row.js +55 -0
- package/dist/flatbuffers/duc/fcfsymbol-style.d.ts +13 -0
- package/dist/flatbuffers/duc/fcfsymbol-style.js +40 -0
- package/dist/flatbuffers/duc/feature-control-frame-segment.d.ts +22 -0
- package/dist/flatbuffers/duc/feature-control-frame-segment.js +65 -0
- package/dist/flatbuffers/duc/feature-modifier.d.ts +18 -0
- package/dist/flatbuffers/duc/feature-modifier.js +21 -0
- package/dist/flatbuffers/duc/gdt-symbol.d.ts +22 -0
- package/dist/flatbuffers/duc/gdt-symbol.js +25 -0
- package/dist/flatbuffers/duc/geometric-point.d.ts +10 -0
- package/dist/flatbuffers/duc/geometric-point.js +27 -0
- package/dist/flatbuffers/duc/grid-display-type.d.ts +6 -0
- package/dist/flatbuffers/duc/grid-display-type.js +9 -0
- package/dist/flatbuffers/duc/grid-settings.d.ts +54 -0
- package/dist/flatbuffers/duc/grid-settings.js +165 -0
- package/dist/flatbuffers/duc/grid-style.d.ts +26 -0
- package/dist/flatbuffers/duc/grid-style.js +74 -0
- package/dist/flatbuffers/duc/grid-type.d.ts +7 -0
- package/dist/flatbuffers/duc/grid-type.js +10 -0
- package/dist/flatbuffers/duc/handle-type.d.ts +4 -0
- package/dist/flatbuffers/duc/handle-type.js +7 -0
- package/dist/flatbuffers/duc/hatch-pattern-line.d.ts +35 -0
- package/dist/flatbuffers/duc/hatch-pattern-line.js +93 -0
- package/dist/flatbuffers/duc/hatch-style.d.ts +5 -0
- package/dist/flatbuffers/duc/hatch-style.js +8 -0
- package/dist/flatbuffers/duc/identified-common-style.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-common-style.js +44 -0
- package/dist/flatbuffers/duc/identified-dimension-style.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-dimension-style.js +44 -0
- package/dist/flatbuffers/duc/identified-doc-style.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-doc-style.js +44 -0
- package/dist/flatbuffers/duc/identified-fcfstyle.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-fcfstyle.js +44 -0
- package/dist/flatbuffers/duc/identified-grid-settings.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-grid-settings.js +44 -0
- package/dist/flatbuffers/duc/identified-hatch-style.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-hatch-style.js +44 -0
- package/dist/flatbuffers/duc/identified-leader-style.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-leader-style.js +44 -0
- package/dist/flatbuffers/duc/identified-snap-settings.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-snap-settings.js +44 -0
- package/dist/flatbuffers/duc/identified-stack-like-style.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-stack-like-style.js +44 -0
- package/dist/flatbuffers/duc/identified-table-style.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-table-style.js +44 -0
- package/dist/flatbuffers/duc/identified-text-style.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-text-style.js +44 -0
- package/dist/flatbuffers/duc/identified-ucs.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-ucs.js +44 -0
- package/dist/flatbuffers/duc/identified-view.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-view.js +44 -0
- package/dist/flatbuffers/duc/identified-viewport-style.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-viewport-style.js +44 -0
- package/dist/flatbuffers/duc/identified-xray-style.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-xray-style.js +44 -0
- package/dist/flatbuffers/duc/identifier.d.ts +20 -0
- package/dist/flatbuffers/duc/identifier.js +57 -0
- package/dist/flatbuffers/duc/image-crop.d.ts +23 -0
- package/dist/flatbuffers/duc/image-crop.js +80 -0
- package/dist/flatbuffers/duc/image-status.d.ts +5 -0
- package/dist/flatbuffers/duc/image-status.js +8 -0
- package/dist/flatbuffers/duc/isometric-grid-settings.d.ts +15 -0
- package/dist/flatbuffers/duc/isometric-grid-settings.js +48 -0
- package/dist/flatbuffers/duc/jsonpatch-operation.d.ts +23 -0
- package/dist/flatbuffers/duc/jsonpatch-operation.js +64 -0
- package/dist/flatbuffers/duc/layer-snap-filters.d.ts +23 -0
- package/dist/flatbuffers/duc/layer-snap-filters.js +76 -0
- package/dist/flatbuffers/duc/layer-validation-rules.d.ts +17 -0
- package/dist/flatbuffers/duc/layer-validation-rules.js +54 -0
- package/dist/flatbuffers/duc/leader-block-content.d.ts +25 -0
- package/dist/flatbuffers/duc/leader-block-content.js +85 -0
- package/dist/flatbuffers/duc/leader-content-data.d.ts +9 -0
- package/dist/flatbuffers/duc/leader-content-data.js +26 -0
- package/dist/flatbuffers/duc/leader-content-type.d.ts +4 -0
- package/dist/flatbuffers/duc/leader-content-type.js +7 -0
- package/dist/flatbuffers/duc/leader-content.d.ts +19 -0
- package/dist/flatbuffers/duc/leader-content.js +58 -0
- package/dist/flatbuffers/duc/leader-text-block-content.d.ts +14 -0
- package/dist/flatbuffers/duc/leader-text-block-content.js +40 -0
- package/dist/flatbuffers/duc/line-head.d.ts +17 -0
- package/dist/flatbuffers/duc/line-head.js +20 -0
- package/dist/flatbuffers/duc/line-spacing-type.d.ts +5 -0
- package/dist/flatbuffers/duc/line-spacing-type.js +8 -0
- package/dist/flatbuffers/duc/line-spacing.d.ts +16 -0
- package/dist/flatbuffers/duc/line-spacing.js +49 -0
- package/dist/flatbuffers/duc/linear-unit-system.d.ts +24 -0
- package/dist/flatbuffers/duc/linear-unit-system.js +75 -0
- package/dist/flatbuffers/duc/margins.d.ts +19 -0
- package/dist/flatbuffers/duc/margins.js +64 -0
- package/dist/flatbuffers/duc/mark-ellipse-center.d.ts +4 -0
- package/dist/flatbuffers/duc/mark-ellipse-center.js +7 -0
- package/dist/flatbuffers/duc/material-condition.d.ts +5 -0
- package/dist/flatbuffers/duc/material-condition.js +8 -0
- package/dist/flatbuffers/duc/object-snap-mode.d.ts +22 -0
- package/dist/flatbuffers/duc/object-snap-mode.js +25 -0
- package/dist/flatbuffers/duc/paragraph-formatting.d.ts +33 -0
- package/dist/flatbuffers/duc/paragraph-formatting.js +106 -0
- package/dist/flatbuffers/duc/parametric-source-type.d.ts +4 -0
- package/dist/flatbuffers/duc/parametric-source-type.js +7 -0
- package/dist/flatbuffers/duc/parametric-source.d.ts +20 -0
- package/dist/flatbuffers/duc/parametric-source.js +57 -0
- package/dist/flatbuffers/duc/plot-layout.d.ts +14 -0
- package/dist/flatbuffers/duc/plot-layout.js +41 -0
- package/dist/flatbuffers/duc/point-binding-point.d.ts +15 -0
- package/dist/flatbuffers/duc/point-binding-point.js +48 -0
- package/dist/flatbuffers/duc/polar-grid-settings.d.ts +17 -0
- package/dist/flatbuffers/duc/polar-grid-settings.js +56 -0
- package/dist/flatbuffers/duc/polar-tracking-settings.d.ts +29 -0
- package/dist/flatbuffers/duc/polar-tracking-settings.js +90 -0
- package/dist/flatbuffers/duc/primary-units.d.ts +16 -0
- package/dist/flatbuffers/duc/primary-units.js +44 -0
- package/dist/flatbuffers/duc/pruning-level.d.ts +5 -0
- package/dist/flatbuffers/duc/pruning-level.js +8 -0
- package/dist/flatbuffers/duc/snap-marker-settings.d.ts +23 -0
- package/dist/flatbuffers/duc/snap-marker-settings.js +79 -0
- package/dist/flatbuffers/duc/snap-marker-shape.d.ts +6 -0
- package/dist/flatbuffers/duc/snap-marker-shape.js +9 -0
- package/dist/flatbuffers/duc/snap-marker-style-entry.d.ts +16 -0
- package/dist/flatbuffers/duc/snap-marker-style-entry.js +43 -0
- package/dist/flatbuffers/duc/snap-marker-style.d.ts +17 -0
- package/dist/flatbuffers/duc/snap-marker-style.js +49 -0
- package/dist/flatbuffers/duc/snap-mode.d.ts +4 -0
- package/dist/flatbuffers/duc/snap-mode.js +7 -0
- package/dist/flatbuffers/duc/snap-override-behavior.d.ts +5 -0
- package/dist/flatbuffers/duc/snap-override-behavior.js +8 -0
- package/dist/flatbuffers/duc/snap-override.d.ts +17 -0
- package/dist/flatbuffers/duc/snap-override.js +49 -0
- package/dist/flatbuffers/duc/snap-settings.d.ts +75 -0
- package/dist/flatbuffers/duc/snap-settings.js +245 -0
- package/dist/flatbuffers/duc/stack-format-properties.d.ts +18 -0
- package/dist/flatbuffers/duc/stack-format-properties.js +57 -0
- package/dist/flatbuffers/duc/stack-format.d.ts +21 -0
- package/dist/flatbuffers/duc/stack-format.js +64 -0
- package/dist/flatbuffers/duc/stacked-text-align.d.ts +5 -0
- package/dist/flatbuffers/duc/stacked-text-align.js +8 -0
- package/dist/flatbuffers/duc/standard-overrides.d.ts +63 -0
- package/dist/flatbuffers/duc/standard-overrides.js +162 -0
- package/dist/flatbuffers/duc/standard-styles.d.ts +77 -0
- package/dist/flatbuffers/duc/standard-styles.js +285 -0
- package/dist/flatbuffers/duc/standard-units.d.ts +16 -0
- package/dist/flatbuffers/duc/standard-units.js +44 -0
- package/dist/flatbuffers/duc/standard-validation.d.ts +16 -0
- package/dist/flatbuffers/duc/standard-validation.js +44 -0
- package/dist/flatbuffers/duc/standard-view-settings.d.ts +35 -0
- package/dist/flatbuffers/duc/standard-view-settings.js +124 -0
- package/dist/flatbuffers/duc/standard.d.ts +33 -0
- package/dist/flatbuffers/duc/standard.js +90 -0
- package/dist/flatbuffers/duc/string-value-entry.d.ts +17 -0
- package/dist/flatbuffers/duc/string-value-entry.js +49 -0
- package/dist/flatbuffers/duc/stroke-cap.d.ts +5 -0
- package/dist/flatbuffers/duc/stroke-cap.js +8 -0
- package/dist/flatbuffers/duc/stroke-join.d.ts +5 -0
- package/dist/flatbuffers/duc/stroke-join.js +8 -0
- package/dist/flatbuffers/duc/stroke-placement.d.ts +5 -0
- package/dist/flatbuffers/duc/stroke-placement.js +8 -0
- package/dist/flatbuffers/duc/stroke-preference.d.ts +6 -0
- package/dist/flatbuffers/duc/stroke-preference.js +9 -0
- package/dist/flatbuffers/duc/stroke-side-preference.d.ts +8 -0
- package/dist/flatbuffers/duc/stroke-side-preference.js +11 -0
- package/dist/flatbuffers/duc/stroke-sides.d.ts +24 -0
- package/dist/flatbuffers/duc/stroke-sides.js +67 -0
- package/dist/flatbuffers/duc/stroke-style.d.ts +37 -0
- package/dist/flatbuffers/duc/stroke-style.js +111 -0
- package/dist/flatbuffers/duc/stroke-width.d.ts +5 -0
- package/dist/flatbuffers/duc/stroke-width.js +8 -0
- package/dist/flatbuffers/duc/table-cell-alignment.d.ts +11 -0
- package/dist/flatbuffers/duc/table-cell-alignment.js +14 -0
- package/dist/flatbuffers/duc/table-flow-direction.d.ts +4 -0
- package/dist/flatbuffers/duc/table-flow-direction.js +7 -0
- package/dist/flatbuffers/duc/text-align.d.ts +5 -0
- package/dist/flatbuffers/duc/text-align.js +8 -0
- package/dist/flatbuffers/duc/text-column.d.ts +15 -0
- package/dist/flatbuffers/duc/text-column.js +48 -0
- package/dist/flatbuffers/duc/text-field-source-property.d.ts +13 -0
- package/dist/flatbuffers/duc/text-field-source-property.js +16 -0
- package/dist/flatbuffers/duc/text-field-source-type.d.ts +4 -0
- package/dist/flatbuffers/duc/text-field-source-type.js +7 -0
- package/dist/flatbuffers/duc/text-flow-direction.d.ts +6 -0
- package/dist/flatbuffers/duc/text-flow-direction.js +9 -0
- package/dist/flatbuffers/duc/tiling-properties.d.ts +21 -0
- package/dist/flatbuffers/duc/tiling-properties.js +75 -0
- package/dist/flatbuffers/duc/tolerance-clause.d.ts +27 -0
- package/dist/flatbuffers/duc/tolerance-clause.js +84 -0
- package/dist/flatbuffers/duc/tolerance-display.d.ts +7 -0
- package/dist/flatbuffers/duc/tolerance-display.js +10 -0
- package/dist/flatbuffers/duc/tolerance-type.d.ts +5 -0
- package/dist/flatbuffers/duc/tolerance-type.js +8 -0
- package/dist/flatbuffers/duc/tolerance-zone-type.d.ts +7 -0
- package/dist/flatbuffers/duc/tolerance-zone-type.js +10 -0
- package/dist/flatbuffers/duc/tracking-line-style.d.ts +26 -0
- package/dist/flatbuffers/duc/tracking-line-style.js +74 -0
- package/dist/flatbuffers/duc/unit-precision.d.ts +19 -0
- package/dist/flatbuffers/duc/unit-precision.js +64 -0
- package/dist/flatbuffers/duc/unit-system-base.d.ts +20 -0
- package/dist/flatbuffers/duc/unit-system-base.js +65 -0
- package/dist/flatbuffers/duc/unit-system.d.ts +4 -0
- package/dist/flatbuffers/duc/unit-system.js +7 -0
- package/dist/flatbuffers/duc/version-base.d.ts +27 -0
- package/dist/flatbuffers/duc/version-base.js +80 -0
- package/dist/flatbuffers/duc/version-graph-metadata.d.ts +15 -0
- package/dist/flatbuffers/duc/version-graph-metadata.js +48 -0
- package/dist/flatbuffers/duc/version-graph.d.ts +31 -0
- package/dist/flatbuffers/duc/version-graph.js +94 -0
- package/dist/flatbuffers/duc/vertical-align.d.ts +5 -0
- package/dist/flatbuffers/duc/vertical-align.js +8 -0
- package/dist/flatbuffers/duc/viewport-shade-plot.d.ts +6 -0
- package/dist/flatbuffers/duc/viewport-shade-plot.js +9 -0
- package/dist/flatbuffers/duc/youtube-states.d.ts +8 -0
- package/dist/flatbuffers/duc/youtube-states.js +11 -0
- package/dist/flatbuffers/duc.d.ts +227 -0
- package/dist/flatbuffers/duc.js +229 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +8 -0
- package/dist/legacy/index.d.ts +1 -0
- package/dist/legacy/index.js +1 -0
- package/dist/legacy/v1/duc/app-state.d.ts +124 -0
- package/dist/legacy/v1/duc/app-state.js +388 -0
- package/dist/legacy/v1/duc/binary-file-data.d.ts +27 -0
- package/dist/legacy/v1/duc/binary-file-data.js +90 -0
- package/dist/legacy/v1/duc/binary-files-entry.d.ts +16 -0
- package/dist/legacy/v1/duc/binary-files-entry.js +43 -0
- package/dist/legacy/v1/duc/binary-files.d.ts +17 -0
- package/dist/legacy/v1/duc/binary-files.js +55 -0
- package/dist/legacy/v1/duc/binding-point.d.ts +15 -0
- package/dist/legacy/v1/duc/binding-point.js +48 -0
- package/dist/legacy/v1/duc/bound-element.d.ts +17 -0
- package/dist/legacy/v1/duc/bound-element.js +48 -0
- package/dist/legacy/v1/duc/duc-block-attribute-details.d.ts +22 -0
- package/dist/legacy/v1/duc/duc-block-attribute-details.js +57 -0
- package/dist/legacy/v1/duc/duc-block-attribute.d.ts +16 -0
- package/dist/legacy/v1/duc/duc-block-attribute.js +43 -0
- package/dist/legacy/v1/duc/duc-block-instance-element-override.d.ts +17 -0
- package/dist/legacy/v1/duc/duc-block-instance-element-override.js +48 -0
- package/dist/legacy/v1/duc/duc-block.d.ts +34 -0
- package/dist/legacy/v1/duc/duc-block.js +110 -0
- package/dist/legacy/v1/duc/duc-element.d.ts +273 -0
- package/dist/legacy/v1/duc/duc-element.js +865 -0
- package/dist/legacy/v1/duc/duc-group.d.ts +40 -0
- package/dist/legacy/v1/duc/duc-group.js +114 -0
- package/dist/legacy/v1/duc/duc-line-reference.d.ts +15 -0
- package/dist/legacy/v1/duc/duc-line-reference.js +43 -0
- package/dist/legacy/v1/duc/duc-line.d.ts +15 -0
- package/dist/legacy/v1/duc/duc-line.js +43 -0
- package/dist/legacy/v1/duc/duc-path.d.ts +26 -0
- package/dist/legacy/v1/duc/duc-path.js +69 -0
- package/dist/legacy/v1/duc/duc-table-cell.d.ts +22 -0
- package/dist/legacy/v1/duc/duc-table-cell.js +57 -0
- package/dist/legacy/v1/duc/duc-table-column.d.ts +18 -0
- package/dist/legacy/v1/duc/duc-table-column.js +50 -0
- package/dist/legacy/v1/duc/duc-table-row.d.ts +18 -0
- package/dist/legacy/v1/duc/duc-table-row.js +50 -0
- package/dist/legacy/v1/duc/duc-table-style-props.d.ts +39 -0
- package/dist/legacy/v1/duc/duc-table-style-props.js +114 -0
- package/dist/legacy/v1/duc/duc-table-style.d.ts +14 -0
- package/dist/legacy/v1/duc/duc-table-style.js +41 -0
- package/dist/legacy/v1/duc/element-background.d.ts +14 -0
- package/dist/legacy/v1/duc/element-background.js +41 -0
- package/dist/legacy/v1/duc/element-content-base.d.ts +22 -0
- package/dist/legacy/v1/duc/element-content-base.js +64 -0
- package/dist/legacy/v1/duc/element-stroke.d.ts +23 -0
- package/dist/legacy/v1/duc/element-stroke.js +66 -0
- package/dist/legacy/v1/duc/exported-data-state.d.ts +51 -0
- package/dist/legacy/v1/duc/exported-data-state.js +155 -0
- package/dist/legacy/v1/duc/image-crop.d.ts +23 -0
- package/dist/legacy/v1/duc/image-crop.js +80 -0
- package/dist/legacy/v1/duc/linear-element-editor.d.ts +44 -0
- package/dist/legacy/v1/duc/linear-element-editor.js +119 -0
- package/dist/legacy/v1/duc/point-binding.d.ts +25 -0
- package/dist/legacy/v1/duc/point-binding.js +72 -0
- package/dist/legacy/v1/duc/point.d.ts +20 -0
- package/dist/legacy/v1/duc/point.js +63 -0
- package/dist/legacy/v1/duc/pointer-down-state.d.ts +32 -0
- package/dist/legacy/v1/duc/pointer-down-state.js +90 -0
- package/dist/legacy/v1/duc/renderer-state.d.ts +17 -0
- package/dist/legacy/v1/duc/renderer-state.js +54 -0
- package/dist/legacy/v1/duc/segment-midpoint-state.d.ts +18 -0
- package/dist/legacy/v1/duc/segment-midpoint-state.js +57 -0
- package/dist/legacy/v1/duc/simple-point.d.ts +15 -0
- package/dist/legacy/v1/duc/simple-point.js +48 -0
- package/dist/legacy/v1/duc/stroke-sides.d.ts +23 -0
- package/dist/legacy/v1/duc/stroke-sides.js +66 -0
- package/dist/legacy/v1/duc/stroke-style.d.ts +31 -0
- package/dist/legacy/v1/duc/stroke-style.js +102 -0
- package/dist/legacy/v1/duc/tiling-properties.d.ts +21 -0
- package/dist/legacy/v1/duc/tiling-properties.js +75 -0
- package/dist/legacy/v1/duc.d.ts +35 -0
- package/dist/legacy/v1/duc.js +37 -0
- package/dist/legacy/v1/index.d.ts +1 -0
- package/dist/legacy/v1/index.js +1 -0
- package/dist/legacy/v1/parse/index.d.ts +67 -0
- package/dist/legacy/v1/parse/index.js +101 -0
- package/dist/legacy/v1/parse/parseAppStateFromBinary.d.ts +3 -0
- package/dist/legacy/v1/parse/parseAppStateFromBinary.js +139 -0
- package/dist/legacy/v1/parse/parseBinaryFilesFromBinary.d.ts +4 -0
- package/dist/legacy/v1/parse/parseBinaryFilesFromBinary.js +32 -0
- package/dist/legacy/v1/parse/parseBlockFromBinary.d.ts +3 -0
- package/dist/legacy/v1/parse/parseBlockFromBinary.js +70 -0
- package/dist/legacy/v1/parse/parseElementFromBinary.d.ts +8 -0
- package/dist/legacy/v1/parse/parseElementFromBinary.js +387 -0
- package/dist/legacy/v1/parse/parseGroupFromBinary.d.ts +4 -0
- package/dist/legacy/v1/parse/parseGroupFromBinary.js +36 -0
- package/dist/legacy/v1/parse/parseRendererStateFromBinary.d.ts +4 -0
- package/dist/legacy/v1/parse/parseRendererStateFromBinary.js +15 -0
- package/dist/legacy/v1/serialize/index.d.ts +5 -0
- package/dist/legacy/v1/serialize/index.js +81 -0
- package/dist/legacy/v1/serialize/serializationUtils.d.ts +17 -0
- package/dist/legacy/v1/serialize/serializationUtils.js +27 -0
- package/dist/legacy/v1/serialize/serializeAppStateFromDuc.d.ts +4 -0
- package/dist/legacy/v1/serialize/serializeAppStateFromDuc.js +145 -0
- package/dist/legacy/v1/serialize/serializeBinaryFilesFromDuc.d.ts +4 -0
- package/dist/legacy/v1/serialize/serializeBinaryFilesFromDuc.js +46 -0
- package/dist/legacy/v1/serialize/serializeBlockFromDuc.d.ts +3 -0
- package/dist/legacy/v1/serialize/serializeBlockFromDuc.js +60 -0
- package/dist/legacy/v1/serialize/serializeElementFromDuc.d.ts +8 -0
- package/dist/legacy/v1/serialize/serializeElementFromDuc.js +435 -0
- package/dist/legacy/v1/serialize/serializeGroupFromDuc.d.ts +3 -0
- package/dist/legacy/v1/serialize/serializeGroupFromDuc.js +37 -0
- package/dist/legacy/v1/serialize/serializeRendererStateFromDuc.d.ts +4 -0
- package/dist/legacy/v1/serialize/serializeRendererStateFromDuc.js +7 -0
- package/dist/legacy/v1/types/elements/index.d.ts +480 -0
- package/dist/legacy/v1/types/elements/index.js +1 -0
- package/dist/legacy/v1/types/elements/typeChecks.d.ts +40 -0
- package/dist/legacy/v1/types/elements/typeChecks.js +179 -0
- package/dist/legacy/v1/types/geometryTypes.d.ts +78 -0
- package/dist/legacy/v1/types/geometryTypes.js +1 -0
- package/dist/legacy/v1/types/index.d.ts +496 -0
- package/dist/legacy/v1/types/index.js +1 -0
- package/dist/legacy/v1/types/utility-types.d.ts +31 -0
- package/dist/legacy/v1/types/utility-types.js +1 -0
- package/dist/legacy/v1/utils/bounds.d.ts +76 -0
- package/dist/legacy/v1/utils/bounds.js +415 -0
- package/dist/legacy/v1/utils/constants.d.ts +370 -0
- package/dist/legacy/v1/utils/constants.js +571 -0
- package/dist/legacy/v1/utils/elements/index.d.ts +26 -0
- package/dist/legacy/v1/utils/elements/index.js +108 -0
- package/dist/legacy/v1/utils/elements/linearElement.d.ts +133 -0
- package/dist/legacy/v1/utils/elements/linearElement.js +544 -0
- package/dist/legacy/v1/utils/elements/textElement.d.ts +89 -0
- package/dist/legacy/v1/utils/elements/textElement.js +563 -0
- package/dist/legacy/v1/utils/index.d.ts +26 -0
- package/dist/legacy/v1/utils/index.js +40 -0
- package/dist/legacy/v1/utils/math/algebra/ga.d.ts +63 -0
- package/dist/legacy/v1/utils/math/algebra/ga.js +268 -0
- package/dist/legacy/v1/utils/math/algebra/gadirections.d.ts +9 -0
- package/dist/legacy/v1/utils/math/algebra/gadirections.js +18 -0
- package/dist/legacy/v1/utils/math/algebra/galines.d.ts +23 -0
- package/dist/legacy/v1/utils/math/algebra/galines.js +32 -0
- package/dist/legacy/v1/utils/math/algebra/gapoints.d.ts +8 -0
- package/dist/legacy/v1/utils/math/algebra/gapoints.js +30 -0
- package/dist/legacy/v1/utils/math/algebra/gatransforms.d.ts +10 -0
- package/dist/legacy/v1/utils/math/algebra/gatransforms.js +23 -0
- package/dist/legacy/v1/utils/math/bbox.d.ts +10 -0
- package/dist/legacy/v1/utils/math/bbox.js +42 -0
- package/dist/legacy/v1/utils/math/geometry.d.ts +102 -0
- package/dist/legacy/v1/utils/math/geometry.js +790 -0
- package/dist/legacy/v1/utils/math/index.d.ts +309 -0
- package/dist/legacy/v1/utils/math/index.js +1140 -0
- package/dist/legacy/v1/utils/math/random.d.ts +4 -0
- package/dist/legacy/v1/utils/math/random.js +25 -0
- package/dist/legacy/v1/utils/measurements.d.ts +33 -0
- package/dist/legacy/v1/utils/measurements.js +65 -0
- package/dist/legacy/v1/utils/normalize.d.ts +14 -0
- package/dist/legacy/v1/utils/normalize.js +49 -0
- package/dist/legacy/v1/utils/restore.d.ts +197 -0
- package/dist/legacy/v1/utils/restore.js +1255 -0
- package/dist/legacy/v1/utils/scopes.d.ts +260 -0
- package/dist/legacy/v1/utils/scopes.js +661 -0
- package/dist/legacy/v1/utils/standards.d.ts +12 -0
- package/dist/legacy/v1/utils/standards.js +10 -0
- package/dist/legacy/v1/utils/state/index.d.ts +2 -0
- package/dist/legacy/v1/utils/state/index.js +68 -0
- package/dist/legacy/v1/utils/url.d.ts +8 -0
- package/dist/legacy/v1/utils/url.js +33 -0
- package/dist/parse.d.ts +54 -0
- package/dist/parse.js +1318 -0
- package/dist/restore/index.d.ts +3 -0
- package/dist/restore/index.js +3 -0
- package/dist/restore/restoreDataState.d.ts +191 -0
- package/dist/restore/restoreDataState.js +716 -0
- package/dist/restore/restoreElements.d.ts +34 -0
- package/dist/restore/restoreElements.js +1281 -0
- package/dist/restore/restoreStandards.d.ts +8 -0
- package/dist/restore/restoreStandards.js +224 -0
- package/dist/serialize.d.ts +3 -0
- package/dist/serialize.js +2465 -0
- package/dist/technical/index.d.ts +3 -0
- package/dist/technical/index.js +3 -0
- package/dist/technical/measurements.d.ts +31 -0
- package/dist/technical/measurements.js +64 -0
- package/dist/technical/scopes.d.ts +261 -0
- package/dist/technical/scopes.js +661 -0
- package/dist/technical/standards.d.ts +124 -0
- package/dist/technical/standards.js +10 -0
- package/dist/types/elements/index.d.ts +1356 -0
- package/dist/types/elements/index.js +1 -0
- package/dist/types/elements/typeChecks.d.ts +40 -0
- package/dist/types/elements/typeChecks.js +188 -0
- package/dist/types/geometryTypes.d.ts +90 -0
- package/dist/types/geometryTypes.js +1 -0
- package/dist/types/index.d.ts +591 -0
- package/dist/types/index.js +3 -0
- package/dist/types/utility-types.d.ts +31 -0
- package/dist/types/utility-types.js +1 -0
- package/dist/utils/bounds.d.ts +75 -0
- package/dist/utils/bounds.js +414 -0
- package/dist/utils/constants.d.ts +288 -0
- package/dist/utils/constants.js +529 -0
- package/dist/utils/elements/frameElement.d.ts +4 -0
- package/dist/utils/elements/frameElement.js +16 -0
- package/dist/utils/elements/freedrawElement.d.ts +2 -0
- package/dist/utils/elements/freedrawElement.js +46 -0
- package/dist/utils/elements/index.d.ts +51 -0
- package/dist/utils/elements/index.js +215 -0
- package/dist/utils/elements/linearElement.d.ts +53 -0
- package/dist/utils/elements/linearElement.js +539 -0
- package/dist/utils/elements/newElement.d.ts +72 -0
- package/dist/utils/elements/newElement.js +268 -0
- package/dist/utils/elements/textElement.d.ts +89 -0
- package/dist/utils/elements/textElement.js +565 -0
- package/dist/utils/elements/viewportElement.d.ts +6 -0
- package/dist/utils/elements/viewportElement.js +9 -0
- package/dist/utils/filebyte.d.ts +39 -0
- package/dist/utils/filebyte.js +117 -0
- package/dist/utils/functionCodec.d.ts +5 -0
- package/dist/utils/functionCodec.js +86 -0
- package/dist/utils/index.d.ts +32 -0
- package/dist/utils/index.js +53 -0
- package/dist/utils/math/algebra/ga.d.ts +63 -0
- package/dist/utils/math/algebra/ga.js +268 -0
- package/dist/utils/math/algebra/gadirections.d.ts +9 -0
- package/dist/utils/math/algebra/gadirections.js +18 -0
- package/dist/utils/math/algebra/galines.d.ts +23 -0
- package/dist/utils/math/algebra/galines.js +32 -0
- package/dist/utils/math/algebra/gapoints.d.ts +8 -0
- package/dist/utils/math/algebra/gapoints.js +30 -0
- package/dist/utils/math/algebra/gatransforms.d.ts +10 -0
- package/dist/utils/math/algebra/gatransforms.js +23 -0
- package/dist/utils/math/algebra/index.d.ts +5 -0
- package/dist/utils/math/algebra/index.js +5 -0
- package/dist/utils/math/bbox.d.ts +10 -0
- package/dist/utils/math/bbox.js +42 -0
- package/dist/utils/math/geometry.d.ts +102 -0
- package/dist/utils/math/geometry.js +790 -0
- package/dist/utils/math/index.d.ts +323 -0
- package/dist/utils/math/index.js +1188 -0
- package/dist/utils/math/random.d.ts +4 -0
- package/dist/utils/math/random.js +25 -0
- package/dist/utils/normalize.d.ts +14 -0
- package/dist/utils/normalize.js +49 -0
- package/dist/utils/shape.d.ts +15 -0
- package/dist/utils/shape.js +254 -0
- package/dist/utils/state/grid.d.ts +7 -0
- package/dist/utils/state/grid.js +25 -0
- package/dist/utils/state/index.d.ts +9 -0
- package/dist/utils/state/index.js +131 -0
- package/dist/utils/url.d.ts +8 -0
- package/dist/utils/url.js +33 -0
- package/dist/utils/version.d.ts +1 -0
- package/dist/utils/version.js +1 -0
- package/package.json +79 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { DucState, RawValue, Scope, ScopedValue } from "ducjs/legacy/v1/types";
|
|
2
|
+
import { DucElement, DucElementType, DucTextContainer, DucTextElement, DucTextElementWithContainer, ElementsMap, FontFamilyValues, FontString, NonDeletedDucElement } from "ducjs/legacy/v1/types/elements";
|
|
3
|
+
import { GeometricPoint } from "ducjs/legacy/v1/types/geometryTypes";
|
|
4
|
+
import { ExtractSetType } from "ducjs/legacy/v1/types/utility-types";
|
|
5
|
+
import { getBoundTextElementPosition } from "ducjs/legacy/v1/utils/elements/linearElement";
|
|
6
|
+
import { SupportedMeasures } from "ducjs/legacy/v1/utils/scopes";
|
|
7
|
+
export declare const computeBoundTextPosition: (container: DucElement, boundTextElement: DucTextElementWithContainer, elementsMap: ElementsMap, currentScope: SupportedMeasures) => {
|
|
8
|
+
x: ScopedValue;
|
|
9
|
+
y: ScopedValue;
|
|
10
|
+
};
|
|
11
|
+
export declare const measureText: (text: string, font: FontString, lineHeight: DucTextElement["lineHeight"], currentScope: Scope) => {
|
|
12
|
+
width: RawValue;
|
|
13
|
+
height: RawValue;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* We calculate the line height from the font size and the unitless line height,
|
|
17
|
+
* aligning with the W3C spec.
|
|
18
|
+
*/
|
|
19
|
+
export declare const getLineHeightInPx: (fontSize: DucTextElement["fontSize"], lineHeight: DucTextElement["lineHeight"]) => RawValue;
|
|
20
|
+
export declare const getApproxMinLineHeight: (fontSize: DucTextElement["fontSize"], lineHeight: DucTextElement["lineHeight"]) => RawValue;
|
|
21
|
+
export declare const getTextWidth: (text: string, font: FontString, forceAdvanceWidth?: true) => RawValue;
|
|
22
|
+
export declare const getTextHeight: (text: DucTextElement["text"], fontSize: DucTextElement["fontSize"], lineHeight: DucTextElement["lineHeight"]) => RawValue;
|
|
23
|
+
export declare const parseTokens: (text: string) => string[];
|
|
24
|
+
export declare const wrapText: (text: string, font: FontString, maxWidth: number) => string;
|
|
25
|
+
export declare const charWidth: {
|
|
26
|
+
calculate: (char: string, font: FontString) => number;
|
|
27
|
+
getCache: (font: FontString) => number[];
|
|
28
|
+
};
|
|
29
|
+
export declare const getApproxMinLineWidth: (font: FontString, lineHeight: DucTextElement["lineHeight"], currentScope: SupportedMeasures) => RawValue;
|
|
30
|
+
export declare const getMinCharWidth: (font: FontString) => RawValue;
|
|
31
|
+
export declare const getMaxCharWidth: (font: FontString) => RawValue;
|
|
32
|
+
export declare const getContainerCenter: (container: DucElement, DucState: DucState, elementsMap: ElementsMap) => GeometricPoint;
|
|
33
|
+
export declare const getContainerCoords: (container: NonDeletedDucElement) => {
|
|
34
|
+
x: RawValue;
|
|
35
|
+
y: RawValue;
|
|
36
|
+
};
|
|
37
|
+
export declare const getTextElementAngle: (textElement: DucTextElement, container: DucTextContainer | null) => import("ducjs/legacy/v1/types/geometryTypes").Radian;
|
|
38
|
+
export declare const shouldAllowVerticalAlign: (selectedElements: NonDeletedDucElement[], elementsMap: ElementsMap) => boolean;
|
|
39
|
+
export declare const suppportsHorizontalAlign: (selectedElements: NonDeletedDucElement[], elementsMap: ElementsMap) => boolean;
|
|
40
|
+
declare const VALID_CONTAINER_TYPES: Set<string>;
|
|
41
|
+
export declare const isValidTextContainer: (element: {
|
|
42
|
+
type: DucElementType;
|
|
43
|
+
}) => boolean;
|
|
44
|
+
export declare const computeContainerDimensionForBoundText: (dimension: RawValue, containerType: ExtractSetType<typeof VALID_CONTAINER_TYPES>) => RawValue;
|
|
45
|
+
export declare const getBoundTextMaxWidth: (container: DucElement, boundTextElement: DucTextElement | null) => RawValue;
|
|
46
|
+
export declare const getBoundTextMaxHeight: (container: DucElement, boundTextElement: DucTextElementWithContainer) => RawValue;
|
|
47
|
+
export declare const isMeasureTextSupported: (currentScope: SupportedMeasures) => boolean;
|
|
48
|
+
export declare const getMinTextElementWidth: (font: FontString, lineHeight: DucTextElement["lineHeight"], currentScope: SupportedMeasures) => RawValue;
|
|
49
|
+
/** retrieves text from text elements and concatenates to a single string */
|
|
50
|
+
export declare const getTextFromElements: (elements: readonly DucElement[], separator?: string) => string;
|
|
51
|
+
export declare const getFontFamilyString: ({ fontFamily, }: {
|
|
52
|
+
fontFamily: FontFamilyValues;
|
|
53
|
+
}) => string;
|
|
54
|
+
/** returns fontSize+fontFamily string for assignment to DOM elements */
|
|
55
|
+
export declare const getFontString: ({ fontSize, fontFamily, }: {
|
|
56
|
+
fontSize: DucTextElement["fontSize"];
|
|
57
|
+
fontFamily: FontFamilyValues;
|
|
58
|
+
}) => FontString;
|
|
59
|
+
/** computes element x/y offset based on textAlign/verticalAlign */
|
|
60
|
+
export declare const getTextElementPositionOffsets: (opts: {
|
|
61
|
+
textAlign: DucTextElement["textAlign"];
|
|
62
|
+
verticalAlign: DucTextElement["verticalAlign"];
|
|
63
|
+
}, metrics: {
|
|
64
|
+
width: RawValue;
|
|
65
|
+
height: RawValue;
|
|
66
|
+
}) => {
|
|
67
|
+
x: number;
|
|
68
|
+
y: number;
|
|
69
|
+
};
|
|
70
|
+
export declare const refreshTextDimensions: (textElement: DucTextElement, container: DucTextContainer | null, elementsMap: ElementsMap, currentScope: Scope, text?: string) => {
|
|
71
|
+
x: RawValue;
|
|
72
|
+
y: RawValue;
|
|
73
|
+
width: RawValue;
|
|
74
|
+
height: RawValue;
|
|
75
|
+
text: string;
|
|
76
|
+
} | undefined;
|
|
77
|
+
export declare const splitIntoLines: (text: string) => string[];
|
|
78
|
+
/**
|
|
79
|
+
* To get unitless line-height (if unknown) we can calculate it by dividing
|
|
80
|
+
* height-per-line by fontSize.
|
|
81
|
+
*/
|
|
82
|
+
export declare const detectLineHeight: (textElement: DucTextElement) => DucTextElement["lineHeight"];
|
|
83
|
+
export declare const getAdjustedDimensions: (element: DucTextElement, elementsMap: ElementsMap, nextText: string, currentScope: Scope) => {
|
|
84
|
+
x: RawValue;
|
|
85
|
+
y: RawValue;
|
|
86
|
+
width: RawValue;
|
|
87
|
+
height: RawValue;
|
|
88
|
+
};
|
|
89
|
+
export { getBoundTextElementPosition };
|
|
@@ -0,0 +1,563 @@
|
|
|
1
|
+
import { isArrowElement, isBoundToContainer, isTextElement } from "ducjs/legacy/v1/types/elements/typeChecks";
|
|
2
|
+
import { getContainerElement, getElementAbsoluteCoords, getResizedElementAbsoluteCoords } from "ducjs/legacy/v1/utils/bounds";
|
|
3
|
+
import { ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO, ARROW_LABEL_WIDTH_FRACTION, BOUND_TEXT_PADDING, DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE, FONT_FAMILY, TEXT_ALIGN, VERTICAL_ALIGN, WINDOWS_EMOJI_FALLBACK_FONT } from "ducjs/legacy/v1/utils/constants";
|
|
4
|
+
import { getBoundTextElementPosition, getPointGlobalCoordinates, getPointsGlobalCoordinates, getSegmentMidPoint } from "ducjs/legacy/v1/utils/elements/linearElement";
|
|
5
|
+
import { adjustXYWithRotation } from "ducjs/legacy/v1/utils/math";
|
|
6
|
+
import { normalizeText } from "ducjs/legacy/v1/utils/normalize";
|
|
7
|
+
import { getPrecisionValueFromRaw, getScopedBezierPointFromDucPoint } from "ducjs/legacy/v1/utils/scopes";
|
|
8
|
+
export const computeBoundTextPosition = (container, boundTextElement, elementsMap, currentScope) => {
|
|
9
|
+
if (isArrowElement(container)) {
|
|
10
|
+
const coords = getBoundTextElementPosition(container, boundTextElement, elementsMap, currentScope);
|
|
11
|
+
if (coords === null) {
|
|
12
|
+
return {
|
|
13
|
+
x: getPrecisionValueFromRaw(0, boundTextElement.scope, currentScope).scoped,
|
|
14
|
+
y: getPrecisionValueFromRaw(0, boundTextElement.scope, currentScope).scoped,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
return { x: coords.x, y: coords.y };
|
|
18
|
+
}
|
|
19
|
+
const containerCoords = getContainerCoords(container);
|
|
20
|
+
const maxContainerHeight = getBoundTextMaxHeight(container, boundTextElement);
|
|
21
|
+
const maxContainerWidth = getBoundTextMaxWidth(container, boundTextElement);
|
|
22
|
+
let x;
|
|
23
|
+
let y;
|
|
24
|
+
if (boundTextElement.verticalAlign === VERTICAL_ALIGN.TOP) {
|
|
25
|
+
y = containerCoords.y;
|
|
26
|
+
}
|
|
27
|
+
else if (boundTextElement.verticalAlign === VERTICAL_ALIGN.BOTTOM) {
|
|
28
|
+
y = containerCoords.y + (maxContainerHeight - boundTextElement.height.value);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
y =
|
|
32
|
+
containerCoords.y +
|
|
33
|
+
(maxContainerHeight / 2 - boundTextElement.height.value / 2);
|
|
34
|
+
}
|
|
35
|
+
if (boundTextElement.textAlign === TEXT_ALIGN.LEFT) {
|
|
36
|
+
x = containerCoords.x;
|
|
37
|
+
}
|
|
38
|
+
else if (boundTextElement.textAlign === TEXT_ALIGN.RIGHT) {
|
|
39
|
+
x = containerCoords.x + (maxContainerWidth - boundTextElement.width.value);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
x =
|
|
43
|
+
containerCoords.x + (maxContainerWidth / 2 - boundTextElement.width.value / 2);
|
|
44
|
+
}
|
|
45
|
+
const xValue = getPrecisionValueFromRaw(x, boundTextElement.scope, currentScope);
|
|
46
|
+
const yValue = getPrecisionValueFromRaw(y, boundTextElement.scope, currentScope);
|
|
47
|
+
return { x: xValue.scoped, y: yValue.scoped };
|
|
48
|
+
};
|
|
49
|
+
export const measureText = (text, font, lineHeight, currentScope) => {
|
|
50
|
+
text = text
|
|
51
|
+
.split("\n")
|
|
52
|
+
// replace empty lines with single space because leading/trailing empty
|
|
53
|
+
// lines would be stripped from computation
|
|
54
|
+
.map((x) => x || " ")
|
|
55
|
+
.join("\n");
|
|
56
|
+
const fontSize = getPrecisionValueFromRaw(parseFloat(font), currentScope, currentScope);
|
|
57
|
+
const height = getTextHeight(text, fontSize, lineHeight);
|
|
58
|
+
const width = getTextWidth(text, font);
|
|
59
|
+
return { width, height };
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* We calculate the line height from the font size and the unitless line height,
|
|
63
|
+
* aligning with the W3C spec.
|
|
64
|
+
*/
|
|
65
|
+
export const getLineHeightInPx = (fontSize, lineHeight) => {
|
|
66
|
+
return fontSize.value * lineHeight;
|
|
67
|
+
};
|
|
68
|
+
// FIXME rename to getApproxMinContainerHeight
|
|
69
|
+
export const getApproxMinLineHeight = (fontSize, lineHeight) => {
|
|
70
|
+
return getLineHeightInPx(fontSize, lineHeight) + (BOUND_TEXT_PADDING * 2);
|
|
71
|
+
};
|
|
72
|
+
let canvas;
|
|
73
|
+
/**
|
|
74
|
+
* @param forceAdvanceWidth use to force retrieve the "advance width" ~ `metrics.width`, instead of the actual boundind box width.
|
|
75
|
+
*
|
|
76
|
+
* > The advance width is the distance between the glyph's initial pen position and the next glyph's initial pen position.
|
|
77
|
+
*
|
|
78
|
+
* We need to use the advance width as that's the closest thing to the browser wrapping algo, hence using it for:
|
|
79
|
+
* - text wrapping
|
|
80
|
+
* - wysiwyg editor (+padding)
|
|
81
|
+
*
|
|
82
|
+
* Everything else should be based on the actual bounding box width.
|
|
83
|
+
*
|
|
84
|
+
* `Math.ceil` of the final width adds additional buffer which stabilizes slight wrapping incosistencies.
|
|
85
|
+
*/
|
|
86
|
+
const getLineWidth = (text, font, forceAdvanceWidth, isTestEnv) => {
|
|
87
|
+
if (!canvas) {
|
|
88
|
+
canvas = document.createElement("canvas");
|
|
89
|
+
}
|
|
90
|
+
const canvas2dContext = canvas.getContext("2d");
|
|
91
|
+
canvas2dContext.font = font;
|
|
92
|
+
const metrics = canvas2dContext.measureText(text);
|
|
93
|
+
const advanceWidth = metrics.width;
|
|
94
|
+
// retrieve the actual bounding box width if these metrics are available (as of now > 95% coverage)
|
|
95
|
+
if (!forceAdvanceWidth &&
|
|
96
|
+
window.TextMetrics &&
|
|
97
|
+
"actualBoundingBoxLeft" in window.TextMetrics.prototype &&
|
|
98
|
+
"actualBoundingBoxRight" in window.TextMetrics.prototype) {
|
|
99
|
+
// could be negative, therefore getting the absolute value
|
|
100
|
+
const actualWidth = Math.abs(metrics.actualBoundingBoxLeft) +
|
|
101
|
+
Math.abs(metrics.actualBoundingBoxRight);
|
|
102
|
+
// fallback to advance width if the actual width is zero, i.e. on text editing start
|
|
103
|
+
// or when actual width does not respect whitespace chars, i.e. spaces
|
|
104
|
+
// otherwise actual width should always be bigger
|
|
105
|
+
return Math.max(actualWidth, advanceWidth);
|
|
106
|
+
}
|
|
107
|
+
// since in test env the canvas measureText algo
|
|
108
|
+
// doesn't measure text and instead just returns number of
|
|
109
|
+
// characters hence we assume that each letteris 10px
|
|
110
|
+
if (isTestEnv) {
|
|
111
|
+
return advanceWidth * 10;
|
|
112
|
+
}
|
|
113
|
+
return advanceWidth;
|
|
114
|
+
};
|
|
115
|
+
export const getTextWidth = (text, font, forceAdvanceWidth) => {
|
|
116
|
+
const lines = splitIntoLines(text);
|
|
117
|
+
let width = 0;
|
|
118
|
+
lines.forEach((line) => {
|
|
119
|
+
width = Math.max(width, getLineWidth(line, font, forceAdvanceWidth));
|
|
120
|
+
});
|
|
121
|
+
return width;
|
|
122
|
+
};
|
|
123
|
+
export const getTextHeight = (text, fontSize, lineHeight) => {
|
|
124
|
+
const lineCount = splitIntoLines(text).length;
|
|
125
|
+
return getLineHeightInPx(fontSize, lineHeight) * lineCount;
|
|
126
|
+
};
|
|
127
|
+
export const parseTokens = (text) => {
|
|
128
|
+
// Splitting words containing "-" as those are treated as separate words
|
|
129
|
+
// by css wrapping algorithm eg non-profit => non-, profit
|
|
130
|
+
const words = text.split("-");
|
|
131
|
+
if (words.length > 1) {
|
|
132
|
+
// non-proft org => ['non-', 'profit org']
|
|
133
|
+
words.forEach((word, index) => {
|
|
134
|
+
if (index !== words.length - 1) {
|
|
135
|
+
words[index] = word += "-";
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
// Joining the words with space and splitting them again with space to get the
|
|
140
|
+
// final list of tokens
|
|
141
|
+
// ['non-', 'profit org'] =>,'non- proft org' => ['non-','profit','org']
|
|
142
|
+
return words.join(" ").split(" ");
|
|
143
|
+
};
|
|
144
|
+
export const wrapText = (text, font, maxWidth) => {
|
|
145
|
+
// if maxWidth is not finite or NaN which can happen in case of bugs in
|
|
146
|
+
// computation, we need to make sure we don't continue as we'll end up
|
|
147
|
+
// in an infinite loop
|
|
148
|
+
if (!Number.isFinite(maxWidth) || maxWidth < 0) {
|
|
149
|
+
return text;
|
|
150
|
+
}
|
|
151
|
+
const lines = [];
|
|
152
|
+
const originalLines = text.split("\n");
|
|
153
|
+
const spaceAdvanceWidth = getLineWidth(" ", font, true);
|
|
154
|
+
let currentLine = "";
|
|
155
|
+
let currentLineWidthTillNow = 0;
|
|
156
|
+
const push = (str) => {
|
|
157
|
+
if (str.trim()) {
|
|
158
|
+
lines.push(str);
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
const resetParams = () => {
|
|
162
|
+
currentLine = "";
|
|
163
|
+
currentLineWidthTillNow = 0;
|
|
164
|
+
};
|
|
165
|
+
for (const originalLine of originalLines) {
|
|
166
|
+
const currentLineWidth = getLineWidth(originalLine, font, true);
|
|
167
|
+
// Push the line if its <= maxWidth
|
|
168
|
+
if (currentLineWidth <= maxWidth) {
|
|
169
|
+
lines.push(originalLine);
|
|
170
|
+
continue;
|
|
171
|
+
}
|
|
172
|
+
const words = parseTokens(originalLine);
|
|
173
|
+
resetParams();
|
|
174
|
+
let index = 0;
|
|
175
|
+
while (index < words.length) {
|
|
176
|
+
const currentWordWidth = getLineWidth(words[index], font, true);
|
|
177
|
+
// This will only happen when single word takes entire width
|
|
178
|
+
if (currentWordWidth === maxWidth) {
|
|
179
|
+
push(words[index]);
|
|
180
|
+
index++;
|
|
181
|
+
}
|
|
182
|
+
// Start breaking longer words exceeding max width
|
|
183
|
+
else if (currentWordWidth > maxWidth) {
|
|
184
|
+
// push current line since the current word exceeds the max width
|
|
185
|
+
// so will be appended in next line
|
|
186
|
+
push(currentLine);
|
|
187
|
+
resetParams();
|
|
188
|
+
while (words[index].length > 0) {
|
|
189
|
+
const currentChar = String.fromCodePoint(words[index].codePointAt(0));
|
|
190
|
+
const line = currentLine + currentChar;
|
|
191
|
+
// use advance width instead of the actual width as it's closest to the browser wapping algo
|
|
192
|
+
// use width of the whole line instead of calculating individual chars to accomodate for kerning
|
|
193
|
+
const lineAdvanceWidth = getLineWidth(line, font, true);
|
|
194
|
+
const charAdvanceWidth = charWidth.calculate(currentChar, font);
|
|
195
|
+
currentLineWidthTillNow = lineAdvanceWidth;
|
|
196
|
+
words[index] = words[index].slice(currentChar.length);
|
|
197
|
+
if (currentLineWidthTillNow >= maxWidth) {
|
|
198
|
+
push(currentLine);
|
|
199
|
+
currentLine = currentChar;
|
|
200
|
+
currentLineWidthTillNow = charAdvanceWidth;
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
currentLine = line;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
// push current line if appending space exceeds max width
|
|
207
|
+
if (currentLineWidthTillNow + spaceAdvanceWidth >= maxWidth) {
|
|
208
|
+
push(currentLine);
|
|
209
|
+
resetParams();
|
|
210
|
+
// space needs to be appended before next word
|
|
211
|
+
// as currentLine contains chars which couldn't be appended
|
|
212
|
+
// to previous line unless the line ends with hyphen to sync
|
|
213
|
+
// with css word-wrap
|
|
214
|
+
}
|
|
215
|
+
else if (!currentLine.endsWith("-")) {
|
|
216
|
+
currentLine += " ";
|
|
217
|
+
currentLineWidthTillNow += spaceAdvanceWidth;
|
|
218
|
+
}
|
|
219
|
+
index++;
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
// Start appending words in a line till max width reached
|
|
223
|
+
while (currentLineWidthTillNow < maxWidth && index < words.length) {
|
|
224
|
+
const word = words[index];
|
|
225
|
+
currentLineWidthTillNow = getLineWidth(currentLine + word, font, true);
|
|
226
|
+
if (currentLineWidthTillNow > maxWidth) {
|
|
227
|
+
push(currentLine);
|
|
228
|
+
resetParams();
|
|
229
|
+
break;
|
|
230
|
+
}
|
|
231
|
+
index++;
|
|
232
|
+
// if word ends with "-" then we don't need to add space
|
|
233
|
+
// to sync with css word-wrap
|
|
234
|
+
const shouldAppendSpace = !word.endsWith("-");
|
|
235
|
+
currentLine += word;
|
|
236
|
+
if (shouldAppendSpace) {
|
|
237
|
+
currentLine += " ";
|
|
238
|
+
}
|
|
239
|
+
// Push the word if appending space exceeds max width
|
|
240
|
+
if (currentLineWidthTillNow + spaceAdvanceWidth >= maxWidth) {
|
|
241
|
+
if (shouldAppendSpace) {
|
|
242
|
+
lines.push(currentLine.slice(0, -1));
|
|
243
|
+
}
|
|
244
|
+
else {
|
|
245
|
+
lines.push(currentLine);
|
|
246
|
+
}
|
|
247
|
+
resetParams();
|
|
248
|
+
break;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
if (currentLine.slice(-1) === " ") {
|
|
254
|
+
// only remove last trailing space which we have added when joining words
|
|
255
|
+
currentLine = currentLine.slice(0, -1);
|
|
256
|
+
push(currentLine);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
return lines.join("\n");
|
|
260
|
+
};
|
|
261
|
+
export const charWidth = (() => {
|
|
262
|
+
const cachedCharWidth = {};
|
|
263
|
+
const calculate = (char, font) => {
|
|
264
|
+
const ascii = char.charCodeAt(0);
|
|
265
|
+
if (!cachedCharWidth[font]) {
|
|
266
|
+
cachedCharWidth[font] = [];
|
|
267
|
+
}
|
|
268
|
+
if (!cachedCharWidth[font][ascii]) {
|
|
269
|
+
const width = getLineWidth(char, font, true);
|
|
270
|
+
cachedCharWidth[font][ascii] = width;
|
|
271
|
+
}
|
|
272
|
+
return cachedCharWidth[font][ascii];
|
|
273
|
+
};
|
|
274
|
+
const getCache = (font) => {
|
|
275
|
+
return cachedCharWidth[font];
|
|
276
|
+
};
|
|
277
|
+
return {
|
|
278
|
+
calculate,
|
|
279
|
+
getCache,
|
|
280
|
+
};
|
|
281
|
+
})();
|
|
282
|
+
const DUMMY_TEXT = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".toLocaleUpperCase();
|
|
283
|
+
// FIXME rename to getApproxMinContainerWidth
|
|
284
|
+
export const getApproxMinLineWidth = (font, lineHeight, currentScope) => {
|
|
285
|
+
const maxCharWidth = getMaxCharWidth(font);
|
|
286
|
+
if (maxCharWidth === 0) {
|
|
287
|
+
return (measureText(DUMMY_TEXT.split("").join("\n"), font, lineHeight, currentScope).width +
|
|
288
|
+
BOUND_TEXT_PADDING * 2);
|
|
289
|
+
}
|
|
290
|
+
return (maxCharWidth + BOUND_TEXT_PADDING * 2);
|
|
291
|
+
};
|
|
292
|
+
export const getMinCharWidth = (font) => {
|
|
293
|
+
const cache = charWidth.getCache(font);
|
|
294
|
+
if (!cache) {
|
|
295
|
+
return 0;
|
|
296
|
+
}
|
|
297
|
+
const cacheWithOutEmpty = cache.filter((val) => val !== undefined);
|
|
298
|
+
return Math.min(...cacheWithOutEmpty);
|
|
299
|
+
};
|
|
300
|
+
export const getMaxCharWidth = (font) => {
|
|
301
|
+
const cache = charWidth.getCache(font);
|
|
302
|
+
if (!cache) {
|
|
303
|
+
return 0;
|
|
304
|
+
}
|
|
305
|
+
const cacheWithOutEmpty = cache.filter((val) => val !== undefined);
|
|
306
|
+
return Math.max(...cacheWithOutEmpty);
|
|
307
|
+
};
|
|
308
|
+
export const getContainerCenter = (container, DucState, elementsMap) => {
|
|
309
|
+
if (!isArrowElement(container)) {
|
|
310
|
+
return {
|
|
311
|
+
x: container.x.scoped + container.width.scoped / 2,
|
|
312
|
+
y: container.y.scoped + container.height.scoped / 2,
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
const points = getPointsGlobalCoordinates(container, elementsMap, DucState.scope);
|
|
316
|
+
if (points.length % 2 === 1) {
|
|
317
|
+
const index = Math.floor(container.points.length / 2);
|
|
318
|
+
const midPoint = getPointGlobalCoordinates(container, getScopedBezierPointFromDucPoint(container.points[index]), elementsMap, DucState.scope);
|
|
319
|
+
return { x: midPoint.x, y: midPoint.y };
|
|
320
|
+
}
|
|
321
|
+
const index = container.points.length / 2 - 1;
|
|
322
|
+
// const initialMidSegmentMidpoint = getEditorMidPoints(
|
|
323
|
+
// container,
|
|
324
|
+
// elementsMap,
|
|
325
|
+
// DucState,
|
|
326
|
+
// )[index];
|
|
327
|
+
let initialMidSegmentMidpoint; // FIXME: provide a better implementation for mid points handling
|
|
328
|
+
const initMidPoints = initialMidSegmentMidpoint && getScopedBezierPointFromDucPoint(initialMidSegmentMidpoint);
|
|
329
|
+
// Remove casting in the future
|
|
330
|
+
let midSegmentMidpoint = initMidPoints && { x: initMidPoints.x, y: initMidPoints.y };
|
|
331
|
+
if (!midSegmentMidpoint) {
|
|
332
|
+
midSegmentMidpoint = getSegmentMidPoint(container, getScopedBezierPointFromDucPoint(points[index]), getScopedBezierPointFromDucPoint(points[index + 1]), index + 1, elementsMap, DucState.scope);
|
|
333
|
+
}
|
|
334
|
+
return { x: midSegmentMidpoint.x, y: midSegmentMidpoint.y };
|
|
335
|
+
};
|
|
336
|
+
export const getContainerCoords = (container) => {
|
|
337
|
+
let offsetX = BOUND_TEXT_PADDING;
|
|
338
|
+
let offsetY = BOUND_TEXT_PADDING;
|
|
339
|
+
if (container.type === "ellipse") {
|
|
340
|
+
// The derivation of coordinates is explained in https://github.com/excalidraw/excalidraw/pull/6172
|
|
341
|
+
offsetX += (container.width.value / 2) * (1 - Math.sqrt(2) / 2);
|
|
342
|
+
offsetY += (container.height.value / 2) * (1 - Math.sqrt(2) / 2);
|
|
343
|
+
}
|
|
344
|
+
// The derivation of coordinates is explained in https://github.com/excalidraw/excalidraw/pull/6265
|
|
345
|
+
if (container.type === "polygon") {
|
|
346
|
+
offsetX += container.width.value / 4;
|
|
347
|
+
offsetY += container.height.value / 4;
|
|
348
|
+
}
|
|
349
|
+
return {
|
|
350
|
+
x: container.x.value + offsetX,
|
|
351
|
+
y: container.y.value + offsetY,
|
|
352
|
+
};
|
|
353
|
+
};
|
|
354
|
+
export const getTextElementAngle = (textElement, container) => {
|
|
355
|
+
if (!container || isArrowElement(container)) {
|
|
356
|
+
return textElement.angle;
|
|
357
|
+
}
|
|
358
|
+
return container.angle;
|
|
359
|
+
};
|
|
360
|
+
export const shouldAllowVerticalAlign = (selectedElements, elementsMap) => {
|
|
361
|
+
return selectedElements.some((element) => {
|
|
362
|
+
if (isBoundToContainer(element)) {
|
|
363
|
+
const container = getContainerElement(element, elementsMap);
|
|
364
|
+
if (isArrowElement(container)) {
|
|
365
|
+
return false;
|
|
366
|
+
}
|
|
367
|
+
return true;
|
|
368
|
+
}
|
|
369
|
+
return false;
|
|
370
|
+
});
|
|
371
|
+
};
|
|
372
|
+
export const suppportsHorizontalAlign = (selectedElements, elementsMap) => {
|
|
373
|
+
return selectedElements.some((element) => {
|
|
374
|
+
if (isBoundToContainer(element)) {
|
|
375
|
+
const container = getContainerElement(element, elementsMap);
|
|
376
|
+
if (isArrowElement(container)) {
|
|
377
|
+
return false;
|
|
378
|
+
}
|
|
379
|
+
return true;
|
|
380
|
+
}
|
|
381
|
+
return isTextElement(element);
|
|
382
|
+
});
|
|
383
|
+
};
|
|
384
|
+
const VALID_CONTAINER_TYPES = new Set([
|
|
385
|
+
"rectangle",
|
|
386
|
+
"ellipse",
|
|
387
|
+
"diamond",
|
|
388
|
+
"arrow",
|
|
389
|
+
]);
|
|
390
|
+
export const isValidTextContainer = (element) => VALID_CONTAINER_TYPES.has(element.type);
|
|
391
|
+
export const computeContainerDimensionForBoundText = (dimension, containerType) => {
|
|
392
|
+
dimension = Math.ceil(dimension);
|
|
393
|
+
const padding = (BOUND_TEXT_PADDING * 2);
|
|
394
|
+
if (containerType === "ellipse") {
|
|
395
|
+
return Math.round(((dimension + padding) / Math.sqrt(2)) * 2);
|
|
396
|
+
}
|
|
397
|
+
if (containerType === "arrow") {
|
|
398
|
+
return (dimension + padding * 8);
|
|
399
|
+
}
|
|
400
|
+
if (containerType === "diamond") {
|
|
401
|
+
return (2 * (dimension + padding));
|
|
402
|
+
}
|
|
403
|
+
return (dimension + padding);
|
|
404
|
+
};
|
|
405
|
+
export const getBoundTextMaxWidth = (container, boundTextElement) => {
|
|
406
|
+
var _a;
|
|
407
|
+
const { width } = container;
|
|
408
|
+
if (isArrowElement(container)) {
|
|
409
|
+
const minWidth = ((_a = boundTextElement === null || boundTextElement === void 0 ? void 0 : boundTextElement.fontSize.value) !== null && _a !== void 0 ? _a : DEFAULT_FONT_SIZE) *
|
|
410
|
+
ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO;
|
|
411
|
+
return Math.max(ARROW_LABEL_WIDTH_FRACTION * width.value, minWidth);
|
|
412
|
+
}
|
|
413
|
+
if (container.type === "ellipse") {
|
|
414
|
+
// The width of the largest rectangle inscribed inside an ellipse is
|
|
415
|
+
// Math.round((ellipse.width / 2) * Math.sqrt(2)) which is derived from
|
|
416
|
+
// equation of an ellipse -https://github.com/excalidraw/excalidraw/pull/6172
|
|
417
|
+
return (Math.round((width.value / 2) * Math.sqrt(2)) - BOUND_TEXT_PADDING * 2);
|
|
418
|
+
}
|
|
419
|
+
if (container.type === "polygon") {
|
|
420
|
+
// The width of the largest rectangle inscribed inside a rhombus is
|
|
421
|
+
// Math.round(width / 2) - https://github.com/excalidraw/excalidraw/pull/6265
|
|
422
|
+
return (Math.round(width.value / 2) - BOUND_TEXT_PADDING * 2);
|
|
423
|
+
}
|
|
424
|
+
return (width.value - BOUND_TEXT_PADDING * 2);
|
|
425
|
+
};
|
|
426
|
+
export const getBoundTextMaxHeight = (container, boundTextElement) => {
|
|
427
|
+
const { height } = container;
|
|
428
|
+
if (isArrowElement(container)) {
|
|
429
|
+
const containerHeight = height.value - BOUND_TEXT_PADDING * 8 * 2;
|
|
430
|
+
if (containerHeight <= 0) {
|
|
431
|
+
return boundTextElement.height.value;
|
|
432
|
+
}
|
|
433
|
+
return height.value;
|
|
434
|
+
}
|
|
435
|
+
if (container.type === "ellipse") {
|
|
436
|
+
// The height of the largest rectangle inscribed inside an ellipse is
|
|
437
|
+
// Math.round((ellipse.height / 2) * Math.sqrt(2)) which is derived from
|
|
438
|
+
// equation of an ellipse - https://github.com/excalidraw/excalidraw/pull/6172
|
|
439
|
+
return (Math.round((height.value / 2) * Math.sqrt(2)) - BOUND_TEXT_PADDING * 2);
|
|
440
|
+
}
|
|
441
|
+
if (container.type === "polygon") {
|
|
442
|
+
// The height of the largest rectangle inscribed inside a rhombus is
|
|
443
|
+
// Math.round(height / 2) - https://github.com/excalidraw/excalidraw/pull/6265
|
|
444
|
+
return (Math.round(height.value / 2) - BOUND_TEXT_PADDING * 2);
|
|
445
|
+
}
|
|
446
|
+
return (height.value - BOUND_TEXT_PADDING * 2);
|
|
447
|
+
};
|
|
448
|
+
export const isMeasureTextSupported = (currentScope) => {
|
|
449
|
+
const width = getTextWidth(DUMMY_TEXT, getFontString({
|
|
450
|
+
fontSize: getPrecisionValueFromRaw(DEFAULT_FONT_SIZE, currentScope, currentScope),
|
|
451
|
+
fontFamily: DEFAULT_FONT_FAMILY,
|
|
452
|
+
}));
|
|
453
|
+
return width > 0;
|
|
454
|
+
};
|
|
455
|
+
export const getMinTextElementWidth = (font, lineHeight, currentScope) => {
|
|
456
|
+
return measureText("", font, lineHeight, currentScope).width + BOUND_TEXT_PADDING * 2;
|
|
457
|
+
};
|
|
458
|
+
/** retrieves text from text elements and concatenates to a single string */
|
|
459
|
+
export const getTextFromElements = (elements, separator = "\n\n") => {
|
|
460
|
+
const text = elements
|
|
461
|
+
.reduce((acc, element) => {
|
|
462
|
+
if (isTextElement(element)) {
|
|
463
|
+
acc.push(element.text);
|
|
464
|
+
}
|
|
465
|
+
return acc;
|
|
466
|
+
}, [])
|
|
467
|
+
.join(separator);
|
|
468
|
+
return text;
|
|
469
|
+
};
|
|
470
|
+
export const getFontFamilyString = ({ fontFamily, }) => {
|
|
471
|
+
for (const [fontFamilyString, id] of Object.entries(FONT_FAMILY)) {
|
|
472
|
+
if (id === fontFamily) {
|
|
473
|
+
return `${fontFamilyString}, ${WINDOWS_EMOJI_FALLBACK_FONT}`;
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
return WINDOWS_EMOJI_FALLBACK_FONT;
|
|
477
|
+
};
|
|
478
|
+
/** returns fontSize+fontFamily string for assignment to DOM elements */
|
|
479
|
+
export const getFontString = ({ fontSize, fontFamily, }) => {
|
|
480
|
+
return `${fontSize.scoped}px ${getFontFamilyString({ fontFamily })}`;
|
|
481
|
+
};
|
|
482
|
+
/** computes element x/y offset based on textAlign/verticalAlign */
|
|
483
|
+
export const getTextElementPositionOffsets = (opts, metrics) => {
|
|
484
|
+
return {
|
|
485
|
+
x: opts.textAlign === TEXT_ALIGN.CENTER
|
|
486
|
+
? metrics.width / 2
|
|
487
|
+
: opts.textAlign === TEXT_ALIGN.RIGHT
|
|
488
|
+
? metrics.width
|
|
489
|
+
: 0,
|
|
490
|
+
y: opts.verticalAlign === VERTICAL_ALIGN.MIDDLE ? metrics.height / 2 : 0,
|
|
491
|
+
};
|
|
492
|
+
};
|
|
493
|
+
export const refreshTextDimensions = (textElement, container, elementsMap, currentScope, text = textElement.text) => {
|
|
494
|
+
if (textElement.isDeleted) {
|
|
495
|
+
return;
|
|
496
|
+
}
|
|
497
|
+
if (container || !textElement.autoResize) {
|
|
498
|
+
text = wrapText(text, getFontString({ fontFamily: textElement.fontFamily, fontSize: textElement.fontSize }), container
|
|
499
|
+
? getBoundTextMaxWidth(container, textElement)
|
|
500
|
+
: textElement.width.scoped);
|
|
501
|
+
}
|
|
502
|
+
const dimensions = getAdjustedDimensions(textElement, elementsMap, text, currentScope);
|
|
503
|
+
return Object.assign({ text }, dimensions);
|
|
504
|
+
};
|
|
505
|
+
export const splitIntoLines = (text) => {
|
|
506
|
+
return normalizeText(text).split("\n");
|
|
507
|
+
};
|
|
508
|
+
/**
|
|
509
|
+
* To get unitless line-height (if unknown) we can calculate it by dividing
|
|
510
|
+
* height-per-line by fontSize.
|
|
511
|
+
*/
|
|
512
|
+
export const detectLineHeight = (textElement) => {
|
|
513
|
+
const lineCount = splitIntoLines(textElement.text).length;
|
|
514
|
+
return (textElement.height.scoped /
|
|
515
|
+
lineCount /
|
|
516
|
+
textElement.fontSize.scoped);
|
|
517
|
+
};
|
|
518
|
+
export const getAdjustedDimensions = (element, elementsMap, nextText, currentScope) => {
|
|
519
|
+
let { width: nextWidth, height: nextHeight } = measureText(nextText, getFontString({ fontFamily: element.fontFamily, fontSize: element.fontSize }), element.lineHeight, currentScope);
|
|
520
|
+
// wrapped text
|
|
521
|
+
if (!element.autoResize) {
|
|
522
|
+
nextWidth = element.width.value;
|
|
523
|
+
}
|
|
524
|
+
const { textAlign, verticalAlign } = element;
|
|
525
|
+
let x;
|
|
526
|
+
let y;
|
|
527
|
+
if (textAlign === TEXT_ALIGN.CENTER &&
|
|
528
|
+
verticalAlign === VERTICAL_ALIGN.MIDDLE &&
|
|
529
|
+
!element.containerId &&
|
|
530
|
+
element.autoResize) {
|
|
531
|
+
const prevMetrics = measureText(element.text, getFontString({ fontFamily: element.fontFamily, fontSize: element.fontSize }), element.lineHeight, currentScope);
|
|
532
|
+
const offsets = getTextElementPositionOffsets(element, {
|
|
533
|
+
width: nextWidth - prevMetrics.width,
|
|
534
|
+
height: nextHeight - prevMetrics.height,
|
|
535
|
+
});
|
|
536
|
+
x = element.x.value - offsets.x;
|
|
537
|
+
y = element.y.value - offsets.y;
|
|
538
|
+
}
|
|
539
|
+
else {
|
|
540
|
+
const [x1, y1, x2, y2] = getElementAbsoluteCoords(element, elementsMap, currentScope);
|
|
541
|
+
const nextWidthValue = getPrecisionValueFromRaw(nextWidth, element.scope, currentScope);
|
|
542
|
+
const nextHeightValue = getPrecisionValueFromRaw(nextHeight, element.scope, currentScope);
|
|
543
|
+
const [nextX1, nextY1, nextX2, nextY2] = getResizedElementAbsoluteCoords(element, nextWidthValue.scoped, nextHeightValue.scoped, false, currentScope);
|
|
544
|
+
const deltaX1 = (x1 - nextX1) / 2;
|
|
545
|
+
const deltaY1 = (y1 - nextY1) / 2;
|
|
546
|
+
const deltaX2 = (x2 - nextX2) / 2;
|
|
547
|
+
const deltaY2 = (y2 - nextY2) / 2;
|
|
548
|
+
const rotationPoint = adjustXYWithRotation({
|
|
549
|
+
s: true,
|
|
550
|
+
e: textAlign === TEXT_ALIGN.CENTER || textAlign === TEXT_ALIGN.LEFT,
|
|
551
|
+
w: textAlign === TEXT_ALIGN.CENTER || textAlign === TEXT_ALIGN.RIGHT,
|
|
552
|
+
}, element.x.value, element.y.value, element.angle, deltaX1, deltaY1, deltaX2, deltaY2);
|
|
553
|
+
x = rotationPoint.x;
|
|
554
|
+
y = rotationPoint.y;
|
|
555
|
+
}
|
|
556
|
+
return {
|
|
557
|
+
width: nextWidth,
|
|
558
|
+
height: nextHeight,
|
|
559
|
+
x: Number.isFinite(x) ? x : element.x.value,
|
|
560
|
+
y: Number.isFinite(y) ? y : element.y.value,
|
|
561
|
+
};
|
|
562
|
+
};
|
|
563
|
+
export { getBoundTextElementPosition };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ActiveTool, DucState, ToolType } from "ducjs/legacy/v1/types";
|
|
2
|
+
/**
|
|
3
|
+
* supply `null` as message if non-never value is valid, you just need to
|
|
4
|
+
* typecheck against it
|
|
5
|
+
*/
|
|
6
|
+
export declare const assertNever: (value: never, message: string | null, softAssert?: boolean) => never;
|
|
7
|
+
export declare const getUpdatedTimestamp: () => number;
|
|
8
|
+
export declare const isFiniteNumber: (value: any) => value is number;
|
|
9
|
+
/**
|
|
10
|
+
* Transforms array of objects containing `id` attribute,
|
|
11
|
+
* or array of ids (strings), into a Map, keyd by `id`.
|
|
12
|
+
*/
|
|
13
|
+
export declare const arrayToMap: <T extends {
|
|
14
|
+
id: string;
|
|
15
|
+
} | string>(items: readonly T[] | Map<string, T>) => Map<any, any>;
|
|
16
|
+
export declare const updateActiveTool: (appState: Pick<DucState, "activeTool">, data: (({
|
|
17
|
+
type: ToolType;
|
|
18
|
+
} | {
|
|
19
|
+
type: "custom";
|
|
20
|
+
customType: string;
|
|
21
|
+
}) & {
|
|
22
|
+
locked?: boolean;
|
|
23
|
+
fromSelection?: boolean;
|
|
24
|
+
}) & {
|
|
25
|
+
lastActiveToolBeforeEraser?: ActiveTool | null;
|
|
26
|
+
}) => DucState["activeTool"];
|