@nasser-sw/fabric 7.0.1-beta12 → 7.0.1-beta14
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/.babelrc +0 -0
- package/.babelrcAlt +0 -0
- package/.browserslistrc +0 -0
- package/.editorconfig +0 -0
- package/.gitattributes +0 -0
- package/.gitpod.yml +0 -0
- package/.prettierignore +0 -0
- package/.prettierrc +0 -0
- package/0 +0 -0
- package/CHANGELOG.md +0 -0
- package/CODE_OF_CONDUCT.md +0 -0
- package/CONTRIBUTING.md +0 -0
- package/LICENSE +0 -0
- package/OVERLAY_EDITOR_MIGRATION.md +0 -0
- package/README.md +0 -0
- package/SECURITY.md +0 -0
- package/debug/{konva-master → konva}/CHANGELOG.md +1 -2
- package/debug/{konva-master → konva}/LICENSE +0 -0
- package/debug/{konva-master → konva}/README.md +3 -7
- package/debug/{konva-master → konva}/gulpfile.mjs +0 -0
- package/debug/{konva-master → konva}/package.json +1 -1
- package/debug/{konva-master → konva}/release.sh +4 -1
- package/debug/{konva-master → konva}/resources/doc-includes/ContainerParams.txt +0 -0
- package/debug/{konva-master → konva}/resources/doc-includes/NodeParams.txt +0 -0
- package/debug/{konva-master → konva}/resources/doc-includes/ShapeParams.txt +0 -0
- package/debug/{konva-master → konva}/resources/jsdoc.conf.json +0 -0
- package/debug/{konva-master → konva}/rollup.config.mjs +0 -0
- package/debug/{konva-master → konva}/src/Animation.ts +0 -0
- package/debug/{konva-master → konva}/src/BezierFunctions.ts +0 -0
- package/debug/{konva-master → konva}/src/Canvas.ts +0 -37
- package/debug/{konva-master → konva}/src/Container.ts +0 -0
- package/debug/{konva-master → konva}/src/Context.ts +0 -0
- package/debug/{konva-master → konva}/src/Core.ts +0 -0
- package/debug/{konva-master → konva}/src/DragAndDrop.ts +0 -0
- package/debug/{konva-master → konva}/src/Factory.ts +0 -0
- package/debug/{konva-master → konva}/src/FastLayer.ts +0 -0
- package/debug/{konva-master → konva}/src/Global.ts +0 -0
- package/debug/{konva-master → konva}/src/Group.ts +0 -0
- package/debug/{konva-master → konva}/src/Layer.ts +0 -0
- package/debug/{konva-master → konva}/src/Node.ts +0 -0
- package/debug/{konva-master → konva}/src/PointerEvents.ts +0 -0
- package/debug/{konva-master → konva}/src/Shape.ts +0 -0
- package/debug/{konva-master → konva}/src/Stage.ts +0 -0
- package/debug/{konva-master → konva}/src/Tween.ts +0 -0
- package/debug/{konva-master → konva}/src/Util.ts +0 -0
- package/debug/{konva-master → konva}/src/Validators.ts +0 -0
- package/debug/{konva-master → konva}/src/_CoreInternals.ts +0 -0
- package/debug/{konva-master → konva}/src/_FullInternals.ts +0 -0
- package/debug/{konva-master → konva}/src/canvas-backend.ts +0 -0
- package/debug/{konva-master → konva}/src/filters/Blur.ts +0 -0
- package/debug/{konva-master → konva}/src/filters/Brighten.ts +0 -0
- package/debug/{konva-master → konva}/src/filters/Brightness.ts +0 -0
- package/debug/{konva-master → konva}/src/filters/Contrast.ts +0 -0
- package/debug/{konva-master → konva}/src/filters/Emboss.ts +0 -0
- package/debug/{konva-master → konva}/src/filters/Enhance.ts +0 -0
- package/debug/{konva-master → konva}/src/filters/Grayscale.ts +0 -0
- package/debug/{konva-master → konva}/src/filters/HSL.ts +0 -0
- package/debug/{konva-master → konva}/src/filters/HSV.ts +0 -0
- package/debug/{konva-master → konva}/src/filters/Invert.ts +0 -0
- package/debug/{konva-master → konva}/src/filters/Kaleidoscope.ts +0 -0
- package/debug/{konva-master → konva}/src/filters/Mask.ts +0 -0
- package/debug/{konva-master → konva}/src/filters/Noise.ts +0 -0
- package/debug/{konva-master → konva}/src/filters/Pixelate.ts +0 -0
- package/debug/{konva-master → konva}/src/filters/Posterize.ts +0 -0
- package/debug/{konva-master → konva}/src/filters/RGB.ts +0 -0
- package/debug/{konva-master → konva}/src/filters/RGBA.ts +0 -0
- package/debug/{konva-master → konva}/src/filters/Sepia.ts +0 -0
- package/debug/{konva-master → konva}/src/filters/Solarize.ts +0 -0
- package/debug/{konva-master → konva}/src/filters/Threshold.ts +0 -0
- package/debug/{konva-master → konva}/src/index.ts +0 -0
- package/debug/{konva-master → konva}/src/shapes/Arc.ts +0 -0
- package/debug/{konva-master → konva}/src/shapes/Arrow.ts +0 -0
- package/debug/{konva-master → konva}/src/shapes/Circle.ts +0 -0
- package/debug/{konva-master → konva}/src/shapes/Ellipse.ts +0 -0
- package/debug/{konva-master → konva}/src/shapes/Image.ts +0 -0
- package/debug/{konva-master → konva}/src/shapes/Label.ts +0 -0
- package/debug/{konva-master → konva}/src/shapes/Line.ts +0 -0
- package/debug/{konva-master → konva}/src/shapes/Path.ts +0 -0
- package/debug/{konva-master → konva}/src/shapes/Rect.ts +0 -0
- package/debug/{konva-master → konva}/src/shapes/RegularPolygon.ts +0 -0
- package/debug/{konva-master → konva}/src/shapes/Ring.ts +0 -0
- package/debug/{konva-master → konva}/src/shapes/Sprite.ts +0 -0
- package/debug/{konva-master → konva}/src/shapes/Star.ts +0 -0
- package/debug/{konva-master → konva}/src/shapes/Text.ts +2 -2
- package/debug/{konva-master → konva}/src/shapes/TextPath.ts +0 -0
- package/debug/{konva-master → konva}/src/shapes/Transformer.ts +0 -0
- package/debug/{konva-master → konva}/src/shapes/Wedge.ts +0 -0
- package/debug/{konva-master → konva}/src/skia-backend.ts +0 -0
- package/debug/{konva-master → konva}/src/types.ts +0 -0
- package/debug/{konva-master → konva}/tsconfig.json +0 -0
- package/debug/{konva-master → konva}/tsconfig.test.json +0 -0
- package/dist/_virtual/_rollupPluginBabelHelpers.min.mjs +0 -0
- package/dist/_virtual/_rollupPluginBabelHelpers.min.mjs.map +0 -0
- package/dist/_virtual/_rollupPluginBabelHelpers.mjs +0 -0
- package/dist/_virtual/_rollupPluginBabelHelpers.mjs.map +0 -0
- package/dist/extensions/aligning_guidelines/constant.d.ts +0 -0
- package/dist/extensions/aligning_guidelines/constant.d.ts.map +0 -0
- package/dist/extensions/aligning_guidelines/index.d.ts +0 -0
- package/dist/extensions/aligning_guidelines/index.d.ts.map +0 -0
- package/dist/extensions/aligning_guidelines/typedefs.d.ts +0 -0
- package/dist/extensions/aligning_guidelines/typedefs.d.ts.map +0 -0
- package/dist/extensions/aligning_guidelines/util/basic.d.ts +0 -0
- package/dist/extensions/aligning_guidelines/util/basic.d.ts.map +0 -0
- package/dist/extensions/aligning_guidelines/util/collect-line.d.ts +0 -0
- package/dist/extensions/aligning_guidelines/util/collect-line.d.ts.map +0 -0
- package/dist/extensions/aligning_guidelines/util/collect-point.d.ts +0 -0
- package/dist/extensions/aligning_guidelines/util/collect-point.d.ts.map +0 -0
- package/dist/extensions/aligning_guidelines/util/draw.d.ts +0 -0
- package/dist/extensions/aligning_guidelines/util/draw.d.ts.map +0 -0
- package/dist/extensions/aligning_guidelines/util/get-objects-by-target.d.ts +0 -0
- package/dist/extensions/aligning_guidelines/util/get-objects-by-target.d.ts.map +0 -0
- package/dist/extensions/data_updaters/gradient/index.d.ts +0 -0
- package/dist/extensions/data_updaters/gradient/index.d.ts.map +0 -0
- package/dist/extensions/data_updaters/origins/index.d.ts +0 -0
- package/dist/extensions/data_updaters/origins/index.d.ts.map +0 -0
- package/dist/extensions/index.d.ts +0 -0
- package/dist/extensions/index.d.ts.map +0 -0
- package/dist/fabric.d.ts +0 -0
- package/dist/fabric.d.ts.map +0 -0
- package/dist/fabric.min.mjs +0 -0
- package/dist/fabric.min.mjs.map +0 -0
- package/dist/fabric.mjs +0 -0
- package/dist/fabric.mjs.map +0 -0
- package/dist/index.d.ts +0 -0
- package/dist/index.d.ts.map +0 -0
- package/dist/index.js +1588 -1199
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/index.min.mjs +1 -1
- package/dist/index.min.mjs.map +1 -1
- package/dist/index.mjs +1588 -1199
- package/dist/index.mjs.map +1 -1
- package/dist/index.node.cjs +1588 -1199
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.d.ts +0 -0
- package/dist/index.node.d.ts.map +0 -0
- package/dist/index.node.mjs +1588 -1199
- package/dist/index.node.mjs.map +1 -1
- package/dist/package.json.min.mjs +1 -1
- package/dist/package.json.min.mjs.map +0 -0
- package/dist/package.json.mjs +1 -1
- package/dist/package.json.mjs.map +0 -0
- package/dist/src/ClassRegistry.d.ts +0 -0
- package/dist/src/ClassRegistry.d.ts.map +0 -0
- package/dist/src/ClassRegistry.min.mjs +0 -0
- package/dist/src/ClassRegistry.min.mjs.map +0 -0
- package/dist/src/ClassRegistry.mjs +0 -0
- package/dist/src/ClassRegistry.mjs.map +0 -0
- package/dist/src/Collection.d.ts +0 -0
- package/dist/src/Collection.d.ts.map +0 -0
- package/dist/src/Collection.min.mjs +0 -0
- package/dist/src/Collection.min.mjs.map +0 -0
- package/dist/src/Collection.mjs +0 -0
- package/dist/src/Collection.mjs.map +0 -0
- package/dist/src/CommonMethods.d.ts +0 -0
- package/dist/src/CommonMethods.d.ts.map +0 -0
- package/dist/src/CommonMethods.min.mjs +0 -0
- package/dist/src/CommonMethods.min.mjs.map +0 -0
- package/dist/src/CommonMethods.mjs +0 -0
- package/dist/src/CommonMethods.mjs.map +0 -0
- package/dist/src/EventTypeDefs.d.ts +0 -0
- package/dist/src/EventTypeDefs.d.ts.map +0 -0
- package/dist/src/Intersection.d.ts +0 -0
- package/dist/src/Intersection.d.ts.map +0 -0
- package/dist/src/Intersection.min.mjs +0 -0
- package/dist/src/Intersection.min.mjs.map +0 -0
- package/dist/src/Intersection.mjs +0 -0
- package/dist/src/Intersection.mjs.map +0 -0
- package/dist/src/LayoutManager/ActiveSelectionLayoutManager.d.ts +0 -0
- package/dist/src/LayoutManager/ActiveSelectionLayoutManager.d.ts.map +0 -0
- package/dist/src/LayoutManager/ActiveSelectionLayoutManager.min.mjs +0 -0
- package/dist/src/LayoutManager/ActiveSelectionLayoutManager.min.mjs.map +0 -0
- package/dist/src/LayoutManager/ActiveSelectionLayoutManager.mjs +0 -0
- package/dist/src/LayoutManager/ActiveSelectionLayoutManager.mjs.map +0 -0
- package/dist/src/LayoutManager/LayoutManager.d.ts +0 -0
- package/dist/src/LayoutManager/LayoutManager.d.ts.map +0 -0
- package/dist/src/LayoutManager/LayoutManager.min.mjs +0 -0
- package/dist/src/LayoutManager/LayoutManager.min.mjs.map +0 -0
- package/dist/src/LayoutManager/LayoutManager.mjs +0 -0
- package/dist/src/LayoutManager/LayoutManager.mjs.map +0 -0
- package/dist/src/LayoutManager/LayoutStrategies/ClipPathLayout.d.ts +0 -0
- package/dist/src/LayoutManager/LayoutStrategies/ClipPathLayout.d.ts.map +0 -0
- package/dist/src/LayoutManager/LayoutStrategies/ClipPathLayout.min.mjs +0 -0
- package/dist/src/LayoutManager/LayoutStrategies/ClipPathLayout.min.mjs.map +0 -0
- package/dist/src/LayoutManager/LayoutStrategies/ClipPathLayout.mjs +0 -0
- package/dist/src/LayoutManager/LayoutStrategies/ClipPathLayout.mjs.map +0 -0
- package/dist/src/LayoutManager/LayoutStrategies/FitContentLayout.d.ts +0 -0
- package/dist/src/LayoutManager/LayoutStrategies/FitContentLayout.d.ts.map +0 -0
- package/dist/src/LayoutManager/LayoutStrategies/FitContentLayout.min.mjs +0 -0
- package/dist/src/LayoutManager/LayoutStrategies/FitContentLayout.min.mjs.map +0 -0
- package/dist/src/LayoutManager/LayoutStrategies/FitContentLayout.mjs +0 -0
- package/dist/src/LayoutManager/LayoutStrategies/FitContentLayout.mjs.map +0 -0
- package/dist/src/LayoutManager/LayoutStrategies/FixedLayout.d.ts +0 -0
- package/dist/src/LayoutManager/LayoutStrategies/FixedLayout.d.ts.map +0 -0
- package/dist/src/LayoutManager/LayoutStrategies/FixedLayout.min.mjs +0 -0
- package/dist/src/LayoutManager/LayoutStrategies/FixedLayout.min.mjs.map +0 -0
- package/dist/src/LayoutManager/LayoutStrategies/FixedLayout.mjs +0 -0
- package/dist/src/LayoutManager/LayoutStrategies/FixedLayout.mjs.map +0 -0
- package/dist/src/LayoutManager/LayoutStrategies/LayoutStrategy.d.ts +0 -0
- package/dist/src/LayoutManager/LayoutStrategies/LayoutStrategy.d.ts.map +0 -0
- package/dist/src/LayoutManager/LayoutStrategies/LayoutStrategy.min.mjs +0 -0
- package/dist/src/LayoutManager/LayoutStrategies/LayoutStrategy.min.mjs.map +0 -0
- package/dist/src/LayoutManager/LayoutStrategies/LayoutStrategy.mjs +0 -0
- package/dist/src/LayoutManager/LayoutStrategies/LayoutStrategy.mjs.map +0 -0
- package/dist/src/LayoutManager/LayoutStrategies/utils.d.ts +0 -0
- package/dist/src/LayoutManager/LayoutStrategies/utils.d.ts.map +0 -0
- package/dist/src/LayoutManager/LayoutStrategies/utils.min.mjs +0 -0
- package/dist/src/LayoutManager/LayoutStrategies/utils.min.mjs.map +0 -0
- package/dist/src/LayoutManager/LayoutStrategies/utils.mjs +0 -0
- package/dist/src/LayoutManager/LayoutStrategies/utils.mjs.map +0 -0
- package/dist/src/LayoutManager/constants.d.ts +0 -0
- package/dist/src/LayoutManager/constants.d.ts.map +0 -0
- package/dist/src/LayoutManager/constants.min.mjs +0 -0
- package/dist/src/LayoutManager/constants.min.mjs.map +0 -0
- package/dist/src/LayoutManager/constants.mjs +0 -0
- package/dist/src/LayoutManager/constants.mjs.map +0 -0
- package/dist/src/LayoutManager/index.d.ts +0 -0
- package/dist/src/LayoutManager/index.d.ts.map +0 -0
- package/dist/src/LayoutManager/types.d.ts +0 -0
- package/dist/src/LayoutManager/types.d.ts.map +0 -0
- package/dist/src/Observable.d.ts +0 -0
- package/dist/src/Observable.d.ts.map +0 -0
- package/dist/src/Observable.min.mjs +0 -0
- package/dist/src/Observable.min.mjs.map +0 -0
- package/dist/src/Observable.mjs +0 -0
- package/dist/src/Observable.mjs.map +0 -0
- package/dist/src/Pattern/Pattern.d.ts +0 -0
- package/dist/src/Pattern/Pattern.d.ts.map +0 -0
- package/dist/src/Pattern/Pattern.min.mjs +0 -0
- package/dist/src/Pattern/Pattern.min.mjs.map +0 -0
- package/dist/src/Pattern/Pattern.mjs +0 -0
- package/dist/src/Pattern/Pattern.mjs.map +0 -0
- package/dist/src/Pattern/index.d.ts +0 -0
- package/dist/src/Pattern/index.d.ts.map +0 -0
- package/dist/src/Pattern/types.d.ts +0 -0
- package/dist/src/Pattern/types.d.ts.map +0 -0
- package/dist/src/Point.d.ts +0 -0
- package/dist/src/Point.d.ts.map +0 -0
- package/dist/src/Point.min.mjs +0 -0
- package/dist/src/Point.min.mjs.map +0 -0
- package/dist/src/Point.mjs +0 -0
- package/dist/src/Point.mjs.map +0 -0
- package/dist/src/Shadow.d.ts +0 -0
- package/dist/src/Shadow.d.ts.map +0 -0
- package/dist/src/Shadow.min.mjs +0 -0
- package/dist/src/Shadow.min.mjs.map +0 -0
- package/dist/src/Shadow.mjs +0 -0
- package/dist/src/Shadow.mjs.map +0 -0
- package/dist/src/brushes/BaseBrush.d.ts +0 -0
- package/dist/src/brushes/BaseBrush.d.ts.map +0 -0
- package/dist/src/brushes/BaseBrush.min.mjs +0 -0
- package/dist/src/brushes/BaseBrush.min.mjs.map +0 -0
- package/dist/src/brushes/BaseBrush.mjs +0 -0
- package/dist/src/brushes/BaseBrush.mjs.map +0 -0
- package/dist/src/brushes/CircleBrush.d.ts +0 -0
- package/dist/src/brushes/CircleBrush.d.ts.map +0 -0
- package/dist/src/brushes/CircleBrush.min.mjs +0 -0
- package/dist/src/brushes/CircleBrush.min.mjs.map +0 -0
- package/dist/src/brushes/CircleBrush.mjs +0 -0
- package/dist/src/brushes/CircleBrush.mjs.map +0 -0
- package/dist/src/brushes/PatternBrush.d.ts +0 -0
- package/dist/src/brushes/PatternBrush.d.ts.map +0 -0
- package/dist/src/brushes/PatternBrush.min.mjs +0 -0
- package/dist/src/brushes/PatternBrush.min.mjs.map +0 -0
- package/dist/src/brushes/PatternBrush.mjs +0 -0
- package/dist/src/brushes/PatternBrush.mjs.map +0 -0
- package/dist/src/brushes/PencilBrush.d.ts +0 -0
- package/dist/src/brushes/PencilBrush.d.ts.map +0 -0
- package/dist/src/brushes/PencilBrush.min.mjs +0 -0
- package/dist/src/brushes/PencilBrush.min.mjs.map +0 -0
- package/dist/src/brushes/PencilBrush.mjs +0 -0
- package/dist/src/brushes/PencilBrush.mjs.map +0 -0
- package/dist/src/brushes/SprayBrush.d.ts +0 -0
- package/dist/src/brushes/SprayBrush.d.ts.map +0 -0
- package/dist/src/brushes/SprayBrush.min.mjs +0 -0
- package/dist/src/brushes/SprayBrush.min.mjs.map +0 -0
- package/dist/src/brushes/SprayBrush.mjs +0 -0
- package/dist/src/brushes/SprayBrush.mjs.map +0 -0
- package/dist/src/brushes/typedefs.d.ts +0 -0
- package/dist/src/brushes/typedefs.d.ts.map +0 -0
- package/dist/src/cache.d.ts +0 -0
- package/dist/src/cache.d.ts.map +0 -0
- package/dist/src/cache.min.mjs +0 -0
- package/dist/src/cache.min.mjs.map +0 -0
- package/dist/src/cache.mjs +0 -0
- package/dist/src/cache.mjs.map +0 -0
- package/dist/src/canvas/Canvas.d.ts +0 -0
- package/dist/src/canvas/Canvas.d.ts.map +0 -0
- package/dist/src/canvas/Canvas.min.mjs +0 -0
- package/dist/src/canvas/Canvas.min.mjs.map +0 -0
- package/dist/src/canvas/Canvas.mjs +0 -0
- package/dist/src/canvas/Canvas.mjs.map +0 -0
- package/dist/src/canvas/CanvasOptions.d.ts +0 -0
- package/dist/src/canvas/CanvasOptions.d.ts.map +0 -0
- package/dist/src/canvas/CanvasOptions.min.mjs +0 -0
- package/dist/src/canvas/CanvasOptions.min.mjs.map +0 -0
- package/dist/src/canvas/CanvasOptions.mjs +0 -0
- package/dist/src/canvas/CanvasOptions.mjs.map +0 -0
- package/dist/src/canvas/DOMManagers/CanvasDOMManager.d.ts +0 -0
- package/dist/src/canvas/DOMManagers/CanvasDOMManager.d.ts.map +0 -0
- package/dist/src/canvas/DOMManagers/CanvasDOMManager.min.mjs +0 -0
- package/dist/src/canvas/DOMManagers/CanvasDOMManager.min.mjs.map +0 -0
- package/dist/src/canvas/DOMManagers/CanvasDOMManager.mjs +0 -0
- package/dist/src/canvas/DOMManagers/CanvasDOMManager.mjs.map +0 -0
- package/dist/src/canvas/DOMManagers/StaticCanvasDOMManager.d.ts +0 -0
- package/dist/src/canvas/DOMManagers/StaticCanvasDOMManager.d.ts.map +0 -0
- package/dist/src/canvas/DOMManagers/StaticCanvasDOMManager.min.mjs +0 -0
- package/dist/src/canvas/DOMManagers/StaticCanvasDOMManager.min.mjs.map +0 -0
- package/dist/src/canvas/DOMManagers/StaticCanvasDOMManager.mjs +0 -0
- package/dist/src/canvas/DOMManagers/StaticCanvasDOMManager.mjs.map +0 -0
- package/dist/src/canvas/DOMManagers/util.d.ts +0 -0
- package/dist/src/canvas/DOMManagers/util.d.ts.map +0 -0
- package/dist/src/canvas/DOMManagers/util.min.mjs +0 -0
- package/dist/src/canvas/DOMManagers/util.min.mjs.map +0 -0
- package/dist/src/canvas/DOMManagers/util.mjs +0 -0
- package/dist/src/canvas/DOMManagers/util.mjs.map +0 -0
- package/dist/src/canvas/SelectableCanvas.d.ts +0 -0
- package/dist/src/canvas/SelectableCanvas.d.ts.map +0 -0
- package/dist/src/canvas/SelectableCanvas.min.mjs +0 -0
- package/dist/src/canvas/SelectableCanvas.min.mjs.map +0 -0
- package/dist/src/canvas/SelectableCanvas.mjs +0 -0
- package/dist/src/canvas/SelectableCanvas.mjs.map +0 -0
- package/dist/src/canvas/StaticCanvas.d.ts +0 -0
- package/dist/src/canvas/StaticCanvas.d.ts.map +0 -0
- package/dist/src/canvas/StaticCanvas.min.mjs +0 -0
- package/dist/src/canvas/StaticCanvas.min.mjs.map +0 -0
- package/dist/src/canvas/StaticCanvas.mjs +0 -0
- package/dist/src/canvas/StaticCanvas.mjs.map +0 -0
- package/dist/src/canvas/StaticCanvasOptions.d.ts +0 -0
- package/dist/src/canvas/StaticCanvasOptions.d.ts.map +0 -0
- package/dist/src/canvas/StaticCanvasOptions.min.mjs +0 -0
- package/dist/src/canvas/StaticCanvasOptions.min.mjs.map +0 -0
- package/dist/src/canvas/StaticCanvasOptions.mjs +0 -0
- package/dist/src/canvas/StaticCanvasOptions.mjs.map +0 -0
- package/dist/src/canvas/TextEditingManager.d.ts +0 -0
- package/dist/src/canvas/TextEditingManager.d.ts.map +0 -0
- package/dist/src/canvas/TextEditingManager.min.mjs +0 -0
- package/dist/src/canvas/TextEditingManager.min.mjs.map +0 -0
- package/dist/src/canvas/TextEditingManager.mjs +0 -0
- package/dist/src/canvas/TextEditingManager.mjs.map +0 -0
- package/dist/src/canvas/canvas_gestures.mixin.d.ts +0 -0
- package/dist/src/canvas/canvas_gestures.mixin.d.ts.map +0 -0
- package/dist/src/color/Color.d.ts +0 -0
- package/dist/src/color/Color.d.ts.map +0 -0
- package/dist/src/color/Color.min.mjs +0 -0
- package/dist/src/color/Color.min.mjs.map +0 -0
- package/dist/src/color/Color.mjs +0 -0
- package/dist/src/color/Color.mjs.map +0 -0
- package/dist/src/color/color_map.d.ts +0 -0
- package/dist/src/color/color_map.d.ts.map +0 -0
- package/dist/src/color/color_map.min.mjs +0 -0
- package/dist/src/color/color_map.min.mjs.map +0 -0
- package/dist/src/color/color_map.mjs +0 -0
- package/dist/src/color/color_map.mjs.map +0 -0
- package/dist/src/color/constants.d.ts +0 -0
- package/dist/src/color/constants.d.ts.map +0 -0
- package/dist/src/color/constants.min.mjs +0 -0
- package/dist/src/color/constants.min.mjs.map +0 -0
- package/dist/src/color/constants.mjs +0 -0
- package/dist/src/color/constants.mjs.map +0 -0
- package/dist/src/color/typedefs.d.ts +0 -0
- package/dist/src/color/typedefs.d.ts.map +0 -0
- package/dist/src/color/util.d.ts +0 -0
- package/dist/src/color/util.d.ts.map +0 -0
- package/dist/src/color/util.min.mjs +0 -0
- package/dist/src/color/util.min.mjs.map +0 -0
- package/dist/src/color/util.mjs +0 -0
- package/dist/src/color/util.mjs.map +0 -0
- package/dist/src/config.d.ts +0 -0
- package/dist/src/config.d.ts.map +0 -0
- package/dist/src/config.min.mjs +0 -0
- package/dist/src/config.min.mjs.map +0 -0
- package/dist/src/config.mjs +0 -0
- package/dist/src/config.mjs.map +0 -0
- package/dist/src/constants.d.ts +0 -0
- package/dist/src/constants.d.ts.map +0 -0
- package/dist/src/constants.min.mjs +0 -0
- package/dist/src/constants.min.mjs.map +0 -0
- package/dist/src/constants.mjs +0 -0
- package/dist/src/constants.mjs.map +0 -0
- package/dist/src/controls/Control.d.ts +0 -0
- package/dist/src/controls/Control.d.ts.map +0 -0
- package/dist/src/controls/Control.min.mjs +0 -0
- package/dist/src/controls/Control.min.mjs.map +0 -0
- package/dist/src/controls/Control.mjs +0 -0
- package/dist/src/controls/Control.mjs.map +0 -0
- package/dist/src/controls/changeHeight.d.ts +0 -0
- package/dist/src/controls/changeHeight.d.ts.map +0 -0
- package/dist/src/controls/changeHeight.min.mjs +2 -0
- package/dist/src/controls/changeHeight.min.mjs.map +1 -0
- package/dist/src/controls/changeHeight.mjs +36 -0
- package/dist/src/controls/changeHeight.mjs.map +1 -0
- package/dist/src/controls/changeWidth.d.ts +0 -0
- package/dist/src/controls/changeWidth.d.ts.map +0 -0
- package/dist/src/controls/changeWidth.min.mjs +0 -0
- package/dist/src/controls/changeWidth.min.mjs.map +0 -0
- package/dist/src/controls/changeWidth.mjs +0 -0
- package/dist/src/controls/changeWidth.mjs.map +0 -0
- package/dist/src/controls/commonControls.d.ts +0 -0
- package/dist/src/controls/commonControls.d.ts.map +0 -0
- package/dist/src/controls/commonControls.min.mjs +0 -0
- package/dist/src/controls/commonControls.min.mjs.map +0 -0
- package/dist/src/controls/commonControls.mjs +0 -0
- package/dist/src/controls/commonControls.mjs.map +0 -0
- package/dist/src/controls/controlRendering.d.ts +0 -0
- package/dist/src/controls/controlRendering.d.ts.map +0 -0
- package/dist/src/controls/controlRendering.min.mjs +0 -0
- package/dist/src/controls/controlRendering.min.mjs.map +0 -0
- package/dist/src/controls/controlRendering.mjs +0 -0
- package/dist/src/controls/controlRendering.mjs.map +0 -0
- package/dist/src/controls/drag.d.ts +0 -0
- package/dist/src/controls/drag.d.ts.map +0 -0
- package/dist/src/controls/drag.min.mjs +0 -0
- package/dist/src/controls/drag.min.mjs.map +0 -0
- package/dist/src/controls/drag.mjs +0 -0
- package/dist/src/controls/drag.mjs.map +0 -0
- package/dist/src/controls/fireEvent.d.ts +0 -0
- package/dist/src/controls/fireEvent.d.ts.map +0 -0
- package/dist/src/controls/fireEvent.min.mjs +0 -0
- package/dist/src/controls/fireEvent.min.mjs.map +0 -0
- package/dist/src/controls/fireEvent.mjs +0 -0
- package/dist/src/controls/fireEvent.mjs.map +0 -0
- package/dist/src/controls/index.d.ts +0 -0
- package/dist/src/controls/index.d.ts.map +0 -0
- package/dist/src/controls/index.min.mjs +0 -0
- package/dist/src/controls/index.min.mjs.map +0 -0
- package/dist/src/controls/index.mjs +0 -0
- package/dist/src/controls/index.mjs.map +0 -0
- package/dist/src/controls/pathControl.d.ts +0 -0
- package/dist/src/controls/pathControl.d.ts.map +0 -0
- package/dist/src/controls/pathControl.min.mjs +0 -0
- package/dist/src/controls/pathControl.min.mjs.map +0 -0
- package/dist/src/controls/pathControl.mjs +0 -0
- package/dist/src/controls/pathControl.mjs.map +0 -0
- package/dist/src/controls/polyControl.d.ts +0 -0
- package/dist/src/controls/polyControl.d.ts.map +0 -0
- package/dist/src/controls/polyControl.min.mjs +0 -0
- package/dist/src/controls/polyControl.min.mjs.map +0 -0
- package/dist/src/controls/polyControl.mjs +0 -0
- package/dist/src/controls/polyControl.mjs.map +0 -0
- package/dist/src/controls/rotate.d.ts +0 -0
- package/dist/src/controls/rotate.d.ts.map +0 -0
- package/dist/src/controls/rotate.min.mjs +0 -0
- package/dist/src/controls/rotate.min.mjs.map +0 -0
- package/dist/src/controls/rotate.mjs +0 -0
- package/dist/src/controls/rotate.mjs.map +0 -0
- package/dist/src/controls/scale.d.ts +0 -0
- package/dist/src/controls/scale.d.ts.map +0 -0
- package/dist/src/controls/scale.min.mjs +0 -0
- package/dist/src/controls/scale.min.mjs.map +0 -0
- package/dist/src/controls/scale.mjs +0 -0
- package/dist/src/controls/scale.mjs.map +0 -0
- package/dist/src/controls/scaleSkew.d.ts +0 -0
- package/dist/src/controls/scaleSkew.d.ts.map +0 -0
- package/dist/src/controls/scaleSkew.min.mjs +0 -0
- package/dist/src/controls/scaleSkew.min.mjs.map +0 -0
- package/dist/src/controls/scaleSkew.mjs +0 -0
- package/dist/src/controls/scaleSkew.mjs.map +0 -0
- package/dist/src/controls/skew.d.ts +0 -0
- package/dist/src/controls/skew.d.ts.map +0 -0
- package/dist/src/controls/skew.min.mjs +0 -0
- package/dist/src/controls/skew.min.mjs.map +0 -0
- package/dist/src/controls/skew.mjs +0 -0
- package/dist/src/controls/skew.mjs.map +0 -0
- package/dist/src/controls/util.d.ts +0 -0
- package/dist/src/controls/util.d.ts.map +0 -0
- package/dist/src/controls/util.min.mjs +0 -0
- package/dist/src/controls/util.min.mjs.map +0 -0
- package/dist/src/controls/util.mjs +0 -0
- package/dist/src/controls/util.mjs.map +0 -0
- package/dist/src/controls/wrapWithFireEvent.d.ts +0 -0
- package/dist/src/controls/wrapWithFireEvent.d.ts.map +0 -0
- package/dist/src/controls/wrapWithFireEvent.min.mjs +0 -0
- package/dist/src/controls/wrapWithFireEvent.min.mjs.map +0 -0
- package/dist/src/controls/wrapWithFireEvent.mjs +0 -0
- package/dist/src/controls/wrapWithFireEvent.mjs.map +0 -0
- package/dist/src/controls/wrapWithFixedAnchor.d.ts +0 -0
- package/dist/src/controls/wrapWithFixedAnchor.d.ts.map +0 -0
- package/dist/src/controls/wrapWithFixedAnchor.min.mjs +0 -0
- package/dist/src/controls/wrapWithFixedAnchor.min.mjs.map +0 -0
- package/dist/src/controls/wrapWithFixedAnchor.mjs +0 -0
- package/dist/src/controls/wrapWithFixedAnchor.mjs.map +0 -0
- package/dist/src/env/browser.d.ts +0 -0
- package/dist/src/env/browser.d.ts.map +0 -0
- package/dist/src/env/browser.min.mjs +0 -0
- package/dist/src/env/browser.min.mjs.map +0 -0
- package/dist/src/env/browser.mjs +0 -0
- package/dist/src/env/browser.mjs.map +0 -0
- package/dist/src/env/index.d.ts +0 -0
- package/dist/src/env/index.d.ts.map +0 -0
- package/dist/src/env/index.min.mjs +0 -0
- package/dist/src/env/index.min.mjs.map +0 -0
- package/dist/src/env/index.mjs +0 -0
- package/dist/src/env/index.mjs.map +0 -0
- package/dist/src/env/node.d.ts +0 -0
- package/dist/src/env/node.d.ts.map +0 -0
- package/dist/src/env/types.d.ts +0 -0
- package/dist/src/env/types.d.ts.map +0 -0
- package/dist/src/filters/BaseFilter.d.ts +0 -0
- package/dist/src/filters/BaseFilter.d.ts.map +0 -0
- package/dist/src/filters/BaseFilter.min.mjs +0 -0
- package/dist/src/filters/BaseFilter.min.mjs.map +0 -0
- package/dist/src/filters/BaseFilter.mjs +0 -0
- package/dist/src/filters/BaseFilter.mjs.map +0 -0
- package/dist/src/filters/BlendColor.d.ts +0 -0
- package/dist/src/filters/BlendColor.d.ts.map +0 -0
- package/dist/src/filters/BlendColor.min.mjs +0 -0
- package/dist/src/filters/BlendColor.min.mjs.map +0 -0
- package/dist/src/filters/BlendColor.mjs +0 -0
- package/dist/src/filters/BlendColor.mjs.map +0 -0
- package/dist/src/filters/BlendImage.d.ts +0 -0
- package/dist/src/filters/BlendImage.d.ts.map +0 -0
- package/dist/src/filters/BlendImage.min.mjs +0 -0
- package/dist/src/filters/BlendImage.min.mjs.map +0 -0
- package/dist/src/filters/BlendImage.mjs +0 -0
- package/dist/src/filters/BlendImage.mjs.map +0 -0
- package/dist/src/filters/Blur.d.ts +0 -0
- package/dist/src/filters/Blur.d.ts.map +0 -0
- package/dist/src/filters/Blur.min.mjs +0 -0
- package/dist/src/filters/Blur.min.mjs.map +0 -0
- package/dist/src/filters/Blur.mjs +0 -0
- package/dist/src/filters/Blur.mjs.map +0 -0
- package/dist/src/filters/Boilerplate.d.ts +0 -0
- package/dist/src/filters/Boilerplate.d.ts.map +0 -0
- package/dist/src/filters/Brightness.d.ts +0 -0
- package/dist/src/filters/Brightness.d.ts.map +0 -0
- package/dist/src/filters/Brightness.min.mjs +0 -0
- package/dist/src/filters/Brightness.min.mjs.map +0 -0
- package/dist/src/filters/Brightness.mjs +0 -0
- package/dist/src/filters/Brightness.mjs.map +0 -0
- package/dist/src/filters/Canvas2dFilterBackend.d.ts +0 -0
- package/dist/src/filters/Canvas2dFilterBackend.d.ts.map +0 -0
- package/dist/src/filters/Canvas2dFilterBackend.min.mjs +0 -0
- package/dist/src/filters/Canvas2dFilterBackend.min.mjs.map +0 -0
- package/dist/src/filters/Canvas2dFilterBackend.mjs +0 -0
- package/dist/src/filters/Canvas2dFilterBackend.mjs.map +0 -0
- package/dist/src/filters/ColorMatrix.d.ts +0 -0
- package/dist/src/filters/ColorMatrix.d.ts.map +0 -0
- package/dist/src/filters/ColorMatrix.min.mjs +0 -0
- package/dist/src/filters/ColorMatrix.min.mjs.map +0 -0
- package/dist/src/filters/ColorMatrix.mjs +0 -0
- package/dist/src/filters/ColorMatrix.mjs.map +0 -0
- package/dist/src/filters/ColorMatrixFilters.d.ts +0 -0
- package/dist/src/filters/ColorMatrixFilters.d.ts.map +0 -0
- package/dist/src/filters/ColorMatrixFilters.min.mjs +0 -0
- package/dist/src/filters/ColorMatrixFilters.min.mjs.map +0 -0
- package/dist/src/filters/ColorMatrixFilters.mjs +0 -0
- package/dist/src/filters/ColorMatrixFilters.mjs.map +0 -0
- package/dist/src/filters/Composed.d.ts +0 -0
- package/dist/src/filters/Composed.d.ts.map +0 -0
- package/dist/src/filters/Composed.min.mjs +0 -0
- package/dist/src/filters/Composed.min.mjs.map +0 -0
- package/dist/src/filters/Composed.mjs +0 -0
- package/dist/src/filters/Composed.mjs.map +0 -0
- package/dist/src/filters/Contrast.d.ts +0 -0
- package/dist/src/filters/Contrast.d.ts.map +0 -0
- package/dist/src/filters/Contrast.min.mjs +0 -0
- package/dist/src/filters/Contrast.min.mjs.map +0 -0
- package/dist/src/filters/Contrast.mjs +0 -0
- package/dist/src/filters/Contrast.mjs.map +0 -0
- package/dist/src/filters/Convolute.d.ts +0 -0
- package/dist/src/filters/Convolute.d.ts.map +0 -0
- package/dist/src/filters/Convolute.min.mjs +0 -0
- package/dist/src/filters/Convolute.min.mjs.map +0 -0
- package/dist/src/filters/Convolute.mjs +0 -0
- package/dist/src/filters/Convolute.mjs.map +0 -0
- package/dist/src/filters/FilterBackend.d.ts +0 -0
- package/dist/src/filters/FilterBackend.d.ts.map +0 -0
- package/dist/src/filters/FilterBackend.min.mjs +0 -0
- package/dist/src/filters/FilterBackend.min.mjs.map +0 -0
- package/dist/src/filters/FilterBackend.mjs +0 -0
- package/dist/src/filters/FilterBackend.mjs.map +0 -0
- package/dist/src/filters/GLProbes/GLProbe.d.ts +0 -0
- package/dist/src/filters/GLProbes/GLProbe.d.ts.map +0 -0
- package/dist/src/filters/GLProbes/GLProbe.min.mjs +0 -0
- package/dist/src/filters/GLProbes/GLProbe.min.mjs.map +0 -0
- package/dist/src/filters/GLProbes/GLProbe.mjs +0 -0
- package/dist/src/filters/GLProbes/GLProbe.mjs.map +0 -0
- package/dist/src/filters/GLProbes/NodeGLProbe.d.ts +0 -0
- package/dist/src/filters/GLProbes/NodeGLProbe.d.ts.map +0 -0
- package/dist/src/filters/GLProbes/WebGLProbe.d.ts +0 -0
- package/dist/src/filters/GLProbes/WebGLProbe.d.ts.map +0 -0
- package/dist/src/filters/GLProbes/WebGLProbe.min.mjs +0 -0
- package/dist/src/filters/GLProbes/WebGLProbe.min.mjs.map +0 -0
- package/dist/src/filters/GLProbes/WebGLProbe.mjs +0 -0
- package/dist/src/filters/GLProbes/WebGLProbe.mjs.map +0 -0
- package/dist/src/filters/Gamma.d.ts +0 -0
- package/dist/src/filters/Gamma.d.ts.map +0 -0
- package/dist/src/filters/Gamma.min.mjs +0 -0
- package/dist/src/filters/Gamma.min.mjs.map +0 -0
- package/dist/src/filters/Gamma.mjs +0 -0
- package/dist/src/filters/Gamma.mjs.map +0 -0
- package/dist/src/filters/Grayscale.d.ts +0 -0
- package/dist/src/filters/Grayscale.d.ts.map +0 -0
- package/dist/src/filters/Grayscale.min.mjs +0 -0
- package/dist/src/filters/Grayscale.min.mjs.map +0 -0
- package/dist/src/filters/Grayscale.mjs +0 -0
- package/dist/src/filters/Grayscale.mjs.map +0 -0
- package/dist/src/filters/HueRotation.d.ts +0 -0
- package/dist/src/filters/HueRotation.d.ts.map +0 -0
- package/dist/src/filters/HueRotation.min.mjs +0 -0
- package/dist/src/filters/HueRotation.min.mjs.map +0 -0
- package/dist/src/filters/HueRotation.mjs +0 -0
- package/dist/src/filters/HueRotation.mjs.map +0 -0
- package/dist/src/filters/Invert.d.ts +0 -0
- package/dist/src/filters/Invert.d.ts.map +0 -0
- package/dist/src/filters/Invert.min.mjs +0 -0
- package/dist/src/filters/Invert.min.mjs.map +0 -0
- package/dist/src/filters/Invert.mjs +0 -0
- package/dist/src/filters/Invert.mjs.map +0 -0
- package/dist/src/filters/Noise.d.ts +0 -0
- package/dist/src/filters/Noise.d.ts.map +0 -0
- package/dist/src/filters/Noise.min.mjs +0 -0
- package/dist/src/filters/Noise.min.mjs.map +0 -0
- package/dist/src/filters/Noise.mjs +0 -0
- package/dist/src/filters/Noise.mjs.map +0 -0
- package/dist/src/filters/Pixelate.d.ts +0 -0
- package/dist/src/filters/Pixelate.d.ts.map +0 -0
- package/dist/src/filters/Pixelate.min.mjs +0 -0
- package/dist/src/filters/Pixelate.min.mjs.map +0 -0
- package/dist/src/filters/Pixelate.mjs +0 -0
- package/dist/src/filters/Pixelate.mjs.map +0 -0
- package/dist/src/filters/RemoveColor.d.ts +0 -0
- package/dist/src/filters/RemoveColor.d.ts.map +0 -0
- package/dist/src/filters/RemoveColor.min.mjs +0 -0
- package/dist/src/filters/RemoveColor.min.mjs.map +0 -0
- package/dist/src/filters/RemoveColor.mjs +0 -0
- package/dist/src/filters/RemoveColor.mjs.map +0 -0
- package/dist/src/filters/Resize.d.ts +0 -0
- package/dist/src/filters/Resize.d.ts.map +0 -0
- package/dist/src/filters/Resize.min.mjs +0 -0
- package/dist/src/filters/Resize.min.mjs.map +0 -0
- package/dist/src/filters/Resize.mjs +0 -0
- package/dist/src/filters/Resize.mjs.map +0 -0
- package/dist/src/filters/Saturation.d.ts +0 -0
- package/dist/src/filters/Saturation.d.ts.map +0 -0
- package/dist/src/filters/Saturation.min.mjs +0 -0
- package/dist/src/filters/Saturation.min.mjs.map +0 -0
- package/dist/src/filters/Saturation.mjs +0 -0
- package/dist/src/filters/Saturation.mjs.map +0 -0
- package/dist/src/filters/Vibrance.d.ts +0 -0
- package/dist/src/filters/Vibrance.d.ts.map +0 -0
- package/dist/src/filters/Vibrance.min.mjs +0 -0
- package/dist/src/filters/Vibrance.min.mjs.map +0 -0
- package/dist/src/filters/Vibrance.mjs +0 -0
- package/dist/src/filters/Vibrance.mjs.map +0 -0
- package/dist/src/filters/WebGLFilterBackend.d.ts +0 -0
- package/dist/src/filters/WebGLFilterBackend.d.ts.map +0 -0
- package/dist/src/filters/WebGLFilterBackend.min.mjs +0 -0
- package/dist/src/filters/WebGLFilterBackend.min.mjs.map +0 -0
- package/dist/src/filters/WebGLFilterBackend.mjs +0 -0
- package/dist/src/filters/WebGLFilterBackend.mjs.map +0 -0
- package/dist/src/filters/filters.d.ts +0 -0
- package/dist/src/filters/filters.d.ts.map +0 -0
- package/dist/src/filters/filters.min.mjs +0 -0
- package/dist/src/filters/filters.min.mjs.map +0 -0
- package/dist/src/filters/filters.mjs +0 -0
- package/dist/src/filters/filters.mjs.map +0 -0
- package/dist/src/filters/index.d.ts +0 -0
- package/dist/src/filters/index.d.ts.map +0 -0
- package/dist/src/filters/shaders/baseFilter.d.ts +0 -0
- package/dist/src/filters/shaders/baseFilter.d.ts.map +0 -0
- package/dist/src/filters/shaders/baseFilter.min.mjs +0 -0
- package/dist/src/filters/shaders/baseFilter.min.mjs.map +0 -0
- package/dist/src/filters/shaders/baseFilter.mjs +0 -0
- package/dist/src/filters/shaders/baseFilter.mjs.map +0 -0
- package/dist/src/filters/shaders/blendColor.d.ts +0 -0
- package/dist/src/filters/shaders/blendColor.d.ts.map +0 -0
- package/dist/src/filters/shaders/blendColor.min.mjs +0 -0
- package/dist/src/filters/shaders/blendColor.min.mjs.map +0 -0
- package/dist/src/filters/shaders/blendColor.mjs +0 -0
- package/dist/src/filters/shaders/blendColor.mjs.map +0 -0
- package/dist/src/filters/shaders/blendImage.d.ts +0 -0
- package/dist/src/filters/shaders/blendImage.d.ts.map +0 -0
- package/dist/src/filters/shaders/blendImage.min.mjs +0 -0
- package/dist/src/filters/shaders/blendImage.min.mjs.map +0 -0
- package/dist/src/filters/shaders/blendImage.mjs +0 -0
- package/dist/src/filters/shaders/blendImage.mjs.map +0 -0
- package/dist/src/filters/shaders/blur.d.ts +0 -0
- package/dist/src/filters/shaders/blur.d.ts.map +0 -0
- package/dist/src/filters/shaders/blur.min.mjs +0 -0
- package/dist/src/filters/shaders/blur.min.mjs.map +0 -0
- package/dist/src/filters/shaders/blur.mjs +0 -0
- package/dist/src/filters/shaders/blur.mjs.map +0 -0
- package/dist/src/filters/shaders/brightness.d.ts +0 -0
- package/dist/src/filters/shaders/brightness.d.ts.map +0 -0
- package/dist/src/filters/shaders/brightness.min.mjs +0 -0
- package/dist/src/filters/shaders/brightness.min.mjs.map +0 -0
- package/dist/src/filters/shaders/brightness.mjs +0 -0
- package/dist/src/filters/shaders/brightness.mjs.map +0 -0
- package/dist/src/filters/shaders/colorMatrix.d.ts +0 -0
- package/dist/src/filters/shaders/colorMatrix.d.ts.map +0 -0
- package/dist/src/filters/shaders/colorMatrix.min.mjs +0 -0
- package/dist/src/filters/shaders/colorMatrix.min.mjs.map +0 -0
- package/dist/src/filters/shaders/colorMatrix.mjs +0 -0
- package/dist/src/filters/shaders/colorMatrix.mjs.map +0 -0
- package/dist/src/filters/shaders/constrast.d.ts +0 -0
- package/dist/src/filters/shaders/constrast.d.ts.map +0 -0
- package/dist/src/filters/shaders/constrast.min.mjs +0 -0
- package/dist/src/filters/shaders/constrast.min.mjs.map +0 -0
- package/dist/src/filters/shaders/constrast.mjs +0 -0
- package/dist/src/filters/shaders/constrast.mjs.map +0 -0
- package/dist/src/filters/shaders/convolute.d.ts +0 -0
- package/dist/src/filters/shaders/convolute.d.ts.map +0 -0
- package/dist/src/filters/shaders/convolute.min.mjs +0 -0
- package/dist/src/filters/shaders/convolute.min.mjs.map +0 -0
- package/dist/src/filters/shaders/convolute.mjs +0 -0
- package/dist/src/filters/shaders/convolute.mjs.map +0 -0
- package/dist/src/filters/shaders/gamma.d.ts +0 -0
- package/dist/src/filters/shaders/gamma.d.ts.map +0 -0
- package/dist/src/filters/shaders/gamma.min.mjs +0 -0
- package/dist/src/filters/shaders/gamma.min.mjs.map +0 -0
- package/dist/src/filters/shaders/gamma.mjs +0 -0
- package/dist/src/filters/shaders/gamma.mjs.map +0 -0
- package/dist/src/filters/shaders/grayscale.d.ts +0 -0
- package/dist/src/filters/shaders/grayscale.d.ts.map +0 -0
- package/dist/src/filters/shaders/grayscale.min.mjs +0 -0
- package/dist/src/filters/shaders/grayscale.min.mjs.map +0 -0
- package/dist/src/filters/shaders/grayscale.mjs +0 -0
- package/dist/src/filters/shaders/grayscale.mjs.map +0 -0
- package/dist/src/filters/shaders/invert.d.ts +0 -0
- package/dist/src/filters/shaders/invert.d.ts.map +0 -0
- package/dist/src/filters/shaders/invert.min.mjs +0 -0
- package/dist/src/filters/shaders/invert.min.mjs.map +0 -0
- package/dist/src/filters/shaders/invert.mjs +0 -0
- package/dist/src/filters/shaders/invert.mjs.map +0 -0
- package/dist/src/filters/shaders/noise.d.ts +0 -0
- package/dist/src/filters/shaders/noise.d.ts.map +0 -0
- package/dist/src/filters/shaders/noise.min.mjs +0 -0
- package/dist/src/filters/shaders/noise.min.mjs.map +0 -0
- package/dist/src/filters/shaders/noise.mjs +0 -0
- package/dist/src/filters/shaders/noise.mjs.map +0 -0
- package/dist/src/filters/shaders/pixelate.d.ts +0 -0
- package/dist/src/filters/shaders/pixelate.d.ts.map +0 -0
- package/dist/src/filters/shaders/pixelate.min.mjs +0 -0
- package/dist/src/filters/shaders/pixelate.min.mjs.map +0 -0
- package/dist/src/filters/shaders/pixelate.mjs +0 -0
- package/dist/src/filters/shaders/pixelate.mjs.map +0 -0
- package/dist/src/filters/shaders/removeColor.d.ts +0 -0
- package/dist/src/filters/shaders/removeColor.d.ts.map +0 -0
- package/dist/src/filters/shaders/removeColor.min.mjs +0 -0
- package/dist/src/filters/shaders/removeColor.min.mjs.map +0 -0
- package/dist/src/filters/shaders/removeColor.mjs +0 -0
- package/dist/src/filters/shaders/removeColor.mjs.map +0 -0
- package/dist/src/filters/shaders/saturation.d.ts +0 -0
- package/dist/src/filters/shaders/saturation.d.ts.map +0 -0
- package/dist/src/filters/shaders/saturation.min.mjs +0 -0
- package/dist/src/filters/shaders/saturation.min.mjs.map +0 -0
- package/dist/src/filters/shaders/saturation.mjs +0 -0
- package/dist/src/filters/shaders/saturation.mjs.map +0 -0
- package/dist/src/filters/shaders/vibrance.d.ts +0 -0
- package/dist/src/filters/shaders/vibrance.d.ts.map +0 -0
- package/dist/src/filters/shaders/vibrance.min.mjs +0 -0
- package/dist/src/filters/shaders/vibrance.min.mjs.map +0 -0
- package/dist/src/filters/shaders/vibrance.mjs +0 -0
- package/dist/src/filters/shaders/vibrance.mjs.map +0 -0
- package/dist/src/filters/typedefs.d.ts +0 -0
- package/dist/src/filters/typedefs.d.ts.map +0 -0
- package/dist/src/filters/utils.d.ts +0 -0
- package/dist/src/filters/utils.d.ts.map +0 -0
- package/dist/src/filters/utils.min.mjs +0 -0
- package/dist/src/filters/utils.min.mjs.map +0 -0
- package/dist/src/filters/utils.mjs +0 -0
- package/dist/src/filters/utils.mjs.map +0 -0
- package/dist/src/gradient/Gradient.d.ts +0 -0
- package/dist/src/gradient/Gradient.d.ts.map +0 -0
- package/dist/src/gradient/Gradient.min.mjs +0 -0
- package/dist/src/gradient/Gradient.min.mjs.map +0 -0
- package/dist/src/gradient/Gradient.mjs +0 -0
- package/dist/src/gradient/Gradient.mjs.map +0 -0
- package/dist/src/gradient/constants.d.ts +0 -0
- package/dist/src/gradient/constants.d.ts.map +0 -0
- package/dist/src/gradient/constants.min.mjs +0 -0
- package/dist/src/gradient/constants.min.mjs.map +0 -0
- package/dist/src/gradient/constants.mjs +0 -0
- package/dist/src/gradient/constants.mjs.map +0 -0
- package/dist/src/gradient/index.d.ts +0 -0
- package/dist/src/gradient/index.d.ts.map +0 -0
- package/dist/src/gradient/parser/misc.d.ts +0 -0
- package/dist/src/gradient/parser/misc.d.ts.map +0 -0
- package/dist/src/gradient/parser/misc.min.mjs +0 -0
- package/dist/src/gradient/parser/misc.min.mjs.map +0 -0
- package/dist/src/gradient/parser/misc.mjs +0 -0
- package/dist/src/gradient/parser/misc.mjs.map +0 -0
- package/dist/src/gradient/parser/parseColorStops.d.ts +0 -0
- package/dist/src/gradient/parser/parseColorStops.d.ts.map +0 -0
- package/dist/src/gradient/parser/parseColorStops.min.mjs +0 -0
- package/dist/src/gradient/parser/parseColorStops.min.mjs.map +0 -0
- package/dist/src/gradient/parser/parseColorStops.mjs +0 -0
- package/dist/src/gradient/parser/parseColorStops.mjs.map +0 -0
- package/dist/src/gradient/parser/parseCoords.d.ts +0 -0
- package/dist/src/gradient/parser/parseCoords.d.ts.map +0 -0
- package/dist/src/gradient/parser/parseCoords.min.mjs +0 -0
- package/dist/src/gradient/parser/parseCoords.min.mjs.map +0 -0
- package/dist/src/gradient/parser/parseCoords.mjs +0 -0
- package/dist/src/gradient/parser/parseCoords.mjs.map +0 -0
- package/dist/src/gradient/typedefs.d.ts +0 -0
- package/dist/src/gradient/typedefs.d.ts.map +0 -0
- package/dist/src/mixins/eraser_brush.mixin.d.ts +0 -0
- package/dist/src/mixins/eraser_brush.mixin.d.ts.map +0 -0
- package/dist/src/parkinglot/canvas_animation.mixin.d.ts +0 -0
- package/dist/src/parkinglot/canvas_animation.mixin.d.ts.map +0 -0
- package/dist/src/parkinglot/straighten.d.ts +0 -0
- package/dist/src/parkinglot/straighten.d.ts.map +0 -0
- package/dist/src/parser/applyViewboxTransform.d.ts +0 -0
- package/dist/src/parser/applyViewboxTransform.d.ts.map +0 -0
- package/dist/src/parser/applyViewboxTransform.min.mjs +0 -0
- package/dist/src/parser/applyViewboxTransform.min.mjs.map +0 -0
- package/dist/src/parser/applyViewboxTransform.mjs +0 -0
- package/dist/src/parser/applyViewboxTransform.mjs.map +0 -0
- package/dist/src/parser/attributes.d.ts +0 -0
- package/dist/src/parser/attributes.d.ts.map +0 -0
- package/dist/src/parser/attributes.min.mjs +0 -0
- package/dist/src/parser/attributes.min.mjs.map +0 -0
- package/dist/src/parser/attributes.mjs +0 -0
- package/dist/src/parser/attributes.mjs.map +0 -0
- package/dist/src/parser/constants.d.ts +0 -0
- package/dist/src/parser/constants.d.ts.map +0 -0
- package/dist/src/parser/constants.min.mjs +0 -0
- package/dist/src/parser/constants.min.mjs.map +0 -0
- package/dist/src/parser/constants.mjs +0 -0
- package/dist/src/parser/constants.mjs.map +0 -0
- package/dist/src/parser/doesSomeParentMatch.d.ts +0 -0
- package/dist/src/parser/doesSomeParentMatch.d.ts.map +0 -0
- package/dist/src/parser/doesSomeParentMatch.min.mjs +0 -0
- package/dist/src/parser/doesSomeParentMatch.min.mjs.map +0 -0
- package/dist/src/parser/doesSomeParentMatch.mjs +0 -0
- package/dist/src/parser/doesSomeParentMatch.mjs.map +0 -0
- package/dist/src/parser/elementMatchesRule.d.ts +0 -0
- package/dist/src/parser/elementMatchesRule.d.ts.map +0 -0
- package/dist/src/parser/elementMatchesRule.min.mjs +0 -0
- package/dist/src/parser/elementMatchesRule.min.mjs.map +0 -0
- package/dist/src/parser/elementMatchesRule.mjs +0 -0
- package/dist/src/parser/elementMatchesRule.mjs.map +0 -0
- package/dist/src/parser/elements_parser.d.ts +0 -0
- package/dist/src/parser/elements_parser.d.ts.map +0 -0
- package/dist/src/parser/elements_parser.min.mjs +0 -0
- package/dist/src/parser/elements_parser.min.mjs.map +0 -0
- package/dist/src/parser/elements_parser.mjs +0 -0
- package/dist/src/parser/elements_parser.mjs.map +0 -0
- package/dist/src/parser/getCSSRules.d.ts +0 -0
- package/dist/src/parser/getCSSRules.d.ts.map +0 -0
- package/dist/src/parser/getCSSRules.min.mjs +0 -0
- package/dist/src/parser/getCSSRules.min.mjs.map +0 -0
- package/dist/src/parser/getCSSRules.mjs +0 -0
- package/dist/src/parser/getCSSRules.mjs.map +0 -0
- package/dist/src/parser/getGlobalStylesForElement.d.ts +0 -0
- package/dist/src/parser/getGlobalStylesForElement.d.ts.map +0 -0
- package/dist/src/parser/getGlobalStylesForElement.min.mjs +0 -0
- package/dist/src/parser/getGlobalStylesForElement.min.mjs.map +0 -0
- package/dist/src/parser/getGlobalStylesForElement.mjs +0 -0
- package/dist/src/parser/getGlobalStylesForElement.mjs.map +0 -0
- package/dist/src/parser/getGradientDefs.d.ts +0 -0
- package/dist/src/parser/getGradientDefs.d.ts.map +0 -0
- package/dist/src/parser/getGradientDefs.min.mjs +0 -0
- package/dist/src/parser/getGradientDefs.min.mjs.map +0 -0
- package/dist/src/parser/getGradientDefs.mjs +0 -0
- package/dist/src/parser/getGradientDefs.mjs.map +0 -0
- package/dist/src/parser/getMultipleNodes.d.ts +0 -0
- package/dist/src/parser/getMultipleNodes.d.ts.map +0 -0
- package/dist/src/parser/getMultipleNodes.min.mjs +0 -0
- package/dist/src/parser/getMultipleNodes.min.mjs.map +0 -0
- package/dist/src/parser/getMultipleNodes.mjs +0 -0
- package/dist/src/parser/getMultipleNodes.mjs.map +0 -0
- package/dist/src/parser/getSvgRegex.d.ts +0 -0
- package/dist/src/parser/getSvgRegex.d.ts.map +0 -0
- package/dist/src/parser/getSvgRegex.min.mjs +0 -0
- package/dist/src/parser/getSvgRegex.min.mjs.map +0 -0
- package/dist/src/parser/getSvgRegex.mjs +0 -0
- package/dist/src/parser/getSvgRegex.mjs.map +0 -0
- package/dist/src/parser/getTagName.d.ts +0 -0
- package/dist/src/parser/getTagName.d.ts.map +0 -0
- package/dist/src/parser/getTagName.min.mjs +0 -0
- package/dist/src/parser/getTagName.min.mjs.map +0 -0
- package/dist/src/parser/getTagName.mjs +0 -0
- package/dist/src/parser/getTagName.mjs.map +0 -0
- package/dist/src/parser/hasInvalidAncestor.d.ts +0 -0
- package/dist/src/parser/hasInvalidAncestor.d.ts.map +0 -0
- package/dist/src/parser/hasInvalidAncestor.min.mjs +0 -0
- package/dist/src/parser/hasInvalidAncestor.min.mjs.map +0 -0
- package/dist/src/parser/hasInvalidAncestor.mjs +0 -0
- package/dist/src/parser/hasInvalidAncestor.mjs.map +0 -0
- package/dist/src/parser/loadSVGFromString.d.ts +0 -0
- package/dist/src/parser/loadSVGFromString.d.ts.map +0 -0
- package/dist/src/parser/loadSVGFromString.min.mjs +0 -0
- package/dist/src/parser/loadSVGFromString.min.mjs.map +0 -0
- package/dist/src/parser/loadSVGFromString.mjs +0 -0
- package/dist/src/parser/loadSVGFromString.mjs.map +0 -0
- package/dist/src/parser/loadSVGFromURL.d.ts +0 -0
- package/dist/src/parser/loadSVGFromURL.d.ts.map +0 -0
- package/dist/src/parser/loadSVGFromURL.min.mjs +0 -0
- package/dist/src/parser/loadSVGFromURL.min.mjs.map +0 -0
- package/dist/src/parser/loadSVGFromURL.mjs +0 -0
- package/dist/src/parser/loadSVGFromURL.mjs.map +0 -0
- package/dist/src/parser/normalizeAttr.d.ts +0 -0
- package/dist/src/parser/normalizeAttr.d.ts.map +0 -0
- package/dist/src/parser/normalizeAttr.min.mjs +0 -0
- package/dist/src/parser/normalizeAttr.min.mjs.map +0 -0
- package/dist/src/parser/normalizeAttr.mjs +0 -0
- package/dist/src/parser/normalizeAttr.mjs.map +0 -0
- package/dist/src/parser/normalizeValue.d.ts +0 -0
- package/dist/src/parser/normalizeValue.d.ts.map +0 -0
- package/dist/src/parser/normalizeValue.min.mjs +0 -0
- package/dist/src/parser/normalizeValue.min.mjs.map +0 -0
- package/dist/src/parser/normalizeValue.mjs +0 -0
- package/dist/src/parser/normalizeValue.mjs.map +0 -0
- package/dist/src/parser/parseAttributes.d.ts +0 -0
- package/dist/src/parser/parseAttributes.d.ts.map +0 -0
- package/dist/src/parser/parseAttributes.min.mjs +0 -0
- package/dist/src/parser/parseAttributes.min.mjs.map +0 -0
- package/dist/src/parser/parseAttributes.mjs +0 -0
- package/dist/src/parser/parseAttributes.mjs.map +0 -0
- package/dist/src/parser/parseFontDeclaration.d.ts +0 -0
- package/dist/src/parser/parseFontDeclaration.d.ts.map +0 -0
- package/dist/src/parser/parseFontDeclaration.min.mjs +0 -0
- package/dist/src/parser/parseFontDeclaration.min.mjs.map +0 -0
- package/dist/src/parser/parseFontDeclaration.mjs +0 -0
- package/dist/src/parser/parseFontDeclaration.mjs.map +0 -0
- package/dist/src/parser/parsePointsAttribute.d.ts +0 -0
- package/dist/src/parser/parsePointsAttribute.d.ts.map +0 -0
- package/dist/src/parser/parsePointsAttribute.min.mjs +0 -0
- package/dist/src/parser/parsePointsAttribute.min.mjs.map +0 -0
- package/dist/src/parser/parsePointsAttribute.mjs +0 -0
- package/dist/src/parser/parsePointsAttribute.mjs.map +0 -0
- package/dist/src/parser/parseSVGDocument.d.ts +0 -0
- package/dist/src/parser/parseSVGDocument.d.ts.map +0 -0
- package/dist/src/parser/parseSVGDocument.min.mjs +0 -0
- package/dist/src/parser/parseSVGDocument.min.mjs.map +0 -0
- package/dist/src/parser/parseSVGDocument.mjs +0 -0
- package/dist/src/parser/parseSVGDocument.mjs.map +0 -0
- package/dist/src/parser/parseStyleAttribute.d.ts +0 -0
- package/dist/src/parser/parseStyleAttribute.d.ts.map +0 -0
- package/dist/src/parser/parseStyleAttribute.min.mjs +0 -0
- package/dist/src/parser/parseStyleAttribute.min.mjs.map +0 -0
- package/dist/src/parser/parseStyleAttribute.mjs +0 -0
- package/dist/src/parser/parseStyleAttribute.mjs.map +0 -0
- package/dist/src/parser/parseStyleObject.d.ts +0 -0
- package/dist/src/parser/parseStyleObject.d.ts.map +0 -0
- package/dist/src/parser/parseStyleObject.min.mjs +0 -0
- package/dist/src/parser/parseStyleObject.min.mjs.map +0 -0
- package/dist/src/parser/parseStyleObject.mjs +0 -0
- package/dist/src/parser/parseStyleObject.mjs.map +0 -0
- package/dist/src/parser/parseStyleString.d.ts +0 -0
- package/dist/src/parser/parseStyleString.d.ts.map +0 -0
- package/dist/src/parser/parseStyleString.min.mjs +0 -0
- package/dist/src/parser/parseStyleString.min.mjs.map +0 -0
- package/dist/src/parser/parseStyleString.mjs +0 -0
- package/dist/src/parser/parseStyleString.mjs.map +0 -0
- package/dist/src/parser/parseTransformAttribute.d.ts +0 -0
- package/dist/src/parser/parseTransformAttribute.d.ts.map +0 -0
- package/dist/src/parser/parseTransformAttribute.min.mjs +0 -0
- package/dist/src/parser/parseTransformAttribute.min.mjs.map +0 -0
- package/dist/src/parser/parseTransformAttribute.mjs +0 -0
- package/dist/src/parser/parseTransformAttribute.mjs.map +0 -0
- package/dist/src/parser/parseUseDirectives.d.ts +0 -0
- package/dist/src/parser/parseUseDirectives.d.ts.map +0 -0
- package/dist/src/parser/parseUseDirectives.min.mjs +0 -0
- package/dist/src/parser/parseUseDirectives.min.mjs.map +0 -0
- package/dist/src/parser/parseUseDirectives.mjs +0 -0
- package/dist/src/parser/parseUseDirectives.mjs.map +0 -0
- package/dist/src/parser/percent.d.ts +0 -0
- package/dist/src/parser/percent.d.ts.map +0 -0
- package/dist/src/parser/percent.min.mjs +0 -0
- package/dist/src/parser/percent.min.mjs.map +0 -0
- package/dist/src/parser/percent.mjs +0 -0
- package/dist/src/parser/percent.mjs.map +0 -0
- package/dist/src/parser/recursivelyParseGradientsXlink.d.ts +0 -0
- package/dist/src/parser/recursivelyParseGradientsXlink.d.ts.map +0 -0
- package/dist/src/parser/recursivelyParseGradientsXlink.min.mjs +0 -0
- package/dist/src/parser/recursivelyParseGradientsXlink.min.mjs.map +0 -0
- package/dist/src/parser/recursivelyParseGradientsXlink.mjs +0 -0
- package/dist/src/parser/recursivelyParseGradientsXlink.mjs.map +0 -0
- package/dist/src/parser/selectorMatches.d.ts +0 -0
- package/dist/src/parser/selectorMatches.d.ts.map +0 -0
- package/dist/src/parser/selectorMatches.min.mjs +0 -0
- package/dist/src/parser/selectorMatches.min.mjs.map +0 -0
- package/dist/src/parser/selectorMatches.mjs +0 -0
- package/dist/src/parser/selectorMatches.mjs.map +0 -0
- package/dist/src/parser/setStrokeFillOpacity.d.ts +0 -0
- package/dist/src/parser/setStrokeFillOpacity.d.ts.map +0 -0
- package/dist/src/parser/setStrokeFillOpacity.min.mjs +0 -0
- package/dist/src/parser/setStrokeFillOpacity.min.mjs.map +0 -0
- package/dist/src/parser/setStrokeFillOpacity.mjs +0 -0
- package/dist/src/parser/setStrokeFillOpacity.mjs.map +0 -0
- package/dist/src/parser/typedefs.d.ts +0 -0
- package/dist/src/parser/typedefs.d.ts.map +0 -0
- package/dist/src/shapes/ActiveSelection.d.ts +0 -0
- package/dist/src/shapes/ActiveSelection.d.ts.map +0 -0
- package/dist/src/shapes/ActiveSelection.min.mjs +0 -0
- package/dist/src/shapes/ActiveSelection.min.mjs.map +0 -0
- package/dist/src/shapes/ActiveSelection.mjs +0 -0
- package/dist/src/shapes/ActiveSelection.mjs.map +0 -0
- package/dist/src/shapes/Circle.d.ts +0 -0
- package/dist/src/shapes/Circle.d.ts.map +0 -0
- package/dist/src/shapes/Circle.min.mjs +0 -0
- package/dist/src/shapes/Circle.min.mjs.map +0 -0
- package/dist/src/shapes/Circle.mjs +0 -0
- package/dist/src/shapes/Circle.mjs.map +0 -0
- package/dist/src/shapes/Ellipse.d.ts +0 -0
- package/dist/src/shapes/Ellipse.d.ts.map +0 -0
- package/dist/src/shapes/Ellipse.min.mjs +0 -0
- package/dist/src/shapes/Ellipse.min.mjs.map +0 -0
- package/dist/src/shapes/Ellipse.mjs +0 -0
- package/dist/src/shapes/Ellipse.mjs.map +0 -0
- package/dist/src/shapes/Group.d.ts +0 -0
- package/dist/src/shapes/Group.d.ts.map +0 -0
- package/dist/src/shapes/Group.min.mjs +0 -0
- package/dist/src/shapes/Group.min.mjs.map +0 -0
- package/dist/src/shapes/Group.mjs +0 -0
- package/dist/src/shapes/Group.mjs.map +0 -0
- package/dist/src/shapes/IText/DraggableTextDelegate.d.ts +0 -0
- package/dist/src/shapes/IText/DraggableTextDelegate.d.ts.map +0 -0
- package/dist/src/shapes/IText/DraggableTextDelegate.min.mjs +0 -0
- package/dist/src/shapes/IText/DraggableTextDelegate.min.mjs.map +0 -0
- package/dist/src/shapes/IText/DraggableTextDelegate.mjs +0 -0
- package/dist/src/shapes/IText/DraggableTextDelegate.mjs.map +0 -0
- package/dist/src/shapes/IText/IText.d.ts +0 -0
- package/dist/src/shapes/IText/IText.d.ts.map +0 -0
- package/dist/src/shapes/IText/IText.min.mjs +0 -0
- package/dist/src/shapes/IText/IText.min.mjs.map +1 -1
- package/dist/src/shapes/IText/IText.mjs +206 -206
- package/dist/src/shapes/IText/IText.mjs.map +1 -1
- package/dist/src/shapes/IText/ITextBehavior.d.ts +0 -0
- package/dist/src/shapes/IText/ITextBehavior.d.ts.map +1 -1
- package/dist/src/shapes/IText/ITextBehavior.min.mjs +1 -1
- package/dist/src/shapes/IText/ITextBehavior.min.mjs.map +1 -1
- package/dist/src/shapes/IText/ITextBehavior.mjs +221 -157
- package/dist/src/shapes/IText/ITextBehavior.mjs.map +1 -1
- package/dist/src/shapes/IText/ITextClickBehavior.d.ts +0 -0
- package/dist/src/shapes/IText/ITextClickBehavior.d.ts.map +0 -0
- package/dist/src/shapes/IText/ITextClickBehavior.min.mjs +0 -0
- package/dist/src/shapes/IText/ITextClickBehavior.min.mjs.map +1 -1
- package/dist/src/shapes/IText/ITextClickBehavior.mjs +36 -36
- package/dist/src/shapes/IText/ITextClickBehavior.mjs.map +1 -1
- package/dist/src/shapes/IText/ITextKeyBehavior.d.ts +0 -0
- package/dist/src/shapes/IText/ITextKeyBehavior.d.ts.map +0 -0
- package/dist/src/shapes/IText/ITextKeyBehavior.min.mjs +0 -0
- package/dist/src/shapes/IText/ITextKeyBehavior.min.mjs.map +1 -1
- package/dist/src/shapes/IText/ITextKeyBehavior.mjs +115 -115
- package/dist/src/shapes/IText/ITextKeyBehavior.mjs.map +1 -1
- package/dist/src/shapes/IText/constants.d.ts +0 -0
- package/dist/src/shapes/IText/constants.d.ts.map +0 -0
- package/dist/src/shapes/IText/constants.min.mjs +0 -0
- package/dist/src/shapes/IText/constants.min.mjs.map +0 -0
- package/dist/src/shapes/IText/constants.mjs +0 -0
- package/dist/src/shapes/IText/constants.mjs.map +0 -0
- package/dist/src/shapes/Image.d.ts +0 -0
- package/dist/src/shapes/Image.d.ts.map +0 -0
- package/dist/src/shapes/Image.min.mjs +0 -0
- package/dist/src/shapes/Image.min.mjs.map +0 -0
- package/dist/src/shapes/Image.mjs +0 -0
- package/dist/src/shapes/Image.mjs.map +0 -0
- package/dist/src/shapes/Line.d.ts +0 -0
- package/dist/src/shapes/Line.d.ts.map +0 -0
- package/dist/src/shapes/Line.min.mjs +0 -0
- package/dist/src/shapes/Line.min.mjs.map +0 -0
- package/dist/src/shapes/Line.mjs +0 -0
- package/dist/src/shapes/Line.mjs.map +0 -0
- package/dist/src/shapes/Object/FabricObject.d.ts +0 -0
- package/dist/src/shapes/Object/FabricObject.d.ts.map +0 -0
- package/dist/src/shapes/Object/FabricObject.min.mjs +0 -0
- package/dist/src/shapes/Object/FabricObject.min.mjs.map +0 -0
- package/dist/src/shapes/Object/FabricObject.mjs +0 -0
- package/dist/src/shapes/Object/FabricObject.mjs.map +0 -0
- package/dist/src/shapes/Object/FabricObjectSVGExportMixin.d.ts +0 -0
- package/dist/src/shapes/Object/FabricObjectSVGExportMixin.d.ts.map +0 -0
- package/dist/src/shapes/Object/FabricObjectSVGExportMixin.min.mjs +0 -0
- package/dist/src/shapes/Object/FabricObjectSVGExportMixin.min.mjs.map +0 -0
- package/dist/src/shapes/Object/FabricObjectSVGExportMixin.mjs +0 -0
- package/dist/src/shapes/Object/FabricObjectSVGExportMixin.mjs.map +0 -0
- package/dist/src/shapes/Object/InteractiveObject.d.ts +0 -0
- package/dist/src/shapes/Object/InteractiveObject.d.ts.map +0 -0
- package/dist/src/shapes/Object/InteractiveObject.min.mjs +0 -0
- package/dist/src/shapes/Object/InteractiveObject.min.mjs.map +0 -0
- package/dist/src/shapes/Object/InteractiveObject.mjs +0 -0
- package/dist/src/shapes/Object/InteractiveObject.mjs.map +0 -0
- package/dist/src/shapes/Object/Object.d.ts +0 -0
- package/dist/src/shapes/Object/Object.d.ts.map +0 -0
- package/dist/src/shapes/Object/Object.min.mjs +0 -0
- package/dist/src/shapes/Object/Object.min.mjs.map +0 -0
- package/dist/src/shapes/Object/Object.mjs +0 -0
- package/dist/src/shapes/Object/Object.mjs.map +0 -0
- package/dist/src/shapes/Object/ObjectGeometry.d.ts +0 -0
- package/dist/src/shapes/Object/ObjectGeometry.d.ts.map +0 -0
- package/dist/src/shapes/Object/ObjectGeometry.min.mjs +0 -0
- package/dist/src/shapes/Object/ObjectGeometry.min.mjs.map +0 -0
- package/dist/src/shapes/Object/ObjectGeometry.mjs +0 -0
- package/dist/src/shapes/Object/ObjectGeometry.mjs.map +0 -0
- package/dist/src/shapes/Object/defaultValues.d.ts +0 -0
- package/dist/src/shapes/Object/defaultValues.d.ts.map +0 -0
- package/dist/src/shapes/Object/defaultValues.min.mjs +0 -0
- package/dist/src/shapes/Object/defaultValues.min.mjs.map +0 -0
- package/dist/src/shapes/Object/defaultValues.mjs +0 -0
- package/dist/src/shapes/Object/defaultValues.mjs.map +0 -0
- package/dist/src/shapes/Object/types/BaseProps.d.ts +0 -0
- package/dist/src/shapes/Object/types/BaseProps.d.ts.map +0 -0
- package/dist/src/shapes/Object/types/BorderProps.d.ts +0 -0
- package/dist/src/shapes/Object/types/BorderProps.d.ts.map +0 -0
- package/dist/src/shapes/Object/types/ControlProps.d.ts +0 -0
- package/dist/src/shapes/Object/types/ControlProps.d.ts.map +0 -0
- package/dist/src/shapes/Object/types/FabricObjectProps.d.ts +0 -0
- package/dist/src/shapes/Object/types/FabricObjectProps.d.ts.map +0 -0
- package/dist/src/shapes/Object/types/FillStrokeProps.d.ts +0 -0
- package/dist/src/shapes/Object/types/FillStrokeProps.d.ts.map +0 -0
- package/dist/src/shapes/Object/types/LockInteractionProps.d.ts +0 -0
- package/dist/src/shapes/Object/types/LockInteractionProps.d.ts.map +0 -0
- package/dist/src/shapes/Object/types/ObjectProps.d.ts +0 -0
- package/dist/src/shapes/Object/types/ObjectProps.d.ts.map +0 -0
- package/dist/src/shapes/Object/types/ObjectTransformProps.d.ts +0 -0
- package/dist/src/shapes/Object/types/ObjectTransformProps.d.ts.map +0 -0
- package/dist/src/shapes/Object/types/SerializedObjectProps.d.ts +0 -0
- package/dist/src/shapes/Object/types/SerializedObjectProps.d.ts.map +0 -0
- package/dist/src/shapes/Object/types/index.d.ts +0 -0
- package/dist/src/shapes/Object/types/index.d.ts.map +0 -0
- package/dist/src/shapes/Path.d.ts +0 -0
- package/dist/src/shapes/Path.d.ts.map +0 -0
- package/dist/src/shapes/Path.min.mjs +0 -0
- package/dist/src/shapes/Path.min.mjs.map +0 -0
- package/dist/src/shapes/Path.mjs +0 -0
- package/dist/src/shapes/Path.mjs.map +0 -0
- package/dist/src/shapes/Polygon.d.ts +0 -0
- package/dist/src/shapes/Polygon.d.ts.map +0 -0
- package/dist/src/shapes/Polygon.min.mjs +0 -0
- package/dist/src/shapes/Polygon.min.mjs.map +0 -0
- package/dist/src/shapes/Polygon.mjs +0 -0
- package/dist/src/shapes/Polygon.mjs.map +0 -0
- package/dist/src/shapes/Polyline.d.ts +0 -0
- package/dist/src/shapes/Polyline.d.ts.map +0 -0
- package/dist/src/shapes/Polyline.min.mjs +0 -0
- package/dist/src/shapes/Polyline.min.mjs.map +0 -0
- package/dist/src/shapes/Polyline.mjs +0 -0
- package/dist/src/shapes/Polyline.mjs.map +0 -0
- package/dist/src/shapes/Rect.d.ts +0 -0
- package/dist/src/shapes/Rect.d.ts.map +0 -0
- package/dist/src/shapes/Rect.min.mjs +0 -0
- package/dist/src/shapes/Rect.min.mjs.map +0 -0
- package/dist/src/shapes/Rect.mjs +0 -0
- package/dist/src/shapes/Rect.mjs.map +0 -0
- package/dist/src/shapes/Text/StyledText.d.ts +0 -0
- package/dist/src/shapes/Text/StyledText.d.ts.map +0 -0
- package/dist/src/shapes/Text/StyledText.min.mjs +0 -0
- package/dist/src/shapes/Text/StyledText.min.mjs.map +0 -0
- package/dist/src/shapes/Text/StyledText.mjs +0 -0
- package/dist/src/shapes/Text/StyledText.mjs.map +0 -0
- package/dist/src/shapes/Text/Text.d.ts +1 -0
- package/dist/src/shapes/Text/Text.d.ts.map +1 -1
- package/dist/src/shapes/Text/Text.min.mjs +1 -1
- package/dist/src/shapes/Text/Text.min.mjs.map +1 -1
- package/dist/src/shapes/Text/Text.mjs +315 -302
- package/dist/src/shapes/Text/Text.mjs.map +1 -1
- package/dist/src/shapes/Text/TextSVGExportMixin.d.ts +0 -0
- package/dist/src/shapes/Text/TextSVGExportMixin.d.ts.map +0 -0
- package/dist/src/shapes/Text/TextSVGExportMixin.min.mjs +0 -0
- package/dist/src/shapes/Text/TextSVGExportMixin.min.mjs.map +0 -0
- package/dist/src/shapes/Text/TextSVGExportMixin.mjs +0 -0
- package/dist/src/shapes/Text/TextSVGExportMixin.mjs.map +0 -0
- package/dist/src/shapes/Text/constants.d.ts +0 -0
- package/dist/src/shapes/Text/constants.d.ts.map +0 -0
- package/dist/src/shapes/Text/constants.min.mjs +0 -0
- package/dist/src/shapes/Text/constants.min.mjs.map +1 -1
- package/dist/src/shapes/Text/constants.mjs +0 -0
- package/dist/src/shapes/Text/constants.mjs.map +1 -1
- package/dist/src/shapes/Textbox.d.ts +20 -0
- package/dist/src/shapes/Textbox.d.ts.map +1 -1
- package/dist/src/shapes/Textbox.min.mjs +1 -1
- package/dist/src/shapes/Textbox.min.mjs.map +1 -1
- package/dist/src/shapes/Textbox.mjs +486 -202
- package/dist/src/shapes/Textbox.mjs.map +1 -1
- package/dist/src/shapes/Triangle.d.ts +0 -0
- package/dist/src/shapes/Triangle.d.ts.map +0 -0
- package/dist/src/shapes/Triangle.min.mjs +0 -0
- package/dist/src/shapes/Triangle.min.mjs.map +0 -0
- package/dist/src/shapes/Triangle.mjs +0 -0
- package/dist/src/shapes/Triangle.mjs.map +0 -0
- package/dist/src/text/browserLines.d.ts +7 -2
- package/dist/src/text/browserLines.d.ts.map +1 -1
- package/dist/src/text/browserLines.min.mjs +1 -1
- package/dist/src/text/browserLines.min.mjs.map +1 -1
- package/dist/src/text/browserLines.mjs +35 -25
- package/dist/src/text/browserLines.mjs.map +1 -1
- package/dist/src/text/ellipsis.d.ts +0 -0
- package/dist/src/text/ellipsis.d.ts.map +0 -0
- package/dist/src/text/ellipsis.min.mjs +0 -0
- package/dist/src/text/ellipsis.min.mjs.map +1 -1
- package/dist/src/text/ellipsis.mjs +11 -11
- package/dist/src/text/ellipsis.mjs.map +1 -1
- package/dist/src/text/hitTest.d.ts +0 -0
- package/dist/src/text/hitTest.d.ts.map +0 -0
- package/dist/src/text/hitTest.min.mjs +0 -0
- package/dist/src/text/hitTest.min.mjs.map +1 -1
- package/dist/src/text/hitTest.mjs +19 -19
- package/dist/src/text/hitTest.mjs.map +1 -1
- package/dist/src/text/layout.d.ts +0 -0
- package/dist/src/text/layout.d.ts.map +0 -0
- package/dist/src/text/layout.min.mjs +0 -0
- package/dist/src/text/layout.min.mjs.map +1 -1
- package/dist/src/text/layout.mjs +33 -33
- package/dist/src/text/layout.mjs.map +1 -1
- package/dist/src/text/measure.d.ts +0 -0
- package/dist/src/text/measure.d.ts.map +0 -0
- package/dist/src/text/measure.min.mjs +0 -0
- package/dist/src/text/measure.min.mjs.map +1 -1
- package/dist/src/text/measure.mjs +30 -30
- package/dist/src/text/measure.mjs.map +1 -1
- package/dist/src/text/overlayEditor.d.ts +1 -0
- package/dist/src/text/overlayEditor.d.ts.map +1 -1
- package/dist/src/text/overlayEditor.min.mjs +1 -1
- package/dist/src/text/overlayEditor.min.mjs.map +1 -1
- package/dist/src/text/overlayEditor.mjs +70 -51
- package/dist/src/text/overlayEditor.mjs.map +1 -1
- package/dist/src/text/unicode.d.ts +0 -0
- package/dist/src/text/unicode.d.ts.map +0 -0
- package/dist/src/text/unicode.min.mjs +0 -0
- package/dist/src/text/unicode.min.mjs.map +1 -1
- package/dist/src/text/unicode.mjs +8 -8
- package/dist/src/text/unicode.mjs.map +1 -1
- package/dist/src/typedefs.d.ts +0 -0
- package/dist/src/typedefs.d.ts.map +0 -0
- package/dist/src/util/animation/AnimationBase.d.ts +0 -0
- package/dist/src/util/animation/AnimationBase.d.ts.map +0 -0
- package/dist/src/util/animation/AnimationBase.min.mjs +0 -0
- package/dist/src/util/animation/AnimationBase.min.mjs.map +0 -0
- package/dist/src/util/animation/AnimationBase.mjs +0 -0
- package/dist/src/util/animation/AnimationBase.mjs.map +0 -0
- package/dist/src/util/animation/AnimationFrameProvider.d.ts +0 -0
- package/dist/src/util/animation/AnimationFrameProvider.d.ts.map +0 -0
- package/dist/src/util/animation/AnimationFrameProvider.min.mjs +0 -0
- package/dist/src/util/animation/AnimationFrameProvider.min.mjs.map +0 -0
- package/dist/src/util/animation/AnimationFrameProvider.mjs +0 -0
- package/dist/src/util/animation/AnimationFrameProvider.mjs.map +0 -0
- package/dist/src/util/animation/AnimationRegistry.d.ts +0 -0
- package/dist/src/util/animation/AnimationRegistry.d.ts.map +0 -0
- package/dist/src/util/animation/AnimationRegistry.min.mjs +0 -0
- package/dist/src/util/animation/AnimationRegistry.min.mjs.map +0 -0
- package/dist/src/util/animation/AnimationRegistry.mjs +0 -0
- package/dist/src/util/animation/AnimationRegistry.mjs.map +0 -0
- package/dist/src/util/animation/ArrayAnimation.d.ts +0 -0
- package/dist/src/util/animation/ArrayAnimation.d.ts.map +0 -0
- package/dist/src/util/animation/ArrayAnimation.min.mjs +0 -0
- package/dist/src/util/animation/ArrayAnimation.min.mjs.map +0 -0
- package/dist/src/util/animation/ArrayAnimation.mjs +0 -0
- package/dist/src/util/animation/ArrayAnimation.mjs.map +0 -0
- package/dist/src/util/animation/ColorAnimation.d.ts +0 -0
- package/dist/src/util/animation/ColorAnimation.d.ts.map +0 -0
- package/dist/src/util/animation/ColorAnimation.min.mjs +0 -0
- package/dist/src/util/animation/ColorAnimation.min.mjs.map +0 -0
- package/dist/src/util/animation/ColorAnimation.mjs +0 -0
- package/dist/src/util/animation/ColorAnimation.mjs.map +0 -0
- package/dist/src/util/animation/ValueAnimation.d.ts +0 -0
- package/dist/src/util/animation/ValueAnimation.d.ts.map +0 -0
- package/dist/src/util/animation/ValueAnimation.min.mjs +0 -0
- package/dist/src/util/animation/ValueAnimation.min.mjs.map +0 -0
- package/dist/src/util/animation/ValueAnimation.mjs +0 -0
- package/dist/src/util/animation/ValueAnimation.mjs.map +0 -0
- package/dist/src/util/animation/animate.d.ts +0 -0
- package/dist/src/util/animation/animate.d.ts.map +0 -0
- package/dist/src/util/animation/animate.min.mjs +0 -0
- package/dist/src/util/animation/animate.min.mjs.map +0 -0
- package/dist/src/util/animation/animate.mjs +0 -0
- package/dist/src/util/animation/animate.mjs.map +0 -0
- package/dist/src/util/animation/easing.d.ts +0 -0
- package/dist/src/util/animation/easing.d.ts.map +0 -0
- package/dist/src/util/animation/easing.min.mjs +0 -0
- package/dist/src/util/animation/easing.min.mjs.map +0 -0
- package/dist/src/util/animation/easing.mjs +0 -0
- package/dist/src/util/animation/easing.mjs.map +0 -0
- package/dist/src/util/animation/index.d.ts +0 -0
- package/dist/src/util/animation/index.d.ts.map +0 -0
- package/dist/src/util/animation/types.d.ts +0 -0
- package/dist/src/util/animation/types.d.ts.map +0 -0
- package/dist/src/util/applyMixins.d.ts +0 -0
- package/dist/src/util/applyMixins.d.ts.map +0 -0
- package/dist/src/util/applyMixins.min.mjs +0 -0
- package/dist/src/util/applyMixins.min.mjs.map +0 -0
- package/dist/src/util/applyMixins.mjs +0 -0
- package/dist/src/util/applyMixins.mjs.map +0 -0
- package/dist/src/util/dom_event.d.ts +0 -0
- package/dist/src/util/dom_event.d.ts.map +0 -0
- package/dist/src/util/dom_event.min.mjs +0 -0
- package/dist/src/util/dom_event.min.mjs.map +0 -0
- package/dist/src/util/dom_event.mjs +0 -0
- package/dist/src/util/dom_event.mjs.map +0 -0
- package/dist/src/util/dom_misc.d.ts +0 -0
- package/dist/src/util/dom_misc.d.ts.map +0 -0
- package/dist/src/util/dom_misc.min.mjs +0 -0
- package/dist/src/util/dom_misc.min.mjs.map +0 -0
- package/dist/src/util/dom_misc.mjs +0 -0
- package/dist/src/util/dom_misc.mjs.map +0 -0
- package/dist/src/util/index.d.ts +0 -0
- package/dist/src/util/index.d.ts.map +0 -0
- package/dist/src/util/index.min.mjs +0 -0
- package/dist/src/util/index.min.mjs.map +0 -0
- package/dist/src/util/index.mjs +0 -0
- package/dist/src/util/index.mjs.map +0 -0
- package/dist/src/util/internals/applyCanvasTransform.d.ts +0 -0
- package/dist/src/util/internals/applyCanvasTransform.d.ts.map +0 -0
- package/dist/src/util/internals/applyCanvasTransform.min.mjs +0 -0
- package/dist/src/util/internals/applyCanvasTransform.min.mjs.map +0 -0
- package/dist/src/util/internals/applyCanvasTransform.mjs +0 -0
- package/dist/src/util/internals/applyCanvasTransform.mjs.map +0 -0
- package/dist/src/util/internals/cleanupSvgAttribute.d.ts +0 -0
- package/dist/src/util/internals/cleanupSvgAttribute.d.ts.map +0 -0
- package/dist/src/util/internals/cleanupSvgAttribute.min.mjs +0 -0
- package/dist/src/util/internals/cleanupSvgAttribute.min.mjs.map +0 -0
- package/dist/src/util/internals/cleanupSvgAttribute.mjs +0 -0
- package/dist/src/util/internals/cleanupSvgAttribute.mjs.map +0 -0
- package/dist/src/util/internals/cloneStyles.d.ts +0 -0
- package/dist/src/util/internals/cloneStyles.d.ts.map +0 -0
- package/dist/src/util/internals/cloneStyles.min.mjs +0 -0
- package/dist/src/util/internals/cloneStyles.min.mjs.map +0 -0
- package/dist/src/util/internals/cloneStyles.mjs +0 -0
- package/dist/src/util/internals/cloneStyles.mjs.map +0 -0
- package/dist/src/util/internals/console.d.ts +0 -0
- package/dist/src/util/internals/console.d.ts.map +0 -0
- package/dist/src/util/internals/console.min.mjs +0 -0
- package/dist/src/util/internals/console.min.mjs.map +0 -0
- package/dist/src/util/internals/console.mjs +0 -0
- package/dist/src/util/internals/console.mjs.map +0 -0
- package/dist/src/util/internals/dom_style.d.ts +0 -0
- package/dist/src/util/internals/dom_style.d.ts.map +0 -0
- package/dist/src/util/internals/dom_style.min.mjs +0 -0
- package/dist/src/util/internals/dom_style.min.mjs.map +0 -0
- package/dist/src/util/internals/dom_style.mjs +0 -0
- package/dist/src/util/internals/dom_style.mjs.map +0 -0
- package/dist/src/util/internals/findRight.d.ts +0 -0
- package/dist/src/util/internals/findRight.d.ts.map +0 -0
- package/dist/src/util/internals/findRight.min.mjs +0 -0
- package/dist/src/util/internals/findRight.min.mjs.map +0 -0
- package/dist/src/util/internals/findRight.mjs +0 -0
- package/dist/src/util/internals/findRight.mjs.map +0 -0
- package/dist/src/util/internals/getRandomInt.d.ts +0 -0
- package/dist/src/util/internals/getRandomInt.d.ts.map +0 -0
- package/dist/src/util/internals/getRandomInt.min.mjs +0 -0
- package/dist/src/util/internals/getRandomInt.min.mjs.map +0 -0
- package/dist/src/util/internals/getRandomInt.mjs +0 -0
- package/dist/src/util/internals/getRandomInt.mjs.map +0 -0
- package/dist/src/util/internals/ifNaN.d.ts +0 -0
- package/dist/src/util/internals/ifNaN.d.ts.map +0 -0
- package/dist/src/util/internals/ifNaN.min.mjs +0 -0
- package/dist/src/util/internals/ifNaN.min.mjs.map +0 -0
- package/dist/src/util/internals/ifNaN.mjs +0 -0
- package/dist/src/util/internals/ifNaN.mjs.map +0 -0
- package/dist/src/util/internals/removeFromArray.d.ts +0 -0
- package/dist/src/util/internals/removeFromArray.d.ts.map +0 -0
- package/dist/src/util/internals/removeFromArray.min.mjs +0 -0
- package/dist/src/util/internals/removeFromArray.min.mjs.map +0 -0
- package/dist/src/util/internals/removeFromArray.mjs +0 -0
- package/dist/src/util/internals/removeFromArray.mjs.map +0 -0
- package/dist/src/util/internals/uid.d.ts +0 -0
- package/dist/src/util/internals/uid.d.ts.map +0 -0
- package/dist/src/util/internals/uid.min.mjs +0 -0
- package/dist/src/util/internals/uid.min.mjs.map +0 -0
- package/dist/src/util/internals/uid.mjs +0 -0
- package/dist/src/util/internals/uid.mjs.map +0 -0
- package/dist/src/util/lang_string.d.ts +0 -0
- package/dist/src/util/lang_string.d.ts.map +0 -0
- package/dist/src/util/lang_string.min.mjs +0 -0
- package/dist/src/util/lang_string.min.mjs.map +0 -0
- package/dist/src/util/lang_string.mjs +0 -0
- package/dist/src/util/lang_string.mjs.map +0 -0
- package/dist/src/util/misc/boundingBoxFromPoints.d.ts +0 -0
- package/dist/src/util/misc/boundingBoxFromPoints.d.ts.map +0 -0
- package/dist/src/util/misc/boundingBoxFromPoints.min.mjs +0 -0
- package/dist/src/util/misc/boundingBoxFromPoints.min.mjs.map +0 -0
- package/dist/src/util/misc/boundingBoxFromPoints.mjs +0 -0
- package/dist/src/util/misc/boundingBoxFromPoints.mjs.map +0 -0
- package/dist/src/util/misc/capValue.d.ts +0 -0
- package/dist/src/util/misc/capValue.d.ts.map +0 -0
- package/dist/src/util/misc/capValue.min.mjs +0 -0
- package/dist/src/util/misc/capValue.min.mjs.map +0 -0
- package/dist/src/util/misc/capValue.mjs +0 -0
- package/dist/src/util/misc/capValue.mjs.map +0 -0
- package/dist/src/util/misc/cornerRadius.d.ts +0 -0
- package/dist/src/util/misc/cornerRadius.d.ts.map +0 -0
- package/dist/src/util/misc/cornerRadius.min.mjs +0 -0
- package/dist/src/util/misc/cornerRadius.min.mjs.map +0 -0
- package/dist/src/util/misc/cornerRadius.mjs +0 -0
- package/dist/src/util/misc/cornerRadius.mjs.map +0 -0
- package/dist/src/util/misc/cos.d.ts +0 -0
- package/dist/src/util/misc/cos.d.ts.map +0 -0
- package/dist/src/util/misc/cos.min.mjs +0 -0
- package/dist/src/util/misc/cos.min.mjs.map +0 -0
- package/dist/src/util/misc/cos.mjs +0 -0
- package/dist/src/util/misc/cos.mjs.map +0 -0
- package/dist/src/util/misc/dom.d.ts +0 -0
- package/dist/src/util/misc/dom.d.ts.map +0 -0
- package/dist/src/util/misc/dom.min.mjs +0 -0
- package/dist/src/util/misc/dom.min.mjs.map +0 -0
- package/dist/src/util/misc/dom.mjs +0 -0
- package/dist/src/util/misc/dom.mjs.map +0 -0
- package/dist/src/util/misc/findScaleTo.d.ts +0 -0
- package/dist/src/util/misc/findScaleTo.d.ts.map +0 -0
- package/dist/src/util/misc/findScaleTo.min.mjs +0 -0
- package/dist/src/util/misc/findScaleTo.min.mjs.map +0 -0
- package/dist/src/util/misc/findScaleTo.mjs +0 -0
- package/dist/src/util/misc/findScaleTo.mjs.map +0 -0
- package/dist/src/util/misc/groupSVGElements.d.ts +0 -0
- package/dist/src/util/misc/groupSVGElements.d.ts.map +0 -0
- package/dist/src/util/misc/groupSVGElements.min.mjs +0 -0
- package/dist/src/util/misc/groupSVGElements.min.mjs.map +0 -0
- package/dist/src/util/misc/groupSVGElements.mjs +0 -0
- package/dist/src/util/misc/groupSVGElements.mjs.map +0 -0
- package/dist/src/util/misc/isTransparent.d.ts +0 -0
- package/dist/src/util/misc/isTransparent.d.ts.map +0 -0
- package/dist/src/util/misc/isTransparent.min.mjs +0 -0
- package/dist/src/util/misc/isTransparent.min.mjs.map +0 -0
- package/dist/src/util/misc/isTransparent.mjs +0 -0
- package/dist/src/util/misc/isTransparent.mjs.map +0 -0
- package/dist/src/util/misc/matrix.d.ts +0 -0
- package/dist/src/util/misc/matrix.d.ts.map +0 -0
- package/dist/src/util/misc/matrix.min.mjs +0 -0
- package/dist/src/util/misc/matrix.min.mjs.map +0 -0
- package/dist/src/util/misc/matrix.mjs +0 -0
- package/dist/src/util/misc/matrix.mjs.map +0 -0
- package/dist/src/util/misc/mergeClipPaths.d.ts +0 -0
- package/dist/src/util/misc/mergeClipPaths.d.ts.map +0 -0
- package/dist/src/util/misc/mergeClipPaths.min.mjs +0 -0
- package/dist/src/util/misc/mergeClipPaths.min.mjs.map +0 -0
- package/dist/src/util/misc/mergeClipPaths.mjs +0 -0
- package/dist/src/util/misc/mergeClipPaths.mjs.map +0 -0
- package/dist/src/util/misc/objectEnlive.d.ts +0 -0
- package/dist/src/util/misc/objectEnlive.d.ts.map +0 -0
- package/dist/src/util/misc/objectEnlive.min.mjs +0 -0
- package/dist/src/util/misc/objectEnlive.min.mjs.map +0 -0
- package/dist/src/util/misc/objectEnlive.mjs +0 -0
- package/dist/src/util/misc/objectEnlive.mjs.map +0 -0
- package/dist/src/util/misc/objectTransforms.d.ts +0 -0
- package/dist/src/util/misc/objectTransforms.d.ts.map +0 -0
- package/dist/src/util/misc/objectTransforms.min.mjs +0 -0
- package/dist/src/util/misc/objectTransforms.min.mjs.map +0 -0
- package/dist/src/util/misc/objectTransforms.mjs +0 -0
- package/dist/src/util/misc/objectTransforms.mjs.map +0 -0
- package/dist/src/util/misc/pick.d.ts +0 -0
- package/dist/src/util/misc/pick.d.ts.map +0 -0
- package/dist/src/util/misc/pick.min.mjs +0 -0
- package/dist/src/util/misc/pick.min.mjs.map +0 -0
- package/dist/src/util/misc/pick.mjs +0 -0
- package/dist/src/util/misc/pick.mjs.map +0 -0
- package/dist/src/util/misc/planeChange.d.ts +0 -0
- package/dist/src/util/misc/planeChange.d.ts.map +0 -0
- package/dist/src/util/misc/planeChange.min.mjs +0 -0
- package/dist/src/util/misc/planeChange.min.mjs.map +0 -0
- package/dist/src/util/misc/planeChange.mjs +0 -0
- package/dist/src/util/misc/planeChange.mjs.map +0 -0
- package/dist/src/util/misc/projectStroke/StrokeLineCapProjections.d.ts +0 -0
- package/dist/src/util/misc/projectStroke/StrokeLineCapProjections.d.ts.map +0 -0
- package/dist/src/util/misc/projectStroke/StrokeLineCapProjections.min.mjs +0 -0
- package/dist/src/util/misc/projectStroke/StrokeLineCapProjections.min.mjs.map +0 -0
- package/dist/src/util/misc/projectStroke/StrokeLineCapProjections.mjs +0 -0
- package/dist/src/util/misc/projectStroke/StrokeLineCapProjections.mjs.map +0 -0
- package/dist/src/util/misc/projectStroke/StrokeLineJoinProjections.d.ts +0 -0
- package/dist/src/util/misc/projectStroke/StrokeLineJoinProjections.d.ts.map +0 -0
- package/dist/src/util/misc/projectStroke/StrokeLineJoinProjections.min.mjs +0 -0
- package/dist/src/util/misc/projectStroke/StrokeLineJoinProjections.min.mjs.map +0 -0
- package/dist/src/util/misc/projectStroke/StrokeLineJoinProjections.mjs +0 -0
- package/dist/src/util/misc/projectStroke/StrokeLineJoinProjections.mjs.map +0 -0
- package/dist/src/util/misc/projectStroke/StrokeProjectionsBase.d.ts +0 -0
- package/dist/src/util/misc/projectStroke/StrokeProjectionsBase.d.ts.map +0 -0
- package/dist/src/util/misc/projectStroke/StrokeProjectionsBase.min.mjs +0 -0
- package/dist/src/util/misc/projectStroke/StrokeProjectionsBase.min.mjs.map +0 -0
- package/dist/src/util/misc/projectStroke/StrokeProjectionsBase.mjs +0 -0
- package/dist/src/util/misc/projectStroke/StrokeProjectionsBase.mjs.map +0 -0
- package/dist/src/util/misc/projectStroke/index.d.ts +0 -0
- package/dist/src/util/misc/projectStroke/index.d.ts.map +0 -0
- package/dist/src/util/misc/projectStroke/index.min.mjs +0 -0
- package/dist/src/util/misc/projectStroke/index.min.mjs.map +0 -0
- package/dist/src/util/misc/projectStroke/index.mjs +0 -0
- package/dist/src/util/misc/projectStroke/index.mjs.map +0 -0
- package/dist/src/util/misc/projectStroke/types.d.ts +0 -0
- package/dist/src/util/misc/projectStroke/types.d.ts.map +0 -0
- package/dist/src/util/misc/radiansDegreesConversion.d.ts +0 -0
- package/dist/src/util/misc/radiansDegreesConversion.d.ts.map +0 -0
- package/dist/src/util/misc/radiansDegreesConversion.min.mjs +0 -0
- package/dist/src/util/misc/radiansDegreesConversion.min.mjs.map +0 -0
- package/dist/src/util/misc/radiansDegreesConversion.mjs +0 -0
- package/dist/src/util/misc/radiansDegreesConversion.mjs.map +0 -0
- package/dist/src/util/misc/resolveOrigin.d.ts +0 -0
- package/dist/src/util/misc/resolveOrigin.d.ts.map +0 -0
- package/dist/src/util/misc/resolveOrigin.min.mjs +0 -0
- package/dist/src/util/misc/resolveOrigin.min.mjs.map +0 -0
- package/dist/src/util/misc/resolveOrigin.mjs +0 -0
- package/dist/src/util/misc/resolveOrigin.mjs.map +0 -0
- package/dist/src/util/misc/sin.d.ts +0 -0
- package/dist/src/util/misc/sin.d.ts.map +0 -0
- package/dist/src/util/misc/sin.min.mjs +0 -0
- package/dist/src/util/misc/sin.min.mjs.map +0 -0
- package/dist/src/util/misc/sin.mjs +0 -0
- package/dist/src/util/misc/sin.mjs.map +0 -0
- package/dist/src/util/misc/svgExport.d.ts +0 -0
- package/dist/src/util/misc/svgExport.d.ts.map +0 -0
- package/dist/src/util/misc/svgExport.min.mjs +0 -0
- package/dist/src/util/misc/svgExport.min.mjs.map +0 -0
- package/dist/src/util/misc/svgExport.mjs +0 -0
- package/dist/src/util/misc/svgExport.mjs.map +0 -0
- package/dist/src/util/misc/svgParsing.d.ts +0 -0
- package/dist/src/util/misc/svgParsing.d.ts.map +0 -0
- package/dist/src/util/misc/svgParsing.min.mjs +0 -0
- package/dist/src/util/misc/svgParsing.min.mjs.map +0 -0
- package/dist/src/util/misc/svgParsing.mjs +0 -0
- package/dist/src/util/misc/svgParsing.mjs.map +0 -0
- package/dist/src/util/misc/textStyles.d.ts +0 -0
- package/dist/src/util/misc/textStyles.d.ts.map +0 -0
- package/dist/src/util/misc/textStyles.min.mjs +0 -0
- package/dist/src/util/misc/textStyles.min.mjs.map +0 -0
- package/dist/src/util/misc/textStyles.mjs +0 -0
- package/dist/src/util/misc/textStyles.mjs.map +0 -0
- package/dist/src/util/misc/toFixed.d.ts +0 -0
- package/dist/src/util/misc/toFixed.d.ts.map +0 -0
- package/dist/src/util/misc/toFixed.min.mjs +0 -0
- package/dist/src/util/misc/toFixed.min.mjs.map +0 -0
- package/dist/src/util/misc/toFixed.mjs +0 -0
- package/dist/src/util/misc/toFixed.mjs.map +0 -0
- package/dist/src/util/misc/vectors.d.ts +0 -0
- package/dist/src/util/misc/vectors.d.ts.map +0 -0
- package/dist/src/util/misc/vectors.min.mjs +0 -0
- package/dist/src/util/misc/vectors.min.mjs.map +0 -0
- package/dist/src/util/misc/vectors.mjs +0 -0
- package/dist/src/util/misc/vectors.mjs.map +0 -0
- package/dist/src/util/path/index.d.ts +0 -0
- package/dist/src/util/path/index.d.ts.map +0 -0
- package/dist/src/util/path/index.min.mjs +0 -0
- package/dist/src/util/path/index.min.mjs.map +0 -0
- package/dist/src/util/path/index.mjs +0 -0
- package/dist/src/util/path/index.mjs.map +0 -0
- package/dist/src/util/path/regex.d.ts +0 -0
- package/dist/src/util/path/regex.d.ts.map +0 -0
- package/dist/src/util/path/regex.min.mjs +0 -0
- package/dist/src/util/path/regex.min.mjs.map +0 -0
- package/dist/src/util/path/regex.mjs +0 -0
- package/dist/src/util/path/regex.mjs.map +0 -0
- package/dist/src/util/path/typechecks.d.ts +0 -0
- package/dist/src/util/path/typechecks.d.ts.map +0 -0
- package/dist/src/util/path/typedefs.d.ts +0 -0
- package/dist/src/util/path/typedefs.d.ts.map +0 -0
- package/dist/src/util/transform_matrix_removal.d.ts +0 -0
- package/dist/src/util/transform_matrix_removal.d.ts.map +0 -0
- package/dist/src/util/transform_matrix_removal.min.mjs +0 -0
- package/dist/src/util/transform_matrix_removal.min.mjs.map +0 -0
- package/dist/src/util/transform_matrix_removal.mjs +0 -0
- package/dist/src/util/transform_matrix_removal.mjs.map +0 -0
- package/dist/src/util/typeAssertions.d.ts +0 -0
- package/dist/src/util/typeAssertions.d.ts.map +0 -0
- package/dist/src/util/typeAssertions.min.mjs +0 -0
- package/dist/src/util/typeAssertions.min.mjs.map +0 -0
- package/dist/src/util/typeAssertions.mjs +0 -0
- package/dist/src/util/typeAssertions.mjs.map +0 -0
- package/dist-extensions/aligning_guidelines/constant.mjs +0 -0
- package/dist-extensions/aligning_guidelines/constant.mjs.map +0 -0
- package/dist-extensions/aligning_guidelines/index.mjs +0 -0
- package/dist-extensions/aligning_guidelines/index.mjs.map +0 -0
- package/dist-extensions/aligning_guidelines/util/basic.mjs +0 -0
- package/dist-extensions/aligning_guidelines/util/basic.mjs.map +0 -0
- package/dist-extensions/aligning_guidelines/util/collect-line.mjs +0 -0
- package/dist-extensions/aligning_guidelines/util/collect-line.mjs.map +0 -0
- package/dist-extensions/aligning_guidelines/util/collect-point.mjs +0 -0
- package/dist-extensions/aligning_guidelines/util/collect-point.mjs.map +0 -0
- package/dist-extensions/aligning_guidelines/util/draw.mjs +0 -0
- package/dist-extensions/aligning_guidelines/util/draw.mjs.map +0 -0
- package/dist-extensions/aligning_guidelines/util/get-objects-by-target.mjs +0 -0
- package/dist-extensions/aligning_guidelines/util/get-objects-by-target.mjs.map +0 -0
- package/dist-extensions/data_updaters/gradient/index.mjs +0 -0
- package/dist-extensions/data_updaters/gradient/index.mjs.map +0 -0
- package/dist-extensions/data_updaters/origins/index.mjs +0 -0
- package/dist-extensions/data_updaters/origins/index.mjs.map +0 -0
- package/dist-extensions/extensions/aligning_guidelines/constant.d.ts +0 -0
- package/dist-extensions/extensions/aligning_guidelines/constant.d.ts.map +0 -0
- package/dist-extensions/extensions/aligning_guidelines/index.d.ts +0 -0
- package/dist-extensions/extensions/aligning_guidelines/index.d.ts.map +0 -0
- package/dist-extensions/extensions/aligning_guidelines/typedefs.d.ts +0 -0
- package/dist-extensions/extensions/aligning_guidelines/typedefs.d.ts.map +0 -0
- package/dist-extensions/extensions/aligning_guidelines/util/basic.d.ts +0 -0
- package/dist-extensions/extensions/aligning_guidelines/util/basic.d.ts.map +0 -0
- package/dist-extensions/extensions/aligning_guidelines/util/collect-line.d.ts +0 -0
- package/dist-extensions/extensions/aligning_guidelines/util/collect-line.d.ts.map +0 -0
- package/dist-extensions/extensions/aligning_guidelines/util/collect-point.d.ts +0 -0
- package/dist-extensions/extensions/aligning_guidelines/util/collect-point.d.ts.map +0 -0
- package/dist-extensions/extensions/aligning_guidelines/util/draw.d.ts +0 -0
- package/dist-extensions/extensions/aligning_guidelines/util/draw.d.ts.map +0 -0
- package/dist-extensions/extensions/aligning_guidelines/util/get-objects-by-target.d.ts +0 -0
- package/dist-extensions/extensions/aligning_guidelines/util/get-objects-by-target.d.ts.map +0 -0
- package/dist-extensions/extensions/data_updaters/gradient/index.d.ts +0 -0
- package/dist-extensions/extensions/data_updaters/gradient/index.d.ts.map +0 -0
- package/dist-extensions/extensions/data_updaters/origins/index.d.ts +0 -0
- package/dist-extensions/extensions/data_updaters/origins/index.d.ts.map +0 -0
- package/dist-extensions/extensions/index.d.ts +0 -0
- package/dist-extensions/extensions/index.d.ts.map +0 -0
- package/dist-extensions/fabric-extensions.min.js +0 -0
- package/dist-extensions/fabric-extensions.min.js.map +0 -0
- package/dist-extensions/fabric.d.ts +0 -0
- package/dist-extensions/fabric.d.ts.map +0 -0
- package/dist-extensions/index.d.ts +0 -0
- package/dist-extensions/index.d.ts.map +0 -0
- package/dist-extensions/index.mjs +0 -0
- package/dist-extensions/index.mjs.map +0 -0
- package/dist-extensions/src/ClassRegistry.d.ts +0 -0
- package/dist-extensions/src/ClassRegistry.d.ts.map +0 -0
- package/dist-extensions/src/Collection.d.ts +0 -0
- package/dist-extensions/src/Collection.d.ts.map +0 -0
- package/dist-extensions/src/CommonMethods.d.ts +0 -0
- package/dist-extensions/src/CommonMethods.d.ts.map +0 -0
- package/dist-extensions/src/EventTypeDefs.d.ts +0 -0
- package/dist-extensions/src/EventTypeDefs.d.ts.map +0 -0
- package/dist-extensions/src/Intersection.d.ts +0 -0
- package/dist-extensions/src/Intersection.d.ts.map +0 -0
- package/dist-extensions/src/LayoutManager/ActiveSelectionLayoutManager.d.ts +0 -0
- package/dist-extensions/src/LayoutManager/ActiveSelectionLayoutManager.d.ts.map +0 -0
- package/dist-extensions/src/LayoutManager/LayoutManager.d.ts +0 -0
- package/dist-extensions/src/LayoutManager/LayoutManager.d.ts.map +0 -0
- package/dist-extensions/src/LayoutManager/LayoutStrategies/ClipPathLayout.d.ts +0 -0
- package/dist-extensions/src/LayoutManager/LayoutStrategies/ClipPathLayout.d.ts.map +0 -0
- package/dist-extensions/src/LayoutManager/LayoutStrategies/FitContentLayout.d.ts +0 -0
- package/dist-extensions/src/LayoutManager/LayoutStrategies/FitContentLayout.d.ts.map +0 -0
- package/dist-extensions/src/LayoutManager/LayoutStrategies/FixedLayout.d.ts +0 -0
- package/dist-extensions/src/LayoutManager/LayoutStrategies/FixedLayout.d.ts.map +0 -0
- package/dist-extensions/src/LayoutManager/LayoutStrategies/LayoutStrategy.d.ts +0 -0
- package/dist-extensions/src/LayoutManager/LayoutStrategies/LayoutStrategy.d.ts.map +0 -0
- package/dist-extensions/src/LayoutManager/LayoutStrategies/utils.d.ts +0 -0
- package/dist-extensions/src/LayoutManager/LayoutStrategies/utils.d.ts.map +0 -0
- package/dist-extensions/src/LayoutManager/constants.d.ts +0 -0
- package/dist-extensions/src/LayoutManager/constants.d.ts.map +0 -0
- package/dist-extensions/src/LayoutManager/index.d.ts +0 -0
- package/dist-extensions/src/LayoutManager/index.d.ts.map +0 -0
- package/dist-extensions/src/LayoutManager/types.d.ts +0 -0
- package/dist-extensions/src/LayoutManager/types.d.ts.map +0 -0
- package/dist-extensions/src/Observable.d.ts +0 -0
- package/dist-extensions/src/Observable.d.ts.map +0 -0
- package/dist-extensions/src/Pattern/Pattern.d.ts +0 -0
- package/dist-extensions/src/Pattern/Pattern.d.ts.map +0 -0
- package/dist-extensions/src/Pattern/index.d.ts +0 -0
- package/dist-extensions/src/Pattern/index.d.ts.map +0 -0
- package/dist-extensions/src/Pattern/types.d.ts +0 -0
- package/dist-extensions/src/Pattern/types.d.ts.map +0 -0
- package/dist-extensions/src/Point.d.ts +0 -0
- package/dist-extensions/src/Point.d.ts.map +0 -0
- package/dist-extensions/src/Shadow.d.ts +0 -0
- package/dist-extensions/src/Shadow.d.ts.map +0 -0
- package/dist-extensions/src/brushes/BaseBrush.d.ts +0 -0
- package/dist-extensions/src/brushes/BaseBrush.d.ts.map +0 -0
- package/dist-extensions/src/brushes/CircleBrush.d.ts +0 -0
- package/dist-extensions/src/brushes/CircleBrush.d.ts.map +0 -0
- package/dist-extensions/src/brushes/PatternBrush.d.ts +0 -0
- package/dist-extensions/src/brushes/PatternBrush.d.ts.map +0 -0
- package/dist-extensions/src/brushes/PencilBrush.d.ts +0 -0
- package/dist-extensions/src/brushes/PencilBrush.d.ts.map +0 -0
- package/dist-extensions/src/brushes/SprayBrush.d.ts +0 -0
- package/dist-extensions/src/brushes/SprayBrush.d.ts.map +0 -0
- package/dist-extensions/src/brushes/typedefs.d.ts +0 -0
- package/dist-extensions/src/brushes/typedefs.d.ts.map +0 -0
- package/dist-extensions/src/cache.d.ts +0 -0
- package/dist-extensions/src/cache.d.ts.map +0 -0
- package/dist-extensions/src/canvas/Canvas.d.ts +0 -0
- package/dist-extensions/src/canvas/Canvas.d.ts.map +0 -0
- package/dist-extensions/src/canvas/CanvasOptions.d.ts +0 -0
- package/dist-extensions/src/canvas/CanvasOptions.d.ts.map +0 -0
- package/dist-extensions/src/canvas/DOMManagers/CanvasDOMManager.d.ts +0 -0
- package/dist-extensions/src/canvas/DOMManagers/CanvasDOMManager.d.ts.map +0 -0
- package/dist-extensions/src/canvas/DOMManagers/StaticCanvasDOMManager.d.ts +0 -0
- package/dist-extensions/src/canvas/DOMManagers/StaticCanvasDOMManager.d.ts.map +0 -0
- package/dist-extensions/src/canvas/DOMManagers/util.d.ts +0 -0
- package/dist-extensions/src/canvas/DOMManagers/util.d.ts.map +0 -0
- package/dist-extensions/src/canvas/SelectableCanvas.d.ts +0 -0
- package/dist-extensions/src/canvas/SelectableCanvas.d.ts.map +0 -0
- package/dist-extensions/src/canvas/StaticCanvas.d.ts +0 -0
- package/dist-extensions/src/canvas/StaticCanvas.d.ts.map +0 -0
- package/dist-extensions/src/canvas/StaticCanvasOptions.d.ts +0 -0
- package/dist-extensions/src/canvas/StaticCanvasOptions.d.ts.map +0 -0
- package/dist-extensions/src/canvas/TextEditingManager.d.ts +0 -0
- package/dist-extensions/src/canvas/TextEditingManager.d.ts.map +0 -0
- package/dist-extensions/src/color/Color.d.ts +0 -0
- package/dist-extensions/src/color/Color.d.ts.map +0 -0
- package/dist-extensions/src/color/color_map.d.ts +0 -0
- package/dist-extensions/src/color/color_map.d.ts.map +0 -0
- package/dist-extensions/src/color/constants.d.ts +0 -0
- package/dist-extensions/src/color/constants.d.ts.map +0 -0
- package/dist-extensions/src/color/typedefs.d.ts +0 -0
- package/dist-extensions/src/color/typedefs.d.ts.map +0 -0
- package/dist-extensions/src/color/util.d.ts +0 -0
- package/dist-extensions/src/color/util.d.ts.map +0 -0
- package/dist-extensions/src/config.d.ts +0 -0
- package/dist-extensions/src/config.d.ts.map +0 -0
- package/dist-extensions/src/constants.d.ts +0 -0
- package/dist-extensions/src/constants.d.ts.map +0 -0
- package/dist-extensions/src/controls/Control.d.ts +0 -0
- package/dist-extensions/src/controls/Control.d.ts.map +0 -0
- package/dist-extensions/src/controls/changeHeight.d.ts +0 -0
- package/dist-extensions/src/controls/changeHeight.d.ts.map +0 -0
- package/dist-extensions/src/controls/changeWidth.d.ts +0 -0
- package/dist-extensions/src/controls/changeWidth.d.ts.map +0 -0
- package/dist-extensions/src/controls/commonControls.d.ts +0 -0
- package/dist-extensions/src/controls/commonControls.d.ts.map +0 -0
- package/dist-extensions/src/controls/controlRendering.d.ts +0 -0
- package/dist-extensions/src/controls/controlRendering.d.ts.map +0 -0
- package/dist-extensions/src/controls/drag.d.ts +0 -0
- package/dist-extensions/src/controls/drag.d.ts.map +0 -0
- package/dist-extensions/src/controls/fireEvent.d.ts +0 -0
- package/dist-extensions/src/controls/fireEvent.d.ts.map +0 -0
- package/dist-extensions/src/controls/index.d.ts +0 -0
- package/dist-extensions/src/controls/index.d.ts.map +0 -0
- package/dist-extensions/src/controls/pathControl.d.ts +0 -0
- package/dist-extensions/src/controls/pathControl.d.ts.map +0 -0
- package/dist-extensions/src/controls/polyControl.d.ts +0 -0
- package/dist-extensions/src/controls/polyControl.d.ts.map +0 -0
- package/dist-extensions/src/controls/rotate.d.ts +0 -0
- package/dist-extensions/src/controls/rotate.d.ts.map +0 -0
- package/dist-extensions/src/controls/scale.d.ts +0 -0
- package/dist-extensions/src/controls/scale.d.ts.map +0 -0
- package/dist-extensions/src/controls/scaleSkew.d.ts +0 -0
- package/dist-extensions/src/controls/scaleSkew.d.ts.map +0 -0
- package/dist-extensions/src/controls/skew.d.ts +0 -0
- package/dist-extensions/src/controls/skew.d.ts.map +0 -0
- package/dist-extensions/src/controls/util.d.ts +0 -0
- package/dist-extensions/src/controls/util.d.ts.map +0 -0
- package/dist-extensions/src/controls/wrapWithFireEvent.d.ts +0 -0
- package/dist-extensions/src/controls/wrapWithFireEvent.d.ts.map +0 -0
- package/dist-extensions/src/controls/wrapWithFixedAnchor.d.ts +0 -0
- package/dist-extensions/src/controls/wrapWithFixedAnchor.d.ts.map +0 -0
- package/dist-extensions/src/env/browser.d.ts +0 -0
- package/dist-extensions/src/env/browser.d.ts.map +0 -0
- package/dist-extensions/src/env/index.d.ts +0 -0
- package/dist-extensions/src/env/index.d.ts.map +0 -0
- package/dist-extensions/src/env/types.d.ts +0 -0
- package/dist-extensions/src/env/types.d.ts.map +0 -0
- package/dist-extensions/src/filters/BaseFilter.d.ts +0 -0
- package/dist-extensions/src/filters/BaseFilter.d.ts.map +0 -0
- package/dist-extensions/src/filters/BlendColor.d.ts +0 -0
- package/dist-extensions/src/filters/BlendColor.d.ts.map +0 -0
- package/dist-extensions/src/filters/BlendImage.d.ts +0 -0
- package/dist-extensions/src/filters/BlendImage.d.ts.map +0 -0
- package/dist-extensions/src/filters/Blur.d.ts +0 -0
- package/dist-extensions/src/filters/Blur.d.ts.map +0 -0
- package/dist-extensions/src/filters/Brightness.d.ts +0 -0
- package/dist-extensions/src/filters/Brightness.d.ts.map +0 -0
- package/dist-extensions/src/filters/Canvas2dFilterBackend.d.ts +0 -0
- package/dist-extensions/src/filters/Canvas2dFilterBackend.d.ts.map +0 -0
- package/dist-extensions/src/filters/ColorMatrix.d.ts +0 -0
- package/dist-extensions/src/filters/ColorMatrix.d.ts.map +0 -0
- package/dist-extensions/src/filters/ColorMatrixFilters.d.ts +0 -0
- package/dist-extensions/src/filters/ColorMatrixFilters.d.ts.map +0 -0
- package/dist-extensions/src/filters/Composed.d.ts +0 -0
- package/dist-extensions/src/filters/Composed.d.ts.map +0 -0
- package/dist-extensions/src/filters/Contrast.d.ts +0 -0
- package/dist-extensions/src/filters/Contrast.d.ts.map +0 -0
- package/dist-extensions/src/filters/Convolute.d.ts +0 -0
- package/dist-extensions/src/filters/Convolute.d.ts.map +0 -0
- package/dist-extensions/src/filters/FilterBackend.d.ts +0 -0
- package/dist-extensions/src/filters/FilterBackend.d.ts.map +0 -0
- package/dist-extensions/src/filters/GLProbes/GLProbe.d.ts +0 -0
- package/dist-extensions/src/filters/GLProbes/GLProbe.d.ts.map +0 -0
- package/dist-extensions/src/filters/GLProbes/WebGLProbe.d.ts +0 -0
- package/dist-extensions/src/filters/GLProbes/WebGLProbe.d.ts.map +0 -0
- package/dist-extensions/src/filters/Gamma.d.ts +0 -0
- package/dist-extensions/src/filters/Gamma.d.ts.map +0 -0
- package/dist-extensions/src/filters/Grayscale.d.ts +0 -0
- package/dist-extensions/src/filters/Grayscale.d.ts.map +0 -0
- package/dist-extensions/src/filters/HueRotation.d.ts +0 -0
- package/dist-extensions/src/filters/HueRotation.d.ts.map +0 -0
- package/dist-extensions/src/filters/Invert.d.ts +0 -0
- package/dist-extensions/src/filters/Invert.d.ts.map +0 -0
- package/dist-extensions/src/filters/Noise.d.ts +0 -0
- package/dist-extensions/src/filters/Noise.d.ts.map +0 -0
- package/dist-extensions/src/filters/Pixelate.d.ts +0 -0
- package/dist-extensions/src/filters/Pixelate.d.ts.map +0 -0
- package/dist-extensions/src/filters/RemoveColor.d.ts +0 -0
- package/dist-extensions/src/filters/RemoveColor.d.ts.map +0 -0
- package/dist-extensions/src/filters/Resize.d.ts +0 -0
- package/dist-extensions/src/filters/Resize.d.ts.map +0 -0
- package/dist-extensions/src/filters/Saturation.d.ts +0 -0
- package/dist-extensions/src/filters/Saturation.d.ts.map +0 -0
- package/dist-extensions/src/filters/Vibrance.d.ts +0 -0
- package/dist-extensions/src/filters/Vibrance.d.ts.map +0 -0
- package/dist-extensions/src/filters/WebGLFilterBackend.d.ts +0 -0
- package/dist-extensions/src/filters/WebGLFilterBackend.d.ts.map +0 -0
- package/dist-extensions/src/filters/filters.d.ts +0 -0
- package/dist-extensions/src/filters/filters.d.ts.map +0 -0
- package/dist-extensions/src/filters/index.d.ts +0 -0
- package/dist-extensions/src/filters/index.d.ts.map +0 -0
- package/dist-extensions/src/filters/shaders/baseFilter.d.ts +0 -0
- package/dist-extensions/src/filters/shaders/baseFilter.d.ts.map +0 -0
- package/dist-extensions/src/filters/shaders/blendColor.d.ts +0 -0
- package/dist-extensions/src/filters/shaders/blendColor.d.ts.map +0 -0
- package/dist-extensions/src/filters/shaders/blendImage.d.ts +0 -0
- package/dist-extensions/src/filters/shaders/blendImage.d.ts.map +0 -0
- package/dist-extensions/src/filters/shaders/blur.d.ts +0 -0
- package/dist-extensions/src/filters/shaders/blur.d.ts.map +0 -0
- package/dist-extensions/src/filters/shaders/brightness.d.ts +0 -0
- package/dist-extensions/src/filters/shaders/brightness.d.ts.map +0 -0
- package/dist-extensions/src/filters/shaders/colorMatrix.d.ts +0 -0
- package/dist-extensions/src/filters/shaders/colorMatrix.d.ts.map +0 -0
- package/dist-extensions/src/filters/shaders/constrast.d.ts +0 -0
- package/dist-extensions/src/filters/shaders/constrast.d.ts.map +0 -0
- package/dist-extensions/src/filters/shaders/convolute.d.ts +0 -0
- package/dist-extensions/src/filters/shaders/convolute.d.ts.map +0 -0
- package/dist-extensions/src/filters/shaders/gamma.d.ts +0 -0
- package/dist-extensions/src/filters/shaders/gamma.d.ts.map +0 -0
- package/dist-extensions/src/filters/shaders/grayscale.d.ts +0 -0
- package/dist-extensions/src/filters/shaders/grayscale.d.ts.map +0 -0
- package/dist-extensions/src/filters/shaders/invert.d.ts +0 -0
- package/dist-extensions/src/filters/shaders/invert.d.ts.map +0 -0
- package/dist-extensions/src/filters/shaders/noise.d.ts +0 -0
- package/dist-extensions/src/filters/shaders/noise.d.ts.map +0 -0
- package/dist-extensions/src/filters/shaders/pixelate.d.ts +0 -0
- package/dist-extensions/src/filters/shaders/pixelate.d.ts.map +0 -0
- package/dist-extensions/src/filters/shaders/removeColor.d.ts +0 -0
- package/dist-extensions/src/filters/shaders/removeColor.d.ts.map +0 -0
- package/dist-extensions/src/filters/shaders/saturation.d.ts +0 -0
- package/dist-extensions/src/filters/shaders/saturation.d.ts.map +0 -0
- package/dist-extensions/src/filters/shaders/vibrance.d.ts +0 -0
- package/dist-extensions/src/filters/shaders/vibrance.d.ts.map +0 -0
- package/dist-extensions/src/filters/typedefs.d.ts +0 -0
- package/dist-extensions/src/filters/typedefs.d.ts.map +0 -0
- package/dist-extensions/src/filters/utils.d.ts +0 -0
- package/dist-extensions/src/filters/utils.d.ts.map +0 -0
- package/dist-extensions/src/gradient/Gradient.d.ts +0 -0
- package/dist-extensions/src/gradient/Gradient.d.ts.map +0 -0
- package/dist-extensions/src/gradient/constants.d.ts +0 -0
- package/dist-extensions/src/gradient/constants.d.ts.map +0 -0
- package/dist-extensions/src/gradient/index.d.ts +0 -0
- package/dist-extensions/src/gradient/index.d.ts.map +0 -0
- package/dist-extensions/src/gradient/parser/misc.d.ts +0 -0
- package/dist-extensions/src/gradient/parser/misc.d.ts.map +0 -0
- package/dist-extensions/src/gradient/parser/parseColorStops.d.ts +0 -0
- package/dist-extensions/src/gradient/parser/parseColorStops.d.ts.map +0 -0
- package/dist-extensions/src/gradient/parser/parseCoords.d.ts +0 -0
- package/dist-extensions/src/gradient/parser/parseCoords.d.ts.map +0 -0
- package/dist-extensions/src/gradient/typedefs.d.ts +0 -0
- package/dist-extensions/src/gradient/typedefs.d.ts.map +0 -0
- package/dist-extensions/src/parser/applyViewboxTransform.d.ts +0 -0
- package/dist-extensions/src/parser/applyViewboxTransform.d.ts.map +0 -0
- package/dist-extensions/src/parser/attributes.d.ts +0 -0
- package/dist-extensions/src/parser/attributes.d.ts.map +0 -0
- package/dist-extensions/src/parser/constants.d.ts +0 -0
- package/dist-extensions/src/parser/constants.d.ts.map +0 -0
- package/dist-extensions/src/parser/doesSomeParentMatch.d.ts +0 -0
- package/dist-extensions/src/parser/doesSomeParentMatch.d.ts.map +0 -0
- package/dist-extensions/src/parser/elementMatchesRule.d.ts +0 -0
- package/dist-extensions/src/parser/elementMatchesRule.d.ts.map +0 -0
- package/dist-extensions/src/parser/elements_parser.d.ts +0 -0
- package/dist-extensions/src/parser/elements_parser.d.ts.map +0 -0
- package/dist-extensions/src/parser/getCSSRules.d.ts +0 -0
- package/dist-extensions/src/parser/getCSSRules.d.ts.map +0 -0
- package/dist-extensions/src/parser/getGlobalStylesForElement.d.ts +0 -0
- package/dist-extensions/src/parser/getGlobalStylesForElement.d.ts.map +0 -0
- package/dist-extensions/src/parser/getGradientDefs.d.ts +0 -0
- package/dist-extensions/src/parser/getGradientDefs.d.ts.map +0 -0
- package/dist-extensions/src/parser/getMultipleNodes.d.ts +0 -0
- package/dist-extensions/src/parser/getMultipleNodes.d.ts.map +0 -0
- package/dist-extensions/src/parser/getSvgRegex.d.ts +0 -0
- package/dist-extensions/src/parser/getSvgRegex.d.ts.map +0 -0
- package/dist-extensions/src/parser/getTagName.d.ts +0 -0
- package/dist-extensions/src/parser/getTagName.d.ts.map +0 -0
- package/dist-extensions/src/parser/hasInvalidAncestor.d.ts +0 -0
- package/dist-extensions/src/parser/hasInvalidAncestor.d.ts.map +0 -0
- package/dist-extensions/src/parser/loadSVGFromString.d.ts +0 -0
- package/dist-extensions/src/parser/loadSVGFromString.d.ts.map +0 -0
- package/dist-extensions/src/parser/loadSVGFromURL.d.ts +0 -0
- package/dist-extensions/src/parser/loadSVGFromURL.d.ts.map +0 -0
- package/dist-extensions/src/parser/normalizeAttr.d.ts +0 -0
- package/dist-extensions/src/parser/normalizeAttr.d.ts.map +0 -0
- package/dist-extensions/src/parser/normalizeValue.d.ts +0 -0
- package/dist-extensions/src/parser/normalizeValue.d.ts.map +0 -0
- package/dist-extensions/src/parser/parseAttributes.d.ts +0 -0
- package/dist-extensions/src/parser/parseAttributes.d.ts.map +0 -0
- package/dist-extensions/src/parser/parseFontDeclaration.d.ts +0 -0
- package/dist-extensions/src/parser/parseFontDeclaration.d.ts.map +0 -0
- package/dist-extensions/src/parser/parsePointsAttribute.d.ts +0 -0
- package/dist-extensions/src/parser/parsePointsAttribute.d.ts.map +0 -0
- package/dist-extensions/src/parser/parseSVGDocument.d.ts +0 -0
- package/dist-extensions/src/parser/parseSVGDocument.d.ts.map +0 -0
- package/dist-extensions/src/parser/parseStyleAttribute.d.ts +0 -0
- package/dist-extensions/src/parser/parseStyleAttribute.d.ts.map +0 -0
- package/dist-extensions/src/parser/parseStyleObject.d.ts +0 -0
- package/dist-extensions/src/parser/parseStyleObject.d.ts.map +0 -0
- package/dist-extensions/src/parser/parseStyleString.d.ts +0 -0
- package/dist-extensions/src/parser/parseStyleString.d.ts.map +0 -0
- package/dist-extensions/src/parser/parseTransformAttribute.d.ts +0 -0
- package/dist-extensions/src/parser/parseTransformAttribute.d.ts.map +0 -0
- package/dist-extensions/src/parser/parseUseDirectives.d.ts +0 -0
- package/dist-extensions/src/parser/parseUseDirectives.d.ts.map +0 -0
- package/dist-extensions/src/parser/percent.d.ts +0 -0
- package/dist-extensions/src/parser/percent.d.ts.map +0 -0
- package/dist-extensions/src/parser/recursivelyParseGradientsXlink.d.ts +0 -0
- package/dist-extensions/src/parser/recursivelyParseGradientsXlink.d.ts.map +0 -0
- package/dist-extensions/src/parser/selectorMatches.d.ts +0 -0
- package/dist-extensions/src/parser/selectorMatches.d.ts.map +0 -0
- package/dist-extensions/src/parser/setStrokeFillOpacity.d.ts +0 -0
- package/dist-extensions/src/parser/setStrokeFillOpacity.d.ts.map +0 -0
- package/dist-extensions/src/parser/typedefs.d.ts +0 -0
- package/dist-extensions/src/parser/typedefs.d.ts.map +0 -0
- package/dist-extensions/src/shapes/ActiveSelection.d.ts +0 -0
- package/dist-extensions/src/shapes/ActiveSelection.d.ts.map +0 -0
- package/dist-extensions/src/shapes/Circle.d.ts +0 -0
- package/dist-extensions/src/shapes/Circle.d.ts.map +0 -0
- package/dist-extensions/src/shapes/Ellipse.d.ts +0 -0
- package/dist-extensions/src/shapes/Ellipse.d.ts.map +0 -0
- package/dist-extensions/src/shapes/Group.d.ts +0 -0
- package/dist-extensions/src/shapes/Group.d.ts.map +0 -0
- package/dist-extensions/src/shapes/IText/DraggableTextDelegate.d.ts +0 -0
- package/dist-extensions/src/shapes/IText/DraggableTextDelegate.d.ts.map +0 -0
- package/dist-extensions/src/shapes/IText/IText.d.ts +0 -0
- package/dist-extensions/src/shapes/IText/IText.d.ts.map +0 -0
- package/dist-extensions/src/shapes/IText/ITextBehavior.d.ts +0 -0
- package/dist-extensions/src/shapes/IText/ITextBehavior.d.ts.map +1 -1
- package/dist-extensions/src/shapes/IText/ITextClickBehavior.d.ts +0 -0
- package/dist-extensions/src/shapes/IText/ITextClickBehavior.d.ts.map +0 -0
- package/dist-extensions/src/shapes/IText/ITextKeyBehavior.d.ts +0 -0
- package/dist-extensions/src/shapes/IText/ITextKeyBehavior.d.ts.map +0 -0
- package/dist-extensions/src/shapes/IText/constants.d.ts +0 -0
- package/dist-extensions/src/shapes/IText/constants.d.ts.map +0 -0
- package/dist-extensions/src/shapes/Image.d.ts +0 -0
- package/dist-extensions/src/shapes/Image.d.ts.map +0 -0
- package/dist-extensions/src/shapes/Line.d.ts +0 -0
- package/dist-extensions/src/shapes/Line.d.ts.map +0 -0
- package/dist-extensions/src/shapes/Object/FabricObject.d.ts +0 -0
- package/dist-extensions/src/shapes/Object/FabricObject.d.ts.map +0 -0
- package/dist-extensions/src/shapes/Object/FabricObjectSVGExportMixin.d.ts +0 -0
- package/dist-extensions/src/shapes/Object/FabricObjectSVGExportMixin.d.ts.map +0 -0
- package/dist-extensions/src/shapes/Object/InteractiveObject.d.ts +0 -0
- package/dist-extensions/src/shapes/Object/InteractiveObject.d.ts.map +0 -0
- package/dist-extensions/src/shapes/Object/Object.d.ts +0 -0
- package/dist-extensions/src/shapes/Object/Object.d.ts.map +0 -0
- package/dist-extensions/src/shapes/Object/ObjectGeometry.d.ts +0 -0
- package/dist-extensions/src/shapes/Object/ObjectGeometry.d.ts.map +0 -0
- package/dist-extensions/src/shapes/Object/defaultValues.d.ts +0 -0
- package/dist-extensions/src/shapes/Object/defaultValues.d.ts.map +0 -0
- package/dist-extensions/src/shapes/Object/types/BaseProps.d.ts +0 -0
- package/dist-extensions/src/shapes/Object/types/BaseProps.d.ts.map +0 -0
- package/dist-extensions/src/shapes/Object/types/BorderProps.d.ts +0 -0
- package/dist-extensions/src/shapes/Object/types/BorderProps.d.ts.map +0 -0
- package/dist-extensions/src/shapes/Object/types/ControlProps.d.ts +0 -0
- package/dist-extensions/src/shapes/Object/types/ControlProps.d.ts.map +0 -0
- package/dist-extensions/src/shapes/Object/types/FabricObjectProps.d.ts +0 -0
- package/dist-extensions/src/shapes/Object/types/FabricObjectProps.d.ts.map +0 -0
- package/dist-extensions/src/shapes/Object/types/FillStrokeProps.d.ts +0 -0
- package/dist-extensions/src/shapes/Object/types/FillStrokeProps.d.ts.map +0 -0
- package/dist-extensions/src/shapes/Object/types/LockInteractionProps.d.ts +0 -0
- package/dist-extensions/src/shapes/Object/types/LockInteractionProps.d.ts.map +0 -0
- package/dist-extensions/src/shapes/Object/types/ObjectProps.d.ts +0 -0
- package/dist-extensions/src/shapes/Object/types/ObjectProps.d.ts.map +0 -0
- package/dist-extensions/src/shapes/Object/types/ObjectTransformProps.d.ts +0 -0
- package/dist-extensions/src/shapes/Object/types/ObjectTransformProps.d.ts.map +0 -0
- package/dist-extensions/src/shapes/Object/types/SerializedObjectProps.d.ts +0 -0
- package/dist-extensions/src/shapes/Object/types/SerializedObjectProps.d.ts.map +0 -0
- package/dist-extensions/src/shapes/Object/types/index.d.ts +0 -0
- package/dist-extensions/src/shapes/Object/types/index.d.ts.map +0 -0
- package/dist-extensions/src/shapes/Path.d.ts +0 -0
- package/dist-extensions/src/shapes/Path.d.ts.map +0 -0
- package/dist-extensions/src/shapes/Polygon.d.ts +0 -0
- package/dist-extensions/src/shapes/Polygon.d.ts.map +0 -0
- package/dist-extensions/src/shapes/Polyline.d.ts +0 -0
- package/dist-extensions/src/shapes/Polyline.d.ts.map +0 -0
- package/dist-extensions/src/shapes/Rect.d.ts +0 -0
- package/dist-extensions/src/shapes/Rect.d.ts.map +0 -0
- package/dist-extensions/src/shapes/Text/StyledText.d.ts +0 -0
- package/dist-extensions/src/shapes/Text/StyledText.d.ts.map +0 -0
- package/dist-extensions/src/shapes/Text/Text.d.ts +1 -0
- package/dist-extensions/src/shapes/Text/Text.d.ts.map +1 -1
- package/dist-extensions/src/shapes/Text/TextSVGExportMixin.d.ts +0 -0
- package/dist-extensions/src/shapes/Text/TextSVGExportMixin.d.ts.map +0 -0
- package/dist-extensions/src/shapes/Text/constants.d.ts +0 -0
- package/dist-extensions/src/shapes/Text/constants.d.ts.map +0 -0
- package/dist-extensions/src/shapes/Textbox.d.ts +20 -0
- package/dist-extensions/src/shapes/Textbox.d.ts.map +1 -1
- package/dist-extensions/src/shapes/Triangle.d.ts +0 -0
- package/dist-extensions/src/shapes/Triangle.d.ts.map +0 -0
- package/dist-extensions/src/text/browserLines.d.ts +7 -2
- package/dist-extensions/src/text/browserLines.d.ts.map +1 -1
- package/dist-extensions/src/text/ellipsis.d.ts +0 -0
- package/dist-extensions/src/text/ellipsis.d.ts.map +0 -0
- package/dist-extensions/src/text/hitTest.d.ts +0 -0
- package/dist-extensions/src/text/hitTest.d.ts.map +0 -0
- package/dist-extensions/src/text/layout.d.ts +0 -0
- package/dist-extensions/src/text/layout.d.ts.map +0 -0
- package/dist-extensions/src/text/measure.d.ts +0 -0
- package/dist-extensions/src/text/measure.d.ts.map +0 -0
- package/dist-extensions/src/text/overlayEditor.d.ts +1 -0
- package/dist-extensions/src/text/overlayEditor.d.ts.map +1 -1
- package/dist-extensions/src/text/unicode.d.ts +0 -0
- package/dist-extensions/src/text/unicode.d.ts.map +0 -0
- package/dist-extensions/src/typedefs.d.ts +0 -0
- package/dist-extensions/src/typedefs.d.ts.map +0 -0
- package/dist-extensions/src/util/animation/AnimationBase.d.ts +0 -0
- package/dist-extensions/src/util/animation/AnimationBase.d.ts.map +0 -0
- package/dist-extensions/src/util/animation/AnimationFrameProvider.d.ts +0 -0
- package/dist-extensions/src/util/animation/AnimationFrameProvider.d.ts.map +0 -0
- package/dist-extensions/src/util/animation/AnimationRegistry.d.ts +0 -0
- package/dist-extensions/src/util/animation/AnimationRegistry.d.ts.map +0 -0
- package/dist-extensions/src/util/animation/ArrayAnimation.d.ts +0 -0
- package/dist-extensions/src/util/animation/ArrayAnimation.d.ts.map +0 -0
- package/dist-extensions/src/util/animation/ColorAnimation.d.ts +0 -0
- package/dist-extensions/src/util/animation/ColorAnimation.d.ts.map +0 -0
- package/dist-extensions/src/util/animation/ValueAnimation.d.ts +0 -0
- package/dist-extensions/src/util/animation/ValueAnimation.d.ts.map +0 -0
- package/dist-extensions/src/util/animation/animate.d.ts +0 -0
- package/dist-extensions/src/util/animation/animate.d.ts.map +0 -0
- package/dist-extensions/src/util/animation/easing.d.ts +0 -0
- package/dist-extensions/src/util/animation/easing.d.ts.map +0 -0
- package/dist-extensions/src/util/animation/index.d.ts +0 -0
- package/dist-extensions/src/util/animation/index.d.ts.map +0 -0
- package/dist-extensions/src/util/animation/types.d.ts +0 -0
- package/dist-extensions/src/util/animation/types.d.ts.map +0 -0
- package/dist-extensions/src/util/applyMixins.d.ts +0 -0
- package/dist-extensions/src/util/applyMixins.d.ts.map +0 -0
- package/dist-extensions/src/util/dom_event.d.ts +0 -0
- package/dist-extensions/src/util/dom_event.d.ts.map +0 -0
- package/dist-extensions/src/util/dom_misc.d.ts +0 -0
- package/dist-extensions/src/util/dom_misc.d.ts.map +0 -0
- package/dist-extensions/src/util/index.d.ts +0 -0
- package/dist-extensions/src/util/index.d.ts.map +0 -0
- package/dist-extensions/src/util/internals/applyCanvasTransform.d.ts +0 -0
- package/dist-extensions/src/util/internals/applyCanvasTransform.d.ts.map +0 -0
- package/dist-extensions/src/util/internals/cleanupSvgAttribute.d.ts +0 -0
- package/dist-extensions/src/util/internals/cleanupSvgAttribute.d.ts.map +0 -0
- package/dist-extensions/src/util/internals/cloneStyles.d.ts +0 -0
- package/dist-extensions/src/util/internals/cloneStyles.d.ts.map +0 -0
- package/dist-extensions/src/util/internals/console.d.ts +0 -0
- package/dist-extensions/src/util/internals/console.d.ts.map +0 -0
- package/dist-extensions/src/util/internals/dom_style.d.ts +0 -0
- package/dist-extensions/src/util/internals/dom_style.d.ts.map +0 -0
- package/dist-extensions/src/util/internals/findRight.d.ts +0 -0
- package/dist-extensions/src/util/internals/findRight.d.ts.map +0 -0
- package/dist-extensions/src/util/internals/getRandomInt.d.ts +0 -0
- package/dist-extensions/src/util/internals/getRandomInt.d.ts.map +0 -0
- package/dist-extensions/src/util/internals/ifNaN.d.ts +0 -0
- package/dist-extensions/src/util/internals/ifNaN.d.ts.map +0 -0
- package/dist-extensions/src/util/internals/removeFromArray.d.ts +0 -0
- package/dist-extensions/src/util/internals/removeFromArray.d.ts.map +0 -0
- package/dist-extensions/src/util/internals/uid.d.ts +0 -0
- package/dist-extensions/src/util/internals/uid.d.ts.map +0 -0
- package/dist-extensions/src/util/lang_string.d.ts +0 -0
- package/dist-extensions/src/util/lang_string.d.ts.map +0 -0
- package/dist-extensions/src/util/misc/boundingBoxFromPoints.d.ts +0 -0
- package/dist-extensions/src/util/misc/boundingBoxFromPoints.d.ts.map +0 -0
- package/dist-extensions/src/util/misc/capValue.d.ts +0 -0
- package/dist-extensions/src/util/misc/capValue.d.ts.map +0 -0
- package/dist-extensions/src/util/misc/cornerRadius.d.ts +0 -0
- package/dist-extensions/src/util/misc/cornerRadius.d.ts.map +0 -0
- package/dist-extensions/src/util/misc/cos.d.ts +0 -0
- package/dist-extensions/src/util/misc/cos.d.ts.map +0 -0
- package/dist-extensions/src/util/misc/dom.d.ts +0 -0
- package/dist-extensions/src/util/misc/dom.d.ts.map +0 -0
- package/dist-extensions/src/util/misc/findScaleTo.d.ts +0 -0
- package/dist-extensions/src/util/misc/findScaleTo.d.ts.map +0 -0
- package/dist-extensions/src/util/misc/groupSVGElements.d.ts +0 -0
- package/dist-extensions/src/util/misc/groupSVGElements.d.ts.map +0 -0
- package/dist-extensions/src/util/misc/isTransparent.d.ts +0 -0
- package/dist-extensions/src/util/misc/isTransparent.d.ts.map +0 -0
- package/dist-extensions/src/util/misc/matrix.d.ts +0 -0
- package/dist-extensions/src/util/misc/matrix.d.ts.map +0 -0
- package/dist-extensions/src/util/misc/mergeClipPaths.d.ts +0 -0
- package/dist-extensions/src/util/misc/mergeClipPaths.d.ts.map +0 -0
- package/dist-extensions/src/util/misc/objectEnlive.d.ts +0 -0
- package/dist-extensions/src/util/misc/objectEnlive.d.ts.map +0 -0
- package/dist-extensions/src/util/misc/objectTransforms.d.ts +0 -0
- package/dist-extensions/src/util/misc/objectTransforms.d.ts.map +0 -0
- package/dist-extensions/src/util/misc/pick.d.ts +0 -0
- package/dist-extensions/src/util/misc/pick.d.ts.map +0 -0
- package/dist-extensions/src/util/misc/planeChange.d.ts +0 -0
- package/dist-extensions/src/util/misc/planeChange.d.ts.map +0 -0
- package/dist-extensions/src/util/misc/projectStroke/StrokeLineCapProjections.d.ts +0 -0
- package/dist-extensions/src/util/misc/projectStroke/StrokeLineCapProjections.d.ts.map +0 -0
- package/dist-extensions/src/util/misc/projectStroke/StrokeLineJoinProjections.d.ts +0 -0
- package/dist-extensions/src/util/misc/projectStroke/StrokeLineJoinProjections.d.ts.map +0 -0
- package/dist-extensions/src/util/misc/projectStroke/StrokeProjectionsBase.d.ts +0 -0
- package/dist-extensions/src/util/misc/projectStroke/StrokeProjectionsBase.d.ts.map +0 -0
- package/dist-extensions/src/util/misc/projectStroke/index.d.ts +0 -0
- package/dist-extensions/src/util/misc/projectStroke/index.d.ts.map +0 -0
- package/dist-extensions/src/util/misc/projectStroke/types.d.ts +0 -0
- package/dist-extensions/src/util/misc/projectStroke/types.d.ts.map +0 -0
- package/dist-extensions/src/util/misc/radiansDegreesConversion.d.ts +0 -0
- package/dist-extensions/src/util/misc/radiansDegreesConversion.d.ts.map +0 -0
- package/dist-extensions/src/util/misc/resolveOrigin.d.ts +0 -0
- package/dist-extensions/src/util/misc/resolveOrigin.d.ts.map +0 -0
- package/dist-extensions/src/util/misc/sin.d.ts +0 -0
- package/dist-extensions/src/util/misc/sin.d.ts.map +0 -0
- package/dist-extensions/src/util/misc/svgExport.d.ts +0 -0
- package/dist-extensions/src/util/misc/svgExport.d.ts.map +0 -0
- package/dist-extensions/src/util/misc/svgParsing.d.ts +0 -0
- package/dist-extensions/src/util/misc/svgParsing.d.ts.map +0 -0
- package/dist-extensions/src/util/misc/textStyles.d.ts +0 -0
- package/dist-extensions/src/util/misc/textStyles.d.ts.map +0 -0
- package/dist-extensions/src/util/misc/toFixed.d.ts +0 -0
- package/dist-extensions/src/util/misc/toFixed.d.ts.map +0 -0
- package/dist-extensions/src/util/misc/vectors.d.ts +0 -0
- package/dist-extensions/src/util/misc/vectors.d.ts.map +0 -0
- package/dist-extensions/src/util/path/index.d.ts +0 -0
- package/dist-extensions/src/util/path/index.d.ts.map +0 -0
- package/dist-extensions/src/util/path/regex.d.ts +0 -0
- package/dist-extensions/src/util/path/regex.d.ts.map +0 -0
- package/dist-extensions/src/util/path/typedefs.d.ts +0 -0
- package/dist-extensions/src/util/path/typedefs.d.ts.map +0 -0
- package/dist-extensions/src/util/transform_matrix_removal.d.ts +0 -0
- package/dist-extensions/src/util/transform_matrix_removal.d.ts.map +0 -0
- package/dist-extensions/src/util/typeAssertions.d.ts +0 -0
- package/dist-extensions/src/util/typeAssertions.d.ts.map +0 -0
- package/docs/fabric-konva-gap-analysis.md +0 -0
- package/docs/konva-text-behavior-spec.md +0 -0
- package/docs/text-engine-design.md +0 -0
- package/eslint.config.mjs +0 -0
- package/examples/overlay-edit.html +416 -416
- package/extensions/README.MD +0 -0
- package/extensions/aligning_guidelines/README.MD +0 -0
- package/extensions/aligning_guidelines/constant.ts +0 -0
- package/extensions/aligning_guidelines/index.ts +0 -0
- package/extensions/aligning_guidelines/typedefs.ts +0 -0
- package/extensions/aligning_guidelines/util/basic.spec.ts +0 -0
- package/extensions/aligning_guidelines/util/basic.ts +0 -0
- package/extensions/aligning_guidelines/util/collect-line.ts +0 -0
- package/extensions/aligning_guidelines/util/collect-point.ts +0 -0
- package/extensions/aligning_guidelines/util/draw.ts +0 -0
- package/extensions/aligning_guidelines/util/get-objects-by-target.ts +0 -0
- package/extensions/data_updaters/README.md +0 -0
- package/extensions/data_updaters/gradient/__snapshots__/index.spec.ts.snap +0 -0
- package/extensions/data_updaters/gradient/index.spec.ts +0 -0
- package/extensions/data_updaters/gradient/index.ts +0 -0
- package/extensions/data_updaters/origins/README.md +0 -0
- package/extensions/data_updaters/origins/index.spec.ts +0 -0
- package/extensions/data_updaters/origins/index.ts +0 -0
- package/extensions/index.ts +0 -0
- package/fabric.ts +182 -182
- package/index.node.ts +0 -0
- package/index.ts +0 -0
- package/lib/aligning_guidelines.js +0 -0
- package/lib/centering_guidelines.js +0 -0
- package/lib/event.js +0 -0
- package/package.json +164 -164
- package/playwright.config.ts +0 -0
- package/playwright.setup.ts +0 -0
- package/{fonts → public/fonts}/STV Bold.ttf +0 -0
- package/{fonts → public/fonts}/STV Light.ttf +0 -0
- package/{fonts → public/fonts}/STV Regular.ttf +0 -0
- package/publish-next.js +0 -0
- package/publish.js +0 -0
- package/rollup.config.mjs +0 -0
- package/rtl-debug.html +744 -744
- package/scripts/bench-text.js +591 -591
- package/scripts/build.mjs +0 -0
- package/scripts/buildLock.mjs +0 -0
- package/scripts/buildReporter.mjs +0 -0
- package/scripts/buildStats.mjs +0 -0
- package/scripts/dirname.mjs +0 -0
- package/scripts/git.mjs +0 -0
- package/scripts/index.mjs +0 -0
- package/scripts/sandbox.mjs +0 -0
- package/src/ClassRegistry.spec.ts +0 -0
- package/src/ClassRegistry.ts +0 -0
- package/src/Collection.spec.ts +0 -0
- package/src/Collection.ts +0 -0
- package/src/CommonMethods.ts +0 -0
- package/src/EventTypeDefs.ts +0 -0
- package/src/Intersection.spec.ts +0 -0
- package/src/Intersection.ts +0 -0
- package/src/LayoutManager/ActiveSelectionLayoutManager.spec.ts +0 -0
- package/src/LayoutManager/ActiveSelectionLayoutManager.ts +0 -0
- package/src/LayoutManager/LayoutManager.spec.ts +0 -0
- package/src/LayoutManager/LayoutManager.ts +0 -0
- package/src/LayoutManager/LayoutStrategies/ClipPathLayout.ts +0 -0
- package/src/LayoutManager/LayoutStrategies/FitContentLayout.ts +0 -0
- package/src/LayoutManager/LayoutStrategies/FixedLayout.ts +0 -0
- package/src/LayoutManager/LayoutStrategies/LayoutStrategy.ts +0 -0
- package/src/LayoutManager/LayoutStrategies/utils.ts +0 -0
- package/src/LayoutManager/README.md +0 -0
- package/src/LayoutManager/__snapshots__/LayoutManager.spec.ts.snap +0 -0
- package/src/LayoutManager/constants.ts +0 -0
- package/src/LayoutManager/index.ts +0 -0
- package/src/LayoutManager/types.ts +0 -0
- package/src/Observable.spec.ts +0 -0
- package/src/Observable.ts +0 -0
- package/src/Pattern/Pattern.spec.ts +0 -0
- package/src/Pattern/Pattern.ts +0 -0
- package/src/Pattern/index.ts +0 -0
- package/src/Pattern/types.ts +0 -0
- package/src/Point.spec.ts +0 -0
- package/src/Point.ts +0 -0
- package/src/Shadow.spec.ts +0 -0
- package/src/Shadow.ts +0 -0
- package/src/__snapshots__/Shadow.spec.ts.snap +0 -0
- package/src/brushes/BaseBrush.spec.ts +0 -0
- package/src/brushes/BaseBrush.ts +0 -0
- package/src/brushes/CircleBrush.test.ts +0 -0
- package/src/brushes/CircleBrush.ts +0 -0
- package/src/brushes/PatternBrush.ts +0 -0
- package/src/brushes/PencilBrush.spec.ts +0 -0
- package/src/brushes/PencilBrush.ts +0 -0
- package/src/brushes/SprayBrush.ts +0 -0
- package/src/brushes/__snapshots__/PencilBrush.spec.ts.snap +0 -0
- package/src/brushes/typedefs.ts +0 -0
- package/src/cache.spec.ts +0 -0
- package/src/cache.ts +0 -0
- package/src/canvas/Canvas-dispose.spec.ts +0 -0
- package/src/canvas/Canvas-events.spec.ts +0 -0
- package/src/canvas/Canvas.spec.ts +0 -0
- package/src/canvas/Canvas.ts +0 -0
- package/src/canvas/CanvasOptions.ts +0 -0
- package/src/canvas/DOMManagers/CanvasDOMManager.ts +0 -0
- package/src/canvas/DOMManagers/StaticCanvasDOMManager.ts +0 -0
- package/src/canvas/DOMManagers/util.spec.ts +0 -0
- package/src/canvas/DOMManagers/util.ts +0 -0
- package/src/canvas/SelectableCanvas.spec.ts +0 -0
- package/src/canvas/SelectableCanvas.ts +0 -0
- package/src/canvas/StaticCanvas.spec.ts +0 -0
- package/src/canvas/StaticCanvas.ts +0 -0
- package/src/canvas/StaticCanvasOptions.ts +0 -0
- package/src/canvas/TextEditingManager.ts +0 -0
- package/src/canvas/__tests__/SelectableCanvas.spec.ts +0 -0
- package/src/canvas/__tests__/__snapshots__/eventData.test.ts.snap +0 -0
- package/src/canvas/__tests__/eventData.test.ts +0 -0
- package/src/canvas/canvas_gestures.mixin.ts +0 -0
- package/src/color/Color.ts +0 -0
- package/src/color/color.test.ts +0 -0
- package/src/color/color_map.ts +0 -0
- package/src/color/constants.ts +0 -0
- package/src/color/typedefs.ts +0 -0
- package/src/color/util.ts +0 -0
- package/src/config.ts +0 -0
- package/src/constants.ts +0 -0
- package/src/controls/Control-cursor.spec.ts +0 -0
- package/src/controls/Control-handlers.spec.ts +0 -0
- package/src/controls/Control.spec.ts +0 -0
- package/src/controls/Control.ts +0 -0
- package/src/controls/changeHeight.ts +0 -0
- package/src/controls/changeWidth.test.ts +0 -0
- package/src/controls/changeWidth.ts +0 -0
- package/src/controls/commonControls.ts +0 -0
- package/src/controls/controlRendering.ts +0 -0
- package/src/controls/drag.ts +0 -0
- package/src/controls/fireEvent.ts +0 -0
- package/src/controls/index.ts +0 -0
- package/src/controls/pathControl.spec.ts +0 -0
- package/src/controls/pathControl.ts +0 -0
- package/src/controls/polyControl.spec.ts +0 -0
- package/src/controls/polyControl.ts +0 -0
- package/src/controls/rotate.ts +0 -0
- package/src/controls/scale.test.ts +0 -0
- package/src/controls/scale.ts +0 -0
- package/src/controls/scaleSkew.ts +0 -0
- package/src/controls/skew.ts +0 -0
- package/src/controls/util.ts +0 -0
- package/src/controls/wrapWithFireEvent.ts +0 -0
- package/src/controls/wrapWithFixedAnchor.spec.ts +0 -0
- package/src/controls/wrapWithFixedAnchor.ts +0 -0
- package/src/env/browser.ts +0 -0
- package/src/env/env.spec.ts +0 -0
- package/src/env/index.ts +0 -0
- package/src/env/node.ts +0 -0
- package/src/env/types.ts +0 -0
- package/src/filters/BaseFilter.spec.ts +0 -0
- package/src/filters/BaseFilter.ts +0 -0
- package/src/filters/BlendColor.ts +0 -0
- package/src/filters/BlendImage.ts +0 -0
- package/src/filters/Blur.ts +0 -0
- package/src/filters/Boilerplate.ts +0 -0
- package/src/filters/Brightness.ts +0 -0
- package/src/filters/Canvas2dFilterBackend.ts +0 -0
- package/src/filters/ColorMatrix.spec.ts +0 -0
- package/src/filters/ColorMatrix.ts +0 -0
- package/src/filters/ColorMatrixFilters.ts +0 -0
- package/src/filters/Composed.ts +0 -0
- package/src/filters/Contrast.ts +0 -0
- package/src/filters/Convolute.ts +0 -0
- package/src/filters/FilterBackend.ts +0 -0
- package/src/filters/GLProbes/GLProbe.ts +0 -0
- package/src/filters/GLProbes/NodeGLProbe.ts +0 -0
- package/src/filters/GLProbes/WebGLProbe.ts +0 -0
- package/src/filters/Gamma.ts +0 -0
- package/src/filters/Grayscale.ts +0 -0
- package/src/filters/HueRotation.ts +0 -0
- package/src/filters/Invert.ts +0 -0
- package/src/filters/Noise.ts +0 -0
- package/src/filters/Pixelate.ts +0 -0
- package/src/filters/RemoveColor.ts +0 -0
- package/src/filters/Resize.ts +0 -0
- package/src/filters/Saturation.ts +0 -0
- package/src/filters/Vibrance.ts +0 -0
- package/src/filters/WebGLFilterBackend.spec.ts +0 -0
- package/src/filters/WebGLFilterBackend.ts +0 -0
- package/src/filters/filters.ts +0 -0
- package/src/filters/index.ts +0 -0
- package/src/filters/shaders/baseFilter.ts +0 -0
- package/src/filters/shaders/blendColor.ts +0 -0
- package/src/filters/shaders/blendImage.ts +0 -0
- package/src/filters/shaders/blur.ts +0 -0
- package/src/filters/shaders/brightness.ts +0 -0
- package/src/filters/shaders/colorMatrix.ts +0 -0
- package/src/filters/shaders/constrast.ts +0 -0
- package/src/filters/shaders/convolute.ts +0 -0
- package/src/filters/shaders/gamma.ts +0 -0
- package/src/filters/shaders/grayscale.ts +0 -0
- package/src/filters/shaders/invert.ts +0 -0
- package/src/filters/shaders/noise.ts +0 -0
- package/src/filters/shaders/pixelate.ts +0 -0
- package/src/filters/shaders/removeColor.ts +0 -0
- package/src/filters/shaders/saturation.ts +0 -0
- package/src/filters/shaders/vibrance.ts +0 -0
- package/src/filters/typedefs.ts +0 -0
- package/src/filters/utils.ts +0 -0
- package/src/gradient/Gradient.spec.ts +0 -0
- package/src/gradient/Gradient.ts +0 -0
- package/src/gradient/constants.ts +0 -0
- package/src/gradient/index.ts +0 -0
- package/src/gradient/parser/misc.ts +0 -0
- package/src/gradient/parser/parseColorStops.ts +0 -0
- package/src/gradient/parser/parseCoords.ts +0 -0
- package/src/gradient/typedefs.ts +0 -0
- package/src/mixins/eraser_brush.mixin.ts +0 -0
- package/src/parkinglot/canvas_animation.mixin.ts +0 -0
- package/src/parkinglot/straighten.ts +0 -0
- package/src/parser/applyViewboxTransform.spec.ts +0 -0
- package/src/parser/applyViewboxTransform.ts +0 -0
- package/src/parser/attributes.ts +0 -0
- package/src/parser/constants.spec.ts +0 -0
- package/src/parser/constants.ts +0 -0
- package/src/parser/doesSomeParentMatch.ts +0 -0
- package/src/parser/elementMatchesRule.ts +0 -0
- package/src/parser/elements_parser.ts +0 -0
- package/src/parser/getCSSRules.spec.ts +0 -0
- package/src/parser/getCSSRules.ts +0 -0
- package/src/parser/getGlobalStylesForElement.ts +0 -0
- package/src/parser/getGradientDefs.ts +0 -0
- package/src/parser/getMultipleNodes.ts +0 -0
- package/src/parser/getSvgRegex.ts +0 -0
- package/src/parser/getTagName.ts +0 -0
- package/src/parser/hasInvalidAncestor.ts +0 -0
- package/src/parser/loadSVGFromString.test.ts +0 -0
- package/src/parser/loadSVGFromString.ts +0 -0
- package/src/parser/loadSVGFromURL.ts +0 -0
- package/src/parser/normalizeAttr.ts +0 -0
- package/src/parser/normalizeValue.ts +0 -0
- package/src/parser/parseAttributes.ts +0 -0
- package/src/parser/parseFontDeclaration.ts +0 -0
- package/src/parser/parsePointsAttribute.ts +0 -0
- package/src/parser/parseSVGDocument.ts +0 -0
- package/src/parser/parseStyleAttribute.ts +0 -0
- package/src/parser/parseStyleObject.ts +0 -0
- package/src/parser/parseStyleString.ts +0 -0
- package/src/parser/parseTransformAttribute.ts +0 -0
- package/src/parser/parseUseDirectives.test.ts +0 -0
- package/src/parser/parseUseDirectives.ts +0 -0
- package/src/parser/parser.spec.ts +0 -0
- package/src/parser/percent.ts +0 -0
- package/src/parser/recursivelyParseGradientsXlink.ts +0 -0
- package/src/parser/selectorMatches.ts +0 -0
- package/src/parser/setStrokeFillOpacity.ts +0 -0
- package/src/parser/typedefs.ts +0 -0
- package/src/shapes/ActiveSelection.spec.ts +0 -0
- package/src/shapes/ActiveSelection.ts +0 -0
- package/src/shapes/Circle.spec.ts +0 -0
- package/src/shapes/Circle.ts +0 -0
- package/src/shapes/Ellipse.spec.ts +0 -0
- package/src/shapes/Ellipse.ts +0 -0
- package/src/shapes/Group.spec.ts +0 -0
- package/src/shapes/Group.ts +0 -0
- package/src/shapes/IText/DraggableTextDelegate.ts +0 -0
- package/src/shapes/IText/IText-click-behavior.spec.ts +0 -0
- package/src/shapes/IText/IText.test.ts +0 -0
- package/src/shapes/IText/IText.ts +846 -846
- package/src/shapes/IText/ITextBehavior.test.ts +0 -0
- package/src/shapes/IText/ITextBehavior.ts +1263 -1188
- package/src/shapes/IText/ITextClickBehavior.ts +254 -254
- package/src/shapes/IText/ITextKeyBehavior.test.ts +0 -0
- package/src/shapes/IText/ITextKeyBehavior.ts +732 -732
- package/src/shapes/IText/__snapshots__/IText.test.ts.snap +0 -0
- package/src/shapes/IText/__snapshots__/ITextBehavior.test.ts.snap +0 -0
- package/src/shapes/IText/constants.ts +0 -0
- package/src/shapes/Image-filters.spec.ts +0 -0
- package/src/shapes/Image.spec.ts +0 -0
- package/src/shapes/Image.ts +0 -0
- package/src/shapes/Line.spec.ts +0 -0
- package/src/shapes/Line.ts +0 -0
- package/src/shapes/Object/FabricObject.spec.ts +0 -0
- package/src/shapes/Object/FabricObject.ts +0 -0
- package/src/shapes/Object/FabricObjectSVGExportMixin.ts +0 -0
- package/src/shapes/Object/InteractiveObject.spec.ts +0 -0
- package/src/shapes/Object/InteractiveObject.ts +0 -0
- package/src/shapes/Object/Object-clip-path.spec.ts +0 -0
- package/src/shapes/Object/Object-interactivity.spec.ts +0 -0
- package/src/shapes/Object/Object.spec.ts +0 -0
- package/src/shapes/Object/Object.ts +0 -0
- package/src/shapes/Object/ObjectGeometry.spec.ts +0 -0
- package/src/shapes/Object/ObjectGeometry.ts +0 -0
- package/src/shapes/Object/ObjectOrigin.spec.ts +0 -0
- package/src/shapes/Object/ObjectSerialization.spec.ts +0 -0
- package/src/shapes/Object/StackedObject.spec.ts +0 -0
- package/src/shapes/Object/__snapshots__/InteractiveObject.spec.ts.snap +0 -0
- package/src/shapes/Object/defaultValues.ts +0 -0
- package/src/shapes/Object/types/BaseProps.ts +0 -0
- package/src/shapes/Object/types/BorderProps.ts +0 -0
- package/src/shapes/Object/types/ControlProps.ts +0 -0
- package/src/shapes/Object/types/FabricObjectProps.ts +0 -0
- package/src/shapes/Object/types/FillStrokeProps.ts +0 -0
- package/src/shapes/Object/types/LockInteractionProps.ts +0 -0
- package/src/shapes/Object/types/ObjectProps.ts +0 -0
- package/src/shapes/Object/types/ObjectTransformProps.ts +0 -0
- package/src/shapes/Object/types/SerializedObjectProps.ts +0 -0
- package/src/shapes/Object/types/index.ts +0 -0
- package/src/shapes/Path.spec.ts +0 -0
- package/src/shapes/Path.ts +0 -0
- package/src/shapes/Polygon.spec.ts +0 -0
- package/src/shapes/Polygon.ts +0 -0
- package/src/shapes/Polyline.spec.ts +0 -0
- package/src/shapes/Polyline.ts +0 -0
- package/src/shapes/Rect.spec.ts +0 -0
- package/src/shapes/Rect.ts +0 -0
- package/src/shapes/Text/StyledText.spec.ts +0 -0
- package/src/shapes/Text/StyledText.ts +0 -0
- package/src/shapes/Text/Text.spec.ts +0 -0
- package/src/shapes/Text/Text.ts +2530 -2463
- package/src/shapes/Text/TextSVGExportMixin.spec.ts +0 -0
- package/src/shapes/Text/TextSVGExportMixin.ts +0 -0
- package/src/shapes/Text/__snapshots__/Text.spec.ts.snap +0 -0
- package/src/shapes/Text/__snapshots__/TextSVGExportMixin.spec.ts.snap +0 -0
- package/src/shapes/Text/constants.ts +135 -135
- package/src/shapes/Textbox.spec.ts +0 -0
- package/src/shapes/Textbox.ts +1788 -1320
- package/src/shapes/Triangle.spec.ts +0 -0
- package/src/shapes/Triangle.ts +0 -0
- package/src/shapes/__snapshots__/Image.spec.ts.snap +0 -0
- package/src/shapes/__snapshots__/Textbox.spec.ts.snap +0 -0
- package/src/text/browserLines.ts +266 -234
- package/src/text/ellipsis.ts +516 -516
- package/src/text/hitTest.ts +623 -623
- package/src/text/layout.ts +586 -586
- package/src/text/measure.ts +626 -626
- package/src/text/overlayEditor.ts +1108 -1047
- package/src/text/unicode.ts +454 -454
- package/src/typedefs.ts +0 -0
- package/src/util/__snapshots__/index.spec.ts.snap +0 -0
- package/src/util/animation/AnimationBase.ts +0 -0
- package/src/util/animation/AnimationFrameProvider.ts +0 -0
- package/src/util/animation/AnimationRegistry.ts +0 -0
- package/src/util/animation/ArrayAnimation.ts +0 -0
- package/src/util/animation/ColorAnimation.ts +0 -0
- package/src/util/animation/ValueAnimation.ts +0 -0
- package/src/util/animation/__snapshots__/animations.spec.ts.snap +0 -0
- package/src/util/animation/animate.ts +0 -0
- package/src/util/animation/animations.spec.ts +0 -0
- package/src/util/animation/easing.ts +0 -0
- package/src/util/animation/index.ts +0 -0
- package/src/util/animation/types.ts +0 -0
- package/src/util/applyMixins.ts +0 -0
- package/src/util/dom_event.spec.ts +0 -0
- package/src/util/dom_event.ts +0 -0
- package/src/util/dom_misc.ts +0 -0
- package/src/util/index.spec.ts +0 -0
- package/src/util/index.ts +0 -0
- package/src/util/internals/applyCanvasTransform.ts +0 -0
- package/src/util/internals/cleanupSvgAttribute.test.ts +0 -0
- package/src/util/internals/cleanupSvgAttribute.ts +0 -0
- package/src/util/internals/cloneStyles.spec.ts +0 -0
- package/src/util/internals/cloneStyles.ts +0 -0
- package/src/util/internals/console.ts +0 -0
- package/src/util/internals/dom_style.spec.ts +0 -0
- package/src/util/internals/dom_style.ts +0 -0
- package/src/util/internals/findRight.ts +0 -0
- package/src/util/internals/getRandomInt.test.ts +0 -0
- package/src/util/internals/getRandomInt.ts +0 -0
- package/src/util/internals/ifNaN.ts +0 -0
- package/src/util/internals/removeFromArray.spec.ts +0 -0
- package/src/util/internals/removeFromArray.ts +0 -0
- package/src/util/internals/uid.ts +0 -0
- package/src/util/lang_string.spec.ts +0 -0
- package/src/util/lang_string.ts +0 -0
- package/src/util/misc/boundingBoxFromPoints.spec.ts +0 -0
- package/src/util/misc/boundingBoxFromPoints.ts +0 -0
- package/src/util/misc/capValue.spec.ts +0 -0
- package/src/util/misc/capValue.ts +0 -0
- package/src/util/misc/cornerRadius.spec.ts +0 -0
- package/src/util/misc/cornerRadius.ts +0 -0
- package/src/util/misc/cos.spec.ts +0 -0
- package/src/util/misc/cos.ts +0 -0
- package/src/util/misc/dom.spec.ts +0 -0
- package/src/util/misc/dom.ts +0 -0
- package/src/util/misc/findScaleTo.spec.ts +0 -0
- package/src/util/misc/findScaleTo.ts +0 -0
- package/src/util/misc/groupSVGElements.spec.ts +0 -0
- package/src/util/misc/groupSVGElements.ts +0 -0
- package/src/util/misc/isTransparent.ts +0 -0
- package/src/util/misc/matrix.spec.ts +0 -0
- package/src/util/misc/matrix.ts +0 -0
- package/src/util/misc/mergeClipPaths.spec.ts +0 -0
- package/src/util/misc/mergeClipPaths.ts +0 -0
- package/src/util/misc/objectEnlive.spec.ts +0 -0
- package/src/util/misc/objectEnlive.ts +0 -0
- package/src/util/misc/objectTransforms.spec.ts +0 -0
- package/src/util/misc/objectTransforms.ts +0 -0
- package/src/util/misc/pick.spec.ts +0 -0
- package/src/util/misc/pick.ts +0 -0
- package/src/util/misc/planeChange.spec.ts +0 -0
- package/src/util/misc/planeChange.ts +0 -0
- package/src/util/misc/projectStroke/StrokeLineCapProjections.ts +0 -0
- package/src/util/misc/projectStroke/StrokeLineJoinProjections.ts +0 -0
- package/src/util/misc/projectStroke/StrokeProjectionsBase.ts +0 -0
- package/src/util/misc/projectStroke/index.ts +0 -0
- package/src/util/misc/projectStroke/types.ts +0 -0
- package/src/util/misc/radiansDegreesConversion.spec.ts +0 -0
- package/src/util/misc/radiansDegreesConversion.ts +0 -0
- package/src/util/misc/resolveOrigin.ts +0 -0
- package/src/util/misc/sin.ts +0 -0
- package/src/util/misc/svgExport.ts +0 -0
- package/src/util/misc/svgParsing.spec.ts +0 -0
- package/src/util/misc/svgParsing.ts +0 -0
- package/src/util/misc/textStyles.ts +0 -0
- package/src/util/misc/toFixed.spec.ts +0 -0
- package/src/util/misc/toFixed.ts +0 -0
- package/src/util/misc/vectors.spec.ts +0 -0
- package/src/util/misc/vectors.ts +0 -0
- package/src/util/path/__snapshots__/index.spec.ts.snap +0 -0
- package/src/util/path/index.spec.ts +0 -0
- package/src/util/path/index.ts +0 -0
- package/src/util/path/regex.ts +0 -0
- package/src/util/path/typechecks.ts +0 -0
- package/src/util/path/typedefs.ts +0 -0
- package/src/util/transform_matrix_removal.ts +0 -0
- package/src/util/typeAssertions.spec.ts +0 -0
- package/src/util/typeAssertions.ts +0 -0
- package/tsconfig-extensions.json +0 -0
- package/tsconfig.json +0 -0
- package/tsconfig.spec.json +0 -0
- package/typedoc.config.json +0 -0
- package/vitest.config.ts +0 -0
- package/vitest.d.ts +0 -0
- package/vitest.env.d.ts +0 -0
- package/vitest.extend.ts +0 -0
- package/vitest.setup.ts +0 -0
- package/dist/src/text/examples/arabicTextExample.d.ts +0 -60
- package/dist/src/text/examples/arabicTextExample.d.ts.map +0 -1
- package/dist/src/text/scriptUtils.d.ts +0 -142
- package/dist/src/text/scriptUtils.d.ts.map +0 -1
- package/dist/src/text/scriptUtils.min.mjs +0 -2
- package/dist/src/text/scriptUtils.min.mjs.map +0 -1
- package/dist/src/text/scriptUtils.mjs +0 -212
- package/dist/src/text/scriptUtils.mjs.map +0 -1
- package/dist-extensions/src/shapes/CustomLine.d.ts +0 -10
- package/dist-extensions/src/shapes/CustomLine.d.ts.map +0 -1
- package/dist-extensions/src/text/scriptUtils.d.ts +0 -142
- package/dist-extensions/src/text/scriptUtils.d.ts.map +0 -1
- package/fabric-test-editor.html +0 -3552
- package/fabric-test2.html +0 -647
package/dist/index.js
CHANGED
|
@@ -360,7 +360,7 @@
|
|
|
360
360
|
}
|
|
361
361
|
const cache = new Cache();
|
|
362
362
|
|
|
363
|
-
var version = "7.0.1-
|
|
363
|
+
var version = "7.0.1-beta14";
|
|
364
364
|
|
|
365
365
|
// use this syntax so babel plugin see this import here
|
|
366
366
|
const VERSION = version;
|
|
@@ -19189,8 +19189,8 @@
|
|
|
19189
19189
|
// Global measurement context - reused for performance
|
|
19190
19190
|
let measurementContext = null;
|
|
19191
19191
|
|
|
19192
|
-
/**
|
|
19193
|
-
* Get or create the shared measurement context
|
|
19192
|
+
/**
|
|
19193
|
+
* Get or create the shared measurement context
|
|
19194
19194
|
*/
|
|
19195
19195
|
function getMeasurementContext() {
|
|
19196
19196
|
if (!measurementContext) {
|
|
@@ -19203,8 +19203,8 @@
|
|
|
19203
19203
|
return measurementContext;
|
|
19204
19204
|
}
|
|
19205
19205
|
|
|
19206
|
-
/**
|
|
19207
|
-
* Measure a single grapheme
|
|
19206
|
+
/**
|
|
19207
|
+
* Measure a single grapheme
|
|
19208
19208
|
*/
|
|
19209
19209
|
function measureGrapheme(grapheme, options, ctx) {
|
|
19210
19210
|
// Check cache first
|
|
@@ -19237,8 +19237,8 @@
|
|
|
19237
19237
|
return measurement;
|
|
19238
19238
|
}
|
|
19239
19239
|
|
|
19240
|
-
/**
|
|
19241
|
-
* Measure a grapheme with kerning relative to previous character
|
|
19240
|
+
/**
|
|
19241
|
+
* Measure a grapheme with kerning relative to previous character
|
|
19242
19242
|
*/
|
|
19243
19243
|
function measureGraphemeWithKerning(grapheme, previousGrapheme, options, ctx) {
|
|
19244
19244
|
// Get individual measurement
|
|
@@ -19279,9 +19279,9 @@
|
|
|
19279
19279
|
};
|
|
19280
19280
|
}
|
|
19281
19281
|
|
|
19282
|
-
/**
|
|
19283
|
-
* Get a representative character for font metrics measurement
|
|
19284
|
-
* Uses canvas to test which scripts the font actually supports
|
|
19282
|
+
/**
|
|
19283
|
+
* Get a representative character for font metrics measurement
|
|
19284
|
+
* Uses canvas to test which scripts the font actually supports
|
|
19285
19285
|
*/
|
|
19286
19286
|
function getRepresentativeCharacter(fontFamily) {
|
|
19287
19287
|
const context = getMeasurementContext();
|
|
@@ -19370,8 +19370,8 @@
|
|
|
19370
19370
|
return 'M';
|
|
19371
19371
|
}
|
|
19372
19372
|
|
|
19373
|
-
/**
|
|
19374
|
-
* Get font metrics for layout calculations
|
|
19373
|
+
/**
|
|
19374
|
+
* Get font metrics for layout calculations
|
|
19375
19375
|
*/
|
|
19376
19376
|
function getFontMetrics(options) {
|
|
19377
19377
|
var _metrics$fontBounding, _metrics$fontBounding2, _metrics$actualBoundi, _metrics$actualBoundi2;
|
|
@@ -19407,8 +19407,8 @@
|
|
|
19407
19407
|
return result;
|
|
19408
19408
|
}
|
|
19409
19409
|
|
|
19410
|
-
/**
|
|
19411
|
-
* Apply font styling to canvas context
|
|
19410
|
+
/**
|
|
19411
|
+
* Apply font styling to canvas context
|
|
19412
19412
|
*/
|
|
19413
19413
|
function applyFontStyle(ctx, options) {
|
|
19414
19414
|
const fontDeclaration = getFontDeclaration(options);
|
|
@@ -19425,8 +19425,8 @@
|
|
|
19425
19425
|
ctx.textBaseline = 'alphabetic';
|
|
19426
19426
|
}
|
|
19427
19427
|
|
|
19428
|
-
/**
|
|
19429
|
-
* Generate font declaration string
|
|
19428
|
+
/**
|
|
19429
|
+
* Generate font declaration string
|
|
19430
19430
|
*/
|
|
19431
19431
|
function getFontDeclaration(options) {
|
|
19432
19432
|
const {
|
|
@@ -19445,8 +19445,8 @@
|
|
|
19445
19445
|
return `${fontStyle} ${fontWeight} ${fontSize}px ${normalizedFamily}`;
|
|
19446
19446
|
}
|
|
19447
19447
|
|
|
19448
|
-
/**
|
|
19449
|
-
* LRU Cache implementation for measurements
|
|
19448
|
+
/**
|
|
19449
|
+
* LRU Cache implementation for measurements
|
|
19450
19450
|
*/
|
|
19451
19451
|
class LRUCache {
|
|
19452
19452
|
constructor() {
|
|
@@ -19508,8 +19508,8 @@
|
|
|
19508
19508
|
}
|
|
19509
19509
|
}
|
|
19510
19510
|
|
|
19511
|
-
/**
|
|
19512
|
-
* Advanced measurement cache with font-aware keys
|
|
19511
|
+
/**
|
|
19512
|
+
* Advanced measurement cache with font-aware keys
|
|
19513
19513
|
*/
|
|
19514
19514
|
class MeasurementCache {
|
|
19515
19515
|
constructor() {
|
|
@@ -19536,8 +19536,8 @@
|
|
|
19536
19536
|
}
|
|
19537
19537
|
}
|
|
19538
19538
|
|
|
19539
|
-
/**
|
|
19540
|
-
* Kerning cache for character pairs
|
|
19539
|
+
/**
|
|
19540
|
+
* Kerning cache for character pairs
|
|
19541
19541
|
*/
|
|
19542
19542
|
class KerningCache {
|
|
19543
19543
|
constructor() {
|
|
@@ -19565,8 +19565,8 @@
|
|
|
19565
19565
|
}
|
|
19566
19566
|
}
|
|
19567
19567
|
|
|
19568
|
-
/**
|
|
19569
|
-
* Font metrics cache
|
|
19568
|
+
/**
|
|
19569
|
+
* Font metrics cache
|
|
19570
19570
|
*/
|
|
19571
19571
|
class FontMetricsCache {
|
|
19572
19572
|
constructor() {
|
|
@@ -19601,8 +19601,8 @@
|
|
|
19601
19601
|
});
|
|
19602
19602
|
}
|
|
19603
19603
|
|
|
19604
|
-
/**
|
|
19605
|
-
* Clear all measurement caches
|
|
19604
|
+
/**
|
|
19605
|
+
* Clear all measurement caches
|
|
19606
19606
|
*/
|
|
19607
19607
|
function clearAllCaches() {
|
|
19608
19608
|
measurementCache.clear();
|
|
@@ -19610,9 +19610,9 @@
|
|
|
19610
19610
|
fontMetricsCache.clear();
|
|
19611
19611
|
}
|
|
19612
19612
|
|
|
19613
|
-
/**
|
|
19614
|
-
* Detect if a font lacks English glyph support
|
|
19615
|
-
* These fonts should use browser-native measurement instead of Fabric's character-by-character measurement
|
|
19613
|
+
/**
|
|
19614
|
+
* Detect if a font lacks English glyph support
|
|
19615
|
+
* These fonts should use browser-native measurement instead of Fabric's character-by-character measurement
|
|
19616
19616
|
*/
|
|
19617
19617
|
function fontLacksEnglishGlyphs(fontFamily) {
|
|
19618
19618
|
if (typeof document === 'undefined') return false;
|
|
@@ -19656,8 +19656,8 @@
|
|
|
19656
19656
|
// Cache for font glyph detection results
|
|
19657
19657
|
const fontGlyphCache = new Map();
|
|
19658
19658
|
|
|
19659
|
-
/**
|
|
19660
|
-
* Cached version of font glyph detection
|
|
19659
|
+
/**
|
|
19660
|
+
* Cached version of font glyph detection
|
|
19661
19661
|
*/
|
|
19662
19662
|
function fontLacksEnglishGlyphsCached(fontFamily) {
|
|
19663
19663
|
if (fontGlyphCache.has(fontFamily)) {
|
|
@@ -19668,17 +19668,17 @@
|
|
|
19668
19668
|
return result;
|
|
19669
19669
|
}
|
|
19670
19670
|
|
|
19671
|
-
/**
|
|
19672
|
-
* Unicode and Internationalization Support
|
|
19673
|
-
*
|
|
19674
|
-
* Enhanced Unicode handling for complex scripts, RTL/LTR text,
|
|
19675
|
-
* and grapheme cluster boundary detection.
|
|
19671
|
+
/**
|
|
19672
|
+
* Unicode and Internationalization Support
|
|
19673
|
+
*
|
|
19674
|
+
* Enhanced Unicode handling for complex scripts, RTL/LTR text,
|
|
19675
|
+
* and grapheme cluster boundary detection.
|
|
19676
19676
|
*/
|
|
19677
19677
|
|
|
19678
19678
|
|
|
19679
|
-
/**
|
|
19680
|
-
* Enhanced grapheme segmentation using Intl.Segmenter when available
|
|
19681
|
-
* with fallback to existing graphemeSplit implementation
|
|
19679
|
+
/**
|
|
19680
|
+
* Enhanced grapheme segmentation using Intl.Segmenter when available
|
|
19681
|
+
* with fallback to existing graphemeSplit implementation
|
|
19682
19682
|
*/
|
|
19683
19683
|
function segmentGraphemes(text) {
|
|
19684
19684
|
// Use native Intl.Segmenter if available
|
|
@@ -19698,15 +19698,15 @@
|
|
|
19698
19698
|
return graphemeSplit(text);
|
|
19699
19699
|
}
|
|
19700
19700
|
|
|
19701
|
-
/**
|
|
19702
|
-
* Ellipsis Text Truncation System
|
|
19703
|
-
*
|
|
19704
|
-
* Implements text truncation with ellipsis when content exceeds bounds,
|
|
19705
|
-
* using binary search for optimal truncation points.
|
|
19701
|
+
/**
|
|
19702
|
+
* Ellipsis Text Truncation System
|
|
19703
|
+
*
|
|
19704
|
+
* Implements text truncation with ellipsis when content exceeds bounds,
|
|
19705
|
+
* using binary search for optimal truncation points.
|
|
19706
19706
|
*/
|
|
19707
19707
|
|
|
19708
|
-
/**
|
|
19709
|
-
* Apply ellipsis truncation to text based on width/height constraints
|
|
19708
|
+
/**
|
|
19709
|
+
* Apply ellipsis truncation to text based on width/height constraints
|
|
19710
19710
|
*/
|
|
19711
19711
|
function applyEllipsis(text, options) {
|
|
19712
19712
|
const {
|
|
@@ -19776,8 +19776,8 @@
|
|
|
19776
19776
|
};
|
|
19777
19777
|
}
|
|
19778
19778
|
|
|
19779
|
-
/**
|
|
19780
|
-
* Truncate text based on width constraint using binary search
|
|
19779
|
+
/**
|
|
19780
|
+
* Truncate text based on width constraint using binary search
|
|
19781
19781
|
*/
|
|
19782
19782
|
function truncateByWidth(text, maxWidth, ellipsisChar, ellipsisWidth, measureFn) {
|
|
19783
19783
|
const graphemes = segmentGraphemes(text);
|
|
@@ -19827,8 +19827,8 @@
|
|
|
19827
19827
|
};
|
|
19828
19828
|
}
|
|
19829
19829
|
|
|
19830
|
-
/**
|
|
19831
|
-
* Truncate text based on height constraint
|
|
19830
|
+
/**
|
|
19831
|
+
* Truncate text based on height constraint
|
|
19832
19832
|
*/
|
|
19833
19833
|
function truncateByHeight(text, maxHeight, ellipsisChar, measureFn) {
|
|
19834
19834
|
var _measureFn;
|
|
@@ -19876,19 +19876,19 @@
|
|
|
19876
19876
|
return truncateByWidth(lines[0], firstLineWidth, ellipsisChar, 0, measureFn);
|
|
19877
19877
|
}
|
|
19878
19878
|
|
|
19879
|
-
/**
|
|
19880
|
-
* Core Text Layout Engine
|
|
19881
|
-
*
|
|
19882
|
-
* Implements Konva-compatible text layout with support for:
|
|
19883
|
-
* - Multiple wrap modes (word/char/none)
|
|
19884
|
-
* - Ellipsis truncation
|
|
19885
|
-
* - Justify alignment with proper space distribution
|
|
19886
|
-
* - RTL/LTR text direction
|
|
19887
|
-
* - Advanced grapheme handling
|
|
19879
|
+
/**
|
|
19880
|
+
* Core Text Layout Engine
|
|
19881
|
+
*
|
|
19882
|
+
* Implements Konva-compatible text layout with support for:
|
|
19883
|
+
* - Multiple wrap modes (word/char/none)
|
|
19884
|
+
* - Ellipsis truncation
|
|
19885
|
+
* - Justify alignment with proper space distribution
|
|
19886
|
+
* - RTL/LTR text direction
|
|
19887
|
+
* - Advanced grapheme handling
|
|
19888
19888
|
*/
|
|
19889
19889
|
|
|
19890
|
-
/**
|
|
19891
|
-
* Main text layout function - converts text and options into positioned layout
|
|
19890
|
+
/**
|
|
19891
|
+
* Main text layout function - converts text and options into positioned layout
|
|
19892
19892
|
*/
|
|
19893
19893
|
function layoutText(options) {
|
|
19894
19894
|
var _ellipsisResult;
|
|
@@ -20007,8 +20007,8 @@
|
|
|
20007
20007
|
};
|
|
20008
20008
|
}
|
|
20009
20009
|
|
|
20010
|
-
/**
|
|
20011
|
-
* Layout a single paragraph with wrapping
|
|
20010
|
+
/**
|
|
20011
|
+
* Layout a single paragraph with wrapping
|
|
20012
20012
|
*/
|
|
20013
20013
|
function layoutParagraph(text, options) {
|
|
20014
20014
|
const {
|
|
@@ -20043,8 +20043,8 @@
|
|
|
20043
20043
|
return layoutLines;
|
|
20044
20044
|
}
|
|
20045
20045
|
|
|
20046
|
-
/**
|
|
20047
|
-
* Layout a single line of text (no wrapping)
|
|
20046
|
+
/**
|
|
20047
|
+
* Layout a single line of text (no wrapping)
|
|
20048
20048
|
*/
|
|
20049
20049
|
function layoutSingleLine(text, options) {
|
|
20050
20050
|
let textOffset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
@@ -20114,8 +20114,8 @@
|
|
|
20114
20114
|
};
|
|
20115
20115
|
}
|
|
20116
20116
|
|
|
20117
|
-
/**
|
|
20118
|
-
* Word-based wrapping algorithm
|
|
20117
|
+
/**
|
|
20118
|
+
* Word-based wrapping algorithm
|
|
20119
20119
|
*/
|
|
20120
20120
|
function wrapByWords(text, maxWidth, options) {
|
|
20121
20121
|
const lines = [];
|
|
@@ -20148,8 +20148,8 @@
|
|
|
20148
20148
|
return lines.length > 0 ? lines : [''];
|
|
20149
20149
|
}
|
|
20150
20150
|
|
|
20151
|
-
/**
|
|
20152
|
-
* Character-based wrapping algorithm
|
|
20151
|
+
/**
|
|
20152
|
+
* Character-based wrapping algorithm
|
|
20153
20153
|
*/
|
|
20154
20154
|
function wrapByCharacters(text, maxWidth, options) {
|
|
20155
20155
|
const lines = [];
|
|
@@ -20171,8 +20171,8 @@
|
|
|
20171
20171
|
return lines.length > 0 ? lines : [''];
|
|
20172
20172
|
}
|
|
20173
20173
|
|
|
20174
|
-
/**
|
|
20175
|
-
* Apply text alignment to lines
|
|
20174
|
+
/**
|
|
20175
|
+
* Apply text alignment to lines
|
|
20176
20176
|
*/
|
|
20177
20177
|
function applyAlignment(lines, align, containerWidth, options) {
|
|
20178
20178
|
return lines.map(line => {
|
|
@@ -20206,8 +20206,8 @@
|
|
|
20206
20206
|
});
|
|
20207
20207
|
}
|
|
20208
20208
|
|
|
20209
|
-
/**
|
|
20210
|
-
* Apply justify alignment by expanding spaces
|
|
20209
|
+
/**
|
|
20210
|
+
* Apply justify alignment by expanding spaces
|
|
20211
20211
|
*/
|
|
20212
20212
|
function applyJustification(line, containerWidth, options) {
|
|
20213
20213
|
const spaces = line.graphemes.filter(g => /\s/.test(g)).length;
|
|
@@ -20230,8 +20230,8 @@
|
|
|
20230
20230
|
return line;
|
|
20231
20231
|
}
|
|
20232
20232
|
|
|
20233
|
-
/**
|
|
20234
|
-
* Calculate vertical alignment offset
|
|
20233
|
+
/**
|
|
20234
|
+
* Calculate vertical alignment offset
|
|
20235
20235
|
*/
|
|
20236
20236
|
function calculateVerticalOffset(contentHeight, containerHeight, align) {
|
|
20237
20237
|
switch (align) {
|
|
@@ -20245,8 +20245,8 @@
|
|
|
20245
20245
|
}
|
|
20246
20246
|
}
|
|
20247
20247
|
|
|
20248
|
-
/**
|
|
20249
|
-
* Handle height overflow with ellipsis
|
|
20248
|
+
/**
|
|
20249
|
+
* Handle height overflow with ellipsis
|
|
20250
20250
|
*/
|
|
20251
20251
|
function handleHeightOverflow(existingLines, overflowLine, remainingHeight, options) {
|
|
20252
20252
|
// If ellipsis is enabled, try to fit part of the overflow line
|
|
@@ -20275,8 +20275,8 @@
|
|
|
20275
20275
|
};
|
|
20276
20276
|
}
|
|
20277
20277
|
|
|
20278
|
-
/**
|
|
20279
|
-
* Create empty line for empty paragraphs
|
|
20278
|
+
/**
|
|
20279
|
+
* Create empty line for empty paragraphs
|
|
20280
20280
|
*/
|
|
20281
20281
|
function createEmptyLine(options) {
|
|
20282
20282
|
const height = options.fontSize * options.lineHeight;
|
|
@@ -20292,8 +20292,8 @@
|
|
|
20292
20292
|
};
|
|
20293
20293
|
}
|
|
20294
20294
|
|
|
20295
|
-
/**
|
|
20296
|
-
* Measure width of a line of text
|
|
20295
|
+
/**
|
|
20296
|
+
* Measure width of a line of text
|
|
20297
20297
|
*/
|
|
20298
20298
|
function measureLineWidth(text, options) {
|
|
20299
20299
|
const graphemes = segmentGraphemes(text);
|
|
@@ -20310,8 +20310,8 @@
|
|
|
20310
20310
|
return width;
|
|
20311
20311
|
}
|
|
20312
20312
|
|
|
20313
|
-
/**
|
|
20314
|
-
* Convert layout options to measurement options
|
|
20313
|
+
/**
|
|
20314
|
+
* Convert layout options to measurement options
|
|
20315
20315
|
*/
|
|
20316
20316
|
function createMeasurementOptions(options) {
|
|
20317
20317
|
return {
|
|
@@ -20554,15 +20554,15 @@
|
|
|
20554
20554
|
}
|
|
20555
20555
|
}
|
|
20556
20556
|
|
|
20557
|
-
/**
|
|
20558
|
-
* Browser Line Break Extraction
|
|
20559
|
-
*
|
|
20560
|
-
* Captures exact line breaks as rendered by the browser to ensure
|
|
20561
|
-
* pixel-perfect consistency between DOM editing and canvas rendering.
|
|
20557
|
+
/**
|
|
20558
|
+
* Browser Line Break Extraction
|
|
20559
|
+
*
|
|
20560
|
+
* Captures exact line breaks as rendered by the browser to ensure
|
|
20561
|
+
* pixel-perfect consistency between DOM editing and canvas rendering.
|
|
20562
20562
|
*/
|
|
20563
20563
|
|
|
20564
|
-
/**
|
|
20565
|
-
* Segment text into graphemes safely using Intl.Segmenter or fallback
|
|
20564
|
+
/**
|
|
20565
|
+
* Segment text into graphemes safely using Intl.Segmenter or fallback
|
|
20566
20566
|
*/
|
|
20567
20567
|
function segmentIntoGraphemes(text) {
|
|
20568
20568
|
if (typeof Intl !== 'undefined' && Intl.Segmenter) {
|
|
@@ -20576,9 +20576,9 @@
|
|
|
20576
20576
|
return Array.from(text);
|
|
20577
20577
|
}
|
|
20578
20578
|
|
|
20579
|
-
/**
|
|
20580
|
-
* Extract line break information from a textarea by creating a mirror element
|
|
20581
|
-
* with identical computed styles and measuring grapheme positions.
|
|
20579
|
+
/**
|
|
20580
|
+
* Extract line break information from a textarea by creating a mirror element
|
|
20581
|
+
* with identical computed styles and measuring grapheme positions.
|
|
20582
20582
|
*/
|
|
20583
20583
|
function extractLinesFromDOM(textarea) {
|
|
20584
20584
|
const text = textarea.value;
|
|
@@ -20586,7 +20586,8 @@
|
|
|
20586
20586
|
return {
|
|
20587
20587
|
lines: [],
|
|
20588
20588
|
totalWidth: 0,
|
|
20589
|
-
totalHeight: 0
|
|
20589
|
+
totalHeight: 0,
|
|
20590
|
+
width: 0
|
|
20590
20591
|
};
|
|
20591
20592
|
}
|
|
20592
20593
|
|
|
@@ -20615,6 +20616,8 @@
|
|
|
20615
20616
|
mirror.style.overflow = 'hidden';
|
|
20616
20617
|
mirror.style.resize = 'none';
|
|
20617
20618
|
container.appendChild(mirror);
|
|
20619
|
+
// capture the width the browser is using for layout
|
|
20620
|
+
const width = mirror.clientWidth;
|
|
20618
20621
|
try {
|
|
20619
20622
|
// Segment text into graphemes
|
|
20620
20623
|
const graphemes = segmentIntoGraphemes(text);
|
|
@@ -20665,7 +20668,8 @@
|
|
|
20665
20668
|
return {
|
|
20666
20669
|
lines,
|
|
20667
20670
|
totalWidth,
|
|
20668
|
-
totalHeight
|
|
20671
|
+
totalHeight,
|
|
20672
|
+
width
|
|
20669
20673
|
};
|
|
20670
20674
|
} finally {
|
|
20671
20675
|
// Clean up mirror element
|
|
@@ -20673,16 +20677,16 @@
|
|
|
20673
20677
|
}
|
|
20674
20678
|
}
|
|
20675
20679
|
|
|
20676
|
-
/**
|
|
20677
|
-
* Create a hash of layout-affecting properties to detect when browser lines are still valid
|
|
20680
|
+
/**
|
|
20681
|
+
* Create a hash of layout-affecting properties to detect when browser lines are still valid
|
|
20678
20682
|
*/
|
|
20679
20683
|
function createLayoutHash(target) {
|
|
20680
20684
|
const properties = [target.text, target.width, target.height, target.fontFamily, target.fontSize, target.fontWeight, target.fontStyle, target.lineHeight, target.charSpacing, target.textAlign, target.direction];
|
|
20681
20685
|
return properties.map(p => String(p)).join('|');
|
|
20682
20686
|
}
|
|
20683
20687
|
|
|
20684
|
-
/**
|
|
20685
|
-
* Check if stored browser lines are still valid for the current target state
|
|
20688
|
+
/**
|
|
20689
|
+
* Check if stored browser lines are still valid for the current target state
|
|
20686
20690
|
*/
|
|
20687
20691
|
function areBrowserLinesValid(target, storedHash) {
|
|
20688
20692
|
if (!storedHash || !target.__lastBrowserLines) {
|
|
@@ -20691,40 +20695,46 @@
|
|
|
20691
20695
|
const currentHash = createLayoutHash(target);
|
|
20692
20696
|
return currentHash === storedHash;
|
|
20693
20697
|
}
|
|
20694
|
-
|
|
20695
|
-
|
|
20696
|
-
* Store browser lines on a target object with validity hash
|
|
20698
|
+
/**
|
|
20699
|
+
* Store browser lines on a target object with validity hash
|
|
20697
20700
|
*/
|
|
20698
|
-
function storeBrowserLines(target, lines, layoutHash) {
|
|
20701
|
+
function storeBrowserLines(target, lines, width, layoutHash) {
|
|
20699
20702
|
target.__lastBrowserLines = lines;
|
|
20703
|
+
target.__lastBrowserLinesWidth = width;
|
|
20700
20704
|
target.__lastBrowserLinesHash = createLayoutHash(target);
|
|
20701
20705
|
}
|
|
20702
20706
|
|
|
20703
|
-
/**
|
|
20704
|
-
* Clear stored browser lines from a target object
|
|
20707
|
+
/**
|
|
20708
|
+
* Clear stored browser lines from a target object
|
|
20705
20709
|
*/
|
|
20706
20710
|
function clearBrowserLines(target) {
|
|
20707
20711
|
delete target.__lastBrowserLines;
|
|
20708
20712
|
delete target.__lastBrowserLinesHash;
|
|
20713
|
+
delete target.__lastBrowserLinesWidth;
|
|
20709
20714
|
}
|
|
20710
20715
|
|
|
20711
|
-
/**
|
|
20712
|
-
* Get stored browser lines if they're still valid
|
|
20716
|
+
/**
|
|
20717
|
+
* Get stored browser lines if they're still valid
|
|
20713
20718
|
*/
|
|
20714
20719
|
function getBrowserLines(target) {
|
|
20715
20720
|
const lines = target.__lastBrowserLines;
|
|
20716
20721
|
const hash = target.__lastBrowserLinesHash;
|
|
20717
20722
|
if (lines && areBrowserLinesValid(target, hash)) {
|
|
20718
|
-
return
|
|
20723
|
+
return {
|
|
20724
|
+
lines,
|
|
20725
|
+
totalWidth: 0,
|
|
20726
|
+
totalHeight: 0,
|
|
20727
|
+
width: target.__lastBrowserLinesWidth
|
|
20728
|
+
};
|
|
20719
20729
|
}
|
|
20720
20730
|
return null;
|
|
20721
20731
|
}
|
|
20722
20732
|
|
|
20723
20733
|
let measuringContext;
|
|
20724
20734
|
|
|
20725
|
-
/**
|
|
20726
|
-
* Return a context for measurement of text string.
|
|
20727
|
-
* if created it gets stored for reuse
|
|
20735
|
+
/**
|
|
20736
|
+
* Return a context for measurement of text string.
|
|
20737
|
+
* if created it gets stored for reuse
|
|
20728
20738
|
*/
|
|
20729
20739
|
function getMeasuringContext() {
|
|
20730
20740
|
if (!measuringContext) {
|
|
@@ -20737,17 +20747,17 @@
|
|
|
20737
20747
|
return measuringContext;
|
|
20738
20748
|
}
|
|
20739
20749
|
|
|
20740
|
-
/**
|
|
20741
|
-
* Measure and return the info of a single grapheme.
|
|
20742
|
-
* needs the the info of previous graphemes already filled
|
|
20743
|
-
* Override to customize measuring
|
|
20750
|
+
/**
|
|
20751
|
+
* Measure and return the info of a single grapheme.
|
|
20752
|
+
* needs the the info of previous graphemes already filled
|
|
20753
|
+
* Override to customize measuring
|
|
20744
20754
|
*/
|
|
20745
20755
|
|
|
20746
20756
|
// @TODO this is not complete
|
|
20747
20757
|
|
|
20748
|
-
/**
|
|
20749
|
-
* Text class
|
|
20750
|
-
* @see {@link http://fabricjs.com/fabric-intro-part-2#text}
|
|
20758
|
+
/**
|
|
20759
|
+
* Text class
|
|
20760
|
+
* @see {@link http://fabricjs.com/fabric-intro-part-2#text}
|
|
20751
20761
|
*/
|
|
20752
20762
|
class FabricText extends StyledText {
|
|
20753
20763
|
static getDefaults() {
|
|
@@ -20758,11 +20768,11 @@
|
|
|
20758
20768
|
}
|
|
20759
20769
|
constructor(text, options) {
|
|
20760
20770
|
super();
|
|
20761
|
-
/**
|
|
20762
|
-
* contains characters bounding boxes
|
|
20763
|
-
* This variable is considered to be protected.
|
|
20764
|
-
* But for how mixins are implemented right now, we can't leave it private
|
|
20765
|
-
* @protected
|
|
20771
|
+
/**
|
|
20772
|
+
* contains characters bounding boxes
|
|
20773
|
+
* This variable is considered to be protected.
|
|
20774
|
+
* But for how mixins are implemented right now, we can't leave it private
|
|
20775
|
+
* @protected
|
|
20766
20776
|
*/
|
|
20767
20777
|
_defineProperty(this, "__charBounds", []);
|
|
20768
20778
|
Object.assign(this, FabricText.ownDefaults);
|
|
@@ -20779,9 +20789,9 @@
|
|
|
20779
20789
|
this.setCoords();
|
|
20780
20790
|
}
|
|
20781
20791
|
|
|
20782
|
-
/**
|
|
20783
|
-
* If text has a path, it will add the extra information needed
|
|
20784
|
-
* for path and text calculations
|
|
20792
|
+
/**
|
|
20793
|
+
* If text has a path, it will add the extra information needed
|
|
20794
|
+
* for path and text calculations
|
|
20785
20795
|
*/
|
|
20786
20796
|
setPathInfo() {
|
|
20787
20797
|
const path = this.path;
|
|
@@ -20790,16 +20800,24 @@
|
|
|
20790
20800
|
}
|
|
20791
20801
|
}
|
|
20792
20802
|
|
|
20793
|
-
/**
|
|
20794
|
-
* @private
|
|
20795
|
-
* Divides text into lines of text and lines of graphemes.
|
|
20796
|
-
* Uses browser lines when available for pixel-perfect consistency.
|
|
20803
|
+
/**
|
|
20804
|
+
* @private
|
|
20805
|
+
* Divides text into lines of text and lines of graphemes.
|
|
20806
|
+
* Uses browser lines when available for pixel-perfect consistency.
|
|
20797
20807
|
*/
|
|
20798
20808
|
_splitText() {
|
|
20799
|
-
//
|
|
20800
|
-
|
|
20801
|
-
|
|
20802
|
-
|
|
20809
|
+
// For justify text with overlay editing, always use normal fabric wrapping
|
|
20810
|
+
if (this.textAlign.includes('justify') && this.useOverlayEditing) {
|
|
20811
|
+
console.log('🧹 JUSTIFY OVERLAY: Using fabric wrapping');
|
|
20812
|
+
this.__lastBrowserLines = null;
|
|
20813
|
+
this.__lastBrowserLinesHash = null;
|
|
20814
|
+
} else {
|
|
20815
|
+
// Check if we have valid browser lines for non-justify text
|
|
20816
|
+
const browserLinesInfo = getBrowserLines(this);
|
|
20817
|
+
if (browserLinesInfo && this.useOverlayEditing) {
|
|
20818
|
+
this._browserWrappingWidth = browserLinesInfo.width;
|
|
20819
|
+
return this._splitTextFromBrowserLines(browserLinesInfo.lines);
|
|
20820
|
+
}
|
|
20803
20821
|
}
|
|
20804
20822
|
const newLines = this._splitTextIntoLines(this.text);
|
|
20805
20823
|
this.textLines = newLines.lines;
|
|
@@ -20809,9 +20827,9 @@
|
|
|
20809
20827
|
return newLines;
|
|
20810
20828
|
}
|
|
20811
20829
|
|
|
20812
|
-
/**
|
|
20813
|
-
* Create TextLinesInfo from browser-extracted lines
|
|
20814
|
-
* @private
|
|
20830
|
+
/**
|
|
20831
|
+
* Create TextLinesInfo from browser-extracted lines
|
|
20832
|
+
* @private
|
|
20815
20833
|
*/
|
|
20816
20834
|
_splitTextFromBrowserLines(browserLines) {
|
|
20817
20835
|
const lines = [];
|
|
@@ -20845,10 +20863,10 @@
|
|
|
20845
20863
|
return result;
|
|
20846
20864
|
}
|
|
20847
20865
|
|
|
20848
|
-
/**
|
|
20849
|
-
* Initialize or update text dimensions.
|
|
20850
|
-
* Updates this.width and this.height with the proper values.
|
|
20851
|
-
* Does not return dimensions.
|
|
20866
|
+
/**
|
|
20867
|
+
* Initialize or update text dimensions.
|
|
20868
|
+
* Updates this.width and this.height with the proper values.
|
|
20869
|
+
* Does not return dimensions.
|
|
20852
20870
|
*/
|
|
20853
20871
|
initDimensions() {
|
|
20854
20872
|
// Check if font is ready for accurate measurements
|
|
@@ -20894,24 +20912,29 @@
|
|
|
20894
20912
|
}
|
|
20895
20913
|
}
|
|
20896
20914
|
|
|
20897
|
-
/**
|
|
20898
|
-
* Enlarge space boxes and shift the others
|
|
20915
|
+
/**
|
|
20916
|
+
* Enlarge space boxes and shift the others
|
|
20899
20917
|
*/
|
|
20900
20918
|
enlargeSpaces() {
|
|
20901
20919
|
let diffSpace, currentLineWidth, numberOfSpaces, accumulatedSpace, line, charBound, spaces;
|
|
20902
20920
|
const isRtl = this.direction === 'rtl';
|
|
20921
|
+
// use browser wrapping width if available
|
|
20922
|
+
const justificationWidth = this._browserWrappingWidth || this.width;
|
|
20923
|
+
if (this._browserWrappingWidth) {
|
|
20924
|
+
this._browserWrappingWidth = undefined;
|
|
20925
|
+
}
|
|
20903
20926
|
for (let i = 0, len = this._textLines.length; i < len; i++) {
|
|
20904
|
-
if (!this.textAlign.includes('justify')
|
|
20927
|
+
if (!this.textAlign.includes('justify') || i === len - 1 || this.isEndOfWrapping(i)) {
|
|
20905
20928
|
continue;
|
|
20906
20929
|
}
|
|
20907
20930
|
accumulatedSpace = 0;
|
|
20908
20931
|
line = this._textLines[i];
|
|
20909
20932
|
currentLineWidth = this.getLineWidth(i);
|
|
20910
|
-
if (currentLineWidth <
|
|
20933
|
+
if (currentLineWidth < justificationWidth && (spaces = this.textLines[i].match(this._reSpacesAndTabs))) {
|
|
20911
20934
|
numberOfSpaces = spaces.length;
|
|
20912
|
-
diffSpace = (
|
|
20935
|
+
diffSpace = (justificationWidth - currentLineWidth) / numberOfSpaces;
|
|
20913
20936
|
console.log(`🔧 EnlargeSpaces Line ${i}:`);
|
|
20914
|
-
console.log(` Current width: ${currentLineWidth}, Target: ${
|
|
20937
|
+
console.log(` Current width: ${currentLineWidth}, Target: ${justificationWidth}`);
|
|
20915
20938
|
console.log(` Spaces: ${numberOfSpaces}, diffSpace: ${diffSpace.toFixed(2)}`);
|
|
20916
20939
|
if (isRtl) {
|
|
20917
20940
|
for (let j = 0; j < line.length; j++) {
|
|
@@ -20957,18 +20980,18 @@
|
|
|
20957
20980
|
}
|
|
20958
20981
|
}
|
|
20959
20982
|
|
|
20960
|
-
/**
|
|
20961
|
-
* Advanced layout using new text engine (Konva-compatible)
|
|
20962
|
-
* @private
|
|
20983
|
+
/**
|
|
20984
|
+
* Advanced layout using new text engine (Konva-compatible)
|
|
20985
|
+
* @private
|
|
20963
20986
|
*/
|
|
20964
20987
|
_layoutTextAdvanced() {
|
|
20965
20988
|
const options = this._getAdvancedLayoutOptions();
|
|
20966
20989
|
return layoutText(options);
|
|
20967
20990
|
}
|
|
20968
20991
|
|
|
20969
|
-
/**
|
|
20970
|
-
* Get advanced layout options from current text properties
|
|
20971
|
-
* @private
|
|
20992
|
+
/**
|
|
20993
|
+
* Get advanced layout options from current text properties
|
|
20994
|
+
* @private
|
|
20972
20995
|
*/
|
|
20973
20996
|
_getAdvancedLayoutOptions() {
|
|
20974
20997
|
return {
|
|
@@ -20990,9 +21013,9 @@
|
|
|
20990
21013
|
};
|
|
20991
21014
|
}
|
|
20992
21015
|
|
|
20993
|
-
/**
|
|
20994
|
-
* Map Fabric textAlign to Konva align format
|
|
20995
|
-
* @private
|
|
21016
|
+
/**
|
|
21017
|
+
* Map Fabric textAlign to Konva align format
|
|
21018
|
+
* @private
|
|
20996
21019
|
*/
|
|
20997
21020
|
_mapTextAlignToAlign(textAlign) {
|
|
20998
21021
|
switch (textAlign) {
|
|
@@ -21013,8 +21036,8 @@
|
|
|
21013
21036
|
}
|
|
21014
21037
|
}
|
|
21015
21038
|
|
|
21016
|
-
/**
|
|
21017
|
-
* Enhanced initDimensions that uses advanced layout when enabled
|
|
21039
|
+
/**
|
|
21040
|
+
* Enhanced initDimensions that uses advanced layout when enabled
|
|
21018
21041
|
*/
|
|
21019
21042
|
initDimensionsAdvanced() {
|
|
21020
21043
|
if (!this.enableAdvancedLayout) {
|
|
@@ -21043,9 +21066,9 @@
|
|
|
21043
21066
|
this.dirty = true;
|
|
21044
21067
|
}
|
|
21045
21068
|
|
|
21046
|
-
/**
|
|
21047
|
-
* Convert new layout format to legacy _textLines and __charBounds format
|
|
21048
|
-
* @private
|
|
21069
|
+
/**
|
|
21070
|
+
* Convert new layout format to legacy _textLines and __charBounds format
|
|
21071
|
+
* @private
|
|
21049
21072
|
*/
|
|
21050
21073
|
_convertLayoutToLegacyFormat(layout) {
|
|
21051
21074
|
this._textLines = layout.lines.map(line => line.graphemes);
|
|
@@ -21067,30 +21090,30 @@
|
|
|
21067
21090
|
}
|
|
21068
21091
|
}
|
|
21069
21092
|
|
|
21070
|
-
/**
|
|
21071
|
-
* Detect if the text line is ended with an hard break
|
|
21072
|
-
* text and itext do not have wrapping, return false
|
|
21073
|
-
* @return {Boolean}
|
|
21093
|
+
/**
|
|
21094
|
+
* Detect if the text line is ended with an hard break
|
|
21095
|
+
* text and itext do not have wrapping, return false
|
|
21096
|
+
* @return {Boolean}
|
|
21074
21097
|
*/
|
|
21075
21098
|
isEndOfWrapping(lineIndex) {
|
|
21076
21099
|
return lineIndex === this._textLines.length - 1;
|
|
21077
21100
|
}
|
|
21078
21101
|
|
|
21079
|
-
/**
|
|
21080
|
-
* Detect if a line has a linebreak and so we need to account for it when moving
|
|
21081
|
-
* and counting style.
|
|
21082
|
-
* It return always 1 for text and Itext. Textbox has its own implementation
|
|
21083
|
-
* @return Number
|
|
21102
|
+
/**
|
|
21103
|
+
* Detect if a line has a linebreak and so we need to account for it when moving
|
|
21104
|
+
* and counting style.
|
|
21105
|
+
* It return always 1 for text and Itext. Textbox has its own implementation
|
|
21106
|
+
* @return Number
|
|
21084
21107
|
*/
|
|
21085
21108
|
|
|
21086
21109
|
missingNewlineOffset(_lineIndex) {
|
|
21087
21110
|
return 1;
|
|
21088
21111
|
}
|
|
21089
21112
|
|
|
21090
|
-
/**
|
|
21091
|
-
* Returns 2d representation (lineIndex and charIndex) of cursor
|
|
21092
|
-
* @param {Number} selectionStart
|
|
21093
|
-
* @param {Boolean} [skipWrapping] consider the location for unwrapped lines. useful to manage styles.
|
|
21113
|
+
/**
|
|
21114
|
+
* Returns 2d representation (lineIndex and charIndex) of cursor
|
|
21115
|
+
* @param {Number} selectionStart
|
|
21116
|
+
* @param {Boolean} [skipWrapping] consider the location for unwrapped lines. useful to manage styles.
|
|
21094
21117
|
*/
|
|
21095
21118
|
get2DCursorLocation(selectionStart, skipWrapping) {
|
|
21096
21119
|
const lines = skipWrapping ? this._unwrappedTextLines : this._textLines;
|
|
@@ -21110,24 +21133,24 @@
|
|
|
21110
21133
|
};
|
|
21111
21134
|
}
|
|
21112
21135
|
|
|
21113
|
-
/**
|
|
21114
|
-
* Returns string representation of an instance
|
|
21115
|
-
* @return {String} String representation of text object
|
|
21136
|
+
/**
|
|
21137
|
+
* Returns string representation of an instance
|
|
21138
|
+
* @return {String} String representation of text object
|
|
21116
21139
|
*/
|
|
21117
21140
|
toString() {
|
|
21118
21141
|
return `#<Text (${this.complexity()}): { "text": "${this.text}", "fontFamily": "${this.fontFamily}" }>`;
|
|
21119
21142
|
}
|
|
21120
21143
|
|
|
21121
|
-
/**
|
|
21122
|
-
* Return the dimension and the zoom level needed to create a cache canvas
|
|
21123
|
-
* big enough to host the object to be cached.
|
|
21124
|
-
* @private
|
|
21125
|
-
* @param {Object} dim.x width of object to be cached
|
|
21126
|
-
* @param {Object} dim.y height of object to be cached
|
|
21127
|
-
* @return {Object}.width width of canvas
|
|
21128
|
-
* @return {Object}.height height of canvas
|
|
21129
|
-
* @return {Object}.zoomX zoomX zoom value to unscale the canvas before drawing cache
|
|
21130
|
-
* @return {Object}.zoomY zoomY zoom value to unscale the canvas before drawing cache
|
|
21144
|
+
/**
|
|
21145
|
+
* Return the dimension and the zoom level needed to create a cache canvas
|
|
21146
|
+
* big enough to host the object to be cached.
|
|
21147
|
+
* @private
|
|
21148
|
+
* @param {Object} dim.x width of object to be cached
|
|
21149
|
+
* @param {Object} dim.y height of object to be cached
|
|
21150
|
+
* @return {Object}.width width of canvas
|
|
21151
|
+
* @return {Object}.height height of canvas
|
|
21152
|
+
* @return {Object}.zoomX zoomX zoom value to unscale the canvas before drawing cache
|
|
21153
|
+
* @return {Object}.zoomY zoomY zoom value to unscale the canvas before drawing cache
|
|
21131
21154
|
*/
|
|
21132
21155
|
_getCacheCanvasDimensions() {
|
|
21133
21156
|
const dims = super._getCacheCanvasDimensions();
|
|
@@ -21137,9 +21160,9 @@
|
|
|
21137
21160
|
return dims;
|
|
21138
21161
|
}
|
|
21139
21162
|
|
|
21140
|
-
/**
|
|
21141
|
-
* @private
|
|
21142
|
-
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21163
|
+
/**
|
|
21164
|
+
* @private
|
|
21165
|
+
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21143
21166
|
*/
|
|
21144
21167
|
_render(ctx) {
|
|
21145
21168
|
const path = this.path;
|
|
@@ -21152,9 +21175,9 @@
|
|
|
21152
21175
|
this._renderTextDecoration(ctx, 'linethrough');
|
|
21153
21176
|
}
|
|
21154
21177
|
|
|
21155
|
-
/**
|
|
21156
|
-
* @private
|
|
21157
|
-
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21178
|
+
/**
|
|
21179
|
+
* @private
|
|
21180
|
+
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21158
21181
|
*/
|
|
21159
21182
|
_renderText(ctx) {
|
|
21160
21183
|
// Skip text rendering if in overlay editing mode
|
|
@@ -21170,15 +21193,15 @@
|
|
|
21170
21193
|
}
|
|
21171
21194
|
}
|
|
21172
21195
|
|
|
21173
|
-
/**
|
|
21174
|
-
* Set the font parameter of the context with the object properties or with charStyle
|
|
21175
|
-
* @private
|
|
21176
|
-
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21177
|
-
* @param {Object} [charStyle] object with font style properties
|
|
21178
|
-
* @param {String} [charStyle.fontFamily] Font Family
|
|
21179
|
-
* @param {Number} [charStyle.fontSize] Font size in pixels. ( without px suffix )
|
|
21180
|
-
* @param {String} [charStyle.fontWeight] Font weight
|
|
21181
|
-
* @param {String} [charStyle.fontStyle] Font style (italic|normal)
|
|
21196
|
+
/**
|
|
21197
|
+
* Set the font parameter of the context with the object properties or with charStyle
|
|
21198
|
+
* @private
|
|
21199
|
+
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21200
|
+
* @param {Object} [charStyle] object with font style properties
|
|
21201
|
+
* @param {String} [charStyle.fontFamily] Font Family
|
|
21202
|
+
* @param {Number} [charStyle.fontSize] Font size in pixels. ( without px suffix )
|
|
21203
|
+
* @param {String} [charStyle.fontWeight] Font weight
|
|
21204
|
+
* @param {String} [charStyle.fontStyle] Font style (italic|normal)
|
|
21182
21205
|
*/
|
|
21183
21206
|
_setTextStyles(ctx, charStyle, forMeasuring) {
|
|
21184
21207
|
ctx.textBaseline = 'alphabetic';
|
|
@@ -21198,11 +21221,11 @@
|
|
|
21198
21221
|
ctx.font = this._getFontDeclaration(charStyle, forMeasuring);
|
|
21199
21222
|
}
|
|
21200
21223
|
|
|
21201
|
-
/**
|
|
21202
|
-
* calculate and return the text Width measuring each line.
|
|
21203
|
-
* @private
|
|
21204
|
-
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21205
|
-
* @return {Number} Maximum width of Text object
|
|
21224
|
+
/**
|
|
21225
|
+
* calculate and return the text Width measuring each line.
|
|
21226
|
+
* @private
|
|
21227
|
+
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21228
|
+
* @return {Number} Maximum width of Text object
|
|
21206
21229
|
*/
|
|
21207
21230
|
calcTextWidth() {
|
|
21208
21231
|
let maxWidth = this.getLineWidth(0);
|
|
@@ -21215,23 +21238,23 @@
|
|
|
21215
21238
|
return maxWidth;
|
|
21216
21239
|
}
|
|
21217
21240
|
|
|
21218
|
-
/**
|
|
21219
|
-
* @private
|
|
21220
|
-
* @param {String} method Method name ("fillText" or "strokeText")
|
|
21221
|
-
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21222
|
-
* @param {String} line Text to render
|
|
21223
|
-
* @param {Number} left Left position of text
|
|
21224
|
-
* @param {Number} top Top position of text
|
|
21225
|
-
* @param {Number} lineIndex Index of a line in a text
|
|
21241
|
+
/**
|
|
21242
|
+
* @private
|
|
21243
|
+
* @param {String} method Method name ("fillText" or "strokeText")
|
|
21244
|
+
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21245
|
+
* @param {String} line Text to render
|
|
21246
|
+
* @param {Number} left Left position of text
|
|
21247
|
+
* @param {Number} top Top position of text
|
|
21248
|
+
* @param {Number} lineIndex Index of a line in a text
|
|
21226
21249
|
*/
|
|
21227
21250
|
_renderTextLine(method, ctx, line, left, top, lineIndex) {
|
|
21228
21251
|
this._renderChars(method, ctx, line, left, top, lineIndex);
|
|
21229
21252
|
}
|
|
21230
21253
|
|
|
21231
|
-
/**
|
|
21232
|
-
* Renders the text background for lines, taking care of style
|
|
21233
|
-
* @private
|
|
21234
|
-
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21254
|
+
/**
|
|
21255
|
+
* Renders the text background for lines, taking care of style
|
|
21256
|
+
* @private
|
|
21257
|
+
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21235
21258
|
*/
|
|
21236
21259
|
_renderTextLinesBackground(ctx) {
|
|
21237
21260
|
if (!this.textBackgroundColor && !this.styleHas('textBackgroundColor')) {
|
|
@@ -21294,15 +21317,15 @@
|
|
|
21294
21317
|
this._removeShadow(ctx);
|
|
21295
21318
|
}
|
|
21296
21319
|
|
|
21297
|
-
/**
|
|
21298
|
-
* measure and return the width of a single character.
|
|
21299
|
-
* possibly overridden to accommodate different measure logic or
|
|
21300
|
-
* to hook some external lib for character measurement
|
|
21301
|
-
* @private
|
|
21302
|
-
* @param {String} _char, char to be measured
|
|
21303
|
-
* @param {Object} charStyle style of char to be measured
|
|
21304
|
-
* @param {String} [previousChar] previous char
|
|
21305
|
-
* @param {Object} [prevCharStyle] style of previous char
|
|
21320
|
+
/**
|
|
21321
|
+
* measure and return the width of a single character.
|
|
21322
|
+
* possibly overridden to accommodate different measure logic or
|
|
21323
|
+
* to hook some external lib for character measurement
|
|
21324
|
+
* @private
|
|
21325
|
+
* @param {String} _char, char to be measured
|
|
21326
|
+
* @param {Object} charStyle style of char to be measured
|
|
21327
|
+
* @param {String} [previousChar] previous char
|
|
21328
|
+
* @param {Object} [prevCharStyle] style of previous char
|
|
21306
21329
|
*/
|
|
21307
21330
|
_measureChar(_char, charStyle, previousChar, prevCharStyle) {
|
|
21308
21331
|
const fontCache = cache.getFontCache(charStyle),
|
|
@@ -21347,19 +21370,19 @@
|
|
|
21347
21370
|
};
|
|
21348
21371
|
}
|
|
21349
21372
|
|
|
21350
|
-
/**
|
|
21351
|
-
* Computes height of character at given position
|
|
21352
|
-
* @param {Number} line the line index number
|
|
21353
|
-
* @param {Number} _char the character index number
|
|
21354
|
-
* @return {Number} fontSize of the character
|
|
21373
|
+
/**
|
|
21374
|
+
* Computes height of character at given position
|
|
21375
|
+
* @param {Number} line the line index number
|
|
21376
|
+
* @param {Number} _char the character index number
|
|
21377
|
+
* @return {Number} fontSize of the character
|
|
21355
21378
|
*/
|
|
21356
21379
|
getHeightOfChar(line, _char) {
|
|
21357
21380
|
return this.getValueOfPropertyAt(line, _char, 'fontSize');
|
|
21358
21381
|
}
|
|
21359
21382
|
|
|
21360
|
-
/**
|
|
21361
|
-
* measure a text line measuring all characters.
|
|
21362
|
-
* @param {Number} lineIndex line number
|
|
21383
|
+
/**
|
|
21384
|
+
* measure a text line measuring all characters.
|
|
21385
|
+
* @param {Number} lineIndex line number
|
|
21363
21386
|
*/
|
|
21364
21387
|
measureLine(lineIndex) {
|
|
21365
21388
|
const lineInfo = this._measureLine(lineIndex);
|
|
@@ -21372,11 +21395,11 @@
|
|
|
21372
21395
|
return lineInfo;
|
|
21373
21396
|
}
|
|
21374
21397
|
|
|
21375
|
-
/**
|
|
21376
|
-
* measure every grapheme of a line, populating __charBounds
|
|
21377
|
-
* @param {Number} lineIndex
|
|
21378
|
-
* @return {Object} object.width total width of characters
|
|
21379
|
-
* @return {Object} object.numOfSpaces length of chars that match this._reSpacesAndTabs
|
|
21398
|
+
/**
|
|
21399
|
+
* measure every grapheme of a line, populating __charBounds
|
|
21400
|
+
* @param {Number} lineIndex
|
|
21401
|
+
* @return {Object} object.width total width of characters
|
|
21402
|
+
* @return {Object} object.numOfSpaces length of chars that match this._reSpacesAndTabs
|
|
21380
21403
|
*/
|
|
21381
21404
|
_measureLine(lineIndex) {
|
|
21382
21405
|
let width = 0,
|
|
@@ -21439,13 +21462,13 @@
|
|
|
21439
21462
|
};
|
|
21440
21463
|
}
|
|
21441
21464
|
|
|
21442
|
-
/**
|
|
21443
|
-
* Calculate the angle and the left,top position of the char that follow a path.
|
|
21444
|
-
* It appends it to graphemeInfo to be reused later at rendering
|
|
21445
|
-
* @private
|
|
21446
|
-
* @param {Number} positionInPath to be measured
|
|
21447
|
-
* @param {GraphemeBBox} graphemeInfo current grapheme box information
|
|
21448
|
-
* @param {Object} startingPoint position of the point
|
|
21465
|
+
/**
|
|
21466
|
+
* Calculate the angle and the left,top position of the char that follow a path.
|
|
21467
|
+
* It appends it to graphemeInfo to be reused later at rendering
|
|
21468
|
+
* @private
|
|
21469
|
+
* @param {Number} positionInPath to be measured
|
|
21470
|
+
* @param {GraphemeBBox} graphemeInfo current grapheme box information
|
|
21471
|
+
* @param {Object} startingPoint position of the point
|
|
21449
21472
|
*/
|
|
21450
21473
|
_setGraphemeOnPath(positionInPath, graphemeInfo) {
|
|
21451
21474
|
const centerPosition = positionInPath + graphemeInfo.kernedWidth / 2,
|
|
@@ -21458,13 +21481,13 @@
|
|
|
21458
21481
|
graphemeInfo.angle = info.angle + (this.pathSide === RIGHT ? Math.PI : 0);
|
|
21459
21482
|
}
|
|
21460
21483
|
|
|
21461
|
-
/**
|
|
21462
|
-
*
|
|
21463
|
-
* @param {String} grapheme to be measured
|
|
21464
|
-
* @param {Number} lineIndex index of the line where the char is
|
|
21465
|
-
* @param {Number} charIndex position in the line
|
|
21466
|
-
* @param {String} [prevGrapheme] character preceding the one to be measured
|
|
21467
|
-
* @returns {GraphemeBBox} grapheme bbox
|
|
21484
|
+
/**
|
|
21485
|
+
*
|
|
21486
|
+
* @param {String} grapheme to be measured
|
|
21487
|
+
* @param {Number} lineIndex index of the line where the char is
|
|
21488
|
+
* @param {Number} charIndex position in the line
|
|
21489
|
+
* @param {String} [prevGrapheme] character preceding the one to be measured
|
|
21490
|
+
* @returns {GraphemeBBox} grapheme bbox
|
|
21468
21491
|
*/
|
|
21469
21492
|
_getGraphemeBox(grapheme, lineIndex, charIndex, prevGrapheme, skipLeft) {
|
|
21470
21493
|
const style = this.getCompleteStyleDeclaration(lineIndex, charIndex),
|
|
@@ -21492,10 +21515,10 @@
|
|
|
21492
21515
|
return box;
|
|
21493
21516
|
}
|
|
21494
21517
|
|
|
21495
|
-
/**
|
|
21496
|
-
* Calculate height of line at 'lineIndex'
|
|
21497
|
-
* @param {Number} lineIndex index of line to calculate
|
|
21498
|
-
* @return {Number}
|
|
21518
|
+
/**
|
|
21519
|
+
* Calculate height of line at 'lineIndex'
|
|
21520
|
+
* @param {Number} lineIndex index of line to calculate
|
|
21521
|
+
* @return {Number}
|
|
21499
21522
|
*/
|
|
21500
21523
|
getHeightOfLine(lineIndex) {
|
|
21501
21524
|
if (this.__lineHeights[lineIndex]) {
|
|
@@ -21511,8 +21534,8 @@
|
|
|
21511
21534
|
return this.__lineHeights[lineIndex] = maxHeight * this.lineHeight * this._fontSizeMult;
|
|
21512
21535
|
}
|
|
21513
21536
|
|
|
21514
|
-
/**
|
|
21515
|
-
* Calculate text box height
|
|
21537
|
+
/**
|
|
21538
|
+
* Calculate text box height
|
|
21516
21539
|
*/
|
|
21517
21540
|
calcTextHeight() {
|
|
21518
21541
|
let lineHeight,
|
|
@@ -21524,26 +21547,26 @@
|
|
|
21524
21547
|
return height;
|
|
21525
21548
|
}
|
|
21526
21549
|
|
|
21527
|
-
/**
|
|
21528
|
-
* @private
|
|
21529
|
-
* @return {Number} Left offset
|
|
21550
|
+
/**
|
|
21551
|
+
* @private
|
|
21552
|
+
* @return {Number} Left offset
|
|
21530
21553
|
*/
|
|
21531
21554
|
_getLeftOffset() {
|
|
21532
21555
|
return this.direction === 'ltr' ? -this.width / 2 : this.width / 2;
|
|
21533
21556
|
}
|
|
21534
21557
|
|
|
21535
|
-
/**
|
|
21536
|
-
* @private
|
|
21537
|
-
* @return {Number} Top offset
|
|
21558
|
+
/**
|
|
21559
|
+
* @private
|
|
21560
|
+
* @return {Number} Top offset
|
|
21538
21561
|
*/
|
|
21539
21562
|
_getTopOffset() {
|
|
21540
21563
|
return -this.height / 2;
|
|
21541
21564
|
}
|
|
21542
21565
|
|
|
21543
|
-
/**
|
|
21544
|
-
* @private
|
|
21545
|
-
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21546
|
-
* @param {String} method Method name ("fillText" or "strokeText")
|
|
21566
|
+
/**
|
|
21567
|
+
* @private
|
|
21568
|
+
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21569
|
+
* @param {String} method Method name ("fillText" or "strokeText")
|
|
21547
21570
|
*/
|
|
21548
21571
|
_renderTextCommon(ctx, method) {
|
|
21549
21572
|
ctx.save();
|
|
@@ -21560,9 +21583,9 @@
|
|
|
21560
21583
|
ctx.restore();
|
|
21561
21584
|
}
|
|
21562
21585
|
|
|
21563
|
-
/**
|
|
21564
|
-
* @private
|
|
21565
|
-
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21586
|
+
/**
|
|
21587
|
+
* @private
|
|
21588
|
+
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21566
21589
|
*/
|
|
21567
21590
|
_renderTextFill(ctx) {
|
|
21568
21591
|
if (!this.fill && !this.styleHas(FILL)) {
|
|
@@ -21571,9 +21594,9 @@
|
|
|
21571
21594
|
this._renderTextCommon(ctx, 'fillText');
|
|
21572
21595
|
}
|
|
21573
21596
|
|
|
21574
|
-
/**
|
|
21575
|
-
* @private
|
|
21576
|
-
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21597
|
+
/**
|
|
21598
|
+
* @private
|
|
21599
|
+
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21577
21600
|
*/
|
|
21578
21601
|
_renderTextStroke(ctx) {
|
|
21579
21602
|
if ((!this.stroke || this.strokeWidth === 0) && this.isEmptyStyles()) {
|
|
@@ -21590,14 +21613,14 @@
|
|
|
21590
21613
|
ctx.restore();
|
|
21591
21614
|
}
|
|
21592
21615
|
|
|
21593
|
-
/**
|
|
21594
|
-
* @private
|
|
21595
|
-
* @param {String} method fillText or strokeText.
|
|
21596
|
-
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21597
|
-
* @param {Array} line Content of the line, splitted in an array by grapheme
|
|
21598
|
-
* @param {Number} left
|
|
21599
|
-
* @param {Number} top
|
|
21600
|
-
* @param {Number} lineIndex
|
|
21616
|
+
/**
|
|
21617
|
+
* @private
|
|
21618
|
+
* @param {String} method fillText or strokeText.
|
|
21619
|
+
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21620
|
+
* @param {Array} line Content of the line, splitted in an array by grapheme
|
|
21621
|
+
* @param {Number} left
|
|
21622
|
+
* @param {Number} top
|
|
21623
|
+
* @param {Number} lineIndex
|
|
21601
21624
|
*/
|
|
21602
21625
|
_renderChars(method, ctx, line, left, top, lineIndex) {
|
|
21603
21626
|
const lineHeight = this.getHeightOfLine(lineIndex),
|
|
@@ -21679,16 +21702,16 @@
|
|
|
21679
21702
|
ctx.restore();
|
|
21680
21703
|
}
|
|
21681
21704
|
|
|
21682
|
-
/**
|
|
21683
|
-
* This function try to patch the missing gradientTransform on canvas gradients.
|
|
21684
|
-
* transforming a context to transform the gradient, is going to transform the stroke too.
|
|
21685
|
-
* we want to transform the gradient but not the stroke operation, so we create
|
|
21686
|
-
* a transformed gradient on a pattern and then we use the pattern instead of the gradient.
|
|
21687
|
-
* this method has drawbacks: is slow, is in low resolution, needs a patch for when the size
|
|
21688
|
-
* is limited.
|
|
21689
|
-
* @private
|
|
21690
|
-
* @param {TFiller} filler a fabric gradient instance
|
|
21691
|
-
* @return {CanvasPattern} a pattern to use as fill/stroke style
|
|
21705
|
+
/**
|
|
21706
|
+
* This function try to patch the missing gradientTransform on canvas gradients.
|
|
21707
|
+
* transforming a context to transform the gradient, is going to transform the stroke too.
|
|
21708
|
+
* we want to transform the gradient but not the stroke operation, so we create
|
|
21709
|
+
* a transformed gradient on a pattern and then we use the pattern instead of the gradient.
|
|
21710
|
+
* this method has drawbacks: is slow, is in low resolution, needs a patch for when the size
|
|
21711
|
+
* is limited.
|
|
21712
|
+
* @private
|
|
21713
|
+
* @param {TFiller} filler a fabric gradient instance
|
|
21714
|
+
* @return {CanvasPattern} a pattern to use as fill/stroke style
|
|
21692
21715
|
*/
|
|
21693
21716
|
_applyPatternGradientTransformText(filler) {
|
|
21694
21717
|
// TODO: verify compatibility with strokeUniform
|
|
@@ -21744,12 +21767,12 @@
|
|
|
21744
21767
|
};
|
|
21745
21768
|
}
|
|
21746
21769
|
|
|
21747
|
-
/**
|
|
21748
|
-
* This function prepare the canvas for a stroke style, and stroke and strokeWidth
|
|
21749
|
-
* need to be sent in as defined
|
|
21750
|
-
* @param {CanvasRenderingContext2D} ctx
|
|
21751
|
-
* @param {CompleteTextStyleDeclaration} style with stroke and strokeWidth defined
|
|
21752
|
-
* @returns
|
|
21770
|
+
/**
|
|
21771
|
+
* This function prepare the canvas for a stroke style, and stroke and strokeWidth
|
|
21772
|
+
* need to be sent in as defined
|
|
21773
|
+
* @param {CanvasRenderingContext2D} ctx
|
|
21774
|
+
* @param {CompleteTextStyleDeclaration} style with stroke and strokeWidth defined
|
|
21775
|
+
* @returns
|
|
21753
21776
|
*/
|
|
21754
21777
|
_setStrokeStyles(ctx, _ref) {
|
|
21755
21778
|
let {
|
|
@@ -21764,12 +21787,12 @@
|
|
|
21764
21787
|
return this.handleFiller(ctx, 'strokeStyle', stroke);
|
|
21765
21788
|
}
|
|
21766
21789
|
|
|
21767
|
-
/**
|
|
21768
|
-
* This function prepare the canvas for a ill style, and fill
|
|
21769
|
-
* need to be sent in as defined
|
|
21770
|
-
* @param {CanvasRenderingContext2D} ctx
|
|
21771
|
-
* @param {CompleteTextStyleDeclaration} style with ill defined
|
|
21772
|
-
* @returns
|
|
21790
|
+
/**
|
|
21791
|
+
* This function prepare the canvas for a ill style, and fill
|
|
21792
|
+
* need to be sent in as defined
|
|
21793
|
+
* @param {CanvasRenderingContext2D} ctx
|
|
21794
|
+
* @param {CompleteTextStyleDeclaration} style with ill defined
|
|
21795
|
+
* @returns
|
|
21773
21796
|
*/
|
|
21774
21797
|
_setFillStyles(ctx, _ref2) {
|
|
21775
21798
|
let {
|
|
@@ -21778,16 +21801,16 @@
|
|
|
21778
21801
|
return this.handleFiller(ctx, 'fillStyle', fill);
|
|
21779
21802
|
}
|
|
21780
21803
|
|
|
21781
|
-
/**
|
|
21782
|
-
* @private
|
|
21783
|
-
* @param {String} method
|
|
21784
|
-
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21785
|
-
* @param {Number} lineIndex
|
|
21786
|
-
* @param {Number} charIndex
|
|
21787
|
-
* @param {String} _char
|
|
21788
|
-
* @param {Number} left Left coordinate
|
|
21789
|
-
* @param {Number} top Top coordinate
|
|
21790
|
-
* @param {Number} lineHeight Height of the line
|
|
21804
|
+
/**
|
|
21805
|
+
* @private
|
|
21806
|
+
* @param {String} method
|
|
21807
|
+
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21808
|
+
* @param {Number} lineIndex
|
|
21809
|
+
* @param {Number} charIndex
|
|
21810
|
+
* @param {String} _char
|
|
21811
|
+
* @param {Number} left Left coordinate
|
|
21812
|
+
* @param {Number} top Top coordinate
|
|
21813
|
+
* @param {Number} lineHeight Height of the line
|
|
21791
21814
|
*/
|
|
21792
21815
|
_renderChar(method, ctx, lineIndex, charIndex, _char, left, top) {
|
|
21793
21816
|
const decl = this._getStyleDeclaration(lineIndex, charIndex),
|
|
@@ -21816,30 +21839,30 @@
|
|
|
21816
21839
|
ctx.restore();
|
|
21817
21840
|
}
|
|
21818
21841
|
|
|
21819
|
-
/**
|
|
21820
|
-
* Turns the character into a 'superior figure' (i.e. 'superscript')
|
|
21821
|
-
* @param {Number} start selection start
|
|
21822
|
-
* @param {Number} end selection end
|
|
21842
|
+
/**
|
|
21843
|
+
* Turns the character into a 'superior figure' (i.e. 'superscript')
|
|
21844
|
+
* @param {Number} start selection start
|
|
21845
|
+
* @param {Number} end selection end
|
|
21823
21846
|
*/
|
|
21824
21847
|
setSuperscript(start, end) {
|
|
21825
21848
|
this._setScript(start, end, this.superscript);
|
|
21826
21849
|
}
|
|
21827
21850
|
|
|
21828
|
-
/**
|
|
21829
|
-
* Turns the character into an 'inferior figure' (i.e. 'subscript')
|
|
21830
|
-
* @param {Number} start selection start
|
|
21831
|
-
* @param {Number} end selection end
|
|
21851
|
+
/**
|
|
21852
|
+
* Turns the character into an 'inferior figure' (i.e. 'subscript')
|
|
21853
|
+
* @param {Number} start selection start
|
|
21854
|
+
* @param {Number} end selection end
|
|
21832
21855
|
*/
|
|
21833
21856
|
setSubscript(start, end) {
|
|
21834
21857
|
this._setScript(start, end, this.subscript);
|
|
21835
21858
|
}
|
|
21836
21859
|
|
|
21837
|
-
/**
|
|
21838
|
-
* Applies 'schema' at given position
|
|
21839
|
-
* @private
|
|
21840
|
-
* @param {Number} start selection start
|
|
21841
|
-
* @param {Number} end selection end
|
|
21842
|
-
* @param {Number} schema
|
|
21860
|
+
/**
|
|
21861
|
+
* Applies 'schema' at given position
|
|
21862
|
+
* @private
|
|
21863
|
+
* @param {Number} start selection start
|
|
21864
|
+
* @param {Number} end selection end
|
|
21865
|
+
* @param {Number} schema
|
|
21843
21866
|
*/
|
|
21844
21867
|
_setScript(start, end, schema) {
|
|
21845
21868
|
const loc = this.get2DCursorLocation(start, true),
|
|
@@ -21852,10 +21875,10 @@
|
|
|
21852
21875
|
this.setSelectionStyles(style, start, end);
|
|
21853
21876
|
}
|
|
21854
21877
|
|
|
21855
|
-
/**
|
|
21856
|
-
* @private
|
|
21857
|
-
* @param {Number} lineIndex index text line
|
|
21858
|
-
* @return {Number} Line left offset
|
|
21878
|
+
/**
|
|
21879
|
+
* @private
|
|
21880
|
+
* @param {Number} lineIndex index text line
|
|
21881
|
+
* @return {Number} Line left offset
|
|
21859
21882
|
*/
|
|
21860
21883
|
_getLineLeftOffset(lineIndex) {
|
|
21861
21884
|
const lineWidth = this.getLineWidth(lineIndex),
|
|
@@ -21905,8 +21928,8 @@
|
|
|
21905
21928
|
return leftOffset;
|
|
21906
21929
|
}
|
|
21907
21930
|
|
|
21908
|
-
/**
|
|
21909
|
-
* @private
|
|
21931
|
+
/**
|
|
21932
|
+
* @private
|
|
21910
21933
|
*/
|
|
21911
21934
|
_clearCache() {
|
|
21912
21935
|
this._forceClearCache = false;
|
|
@@ -21915,12 +21938,12 @@
|
|
|
21915
21938
|
this.__charBounds = [];
|
|
21916
21939
|
}
|
|
21917
21940
|
|
|
21918
|
-
/**
|
|
21919
|
-
* Measure a single line given its index. Used to calculate the initial
|
|
21920
|
-
* text bounding box. The values are calculated and stored in __lineWidths cache.
|
|
21921
|
-
* @private
|
|
21922
|
-
* @param {Number} lineIndex line number
|
|
21923
|
-
* @return {Number} Line width
|
|
21941
|
+
/**
|
|
21942
|
+
* Measure a single line given its index. Used to calculate the initial
|
|
21943
|
+
* text bounding box. The values are calculated and stored in __lineWidths cache.
|
|
21944
|
+
* @private
|
|
21945
|
+
* @param {Number} lineIndex line number
|
|
21946
|
+
* @return {Number} Line width
|
|
21924
21947
|
*/
|
|
21925
21948
|
getLineWidth(lineIndex) {
|
|
21926
21949
|
if (this.__lineWidths[lineIndex] !== undefined) {
|
|
@@ -21939,12 +21962,12 @@
|
|
|
21939
21962
|
return 0;
|
|
21940
21963
|
}
|
|
21941
21964
|
|
|
21942
|
-
/**
|
|
21943
|
-
* Retrieves the value of property at given character position
|
|
21944
|
-
* @param {Number} lineIndex the line number
|
|
21945
|
-
* @param {Number} charIndex the character number
|
|
21946
|
-
* @param {String} property the property name
|
|
21947
|
-
* @returns the value of 'property'
|
|
21965
|
+
/**
|
|
21966
|
+
* Retrieves the value of property at given character position
|
|
21967
|
+
* @param {Number} lineIndex the line number
|
|
21968
|
+
* @param {Number} charIndex the character number
|
|
21969
|
+
* @param {String} property the property name
|
|
21970
|
+
* @returns the value of 'property'
|
|
21948
21971
|
*/
|
|
21949
21972
|
getValueOfPropertyAt(lineIndex, charIndex, property) {
|
|
21950
21973
|
var _charStyle$property;
|
|
@@ -21952,9 +21975,9 @@
|
|
|
21952
21975
|
return (_charStyle$property = charStyle[property]) !== null && _charStyle$property !== void 0 ? _charStyle$property : this[property];
|
|
21953
21976
|
}
|
|
21954
21977
|
|
|
21955
|
-
/**
|
|
21956
|
-
* @private
|
|
21957
|
-
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21978
|
+
/**
|
|
21979
|
+
* @private
|
|
21980
|
+
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21958
21981
|
*/
|
|
21959
21982
|
_renderTextDecoration(ctx, type) {
|
|
21960
21983
|
if (!this[type] && !this.styleHas(type)) {
|
|
@@ -22038,10 +22061,10 @@
|
|
|
22038
22061
|
this._removeShadow(ctx);
|
|
22039
22062
|
}
|
|
22040
22063
|
|
|
22041
|
-
/**
|
|
22042
|
-
* return font declaration string for canvas context
|
|
22043
|
-
* @param {Object} [styleObject] object
|
|
22044
|
-
* @returns {String} font declaration formatted for canvas context.
|
|
22064
|
+
/**
|
|
22065
|
+
* return font declaration string for canvas context
|
|
22066
|
+
* @param {Object} [styleObject] object
|
|
22067
|
+
* @returns {String} font declaration formatted for canvas context.
|
|
22045
22068
|
*/
|
|
22046
22069
|
_getFontDeclaration() {
|
|
22047
22070
|
let {
|
|
@@ -22067,9 +22090,9 @@
|
|
|
22067
22090
|
return [fontStyle, fontWeight, `${forMeasuring ? this.CACHE_FONT_SIZE : fontSize}px`, parsedFontFamily].join(' ');
|
|
22068
22091
|
}
|
|
22069
22092
|
|
|
22070
|
-
/**
|
|
22071
|
-
* Renders text instance on a specified context
|
|
22072
|
-
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
22093
|
+
/**
|
|
22094
|
+
* Renders text instance on a specified context
|
|
22095
|
+
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
22073
22096
|
*/
|
|
22074
22097
|
render(ctx) {
|
|
22075
22098
|
if (!this.visible) {
|
|
@@ -22084,22 +22107,22 @@
|
|
|
22084
22107
|
super.render(ctx);
|
|
22085
22108
|
}
|
|
22086
22109
|
|
|
22087
|
-
/**
|
|
22088
|
-
* Override this method to customize grapheme splitting
|
|
22089
|
-
* @todo the util `graphemeSplit` needs to be injectable in some way.
|
|
22090
|
-
* is more comfortable to inject the correct util rather than having to override text
|
|
22091
|
-
* in the middle of the prototype chain
|
|
22092
|
-
* @param {string} value
|
|
22093
|
-
* @returns {string[]} array of graphemes
|
|
22110
|
+
/**
|
|
22111
|
+
* Override this method to customize grapheme splitting
|
|
22112
|
+
* @todo the util `graphemeSplit` needs to be injectable in some way.
|
|
22113
|
+
* is more comfortable to inject the correct util rather than having to override text
|
|
22114
|
+
* in the middle of the prototype chain
|
|
22115
|
+
* @param {string} value
|
|
22116
|
+
* @returns {string[]} array of graphemes
|
|
22094
22117
|
*/
|
|
22095
22118
|
graphemeSplit(value) {
|
|
22096
22119
|
return graphemeSplit(value);
|
|
22097
22120
|
}
|
|
22098
22121
|
|
|
22099
|
-
/**
|
|
22100
|
-
* Returns the text as an array of lines.
|
|
22101
|
-
* @param {String} text text to split
|
|
22102
|
-
* @returns Lines in the text
|
|
22122
|
+
/**
|
|
22123
|
+
* Returns the text as an array of lines.
|
|
22124
|
+
* @param {String} text text to split
|
|
22125
|
+
* @returns Lines in the text
|
|
22103
22126
|
*/
|
|
22104
22127
|
_splitTextIntoLines(text) {
|
|
22105
22128
|
const lines = text.split(this._reNewline),
|
|
@@ -22125,18 +22148,18 @@
|
|
|
22125
22148
|
};
|
|
22126
22149
|
}
|
|
22127
22150
|
|
|
22128
|
-
/**
|
|
22129
|
-
* Check if text contains Arabic characters
|
|
22130
|
-
* @private
|
|
22151
|
+
/**
|
|
22152
|
+
* Check if text contains Arabic characters
|
|
22153
|
+
* @private
|
|
22131
22154
|
*/
|
|
22132
22155
|
_containsArabicText(text) {
|
|
22133
22156
|
return /[\u0600-\u06FF\u0750-\u077F\uFB50-\uFDFF\uFE70-\uFEFF]/.test(text);
|
|
22134
22157
|
}
|
|
22135
22158
|
|
|
22136
|
-
/**
|
|
22137
|
-
* Returns object representation of an instance
|
|
22138
|
-
* @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output
|
|
22139
|
-
* @return {Object} Object representation of an instance
|
|
22159
|
+
/**
|
|
22160
|
+
* Returns object representation of an instance
|
|
22161
|
+
* @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output
|
|
22162
|
+
* @return {Object} Object representation of an instance
|
|
22140
22163
|
*/
|
|
22141
22164
|
toObject() {
|
|
22142
22165
|
let propertiesToInclude = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
@@ -22179,23 +22202,23 @@
|
|
|
22179
22202
|
return this;
|
|
22180
22203
|
}
|
|
22181
22204
|
|
|
22182
|
-
/**
|
|
22183
|
-
* Returns complexity of an instance
|
|
22184
|
-
* @return {Number} complexity
|
|
22205
|
+
/**
|
|
22206
|
+
* Returns complexity of an instance
|
|
22207
|
+
* @return {Number} complexity
|
|
22185
22208
|
*/
|
|
22186
22209
|
complexity() {
|
|
22187
22210
|
return 1;
|
|
22188
22211
|
}
|
|
22189
22212
|
|
|
22190
|
-
/**
|
|
22191
|
-
* List of generic font families
|
|
22192
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/font-family#generic-name
|
|
22213
|
+
/**
|
|
22214
|
+
* List of generic font families
|
|
22215
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/font-family#generic-name
|
|
22193
22216
|
*/
|
|
22194
22217
|
|
|
22195
|
-
/**
|
|
22196
|
-
* Returns FabricText instance from an SVG element (<b>not yet implemented</b>)
|
|
22197
|
-
* @param {HTMLElement} element Element to parse
|
|
22198
|
-
* @param {Object} [options] Options object
|
|
22218
|
+
/**
|
|
22219
|
+
* Returns FabricText instance from an SVG element (<b>not yet implemented</b>)
|
|
22220
|
+
* @param {HTMLElement} element Element to parse
|
|
22221
|
+
* @param {Object} [options] Options object
|
|
22199
22222
|
*/
|
|
22200
22223
|
static async fromElement(element, options, cssRules) {
|
|
22201
22224
|
const parsedAttributes = parseAttributes(element, FabricText.ATTRIBUTE_NAMES, cssRules);
|
|
@@ -22234,10 +22257,10 @@
|
|
|
22234
22257
|
scaledDiff = lineHeightDiff * textHeightScaleFactor,
|
|
22235
22258
|
textHeight = text.getScaledHeight() + scaledDiff;
|
|
22236
22259
|
let offX = 0;
|
|
22237
|
-
/*
|
|
22238
|
-
Adjust positioning:
|
|
22239
|
-
x/y attributes in SVG correspond to the bottom-left corner of text bounding box
|
|
22240
|
-
fabric output by default at top, left.
|
|
22260
|
+
/*
|
|
22261
|
+
Adjust positioning:
|
|
22262
|
+
x/y attributes in SVG correspond to the bottom-left corner of text bounding box
|
|
22263
|
+
fabric output by default at top, left.
|
|
22241
22264
|
*/
|
|
22242
22265
|
if (textAnchor === CENTER) {
|
|
22243
22266
|
offX = text.getScaledWidth() / 2;
|
|
@@ -22255,9 +22278,9 @@
|
|
|
22255
22278
|
|
|
22256
22279
|
/* _FROM_SVG_END_ */
|
|
22257
22280
|
|
|
22258
|
-
/**
|
|
22259
|
-
* Check if the font is ready for accurate measurements
|
|
22260
|
-
* @private
|
|
22281
|
+
/**
|
|
22282
|
+
* Check if the font is ready for accurate measurements
|
|
22283
|
+
* @private
|
|
22261
22284
|
*/
|
|
22262
22285
|
_isFontReady() {
|
|
22263
22286
|
if (typeof document === 'undefined' || !('fonts' in document)) {
|
|
@@ -22270,9 +22293,9 @@
|
|
|
22270
22293
|
}
|
|
22271
22294
|
}
|
|
22272
22295
|
|
|
22273
|
-
/**
|
|
22274
|
-
* Schedule re-initialization after font loads
|
|
22275
|
-
* @private
|
|
22296
|
+
/**
|
|
22297
|
+
* Schedule re-initialization after font loads
|
|
22298
|
+
* @private
|
|
22276
22299
|
*/
|
|
22277
22300
|
_scheduleInitAfterFontLoad() {
|
|
22278
22301
|
if (typeof document === 'undefined' || !('fonts' in document)) {
|
|
@@ -22308,8 +22331,8 @@
|
|
|
22308
22331
|
});
|
|
22309
22332
|
}
|
|
22310
22333
|
|
|
22311
|
-
/**
|
|
22312
|
-
* Force complete text re-initialization (useful after JSON loading)
|
|
22334
|
+
/**
|
|
22335
|
+
* Force complete text re-initialization (useful after JSON loading)
|
|
22313
22336
|
*/
|
|
22314
22337
|
forceTextReinitialization() {
|
|
22315
22338
|
console.log('🔄 Force reinitializing text object');
|
|
@@ -22337,10 +22360,10 @@
|
|
|
22337
22360
|
}
|
|
22338
22361
|
}
|
|
22339
22362
|
|
|
22340
|
-
/**
|
|
22341
|
-
* Returns FabricText instance from an object representation
|
|
22342
|
-
* @param {Object} object plain js Object to create an instance from
|
|
22343
|
-
* @returns {Promise<FabricText>}
|
|
22363
|
+
/**
|
|
22364
|
+
* Returns FabricText instance from an object representation
|
|
22365
|
+
* @param {Object} object plain js Object to create an instance from
|
|
22366
|
+
* @returns {Promise<FabricText>}
|
|
22344
22367
|
*/
|
|
22345
22368
|
static fromObject(object) {
|
|
22346
22369
|
return this._fromObject({
|
|
@@ -22442,10 +22465,10 @@
|
|
|
22442
22465
|
});
|
|
22443
22466
|
}
|
|
22444
22467
|
}
|
|
22445
|
-
/**
|
|
22446
|
-
* Properties that requires a text layout recalculation when changed
|
|
22447
|
-
* @type string[]
|
|
22448
|
-
* @protected
|
|
22468
|
+
/**
|
|
22469
|
+
* Properties that requires a text layout recalculation when changed
|
|
22470
|
+
* @type string[]
|
|
22471
|
+
* @protected
|
|
22449
22472
|
*/
|
|
22450
22473
|
_defineProperty(FabricText, "textLayoutProperties", textLayoutProperties);
|
|
22451
22474
|
_defineProperty(FabricText, "cacheProperties", [...cacheProperties, ...additionalProps]);
|
|
@@ -22453,9 +22476,9 @@
|
|
|
22453
22476
|
_defineProperty(FabricText, "type", 'Text');
|
|
22454
22477
|
_defineProperty(FabricText, "genericFonts", ['serif', 'sans-serif', 'monospace', 'cursive', 'fantasy', 'system-ui', 'ui-serif', 'ui-sans-serif', 'ui-monospace', 'ui-rounded', 'math', 'emoji', 'fangsong']);
|
|
22455
22478
|
/* _FROM_SVG_START_ */
|
|
22456
|
-
/**
|
|
22457
|
-
* List of attribute names to account for when parsing SVG element (used by {@link FabricText.fromElement})
|
|
22458
|
-
* @see: http://www.w3.org/TR/SVG/text.html#TextElement
|
|
22479
|
+
/**
|
|
22480
|
+
* List of attribute names to account for when parsing SVG element (used by {@link FabricText.fromElement})
|
|
22481
|
+
* @see: http://www.w3.org/TR/SVG/text.html#TextElement
|
|
22459
22482
|
*/
|
|
22460
22483
|
_defineProperty(FabricText, "ATTRIBUTE_NAMES", SHARED_ATTRIBUTES.concat('x', 'y', 'dx', 'dy', 'font-family', 'font-style', 'font-weight', 'font-size', 'letter-spacing', 'text-decoration', 'text-anchor'));
|
|
22461
22484
|
applyMixins(FabricText, [TextSVGExportMixin]);
|
|
@@ -22842,8 +22865,8 @@
|
|
|
22842
22865
|
// We don't need to save/restore them here as it would conflict with IText's restoration
|
|
22843
22866
|
}
|
|
22844
22867
|
|
|
22845
|
-
/**
|
|
22846
|
-
* Get the container element for the overlay (parent of upperCanvasEl)
|
|
22868
|
+
/**
|
|
22869
|
+
* Get the container element for the overlay (parent of upperCanvasEl)
|
|
22847
22870
|
*/
|
|
22848
22871
|
getCanvasContainer() {
|
|
22849
22872
|
const upperCanvas = this.canvas.upperCanvasEl;
|
|
@@ -22857,8 +22880,8 @@
|
|
|
22857
22880
|
return container;
|
|
22858
22881
|
}
|
|
22859
22882
|
|
|
22860
|
-
/**
|
|
22861
|
-
* Create the overlay DOM structure
|
|
22883
|
+
/**
|
|
22884
|
+
* Create the overlay DOM structure
|
|
22862
22885
|
*/
|
|
22863
22886
|
createOverlayDOM() {
|
|
22864
22887
|
// Host div for positioning and overflow control
|
|
@@ -22913,8 +22936,8 @@
|
|
|
22913
22936
|
document.body.appendChild(this.hostDiv);
|
|
22914
22937
|
}
|
|
22915
22938
|
|
|
22916
|
-
/**
|
|
22917
|
-
* Attach all event listeners
|
|
22939
|
+
/**
|
|
22940
|
+
* Attach all event listeners
|
|
22918
22941
|
*/
|
|
22919
22942
|
attachEventListeners() {
|
|
22920
22943
|
// Textarea events
|
|
@@ -22934,8 +22957,8 @@
|
|
|
22934
22957
|
this.setupViewportChangeDetection();
|
|
22935
22958
|
}
|
|
22936
22959
|
|
|
22937
|
-
/**
|
|
22938
|
-
* Remove all event listeners
|
|
22960
|
+
/**
|
|
22961
|
+
* Remove all event listeners
|
|
22939
22962
|
*/
|
|
22940
22963
|
removeEventListeners() {
|
|
22941
22964
|
this.textarea.removeEventListener('input', this.boundHandlers.onInput);
|
|
@@ -22952,16 +22975,16 @@
|
|
|
22952
22975
|
this.restoreViewportChangeDetection();
|
|
22953
22976
|
}
|
|
22954
22977
|
|
|
22955
|
-
/**
|
|
22956
|
-
* Simple method to refresh positioning when canvas changes
|
|
22978
|
+
/**
|
|
22979
|
+
* Simple method to refresh positioning when canvas changes
|
|
22957
22980
|
*/
|
|
22958
22981
|
updatePosition() {
|
|
22959
22982
|
this.applyOverlayStyle();
|
|
22960
22983
|
}
|
|
22961
22984
|
|
|
22962
|
-
/**
|
|
22963
|
-
* Update the Fabric object bounds to match current textarea size
|
|
22964
|
-
* This ensures Fabric.js selection controls follow the growing textbox
|
|
22985
|
+
/**
|
|
22986
|
+
* Update the Fabric object bounds to match current textarea size
|
|
22987
|
+
* This ensures Fabric.js selection controls follow the growing textbox
|
|
22965
22988
|
*/
|
|
22966
22989
|
updateObjectBounds() {
|
|
22967
22990
|
if (this.isDestroyed) return;
|
|
@@ -22995,15 +23018,15 @@
|
|
|
22995
23018
|
}
|
|
22996
23019
|
}
|
|
22997
23020
|
|
|
22998
|
-
/**
|
|
22999
|
-
* Convert Fabric charSpacing (1/1000 em) to CSS letter-spacing (px)
|
|
23021
|
+
/**
|
|
23022
|
+
* Convert Fabric charSpacing (1/1000 em) to CSS letter-spacing (px)
|
|
23000
23023
|
*/
|
|
23001
23024
|
letterSpacingPx(charSpacing, fontSize) {
|
|
23002
23025
|
return charSpacing / 1000 * fontSize;
|
|
23003
23026
|
}
|
|
23004
23027
|
|
|
23005
|
-
/**
|
|
23006
|
-
* Detect text direction using first strong directional character
|
|
23028
|
+
/**
|
|
23029
|
+
* Detect text direction using first strong directional character
|
|
23007
23030
|
*/
|
|
23008
23031
|
firstStrongDir(text) {
|
|
23009
23032
|
// Hebrew: \u0590-\u05FF, Arabic: \u0600-\u06FF, \u0750-\u077F, \uFB50-\uFDFF, \uFE70-\uFEFF
|
|
@@ -23042,10 +23065,10 @@
|
|
|
23042
23065
|
const top = canvasRect.top + scrollY + screenPoint.y;
|
|
23043
23066
|
|
|
23044
23067
|
// 4. Calculate the precise width and height for the container
|
|
23045
|
-
// **THE FIX:** Use
|
|
23046
|
-
// This is the most reliable measure of the object's final rendered dimensions.
|
|
23068
|
+
// **THE FIX:** Use the same width calculation as measureLinesWithBrowser for consistency
|
|
23047
23069
|
const objectBounds = target.getBoundingRect();
|
|
23048
|
-
const
|
|
23070
|
+
const scaleX = target.scaleX || 1;
|
|
23071
|
+
const width = Math.round((target.width * scaleX + padding * 2) * zoom);
|
|
23049
23072
|
const height = Math.round(objectBounds.height * zoom);
|
|
23050
23073
|
|
|
23051
23074
|
// 5. Apply styles to host DIV - absolute positioning like rtl-test.html
|
|
@@ -23067,7 +23090,6 @@
|
|
|
23067
23090
|
// 6. Style the textarea - match Fabric's exact rendering with padding
|
|
23068
23091
|
const baseFontSize = (_target$fontSize = target.fontSize) !== null && _target$fontSize !== void 0 ? _target$fontSize : 16;
|
|
23069
23092
|
// Use scaleX for font scaling to match Fabric text scaling exactly
|
|
23070
|
-
const scaleX = target.scaleX || 1;
|
|
23071
23093
|
const finalFontSize = baseFontSize * scaleX * zoom;
|
|
23072
23094
|
const fabricLineHeight = target.lineHeight || 1.16;
|
|
23073
23095
|
// **THE FIX:** Use 'border-box' so the width property includes padding.
|
|
@@ -23129,7 +23151,7 @@
|
|
|
23129
23151
|
this.textarea.style.textAlignLast = 'left';
|
|
23130
23152
|
}
|
|
23131
23153
|
} else if (textAlign === 'justify-right') {
|
|
23132
|
-
// If text is LTR but fabric says justify-right, override to justify-left for better UX
|
|
23154
|
+
// If text is LTR but fabric says justify-right, override to justify-left for better UX
|
|
23133
23155
|
if (autoDetectedDirection === 'ltr') {
|
|
23134
23156
|
this.textarea.style.textAlignLast = 'left';
|
|
23135
23157
|
console.log(' → Overrode justify-right to justify-left for LTR text');
|
|
@@ -23240,8 +23262,8 @@
|
|
|
23240
23262
|
// Initial bounds are set correctly by Fabric.js - don't force update here
|
|
23241
23263
|
}
|
|
23242
23264
|
|
|
23243
|
-
/**
|
|
23244
|
-
* Debug method to compare textarea and canvas object bounding boxes
|
|
23265
|
+
/**
|
|
23266
|
+
* Debug method to compare textarea and canvas object bounding boxes
|
|
23245
23267
|
*/
|
|
23246
23268
|
debugBoundingBoxComparison() {
|
|
23247
23269
|
const target = this.target;
|
|
@@ -23311,8 +23333,8 @@
|
|
|
23311
23333
|
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
23312
23334
|
}
|
|
23313
23335
|
|
|
23314
|
-
/**
|
|
23315
|
-
* Debug method to compare text wrapping between textarea and Fabric text object
|
|
23336
|
+
/**
|
|
23337
|
+
* Debug method to compare text wrapping between textarea and Fabric text object
|
|
23316
23338
|
*/
|
|
23317
23339
|
debugTextWrapping() {
|
|
23318
23340
|
const target = this.target;
|
|
@@ -23397,8 +23419,8 @@
|
|
|
23397
23419
|
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
23398
23420
|
}
|
|
23399
23421
|
|
|
23400
|
-
/**
|
|
23401
|
-
* Focus the textarea and position cursor at end
|
|
23422
|
+
/**
|
|
23423
|
+
* Focus the textarea and position cursor at end
|
|
23402
23424
|
*/
|
|
23403
23425
|
focusTextarea() {
|
|
23404
23426
|
// For overlay editing, we want to keep the object in "selection mode" not "editing mode"
|
|
@@ -23438,8 +23460,8 @@
|
|
|
23438
23460
|
this.canvas.requestRenderAll();
|
|
23439
23461
|
}
|
|
23440
23462
|
|
|
23441
|
-
/**
|
|
23442
|
-
* Refresh overlay positioning and styling
|
|
23463
|
+
/**
|
|
23464
|
+
* Refresh overlay positioning and styling
|
|
23443
23465
|
*/
|
|
23444
23466
|
refresh() {
|
|
23445
23467
|
if (this.isDestroyed) return;
|
|
@@ -23447,32 +23469,34 @@
|
|
|
23447
23469
|
// Don't update object bounds on every refresh - only when textarea actually resizes
|
|
23448
23470
|
}
|
|
23449
23471
|
|
|
23450
|
-
/**
|
|
23451
|
-
* Destroy the overlay editor
|
|
23472
|
+
/**
|
|
23473
|
+
* Destroy the overlay editor
|
|
23452
23474
|
*/
|
|
23453
23475
|
destroy() {
|
|
23476
|
+
var _this$target$textAlig;
|
|
23454
23477
|
let commit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
23455
23478
|
if (this.isDestroyed) return;
|
|
23456
23479
|
this.isDestroyed = true;
|
|
23457
23480
|
this.removeEventListeners();
|
|
23458
23481
|
|
|
23459
|
-
//
|
|
23460
|
-
|
|
23461
|
-
|
|
23462
|
-
|
|
23463
|
-
|
|
23464
|
-
|
|
23465
|
-
|
|
23466
|
-
|
|
23482
|
+
// EXTRACT DOM DATA BEFORE REMOVING DOM for justify text preservation
|
|
23483
|
+
let extractedOverlayData = null;
|
|
23484
|
+
if (commit && (_this$target$textAlig = this.target.textAlign) !== null && _this$target$textAlig !== void 0 && _this$target$textAlig.includes('justify')) {
|
|
23485
|
+
try {
|
|
23486
|
+
// Store the DOM structure before destruction
|
|
23487
|
+
const result = extractLinesFromDOM(this.textarea);
|
|
23488
|
+
extractedOverlayData = result.lines;
|
|
23489
|
+
console.log('🔧 DESTROY: Extracted overlay lines before DOM removal');
|
|
23490
|
+
} catch (error) {
|
|
23491
|
+
console.warn('Failed to extract overlay lines before destruction:', error);
|
|
23467
23492
|
}
|
|
23468
23493
|
}
|
|
23469
23494
|
|
|
23470
|
-
//
|
|
23471
|
-
if (this.
|
|
23472
|
-
this.
|
|
23495
|
+
// Restore original opacity but keep overlayEditor reference for commit
|
|
23496
|
+
if (this.target.__overlayOriginalOpacity !== undefined) {
|
|
23497
|
+
this.target.opacity = this.target.__overlayOriginalOpacity;
|
|
23498
|
+
delete this.target.__overlayOriginalOpacity;
|
|
23473
23499
|
}
|
|
23474
|
-
|
|
23475
|
-
// Handle commit/cancel after restoring visibility
|
|
23476
23500
|
if (commit && !this.isComposing) {
|
|
23477
23501
|
const finalText = this.textarea.value;
|
|
23478
23502
|
|
|
@@ -23493,12 +23517,26 @@
|
|
|
23493
23517
|
console.log(`📝 Overlay Exit: Direction unchanged (${currentDirection}), text: "${finalText.substring(0, 30)}..."`);
|
|
23494
23518
|
}
|
|
23495
23519
|
if (this.onCommit) {
|
|
23520
|
+
// Store extracted overlay data on target for commitOverlayEdit to use
|
|
23521
|
+
if (extractedOverlayData) {
|
|
23522
|
+
this.target._extractedOverlayLines = extractedOverlayData;
|
|
23523
|
+
}
|
|
23496
23524
|
this.onCommit(finalText);
|
|
23497
23525
|
}
|
|
23498
23526
|
} else if (!commit && this.onCancel) {
|
|
23499
23527
|
this.onCancel();
|
|
23500
23528
|
}
|
|
23501
23529
|
|
|
23530
|
+
// Clear overlay editor reference AFTER commit/cancel handlers
|
|
23531
|
+
if (this.target.__overlayEditor === this) {
|
|
23532
|
+
this.target.__overlayEditor = undefined;
|
|
23533
|
+
}
|
|
23534
|
+
|
|
23535
|
+
// Remove DOM after commit/cancel handlers
|
|
23536
|
+
if (this.hostDiv.parentNode) {
|
|
23537
|
+
this.hostDiv.parentNode.removeChild(this.hostDiv);
|
|
23538
|
+
}
|
|
23539
|
+
|
|
23502
23540
|
// Note: Don't restore object cursors since IText manages all cursors in _restoreEditingProps
|
|
23503
23541
|
// Let the IText editing system handle proper restoration of all cursor properties
|
|
23504
23542
|
|
|
@@ -23513,6 +23551,9 @@
|
|
|
23513
23551
|
// Request canvas re-render
|
|
23514
23552
|
this.canvas.requestRenderAll();
|
|
23515
23553
|
}
|
|
23554
|
+
get textareaElement() {
|
|
23555
|
+
return this.textarea;
|
|
23556
|
+
}
|
|
23516
23557
|
|
|
23517
23558
|
// Event handlers
|
|
23518
23559
|
handleInput() {
|
|
@@ -23616,8 +23657,8 @@
|
|
|
23616
23657
|
}
|
|
23617
23658
|
}
|
|
23618
23659
|
|
|
23619
|
-
/**
|
|
23620
|
-
* Setup detection for viewport changes (zoom/pan)
|
|
23660
|
+
/**
|
|
23661
|
+
* Setup detection for viewport changes (zoom/pan)
|
|
23621
23662
|
*/
|
|
23622
23663
|
setupViewportChangeDetection() {
|
|
23623
23664
|
// Store original methods
|
|
@@ -23646,8 +23687,8 @@
|
|
|
23646
23687
|
};
|
|
23647
23688
|
}
|
|
23648
23689
|
|
|
23649
|
-
/**
|
|
23650
|
-
* Restore original viewport methods
|
|
23690
|
+
/**
|
|
23691
|
+
* Restore original viewport methods
|
|
23651
23692
|
*/
|
|
23652
23693
|
restoreViewportChangeDetection() {
|
|
23653
23694
|
if (this.canvas.__originalSetZoom) {
|
|
@@ -23662,8 +23703,8 @@
|
|
|
23662
23703
|
}
|
|
23663
23704
|
}
|
|
23664
23705
|
|
|
23665
|
-
/**
|
|
23666
|
-
* Enter overlay text editing mode for a text object
|
|
23706
|
+
/**
|
|
23707
|
+
* Enter overlay text editing mode for a text object
|
|
23667
23708
|
*/
|
|
23668
23709
|
function enterTextOverlayEdit(canvas, target, options) {
|
|
23669
23710
|
// If already in overlay editing, destroy existing editor first
|
|
@@ -23687,35 +23728,35 @@
|
|
|
23687
23728
|
return editor;
|
|
23688
23729
|
}
|
|
23689
23730
|
|
|
23690
|
-
/**
|
|
23691
|
-
* extend this regex to support non english languages
|
|
23692
|
-
*
|
|
23693
|
-
* - ` ` Matches a SPACE character (char code 32).
|
|
23694
|
-
* - `\n` Matches a LINE FEED character (char code 10).
|
|
23695
|
-
* - `.` Matches a "." character (char code 46).
|
|
23696
|
-
* - `,` Matches a "," character (char code 44).
|
|
23697
|
-
* - `;` Matches a ";" character (char code 59).
|
|
23698
|
-
* - `!` Matches a "!" character (char code 33).
|
|
23699
|
-
* - `\?` Matches a "?" character (char code 63).
|
|
23700
|
-
* - `\-` Matches a "-" character (char code 45).
|
|
23731
|
+
/**
|
|
23732
|
+
* extend this regex to support non english languages
|
|
23733
|
+
*
|
|
23734
|
+
* - ` ` Matches a SPACE character (char code 32).
|
|
23735
|
+
* - `\n` Matches a LINE FEED character (char code 10).
|
|
23736
|
+
* - `.` Matches a "." character (char code 46).
|
|
23737
|
+
* - `,` Matches a "," character (char code 44).
|
|
23738
|
+
* - `;` Matches a ";" character (char code 59).
|
|
23739
|
+
* - `!` Matches a "!" character (char code 33).
|
|
23740
|
+
* - `\?` Matches a "?" character (char code 63).
|
|
23741
|
+
* - `\-` Matches a "-" character (char code 45).
|
|
23701
23742
|
*/
|
|
23702
23743
|
// eslint-disable-next-line no-useless-escape
|
|
23703
23744
|
const reNonWord = /[ \n\.,;!\?\-]/;
|
|
23704
23745
|
class ITextBehavior extends FabricText {
|
|
23705
23746
|
constructor() {
|
|
23706
23747
|
super(...arguments);
|
|
23707
|
-
/**
|
|
23708
|
-
* Helps determining when the text is in composition, so that the cursor
|
|
23709
|
-
* rendering is altered.
|
|
23748
|
+
/**
|
|
23749
|
+
* Helps determining when the text is in composition, so that the cursor
|
|
23750
|
+
* rendering is altered.
|
|
23710
23751
|
*/
|
|
23711
23752
|
_defineProperty(this, "_currentCursorOpacity", 1);
|
|
23712
23753
|
}
|
|
23713
|
-
/**
|
|
23714
|
-
* Keeps track if the IText object was selected before the actual click.
|
|
23715
|
-
* This because we want to delay enter editing by a click.
|
|
23754
|
+
/**
|
|
23755
|
+
* Keeps track if the IText object was selected before the actual click.
|
|
23756
|
+
* This because we want to delay enter editing by a click.
|
|
23716
23757
|
*/
|
|
23717
|
-
/**
|
|
23718
|
-
* Initializes all the interactive behavior of IText
|
|
23758
|
+
/**
|
|
23759
|
+
* Initializes all the interactive behavior of IText
|
|
23719
23760
|
*/
|
|
23720
23761
|
initBehavior() {
|
|
23721
23762
|
this._tick = this._tick.bind(this);
|
|
@@ -23728,8 +23769,8 @@
|
|
|
23728
23769
|
return super.onDeselect(options);
|
|
23729
23770
|
}
|
|
23730
23771
|
|
|
23731
|
-
/**
|
|
23732
|
-
* @private
|
|
23772
|
+
/**
|
|
23773
|
+
* @private
|
|
23733
23774
|
*/
|
|
23734
23775
|
_animateCursor(_ref) {
|
|
23735
23776
|
let {
|
|
@@ -23754,8 +23795,8 @@
|
|
|
23754
23795
|
});
|
|
23755
23796
|
}
|
|
23756
23797
|
|
|
23757
|
-
/**
|
|
23758
|
-
* changes the cursor from visible to invisible
|
|
23798
|
+
/**
|
|
23799
|
+
* changes the cursor from visible to invisible
|
|
23759
23800
|
*/
|
|
23760
23801
|
_tick(delay) {
|
|
23761
23802
|
this._currentTickState = this._animateCursor({
|
|
@@ -23766,8 +23807,8 @@
|
|
|
23766
23807
|
});
|
|
23767
23808
|
}
|
|
23768
23809
|
|
|
23769
|
-
/**
|
|
23770
|
-
* Changes the cursor from invisible to visible
|
|
23810
|
+
/**
|
|
23811
|
+
* Changes the cursor from invisible to visible
|
|
23771
23812
|
*/
|
|
23772
23813
|
_onTickComplete() {
|
|
23773
23814
|
var _this$_currentTickCom;
|
|
@@ -23779,16 +23820,16 @@
|
|
|
23779
23820
|
});
|
|
23780
23821
|
}
|
|
23781
23822
|
|
|
23782
|
-
/**
|
|
23783
|
-
* Initializes delayed cursor
|
|
23823
|
+
/**
|
|
23824
|
+
* Initializes delayed cursor
|
|
23784
23825
|
*/
|
|
23785
23826
|
initDelayedCursor(restart) {
|
|
23786
23827
|
this.abortCursorAnimation();
|
|
23787
23828
|
this._tick(restart ? 0 : this.cursorDelay);
|
|
23788
23829
|
}
|
|
23789
23830
|
|
|
23790
|
-
/**
|
|
23791
|
-
* Aborts cursor animation, clears all timeouts and clear textarea context if necessary
|
|
23831
|
+
/**
|
|
23832
|
+
* Aborts cursor animation, clears all timeouts and clear textarea context if necessary
|
|
23792
23833
|
*/
|
|
23793
23834
|
abortCursorAnimation() {
|
|
23794
23835
|
let shouldClear = false;
|
|
@@ -23806,9 +23847,9 @@
|
|
|
23806
23847
|
}
|
|
23807
23848
|
}
|
|
23808
23849
|
|
|
23809
|
-
/**
|
|
23810
|
-
* Restart tue cursor animation if either is in complete state ( between animations )
|
|
23811
|
-
* or if it never started before
|
|
23850
|
+
/**
|
|
23851
|
+
* Restart tue cursor animation if either is in complete state ( between animations )
|
|
23852
|
+
* or if it never started before
|
|
23812
23853
|
*/
|
|
23813
23854
|
restartCursorIfNeeded() {
|
|
23814
23855
|
if ([this._currentTickState, this._currentTickCompleteState].some(cursorAnimation => !cursorAnimation || cursorAnimation.isDone())) {
|
|
@@ -23816,8 +23857,8 @@
|
|
|
23816
23857
|
}
|
|
23817
23858
|
}
|
|
23818
23859
|
|
|
23819
|
-
/**
|
|
23820
|
-
* Selects entire text
|
|
23860
|
+
/**
|
|
23861
|
+
* Selects entire text
|
|
23821
23862
|
*/
|
|
23822
23863
|
selectAll() {
|
|
23823
23864
|
this.selectionStart = 0;
|
|
@@ -23827,26 +23868,26 @@
|
|
|
23827
23868
|
return this;
|
|
23828
23869
|
}
|
|
23829
23870
|
|
|
23830
|
-
/**
|
|
23831
|
-
* Selects entire text and updates the visual state
|
|
23871
|
+
/**
|
|
23872
|
+
* Selects entire text and updates the visual state
|
|
23832
23873
|
*/
|
|
23833
23874
|
cmdAll() {
|
|
23834
23875
|
this.selectAll();
|
|
23835
23876
|
this.renderCursorOrSelection();
|
|
23836
23877
|
}
|
|
23837
23878
|
|
|
23838
|
-
/**
|
|
23839
|
-
* Returns selected text
|
|
23840
|
-
* @return {String}
|
|
23879
|
+
/**
|
|
23880
|
+
* Returns selected text
|
|
23881
|
+
* @return {String}
|
|
23841
23882
|
*/
|
|
23842
23883
|
getSelectedText() {
|
|
23843
23884
|
return this._text.slice(this.selectionStart, this.selectionEnd).join('');
|
|
23844
23885
|
}
|
|
23845
23886
|
|
|
23846
|
-
/**
|
|
23847
|
-
* Find new selection index representing start of current word according to current selection index
|
|
23848
|
-
* @param {Number} startFrom Current selection index
|
|
23849
|
-
* @return {Number} New selection index
|
|
23887
|
+
/**
|
|
23888
|
+
* Find new selection index representing start of current word according to current selection index
|
|
23889
|
+
* @param {Number} startFrom Current selection index
|
|
23890
|
+
* @return {Number} New selection index
|
|
23850
23891
|
*/
|
|
23851
23892
|
findWordBoundaryLeft(startFrom) {
|
|
23852
23893
|
let offset = 0,
|
|
@@ -23866,10 +23907,10 @@
|
|
|
23866
23907
|
return startFrom - offset;
|
|
23867
23908
|
}
|
|
23868
23909
|
|
|
23869
|
-
/**
|
|
23870
|
-
* Find new selection index representing end of current word according to current selection index
|
|
23871
|
-
* @param {Number} startFrom Current selection index
|
|
23872
|
-
* @return {Number} New selection index
|
|
23910
|
+
/**
|
|
23911
|
+
* Find new selection index representing end of current word according to current selection index
|
|
23912
|
+
* @param {Number} startFrom Current selection index
|
|
23913
|
+
* @return {Number} New selection index
|
|
23873
23914
|
*/
|
|
23874
23915
|
findWordBoundaryRight(startFrom) {
|
|
23875
23916
|
let offset = 0,
|
|
@@ -23889,10 +23930,10 @@
|
|
|
23889
23930
|
return startFrom + offset;
|
|
23890
23931
|
}
|
|
23891
23932
|
|
|
23892
|
-
/**
|
|
23893
|
-
* Find new selection index representing start of current line according to current selection index
|
|
23894
|
-
* @param {Number} startFrom Current selection index
|
|
23895
|
-
* @return {Number} New selection index
|
|
23933
|
+
/**
|
|
23934
|
+
* Find new selection index representing start of current line according to current selection index
|
|
23935
|
+
* @param {Number} startFrom Current selection index
|
|
23936
|
+
* @return {Number} New selection index
|
|
23896
23937
|
*/
|
|
23897
23938
|
findLineBoundaryLeft(startFrom) {
|
|
23898
23939
|
let offset = 0,
|
|
@@ -23904,10 +23945,10 @@
|
|
|
23904
23945
|
return startFrom - offset;
|
|
23905
23946
|
}
|
|
23906
23947
|
|
|
23907
|
-
/**
|
|
23908
|
-
* Find new selection index representing end of current line according to current selection index
|
|
23909
|
-
* @param {Number} startFrom Current selection index
|
|
23910
|
-
* @return {Number} New selection index
|
|
23948
|
+
/**
|
|
23949
|
+
* Find new selection index representing end of current line according to current selection index
|
|
23950
|
+
* @param {Number} startFrom Current selection index
|
|
23951
|
+
* @return {Number} New selection index
|
|
23911
23952
|
*/
|
|
23912
23953
|
findLineBoundaryRight(startFrom) {
|
|
23913
23954
|
let offset = 0,
|
|
@@ -23919,11 +23960,11 @@
|
|
|
23919
23960
|
return startFrom + offset;
|
|
23920
23961
|
}
|
|
23921
23962
|
|
|
23922
|
-
/**
|
|
23923
|
-
* Finds index corresponding to beginning or end of a word
|
|
23924
|
-
* @param {Number} selectionStart Index of a character
|
|
23925
|
-
* @param {Number} direction 1 or -1
|
|
23926
|
-
* @return {Number} Index of the beginning or end of a word
|
|
23963
|
+
/**
|
|
23964
|
+
* Finds index corresponding to beginning or end of a word
|
|
23965
|
+
* @param {Number} selectionStart Index of a character
|
|
23966
|
+
* @param {Number} direction 1 or -1
|
|
23967
|
+
* @return {Number} Index of the beginning or end of a word
|
|
23927
23968
|
*/
|
|
23928
23969
|
searchWordBoundary(selectionStart, direction) {
|
|
23929
23970
|
const text = this._text;
|
|
@@ -23941,9 +23982,9 @@
|
|
|
23941
23982
|
return index;
|
|
23942
23983
|
}
|
|
23943
23984
|
|
|
23944
|
-
/**
|
|
23945
|
-
* Selects the word that contains the char at index selectionStart
|
|
23946
|
-
* @param {Number} selectionStart Index of a character
|
|
23985
|
+
/**
|
|
23986
|
+
* Selects the word that contains the char at index selectionStart
|
|
23987
|
+
* @param {Number} selectionStart Index of a character
|
|
23947
23988
|
*/
|
|
23948
23989
|
selectWord(selectionStart) {
|
|
23949
23990
|
selectionStart = selectionStart !== null && selectionStart !== void 0 ? selectionStart : this.selectionStart;
|
|
@@ -23959,9 +24000,9 @@
|
|
|
23959
24000
|
this.renderCursorOrSelection();
|
|
23960
24001
|
}
|
|
23961
24002
|
|
|
23962
|
-
/**
|
|
23963
|
-
* Selects the line that contains selectionStart
|
|
23964
|
-
* @param {Number} selectionStart Index of a character
|
|
24003
|
+
/**
|
|
24004
|
+
* Selects the line that contains selectionStart
|
|
24005
|
+
* @param {Number} selectionStart Index of a character
|
|
23965
24006
|
*/
|
|
23966
24007
|
selectLine(selectionStart) {
|
|
23967
24008
|
selectionStart = selectionStart !== null && selectionStart !== void 0 ? selectionStart : this.selectionStart;
|
|
@@ -23973,8 +24014,8 @@
|
|
|
23973
24014
|
this._updateTextarea();
|
|
23974
24015
|
}
|
|
23975
24016
|
|
|
23976
|
-
/**
|
|
23977
|
-
* Enters editing state
|
|
24017
|
+
/**
|
|
24018
|
+
* Enters editing state
|
|
23978
24019
|
*/
|
|
23979
24020
|
enterEditing(e) {
|
|
23980
24021
|
if (this.isEditing || !this.editable) {
|
|
@@ -23994,8 +24035,8 @@
|
|
|
23994
24035
|
}
|
|
23995
24036
|
}
|
|
23996
24037
|
|
|
23997
|
-
/**
|
|
23998
|
-
* runs the actual logic that enter from editing state, see {@link enterEditing}
|
|
24038
|
+
/**
|
|
24039
|
+
* runs the actual logic that enter from editing state, see {@link enterEditing}
|
|
23999
24040
|
*/
|
|
24000
24041
|
enterEditingImpl() {
|
|
24001
24042
|
if (this.canvas) {
|
|
@@ -24006,6 +24047,18 @@
|
|
|
24006
24047
|
|
|
24007
24048
|
// Check if using overlay editing
|
|
24008
24049
|
if (this.useOverlayEditing) {
|
|
24050
|
+
// For justify text, backup the current working state before overlay editing
|
|
24051
|
+
if (this.textAlign.includes('justify')) {
|
|
24052
|
+
console.log('💾 BACKUP: Saving pre-overlay justify state');
|
|
24053
|
+
this._originalText = this.text; // Store original text to detect changes
|
|
24054
|
+
this._preOverlayJustifyState = {
|
|
24055
|
+
__charBounds: JSON.parse(JSON.stringify(this.__charBounds || [])),
|
|
24056
|
+
__lineHeights: [...(this.__lineHeights || [])],
|
|
24057
|
+
__lineWidths: [...(this.__lineWidths || [])],
|
|
24058
|
+
textLines: [...(this.textLines || [])],
|
|
24059
|
+
_textLines: (this._textLines || []).map(line => [...line])
|
|
24060
|
+
};
|
|
24061
|
+
}
|
|
24009
24062
|
this.enterOverlayEditing();
|
|
24010
24063
|
} else {
|
|
24011
24064
|
this.initHiddenTextarea();
|
|
@@ -24019,8 +24072,8 @@
|
|
|
24019
24072
|
}
|
|
24020
24073
|
}
|
|
24021
24074
|
|
|
24022
|
-
/**
|
|
24023
|
-
* Enter overlay editing mode using DOM textarea overlay
|
|
24075
|
+
/**
|
|
24076
|
+
* Enter overlay editing mode using DOM textarea overlay
|
|
24024
24077
|
*/
|
|
24025
24078
|
enterOverlayEditing() {
|
|
24026
24079
|
this._saveEditingProps();
|
|
@@ -24041,33 +24094,85 @@
|
|
|
24041
24094
|
});
|
|
24042
24095
|
}
|
|
24043
24096
|
|
|
24044
|
-
/**
|
|
24045
|
-
* Commit overlay editing changes
|
|
24097
|
+
/**
|
|
24098
|
+
* Commit overlay editing changes
|
|
24046
24099
|
*/
|
|
24047
24100
|
commitOverlayEdit(text) {
|
|
24048
24101
|
const overlayEditor = this.__overlayEditor;
|
|
24049
|
-
|
|
24050
|
-
|
|
24051
|
-
|
|
24102
|
+
|
|
24103
|
+
// Update text first so browser line cache uses the new content
|
|
24104
|
+
this.text = text;
|
|
24105
|
+
|
|
24106
|
+
// For justify text, restore pre-overlay state only if text didn't change
|
|
24107
|
+
if (this.textAlign.includes('justify')) {
|
|
24108
|
+
const textChanged = this._originalText !== text;
|
|
24109
|
+
console.log('🔄 JUSTIFY CHECK: Text changed:', textChanged);
|
|
24110
|
+
|
|
24111
|
+
// Only restore backup state if text didn't change
|
|
24112
|
+
if (!textChanged) {
|
|
24113
|
+
const backupState = this._preOverlayJustifyState;
|
|
24114
|
+
if (backupState) {
|
|
24115
|
+
var _this$canvas;
|
|
24116
|
+
console.log('📦 RESTORE: Text unchanged, restoring pre-overlay state');
|
|
24117
|
+
// Restore the working character bounds and measurements (but keep current text)
|
|
24118
|
+
this.__charBounds = JSON.parse(JSON.stringify(backupState.__charBounds));
|
|
24119
|
+
this.__lineHeights = [...backupState.__lineHeights];
|
|
24120
|
+
this.__lineWidths = [...backupState.__lineWidths];
|
|
24121
|
+
this.textLines = [...backupState.textLines];
|
|
24122
|
+
this._textLines = backupState._textLines.map(line => [...line]);
|
|
24123
|
+
|
|
24124
|
+
// Clear the backup
|
|
24125
|
+
delete this._preOverlayJustifyState;
|
|
24126
|
+
delete this._originalText;
|
|
24127
|
+
|
|
24128
|
+
// Just request a render, don't rebuild
|
|
24129
|
+
(_this$canvas = this.canvas) === null || _this$canvas === void 0 || _this$canvas.requestRenderAll();
|
|
24130
|
+
return;
|
|
24131
|
+
}
|
|
24132
|
+
} else {
|
|
24133
|
+
console.log('🆕 REBUILD: Text changed, need to rebuild justify layout');
|
|
24134
|
+
// Clean up backup since we won't use it
|
|
24135
|
+
delete this._preOverlayJustifyState;
|
|
24136
|
+
delete this._originalText;
|
|
24137
|
+
}
|
|
24138
|
+
}
|
|
24139
|
+
if (overlayEditor && overlayEditor.textareaElement) {
|
|
24140
|
+
// For non-justify text, extract browser lines normally
|
|
24141
|
+
try {
|
|
24052
24142
|
const result = extractLinesFromDOM(overlayEditor.textareaElement);
|
|
24053
|
-
storeBrowserLines(this, result.lines);
|
|
24143
|
+
storeBrowserLines(this, result.lines, result.width);
|
|
24054
24144
|
} catch (error) {
|
|
24055
24145
|
console.warn('Failed to extract browser lines:', error);
|
|
24056
24146
|
}
|
|
24057
24147
|
}
|
|
24058
24148
|
|
|
24059
|
-
//
|
|
24060
|
-
this.text = text;
|
|
24149
|
+
// Trigger layout recalculation
|
|
24061
24150
|
this.dirty = true;
|
|
24062
24151
|
this.initDimensions();
|
|
24152
|
+
|
|
24153
|
+
// For justify text, force complete reconstruction after overlay editing
|
|
24154
|
+
if (this.textAlign.includes('justify') && 'enlargeSpaces' in this) {
|
|
24155
|
+
setTimeout(() => {
|
|
24156
|
+
var _this$canvas2;
|
|
24157
|
+
console.log('🔧 FORCE REBUILD: Rebuilding justify text after overlay editing');
|
|
24158
|
+
// Force complete reconstruction of character bounds
|
|
24159
|
+
this.__charBounds = [];
|
|
24160
|
+
this.__lineHeights = [];
|
|
24161
|
+
this.__lineWidths = [];
|
|
24162
|
+
// Re-run initDimensions to rebuild everything
|
|
24163
|
+
this.initDimensions();
|
|
24164
|
+
(_this$canvas2 = this.canvas) === null || _this$canvas2 === void 0 || _this$canvas2.requestRenderAll();
|
|
24165
|
+
}, 20);
|
|
24166
|
+
}
|
|
24063
24167
|
this.setCoords();
|
|
24064
24168
|
this.exitEditing();
|
|
24065
24169
|
this.fire('changed');
|
|
24066
24170
|
this.canvas && this.canvas.requestRenderAll();
|
|
24171
|
+
console.log('🔧 DEBUG: commitOverlayEdit complete');
|
|
24067
24172
|
}
|
|
24068
24173
|
|
|
24069
|
-
/**
|
|
24070
|
-
* Cancel overlay editing without changes
|
|
24174
|
+
/**
|
|
24175
|
+
* Cancel overlay editing without changes
|
|
24071
24176
|
*/
|
|
24072
24177
|
cancelOverlayEdit() {
|
|
24073
24178
|
// Restore original text
|
|
@@ -24075,8 +24180,8 @@
|
|
|
24075
24180
|
this.exitEditing();
|
|
24076
24181
|
}
|
|
24077
24182
|
|
|
24078
|
-
/**
|
|
24079
|
-
* called by {@link Canvas#textEditingManager}
|
|
24183
|
+
/**
|
|
24184
|
+
* called by {@link Canvas#textEditingManager}
|
|
24080
24185
|
*/
|
|
24081
24186
|
updateSelectionOnMouseMove(e) {
|
|
24082
24187
|
if (this.getActiveControl()) {
|
|
@@ -24104,8 +24209,8 @@
|
|
|
24104
24209
|
}
|
|
24105
24210
|
}
|
|
24106
24211
|
|
|
24107
|
-
/**
|
|
24108
|
-
* @private
|
|
24212
|
+
/**
|
|
24213
|
+
* @private
|
|
24109
24214
|
*/
|
|
24110
24215
|
_setEditingProps() {
|
|
24111
24216
|
this.hoverCursor = 'text';
|
|
@@ -24117,8 +24222,8 @@
|
|
|
24117
24222
|
this.lockMovementX = this.lockMovementY = true;
|
|
24118
24223
|
}
|
|
24119
24224
|
|
|
24120
|
-
/**
|
|
24121
|
-
* convert from textarea to grapheme indexes
|
|
24225
|
+
/**
|
|
24226
|
+
* convert from textarea to grapheme indexes
|
|
24122
24227
|
*/
|
|
24123
24228
|
fromStringToGraphemeSelection(start, end, text) {
|
|
24124
24229
|
const smallerTextStart = text.slice(0, start),
|
|
@@ -24137,8 +24242,8 @@
|
|
|
24137
24242
|
};
|
|
24138
24243
|
}
|
|
24139
24244
|
|
|
24140
|
-
/**
|
|
24141
|
-
* convert from fabric to textarea values
|
|
24245
|
+
/**
|
|
24246
|
+
* convert from fabric to textarea values
|
|
24142
24247
|
*/
|
|
24143
24248
|
fromGraphemeToStringSelection(start, end, graphemes) {
|
|
24144
24249
|
const smallerTextStart = graphemes.slice(0, start),
|
|
@@ -24157,8 +24262,8 @@
|
|
|
24157
24262
|
};
|
|
24158
24263
|
}
|
|
24159
24264
|
|
|
24160
|
-
/**
|
|
24161
|
-
* @private
|
|
24265
|
+
/**
|
|
24266
|
+
* @private
|
|
24162
24267
|
*/
|
|
24163
24268
|
_updateTextarea() {
|
|
24164
24269
|
console.log('🔤 _updateTextarea called with fabric text:', this.text);
|
|
@@ -24183,8 +24288,8 @@
|
|
|
24183
24288
|
this.updateTextareaPosition();
|
|
24184
24289
|
}
|
|
24185
24290
|
|
|
24186
|
-
/**
|
|
24187
|
-
* @private
|
|
24291
|
+
/**
|
|
24292
|
+
* @private
|
|
24188
24293
|
*/
|
|
24189
24294
|
updateFromTextArea() {
|
|
24190
24295
|
if (!this.hiddenTextarea) {
|
|
@@ -24204,8 +24309,8 @@
|
|
|
24204
24309
|
this.updateTextareaPosition();
|
|
24205
24310
|
}
|
|
24206
24311
|
|
|
24207
|
-
/**
|
|
24208
|
-
* @private
|
|
24312
|
+
/**
|
|
24313
|
+
* @private
|
|
24209
24314
|
*/
|
|
24210
24315
|
updateTextareaPosition() {
|
|
24211
24316
|
if (this.selectionStart === this.selectionEnd) {
|
|
@@ -24215,9 +24320,9 @@
|
|
|
24215
24320
|
}
|
|
24216
24321
|
}
|
|
24217
24322
|
|
|
24218
|
-
/**
|
|
24219
|
-
* @private
|
|
24220
|
-
* @return {Object} style contains style for hiddenTextarea
|
|
24323
|
+
/**
|
|
24324
|
+
* @private
|
|
24325
|
+
* @return {Object} style contains style for hiddenTextarea
|
|
24221
24326
|
*/
|
|
24222
24327
|
_calcTextareaPosition() {
|
|
24223
24328
|
if (!this.canvas) {
|
|
@@ -24264,8 +24369,8 @@
|
|
|
24264
24369
|
};
|
|
24265
24370
|
}
|
|
24266
24371
|
|
|
24267
|
-
/**
|
|
24268
|
-
* @private
|
|
24372
|
+
/**
|
|
24373
|
+
* @private
|
|
24269
24374
|
*/
|
|
24270
24375
|
_saveEditingProps() {
|
|
24271
24376
|
this._savedProps = {
|
|
@@ -24282,8 +24387,8 @@
|
|
|
24282
24387
|
};
|
|
24283
24388
|
}
|
|
24284
24389
|
|
|
24285
|
-
/**
|
|
24286
|
-
* @private
|
|
24390
|
+
/**
|
|
24391
|
+
* @private
|
|
24287
24392
|
*/
|
|
24288
24393
|
_restoreEditingProps() {
|
|
24289
24394
|
if (!this._savedProps) {
|
|
@@ -24303,9 +24408,9 @@
|
|
|
24303
24408
|
delete this._savedProps;
|
|
24304
24409
|
}
|
|
24305
24410
|
|
|
24306
|
-
/**
|
|
24307
|
-
* runs the actual logic that exits from editing state, see {@link exitEditing}
|
|
24308
|
-
* But it does not fire events
|
|
24411
|
+
/**
|
|
24412
|
+
* runs the actual logic that exits from editing state, see {@link exitEditing}
|
|
24413
|
+
* But it does not fire events
|
|
24309
24414
|
*/
|
|
24310
24415
|
exitEditingImpl() {
|
|
24311
24416
|
const hiddenTextarea = this.hiddenTextarea;
|
|
@@ -24326,8 +24431,8 @@
|
|
|
24326
24431
|
}
|
|
24327
24432
|
}
|
|
24328
24433
|
|
|
24329
|
-
/**
|
|
24330
|
-
* Exits from editing state and fires relevant events
|
|
24434
|
+
/**
|
|
24435
|
+
* Exits from editing state and fires relevant events
|
|
24331
24436
|
*/
|
|
24332
24437
|
exitEditing() {
|
|
24333
24438
|
const isTextChanged = this._textBeforeEdit !== this.text;
|
|
@@ -24346,8 +24451,8 @@
|
|
|
24346
24451
|
return this;
|
|
24347
24452
|
}
|
|
24348
24453
|
|
|
24349
|
-
/**
|
|
24350
|
-
* @private
|
|
24454
|
+
/**
|
|
24455
|
+
* @private
|
|
24351
24456
|
*/
|
|
24352
24457
|
_removeExtraneousStyles() {
|
|
24353
24458
|
for (const prop in this.styles) {
|
|
@@ -24357,10 +24462,10 @@
|
|
|
24357
24462
|
}
|
|
24358
24463
|
}
|
|
24359
24464
|
|
|
24360
|
-
/**
|
|
24361
|
-
* remove and reflow a style block from start to end.
|
|
24362
|
-
* @param {Number} start linear start position for removal (included in removal)
|
|
24363
|
-
* @param {Number} end linear end position for removal ( excluded from removal )
|
|
24465
|
+
/**
|
|
24466
|
+
* remove and reflow a style block from start to end.
|
|
24467
|
+
* @param {Number} start linear start position for removal (included in removal)
|
|
24468
|
+
* @param {Number} end linear end position for removal ( excluded from removal )
|
|
24364
24469
|
*/
|
|
24365
24470
|
removeStyleFromTo(start, end) {
|
|
24366
24471
|
const {
|
|
@@ -24413,10 +24518,10 @@
|
|
|
24413
24518
|
}
|
|
24414
24519
|
}
|
|
24415
24520
|
|
|
24416
|
-
/**
|
|
24417
|
-
* Shifts line styles up or down
|
|
24418
|
-
* @param {Number} lineIndex Index of a line
|
|
24419
|
-
* @param {Number} offset Can any number?
|
|
24521
|
+
/**
|
|
24522
|
+
* Shifts line styles up or down
|
|
24523
|
+
* @param {Number} lineIndex Index of a line
|
|
24524
|
+
* @param {Number} offset Can any number?
|
|
24420
24525
|
*/
|
|
24421
24526
|
shiftLineStyles(lineIndex, offset) {
|
|
24422
24527
|
const clonedStyles = Object.assign({}, this.styles);
|
|
@@ -24431,15 +24536,15 @@
|
|
|
24431
24536
|
}
|
|
24432
24537
|
}
|
|
24433
24538
|
|
|
24434
|
-
/**
|
|
24435
|
-
* Handle insertion of more consecutive style lines for when one or more
|
|
24436
|
-
* newlines gets added to the text. Since current style needs to be shifted
|
|
24437
|
-
* first we shift the current style of the number lines needed, then we add
|
|
24438
|
-
* new lines from the last to the first.
|
|
24439
|
-
* @param {Number} lineIndex Index of a line
|
|
24440
|
-
* @param {Number} charIndex Index of a char
|
|
24441
|
-
* @param {Number} qty number of lines to add
|
|
24442
|
-
* @param {Array} copiedStyle Array of objects styles
|
|
24539
|
+
/**
|
|
24540
|
+
* Handle insertion of more consecutive style lines for when one or more
|
|
24541
|
+
* newlines gets added to the text. Since current style needs to be shifted
|
|
24542
|
+
* first we shift the current style of the number lines needed, then we add
|
|
24543
|
+
* new lines from the last to the first.
|
|
24544
|
+
* @param {Number} lineIndex Index of a line
|
|
24545
|
+
* @param {Number} charIndex Index of a char
|
|
24546
|
+
* @param {Number} qty number of lines to add
|
|
24547
|
+
* @param {Array} copiedStyle Array of objects styles
|
|
24443
24548
|
*/
|
|
24444
24549
|
insertNewlineStyleObject(lineIndex, charIndex, qty, copiedStyle) {
|
|
24445
24550
|
const newLineStyles = {};
|
|
@@ -24499,12 +24604,12 @@
|
|
|
24499
24604
|
this._forceClearCache = true;
|
|
24500
24605
|
}
|
|
24501
24606
|
|
|
24502
|
-
/**
|
|
24503
|
-
* Inserts style object for a given line/char index
|
|
24504
|
-
* @param {Number} lineIndex Index of a line
|
|
24505
|
-
* @param {Number} charIndex Index of a char
|
|
24506
|
-
* @param {Number} quantity number Style object to insert, if given
|
|
24507
|
-
* @param {Array} copiedStyle array of style objects
|
|
24607
|
+
/**
|
|
24608
|
+
* Inserts style object for a given line/char index
|
|
24609
|
+
* @param {Number} lineIndex Index of a line
|
|
24610
|
+
* @param {Number} charIndex Index of a char
|
|
24611
|
+
* @param {Number} quantity number Style object to insert, if given
|
|
24612
|
+
* @param {Array} copiedStyle array of style objects
|
|
24508
24613
|
*/
|
|
24509
24614
|
insertCharStyleObject(lineIndex, charIndex, quantity, copiedStyle) {
|
|
24510
24615
|
if (!this.styles) {
|
|
@@ -24553,11 +24658,11 @@
|
|
|
24553
24658
|
}
|
|
24554
24659
|
}
|
|
24555
24660
|
|
|
24556
|
-
/**
|
|
24557
|
-
* Inserts style object(s)
|
|
24558
|
-
* @param {Array} insertedText Characters at the location where style is inserted
|
|
24559
|
-
* @param {Number} start cursor index for inserting style
|
|
24560
|
-
* @param {Array} [copiedStyle] array of style objects to insert.
|
|
24661
|
+
/**
|
|
24662
|
+
* Inserts style object(s)
|
|
24663
|
+
* @param {Array} insertedText Characters at the location where style is inserted
|
|
24664
|
+
* @param {Number} start cursor index for inserting style
|
|
24665
|
+
* @param {Array} [copiedStyle] array of style objects to insert.
|
|
24561
24666
|
*/
|
|
24562
24667
|
insertNewStyleBlock(insertedText, start, copiedStyle) {
|
|
24563
24668
|
const cursorLoc = this.get2DCursorLocation(start, true),
|
|
@@ -24598,12 +24703,12 @@
|
|
|
24598
24703
|
}
|
|
24599
24704
|
}
|
|
24600
24705
|
|
|
24601
|
-
/**
|
|
24602
|
-
* Removes characters from start/end
|
|
24603
|
-
* start/end ar per grapheme position in _text array.
|
|
24604
|
-
*
|
|
24605
|
-
* @param {Number} start
|
|
24606
|
-
* @param {Number} end default to start + 1
|
|
24706
|
+
/**
|
|
24707
|
+
* Removes characters from start/end
|
|
24708
|
+
* start/end ar per grapheme position in _text array.
|
|
24709
|
+
*
|
|
24710
|
+
* @param {Number} start
|
|
24711
|
+
* @param {Number} end default to start + 1
|
|
24607
24712
|
*/
|
|
24608
24713
|
removeChars(start) {
|
|
24609
24714
|
let end = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : start + 1;
|
|
@@ -24616,17 +24721,17 @@
|
|
|
24616
24721
|
this._removeExtraneousStyles();
|
|
24617
24722
|
}
|
|
24618
24723
|
|
|
24619
|
-
/**
|
|
24620
|
-
* insert characters at start position, before start position.
|
|
24621
|
-
* start equal 1 it means the text get inserted between actual grapheme 0 and 1
|
|
24622
|
-
* if style array is provided, it must be as the same length of text in graphemes
|
|
24623
|
-
* if end is provided and is bigger than start, old text is replaced.
|
|
24624
|
-
* start/end ar per grapheme position in _text array.
|
|
24625
|
-
*
|
|
24626
|
-
* @param {String} text text to insert
|
|
24627
|
-
* @param {Array} style array of style objects
|
|
24628
|
-
* @param {Number} start
|
|
24629
|
-
* @param {Number} end default to start + 1
|
|
24724
|
+
/**
|
|
24725
|
+
* insert characters at start position, before start position.
|
|
24726
|
+
* start equal 1 it means the text get inserted between actual grapheme 0 and 1
|
|
24727
|
+
* if style array is provided, it must be as the same length of text in graphemes
|
|
24728
|
+
* if end is provided and is bigger than start, old text is replaced.
|
|
24729
|
+
* start/end ar per grapheme position in _text array.
|
|
24730
|
+
*
|
|
24731
|
+
* @param {String} text text to insert
|
|
24732
|
+
* @param {Array} style array of style objects
|
|
24733
|
+
* @param {Number} start
|
|
24734
|
+
* @param {Number} end default to start + 1
|
|
24630
24735
|
*/
|
|
24631
24736
|
insertChars(text, style, start) {
|
|
24632
24737
|
let end = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : start;
|
|
@@ -24643,9 +24748,9 @@
|
|
|
24643
24748
|
this._removeExtraneousStyles();
|
|
24644
24749
|
}
|
|
24645
24750
|
|
|
24646
|
-
/**
|
|
24647
|
-
* Set the selectionStart and selectionEnd according to the new position of cursor
|
|
24648
|
-
* mimic the key - mouse navigation when shift is pressed.
|
|
24751
|
+
/**
|
|
24752
|
+
* Set the selectionStart and selectionEnd according to the new position of cursor
|
|
24753
|
+
* mimic the key - mouse navigation when shift is pressed.
|
|
24649
24754
|
*/
|
|
24650
24755
|
setSelectionStartEndWithShift(start, end, newSelection) {
|
|
24651
24756
|
if (newSelection <= start) {
|
|
@@ -24676,36 +24781,36 @@
|
|
|
24676
24781
|
}
|
|
24677
24782
|
|
|
24678
24783
|
class ITextKeyBehavior extends ITextBehavior {
|
|
24679
|
-
/**
|
|
24680
|
-
* For functionalities on keyDown
|
|
24681
|
-
* Map a special key to a function of the instance/prototype
|
|
24682
|
-
* If you need different behavior for ESC or TAB or arrows, you have to change
|
|
24683
|
-
* this map setting the name of a function that you build on the IText or
|
|
24684
|
-
* your prototype.
|
|
24685
|
-
* the map change will affect all Instances unless you need for only some text Instances
|
|
24686
|
-
* in that case you have to clone this object and assign your Instance.
|
|
24687
|
-
* this.keysMap = Object.assign({}, this.keysMap);
|
|
24688
|
-
* The function must be in IText.prototype.myFunction And will receive event as args[0]
|
|
24784
|
+
/**
|
|
24785
|
+
* For functionalities on keyDown
|
|
24786
|
+
* Map a special key to a function of the instance/prototype
|
|
24787
|
+
* If you need different behavior for ESC or TAB or arrows, you have to change
|
|
24788
|
+
* this map setting the name of a function that you build on the IText or
|
|
24789
|
+
* your prototype.
|
|
24790
|
+
* the map change will affect all Instances unless you need for only some text Instances
|
|
24791
|
+
* in that case you have to clone this object and assign your Instance.
|
|
24792
|
+
* this.keysMap = Object.assign({}, this.keysMap);
|
|
24793
|
+
* The function must be in IText.prototype.myFunction And will receive event as args[0]
|
|
24689
24794
|
*/
|
|
24690
24795
|
|
|
24691
|
-
/**
|
|
24692
|
-
* For functionalities on keyUp + ctrl || cmd
|
|
24796
|
+
/**
|
|
24797
|
+
* For functionalities on keyUp + ctrl || cmd
|
|
24693
24798
|
*/
|
|
24694
24799
|
|
|
24695
|
-
/**
|
|
24696
|
-
* For functionalities on keyDown + ctrl || cmd
|
|
24800
|
+
/**
|
|
24801
|
+
* For functionalities on keyDown + ctrl || cmd
|
|
24697
24802
|
*/
|
|
24698
24803
|
|
|
24699
|
-
/**
|
|
24700
|
-
* DOM container to append the hiddenTextarea.
|
|
24701
|
-
* An alternative to attaching to the document.body.
|
|
24702
|
-
* Useful to reduce laggish redraw of the full document.body tree and
|
|
24703
|
-
* also with modals event capturing that won't let the textarea take focus.
|
|
24704
|
-
* @type HTMLElement
|
|
24804
|
+
/**
|
|
24805
|
+
* DOM container to append the hiddenTextarea.
|
|
24806
|
+
* An alternative to attaching to the document.body.
|
|
24807
|
+
* Useful to reduce laggish redraw of the full document.body tree and
|
|
24808
|
+
* also with modals event capturing that won't let the textarea take focus.
|
|
24809
|
+
* @type HTMLElement
|
|
24705
24810
|
*/
|
|
24706
24811
|
|
|
24707
|
-
/**
|
|
24708
|
-
* Initializes hidden textarea (needed to bring up keyboard in iOS)
|
|
24812
|
+
/**
|
|
24813
|
+
* Initializes hidden textarea (needed to bring up keyboard in iOS)
|
|
24709
24814
|
*/
|
|
24710
24815
|
initHiddenTextarea() {
|
|
24711
24816
|
const doc = this.canvas && getDocumentFromElement(this.canvas.getElement()) || getFabricDocument();
|
|
@@ -24748,17 +24853,17 @@
|
|
|
24748
24853
|
this.hiddenTextarea = textarea;
|
|
24749
24854
|
}
|
|
24750
24855
|
|
|
24751
|
-
/**
|
|
24752
|
-
* Override this method to customize cursor behavior on textbox blur
|
|
24856
|
+
/**
|
|
24857
|
+
* Override this method to customize cursor behavior on textbox blur
|
|
24753
24858
|
*/
|
|
24754
24859
|
blur() {
|
|
24755
24860
|
this.abortCursorAnimation();
|
|
24756
24861
|
}
|
|
24757
24862
|
|
|
24758
|
-
/**
|
|
24759
|
-
* Handles keydown event
|
|
24760
|
-
* only used for arrows and combination of modifier keys.
|
|
24761
|
-
* @param {KeyboardEvent} e Event object
|
|
24863
|
+
/**
|
|
24864
|
+
* Handles keydown event
|
|
24865
|
+
* only used for arrows and combination of modifier keys.
|
|
24866
|
+
* @param {KeyboardEvent} e Event object
|
|
24762
24867
|
*/
|
|
24763
24868
|
onKeyDown(e) {
|
|
24764
24869
|
if (!this.isEditing) {
|
|
@@ -24784,11 +24889,11 @@
|
|
|
24784
24889
|
}
|
|
24785
24890
|
}
|
|
24786
24891
|
|
|
24787
|
-
/**
|
|
24788
|
-
* Handles keyup event
|
|
24789
|
-
* We handle KeyUp because ie11 and edge have difficulties copy/pasting
|
|
24790
|
-
* if a copy/cut event fired, keyup is dismissed
|
|
24791
|
-
* @param {KeyboardEvent} e Event object
|
|
24892
|
+
/**
|
|
24893
|
+
* Handles keyup event
|
|
24894
|
+
* We handle KeyUp because ie11 and edge have difficulties copy/pasting
|
|
24895
|
+
* if a copy/cut event fired, keyup is dismissed
|
|
24896
|
+
* @param {KeyboardEvent} e Event object
|
|
24792
24897
|
*/
|
|
24793
24898
|
onKeyUp(e) {
|
|
24794
24899
|
if (!this.isEditing || this._copyDone || this.inCompositionMode) {
|
|
@@ -24805,9 +24910,9 @@
|
|
|
24805
24910
|
this.canvas && this.canvas.requestRenderAll();
|
|
24806
24911
|
}
|
|
24807
24912
|
|
|
24808
|
-
/**
|
|
24809
|
-
* Handles onInput event
|
|
24810
|
-
* @param {Event} e Event object
|
|
24913
|
+
/**
|
|
24914
|
+
* Handles onInput event
|
|
24915
|
+
* @param {Event} e Event object
|
|
24811
24916
|
*/
|
|
24812
24917
|
onInput(e) {
|
|
24813
24918
|
const fromPaste = this.fromPaste;
|
|
@@ -24944,15 +25049,15 @@
|
|
|
24944
25049
|
updateAndFire();
|
|
24945
25050
|
}
|
|
24946
25051
|
|
|
24947
|
-
/**
|
|
24948
|
-
* Composition start
|
|
25052
|
+
/**
|
|
25053
|
+
* Composition start
|
|
24949
25054
|
*/
|
|
24950
25055
|
onCompositionStart() {
|
|
24951
25056
|
this.inCompositionMode = true;
|
|
24952
25057
|
}
|
|
24953
25058
|
|
|
24954
|
-
/**
|
|
24955
|
-
* Composition end
|
|
25059
|
+
/**
|
|
25060
|
+
* Composition end
|
|
24956
25061
|
*/
|
|
24957
25062
|
onCompositionEnd() {
|
|
24958
25063
|
this.inCompositionMode = false;
|
|
@@ -24970,8 +25075,8 @@
|
|
|
24970
25075
|
this.updateTextareaPosition();
|
|
24971
25076
|
}
|
|
24972
25077
|
|
|
24973
|
-
/**
|
|
24974
|
-
* Copies selected text
|
|
25078
|
+
/**
|
|
25079
|
+
* Copies selected text
|
|
24975
25080
|
*/
|
|
24976
25081
|
copy() {
|
|
24977
25082
|
if (this.selectionStart === this.selectionEnd) {
|
|
@@ -24990,19 +25095,19 @@
|
|
|
24990
25095
|
this._copyDone = true;
|
|
24991
25096
|
}
|
|
24992
25097
|
|
|
24993
|
-
/**
|
|
24994
|
-
* Pastes text
|
|
25098
|
+
/**
|
|
25099
|
+
* Pastes text
|
|
24995
25100
|
*/
|
|
24996
25101
|
paste() {
|
|
24997
25102
|
this.fromPaste = true;
|
|
24998
25103
|
}
|
|
24999
25104
|
|
|
25000
|
-
/**
|
|
25001
|
-
* Finds the width in pixels before the cursor on the same line
|
|
25002
|
-
* @private
|
|
25003
|
-
* @param {Number} lineIndex
|
|
25004
|
-
* @param {Number} charIndex
|
|
25005
|
-
* @return {Number} widthBeforeCursor width before cursor
|
|
25105
|
+
/**
|
|
25106
|
+
* Finds the width in pixels before the cursor on the same line
|
|
25107
|
+
* @private
|
|
25108
|
+
* @param {Number} lineIndex
|
|
25109
|
+
* @param {Number} charIndex
|
|
25110
|
+
* @return {Number} widthBeforeCursor width before cursor
|
|
25006
25111
|
*/
|
|
25007
25112
|
_getWidthBeforeCursor(lineIndex, charIndex) {
|
|
25008
25113
|
let widthBeforeCursor = this._getLineLeftOffset(lineIndex),
|
|
@@ -25014,11 +25119,11 @@
|
|
|
25014
25119
|
return widthBeforeCursor;
|
|
25015
25120
|
}
|
|
25016
25121
|
|
|
25017
|
-
/**
|
|
25018
|
-
* Gets start offset of a selection
|
|
25019
|
-
* @param {KeyboardEvent} e Event object
|
|
25020
|
-
* @param {Boolean} isRight
|
|
25021
|
-
* @return {Number}
|
|
25122
|
+
/**
|
|
25123
|
+
* Gets start offset of a selection
|
|
25124
|
+
* @param {KeyboardEvent} e Event object
|
|
25125
|
+
* @param {Boolean} isRight
|
|
25126
|
+
* @return {Number}
|
|
25022
25127
|
*/
|
|
25023
25128
|
getDownCursorOffset(e, isRight) {
|
|
25024
25129
|
const selectionProp = this._getSelectionForOffset(e, isRight),
|
|
@@ -25036,12 +25141,12 @@
|
|
|
25036
25141
|
return textAfterCursor.length + indexOnOtherLine + 1 + this.missingNewlineOffset(lineIndex);
|
|
25037
25142
|
}
|
|
25038
25143
|
|
|
25039
|
-
/**
|
|
25040
|
-
* private
|
|
25041
|
-
* Helps finding if the offset should be counted from Start or End
|
|
25042
|
-
* @param {KeyboardEvent} e Event object
|
|
25043
|
-
* @param {Boolean} isRight
|
|
25044
|
-
* @return {Number}
|
|
25144
|
+
/**
|
|
25145
|
+
* private
|
|
25146
|
+
* Helps finding if the offset should be counted from Start or End
|
|
25147
|
+
* @param {KeyboardEvent} e Event object
|
|
25148
|
+
* @param {Boolean} isRight
|
|
25149
|
+
* @return {Number}
|
|
25045
25150
|
*/
|
|
25046
25151
|
_getSelectionForOffset(e, isRight) {
|
|
25047
25152
|
if (e.shiftKey && this.selectionStart !== this.selectionEnd && isRight) {
|
|
@@ -25051,10 +25156,10 @@
|
|
|
25051
25156
|
}
|
|
25052
25157
|
}
|
|
25053
25158
|
|
|
25054
|
-
/**
|
|
25055
|
-
* @param {KeyboardEvent} e Event object
|
|
25056
|
-
* @param {Boolean} isRight
|
|
25057
|
-
* @return {Number}
|
|
25159
|
+
/**
|
|
25160
|
+
* @param {KeyboardEvent} e Event object
|
|
25161
|
+
* @param {Boolean} isRight
|
|
25162
|
+
* @return {Number}
|
|
25058
25163
|
*/
|
|
25059
25164
|
getUpCursorOffset(e, isRight) {
|
|
25060
25165
|
const selectionProp = this._getSelectionForOffset(e, isRight),
|
|
@@ -25073,9 +25178,9 @@
|
|
|
25073
25178
|
return -this._textLines[lineIndex - 1].length + indexOnOtherLine - textBeforeCursor.length + (1 - missingNewlineOffset);
|
|
25074
25179
|
}
|
|
25075
25180
|
|
|
25076
|
-
/**
|
|
25077
|
-
* for a given width it founds the matching character.
|
|
25078
|
-
* @private
|
|
25181
|
+
/**
|
|
25182
|
+
* for a given width it founds the matching character.
|
|
25183
|
+
* @private
|
|
25079
25184
|
*/
|
|
25080
25185
|
_getIndexOnLine(lineIndex, width) {
|
|
25081
25186
|
const line = this._textLines[lineIndex],
|
|
@@ -25105,9 +25210,9 @@
|
|
|
25105
25210
|
return indexOnLine;
|
|
25106
25211
|
}
|
|
25107
25212
|
|
|
25108
|
-
/**
|
|
25109
|
-
* Moves cursor down
|
|
25110
|
-
* @param {KeyboardEvent} e Event object
|
|
25213
|
+
/**
|
|
25214
|
+
* Moves cursor down
|
|
25215
|
+
* @param {KeyboardEvent} e Event object
|
|
25111
25216
|
*/
|
|
25112
25217
|
moveCursorDown(e) {
|
|
25113
25218
|
if (this.selectionStart >= this._text.length && this.selectionEnd >= this._text.length) {
|
|
@@ -25116,9 +25221,9 @@
|
|
|
25116
25221
|
this._moveCursorUpOrDown('Down', e);
|
|
25117
25222
|
}
|
|
25118
25223
|
|
|
25119
|
-
/**
|
|
25120
|
-
* Moves cursor up
|
|
25121
|
-
* @param {KeyboardEvent} e Event object
|
|
25224
|
+
/**
|
|
25225
|
+
* Moves cursor up
|
|
25226
|
+
* @param {KeyboardEvent} e Event object
|
|
25122
25227
|
*/
|
|
25123
25228
|
moveCursorUp(e) {
|
|
25124
25229
|
if (this.selectionStart === 0 && this.selectionEnd === 0) {
|
|
@@ -25127,10 +25232,10 @@
|
|
|
25127
25232
|
this._moveCursorUpOrDown('Up', e);
|
|
25128
25233
|
}
|
|
25129
25234
|
|
|
25130
|
-
/**
|
|
25131
|
-
* Moves cursor up or down, fires the events
|
|
25132
|
-
* @param {String} direction 'Up' or 'Down'
|
|
25133
|
-
* @param {KeyboardEvent} e Event object
|
|
25235
|
+
/**
|
|
25236
|
+
* Moves cursor up or down, fires the events
|
|
25237
|
+
* @param {String} direction 'Up' or 'Down'
|
|
25238
|
+
* @param {KeyboardEvent} e Event object
|
|
25134
25239
|
*/
|
|
25135
25240
|
_moveCursorUpOrDown(direction, e) {
|
|
25136
25241
|
const offset = this[`get${direction}CursorOffset`](e, this._selectionDirection === RIGHT);
|
|
@@ -25152,9 +25257,9 @@
|
|
|
25152
25257
|
}
|
|
25153
25258
|
}
|
|
25154
25259
|
|
|
25155
|
-
/**
|
|
25156
|
-
* Moves cursor with shift
|
|
25157
|
-
* @param {Number} offset
|
|
25260
|
+
/**
|
|
25261
|
+
* Moves cursor with shift
|
|
25262
|
+
* @param {Number} offset
|
|
25158
25263
|
*/
|
|
25159
25264
|
moveCursorWithShift(offset) {
|
|
25160
25265
|
const newSelection = this._selectionDirection === LEFT ? this.selectionStart + offset : this.selectionEnd + offset;
|
|
@@ -25162,9 +25267,9 @@
|
|
|
25162
25267
|
return offset !== 0;
|
|
25163
25268
|
}
|
|
25164
25269
|
|
|
25165
|
-
/**
|
|
25166
|
-
* Moves cursor up without shift
|
|
25167
|
-
* @param {Number} offset
|
|
25270
|
+
/**
|
|
25271
|
+
* Moves cursor up without shift
|
|
25272
|
+
* @param {Number} offset
|
|
25168
25273
|
*/
|
|
25169
25274
|
moveCursorWithoutShift(offset) {
|
|
25170
25275
|
if (offset < 0) {
|
|
@@ -25177,9 +25282,9 @@
|
|
|
25177
25282
|
return offset !== 0;
|
|
25178
25283
|
}
|
|
25179
25284
|
|
|
25180
|
-
/**
|
|
25181
|
-
* Moves cursor left
|
|
25182
|
-
* @param {KeyboardEvent} e Event object
|
|
25285
|
+
/**
|
|
25286
|
+
* Moves cursor left
|
|
25287
|
+
* @param {KeyboardEvent} e Event object
|
|
25183
25288
|
*/
|
|
25184
25289
|
moveCursorLeft(e) {
|
|
25185
25290
|
if (this.selectionStart === 0 && this.selectionEnd === 0) {
|
|
@@ -25188,11 +25293,11 @@
|
|
|
25188
25293
|
this._moveCursorLeftOrRight('Left', e);
|
|
25189
25294
|
}
|
|
25190
25295
|
|
|
25191
|
-
/**
|
|
25192
|
-
* @private
|
|
25193
|
-
* @return {Boolean} true if a change happened
|
|
25194
|
-
*
|
|
25195
|
-
* @todo refactor not to use method name composition
|
|
25296
|
+
/**
|
|
25297
|
+
* @private
|
|
25298
|
+
* @return {Boolean} true if a change happened
|
|
25299
|
+
*
|
|
25300
|
+
* @todo refactor not to use method name composition
|
|
25196
25301
|
*/
|
|
25197
25302
|
_move(e, prop, direction) {
|
|
25198
25303
|
let newValue;
|
|
@@ -25211,23 +25316,23 @@
|
|
|
25211
25316
|
return false;
|
|
25212
25317
|
}
|
|
25213
25318
|
|
|
25214
|
-
/**
|
|
25215
|
-
* @private
|
|
25319
|
+
/**
|
|
25320
|
+
* @private
|
|
25216
25321
|
*/
|
|
25217
25322
|
_moveLeft(e, prop) {
|
|
25218
25323
|
return this._move(e, prop, 'Left');
|
|
25219
25324
|
}
|
|
25220
25325
|
|
|
25221
|
-
/**
|
|
25222
|
-
* @private
|
|
25326
|
+
/**
|
|
25327
|
+
* @private
|
|
25223
25328
|
*/
|
|
25224
25329
|
_moveRight(e, prop) {
|
|
25225
25330
|
return this._move(e, prop, 'Right');
|
|
25226
25331
|
}
|
|
25227
25332
|
|
|
25228
|
-
/**
|
|
25229
|
-
* Moves cursor left without keeping selection
|
|
25230
|
-
* @param {KeyboardEvent} e
|
|
25333
|
+
/**
|
|
25334
|
+
* Moves cursor left without keeping selection
|
|
25335
|
+
* @param {KeyboardEvent} e
|
|
25231
25336
|
*/
|
|
25232
25337
|
moveCursorLeftWithoutShift(e) {
|
|
25233
25338
|
let change = true;
|
|
@@ -25242,9 +25347,9 @@
|
|
|
25242
25347
|
return change;
|
|
25243
25348
|
}
|
|
25244
25349
|
|
|
25245
|
-
/**
|
|
25246
|
-
* Moves cursor left while keeping selection
|
|
25247
|
-
* @param {KeyboardEvent} e
|
|
25350
|
+
/**
|
|
25351
|
+
* Moves cursor left while keeping selection
|
|
25352
|
+
* @param {KeyboardEvent} e
|
|
25248
25353
|
*/
|
|
25249
25354
|
moveCursorLeftWithShift(e) {
|
|
25250
25355
|
if (this._selectionDirection === RIGHT && this.selectionStart !== this.selectionEnd) {
|
|
@@ -25255,9 +25360,9 @@
|
|
|
25255
25360
|
}
|
|
25256
25361
|
}
|
|
25257
25362
|
|
|
25258
|
-
/**
|
|
25259
|
-
* Moves cursor right
|
|
25260
|
-
* @param {KeyboardEvent} e Event object
|
|
25363
|
+
/**
|
|
25364
|
+
* Moves cursor right
|
|
25365
|
+
* @param {KeyboardEvent} e Event object
|
|
25261
25366
|
*/
|
|
25262
25367
|
moveCursorRight(e) {
|
|
25263
25368
|
if (this.selectionStart >= this._text.length && this.selectionEnd >= this._text.length) {
|
|
@@ -25266,10 +25371,10 @@
|
|
|
25266
25371
|
this._moveCursorLeftOrRight('Right', e);
|
|
25267
25372
|
}
|
|
25268
25373
|
|
|
25269
|
-
/**
|
|
25270
|
-
* Moves cursor right or Left, fires event
|
|
25271
|
-
* @param {String} direction 'Left', 'Right'
|
|
25272
|
-
* @param {KeyboardEvent} e Event object
|
|
25374
|
+
/**
|
|
25375
|
+
* Moves cursor right or Left, fires event
|
|
25376
|
+
* @param {String} direction 'Left', 'Right'
|
|
25377
|
+
* @param {KeyboardEvent} e Event object
|
|
25273
25378
|
*/
|
|
25274
25379
|
_moveCursorLeftOrRight(direction, e) {
|
|
25275
25380
|
const actionName = `moveCursor${direction}${e.shiftKey ? 'WithShift' : 'WithoutShift'}`;
|
|
@@ -25284,9 +25389,9 @@
|
|
|
25284
25389
|
}
|
|
25285
25390
|
}
|
|
25286
25391
|
|
|
25287
|
-
/**
|
|
25288
|
-
* Moves cursor right while keeping selection
|
|
25289
|
-
* @param {KeyboardEvent} e
|
|
25392
|
+
/**
|
|
25393
|
+
* Moves cursor right while keeping selection
|
|
25394
|
+
* @param {KeyboardEvent} e
|
|
25290
25395
|
*/
|
|
25291
25396
|
moveCursorRightWithShift(e) {
|
|
25292
25397
|
if (this._selectionDirection === LEFT && this.selectionStart !== this.selectionEnd) {
|
|
@@ -25297,9 +25402,9 @@
|
|
|
25297
25402
|
}
|
|
25298
25403
|
}
|
|
25299
25404
|
|
|
25300
|
-
/**
|
|
25301
|
-
* Moves cursor right without keeping selection
|
|
25302
|
-
* @param {KeyboardEvent} e Event object
|
|
25405
|
+
/**
|
|
25406
|
+
* Moves cursor right without keeping selection
|
|
25407
|
+
* @param {KeyboardEvent} e Event object
|
|
25303
25408
|
*/
|
|
25304
25409
|
moveCursorRightWithoutShift(e) {
|
|
25305
25410
|
let changed = true;
|
|
@@ -25314,8 +25419,8 @@
|
|
|
25314
25419
|
}
|
|
25315
25420
|
}
|
|
25316
25421
|
|
|
25317
|
-
/**
|
|
25318
|
-
* `LEFT_CLICK === 0`
|
|
25422
|
+
/**
|
|
25423
|
+
* `LEFT_CLICK === 0`
|
|
25319
25424
|
*/
|
|
25320
25425
|
const notALeftClick = e => !!e.button;
|
|
25321
25426
|
class ITextClickBehavior extends ITextKeyBehavior {
|
|
@@ -25333,36 +25438,36 @@
|
|
|
25333
25438
|
super.initBehavior();
|
|
25334
25439
|
}
|
|
25335
25440
|
|
|
25336
|
-
/**
|
|
25337
|
-
* If this method returns true a mouse move operation over a text selection
|
|
25338
|
-
* will not prevent the native mouse event allowing the browser to start a drag operation.
|
|
25339
|
-
* shouldStartDragging can be read 'do not prevent default for mouse move event'
|
|
25340
|
-
* To prevent drag and drop between objects both shouldStartDragging and onDragStart should return false
|
|
25341
|
-
* @returns
|
|
25441
|
+
/**
|
|
25442
|
+
* If this method returns true a mouse move operation over a text selection
|
|
25443
|
+
* will not prevent the native mouse event allowing the browser to start a drag operation.
|
|
25444
|
+
* shouldStartDragging can be read 'do not prevent default for mouse move event'
|
|
25445
|
+
* To prevent drag and drop between objects both shouldStartDragging and onDragStart should return false
|
|
25446
|
+
* @returns
|
|
25342
25447
|
*/
|
|
25343
25448
|
shouldStartDragging() {
|
|
25344
25449
|
return this.draggableTextDelegate.isActive();
|
|
25345
25450
|
}
|
|
25346
25451
|
|
|
25347
|
-
/**
|
|
25348
|
-
* @public override this method to control whether instance should/shouldn't become a drag source,
|
|
25349
|
-
* @see also {@link DraggableTextDelegate#isActive}
|
|
25350
|
-
* To prevent drag and drop between objects both shouldStartDragging and onDragStart should return false
|
|
25351
|
-
* @returns {boolean} should handle event
|
|
25452
|
+
/**
|
|
25453
|
+
* @public override this method to control whether instance should/shouldn't become a drag source,
|
|
25454
|
+
* @see also {@link DraggableTextDelegate#isActive}
|
|
25455
|
+
* To prevent drag and drop between objects both shouldStartDragging and onDragStart should return false
|
|
25456
|
+
* @returns {boolean} should handle event
|
|
25352
25457
|
*/
|
|
25353
25458
|
onDragStart(e) {
|
|
25354
25459
|
return this.draggableTextDelegate.onDragStart(e);
|
|
25355
25460
|
}
|
|
25356
25461
|
|
|
25357
|
-
/**
|
|
25358
|
-
* @public override this method to control whether instance should/shouldn't become a drop target
|
|
25462
|
+
/**
|
|
25463
|
+
* @public override this method to control whether instance should/shouldn't become a drop target
|
|
25359
25464
|
*/
|
|
25360
25465
|
canDrop(e) {
|
|
25361
25466
|
return this.draggableTextDelegate.canDrop(e);
|
|
25362
25467
|
}
|
|
25363
25468
|
|
|
25364
|
-
/**
|
|
25365
|
-
* Default handler for double click, select a word or enter overlay editing
|
|
25469
|
+
/**
|
|
25470
|
+
* Default handler for double click, select a word or enter overlay editing
|
|
25366
25471
|
*/
|
|
25367
25472
|
doubleClickHandler(options) {
|
|
25368
25473
|
// Check if we should enter overlay editing mode
|
|
@@ -25379,8 +25484,8 @@
|
|
|
25379
25484
|
this.renderCursorOrSelection();
|
|
25380
25485
|
}
|
|
25381
25486
|
|
|
25382
|
-
/**
|
|
25383
|
-
* Default handler for triple click, select a line
|
|
25487
|
+
/**
|
|
25488
|
+
* Default handler for triple click, select a line
|
|
25384
25489
|
*/
|
|
25385
25490
|
tripleClickHandler(options) {
|
|
25386
25491
|
if (!this.isEditing) {
|
|
@@ -25390,13 +25495,13 @@
|
|
|
25390
25495
|
this.renderCursorOrSelection();
|
|
25391
25496
|
}
|
|
25392
25497
|
|
|
25393
|
-
/**
|
|
25394
|
-
* Default event handler for the basic functionalities needed on _mouseDown
|
|
25395
|
-
* can be overridden to do something different.
|
|
25396
|
-
* Scope of this implementation is: find the click position, set selectionStart
|
|
25397
|
-
* find selectionEnd, initialize the drawing of either cursor or selection area
|
|
25398
|
-
* initializing a mousedDown on a text area will cancel fabricjs knowledge of
|
|
25399
|
-
* current compositionMode. It will be set to false.
|
|
25498
|
+
/**
|
|
25499
|
+
* Default event handler for the basic functionalities needed on _mouseDown
|
|
25500
|
+
* can be overridden to do something different.
|
|
25501
|
+
* Scope of this implementation is: find the click position, set selectionStart
|
|
25502
|
+
* find selectionEnd, initialize the drawing of either cursor or selection area
|
|
25503
|
+
* initializing a mousedDown on a text area will cancel fabricjs knowledge of
|
|
25504
|
+
* current compositionMode. It will be set to false.
|
|
25400
25505
|
*/
|
|
25401
25506
|
_mouseDownHandler(_ref) {
|
|
25402
25507
|
let {
|
|
@@ -25424,9 +25529,9 @@
|
|
|
25424
25529
|
this.selected || (this.selected = alreadySelected || this.isEditing);
|
|
25425
25530
|
}
|
|
25426
25531
|
|
|
25427
|
-
/**
|
|
25428
|
-
* standard handler for mouse up, overridable
|
|
25429
|
-
* @private
|
|
25532
|
+
/**
|
|
25533
|
+
* standard handler for mouse up, overridable
|
|
25534
|
+
* @private
|
|
25430
25535
|
*/
|
|
25431
25536
|
mouseUpHandler(_ref2) {
|
|
25432
25537
|
let {
|
|
@@ -25457,9 +25562,9 @@
|
|
|
25457
25562
|
}
|
|
25458
25563
|
}
|
|
25459
25564
|
|
|
25460
|
-
/**
|
|
25461
|
-
* Changes cursor location in a text depending on passed pointer (x/y) object
|
|
25462
|
-
* @param {TPointerEvent} e Event object
|
|
25565
|
+
/**
|
|
25566
|
+
* Changes cursor location in a text depending on passed pointer (x/y) object
|
|
25567
|
+
* @param {TPointerEvent} e Event object
|
|
25463
25568
|
*/
|
|
25464
25569
|
setCursorByClick(e) {
|
|
25465
25570
|
const newSelection = this.getSelectionStartFromPointer(e),
|
|
@@ -25477,10 +25582,10 @@
|
|
|
25477
25582
|
}
|
|
25478
25583
|
}
|
|
25479
25584
|
|
|
25480
|
-
/**
|
|
25481
|
-
* Returns index of a character corresponding to where an object was clicked
|
|
25482
|
-
* @param {TPointerEvent} e Event object
|
|
25483
|
-
* @return {Number} Index of a character
|
|
25585
|
+
/**
|
|
25586
|
+
* Returns index of a character corresponding to where an object was clicked
|
|
25587
|
+
* @param {TPointerEvent} e Event object
|
|
25588
|
+
* @return {Number} Index of a character
|
|
25484
25589
|
*/
|
|
25485
25590
|
getSelectionStartFromPointer(e) {
|
|
25486
25591
|
const mouseOffset = this.canvas.getScenePoint(e).transform(invertTransform(this.calcTransformMatrix())).add(new Point(-this._getLeftOffset(), -this._getTopOffset()));
|
|
@@ -25526,15 +25631,15 @@
|
|
|
25526
25631
|
}
|
|
25527
25632
|
}
|
|
25528
25633
|
|
|
25529
|
-
/**
|
|
25530
|
-
* Hit Testing and Cursor Positioning System
|
|
25531
|
-
*
|
|
25532
|
-
* Maps pointer coordinates to text positions and provides cursor rectangles
|
|
25533
|
-
* for interactive text editing with grapheme-aware boundaries.
|
|
25634
|
+
/**
|
|
25635
|
+
* Hit Testing and Cursor Positioning System
|
|
25636
|
+
*
|
|
25637
|
+
* Maps pointer coordinates to text positions and provides cursor rectangles
|
|
25638
|
+
* for interactive text editing with grapheme-aware boundaries.
|
|
25534
25639
|
*/
|
|
25535
25640
|
|
|
25536
|
-
/**
|
|
25537
|
-
* Hit test a point against laid out text to find insertion position
|
|
25641
|
+
/**
|
|
25642
|
+
* Hit test a point against laid out text to find insertion position
|
|
25538
25643
|
*/
|
|
25539
25644
|
function hitTest(x, y, layout, options) {
|
|
25540
25645
|
if (layout.lines.length === 0) {
|
|
@@ -25578,8 +25683,8 @@
|
|
|
25578
25683
|
};
|
|
25579
25684
|
}
|
|
25580
25685
|
|
|
25581
|
-
/**
|
|
25582
|
-
* Get cursor rectangle for a given insertion index
|
|
25686
|
+
/**
|
|
25687
|
+
* Get cursor rectangle for a given insertion index
|
|
25583
25688
|
*/
|
|
25584
25689
|
function getCursorRect(insertionIndex, layout, options) {
|
|
25585
25690
|
if (layout.lines.length === 0) {
|
|
@@ -25626,8 +25731,8 @@
|
|
|
25626
25731
|
|
|
25627
25732
|
// Private helper functions
|
|
25628
25733
|
|
|
25629
|
-
/**
|
|
25630
|
-
* Find which line contains the given Y coordinate
|
|
25734
|
+
/**
|
|
25735
|
+
* Find which line contains the given Y coordinate
|
|
25631
25736
|
*/
|
|
25632
25737
|
function findLineAtY(y, lines) {
|
|
25633
25738
|
var _lines;
|
|
@@ -25650,8 +25755,8 @@
|
|
|
25650
25755
|
};
|
|
25651
25756
|
}
|
|
25652
25757
|
|
|
25653
|
-
/**
|
|
25654
|
-
* Find character position within a line at given X coordinate
|
|
25758
|
+
/**
|
|
25759
|
+
* Find character position within a line at given X coordinate
|
|
25655
25760
|
*/
|
|
25656
25761
|
function findCharAtX(x, line, options) {
|
|
25657
25762
|
if (line.bounds.length === 0) {
|
|
@@ -25757,8 +25862,8 @@
|
|
|
25757
25862
|
};
|
|
25758
25863
|
}
|
|
25759
25864
|
|
|
25760
|
-
/**
|
|
25761
|
-
* Calculate total insertion index from line and character indices
|
|
25865
|
+
/**
|
|
25866
|
+
* Calculate total insertion index from line and character indices
|
|
25762
25867
|
*/
|
|
25763
25868
|
function calculateInsertionIndex(lineIndex, graphemeIndex, layout) {
|
|
25764
25869
|
let insertionIndex = 0;
|
|
@@ -25777,8 +25882,8 @@
|
|
|
25777
25882
|
return insertionIndex;
|
|
25778
25883
|
}
|
|
25779
25884
|
|
|
25780
|
-
/**
|
|
25781
|
-
* Find line and grapheme position from insertion index
|
|
25885
|
+
/**
|
|
25886
|
+
* Find line and grapheme position from insertion index
|
|
25782
25887
|
*/
|
|
25783
25888
|
function findPositionFromIndex(insertionIndex, layout) {
|
|
25784
25889
|
let currentIndex = 0;
|
|
@@ -25820,8 +25925,8 @@
|
|
|
25820
25925
|
};
|
|
25821
25926
|
}
|
|
25822
25927
|
|
|
25823
|
-
/**
|
|
25824
|
-
* Calculate Y position of a line
|
|
25928
|
+
/**
|
|
25929
|
+
* Calculate Y position of a line
|
|
25825
25930
|
*/
|
|
25826
25931
|
function calculateLineY(lineIndex, layout, options) {
|
|
25827
25932
|
let y = 0;
|
|
@@ -25924,48 +26029,48 @@
|
|
|
25924
26029
|
|
|
25925
26030
|
// @TODO this is not complete
|
|
25926
26031
|
|
|
25927
|
-
/**
|
|
25928
|
-
* @fires changed
|
|
25929
|
-
* @fires selection:changed
|
|
25930
|
-
* @fires editing:entered
|
|
25931
|
-
* @fires editing:exited
|
|
25932
|
-
* @fires dragstart
|
|
25933
|
-
* @fires drag drag event firing on the drag source
|
|
25934
|
-
* @fires dragend
|
|
25935
|
-
* @fires copy
|
|
25936
|
-
* @fires cut
|
|
25937
|
-
* @fires paste
|
|
25938
|
-
*
|
|
25939
|
-
* #### Supported key combinations
|
|
25940
|
-
* ```
|
|
25941
|
-
* Move cursor: left, right, up, down
|
|
25942
|
-
* Select character: shift + left, shift + right
|
|
25943
|
-
* Select text vertically: shift + up, shift + down
|
|
25944
|
-
* Move cursor by word: alt + left, alt + right
|
|
25945
|
-
* Select words: shift + alt + left, shift + alt + right
|
|
25946
|
-
* Move cursor to line start/end: cmd + left, cmd + right or home, end
|
|
25947
|
-
* Select till start/end of line: cmd + shift + left, cmd + shift + right or shift + home, shift + end
|
|
25948
|
-
* Jump to start/end of text: cmd + up, cmd + down
|
|
25949
|
-
* Select till start/end of text: cmd + shift + up, cmd + shift + down or shift + pgUp, shift + pgDown
|
|
25950
|
-
* Delete character: backspace
|
|
25951
|
-
* Delete word: alt + backspace
|
|
25952
|
-
* Delete line: cmd + backspace
|
|
25953
|
-
* Forward delete: delete
|
|
25954
|
-
* Copy text: ctrl/cmd + c
|
|
25955
|
-
* Paste text: ctrl/cmd + v
|
|
25956
|
-
* Cut text: ctrl/cmd + x
|
|
25957
|
-
* Select entire text: ctrl/cmd + a
|
|
25958
|
-
* Quit editing tab or esc
|
|
25959
|
-
* ```
|
|
25960
|
-
*
|
|
25961
|
-
* #### Supported mouse/touch combination
|
|
25962
|
-
* ```
|
|
25963
|
-
* Position cursor: click/touch
|
|
25964
|
-
* Create selection: click/touch & drag
|
|
25965
|
-
* Create selection: click & shift + click
|
|
25966
|
-
* Select word: double click
|
|
25967
|
-
* Select line: triple click
|
|
25968
|
-
* ```
|
|
26032
|
+
/**
|
|
26033
|
+
* @fires changed
|
|
26034
|
+
* @fires selection:changed
|
|
26035
|
+
* @fires editing:entered
|
|
26036
|
+
* @fires editing:exited
|
|
26037
|
+
* @fires dragstart
|
|
26038
|
+
* @fires drag drag event firing on the drag source
|
|
26039
|
+
* @fires dragend
|
|
26040
|
+
* @fires copy
|
|
26041
|
+
* @fires cut
|
|
26042
|
+
* @fires paste
|
|
26043
|
+
*
|
|
26044
|
+
* #### Supported key combinations
|
|
26045
|
+
* ```
|
|
26046
|
+
* Move cursor: left, right, up, down
|
|
26047
|
+
* Select character: shift + left, shift + right
|
|
26048
|
+
* Select text vertically: shift + up, shift + down
|
|
26049
|
+
* Move cursor by word: alt + left, alt + right
|
|
26050
|
+
* Select words: shift + alt + left, shift + alt + right
|
|
26051
|
+
* Move cursor to line start/end: cmd + left, cmd + right or home, end
|
|
26052
|
+
* Select till start/end of line: cmd + shift + left, cmd + shift + right or shift + home, shift + end
|
|
26053
|
+
* Jump to start/end of text: cmd + up, cmd + down
|
|
26054
|
+
* Select till start/end of text: cmd + shift + up, cmd + shift + down or shift + pgUp, shift + pgDown
|
|
26055
|
+
* Delete character: backspace
|
|
26056
|
+
* Delete word: alt + backspace
|
|
26057
|
+
* Delete line: cmd + backspace
|
|
26058
|
+
* Forward delete: delete
|
|
26059
|
+
* Copy text: ctrl/cmd + c
|
|
26060
|
+
* Paste text: ctrl/cmd + v
|
|
26061
|
+
* Cut text: ctrl/cmd + x
|
|
26062
|
+
* Select entire text: ctrl/cmd + a
|
|
26063
|
+
* Quit editing tab or esc
|
|
26064
|
+
* ```
|
|
26065
|
+
*
|
|
26066
|
+
* #### Supported mouse/touch combination
|
|
26067
|
+
* ```
|
|
26068
|
+
* Position cursor: click/touch
|
|
26069
|
+
* Create selection: click/touch & drag
|
|
26070
|
+
* Create selection: click & shift + click
|
|
26071
|
+
* Select word: double click
|
|
26072
|
+
* Select line: triple click
|
|
26073
|
+
* ```
|
|
25969
26074
|
*/
|
|
25970
26075
|
class IText extends ITextClickBehavior {
|
|
25971
26076
|
static getDefaults() {
|
|
@@ -25980,10 +26085,10 @@
|
|
|
25980
26085
|
return type === 'itext' ? 'i-text' : type;
|
|
25981
26086
|
}
|
|
25982
26087
|
|
|
25983
|
-
/**
|
|
25984
|
-
* Constructor
|
|
25985
|
-
* @param {String} text Text string
|
|
25986
|
-
* @param {Object} [options] Options object
|
|
26088
|
+
/**
|
|
26089
|
+
* Constructor
|
|
26090
|
+
* @param {String} text Text string
|
|
26091
|
+
* @param {Object} [options] Options object
|
|
25987
26092
|
*/
|
|
25988
26093
|
constructor(text, options) {
|
|
25989
26094
|
super(text, {
|
|
@@ -25993,11 +26098,11 @@
|
|
|
25993
26098
|
this.initBehavior();
|
|
25994
26099
|
}
|
|
25995
26100
|
|
|
25996
|
-
/**
|
|
25997
|
-
* While editing handle differently
|
|
25998
|
-
* @private
|
|
25999
|
-
* @param {string} key
|
|
26000
|
-
* @param {*} value
|
|
26101
|
+
/**
|
|
26102
|
+
* While editing handle differently
|
|
26103
|
+
* @private
|
|
26104
|
+
* @param {string} key
|
|
26105
|
+
* @param {*} value
|
|
26001
26106
|
*/
|
|
26002
26107
|
_set(key, value) {
|
|
26003
26108
|
if (this.isEditing && this._savedProps && key in this._savedProps) {
|
|
@@ -26012,28 +26117,28 @@
|
|
|
26012
26117
|
return super._set(key, value);
|
|
26013
26118
|
}
|
|
26014
26119
|
|
|
26015
|
-
/**
|
|
26016
|
-
* Sets selection start (left boundary of a selection)
|
|
26017
|
-
* @param {Number} index Index to set selection start to
|
|
26120
|
+
/**
|
|
26121
|
+
* Sets selection start (left boundary of a selection)
|
|
26122
|
+
* @param {Number} index Index to set selection start to
|
|
26018
26123
|
*/
|
|
26019
26124
|
setSelectionStart(index) {
|
|
26020
26125
|
index = Math.max(index, 0);
|
|
26021
26126
|
this._updateAndFire('selectionStart', index);
|
|
26022
26127
|
}
|
|
26023
26128
|
|
|
26024
|
-
/**
|
|
26025
|
-
* Sets selection end (right boundary of a selection)
|
|
26026
|
-
* @param {Number} index Index to set selection end to
|
|
26129
|
+
/**
|
|
26130
|
+
* Sets selection end (right boundary of a selection)
|
|
26131
|
+
* @param {Number} index Index to set selection end to
|
|
26027
26132
|
*/
|
|
26028
26133
|
setSelectionEnd(index) {
|
|
26029
26134
|
index = Math.min(index, this.text.length);
|
|
26030
26135
|
this._updateAndFire('selectionEnd', index);
|
|
26031
26136
|
}
|
|
26032
26137
|
|
|
26033
|
-
/**
|
|
26034
|
-
* @private
|
|
26035
|
-
* @param {String} property 'selectionStart' or 'selectionEnd'
|
|
26036
|
-
* @param {Number} index new position of property
|
|
26138
|
+
/**
|
|
26139
|
+
* @private
|
|
26140
|
+
* @param {String} property 'selectionStart' or 'selectionEnd'
|
|
26141
|
+
* @param {Number} index new position of property
|
|
26037
26142
|
*/
|
|
26038
26143
|
_updateAndFire(property, index) {
|
|
26039
26144
|
if (this[property] !== index) {
|
|
@@ -26043,9 +26148,9 @@
|
|
|
26043
26148
|
this._updateTextarea();
|
|
26044
26149
|
}
|
|
26045
26150
|
|
|
26046
|
-
/**
|
|
26047
|
-
* Fires the even of selection changed
|
|
26048
|
-
* @private
|
|
26151
|
+
/**
|
|
26152
|
+
* Fires the even of selection changed
|
|
26153
|
+
* @private
|
|
26049
26154
|
*/
|
|
26050
26155
|
_fireSelectionChanged() {
|
|
26051
26156
|
this.fire('selection:changed');
|
|
@@ -26054,25 +26159,25 @@
|
|
|
26054
26159
|
});
|
|
26055
26160
|
}
|
|
26056
26161
|
|
|
26057
|
-
/**
|
|
26058
|
-
* Initialize text dimensions. Render all text on given context
|
|
26059
|
-
* or on a offscreen canvas to get the text width with measureText.
|
|
26060
|
-
* Updates this.width and this.height with the proper values.
|
|
26061
|
-
* Does not return dimensions.
|
|
26062
|
-
* @private
|
|
26162
|
+
/**
|
|
26163
|
+
* Initialize text dimensions. Render all text on given context
|
|
26164
|
+
* or on a offscreen canvas to get the text width with measureText.
|
|
26165
|
+
* Updates this.width and this.height with the proper values.
|
|
26166
|
+
* Does not return dimensions.
|
|
26167
|
+
* @private
|
|
26063
26168
|
*/
|
|
26064
26169
|
initDimensions() {
|
|
26065
26170
|
this.isEditing && this.initDelayedCursor();
|
|
26066
26171
|
super.initDimensions();
|
|
26067
26172
|
}
|
|
26068
26173
|
|
|
26069
|
-
/**
|
|
26070
|
-
* Gets style of a current selection/cursor (at the start position)
|
|
26071
|
-
* if startIndex or endIndex are not provided, selectionStart or selectionEnd will be used.
|
|
26072
|
-
* @param {Number} startIndex Start index to get styles at
|
|
26073
|
-
* @param {Number} endIndex End index to get styles at, if not specified selectionEnd or startIndex + 1
|
|
26074
|
-
* @param {Boolean} [complete] get full style or not
|
|
26075
|
-
* @return {Array} styles an array with one, zero or more Style objects
|
|
26174
|
+
/**
|
|
26175
|
+
* Gets style of a current selection/cursor (at the start position)
|
|
26176
|
+
* if startIndex or endIndex are not provided, selectionStart or selectionEnd will be used.
|
|
26177
|
+
* @param {Number} startIndex Start index to get styles at
|
|
26178
|
+
* @param {Number} endIndex End index to get styles at, if not specified selectionEnd or startIndex + 1
|
|
26179
|
+
* @param {Boolean} [complete] get full style or not
|
|
26180
|
+
* @return {Array} styles an array with one, zero or more Style objects
|
|
26076
26181
|
*/
|
|
26077
26182
|
getSelectionStyles() {
|
|
26078
26183
|
let startIndex = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.selectionStart || 0;
|
|
@@ -26081,11 +26186,11 @@
|
|
|
26081
26186
|
return super.getSelectionStyles(startIndex, endIndex, complete);
|
|
26082
26187
|
}
|
|
26083
26188
|
|
|
26084
|
-
/**
|
|
26085
|
-
* Sets style of a current selection, if no selection exist, do not set anything.
|
|
26086
|
-
* @param {Object} [styles] Styles object
|
|
26087
|
-
* @param {Number} [startIndex] Start index to get styles at
|
|
26088
|
-
* @param {Number} [endIndex] End index to get styles at, if not specified selectionEnd or startIndex + 1
|
|
26189
|
+
/**
|
|
26190
|
+
* Sets style of a current selection, if no selection exist, do not set anything.
|
|
26191
|
+
* @param {Object} [styles] Styles object
|
|
26192
|
+
* @param {Number} [startIndex] Start index to get styles at
|
|
26193
|
+
* @param {Number} [endIndex] End index to get styles at, if not specified selectionEnd or startIndex + 1
|
|
26089
26194
|
*/
|
|
26090
26195
|
setSelectionStyles(styles) {
|
|
26091
26196
|
let startIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.selectionStart || 0;
|
|
@@ -26093,10 +26198,10 @@
|
|
|
26093
26198
|
return super.setSelectionStyles(styles, startIndex, endIndex);
|
|
26094
26199
|
}
|
|
26095
26200
|
|
|
26096
|
-
/**
|
|
26097
|
-
* Returns 2d representation (lineIndex and charIndex) of cursor (or selection start)
|
|
26098
|
-
* @param {Number} [selectionStart] Optional index. When not given, current selectionStart is used.
|
|
26099
|
-
* @param {Boolean} [skipWrapping] consider the location for unwrapped lines. useful to manage styles.
|
|
26201
|
+
/**
|
|
26202
|
+
* Returns 2d representation (lineIndex and charIndex) of cursor (or selection start)
|
|
26203
|
+
* @param {Number} [selectionStart] Optional index. When not given, current selectionStart is used.
|
|
26204
|
+
* @param {Boolean} [skipWrapping] consider the location for unwrapped lines. useful to manage styles.
|
|
26100
26205
|
*/
|
|
26101
26206
|
get2DCursorLocation() {
|
|
26102
26207
|
let selectionStart = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.selectionStart;
|
|
@@ -26104,9 +26209,9 @@
|
|
|
26104
26209
|
return super.get2DCursorLocation(selectionStart, skipWrapping);
|
|
26105
26210
|
}
|
|
26106
26211
|
|
|
26107
|
-
/**
|
|
26108
|
-
* @private
|
|
26109
|
-
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
26212
|
+
/**
|
|
26213
|
+
* @private
|
|
26214
|
+
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
26110
26215
|
*/
|
|
26111
26216
|
render(ctx) {
|
|
26112
26217
|
super.render(ctx);
|
|
@@ -26116,9 +26221,9 @@
|
|
|
26116
26221
|
this.renderCursorOrSelection();
|
|
26117
26222
|
}
|
|
26118
26223
|
|
|
26119
|
-
/**
|
|
26120
|
-
* @override block cursor/selection logic while rendering the exported canvas
|
|
26121
|
-
* @todo this workaround should be replaced with a more robust solution
|
|
26224
|
+
/**
|
|
26225
|
+
* @override block cursor/selection logic while rendering the exported canvas
|
|
26226
|
+
* @todo this workaround should be replaced with a more robust solution
|
|
26122
26227
|
*/
|
|
26123
26228
|
toCanvasElement(options) {
|
|
26124
26229
|
const isEditing = this.isEditing;
|
|
@@ -26128,9 +26233,9 @@
|
|
|
26128
26233
|
return canvas;
|
|
26129
26234
|
}
|
|
26130
26235
|
|
|
26131
|
-
/**
|
|
26132
|
-
* Renders cursor or selection (depending on what exists)
|
|
26133
|
-
* it does on the contextTop. If contextTop is not available, do nothing.
|
|
26236
|
+
/**
|
|
26237
|
+
* Renders cursor or selection (depending on what exists)
|
|
26238
|
+
* it does on the contextTop. If contextTop is not available, do nothing.
|
|
26134
26239
|
*/
|
|
26135
26240
|
renderCursorOrSelection() {
|
|
26136
26241
|
if (!this.isEditing || !this.canvas) {
|
|
@@ -26186,12 +26291,12 @@
|
|
|
26186
26291
|
ctx.restore();
|
|
26187
26292
|
}
|
|
26188
26293
|
|
|
26189
|
-
/**
|
|
26190
|
-
* Finds and returns an array of clip paths that are applied to the parent
|
|
26191
|
-
* group(s) of the current FabricObject instance. The object's hierarchy is
|
|
26192
|
-
* traversed upwards (from the current object towards the root of the canvas),
|
|
26193
|
-
* checking each parent object for the presence of a `clipPath` that is not
|
|
26194
|
-
* absolutely positioned.
|
|
26294
|
+
/**
|
|
26295
|
+
* Finds and returns an array of clip paths that are applied to the parent
|
|
26296
|
+
* group(s) of the current FabricObject instance. The object's hierarchy is
|
|
26297
|
+
* traversed upwards (from the current object towards the root of the canvas),
|
|
26298
|
+
* checking each parent object for the presence of a `clipPath` that is not
|
|
26299
|
+
* absolutely positioned.
|
|
26195
26300
|
*/
|
|
26196
26301
|
findAncestorsWithClipPath() {
|
|
26197
26302
|
const clipPathAncestors = [];
|
|
@@ -26206,13 +26311,13 @@
|
|
|
26206
26311
|
return clipPathAncestors;
|
|
26207
26312
|
}
|
|
26208
26313
|
|
|
26209
|
-
/**
|
|
26210
|
-
* Returns cursor boundaries (left, top, leftOffset, topOffset)
|
|
26211
|
-
* left/top are left/top of entire text box
|
|
26212
|
-
* leftOffset/topOffset are offset from that left/top point of a text box
|
|
26213
|
-
* @private
|
|
26214
|
-
* @param {number} [index] index from start
|
|
26215
|
-
* @param {boolean} [skipCaching]
|
|
26314
|
+
/**
|
|
26315
|
+
* Returns cursor boundaries (left, top, leftOffset, topOffset)
|
|
26316
|
+
* left/top are left/top of entire text box
|
|
26317
|
+
* leftOffset/topOffset are offset from that left/top point of a text box
|
|
26318
|
+
* @private
|
|
26319
|
+
* @param {number} [index] index from start
|
|
26320
|
+
* @param {boolean} [skipCaching]
|
|
26216
26321
|
*/
|
|
26217
26322
|
_getCursorBoundaries() {
|
|
26218
26323
|
let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.selectionStart;
|
|
@@ -26226,11 +26331,11 @@
|
|
|
26226
26331
|
return this._getCursorBoundariesOriginal(index, skipCaching);
|
|
26227
26332
|
}
|
|
26228
26333
|
|
|
26229
|
-
/**
|
|
26230
|
-
* Caches and returns cursor left/top offset relative to instance's center point
|
|
26231
|
-
* @private
|
|
26232
|
-
* @param {number} index index from start
|
|
26233
|
-
* @param {boolean} [skipCaching]
|
|
26334
|
+
/**
|
|
26335
|
+
* Caches and returns cursor left/top offset relative to instance's center point
|
|
26336
|
+
* @private
|
|
26337
|
+
* @param {number} index index from start
|
|
26338
|
+
* @param {boolean} [skipCaching]
|
|
26234
26339
|
*/
|
|
26235
26340
|
_getCursorBoundariesOffsets(index, skipCaching) {
|
|
26236
26341
|
if (skipCaching) {
|
|
@@ -26242,9 +26347,9 @@
|
|
|
26242
26347
|
return this.cursorOffsetCache = this.__getCursorBoundariesOffsets(index);
|
|
26243
26348
|
}
|
|
26244
26349
|
|
|
26245
|
-
/**
|
|
26246
|
-
* Enhanced cursor boundaries using advanced hit testing when available
|
|
26247
|
-
* @private
|
|
26350
|
+
/**
|
|
26351
|
+
* Enhanced cursor boundaries using advanced hit testing when available
|
|
26352
|
+
* @private
|
|
26248
26353
|
*/
|
|
26249
26354
|
_getCursorBoundariesAdvanced(index) {
|
|
26250
26355
|
if (!this.enableAdvancedLayout || !this._layoutTextAdvanced) {
|
|
@@ -26260,9 +26365,9 @@
|
|
|
26260
26365
|
};
|
|
26261
26366
|
}
|
|
26262
26367
|
|
|
26263
|
-
/**
|
|
26264
|
-
* Enhanced selection start from pointer using BiDi-aware hit testing
|
|
26265
|
-
* @override
|
|
26368
|
+
/**
|
|
26369
|
+
* Enhanced selection start from pointer using BiDi-aware hit testing
|
|
26370
|
+
* @override
|
|
26266
26371
|
*/
|
|
26267
26372
|
getSelectionStartFromPointer(e) {
|
|
26268
26373
|
if (!this.enableAdvancedLayout || !this._layoutTextAdvanced) {
|
|
@@ -26276,9 +26381,9 @@
|
|
|
26276
26381
|
return Math.min(hitResult.charIndex, this._text.length);
|
|
26277
26382
|
}
|
|
26278
26383
|
|
|
26279
|
-
/**
|
|
26280
|
-
* Original cursor boundaries implementation
|
|
26281
|
-
* @private
|
|
26384
|
+
/**
|
|
26385
|
+
* Original cursor boundaries implementation
|
|
26386
|
+
* @private
|
|
26282
26387
|
*/
|
|
26283
26388
|
_getCursorBoundariesOriginal(index, skipCaching) {
|
|
26284
26389
|
const left = this._getLeftOffset(),
|
|
@@ -26292,10 +26397,10 @@
|
|
|
26292
26397
|
};
|
|
26293
26398
|
}
|
|
26294
26399
|
|
|
26295
|
-
/**
|
|
26296
|
-
* Calculates cursor left/top offset relative to instance's center point
|
|
26297
|
-
* @private
|
|
26298
|
-
* @param {number} index index from start
|
|
26400
|
+
/**
|
|
26401
|
+
* Calculates cursor left/top offset relative to instance's center point
|
|
26402
|
+
* @private
|
|
26403
|
+
* @param {number} index index from start
|
|
26299
26404
|
*/
|
|
26300
26405
|
__getCursorBoundariesOffsets(index) {
|
|
26301
26406
|
let topOffset = 0,
|
|
@@ -26329,29 +26434,29 @@
|
|
|
26329
26434
|
return boundaries;
|
|
26330
26435
|
}
|
|
26331
26436
|
|
|
26332
|
-
/**
|
|
26333
|
-
* Renders cursor on context Top, outside the animation cycle, on request
|
|
26334
|
-
* Used for the drag/drop effect.
|
|
26335
|
-
* If contextTop is not available, do nothing.
|
|
26437
|
+
/**
|
|
26438
|
+
* Renders cursor on context Top, outside the animation cycle, on request
|
|
26439
|
+
* Used for the drag/drop effect.
|
|
26440
|
+
* If contextTop is not available, do nothing.
|
|
26336
26441
|
*/
|
|
26337
26442
|
renderCursorAt(selectionStart) {
|
|
26338
26443
|
this._renderCursor(this.canvas.contextTop, this._getCursorBoundaries(selectionStart, true), selectionStart);
|
|
26339
26444
|
}
|
|
26340
26445
|
|
|
26341
|
-
/**
|
|
26342
|
-
* Renders cursor
|
|
26343
|
-
* @param {Object} boundaries
|
|
26344
|
-
* @param {CanvasRenderingContext2D} ctx transformed context to draw on
|
|
26446
|
+
/**
|
|
26447
|
+
* Renders cursor
|
|
26448
|
+
* @param {Object} boundaries
|
|
26449
|
+
* @param {CanvasRenderingContext2D} ctx transformed context to draw on
|
|
26345
26450
|
*/
|
|
26346
26451
|
renderCursor(ctx, boundaries) {
|
|
26347
26452
|
this._renderCursor(ctx, boundaries, this.selectionStart);
|
|
26348
26453
|
}
|
|
26349
26454
|
|
|
26350
|
-
/**
|
|
26351
|
-
* Return the data needed to render the cursor for given selection start
|
|
26352
|
-
* The left,top are relative to the object, while width and height are prescaled
|
|
26353
|
-
* to look think with canvas zoom and object scaling,
|
|
26354
|
-
* so they depend on canvas and object scaling
|
|
26455
|
+
/**
|
|
26456
|
+
* Return the data needed to render the cursor for given selection start
|
|
26457
|
+
* The left,top are relative to the object, while width and height are prescaled
|
|
26458
|
+
* to look think with canvas zoom and object scaling,
|
|
26459
|
+
* so they depend on canvas and object scaling
|
|
26355
26460
|
*/
|
|
26356
26461
|
getCursorRenderingData() {
|
|
26357
26462
|
let selectionStart = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.selectionStart;
|
|
@@ -26374,9 +26479,9 @@
|
|
|
26374
26479
|
};
|
|
26375
26480
|
}
|
|
26376
26481
|
|
|
26377
|
-
/**
|
|
26378
|
-
* Render the cursor at the given selectionStart.
|
|
26379
|
-
* @param {CanvasRenderingContext2D} ctx transformed context to draw on
|
|
26482
|
+
/**
|
|
26483
|
+
* Render the cursor at the given selectionStart.
|
|
26484
|
+
* @param {CanvasRenderingContext2D} ctx transformed context to draw on
|
|
26380
26485
|
*/
|
|
26381
26486
|
_renderCursor(ctx, boundaries, selectionStart) {
|
|
26382
26487
|
const {
|
|
@@ -26392,10 +26497,10 @@
|
|
|
26392
26497
|
ctx.fillRect(left, top, width, height);
|
|
26393
26498
|
}
|
|
26394
26499
|
|
|
26395
|
-
/**
|
|
26396
|
-
* Renders text selection
|
|
26397
|
-
* @param {Object} boundaries Object with left/top/leftOffset/topOffset
|
|
26398
|
-
* @param {CanvasRenderingContext2D} ctx transformed context to draw on
|
|
26500
|
+
/**
|
|
26501
|
+
* Renders text selection
|
|
26502
|
+
* @param {Object} boundaries Object with left/top/leftOffset/topOffset
|
|
26503
|
+
* @param {CanvasRenderingContext2D} ctx transformed context to draw on
|
|
26399
26504
|
*/
|
|
26400
26505
|
renderSelection(ctx, boundaries) {
|
|
26401
26506
|
const selection = {
|
|
@@ -26405,8 +26510,8 @@
|
|
|
26405
26510
|
this._renderSelection(ctx, selection, boundaries);
|
|
26406
26511
|
}
|
|
26407
26512
|
|
|
26408
|
-
/**
|
|
26409
|
-
* Renders drag start text selection
|
|
26513
|
+
/**
|
|
26514
|
+
* Renders drag start text selection
|
|
26410
26515
|
*/
|
|
26411
26516
|
renderDragSourceEffect() {
|
|
26412
26517
|
const dragStartSelection = this.draggableTextDelegate.getDragStartSelection();
|
|
@@ -26417,12 +26522,12 @@
|
|
|
26417
26522
|
this.renderCursorAt(dragSelection);
|
|
26418
26523
|
}
|
|
26419
26524
|
|
|
26420
|
-
/**
|
|
26421
|
-
* Renders text selection
|
|
26422
|
-
* @private
|
|
26423
|
-
* @param {{ selectionStart: number, selectionEnd: number }} selection
|
|
26424
|
-
* @param {Object} boundaries Object with left/top/leftOffset/topOffset
|
|
26425
|
-
* @param {CanvasRenderingContext2D} ctx transformed context to draw on
|
|
26525
|
+
/**
|
|
26526
|
+
* Renders text selection
|
|
26527
|
+
* @private
|
|
26528
|
+
* @param {{ selectionStart: number, selectionEnd: number }} selection
|
|
26529
|
+
* @param {Object} boundaries Object with left/top/leftOffset/topOffset
|
|
26530
|
+
* @param {CanvasRenderingContext2D} ctx transformed context to draw on
|
|
26426
26531
|
*/
|
|
26427
26532
|
_renderSelection(ctx, selection, boundaries) {
|
|
26428
26533
|
const selectionStart = selection.selectionStart,
|
|
@@ -26484,34 +26589,34 @@
|
|
|
26484
26589
|
}
|
|
26485
26590
|
}
|
|
26486
26591
|
|
|
26487
|
-
/**
|
|
26488
|
-
* High level function to know the height of the cursor.
|
|
26489
|
-
* the currentChar is the one that precedes the cursor
|
|
26490
|
-
* Returns fontSize of char at the current cursor
|
|
26491
|
-
* Unused from the library, is for the end user
|
|
26492
|
-
* @return {Number} Character font size
|
|
26592
|
+
/**
|
|
26593
|
+
* High level function to know the height of the cursor.
|
|
26594
|
+
* the currentChar is the one that precedes the cursor
|
|
26595
|
+
* Returns fontSize of char at the current cursor
|
|
26596
|
+
* Unused from the library, is for the end user
|
|
26597
|
+
* @return {Number} Character font size
|
|
26493
26598
|
*/
|
|
26494
26599
|
getCurrentCharFontSize() {
|
|
26495
26600
|
const cp = this._getCurrentCharIndex();
|
|
26496
26601
|
return this.getValueOfPropertyAt(cp.l, cp.c, 'fontSize');
|
|
26497
26602
|
}
|
|
26498
26603
|
|
|
26499
|
-
/**
|
|
26500
|
-
* High level function to know the color of the cursor.
|
|
26501
|
-
* the currentChar is the one that precedes the cursor
|
|
26502
|
-
* Returns color (fill) of char at the current cursor
|
|
26503
|
-
* if the text object has a pattern or gradient for filler, it will return that.
|
|
26504
|
-
* Unused by the library, is for the end user
|
|
26505
|
-
* @return {String | TFiller} Character color (fill)
|
|
26604
|
+
/**
|
|
26605
|
+
* High level function to know the color of the cursor.
|
|
26606
|
+
* the currentChar is the one that precedes the cursor
|
|
26607
|
+
* Returns color (fill) of char at the current cursor
|
|
26608
|
+
* if the text object has a pattern or gradient for filler, it will return that.
|
|
26609
|
+
* Unused by the library, is for the end user
|
|
26610
|
+
* @return {String | TFiller} Character color (fill)
|
|
26506
26611
|
*/
|
|
26507
26612
|
getCurrentCharColor() {
|
|
26508
26613
|
const cp = this._getCurrentCharIndex();
|
|
26509
26614
|
return this.getValueOfPropertyAt(cp.l, cp.c, FILL);
|
|
26510
26615
|
}
|
|
26511
26616
|
|
|
26512
|
-
/**
|
|
26513
|
-
* Returns the cursor position for the getCurrent.. functions
|
|
26514
|
-
* @private
|
|
26617
|
+
/**
|
|
26618
|
+
* Returns the cursor position for the getCurrent.. functions
|
|
26619
|
+
* @private
|
|
26515
26620
|
*/
|
|
26516
26621
|
_getCurrentCharIndex() {
|
|
26517
26622
|
const cursorPosition = this.get2DCursorLocation(this.selectionStart, true),
|
|
@@ -26527,52 +26632,52 @@
|
|
|
26527
26632
|
super.dispose();
|
|
26528
26633
|
}
|
|
26529
26634
|
}
|
|
26530
|
-
/**
|
|
26531
|
-
* Index where text selection starts (or where cursor is when there is no selection)
|
|
26532
|
-
* @type Number
|
|
26635
|
+
/**
|
|
26636
|
+
* Index where text selection starts (or where cursor is when there is no selection)
|
|
26637
|
+
* @type Number
|
|
26533
26638
|
*/
|
|
26534
|
-
/**
|
|
26535
|
-
* Index where text selection ends
|
|
26536
|
-
* @type Number
|
|
26639
|
+
/**
|
|
26640
|
+
* Index where text selection ends
|
|
26641
|
+
* @type Number
|
|
26537
26642
|
*/
|
|
26538
|
-
/**
|
|
26539
|
-
* Color of text selection
|
|
26540
|
-
* @type String
|
|
26643
|
+
/**
|
|
26644
|
+
* Color of text selection
|
|
26645
|
+
* @type String
|
|
26541
26646
|
*/
|
|
26542
|
-
/**
|
|
26543
|
-
* Indicates whether text is in editing mode
|
|
26544
|
-
* @type Boolean
|
|
26647
|
+
/**
|
|
26648
|
+
* Indicates whether text is in editing mode
|
|
26649
|
+
* @type Boolean
|
|
26545
26650
|
*/
|
|
26546
|
-
/**
|
|
26547
|
-
* Indicates whether a text can be edited
|
|
26548
|
-
* @type Boolean
|
|
26651
|
+
/**
|
|
26652
|
+
* Indicates whether a text can be edited
|
|
26653
|
+
* @type Boolean
|
|
26549
26654
|
*/
|
|
26550
|
-
/**
|
|
26551
|
-
* Border color of text object while it's in editing mode
|
|
26552
|
-
* @type String
|
|
26655
|
+
/**
|
|
26656
|
+
* Border color of text object while it's in editing mode
|
|
26657
|
+
* @type String
|
|
26553
26658
|
*/
|
|
26554
|
-
/**
|
|
26555
|
-
* Width of cursor (in px)
|
|
26556
|
-
* @type Number
|
|
26659
|
+
/**
|
|
26660
|
+
* Width of cursor (in px)
|
|
26661
|
+
* @type Number
|
|
26557
26662
|
*/
|
|
26558
|
-
/**
|
|
26559
|
-
* Color of text cursor color in editing mode.
|
|
26560
|
-
* if not set (default) will take color from the text.
|
|
26561
|
-
* if set to a color value that fabric can understand, it will
|
|
26562
|
-
* be used instead of the color of the text at the current position.
|
|
26563
|
-
* @type String
|
|
26663
|
+
/**
|
|
26664
|
+
* Color of text cursor color in editing mode.
|
|
26665
|
+
* if not set (default) will take color from the text.
|
|
26666
|
+
* if set to a color value that fabric can understand, it will
|
|
26667
|
+
* be used instead of the color of the text at the current position.
|
|
26668
|
+
* @type String
|
|
26564
26669
|
*/
|
|
26565
|
-
/**
|
|
26566
|
-
* Delay between cursor blink (in ms)
|
|
26567
|
-
* @type Number
|
|
26670
|
+
/**
|
|
26671
|
+
* Delay between cursor blink (in ms)
|
|
26672
|
+
* @type Number
|
|
26568
26673
|
*/
|
|
26569
|
-
/**
|
|
26570
|
-
* Duration of cursor fade in (in ms)
|
|
26571
|
-
* @type Number
|
|
26674
|
+
/**
|
|
26675
|
+
* Duration of cursor fade in (in ms)
|
|
26676
|
+
* @type Number
|
|
26572
26677
|
*/
|
|
26573
|
-
/**
|
|
26574
|
-
* Indicates whether internal text char widths can be cached
|
|
26575
|
-
* @type Boolean
|
|
26678
|
+
/**
|
|
26679
|
+
* Indicates whether internal text char widths can be cached
|
|
26680
|
+
* @type Boolean
|
|
26576
26681
|
*/
|
|
26577
26682
|
_defineProperty(IText, "ownDefaults", iTextDefaultValues);
|
|
26578
26683
|
_defineProperty(IText, "type", 'IText');
|
|
@@ -26594,11 +26699,11 @@
|
|
|
26594
26699
|
|
|
26595
26700
|
// @TODO this is not complete
|
|
26596
26701
|
|
|
26597
|
-
/**
|
|
26598
|
-
* Textbox class, based on IText, allows the user to resize the text rectangle
|
|
26599
|
-
* and wraps lines automatically. Textboxes have their Y scaling locked, the
|
|
26600
|
-
* user can only change width. Height is adjusted automatically based on the
|
|
26601
|
-
* wrapping of lines.
|
|
26702
|
+
/**
|
|
26703
|
+
* Textbox class, based on IText, allows the user to resize the text rectangle
|
|
26704
|
+
* and wraps lines automatically. Textboxes have their Y scaling locked, the
|
|
26705
|
+
* user can only change width. Height is adjusted automatically based on the
|
|
26706
|
+
* wrapping of lines.
|
|
26602
26707
|
*/
|
|
26603
26708
|
class Textbox extends IText {
|
|
26604
26709
|
static getDefaults() {
|
|
@@ -26608,10 +26713,10 @@
|
|
|
26608
26713
|
};
|
|
26609
26714
|
}
|
|
26610
26715
|
|
|
26611
|
-
/**
|
|
26612
|
-
* Constructor
|
|
26613
|
-
* @param {String} text Text string
|
|
26614
|
-
* @param {Object} [options] Options object
|
|
26716
|
+
/**
|
|
26717
|
+
* Constructor
|
|
26718
|
+
* @param {String} text Text string
|
|
26719
|
+
* @param {Object} [options] Options object
|
|
26615
26720
|
*/
|
|
26616
26721
|
constructor(text, options) {
|
|
26617
26722
|
super(text, {
|
|
@@ -26621,10 +26726,10 @@
|
|
|
26621
26726
|
this.initializeEventListeners();
|
|
26622
26727
|
}
|
|
26623
26728
|
|
|
26624
|
-
/**
|
|
26625
|
-
* Creates the default control object.
|
|
26626
|
-
* If you prefer to have on instance of controls shared among all objects
|
|
26627
|
-
* make this function return an empty object and add controls to the ownDefaults object
|
|
26729
|
+
/**
|
|
26730
|
+
* Creates the default control object.
|
|
26731
|
+
* If you prefer to have on instance of controls shared among all objects
|
|
26732
|
+
* make this function return an empty object and add controls to the ownDefaults object
|
|
26628
26733
|
*/
|
|
26629
26734
|
static createControls() {
|
|
26630
26735
|
return {
|
|
@@ -26632,11 +26737,11 @@
|
|
|
26632
26737
|
};
|
|
26633
26738
|
}
|
|
26634
26739
|
|
|
26635
|
-
/**
|
|
26636
|
-
* Unlike superclass's version of this function, Textbox does not update
|
|
26637
|
-
* its width.
|
|
26638
|
-
* @private
|
|
26639
|
-
* @override
|
|
26740
|
+
/**
|
|
26741
|
+
* Unlike superclass's version of this function, Textbox does not update
|
|
26742
|
+
* its width.
|
|
26743
|
+
* @private
|
|
26744
|
+
* @override
|
|
26640
26745
|
*/
|
|
26641
26746
|
initDimensions() {
|
|
26642
26747
|
if (!this.initialized) {
|
|
@@ -26704,6 +26809,7 @@
|
|
|
26704
26809
|
if (this._usingBrowserWrapping) {
|
|
26705
26810
|
this._browserWrapInitialized = true;
|
|
26706
26811
|
}
|
|
26812
|
+
this.calcTextWidth();
|
|
26707
26813
|
if (this.textAlign.includes(JUSTIFY)) {
|
|
26708
26814
|
// For browser wrapping fonts, apply browser-calculated justify spaces
|
|
26709
26815
|
if (this._usingBrowserWrapping) {
|
|
@@ -26712,15 +26818,8 @@
|
|
|
26712
26818
|
return;
|
|
26713
26819
|
}
|
|
26714
26820
|
|
|
26715
|
-
//
|
|
26716
|
-
|
|
26717
|
-
const lastDragTime = this._lastInitDimensionsTime || 0;
|
|
26718
|
-
const isDuringDrag = now - lastDragTime < 200; // 200ms window for drag detection
|
|
26719
|
-
|
|
26720
|
-
if (isDuringDrag) {
|
|
26721
|
-
console.log('🔤 Skipping justify during drag operation to prevent snapping');
|
|
26722
|
-
return;
|
|
26723
|
-
}
|
|
26821
|
+
// Note: Removed drag detection logic that was causing issues
|
|
26822
|
+
// Justify alignment will now apply immediately when needed
|
|
26724
26823
|
|
|
26725
26824
|
// For non-browser-wrapping fonts, use Fabric's justify system
|
|
26726
26825
|
// once text is measured we need to make space fatter to make justified text.
|
|
@@ -26778,11 +26877,40 @@
|
|
|
26778
26877
|
} else {
|
|
26779
26878
|
this.height = this.calcTextHeight();
|
|
26780
26879
|
}
|
|
26880
|
+
|
|
26881
|
+
// Double-check that justify was applied by checking space widths
|
|
26882
|
+
// Skip validation during rapid width changes to prevent interference
|
|
26883
|
+
console.log('🔍 JUSTIFY CHECK:', this.textAlign.includes('justify'), !!this.__charBounds, !this._skipJustifyValidation);
|
|
26884
|
+
if (this.textAlign.includes('justify') && this.__charBounds && !this._skipJustifyValidation) {
|
|
26885
|
+
setTimeout(() => {
|
|
26886
|
+
// Verify justify was applied by checking if space widths vary
|
|
26887
|
+
let hasVariableSpaces = false;
|
|
26888
|
+
this.__charBounds.forEach((lineBounds, i) => {
|
|
26889
|
+
if (lineBounds && this._textLines && this._textLines[i]) {
|
|
26890
|
+
const spaces = lineBounds.filter((bound, j) => /\s/.test(this._textLines[i][j]));
|
|
26891
|
+
if (spaces.length > 1) {
|
|
26892
|
+
const firstSpaceWidth = spaces[0].width;
|
|
26893
|
+
hasVariableSpaces = spaces.some(space => Math.abs(space.width - firstSpaceWidth) > 0.1);
|
|
26894
|
+
}
|
|
26895
|
+
}
|
|
26896
|
+
});
|
|
26897
|
+
if (!hasVariableSpaces && this.__charBounds.length > 0) {
|
|
26898
|
+
console.warn(' ⚠️ Justify spaces still uniform - forcing enlargeSpaces again');
|
|
26899
|
+
if (this.enlargeSpaces) {
|
|
26900
|
+
var _this$canvas3;
|
|
26901
|
+
this.enlargeSpaces();
|
|
26902
|
+
(_this$canvas3 = this.canvas) === null || _this$canvas3 === void 0 || _this$canvas3.requestRenderAll();
|
|
26903
|
+
}
|
|
26904
|
+
} else {
|
|
26905
|
+
console.log(' ✅ Justify spaces properly expanded');
|
|
26906
|
+
}
|
|
26907
|
+
}, 10);
|
|
26908
|
+
}
|
|
26781
26909
|
}
|
|
26782
26910
|
|
|
26783
|
-
/**
|
|
26784
|
-
* Schedule justify calculation after font loads (Textbox-specific)
|
|
26785
|
-
* @private
|
|
26911
|
+
/**
|
|
26912
|
+
* Schedule justify calculation after font loads (Textbox-specific)
|
|
26913
|
+
* @private
|
|
26786
26914
|
*/
|
|
26787
26915
|
_scheduleJustifyAfterFontLoad() {
|
|
26788
26916
|
if (typeof document === 'undefined' || !('fonts' in document)) {
|
|
@@ -26796,22 +26924,22 @@
|
|
|
26796
26924
|
this._fontJustifyScheduled = true;
|
|
26797
26925
|
const fontSpec = `${this.fontSize}px ${this.fontFamily}`;
|
|
26798
26926
|
document.fonts.load(fontSpec).then(() => {
|
|
26799
|
-
var _this$
|
|
26927
|
+
var _this$canvas4;
|
|
26800
26928
|
this._fontJustifyScheduled = false;
|
|
26801
26929
|
console.log('🔧 Textbox: Font loaded, applying justify alignment');
|
|
26802
26930
|
|
|
26803
26931
|
// Re-run initDimensions to ensure proper justify calculation
|
|
26804
26932
|
this.initDimensions();
|
|
26805
|
-
(_this$
|
|
26933
|
+
(_this$canvas4 = this.canvas) === null || _this$canvas4 === void 0 || _this$canvas4.requestRenderAll();
|
|
26806
26934
|
}).catch(() => {
|
|
26807
26935
|
this._fontJustifyScheduled = false;
|
|
26808
26936
|
console.warn('⚠️ Textbox: Font loading failed, justify may be incorrect');
|
|
26809
26937
|
});
|
|
26810
26938
|
}
|
|
26811
26939
|
|
|
26812
|
-
/**
|
|
26813
|
-
* Advanced dimensions calculation using new layout engine
|
|
26814
|
-
* @private
|
|
26940
|
+
/**
|
|
26941
|
+
* Advanced dimensions calculation using new layout engine
|
|
26942
|
+
* @private
|
|
26815
26943
|
*/
|
|
26816
26944
|
initDimensionsAdvanced() {
|
|
26817
26945
|
if (!this.initialized) {
|
|
@@ -26866,9 +26994,9 @@
|
|
|
26866
26994
|
this.dirty = true;
|
|
26867
26995
|
}
|
|
26868
26996
|
|
|
26869
|
-
/**
|
|
26870
|
-
* Generate style map from new layout format
|
|
26871
|
-
* @private
|
|
26997
|
+
/**
|
|
26998
|
+
* Generate style map from new layout format
|
|
26999
|
+
* @private
|
|
26872
27000
|
*/
|
|
26873
27001
|
_generateStyleMapFromLayout(layout) {
|
|
26874
27002
|
const map = {};
|
|
@@ -26890,12 +27018,12 @@
|
|
|
26890
27018
|
return map;
|
|
26891
27019
|
}
|
|
26892
27020
|
|
|
26893
|
-
/**
|
|
26894
|
-
* Generate an object that translates the style object so that it is
|
|
26895
|
-
* broken up by visual lines (new lines and automatic wrapping).
|
|
26896
|
-
* The original text styles object is broken up by actual lines (new lines only),
|
|
26897
|
-
* which is only sufficient for Text / IText
|
|
26898
|
-
* @private
|
|
27021
|
+
/**
|
|
27022
|
+
* Generate an object that translates the style object so that it is
|
|
27023
|
+
* broken up by visual lines (new lines and automatic wrapping).
|
|
27024
|
+
* The original text styles object is broken up by actual lines (new lines only),
|
|
27025
|
+
* which is only sufficient for Text / IText
|
|
27026
|
+
* @private
|
|
26899
27027
|
*/
|
|
26900
27028
|
_generateStyleMap(textInfo) {
|
|
26901
27029
|
let realLineCount = 0,
|
|
@@ -26922,10 +27050,10 @@
|
|
|
26922
27050
|
return map;
|
|
26923
27051
|
}
|
|
26924
27052
|
|
|
26925
|
-
/**
|
|
26926
|
-
* Returns true if object has a style property or has it on a specified line
|
|
26927
|
-
* @param {Number} lineIndex
|
|
26928
|
-
* @return {Boolean}
|
|
27053
|
+
/**
|
|
27054
|
+
* Returns true if object has a style property or has it on a specified line
|
|
27055
|
+
* @param {Number} lineIndex
|
|
27056
|
+
* @return {Boolean}
|
|
26929
27057
|
*/
|
|
26930
27058
|
styleHas(property, lineIndex) {
|
|
26931
27059
|
if (this._styleMap && !this.isWrapping) {
|
|
@@ -26937,10 +27065,10 @@
|
|
|
26937
27065
|
return super.styleHas(property, lineIndex);
|
|
26938
27066
|
}
|
|
26939
27067
|
|
|
26940
|
-
/**
|
|
26941
|
-
* Returns true if object has no styling or no styling in a line
|
|
26942
|
-
* @param {Number} lineIndex , lineIndex is on wrapped lines.
|
|
26943
|
-
* @return {Boolean}
|
|
27068
|
+
/**
|
|
27069
|
+
* Returns true if object has no styling or no styling in a line
|
|
27070
|
+
* @param {Number} lineIndex , lineIndex is on wrapped lines.
|
|
27071
|
+
* @return {Boolean}
|
|
26944
27072
|
*/
|
|
26945
27073
|
isEmptyStyles(lineIndex) {
|
|
26946
27074
|
if (!this.styles) {
|
|
@@ -26977,11 +27105,11 @@
|
|
|
26977
27105
|
return true;
|
|
26978
27106
|
}
|
|
26979
27107
|
|
|
26980
|
-
/**
|
|
26981
|
-
* @protected
|
|
26982
|
-
* @param {Number} lineIndex
|
|
26983
|
-
* @param {Number} charIndex
|
|
26984
|
-
* @return {TextStyleDeclaration} a style object reference to the existing one or a new empty object when undefined
|
|
27108
|
+
/**
|
|
27109
|
+
* @protected
|
|
27110
|
+
* @param {Number} lineIndex
|
|
27111
|
+
* @param {Number} charIndex
|
|
27112
|
+
* @return {TextStyleDeclaration} a style object reference to the existing one or a new empty object when undefined
|
|
26985
27113
|
*/
|
|
26986
27114
|
_getStyleDeclaration(lineIndex, charIndex) {
|
|
26987
27115
|
if (this._styleMap && !this.isWrapping) {
|
|
@@ -26995,59 +27123,59 @@
|
|
|
26995
27123
|
return super._getStyleDeclaration(lineIndex, charIndex);
|
|
26996
27124
|
}
|
|
26997
27125
|
|
|
26998
|
-
/**
|
|
26999
|
-
* @param {Number} lineIndex
|
|
27000
|
-
* @param {Number} charIndex
|
|
27001
|
-
* @param {Object} style
|
|
27002
|
-
* @private
|
|
27126
|
+
/**
|
|
27127
|
+
* @param {Number} lineIndex
|
|
27128
|
+
* @param {Number} charIndex
|
|
27129
|
+
* @param {Object} style
|
|
27130
|
+
* @private
|
|
27003
27131
|
*/
|
|
27004
27132
|
_setStyleDeclaration(lineIndex, charIndex, style) {
|
|
27005
27133
|
const map = this._styleMap[lineIndex];
|
|
27006
27134
|
super._setStyleDeclaration(map.line, map.offset + charIndex, style);
|
|
27007
27135
|
}
|
|
27008
27136
|
|
|
27009
|
-
/**
|
|
27010
|
-
* @param {Number} lineIndex
|
|
27011
|
-
* @param {Number} charIndex
|
|
27012
|
-
* @private
|
|
27137
|
+
/**
|
|
27138
|
+
* @param {Number} lineIndex
|
|
27139
|
+
* @param {Number} charIndex
|
|
27140
|
+
* @private
|
|
27013
27141
|
*/
|
|
27014
27142
|
_deleteStyleDeclaration(lineIndex, charIndex) {
|
|
27015
27143
|
const map = this._styleMap[lineIndex];
|
|
27016
27144
|
super._deleteStyleDeclaration(map.line, map.offset + charIndex);
|
|
27017
27145
|
}
|
|
27018
27146
|
|
|
27019
|
-
/**
|
|
27020
|
-
* probably broken need a fix
|
|
27021
|
-
* Returns the real style line that correspond to the wrapped lineIndex line
|
|
27022
|
-
* Used just to verify if the line does exist or not.
|
|
27023
|
-
* @param {Number} lineIndex
|
|
27024
|
-
* @returns {Boolean} if the line exists or not
|
|
27025
|
-
* @private
|
|
27147
|
+
/**
|
|
27148
|
+
* probably broken need a fix
|
|
27149
|
+
* Returns the real style line that correspond to the wrapped lineIndex line
|
|
27150
|
+
* Used just to verify if the line does exist or not.
|
|
27151
|
+
* @param {Number} lineIndex
|
|
27152
|
+
* @returns {Boolean} if the line exists or not
|
|
27153
|
+
* @private
|
|
27026
27154
|
*/
|
|
27027
27155
|
_getLineStyle(lineIndex) {
|
|
27028
27156
|
const map = this._styleMap[lineIndex];
|
|
27029
27157
|
return !!this.styles[map.line];
|
|
27030
27158
|
}
|
|
27031
27159
|
|
|
27032
|
-
/**
|
|
27033
|
-
* Set the line style to an empty object so that is initialized
|
|
27034
|
-
* @param {Number} lineIndex
|
|
27035
|
-
* @param {Object} style
|
|
27036
|
-
* @private
|
|
27160
|
+
/**
|
|
27161
|
+
* Set the line style to an empty object so that is initialized
|
|
27162
|
+
* @param {Number} lineIndex
|
|
27163
|
+
* @param {Object} style
|
|
27164
|
+
* @private
|
|
27037
27165
|
*/
|
|
27038
27166
|
_setLineStyle(lineIndex) {
|
|
27039
27167
|
const map = this._styleMap[lineIndex];
|
|
27040
27168
|
super._setLineStyle(map.line);
|
|
27041
27169
|
}
|
|
27042
27170
|
|
|
27043
|
-
/**
|
|
27044
|
-
* Wraps text using the 'width' property of Textbox. First this function
|
|
27045
|
-
* splits text on newlines, so we preserve newlines entered by the user.
|
|
27046
|
-
* Then it wraps each line using the width of the Textbox by calling
|
|
27047
|
-
* _wrapLine().
|
|
27048
|
-
* @param {Array} lines The string array of text that is split into lines
|
|
27049
|
-
* @param {Number} desiredWidth width you want to wrap to
|
|
27050
|
-
* @returns {Array} Array of lines
|
|
27171
|
+
/**
|
|
27172
|
+
* Wraps text using the 'width' property of Textbox. First this function
|
|
27173
|
+
* splits text on newlines, so we preserve newlines entered by the user.
|
|
27174
|
+
* Then it wraps each line using the width of the Textbox by calling
|
|
27175
|
+
* _wrapLine().
|
|
27176
|
+
* @param {Array} lines The string array of text that is split into lines
|
|
27177
|
+
* @param {Number} desiredWidth width you want to wrap to
|
|
27178
|
+
* @returns {Array} Array of lines
|
|
27051
27179
|
*/
|
|
27052
27180
|
_wrapText(lines, desiredWidth) {
|
|
27053
27181
|
this.isWrapping = true;
|
|
@@ -27061,12 +27189,12 @@
|
|
|
27061
27189
|
return wrapped;
|
|
27062
27190
|
}
|
|
27063
27191
|
|
|
27064
|
-
/**
|
|
27065
|
-
* For each line of text terminated by an hard line stop,
|
|
27066
|
-
* measure each word width and extract the largest word from all.
|
|
27067
|
-
* The returned words here are the one that at the end will be rendered.
|
|
27068
|
-
* @param {string[]} lines the lines we need to measure
|
|
27069
|
-
*
|
|
27192
|
+
/**
|
|
27193
|
+
* For each line of text terminated by an hard line stop,
|
|
27194
|
+
* measure each word width and extract the largest word from all.
|
|
27195
|
+
* The returned words here are the one that at the end will be rendered.
|
|
27196
|
+
* @param {string[]} lines the lines we need to measure
|
|
27197
|
+
*
|
|
27070
27198
|
*/
|
|
27071
27199
|
getGraphemeDataForRender(lines) {
|
|
27072
27200
|
const splitByGrapheme = this.splitByGrapheme,
|
|
@@ -27099,17 +27227,17 @@
|
|
|
27099
27227
|
};
|
|
27100
27228
|
}
|
|
27101
27229
|
|
|
27102
|
-
/**
|
|
27103
|
-
* Helper function to measure a string of text, given its lineIndex and charIndex offset
|
|
27104
|
-
* It gets called when charBounds are not available yet.
|
|
27105
|
-
* Override if necessary
|
|
27106
|
-
* Use with {@link Textbox#wordSplit}
|
|
27107
|
-
*
|
|
27108
|
-
* @param {CanvasRenderingContext2D} ctx
|
|
27109
|
-
* @param {String} text
|
|
27110
|
-
* @param {number} lineIndex
|
|
27111
|
-
* @param {number} charOffset
|
|
27112
|
-
* @returns {number}
|
|
27230
|
+
/**
|
|
27231
|
+
* Helper function to measure a string of text, given its lineIndex and charIndex offset
|
|
27232
|
+
* It gets called when charBounds are not available yet.
|
|
27233
|
+
* Override if necessary
|
|
27234
|
+
* Use with {@link Textbox#wordSplit}
|
|
27235
|
+
*
|
|
27236
|
+
* @param {CanvasRenderingContext2D} ctx
|
|
27237
|
+
* @param {String} text
|
|
27238
|
+
* @param {number} lineIndex
|
|
27239
|
+
* @param {number} charOffset
|
|
27240
|
+
* @returns {number}
|
|
27113
27241
|
*/
|
|
27114
27242
|
_measureWord(word, lineIndex) {
|
|
27115
27243
|
let charOffset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
@@ -27124,26 +27252,26 @@
|
|
|
27124
27252
|
return width;
|
|
27125
27253
|
}
|
|
27126
27254
|
|
|
27127
|
-
/**
|
|
27128
|
-
* Override this method to customize word splitting
|
|
27129
|
-
* Use with {@link Textbox#_measureWord}
|
|
27130
|
-
* @param {string} value
|
|
27131
|
-
* @returns {string[]} array of words
|
|
27255
|
+
/**
|
|
27256
|
+
* Override this method to customize word splitting
|
|
27257
|
+
* Use with {@link Textbox#_measureWord}
|
|
27258
|
+
* @param {string} value
|
|
27259
|
+
* @returns {string[]} array of words
|
|
27132
27260
|
*/
|
|
27133
27261
|
wordSplit(value) {
|
|
27134
27262
|
return value.split(this._wordJoiners);
|
|
27135
27263
|
}
|
|
27136
27264
|
|
|
27137
|
-
/**
|
|
27138
|
-
* Wraps a line of text using the width of the Textbox as desiredWidth
|
|
27139
|
-
* and leveraging the known width o words from GraphemeData
|
|
27140
|
-
* @private
|
|
27141
|
-
* @param {Number} lineIndex
|
|
27142
|
-
* @param {Number} desiredWidth width you want to wrap the line to
|
|
27143
|
-
* @param {GraphemeData} graphemeData an object containing all the lines' words width.
|
|
27144
|
-
* @param {Number} reservedSpace space to remove from wrapping for custom functionalities
|
|
27145
|
-
* @returns {Array} Array of line(s) into which the given text is wrapped
|
|
27146
|
-
* to.
|
|
27265
|
+
/**
|
|
27266
|
+
* Wraps a line of text using the width of the Textbox as desiredWidth
|
|
27267
|
+
* and leveraging the known width o words from GraphemeData
|
|
27268
|
+
* @private
|
|
27269
|
+
* @param {Number} lineIndex
|
|
27270
|
+
* @param {Number} desiredWidth width you want to wrap the line to
|
|
27271
|
+
* @param {GraphemeData} graphemeData an object containing all the lines' words width.
|
|
27272
|
+
* @param {Number} reservedSpace space to remove from wrapping for custom functionalities
|
|
27273
|
+
* @returns {Array} Array of line(s) into which the given text is wrapped
|
|
27274
|
+
* to.
|
|
27147
27275
|
*/
|
|
27148
27276
|
_wrapLine(lineIndex, desiredWidth, _ref) {
|
|
27149
27277
|
let {
|
|
@@ -27225,11 +27353,11 @@
|
|
|
27225
27353
|
return graphemeLines;
|
|
27226
27354
|
}
|
|
27227
27355
|
|
|
27228
|
-
/**
|
|
27229
|
-
* Detect if the text line is ended with an hard break
|
|
27230
|
-
* text and itext do not have wrapping, return false
|
|
27231
|
-
* @param {Number} lineIndex text to split
|
|
27232
|
-
* @return {Boolean}
|
|
27356
|
+
/**
|
|
27357
|
+
* Detect if the text line is ended with an hard break
|
|
27358
|
+
* text and itext do not have wrapping, return false
|
|
27359
|
+
* @param {Number} lineIndex text to split
|
|
27360
|
+
* @return {Boolean}
|
|
27233
27361
|
*/
|
|
27234
27362
|
isEndOfWrapping(lineIndex) {
|
|
27235
27363
|
if (!this._styleMap[lineIndex + 1]) {
|
|
@@ -27243,12 +27371,12 @@
|
|
|
27243
27371
|
return false;
|
|
27244
27372
|
}
|
|
27245
27373
|
|
|
27246
|
-
/**
|
|
27247
|
-
* Detect if a line has a linebreak and so we need to account for it when moving
|
|
27248
|
-
* and counting style.
|
|
27249
|
-
* This is important only for splitByGrapheme at the end of wrapping.
|
|
27250
|
-
* If we are not wrapping the offset is always 1
|
|
27251
|
-
* @return Number
|
|
27374
|
+
/**
|
|
27375
|
+
* Detect if a line has a linebreak and so we need to account for it when moving
|
|
27376
|
+
* and counting style.
|
|
27377
|
+
* This is important only for splitByGrapheme at the end of wrapping.
|
|
27378
|
+
* If we are not wrapping the offset is always 1
|
|
27379
|
+
* @return Number
|
|
27252
27380
|
*/
|
|
27253
27381
|
missingNewlineOffset(lineIndex, skipWrapping) {
|
|
27254
27382
|
if (this.splitByGrapheme && !skipWrapping) {
|
|
@@ -27257,16 +27385,17 @@
|
|
|
27257
27385
|
return 1;
|
|
27258
27386
|
}
|
|
27259
27387
|
|
|
27260
|
-
/**
|
|
27261
|
-
* Gets lines of text to render in the Textbox. This function calculates
|
|
27262
|
-
* text wrapping on the fly every time it is called.
|
|
27263
|
-
* @param {String} text text to split
|
|
27264
|
-
* @returns {Array} Array of lines in the Textbox.
|
|
27265
|
-
* @override
|
|
27388
|
+
/**
|
|
27389
|
+
* Gets lines of text to render in the Textbox. This function calculates
|
|
27390
|
+
* text wrapping on the fly every time it is called.
|
|
27391
|
+
* @param {String} text text to split
|
|
27392
|
+
* @returns {Array} Array of lines in the Textbox.
|
|
27393
|
+
* @override
|
|
27266
27394
|
*/
|
|
27267
27395
|
_splitTextIntoLines(text) {
|
|
27268
27396
|
// Check if we need browser wrapping using smart font detection
|
|
27269
|
-
|
|
27397
|
+
// Skip browser wrapping for justify text when using overlay editing to prevent measurement conflicts
|
|
27398
|
+
const needsBrowserWrapping = this.fontFamily && fontLacksEnglishGlyphsCached(this.fontFamily) && !(this.textAlign.includes('justify') && this.useOverlayEditing);
|
|
27270
27399
|
if (needsBrowserWrapping) {
|
|
27271
27400
|
// Cache key based on text content, width, font properties, AND text alignment
|
|
27272
27401
|
const textHash = text.length + text.slice(0, 50); // Include text content in cache key
|
|
@@ -27291,6 +27420,11 @@
|
|
|
27291
27420
|
|
|
27292
27421
|
// Mark that we used browser wrapping to prevent dynamicMinWidth modifications
|
|
27293
27422
|
this._usingBrowserWrapping = true;
|
|
27423
|
+
|
|
27424
|
+
// pass the width to enlargeSpaces
|
|
27425
|
+
if (result.width) {
|
|
27426
|
+
this._browserWrappingWidth = result.width;
|
|
27427
|
+
}
|
|
27294
27428
|
return result;
|
|
27295
27429
|
}
|
|
27296
27430
|
|
|
@@ -27309,9 +27443,9 @@
|
|
|
27309
27443
|
return newText;
|
|
27310
27444
|
}
|
|
27311
27445
|
|
|
27312
|
-
/**
|
|
27313
|
-
* Use browser's native text wrapping for accurate handling of fonts without English glyphs
|
|
27314
|
-
* @private
|
|
27446
|
+
/**
|
|
27447
|
+
* Use browser's native text wrapping for accurate handling of fonts without English glyphs
|
|
27448
|
+
* @private
|
|
27315
27449
|
*/
|
|
27316
27450
|
_splitTextIntoLinesWithBrowser(text) {
|
|
27317
27451
|
if (typeof document === 'undefined') {
|
|
@@ -27319,26 +27453,47 @@
|
|
|
27319
27453
|
return this._splitTextIntoLinesDefault(text);
|
|
27320
27454
|
}
|
|
27321
27455
|
|
|
27456
|
+
// Skip measurement if we just extracted lines from overlay for justify text
|
|
27457
|
+
if (this._skipJustifyMeasurement && this.textAlign.includes('justify')) {
|
|
27458
|
+
console.log('🚫 SKIP: Skipping browser measurement, using stored overlay lines');
|
|
27459
|
+
this._skipJustifyMeasurement = false; // Reset flag
|
|
27460
|
+
return this._splitTextIntoLinesDefault(text);
|
|
27461
|
+
}
|
|
27462
|
+
|
|
27322
27463
|
// Create a hidden element that mimics the overlay editor
|
|
27323
27464
|
const testElement = document.createElement('div');
|
|
27324
27465
|
testElement.style.position = 'absolute';
|
|
27325
27466
|
testElement.style.left = '-9999px';
|
|
27326
27467
|
testElement.style.visibility = 'hidden';
|
|
27327
|
-
|
|
27468
|
+
const scaleX = this.scaleX || 1;
|
|
27469
|
+
const fontSize = this.fontSize * scaleX;
|
|
27470
|
+
const padding = this.padding || 0;
|
|
27471
|
+
testElement.style.fontSize = `${fontSize}px`;
|
|
27328
27472
|
testElement.style.fontFamily = `"${this.fontFamily}"`;
|
|
27329
27473
|
testElement.style.fontWeight = String(this.fontWeight || 'normal');
|
|
27330
27474
|
testElement.style.fontStyle = String(this.fontStyle || 'normal');
|
|
27331
27475
|
testElement.style.lineHeight = String(this.lineHeight || 1.16);
|
|
27332
|
-
testElement.style.
|
|
27476
|
+
testElement.style.letterSpacing = `${(this.charSpacing || 0) / 1000 * fontSize}px`;
|
|
27333
27477
|
testElement.style.direction = this.direction || 'ltr';
|
|
27334
27478
|
testElement.style.whiteSpace = 'pre-wrap';
|
|
27335
27479
|
testElement.style.wordBreak = 'normal';
|
|
27336
27480
|
testElement.style.overflowWrap = 'break-word';
|
|
27337
|
-
|
|
27338
|
-
|
|
27481
|
+
testElement.style.padding = `${padding}px`;
|
|
27482
|
+
testElement.style.boxSizing = 'border-box';
|
|
27483
|
+
testElement.style.width = `${this.width * scaleX + padding * 2}px`;
|
|
27339
27484
|
if (this.textAlign.includes('justify')) {
|
|
27340
27485
|
testElement.style.textAlign = 'justify';
|
|
27341
|
-
|
|
27486
|
+
if (this.direction === 'rtl') {
|
|
27487
|
+
testElement.style.textAlignLast = 'right';
|
|
27488
|
+
} else {
|
|
27489
|
+
testElement.style.textAlignLast = 'left';
|
|
27490
|
+
}
|
|
27491
|
+
testElement.style.textJustify = 'inter-word';
|
|
27492
|
+
testElement.style.unicodeBidi = 'plaintext';
|
|
27493
|
+
testElement.style.wordSpacing = 'normal';
|
|
27494
|
+
// Match font smoothing from overlay editor
|
|
27495
|
+
testElement.style.webkitFontSmoothing = 'auto';
|
|
27496
|
+
testElement.style.mozOsxFontSmoothing = 'auto';
|
|
27342
27497
|
} else {
|
|
27343
27498
|
testElement.style.textAlign = this.textAlign;
|
|
27344
27499
|
}
|
|
@@ -27363,7 +27518,7 @@
|
|
|
27363
27518
|
if (i > currentLineStart && (rect.bottom > previousBottom + 5 || i === textLength)) {
|
|
27364
27519
|
// New line detected or end of text
|
|
27365
27520
|
const lineEnd = i === textLength ? i : i - 1;
|
|
27366
|
-
const lineText = text.substring(currentLineStart, lineEnd)
|
|
27521
|
+
const lineText = text.substring(currentLineStart, lineEnd);
|
|
27367
27522
|
if (lineText) {
|
|
27368
27523
|
lines.push(lineText);
|
|
27369
27524
|
// Convert to graphemes for compatibility
|
|
@@ -27386,6 +27541,7 @@
|
|
|
27386
27541
|
const offsetHeight = testElement.offsetHeight;
|
|
27387
27542
|
const clientHeight = testElement.clientHeight;
|
|
27388
27543
|
const boundingRect = testElement.getBoundingClientRect();
|
|
27544
|
+
const clientWidth = testElement.clientWidth;
|
|
27389
27545
|
console.log(`🔤 Browser element measurements:`);
|
|
27390
27546
|
console.log(` scrollHeight: ${actualBrowserHeight}px (content + padding + hidden overflow)`);
|
|
27391
27547
|
console.log(` offsetHeight: ${offsetHeight}px (content + padding + border)`);
|
|
@@ -27433,13 +27589,14 @@
|
|
|
27433
27589
|
graphemeText: text.split(''),
|
|
27434
27590
|
graphemeLines: graphemeLines,
|
|
27435
27591
|
justifySpaceMeasurements: justifySpaceMeasurements,
|
|
27436
|
-
actualBrowserHeight: adjustedHeight
|
|
27592
|
+
actualBrowserHeight: adjustedHeight,
|
|
27593
|
+
width: clientWidth
|
|
27437
27594
|
};
|
|
27438
27595
|
}
|
|
27439
27596
|
|
|
27440
|
-
/**
|
|
27441
|
-
* Extract justify space measurements from browser
|
|
27442
|
-
* @private
|
|
27597
|
+
/**
|
|
27598
|
+
* Extract justify space measurements from browser
|
|
27599
|
+
* @private
|
|
27443
27600
|
*/
|
|
27444
27601
|
_extractJustifySpaceMeasurements(element, lines) {
|
|
27445
27602
|
console.log(`🔤 Extracting browser justify space measurements for ${lines.length} lines`);
|
|
@@ -27475,9 +27632,9 @@
|
|
|
27475
27632
|
return spaceWidths;
|
|
27476
27633
|
}
|
|
27477
27634
|
|
|
27478
|
-
/**
|
|
27479
|
-
* Apply browser-calculated justify space measurements
|
|
27480
|
-
* @private
|
|
27635
|
+
/**
|
|
27636
|
+
* Apply browser-calculated justify space measurements
|
|
27637
|
+
* @private
|
|
27481
27638
|
*/
|
|
27482
27639
|
_applyBrowserJustifySpaces() {
|
|
27483
27640
|
if (!this._textLines || !this.__charBounds) {
|
|
@@ -27485,6 +27642,14 @@
|
|
|
27485
27642
|
return;
|
|
27486
27643
|
}
|
|
27487
27644
|
|
|
27645
|
+
// Check for overlay justify measurements first
|
|
27646
|
+
const overlayMeasurements = this._overlayJustifyMeasurements;
|
|
27647
|
+
if (overlayMeasurements) {
|
|
27648
|
+
console.log('🎯 OVERLAY JUSTIFY: Using stored overlay measurements');
|
|
27649
|
+
this._applyOverlayJustifySpaces(overlayMeasurements);
|
|
27650
|
+
return;
|
|
27651
|
+
}
|
|
27652
|
+
|
|
27488
27653
|
// Get space measurements from browser wrapping result
|
|
27489
27654
|
const styleMap = this._styleMap;
|
|
27490
27655
|
if (!styleMap || !styleMap.justifySpaceMeasurements) {
|
|
@@ -27500,23 +27665,164 @@
|
|
|
27500
27665
|
const lineBounds = this.__charBounds[lineIndex];
|
|
27501
27666
|
const lineSpaceWidths = spaceWidths[lineIndex];
|
|
27502
27667
|
let spaceIndex = 0;
|
|
27668
|
+
let accumulatedSpace = 0;
|
|
27669
|
+
const isRtl = this.direction === 'rtl';
|
|
27670
|
+
const spaceDiffs = [];
|
|
27671
|
+
|
|
27672
|
+
// First, calculate the difference for each space
|
|
27503
27673
|
for (let charIndex = 0; charIndex < line.length; charIndex++) {
|
|
27504
27674
|
if (/\s/.test(line[charIndex]) && spaceIndex < lineSpaceWidths.length) {
|
|
27505
|
-
const
|
|
27506
|
-
if (
|
|
27507
|
-
|
|
27508
|
-
lineBounds[charIndex].width = expandedWidth;
|
|
27509
|
-
console.log(`🔤 Line ${lineIndex} space ${spaceIndex}: ${oldWidth.toFixed(1)}px -> ${expandedWidth.toFixed(1)}px`);
|
|
27675
|
+
const charBound = lineBounds[charIndex];
|
|
27676
|
+
if (charBound) {
|
|
27677
|
+
spaceDiffs.push(lineSpaceWidths[spaceIndex] - charBound.width);
|
|
27510
27678
|
}
|
|
27511
27679
|
spaceIndex++;
|
|
27512
27680
|
}
|
|
27513
27681
|
}
|
|
27682
|
+
spaceIndex = 0;
|
|
27683
|
+
let remainingDiff = spaceDiffs.reduce((a, b) => a + b, 0);
|
|
27684
|
+
for (let charIndex = 0; charIndex < line.length; charIndex++) {
|
|
27685
|
+
const charBound = lineBounds[charIndex];
|
|
27686
|
+
if (!charBound) continue;
|
|
27687
|
+
if (isRtl) {
|
|
27688
|
+
charBound.left += remainingDiff;
|
|
27689
|
+
} else {
|
|
27690
|
+
charBound.left += accumulatedSpace;
|
|
27691
|
+
}
|
|
27692
|
+
if (/\s/.test(line[charIndex]) && spaceIndex < spaceDiffs.length) {
|
|
27693
|
+
const diff = spaceDiffs[spaceIndex];
|
|
27694
|
+
const oldWidth = charBound.width;
|
|
27695
|
+
charBound.width += diff;
|
|
27696
|
+
charBound.kernedWidth += diff;
|
|
27697
|
+
console.log(`🔤 Line ${lineIndex} space ${spaceIndex}: ${oldWidth.toFixed(1)}px -> ${charBound.width.toFixed(1)}px`);
|
|
27698
|
+
if (isRtl) {
|
|
27699
|
+
remainingDiff -= diff;
|
|
27700
|
+
} else {
|
|
27701
|
+
accumulatedSpace += diff;
|
|
27702
|
+
}
|
|
27703
|
+
spaceIndex++;
|
|
27704
|
+
}
|
|
27705
|
+
}
|
|
27706
|
+
// also need to update the last charBound
|
|
27707
|
+
const lastBound = lineBounds[line.length];
|
|
27708
|
+
if (lastBound) {
|
|
27709
|
+
if (isRtl) {
|
|
27710
|
+
lastBound.left += remainingDiff;
|
|
27711
|
+
} else {
|
|
27712
|
+
lastBound.left += accumulatedSpace;
|
|
27713
|
+
}
|
|
27714
|
+
}
|
|
27715
|
+
});
|
|
27716
|
+
}
|
|
27717
|
+
|
|
27718
|
+
/**
|
|
27719
|
+
* Apply overlay justify measurements to character bounds
|
|
27720
|
+
* @private
|
|
27721
|
+
*/
|
|
27722
|
+
_applyOverlayJustifySpaces(overlayMeasurements) {
|
|
27723
|
+
this._textLines.forEach((line, lineIndex) => {
|
|
27724
|
+
if (!this.__charBounds || !this.__charBounds[lineIndex]) return;
|
|
27725
|
+
const lineMeasurement = overlayMeasurements[lineIndex];
|
|
27726
|
+
if (!lineMeasurement) return;
|
|
27727
|
+
const {
|
|
27728
|
+
justifiedSpaceWidth
|
|
27729
|
+
} = lineMeasurement;
|
|
27730
|
+
let spaceIndex = 0;
|
|
27731
|
+
line.forEach((char, charIndex) => {
|
|
27732
|
+
if (char === ' ' && this.__charBounds[lineIndex][charIndex]) {
|
|
27733
|
+
const oldWidth = this.__charBounds[lineIndex][charIndex].width;
|
|
27734
|
+
this.__charBounds[lineIndex][charIndex].width = justifiedSpaceWidth;
|
|
27735
|
+
console.log(`🎯 OVERLAY Line ${lineIndex} space ${spaceIndex}: ${oldWidth.toFixed(1)}px -> ${justifiedSpaceWidth.toFixed(1)}px`);
|
|
27736
|
+
spaceIndex++;
|
|
27737
|
+
}
|
|
27738
|
+
});
|
|
27514
27739
|
});
|
|
27515
27740
|
}
|
|
27516
27741
|
|
|
27517
|
-
/**
|
|
27518
|
-
*
|
|
27519
|
-
|
|
27742
|
+
/**
|
|
27743
|
+
* Extract justify measurements from overlay textarea and store them
|
|
27744
|
+
*/
|
|
27745
|
+
extractJustifyMeasurementsFromOverlay(textarea) {
|
|
27746
|
+
const text = textarea.value;
|
|
27747
|
+
if (!text || !this.textAlign.includes('justify')) {
|
|
27748
|
+
return;
|
|
27749
|
+
}
|
|
27750
|
+
|
|
27751
|
+
// Use the same measurement technique as measureLinesWithBrowser
|
|
27752
|
+
const testElement = document.createElement('div');
|
|
27753
|
+
testElement.style.position = 'absolute';
|
|
27754
|
+
testElement.style.left = '-9999px';
|
|
27755
|
+
testElement.style.visibility = 'hidden';
|
|
27756
|
+
|
|
27757
|
+
// Copy all styles from the textarea to ensure identical rendering
|
|
27758
|
+
const computedStyle = window.getComputedStyle(textarea);
|
|
27759
|
+
const stylesToCopy = ['fontSize', 'fontFamily', 'fontWeight', 'fontStyle', 'lineHeight', 'letterSpacing', 'direction', 'textAlign', 'textAlignLast', 'textJustify', 'width', 'padding', 'boxSizing', 'whiteSpace', 'wordBreak', 'overflowWrap'];
|
|
27760
|
+
stylesToCopy.forEach(prop => {
|
|
27761
|
+
testElement.style[prop] = computedStyle[prop];
|
|
27762
|
+
});
|
|
27763
|
+
testElement.textContent = text;
|
|
27764
|
+
document.body.appendChild(testElement);
|
|
27765
|
+
try {
|
|
27766
|
+
// Extract justify space measurements using the same logic
|
|
27767
|
+
const lines = text.split('\n');
|
|
27768
|
+
const justifyMeasurements = {};
|
|
27769
|
+
lines.forEach((line, lineIndex) => {
|
|
27770
|
+
if (line.trim()) {
|
|
27771
|
+
const spaces = (line.match(/\s/g) || []).length;
|
|
27772
|
+
if (spaces > 0) {
|
|
27773
|
+
// Measure natural space width
|
|
27774
|
+
const singleSpaceDiv = document.createElement('div');
|
|
27775
|
+
stylesToCopy.forEach(prop => {
|
|
27776
|
+
singleSpaceDiv.style[prop] = computedStyle[prop];
|
|
27777
|
+
});
|
|
27778
|
+
singleSpaceDiv.textContent = ' ';
|
|
27779
|
+
document.body.appendChild(singleSpaceDiv);
|
|
27780
|
+
const naturalSpaceWidth = singleSpaceDiv.getBoundingClientRect().width;
|
|
27781
|
+
document.body.removeChild(singleSpaceDiv);
|
|
27782
|
+
|
|
27783
|
+
// Measure justified line width
|
|
27784
|
+
const lineDiv = document.createElement('div');
|
|
27785
|
+
stylesToCopy.forEach(prop => {
|
|
27786
|
+
lineDiv.style[prop] = computedStyle[prop];
|
|
27787
|
+
});
|
|
27788
|
+
lineDiv.textContent = line;
|
|
27789
|
+
document.body.appendChild(lineDiv);
|
|
27790
|
+
const lineWidth = lineDiv.getBoundingClientRect().width;
|
|
27791
|
+
const containerWidth = parseFloat(computedStyle.width);
|
|
27792
|
+
|
|
27793
|
+
// Calculate justified space width
|
|
27794
|
+
const nonSpaceText = line.replace(/\s/g, '');
|
|
27795
|
+
const nonSpaceDiv = document.createElement('div');
|
|
27796
|
+
stylesToCopy.forEach(prop => {
|
|
27797
|
+
nonSpaceDiv.style[prop] = computedStyle[prop];
|
|
27798
|
+
});
|
|
27799
|
+
nonSpaceDiv.textContent = nonSpaceText;
|
|
27800
|
+
document.body.appendChild(nonSpaceDiv);
|
|
27801
|
+
const nonSpaceWidth = nonSpaceDiv.getBoundingClientRect().width;
|
|
27802
|
+
const justifiedSpaceWidth = (containerWidth - nonSpaceWidth) / spaces;
|
|
27803
|
+
console.log(`🎯 OVERLAY Line ${lineIndex}: ${spaces} spaces, natural: ${naturalSpaceWidth.toFixed(1)}px -> justified: ${justifiedSpaceWidth.toFixed(1)}px`);
|
|
27804
|
+
justifyMeasurements[lineIndex] = {
|
|
27805
|
+
naturalSpaceWidth,
|
|
27806
|
+
justifiedSpaceWidth,
|
|
27807
|
+
spaceCount: spaces
|
|
27808
|
+
};
|
|
27809
|
+
document.body.removeChild(lineDiv);
|
|
27810
|
+
document.body.removeChild(nonSpaceDiv);
|
|
27811
|
+
}
|
|
27812
|
+
}
|
|
27813
|
+
});
|
|
27814
|
+
|
|
27815
|
+
// Store the measurements
|
|
27816
|
+
this._overlayJustifyMeasurements = justifyMeasurements;
|
|
27817
|
+
console.log('💾 STORED: Overlay justify measurements', justifyMeasurements);
|
|
27818
|
+
} finally {
|
|
27819
|
+
document.body.removeChild(testElement);
|
|
27820
|
+
}
|
|
27821
|
+
}
|
|
27822
|
+
|
|
27823
|
+
/**
|
|
27824
|
+
* Fallback to default Fabric wrapping
|
|
27825
|
+
* @private
|
|
27520
27826
|
*/
|
|
27521
27827
|
_splitTextIntoLinesDefault(text) {
|
|
27522
27828
|
const newText = super._splitTextIntoLines(text),
|
|
@@ -27548,12 +27854,12 @@
|
|
|
27548
27854
|
}
|
|
27549
27855
|
}
|
|
27550
27856
|
|
|
27551
|
-
/**
|
|
27552
|
-
* Initialize event listeners for safety snap functionality
|
|
27553
|
-
* @private
|
|
27857
|
+
/**
|
|
27858
|
+
* Initialize event listeners for safety snap functionality
|
|
27859
|
+
* @private
|
|
27554
27860
|
*/
|
|
27555
27861
|
initializeEventListeners() {
|
|
27556
|
-
var _this$
|
|
27862
|
+
var _this$canvas5;
|
|
27557
27863
|
// Track which side is being used for resize to handle position compensation
|
|
27558
27864
|
let resizeOrigin = null;
|
|
27559
27865
|
|
|
@@ -27578,13 +27884,14 @@
|
|
|
27578
27884
|
// Use 'modified' event which fires after user releases the mouse
|
|
27579
27885
|
this.on('modified', () => {
|
|
27580
27886
|
const currentResizeOrigin = resizeOrigin; // Capture the value before reset
|
|
27887
|
+
this.initDimensions();
|
|
27581
27888
|
// Small delay to ensure text layout is updated
|
|
27582
27889
|
setTimeout(() => this.safetySnapWidth(currentResizeOrigin), 10);
|
|
27583
27890
|
resizeOrigin = null; // Reset after capturing
|
|
27584
27891
|
});
|
|
27585
27892
|
|
|
27586
27893
|
// Also listen to canvas-level modified event as backup
|
|
27587
|
-
(_this$
|
|
27894
|
+
(_this$canvas5 = this.canvas) === null || _this$canvas5 === void 0 || _this$canvas5.on('object:modified', e => {
|
|
27588
27895
|
if (e.target === this) {
|
|
27589
27896
|
const currentResizeOrigin = resizeOrigin; // Capture the value before reset
|
|
27590
27897
|
setTimeout(() => this.safetySnapWidth(currentResizeOrigin), 10);
|
|
@@ -27593,12 +27900,12 @@
|
|
|
27593
27900
|
});
|
|
27594
27901
|
}
|
|
27595
27902
|
|
|
27596
|
-
/**
|
|
27597
|
-
* Safety snap to prevent glyph clipping after manual resize.
|
|
27598
|
-
* Similar to Polotno - checks if any glyphs are too close to edges
|
|
27599
|
-
* and automatically expands width if needed.
|
|
27600
|
-
* @private
|
|
27601
|
-
* @param resizeOrigin - Which side was used for resizing ('left' or 'right')
|
|
27903
|
+
/**
|
|
27904
|
+
* Safety snap to prevent glyph clipping after manual resize.
|
|
27905
|
+
* Similar to Polotno - checks if any glyphs are too close to edges
|
|
27906
|
+
* and automatically expands width if needed.
|
|
27907
|
+
* @private
|
|
27908
|
+
* @param resizeOrigin - Which side was used for resizing ('left' or 'right')
|
|
27602
27909
|
*/
|
|
27603
27910
|
safetySnapWidth(resizeOrigin) {
|
|
27604
27911
|
// For Textbox objects, we always want to check for clipping regardless of isWrapping flag
|
|
@@ -27628,7 +27935,7 @@
|
|
|
27628
27935
|
const safetyThreshold = 2; // px - very subtle trigger
|
|
27629
27936
|
|
|
27630
27937
|
if (maxRequiredWidth > this.width - safetyThreshold) {
|
|
27631
|
-
var _this$
|
|
27938
|
+
var _this$canvas6;
|
|
27632
27939
|
// Set width to exactly what's needed + minimal safety margin
|
|
27633
27940
|
const newWidth = maxRequiredWidth + 1; // Add just 1px safety margin
|
|
27634
27941
|
|
|
@@ -27637,7 +27944,7 @@
|
|
|
27637
27944
|
const originalTop = this.top;
|
|
27638
27945
|
const widthIncrease = newWidth - this.width;
|
|
27639
27946
|
|
|
27640
|
-
// Change width
|
|
27947
|
+
// Change width
|
|
27641
27948
|
this.set('width', newWidth);
|
|
27642
27949
|
|
|
27643
27950
|
// Force text layout recalculation
|
|
@@ -27649,8 +27956,8 @@
|
|
|
27649
27956
|
// When resizing from left, the expansion pushes text right
|
|
27650
27957
|
// Compensate by moving the textbox left by the width increase
|
|
27651
27958
|
this.set({
|
|
27652
|
-
|
|
27653
|
-
|
|
27959
|
+
left: originalLeft - widthIncrease,
|
|
27960
|
+
top: originalTop
|
|
27654
27961
|
});
|
|
27655
27962
|
}
|
|
27656
27963
|
this.setCoords();
|
|
@@ -27661,13 +27968,13 @@
|
|
|
27661
27968
|
this.__overlayEditor.refresh();
|
|
27662
27969
|
}, 0);
|
|
27663
27970
|
}
|
|
27664
|
-
(_this$
|
|
27971
|
+
(_this$canvas6 = this.canvas) === null || _this$canvas6 === void 0 || _this$canvas6.requestRenderAll();
|
|
27665
27972
|
}
|
|
27666
27973
|
}
|
|
27667
27974
|
|
|
27668
|
-
/**
|
|
27669
|
-
* Fix character selection mismatch after JSON loading for browser-wrapped fonts
|
|
27670
|
-
* @private
|
|
27975
|
+
/**
|
|
27976
|
+
* Fix character selection mismatch after JSON loading for browser-wrapped fonts
|
|
27977
|
+
* @private
|
|
27671
27978
|
*/
|
|
27672
27979
|
_fixCharacterMappingAfterJsonLoad() {
|
|
27673
27980
|
if (this._usingBrowserWrapping) {
|
|
@@ -27687,9 +27994,9 @@
|
|
|
27687
27994
|
}
|
|
27688
27995
|
}
|
|
27689
27996
|
|
|
27690
|
-
/**
|
|
27691
|
-
* Force complete textbox re-initialization (useful after JSON loading)
|
|
27692
|
-
* Overrides Text version with Textbox-specific logic
|
|
27997
|
+
/**
|
|
27998
|
+
* Force complete textbox re-initialization (useful after JSON loading)
|
|
27999
|
+
* Overrides Text version with Textbox-specific logic
|
|
27693
28000
|
*/
|
|
27694
28001
|
forceTextReinitialization() {
|
|
27695
28002
|
console.log('🔄 Force reinitializing Textbox object');
|
|
@@ -27712,7 +28019,7 @@
|
|
|
27712
28019
|
// Double-check that justify was applied by checking space widths
|
|
27713
28020
|
if (this.textAlign.includes('justify') && this.__charBounds) {
|
|
27714
28021
|
setTimeout(() => {
|
|
27715
|
-
var _this$
|
|
28022
|
+
var _this$canvas7;
|
|
27716
28023
|
// Verify justify was applied by checking if space widths vary
|
|
27717
28024
|
let hasVariableSpaces = false;
|
|
27718
28025
|
this.__charBounds.forEach((lineBounds, i) => {
|
|
@@ -27741,36 +28048,118 @@
|
|
|
27741
28048
|
this.height = this.calcTextHeight();
|
|
27742
28049
|
console.log(`🔧 JUSTIFY: Used calcTextHeight: ${this.height}px`);
|
|
27743
28050
|
}
|
|
27744
|
-
(_this$
|
|
28051
|
+
(_this$canvas7 = this.canvas) === null || _this$canvas7 === void 0 || _this$canvas7.requestRenderAll();
|
|
27745
28052
|
}, 10);
|
|
27746
28053
|
}
|
|
27747
28054
|
}
|
|
27748
28055
|
|
|
27749
|
-
/**
|
|
27750
|
-
*
|
|
27751
|
-
* @
|
|
27752
|
-
|
|
28056
|
+
/**
|
|
28057
|
+
* Fix justify text after JSON loading - call this after fromObject
|
|
28058
|
+
* @public
|
|
28059
|
+
*/
|
|
28060
|
+
fixJustifyAfterJSONLoad() {
|
|
28061
|
+
if (this.textAlign.includes('justify') && this.useOverlayEditing) {
|
|
28062
|
+
console.log('🔧 JSON FIX: Fixing justify text after JSON load');
|
|
28063
|
+
// The issue is that enlargeSpaces() isn't properly updating after JSON load
|
|
28064
|
+
// Workaround: temporarily change width to trigger proper rebuild, then restore
|
|
28065
|
+
setTimeout(() => {
|
|
28066
|
+
const originalWidth = this.width;
|
|
28067
|
+
console.log('🔄 JSON TRICK: Temporarily changing width to force justify rebuild');
|
|
28068
|
+
|
|
28069
|
+
// Temporarily change width by 1px to trigger proper justify recalculation
|
|
28070
|
+
this.width = originalWidth + 1;
|
|
28071
|
+
this.initDimensions();
|
|
28072
|
+
|
|
28073
|
+
// Restore original width - this will trigger the proper justify calculation
|
|
28074
|
+
setTimeout(() => {
|
|
28075
|
+
var _this$canvas8;
|
|
28076
|
+
this.width = originalWidth;
|
|
28077
|
+
this.initDimensions();
|
|
28078
|
+
(_this$canvas8 = this.canvas) === null || _this$canvas8 === void 0 || _this$canvas8.requestRenderAll();
|
|
28079
|
+
console.log('✅ JSON FIX: Restored original width, justify should be fixed');
|
|
28080
|
+
}, 50);
|
|
28081
|
+
}, 100);
|
|
28082
|
+
}
|
|
28083
|
+
}
|
|
28084
|
+
|
|
28085
|
+
/**
|
|
28086
|
+
* Returns object representation of an instance
|
|
28087
|
+
* @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output
|
|
28088
|
+
* @return {Object} object representation of an instance
|
|
27753
28089
|
*/
|
|
27754
28090
|
toObject() {
|
|
27755
28091
|
let propertiesToInclude = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
27756
|
-
|
|
28092
|
+
const obj = super.toObject(['minWidth', 'splitByGrapheme', ...propertiesToInclude]);
|
|
28093
|
+
|
|
28094
|
+
// For justify text with overlay editing, ensure measurements are available
|
|
28095
|
+
if (this.textAlign.includes('justify') && this.useOverlayEditing) {
|
|
28096
|
+
var _charBounds, _charBounds2;
|
|
28097
|
+
// If character bounds don't exist yet, initialize dimensions to calculate them
|
|
28098
|
+
if (!((_charBounds = this.__charBounds) !== null && _charBounds !== void 0 && _charBounds.length)) {
|
|
28099
|
+
console.log('🔧 SERIALIZE: Character bounds missing, initializing dimensions for justify text');
|
|
28100
|
+
this.initDimensions();
|
|
28101
|
+
}
|
|
28102
|
+
|
|
28103
|
+
// Now save the measurements if they exist
|
|
28104
|
+
if ((_charBounds2 = this.__charBounds) !== null && _charBounds2 !== void 0 && _charBounds2.length) {
|
|
28105
|
+
console.log('💾 SERIALIZE: Saving justify measurements to JSON');
|
|
28106
|
+
obj._justifyMeasurements = {
|
|
28107
|
+
__charBounds: this.__charBounds,
|
|
28108
|
+
__lineHeights: this.__lineHeights,
|
|
28109
|
+
__lineWidths: this.__lineWidths,
|
|
28110
|
+
_hasJustifyData: true
|
|
28111
|
+
};
|
|
28112
|
+
} else {
|
|
28113
|
+
console.warn('⚠️ SERIALIZE: Could not generate character bounds for justify text');
|
|
28114
|
+
}
|
|
28115
|
+
}
|
|
28116
|
+
return obj;
|
|
28117
|
+
}
|
|
28118
|
+
|
|
28119
|
+
/**
|
|
28120
|
+
* Override _set to handle justify measurements during JSON loading
|
|
28121
|
+
* @private
|
|
28122
|
+
*/
|
|
28123
|
+
_set(key, value) {
|
|
28124
|
+
const result = super._set(key, value);
|
|
28125
|
+
|
|
28126
|
+
// Restore justify measurements if they exist in the JSON data
|
|
28127
|
+
if (key === '_justifyMeasurements' && value && value._hasJustifyData) {
|
|
28128
|
+
console.log('🔄 DESERIALIZE: Restoring justify measurements from JSON');
|
|
28129
|
+
this.__charBounds = value.__charBounds;
|
|
28130
|
+
this.__lineHeights = value.__lineHeights;
|
|
28131
|
+
this.__lineWidths = value.__lineWidths;
|
|
28132
|
+
|
|
28133
|
+
// Mark that we have restored data so we don't interfere with it
|
|
28134
|
+
this._hasRestoredJustifyData = true;
|
|
28135
|
+
|
|
28136
|
+
// Automatically trigger the fix after JSON loading
|
|
28137
|
+
if (this.textAlign.includes('justify') && this.useOverlayEditing) {
|
|
28138
|
+
console.log('🔄 AUTO-FIX: Calling fixJustifyAfterJSONLoad after restoring justify measurements');
|
|
28139
|
+
// Use setTimeout to ensure this runs after all object initialization is complete
|
|
28140
|
+
setTimeout(() => {
|
|
28141
|
+
this.fixJustifyAfterJSONLoad();
|
|
28142
|
+
}, 10);
|
|
28143
|
+
}
|
|
28144
|
+
}
|
|
28145
|
+
return result;
|
|
27757
28146
|
}
|
|
27758
28147
|
}
|
|
27759
|
-
/**
|
|
27760
|
-
* Minimum width of textbox, in pixels.
|
|
27761
|
-
* @type Number
|
|
27762
|
-
*/
|
|
27763
|
-
/**
|
|
27764
|
-
* Minimum calculated width of a textbox, in pixels.
|
|
27765
|
-
* fixed to 2 so that an empty textbox cannot go to 0
|
|
27766
|
-
* and is still selectable without text.
|
|
27767
|
-
* @type Number
|
|
27768
|
-
*/
|
|
27769
|
-
/**
|
|
27770
|
-
* Use this boolean property in order to split strings that have no white space concept.
|
|
27771
|
-
* this is a cheap way to help with chinese/japanese
|
|
27772
|
-
* @type Boolean
|
|
27773
|
-
* @since 2.6.0
|
|
28148
|
+
/**
|
|
28149
|
+
* Minimum width of textbox, in pixels.
|
|
28150
|
+
* @type Number
|
|
28151
|
+
*/
|
|
28152
|
+
/**
|
|
28153
|
+
* Minimum calculated width of a textbox, in pixels.
|
|
28154
|
+
* fixed to 2 so that an empty textbox cannot go to 0
|
|
28155
|
+
* and is still selectable without text.
|
|
28156
|
+
* @type Number
|
|
28157
|
+
*/
|
|
28158
|
+
/**
|
|
28159
|
+
* Use this boolean property in order to split strings that have no white space concept.
|
|
28160
|
+
* this is a cheap way to help with chinese/japanese
|
|
28161
|
+
* @type Boolean
|
|
28162
|
+
* @since 2.6.0
|
|
27774
28163
|
*/
|
|
27775
28164
|
_defineProperty(Textbox, "type", 'Textbox');
|
|
27776
28165
|
_defineProperty(Textbox, "textLayoutProperties", [...IText.textLayoutProperties, 'width']);
|