@wcardinal/wcardinal-ui 0.150.2 → 0.154.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/types/wcardinal/ui/d-chart-axis-base-options-parser.d.ts +4 -0
- package/dist/types/wcardinal/ui/d-chart-axis-base-options.d.ts +7 -1
- package/dist/types/wcardinal/ui/d-chart-coordinate-container-sub-impl.d.ts +2 -1
- package/dist/types/wcardinal/ui/d-chart-coordinate-direction.d.ts +5 -0
- package/dist/types/wcardinal/ui/d-chart-coordinate-linear-tick.d.ts +13 -8
- package/dist/types/wcardinal/ui/d-chart-coordinate-linear.d.ts +18 -14
- package/dist/types/wcardinal/ui/d-chart-coordinate-log-tick.d.ts +14 -7
- package/dist/types/wcardinal/ui/d-chart-coordinate-log.d.ts +18 -14
- package/dist/types/wcardinal/ui/d-chart-coordinate-tick-major-step-function.d.ts +1 -0
- package/dist/types/wcardinal/ui/d-chart-coordinate-tick-minor-step-function.d.ts +1 -0
- package/dist/types/wcardinal/ui/d-chart-coordinate-tick.d.ts +13 -0
- package/dist/types/wcardinal/ui/d-chart-coordinate-transform-impl.d.ts +8 -3
- package/dist/types/wcardinal/ui/d-chart-coordinate-transform.d.ts +6 -1
- package/dist/types/wcardinal/ui/d-chart-coordinate.d.ts +18 -7
- package/dist/types/wcardinal/ui/d-diagram-data-remote.d.ts +1 -1
- package/dist/types/wcardinal/ui/d-diagram-data.d.ts +8 -8
- package/dist/types/wcardinal/ui/d-view-constraint.d.ts +5 -0
- package/dist/types/wcardinal/ui/d-view-gesture-impl.d.ts +3 -1
- package/dist/types/wcardinal/ui/d-view-impl.d.ts +3 -0
- package/dist/types/wcardinal/ui/d-view-transform-impl.d.ts +4 -2
- package/dist/types/wcardinal/ui/d-view.d.ts +3 -0
- package/dist/types/wcardinal/ui/index.d.ts +5 -0
- package/dist/types/wcardinal/ui/shape/action/{e-shape-action-value-deserializer.d.ts → deserialize-action-value.d.ts} +1 -4
- package/dist/types/wcardinal/ui/shape/action/e-shape-action-runtimes.d.ts +3 -3
- package/dist/types/wcardinal/ui/shape/action/index.d.ts +1 -1
- package/dist/types/wcardinal/ui/shape/e-shape-deserializers.d.ts +15 -4
- package/dist/types/wcardinal/ui/shape/index.d.ts +0 -3
- package/dist/types/wcardinal/ui/shape/variant/deserialize-all.d.ts +4 -0
- package/dist/types/wcardinal/ui/shape/variant/deserialize-bar.d.ts +1 -1
- package/dist/types/wcardinal/ui/shape/variant/deserialize-base.d.ts +4 -0
- package/dist/types/wcardinal/ui/shape/variant/deserialize-button.d.ts +1 -1
- package/dist/types/wcardinal/ui/shape/variant/deserialize-circle.d.ts +1 -1
- package/dist/types/wcardinal/ui/shape/variant/deserialize-connector-line.d.ts +2 -2
- package/dist/types/wcardinal/ui/shape/variant/deserialize-gradient.d.ts +2 -0
- package/dist/types/wcardinal/ui/shape/variant/deserialize-group-shadowed.d.ts +1 -1
- package/dist/types/wcardinal/ui/shape/variant/deserialize-group.d.ts +1 -1
- package/dist/types/wcardinal/ui/shape/variant/deserialize-image-sdf.d.ts +1 -1
- package/dist/types/wcardinal/ui/shape/variant/deserialize-image.d.ts +1 -1
- package/dist/types/wcardinal/ui/shape/variant/deserialize-label.d.ts +1 -1
- package/dist/types/wcardinal/ui/shape/variant/deserialize-line-of-circles.d.ts +1 -1
- package/dist/types/wcardinal/ui/shape/variant/deserialize-line-of-rectangle-roundeds.d.ts +1 -1
- package/dist/types/wcardinal/ui/shape/variant/deserialize-line-of-rectangles.d.ts +1 -1
- package/dist/types/wcardinal/ui/shape/variant/deserialize-line-of-triangle-roundeds.d.ts +1 -1
- package/dist/types/wcardinal/ui/shape/variant/deserialize-line-of-triangles.d.ts +1 -1
- package/dist/types/wcardinal/ui/shape/variant/deserialize-line.d.ts +1 -1
- package/dist/types/wcardinal/ui/shape/variant/deserialize-null.d.ts +1 -1
- package/dist/types/wcardinal/ui/shape/variant/deserialize-rectangle-pivoted.d.ts +1 -1
- package/dist/types/wcardinal/ui/shape/variant/deserialize-rectangle-rounded.d.ts +1 -1
- package/dist/types/wcardinal/ui/shape/variant/deserialize-rectangle.d.ts +1 -1
- package/dist/types/wcardinal/ui/shape/variant/deserialize-triangle-rounded.d.ts +1 -1
- package/dist/types/wcardinal/ui/shape/variant/deserialize-triangle.d.ts +1 -1
- package/dist/types/wcardinal/ui/shape/variant/deserialize.d.ts +4 -0
- package/dist/types/wcardinal/ui/shape/variant/e-shape-embeddeds.d.ts +1 -2
- package/dist/types/wcardinal/ui/shape/variant/e-shape-line-of-circles.d.ts +2 -1
- package/dist/types/wcardinal/ui/shape/variant/e-shape-line-of-rectangle-roundeds.d.ts +2 -1
- package/dist/types/wcardinal/ui/shape/variant/e-shape-line-of-rectangles.d.ts +2 -1
- package/dist/types/wcardinal/ui/shape/variant/e-shape-line-of-triangle-roundeds.d.ts +2 -1
- package/dist/types/wcardinal/ui/shape/variant/e-shape-line-of-triangles.d.ts +2 -1
- package/dist/types/wcardinal/ui/shape/variant/index.d.ts +11 -2
- package/dist/types/wcardinal/ui/shape/variant/to-gradient-image-url.d.ts +2 -0
- package/dist/types/wcardinal/ui/shape/variant/to-gradient-serialized.d.ts +2 -0
- package/dist/types/wcardinal/ui/shape/variant/to-image-element.d.ts +1 -0
- package/dist/types/wcardinal/ui/shape/variant/to-resized.d.ts +3 -0
- package/dist/types/wcardinal/ui/shape/variant/to-size-normalized.d.ts +1 -0
- package/dist/types/wcardinal/ui/shape/variant/to-size-rounded.d.ts +1 -0
- package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-chart-axis-base.d.ts +4 -0
- package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-chart-coordinate-tick.d.ts +4 -0
- package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-chart-coordinate-transform.d.ts +4 -0
- package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-chart-coordinate.d.ts +4 -0
- package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-chart-plot-area.d.ts +1 -0
- package/dist/types/wcardinal/ui/theme/dark/index.d.ts +3 -2
- package/dist/types/wcardinal/ui/theme/white/d-theme-white-chart-axis-base.d.ts +4 -0
- package/dist/types/wcardinal/ui/theme/white/d-theme-white-chart-coordinate-tick.d.ts +4 -0
- package/dist/types/wcardinal/ui/theme/white/d-theme-white-chart-coordinate-transform.d.ts +4 -0
- package/dist/types/wcardinal/ui/theme/white/d-theme-white-chart-coordinate.d.ts +4 -0
- package/dist/types/wcardinal/ui/theme/white/d-theme-white-chart-plot-area.d.ts +1 -0
- package/dist/types/wcardinal/ui/theme/white/index.d.ts +3 -2
- package/dist/wcardinal/ui/d-chart-axis-base-options-parser.js +7 -5
- package/dist/wcardinal/ui/d-chart-axis-base-options-parser.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-axis-base-options.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-axis-base.js +16 -8
- package/dist/wcardinal/ui/d-chart-axis-base.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-coordinate-container-impl.js +1 -1
- package/dist/wcardinal/ui/d-chart-coordinate-container-impl.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-coordinate-container-sub-impl.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-coordinate-direction.js +9 -0
- package/dist/wcardinal/ui/d-chart-coordinate-direction.js.map +1 -0
- package/dist/wcardinal/ui/d-chart-coordinate-linear-tick.js +64 -29
- package/dist/wcardinal/ui/d-chart-coordinate-linear-tick.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-coordinate-linear.js +41 -8
- package/dist/wcardinal/ui/d-chart-coordinate-linear.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-coordinate-log-tick.js +53 -28
- package/dist/wcardinal/ui/d-chart-coordinate-log-tick.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-coordinate-log.js +41 -8
- package/dist/wcardinal/ui/d-chart-coordinate-log.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-coordinate-tick-major-step-function.js +6 -0
- package/dist/wcardinal/ui/d-chart-coordinate-tick-major-step-function.js.map +1 -0
- package/dist/wcardinal/ui/d-chart-coordinate-tick-minor-step-function.js +6 -0
- package/dist/wcardinal/ui/d-chart-coordinate-tick-minor-step-function.js.map +1 -0
- package/dist/wcardinal/ui/d-chart-coordinate-tick.js +6 -0
- package/dist/wcardinal/ui/d-chart-coordinate-tick.js.map +1 -0
- package/dist/wcardinal/ui/d-chart-coordinate-transform-impl.js +23 -5
- package/dist/wcardinal/ui/d-chart-coordinate-transform-impl.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-coordinate-transform.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-coordinate.js +1 -4
- package/dist/wcardinal/ui/d-chart-coordinate.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-series-linear.js +43 -34
- package/dist/wcardinal/ui/d-chart-series-linear.js.map +1 -1
- package/dist/wcardinal/ui/d-diagram-data-remote.js +2 -0
- package/dist/wcardinal/ui/d-diagram-data-remote.js.map +1 -1
- package/dist/wcardinal/ui/d-diagram-data.js +16 -0
- package/dist/wcardinal/ui/d-diagram-data.js.map +1 -1
- package/dist/wcardinal/ui/d-diagrams.js +2 -2
- package/dist/wcardinal/ui/d-diagrams.js.map +1 -1
- package/dist/wcardinal/ui/d-view-constraint.js +6 -0
- package/dist/wcardinal/ui/d-view-constraint.js.map +1 -0
- package/dist/wcardinal/ui/d-view-gesture-impl.js +3 -3
- package/dist/wcardinal/ui/d-view-gesture-impl.js.map +1 -1
- package/dist/wcardinal/ui/d-view-impl.js +16 -5
- package/dist/wcardinal/ui/d-view-impl.js.map +1 -1
- package/dist/wcardinal/ui/d-view-transform-impl.js +6 -7
- package/dist/wcardinal/ui/d-view-transform-impl.js.map +1 -1
- package/dist/wcardinal/ui/d-view.js.map +1 -1
- package/dist/wcardinal/ui/index.js +5 -0
- package/dist/wcardinal/ui/index.js.map +1 -1
- package/dist/wcardinal/ui/shape/action/deserialize-action-value.js +109 -0
- package/dist/wcardinal/ui/shape/action/deserialize-action-value.js.map +1 -0
- package/dist/wcardinal/ui/shape/action/e-shape-action-runtime-transform-resize-height-absolute.js +2 -2
- package/dist/wcardinal/ui/shape/action/e-shape-action-runtime-transform-resize-height-absolute.js.map +1 -1
- package/dist/wcardinal/ui/shape/action/e-shape-action-runtime-transform-resize-height-relative.js +2 -2
- package/dist/wcardinal/ui/shape/action/e-shape-action-runtime-transform-resize-height-relative.js.map +1 -1
- package/dist/wcardinal/ui/shape/action/e-shape-action-runtime-transform-resize-size-absolute.js +2 -2
- package/dist/wcardinal/ui/shape/action/e-shape-action-runtime-transform-resize-size-absolute.js.map +1 -1
- package/dist/wcardinal/ui/shape/action/e-shape-action-runtime-transform-resize-size-relative.js +2 -2
- package/dist/wcardinal/ui/shape/action/e-shape-action-runtime-transform-resize-size-relative.js.map +1 -1
- package/dist/wcardinal/ui/shape/action/e-shape-action-runtime-transform-resize-width-absolute.js +2 -2
- package/dist/wcardinal/ui/shape/action/e-shape-action-runtime-transform-resize-width-absolute.js.map +1 -1
- package/dist/wcardinal/ui/shape/action/e-shape-action-runtime-transform-resize-width-relative.js +2 -2
- package/dist/wcardinal/ui/shape/action/e-shape-action-runtime-transform-resize-width-relative.js.map +1 -1
- package/dist/wcardinal/ui/shape/action/e-shape-action-runtimes.js +7 -2
- package/dist/wcardinal/ui/shape/action/e-shape-action-runtimes.js.map +1 -1
- package/dist/wcardinal/ui/shape/action/index.js +1 -1
- package/dist/wcardinal/ui/shape/action/index.js.map +1 -1
- package/dist/wcardinal/ui/shape/e-shape-deserializers.js +7 -1
- package/dist/wcardinal/ui/shape/e-shape-deserializers.js.map +1 -1
- package/dist/wcardinal/ui/shape/e-shape-transforms.js +3 -3
- package/dist/wcardinal/ui/shape/e-shape-transforms.js.map +1 -1
- package/dist/wcardinal/ui/shape/index.js +0 -3
- package/dist/wcardinal/ui/shape/index.js.map +1 -1
- package/dist/wcardinal/ui/shape/load/load-shape-connector-line.js +3 -3
- package/dist/wcardinal/ui/shape/load/load-shape-connector-line.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/create-image-sdf.js +3 -3
- package/dist/wcardinal/ui/shape/variant/create-image-sdf.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/create-image.js +2 -2
- package/dist/wcardinal/ui/shape/variant/create-image.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/deserialize-all.js +32 -0
- package/dist/wcardinal/ui/shape/variant/deserialize-all.js.map +1 -0
- package/dist/wcardinal/ui/shape/variant/deserialize-bar.js +4 -4
- package/dist/wcardinal/ui/shape/variant/deserialize-bar.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/deserialize-base.js +100 -0
- package/dist/wcardinal/ui/shape/variant/deserialize-base.js.map +1 -0
- package/dist/wcardinal/ui/shape/variant/deserialize-button.js +4 -5
- package/dist/wcardinal/ui/shape/variant/deserialize-button.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/deserialize-circle.js +3 -3
- package/dist/wcardinal/ui/shape/variant/deserialize-circle.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/deserialize-connector-line.js +4 -4
- package/dist/wcardinal/ui/shape/variant/deserialize-connector-line.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/deserialize-embedded.js +15 -2
- package/dist/wcardinal/ui/shape/variant/deserialize-embedded.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/deserialize-gradient.js +34 -0
- package/dist/wcardinal/ui/shape/variant/deserialize-gradient.js.map +1 -0
- package/dist/wcardinal/ui/shape/variant/deserialize-group-shadowed.js +4 -4
- package/dist/wcardinal/ui/shape/variant/deserialize-group-shadowed.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/deserialize-group.js +4 -4
- package/dist/wcardinal/ui/shape/variant/deserialize-group.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/deserialize-image-sdf.js +3 -3
- package/dist/wcardinal/ui/shape/variant/deserialize-image-sdf.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/deserialize-image.js +3 -3
- package/dist/wcardinal/ui/shape/variant/deserialize-image.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/deserialize-label.js +3 -3
- package/dist/wcardinal/ui/shape/variant/deserialize-label.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/deserialize-line-of-circles.js +3 -3
- package/dist/wcardinal/ui/shape/variant/deserialize-line-of-circles.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/deserialize-line-of-rectangle-roundeds.js +3 -3
- package/dist/wcardinal/ui/shape/variant/deserialize-line-of-rectangle-roundeds.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/deserialize-line-of-rectangles.js +3 -3
- package/dist/wcardinal/ui/shape/variant/deserialize-line-of-rectangles.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/deserialize-line-of-triangle-roundeds.js +3 -3
- package/dist/wcardinal/ui/shape/variant/deserialize-line-of-triangle-roundeds.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/deserialize-line-of-triangles.js +3 -3
- package/dist/wcardinal/ui/shape/variant/deserialize-line-of-triangles.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/deserialize-line.js +4 -4
- package/dist/wcardinal/ui/shape/variant/deserialize-line.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/deserialize-null.js +3 -3
- package/dist/wcardinal/ui/shape/variant/deserialize-null.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/deserialize-rectangle-pivoted.js +3 -3
- package/dist/wcardinal/ui/shape/variant/deserialize-rectangle-pivoted.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/deserialize-rectangle-rounded.js +3 -3
- package/dist/wcardinal/ui/shape/variant/deserialize-rectangle-rounded.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/deserialize-rectangle.js +3 -3
- package/dist/wcardinal/ui/shape/variant/deserialize-rectangle.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/deserialize-triangle-rounded.js +3 -3
- package/dist/wcardinal/ui/shape/variant/deserialize-triangle-rounded.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/deserialize-triangle.js +3 -3
- package/dist/wcardinal/ui/shape/variant/deserialize-triangle.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/deserialize.js +17 -0
- package/dist/wcardinal/ui/shape/variant/deserialize.js.map +1 -0
- package/dist/wcardinal/ui/shape/variant/e-shape-bar.js +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-bar.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-base.js +9 -2
- package/dist/wcardinal/ui/shape/variant/e-shape-base.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-button.js +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-button.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-circle.js +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-circle.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-connector-line.js +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-connector-line.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-embeddeds.js +0 -13
- package/dist/wcardinal/ui/shape/variant/e-shape-embeddeds.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-image-sdf.js +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-image-sdf.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-image.js +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-image.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-label.js +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-label.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-line-of-circles.js +4 -3
- package/dist/wcardinal/ui/shape/variant/e-shape-line-of-circles.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-line-of-rectangle-roundeds.js +4 -3
- package/dist/wcardinal/ui/shape/variant/e-shape-line-of-rectangle-roundeds.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-line-of-rectangles.js +4 -3
- package/dist/wcardinal/ui/shape/variant/e-shape-line-of-rectangles.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-line-of-triangle-roundeds.js +4 -3
- package/dist/wcardinal/ui/shape/variant/e-shape-line-of-triangle-roundeds.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-line-of-triangles.js +4 -3
- package/dist/wcardinal/ui/shape/variant/e-shape-line-of-triangles.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-line.js +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-line.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-null.js +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-null.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-rectangle-rounded.js +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-rectangle-rounded.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-rectangle.js +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-rectangle.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-triangle-rounded.js +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-triangle-rounded.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-triangle.js +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-triangle.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/index.js +11 -2
- package/dist/wcardinal/ui/shape/variant/index.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/to-gradient-image-url.js +35 -0
- package/dist/wcardinal/ui/shape/variant/to-gradient-image-url.js.map +1 -0
- package/dist/wcardinal/ui/shape/variant/to-gradient-serialized.js +15 -0
- package/dist/wcardinal/ui/shape/variant/to-gradient-serialized.js.map +1 -0
- package/dist/wcardinal/ui/shape/variant/to-image-element.js +32 -0
- package/dist/wcardinal/ui/shape/variant/to-image-element.js.map +1 -0
- package/dist/wcardinal/ui/shape/variant/to-resized.js +52 -0
- package/dist/wcardinal/ui/shape/variant/to-resized.js.map +1 -0
- package/dist/wcardinal/ui/shape/variant/to-size-normalized.js +12 -0
- package/dist/wcardinal/ui/shape/variant/to-size-normalized.js.map +1 -0
- package/dist/wcardinal/ui/shape/variant/to-size-rounded.js +8 -0
- package/dist/wcardinal/ui/shape/variant/to-size-rounded.js.map +1 -0
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-chart-axis-base.js +7 -1
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-chart-axis-base.js.map +1 -1
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-chart-coordinate-tick.js +23 -0
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-chart-coordinate-tick.js.map +1 -0
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-chart-coordinate-transform.js +14 -0
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-chart-coordinate-transform.js.map +1 -0
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-chart-coordinate.js +14 -0
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-chart-coordinate.js.map +1 -0
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-chart-plot-area.js +4 -0
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-chart-plot-area.js.map +1 -1
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-chart.js +1 -1
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-chart.js.map +1 -1
- package/dist/wcardinal/ui/theme/dark/index.js +3 -2
- package/dist/wcardinal/ui/theme/dark/index.js.map +1 -1
- package/dist/wcardinal/ui/theme/dark/load/load-theme-dark-chart.js +6 -4
- package/dist/wcardinal/ui/theme/dark/load/load-theme-dark-chart.js.map +1 -1
- package/dist/wcardinal/ui/theme/white/d-theme-white-chart-axis-base.js +8 -2
- package/dist/wcardinal/ui/theme/white/d-theme-white-chart-axis-base.js.map +1 -1
- package/dist/wcardinal/ui/theme/white/d-theme-white-chart-coordinate-tick.js +23 -0
- package/dist/wcardinal/ui/theme/white/d-theme-white-chart-coordinate-tick.js.map +1 -0
- package/dist/wcardinal/ui/theme/white/d-theme-white-chart-coordinate-transform.js +14 -0
- package/dist/wcardinal/ui/theme/white/d-theme-white-chart-coordinate-transform.js.map +1 -0
- package/dist/wcardinal/ui/theme/white/d-theme-white-chart-coordinate.js +14 -0
- package/dist/wcardinal/ui/theme/white/d-theme-white-chart-coordinate.js.map +1 -0
- package/dist/wcardinal/ui/theme/white/d-theme-white-chart-plot-area.js +4 -0
- package/dist/wcardinal/ui/theme/white/d-theme-white-chart-plot-area.js.map +1 -1
- package/dist/wcardinal/ui/theme/white/d-theme-white-chart.js +1 -1
- package/dist/wcardinal/ui/theme/white/d-theme-white-chart.js.map +1 -1
- package/dist/wcardinal/ui/theme/white/index.js +3 -2
- package/dist/wcardinal/ui/theme/white/index.js.map +1 -1
- package/dist/wcardinal/ui/theme/white/load/load-theme-white-chart.js +6 -4
- package/dist/wcardinal/ui/theme/white/load/load-theme-white-chart.js.map +1 -1
- package/dist/wcardinal-ui-theme-dark.js +37 -28
- package/dist/wcardinal-ui-theme-dark.min.js +2 -2
- package/dist/wcardinal-ui-theme-dark.min.js.map +1 -1
- package/dist/wcardinal-ui-theme-white.js +38 -29
- package/dist/wcardinal-ui-theme-white.min.js +2 -2
- package/dist/wcardinal-ui-theme-white.min.js.map +1 -1
- package/dist/wcardinal-ui.cjs.js +2859 -2630
- package/dist/wcardinal-ui.js +2219 -2008
- package/dist/wcardinal-ui.min.js +2 -2
- package/dist/wcardinal-ui.min.js.map +1 -1
- package/package.json +1 -1
- package/dist/types/wcardinal/ui/shape/e-shape-deserializer.d.ts +0 -10
- package/dist/types/wcardinal/ui/shape/e-shape-image-elements.d.ts +0 -6
- package/dist/types/wcardinal/ui/shape/e-shape-sizes.d.ts +0 -7
- package/dist/types/wcardinal/ui/shape/variant/e-shape-gradients.d.ts +0 -9
- package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-chart-coordinate-linear.d.ts +0 -5
- package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-chart-coordinate-log.d.ts +0 -5
- package/dist/types/wcardinal/ui/theme/white/d-theme-white-chart-coordinate-linear.d.ts +0 -5
- package/dist/types/wcardinal/ui/theme/white/d-theme-white-chart-coordinate-log.d.ts +0 -5
- package/dist/wcardinal/ui/shape/action/e-shape-action-value-deserializer.js +0 -115
- package/dist/wcardinal/ui/shape/action/e-shape-action-value-deserializer.js.map +0 -1
- package/dist/wcardinal/ui/shape/e-shape-deserializer.js +0 -143
- package/dist/wcardinal/ui/shape/e-shape-deserializer.js.map +0 -1
- package/dist/wcardinal/ui/shape/e-shape-image-elements.js +0 -35
- package/dist/wcardinal/ui/shape/e-shape-image-elements.js.map +0 -1
- package/dist/wcardinal/ui/shape/e-shape-sizes.js +0 -66
- package/dist/wcardinal/ui/shape/e-shape-sizes.js.map +0 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-gradients.js +0 -89
- package/dist/wcardinal/ui/shape/variant/e-shape-gradients.js.map +0 -1
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-chart-coordinate-linear.js +0 -26
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-chart-coordinate-linear.js.map +0 -1
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-chart-coordinate-log.js +0 -26
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-chart-coordinate-log.js.map +0 -1
- package/dist/wcardinal/ui/theme/white/d-theme-white-chart-coordinate-linear.js +0 -26
- package/dist/wcardinal/ui/theme/white/d-theme-white-chart-coordinate-linear.js.map +0 -1
- package/dist/wcardinal/ui/theme/white/d-theme-white-chart-coordinate-log.js +0 -26
- package/dist/wcardinal/ui/theme/white/d-theme-white-chart-coordinate-log.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { DDiagramSerializedItem } from "../d-diagram-serialized";
|
|
2
|
-
import { EShape } from "./e-shape";
|
|
3
|
-
import { EShapeResourceManagerDeserialization } from "./e-shape-resource-manager-deserialization";
|
|
4
|
-
import { EShapeUuidMapping } from "./e-shape-uuid-mapping";
|
|
5
|
-
export declare class EShapeDeserializer {
|
|
6
|
-
static toShape(item: DDiagramSerializedItem, manager: EShapeResourceManagerDeserialization): Promise<EShape> | EShape;
|
|
7
|
-
static deserialize<SHAPE extends EShape>(item: DDiagramSerializedItem, manager: EShapeResourceManagerDeserialization, result: SHAPE): Promise<SHAPE> | SHAPE;
|
|
8
|
-
static deserializeAll(serializeds: DDiagramSerializedItem[], manager: EShapeResourceManagerDeserialization): Promise<EShape[]> | null;
|
|
9
|
-
static onDeserialized(serializeds: DDiagramSerializedItem[], shapes: EShape[], mapping: EShapeUuidMapping, manager: EShapeResourceManagerDeserialization): void;
|
|
10
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { IPoint } from "pixi.js";
|
|
2
|
-
import { EShape } from "./e-shape";
|
|
3
|
-
export declare class EShapeSizes {
|
|
4
|
-
static toRounded(value: number): number;
|
|
5
|
-
static toNormalized(size: number): number;
|
|
6
|
-
static resize(shape: EShape, from: IPoint, to: IPoint, centerMode: boolean, isPerfect: boolean): void;
|
|
7
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { EShapeGradientLike } from "../e-shape-gradient";
|
|
2
|
-
import { EShapeResourceManagerSerialization } from "../e-shape-resource-manager-serialization";
|
|
3
|
-
export declare class EShapeGradients {
|
|
4
|
-
static serializeGradient(gradient: EShapeGradientLike): string;
|
|
5
|
-
static parseGradient(target: string): number[] | null;
|
|
6
|
-
static deserializeGradient(target: string): EShapeGradientLike | undefined;
|
|
7
|
-
static toGradientId(gradient: EShapeGradientLike | undefined, manager: EShapeResourceManagerSerialization): number;
|
|
8
|
-
static toGradientImageUrl(gradient: EShapeGradientLike): string;
|
|
9
|
-
}
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (C) 2019 Toshiba Corporation
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
import { isArray } from "../../util/is-array";
|
|
6
|
-
import { isNumber } from "../../util/is-number";
|
|
7
|
-
import { EShapeActionValueBlink } from "./e-shape-action-value-blink";
|
|
8
|
-
import { EShapeActionValueChangeColor } from "./e-shape-action-value-change-color";
|
|
9
|
-
import { EShapeActionValueChangeColorBrightness } from "./e-shape-action-value-change-color-brightness";
|
|
10
|
-
import { EShapeActionValueChangeColorCode } from "./e-shape-action-value-change-color-code";
|
|
11
|
-
import { EShapeActionValueChangeColorTarget } from "./e-shape-action-value-change-color-target";
|
|
12
|
-
import { EShapeActionValueChangeCursor } from "./e-shape-action-value-change-cursor";
|
|
13
|
-
import { EShapeActionValueChangeText } from "./e-shape-action-value-change-text";
|
|
14
|
-
import { EShapeActionValueEmitEvent } from "./e-shape-action-value-emit-event";
|
|
15
|
-
import { EShapeActionValueMisc } from "./e-shape-action-value-misc";
|
|
16
|
-
import { EShapeActionValueMiscGesture } from "./e-shape-action-value-misc-gesture";
|
|
17
|
-
import { EShapeActionValueMiscLayerGesture } from "./e-shape-action-value-misc-layer-gesture";
|
|
18
|
-
import { EShapeActionValueMiscLayerShowHide } from "./e-shape-action-value-misc-layer-show-hide";
|
|
19
|
-
import { EShapeActionValueMiscType } from "./e-shape-action-value-misc-type";
|
|
20
|
-
import { EShapeActionValueOpen } from "./e-shape-action-value-open";
|
|
21
|
-
import { EShapeActionValueShowHide } from "./e-shape-action-value-show-hide";
|
|
22
|
-
import { EShapeActionValueShowHideType } from "./e-shape-action-value-show-hide-type";
|
|
23
|
-
import { EShapeActionValueTransformMove } from "./e-shape-action-value-transform-move";
|
|
24
|
-
import { EShapeActionValueTransformResize } from "./e-shape-action-value-transform-resize";
|
|
25
|
-
import { EShapeActionValueTransformRotate } from "./e-shape-action-value-transform-rotate";
|
|
26
|
-
import { EShapeActionValueTransformType } from "./e-shape-action-value-transform-type";
|
|
27
|
-
import { EShapeActionValueType } from "./e-shape-action-value-type";
|
|
28
|
-
var EShapeActionValueDeserializer = /** @class */ (function () {
|
|
29
|
-
function EShapeActionValueDeserializer() {
|
|
30
|
-
}
|
|
31
|
-
EShapeActionValueDeserializer.toSerialized = function (resource) {
|
|
32
|
-
try {
|
|
33
|
-
var parsed = JSON.parse(resource);
|
|
34
|
-
if (isArray(parsed)) {
|
|
35
|
-
for (var i = 0, imax = parsed.length; i < imax; ++i) {
|
|
36
|
-
if (!isNumber(parsed[i])) {
|
|
37
|
-
return null;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
if (2 <= parsed.length) {
|
|
41
|
-
return parsed;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
catch (e) {
|
|
47
|
-
return null;
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
EShapeActionValueDeserializer.deserialize = function (id, manager) {
|
|
51
|
-
var action = manager.getAction(id);
|
|
52
|
-
if (action != null) {
|
|
53
|
-
return action;
|
|
54
|
-
}
|
|
55
|
-
var resources = manager.resources;
|
|
56
|
-
var resource = resources[id];
|
|
57
|
-
if (resource != null) {
|
|
58
|
-
var serialized = this.toSerialized(resource);
|
|
59
|
-
if (serialized != null) {
|
|
60
|
-
switch (serialized[0]) {
|
|
61
|
-
case EShapeActionValueType.SHOW_HIDE:
|
|
62
|
-
return EShapeActionValueShowHide.deserialize(serialized, manager);
|
|
63
|
-
case EShapeActionValueType.BLINK:
|
|
64
|
-
return EShapeActionValueBlink.deserialize(serialized, manager);
|
|
65
|
-
case EShapeActionValueType.CHANGE_COLOR:
|
|
66
|
-
case EShapeActionValueType.CHANGE_COLOR_LEGACY:
|
|
67
|
-
switch (serialized[3]) {
|
|
68
|
-
case EShapeActionValueChangeColorTarget.COLOR_AND_ALPHA:
|
|
69
|
-
case EShapeActionValueChangeColorTarget.COLOR:
|
|
70
|
-
case EShapeActionValueChangeColorTarget.ALPHA:
|
|
71
|
-
return EShapeActionValueChangeColor.deserialize(serialized, manager);
|
|
72
|
-
case EShapeActionValueChangeColorTarget.CODE:
|
|
73
|
-
return EShapeActionValueChangeColorCode.deserialize(serialized, manager);
|
|
74
|
-
case EShapeActionValueChangeColorTarget.BRIGHTNESS:
|
|
75
|
-
return EShapeActionValueChangeColorBrightness.deserialize(serialized, manager);
|
|
76
|
-
}
|
|
77
|
-
break;
|
|
78
|
-
case EShapeActionValueType.CHANGE_TEXT:
|
|
79
|
-
return EShapeActionValueChangeText.deserialize(serialized, manager);
|
|
80
|
-
case EShapeActionValueType.CHANGE_CURSOR:
|
|
81
|
-
return EShapeActionValueChangeCursor.deserialize(serialized, manager);
|
|
82
|
-
case EShapeActionValueType.EMIT_EVENT:
|
|
83
|
-
return EShapeActionValueEmitEvent.deserialize(serialized, manager);
|
|
84
|
-
case EShapeActionValueType.OPEN:
|
|
85
|
-
return EShapeActionValueOpen.deserialize(serialized, manager);
|
|
86
|
-
case EShapeActionValueType.TRANSFORM:
|
|
87
|
-
switch (serialized[2]) {
|
|
88
|
-
case EShapeActionValueTransformType.MOVE:
|
|
89
|
-
return EShapeActionValueTransformMove.deserialize(serialized, manager);
|
|
90
|
-
case EShapeActionValueTransformType.RESIZE:
|
|
91
|
-
return EShapeActionValueTransformResize.deserialize(serialized, manager);
|
|
92
|
-
case EShapeActionValueTransformType.ROTATE:
|
|
93
|
-
return EShapeActionValueTransformRotate.deserialize(serialized, manager);
|
|
94
|
-
}
|
|
95
|
-
break;
|
|
96
|
-
case EShapeActionValueType.MISC:
|
|
97
|
-
switch (serialized[2]) {
|
|
98
|
-
case EShapeActionValueMiscType.GESTURE:
|
|
99
|
-
return EShapeActionValueMiscGesture.deserialize(serialized, manager);
|
|
100
|
-
case EShapeActionValueMiscType.LAYER_SHOW_HIDE:
|
|
101
|
-
return EShapeActionValueMiscLayerShowHide.deserialize(serialized, manager);
|
|
102
|
-
case EShapeActionValueMiscType.LAYER_GESTURE:
|
|
103
|
-
return EShapeActionValueMiscLayerGesture.deserialize(serialized, manager);
|
|
104
|
-
default:
|
|
105
|
-
return EShapeActionValueMisc.deserialize(serialized, manager);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
return new EShapeActionValueShowHide(EShapeActionValueShowHideType.SHOW, "");
|
|
111
|
-
};
|
|
112
|
-
return EShapeActionValueDeserializer;
|
|
113
|
-
}());
|
|
114
|
-
export { EShapeActionValueDeserializer };
|
|
115
|
-
//# sourceMappingURL=e-shape-action-value-deserializer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"e-shape-action-value-deserializer.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/shape/action/e-shape-action-value-deserializer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAGhD,OAAO,EACN,sBAAsB,EAEtB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACN,4BAA4B,EAG5B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACN,sCAAsC,EAGtC,MAAM,gDAAgD,CAAC;AACxD,OAAO,EACN,gCAAgC,EAGhC,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,kCAAkC,EAAE,MAAM,4CAA4C,CAAC;AAChG,OAAO,EACN,6BAA6B,EAE7B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACN,2BAA2B,EAE3B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACN,0BAA0B,EAE1B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACN,qBAAqB,EAErB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACN,4BAA4B,EAE5B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACN,iCAAiC,EAEjC,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACN,kCAAkC,EAElC,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,yBAAyB,EAAE,MA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\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { isArray } from \"../../util/is-array\";\nimport { isNumber } from \"../../util/is-number\";\nimport { EShapeResourceManagerDeserialization } from \"../e-shape-resource-manager-deserialization\";\nimport { EShapeActionValue } from \"./e-shape-action-value\";\nimport {\n\tEShapeActionValueBlink,\n\tEShapeActionValueBlinkSerialized\n} from \"./e-shape-action-value-blink\";\nimport {\n\tEShapeActionValueChangeColor,\n\tEShapeActionValueChangeColorSerialized,\n\tEShapeActionValueChangeColorSerializedLegacy\n} from \"./e-shape-action-value-change-color\";\nimport {\n\tEShapeActionValueChangeColorBrightness,\n\tEShapeActionValueChangeColorBrightnessSerialized,\n\tEShapeActionValueChangeColorBrightnessSerializedLegacy\n} from \"./e-shape-action-value-change-color-brightness\";\nimport {\n\tEShapeActionValueChangeColorCode,\n\tEShapeActionValueChangeColorCodeSerialized,\n\tEShapeActionValueChangeColorCodeSerializedLegacy\n} from \"./e-shape-action-value-change-color-code\";\nimport { EShapeActionValueChangeColorTarget } from \"./e-shape-action-value-change-color-target\";\nimport {\n\tEShapeActionValueChangeCursor,\n\tEShapeActionValueChangeCursorSerialized\n} from \"./e-shape-action-value-change-cursor\";\nimport {\n\tEShapeActionValueChangeText,\n\tEShapeActionValueChangeTextSerialized\n} from \"./e-shape-action-value-change-text\";\nimport {\n\tEShapeActionValueEmitEvent,\n\tEShapeActionValueEmitEventSerialized\n} from \"./e-shape-action-value-emit-event\";\nimport {\n\tEShapeActionValueMisc,\n\tEShapeActionValueMiscSerialized\n} from \"./e-shape-action-value-misc\";\nimport {\n\tEShapeActionValueMiscGesture,\n\tEShapeActionValueMiscGestureSerialized\n} from \"./e-shape-action-value-misc-gesture\";\nimport {\n\tEShapeActionValueMiscLayerGesture,\n\tEShapeActionValueMiscLayerGestureSerialized\n} from \"./e-shape-action-value-misc-layer-gesture\";\nimport {\n\tEShapeActionValueMiscLayerShowHide,\n\tEShapeActionValueMiscLayerShowHideSerialized\n} from \"./e-shape-action-value-misc-layer-show-hide\";\nimport { EShapeActionValueMiscType } from \"./e-shape-action-value-misc-type\";\nimport {\n\tEShapeActionValueOpen,\n\tEShapeActionValueOpenSerialized\n} from \"./e-shape-action-value-open\";\nimport {\n\tEShapeActionValueShowHide,\n\tEShapeActionValueShowHideSerialized\n} from \"./e-shape-action-value-show-hide\";\nimport { EShapeActionValueShowHideType } from \"./e-shape-action-value-show-hide-type\";\nimport {\n\tEShapeActionValueTransformMove,\n\tEShapeActionValueTransformMoveSerialized\n} from \"./e-shape-action-value-transform-move\";\nimport {\n\tEShapeActionValueTransformResize,\n\tEShapeActionValueTransformResizeSerialized\n} from \"./e-shape-action-value-transform-resize\";\nimport {\n\tEShapeActionValueTransformRotate,\n\tEShapeActionValueTransformRotateSerialized\n} from \"./e-shape-action-value-transform-rotate\";\nimport { EShapeActionValueTransformType } from \"./e-shape-action-value-transform-type\";\nimport { EShapeActionValueType } from \"./e-shape-action-value-type\";\n\nexport type EShapeActionValueSerialized =\n\t| EShapeActionValueShowHideSerialized\n\t| EShapeActionValueBlinkSerialized\n\t| EShapeActionValueBlinkSerialized\n\t| EShapeActionValueChangeColorSerialized\n\t| EShapeActionValueChangeColorSerializedLegacy\n\t| EShapeActionValueChangeColorCodeSerialized\n\t| EShapeActionValueChangeColorCodeSerializedLegacy\n\t| EShapeActionValueChangeColorBrightnessSerialized\n\t| EShapeActionValueChangeColorBrightnessSerializedLegacy\n\t| EShapeActionValueChangeTextSerialized\n\t| EShapeActionValueChangeCursorSerialized\n\t| EShapeActionValueEmitEventSerialized\n\t| EShapeActionValueOpenSerialized\n\t| EShapeActionValueTransformMoveSerialized\n\t| EShapeActionValueTransformResizeSerialized\n\t| EShapeActionValueTransformRotateSerialized\n\t| EShapeActionValueMiscSerialized\n\t| EShapeActionValueMiscGestureSerialized\n\t| EShapeActionValueMiscLayerGestureSerialized\n\t| EShapeActionValueMiscLayerShowHideSerialized;\n\nexport class EShapeActionValueDeserializer {\n\tstatic toSerialized(resource: string): EShapeActionValueSerialized | null {\n\t\ttry {\n\t\t\tconst parsed = JSON.parse(resource);\n\t\t\tif (isArray(parsed)) {\n\t\t\t\tfor (let i = 0, imax = parsed.length; i < imax; ++i) {\n\t\t\t\t\tif (!isNumber(parsed[i])) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (2 <= parsed.length) {\n\t\t\t\t\treturn parsed as EShapeActionValueSerialized;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t} catch (e) {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tstatic deserialize(\n\t\tid: number,\n\t\tmanager: EShapeResourceManagerDeserialization\n\t): EShapeActionValue {\n\t\tconst action = manager.getAction(id);\n\t\tif (action != null) {\n\t\t\treturn action;\n\t\t}\n\n\t\tconst resources = manager.resources;\n\t\tconst resource = resources[id];\n\t\tif (resource != null) {\n\t\t\tconst serialized = this.toSerialized(resource);\n\t\t\tif (serialized != null) {\n\t\t\t\tswitch (serialized[0]) {\n\t\t\t\t\tcase EShapeActionValueType.SHOW_HIDE:\n\t\t\t\t\t\treturn EShapeActionValueShowHide.deserialize(serialized, manager);\n\t\t\t\t\tcase EShapeActionValueType.BLINK:\n\t\t\t\t\t\treturn EShapeActionValueBlink.deserialize(serialized, manager);\n\t\t\t\t\tcase EShapeActionValueType.CHANGE_COLOR:\n\t\t\t\t\tcase EShapeActionValueType.CHANGE_COLOR_LEGACY:\n\t\t\t\t\t\tswitch (serialized[3]) {\n\t\t\t\t\t\t\tcase EShapeActionValueChangeColorTarget.COLOR_AND_ALPHA:\n\t\t\t\t\t\t\tcase EShapeActionValueChangeColorTarget.COLOR:\n\t\t\t\t\t\t\tcase EShapeActionValueChangeColorTarget.ALPHA:\n\t\t\t\t\t\t\t\treturn EShapeActionValueChangeColor.deserialize(\n\t\t\t\t\t\t\t\t\tserialized,\n\t\t\t\t\t\t\t\t\tmanager\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tcase EShapeActionValueChangeColorTarget.CODE:\n\t\t\t\t\t\t\t\treturn EShapeActionValueChangeColorCode.deserialize(\n\t\t\t\t\t\t\t\t\tserialized,\n\t\t\t\t\t\t\t\t\tmanager\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tcase EShapeActionValueChangeColorTarget.BRIGHTNESS:\n\t\t\t\t\t\t\t\treturn EShapeActionValueChangeColorBrightness.deserialize(\n\t\t\t\t\t\t\t\t\tserialized,\n\t\t\t\t\t\t\t\t\tmanager\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase EShapeActionValueType.CHANGE_TEXT:\n\t\t\t\t\t\treturn EShapeActionValueChangeText.deserialize(serialized, manager);\n\t\t\t\t\tcase EShapeActionValueType.CHANGE_CURSOR:\n\t\t\t\t\t\treturn EShapeActionValueChangeCursor.deserialize(serialized, manager);\n\t\t\t\t\tcase EShapeActionValueType.EMIT_EVENT:\n\t\t\t\t\t\treturn EShapeActionValueEmitEvent.deserialize(serialized, manager);\n\t\t\t\t\tcase EShapeActionValueType.OPEN:\n\t\t\t\t\t\treturn EShapeActionValueOpen.deserialize(serialized, manager);\n\t\t\t\t\tcase EShapeActionValueType.TRANSFORM:\n\t\t\t\t\t\tswitch (serialized[2]) {\n\t\t\t\t\t\t\tcase EShapeActionValueTransformType.MOVE:\n\t\t\t\t\t\t\t\treturn EShapeActionValueTransformMove.deserialize(\n\t\t\t\t\t\t\t\t\tserialized,\n\t\t\t\t\t\t\t\t\tmanager\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tcase EShapeActionValueTransformType.RESIZE:\n\t\t\t\t\t\t\t\treturn EShapeActionValueTransformResize.deserialize(\n\t\t\t\t\t\t\t\t\tserialized,\n\t\t\t\t\t\t\t\t\tmanager\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tcase EShapeActionValueTransformType.ROTATE:\n\t\t\t\t\t\t\t\treturn EShapeActionValueTransformRotate.deserialize(\n\t\t\t\t\t\t\t\t\tserialized,\n\t\t\t\t\t\t\t\t\tmanager\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase EShapeActionValueType.MISC:\n\t\t\t\t\t\tswitch (serialized[2]) {\n\t\t\t\t\t\t\tcase EShapeActionValueMiscType.GESTURE:\n\t\t\t\t\t\t\t\treturn EShapeActionValueMiscGesture.deserialize(\n\t\t\t\t\t\t\t\t\tserialized,\n\t\t\t\t\t\t\t\t\tmanager\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tcase EShapeActionValueMiscType.LAYER_SHOW_HIDE:\n\t\t\t\t\t\t\t\treturn EShapeActionValueMiscLayerShowHide.deserialize(\n\t\t\t\t\t\t\t\t\tserialized,\n\t\t\t\t\t\t\t\t\tmanager\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tcase EShapeActionValueMiscType.LAYER_GESTURE:\n\t\t\t\t\t\t\t\treturn EShapeActionValueMiscLayerGesture.deserialize(\n\t\t\t\t\t\t\t\t\tserialized,\n\t\t\t\t\t\t\t\t\tmanager\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\treturn EShapeActionValueMisc.deserialize(serialized, manager);\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn new EShapeActionValueShowHide(EShapeActionValueShowHideType.SHOW, \"\");\n\t}\n}\n"]}
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (C) 2019 Toshiba Corporation
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
import { isString } from "../util/is-string";
|
|
6
|
-
import { EShapeActionValueDeserializer } from "./action/e-shape-action-value-deserializer";
|
|
7
|
-
import { EShapeDeserializers, EShapeOnDeserialized } from "./e-shape-deserializers";
|
|
8
|
-
import { EShapeImageElements } from "./e-shape-image-elements";
|
|
9
|
-
import { EShapeSizes } from "./e-shape-sizes";
|
|
10
|
-
import { EShapeUuidMappingImpl } from "./e-shape-uuid-mapping-impl";
|
|
11
|
-
import { EShapeGradients } from "./variant/e-shape-gradients";
|
|
12
|
-
import { EShapeNull } from "./variant/e-shape-null";
|
|
13
|
-
var EShapeDeserializer = /** @class */ (function () {
|
|
14
|
-
function EShapeDeserializer() {
|
|
15
|
-
}
|
|
16
|
-
EShapeDeserializer.toShape = function (item, manager) {
|
|
17
|
-
var shapeDeserializer = EShapeDeserializers[item[0]];
|
|
18
|
-
if (shapeDeserializer != null) {
|
|
19
|
-
var result = shapeDeserializer(item, manager);
|
|
20
|
-
if (result != null) {
|
|
21
|
-
return result;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
return EShapeDeserializer.deserialize(item, manager, new EShapeNull());
|
|
25
|
-
};
|
|
26
|
-
EShapeDeserializer.deserialize = function (item, manager, result) {
|
|
27
|
-
result.id = manager.resources[item[1]] || "";
|
|
28
|
-
var transform = result.transform;
|
|
29
|
-
transform.position.set(item[2], item[3]);
|
|
30
|
-
transform.rotation = item[6];
|
|
31
|
-
transform.skew.set(item[7], item[7]);
|
|
32
|
-
transform.pivot.set(item[21], item[22]);
|
|
33
|
-
result.size.set(EShapeSizes.toNormalized(item[4]), EShapeSizes.toNormalized(item[5]));
|
|
34
|
-
result.fill.deserialize(item[8], manager);
|
|
35
|
-
result.stroke.deserialize(item[9], manager);
|
|
36
|
-
result.cursor = manager.resources[item[10]] || "";
|
|
37
|
-
result.text.deserialize(item[11], manager);
|
|
38
|
-
result.data.deserialize(item[12], manager);
|
|
39
|
-
result.radius = item[13];
|
|
40
|
-
result.corner = item[14];
|
|
41
|
-
var item23 = item[23];
|
|
42
|
-
result.interactive = !!(item23 & 1);
|
|
43
|
-
var state = result.state;
|
|
44
|
-
state.isFocusable = !(item23 & 2);
|
|
45
|
-
state.isActive = !!(item23 & 4);
|
|
46
|
-
var item24 = item[24];
|
|
47
|
-
result.shortcut = 0 <= item24 ? manager.resources[item24] : undefined;
|
|
48
|
-
var item25 = item[25];
|
|
49
|
-
result.title = 0 <= item25 ? manager.resources[item25] : undefined;
|
|
50
|
-
var item26 = item[26];
|
|
51
|
-
result.uuid = item26 != null ? item26 : 0;
|
|
52
|
-
// Children
|
|
53
|
-
var childrenPromise = null;
|
|
54
|
-
var childrenSerialized = item[20];
|
|
55
|
-
if (0 < childrenSerialized.length) {
|
|
56
|
-
var childrenOrPromises = [];
|
|
57
|
-
for (var i = 0, imax = childrenSerialized.length; i < imax; ++i) {
|
|
58
|
-
childrenOrPromises.push(EShapeDeserializer.toShape(childrenSerialized[i], manager));
|
|
59
|
-
}
|
|
60
|
-
childrenPromise = Promise.all(childrenOrPromises).then(function (children) {
|
|
61
|
-
result.children = children;
|
|
62
|
-
for (var i = 0, imax = children.length; i < imax; ++i) {
|
|
63
|
-
children[i].parent = result;
|
|
64
|
-
}
|
|
65
|
-
result.onChildTransformChange();
|
|
66
|
-
result.toDirty();
|
|
67
|
-
return result;
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
// Action
|
|
71
|
-
var serializedActions = item[17];
|
|
72
|
-
for (var i = 0, imax = serializedActions.length; i < imax; ++i) {
|
|
73
|
-
result.action.add(EShapeActionValueDeserializer.deserialize(serializedActions[i], manager));
|
|
74
|
-
}
|
|
75
|
-
// Gradient
|
|
76
|
-
var gradientId = item[19];
|
|
77
|
-
if (0 <= gradientId && gradientId < manager.resources.length) {
|
|
78
|
-
var gradient = manager.resources[gradientId];
|
|
79
|
-
if (isString(gradient)) {
|
|
80
|
-
result.gradient = EShapeGradients.deserializeGradient(gradient);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
// Image
|
|
84
|
-
var imagePromise = null;
|
|
85
|
-
var imageId = item[18];
|
|
86
|
-
if (0 <= imageId && imageId < manager.resources.length) {
|
|
87
|
-
var imageSrc = manager.resources[imageId];
|
|
88
|
-
if (isString(imageSrc)) {
|
|
89
|
-
imagePromise = EShapeImageElements.toImageElement(imageSrc).then(function (imageElement) {
|
|
90
|
-
result.image = imageElement;
|
|
91
|
-
return result;
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
//
|
|
96
|
-
if (childrenPromise != null) {
|
|
97
|
-
if (imagePromise != null) {
|
|
98
|
-
return Promise.all([childrenPromise, imagePromise]).then(function () {
|
|
99
|
-
return result;
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
else {
|
|
103
|
-
return childrenPromise;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
if (imagePromise != null) {
|
|
108
|
-
return imagePromise;
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
return result;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
|
-
EShapeDeserializer.deserializeAll = function (serializeds, manager) {
|
|
116
|
-
var _this = this;
|
|
117
|
-
var shapes = [];
|
|
118
|
-
for (var i = 0, imax = serializeds.length; i < imax; ++i) {
|
|
119
|
-
shapes.push(EShapeDeserializer.toShape(serializeds[i], manager));
|
|
120
|
-
}
|
|
121
|
-
if (0 < shapes.length) {
|
|
122
|
-
return Promise.all(shapes).then(function (resolved) {
|
|
123
|
-
_this.onDeserialized(serializeds, resolved, new EShapeUuidMappingImpl(resolved), manager);
|
|
124
|
-
return resolved;
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
return null;
|
|
128
|
-
};
|
|
129
|
-
EShapeDeserializer.onDeserialized = function (serializeds, shapes, mapping, manager) {
|
|
130
|
-
for (var i = 0, imax = serializeds.length; i < imax; ++i) {
|
|
131
|
-
var serialized = serializeds[i];
|
|
132
|
-
var shape = shapes[i];
|
|
133
|
-
var onDeserialized = EShapeOnDeserialized[serialized[0]];
|
|
134
|
-
if (onDeserialized) {
|
|
135
|
-
onDeserialized(serialized, shape, mapping, manager);
|
|
136
|
-
}
|
|
137
|
-
this.onDeserialized(serialized[20], shape.children, mapping, manager);
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
return EShapeDeserializer;
|
|
141
|
-
}());
|
|
142
|
-
export { EShapeDeserializer };
|
|
143
|
-
//# sourceMappingURL=e-shape-deserializer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"e-shape-deserializer.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/shape/e-shape-deserializer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,6BAA6B,EAAE,MAAM,4CAA4C,CAAC;AAE3F,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AACpF,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD;IAAA;IAuJA,CAAC;IAtJO,0BAAO,GAAd,UACC,IAA4B,EAC5B,OAA6C;QAE7C,IAAM,iBAAiB,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QACvD,IAAI,iBAAiB,IAAI,IAAI,EAAE;YAC9B,IAAM,MAAM,GAAG,iBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YAChD,IAAI,MAAM,IAAI,IAAI,EAAE;gBACnB,OAAO,MAAM,CAAC;aACd;SACD;QACD,OAAO,kBAAkB,CAAC,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,UAAU,EAAE,CAAC,CAAC;IACxE,CAAC;IAEM,8BAAW,GAAlB,UACC,IAA4B,EAC5B,O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AAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;SACjE;QACD,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE;YACtB,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,UAAC,QAAkB;gBAClD,KAAI,CAAC,cAAc,CAClB,WAAW,EACX,QAAQ,EACR,IAAI,qBAAqB,CAAC,QAAQ,CAAC,EACnC,OAAO,CACP,CAAC;gBACF,OAAO,QAAQ,CAAC;YACjB,CAAC,CAAC,CAAC;SACH;QACD,OAAO,IAAI,CAAC;IACb,CAAC;IAEM,iCAAc,GAArB,UACC,WAAqC,EACrC,MAAgB,EAChB,OAA0B,EAC1B,OAA6C;QAE7C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,EAAE;YACzD,IAAM,UAAU,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;YAClC,IAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YACxB,IAAM,cAAc,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;YAC3D,IAAI,cAAc,EAAE;gBACnB,cAAc,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;aACpD;YACD,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SACtE;IACF,CAAC;IACF,yBAAC;AAAD,CAAC,AAvJD,IAuJC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DDiagramSerializedItem } from \"../d-diagram-serialized\";\nimport { isString } from \"../util/is-string\";\nimport { EShapeActionValueDeserializer } from \"./action/e-shape-action-value-deserializer\";\nimport { EShape } from \"./e-shape\";\nimport { EShapeDeserializers, EShapeOnDeserialized } from \"./e-shape-deserializers\";\nimport { EShapeImageElements } from \"./e-shape-image-elements\";\nimport { EShapeResourceManagerDeserialization } from \"./e-shape-resource-manager-deserialization\";\nimport { EShapeSizes } from \"./e-shape-sizes\";\nimport { EShapeUuidMapping } from \"./e-shape-uuid-mapping\";\nimport { EShapeUuidMappingImpl } from \"./e-shape-uuid-mapping-impl\";\nimport { EShapeGradients } from \"./variant/e-shape-gradients\";\nimport { EShapeNull } from \"./variant/e-shape-null\";\n\nexport class EShapeDeserializer {\n\tstatic toShape(\n\t\titem: DDiagramSerializedItem,\n\t\tmanager: EShapeResourceManagerDeserialization\n\t): Promise<EShape> | EShape {\n\t\tconst shapeDeserializer = EShapeDeserializers[item[0]];\n\t\tif (shapeDeserializer != null) {\n\t\t\tconst result = shapeDeserializer(item, manager);\n\t\t\tif (result != null) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\treturn EShapeDeserializer.deserialize(item, manager, new EShapeNull());\n\t}\n\n\tstatic deserialize<SHAPE extends EShape>(\n\t\titem: DDiagramSerializedItem,\n\t\tmanager: EShapeResourceManagerDeserialization,\n\t\tresult: SHAPE\n\t): Promise<SHAPE> | SHAPE {\n\t\tresult.id = manager.resources[item[1]] || \"\";\n\t\tconst transform = result.transform;\n\t\ttransform.position.set(item[2], item[3]);\n\t\ttransform.rotation = item[6];\n\t\ttransform.skew.set(item[7], item[7]);\n\t\ttransform.pivot.set(item[21], item[22]);\n\t\tresult.size.set(EShapeSizes.toNormalized(item[4]), EShapeSizes.toNormalized(item[5]));\n\t\tresult.fill.deserialize(item[8], manager);\n\t\tresult.stroke.deserialize(item[9], manager);\n\t\tresult.cursor = manager.resources[item[10]] || \"\";\n\t\tresult.text.deserialize(item[11], manager);\n\t\tresult.data.deserialize(item[12], manager);\n\t\tresult.radius = item[13];\n\t\tresult.corner = item[14];\n\t\tconst item23 = item[23];\n\t\tresult.interactive = !!(item23 & 1);\n\t\tconst state = result.state;\n\t\tstate.isFocusable = !(item23 & 2);\n\t\tstate.isActive = !!(item23 & 4);\n\t\tconst item24 = item[24];\n\t\tresult.shortcut = 0 <= item24 ? manager.resources[item24] : undefined;\n\t\tconst item25 = item[25];\n\t\tresult.title = 0 <= item25 ? manager.resources[item25] : undefined;\n\t\tconst item26 = item[26];\n\t\tresult.uuid = item26 != null ? item26 : 0;\n\n\t\t// Children\n\t\tlet childrenPromise: Promise<SHAPE> | null = null;\n\t\tconst childrenSerialized = item[20];\n\t\tif (0 < childrenSerialized.length) {\n\t\t\tconst childrenOrPromises = [];\n\t\t\tfor (let i = 0, imax = childrenSerialized.length; i < imax; ++i) {\n\t\t\t\tchildrenOrPromises.push(EShapeDeserializer.toShape(childrenSerialized[i], manager));\n\t\t\t}\n\t\t\tchildrenPromise = Promise.all(childrenOrPromises).then((children: EShape[]) => {\n\t\t\t\tresult.children = children;\n\t\t\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\t\t\tchildren[i].parent = result;\n\t\t\t\t}\n\t\t\t\tresult.onChildTransformChange();\n\t\t\t\tresult.toDirty();\n\t\t\t\treturn result;\n\t\t\t});\n\t\t}\n\n\t\t// Action\n\t\tconst serializedActions = item[17];\n\t\tfor (let i = 0, imax = serializedActions.length; i < imax; ++i) {\n\t\t\tresult.action.add(\n\t\t\t\tEShapeActionValueDeserializer.deserialize(serializedActions[i], manager)\n\t\t\t);\n\t\t}\n\n\t\t// Gradient\n\t\tconst gradientId = item[19];\n\t\tif (0 <= gradientId && gradientId < manager.resources.length) {\n\t\t\tconst gradient = manager.resources[gradientId];\n\t\t\tif (isString(gradient)) {\n\t\t\t\tresult.gradient = EShapeGradients.deserializeGradient(gradient);\n\t\t\t}\n\t\t}\n\n\t\t// Image\n\t\tlet imagePromise: Promise<SHAPE> | null = null;\n\t\tconst imageId = item[18];\n\t\tif (0 <= imageId && imageId < manager.resources.length) {\n\t\t\tconst imageSrc = manager.resources[imageId];\n\t\t\tif (isString(imageSrc)) {\n\t\t\t\timagePromise = EShapeImageElements.toImageElement(imageSrc).then((imageElement) => {\n\t\t\t\t\tresult.image = imageElement;\n\t\t\t\t\treturn result;\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\tif (childrenPromise != null) {\n\t\t\tif (imagePromise != null) {\n\t\t\t\treturn Promise.all([childrenPromise, imagePromise]).then(() => {\n\t\t\t\t\treturn result;\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\treturn childrenPromise;\n\t\t\t}\n\t\t} else {\n\t\t\tif (imagePromise != null) {\n\t\t\t\treturn imagePromise;\n\t\t\t} else {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t}\n\n\tstatic deserializeAll(\n\t\tserializeds: DDiagramSerializedItem[],\n\t\tmanager: EShapeResourceManagerDeserialization\n\t): Promise<EShape[]> | null {\n\t\tconst shapes: Array<Promise<EShape> | EShape> = [];\n\t\tfor (let i = 0, imax = serializeds.length; i < imax; ++i) {\n\t\t\tshapes.push(EShapeDeserializer.toShape(serializeds[i], manager));\n\t\t}\n\t\tif (0 < shapes.length) {\n\t\t\treturn Promise.all(shapes).then((resolved: EShape[]): EShape[] => {\n\t\t\t\tthis.onDeserialized(\n\t\t\t\t\tserializeds,\n\t\t\t\t\tresolved,\n\t\t\t\t\tnew EShapeUuidMappingImpl(resolved),\n\t\t\t\t\tmanager\n\t\t\t\t);\n\t\t\t\treturn resolved;\n\t\t\t});\n\t\t}\n\t\treturn null;\n\t}\n\n\tstatic onDeserialized(\n\t\tserializeds: DDiagramSerializedItem[],\n\t\tshapes: EShape[],\n\t\tmapping: EShapeUuidMapping,\n\t\tmanager: EShapeResourceManagerDeserialization\n\t): void {\n\t\tfor (let i = 0, imax = serializeds.length; i < imax; ++i) {\n\t\t\tconst serialized = serializeds[i];\n\t\t\tconst shape = shapes[i];\n\t\t\tconst onDeserialized = EShapeOnDeserialized[serialized[0]];\n\t\t\tif (onDeserialized) {\n\t\t\t\tonDeserialized(serialized, shape, mapping, manager);\n\t\t\t}\n\t\t\tthis.onDeserialized(serialized[20], shape.children, mapping, manager);\n\t\t}\n\t}\n}\n"]}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
var EShapeImageElements = /** @class */ (function () {
|
|
2
|
-
function EShapeImageElements() {
|
|
3
|
-
}
|
|
4
|
-
EShapeImageElements.toImageElement = function (dataUrl) {
|
|
5
|
-
var imageElements = EShapeImageElements.imageElements;
|
|
6
|
-
var cachedImageElement = imageElements[dataUrl];
|
|
7
|
-
if (cachedImageElement != null) {
|
|
8
|
-
if (cachedImageElement instanceof HTMLImageElement) {
|
|
9
|
-
return Promise.resolve(cachedImageElement);
|
|
10
|
-
}
|
|
11
|
-
else {
|
|
12
|
-
return cachedImageElement;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
var result = new Promise(function (resolve, reject) {
|
|
17
|
-
var imageElement = document.createElement("img");
|
|
18
|
-
imageElement.onload = function () {
|
|
19
|
-
imageElements[dataUrl] = imageElement;
|
|
20
|
-
resolve(imageElement);
|
|
21
|
-
};
|
|
22
|
-
imageElement.onabort = imageElement.onerror = function () {
|
|
23
|
-
reject();
|
|
24
|
-
};
|
|
25
|
-
imageElement.src = dataUrl;
|
|
26
|
-
});
|
|
27
|
-
imageElements[dataUrl] = result;
|
|
28
|
-
return result;
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
EShapeImageElements.imageElements = {};
|
|
32
|
-
return EShapeImageElements;
|
|
33
|
-
}());
|
|
34
|
-
export { EShapeImageElements };
|
|
35
|
-
//# sourceMappingURL=e-shape-image-elements.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"e-shape-image-elements.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/shape/e-shape-image-elements.ts"],"names":[],"mappings":"AAAA;IAAA;IA8BA,CAAC;IAzBO,kCAAc,GAArB,UAAsB,OAAe;QACpC,IAAM,aAAa,GAAG,mBAAmB,CAAC,aAAa,CAAC;QACxD,IAAM,kBAAkB,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;QAClD,IAAI,kBAAkB,IAAI,IAAI,EAAE;YAC/B,IAAI,kBAAkB,YAAY,gBAAgB,EAAE;gBACnD,OAAO,OAAO,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;aAC3C;iBAAM;gBACN,OAAO,kBAAkB,CAAC;aAC1B;SACD;aAAM;YACN,IAAM,MAAM,GAAG,IAAI,OAAO,CAAmB,UAAC,OAAO,EAAE,MAAM;gBAC5D,IAAM,YAAY,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;gBACnD,YAAY,CAAC,MAAM,GAAG;oBACrB,aAAa,CAAC,OAAO,CAAC,GAAG,YAAY,CAAC;oBACtC,OAAO,CAAC,YAAY,CAAC,CAAC;gBACvB,CAAC,CAAC;gBACF,YAAY,CAAC,OAAO,GAAG,YAAY,CAAC,OAAO,GAAG;oBAC7C,MAAM,EAAE,CAAC;gBACV,CAAC,CAAC;gBACF,YAAY,CAAC,GAAG,GAAG,OAAO,CAAC;YAC5B,CAAC,CAAC,CAAC;YACH,aAAa,CAAC,OAAO,CAAC,GAAG,MAAM,CAAC;YAChC,OAAO,MAAM,CAAC;SACd;IACF,CAAC;IA5BM,iCAAa,GAEhB,EAAE,CAAC;IA2BR,0BAAC;CAAA,AA9BD,IA8BC;SA9BY,mBAAmB","sourcesContent":["export class EShapeImageElements {\n\tstatic imageElements: {\n\t\t[src: string]: Promise<HTMLImageElement> | HTMLImageElement | undefined;\n\t} = {};\n\n\tstatic toImageElement(dataUrl: string): Promise<HTMLImageElement> {\n\t\tconst imageElements = EShapeImageElements.imageElements;\n\t\tconst cachedImageElement = imageElements[dataUrl];\n\t\tif (cachedImageElement != null) {\n\t\t\tif (cachedImageElement instanceof HTMLImageElement) {\n\t\t\t\treturn Promise.resolve(cachedImageElement);\n\t\t\t} else {\n\t\t\t\treturn cachedImageElement;\n\t\t\t}\n\t\t} else {\n\t\t\tconst result = new Promise<HTMLImageElement>((resolve, reject): void => {\n\t\t\t\tconst imageElement = document.createElement(\"img\");\n\t\t\t\timageElement.onload = () => {\n\t\t\t\t\timageElements[dataUrl] = imageElement;\n\t\t\t\t\tresolve(imageElement);\n\t\t\t\t};\n\t\t\t\timageElement.onabort = imageElement.onerror = () => {\n\t\t\t\t\treject();\n\t\t\t\t};\n\t\t\t\timageElement.src = dataUrl;\n\t\t\t});\n\t\t\timageElements[dataUrl] = result;\n\t\t\treturn result;\n\t\t}\n\t}\n}\n"]}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (C) 2019 Toshiba Corporation
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
var EShapeSizes = /** @class */ (function () {
|
|
6
|
-
function EShapeSizes() {
|
|
7
|
-
}
|
|
8
|
-
EShapeSizes.toRounded = function (value) {
|
|
9
|
-
return Math.round(value * 100) / 100;
|
|
10
|
-
};
|
|
11
|
-
EShapeSizes.toNormalized = function (size) {
|
|
12
|
-
var THRESHOLD = 0.001;
|
|
13
|
-
if (Math.abs(size) < THRESHOLD) {
|
|
14
|
-
return size < 0 ? -THRESHOLD : +THRESHOLD;
|
|
15
|
-
}
|
|
16
|
-
return EShapeSizes.toRounded(size);
|
|
17
|
-
};
|
|
18
|
-
EShapeSizes.resize = function (shape, from, to, centerMode, isPerfect) {
|
|
19
|
-
shape.disallowUploadedUpdate();
|
|
20
|
-
var position = shape.transform.position;
|
|
21
|
-
if (centerMode) {
|
|
22
|
-
var dx = Math.abs(to.x - from.x);
|
|
23
|
-
var dy = Math.abs(to.y - from.y);
|
|
24
|
-
if (isPerfect) {
|
|
25
|
-
var hsize = Math.max(dx, dy);
|
|
26
|
-
var size = hsize + hsize;
|
|
27
|
-
shape.size.set(EShapeSizes.toNormalized(size), EShapeSizes.toNormalized(size));
|
|
28
|
-
position.set(EShapeSizes.toRounded(from.x), EShapeSizes.toRounded(from.y));
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
shape.size.set(EShapeSizes.toNormalized(dx + dx), EShapeSizes.toNormalized(dy + dy));
|
|
32
|
-
position.set(EShapeSizes.toRounded(from.x), EShapeSizes.toRounded(from.y));
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
if (isPerfect) {
|
|
37
|
-
var dx = to.x - from.x;
|
|
38
|
-
var dy = to.y - from.y;
|
|
39
|
-
var size = Math.max(Math.abs(dx), Math.abs(dy));
|
|
40
|
-
var x2 = from.x + (dx < 0 ? -size : +size);
|
|
41
|
-
var y2 = from.y + (dy < 0 ? -size : +size);
|
|
42
|
-
var hsize = size * 0.5;
|
|
43
|
-
var x = Math.min(from.x, x2) + hsize;
|
|
44
|
-
var y = Math.min(from.y, y2) + hsize;
|
|
45
|
-
shape.size.set(EShapeSizes.toNormalized(size), EShapeSizes.toNormalized(size));
|
|
46
|
-
position.set(EShapeSizes.toRounded(x), EShapeSizes.toRounded(y));
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
var x0 = Math.min(from.x, to.x);
|
|
50
|
-
var y0 = Math.min(from.y, to.y);
|
|
51
|
-
var x1 = Math.max(from.x, to.x);
|
|
52
|
-
var y1 = Math.max(from.y, to.y);
|
|
53
|
-
var width = x1 - x0;
|
|
54
|
-
var height = y1 - y0;
|
|
55
|
-
var px = width * 0.5;
|
|
56
|
-
var py = height * 0.5;
|
|
57
|
-
shape.size.set(EShapeSizes.toNormalized(width), EShapeSizes.toNormalized(height));
|
|
58
|
-
position.set(EShapeSizes.toRounded(x0 + px), EShapeSizes.toRounded(y0 + py));
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
shape.allowUploadedUpdate();
|
|
62
|
-
};
|
|
63
|
-
return EShapeSizes;
|
|
64
|
-
}());
|
|
65
|
-
export { EShapeSizes };
|
|
66
|
-
//# sourceMappingURL=e-shape-sizes.js.map
|
|
@@ -1 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CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;aAC7E;SACD;QACD,KAAK,CAAC,mBAAmB,EAAE,CAAC;IAC7B,CAAC;IACF,kBAAC;AAAD,CAAC,AAhED,IAgEC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { IPoint } from \"pixi.js\";\nimport { EShape } from \"./e-shape\";\n\nexport class EShapeSizes {\n\tstatic toRounded(value: number): number {\n\t\treturn Math.round(value * 100) / 100;\n\t}\n\n\tstatic toNormalized(size: number): number {\n\t\tconst THRESHOLD = 0.001;\n\t\tif (Math.abs(size) < THRESHOLD) {\n\t\t\treturn size < 0 ? -THRESHOLD : +THRESHOLD;\n\t\t}\n\t\treturn EShapeSizes.toRounded(size);\n\t}\n\n\tstatic resize(\n\t\tshape: EShape,\n\t\tfrom: IPoint,\n\t\tto: IPoint,\n\t\tcenterMode: boolean,\n\t\tisPerfect: boolean\n\t): void {\n\t\tshape.disallowUploadedUpdate();\n\t\tconst position = shape.transform.position;\n\t\tif (centerMode) {\n\t\t\tconst dx = Math.abs(to.x - from.x);\n\t\t\tconst dy = Math.abs(to.y - from.y);\n\t\t\tif (isPerfect) {\n\t\t\t\tconst hsize = Math.max(dx, dy);\n\t\t\t\tconst size = hsize + hsize;\n\t\t\t\tshape.size.set(EShapeSizes.toNormalized(size), EShapeSizes.toNormalized(size));\n\t\t\t\tposition.set(EShapeSizes.toRounded(from.x), EShapeSizes.toRounded(from.y));\n\t\t\t} else {\n\t\t\t\tshape.size.set(\n\t\t\t\t\tEShapeSizes.toNormalized(dx + dx),\n\t\t\t\t\tEShapeSizes.toNormalized(dy + dy)\n\t\t\t\t);\n\t\t\t\tposition.set(EShapeSizes.toRounded(from.x), EShapeSizes.toRounded(from.y));\n\t\t\t}\n\t\t} else {\n\t\t\tif (isPerfect) {\n\t\t\t\tconst dx = to.x - from.x;\n\t\t\t\tconst dy = to.y - from.y;\n\t\t\t\tconst size = Math.max(Math.abs(dx), Math.abs(dy));\n\t\t\t\tconst x2 = from.x + (dx < 0 ? -size : +size);\n\t\t\t\tconst y2 = from.y + (dy < 0 ? -size : +size);\n\t\t\t\tconst hsize = size * 0.5;\n\t\t\t\tconst x = Math.min(from.x, x2) + hsize;\n\t\t\t\tconst y = Math.min(from.y, y2) + hsize;\n\t\t\t\tshape.size.set(EShapeSizes.toNormalized(size), EShapeSizes.toNormalized(size));\n\t\t\t\tposition.set(EShapeSizes.toRounded(x), EShapeSizes.toRounded(y));\n\t\t\t} else {\n\t\t\t\tconst x0 = Math.min(from.x, to.x);\n\t\t\t\tconst y0 = Math.min(from.y, to.y);\n\t\t\t\tconst x1 = Math.max(from.x, to.x);\n\t\t\t\tconst y1 = Math.max(from.y, to.y);\n\t\t\t\tconst width = x1 - x0;\n\t\t\t\tconst height = y1 - y0;\n\t\t\t\tconst px = width * 0.5;\n\t\t\t\tconst py = height * 0.5;\n\t\t\t\tshape.size.set(EShapeSizes.toNormalized(width), EShapeSizes.toNormalized(height));\n\t\t\t\tposition.set(EShapeSizes.toRounded(x0 + px), EShapeSizes.toRounded(y0 + py));\n\t\t\t}\n\t\t}\n\t\tshape.allowUploadedUpdate();\n\t}\n}\n"]}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (C) 2019 Toshiba Corporation
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
import { toSvgUrl } from "../../util/to-svg-url";
|
|
6
|
-
import { UtilRgb } from "../../util/util-rgb";
|
|
7
|
-
var EShapeGradients = /** @class */ (function () {
|
|
8
|
-
function EShapeGradients() {
|
|
9
|
-
}
|
|
10
|
-
EShapeGradients.serializeGradient = function (gradient) {
|
|
11
|
-
var points = gradient.points;
|
|
12
|
-
var result = "[" + gradient.direction;
|
|
13
|
-
for (var i = 0, imax = points.length, j = 1; i < imax; i += 1, j += 3) {
|
|
14
|
-
var point = points[i];
|
|
15
|
-
result += "," + point.color + "," + point.alpha + "," + point.position;
|
|
16
|
-
}
|
|
17
|
-
result += "]";
|
|
18
|
-
return result;
|
|
19
|
-
};
|
|
20
|
-
EShapeGradients.parseGradient = function (target) {
|
|
21
|
-
try {
|
|
22
|
-
return JSON.parse(target);
|
|
23
|
-
}
|
|
24
|
-
catch (e) {
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
EShapeGradients.deserializeGradient = function (target) {
|
|
29
|
-
var parsed = this.parseGradient(target);
|
|
30
|
-
if (parsed == null || parsed.length < 7) {
|
|
31
|
-
return undefined;
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
var direction = parsed[0];
|
|
35
|
-
var points = [];
|
|
36
|
-
for (var i = 1, imax = parsed.length; i < imax; i += 3) {
|
|
37
|
-
points.push({
|
|
38
|
-
color: parsed[i + 0],
|
|
39
|
-
alpha: parsed[i + 1],
|
|
40
|
-
position: parsed[i + 2]
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
return {
|
|
44
|
-
points: points,
|
|
45
|
-
direction: direction
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
EShapeGradients.toGradientId = function (gradient, manager) {
|
|
50
|
-
if (gradient != null) {
|
|
51
|
-
if (gradient.serialized == null) {
|
|
52
|
-
gradient.serialized = this.serializeGradient(gradient);
|
|
53
|
-
}
|
|
54
|
-
return manager.addResource(gradient.serialized);
|
|
55
|
-
}
|
|
56
|
-
return -1;
|
|
57
|
-
};
|
|
58
|
-
EShapeGradients.toGradientImageUrl = function (gradient) {
|
|
59
|
-
var direction = gradient.direction;
|
|
60
|
-
var points = gradient.points;
|
|
61
|
-
var stops = "";
|
|
62
|
-
for (var i = 0, imax = points.length; i < imax; ++i) {
|
|
63
|
-
var point = points[i];
|
|
64
|
-
var color = UtilRgb.toCode(point.color);
|
|
65
|
-
var alpha = point.alpha;
|
|
66
|
-
var offset = point.position * 100;
|
|
67
|
-
stops += "<stop offset=\"" + offset + "%\" stop-color=\"#" + color + "\" stop-opacity=\"" + alpha + "\" />";
|
|
68
|
-
}
|
|
69
|
-
var radian = (direction * Math.PI) / 180;
|
|
70
|
-
var dx = 0.5 * Math.cos(radian);
|
|
71
|
-
var dy = -0.5 * Math.sin(radian);
|
|
72
|
-
var url = toSvgUrl(
|
|
73
|
-
/* eslint-disable prettier/prettier */
|
|
74
|
-
"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"32\" height=\"32\" viewBox=\"0 0 32 32\">" +
|
|
75
|
-
"<defs>" +
|
|
76
|
-
("<linearGradient id=\"o2glkm3aeu2oio\" x1=\"" + (0.5 - dx) + "\" x2=\"" + (0.5 + dx) + "\" y1=\"" + (0.5 - dy) + "\" y2=\"" + (0.5 + dy) + "\">") +
|
|
77
|
-
stops +
|
|
78
|
-
"</linearGradient>" +
|
|
79
|
-
"</defs>" +
|
|
80
|
-
"<rect x=\"0\" y=\"0\" width=\"32\" height=\"32\" stroke=\"none\" fill=\"url(#o2glkm3aeu2oio)\" />" +
|
|
81
|
-
"</svg>"
|
|
82
|
-
/* eslint-enable prettier/prettier */
|
|
83
|
-
);
|
|
84
|
-
return url;
|
|
85
|
-
};
|
|
86
|
-
return EShapeGradients;
|
|
87
|
-
}());
|
|
88
|
-
export { EShapeGradients };
|
|
89
|
-
//# sourceMappingURL=e-shape-gradients.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"e-shape-gradients.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/shape/variant/e-shape-gradients.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAI9C;IAAA;IAsFA,CAAC;IArFO,iCAAiB,GAAxB,UAAyB,QAA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I,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAClC,IAAM,EAAE,GAAG,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAEnC,IAAM,GAAG,GAAG,QAAQ;QACnB,sCAAsC;QACtC,6FAAqF;YACpF,QAAQ;aACP,iDAA2C,GAAG,GAAG,EAAE,kBAAS,GAAG,GAAG,EAAE,kBAAS,GAAG,GAAG,EAAE,kBAAS,GAAG,GAAG,EAAE,SAAI,CAAA;YACzG,KAAK;YACN,mBAAmB;YACpB,SAAS;YACT,mGAAuF;YACxF,QAAQ;QACR,qCAAqC;SACrC,CAAC;QAEF,OAAO,GAAG,CAAC;IACZ,CAAC;IACF,sBAAC;AAAD,CAAC,AAtFD,IAsFC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { toSvgUrl } from \"../../util/to-svg-url\";\nimport { UtilRgb } from \"../../util/util-rgb\";\nimport { EShapeGradientLike, EShapeGradientPointLike } from \"../e-shape-gradient\";\nimport { EShapeResourceManagerSerialization } from \"../e-shape-resource-manager-serialization\";\n\nexport class EShapeGradients {\n\tstatic serializeGradient(gradient: EShapeGradientLike): string {\n\t\tconst points = gradient.points;\n\t\tlet result = `[${gradient.direction}`;\n\t\tfor (let i = 0, imax = points.length, j = 1; i < imax; i += 1, j += 3) {\n\t\t\tconst point = points[i];\n\t\t\tresult += `,${point.color},${point.alpha},${point.position}`;\n\t\t}\n\t\tresult += \"]\";\n\t\treturn result;\n\t}\n\n\tstatic parseGradient(target: string): number[] | null {\n\t\ttry {\n\t\t\treturn JSON.parse(target) as number[];\n\t\t} catch (e) {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tstatic deserializeGradient(target: string): EShapeGradientLike | undefined {\n\t\tconst parsed = this.parseGradient(target);\n\t\tif (parsed == null || parsed.length < 7) {\n\t\t\treturn undefined;\n\t\t} else {\n\t\t\tconst direction = parsed[0];\n\t\t\tconst points: EShapeGradientPointLike[] = [];\n\t\t\tfor (let i = 1, imax = parsed.length; i < imax; i += 3) {\n\t\t\t\tpoints.push({\n\t\t\t\t\tcolor: parsed[i + 0],\n\t\t\t\t\talpha: parsed[i + 1],\n\t\t\t\t\tposition: parsed[i + 2]\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tpoints,\n\t\t\t\tdirection\n\t\t\t};\n\t\t}\n\t}\n\n\tstatic toGradientId(\n\t\tgradient: EShapeGradientLike | undefined,\n\t\tmanager: EShapeResourceManagerSerialization\n\t): number {\n\t\tif (gradient != null) {\n\t\t\tif (gradient.serialized == null) {\n\t\t\t\tgradient.serialized = this.serializeGradient(gradient);\n\t\t\t}\n\t\t\treturn manager.addResource(gradient.serialized);\n\t\t}\n\t\treturn -1;\n\t}\n\n\tstatic toGradientImageUrl(gradient: EShapeGradientLike): string {\n\t\tconst direction = gradient.direction;\n\t\tconst points = gradient.points;\n\n\t\tlet stops = \"\";\n\t\tfor (let i = 0, imax = points.length; i < imax; ++i) {\n\t\t\tconst point = points[i];\n\t\t\tconst color = UtilRgb.toCode(point.color);\n\t\t\tconst alpha = point.alpha;\n\t\t\tconst offset = point.position * 100;\n\t\t\tstops += `<stop offset=\"${offset}%\" stop-color=\"#${color}\" stop-opacity=\"${alpha}\" />`;\n\t\t}\n\n\t\tconst radian = (direction * Math.PI) / 180;\n\t\tconst dx = 0.5 * Math.cos(radian);\n\t\tconst dy = -0.5 * Math.sin(radian);\n\n\t\tconst url = toSvgUrl(\n\t\t\t/* eslint-disable prettier/prettier */\n\t\t\t`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"32\" height=\"32\" viewBox=\"0 0 32 32\">` +\n\t\t\t\t`<defs>` +\n\t\t\t\t\t`<linearGradient id=\"o2glkm3aeu2oio\" x1=\"${0.5 - dx}\" x2=\"${0.5 + dx}\" y1=\"${0.5 - dy}\" y2=\"${0.5 + dy}\">` +\n\t\t\t\t\t\tstops +\n\t\t\t\t\t`</linearGradient>` +\n\t\t\t\t`</defs>` +\n\t\t\t\t`<rect x=\"0\" y=\"0\" width=\"32\" height=\"32\" stroke=\"none\" fill=\"url(#o2glkm3aeu2oio)\" />` +\n\t\t\t`</svg>`\n\t\t\t/* eslint-enable prettier/prettier */\n\t\t);\n\n\t\treturn url;\n\t}\n}\n"]}
|