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,716 @@
|
|
|
1
|
+
import { BEZIER_MIRRORING, BLENDING, BOOLEAN_OPERATION, ELEMENT_CONTENT_PREFERENCE, IMAGE_STATUS, LINE_HEAD, PRUNING_LEVEL, STROKE_CAP, STROKE_JOIN, STROKE_PLACEMENT, STROKE_PREFERENCE, STROKE_SIDE_PREFERENCE, TEXT_ALIGN, VERTICAL_ALIGN, } from "ducjs/flatbuffers/duc";
|
|
2
|
+
import { restoreElements } from "ducjs/restore/restoreElements";
|
|
3
|
+
import { isStandardIdPresent, restoreStandards, } from "ducjs/restore/restoreStandards";
|
|
4
|
+
import { getPrecisionScope } from "ducjs/technical/measurements";
|
|
5
|
+
import { getPrecisionValueFromRaw, getPrecisionValueFromScoped, NEUTRAL_SCOPE, ScaleFactors } from "ducjs/technical/scopes";
|
|
6
|
+
import { PREDEFINED_STANDARDS } from "ducjs/technical/standards";
|
|
7
|
+
import { base64ToUint8Array, getDefaultGlobalState, getDefaultLocalState, getZoom, isEncodedFunctionString, isFiniteNumber, reviveEncodedFunction, } from "ducjs/utils";
|
|
8
|
+
import { DEFAULT_ELEMENT_PROPS, DEFAULT_POLYGON_SIDES, DEFAULT_TEXT_ALIGN, DEFAULT_VERTICAL_ALIGN, DEFAULT_ZOOM_STEP, MAX_ZOOM_STEP, MIN_ZOOM_STEP, } from "ducjs/utils/constants";
|
|
9
|
+
import { getDefaultStackProperties } from "ducjs/utils/elements";
|
|
10
|
+
import tinycolor from "tinycolor2";
|
|
11
|
+
export const restore = (data, elementsConfig) => {
|
|
12
|
+
const restoredStandards = restoreStandards(data === null || data === void 0 ? void 0 : data.standards);
|
|
13
|
+
const restoredDictionary = restoreDictionary(data === null || data === void 0 ? void 0 : data.dictionary);
|
|
14
|
+
const restoredGlobalState = restoreGlobalState(data === null || data === void 0 ? void 0 : data.globalState);
|
|
15
|
+
const restoredLocalState = restoreLocalState(data === null || data === void 0 ? void 0 : data.localState, restoredGlobalState, restoredStandards);
|
|
16
|
+
const restoredElementsConfig = Object.assign(Object.assign({}, elementsConfig), { localState: restoredLocalState });
|
|
17
|
+
const restoredBlocks = restoreBlocks(data === null || data === void 0 ? void 0 : data.blocks, restoredLocalState.scope, restoredElementsConfig);
|
|
18
|
+
const restoredRegions = restoreRegions(data === null || data === void 0 ? void 0 : data.regions);
|
|
19
|
+
const restoredGroups = restoreGroups(data === null || data === void 0 ? void 0 : data.groups);
|
|
20
|
+
const restoredLayers = restoreLayers(data === null || data === void 0 ? void 0 : data.layers, restoredLocalState.scope);
|
|
21
|
+
const restoredElements = restoreElements(data === null || data === void 0 ? void 0 : data.elements, restoredLocalState.scope, restoredBlocks, restoredElementsConfig);
|
|
22
|
+
const restoredVersionGraph = restoreVersionGraph(data === null || data === void 0 ? void 0 : data.versionGraph);
|
|
23
|
+
return {
|
|
24
|
+
dictionary: restoredDictionary,
|
|
25
|
+
thumbnail: isValidUint8Array(data === null || data === void 0 ? void 0 : data.thumbnail),
|
|
26
|
+
elements: restoredElements,
|
|
27
|
+
blocks: restoredBlocks,
|
|
28
|
+
groups: restoredGroups,
|
|
29
|
+
regions: restoredRegions,
|
|
30
|
+
layers: restoredLayers,
|
|
31
|
+
standards: restoredStandards,
|
|
32
|
+
versionGraph: restoredVersionGraph,
|
|
33
|
+
localState: restoredLocalState,
|
|
34
|
+
globalState: restoredGlobalState,
|
|
35
|
+
files: restoreFiles(data === null || data === void 0 ? void 0 : data.files),
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export const restoreFiles = (importedFiles) => {
|
|
39
|
+
var _a;
|
|
40
|
+
if (!importedFiles || typeof importedFiles !== "object") {
|
|
41
|
+
return {};
|
|
42
|
+
}
|
|
43
|
+
const restoredFiles = {};
|
|
44
|
+
const files = importedFiles;
|
|
45
|
+
for (const key in files) {
|
|
46
|
+
if (Object.prototype.hasOwnProperty.call(files, key)) {
|
|
47
|
+
const fileData = files[key];
|
|
48
|
+
if (!fileData || typeof fileData !== "object") {
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
const id = isValidExternalFileId(fileData.id);
|
|
52
|
+
const mimeType = isValidString(fileData.mimeType);
|
|
53
|
+
const created = isFiniteNumber(fileData.created)
|
|
54
|
+
? fileData.created
|
|
55
|
+
: Date.now();
|
|
56
|
+
// Check for data under 'data' or 'dataURL' to be more flexible.
|
|
57
|
+
const dataSource = (_a = fileData.data) !== null && _a !== void 0 ? _a : fileData.dataURL;
|
|
58
|
+
const data = isValidUint8Array(dataSource);
|
|
59
|
+
if (id && mimeType && data) {
|
|
60
|
+
restoredFiles[id] = {
|
|
61
|
+
id,
|
|
62
|
+
mimeType,
|
|
63
|
+
data,
|
|
64
|
+
created,
|
|
65
|
+
lastRetrieved: isFiniteNumber(fileData.lastRetrieved)
|
|
66
|
+
? fileData.lastRetrieved
|
|
67
|
+
: undefined,
|
|
68
|
+
version: isFiniteNumber(fileData.version)
|
|
69
|
+
? fileData.version
|
|
70
|
+
: undefined,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return restoredFiles;
|
|
76
|
+
};
|
|
77
|
+
export const restoreDictionary = (importedDictionary) => {
|
|
78
|
+
if (!importedDictionary || typeof importedDictionary !== "object") {
|
|
79
|
+
return {};
|
|
80
|
+
}
|
|
81
|
+
const restoredDictionary = {};
|
|
82
|
+
const dict = importedDictionary;
|
|
83
|
+
for (const key in dict) {
|
|
84
|
+
if (Object.prototype.hasOwnProperty.call(dict, key)) {
|
|
85
|
+
restoredDictionary[key] = typeof dict[key] === "string" ? dict[key] : String(dict[key]);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return restoredDictionary;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Restores the groups array from imported data, ensuring each item
|
|
92
|
+
* conforms to the DucGroup type.
|
|
93
|
+
*
|
|
94
|
+
* This function iterates through the raw input, filters out any invalid entries,
|
|
95
|
+
* and constructs a new array of clean, validated DucGroup objects.
|
|
96
|
+
*
|
|
97
|
+
* @param groups - The raw, untrusted array of group-like objects.
|
|
98
|
+
* @returns A validated array of DucGroup objects, or an empty array if the input is invalid.
|
|
99
|
+
*/
|
|
100
|
+
export const restoreGroups = (groups) => {
|
|
101
|
+
if (!Array.isArray(groups)) {
|
|
102
|
+
return [];
|
|
103
|
+
}
|
|
104
|
+
return groups
|
|
105
|
+
.filter((g) => {
|
|
106
|
+
if (!g || typeof g !== "object")
|
|
107
|
+
return false;
|
|
108
|
+
return typeof g.id === "string";
|
|
109
|
+
})
|
|
110
|
+
.map((g) => {
|
|
111
|
+
return Object.assign({ id: g.id }, restoreDucStackProperties(g));
|
|
112
|
+
});
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* Restores the layers array from imported data, ensuring each item
|
|
116
|
+
* conforms to the DucLayer type.
|
|
117
|
+
*
|
|
118
|
+
* This function deeply validates each layer, including its nested 'overrides'
|
|
119
|
+
* for default stroke and background styles. It provides safe defaults for any
|
|
120
|
+
* missing or invalid properties.
|
|
121
|
+
*
|
|
122
|
+
* @param layers - The raw, untrusted array of layer-like objects.
|
|
123
|
+
* @param currentScope - The current drawing scope, required for restoring
|
|
124
|
+
* scope-dependent properties like stroke width.
|
|
125
|
+
* @returns A validated array of DucLayer objects, or an empty array if the input is invalid.
|
|
126
|
+
*/
|
|
127
|
+
export const restoreLayers = (layers, currentScope) => {
|
|
128
|
+
if (!Array.isArray(layers)) {
|
|
129
|
+
return [];
|
|
130
|
+
}
|
|
131
|
+
return layers
|
|
132
|
+
.filter((g) => {
|
|
133
|
+
if (!g || typeof g !== "object")
|
|
134
|
+
return false;
|
|
135
|
+
return typeof g.id === "string";
|
|
136
|
+
})
|
|
137
|
+
.map((l) => {
|
|
138
|
+
return Object.assign(Object.assign({ id: l.id }, restoreDucStackProperties(l)), { readonly: isValidBoolean(l.readonly, false), overrides: {
|
|
139
|
+
stroke: validateStroke(l.overrides.stroke, currentScope, currentScope),
|
|
140
|
+
background: validateBackground(l.overrides.background),
|
|
141
|
+
} });
|
|
142
|
+
});
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* Restores the regions array, ensuring correct structure and types.
|
|
146
|
+
*/
|
|
147
|
+
export const restoreRegions = (regions) => {
|
|
148
|
+
if (!Array.isArray(regions)) {
|
|
149
|
+
return [];
|
|
150
|
+
}
|
|
151
|
+
return regions
|
|
152
|
+
.filter((g) => {
|
|
153
|
+
if (!g || typeof g !== "object")
|
|
154
|
+
return false;
|
|
155
|
+
return typeof g.id === "string";
|
|
156
|
+
})
|
|
157
|
+
.map((r) => {
|
|
158
|
+
return Object.assign(Object.assign({ type: "region", id: r.id }, restoreDucStackProperties(r)), { booleanOperation: Object.values(BOOLEAN_OPERATION).includes(r.booleanOperation)
|
|
159
|
+
? r.booleanOperation
|
|
160
|
+
: BOOLEAN_OPERATION.UNION });
|
|
161
|
+
});
|
|
162
|
+
};
|
|
163
|
+
/**
|
|
164
|
+
* Restores the blocks array using a two-pass approach to resolve circular dependencies.
|
|
165
|
+
*
|
|
166
|
+
* Pass 1: Creates a "shallow" version of each block with all top-level properties
|
|
167
|
+
* but an empty `elements` array. This provides a complete reference list of all blocks.
|
|
168
|
+
*
|
|
169
|
+
* Pass 2: Iterates over the shallow blocks, calling `restoreElements` for each one,
|
|
170
|
+
* providing the complete block list from Pass 1 as the necessary context.
|
|
171
|
+
*/
|
|
172
|
+
export const restoreBlocks = (blocks, currentScope, elementsConfig) => {
|
|
173
|
+
if (!Array.isArray(blocks)) {
|
|
174
|
+
return [];
|
|
175
|
+
}
|
|
176
|
+
const partiallyRestoredBlocks = blocks
|
|
177
|
+
.filter((b) => {
|
|
178
|
+
if (!b || typeof b !== "object")
|
|
179
|
+
return false;
|
|
180
|
+
const obj = b;
|
|
181
|
+
return typeof obj.id === "string";
|
|
182
|
+
})
|
|
183
|
+
.map((b) => {
|
|
184
|
+
const obj = b;
|
|
185
|
+
return {
|
|
186
|
+
id: obj.id,
|
|
187
|
+
label: typeof obj.label === "string" ? obj.label : "",
|
|
188
|
+
description: typeof obj.description === "string" ? obj.description : undefined,
|
|
189
|
+
version: typeof obj.version === "number" ? obj.version : 1,
|
|
190
|
+
attributes: obj.attributes || undefined,
|
|
191
|
+
attributeDefinitions: obj.attributeDefinitions && typeof obj.attributeDefinitions === "object"
|
|
192
|
+
? obj.attributeDefinitions
|
|
193
|
+
: {},
|
|
194
|
+
elements: [],
|
|
195
|
+
};
|
|
196
|
+
});
|
|
197
|
+
partiallyRestoredBlocks.forEach((restoredBlock) => {
|
|
198
|
+
const originalBlockData = blocks.find((b) => b.id === restoredBlock.id);
|
|
199
|
+
if (originalBlockData && originalBlockData.elements) {
|
|
200
|
+
const finalElements = restoreElements(originalBlockData.elements, currentScope, partiallyRestoredBlocks, elementsConfig);
|
|
201
|
+
restoredBlock.elements = finalElements;
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
return partiallyRestoredBlocks;
|
|
205
|
+
};
|
|
206
|
+
/**
|
|
207
|
+
* Restores the global state of the document from imported data.
|
|
208
|
+
* It validates and provides defaults for missing or invalid properties.
|
|
209
|
+
*
|
|
210
|
+
* @param importedState - The partially imported global state data.
|
|
211
|
+
* @returns A complete and valid DucGlobalState object.
|
|
212
|
+
*/
|
|
213
|
+
export const restoreGlobalState = (importedState = {}) => {
|
|
214
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
215
|
+
const defaults = getDefaultGlobalState();
|
|
216
|
+
const linearPrecision = isValidFinitePositiveByteValue(importedState.coordDecimalPlaces, defaults.displayPrecision.linear);
|
|
217
|
+
return Object.assign(Object.assign({}, defaults), { name: (_a = importedState.name) !== null && _a !== void 0 ? _a : defaults.name, viewBackgroundColor: (_b = importedState.viewBackgroundColor) !== null && _b !== void 0 ? _b : defaults.viewBackgroundColor, mainScope: (_c = isValidAppStateScopeValue(importedState.mainScope)) !== null && _c !== void 0 ? _c : defaults.mainScope, scopeExponentThreshold: isValidAppStateScopeExponentThresholdValue(importedState.scopeExponentThreshold, defaults.scopeExponentThreshold), dashSpacingScale: (_d = importedState.dashSpacingScale) !== null && _d !== void 0 ? _d : defaults.dashSpacingScale, isDashSpacingAffectedByViewportScale: (_e = importedState.isDashSpacingAffectedByViewportScale) !== null && _e !== void 0 ? _e : defaults.isDashSpacingAffectedByViewportScale, dimensionsAssociativeByDefault: (_f = importedState.dimensionsAssociativeByDefault) !== null && _f !== void 0 ? _f : defaults.dimensionsAssociativeByDefault, useAnnotativeScaling: (_g = importedState.useAnnotativeScaling) !== null && _g !== void 0 ? _g : defaults.useAnnotativeScaling, displayPrecision: {
|
|
218
|
+
linear: linearPrecision,
|
|
219
|
+
angular: (_j = (_h = importedState.displayPrecision) === null || _h === void 0 ? void 0 : _h.angular) !== null && _j !== void 0 ? _j : defaults.displayPrecision.angular,
|
|
220
|
+
}, pruningLevel: importedState.pruningLevel &&
|
|
221
|
+
Object.values(PRUNING_LEVEL).includes(importedState.pruningLevel)
|
|
222
|
+
? importedState.pruningLevel
|
|
223
|
+
: PRUNING_LEVEL.BALANCED });
|
|
224
|
+
};
|
|
225
|
+
/**
|
|
226
|
+
* Restores the user's local session state from imported data.
|
|
227
|
+
* It requires the already-restored global state to correctly calculate dependent values
|
|
228
|
+
* like zoom and scope.
|
|
229
|
+
*
|
|
230
|
+
* @param importedState - The partially imported local state data.
|
|
231
|
+
* @param restoredGlobalState - The complete and valid global state for the document.
|
|
232
|
+
* @returns A complete and valid DucLocalState object.
|
|
233
|
+
*/
|
|
234
|
+
export const restoreLocalState = (importedState = {}, restoredGlobalState, restoredStandards) => {
|
|
235
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
236
|
+
const defaults = getDefaultLocalState();
|
|
237
|
+
const zoom = getZoom((_b = (_a = importedState.zoom) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : defaults.zoom.value, restoredGlobalState.mainScope, restoredGlobalState.scopeExponentThreshold);
|
|
238
|
+
const scope = isValidPrecisionScopeValue(zoom.value, restoredGlobalState.mainScope, restoredGlobalState.scopeExponentThreshold);
|
|
239
|
+
return Object.assign(Object.assign(Object.assign({}, defaults), importedState), { scope, activeStandardId: isValidStandardId(importedState.activeStandardId, restoredStandards, defaults.activeStandardId), isBindingEnabled: isValidBoolean(importedState.isBindingEnabled, defaults.isBindingEnabled), penMode: isValidBoolean(importedState.penMode, defaults.penMode), scrollX: importedState.scrollX
|
|
240
|
+
? restorePrecisionValue(importedState.scrollX, NEUTRAL_SCOPE, scope)
|
|
241
|
+
: getPrecisionValueFromRaw(defaults.scrollX.value, NEUTRAL_SCOPE, scope), scrollY: importedState.scrollY
|
|
242
|
+
? restorePrecisionValue(importedState.scrollY, NEUTRAL_SCOPE, scope)
|
|
243
|
+
: getPrecisionValueFromRaw(defaults.scrollY.value, NEUTRAL_SCOPE, scope), zoom, activeGridSettings: (_c = importedState.activeGridSettings) !== null && _c !== void 0 ? _c : defaults.activeGridSettings, activeSnapSettings: (_d = importedState.activeSnapSettings) !== null && _d !== void 0 ? _d : defaults.activeSnapSettings, currentItemStroke: (_e = validateStroke(importedState.currentItemStroke, scope, scope)) !== null && _e !== void 0 ? _e : defaults.currentItemStroke, currentItemBackground: (_f = validateBackground(importedState.currentItemBackground)) !== null && _f !== void 0 ? _f : defaults.currentItemBackground, currentItemOpacity: isValidPercentageValue(importedState.currentItemOpacity, defaults.currentItemOpacity), currentItemStartLineHead: (_g = isValidLineHeadValue(importedState.currentItemStartLineHead)) !== null && _g !== void 0 ? _g : defaults.currentItemStartLineHead, currentItemEndLineHead: (_h = isValidLineHeadValue(importedState.currentItemEndLineHead)) !== null && _h !== void 0 ? _h : defaults.currentItemEndLineHead });
|
|
244
|
+
};
|
|
245
|
+
export const restoreVersionGraph = (importedGraph) => {
|
|
246
|
+
if (!importedGraph || typeof importedGraph !== "object") {
|
|
247
|
+
return undefined;
|
|
248
|
+
}
|
|
249
|
+
const userCheckpointVersionId = isValidString(importedGraph.userCheckpointVersionId);
|
|
250
|
+
const latestVersionId = isValidString(importedGraph.latestVersionId);
|
|
251
|
+
if (!userCheckpointVersionId || !latestVersionId) {
|
|
252
|
+
return undefined;
|
|
253
|
+
}
|
|
254
|
+
const checkpoints = [];
|
|
255
|
+
if (Array.isArray(importedGraph.checkpoints)) {
|
|
256
|
+
for (const c of importedGraph.checkpoints) {
|
|
257
|
+
if (!c || typeof c !== "object" || c.type !== "checkpoint") {
|
|
258
|
+
continue;
|
|
259
|
+
}
|
|
260
|
+
const id = isValidString(c.id);
|
|
261
|
+
if (!id) {
|
|
262
|
+
continue;
|
|
263
|
+
}
|
|
264
|
+
const parentId = typeof c.parentId === "string" ? c.parentId : null;
|
|
265
|
+
const timestamp = isFiniteNumber(c.timestamp) ? c.timestamp : 0;
|
|
266
|
+
const isManualSave = isValidBoolean(c.isManualSave, false);
|
|
267
|
+
const sizeBytes = isFiniteNumber(c.sizeBytes) && c.sizeBytes >= 0 ? c.sizeBytes : 0;
|
|
268
|
+
const data = isValidUint8Array(c.data);
|
|
269
|
+
if (!data) {
|
|
270
|
+
continue;
|
|
271
|
+
}
|
|
272
|
+
checkpoints.push({
|
|
273
|
+
type: "checkpoint",
|
|
274
|
+
id,
|
|
275
|
+
parentId,
|
|
276
|
+
timestamp,
|
|
277
|
+
isManualSave,
|
|
278
|
+
sizeBytes,
|
|
279
|
+
data,
|
|
280
|
+
description: isValidString(c.description) || undefined,
|
|
281
|
+
userId: isValidString(c.userId) || undefined,
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
const deltas = [];
|
|
286
|
+
if (Array.isArray(importedGraph.deltas)) {
|
|
287
|
+
for (const d of importedGraph.deltas) {
|
|
288
|
+
if (!d || typeof d !== "object" || d.type !== "delta") {
|
|
289
|
+
continue;
|
|
290
|
+
}
|
|
291
|
+
const id = isValidString(d.id);
|
|
292
|
+
if (!id) {
|
|
293
|
+
continue;
|
|
294
|
+
}
|
|
295
|
+
const parentId = typeof d.parentId === "string" ? d.parentId : null;
|
|
296
|
+
const timestamp = isFiniteNumber(d.timestamp) ? d.timestamp : 0;
|
|
297
|
+
const isManualSave = isValidBoolean(d.isManualSave, false);
|
|
298
|
+
if (!Array.isArray(d.patch)) {
|
|
299
|
+
continue;
|
|
300
|
+
}
|
|
301
|
+
const patch = [];
|
|
302
|
+
let isPatchValid = true;
|
|
303
|
+
for (const op of d.patch) {
|
|
304
|
+
if (!op ||
|
|
305
|
+
typeof op !== "object" ||
|
|
306
|
+
!isValidString(op.op) ||
|
|
307
|
+
!isValidString(op.path)) {
|
|
308
|
+
isPatchValid = false;
|
|
309
|
+
break;
|
|
310
|
+
}
|
|
311
|
+
patch.push({ op: op.op, path: op.path, value: op.value });
|
|
312
|
+
}
|
|
313
|
+
if (!isPatchValid) {
|
|
314
|
+
continue;
|
|
315
|
+
}
|
|
316
|
+
deltas.push({
|
|
317
|
+
type: "delta",
|
|
318
|
+
id,
|
|
319
|
+
parentId,
|
|
320
|
+
timestamp,
|
|
321
|
+
isManualSave,
|
|
322
|
+
patch,
|
|
323
|
+
description: isValidString(d.description) || undefined,
|
|
324
|
+
userId: isValidString(d.userId) || undefined,
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
const importedMetadata = importedGraph.metadata;
|
|
329
|
+
const metadata = {
|
|
330
|
+
lastPruned: isFiniteNumber(importedMetadata === null || importedMetadata === void 0 ? void 0 : importedMetadata.lastPruned)
|
|
331
|
+
? importedMetadata.lastPruned
|
|
332
|
+
: 0,
|
|
333
|
+
totalSize: isFiniteNumber(importedMetadata === null || importedMetadata === void 0 ? void 0 : importedMetadata.totalSize) &&
|
|
334
|
+
importedMetadata.totalSize >= 0
|
|
335
|
+
? importedMetadata.totalSize
|
|
336
|
+
: 0,
|
|
337
|
+
};
|
|
338
|
+
return {
|
|
339
|
+
userCheckpointVersionId,
|
|
340
|
+
latestVersionId,
|
|
341
|
+
checkpoints,
|
|
342
|
+
deltas,
|
|
343
|
+
metadata,
|
|
344
|
+
};
|
|
345
|
+
};
|
|
346
|
+
/**
|
|
347
|
+
* Restores common properties for elements leveraging _DucStackBase.
|
|
348
|
+
*/
|
|
349
|
+
export const restoreDucStackProperties = (stack) => {
|
|
350
|
+
const defaultStackProperties = getDefaultStackProperties();
|
|
351
|
+
return {
|
|
352
|
+
label: typeof stack.label === "string" ? stack.label : "",
|
|
353
|
+
description: typeof stack.description === "string" ? stack.description : null,
|
|
354
|
+
isCollapsed: isValidBoolean(stack.isCollapsed, defaultStackProperties.isCollapsed),
|
|
355
|
+
locked: isValidBoolean(stack.locked, defaultStackProperties.locked),
|
|
356
|
+
isVisible: isValidBoolean(stack.isVisible, defaultStackProperties.isVisible),
|
|
357
|
+
isPlot: isValidBoolean(stack.isPlot, defaultStackProperties.isPlot),
|
|
358
|
+
opacity: isValidPercentageValue(stack.opacity, defaultStackProperties.opacity),
|
|
359
|
+
labelingColor: isValidColor(stack.labelingColor, defaultStackProperties.labelingColor),
|
|
360
|
+
};
|
|
361
|
+
};
|
|
362
|
+
export const isValidAppStateScopeValue = (value) => {
|
|
363
|
+
if (value !== undefined && Object.keys(ScaleFactors).includes(value)) {
|
|
364
|
+
return value;
|
|
365
|
+
}
|
|
366
|
+
return NEUTRAL_SCOPE;
|
|
367
|
+
};
|
|
368
|
+
export const isValidAppStateScopeExponentThresholdValue = (value, defaultValue) => {
|
|
369
|
+
const finite = isValidFinitePositiveByteValue(value, defaultValue);
|
|
370
|
+
if (finite >= 1 && finite <= 36) {
|
|
371
|
+
return finite;
|
|
372
|
+
}
|
|
373
|
+
return defaultValue;
|
|
374
|
+
};
|
|
375
|
+
export const isValidPrecisionScopeValue = (zoom, mainScope, scopeExponentThreshold) => {
|
|
376
|
+
return getPrecisionScope(zoom, mainScope, scopeExponentThreshold);
|
|
377
|
+
};
|
|
378
|
+
/**
|
|
379
|
+
* Converts a plain number or legacy value to a PrecisionValue object
|
|
380
|
+
* @param value - The value to convert (can be a raw number or legacy value)
|
|
381
|
+
* @param elementScope - The scope to use for the precision value
|
|
382
|
+
* @returns A properly formatted PrecisionValue object
|
|
383
|
+
*/
|
|
384
|
+
export const restorePrecisionValue = (value, elementScope, currentScope, defaultValue, fromScoped = false) => {
|
|
385
|
+
const fallbackValue = getPrecisionValueFromRaw((defaultValue !== null && defaultValue !== void 0 ? defaultValue : 0), currentScope, currentScope);
|
|
386
|
+
if (value === undefined || value === null) {
|
|
387
|
+
return fallbackValue;
|
|
388
|
+
}
|
|
389
|
+
if (typeof value === "number") {
|
|
390
|
+
if (!Number.isFinite(value)) {
|
|
391
|
+
return fallbackValue;
|
|
392
|
+
}
|
|
393
|
+
return fromScoped
|
|
394
|
+
? getPrecisionValueFromScoped(value, elementScope, currentScope)
|
|
395
|
+
: getPrecisionValueFromRaw(value, elementScope, currentScope);
|
|
396
|
+
}
|
|
397
|
+
return getPrecisionValueFromRaw(value.value, elementScope, currentScope);
|
|
398
|
+
};
|
|
399
|
+
export const isValidFillStyleValue = (value) => {
|
|
400
|
+
if (value === undefined ||
|
|
401
|
+
!Object.values(ELEMENT_CONTENT_PREFERENCE).includes(value))
|
|
402
|
+
return ELEMENT_CONTENT_PREFERENCE.SOLID;
|
|
403
|
+
return value;
|
|
404
|
+
};
|
|
405
|
+
export const isValidStrokePreferenceValue = (value) => {
|
|
406
|
+
if (value === undefined || !Object.values(STROKE_PREFERENCE).includes(value))
|
|
407
|
+
return STROKE_PREFERENCE.SOLID;
|
|
408
|
+
return value;
|
|
409
|
+
};
|
|
410
|
+
export const isValidVerticalAlignValue = (value) => {
|
|
411
|
+
if (value === undefined || !Object.values(VERTICAL_ALIGN).includes(value))
|
|
412
|
+
return DEFAULT_VERTICAL_ALIGN;
|
|
413
|
+
return value;
|
|
414
|
+
};
|
|
415
|
+
export const isValidTextAlignValue = (value) => {
|
|
416
|
+
if (value === undefined || !Object.values(TEXT_ALIGN).includes(value))
|
|
417
|
+
return DEFAULT_TEXT_ALIGN;
|
|
418
|
+
return value;
|
|
419
|
+
};
|
|
420
|
+
export const isValidScopeValue = (value, localState, mainScope) => {
|
|
421
|
+
if (value !== undefined && Object.keys(ScaleFactors).includes(value)) {
|
|
422
|
+
return value;
|
|
423
|
+
}
|
|
424
|
+
if (mainScope && Object.keys(ScaleFactors).includes(mainScope)) {
|
|
425
|
+
return mainScope;
|
|
426
|
+
}
|
|
427
|
+
if ((localState === null || localState === void 0 ? void 0 : localState.scope) &&
|
|
428
|
+
Object.keys(ScaleFactors).includes(localState.scope)) {
|
|
429
|
+
return localState.scope;
|
|
430
|
+
}
|
|
431
|
+
return NEUTRAL_SCOPE;
|
|
432
|
+
};
|
|
433
|
+
export const isValidImageStatusValue = (value) => {
|
|
434
|
+
if (value === undefined || !Object.values(IMAGE_STATUS).includes(value))
|
|
435
|
+
return IMAGE_STATUS.PENDING;
|
|
436
|
+
return value;
|
|
437
|
+
};
|
|
438
|
+
export const isValidDucHead = (value, blocks, elementScope, currentScope) => {
|
|
439
|
+
if (value === undefined || value === null)
|
|
440
|
+
return null;
|
|
441
|
+
const type = isValidLineHeadValue(value.type);
|
|
442
|
+
const blockId = isValidBlockId(value.blockId, blocks);
|
|
443
|
+
if (type === null || blockId === null)
|
|
444
|
+
return null;
|
|
445
|
+
return {
|
|
446
|
+
type,
|
|
447
|
+
blockId,
|
|
448
|
+
size: restorePrecisionValue(value.size, elementScope, currentScope),
|
|
449
|
+
};
|
|
450
|
+
};
|
|
451
|
+
export const isValidLineHeadValue = (value) => {
|
|
452
|
+
if (value === undefined ||
|
|
453
|
+
value === null ||
|
|
454
|
+
!Object.values(LINE_HEAD).includes(value))
|
|
455
|
+
return null;
|
|
456
|
+
return value;
|
|
457
|
+
};
|
|
458
|
+
export const isValidZoomStepValue = (value) => {
|
|
459
|
+
if (value === undefined || value < MIN_ZOOM_STEP || value > MAX_ZOOM_STEP)
|
|
460
|
+
return DEFAULT_ZOOM_STEP;
|
|
461
|
+
return value;
|
|
462
|
+
};
|
|
463
|
+
export const isValidImageScaleValue = (value) => {
|
|
464
|
+
if (value === undefined || value[0] === 0 || value[1] === 0)
|
|
465
|
+
return [1, 1];
|
|
466
|
+
return value;
|
|
467
|
+
};
|
|
468
|
+
export const isValidBezierMirroringValue = (value) => {
|
|
469
|
+
if (value === undefined || !Object.values(BEZIER_MIRRORING).includes(value))
|
|
470
|
+
return undefined;
|
|
471
|
+
return value;
|
|
472
|
+
};
|
|
473
|
+
export const isValidStrokeSidePreferenceValue = (value) => {
|
|
474
|
+
if (value === undefined ||
|
|
475
|
+
!Object.values(STROKE_SIDE_PREFERENCE).includes(value))
|
|
476
|
+
return STROKE_SIDE_PREFERENCE.TOP;
|
|
477
|
+
return value;
|
|
478
|
+
};
|
|
479
|
+
export const isValidStrokeCapValue = (value) => {
|
|
480
|
+
if (value === undefined || !Object.values(STROKE_CAP).includes(value))
|
|
481
|
+
return STROKE_CAP.BUTT;
|
|
482
|
+
return value;
|
|
483
|
+
};
|
|
484
|
+
export const isValidStrokeJoinValue = (value) => {
|
|
485
|
+
if (value === undefined || !Object.values(STROKE_JOIN).includes(value))
|
|
486
|
+
return STROKE_JOIN.MITER;
|
|
487
|
+
return value;
|
|
488
|
+
};
|
|
489
|
+
export const isValidStrokeDashValue = (value) => {
|
|
490
|
+
if (!value || !Array.isArray(value))
|
|
491
|
+
return [];
|
|
492
|
+
return value;
|
|
493
|
+
};
|
|
494
|
+
export const isValidStrokeMiterLimitValue = (value) => {
|
|
495
|
+
if (value === undefined || value < 0 || value > 100)
|
|
496
|
+
return 4;
|
|
497
|
+
return value;
|
|
498
|
+
};
|
|
499
|
+
export const isValidBlendingValue = (value) => {
|
|
500
|
+
if (value === undefined || !Object.values(BLENDING).includes(value))
|
|
501
|
+
return undefined;
|
|
502
|
+
return value;
|
|
503
|
+
};
|
|
504
|
+
export const validateElementContent = ({ content, defaultContent, }) => {
|
|
505
|
+
var _a;
|
|
506
|
+
return {
|
|
507
|
+
preference: isValidFillStyleValue(content === null || content === void 0 ? void 0 : content.preference),
|
|
508
|
+
src: (_a = content === null || content === void 0 ? void 0 : content.src) !== null && _a !== void 0 ? _a : defaultContent.src,
|
|
509
|
+
visible: isValidBoolean(content === null || content === void 0 ? void 0 : content.visible, defaultContent.visible),
|
|
510
|
+
opacity: isValidPercentageValue(content === null || content === void 0 ? void 0 : content.opacity, defaultContent.opacity),
|
|
511
|
+
tiling: (content === null || content === void 0 ? void 0 : content.tiling) || defaultContent.tiling,
|
|
512
|
+
};
|
|
513
|
+
};
|
|
514
|
+
export const validateStrokeStyle = (style) => {
|
|
515
|
+
if (!style) {
|
|
516
|
+
return {
|
|
517
|
+
preference: STROKE_PREFERENCE.SOLID,
|
|
518
|
+
cap: STROKE_CAP.BUTT,
|
|
519
|
+
join: STROKE_JOIN.MITER,
|
|
520
|
+
dash: [],
|
|
521
|
+
miterLimit: 4,
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
return {
|
|
525
|
+
preference: isValidStrokePreferenceValue(style.preference),
|
|
526
|
+
cap: isValidStrokeCapValue(style.cap),
|
|
527
|
+
join: isValidStrokeJoinValue(style.join),
|
|
528
|
+
dash: isValidStrokeDashValue(style.dash),
|
|
529
|
+
miterLimit: isValidStrokeMiterLimitValue(style.miterLimit),
|
|
530
|
+
};
|
|
531
|
+
};
|
|
532
|
+
const validateStrokeSides = (sides) => {
|
|
533
|
+
if (!sides)
|
|
534
|
+
return undefined;
|
|
535
|
+
return {
|
|
536
|
+
preference: isValidStrokeSidePreferenceValue(sides.preference),
|
|
537
|
+
values: sides.values || undefined,
|
|
538
|
+
};
|
|
539
|
+
};
|
|
540
|
+
export const validateStroke = (stroke, elementScope, currentScope) => {
|
|
541
|
+
var _a;
|
|
542
|
+
return {
|
|
543
|
+
content: validateElementContent({
|
|
544
|
+
content: stroke === null || stroke === void 0 ? void 0 : stroke.content,
|
|
545
|
+
defaultContent: DEFAULT_ELEMENT_PROPS.stroke.content,
|
|
546
|
+
}),
|
|
547
|
+
placement: (_a = stroke === null || stroke === void 0 ? void 0 : stroke.placement) !== null && _a !== void 0 ? _a : STROKE_PLACEMENT.CENTER,
|
|
548
|
+
width: restorePrecisionValue(stroke === null || stroke === void 0 ? void 0 : stroke.width, elementScope, currentScope, DEFAULT_ELEMENT_PROPS.stroke.width.value),
|
|
549
|
+
style: validateStrokeStyle(stroke === null || stroke === void 0 ? void 0 : stroke.style),
|
|
550
|
+
strokeSides: validateStrokeSides(stroke === null || stroke === void 0 ? void 0 : stroke.strokeSides),
|
|
551
|
+
};
|
|
552
|
+
};
|
|
553
|
+
export const validateBackground = (bg) => {
|
|
554
|
+
return {
|
|
555
|
+
content: validateElementContent({
|
|
556
|
+
content: bg === null || bg === void 0 ? void 0 : bg.content,
|
|
557
|
+
defaultContent: DEFAULT_ELEMENT_PROPS.background.content,
|
|
558
|
+
}),
|
|
559
|
+
};
|
|
560
|
+
};
|
|
561
|
+
export const isValidFinitePositiveByteValue = (value, defaultValue) => {
|
|
562
|
+
if (value === undefined || !Number.isFinite(value)) {
|
|
563
|
+
return defaultValue;
|
|
564
|
+
}
|
|
565
|
+
const roundedValue = Math.round(value);
|
|
566
|
+
return Math.max(0, Math.min(255, roundedValue));
|
|
567
|
+
};
|
|
568
|
+
export const isValidPolygonSides = (sides) => {
|
|
569
|
+
if (sides >= 3) {
|
|
570
|
+
if (Number.isInteger(sides)) {
|
|
571
|
+
return sides;
|
|
572
|
+
}
|
|
573
|
+
else {
|
|
574
|
+
return Math.round(sides);
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
return DEFAULT_POLYGON_SIDES;
|
|
578
|
+
};
|
|
579
|
+
export const isValidRadianValue = (value, defaultValue) => {
|
|
580
|
+
if (value === undefined || !Number.isFinite(value)) {
|
|
581
|
+
return defaultValue;
|
|
582
|
+
}
|
|
583
|
+
if (value > Math.PI * 2 || value < -Math.PI * 2) {
|
|
584
|
+
return defaultValue;
|
|
585
|
+
}
|
|
586
|
+
return value;
|
|
587
|
+
};
|
|
588
|
+
/**
|
|
589
|
+
* Validates a Percentage value.
|
|
590
|
+
* Returns a clamped value within the <0,1> range or a provided default.
|
|
591
|
+
*/
|
|
592
|
+
export const isValidPercentageValue = (value, defaultValue, allowNegative = false) => {
|
|
593
|
+
if (value === undefined || !Number.isFinite(value)) {
|
|
594
|
+
return defaultValue;
|
|
595
|
+
}
|
|
596
|
+
if (value > 1 && value <= 100) {
|
|
597
|
+
value /= 100;
|
|
598
|
+
}
|
|
599
|
+
return Math.max(allowNegative ? -1 : 0, Math.min(1, value));
|
|
600
|
+
};
|
|
601
|
+
export const isValidBoolean = (value, defaultValue = false) => {
|
|
602
|
+
return typeof value === "boolean" ? value : defaultValue;
|
|
603
|
+
};
|
|
604
|
+
/**
|
|
605
|
+
* Ensures the supplied easing function is valid. Falls back to the default easing otherwise.
|
|
606
|
+
*/
|
|
607
|
+
export const isValidFunction = (value, defaultFn) => {
|
|
608
|
+
if (typeof value === "function")
|
|
609
|
+
return value;
|
|
610
|
+
if (typeof value === "string" && isEncodedFunctionString(value)) {
|
|
611
|
+
const revived = reviveEncodedFunction(value);
|
|
612
|
+
if (typeof revived === "function")
|
|
613
|
+
return revived;
|
|
614
|
+
}
|
|
615
|
+
return defaultFn;
|
|
616
|
+
};
|
|
617
|
+
export const isValidColor = (value, defaultValue = "#000000") => {
|
|
618
|
+
const color = tinycolor(value);
|
|
619
|
+
return color.isValid() ? color.toHexString() : defaultValue;
|
|
620
|
+
};
|
|
621
|
+
/**
|
|
622
|
+
* Validates a string value.
|
|
623
|
+
* Returns the string if valid, otherwise returns the provided defaultValue or an empty string.
|
|
624
|
+
*/
|
|
625
|
+
export const isValidString = (value, defaultValue = "") => {
|
|
626
|
+
if (typeof value !== "string")
|
|
627
|
+
return defaultValue;
|
|
628
|
+
if (value.trim().length === 0)
|
|
629
|
+
return defaultValue;
|
|
630
|
+
return value;
|
|
631
|
+
};
|
|
632
|
+
export const isValidExternalFileId = (value, defaultValue = "") => {
|
|
633
|
+
if (typeof value !== "string")
|
|
634
|
+
return defaultValue;
|
|
635
|
+
if (value.trim().length === 0)
|
|
636
|
+
return defaultValue;
|
|
637
|
+
return value;
|
|
638
|
+
};
|
|
639
|
+
/**
|
|
640
|
+
* Validates a value to ensure it is or can be converted to a non-empty Uint8Array.
|
|
641
|
+
*
|
|
642
|
+
* This function handles three types of input:
|
|
643
|
+
* 1. An existing `Uint8Array`.
|
|
644
|
+
* 2. A Base64-encoded string.
|
|
645
|
+
* 3. A full Data URL string (e.g., "data:image/png;base64,...").
|
|
646
|
+
*
|
|
647
|
+
* @param value The unknown value to validate.
|
|
648
|
+
* @returns A valid, non-empty `Uint8Array` if the conversion is successful, otherwise `undefined`.
|
|
649
|
+
*/
|
|
650
|
+
export const isValidUint8Array = (value) => {
|
|
651
|
+
if (value instanceof Uint8Array) {
|
|
652
|
+
return value.byteLength > 0 ? value : undefined;
|
|
653
|
+
}
|
|
654
|
+
if (typeof value === "string") {
|
|
655
|
+
let base64String = value;
|
|
656
|
+
if (value.startsWith("data:")) {
|
|
657
|
+
const commaIndex = value.indexOf(",");
|
|
658
|
+
if (commaIndex === -1) {
|
|
659
|
+
console.warn("Invalid Data URL format: missing comma.");
|
|
660
|
+
return undefined; // Malformed Data URL
|
|
661
|
+
}
|
|
662
|
+
// Ensure it's a base64-encoded Data URL
|
|
663
|
+
const header = value.substring(0, commaIndex);
|
|
664
|
+
if (!header.includes(";base64")) {
|
|
665
|
+
console.warn("Unsupported Data URL: only base64 encoding is supported.");
|
|
666
|
+
return undefined;
|
|
667
|
+
}
|
|
668
|
+
// Extract the actual base64 payload
|
|
669
|
+
base64String = value.substring(commaIndex + 1);
|
|
670
|
+
}
|
|
671
|
+
try {
|
|
672
|
+
if (base64String.trim().length === 0) {
|
|
673
|
+
return undefined;
|
|
674
|
+
}
|
|
675
|
+
const decodedData = base64ToUint8Array(base64String);
|
|
676
|
+
return decodedData.byteLength > 0 ? decodedData : undefined;
|
|
677
|
+
}
|
|
678
|
+
catch (error) {
|
|
679
|
+
console.warn("Failed to decode base64 string:", error);
|
|
680
|
+
return undefined;
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
return undefined;
|
|
684
|
+
};
|
|
685
|
+
/**
|
|
686
|
+
* Validates a Standard id.
|
|
687
|
+
* Returns the id if valid and present in standards, otherwise returns the default DUC standard id.
|
|
688
|
+
*/
|
|
689
|
+
export const isValidStandardId = (id, standards, defaultId = PREDEFINED_STANDARDS.DUC) => {
|
|
690
|
+
const validId = isValidString(id);
|
|
691
|
+
if (isStandardIdPresent(validId, standards))
|
|
692
|
+
return validId;
|
|
693
|
+
return defaultId;
|
|
694
|
+
};
|
|
695
|
+
/**
|
|
696
|
+
* Validates a block id.
|
|
697
|
+
* Returns the id if present in restored blocks, otherwise returns null.
|
|
698
|
+
*/
|
|
699
|
+
export const isValidBlockId = (blockId, blocks) => {
|
|
700
|
+
const validId = isValidString(blockId);
|
|
701
|
+
if (blocks.some((b) => b.id === validId))
|
|
702
|
+
return validId;
|
|
703
|
+
return null;
|
|
704
|
+
};
|
|
705
|
+
/**
|
|
706
|
+
* A generic helper to validate an enum value from a lookup object.
|
|
707
|
+
* @param value The value to check.
|
|
708
|
+
* @param enumObject The object containing valid enum values (e.g., VIEWPORT_SHADE_PLOT).
|
|
709
|
+
* @param defaultValue The value to return if the input is invalid.
|
|
710
|
+
*/
|
|
711
|
+
export const isValidEnumValue = (value, enumObject, defaultValue) => {
|
|
712
|
+
if (value !== undefined && Object.values(enumObject).includes(value)) {
|
|
713
|
+
return value;
|
|
714
|
+
}
|
|
715
|
+
return defaultValue;
|
|
716
|
+
};
|