@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.node.cjs
CHANGED
|
@@ -412,7 +412,7 @@ class Cache {
|
|
|
412
412
|
}
|
|
413
413
|
const cache = new Cache();
|
|
414
414
|
|
|
415
|
-
var version = "7.0.1-
|
|
415
|
+
var version = "7.0.1-beta14";
|
|
416
416
|
|
|
417
417
|
// use this syntax so babel plugin see this import here
|
|
418
418
|
const VERSION = version;
|
|
@@ -19241,8 +19241,8 @@ _defineProperty(StyledText, "_styleProperties", styleProperties);
|
|
|
19241
19241
|
// Global measurement context - reused for performance
|
|
19242
19242
|
let measurementContext = null;
|
|
19243
19243
|
|
|
19244
|
-
/**
|
|
19245
|
-
* Get or create the shared measurement context
|
|
19244
|
+
/**
|
|
19245
|
+
* Get or create the shared measurement context
|
|
19246
19246
|
*/
|
|
19247
19247
|
function getMeasurementContext() {
|
|
19248
19248
|
if (!measurementContext) {
|
|
@@ -19255,8 +19255,8 @@ function getMeasurementContext() {
|
|
|
19255
19255
|
return measurementContext;
|
|
19256
19256
|
}
|
|
19257
19257
|
|
|
19258
|
-
/**
|
|
19259
|
-
* Measure a single grapheme
|
|
19258
|
+
/**
|
|
19259
|
+
* Measure a single grapheme
|
|
19260
19260
|
*/
|
|
19261
19261
|
function measureGrapheme(grapheme, options, ctx) {
|
|
19262
19262
|
// Check cache first
|
|
@@ -19289,8 +19289,8 @@ function measureGrapheme(grapheme, options, ctx) {
|
|
|
19289
19289
|
return measurement;
|
|
19290
19290
|
}
|
|
19291
19291
|
|
|
19292
|
-
/**
|
|
19293
|
-
* Measure a grapheme with kerning relative to previous character
|
|
19292
|
+
/**
|
|
19293
|
+
* Measure a grapheme with kerning relative to previous character
|
|
19294
19294
|
*/
|
|
19295
19295
|
function measureGraphemeWithKerning(grapheme, previousGrapheme, options, ctx) {
|
|
19296
19296
|
// Get individual measurement
|
|
@@ -19331,9 +19331,9 @@ function measureGraphemeWithKerning(grapheme, previousGrapheme, options, ctx) {
|
|
|
19331
19331
|
};
|
|
19332
19332
|
}
|
|
19333
19333
|
|
|
19334
|
-
/**
|
|
19335
|
-
* Get a representative character for font metrics measurement
|
|
19336
|
-
* Uses canvas to test which scripts the font actually supports
|
|
19334
|
+
/**
|
|
19335
|
+
* Get a representative character for font metrics measurement
|
|
19336
|
+
* Uses canvas to test which scripts the font actually supports
|
|
19337
19337
|
*/
|
|
19338
19338
|
function getRepresentativeCharacter(fontFamily) {
|
|
19339
19339
|
const context = getMeasurementContext();
|
|
@@ -19422,8 +19422,8 @@ function getRepresentativeCharacter(fontFamily) {
|
|
|
19422
19422
|
return 'M';
|
|
19423
19423
|
}
|
|
19424
19424
|
|
|
19425
|
-
/**
|
|
19426
|
-
* Get font metrics for layout calculations
|
|
19425
|
+
/**
|
|
19426
|
+
* Get font metrics for layout calculations
|
|
19427
19427
|
*/
|
|
19428
19428
|
function getFontMetrics(options) {
|
|
19429
19429
|
var _metrics$fontBounding, _metrics$fontBounding2, _metrics$actualBoundi, _metrics$actualBoundi2;
|
|
@@ -19459,8 +19459,8 @@ function getFontMetrics(options) {
|
|
|
19459
19459
|
return result;
|
|
19460
19460
|
}
|
|
19461
19461
|
|
|
19462
|
-
/**
|
|
19463
|
-
* Apply font styling to canvas context
|
|
19462
|
+
/**
|
|
19463
|
+
* Apply font styling to canvas context
|
|
19464
19464
|
*/
|
|
19465
19465
|
function applyFontStyle(ctx, options) {
|
|
19466
19466
|
const fontDeclaration = getFontDeclaration(options);
|
|
@@ -19477,8 +19477,8 @@ function applyFontStyle(ctx, options) {
|
|
|
19477
19477
|
ctx.textBaseline = 'alphabetic';
|
|
19478
19478
|
}
|
|
19479
19479
|
|
|
19480
|
-
/**
|
|
19481
|
-
* Generate font declaration string
|
|
19480
|
+
/**
|
|
19481
|
+
* Generate font declaration string
|
|
19482
19482
|
*/
|
|
19483
19483
|
function getFontDeclaration(options) {
|
|
19484
19484
|
const {
|
|
@@ -19497,8 +19497,8 @@ function getFontDeclaration(options) {
|
|
|
19497
19497
|
return `${fontStyle} ${fontWeight} ${fontSize}px ${normalizedFamily}`;
|
|
19498
19498
|
}
|
|
19499
19499
|
|
|
19500
|
-
/**
|
|
19501
|
-
* LRU Cache implementation for measurements
|
|
19500
|
+
/**
|
|
19501
|
+
* LRU Cache implementation for measurements
|
|
19502
19502
|
*/
|
|
19503
19503
|
class LRUCache {
|
|
19504
19504
|
constructor() {
|
|
@@ -19560,8 +19560,8 @@ class LRUCache {
|
|
|
19560
19560
|
}
|
|
19561
19561
|
}
|
|
19562
19562
|
|
|
19563
|
-
/**
|
|
19564
|
-
* Advanced measurement cache with font-aware keys
|
|
19563
|
+
/**
|
|
19564
|
+
* Advanced measurement cache with font-aware keys
|
|
19565
19565
|
*/
|
|
19566
19566
|
class MeasurementCache {
|
|
19567
19567
|
constructor() {
|
|
@@ -19588,8 +19588,8 @@ class MeasurementCache {
|
|
|
19588
19588
|
}
|
|
19589
19589
|
}
|
|
19590
19590
|
|
|
19591
|
-
/**
|
|
19592
|
-
* Kerning cache for character pairs
|
|
19591
|
+
/**
|
|
19592
|
+
* Kerning cache for character pairs
|
|
19593
19593
|
*/
|
|
19594
19594
|
class KerningCache {
|
|
19595
19595
|
constructor() {
|
|
@@ -19617,8 +19617,8 @@ class KerningCache {
|
|
|
19617
19617
|
}
|
|
19618
19618
|
}
|
|
19619
19619
|
|
|
19620
|
-
/**
|
|
19621
|
-
* Font metrics cache
|
|
19620
|
+
/**
|
|
19621
|
+
* Font metrics cache
|
|
19622
19622
|
*/
|
|
19623
19623
|
class FontMetricsCache {
|
|
19624
19624
|
constructor() {
|
|
@@ -19653,8 +19653,8 @@ if (typeof document !== 'undefined' && 'fonts' in document) {
|
|
|
19653
19653
|
});
|
|
19654
19654
|
}
|
|
19655
19655
|
|
|
19656
|
-
/**
|
|
19657
|
-
* Clear all measurement caches
|
|
19656
|
+
/**
|
|
19657
|
+
* Clear all measurement caches
|
|
19658
19658
|
*/
|
|
19659
19659
|
function clearAllCaches() {
|
|
19660
19660
|
measurementCache.clear();
|
|
@@ -19662,9 +19662,9 @@ function clearAllCaches() {
|
|
|
19662
19662
|
fontMetricsCache.clear();
|
|
19663
19663
|
}
|
|
19664
19664
|
|
|
19665
|
-
/**
|
|
19666
|
-
* Detect if a font lacks English glyph support
|
|
19667
|
-
* These fonts should use browser-native measurement instead of Fabric's character-by-character measurement
|
|
19665
|
+
/**
|
|
19666
|
+
* Detect if a font lacks English glyph support
|
|
19667
|
+
* These fonts should use browser-native measurement instead of Fabric's character-by-character measurement
|
|
19668
19668
|
*/
|
|
19669
19669
|
function fontLacksEnglishGlyphs(fontFamily) {
|
|
19670
19670
|
if (typeof document === 'undefined') return false;
|
|
@@ -19708,8 +19708,8 @@ function fontLacksEnglishGlyphs(fontFamily) {
|
|
|
19708
19708
|
// Cache for font glyph detection results
|
|
19709
19709
|
const fontGlyphCache = new Map();
|
|
19710
19710
|
|
|
19711
|
-
/**
|
|
19712
|
-
* Cached version of font glyph detection
|
|
19711
|
+
/**
|
|
19712
|
+
* Cached version of font glyph detection
|
|
19713
19713
|
*/
|
|
19714
19714
|
function fontLacksEnglishGlyphsCached(fontFamily) {
|
|
19715
19715
|
if (fontGlyphCache.has(fontFamily)) {
|
|
@@ -19720,17 +19720,17 @@ function fontLacksEnglishGlyphsCached(fontFamily) {
|
|
|
19720
19720
|
return result;
|
|
19721
19721
|
}
|
|
19722
19722
|
|
|
19723
|
-
/**
|
|
19724
|
-
* Unicode and Internationalization Support
|
|
19725
|
-
*
|
|
19726
|
-
* Enhanced Unicode handling for complex scripts, RTL/LTR text,
|
|
19727
|
-
* and grapheme cluster boundary detection.
|
|
19723
|
+
/**
|
|
19724
|
+
* Unicode and Internationalization Support
|
|
19725
|
+
*
|
|
19726
|
+
* Enhanced Unicode handling for complex scripts, RTL/LTR text,
|
|
19727
|
+
* and grapheme cluster boundary detection.
|
|
19728
19728
|
*/
|
|
19729
19729
|
|
|
19730
19730
|
|
|
19731
|
-
/**
|
|
19732
|
-
* Enhanced grapheme segmentation using Intl.Segmenter when available
|
|
19733
|
-
* with fallback to existing graphemeSplit implementation
|
|
19731
|
+
/**
|
|
19732
|
+
* Enhanced grapheme segmentation using Intl.Segmenter when available
|
|
19733
|
+
* with fallback to existing graphemeSplit implementation
|
|
19734
19734
|
*/
|
|
19735
19735
|
function segmentGraphemes(text) {
|
|
19736
19736
|
// Use native Intl.Segmenter if available
|
|
@@ -19750,15 +19750,15 @@ function segmentGraphemes(text) {
|
|
|
19750
19750
|
return graphemeSplit(text);
|
|
19751
19751
|
}
|
|
19752
19752
|
|
|
19753
|
-
/**
|
|
19754
|
-
* Ellipsis Text Truncation System
|
|
19755
|
-
*
|
|
19756
|
-
* Implements text truncation with ellipsis when content exceeds bounds,
|
|
19757
|
-
* using binary search for optimal truncation points.
|
|
19753
|
+
/**
|
|
19754
|
+
* Ellipsis Text Truncation System
|
|
19755
|
+
*
|
|
19756
|
+
* Implements text truncation with ellipsis when content exceeds bounds,
|
|
19757
|
+
* using binary search for optimal truncation points.
|
|
19758
19758
|
*/
|
|
19759
19759
|
|
|
19760
|
-
/**
|
|
19761
|
-
* Apply ellipsis truncation to text based on width/height constraints
|
|
19760
|
+
/**
|
|
19761
|
+
* Apply ellipsis truncation to text based on width/height constraints
|
|
19762
19762
|
*/
|
|
19763
19763
|
function applyEllipsis(text, options) {
|
|
19764
19764
|
const {
|
|
@@ -19828,8 +19828,8 @@ function applyEllipsis(text, options) {
|
|
|
19828
19828
|
};
|
|
19829
19829
|
}
|
|
19830
19830
|
|
|
19831
|
-
/**
|
|
19832
|
-
* Truncate text based on width constraint using binary search
|
|
19831
|
+
/**
|
|
19832
|
+
* Truncate text based on width constraint using binary search
|
|
19833
19833
|
*/
|
|
19834
19834
|
function truncateByWidth(text, maxWidth, ellipsisChar, ellipsisWidth, measureFn) {
|
|
19835
19835
|
const graphemes = segmentGraphemes(text);
|
|
@@ -19879,8 +19879,8 @@ function truncateByWidth(text, maxWidth, ellipsisChar, ellipsisWidth, measureFn)
|
|
|
19879
19879
|
};
|
|
19880
19880
|
}
|
|
19881
19881
|
|
|
19882
|
-
/**
|
|
19883
|
-
* Truncate text based on height constraint
|
|
19882
|
+
/**
|
|
19883
|
+
* Truncate text based on height constraint
|
|
19884
19884
|
*/
|
|
19885
19885
|
function truncateByHeight(text, maxHeight, ellipsisChar, measureFn) {
|
|
19886
19886
|
var _measureFn;
|
|
@@ -19928,19 +19928,19 @@ function truncateByHeight(text, maxHeight, ellipsisChar, measureFn) {
|
|
|
19928
19928
|
return truncateByWidth(lines[0], firstLineWidth, ellipsisChar, 0, measureFn);
|
|
19929
19929
|
}
|
|
19930
19930
|
|
|
19931
|
-
/**
|
|
19932
|
-
* Core Text Layout Engine
|
|
19933
|
-
*
|
|
19934
|
-
* Implements Konva-compatible text layout with support for:
|
|
19935
|
-
* - Multiple wrap modes (word/char/none)
|
|
19936
|
-
* - Ellipsis truncation
|
|
19937
|
-
* - Justify alignment with proper space distribution
|
|
19938
|
-
* - RTL/LTR text direction
|
|
19939
|
-
* - Advanced grapheme handling
|
|
19931
|
+
/**
|
|
19932
|
+
* Core Text Layout Engine
|
|
19933
|
+
*
|
|
19934
|
+
* Implements Konva-compatible text layout with support for:
|
|
19935
|
+
* - Multiple wrap modes (word/char/none)
|
|
19936
|
+
* - Ellipsis truncation
|
|
19937
|
+
* - Justify alignment with proper space distribution
|
|
19938
|
+
* - RTL/LTR text direction
|
|
19939
|
+
* - Advanced grapheme handling
|
|
19940
19940
|
*/
|
|
19941
19941
|
|
|
19942
|
-
/**
|
|
19943
|
-
* Main text layout function - converts text and options into positioned layout
|
|
19942
|
+
/**
|
|
19943
|
+
* Main text layout function - converts text and options into positioned layout
|
|
19944
19944
|
*/
|
|
19945
19945
|
function layoutText(options) {
|
|
19946
19946
|
var _ellipsisResult;
|
|
@@ -20059,8 +20059,8 @@ function layoutText(options) {
|
|
|
20059
20059
|
};
|
|
20060
20060
|
}
|
|
20061
20061
|
|
|
20062
|
-
/**
|
|
20063
|
-
* Layout a single paragraph with wrapping
|
|
20062
|
+
/**
|
|
20063
|
+
* Layout a single paragraph with wrapping
|
|
20064
20064
|
*/
|
|
20065
20065
|
function layoutParagraph(text, options) {
|
|
20066
20066
|
const {
|
|
@@ -20095,8 +20095,8 @@ function layoutParagraph(text, options) {
|
|
|
20095
20095
|
return layoutLines;
|
|
20096
20096
|
}
|
|
20097
20097
|
|
|
20098
|
-
/**
|
|
20099
|
-
* Layout a single line of text (no wrapping)
|
|
20098
|
+
/**
|
|
20099
|
+
* Layout a single line of text (no wrapping)
|
|
20100
20100
|
*/
|
|
20101
20101
|
function layoutSingleLine(text, options) {
|
|
20102
20102
|
let textOffset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
@@ -20166,8 +20166,8 @@ function layoutSingleLine(text, options) {
|
|
|
20166
20166
|
};
|
|
20167
20167
|
}
|
|
20168
20168
|
|
|
20169
|
-
/**
|
|
20170
|
-
* Word-based wrapping algorithm
|
|
20169
|
+
/**
|
|
20170
|
+
* Word-based wrapping algorithm
|
|
20171
20171
|
*/
|
|
20172
20172
|
function wrapByWords(text, maxWidth, options) {
|
|
20173
20173
|
const lines = [];
|
|
@@ -20200,8 +20200,8 @@ function wrapByWords(text, maxWidth, options) {
|
|
|
20200
20200
|
return lines.length > 0 ? lines : [''];
|
|
20201
20201
|
}
|
|
20202
20202
|
|
|
20203
|
-
/**
|
|
20204
|
-
* Character-based wrapping algorithm
|
|
20203
|
+
/**
|
|
20204
|
+
* Character-based wrapping algorithm
|
|
20205
20205
|
*/
|
|
20206
20206
|
function wrapByCharacters(text, maxWidth, options) {
|
|
20207
20207
|
const lines = [];
|
|
@@ -20223,8 +20223,8 @@ function wrapByCharacters(text, maxWidth, options) {
|
|
|
20223
20223
|
return lines.length > 0 ? lines : [''];
|
|
20224
20224
|
}
|
|
20225
20225
|
|
|
20226
|
-
/**
|
|
20227
|
-
* Apply text alignment to lines
|
|
20226
|
+
/**
|
|
20227
|
+
* Apply text alignment to lines
|
|
20228
20228
|
*/
|
|
20229
20229
|
function applyAlignment(lines, align, containerWidth, options) {
|
|
20230
20230
|
return lines.map(line => {
|
|
@@ -20258,8 +20258,8 @@ function applyAlignment(lines, align, containerWidth, options) {
|
|
|
20258
20258
|
});
|
|
20259
20259
|
}
|
|
20260
20260
|
|
|
20261
|
-
/**
|
|
20262
|
-
* Apply justify alignment by expanding spaces
|
|
20261
|
+
/**
|
|
20262
|
+
* Apply justify alignment by expanding spaces
|
|
20263
20263
|
*/
|
|
20264
20264
|
function applyJustification(line, containerWidth, options) {
|
|
20265
20265
|
const spaces = line.graphemes.filter(g => /\s/.test(g)).length;
|
|
@@ -20282,8 +20282,8 @@ function applyJustification(line, containerWidth, options) {
|
|
|
20282
20282
|
return line;
|
|
20283
20283
|
}
|
|
20284
20284
|
|
|
20285
|
-
/**
|
|
20286
|
-
* Calculate vertical alignment offset
|
|
20285
|
+
/**
|
|
20286
|
+
* Calculate vertical alignment offset
|
|
20287
20287
|
*/
|
|
20288
20288
|
function calculateVerticalOffset(contentHeight, containerHeight, align) {
|
|
20289
20289
|
switch (align) {
|
|
@@ -20297,8 +20297,8 @@ function calculateVerticalOffset(contentHeight, containerHeight, align) {
|
|
|
20297
20297
|
}
|
|
20298
20298
|
}
|
|
20299
20299
|
|
|
20300
|
-
/**
|
|
20301
|
-
* Handle height overflow with ellipsis
|
|
20300
|
+
/**
|
|
20301
|
+
* Handle height overflow with ellipsis
|
|
20302
20302
|
*/
|
|
20303
20303
|
function handleHeightOverflow(existingLines, overflowLine, remainingHeight, options) {
|
|
20304
20304
|
// If ellipsis is enabled, try to fit part of the overflow line
|
|
@@ -20327,8 +20327,8 @@ function handleHeightOverflow(existingLines, overflowLine, remainingHeight, opti
|
|
|
20327
20327
|
};
|
|
20328
20328
|
}
|
|
20329
20329
|
|
|
20330
|
-
/**
|
|
20331
|
-
* Create empty line for empty paragraphs
|
|
20330
|
+
/**
|
|
20331
|
+
* Create empty line for empty paragraphs
|
|
20332
20332
|
*/
|
|
20333
20333
|
function createEmptyLine(options) {
|
|
20334
20334
|
const height = options.fontSize * options.lineHeight;
|
|
@@ -20344,8 +20344,8 @@ function createEmptyLine(options) {
|
|
|
20344
20344
|
};
|
|
20345
20345
|
}
|
|
20346
20346
|
|
|
20347
|
-
/**
|
|
20348
|
-
* Measure width of a line of text
|
|
20347
|
+
/**
|
|
20348
|
+
* Measure width of a line of text
|
|
20349
20349
|
*/
|
|
20350
20350
|
function measureLineWidth(text, options) {
|
|
20351
20351
|
const graphemes = segmentGraphemes(text);
|
|
@@ -20362,8 +20362,8 @@ function measureLineWidth(text, options) {
|
|
|
20362
20362
|
return width;
|
|
20363
20363
|
}
|
|
20364
20364
|
|
|
20365
|
-
/**
|
|
20366
|
-
* Convert layout options to measurement options
|
|
20365
|
+
/**
|
|
20366
|
+
* Convert layout options to measurement options
|
|
20367
20367
|
*/
|
|
20368
20368
|
function createMeasurementOptions(options) {
|
|
20369
20369
|
return {
|
|
@@ -20606,15 +20606,15 @@ class TextSVGExportMixin extends FabricObjectSVGExportMixin {
|
|
|
20606
20606
|
}
|
|
20607
20607
|
}
|
|
20608
20608
|
|
|
20609
|
-
/**
|
|
20610
|
-
* Browser Line Break Extraction
|
|
20611
|
-
*
|
|
20612
|
-
* Captures exact line breaks as rendered by the browser to ensure
|
|
20613
|
-
* pixel-perfect consistency between DOM editing and canvas rendering.
|
|
20609
|
+
/**
|
|
20610
|
+
* Browser Line Break Extraction
|
|
20611
|
+
*
|
|
20612
|
+
* Captures exact line breaks as rendered by the browser to ensure
|
|
20613
|
+
* pixel-perfect consistency between DOM editing and canvas rendering.
|
|
20614
20614
|
*/
|
|
20615
20615
|
|
|
20616
|
-
/**
|
|
20617
|
-
* Segment text into graphemes safely using Intl.Segmenter or fallback
|
|
20616
|
+
/**
|
|
20617
|
+
* Segment text into graphemes safely using Intl.Segmenter or fallback
|
|
20618
20618
|
*/
|
|
20619
20619
|
function segmentIntoGraphemes(text) {
|
|
20620
20620
|
if (typeof Intl !== 'undefined' && Intl.Segmenter) {
|
|
@@ -20628,9 +20628,9 @@ function segmentIntoGraphemes(text) {
|
|
|
20628
20628
|
return Array.from(text);
|
|
20629
20629
|
}
|
|
20630
20630
|
|
|
20631
|
-
/**
|
|
20632
|
-
* Extract line break information from a textarea by creating a mirror element
|
|
20633
|
-
* with identical computed styles and measuring grapheme positions.
|
|
20631
|
+
/**
|
|
20632
|
+
* Extract line break information from a textarea by creating a mirror element
|
|
20633
|
+
* with identical computed styles and measuring grapheme positions.
|
|
20634
20634
|
*/
|
|
20635
20635
|
function extractLinesFromDOM(textarea) {
|
|
20636
20636
|
const text = textarea.value;
|
|
@@ -20638,7 +20638,8 @@ function extractLinesFromDOM(textarea) {
|
|
|
20638
20638
|
return {
|
|
20639
20639
|
lines: [],
|
|
20640
20640
|
totalWidth: 0,
|
|
20641
|
-
totalHeight: 0
|
|
20641
|
+
totalHeight: 0,
|
|
20642
|
+
width: 0
|
|
20642
20643
|
};
|
|
20643
20644
|
}
|
|
20644
20645
|
|
|
@@ -20667,6 +20668,8 @@ function extractLinesFromDOM(textarea) {
|
|
|
20667
20668
|
mirror.style.overflow = 'hidden';
|
|
20668
20669
|
mirror.style.resize = 'none';
|
|
20669
20670
|
container.appendChild(mirror);
|
|
20671
|
+
// capture the width the browser is using for layout
|
|
20672
|
+
const width = mirror.clientWidth;
|
|
20670
20673
|
try {
|
|
20671
20674
|
// Segment text into graphemes
|
|
20672
20675
|
const graphemes = segmentIntoGraphemes(text);
|
|
@@ -20717,7 +20720,8 @@ function extractLinesFromDOM(textarea) {
|
|
|
20717
20720
|
return {
|
|
20718
20721
|
lines,
|
|
20719
20722
|
totalWidth,
|
|
20720
|
-
totalHeight
|
|
20723
|
+
totalHeight,
|
|
20724
|
+
width
|
|
20721
20725
|
};
|
|
20722
20726
|
} finally {
|
|
20723
20727
|
// Clean up mirror element
|
|
@@ -20725,16 +20729,16 @@ function extractLinesFromDOM(textarea) {
|
|
|
20725
20729
|
}
|
|
20726
20730
|
}
|
|
20727
20731
|
|
|
20728
|
-
/**
|
|
20729
|
-
* Create a hash of layout-affecting properties to detect when browser lines are still valid
|
|
20732
|
+
/**
|
|
20733
|
+
* Create a hash of layout-affecting properties to detect when browser lines are still valid
|
|
20730
20734
|
*/
|
|
20731
20735
|
function createLayoutHash(target) {
|
|
20732
20736
|
const properties = [target.text, target.width, target.height, target.fontFamily, target.fontSize, target.fontWeight, target.fontStyle, target.lineHeight, target.charSpacing, target.textAlign, target.direction];
|
|
20733
20737
|
return properties.map(p => String(p)).join('|');
|
|
20734
20738
|
}
|
|
20735
20739
|
|
|
20736
|
-
/**
|
|
20737
|
-
* Check if stored browser lines are still valid for the current target state
|
|
20740
|
+
/**
|
|
20741
|
+
* Check if stored browser lines are still valid for the current target state
|
|
20738
20742
|
*/
|
|
20739
20743
|
function areBrowserLinesValid(target, storedHash) {
|
|
20740
20744
|
if (!storedHash || !target.__lastBrowserLines) {
|
|
@@ -20743,40 +20747,46 @@ function areBrowserLinesValid(target, storedHash) {
|
|
|
20743
20747
|
const currentHash = createLayoutHash(target);
|
|
20744
20748
|
return currentHash === storedHash;
|
|
20745
20749
|
}
|
|
20746
|
-
|
|
20747
|
-
|
|
20748
|
-
* Store browser lines on a target object with validity hash
|
|
20750
|
+
/**
|
|
20751
|
+
* Store browser lines on a target object with validity hash
|
|
20749
20752
|
*/
|
|
20750
|
-
function storeBrowserLines(target, lines, layoutHash) {
|
|
20753
|
+
function storeBrowserLines(target, lines, width, layoutHash) {
|
|
20751
20754
|
target.__lastBrowserLines = lines;
|
|
20755
|
+
target.__lastBrowserLinesWidth = width;
|
|
20752
20756
|
target.__lastBrowserLinesHash = createLayoutHash(target);
|
|
20753
20757
|
}
|
|
20754
20758
|
|
|
20755
|
-
/**
|
|
20756
|
-
* Clear stored browser lines from a target object
|
|
20759
|
+
/**
|
|
20760
|
+
* Clear stored browser lines from a target object
|
|
20757
20761
|
*/
|
|
20758
20762
|
function clearBrowserLines(target) {
|
|
20759
20763
|
delete target.__lastBrowserLines;
|
|
20760
20764
|
delete target.__lastBrowserLinesHash;
|
|
20765
|
+
delete target.__lastBrowserLinesWidth;
|
|
20761
20766
|
}
|
|
20762
20767
|
|
|
20763
|
-
/**
|
|
20764
|
-
* Get stored browser lines if they're still valid
|
|
20768
|
+
/**
|
|
20769
|
+
* Get stored browser lines if they're still valid
|
|
20765
20770
|
*/
|
|
20766
20771
|
function getBrowserLines(target) {
|
|
20767
20772
|
const lines = target.__lastBrowserLines;
|
|
20768
20773
|
const hash = target.__lastBrowserLinesHash;
|
|
20769
20774
|
if (lines && areBrowserLinesValid(target, hash)) {
|
|
20770
|
-
return
|
|
20775
|
+
return {
|
|
20776
|
+
lines,
|
|
20777
|
+
totalWidth: 0,
|
|
20778
|
+
totalHeight: 0,
|
|
20779
|
+
width: target.__lastBrowserLinesWidth
|
|
20780
|
+
};
|
|
20771
20781
|
}
|
|
20772
20782
|
return null;
|
|
20773
20783
|
}
|
|
20774
20784
|
|
|
20775
20785
|
let measuringContext;
|
|
20776
20786
|
|
|
20777
|
-
/**
|
|
20778
|
-
* Return a context for measurement of text string.
|
|
20779
|
-
* if created it gets stored for reuse
|
|
20787
|
+
/**
|
|
20788
|
+
* Return a context for measurement of text string.
|
|
20789
|
+
* if created it gets stored for reuse
|
|
20780
20790
|
*/
|
|
20781
20791
|
function getMeasuringContext() {
|
|
20782
20792
|
if (!measuringContext) {
|
|
@@ -20789,17 +20799,17 @@ function getMeasuringContext() {
|
|
|
20789
20799
|
return measuringContext;
|
|
20790
20800
|
}
|
|
20791
20801
|
|
|
20792
|
-
/**
|
|
20793
|
-
* Measure and return the info of a single grapheme.
|
|
20794
|
-
* needs the the info of previous graphemes already filled
|
|
20795
|
-
* Override to customize measuring
|
|
20802
|
+
/**
|
|
20803
|
+
* Measure and return the info of a single grapheme.
|
|
20804
|
+
* needs the the info of previous graphemes already filled
|
|
20805
|
+
* Override to customize measuring
|
|
20796
20806
|
*/
|
|
20797
20807
|
|
|
20798
20808
|
// @TODO this is not complete
|
|
20799
20809
|
|
|
20800
|
-
/**
|
|
20801
|
-
* Text class
|
|
20802
|
-
* @see {@link http://fabricjs.com/fabric-intro-part-2#text}
|
|
20810
|
+
/**
|
|
20811
|
+
* Text class
|
|
20812
|
+
* @see {@link http://fabricjs.com/fabric-intro-part-2#text}
|
|
20803
20813
|
*/
|
|
20804
20814
|
class FabricText extends StyledText {
|
|
20805
20815
|
static getDefaults() {
|
|
@@ -20810,11 +20820,11 @@ class FabricText extends StyledText {
|
|
|
20810
20820
|
}
|
|
20811
20821
|
constructor(text, options) {
|
|
20812
20822
|
super();
|
|
20813
|
-
/**
|
|
20814
|
-
* contains characters bounding boxes
|
|
20815
|
-
* This variable is considered to be protected.
|
|
20816
|
-
* But for how mixins are implemented right now, we can't leave it private
|
|
20817
|
-
* @protected
|
|
20823
|
+
/**
|
|
20824
|
+
* contains characters bounding boxes
|
|
20825
|
+
* This variable is considered to be protected.
|
|
20826
|
+
* But for how mixins are implemented right now, we can't leave it private
|
|
20827
|
+
* @protected
|
|
20818
20828
|
*/
|
|
20819
20829
|
_defineProperty(this, "__charBounds", []);
|
|
20820
20830
|
Object.assign(this, FabricText.ownDefaults);
|
|
@@ -20831,9 +20841,9 @@ class FabricText extends StyledText {
|
|
|
20831
20841
|
this.setCoords();
|
|
20832
20842
|
}
|
|
20833
20843
|
|
|
20834
|
-
/**
|
|
20835
|
-
* If text has a path, it will add the extra information needed
|
|
20836
|
-
* for path and text calculations
|
|
20844
|
+
/**
|
|
20845
|
+
* If text has a path, it will add the extra information needed
|
|
20846
|
+
* for path and text calculations
|
|
20837
20847
|
*/
|
|
20838
20848
|
setPathInfo() {
|
|
20839
20849
|
const path = this.path;
|
|
@@ -20842,16 +20852,24 @@ class FabricText extends StyledText {
|
|
|
20842
20852
|
}
|
|
20843
20853
|
}
|
|
20844
20854
|
|
|
20845
|
-
/**
|
|
20846
|
-
* @private
|
|
20847
|
-
* Divides text into lines of text and lines of graphemes.
|
|
20848
|
-
* Uses browser lines when available for pixel-perfect consistency.
|
|
20855
|
+
/**
|
|
20856
|
+
* @private
|
|
20857
|
+
* Divides text into lines of text and lines of graphemes.
|
|
20858
|
+
* Uses browser lines when available for pixel-perfect consistency.
|
|
20849
20859
|
*/
|
|
20850
20860
|
_splitText() {
|
|
20851
|
-
//
|
|
20852
|
-
|
|
20853
|
-
|
|
20854
|
-
|
|
20861
|
+
// For justify text with overlay editing, always use normal fabric wrapping
|
|
20862
|
+
if (this.textAlign.includes('justify') && this.useOverlayEditing) {
|
|
20863
|
+
console.log('🧹 JUSTIFY OVERLAY: Using fabric wrapping');
|
|
20864
|
+
this.__lastBrowserLines = null;
|
|
20865
|
+
this.__lastBrowserLinesHash = null;
|
|
20866
|
+
} else {
|
|
20867
|
+
// Check if we have valid browser lines for non-justify text
|
|
20868
|
+
const browserLinesInfo = getBrowserLines(this);
|
|
20869
|
+
if (browserLinesInfo && this.useOverlayEditing) {
|
|
20870
|
+
this._browserWrappingWidth = browserLinesInfo.width;
|
|
20871
|
+
return this._splitTextFromBrowserLines(browserLinesInfo.lines);
|
|
20872
|
+
}
|
|
20855
20873
|
}
|
|
20856
20874
|
const newLines = this._splitTextIntoLines(this.text);
|
|
20857
20875
|
this.textLines = newLines.lines;
|
|
@@ -20861,9 +20879,9 @@ class FabricText extends StyledText {
|
|
|
20861
20879
|
return newLines;
|
|
20862
20880
|
}
|
|
20863
20881
|
|
|
20864
|
-
/**
|
|
20865
|
-
* Create TextLinesInfo from browser-extracted lines
|
|
20866
|
-
* @private
|
|
20882
|
+
/**
|
|
20883
|
+
* Create TextLinesInfo from browser-extracted lines
|
|
20884
|
+
* @private
|
|
20867
20885
|
*/
|
|
20868
20886
|
_splitTextFromBrowserLines(browserLines) {
|
|
20869
20887
|
const lines = [];
|
|
@@ -20897,10 +20915,10 @@ class FabricText extends StyledText {
|
|
|
20897
20915
|
return result;
|
|
20898
20916
|
}
|
|
20899
20917
|
|
|
20900
|
-
/**
|
|
20901
|
-
* Initialize or update text dimensions.
|
|
20902
|
-
* Updates this.width and this.height with the proper values.
|
|
20903
|
-
* Does not return dimensions.
|
|
20918
|
+
/**
|
|
20919
|
+
* Initialize or update text dimensions.
|
|
20920
|
+
* Updates this.width and this.height with the proper values.
|
|
20921
|
+
* Does not return dimensions.
|
|
20904
20922
|
*/
|
|
20905
20923
|
initDimensions() {
|
|
20906
20924
|
// Check if font is ready for accurate measurements
|
|
@@ -20946,24 +20964,29 @@ class FabricText extends StyledText {
|
|
|
20946
20964
|
}
|
|
20947
20965
|
}
|
|
20948
20966
|
|
|
20949
|
-
/**
|
|
20950
|
-
* Enlarge space boxes and shift the others
|
|
20967
|
+
/**
|
|
20968
|
+
* Enlarge space boxes and shift the others
|
|
20951
20969
|
*/
|
|
20952
20970
|
enlargeSpaces() {
|
|
20953
20971
|
let diffSpace, currentLineWidth, numberOfSpaces, accumulatedSpace, line, charBound, spaces;
|
|
20954
20972
|
const isRtl = this.direction === 'rtl';
|
|
20973
|
+
// use browser wrapping width if available
|
|
20974
|
+
const justificationWidth = this._browserWrappingWidth || this.width;
|
|
20975
|
+
if (this._browserWrappingWidth) {
|
|
20976
|
+
this._browserWrappingWidth = undefined;
|
|
20977
|
+
}
|
|
20955
20978
|
for (let i = 0, len = this._textLines.length; i < len; i++) {
|
|
20956
|
-
if (!this.textAlign.includes('justify')
|
|
20979
|
+
if (!this.textAlign.includes('justify') || i === len - 1 || this.isEndOfWrapping(i)) {
|
|
20957
20980
|
continue;
|
|
20958
20981
|
}
|
|
20959
20982
|
accumulatedSpace = 0;
|
|
20960
20983
|
line = this._textLines[i];
|
|
20961
20984
|
currentLineWidth = this.getLineWidth(i);
|
|
20962
|
-
if (currentLineWidth <
|
|
20985
|
+
if (currentLineWidth < justificationWidth && (spaces = this.textLines[i].match(this._reSpacesAndTabs))) {
|
|
20963
20986
|
numberOfSpaces = spaces.length;
|
|
20964
|
-
diffSpace = (
|
|
20987
|
+
diffSpace = (justificationWidth - currentLineWidth) / numberOfSpaces;
|
|
20965
20988
|
console.log(`🔧 EnlargeSpaces Line ${i}:`);
|
|
20966
|
-
console.log(` Current width: ${currentLineWidth}, Target: ${
|
|
20989
|
+
console.log(` Current width: ${currentLineWidth}, Target: ${justificationWidth}`);
|
|
20967
20990
|
console.log(` Spaces: ${numberOfSpaces}, diffSpace: ${diffSpace.toFixed(2)}`);
|
|
20968
20991
|
if (isRtl) {
|
|
20969
20992
|
for (let j = 0; j < line.length; j++) {
|
|
@@ -21009,18 +21032,18 @@ class FabricText extends StyledText {
|
|
|
21009
21032
|
}
|
|
21010
21033
|
}
|
|
21011
21034
|
|
|
21012
|
-
/**
|
|
21013
|
-
* Advanced layout using new text engine (Konva-compatible)
|
|
21014
|
-
* @private
|
|
21035
|
+
/**
|
|
21036
|
+
* Advanced layout using new text engine (Konva-compatible)
|
|
21037
|
+
* @private
|
|
21015
21038
|
*/
|
|
21016
21039
|
_layoutTextAdvanced() {
|
|
21017
21040
|
const options = this._getAdvancedLayoutOptions();
|
|
21018
21041
|
return layoutText(options);
|
|
21019
21042
|
}
|
|
21020
21043
|
|
|
21021
|
-
/**
|
|
21022
|
-
* Get advanced layout options from current text properties
|
|
21023
|
-
* @private
|
|
21044
|
+
/**
|
|
21045
|
+
* Get advanced layout options from current text properties
|
|
21046
|
+
* @private
|
|
21024
21047
|
*/
|
|
21025
21048
|
_getAdvancedLayoutOptions() {
|
|
21026
21049
|
return {
|
|
@@ -21042,9 +21065,9 @@ class FabricText extends StyledText {
|
|
|
21042
21065
|
};
|
|
21043
21066
|
}
|
|
21044
21067
|
|
|
21045
|
-
/**
|
|
21046
|
-
* Map Fabric textAlign to Konva align format
|
|
21047
|
-
* @private
|
|
21068
|
+
/**
|
|
21069
|
+
* Map Fabric textAlign to Konva align format
|
|
21070
|
+
* @private
|
|
21048
21071
|
*/
|
|
21049
21072
|
_mapTextAlignToAlign(textAlign) {
|
|
21050
21073
|
switch (textAlign) {
|
|
@@ -21065,8 +21088,8 @@ class FabricText extends StyledText {
|
|
|
21065
21088
|
}
|
|
21066
21089
|
}
|
|
21067
21090
|
|
|
21068
|
-
/**
|
|
21069
|
-
* Enhanced initDimensions that uses advanced layout when enabled
|
|
21091
|
+
/**
|
|
21092
|
+
* Enhanced initDimensions that uses advanced layout when enabled
|
|
21070
21093
|
*/
|
|
21071
21094
|
initDimensionsAdvanced() {
|
|
21072
21095
|
if (!this.enableAdvancedLayout) {
|
|
@@ -21095,9 +21118,9 @@ class FabricText extends StyledText {
|
|
|
21095
21118
|
this.dirty = true;
|
|
21096
21119
|
}
|
|
21097
21120
|
|
|
21098
|
-
/**
|
|
21099
|
-
* Convert new layout format to legacy _textLines and __charBounds format
|
|
21100
|
-
* @private
|
|
21121
|
+
/**
|
|
21122
|
+
* Convert new layout format to legacy _textLines and __charBounds format
|
|
21123
|
+
* @private
|
|
21101
21124
|
*/
|
|
21102
21125
|
_convertLayoutToLegacyFormat(layout) {
|
|
21103
21126
|
this._textLines = layout.lines.map(line => line.graphemes);
|
|
@@ -21119,30 +21142,30 @@ class FabricText extends StyledText {
|
|
|
21119
21142
|
}
|
|
21120
21143
|
}
|
|
21121
21144
|
|
|
21122
|
-
/**
|
|
21123
|
-
* Detect if the text line is ended with an hard break
|
|
21124
|
-
* text and itext do not have wrapping, return false
|
|
21125
|
-
* @return {Boolean}
|
|
21145
|
+
/**
|
|
21146
|
+
* Detect if the text line is ended with an hard break
|
|
21147
|
+
* text and itext do not have wrapping, return false
|
|
21148
|
+
* @return {Boolean}
|
|
21126
21149
|
*/
|
|
21127
21150
|
isEndOfWrapping(lineIndex) {
|
|
21128
21151
|
return lineIndex === this._textLines.length - 1;
|
|
21129
21152
|
}
|
|
21130
21153
|
|
|
21131
|
-
/**
|
|
21132
|
-
* Detect if a line has a linebreak and so we need to account for it when moving
|
|
21133
|
-
* and counting style.
|
|
21134
|
-
* It return always 1 for text and Itext. Textbox has its own implementation
|
|
21135
|
-
* @return Number
|
|
21154
|
+
/**
|
|
21155
|
+
* Detect if a line has a linebreak and so we need to account for it when moving
|
|
21156
|
+
* and counting style.
|
|
21157
|
+
* It return always 1 for text and Itext. Textbox has its own implementation
|
|
21158
|
+
* @return Number
|
|
21136
21159
|
*/
|
|
21137
21160
|
|
|
21138
21161
|
missingNewlineOffset(_lineIndex) {
|
|
21139
21162
|
return 1;
|
|
21140
21163
|
}
|
|
21141
21164
|
|
|
21142
|
-
/**
|
|
21143
|
-
* Returns 2d representation (lineIndex and charIndex) of cursor
|
|
21144
|
-
* @param {Number} selectionStart
|
|
21145
|
-
* @param {Boolean} [skipWrapping] consider the location for unwrapped lines. useful to manage styles.
|
|
21165
|
+
/**
|
|
21166
|
+
* Returns 2d representation (lineIndex and charIndex) of cursor
|
|
21167
|
+
* @param {Number} selectionStart
|
|
21168
|
+
* @param {Boolean} [skipWrapping] consider the location for unwrapped lines. useful to manage styles.
|
|
21146
21169
|
*/
|
|
21147
21170
|
get2DCursorLocation(selectionStart, skipWrapping) {
|
|
21148
21171
|
const lines = skipWrapping ? this._unwrappedTextLines : this._textLines;
|
|
@@ -21162,24 +21185,24 @@ class FabricText extends StyledText {
|
|
|
21162
21185
|
};
|
|
21163
21186
|
}
|
|
21164
21187
|
|
|
21165
|
-
/**
|
|
21166
|
-
* Returns string representation of an instance
|
|
21167
|
-
* @return {String} String representation of text object
|
|
21188
|
+
/**
|
|
21189
|
+
* Returns string representation of an instance
|
|
21190
|
+
* @return {String} String representation of text object
|
|
21168
21191
|
*/
|
|
21169
21192
|
toString() {
|
|
21170
21193
|
return `#<Text (${this.complexity()}): { "text": "${this.text}", "fontFamily": "${this.fontFamily}" }>`;
|
|
21171
21194
|
}
|
|
21172
21195
|
|
|
21173
|
-
/**
|
|
21174
|
-
* Return the dimension and the zoom level needed to create a cache canvas
|
|
21175
|
-
* big enough to host the object to be cached.
|
|
21176
|
-
* @private
|
|
21177
|
-
* @param {Object} dim.x width of object to be cached
|
|
21178
|
-
* @param {Object} dim.y height of object to be cached
|
|
21179
|
-
* @return {Object}.width width of canvas
|
|
21180
|
-
* @return {Object}.height height of canvas
|
|
21181
|
-
* @return {Object}.zoomX zoomX zoom value to unscale the canvas before drawing cache
|
|
21182
|
-
* @return {Object}.zoomY zoomY zoom value to unscale the canvas before drawing cache
|
|
21196
|
+
/**
|
|
21197
|
+
* Return the dimension and the zoom level needed to create a cache canvas
|
|
21198
|
+
* big enough to host the object to be cached.
|
|
21199
|
+
* @private
|
|
21200
|
+
* @param {Object} dim.x width of object to be cached
|
|
21201
|
+
* @param {Object} dim.y height of object to be cached
|
|
21202
|
+
* @return {Object}.width width of canvas
|
|
21203
|
+
* @return {Object}.height height of canvas
|
|
21204
|
+
* @return {Object}.zoomX zoomX zoom value to unscale the canvas before drawing cache
|
|
21205
|
+
* @return {Object}.zoomY zoomY zoom value to unscale the canvas before drawing cache
|
|
21183
21206
|
*/
|
|
21184
21207
|
_getCacheCanvasDimensions() {
|
|
21185
21208
|
const dims = super._getCacheCanvasDimensions();
|
|
@@ -21189,9 +21212,9 @@ class FabricText extends StyledText {
|
|
|
21189
21212
|
return dims;
|
|
21190
21213
|
}
|
|
21191
21214
|
|
|
21192
|
-
/**
|
|
21193
|
-
* @private
|
|
21194
|
-
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21215
|
+
/**
|
|
21216
|
+
* @private
|
|
21217
|
+
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21195
21218
|
*/
|
|
21196
21219
|
_render(ctx) {
|
|
21197
21220
|
const path = this.path;
|
|
@@ -21204,9 +21227,9 @@ class FabricText extends StyledText {
|
|
|
21204
21227
|
this._renderTextDecoration(ctx, 'linethrough');
|
|
21205
21228
|
}
|
|
21206
21229
|
|
|
21207
|
-
/**
|
|
21208
|
-
* @private
|
|
21209
|
-
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21230
|
+
/**
|
|
21231
|
+
* @private
|
|
21232
|
+
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21210
21233
|
*/
|
|
21211
21234
|
_renderText(ctx) {
|
|
21212
21235
|
// Skip text rendering if in overlay editing mode
|
|
@@ -21222,15 +21245,15 @@ class FabricText extends StyledText {
|
|
|
21222
21245
|
}
|
|
21223
21246
|
}
|
|
21224
21247
|
|
|
21225
|
-
/**
|
|
21226
|
-
* Set the font parameter of the context with the object properties or with charStyle
|
|
21227
|
-
* @private
|
|
21228
|
-
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21229
|
-
* @param {Object} [charStyle] object with font style properties
|
|
21230
|
-
* @param {String} [charStyle.fontFamily] Font Family
|
|
21231
|
-
* @param {Number} [charStyle.fontSize] Font size in pixels. ( without px suffix )
|
|
21232
|
-
* @param {String} [charStyle.fontWeight] Font weight
|
|
21233
|
-
* @param {String} [charStyle.fontStyle] Font style (italic|normal)
|
|
21248
|
+
/**
|
|
21249
|
+
* Set the font parameter of the context with the object properties or with charStyle
|
|
21250
|
+
* @private
|
|
21251
|
+
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21252
|
+
* @param {Object} [charStyle] object with font style properties
|
|
21253
|
+
* @param {String} [charStyle.fontFamily] Font Family
|
|
21254
|
+
* @param {Number} [charStyle.fontSize] Font size in pixels. ( without px suffix )
|
|
21255
|
+
* @param {String} [charStyle.fontWeight] Font weight
|
|
21256
|
+
* @param {String} [charStyle.fontStyle] Font style (italic|normal)
|
|
21234
21257
|
*/
|
|
21235
21258
|
_setTextStyles(ctx, charStyle, forMeasuring) {
|
|
21236
21259
|
ctx.textBaseline = 'alphabetic';
|
|
@@ -21250,11 +21273,11 @@ class FabricText extends StyledText {
|
|
|
21250
21273
|
ctx.font = this._getFontDeclaration(charStyle, forMeasuring);
|
|
21251
21274
|
}
|
|
21252
21275
|
|
|
21253
|
-
/**
|
|
21254
|
-
* calculate and return the text Width measuring each line.
|
|
21255
|
-
* @private
|
|
21256
|
-
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21257
|
-
* @return {Number} Maximum width of Text object
|
|
21276
|
+
/**
|
|
21277
|
+
* calculate and return the text Width measuring each line.
|
|
21278
|
+
* @private
|
|
21279
|
+
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21280
|
+
* @return {Number} Maximum width of Text object
|
|
21258
21281
|
*/
|
|
21259
21282
|
calcTextWidth() {
|
|
21260
21283
|
let maxWidth = this.getLineWidth(0);
|
|
@@ -21267,23 +21290,23 @@ class FabricText extends StyledText {
|
|
|
21267
21290
|
return maxWidth;
|
|
21268
21291
|
}
|
|
21269
21292
|
|
|
21270
|
-
/**
|
|
21271
|
-
* @private
|
|
21272
|
-
* @param {String} method Method name ("fillText" or "strokeText")
|
|
21273
|
-
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21274
|
-
* @param {String} line Text to render
|
|
21275
|
-
* @param {Number} left Left position of text
|
|
21276
|
-
* @param {Number} top Top position of text
|
|
21277
|
-
* @param {Number} lineIndex Index of a line in a text
|
|
21293
|
+
/**
|
|
21294
|
+
* @private
|
|
21295
|
+
* @param {String} method Method name ("fillText" or "strokeText")
|
|
21296
|
+
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21297
|
+
* @param {String} line Text to render
|
|
21298
|
+
* @param {Number} left Left position of text
|
|
21299
|
+
* @param {Number} top Top position of text
|
|
21300
|
+
* @param {Number} lineIndex Index of a line in a text
|
|
21278
21301
|
*/
|
|
21279
21302
|
_renderTextLine(method, ctx, line, left, top, lineIndex) {
|
|
21280
21303
|
this._renderChars(method, ctx, line, left, top, lineIndex);
|
|
21281
21304
|
}
|
|
21282
21305
|
|
|
21283
|
-
/**
|
|
21284
|
-
* Renders the text background for lines, taking care of style
|
|
21285
|
-
* @private
|
|
21286
|
-
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21306
|
+
/**
|
|
21307
|
+
* Renders the text background for lines, taking care of style
|
|
21308
|
+
* @private
|
|
21309
|
+
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21287
21310
|
*/
|
|
21288
21311
|
_renderTextLinesBackground(ctx) {
|
|
21289
21312
|
if (!this.textBackgroundColor && !this.styleHas('textBackgroundColor')) {
|
|
@@ -21346,15 +21369,15 @@ class FabricText extends StyledText {
|
|
|
21346
21369
|
this._removeShadow(ctx);
|
|
21347
21370
|
}
|
|
21348
21371
|
|
|
21349
|
-
/**
|
|
21350
|
-
* measure and return the width of a single character.
|
|
21351
|
-
* possibly overridden to accommodate different measure logic or
|
|
21352
|
-
* to hook some external lib for character measurement
|
|
21353
|
-
* @private
|
|
21354
|
-
* @param {String} _char, char to be measured
|
|
21355
|
-
* @param {Object} charStyle style of char to be measured
|
|
21356
|
-
* @param {String} [previousChar] previous char
|
|
21357
|
-
* @param {Object} [prevCharStyle] style of previous char
|
|
21372
|
+
/**
|
|
21373
|
+
* measure and return the width of a single character.
|
|
21374
|
+
* possibly overridden to accommodate different measure logic or
|
|
21375
|
+
* to hook some external lib for character measurement
|
|
21376
|
+
* @private
|
|
21377
|
+
* @param {String} _char, char to be measured
|
|
21378
|
+
* @param {Object} charStyle style of char to be measured
|
|
21379
|
+
* @param {String} [previousChar] previous char
|
|
21380
|
+
* @param {Object} [prevCharStyle] style of previous char
|
|
21358
21381
|
*/
|
|
21359
21382
|
_measureChar(_char, charStyle, previousChar, prevCharStyle) {
|
|
21360
21383
|
const fontCache = cache.getFontCache(charStyle),
|
|
@@ -21399,19 +21422,19 @@ class FabricText extends StyledText {
|
|
|
21399
21422
|
};
|
|
21400
21423
|
}
|
|
21401
21424
|
|
|
21402
|
-
/**
|
|
21403
|
-
* Computes height of character at given position
|
|
21404
|
-
* @param {Number} line the line index number
|
|
21405
|
-
* @param {Number} _char the character index number
|
|
21406
|
-
* @return {Number} fontSize of the character
|
|
21425
|
+
/**
|
|
21426
|
+
* Computes height of character at given position
|
|
21427
|
+
* @param {Number} line the line index number
|
|
21428
|
+
* @param {Number} _char the character index number
|
|
21429
|
+
* @return {Number} fontSize of the character
|
|
21407
21430
|
*/
|
|
21408
21431
|
getHeightOfChar(line, _char) {
|
|
21409
21432
|
return this.getValueOfPropertyAt(line, _char, 'fontSize');
|
|
21410
21433
|
}
|
|
21411
21434
|
|
|
21412
|
-
/**
|
|
21413
|
-
* measure a text line measuring all characters.
|
|
21414
|
-
* @param {Number} lineIndex line number
|
|
21435
|
+
/**
|
|
21436
|
+
* measure a text line measuring all characters.
|
|
21437
|
+
* @param {Number} lineIndex line number
|
|
21415
21438
|
*/
|
|
21416
21439
|
measureLine(lineIndex) {
|
|
21417
21440
|
const lineInfo = this._measureLine(lineIndex);
|
|
@@ -21424,11 +21447,11 @@ class FabricText extends StyledText {
|
|
|
21424
21447
|
return lineInfo;
|
|
21425
21448
|
}
|
|
21426
21449
|
|
|
21427
|
-
/**
|
|
21428
|
-
* measure every grapheme of a line, populating __charBounds
|
|
21429
|
-
* @param {Number} lineIndex
|
|
21430
|
-
* @return {Object} object.width total width of characters
|
|
21431
|
-
* @return {Object} object.numOfSpaces length of chars that match this._reSpacesAndTabs
|
|
21450
|
+
/**
|
|
21451
|
+
* measure every grapheme of a line, populating __charBounds
|
|
21452
|
+
* @param {Number} lineIndex
|
|
21453
|
+
* @return {Object} object.width total width of characters
|
|
21454
|
+
* @return {Object} object.numOfSpaces length of chars that match this._reSpacesAndTabs
|
|
21432
21455
|
*/
|
|
21433
21456
|
_measureLine(lineIndex) {
|
|
21434
21457
|
let width = 0,
|
|
@@ -21491,13 +21514,13 @@ class FabricText extends StyledText {
|
|
|
21491
21514
|
};
|
|
21492
21515
|
}
|
|
21493
21516
|
|
|
21494
|
-
/**
|
|
21495
|
-
* Calculate the angle and the left,top position of the char that follow a path.
|
|
21496
|
-
* It appends it to graphemeInfo to be reused later at rendering
|
|
21497
|
-
* @private
|
|
21498
|
-
* @param {Number} positionInPath to be measured
|
|
21499
|
-
* @param {GraphemeBBox} graphemeInfo current grapheme box information
|
|
21500
|
-
* @param {Object} startingPoint position of the point
|
|
21517
|
+
/**
|
|
21518
|
+
* Calculate the angle and the left,top position of the char that follow a path.
|
|
21519
|
+
* It appends it to graphemeInfo to be reused later at rendering
|
|
21520
|
+
* @private
|
|
21521
|
+
* @param {Number} positionInPath to be measured
|
|
21522
|
+
* @param {GraphemeBBox} graphemeInfo current grapheme box information
|
|
21523
|
+
* @param {Object} startingPoint position of the point
|
|
21501
21524
|
*/
|
|
21502
21525
|
_setGraphemeOnPath(positionInPath, graphemeInfo) {
|
|
21503
21526
|
const centerPosition = positionInPath + graphemeInfo.kernedWidth / 2,
|
|
@@ -21510,13 +21533,13 @@ class FabricText extends StyledText {
|
|
|
21510
21533
|
graphemeInfo.angle = info.angle + (this.pathSide === RIGHT ? Math.PI : 0);
|
|
21511
21534
|
}
|
|
21512
21535
|
|
|
21513
|
-
/**
|
|
21514
|
-
*
|
|
21515
|
-
* @param {String} grapheme to be measured
|
|
21516
|
-
* @param {Number} lineIndex index of the line where the char is
|
|
21517
|
-
* @param {Number} charIndex position in the line
|
|
21518
|
-
* @param {String} [prevGrapheme] character preceding the one to be measured
|
|
21519
|
-
* @returns {GraphemeBBox} grapheme bbox
|
|
21536
|
+
/**
|
|
21537
|
+
*
|
|
21538
|
+
* @param {String} grapheme to be measured
|
|
21539
|
+
* @param {Number} lineIndex index of the line where the char is
|
|
21540
|
+
* @param {Number} charIndex position in the line
|
|
21541
|
+
* @param {String} [prevGrapheme] character preceding the one to be measured
|
|
21542
|
+
* @returns {GraphemeBBox} grapheme bbox
|
|
21520
21543
|
*/
|
|
21521
21544
|
_getGraphemeBox(grapheme, lineIndex, charIndex, prevGrapheme, skipLeft) {
|
|
21522
21545
|
const style = this.getCompleteStyleDeclaration(lineIndex, charIndex),
|
|
@@ -21544,10 +21567,10 @@ class FabricText extends StyledText {
|
|
|
21544
21567
|
return box;
|
|
21545
21568
|
}
|
|
21546
21569
|
|
|
21547
|
-
/**
|
|
21548
|
-
* Calculate height of line at 'lineIndex'
|
|
21549
|
-
* @param {Number} lineIndex index of line to calculate
|
|
21550
|
-
* @return {Number}
|
|
21570
|
+
/**
|
|
21571
|
+
* Calculate height of line at 'lineIndex'
|
|
21572
|
+
* @param {Number} lineIndex index of line to calculate
|
|
21573
|
+
* @return {Number}
|
|
21551
21574
|
*/
|
|
21552
21575
|
getHeightOfLine(lineIndex) {
|
|
21553
21576
|
if (this.__lineHeights[lineIndex]) {
|
|
@@ -21563,8 +21586,8 @@ class FabricText extends StyledText {
|
|
|
21563
21586
|
return this.__lineHeights[lineIndex] = maxHeight * this.lineHeight * this._fontSizeMult;
|
|
21564
21587
|
}
|
|
21565
21588
|
|
|
21566
|
-
/**
|
|
21567
|
-
* Calculate text box height
|
|
21589
|
+
/**
|
|
21590
|
+
* Calculate text box height
|
|
21568
21591
|
*/
|
|
21569
21592
|
calcTextHeight() {
|
|
21570
21593
|
let lineHeight,
|
|
@@ -21576,26 +21599,26 @@ class FabricText extends StyledText {
|
|
|
21576
21599
|
return height;
|
|
21577
21600
|
}
|
|
21578
21601
|
|
|
21579
|
-
/**
|
|
21580
|
-
* @private
|
|
21581
|
-
* @return {Number} Left offset
|
|
21602
|
+
/**
|
|
21603
|
+
* @private
|
|
21604
|
+
* @return {Number} Left offset
|
|
21582
21605
|
*/
|
|
21583
21606
|
_getLeftOffset() {
|
|
21584
21607
|
return this.direction === 'ltr' ? -this.width / 2 : this.width / 2;
|
|
21585
21608
|
}
|
|
21586
21609
|
|
|
21587
|
-
/**
|
|
21588
|
-
* @private
|
|
21589
|
-
* @return {Number} Top offset
|
|
21610
|
+
/**
|
|
21611
|
+
* @private
|
|
21612
|
+
* @return {Number} Top offset
|
|
21590
21613
|
*/
|
|
21591
21614
|
_getTopOffset() {
|
|
21592
21615
|
return -this.height / 2;
|
|
21593
21616
|
}
|
|
21594
21617
|
|
|
21595
|
-
/**
|
|
21596
|
-
* @private
|
|
21597
|
-
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21598
|
-
* @param {String} method Method name ("fillText" or "strokeText")
|
|
21618
|
+
/**
|
|
21619
|
+
* @private
|
|
21620
|
+
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21621
|
+
* @param {String} method Method name ("fillText" or "strokeText")
|
|
21599
21622
|
*/
|
|
21600
21623
|
_renderTextCommon(ctx, method) {
|
|
21601
21624
|
ctx.save();
|
|
@@ -21612,9 +21635,9 @@ class FabricText extends StyledText {
|
|
|
21612
21635
|
ctx.restore();
|
|
21613
21636
|
}
|
|
21614
21637
|
|
|
21615
|
-
/**
|
|
21616
|
-
* @private
|
|
21617
|
-
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21638
|
+
/**
|
|
21639
|
+
* @private
|
|
21640
|
+
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21618
21641
|
*/
|
|
21619
21642
|
_renderTextFill(ctx) {
|
|
21620
21643
|
if (!this.fill && !this.styleHas(FILL)) {
|
|
@@ -21623,9 +21646,9 @@ class FabricText extends StyledText {
|
|
|
21623
21646
|
this._renderTextCommon(ctx, 'fillText');
|
|
21624
21647
|
}
|
|
21625
21648
|
|
|
21626
|
-
/**
|
|
21627
|
-
* @private
|
|
21628
|
-
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21649
|
+
/**
|
|
21650
|
+
* @private
|
|
21651
|
+
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21629
21652
|
*/
|
|
21630
21653
|
_renderTextStroke(ctx) {
|
|
21631
21654
|
if ((!this.stroke || this.strokeWidth === 0) && this.isEmptyStyles()) {
|
|
@@ -21642,14 +21665,14 @@ class FabricText extends StyledText {
|
|
|
21642
21665
|
ctx.restore();
|
|
21643
21666
|
}
|
|
21644
21667
|
|
|
21645
|
-
/**
|
|
21646
|
-
* @private
|
|
21647
|
-
* @param {String} method fillText or strokeText.
|
|
21648
|
-
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21649
|
-
* @param {Array} line Content of the line, splitted in an array by grapheme
|
|
21650
|
-
* @param {Number} left
|
|
21651
|
-
* @param {Number} top
|
|
21652
|
-
* @param {Number} lineIndex
|
|
21668
|
+
/**
|
|
21669
|
+
* @private
|
|
21670
|
+
* @param {String} method fillText or strokeText.
|
|
21671
|
+
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21672
|
+
* @param {Array} line Content of the line, splitted in an array by grapheme
|
|
21673
|
+
* @param {Number} left
|
|
21674
|
+
* @param {Number} top
|
|
21675
|
+
* @param {Number} lineIndex
|
|
21653
21676
|
*/
|
|
21654
21677
|
_renderChars(method, ctx, line, left, top, lineIndex) {
|
|
21655
21678
|
const lineHeight = this.getHeightOfLine(lineIndex),
|
|
@@ -21731,16 +21754,16 @@ class FabricText extends StyledText {
|
|
|
21731
21754
|
ctx.restore();
|
|
21732
21755
|
}
|
|
21733
21756
|
|
|
21734
|
-
/**
|
|
21735
|
-
* This function try to patch the missing gradientTransform on canvas gradients.
|
|
21736
|
-
* transforming a context to transform the gradient, is going to transform the stroke too.
|
|
21737
|
-
* we want to transform the gradient but not the stroke operation, so we create
|
|
21738
|
-
* a transformed gradient on a pattern and then we use the pattern instead of the gradient.
|
|
21739
|
-
* this method has drawbacks: is slow, is in low resolution, needs a patch for when the size
|
|
21740
|
-
* is limited.
|
|
21741
|
-
* @private
|
|
21742
|
-
* @param {TFiller} filler a fabric gradient instance
|
|
21743
|
-
* @return {CanvasPattern} a pattern to use as fill/stroke style
|
|
21757
|
+
/**
|
|
21758
|
+
* This function try to patch the missing gradientTransform on canvas gradients.
|
|
21759
|
+
* transforming a context to transform the gradient, is going to transform the stroke too.
|
|
21760
|
+
* we want to transform the gradient but not the stroke operation, so we create
|
|
21761
|
+
* a transformed gradient on a pattern and then we use the pattern instead of the gradient.
|
|
21762
|
+
* this method has drawbacks: is slow, is in low resolution, needs a patch for when the size
|
|
21763
|
+
* is limited.
|
|
21764
|
+
* @private
|
|
21765
|
+
* @param {TFiller} filler a fabric gradient instance
|
|
21766
|
+
* @return {CanvasPattern} a pattern to use as fill/stroke style
|
|
21744
21767
|
*/
|
|
21745
21768
|
_applyPatternGradientTransformText(filler) {
|
|
21746
21769
|
// TODO: verify compatibility with strokeUniform
|
|
@@ -21796,12 +21819,12 @@ class FabricText extends StyledText {
|
|
|
21796
21819
|
};
|
|
21797
21820
|
}
|
|
21798
21821
|
|
|
21799
|
-
/**
|
|
21800
|
-
* This function prepare the canvas for a stroke style, and stroke and strokeWidth
|
|
21801
|
-
* need to be sent in as defined
|
|
21802
|
-
* @param {CanvasRenderingContext2D} ctx
|
|
21803
|
-
* @param {CompleteTextStyleDeclaration} style with stroke and strokeWidth defined
|
|
21804
|
-
* @returns
|
|
21822
|
+
/**
|
|
21823
|
+
* This function prepare the canvas for a stroke style, and stroke and strokeWidth
|
|
21824
|
+
* need to be sent in as defined
|
|
21825
|
+
* @param {CanvasRenderingContext2D} ctx
|
|
21826
|
+
* @param {CompleteTextStyleDeclaration} style with stroke and strokeWidth defined
|
|
21827
|
+
* @returns
|
|
21805
21828
|
*/
|
|
21806
21829
|
_setStrokeStyles(ctx, _ref) {
|
|
21807
21830
|
let {
|
|
@@ -21816,12 +21839,12 @@ class FabricText extends StyledText {
|
|
|
21816
21839
|
return this.handleFiller(ctx, 'strokeStyle', stroke);
|
|
21817
21840
|
}
|
|
21818
21841
|
|
|
21819
|
-
/**
|
|
21820
|
-
* This function prepare the canvas for a ill style, and fill
|
|
21821
|
-
* need to be sent in as defined
|
|
21822
|
-
* @param {CanvasRenderingContext2D} ctx
|
|
21823
|
-
* @param {CompleteTextStyleDeclaration} style with ill defined
|
|
21824
|
-
* @returns
|
|
21842
|
+
/**
|
|
21843
|
+
* This function prepare the canvas for a ill style, and fill
|
|
21844
|
+
* need to be sent in as defined
|
|
21845
|
+
* @param {CanvasRenderingContext2D} ctx
|
|
21846
|
+
* @param {CompleteTextStyleDeclaration} style with ill defined
|
|
21847
|
+
* @returns
|
|
21825
21848
|
*/
|
|
21826
21849
|
_setFillStyles(ctx, _ref2) {
|
|
21827
21850
|
let {
|
|
@@ -21830,16 +21853,16 @@ class FabricText extends StyledText {
|
|
|
21830
21853
|
return this.handleFiller(ctx, 'fillStyle', fill);
|
|
21831
21854
|
}
|
|
21832
21855
|
|
|
21833
|
-
/**
|
|
21834
|
-
* @private
|
|
21835
|
-
* @param {String} method
|
|
21836
|
-
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21837
|
-
* @param {Number} lineIndex
|
|
21838
|
-
* @param {Number} charIndex
|
|
21839
|
-
* @param {String} _char
|
|
21840
|
-
* @param {Number} left Left coordinate
|
|
21841
|
-
* @param {Number} top Top coordinate
|
|
21842
|
-
* @param {Number} lineHeight Height of the line
|
|
21856
|
+
/**
|
|
21857
|
+
* @private
|
|
21858
|
+
* @param {String} method
|
|
21859
|
+
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21860
|
+
* @param {Number} lineIndex
|
|
21861
|
+
* @param {Number} charIndex
|
|
21862
|
+
* @param {String} _char
|
|
21863
|
+
* @param {Number} left Left coordinate
|
|
21864
|
+
* @param {Number} top Top coordinate
|
|
21865
|
+
* @param {Number} lineHeight Height of the line
|
|
21843
21866
|
*/
|
|
21844
21867
|
_renderChar(method, ctx, lineIndex, charIndex, _char, left, top) {
|
|
21845
21868
|
const decl = this._getStyleDeclaration(lineIndex, charIndex),
|
|
@@ -21868,30 +21891,30 @@ class FabricText extends StyledText {
|
|
|
21868
21891
|
ctx.restore();
|
|
21869
21892
|
}
|
|
21870
21893
|
|
|
21871
|
-
/**
|
|
21872
|
-
* Turns the character into a 'superior figure' (i.e. 'superscript')
|
|
21873
|
-
* @param {Number} start selection start
|
|
21874
|
-
* @param {Number} end selection end
|
|
21894
|
+
/**
|
|
21895
|
+
* Turns the character into a 'superior figure' (i.e. 'superscript')
|
|
21896
|
+
* @param {Number} start selection start
|
|
21897
|
+
* @param {Number} end selection end
|
|
21875
21898
|
*/
|
|
21876
21899
|
setSuperscript(start, end) {
|
|
21877
21900
|
this._setScript(start, end, this.superscript);
|
|
21878
21901
|
}
|
|
21879
21902
|
|
|
21880
|
-
/**
|
|
21881
|
-
* Turns the character into an 'inferior figure' (i.e. 'subscript')
|
|
21882
|
-
* @param {Number} start selection start
|
|
21883
|
-
* @param {Number} end selection end
|
|
21903
|
+
/**
|
|
21904
|
+
* Turns the character into an 'inferior figure' (i.e. 'subscript')
|
|
21905
|
+
* @param {Number} start selection start
|
|
21906
|
+
* @param {Number} end selection end
|
|
21884
21907
|
*/
|
|
21885
21908
|
setSubscript(start, end) {
|
|
21886
21909
|
this._setScript(start, end, this.subscript);
|
|
21887
21910
|
}
|
|
21888
21911
|
|
|
21889
|
-
/**
|
|
21890
|
-
* Applies 'schema' at given position
|
|
21891
|
-
* @private
|
|
21892
|
-
* @param {Number} start selection start
|
|
21893
|
-
* @param {Number} end selection end
|
|
21894
|
-
* @param {Number} schema
|
|
21912
|
+
/**
|
|
21913
|
+
* Applies 'schema' at given position
|
|
21914
|
+
* @private
|
|
21915
|
+
* @param {Number} start selection start
|
|
21916
|
+
* @param {Number} end selection end
|
|
21917
|
+
* @param {Number} schema
|
|
21895
21918
|
*/
|
|
21896
21919
|
_setScript(start, end, schema) {
|
|
21897
21920
|
const loc = this.get2DCursorLocation(start, true),
|
|
@@ -21904,10 +21927,10 @@ class FabricText extends StyledText {
|
|
|
21904
21927
|
this.setSelectionStyles(style, start, end);
|
|
21905
21928
|
}
|
|
21906
21929
|
|
|
21907
|
-
/**
|
|
21908
|
-
* @private
|
|
21909
|
-
* @param {Number} lineIndex index text line
|
|
21910
|
-
* @return {Number} Line left offset
|
|
21930
|
+
/**
|
|
21931
|
+
* @private
|
|
21932
|
+
* @param {Number} lineIndex index text line
|
|
21933
|
+
* @return {Number} Line left offset
|
|
21911
21934
|
*/
|
|
21912
21935
|
_getLineLeftOffset(lineIndex) {
|
|
21913
21936
|
const lineWidth = this.getLineWidth(lineIndex),
|
|
@@ -21957,8 +21980,8 @@ class FabricText extends StyledText {
|
|
|
21957
21980
|
return leftOffset;
|
|
21958
21981
|
}
|
|
21959
21982
|
|
|
21960
|
-
/**
|
|
21961
|
-
* @private
|
|
21983
|
+
/**
|
|
21984
|
+
* @private
|
|
21962
21985
|
*/
|
|
21963
21986
|
_clearCache() {
|
|
21964
21987
|
this._forceClearCache = false;
|
|
@@ -21967,12 +21990,12 @@ class FabricText extends StyledText {
|
|
|
21967
21990
|
this.__charBounds = [];
|
|
21968
21991
|
}
|
|
21969
21992
|
|
|
21970
|
-
/**
|
|
21971
|
-
* Measure a single line given its index. Used to calculate the initial
|
|
21972
|
-
* text bounding box. The values are calculated and stored in __lineWidths cache.
|
|
21973
|
-
* @private
|
|
21974
|
-
* @param {Number} lineIndex line number
|
|
21975
|
-
* @return {Number} Line width
|
|
21993
|
+
/**
|
|
21994
|
+
* Measure a single line given its index. Used to calculate the initial
|
|
21995
|
+
* text bounding box. The values are calculated and stored in __lineWidths cache.
|
|
21996
|
+
* @private
|
|
21997
|
+
* @param {Number} lineIndex line number
|
|
21998
|
+
* @return {Number} Line width
|
|
21976
21999
|
*/
|
|
21977
22000
|
getLineWidth(lineIndex) {
|
|
21978
22001
|
if (this.__lineWidths[lineIndex] !== undefined) {
|
|
@@ -21991,12 +22014,12 @@ class FabricText extends StyledText {
|
|
|
21991
22014
|
return 0;
|
|
21992
22015
|
}
|
|
21993
22016
|
|
|
21994
|
-
/**
|
|
21995
|
-
* Retrieves the value of property at given character position
|
|
21996
|
-
* @param {Number} lineIndex the line number
|
|
21997
|
-
* @param {Number} charIndex the character number
|
|
21998
|
-
* @param {String} property the property name
|
|
21999
|
-
* @returns the value of 'property'
|
|
22017
|
+
/**
|
|
22018
|
+
* Retrieves the value of property at given character position
|
|
22019
|
+
* @param {Number} lineIndex the line number
|
|
22020
|
+
* @param {Number} charIndex the character number
|
|
22021
|
+
* @param {String} property the property name
|
|
22022
|
+
* @returns the value of 'property'
|
|
22000
22023
|
*/
|
|
22001
22024
|
getValueOfPropertyAt(lineIndex, charIndex, property) {
|
|
22002
22025
|
var _charStyle$property;
|
|
@@ -22004,9 +22027,9 @@ class FabricText extends StyledText {
|
|
|
22004
22027
|
return (_charStyle$property = charStyle[property]) !== null && _charStyle$property !== void 0 ? _charStyle$property : this[property];
|
|
22005
22028
|
}
|
|
22006
22029
|
|
|
22007
|
-
/**
|
|
22008
|
-
* @private
|
|
22009
|
-
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
22030
|
+
/**
|
|
22031
|
+
* @private
|
|
22032
|
+
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
22010
22033
|
*/
|
|
22011
22034
|
_renderTextDecoration(ctx, type) {
|
|
22012
22035
|
if (!this[type] && !this.styleHas(type)) {
|
|
@@ -22090,10 +22113,10 @@ class FabricText extends StyledText {
|
|
|
22090
22113
|
this._removeShadow(ctx);
|
|
22091
22114
|
}
|
|
22092
22115
|
|
|
22093
|
-
/**
|
|
22094
|
-
* return font declaration string for canvas context
|
|
22095
|
-
* @param {Object} [styleObject] object
|
|
22096
|
-
* @returns {String} font declaration formatted for canvas context.
|
|
22116
|
+
/**
|
|
22117
|
+
* return font declaration string for canvas context
|
|
22118
|
+
* @param {Object} [styleObject] object
|
|
22119
|
+
* @returns {String} font declaration formatted for canvas context.
|
|
22097
22120
|
*/
|
|
22098
22121
|
_getFontDeclaration() {
|
|
22099
22122
|
let {
|
|
@@ -22119,9 +22142,9 @@ class FabricText extends StyledText {
|
|
|
22119
22142
|
return [fontStyle, fontWeight, `${forMeasuring ? this.CACHE_FONT_SIZE : fontSize}px`, parsedFontFamily].join(' ');
|
|
22120
22143
|
}
|
|
22121
22144
|
|
|
22122
|
-
/**
|
|
22123
|
-
* Renders text instance on a specified context
|
|
22124
|
-
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
22145
|
+
/**
|
|
22146
|
+
* Renders text instance on a specified context
|
|
22147
|
+
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
22125
22148
|
*/
|
|
22126
22149
|
render(ctx) {
|
|
22127
22150
|
if (!this.visible) {
|
|
@@ -22136,22 +22159,22 @@ class FabricText extends StyledText {
|
|
|
22136
22159
|
super.render(ctx);
|
|
22137
22160
|
}
|
|
22138
22161
|
|
|
22139
|
-
/**
|
|
22140
|
-
* Override this method to customize grapheme splitting
|
|
22141
|
-
* @todo the util `graphemeSplit` needs to be injectable in some way.
|
|
22142
|
-
* is more comfortable to inject the correct util rather than having to override text
|
|
22143
|
-
* in the middle of the prototype chain
|
|
22144
|
-
* @param {string} value
|
|
22145
|
-
* @returns {string[]} array of graphemes
|
|
22162
|
+
/**
|
|
22163
|
+
* Override this method to customize grapheme splitting
|
|
22164
|
+
* @todo the util `graphemeSplit` needs to be injectable in some way.
|
|
22165
|
+
* is more comfortable to inject the correct util rather than having to override text
|
|
22166
|
+
* in the middle of the prototype chain
|
|
22167
|
+
* @param {string} value
|
|
22168
|
+
* @returns {string[]} array of graphemes
|
|
22146
22169
|
*/
|
|
22147
22170
|
graphemeSplit(value) {
|
|
22148
22171
|
return graphemeSplit(value);
|
|
22149
22172
|
}
|
|
22150
22173
|
|
|
22151
|
-
/**
|
|
22152
|
-
* Returns the text as an array of lines.
|
|
22153
|
-
* @param {String} text text to split
|
|
22154
|
-
* @returns Lines in the text
|
|
22174
|
+
/**
|
|
22175
|
+
* Returns the text as an array of lines.
|
|
22176
|
+
* @param {String} text text to split
|
|
22177
|
+
* @returns Lines in the text
|
|
22155
22178
|
*/
|
|
22156
22179
|
_splitTextIntoLines(text) {
|
|
22157
22180
|
const lines = text.split(this._reNewline),
|
|
@@ -22177,18 +22200,18 @@ class FabricText extends StyledText {
|
|
|
22177
22200
|
};
|
|
22178
22201
|
}
|
|
22179
22202
|
|
|
22180
|
-
/**
|
|
22181
|
-
* Check if text contains Arabic characters
|
|
22182
|
-
* @private
|
|
22203
|
+
/**
|
|
22204
|
+
* Check if text contains Arabic characters
|
|
22205
|
+
* @private
|
|
22183
22206
|
*/
|
|
22184
22207
|
_containsArabicText(text) {
|
|
22185
22208
|
return /[\u0600-\u06FF\u0750-\u077F\uFB50-\uFDFF\uFE70-\uFEFF]/.test(text);
|
|
22186
22209
|
}
|
|
22187
22210
|
|
|
22188
|
-
/**
|
|
22189
|
-
* Returns object representation of an instance
|
|
22190
|
-
* @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output
|
|
22191
|
-
* @return {Object} Object representation of an instance
|
|
22211
|
+
/**
|
|
22212
|
+
* Returns object representation of an instance
|
|
22213
|
+
* @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output
|
|
22214
|
+
* @return {Object} Object representation of an instance
|
|
22192
22215
|
*/
|
|
22193
22216
|
toObject() {
|
|
22194
22217
|
let propertiesToInclude = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
@@ -22231,23 +22254,23 @@ class FabricText extends StyledText {
|
|
|
22231
22254
|
return this;
|
|
22232
22255
|
}
|
|
22233
22256
|
|
|
22234
|
-
/**
|
|
22235
|
-
* Returns complexity of an instance
|
|
22236
|
-
* @return {Number} complexity
|
|
22257
|
+
/**
|
|
22258
|
+
* Returns complexity of an instance
|
|
22259
|
+
* @return {Number} complexity
|
|
22237
22260
|
*/
|
|
22238
22261
|
complexity() {
|
|
22239
22262
|
return 1;
|
|
22240
22263
|
}
|
|
22241
22264
|
|
|
22242
|
-
/**
|
|
22243
|
-
* List of generic font families
|
|
22244
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/font-family#generic-name
|
|
22265
|
+
/**
|
|
22266
|
+
* List of generic font families
|
|
22267
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/font-family#generic-name
|
|
22245
22268
|
*/
|
|
22246
22269
|
|
|
22247
|
-
/**
|
|
22248
|
-
* Returns FabricText instance from an SVG element (<b>not yet implemented</b>)
|
|
22249
|
-
* @param {HTMLElement} element Element to parse
|
|
22250
|
-
* @param {Object} [options] Options object
|
|
22270
|
+
/**
|
|
22271
|
+
* Returns FabricText instance from an SVG element (<b>not yet implemented</b>)
|
|
22272
|
+
* @param {HTMLElement} element Element to parse
|
|
22273
|
+
* @param {Object} [options] Options object
|
|
22251
22274
|
*/
|
|
22252
22275
|
static async fromElement(element, options, cssRules) {
|
|
22253
22276
|
const parsedAttributes = parseAttributes(element, FabricText.ATTRIBUTE_NAMES, cssRules);
|
|
@@ -22286,10 +22309,10 @@ class FabricText extends StyledText {
|
|
|
22286
22309
|
scaledDiff = lineHeightDiff * textHeightScaleFactor,
|
|
22287
22310
|
textHeight = text.getScaledHeight() + scaledDiff;
|
|
22288
22311
|
let offX = 0;
|
|
22289
|
-
/*
|
|
22290
|
-
Adjust positioning:
|
|
22291
|
-
x/y attributes in SVG correspond to the bottom-left corner of text bounding box
|
|
22292
|
-
fabric output by default at top, left.
|
|
22312
|
+
/*
|
|
22313
|
+
Adjust positioning:
|
|
22314
|
+
x/y attributes in SVG correspond to the bottom-left corner of text bounding box
|
|
22315
|
+
fabric output by default at top, left.
|
|
22293
22316
|
*/
|
|
22294
22317
|
if (textAnchor === CENTER) {
|
|
22295
22318
|
offX = text.getScaledWidth() / 2;
|
|
@@ -22307,9 +22330,9 @@ class FabricText extends StyledText {
|
|
|
22307
22330
|
|
|
22308
22331
|
/* _FROM_SVG_END_ */
|
|
22309
22332
|
|
|
22310
|
-
/**
|
|
22311
|
-
* Check if the font is ready for accurate measurements
|
|
22312
|
-
* @private
|
|
22333
|
+
/**
|
|
22334
|
+
* Check if the font is ready for accurate measurements
|
|
22335
|
+
* @private
|
|
22313
22336
|
*/
|
|
22314
22337
|
_isFontReady() {
|
|
22315
22338
|
if (typeof document === 'undefined' || !('fonts' in document)) {
|
|
@@ -22322,9 +22345,9 @@ class FabricText extends StyledText {
|
|
|
22322
22345
|
}
|
|
22323
22346
|
}
|
|
22324
22347
|
|
|
22325
|
-
/**
|
|
22326
|
-
* Schedule re-initialization after font loads
|
|
22327
|
-
* @private
|
|
22348
|
+
/**
|
|
22349
|
+
* Schedule re-initialization after font loads
|
|
22350
|
+
* @private
|
|
22328
22351
|
*/
|
|
22329
22352
|
_scheduleInitAfterFontLoad() {
|
|
22330
22353
|
if (typeof document === 'undefined' || !('fonts' in document)) {
|
|
@@ -22360,8 +22383,8 @@ class FabricText extends StyledText {
|
|
|
22360
22383
|
});
|
|
22361
22384
|
}
|
|
22362
22385
|
|
|
22363
|
-
/**
|
|
22364
|
-
* Force complete text re-initialization (useful after JSON loading)
|
|
22386
|
+
/**
|
|
22387
|
+
* Force complete text re-initialization (useful after JSON loading)
|
|
22365
22388
|
*/
|
|
22366
22389
|
forceTextReinitialization() {
|
|
22367
22390
|
console.log('🔄 Force reinitializing text object');
|
|
@@ -22389,10 +22412,10 @@ class FabricText extends StyledText {
|
|
|
22389
22412
|
}
|
|
22390
22413
|
}
|
|
22391
22414
|
|
|
22392
|
-
/**
|
|
22393
|
-
* Returns FabricText instance from an object representation
|
|
22394
|
-
* @param {Object} object plain js Object to create an instance from
|
|
22395
|
-
* @returns {Promise<FabricText>}
|
|
22415
|
+
/**
|
|
22416
|
+
* Returns FabricText instance from an object representation
|
|
22417
|
+
* @param {Object} object plain js Object to create an instance from
|
|
22418
|
+
* @returns {Promise<FabricText>}
|
|
22396
22419
|
*/
|
|
22397
22420
|
static fromObject(object) {
|
|
22398
22421
|
return this._fromObject({
|
|
@@ -22494,10 +22517,10 @@ class FabricText extends StyledText {
|
|
|
22494
22517
|
});
|
|
22495
22518
|
}
|
|
22496
22519
|
}
|
|
22497
|
-
/**
|
|
22498
|
-
* Properties that requires a text layout recalculation when changed
|
|
22499
|
-
* @type string[]
|
|
22500
|
-
* @protected
|
|
22520
|
+
/**
|
|
22521
|
+
* Properties that requires a text layout recalculation when changed
|
|
22522
|
+
* @type string[]
|
|
22523
|
+
* @protected
|
|
22501
22524
|
*/
|
|
22502
22525
|
_defineProperty(FabricText, "textLayoutProperties", textLayoutProperties);
|
|
22503
22526
|
_defineProperty(FabricText, "cacheProperties", [...cacheProperties, ...additionalProps]);
|
|
@@ -22505,9 +22528,9 @@ _defineProperty(FabricText, "ownDefaults", textDefaultValues);
|
|
|
22505
22528
|
_defineProperty(FabricText, "type", 'Text');
|
|
22506
22529
|
_defineProperty(FabricText, "genericFonts", ['serif', 'sans-serif', 'monospace', 'cursive', 'fantasy', 'system-ui', 'ui-serif', 'ui-sans-serif', 'ui-monospace', 'ui-rounded', 'math', 'emoji', 'fangsong']);
|
|
22507
22530
|
/* _FROM_SVG_START_ */
|
|
22508
|
-
/**
|
|
22509
|
-
* List of attribute names to account for when parsing SVG element (used by {@link FabricText.fromElement})
|
|
22510
|
-
* @see: http://www.w3.org/TR/SVG/text.html#TextElement
|
|
22531
|
+
/**
|
|
22532
|
+
* List of attribute names to account for when parsing SVG element (used by {@link FabricText.fromElement})
|
|
22533
|
+
* @see: http://www.w3.org/TR/SVG/text.html#TextElement
|
|
22511
22534
|
*/
|
|
22512
22535
|
_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'));
|
|
22513
22536
|
applyMixins(FabricText, [TextSVGExportMixin]);
|
|
@@ -22894,8 +22917,8 @@ class OverlayEditor {
|
|
|
22894
22917
|
// We don't need to save/restore them here as it would conflict with IText's restoration
|
|
22895
22918
|
}
|
|
22896
22919
|
|
|
22897
|
-
/**
|
|
22898
|
-
* Get the container element for the overlay (parent of upperCanvasEl)
|
|
22920
|
+
/**
|
|
22921
|
+
* Get the container element for the overlay (parent of upperCanvasEl)
|
|
22899
22922
|
*/
|
|
22900
22923
|
getCanvasContainer() {
|
|
22901
22924
|
const upperCanvas = this.canvas.upperCanvasEl;
|
|
@@ -22909,8 +22932,8 @@ class OverlayEditor {
|
|
|
22909
22932
|
return container;
|
|
22910
22933
|
}
|
|
22911
22934
|
|
|
22912
|
-
/**
|
|
22913
|
-
* Create the overlay DOM structure
|
|
22935
|
+
/**
|
|
22936
|
+
* Create the overlay DOM structure
|
|
22914
22937
|
*/
|
|
22915
22938
|
createOverlayDOM() {
|
|
22916
22939
|
// Host div for positioning and overflow control
|
|
@@ -22965,8 +22988,8 @@ class OverlayEditor {
|
|
|
22965
22988
|
document.body.appendChild(this.hostDiv);
|
|
22966
22989
|
}
|
|
22967
22990
|
|
|
22968
|
-
/**
|
|
22969
|
-
* Attach all event listeners
|
|
22991
|
+
/**
|
|
22992
|
+
* Attach all event listeners
|
|
22970
22993
|
*/
|
|
22971
22994
|
attachEventListeners() {
|
|
22972
22995
|
// Textarea events
|
|
@@ -22986,8 +23009,8 @@ class OverlayEditor {
|
|
|
22986
23009
|
this.setupViewportChangeDetection();
|
|
22987
23010
|
}
|
|
22988
23011
|
|
|
22989
|
-
/**
|
|
22990
|
-
* Remove all event listeners
|
|
23012
|
+
/**
|
|
23013
|
+
* Remove all event listeners
|
|
22991
23014
|
*/
|
|
22992
23015
|
removeEventListeners() {
|
|
22993
23016
|
this.textarea.removeEventListener('input', this.boundHandlers.onInput);
|
|
@@ -23004,16 +23027,16 @@ class OverlayEditor {
|
|
|
23004
23027
|
this.restoreViewportChangeDetection();
|
|
23005
23028
|
}
|
|
23006
23029
|
|
|
23007
|
-
/**
|
|
23008
|
-
* Simple method to refresh positioning when canvas changes
|
|
23030
|
+
/**
|
|
23031
|
+
* Simple method to refresh positioning when canvas changes
|
|
23009
23032
|
*/
|
|
23010
23033
|
updatePosition() {
|
|
23011
23034
|
this.applyOverlayStyle();
|
|
23012
23035
|
}
|
|
23013
23036
|
|
|
23014
|
-
/**
|
|
23015
|
-
* Update the Fabric object bounds to match current textarea size
|
|
23016
|
-
* This ensures Fabric.js selection controls follow the growing textbox
|
|
23037
|
+
/**
|
|
23038
|
+
* Update the Fabric object bounds to match current textarea size
|
|
23039
|
+
* This ensures Fabric.js selection controls follow the growing textbox
|
|
23017
23040
|
*/
|
|
23018
23041
|
updateObjectBounds() {
|
|
23019
23042
|
if (this.isDestroyed) return;
|
|
@@ -23047,15 +23070,15 @@ class OverlayEditor {
|
|
|
23047
23070
|
}
|
|
23048
23071
|
}
|
|
23049
23072
|
|
|
23050
|
-
/**
|
|
23051
|
-
* Convert Fabric charSpacing (1/1000 em) to CSS letter-spacing (px)
|
|
23073
|
+
/**
|
|
23074
|
+
* Convert Fabric charSpacing (1/1000 em) to CSS letter-spacing (px)
|
|
23052
23075
|
*/
|
|
23053
23076
|
letterSpacingPx(charSpacing, fontSize) {
|
|
23054
23077
|
return charSpacing / 1000 * fontSize;
|
|
23055
23078
|
}
|
|
23056
23079
|
|
|
23057
|
-
/**
|
|
23058
|
-
* Detect text direction using first strong directional character
|
|
23080
|
+
/**
|
|
23081
|
+
* Detect text direction using first strong directional character
|
|
23059
23082
|
*/
|
|
23060
23083
|
firstStrongDir(text) {
|
|
23061
23084
|
// Hebrew: \u0590-\u05FF, Arabic: \u0600-\u06FF, \u0750-\u077F, \uFB50-\uFDFF, \uFE70-\uFEFF
|
|
@@ -23094,10 +23117,10 @@ class OverlayEditor {
|
|
|
23094
23117
|
const top = canvasRect.top + scrollY + screenPoint.y;
|
|
23095
23118
|
|
|
23096
23119
|
// 4. Calculate the precise width and height for the container
|
|
23097
|
-
// **THE FIX:** Use
|
|
23098
|
-
// This is the most reliable measure of the object's final rendered dimensions.
|
|
23120
|
+
// **THE FIX:** Use the same width calculation as measureLinesWithBrowser for consistency
|
|
23099
23121
|
const objectBounds = target.getBoundingRect();
|
|
23100
|
-
const
|
|
23122
|
+
const scaleX = target.scaleX || 1;
|
|
23123
|
+
const width = Math.round((target.width * scaleX + padding * 2) * zoom);
|
|
23101
23124
|
const height = Math.round(objectBounds.height * zoom);
|
|
23102
23125
|
|
|
23103
23126
|
// 5. Apply styles to host DIV - absolute positioning like rtl-test.html
|
|
@@ -23119,7 +23142,6 @@ class OverlayEditor {
|
|
|
23119
23142
|
// 6. Style the textarea - match Fabric's exact rendering with padding
|
|
23120
23143
|
const baseFontSize = (_target$fontSize = target.fontSize) !== null && _target$fontSize !== void 0 ? _target$fontSize : 16;
|
|
23121
23144
|
// Use scaleX for font scaling to match Fabric text scaling exactly
|
|
23122
|
-
const scaleX = target.scaleX || 1;
|
|
23123
23145
|
const finalFontSize = baseFontSize * scaleX * zoom;
|
|
23124
23146
|
const fabricLineHeight = target.lineHeight || 1.16;
|
|
23125
23147
|
// **THE FIX:** Use 'border-box' so the width property includes padding.
|
|
@@ -23181,7 +23203,7 @@ class OverlayEditor {
|
|
|
23181
23203
|
this.textarea.style.textAlignLast = 'left';
|
|
23182
23204
|
}
|
|
23183
23205
|
} else if (textAlign === 'justify-right') {
|
|
23184
|
-
// If text is LTR but fabric says justify-right, override to justify-left for better UX
|
|
23206
|
+
// If text is LTR but fabric says justify-right, override to justify-left for better UX
|
|
23185
23207
|
if (autoDetectedDirection === 'ltr') {
|
|
23186
23208
|
this.textarea.style.textAlignLast = 'left';
|
|
23187
23209
|
console.log(' → Overrode justify-right to justify-left for LTR text');
|
|
@@ -23292,8 +23314,8 @@ class OverlayEditor {
|
|
|
23292
23314
|
// Initial bounds are set correctly by Fabric.js - don't force update here
|
|
23293
23315
|
}
|
|
23294
23316
|
|
|
23295
|
-
/**
|
|
23296
|
-
* Debug method to compare textarea and canvas object bounding boxes
|
|
23317
|
+
/**
|
|
23318
|
+
* Debug method to compare textarea and canvas object bounding boxes
|
|
23297
23319
|
*/
|
|
23298
23320
|
debugBoundingBoxComparison() {
|
|
23299
23321
|
const target = this.target;
|
|
@@ -23363,8 +23385,8 @@ class OverlayEditor {
|
|
|
23363
23385
|
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
23364
23386
|
}
|
|
23365
23387
|
|
|
23366
|
-
/**
|
|
23367
|
-
* Debug method to compare text wrapping between textarea and Fabric text object
|
|
23388
|
+
/**
|
|
23389
|
+
* Debug method to compare text wrapping between textarea and Fabric text object
|
|
23368
23390
|
*/
|
|
23369
23391
|
debugTextWrapping() {
|
|
23370
23392
|
const target = this.target;
|
|
@@ -23449,8 +23471,8 @@ class OverlayEditor {
|
|
|
23449
23471
|
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
23450
23472
|
}
|
|
23451
23473
|
|
|
23452
|
-
/**
|
|
23453
|
-
* Focus the textarea and position cursor at end
|
|
23474
|
+
/**
|
|
23475
|
+
* Focus the textarea and position cursor at end
|
|
23454
23476
|
*/
|
|
23455
23477
|
focusTextarea() {
|
|
23456
23478
|
// For overlay editing, we want to keep the object in "selection mode" not "editing mode"
|
|
@@ -23490,8 +23512,8 @@ class OverlayEditor {
|
|
|
23490
23512
|
this.canvas.requestRenderAll();
|
|
23491
23513
|
}
|
|
23492
23514
|
|
|
23493
|
-
/**
|
|
23494
|
-
* Refresh overlay positioning and styling
|
|
23515
|
+
/**
|
|
23516
|
+
* Refresh overlay positioning and styling
|
|
23495
23517
|
*/
|
|
23496
23518
|
refresh() {
|
|
23497
23519
|
if (this.isDestroyed) return;
|
|
@@ -23499,32 +23521,34 @@ class OverlayEditor {
|
|
|
23499
23521
|
// Don't update object bounds on every refresh - only when textarea actually resizes
|
|
23500
23522
|
}
|
|
23501
23523
|
|
|
23502
|
-
/**
|
|
23503
|
-
* Destroy the overlay editor
|
|
23524
|
+
/**
|
|
23525
|
+
* Destroy the overlay editor
|
|
23504
23526
|
*/
|
|
23505
23527
|
destroy() {
|
|
23528
|
+
var _this$target$textAlig;
|
|
23506
23529
|
let commit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
23507
23530
|
if (this.isDestroyed) return;
|
|
23508
23531
|
this.isDestroyed = true;
|
|
23509
23532
|
this.removeEventListeners();
|
|
23510
23533
|
|
|
23511
|
-
//
|
|
23512
|
-
|
|
23513
|
-
|
|
23514
|
-
|
|
23515
|
-
|
|
23516
|
-
|
|
23517
|
-
|
|
23518
|
-
|
|
23534
|
+
// EXTRACT DOM DATA BEFORE REMOVING DOM for justify text preservation
|
|
23535
|
+
let extractedOverlayData = null;
|
|
23536
|
+
if (commit && (_this$target$textAlig = this.target.textAlign) !== null && _this$target$textAlig !== void 0 && _this$target$textAlig.includes('justify')) {
|
|
23537
|
+
try {
|
|
23538
|
+
// Store the DOM structure before destruction
|
|
23539
|
+
const result = extractLinesFromDOM(this.textarea);
|
|
23540
|
+
extractedOverlayData = result.lines;
|
|
23541
|
+
console.log('🔧 DESTROY: Extracted overlay lines before DOM removal');
|
|
23542
|
+
} catch (error) {
|
|
23543
|
+
console.warn('Failed to extract overlay lines before destruction:', error);
|
|
23519
23544
|
}
|
|
23520
23545
|
}
|
|
23521
23546
|
|
|
23522
|
-
//
|
|
23523
|
-
if (this.
|
|
23524
|
-
this.
|
|
23547
|
+
// Restore original opacity but keep overlayEditor reference for commit
|
|
23548
|
+
if (this.target.__overlayOriginalOpacity !== undefined) {
|
|
23549
|
+
this.target.opacity = this.target.__overlayOriginalOpacity;
|
|
23550
|
+
delete this.target.__overlayOriginalOpacity;
|
|
23525
23551
|
}
|
|
23526
|
-
|
|
23527
|
-
// Handle commit/cancel after restoring visibility
|
|
23528
23552
|
if (commit && !this.isComposing) {
|
|
23529
23553
|
const finalText = this.textarea.value;
|
|
23530
23554
|
|
|
@@ -23545,12 +23569,26 @@ class OverlayEditor {
|
|
|
23545
23569
|
console.log(`📝 Overlay Exit: Direction unchanged (${currentDirection}), text: "${finalText.substring(0, 30)}..."`);
|
|
23546
23570
|
}
|
|
23547
23571
|
if (this.onCommit) {
|
|
23572
|
+
// Store extracted overlay data on target for commitOverlayEdit to use
|
|
23573
|
+
if (extractedOverlayData) {
|
|
23574
|
+
this.target._extractedOverlayLines = extractedOverlayData;
|
|
23575
|
+
}
|
|
23548
23576
|
this.onCommit(finalText);
|
|
23549
23577
|
}
|
|
23550
23578
|
} else if (!commit && this.onCancel) {
|
|
23551
23579
|
this.onCancel();
|
|
23552
23580
|
}
|
|
23553
23581
|
|
|
23582
|
+
// Clear overlay editor reference AFTER commit/cancel handlers
|
|
23583
|
+
if (this.target.__overlayEditor === this) {
|
|
23584
|
+
this.target.__overlayEditor = undefined;
|
|
23585
|
+
}
|
|
23586
|
+
|
|
23587
|
+
// Remove DOM after commit/cancel handlers
|
|
23588
|
+
if (this.hostDiv.parentNode) {
|
|
23589
|
+
this.hostDiv.parentNode.removeChild(this.hostDiv);
|
|
23590
|
+
}
|
|
23591
|
+
|
|
23554
23592
|
// Note: Don't restore object cursors since IText manages all cursors in _restoreEditingProps
|
|
23555
23593
|
// Let the IText editing system handle proper restoration of all cursor properties
|
|
23556
23594
|
|
|
@@ -23565,6 +23603,9 @@ class OverlayEditor {
|
|
|
23565
23603
|
// Request canvas re-render
|
|
23566
23604
|
this.canvas.requestRenderAll();
|
|
23567
23605
|
}
|
|
23606
|
+
get textareaElement() {
|
|
23607
|
+
return this.textarea;
|
|
23608
|
+
}
|
|
23568
23609
|
|
|
23569
23610
|
// Event handlers
|
|
23570
23611
|
handleInput() {
|
|
@@ -23668,8 +23709,8 @@ class OverlayEditor {
|
|
|
23668
23709
|
}
|
|
23669
23710
|
}
|
|
23670
23711
|
|
|
23671
|
-
/**
|
|
23672
|
-
* Setup detection for viewport changes (zoom/pan)
|
|
23712
|
+
/**
|
|
23713
|
+
* Setup detection for viewport changes (zoom/pan)
|
|
23673
23714
|
*/
|
|
23674
23715
|
setupViewportChangeDetection() {
|
|
23675
23716
|
// Store original methods
|
|
@@ -23698,8 +23739,8 @@ class OverlayEditor {
|
|
|
23698
23739
|
};
|
|
23699
23740
|
}
|
|
23700
23741
|
|
|
23701
|
-
/**
|
|
23702
|
-
* Restore original viewport methods
|
|
23742
|
+
/**
|
|
23743
|
+
* Restore original viewport methods
|
|
23703
23744
|
*/
|
|
23704
23745
|
restoreViewportChangeDetection() {
|
|
23705
23746
|
if (this.canvas.__originalSetZoom) {
|
|
@@ -23714,8 +23755,8 @@ class OverlayEditor {
|
|
|
23714
23755
|
}
|
|
23715
23756
|
}
|
|
23716
23757
|
|
|
23717
|
-
/**
|
|
23718
|
-
* Enter overlay text editing mode for a text object
|
|
23758
|
+
/**
|
|
23759
|
+
* Enter overlay text editing mode for a text object
|
|
23719
23760
|
*/
|
|
23720
23761
|
function enterTextOverlayEdit(canvas, target, options) {
|
|
23721
23762
|
// If already in overlay editing, destroy existing editor first
|
|
@@ -23739,35 +23780,35 @@ function enterTextOverlayEdit(canvas, target, options) {
|
|
|
23739
23780
|
return editor;
|
|
23740
23781
|
}
|
|
23741
23782
|
|
|
23742
|
-
/**
|
|
23743
|
-
* extend this regex to support non english languages
|
|
23744
|
-
*
|
|
23745
|
-
* - ` ` Matches a SPACE character (char code 32).
|
|
23746
|
-
* - `\n` Matches a LINE FEED character (char code 10).
|
|
23747
|
-
* - `.` Matches a "." character (char code 46).
|
|
23748
|
-
* - `,` Matches a "," character (char code 44).
|
|
23749
|
-
* - `;` Matches a ";" character (char code 59).
|
|
23750
|
-
* - `!` Matches a "!" character (char code 33).
|
|
23751
|
-
* - `\?` Matches a "?" character (char code 63).
|
|
23752
|
-
* - `\-` Matches a "-" character (char code 45).
|
|
23783
|
+
/**
|
|
23784
|
+
* extend this regex to support non english languages
|
|
23785
|
+
*
|
|
23786
|
+
* - ` ` Matches a SPACE character (char code 32).
|
|
23787
|
+
* - `\n` Matches a LINE FEED character (char code 10).
|
|
23788
|
+
* - `.` Matches a "." character (char code 46).
|
|
23789
|
+
* - `,` Matches a "," character (char code 44).
|
|
23790
|
+
* - `;` Matches a ";" character (char code 59).
|
|
23791
|
+
* - `!` Matches a "!" character (char code 33).
|
|
23792
|
+
* - `\?` Matches a "?" character (char code 63).
|
|
23793
|
+
* - `\-` Matches a "-" character (char code 45).
|
|
23753
23794
|
*/
|
|
23754
23795
|
// eslint-disable-next-line no-useless-escape
|
|
23755
23796
|
const reNonWord = /[ \n\.,;!\?\-]/;
|
|
23756
23797
|
class ITextBehavior extends FabricText {
|
|
23757
23798
|
constructor() {
|
|
23758
23799
|
super(...arguments);
|
|
23759
|
-
/**
|
|
23760
|
-
* Helps determining when the text is in composition, so that the cursor
|
|
23761
|
-
* rendering is altered.
|
|
23800
|
+
/**
|
|
23801
|
+
* Helps determining when the text is in composition, so that the cursor
|
|
23802
|
+
* rendering is altered.
|
|
23762
23803
|
*/
|
|
23763
23804
|
_defineProperty(this, "_currentCursorOpacity", 1);
|
|
23764
23805
|
}
|
|
23765
|
-
/**
|
|
23766
|
-
* Keeps track if the IText object was selected before the actual click.
|
|
23767
|
-
* This because we want to delay enter editing by a click.
|
|
23806
|
+
/**
|
|
23807
|
+
* Keeps track if the IText object was selected before the actual click.
|
|
23808
|
+
* This because we want to delay enter editing by a click.
|
|
23768
23809
|
*/
|
|
23769
|
-
/**
|
|
23770
|
-
* Initializes all the interactive behavior of IText
|
|
23810
|
+
/**
|
|
23811
|
+
* Initializes all the interactive behavior of IText
|
|
23771
23812
|
*/
|
|
23772
23813
|
initBehavior() {
|
|
23773
23814
|
this._tick = this._tick.bind(this);
|
|
@@ -23780,8 +23821,8 @@ class ITextBehavior extends FabricText {
|
|
|
23780
23821
|
return super.onDeselect(options);
|
|
23781
23822
|
}
|
|
23782
23823
|
|
|
23783
|
-
/**
|
|
23784
|
-
* @private
|
|
23824
|
+
/**
|
|
23825
|
+
* @private
|
|
23785
23826
|
*/
|
|
23786
23827
|
_animateCursor(_ref) {
|
|
23787
23828
|
let {
|
|
@@ -23806,8 +23847,8 @@ class ITextBehavior extends FabricText {
|
|
|
23806
23847
|
});
|
|
23807
23848
|
}
|
|
23808
23849
|
|
|
23809
|
-
/**
|
|
23810
|
-
* changes the cursor from visible to invisible
|
|
23850
|
+
/**
|
|
23851
|
+
* changes the cursor from visible to invisible
|
|
23811
23852
|
*/
|
|
23812
23853
|
_tick(delay) {
|
|
23813
23854
|
this._currentTickState = this._animateCursor({
|
|
@@ -23818,8 +23859,8 @@ class ITextBehavior extends FabricText {
|
|
|
23818
23859
|
});
|
|
23819
23860
|
}
|
|
23820
23861
|
|
|
23821
|
-
/**
|
|
23822
|
-
* Changes the cursor from invisible to visible
|
|
23862
|
+
/**
|
|
23863
|
+
* Changes the cursor from invisible to visible
|
|
23823
23864
|
*/
|
|
23824
23865
|
_onTickComplete() {
|
|
23825
23866
|
var _this$_currentTickCom;
|
|
@@ -23831,16 +23872,16 @@ class ITextBehavior extends FabricText {
|
|
|
23831
23872
|
});
|
|
23832
23873
|
}
|
|
23833
23874
|
|
|
23834
|
-
/**
|
|
23835
|
-
* Initializes delayed cursor
|
|
23875
|
+
/**
|
|
23876
|
+
* Initializes delayed cursor
|
|
23836
23877
|
*/
|
|
23837
23878
|
initDelayedCursor(restart) {
|
|
23838
23879
|
this.abortCursorAnimation();
|
|
23839
23880
|
this._tick(restart ? 0 : this.cursorDelay);
|
|
23840
23881
|
}
|
|
23841
23882
|
|
|
23842
|
-
/**
|
|
23843
|
-
* Aborts cursor animation, clears all timeouts and clear textarea context if necessary
|
|
23883
|
+
/**
|
|
23884
|
+
* Aborts cursor animation, clears all timeouts and clear textarea context if necessary
|
|
23844
23885
|
*/
|
|
23845
23886
|
abortCursorAnimation() {
|
|
23846
23887
|
let shouldClear = false;
|
|
@@ -23858,9 +23899,9 @@ class ITextBehavior extends FabricText {
|
|
|
23858
23899
|
}
|
|
23859
23900
|
}
|
|
23860
23901
|
|
|
23861
|
-
/**
|
|
23862
|
-
* Restart tue cursor animation if either is in complete state ( between animations )
|
|
23863
|
-
* or if it never started before
|
|
23902
|
+
/**
|
|
23903
|
+
* Restart tue cursor animation if either is in complete state ( between animations )
|
|
23904
|
+
* or if it never started before
|
|
23864
23905
|
*/
|
|
23865
23906
|
restartCursorIfNeeded() {
|
|
23866
23907
|
if ([this._currentTickState, this._currentTickCompleteState].some(cursorAnimation => !cursorAnimation || cursorAnimation.isDone())) {
|
|
@@ -23868,8 +23909,8 @@ class ITextBehavior extends FabricText {
|
|
|
23868
23909
|
}
|
|
23869
23910
|
}
|
|
23870
23911
|
|
|
23871
|
-
/**
|
|
23872
|
-
* Selects entire text
|
|
23912
|
+
/**
|
|
23913
|
+
* Selects entire text
|
|
23873
23914
|
*/
|
|
23874
23915
|
selectAll() {
|
|
23875
23916
|
this.selectionStart = 0;
|
|
@@ -23879,26 +23920,26 @@ class ITextBehavior extends FabricText {
|
|
|
23879
23920
|
return this;
|
|
23880
23921
|
}
|
|
23881
23922
|
|
|
23882
|
-
/**
|
|
23883
|
-
* Selects entire text and updates the visual state
|
|
23923
|
+
/**
|
|
23924
|
+
* Selects entire text and updates the visual state
|
|
23884
23925
|
*/
|
|
23885
23926
|
cmdAll() {
|
|
23886
23927
|
this.selectAll();
|
|
23887
23928
|
this.renderCursorOrSelection();
|
|
23888
23929
|
}
|
|
23889
23930
|
|
|
23890
|
-
/**
|
|
23891
|
-
* Returns selected text
|
|
23892
|
-
* @return {String}
|
|
23931
|
+
/**
|
|
23932
|
+
* Returns selected text
|
|
23933
|
+
* @return {String}
|
|
23893
23934
|
*/
|
|
23894
23935
|
getSelectedText() {
|
|
23895
23936
|
return this._text.slice(this.selectionStart, this.selectionEnd).join('');
|
|
23896
23937
|
}
|
|
23897
23938
|
|
|
23898
|
-
/**
|
|
23899
|
-
* Find new selection index representing start of current word according to current selection index
|
|
23900
|
-
* @param {Number} startFrom Current selection index
|
|
23901
|
-
* @return {Number} New selection index
|
|
23939
|
+
/**
|
|
23940
|
+
* Find new selection index representing start of current word according to current selection index
|
|
23941
|
+
* @param {Number} startFrom Current selection index
|
|
23942
|
+
* @return {Number} New selection index
|
|
23902
23943
|
*/
|
|
23903
23944
|
findWordBoundaryLeft(startFrom) {
|
|
23904
23945
|
let offset = 0,
|
|
@@ -23918,10 +23959,10 @@ class ITextBehavior extends FabricText {
|
|
|
23918
23959
|
return startFrom - offset;
|
|
23919
23960
|
}
|
|
23920
23961
|
|
|
23921
|
-
/**
|
|
23922
|
-
* Find new selection index representing end of current word according to current selection index
|
|
23923
|
-
* @param {Number} startFrom Current selection index
|
|
23924
|
-
* @return {Number} New selection index
|
|
23962
|
+
/**
|
|
23963
|
+
* Find new selection index representing end of current word according to current selection index
|
|
23964
|
+
* @param {Number} startFrom Current selection index
|
|
23965
|
+
* @return {Number} New selection index
|
|
23925
23966
|
*/
|
|
23926
23967
|
findWordBoundaryRight(startFrom) {
|
|
23927
23968
|
let offset = 0,
|
|
@@ -23941,10 +23982,10 @@ class ITextBehavior extends FabricText {
|
|
|
23941
23982
|
return startFrom + offset;
|
|
23942
23983
|
}
|
|
23943
23984
|
|
|
23944
|
-
/**
|
|
23945
|
-
* Find new selection index representing start of current line according to current selection index
|
|
23946
|
-
* @param {Number} startFrom Current selection index
|
|
23947
|
-
* @return {Number} New selection index
|
|
23985
|
+
/**
|
|
23986
|
+
* Find new selection index representing start of current line according to current selection index
|
|
23987
|
+
* @param {Number} startFrom Current selection index
|
|
23988
|
+
* @return {Number} New selection index
|
|
23948
23989
|
*/
|
|
23949
23990
|
findLineBoundaryLeft(startFrom) {
|
|
23950
23991
|
let offset = 0,
|
|
@@ -23956,10 +23997,10 @@ class ITextBehavior extends FabricText {
|
|
|
23956
23997
|
return startFrom - offset;
|
|
23957
23998
|
}
|
|
23958
23999
|
|
|
23959
|
-
/**
|
|
23960
|
-
* Find new selection index representing end of current line according to current selection index
|
|
23961
|
-
* @param {Number} startFrom Current selection index
|
|
23962
|
-
* @return {Number} New selection index
|
|
24000
|
+
/**
|
|
24001
|
+
* Find new selection index representing end of current line according to current selection index
|
|
24002
|
+
* @param {Number} startFrom Current selection index
|
|
24003
|
+
* @return {Number} New selection index
|
|
23963
24004
|
*/
|
|
23964
24005
|
findLineBoundaryRight(startFrom) {
|
|
23965
24006
|
let offset = 0,
|
|
@@ -23971,11 +24012,11 @@ class ITextBehavior extends FabricText {
|
|
|
23971
24012
|
return startFrom + offset;
|
|
23972
24013
|
}
|
|
23973
24014
|
|
|
23974
|
-
/**
|
|
23975
|
-
* Finds index corresponding to beginning or end of a word
|
|
23976
|
-
* @param {Number} selectionStart Index of a character
|
|
23977
|
-
* @param {Number} direction 1 or -1
|
|
23978
|
-
* @return {Number} Index of the beginning or end of a word
|
|
24015
|
+
/**
|
|
24016
|
+
* Finds index corresponding to beginning or end of a word
|
|
24017
|
+
* @param {Number} selectionStart Index of a character
|
|
24018
|
+
* @param {Number} direction 1 or -1
|
|
24019
|
+
* @return {Number} Index of the beginning or end of a word
|
|
23979
24020
|
*/
|
|
23980
24021
|
searchWordBoundary(selectionStart, direction) {
|
|
23981
24022
|
const text = this._text;
|
|
@@ -23993,9 +24034,9 @@ class ITextBehavior extends FabricText {
|
|
|
23993
24034
|
return index;
|
|
23994
24035
|
}
|
|
23995
24036
|
|
|
23996
|
-
/**
|
|
23997
|
-
* Selects the word that contains the char at index selectionStart
|
|
23998
|
-
* @param {Number} selectionStart Index of a character
|
|
24037
|
+
/**
|
|
24038
|
+
* Selects the word that contains the char at index selectionStart
|
|
24039
|
+
* @param {Number} selectionStart Index of a character
|
|
23999
24040
|
*/
|
|
24000
24041
|
selectWord(selectionStart) {
|
|
24001
24042
|
selectionStart = selectionStart !== null && selectionStart !== void 0 ? selectionStart : this.selectionStart;
|
|
@@ -24011,9 +24052,9 @@ class ITextBehavior extends FabricText {
|
|
|
24011
24052
|
this.renderCursorOrSelection();
|
|
24012
24053
|
}
|
|
24013
24054
|
|
|
24014
|
-
/**
|
|
24015
|
-
* Selects the line that contains selectionStart
|
|
24016
|
-
* @param {Number} selectionStart Index of a character
|
|
24055
|
+
/**
|
|
24056
|
+
* Selects the line that contains selectionStart
|
|
24057
|
+
* @param {Number} selectionStart Index of a character
|
|
24017
24058
|
*/
|
|
24018
24059
|
selectLine(selectionStart) {
|
|
24019
24060
|
selectionStart = selectionStart !== null && selectionStart !== void 0 ? selectionStart : this.selectionStart;
|
|
@@ -24025,8 +24066,8 @@ class ITextBehavior extends FabricText {
|
|
|
24025
24066
|
this._updateTextarea();
|
|
24026
24067
|
}
|
|
24027
24068
|
|
|
24028
|
-
/**
|
|
24029
|
-
* Enters editing state
|
|
24069
|
+
/**
|
|
24070
|
+
* Enters editing state
|
|
24030
24071
|
*/
|
|
24031
24072
|
enterEditing(e) {
|
|
24032
24073
|
if (this.isEditing || !this.editable) {
|
|
@@ -24046,8 +24087,8 @@ class ITextBehavior extends FabricText {
|
|
|
24046
24087
|
}
|
|
24047
24088
|
}
|
|
24048
24089
|
|
|
24049
|
-
/**
|
|
24050
|
-
* runs the actual logic that enter from editing state, see {@link enterEditing}
|
|
24090
|
+
/**
|
|
24091
|
+
* runs the actual logic that enter from editing state, see {@link enterEditing}
|
|
24051
24092
|
*/
|
|
24052
24093
|
enterEditingImpl() {
|
|
24053
24094
|
if (this.canvas) {
|
|
@@ -24058,6 +24099,18 @@ class ITextBehavior extends FabricText {
|
|
|
24058
24099
|
|
|
24059
24100
|
// Check if using overlay editing
|
|
24060
24101
|
if (this.useOverlayEditing) {
|
|
24102
|
+
// For justify text, backup the current working state before overlay editing
|
|
24103
|
+
if (this.textAlign.includes('justify')) {
|
|
24104
|
+
console.log('💾 BACKUP: Saving pre-overlay justify state');
|
|
24105
|
+
this._originalText = this.text; // Store original text to detect changes
|
|
24106
|
+
this._preOverlayJustifyState = {
|
|
24107
|
+
__charBounds: JSON.parse(JSON.stringify(this.__charBounds || [])),
|
|
24108
|
+
__lineHeights: [...(this.__lineHeights || [])],
|
|
24109
|
+
__lineWidths: [...(this.__lineWidths || [])],
|
|
24110
|
+
textLines: [...(this.textLines || [])],
|
|
24111
|
+
_textLines: (this._textLines || []).map(line => [...line])
|
|
24112
|
+
};
|
|
24113
|
+
}
|
|
24061
24114
|
this.enterOverlayEditing();
|
|
24062
24115
|
} else {
|
|
24063
24116
|
this.initHiddenTextarea();
|
|
@@ -24071,8 +24124,8 @@ class ITextBehavior extends FabricText {
|
|
|
24071
24124
|
}
|
|
24072
24125
|
}
|
|
24073
24126
|
|
|
24074
|
-
/**
|
|
24075
|
-
* Enter overlay editing mode using DOM textarea overlay
|
|
24127
|
+
/**
|
|
24128
|
+
* Enter overlay editing mode using DOM textarea overlay
|
|
24076
24129
|
*/
|
|
24077
24130
|
enterOverlayEditing() {
|
|
24078
24131
|
this._saveEditingProps();
|
|
@@ -24093,33 +24146,85 @@ class ITextBehavior extends FabricText {
|
|
|
24093
24146
|
});
|
|
24094
24147
|
}
|
|
24095
24148
|
|
|
24096
|
-
/**
|
|
24097
|
-
* Commit overlay editing changes
|
|
24149
|
+
/**
|
|
24150
|
+
* Commit overlay editing changes
|
|
24098
24151
|
*/
|
|
24099
24152
|
commitOverlayEdit(text) {
|
|
24100
24153
|
const overlayEditor = this.__overlayEditor;
|
|
24101
|
-
|
|
24102
|
-
|
|
24103
|
-
|
|
24154
|
+
|
|
24155
|
+
// Update text first so browser line cache uses the new content
|
|
24156
|
+
this.text = text;
|
|
24157
|
+
|
|
24158
|
+
// For justify text, restore pre-overlay state only if text didn't change
|
|
24159
|
+
if (this.textAlign.includes('justify')) {
|
|
24160
|
+
const textChanged = this._originalText !== text;
|
|
24161
|
+
console.log('🔄 JUSTIFY CHECK: Text changed:', textChanged);
|
|
24162
|
+
|
|
24163
|
+
// Only restore backup state if text didn't change
|
|
24164
|
+
if (!textChanged) {
|
|
24165
|
+
const backupState = this._preOverlayJustifyState;
|
|
24166
|
+
if (backupState) {
|
|
24167
|
+
var _this$canvas;
|
|
24168
|
+
console.log('📦 RESTORE: Text unchanged, restoring pre-overlay state');
|
|
24169
|
+
// Restore the working character bounds and measurements (but keep current text)
|
|
24170
|
+
this.__charBounds = JSON.parse(JSON.stringify(backupState.__charBounds));
|
|
24171
|
+
this.__lineHeights = [...backupState.__lineHeights];
|
|
24172
|
+
this.__lineWidths = [...backupState.__lineWidths];
|
|
24173
|
+
this.textLines = [...backupState.textLines];
|
|
24174
|
+
this._textLines = backupState._textLines.map(line => [...line]);
|
|
24175
|
+
|
|
24176
|
+
// Clear the backup
|
|
24177
|
+
delete this._preOverlayJustifyState;
|
|
24178
|
+
delete this._originalText;
|
|
24179
|
+
|
|
24180
|
+
// Just request a render, don't rebuild
|
|
24181
|
+
(_this$canvas = this.canvas) === null || _this$canvas === void 0 || _this$canvas.requestRenderAll();
|
|
24182
|
+
return;
|
|
24183
|
+
}
|
|
24184
|
+
} else {
|
|
24185
|
+
console.log('🆕 REBUILD: Text changed, need to rebuild justify layout');
|
|
24186
|
+
// Clean up backup since we won't use it
|
|
24187
|
+
delete this._preOverlayJustifyState;
|
|
24188
|
+
delete this._originalText;
|
|
24189
|
+
}
|
|
24190
|
+
}
|
|
24191
|
+
if (overlayEditor && overlayEditor.textareaElement) {
|
|
24192
|
+
// For non-justify text, extract browser lines normally
|
|
24193
|
+
try {
|
|
24104
24194
|
const result = extractLinesFromDOM(overlayEditor.textareaElement);
|
|
24105
|
-
storeBrowserLines(this, result.lines);
|
|
24195
|
+
storeBrowserLines(this, result.lines, result.width);
|
|
24106
24196
|
} catch (error) {
|
|
24107
24197
|
console.warn('Failed to extract browser lines:', error);
|
|
24108
24198
|
}
|
|
24109
24199
|
}
|
|
24110
24200
|
|
|
24111
|
-
//
|
|
24112
|
-
this.text = text;
|
|
24201
|
+
// Trigger layout recalculation
|
|
24113
24202
|
this.dirty = true;
|
|
24114
24203
|
this.initDimensions();
|
|
24204
|
+
|
|
24205
|
+
// For justify text, force complete reconstruction after overlay editing
|
|
24206
|
+
if (this.textAlign.includes('justify') && 'enlargeSpaces' in this) {
|
|
24207
|
+
setTimeout(() => {
|
|
24208
|
+
var _this$canvas2;
|
|
24209
|
+
console.log('🔧 FORCE REBUILD: Rebuilding justify text after overlay editing');
|
|
24210
|
+
// Force complete reconstruction of character bounds
|
|
24211
|
+
this.__charBounds = [];
|
|
24212
|
+
this.__lineHeights = [];
|
|
24213
|
+
this.__lineWidths = [];
|
|
24214
|
+
// Re-run initDimensions to rebuild everything
|
|
24215
|
+
this.initDimensions();
|
|
24216
|
+
(_this$canvas2 = this.canvas) === null || _this$canvas2 === void 0 || _this$canvas2.requestRenderAll();
|
|
24217
|
+
}, 20);
|
|
24218
|
+
}
|
|
24115
24219
|
this.setCoords();
|
|
24116
24220
|
this.exitEditing();
|
|
24117
24221
|
this.fire('changed');
|
|
24118
24222
|
this.canvas && this.canvas.requestRenderAll();
|
|
24223
|
+
console.log('🔧 DEBUG: commitOverlayEdit complete');
|
|
24119
24224
|
}
|
|
24120
24225
|
|
|
24121
|
-
/**
|
|
24122
|
-
* Cancel overlay editing without changes
|
|
24226
|
+
/**
|
|
24227
|
+
* Cancel overlay editing without changes
|
|
24123
24228
|
*/
|
|
24124
24229
|
cancelOverlayEdit() {
|
|
24125
24230
|
// Restore original text
|
|
@@ -24127,8 +24232,8 @@ class ITextBehavior extends FabricText {
|
|
|
24127
24232
|
this.exitEditing();
|
|
24128
24233
|
}
|
|
24129
24234
|
|
|
24130
|
-
/**
|
|
24131
|
-
* called by {@link Canvas#textEditingManager}
|
|
24235
|
+
/**
|
|
24236
|
+
* called by {@link Canvas#textEditingManager}
|
|
24132
24237
|
*/
|
|
24133
24238
|
updateSelectionOnMouseMove(e) {
|
|
24134
24239
|
if (this.getActiveControl()) {
|
|
@@ -24156,8 +24261,8 @@ class ITextBehavior extends FabricText {
|
|
|
24156
24261
|
}
|
|
24157
24262
|
}
|
|
24158
24263
|
|
|
24159
|
-
/**
|
|
24160
|
-
* @private
|
|
24264
|
+
/**
|
|
24265
|
+
* @private
|
|
24161
24266
|
*/
|
|
24162
24267
|
_setEditingProps() {
|
|
24163
24268
|
this.hoverCursor = 'text';
|
|
@@ -24169,8 +24274,8 @@ class ITextBehavior extends FabricText {
|
|
|
24169
24274
|
this.lockMovementX = this.lockMovementY = true;
|
|
24170
24275
|
}
|
|
24171
24276
|
|
|
24172
|
-
/**
|
|
24173
|
-
* convert from textarea to grapheme indexes
|
|
24277
|
+
/**
|
|
24278
|
+
* convert from textarea to grapheme indexes
|
|
24174
24279
|
*/
|
|
24175
24280
|
fromStringToGraphemeSelection(start, end, text) {
|
|
24176
24281
|
const smallerTextStart = text.slice(0, start),
|
|
@@ -24189,8 +24294,8 @@ class ITextBehavior extends FabricText {
|
|
|
24189
24294
|
};
|
|
24190
24295
|
}
|
|
24191
24296
|
|
|
24192
|
-
/**
|
|
24193
|
-
* convert from fabric to textarea values
|
|
24297
|
+
/**
|
|
24298
|
+
* convert from fabric to textarea values
|
|
24194
24299
|
*/
|
|
24195
24300
|
fromGraphemeToStringSelection(start, end, graphemes) {
|
|
24196
24301
|
const smallerTextStart = graphemes.slice(0, start),
|
|
@@ -24209,8 +24314,8 @@ class ITextBehavior extends FabricText {
|
|
|
24209
24314
|
};
|
|
24210
24315
|
}
|
|
24211
24316
|
|
|
24212
|
-
/**
|
|
24213
|
-
* @private
|
|
24317
|
+
/**
|
|
24318
|
+
* @private
|
|
24214
24319
|
*/
|
|
24215
24320
|
_updateTextarea() {
|
|
24216
24321
|
console.log('🔤 _updateTextarea called with fabric text:', this.text);
|
|
@@ -24235,8 +24340,8 @@ class ITextBehavior extends FabricText {
|
|
|
24235
24340
|
this.updateTextareaPosition();
|
|
24236
24341
|
}
|
|
24237
24342
|
|
|
24238
|
-
/**
|
|
24239
|
-
* @private
|
|
24343
|
+
/**
|
|
24344
|
+
* @private
|
|
24240
24345
|
*/
|
|
24241
24346
|
updateFromTextArea() {
|
|
24242
24347
|
if (!this.hiddenTextarea) {
|
|
@@ -24256,8 +24361,8 @@ class ITextBehavior extends FabricText {
|
|
|
24256
24361
|
this.updateTextareaPosition();
|
|
24257
24362
|
}
|
|
24258
24363
|
|
|
24259
|
-
/**
|
|
24260
|
-
* @private
|
|
24364
|
+
/**
|
|
24365
|
+
* @private
|
|
24261
24366
|
*/
|
|
24262
24367
|
updateTextareaPosition() {
|
|
24263
24368
|
if (this.selectionStart === this.selectionEnd) {
|
|
@@ -24267,9 +24372,9 @@ class ITextBehavior extends FabricText {
|
|
|
24267
24372
|
}
|
|
24268
24373
|
}
|
|
24269
24374
|
|
|
24270
|
-
/**
|
|
24271
|
-
* @private
|
|
24272
|
-
* @return {Object} style contains style for hiddenTextarea
|
|
24375
|
+
/**
|
|
24376
|
+
* @private
|
|
24377
|
+
* @return {Object} style contains style for hiddenTextarea
|
|
24273
24378
|
*/
|
|
24274
24379
|
_calcTextareaPosition() {
|
|
24275
24380
|
if (!this.canvas) {
|
|
@@ -24316,8 +24421,8 @@ class ITextBehavior extends FabricText {
|
|
|
24316
24421
|
};
|
|
24317
24422
|
}
|
|
24318
24423
|
|
|
24319
|
-
/**
|
|
24320
|
-
* @private
|
|
24424
|
+
/**
|
|
24425
|
+
* @private
|
|
24321
24426
|
*/
|
|
24322
24427
|
_saveEditingProps() {
|
|
24323
24428
|
this._savedProps = {
|
|
@@ -24334,8 +24439,8 @@ class ITextBehavior extends FabricText {
|
|
|
24334
24439
|
};
|
|
24335
24440
|
}
|
|
24336
24441
|
|
|
24337
|
-
/**
|
|
24338
|
-
* @private
|
|
24442
|
+
/**
|
|
24443
|
+
* @private
|
|
24339
24444
|
*/
|
|
24340
24445
|
_restoreEditingProps() {
|
|
24341
24446
|
if (!this._savedProps) {
|
|
@@ -24355,9 +24460,9 @@ class ITextBehavior extends FabricText {
|
|
|
24355
24460
|
delete this._savedProps;
|
|
24356
24461
|
}
|
|
24357
24462
|
|
|
24358
|
-
/**
|
|
24359
|
-
* runs the actual logic that exits from editing state, see {@link exitEditing}
|
|
24360
|
-
* But it does not fire events
|
|
24463
|
+
/**
|
|
24464
|
+
* runs the actual logic that exits from editing state, see {@link exitEditing}
|
|
24465
|
+
* But it does not fire events
|
|
24361
24466
|
*/
|
|
24362
24467
|
exitEditingImpl() {
|
|
24363
24468
|
const hiddenTextarea = this.hiddenTextarea;
|
|
@@ -24378,8 +24483,8 @@ class ITextBehavior extends FabricText {
|
|
|
24378
24483
|
}
|
|
24379
24484
|
}
|
|
24380
24485
|
|
|
24381
|
-
/**
|
|
24382
|
-
* Exits from editing state and fires relevant events
|
|
24486
|
+
/**
|
|
24487
|
+
* Exits from editing state and fires relevant events
|
|
24383
24488
|
*/
|
|
24384
24489
|
exitEditing() {
|
|
24385
24490
|
const isTextChanged = this._textBeforeEdit !== this.text;
|
|
@@ -24398,8 +24503,8 @@ class ITextBehavior extends FabricText {
|
|
|
24398
24503
|
return this;
|
|
24399
24504
|
}
|
|
24400
24505
|
|
|
24401
|
-
/**
|
|
24402
|
-
* @private
|
|
24506
|
+
/**
|
|
24507
|
+
* @private
|
|
24403
24508
|
*/
|
|
24404
24509
|
_removeExtraneousStyles() {
|
|
24405
24510
|
for (const prop in this.styles) {
|
|
@@ -24409,10 +24514,10 @@ class ITextBehavior extends FabricText {
|
|
|
24409
24514
|
}
|
|
24410
24515
|
}
|
|
24411
24516
|
|
|
24412
|
-
/**
|
|
24413
|
-
* remove and reflow a style block from start to end.
|
|
24414
|
-
* @param {Number} start linear start position for removal (included in removal)
|
|
24415
|
-
* @param {Number} end linear end position for removal ( excluded from removal )
|
|
24517
|
+
/**
|
|
24518
|
+
* remove and reflow a style block from start to end.
|
|
24519
|
+
* @param {Number} start linear start position for removal (included in removal)
|
|
24520
|
+
* @param {Number} end linear end position for removal ( excluded from removal )
|
|
24416
24521
|
*/
|
|
24417
24522
|
removeStyleFromTo(start, end) {
|
|
24418
24523
|
const {
|
|
@@ -24465,10 +24570,10 @@ class ITextBehavior extends FabricText {
|
|
|
24465
24570
|
}
|
|
24466
24571
|
}
|
|
24467
24572
|
|
|
24468
|
-
/**
|
|
24469
|
-
* Shifts line styles up or down
|
|
24470
|
-
* @param {Number} lineIndex Index of a line
|
|
24471
|
-
* @param {Number} offset Can any number?
|
|
24573
|
+
/**
|
|
24574
|
+
* Shifts line styles up or down
|
|
24575
|
+
* @param {Number} lineIndex Index of a line
|
|
24576
|
+
* @param {Number} offset Can any number?
|
|
24472
24577
|
*/
|
|
24473
24578
|
shiftLineStyles(lineIndex, offset) {
|
|
24474
24579
|
const clonedStyles = Object.assign({}, this.styles);
|
|
@@ -24483,15 +24588,15 @@ class ITextBehavior extends FabricText {
|
|
|
24483
24588
|
}
|
|
24484
24589
|
}
|
|
24485
24590
|
|
|
24486
|
-
/**
|
|
24487
|
-
* Handle insertion of more consecutive style lines for when one or more
|
|
24488
|
-
* newlines gets added to the text. Since current style needs to be shifted
|
|
24489
|
-
* first we shift the current style of the number lines needed, then we add
|
|
24490
|
-
* new lines from the last to the first.
|
|
24491
|
-
* @param {Number} lineIndex Index of a line
|
|
24492
|
-
* @param {Number} charIndex Index of a char
|
|
24493
|
-
* @param {Number} qty number of lines to add
|
|
24494
|
-
* @param {Array} copiedStyle Array of objects styles
|
|
24591
|
+
/**
|
|
24592
|
+
* Handle insertion of more consecutive style lines for when one or more
|
|
24593
|
+
* newlines gets added to the text. Since current style needs to be shifted
|
|
24594
|
+
* first we shift the current style of the number lines needed, then we add
|
|
24595
|
+
* new lines from the last to the first.
|
|
24596
|
+
* @param {Number} lineIndex Index of a line
|
|
24597
|
+
* @param {Number} charIndex Index of a char
|
|
24598
|
+
* @param {Number} qty number of lines to add
|
|
24599
|
+
* @param {Array} copiedStyle Array of objects styles
|
|
24495
24600
|
*/
|
|
24496
24601
|
insertNewlineStyleObject(lineIndex, charIndex, qty, copiedStyle) {
|
|
24497
24602
|
const newLineStyles = {};
|
|
@@ -24551,12 +24656,12 @@ class ITextBehavior extends FabricText {
|
|
|
24551
24656
|
this._forceClearCache = true;
|
|
24552
24657
|
}
|
|
24553
24658
|
|
|
24554
|
-
/**
|
|
24555
|
-
* Inserts style object for a given line/char index
|
|
24556
|
-
* @param {Number} lineIndex Index of a line
|
|
24557
|
-
* @param {Number} charIndex Index of a char
|
|
24558
|
-
* @param {Number} quantity number Style object to insert, if given
|
|
24559
|
-
* @param {Array} copiedStyle array of style objects
|
|
24659
|
+
/**
|
|
24660
|
+
* Inserts style object for a given line/char index
|
|
24661
|
+
* @param {Number} lineIndex Index of a line
|
|
24662
|
+
* @param {Number} charIndex Index of a char
|
|
24663
|
+
* @param {Number} quantity number Style object to insert, if given
|
|
24664
|
+
* @param {Array} copiedStyle array of style objects
|
|
24560
24665
|
*/
|
|
24561
24666
|
insertCharStyleObject(lineIndex, charIndex, quantity, copiedStyle) {
|
|
24562
24667
|
if (!this.styles) {
|
|
@@ -24605,11 +24710,11 @@ class ITextBehavior extends FabricText {
|
|
|
24605
24710
|
}
|
|
24606
24711
|
}
|
|
24607
24712
|
|
|
24608
|
-
/**
|
|
24609
|
-
* Inserts style object(s)
|
|
24610
|
-
* @param {Array} insertedText Characters at the location where style is inserted
|
|
24611
|
-
* @param {Number} start cursor index for inserting style
|
|
24612
|
-
* @param {Array} [copiedStyle] array of style objects to insert.
|
|
24713
|
+
/**
|
|
24714
|
+
* Inserts style object(s)
|
|
24715
|
+
* @param {Array} insertedText Characters at the location where style is inserted
|
|
24716
|
+
* @param {Number} start cursor index for inserting style
|
|
24717
|
+
* @param {Array} [copiedStyle] array of style objects to insert.
|
|
24613
24718
|
*/
|
|
24614
24719
|
insertNewStyleBlock(insertedText, start, copiedStyle) {
|
|
24615
24720
|
const cursorLoc = this.get2DCursorLocation(start, true),
|
|
@@ -24650,12 +24755,12 @@ class ITextBehavior extends FabricText {
|
|
|
24650
24755
|
}
|
|
24651
24756
|
}
|
|
24652
24757
|
|
|
24653
|
-
/**
|
|
24654
|
-
* Removes characters from start/end
|
|
24655
|
-
* start/end ar per grapheme position in _text array.
|
|
24656
|
-
*
|
|
24657
|
-
* @param {Number} start
|
|
24658
|
-
* @param {Number} end default to start + 1
|
|
24758
|
+
/**
|
|
24759
|
+
* Removes characters from start/end
|
|
24760
|
+
* start/end ar per grapheme position in _text array.
|
|
24761
|
+
*
|
|
24762
|
+
* @param {Number} start
|
|
24763
|
+
* @param {Number} end default to start + 1
|
|
24659
24764
|
*/
|
|
24660
24765
|
removeChars(start) {
|
|
24661
24766
|
let end = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : start + 1;
|
|
@@ -24668,17 +24773,17 @@ class ITextBehavior extends FabricText {
|
|
|
24668
24773
|
this._removeExtraneousStyles();
|
|
24669
24774
|
}
|
|
24670
24775
|
|
|
24671
|
-
/**
|
|
24672
|
-
* insert characters at start position, before start position.
|
|
24673
|
-
* start equal 1 it means the text get inserted between actual grapheme 0 and 1
|
|
24674
|
-
* if style array is provided, it must be as the same length of text in graphemes
|
|
24675
|
-
* if end is provided and is bigger than start, old text is replaced.
|
|
24676
|
-
* start/end ar per grapheme position in _text array.
|
|
24677
|
-
*
|
|
24678
|
-
* @param {String} text text to insert
|
|
24679
|
-
* @param {Array} style array of style objects
|
|
24680
|
-
* @param {Number} start
|
|
24681
|
-
* @param {Number} end default to start + 1
|
|
24776
|
+
/**
|
|
24777
|
+
* insert characters at start position, before start position.
|
|
24778
|
+
* start equal 1 it means the text get inserted between actual grapheme 0 and 1
|
|
24779
|
+
* if style array is provided, it must be as the same length of text in graphemes
|
|
24780
|
+
* if end is provided and is bigger than start, old text is replaced.
|
|
24781
|
+
* start/end ar per grapheme position in _text array.
|
|
24782
|
+
*
|
|
24783
|
+
* @param {String} text text to insert
|
|
24784
|
+
* @param {Array} style array of style objects
|
|
24785
|
+
* @param {Number} start
|
|
24786
|
+
* @param {Number} end default to start + 1
|
|
24682
24787
|
*/
|
|
24683
24788
|
insertChars(text, style, start) {
|
|
24684
24789
|
let end = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : start;
|
|
@@ -24695,9 +24800,9 @@ class ITextBehavior extends FabricText {
|
|
|
24695
24800
|
this._removeExtraneousStyles();
|
|
24696
24801
|
}
|
|
24697
24802
|
|
|
24698
|
-
/**
|
|
24699
|
-
* Set the selectionStart and selectionEnd according to the new position of cursor
|
|
24700
|
-
* mimic the key - mouse navigation when shift is pressed.
|
|
24803
|
+
/**
|
|
24804
|
+
* Set the selectionStart and selectionEnd according to the new position of cursor
|
|
24805
|
+
* mimic the key - mouse navigation when shift is pressed.
|
|
24701
24806
|
*/
|
|
24702
24807
|
setSelectionStartEndWithShift(start, end, newSelection) {
|
|
24703
24808
|
if (newSelection <= start) {
|
|
@@ -24728,36 +24833,36 @@ class ITextBehavior extends FabricText {
|
|
|
24728
24833
|
}
|
|
24729
24834
|
|
|
24730
24835
|
class ITextKeyBehavior extends ITextBehavior {
|
|
24731
|
-
/**
|
|
24732
|
-
* For functionalities on keyDown
|
|
24733
|
-
* Map a special key to a function of the instance/prototype
|
|
24734
|
-
* If you need different behavior for ESC or TAB or arrows, you have to change
|
|
24735
|
-
* this map setting the name of a function that you build on the IText or
|
|
24736
|
-
* your prototype.
|
|
24737
|
-
* the map change will affect all Instances unless you need for only some text Instances
|
|
24738
|
-
* in that case you have to clone this object and assign your Instance.
|
|
24739
|
-
* this.keysMap = Object.assign({}, this.keysMap);
|
|
24740
|
-
* The function must be in IText.prototype.myFunction And will receive event as args[0]
|
|
24836
|
+
/**
|
|
24837
|
+
* For functionalities on keyDown
|
|
24838
|
+
* Map a special key to a function of the instance/prototype
|
|
24839
|
+
* If you need different behavior for ESC or TAB or arrows, you have to change
|
|
24840
|
+
* this map setting the name of a function that you build on the IText or
|
|
24841
|
+
* your prototype.
|
|
24842
|
+
* the map change will affect all Instances unless you need for only some text Instances
|
|
24843
|
+
* in that case you have to clone this object and assign your Instance.
|
|
24844
|
+
* this.keysMap = Object.assign({}, this.keysMap);
|
|
24845
|
+
* The function must be in IText.prototype.myFunction And will receive event as args[0]
|
|
24741
24846
|
*/
|
|
24742
24847
|
|
|
24743
|
-
/**
|
|
24744
|
-
* For functionalities on keyUp + ctrl || cmd
|
|
24848
|
+
/**
|
|
24849
|
+
* For functionalities on keyUp + ctrl || cmd
|
|
24745
24850
|
*/
|
|
24746
24851
|
|
|
24747
|
-
/**
|
|
24748
|
-
* For functionalities on keyDown + ctrl || cmd
|
|
24852
|
+
/**
|
|
24853
|
+
* For functionalities on keyDown + ctrl || cmd
|
|
24749
24854
|
*/
|
|
24750
24855
|
|
|
24751
|
-
/**
|
|
24752
|
-
* DOM container to append the hiddenTextarea.
|
|
24753
|
-
* An alternative to attaching to the document.body.
|
|
24754
|
-
* Useful to reduce laggish redraw of the full document.body tree and
|
|
24755
|
-
* also with modals event capturing that won't let the textarea take focus.
|
|
24756
|
-
* @type HTMLElement
|
|
24856
|
+
/**
|
|
24857
|
+
* DOM container to append the hiddenTextarea.
|
|
24858
|
+
* An alternative to attaching to the document.body.
|
|
24859
|
+
* Useful to reduce laggish redraw of the full document.body tree and
|
|
24860
|
+
* also with modals event capturing that won't let the textarea take focus.
|
|
24861
|
+
* @type HTMLElement
|
|
24757
24862
|
*/
|
|
24758
24863
|
|
|
24759
|
-
/**
|
|
24760
|
-
* Initializes hidden textarea (needed to bring up keyboard in iOS)
|
|
24864
|
+
/**
|
|
24865
|
+
* Initializes hidden textarea (needed to bring up keyboard in iOS)
|
|
24761
24866
|
*/
|
|
24762
24867
|
initHiddenTextarea() {
|
|
24763
24868
|
const doc = this.canvas && getDocumentFromElement(this.canvas.getElement()) || getFabricDocument();
|
|
@@ -24800,17 +24905,17 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
24800
24905
|
this.hiddenTextarea = textarea;
|
|
24801
24906
|
}
|
|
24802
24907
|
|
|
24803
|
-
/**
|
|
24804
|
-
* Override this method to customize cursor behavior on textbox blur
|
|
24908
|
+
/**
|
|
24909
|
+
* Override this method to customize cursor behavior on textbox blur
|
|
24805
24910
|
*/
|
|
24806
24911
|
blur() {
|
|
24807
24912
|
this.abortCursorAnimation();
|
|
24808
24913
|
}
|
|
24809
24914
|
|
|
24810
|
-
/**
|
|
24811
|
-
* Handles keydown event
|
|
24812
|
-
* only used for arrows and combination of modifier keys.
|
|
24813
|
-
* @param {KeyboardEvent} e Event object
|
|
24915
|
+
/**
|
|
24916
|
+
* Handles keydown event
|
|
24917
|
+
* only used for arrows and combination of modifier keys.
|
|
24918
|
+
* @param {KeyboardEvent} e Event object
|
|
24814
24919
|
*/
|
|
24815
24920
|
onKeyDown(e) {
|
|
24816
24921
|
if (!this.isEditing) {
|
|
@@ -24836,11 +24941,11 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
24836
24941
|
}
|
|
24837
24942
|
}
|
|
24838
24943
|
|
|
24839
|
-
/**
|
|
24840
|
-
* Handles keyup event
|
|
24841
|
-
* We handle KeyUp because ie11 and edge have difficulties copy/pasting
|
|
24842
|
-
* if a copy/cut event fired, keyup is dismissed
|
|
24843
|
-
* @param {KeyboardEvent} e Event object
|
|
24944
|
+
/**
|
|
24945
|
+
* Handles keyup event
|
|
24946
|
+
* We handle KeyUp because ie11 and edge have difficulties copy/pasting
|
|
24947
|
+
* if a copy/cut event fired, keyup is dismissed
|
|
24948
|
+
* @param {KeyboardEvent} e Event object
|
|
24844
24949
|
*/
|
|
24845
24950
|
onKeyUp(e) {
|
|
24846
24951
|
if (!this.isEditing || this._copyDone || this.inCompositionMode) {
|
|
@@ -24857,9 +24962,9 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
24857
24962
|
this.canvas && this.canvas.requestRenderAll();
|
|
24858
24963
|
}
|
|
24859
24964
|
|
|
24860
|
-
/**
|
|
24861
|
-
* Handles onInput event
|
|
24862
|
-
* @param {Event} e Event object
|
|
24965
|
+
/**
|
|
24966
|
+
* Handles onInput event
|
|
24967
|
+
* @param {Event} e Event object
|
|
24863
24968
|
*/
|
|
24864
24969
|
onInput(e) {
|
|
24865
24970
|
const fromPaste = this.fromPaste;
|
|
@@ -24996,15 +25101,15 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
24996
25101
|
updateAndFire();
|
|
24997
25102
|
}
|
|
24998
25103
|
|
|
24999
|
-
/**
|
|
25000
|
-
* Composition start
|
|
25104
|
+
/**
|
|
25105
|
+
* Composition start
|
|
25001
25106
|
*/
|
|
25002
25107
|
onCompositionStart() {
|
|
25003
25108
|
this.inCompositionMode = true;
|
|
25004
25109
|
}
|
|
25005
25110
|
|
|
25006
|
-
/**
|
|
25007
|
-
* Composition end
|
|
25111
|
+
/**
|
|
25112
|
+
* Composition end
|
|
25008
25113
|
*/
|
|
25009
25114
|
onCompositionEnd() {
|
|
25010
25115
|
this.inCompositionMode = false;
|
|
@@ -25022,8 +25127,8 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
25022
25127
|
this.updateTextareaPosition();
|
|
25023
25128
|
}
|
|
25024
25129
|
|
|
25025
|
-
/**
|
|
25026
|
-
* Copies selected text
|
|
25130
|
+
/**
|
|
25131
|
+
* Copies selected text
|
|
25027
25132
|
*/
|
|
25028
25133
|
copy() {
|
|
25029
25134
|
if (this.selectionStart === this.selectionEnd) {
|
|
@@ -25042,19 +25147,19 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
25042
25147
|
this._copyDone = true;
|
|
25043
25148
|
}
|
|
25044
25149
|
|
|
25045
|
-
/**
|
|
25046
|
-
* Pastes text
|
|
25150
|
+
/**
|
|
25151
|
+
* Pastes text
|
|
25047
25152
|
*/
|
|
25048
25153
|
paste() {
|
|
25049
25154
|
this.fromPaste = true;
|
|
25050
25155
|
}
|
|
25051
25156
|
|
|
25052
|
-
/**
|
|
25053
|
-
* Finds the width in pixels before the cursor on the same line
|
|
25054
|
-
* @private
|
|
25055
|
-
* @param {Number} lineIndex
|
|
25056
|
-
* @param {Number} charIndex
|
|
25057
|
-
* @return {Number} widthBeforeCursor width before cursor
|
|
25157
|
+
/**
|
|
25158
|
+
* Finds the width in pixels before the cursor on the same line
|
|
25159
|
+
* @private
|
|
25160
|
+
* @param {Number} lineIndex
|
|
25161
|
+
* @param {Number} charIndex
|
|
25162
|
+
* @return {Number} widthBeforeCursor width before cursor
|
|
25058
25163
|
*/
|
|
25059
25164
|
_getWidthBeforeCursor(lineIndex, charIndex) {
|
|
25060
25165
|
let widthBeforeCursor = this._getLineLeftOffset(lineIndex),
|
|
@@ -25066,11 +25171,11 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
25066
25171
|
return widthBeforeCursor;
|
|
25067
25172
|
}
|
|
25068
25173
|
|
|
25069
|
-
/**
|
|
25070
|
-
* Gets start offset of a selection
|
|
25071
|
-
* @param {KeyboardEvent} e Event object
|
|
25072
|
-
* @param {Boolean} isRight
|
|
25073
|
-
* @return {Number}
|
|
25174
|
+
/**
|
|
25175
|
+
* Gets start offset of a selection
|
|
25176
|
+
* @param {KeyboardEvent} e Event object
|
|
25177
|
+
* @param {Boolean} isRight
|
|
25178
|
+
* @return {Number}
|
|
25074
25179
|
*/
|
|
25075
25180
|
getDownCursorOffset(e, isRight) {
|
|
25076
25181
|
const selectionProp = this._getSelectionForOffset(e, isRight),
|
|
@@ -25088,12 +25193,12 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
25088
25193
|
return textAfterCursor.length + indexOnOtherLine + 1 + this.missingNewlineOffset(lineIndex);
|
|
25089
25194
|
}
|
|
25090
25195
|
|
|
25091
|
-
/**
|
|
25092
|
-
* private
|
|
25093
|
-
* Helps finding if the offset should be counted from Start or End
|
|
25094
|
-
* @param {KeyboardEvent} e Event object
|
|
25095
|
-
* @param {Boolean} isRight
|
|
25096
|
-
* @return {Number}
|
|
25196
|
+
/**
|
|
25197
|
+
* private
|
|
25198
|
+
* Helps finding if the offset should be counted from Start or End
|
|
25199
|
+
* @param {KeyboardEvent} e Event object
|
|
25200
|
+
* @param {Boolean} isRight
|
|
25201
|
+
* @return {Number}
|
|
25097
25202
|
*/
|
|
25098
25203
|
_getSelectionForOffset(e, isRight) {
|
|
25099
25204
|
if (e.shiftKey && this.selectionStart !== this.selectionEnd && isRight) {
|
|
@@ -25103,10 +25208,10 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
25103
25208
|
}
|
|
25104
25209
|
}
|
|
25105
25210
|
|
|
25106
|
-
/**
|
|
25107
|
-
* @param {KeyboardEvent} e Event object
|
|
25108
|
-
* @param {Boolean} isRight
|
|
25109
|
-
* @return {Number}
|
|
25211
|
+
/**
|
|
25212
|
+
* @param {KeyboardEvent} e Event object
|
|
25213
|
+
* @param {Boolean} isRight
|
|
25214
|
+
* @return {Number}
|
|
25110
25215
|
*/
|
|
25111
25216
|
getUpCursorOffset(e, isRight) {
|
|
25112
25217
|
const selectionProp = this._getSelectionForOffset(e, isRight),
|
|
@@ -25125,9 +25230,9 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
25125
25230
|
return -this._textLines[lineIndex - 1].length + indexOnOtherLine - textBeforeCursor.length + (1 - missingNewlineOffset);
|
|
25126
25231
|
}
|
|
25127
25232
|
|
|
25128
|
-
/**
|
|
25129
|
-
* for a given width it founds the matching character.
|
|
25130
|
-
* @private
|
|
25233
|
+
/**
|
|
25234
|
+
* for a given width it founds the matching character.
|
|
25235
|
+
* @private
|
|
25131
25236
|
*/
|
|
25132
25237
|
_getIndexOnLine(lineIndex, width) {
|
|
25133
25238
|
const line = this._textLines[lineIndex],
|
|
@@ -25157,9 +25262,9 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
25157
25262
|
return indexOnLine;
|
|
25158
25263
|
}
|
|
25159
25264
|
|
|
25160
|
-
/**
|
|
25161
|
-
* Moves cursor down
|
|
25162
|
-
* @param {KeyboardEvent} e Event object
|
|
25265
|
+
/**
|
|
25266
|
+
* Moves cursor down
|
|
25267
|
+
* @param {KeyboardEvent} e Event object
|
|
25163
25268
|
*/
|
|
25164
25269
|
moveCursorDown(e) {
|
|
25165
25270
|
if (this.selectionStart >= this._text.length && this.selectionEnd >= this._text.length) {
|
|
@@ -25168,9 +25273,9 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
25168
25273
|
this._moveCursorUpOrDown('Down', e);
|
|
25169
25274
|
}
|
|
25170
25275
|
|
|
25171
|
-
/**
|
|
25172
|
-
* Moves cursor up
|
|
25173
|
-
* @param {KeyboardEvent} e Event object
|
|
25276
|
+
/**
|
|
25277
|
+
* Moves cursor up
|
|
25278
|
+
* @param {KeyboardEvent} e Event object
|
|
25174
25279
|
*/
|
|
25175
25280
|
moveCursorUp(e) {
|
|
25176
25281
|
if (this.selectionStart === 0 && this.selectionEnd === 0) {
|
|
@@ -25179,10 +25284,10 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
25179
25284
|
this._moveCursorUpOrDown('Up', e);
|
|
25180
25285
|
}
|
|
25181
25286
|
|
|
25182
|
-
/**
|
|
25183
|
-
* Moves cursor up or down, fires the events
|
|
25184
|
-
* @param {String} direction 'Up' or 'Down'
|
|
25185
|
-
* @param {KeyboardEvent} e Event object
|
|
25287
|
+
/**
|
|
25288
|
+
* Moves cursor up or down, fires the events
|
|
25289
|
+
* @param {String} direction 'Up' or 'Down'
|
|
25290
|
+
* @param {KeyboardEvent} e Event object
|
|
25186
25291
|
*/
|
|
25187
25292
|
_moveCursorUpOrDown(direction, e) {
|
|
25188
25293
|
const offset = this[`get${direction}CursorOffset`](e, this._selectionDirection === RIGHT);
|
|
@@ -25204,9 +25309,9 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
25204
25309
|
}
|
|
25205
25310
|
}
|
|
25206
25311
|
|
|
25207
|
-
/**
|
|
25208
|
-
* Moves cursor with shift
|
|
25209
|
-
* @param {Number} offset
|
|
25312
|
+
/**
|
|
25313
|
+
* Moves cursor with shift
|
|
25314
|
+
* @param {Number} offset
|
|
25210
25315
|
*/
|
|
25211
25316
|
moveCursorWithShift(offset) {
|
|
25212
25317
|
const newSelection = this._selectionDirection === LEFT ? this.selectionStart + offset : this.selectionEnd + offset;
|
|
@@ -25214,9 +25319,9 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
25214
25319
|
return offset !== 0;
|
|
25215
25320
|
}
|
|
25216
25321
|
|
|
25217
|
-
/**
|
|
25218
|
-
* Moves cursor up without shift
|
|
25219
|
-
* @param {Number} offset
|
|
25322
|
+
/**
|
|
25323
|
+
* Moves cursor up without shift
|
|
25324
|
+
* @param {Number} offset
|
|
25220
25325
|
*/
|
|
25221
25326
|
moveCursorWithoutShift(offset) {
|
|
25222
25327
|
if (offset < 0) {
|
|
@@ -25229,9 +25334,9 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
25229
25334
|
return offset !== 0;
|
|
25230
25335
|
}
|
|
25231
25336
|
|
|
25232
|
-
/**
|
|
25233
|
-
* Moves cursor left
|
|
25234
|
-
* @param {KeyboardEvent} e Event object
|
|
25337
|
+
/**
|
|
25338
|
+
* Moves cursor left
|
|
25339
|
+
* @param {KeyboardEvent} e Event object
|
|
25235
25340
|
*/
|
|
25236
25341
|
moveCursorLeft(e) {
|
|
25237
25342
|
if (this.selectionStart === 0 && this.selectionEnd === 0) {
|
|
@@ -25240,11 +25345,11 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
25240
25345
|
this._moveCursorLeftOrRight('Left', e);
|
|
25241
25346
|
}
|
|
25242
25347
|
|
|
25243
|
-
/**
|
|
25244
|
-
* @private
|
|
25245
|
-
* @return {Boolean} true if a change happened
|
|
25246
|
-
*
|
|
25247
|
-
* @todo refactor not to use method name composition
|
|
25348
|
+
/**
|
|
25349
|
+
* @private
|
|
25350
|
+
* @return {Boolean} true if a change happened
|
|
25351
|
+
*
|
|
25352
|
+
* @todo refactor not to use method name composition
|
|
25248
25353
|
*/
|
|
25249
25354
|
_move(e, prop, direction) {
|
|
25250
25355
|
let newValue;
|
|
@@ -25263,23 +25368,23 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
25263
25368
|
return false;
|
|
25264
25369
|
}
|
|
25265
25370
|
|
|
25266
|
-
/**
|
|
25267
|
-
* @private
|
|
25371
|
+
/**
|
|
25372
|
+
* @private
|
|
25268
25373
|
*/
|
|
25269
25374
|
_moveLeft(e, prop) {
|
|
25270
25375
|
return this._move(e, prop, 'Left');
|
|
25271
25376
|
}
|
|
25272
25377
|
|
|
25273
|
-
/**
|
|
25274
|
-
* @private
|
|
25378
|
+
/**
|
|
25379
|
+
* @private
|
|
25275
25380
|
*/
|
|
25276
25381
|
_moveRight(e, prop) {
|
|
25277
25382
|
return this._move(e, prop, 'Right');
|
|
25278
25383
|
}
|
|
25279
25384
|
|
|
25280
|
-
/**
|
|
25281
|
-
* Moves cursor left without keeping selection
|
|
25282
|
-
* @param {KeyboardEvent} e
|
|
25385
|
+
/**
|
|
25386
|
+
* Moves cursor left without keeping selection
|
|
25387
|
+
* @param {KeyboardEvent} e
|
|
25283
25388
|
*/
|
|
25284
25389
|
moveCursorLeftWithoutShift(e) {
|
|
25285
25390
|
let change = true;
|
|
@@ -25294,9 +25399,9 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
25294
25399
|
return change;
|
|
25295
25400
|
}
|
|
25296
25401
|
|
|
25297
|
-
/**
|
|
25298
|
-
* Moves cursor left while keeping selection
|
|
25299
|
-
* @param {KeyboardEvent} e
|
|
25402
|
+
/**
|
|
25403
|
+
* Moves cursor left while keeping selection
|
|
25404
|
+
* @param {KeyboardEvent} e
|
|
25300
25405
|
*/
|
|
25301
25406
|
moveCursorLeftWithShift(e) {
|
|
25302
25407
|
if (this._selectionDirection === RIGHT && this.selectionStart !== this.selectionEnd) {
|
|
@@ -25307,9 +25412,9 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
25307
25412
|
}
|
|
25308
25413
|
}
|
|
25309
25414
|
|
|
25310
|
-
/**
|
|
25311
|
-
* Moves cursor right
|
|
25312
|
-
* @param {KeyboardEvent} e Event object
|
|
25415
|
+
/**
|
|
25416
|
+
* Moves cursor right
|
|
25417
|
+
* @param {KeyboardEvent} e Event object
|
|
25313
25418
|
*/
|
|
25314
25419
|
moveCursorRight(e) {
|
|
25315
25420
|
if (this.selectionStart >= this._text.length && this.selectionEnd >= this._text.length) {
|
|
@@ -25318,10 +25423,10 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
25318
25423
|
this._moveCursorLeftOrRight('Right', e);
|
|
25319
25424
|
}
|
|
25320
25425
|
|
|
25321
|
-
/**
|
|
25322
|
-
* Moves cursor right or Left, fires event
|
|
25323
|
-
* @param {String} direction 'Left', 'Right'
|
|
25324
|
-
* @param {KeyboardEvent} e Event object
|
|
25426
|
+
/**
|
|
25427
|
+
* Moves cursor right or Left, fires event
|
|
25428
|
+
* @param {String} direction 'Left', 'Right'
|
|
25429
|
+
* @param {KeyboardEvent} e Event object
|
|
25325
25430
|
*/
|
|
25326
25431
|
_moveCursorLeftOrRight(direction, e) {
|
|
25327
25432
|
const actionName = `moveCursor${direction}${e.shiftKey ? 'WithShift' : 'WithoutShift'}`;
|
|
@@ -25336,9 +25441,9 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
25336
25441
|
}
|
|
25337
25442
|
}
|
|
25338
25443
|
|
|
25339
|
-
/**
|
|
25340
|
-
* Moves cursor right while keeping selection
|
|
25341
|
-
* @param {KeyboardEvent} e
|
|
25444
|
+
/**
|
|
25445
|
+
* Moves cursor right while keeping selection
|
|
25446
|
+
* @param {KeyboardEvent} e
|
|
25342
25447
|
*/
|
|
25343
25448
|
moveCursorRightWithShift(e) {
|
|
25344
25449
|
if (this._selectionDirection === LEFT && this.selectionStart !== this.selectionEnd) {
|
|
@@ -25349,9 +25454,9 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
25349
25454
|
}
|
|
25350
25455
|
}
|
|
25351
25456
|
|
|
25352
|
-
/**
|
|
25353
|
-
* Moves cursor right without keeping selection
|
|
25354
|
-
* @param {KeyboardEvent} e Event object
|
|
25457
|
+
/**
|
|
25458
|
+
* Moves cursor right without keeping selection
|
|
25459
|
+
* @param {KeyboardEvent} e Event object
|
|
25355
25460
|
*/
|
|
25356
25461
|
moveCursorRightWithoutShift(e) {
|
|
25357
25462
|
let changed = true;
|
|
@@ -25366,8 +25471,8 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
25366
25471
|
}
|
|
25367
25472
|
}
|
|
25368
25473
|
|
|
25369
|
-
/**
|
|
25370
|
-
* `LEFT_CLICK === 0`
|
|
25474
|
+
/**
|
|
25475
|
+
* `LEFT_CLICK === 0`
|
|
25371
25476
|
*/
|
|
25372
25477
|
const notALeftClick = e => !!e.button;
|
|
25373
25478
|
class ITextClickBehavior extends ITextKeyBehavior {
|
|
@@ -25385,36 +25490,36 @@ class ITextClickBehavior extends ITextKeyBehavior {
|
|
|
25385
25490
|
super.initBehavior();
|
|
25386
25491
|
}
|
|
25387
25492
|
|
|
25388
|
-
/**
|
|
25389
|
-
* If this method returns true a mouse move operation over a text selection
|
|
25390
|
-
* will not prevent the native mouse event allowing the browser to start a drag operation.
|
|
25391
|
-
* shouldStartDragging can be read 'do not prevent default for mouse move event'
|
|
25392
|
-
* To prevent drag and drop between objects both shouldStartDragging and onDragStart should return false
|
|
25393
|
-
* @returns
|
|
25493
|
+
/**
|
|
25494
|
+
* If this method returns true a mouse move operation over a text selection
|
|
25495
|
+
* will not prevent the native mouse event allowing the browser to start a drag operation.
|
|
25496
|
+
* shouldStartDragging can be read 'do not prevent default for mouse move event'
|
|
25497
|
+
* To prevent drag and drop between objects both shouldStartDragging and onDragStart should return false
|
|
25498
|
+
* @returns
|
|
25394
25499
|
*/
|
|
25395
25500
|
shouldStartDragging() {
|
|
25396
25501
|
return this.draggableTextDelegate.isActive();
|
|
25397
25502
|
}
|
|
25398
25503
|
|
|
25399
|
-
/**
|
|
25400
|
-
* @public override this method to control whether instance should/shouldn't become a drag source,
|
|
25401
|
-
* @see also {@link DraggableTextDelegate#isActive}
|
|
25402
|
-
* To prevent drag and drop between objects both shouldStartDragging and onDragStart should return false
|
|
25403
|
-
* @returns {boolean} should handle event
|
|
25504
|
+
/**
|
|
25505
|
+
* @public override this method to control whether instance should/shouldn't become a drag source,
|
|
25506
|
+
* @see also {@link DraggableTextDelegate#isActive}
|
|
25507
|
+
* To prevent drag and drop between objects both shouldStartDragging and onDragStart should return false
|
|
25508
|
+
* @returns {boolean} should handle event
|
|
25404
25509
|
*/
|
|
25405
25510
|
onDragStart(e) {
|
|
25406
25511
|
return this.draggableTextDelegate.onDragStart(e);
|
|
25407
25512
|
}
|
|
25408
25513
|
|
|
25409
|
-
/**
|
|
25410
|
-
* @public override this method to control whether instance should/shouldn't become a drop target
|
|
25514
|
+
/**
|
|
25515
|
+
* @public override this method to control whether instance should/shouldn't become a drop target
|
|
25411
25516
|
*/
|
|
25412
25517
|
canDrop(e) {
|
|
25413
25518
|
return this.draggableTextDelegate.canDrop(e);
|
|
25414
25519
|
}
|
|
25415
25520
|
|
|
25416
|
-
/**
|
|
25417
|
-
* Default handler for double click, select a word or enter overlay editing
|
|
25521
|
+
/**
|
|
25522
|
+
* Default handler for double click, select a word or enter overlay editing
|
|
25418
25523
|
*/
|
|
25419
25524
|
doubleClickHandler(options) {
|
|
25420
25525
|
// Check if we should enter overlay editing mode
|
|
@@ -25431,8 +25536,8 @@ class ITextClickBehavior extends ITextKeyBehavior {
|
|
|
25431
25536
|
this.renderCursorOrSelection();
|
|
25432
25537
|
}
|
|
25433
25538
|
|
|
25434
|
-
/**
|
|
25435
|
-
* Default handler for triple click, select a line
|
|
25539
|
+
/**
|
|
25540
|
+
* Default handler for triple click, select a line
|
|
25436
25541
|
*/
|
|
25437
25542
|
tripleClickHandler(options) {
|
|
25438
25543
|
if (!this.isEditing) {
|
|
@@ -25442,13 +25547,13 @@ class ITextClickBehavior extends ITextKeyBehavior {
|
|
|
25442
25547
|
this.renderCursorOrSelection();
|
|
25443
25548
|
}
|
|
25444
25549
|
|
|
25445
|
-
/**
|
|
25446
|
-
* Default event handler for the basic functionalities needed on _mouseDown
|
|
25447
|
-
* can be overridden to do something different.
|
|
25448
|
-
* Scope of this implementation is: find the click position, set selectionStart
|
|
25449
|
-
* find selectionEnd, initialize the drawing of either cursor or selection area
|
|
25450
|
-
* initializing a mousedDown on a text area will cancel fabricjs knowledge of
|
|
25451
|
-
* current compositionMode. It will be set to false.
|
|
25550
|
+
/**
|
|
25551
|
+
* Default event handler for the basic functionalities needed on _mouseDown
|
|
25552
|
+
* can be overridden to do something different.
|
|
25553
|
+
* Scope of this implementation is: find the click position, set selectionStart
|
|
25554
|
+
* find selectionEnd, initialize the drawing of either cursor or selection area
|
|
25555
|
+
* initializing a mousedDown on a text area will cancel fabricjs knowledge of
|
|
25556
|
+
* current compositionMode. It will be set to false.
|
|
25452
25557
|
*/
|
|
25453
25558
|
_mouseDownHandler(_ref) {
|
|
25454
25559
|
let {
|
|
@@ -25476,9 +25581,9 @@ class ITextClickBehavior extends ITextKeyBehavior {
|
|
|
25476
25581
|
this.selected || (this.selected = alreadySelected || this.isEditing);
|
|
25477
25582
|
}
|
|
25478
25583
|
|
|
25479
|
-
/**
|
|
25480
|
-
* standard handler for mouse up, overridable
|
|
25481
|
-
* @private
|
|
25584
|
+
/**
|
|
25585
|
+
* standard handler for mouse up, overridable
|
|
25586
|
+
* @private
|
|
25482
25587
|
*/
|
|
25483
25588
|
mouseUpHandler(_ref2) {
|
|
25484
25589
|
let {
|
|
@@ -25509,9 +25614,9 @@ class ITextClickBehavior extends ITextKeyBehavior {
|
|
|
25509
25614
|
}
|
|
25510
25615
|
}
|
|
25511
25616
|
|
|
25512
|
-
/**
|
|
25513
|
-
* Changes cursor location in a text depending on passed pointer (x/y) object
|
|
25514
|
-
* @param {TPointerEvent} e Event object
|
|
25617
|
+
/**
|
|
25618
|
+
* Changes cursor location in a text depending on passed pointer (x/y) object
|
|
25619
|
+
* @param {TPointerEvent} e Event object
|
|
25515
25620
|
*/
|
|
25516
25621
|
setCursorByClick(e) {
|
|
25517
25622
|
const newSelection = this.getSelectionStartFromPointer(e),
|
|
@@ -25529,10 +25634,10 @@ class ITextClickBehavior extends ITextKeyBehavior {
|
|
|
25529
25634
|
}
|
|
25530
25635
|
}
|
|
25531
25636
|
|
|
25532
|
-
/**
|
|
25533
|
-
* Returns index of a character corresponding to where an object was clicked
|
|
25534
|
-
* @param {TPointerEvent} e Event object
|
|
25535
|
-
* @return {Number} Index of a character
|
|
25637
|
+
/**
|
|
25638
|
+
* Returns index of a character corresponding to where an object was clicked
|
|
25639
|
+
* @param {TPointerEvent} e Event object
|
|
25640
|
+
* @return {Number} Index of a character
|
|
25536
25641
|
*/
|
|
25537
25642
|
getSelectionStartFromPointer(e) {
|
|
25538
25643
|
const mouseOffset = this.canvas.getScenePoint(e).transform(invertTransform(this.calcTransformMatrix())).add(new Point(-this._getLeftOffset(), -this._getTopOffset()));
|
|
@@ -25578,15 +25683,15 @@ class ITextClickBehavior extends ITextKeyBehavior {
|
|
|
25578
25683
|
}
|
|
25579
25684
|
}
|
|
25580
25685
|
|
|
25581
|
-
/**
|
|
25582
|
-
* Hit Testing and Cursor Positioning System
|
|
25583
|
-
*
|
|
25584
|
-
* Maps pointer coordinates to text positions and provides cursor rectangles
|
|
25585
|
-
* for interactive text editing with grapheme-aware boundaries.
|
|
25686
|
+
/**
|
|
25687
|
+
* Hit Testing and Cursor Positioning System
|
|
25688
|
+
*
|
|
25689
|
+
* Maps pointer coordinates to text positions and provides cursor rectangles
|
|
25690
|
+
* for interactive text editing with grapheme-aware boundaries.
|
|
25586
25691
|
*/
|
|
25587
25692
|
|
|
25588
|
-
/**
|
|
25589
|
-
* Hit test a point against laid out text to find insertion position
|
|
25693
|
+
/**
|
|
25694
|
+
* Hit test a point against laid out text to find insertion position
|
|
25590
25695
|
*/
|
|
25591
25696
|
function hitTest(x, y, layout, options) {
|
|
25592
25697
|
if (layout.lines.length === 0) {
|
|
@@ -25630,8 +25735,8 @@ function hitTest(x, y, layout, options) {
|
|
|
25630
25735
|
};
|
|
25631
25736
|
}
|
|
25632
25737
|
|
|
25633
|
-
/**
|
|
25634
|
-
* Get cursor rectangle for a given insertion index
|
|
25738
|
+
/**
|
|
25739
|
+
* Get cursor rectangle for a given insertion index
|
|
25635
25740
|
*/
|
|
25636
25741
|
function getCursorRect(insertionIndex, layout, options) {
|
|
25637
25742
|
if (layout.lines.length === 0) {
|
|
@@ -25678,8 +25783,8 @@ function getCursorRect(insertionIndex, layout, options) {
|
|
|
25678
25783
|
|
|
25679
25784
|
// Private helper functions
|
|
25680
25785
|
|
|
25681
|
-
/**
|
|
25682
|
-
* Find which line contains the given Y coordinate
|
|
25786
|
+
/**
|
|
25787
|
+
* Find which line contains the given Y coordinate
|
|
25683
25788
|
*/
|
|
25684
25789
|
function findLineAtY(y, lines) {
|
|
25685
25790
|
var _lines;
|
|
@@ -25702,8 +25807,8 @@ function findLineAtY(y, lines) {
|
|
|
25702
25807
|
};
|
|
25703
25808
|
}
|
|
25704
25809
|
|
|
25705
|
-
/**
|
|
25706
|
-
* Find character position within a line at given X coordinate
|
|
25810
|
+
/**
|
|
25811
|
+
* Find character position within a line at given X coordinate
|
|
25707
25812
|
*/
|
|
25708
25813
|
function findCharAtX(x, line, options) {
|
|
25709
25814
|
if (line.bounds.length === 0) {
|
|
@@ -25809,8 +25914,8 @@ function findCharAtX(x, line, options) {
|
|
|
25809
25914
|
};
|
|
25810
25915
|
}
|
|
25811
25916
|
|
|
25812
|
-
/**
|
|
25813
|
-
* Calculate total insertion index from line and character indices
|
|
25917
|
+
/**
|
|
25918
|
+
* Calculate total insertion index from line and character indices
|
|
25814
25919
|
*/
|
|
25815
25920
|
function calculateInsertionIndex(lineIndex, graphemeIndex, layout) {
|
|
25816
25921
|
let insertionIndex = 0;
|
|
@@ -25829,8 +25934,8 @@ function calculateInsertionIndex(lineIndex, graphemeIndex, layout) {
|
|
|
25829
25934
|
return insertionIndex;
|
|
25830
25935
|
}
|
|
25831
25936
|
|
|
25832
|
-
/**
|
|
25833
|
-
* Find line and grapheme position from insertion index
|
|
25937
|
+
/**
|
|
25938
|
+
* Find line and grapheme position from insertion index
|
|
25834
25939
|
*/
|
|
25835
25940
|
function findPositionFromIndex(insertionIndex, layout) {
|
|
25836
25941
|
let currentIndex = 0;
|
|
@@ -25872,8 +25977,8 @@ function findPositionFromIndex(insertionIndex, layout) {
|
|
|
25872
25977
|
};
|
|
25873
25978
|
}
|
|
25874
25979
|
|
|
25875
|
-
/**
|
|
25876
|
-
* Calculate Y position of a line
|
|
25980
|
+
/**
|
|
25981
|
+
* Calculate Y position of a line
|
|
25877
25982
|
*/
|
|
25878
25983
|
function calculateLineY(lineIndex, layout, options) {
|
|
25879
25984
|
let y = 0;
|
|
@@ -25976,48 +26081,48 @@ const iTextDefaultValues = {
|
|
|
25976
26081
|
|
|
25977
26082
|
// @TODO this is not complete
|
|
25978
26083
|
|
|
25979
|
-
/**
|
|
25980
|
-
* @fires changed
|
|
25981
|
-
* @fires selection:changed
|
|
25982
|
-
* @fires editing:entered
|
|
25983
|
-
* @fires editing:exited
|
|
25984
|
-
* @fires dragstart
|
|
25985
|
-
* @fires drag drag event firing on the drag source
|
|
25986
|
-
* @fires dragend
|
|
25987
|
-
* @fires copy
|
|
25988
|
-
* @fires cut
|
|
25989
|
-
* @fires paste
|
|
25990
|
-
*
|
|
25991
|
-
* #### Supported key combinations
|
|
25992
|
-
* ```
|
|
25993
|
-
* Move cursor: left, right, up, down
|
|
25994
|
-
* Select character: shift + left, shift + right
|
|
25995
|
-
* Select text vertically: shift + up, shift + down
|
|
25996
|
-
* Move cursor by word: alt + left, alt + right
|
|
25997
|
-
* Select words: shift + alt + left, shift + alt + right
|
|
25998
|
-
* Move cursor to line start/end: cmd + left, cmd + right or home, end
|
|
25999
|
-
* Select till start/end of line: cmd + shift + left, cmd + shift + right or shift + home, shift + end
|
|
26000
|
-
* Jump to start/end of text: cmd + up, cmd + down
|
|
26001
|
-
* Select till start/end of text: cmd + shift + up, cmd + shift + down or shift + pgUp, shift + pgDown
|
|
26002
|
-
* Delete character: backspace
|
|
26003
|
-
* Delete word: alt + backspace
|
|
26004
|
-
* Delete line: cmd + backspace
|
|
26005
|
-
* Forward delete: delete
|
|
26006
|
-
* Copy text: ctrl/cmd + c
|
|
26007
|
-
* Paste text: ctrl/cmd + v
|
|
26008
|
-
* Cut text: ctrl/cmd + x
|
|
26009
|
-
* Select entire text: ctrl/cmd + a
|
|
26010
|
-
* Quit editing tab or esc
|
|
26011
|
-
* ```
|
|
26012
|
-
*
|
|
26013
|
-
* #### Supported mouse/touch combination
|
|
26014
|
-
* ```
|
|
26015
|
-
* Position cursor: click/touch
|
|
26016
|
-
* Create selection: click/touch & drag
|
|
26017
|
-
* Create selection: click & shift + click
|
|
26018
|
-
* Select word: double click
|
|
26019
|
-
* Select line: triple click
|
|
26020
|
-
* ```
|
|
26084
|
+
/**
|
|
26085
|
+
* @fires changed
|
|
26086
|
+
* @fires selection:changed
|
|
26087
|
+
* @fires editing:entered
|
|
26088
|
+
* @fires editing:exited
|
|
26089
|
+
* @fires dragstart
|
|
26090
|
+
* @fires drag drag event firing on the drag source
|
|
26091
|
+
* @fires dragend
|
|
26092
|
+
* @fires copy
|
|
26093
|
+
* @fires cut
|
|
26094
|
+
* @fires paste
|
|
26095
|
+
*
|
|
26096
|
+
* #### Supported key combinations
|
|
26097
|
+
* ```
|
|
26098
|
+
* Move cursor: left, right, up, down
|
|
26099
|
+
* Select character: shift + left, shift + right
|
|
26100
|
+
* Select text vertically: shift + up, shift + down
|
|
26101
|
+
* Move cursor by word: alt + left, alt + right
|
|
26102
|
+
* Select words: shift + alt + left, shift + alt + right
|
|
26103
|
+
* Move cursor to line start/end: cmd + left, cmd + right or home, end
|
|
26104
|
+
* Select till start/end of line: cmd + shift + left, cmd + shift + right or shift + home, shift + end
|
|
26105
|
+
* Jump to start/end of text: cmd + up, cmd + down
|
|
26106
|
+
* Select till start/end of text: cmd + shift + up, cmd + shift + down or shift + pgUp, shift + pgDown
|
|
26107
|
+
* Delete character: backspace
|
|
26108
|
+
* Delete word: alt + backspace
|
|
26109
|
+
* Delete line: cmd + backspace
|
|
26110
|
+
* Forward delete: delete
|
|
26111
|
+
* Copy text: ctrl/cmd + c
|
|
26112
|
+
* Paste text: ctrl/cmd + v
|
|
26113
|
+
* Cut text: ctrl/cmd + x
|
|
26114
|
+
* Select entire text: ctrl/cmd + a
|
|
26115
|
+
* Quit editing tab or esc
|
|
26116
|
+
* ```
|
|
26117
|
+
*
|
|
26118
|
+
* #### Supported mouse/touch combination
|
|
26119
|
+
* ```
|
|
26120
|
+
* Position cursor: click/touch
|
|
26121
|
+
* Create selection: click/touch & drag
|
|
26122
|
+
* Create selection: click & shift + click
|
|
26123
|
+
* Select word: double click
|
|
26124
|
+
* Select line: triple click
|
|
26125
|
+
* ```
|
|
26021
26126
|
*/
|
|
26022
26127
|
class IText extends ITextClickBehavior {
|
|
26023
26128
|
static getDefaults() {
|
|
@@ -26032,10 +26137,10 @@ class IText extends ITextClickBehavior {
|
|
|
26032
26137
|
return type === 'itext' ? 'i-text' : type;
|
|
26033
26138
|
}
|
|
26034
26139
|
|
|
26035
|
-
/**
|
|
26036
|
-
* Constructor
|
|
26037
|
-
* @param {String} text Text string
|
|
26038
|
-
* @param {Object} [options] Options object
|
|
26140
|
+
/**
|
|
26141
|
+
* Constructor
|
|
26142
|
+
* @param {String} text Text string
|
|
26143
|
+
* @param {Object} [options] Options object
|
|
26039
26144
|
*/
|
|
26040
26145
|
constructor(text, options) {
|
|
26041
26146
|
super(text, {
|
|
@@ -26045,11 +26150,11 @@ class IText extends ITextClickBehavior {
|
|
|
26045
26150
|
this.initBehavior();
|
|
26046
26151
|
}
|
|
26047
26152
|
|
|
26048
|
-
/**
|
|
26049
|
-
* While editing handle differently
|
|
26050
|
-
* @private
|
|
26051
|
-
* @param {string} key
|
|
26052
|
-
* @param {*} value
|
|
26153
|
+
/**
|
|
26154
|
+
* While editing handle differently
|
|
26155
|
+
* @private
|
|
26156
|
+
* @param {string} key
|
|
26157
|
+
* @param {*} value
|
|
26053
26158
|
*/
|
|
26054
26159
|
_set(key, value) {
|
|
26055
26160
|
if (this.isEditing && this._savedProps && key in this._savedProps) {
|
|
@@ -26064,28 +26169,28 @@ class IText extends ITextClickBehavior {
|
|
|
26064
26169
|
return super._set(key, value);
|
|
26065
26170
|
}
|
|
26066
26171
|
|
|
26067
|
-
/**
|
|
26068
|
-
* Sets selection start (left boundary of a selection)
|
|
26069
|
-
* @param {Number} index Index to set selection start to
|
|
26172
|
+
/**
|
|
26173
|
+
* Sets selection start (left boundary of a selection)
|
|
26174
|
+
* @param {Number} index Index to set selection start to
|
|
26070
26175
|
*/
|
|
26071
26176
|
setSelectionStart(index) {
|
|
26072
26177
|
index = Math.max(index, 0);
|
|
26073
26178
|
this._updateAndFire('selectionStart', index);
|
|
26074
26179
|
}
|
|
26075
26180
|
|
|
26076
|
-
/**
|
|
26077
|
-
* Sets selection end (right boundary of a selection)
|
|
26078
|
-
* @param {Number} index Index to set selection end to
|
|
26181
|
+
/**
|
|
26182
|
+
* Sets selection end (right boundary of a selection)
|
|
26183
|
+
* @param {Number} index Index to set selection end to
|
|
26079
26184
|
*/
|
|
26080
26185
|
setSelectionEnd(index) {
|
|
26081
26186
|
index = Math.min(index, this.text.length);
|
|
26082
26187
|
this._updateAndFire('selectionEnd', index);
|
|
26083
26188
|
}
|
|
26084
26189
|
|
|
26085
|
-
/**
|
|
26086
|
-
* @private
|
|
26087
|
-
* @param {String} property 'selectionStart' or 'selectionEnd'
|
|
26088
|
-
* @param {Number} index new position of property
|
|
26190
|
+
/**
|
|
26191
|
+
* @private
|
|
26192
|
+
* @param {String} property 'selectionStart' or 'selectionEnd'
|
|
26193
|
+
* @param {Number} index new position of property
|
|
26089
26194
|
*/
|
|
26090
26195
|
_updateAndFire(property, index) {
|
|
26091
26196
|
if (this[property] !== index) {
|
|
@@ -26095,9 +26200,9 @@ class IText extends ITextClickBehavior {
|
|
|
26095
26200
|
this._updateTextarea();
|
|
26096
26201
|
}
|
|
26097
26202
|
|
|
26098
|
-
/**
|
|
26099
|
-
* Fires the even of selection changed
|
|
26100
|
-
* @private
|
|
26203
|
+
/**
|
|
26204
|
+
* Fires the even of selection changed
|
|
26205
|
+
* @private
|
|
26101
26206
|
*/
|
|
26102
26207
|
_fireSelectionChanged() {
|
|
26103
26208
|
this.fire('selection:changed');
|
|
@@ -26106,25 +26211,25 @@ class IText extends ITextClickBehavior {
|
|
|
26106
26211
|
});
|
|
26107
26212
|
}
|
|
26108
26213
|
|
|
26109
|
-
/**
|
|
26110
|
-
* Initialize text dimensions. Render all text on given context
|
|
26111
|
-
* or on a offscreen canvas to get the text width with measureText.
|
|
26112
|
-
* Updates this.width and this.height with the proper values.
|
|
26113
|
-
* Does not return dimensions.
|
|
26114
|
-
* @private
|
|
26214
|
+
/**
|
|
26215
|
+
* Initialize text dimensions. Render all text on given context
|
|
26216
|
+
* or on a offscreen canvas to get the text width with measureText.
|
|
26217
|
+
* Updates this.width and this.height with the proper values.
|
|
26218
|
+
* Does not return dimensions.
|
|
26219
|
+
* @private
|
|
26115
26220
|
*/
|
|
26116
26221
|
initDimensions() {
|
|
26117
26222
|
this.isEditing && this.initDelayedCursor();
|
|
26118
26223
|
super.initDimensions();
|
|
26119
26224
|
}
|
|
26120
26225
|
|
|
26121
|
-
/**
|
|
26122
|
-
* Gets style of a current selection/cursor (at the start position)
|
|
26123
|
-
* if startIndex or endIndex are not provided, selectionStart or selectionEnd will be used.
|
|
26124
|
-
* @param {Number} startIndex Start index to get styles at
|
|
26125
|
-
* @param {Number} endIndex End index to get styles at, if not specified selectionEnd or startIndex + 1
|
|
26126
|
-
* @param {Boolean} [complete] get full style or not
|
|
26127
|
-
* @return {Array} styles an array with one, zero or more Style objects
|
|
26226
|
+
/**
|
|
26227
|
+
* Gets style of a current selection/cursor (at the start position)
|
|
26228
|
+
* if startIndex or endIndex are not provided, selectionStart or selectionEnd will be used.
|
|
26229
|
+
* @param {Number} startIndex Start index to get styles at
|
|
26230
|
+
* @param {Number} endIndex End index to get styles at, if not specified selectionEnd or startIndex + 1
|
|
26231
|
+
* @param {Boolean} [complete] get full style or not
|
|
26232
|
+
* @return {Array} styles an array with one, zero or more Style objects
|
|
26128
26233
|
*/
|
|
26129
26234
|
getSelectionStyles() {
|
|
26130
26235
|
let startIndex = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.selectionStart || 0;
|
|
@@ -26133,11 +26238,11 @@ class IText extends ITextClickBehavior {
|
|
|
26133
26238
|
return super.getSelectionStyles(startIndex, endIndex, complete);
|
|
26134
26239
|
}
|
|
26135
26240
|
|
|
26136
|
-
/**
|
|
26137
|
-
* Sets style of a current selection, if no selection exist, do not set anything.
|
|
26138
|
-
* @param {Object} [styles] Styles object
|
|
26139
|
-
* @param {Number} [startIndex] Start index to get styles at
|
|
26140
|
-
* @param {Number} [endIndex] End index to get styles at, if not specified selectionEnd or startIndex + 1
|
|
26241
|
+
/**
|
|
26242
|
+
* Sets style of a current selection, if no selection exist, do not set anything.
|
|
26243
|
+
* @param {Object} [styles] Styles object
|
|
26244
|
+
* @param {Number} [startIndex] Start index to get styles at
|
|
26245
|
+
* @param {Number} [endIndex] End index to get styles at, if not specified selectionEnd or startIndex + 1
|
|
26141
26246
|
*/
|
|
26142
26247
|
setSelectionStyles(styles) {
|
|
26143
26248
|
let startIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.selectionStart || 0;
|
|
@@ -26145,10 +26250,10 @@ class IText extends ITextClickBehavior {
|
|
|
26145
26250
|
return super.setSelectionStyles(styles, startIndex, endIndex);
|
|
26146
26251
|
}
|
|
26147
26252
|
|
|
26148
|
-
/**
|
|
26149
|
-
* Returns 2d representation (lineIndex and charIndex) of cursor (or selection start)
|
|
26150
|
-
* @param {Number} [selectionStart] Optional index. When not given, current selectionStart is used.
|
|
26151
|
-
* @param {Boolean} [skipWrapping] consider the location for unwrapped lines. useful to manage styles.
|
|
26253
|
+
/**
|
|
26254
|
+
* Returns 2d representation (lineIndex and charIndex) of cursor (or selection start)
|
|
26255
|
+
* @param {Number} [selectionStart] Optional index. When not given, current selectionStart is used.
|
|
26256
|
+
* @param {Boolean} [skipWrapping] consider the location for unwrapped lines. useful to manage styles.
|
|
26152
26257
|
*/
|
|
26153
26258
|
get2DCursorLocation() {
|
|
26154
26259
|
let selectionStart = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.selectionStart;
|
|
@@ -26156,9 +26261,9 @@ class IText extends ITextClickBehavior {
|
|
|
26156
26261
|
return super.get2DCursorLocation(selectionStart, skipWrapping);
|
|
26157
26262
|
}
|
|
26158
26263
|
|
|
26159
|
-
/**
|
|
26160
|
-
* @private
|
|
26161
|
-
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
26264
|
+
/**
|
|
26265
|
+
* @private
|
|
26266
|
+
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
26162
26267
|
*/
|
|
26163
26268
|
render(ctx) {
|
|
26164
26269
|
super.render(ctx);
|
|
@@ -26168,9 +26273,9 @@ class IText extends ITextClickBehavior {
|
|
|
26168
26273
|
this.renderCursorOrSelection();
|
|
26169
26274
|
}
|
|
26170
26275
|
|
|
26171
|
-
/**
|
|
26172
|
-
* @override block cursor/selection logic while rendering the exported canvas
|
|
26173
|
-
* @todo this workaround should be replaced with a more robust solution
|
|
26276
|
+
/**
|
|
26277
|
+
* @override block cursor/selection logic while rendering the exported canvas
|
|
26278
|
+
* @todo this workaround should be replaced with a more robust solution
|
|
26174
26279
|
*/
|
|
26175
26280
|
toCanvasElement(options) {
|
|
26176
26281
|
const isEditing = this.isEditing;
|
|
@@ -26180,9 +26285,9 @@ class IText extends ITextClickBehavior {
|
|
|
26180
26285
|
return canvas;
|
|
26181
26286
|
}
|
|
26182
26287
|
|
|
26183
|
-
/**
|
|
26184
|
-
* Renders cursor or selection (depending on what exists)
|
|
26185
|
-
* it does on the contextTop. If contextTop is not available, do nothing.
|
|
26288
|
+
/**
|
|
26289
|
+
* Renders cursor or selection (depending on what exists)
|
|
26290
|
+
* it does on the contextTop. If contextTop is not available, do nothing.
|
|
26186
26291
|
*/
|
|
26187
26292
|
renderCursorOrSelection() {
|
|
26188
26293
|
if (!this.isEditing || !this.canvas) {
|
|
@@ -26238,12 +26343,12 @@ class IText extends ITextClickBehavior {
|
|
|
26238
26343
|
ctx.restore();
|
|
26239
26344
|
}
|
|
26240
26345
|
|
|
26241
|
-
/**
|
|
26242
|
-
* Finds and returns an array of clip paths that are applied to the parent
|
|
26243
|
-
* group(s) of the current FabricObject instance. The object's hierarchy is
|
|
26244
|
-
* traversed upwards (from the current object towards the root of the canvas),
|
|
26245
|
-
* checking each parent object for the presence of a `clipPath` that is not
|
|
26246
|
-
* absolutely positioned.
|
|
26346
|
+
/**
|
|
26347
|
+
* Finds and returns an array of clip paths that are applied to the parent
|
|
26348
|
+
* group(s) of the current FabricObject instance. The object's hierarchy is
|
|
26349
|
+
* traversed upwards (from the current object towards the root of the canvas),
|
|
26350
|
+
* checking each parent object for the presence of a `clipPath` that is not
|
|
26351
|
+
* absolutely positioned.
|
|
26247
26352
|
*/
|
|
26248
26353
|
findAncestorsWithClipPath() {
|
|
26249
26354
|
const clipPathAncestors = [];
|
|
@@ -26258,13 +26363,13 @@ class IText extends ITextClickBehavior {
|
|
|
26258
26363
|
return clipPathAncestors;
|
|
26259
26364
|
}
|
|
26260
26365
|
|
|
26261
|
-
/**
|
|
26262
|
-
* Returns cursor boundaries (left, top, leftOffset, topOffset)
|
|
26263
|
-
* left/top are left/top of entire text box
|
|
26264
|
-
* leftOffset/topOffset are offset from that left/top point of a text box
|
|
26265
|
-
* @private
|
|
26266
|
-
* @param {number} [index] index from start
|
|
26267
|
-
* @param {boolean} [skipCaching]
|
|
26366
|
+
/**
|
|
26367
|
+
* Returns cursor boundaries (left, top, leftOffset, topOffset)
|
|
26368
|
+
* left/top are left/top of entire text box
|
|
26369
|
+
* leftOffset/topOffset are offset from that left/top point of a text box
|
|
26370
|
+
* @private
|
|
26371
|
+
* @param {number} [index] index from start
|
|
26372
|
+
* @param {boolean} [skipCaching]
|
|
26268
26373
|
*/
|
|
26269
26374
|
_getCursorBoundaries() {
|
|
26270
26375
|
let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.selectionStart;
|
|
@@ -26278,11 +26383,11 @@ class IText extends ITextClickBehavior {
|
|
|
26278
26383
|
return this._getCursorBoundariesOriginal(index, skipCaching);
|
|
26279
26384
|
}
|
|
26280
26385
|
|
|
26281
|
-
/**
|
|
26282
|
-
* Caches and returns cursor left/top offset relative to instance's center point
|
|
26283
|
-
* @private
|
|
26284
|
-
* @param {number} index index from start
|
|
26285
|
-
* @param {boolean} [skipCaching]
|
|
26386
|
+
/**
|
|
26387
|
+
* Caches and returns cursor left/top offset relative to instance's center point
|
|
26388
|
+
* @private
|
|
26389
|
+
* @param {number} index index from start
|
|
26390
|
+
* @param {boolean} [skipCaching]
|
|
26286
26391
|
*/
|
|
26287
26392
|
_getCursorBoundariesOffsets(index, skipCaching) {
|
|
26288
26393
|
if (skipCaching) {
|
|
@@ -26294,9 +26399,9 @@ class IText extends ITextClickBehavior {
|
|
|
26294
26399
|
return this.cursorOffsetCache = this.__getCursorBoundariesOffsets(index);
|
|
26295
26400
|
}
|
|
26296
26401
|
|
|
26297
|
-
/**
|
|
26298
|
-
* Enhanced cursor boundaries using advanced hit testing when available
|
|
26299
|
-
* @private
|
|
26402
|
+
/**
|
|
26403
|
+
* Enhanced cursor boundaries using advanced hit testing when available
|
|
26404
|
+
* @private
|
|
26300
26405
|
*/
|
|
26301
26406
|
_getCursorBoundariesAdvanced(index) {
|
|
26302
26407
|
if (!this.enableAdvancedLayout || !this._layoutTextAdvanced) {
|
|
@@ -26312,9 +26417,9 @@ class IText extends ITextClickBehavior {
|
|
|
26312
26417
|
};
|
|
26313
26418
|
}
|
|
26314
26419
|
|
|
26315
|
-
/**
|
|
26316
|
-
* Enhanced selection start from pointer using BiDi-aware hit testing
|
|
26317
|
-
* @override
|
|
26420
|
+
/**
|
|
26421
|
+
* Enhanced selection start from pointer using BiDi-aware hit testing
|
|
26422
|
+
* @override
|
|
26318
26423
|
*/
|
|
26319
26424
|
getSelectionStartFromPointer(e) {
|
|
26320
26425
|
if (!this.enableAdvancedLayout || !this._layoutTextAdvanced) {
|
|
@@ -26328,9 +26433,9 @@ class IText extends ITextClickBehavior {
|
|
|
26328
26433
|
return Math.min(hitResult.charIndex, this._text.length);
|
|
26329
26434
|
}
|
|
26330
26435
|
|
|
26331
|
-
/**
|
|
26332
|
-
* Original cursor boundaries implementation
|
|
26333
|
-
* @private
|
|
26436
|
+
/**
|
|
26437
|
+
* Original cursor boundaries implementation
|
|
26438
|
+
* @private
|
|
26334
26439
|
*/
|
|
26335
26440
|
_getCursorBoundariesOriginal(index, skipCaching) {
|
|
26336
26441
|
const left = this._getLeftOffset(),
|
|
@@ -26344,10 +26449,10 @@ class IText extends ITextClickBehavior {
|
|
|
26344
26449
|
};
|
|
26345
26450
|
}
|
|
26346
26451
|
|
|
26347
|
-
/**
|
|
26348
|
-
* Calculates cursor left/top offset relative to instance's center point
|
|
26349
|
-
* @private
|
|
26350
|
-
* @param {number} index index from start
|
|
26452
|
+
/**
|
|
26453
|
+
* Calculates cursor left/top offset relative to instance's center point
|
|
26454
|
+
* @private
|
|
26455
|
+
* @param {number} index index from start
|
|
26351
26456
|
*/
|
|
26352
26457
|
__getCursorBoundariesOffsets(index) {
|
|
26353
26458
|
let topOffset = 0,
|
|
@@ -26381,29 +26486,29 @@ class IText extends ITextClickBehavior {
|
|
|
26381
26486
|
return boundaries;
|
|
26382
26487
|
}
|
|
26383
26488
|
|
|
26384
|
-
/**
|
|
26385
|
-
* Renders cursor on context Top, outside the animation cycle, on request
|
|
26386
|
-
* Used for the drag/drop effect.
|
|
26387
|
-
* If contextTop is not available, do nothing.
|
|
26489
|
+
/**
|
|
26490
|
+
* Renders cursor on context Top, outside the animation cycle, on request
|
|
26491
|
+
* Used for the drag/drop effect.
|
|
26492
|
+
* If contextTop is not available, do nothing.
|
|
26388
26493
|
*/
|
|
26389
26494
|
renderCursorAt(selectionStart) {
|
|
26390
26495
|
this._renderCursor(this.canvas.contextTop, this._getCursorBoundaries(selectionStart, true), selectionStart);
|
|
26391
26496
|
}
|
|
26392
26497
|
|
|
26393
|
-
/**
|
|
26394
|
-
* Renders cursor
|
|
26395
|
-
* @param {Object} boundaries
|
|
26396
|
-
* @param {CanvasRenderingContext2D} ctx transformed context to draw on
|
|
26498
|
+
/**
|
|
26499
|
+
* Renders cursor
|
|
26500
|
+
* @param {Object} boundaries
|
|
26501
|
+
* @param {CanvasRenderingContext2D} ctx transformed context to draw on
|
|
26397
26502
|
*/
|
|
26398
26503
|
renderCursor(ctx, boundaries) {
|
|
26399
26504
|
this._renderCursor(ctx, boundaries, this.selectionStart);
|
|
26400
26505
|
}
|
|
26401
26506
|
|
|
26402
|
-
/**
|
|
26403
|
-
* Return the data needed to render the cursor for given selection start
|
|
26404
|
-
* The left,top are relative to the object, while width and height are prescaled
|
|
26405
|
-
* to look think with canvas zoom and object scaling,
|
|
26406
|
-
* so they depend on canvas and object scaling
|
|
26507
|
+
/**
|
|
26508
|
+
* Return the data needed to render the cursor for given selection start
|
|
26509
|
+
* The left,top are relative to the object, while width and height are prescaled
|
|
26510
|
+
* to look think with canvas zoom and object scaling,
|
|
26511
|
+
* so they depend on canvas and object scaling
|
|
26407
26512
|
*/
|
|
26408
26513
|
getCursorRenderingData() {
|
|
26409
26514
|
let selectionStart = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.selectionStart;
|
|
@@ -26426,9 +26531,9 @@ class IText extends ITextClickBehavior {
|
|
|
26426
26531
|
};
|
|
26427
26532
|
}
|
|
26428
26533
|
|
|
26429
|
-
/**
|
|
26430
|
-
* Render the cursor at the given selectionStart.
|
|
26431
|
-
* @param {CanvasRenderingContext2D} ctx transformed context to draw on
|
|
26534
|
+
/**
|
|
26535
|
+
* Render the cursor at the given selectionStart.
|
|
26536
|
+
* @param {CanvasRenderingContext2D} ctx transformed context to draw on
|
|
26432
26537
|
*/
|
|
26433
26538
|
_renderCursor(ctx, boundaries, selectionStart) {
|
|
26434
26539
|
const {
|
|
@@ -26444,10 +26549,10 @@ class IText extends ITextClickBehavior {
|
|
|
26444
26549
|
ctx.fillRect(left, top, width, height);
|
|
26445
26550
|
}
|
|
26446
26551
|
|
|
26447
|
-
/**
|
|
26448
|
-
* Renders text selection
|
|
26449
|
-
* @param {Object} boundaries Object with left/top/leftOffset/topOffset
|
|
26450
|
-
* @param {CanvasRenderingContext2D} ctx transformed context to draw on
|
|
26552
|
+
/**
|
|
26553
|
+
* Renders text selection
|
|
26554
|
+
* @param {Object} boundaries Object with left/top/leftOffset/topOffset
|
|
26555
|
+
* @param {CanvasRenderingContext2D} ctx transformed context to draw on
|
|
26451
26556
|
*/
|
|
26452
26557
|
renderSelection(ctx, boundaries) {
|
|
26453
26558
|
const selection = {
|
|
@@ -26457,8 +26562,8 @@ class IText extends ITextClickBehavior {
|
|
|
26457
26562
|
this._renderSelection(ctx, selection, boundaries);
|
|
26458
26563
|
}
|
|
26459
26564
|
|
|
26460
|
-
/**
|
|
26461
|
-
* Renders drag start text selection
|
|
26565
|
+
/**
|
|
26566
|
+
* Renders drag start text selection
|
|
26462
26567
|
*/
|
|
26463
26568
|
renderDragSourceEffect() {
|
|
26464
26569
|
const dragStartSelection = this.draggableTextDelegate.getDragStartSelection();
|
|
@@ -26469,12 +26574,12 @@ class IText extends ITextClickBehavior {
|
|
|
26469
26574
|
this.renderCursorAt(dragSelection);
|
|
26470
26575
|
}
|
|
26471
26576
|
|
|
26472
|
-
/**
|
|
26473
|
-
* Renders text selection
|
|
26474
|
-
* @private
|
|
26475
|
-
* @param {{ selectionStart: number, selectionEnd: number }} selection
|
|
26476
|
-
* @param {Object} boundaries Object with left/top/leftOffset/topOffset
|
|
26477
|
-
* @param {CanvasRenderingContext2D} ctx transformed context to draw on
|
|
26577
|
+
/**
|
|
26578
|
+
* Renders text selection
|
|
26579
|
+
* @private
|
|
26580
|
+
* @param {{ selectionStart: number, selectionEnd: number }} selection
|
|
26581
|
+
* @param {Object} boundaries Object with left/top/leftOffset/topOffset
|
|
26582
|
+
* @param {CanvasRenderingContext2D} ctx transformed context to draw on
|
|
26478
26583
|
*/
|
|
26479
26584
|
_renderSelection(ctx, selection, boundaries) {
|
|
26480
26585
|
const selectionStart = selection.selectionStart,
|
|
@@ -26536,34 +26641,34 @@ class IText extends ITextClickBehavior {
|
|
|
26536
26641
|
}
|
|
26537
26642
|
}
|
|
26538
26643
|
|
|
26539
|
-
/**
|
|
26540
|
-
* High level function to know the height of the cursor.
|
|
26541
|
-
* the currentChar is the one that precedes the cursor
|
|
26542
|
-
* Returns fontSize of char at the current cursor
|
|
26543
|
-
* Unused from the library, is for the end user
|
|
26544
|
-
* @return {Number} Character font size
|
|
26644
|
+
/**
|
|
26645
|
+
* High level function to know the height of the cursor.
|
|
26646
|
+
* the currentChar is the one that precedes the cursor
|
|
26647
|
+
* Returns fontSize of char at the current cursor
|
|
26648
|
+
* Unused from the library, is for the end user
|
|
26649
|
+
* @return {Number} Character font size
|
|
26545
26650
|
*/
|
|
26546
26651
|
getCurrentCharFontSize() {
|
|
26547
26652
|
const cp = this._getCurrentCharIndex();
|
|
26548
26653
|
return this.getValueOfPropertyAt(cp.l, cp.c, 'fontSize');
|
|
26549
26654
|
}
|
|
26550
26655
|
|
|
26551
|
-
/**
|
|
26552
|
-
* High level function to know the color of the cursor.
|
|
26553
|
-
* the currentChar is the one that precedes the cursor
|
|
26554
|
-
* Returns color (fill) of char at the current cursor
|
|
26555
|
-
* if the text object has a pattern or gradient for filler, it will return that.
|
|
26556
|
-
* Unused by the library, is for the end user
|
|
26557
|
-
* @return {String | TFiller} Character color (fill)
|
|
26656
|
+
/**
|
|
26657
|
+
* High level function to know the color of the cursor.
|
|
26658
|
+
* the currentChar is the one that precedes the cursor
|
|
26659
|
+
* Returns color (fill) of char at the current cursor
|
|
26660
|
+
* if the text object has a pattern or gradient for filler, it will return that.
|
|
26661
|
+
* Unused by the library, is for the end user
|
|
26662
|
+
* @return {String | TFiller} Character color (fill)
|
|
26558
26663
|
*/
|
|
26559
26664
|
getCurrentCharColor() {
|
|
26560
26665
|
const cp = this._getCurrentCharIndex();
|
|
26561
26666
|
return this.getValueOfPropertyAt(cp.l, cp.c, FILL);
|
|
26562
26667
|
}
|
|
26563
26668
|
|
|
26564
|
-
/**
|
|
26565
|
-
* Returns the cursor position for the getCurrent.. functions
|
|
26566
|
-
* @private
|
|
26669
|
+
/**
|
|
26670
|
+
* Returns the cursor position for the getCurrent.. functions
|
|
26671
|
+
* @private
|
|
26567
26672
|
*/
|
|
26568
26673
|
_getCurrentCharIndex() {
|
|
26569
26674
|
const cursorPosition = this.get2DCursorLocation(this.selectionStart, true),
|
|
@@ -26579,52 +26684,52 @@ class IText extends ITextClickBehavior {
|
|
|
26579
26684
|
super.dispose();
|
|
26580
26685
|
}
|
|
26581
26686
|
}
|
|
26582
|
-
/**
|
|
26583
|
-
* Index where text selection starts (or where cursor is when there is no selection)
|
|
26584
|
-
* @type Number
|
|
26687
|
+
/**
|
|
26688
|
+
* Index where text selection starts (or where cursor is when there is no selection)
|
|
26689
|
+
* @type Number
|
|
26585
26690
|
*/
|
|
26586
|
-
/**
|
|
26587
|
-
* Index where text selection ends
|
|
26588
|
-
* @type Number
|
|
26691
|
+
/**
|
|
26692
|
+
* Index where text selection ends
|
|
26693
|
+
* @type Number
|
|
26589
26694
|
*/
|
|
26590
|
-
/**
|
|
26591
|
-
* Color of text selection
|
|
26592
|
-
* @type String
|
|
26695
|
+
/**
|
|
26696
|
+
* Color of text selection
|
|
26697
|
+
* @type String
|
|
26593
26698
|
*/
|
|
26594
|
-
/**
|
|
26595
|
-
* Indicates whether text is in editing mode
|
|
26596
|
-
* @type Boolean
|
|
26699
|
+
/**
|
|
26700
|
+
* Indicates whether text is in editing mode
|
|
26701
|
+
* @type Boolean
|
|
26597
26702
|
*/
|
|
26598
|
-
/**
|
|
26599
|
-
* Indicates whether a text can be edited
|
|
26600
|
-
* @type Boolean
|
|
26703
|
+
/**
|
|
26704
|
+
* Indicates whether a text can be edited
|
|
26705
|
+
* @type Boolean
|
|
26601
26706
|
*/
|
|
26602
|
-
/**
|
|
26603
|
-
* Border color of text object while it's in editing mode
|
|
26604
|
-
* @type String
|
|
26707
|
+
/**
|
|
26708
|
+
* Border color of text object while it's in editing mode
|
|
26709
|
+
* @type String
|
|
26605
26710
|
*/
|
|
26606
|
-
/**
|
|
26607
|
-
* Width of cursor (in px)
|
|
26608
|
-
* @type Number
|
|
26711
|
+
/**
|
|
26712
|
+
* Width of cursor (in px)
|
|
26713
|
+
* @type Number
|
|
26609
26714
|
*/
|
|
26610
|
-
/**
|
|
26611
|
-
* Color of text cursor color in editing mode.
|
|
26612
|
-
* if not set (default) will take color from the text.
|
|
26613
|
-
* if set to a color value that fabric can understand, it will
|
|
26614
|
-
* be used instead of the color of the text at the current position.
|
|
26615
|
-
* @type String
|
|
26715
|
+
/**
|
|
26716
|
+
* Color of text cursor color in editing mode.
|
|
26717
|
+
* if not set (default) will take color from the text.
|
|
26718
|
+
* if set to a color value that fabric can understand, it will
|
|
26719
|
+
* be used instead of the color of the text at the current position.
|
|
26720
|
+
* @type String
|
|
26616
26721
|
*/
|
|
26617
|
-
/**
|
|
26618
|
-
* Delay between cursor blink (in ms)
|
|
26619
|
-
* @type Number
|
|
26722
|
+
/**
|
|
26723
|
+
* Delay between cursor blink (in ms)
|
|
26724
|
+
* @type Number
|
|
26620
26725
|
*/
|
|
26621
|
-
/**
|
|
26622
|
-
* Duration of cursor fade in (in ms)
|
|
26623
|
-
* @type Number
|
|
26726
|
+
/**
|
|
26727
|
+
* Duration of cursor fade in (in ms)
|
|
26728
|
+
* @type Number
|
|
26624
26729
|
*/
|
|
26625
|
-
/**
|
|
26626
|
-
* Indicates whether internal text char widths can be cached
|
|
26627
|
-
* @type Boolean
|
|
26730
|
+
/**
|
|
26731
|
+
* Indicates whether internal text char widths can be cached
|
|
26732
|
+
* @type Boolean
|
|
26628
26733
|
*/
|
|
26629
26734
|
_defineProperty(IText, "ownDefaults", iTextDefaultValues);
|
|
26630
26735
|
_defineProperty(IText, "type", 'IText');
|
|
@@ -26646,11 +26751,11 @@ const textboxDefaultValues = {
|
|
|
26646
26751
|
|
|
26647
26752
|
// @TODO this is not complete
|
|
26648
26753
|
|
|
26649
|
-
/**
|
|
26650
|
-
* Textbox class, based on IText, allows the user to resize the text rectangle
|
|
26651
|
-
* and wraps lines automatically. Textboxes have their Y scaling locked, the
|
|
26652
|
-
* user can only change width. Height is adjusted automatically based on the
|
|
26653
|
-
* wrapping of lines.
|
|
26754
|
+
/**
|
|
26755
|
+
* Textbox class, based on IText, allows the user to resize the text rectangle
|
|
26756
|
+
* and wraps lines automatically. Textboxes have their Y scaling locked, the
|
|
26757
|
+
* user can only change width. Height is adjusted automatically based on the
|
|
26758
|
+
* wrapping of lines.
|
|
26654
26759
|
*/
|
|
26655
26760
|
class Textbox extends IText {
|
|
26656
26761
|
static getDefaults() {
|
|
@@ -26660,10 +26765,10 @@ class Textbox extends IText {
|
|
|
26660
26765
|
};
|
|
26661
26766
|
}
|
|
26662
26767
|
|
|
26663
|
-
/**
|
|
26664
|
-
* Constructor
|
|
26665
|
-
* @param {String} text Text string
|
|
26666
|
-
* @param {Object} [options] Options object
|
|
26768
|
+
/**
|
|
26769
|
+
* Constructor
|
|
26770
|
+
* @param {String} text Text string
|
|
26771
|
+
* @param {Object} [options] Options object
|
|
26667
26772
|
*/
|
|
26668
26773
|
constructor(text, options) {
|
|
26669
26774
|
super(text, {
|
|
@@ -26673,10 +26778,10 @@ class Textbox extends IText {
|
|
|
26673
26778
|
this.initializeEventListeners();
|
|
26674
26779
|
}
|
|
26675
26780
|
|
|
26676
|
-
/**
|
|
26677
|
-
* Creates the default control object.
|
|
26678
|
-
* If you prefer to have on instance of controls shared among all objects
|
|
26679
|
-
* make this function return an empty object and add controls to the ownDefaults object
|
|
26781
|
+
/**
|
|
26782
|
+
* Creates the default control object.
|
|
26783
|
+
* If you prefer to have on instance of controls shared among all objects
|
|
26784
|
+
* make this function return an empty object and add controls to the ownDefaults object
|
|
26680
26785
|
*/
|
|
26681
26786
|
static createControls() {
|
|
26682
26787
|
return {
|
|
@@ -26684,11 +26789,11 @@ class Textbox extends IText {
|
|
|
26684
26789
|
};
|
|
26685
26790
|
}
|
|
26686
26791
|
|
|
26687
|
-
/**
|
|
26688
|
-
* Unlike superclass's version of this function, Textbox does not update
|
|
26689
|
-
* its width.
|
|
26690
|
-
* @private
|
|
26691
|
-
* @override
|
|
26792
|
+
/**
|
|
26793
|
+
* Unlike superclass's version of this function, Textbox does not update
|
|
26794
|
+
* its width.
|
|
26795
|
+
* @private
|
|
26796
|
+
* @override
|
|
26692
26797
|
*/
|
|
26693
26798
|
initDimensions() {
|
|
26694
26799
|
if (!this.initialized) {
|
|
@@ -26756,6 +26861,7 @@ class Textbox extends IText {
|
|
|
26756
26861
|
if (this._usingBrowserWrapping) {
|
|
26757
26862
|
this._browserWrapInitialized = true;
|
|
26758
26863
|
}
|
|
26864
|
+
this.calcTextWidth();
|
|
26759
26865
|
if (this.textAlign.includes(JUSTIFY)) {
|
|
26760
26866
|
// For browser wrapping fonts, apply browser-calculated justify spaces
|
|
26761
26867
|
if (this._usingBrowserWrapping) {
|
|
@@ -26764,15 +26870,8 @@ class Textbox extends IText {
|
|
|
26764
26870
|
return;
|
|
26765
26871
|
}
|
|
26766
26872
|
|
|
26767
|
-
//
|
|
26768
|
-
|
|
26769
|
-
const lastDragTime = this._lastInitDimensionsTime || 0;
|
|
26770
|
-
const isDuringDrag = now - lastDragTime < 200; // 200ms window for drag detection
|
|
26771
|
-
|
|
26772
|
-
if (isDuringDrag) {
|
|
26773
|
-
console.log('🔤 Skipping justify during drag operation to prevent snapping');
|
|
26774
|
-
return;
|
|
26775
|
-
}
|
|
26873
|
+
// Note: Removed drag detection logic that was causing issues
|
|
26874
|
+
// Justify alignment will now apply immediately when needed
|
|
26776
26875
|
|
|
26777
26876
|
// For non-browser-wrapping fonts, use Fabric's justify system
|
|
26778
26877
|
// once text is measured we need to make space fatter to make justified text.
|
|
@@ -26830,11 +26929,40 @@ class Textbox extends IText {
|
|
|
26830
26929
|
} else {
|
|
26831
26930
|
this.height = this.calcTextHeight();
|
|
26832
26931
|
}
|
|
26932
|
+
|
|
26933
|
+
// Double-check that justify was applied by checking space widths
|
|
26934
|
+
// Skip validation during rapid width changes to prevent interference
|
|
26935
|
+
console.log('🔍 JUSTIFY CHECK:', this.textAlign.includes('justify'), !!this.__charBounds, !this._skipJustifyValidation);
|
|
26936
|
+
if (this.textAlign.includes('justify') && this.__charBounds && !this._skipJustifyValidation) {
|
|
26937
|
+
setTimeout(() => {
|
|
26938
|
+
// Verify justify was applied by checking if space widths vary
|
|
26939
|
+
let hasVariableSpaces = false;
|
|
26940
|
+
this.__charBounds.forEach((lineBounds, i) => {
|
|
26941
|
+
if (lineBounds && this._textLines && this._textLines[i]) {
|
|
26942
|
+
const spaces = lineBounds.filter((bound, j) => /\s/.test(this._textLines[i][j]));
|
|
26943
|
+
if (spaces.length > 1) {
|
|
26944
|
+
const firstSpaceWidth = spaces[0].width;
|
|
26945
|
+
hasVariableSpaces = spaces.some(space => Math.abs(space.width - firstSpaceWidth) > 0.1);
|
|
26946
|
+
}
|
|
26947
|
+
}
|
|
26948
|
+
});
|
|
26949
|
+
if (!hasVariableSpaces && this.__charBounds.length > 0) {
|
|
26950
|
+
console.warn(' ⚠️ Justify spaces still uniform - forcing enlargeSpaces again');
|
|
26951
|
+
if (this.enlargeSpaces) {
|
|
26952
|
+
var _this$canvas3;
|
|
26953
|
+
this.enlargeSpaces();
|
|
26954
|
+
(_this$canvas3 = this.canvas) === null || _this$canvas3 === void 0 || _this$canvas3.requestRenderAll();
|
|
26955
|
+
}
|
|
26956
|
+
} else {
|
|
26957
|
+
console.log(' ✅ Justify spaces properly expanded');
|
|
26958
|
+
}
|
|
26959
|
+
}, 10);
|
|
26960
|
+
}
|
|
26833
26961
|
}
|
|
26834
26962
|
|
|
26835
|
-
/**
|
|
26836
|
-
* Schedule justify calculation after font loads (Textbox-specific)
|
|
26837
|
-
* @private
|
|
26963
|
+
/**
|
|
26964
|
+
* Schedule justify calculation after font loads (Textbox-specific)
|
|
26965
|
+
* @private
|
|
26838
26966
|
*/
|
|
26839
26967
|
_scheduleJustifyAfterFontLoad() {
|
|
26840
26968
|
if (typeof document === 'undefined' || !('fonts' in document)) {
|
|
@@ -26848,22 +26976,22 @@ class Textbox extends IText {
|
|
|
26848
26976
|
this._fontJustifyScheduled = true;
|
|
26849
26977
|
const fontSpec = `${this.fontSize}px ${this.fontFamily}`;
|
|
26850
26978
|
document.fonts.load(fontSpec).then(() => {
|
|
26851
|
-
var _this$
|
|
26979
|
+
var _this$canvas4;
|
|
26852
26980
|
this._fontJustifyScheduled = false;
|
|
26853
26981
|
console.log('🔧 Textbox: Font loaded, applying justify alignment');
|
|
26854
26982
|
|
|
26855
26983
|
// Re-run initDimensions to ensure proper justify calculation
|
|
26856
26984
|
this.initDimensions();
|
|
26857
|
-
(_this$
|
|
26985
|
+
(_this$canvas4 = this.canvas) === null || _this$canvas4 === void 0 || _this$canvas4.requestRenderAll();
|
|
26858
26986
|
}).catch(() => {
|
|
26859
26987
|
this._fontJustifyScheduled = false;
|
|
26860
26988
|
console.warn('⚠️ Textbox: Font loading failed, justify may be incorrect');
|
|
26861
26989
|
});
|
|
26862
26990
|
}
|
|
26863
26991
|
|
|
26864
|
-
/**
|
|
26865
|
-
* Advanced dimensions calculation using new layout engine
|
|
26866
|
-
* @private
|
|
26992
|
+
/**
|
|
26993
|
+
* Advanced dimensions calculation using new layout engine
|
|
26994
|
+
* @private
|
|
26867
26995
|
*/
|
|
26868
26996
|
initDimensionsAdvanced() {
|
|
26869
26997
|
if (!this.initialized) {
|
|
@@ -26918,9 +27046,9 @@ class Textbox extends IText {
|
|
|
26918
27046
|
this.dirty = true;
|
|
26919
27047
|
}
|
|
26920
27048
|
|
|
26921
|
-
/**
|
|
26922
|
-
* Generate style map from new layout format
|
|
26923
|
-
* @private
|
|
27049
|
+
/**
|
|
27050
|
+
* Generate style map from new layout format
|
|
27051
|
+
* @private
|
|
26924
27052
|
*/
|
|
26925
27053
|
_generateStyleMapFromLayout(layout) {
|
|
26926
27054
|
const map = {};
|
|
@@ -26942,12 +27070,12 @@ class Textbox extends IText {
|
|
|
26942
27070
|
return map;
|
|
26943
27071
|
}
|
|
26944
27072
|
|
|
26945
|
-
/**
|
|
26946
|
-
* Generate an object that translates the style object so that it is
|
|
26947
|
-
* broken up by visual lines (new lines and automatic wrapping).
|
|
26948
|
-
* The original text styles object is broken up by actual lines (new lines only),
|
|
26949
|
-
* which is only sufficient for Text / IText
|
|
26950
|
-
* @private
|
|
27073
|
+
/**
|
|
27074
|
+
* Generate an object that translates the style object so that it is
|
|
27075
|
+
* broken up by visual lines (new lines and automatic wrapping).
|
|
27076
|
+
* The original text styles object is broken up by actual lines (new lines only),
|
|
27077
|
+
* which is only sufficient for Text / IText
|
|
27078
|
+
* @private
|
|
26951
27079
|
*/
|
|
26952
27080
|
_generateStyleMap(textInfo) {
|
|
26953
27081
|
let realLineCount = 0,
|
|
@@ -26974,10 +27102,10 @@ class Textbox extends IText {
|
|
|
26974
27102
|
return map;
|
|
26975
27103
|
}
|
|
26976
27104
|
|
|
26977
|
-
/**
|
|
26978
|
-
* Returns true if object has a style property or has it on a specified line
|
|
26979
|
-
* @param {Number} lineIndex
|
|
26980
|
-
* @return {Boolean}
|
|
27105
|
+
/**
|
|
27106
|
+
* Returns true if object has a style property or has it on a specified line
|
|
27107
|
+
* @param {Number} lineIndex
|
|
27108
|
+
* @return {Boolean}
|
|
26981
27109
|
*/
|
|
26982
27110
|
styleHas(property, lineIndex) {
|
|
26983
27111
|
if (this._styleMap && !this.isWrapping) {
|
|
@@ -26989,10 +27117,10 @@ class Textbox extends IText {
|
|
|
26989
27117
|
return super.styleHas(property, lineIndex);
|
|
26990
27118
|
}
|
|
26991
27119
|
|
|
26992
|
-
/**
|
|
26993
|
-
* Returns true if object has no styling or no styling in a line
|
|
26994
|
-
* @param {Number} lineIndex , lineIndex is on wrapped lines.
|
|
26995
|
-
* @return {Boolean}
|
|
27120
|
+
/**
|
|
27121
|
+
* Returns true if object has no styling or no styling in a line
|
|
27122
|
+
* @param {Number} lineIndex , lineIndex is on wrapped lines.
|
|
27123
|
+
* @return {Boolean}
|
|
26996
27124
|
*/
|
|
26997
27125
|
isEmptyStyles(lineIndex) {
|
|
26998
27126
|
if (!this.styles) {
|
|
@@ -27029,11 +27157,11 @@ class Textbox extends IText {
|
|
|
27029
27157
|
return true;
|
|
27030
27158
|
}
|
|
27031
27159
|
|
|
27032
|
-
/**
|
|
27033
|
-
* @protected
|
|
27034
|
-
* @param {Number} lineIndex
|
|
27035
|
-
* @param {Number} charIndex
|
|
27036
|
-
* @return {TextStyleDeclaration} a style object reference to the existing one or a new empty object when undefined
|
|
27160
|
+
/**
|
|
27161
|
+
* @protected
|
|
27162
|
+
* @param {Number} lineIndex
|
|
27163
|
+
* @param {Number} charIndex
|
|
27164
|
+
* @return {TextStyleDeclaration} a style object reference to the existing one or a new empty object when undefined
|
|
27037
27165
|
*/
|
|
27038
27166
|
_getStyleDeclaration(lineIndex, charIndex) {
|
|
27039
27167
|
if (this._styleMap && !this.isWrapping) {
|
|
@@ -27047,59 +27175,59 @@ class Textbox extends IText {
|
|
|
27047
27175
|
return super._getStyleDeclaration(lineIndex, charIndex);
|
|
27048
27176
|
}
|
|
27049
27177
|
|
|
27050
|
-
/**
|
|
27051
|
-
* @param {Number} lineIndex
|
|
27052
|
-
* @param {Number} charIndex
|
|
27053
|
-
* @param {Object} style
|
|
27054
|
-
* @private
|
|
27178
|
+
/**
|
|
27179
|
+
* @param {Number} lineIndex
|
|
27180
|
+
* @param {Number} charIndex
|
|
27181
|
+
* @param {Object} style
|
|
27182
|
+
* @private
|
|
27055
27183
|
*/
|
|
27056
27184
|
_setStyleDeclaration(lineIndex, charIndex, style) {
|
|
27057
27185
|
const map = this._styleMap[lineIndex];
|
|
27058
27186
|
super._setStyleDeclaration(map.line, map.offset + charIndex, style);
|
|
27059
27187
|
}
|
|
27060
27188
|
|
|
27061
|
-
/**
|
|
27062
|
-
* @param {Number} lineIndex
|
|
27063
|
-
* @param {Number} charIndex
|
|
27064
|
-
* @private
|
|
27189
|
+
/**
|
|
27190
|
+
* @param {Number} lineIndex
|
|
27191
|
+
* @param {Number} charIndex
|
|
27192
|
+
* @private
|
|
27065
27193
|
*/
|
|
27066
27194
|
_deleteStyleDeclaration(lineIndex, charIndex) {
|
|
27067
27195
|
const map = this._styleMap[lineIndex];
|
|
27068
27196
|
super._deleteStyleDeclaration(map.line, map.offset + charIndex);
|
|
27069
27197
|
}
|
|
27070
27198
|
|
|
27071
|
-
/**
|
|
27072
|
-
* probably broken need a fix
|
|
27073
|
-
* Returns the real style line that correspond to the wrapped lineIndex line
|
|
27074
|
-
* Used just to verify if the line does exist or not.
|
|
27075
|
-
* @param {Number} lineIndex
|
|
27076
|
-
* @returns {Boolean} if the line exists or not
|
|
27077
|
-
* @private
|
|
27199
|
+
/**
|
|
27200
|
+
* probably broken need a fix
|
|
27201
|
+
* Returns the real style line that correspond to the wrapped lineIndex line
|
|
27202
|
+
* Used just to verify if the line does exist or not.
|
|
27203
|
+
* @param {Number} lineIndex
|
|
27204
|
+
* @returns {Boolean} if the line exists or not
|
|
27205
|
+
* @private
|
|
27078
27206
|
*/
|
|
27079
27207
|
_getLineStyle(lineIndex) {
|
|
27080
27208
|
const map = this._styleMap[lineIndex];
|
|
27081
27209
|
return !!this.styles[map.line];
|
|
27082
27210
|
}
|
|
27083
27211
|
|
|
27084
|
-
/**
|
|
27085
|
-
* Set the line style to an empty object so that is initialized
|
|
27086
|
-
* @param {Number} lineIndex
|
|
27087
|
-
* @param {Object} style
|
|
27088
|
-
* @private
|
|
27212
|
+
/**
|
|
27213
|
+
* Set the line style to an empty object so that is initialized
|
|
27214
|
+
* @param {Number} lineIndex
|
|
27215
|
+
* @param {Object} style
|
|
27216
|
+
* @private
|
|
27089
27217
|
*/
|
|
27090
27218
|
_setLineStyle(lineIndex) {
|
|
27091
27219
|
const map = this._styleMap[lineIndex];
|
|
27092
27220
|
super._setLineStyle(map.line);
|
|
27093
27221
|
}
|
|
27094
27222
|
|
|
27095
|
-
/**
|
|
27096
|
-
* Wraps text using the 'width' property of Textbox. First this function
|
|
27097
|
-
* splits text on newlines, so we preserve newlines entered by the user.
|
|
27098
|
-
* Then it wraps each line using the width of the Textbox by calling
|
|
27099
|
-
* _wrapLine().
|
|
27100
|
-
* @param {Array} lines The string array of text that is split into lines
|
|
27101
|
-
* @param {Number} desiredWidth width you want to wrap to
|
|
27102
|
-
* @returns {Array} Array of lines
|
|
27223
|
+
/**
|
|
27224
|
+
* Wraps text using the 'width' property of Textbox. First this function
|
|
27225
|
+
* splits text on newlines, so we preserve newlines entered by the user.
|
|
27226
|
+
* Then it wraps each line using the width of the Textbox by calling
|
|
27227
|
+
* _wrapLine().
|
|
27228
|
+
* @param {Array} lines The string array of text that is split into lines
|
|
27229
|
+
* @param {Number} desiredWidth width you want to wrap to
|
|
27230
|
+
* @returns {Array} Array of lines
|
|
27103
27231
|
*/
|
|
27104
27232
|
_wrapText(lines, desiredWidth) {
|
|
27105
27233
|
this.isWrapping = true;
|
|
@@ -27113,12 +27241,12 @@ class Textbox extends IText {
|
|
|
27113
27241
|
return wrapped;
|
|
27114
27242
|
}
|
|
27115
27243
|
|
|
27116
|
-
/**
|
|
27117
|
-
* For each line of text terminated by an hard line stop,
|
|
27118
|
-
* measure each word width and extract the largest word from all.
|
|
27119
|
-
* The returned words here are the one that at the end will be rendered.
|
|
27120
|
-
* @param {string[]} lines the lines we need to measure
|
|
27121
|
-
*
|
|
27244
|
+
/**
|
|
27245
|
+
* For each line of text terminated by an hard line stop,
|
|
27246
|
+
* measure each word width and extract the largest word from all.
|
|
27247
|
+
* The returned words here are the one that at the end will be rendered.
|
|
27248
|
+
* @param {string[]} lines the lines we need to measure
|
|
27249
|
+
*
|
|
27122
27250
|
*/
|
|
27123
27251
|
getGraphemeDataForRender(lines) {
|
|
27124
27252
|
const splitByGrapheme = this.splitByGrapheme,
|
|
@@ -27151,17 +27279,17 @@ class Textbox extends IText {
|
|
|
27151
27279
|
};
|
|
27152
27280
|
}
|
|
27153
27281
|
|
|
27154
|
-
/**
|
|
27155
|
-
* Helper function to measure a string of text, given its lineIndex and charIndex offset
|
|
27156
|
-
* It gets called when charBounds are not available yet.
|
|
27157
|
-
* Override if necessary
|
|
27158
|
-
* Use with {@link Textbox#wordSplit}
|
|
27159
|
-
*
|
|
27160
|
-
* @param {CanvasRenderingContext2D} ctx
|
|
27161
|
-
* @param {String} text
|
|
27162
|
-
* @param {number} lineIndex
|
|
27163
|
-
* @param {number} charOffset
|
|
27164
|
-
* @returns {number}
|
|
27282
|
+
/**
|
|
27283
|
+
* Helper function to measure a string of text, given its lineIndex and charIndex offset
|
|
27284
|
+
* It gets called when charBounds are not available yet.
|
|
27285
|
+
* Override if necessary
|
|
27286
|
+
* Use with {@link Textbox#wordSplit}
|
|
27287
|
+
*
|
|
27288
|
+
* @param {CanvasRenderingContext2D} ctx
|
|
27289
|
+
* @param {String} text
|
|
27290
|
+
* @param {number} lineIndex
|
|
27291
|
+
* @param {number} charOffset
|
|
27292
|
+
* @returns {number}
|
|
27165
27293
|
*/
|
|
27166
27294
|
_measureWord(word, lineIndex) {
|
|
27167
27295
|
let charOffset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
@@ -27176,26 +27304,26 @@ class Textbox extends IText {
|
|
|
27176
27304
|
return width;
|
|
27177
27305
|
}
|
|
27178
27306
|
|
|
27179
|
-
/**
|
|
27180
|
-
* Override this method to customize word splitting
|
|
27181
|
-
* Use with {@link Textbox#_measureWord}
|
|
27182
|
-
* @param {string} value
|
|
27183
|
-
* @returns {string[]} array of words
|
|
27307
|
+
/**
|
|
27308
|
+
* Override this method to customize word splitting
|
|
27309
|
+
* Use with {@link Textbox#_measureWord}
|
|
27310
|
+
* @param {string} value
|
|
27311
|
+
* @returns {string[]} array of words
|
|
27184
27312
|
*/
|
|
27185
27313
|
wordSplit(value) {
|
|
27186
27314
|
return value.split(this._wordJoiners);
|
|
27187
27315
|
}
|
|
27188
27316
|
|
|
27189
|
-
/**
|
|
27190
|
-
* Wraps a line of text using the width of the Textbox as desiredWidth
|
|
27191
|
-
* and leveraging the known width o words from GraphemeData
|
|
27192
|
-
* @private
|
|
27193
|
-
* @param {Number} lineIndex
|
|
27194
|
-
* @param {Number} desiredWidth width you want to wrap the line to
|
|
27195
|
-
* @param {GraphemeData} graphemeData an object containing all the lines' words width.
|
|
27196
|
-
* @param {Number} reservedSpace space to remove from wrapping for custom functionalities
|
|
27197
|
-
* @returns {Array} Array of line(s) into which the given text is wrapped
|
|
27198
|
-
* to.
|
|
27317
|
+
/**
|
|
27318
|
+
* Wraps a line of text using the width of the Textbox as desiredWidth
|
|
27319
|
+
* and leveraging the known width o words from GraphemeData
|
|
27320
|
+
* @private
|
|
27321
|
+
* @param {Number} lineIndex
|
|
27322
|
+
* @param {Number} desiredWidth width you want to wrap the line to
|
|
27323
|
+
* @param {GraphemeData} graphemeData an object containing all the lines' words width.
|
|
27324
|
+
* @param {Number} reservedSpace space to remove from wrapping for custom functionalities
|
|
27325
|
+
* @returns {Array} Array of line(s) into which the given text is wrapped
|
|
27326
|
+
* to.
|
|
27199
27327
|
*/
|
|
27200
27328
|
_wrapLine(lineIndex, desiredWidth, _ref) {
|
|
27201
27329
|
let {
|
|
@@ -27277,11 +27405,11 @@ class Textbox extends IText {
|
|
|
27277
27405
|
return graphemeLines;
|
|
27278
27406
|
}
|
|
27279
27407
|
|
|
27280
|
-
/**
|
|
27281
|
-
* Detect if the text line is ended with an hard break
|
|
27282
|
-
* text and itext do not have wrapping, return false
|
|
27283
|
-
* @param {Number} lineIndex text to split
|
|
27284
|
-
* @return {Boolean}
|
|
27408
|
+
/**
|
|
27409
|
+
* Detect if the text line is ended with an hard break
|
|
27410
|
+
* text and itext do not have wrapping, return false
|
|
27411
|
+
* @param {Number} lineIndex text to split
|
|
27412
|
+
* @return {Boolean}
|
|
27285
27413
|
*/
|
|
27286
27414
|
isEndOfWrapping(lineIndex) {
|
|
27287
27415
|
if (!this._styleMap[lineIndex + 1]) {
|
|
@@ -27295,12 +27423,12 @@ class Textbox extends IText {
|
|
|
27295
27423
|
return false;
|
|
27296
27424
|
}
|
|
27297
27425
|
|
|
27298
|
-
/**
|
|
27299
|
-
* Detect if a line has a linebreak and so we need to account for it when moving
|
|
27300
|
-
* and counting style.
|
|
27301
|
-
* This is important only for splitByGrapheme at the end of wrapping.
|
|
27302
|
-
* If we are not wrapping the offset is always 1
|
|
27303
|
-
* @return Number
|
|
27426
|
+
/**
|
|
27427
|
+
* Detect if a line has a linebreak and so we need to account for it when moving
|
|
27428
|
+
* and counting style.
|
|
27429
|
+
* This is important only for splitByGrapheme at the end of wrapping.
|
|
27430
|
+
* If we are not wrapping the offset is always 1
|
|
27431
|
+
* @return Number
|
|
27304
27432
|
*/
|
|
27305
27433
|
missingNewlineOffset(lineIndex, skipWrapping) {
|
|
27306
27434
|
if (this.splitByGrapheme && !skipWrapping) {
|
|
@@ -27309,16 +27437,17 @@ class Textbox extends IText {
|
|
|
27309
27437
|
return 1;
|
|
27310
27438
|
}
|
|
27311
27439
|
|
|
27312
|
-
/**
|
|
27313
|
-
* Gets lines of text to render in the Textbox. This function calculates
|
|
27314
|
-
* text wrapping on the fly every time it is called.
|
|
27315
|
-
* @param {String} text text to split
|
|
27316
|
-
* @returns {Array} Array of lines in the Textbox.
|
|
27317
|
-
* @override
|
|
27440
|
+
/**
|
|
27441
|
+
* Gets lines of text to render in the Textbox. This function calculates
|
|
27442
|
+
* text wrapping on the fly every time it is called.
|
|
27443
|
+
* @param {String} text text to split
|
|
27444
|
+
* @returns {Array} Array of lines in the Textbox.
|
|
27445
|
+
* @override
|
|
27318
27446
|
*/
|
|
27319
27447
|
_splitTextIntoLines(text) {
|
|
27320
27448
|
// Check if we need browser wrapping using smart font detection
|
|
27321
|
-
|
|
27449
|
+
// Skip browser wrapping for justify text when using overlay editing to prevent measurement conflicts
|
|
27450
|
+
const needsBrowserWrapping = this.fontFamily && fontLacksEnglishGlyphsCached(this.fontFamily) && !(this.textAlign.includes('justify') && this.useOverlayEditing);
|
|
27322
27451
|
if (needsBrowserWrapping) {
|
|
27323
27452
|
// Cache key based on text content, width, font properties, AND text alignment
|
|
27324
27453
|
const textHash = text.length + text.slice(0, 50); // Include text content in cache key
|
|
@@ -27343,6 +27472,11 @@ class Textbox extends IText {
|
|
|
27343
27472
|
|
|
27344
27473
|
// Mark that we used browser wrapping to prevent dynamicMinWidth modifications
|
|
27345
27474
|
this._usingBrowserWrapping = true;
|
|
27475
|
+
|
|
27476
|
+
// pass the width to enlargeSpaces
|
|
27477
|
+
if (result.width) {
|
|
27478
|
+
this._browserWrappingWidth = result.width;
|
|
27479
|
+
}
|
|
27346
27480
|
return result;
|
|
27347
27481
|
}
|
|
27348
27482
|
|
|
@@ -27361,9 +27495,9 @@ class Textbox extends IText {
|
|
|
27361
27495
|
return newText;
|
|
27362
27496
|
}
|
|
27363
27497
|
|
|
27364
|
-
/**
|
|
27365
|
-
* Use browser's native text wrapping for accurate handling of fonts without English glyphs
|
|
27366
|
-
* @private
|
|
27498
|
+
/**
|
|
27499
|
+
* Use browser's native text wrapping for accurate handling of fonts without English glyphs
|
|
27500
|
+
* @private
|
|
27367
27501
|
*/
|
|
27368
27502
|
_splitTextIntoLinesWithBrowser(text) {
|
|
27369
27503
|
if (typeof document === 'undefined') {
|
|
@@ -27371,26 +27505,47 @@ class Textbox extends IText {
|
|
|
27371
27505
|
return this._splitTextIntoLinesDefault(text);
|
|
27372
27506
|
}
|
|
27373
27507
|
|
|
27508
|
+
// Skip measurement if we just extracted lines from overlay for justify text
|
|
27509
|
+
if (this._skipJustifyMeasurement && this.textAlign.includes('justify')) {
|
|
27510
|
+
console.log('🚫 SKIP: Skipping browser measurement, using stored overlay lines');
|
|
27511
|
+
this._skipJustifyMeasurement = false; // Reset flag
|
|
27512
|
+
return this._splitTextIntoLinesDefault(text);
|
|
27513
|
+
}
|
|
27514
|
+
|
|
27374
27515
|
// Create a hidden element that mimics the overlay editor
|
|
27375
27516
|
const testElement = document.createElement('div');
|
|
27376
27517
|
testElement.style.position = 'absolute';
|
|
27377
27518
|
testElement.style.left = '-9999px';
|
|
27378
27519
|
testElement.style.visibility = 'hidden';
|
|
27379
|
-
|
|
27520
|
+
const scaleX = this.scaleX || 1;
|
|
27521
|
+
const fontSize = this.fontSize * scaleX;
|
|
27522
|
+
const padding = this.padding || 0;
|
|
27523
|
+
testElement.style.fontSize = `${fontSize}px`;
|
|
27380
27524
|
testElement.style.fontFamily = `"${this.fontFamily}"`;
|
|
27381
27525
|
testElement.style.fontWeight = String(this.fontWeight || 'normal');
|
|
27382
27526
|
testElement.style.fontStyle = String(this.fontStyle || 'normal');
|
|
27383
27527
|
testElement.style.lineHeight = String(this.lineHeight || 1.16);
|
|
27384
|
-
testElement.style.
|
|
27528
|
+
testElement.style.letterSpacing = `${(this.charSpacing || 0) / 1000 * fontSize}px`;
|
|
27385
27529
|
testElement.style.direction = this.direction || 'ltr';
|
|
27386
27530
|
testElement.style.whiteSpace = 'pre-wrap';
|
|
27387
27531
|
testElement.style.wordBreak = 'normal';
|
|
27388
27532
|
testElement.style.overflowWrap = 'break-word';
|
|
27389
|
-
|
|
27390
|
-
|
|
27533
|
+
testElement.style.padding = `${padding}px`;
|
|
27534
|
+
testElement.style.boxSizing = 'border-box';
|
|
27535
|
+
testElement.style.width = `${this.width * scaleX + padding * 2}px`;
|
|
27391
27536
|
if (this.textAlign.includes('justify')) {
|
|
27392
27537
|
testElement.style.textAlign = 'justify';
|
|
27393
|
-
|
|
27538
|
+
if (this.direction === 'rtl') {
|
|
27539
|
+
testElement.style.textAlignLast = 'right';
|
|
27540
|
+
} else {
|
|
27541
|
+
testElement.style.textAlignLast = 'left';
|
|
27542
|
+
}
|
|
27543
|
+
testElement.style.textJustify = 'inter-word';
|
|
27544
|
+
testElement.style.unicodeBidi = 'plaintext';
|
|
27545
|
+
testElement.style.wordSpacing = 'normal';
|
|
27546
|
+
// Match font smoothing from overlay editor
|
|
27547
|
+
testElement.style.webkitFontSmoothing = 'auto';
|
|
27548
|
+
testElement.style.mozOsxFontSmoothing = 'auto';
|
|
27394
27549
|
} else {
|
|
27395
27550
|
testElement.style.textAlign = this.textAlign;
|
|
27396
27551
|
}
|
|
@@ -27415,7 +27570,7 @@ class Textbox extends IText {
|
|
|
27415
27570
|
if (i > currentLineStart && (rect.bottom > previousBottom + 5 || i === textLength)) {
|
|
27416
27571
|
// New line detected or end of text
|
|
27417
27572
|
const lineEnd = i === textLength ? i : i - 1;
|
|
27418
|
-
const lineText = text.substring(currentLineStart, lineEnd)
|
|
27573
|
+
const lineText = text.substring(currentLineStart, lineEnd);
|
|
27419
27574
|
if (lineText) {
|
|
27420
27575
|
lines.push(lineText);
|
|
27421
27576
|
// Convert to graphemes for compatibility
|
|
@@ -27438,6 +27593,7 @@ class Textbox extends IText {
|
|
|
27438
27593
|
const offsetHeight = testElement.offsetHeight;
|
|
27439
27594
|
const clientHeight = testElement.clientHeight;
|
|
27440
27595
|
const boundingRect = testElement.getBoundingClientRect();
|
|
27596
|
+
const clientWidth = testElement.clientWidth;
|
|
27441
27597
|
console.log(`🔤 Browser element measurements:`);
|
|
27442
27598
|
console.log(` scrollHeight: ${actualBrowserHeight}px (content + padding + hidden overflow)`);
|
|
27443
27599
|
console.log(` offsetHeight: ${offsetHeight}px (content + padding + border)`);
|
|
@@ -27485,13 +27641,14 @@ class Textbox extends IText {
|
|
|
27485
27641
|
graphemeText: text.split(''),
|
|
27486
27642
|
graphemeLines: graphemeLines,
|
|
27487
27643
|
justifySpaceMeasurements: justifySpaceMeasurements,
|
|
27488
|
-
actualBrowserHeight: adjustedHeight
|
|
27644
|
+
actualBrowserHeight: adjustedHeight,
|
|
27645
|
+
width: clientWidth
|
|
27489
27646
|
};
|
|
27490
27647
|
}
|
|
27491
27648
|
|
|
27492
|
-
/**
|
|
27493
|
-
* Extract justify space measurements from browser
|
|
27494
|
-
* @private
|
|
27649
|
+
/**
|
|
27650
|
+
* Extract justify space measurements from browser
|
|
27651
|
+
* @private
|
|
27495
27652
|
*/
|
|
27496
27653
|
_extractJustifySpaceMeasurements(element, lines) {
|
|
27497
27654
|
console.log(`🔤 Extracting browser justify space measurements for ${lines.length} lines`);
|
|
@@ -27527,9 +27684,9 @@ class Textbox extends IText {
|
|
|
27527
27684
|
return spaceWidths;
|
|
27528
27685
|
}
|
|
27529
27686
|
|
|
27530
|
-
/**
|
|
27531
|
-
* Apply browser-calculated justify space measurements
|
|
27532
|
-
* @private
|
|
27687
|
+
/**
|
|
27688
|
+
* Apply browser-calculated justify space measurements
|
|
27689
|
+
* @private
|
|
27533
27690
|
*/
|
|
27534
27691
|
_applyBrowserJustifySpaces() {
|
|
27535
27692
|
if (!this._textLines || !this.__charBounds) {
|
|
@@ -27537,6 +27694,14 @@ class Textbox extends IText {
|
|
|
27537
27694
|
return;
|
|
27538
27695
|
}
|
|
27539
27696
|
|
|
27697
|
+
// Check for overlay justify measurements first
|
|
27698
|
+
const overlayMeasurements = this._overlayJustifyMeasurements;
|
|
27699
|
+
if (overlayMeasurements) {
|
|
27700
|
+
console.log('🎯 OVERLAY JUSTIFY: Using stored overlay measurements');
|
|
27701
|
+
this._applyOverlayJustifySpaces(overlayMeasurements);
|
|
27702
|
+
return;
|
|
27703
|
+
}
|
|
27704
|
+
|
|
27540
27705
|
// Get space measurements from browser wrapping result
|
|
27541
27706
|
const styleMap = this._styleMap;
|
|
27542
27707
|
if (!styleMap || !styleMap.justifySpaceMeasurements) {
|
|
@@ -27552,23 +27717,164 @@ class Textbox extends IText {
|
|
|
27552
27717
|
const lineBounds = this.__charBounds[lineIndex];
|
|
27553
27718
|
const lineSpaceWidths = spaceWidths[lineIndex];
|
|
27554
27719
|
let spaceIndex = 0;
|
|
27720
|
+
let accumulatedSpace = 0;
|
|
27721
|
+
const isRtl = this.direction === 'rtl';
|
|
27722
|
+
const spaceDiffs = [];
|
|
27723
|
+
|
|
27724
|
+
// First, calculate the difference for each space
|
|
27555
27725
|
for (let charIndex = 0; charIndex < line.length; charIndex++) {
|
|
27556
27726
|
if (/\s/.test(line[charIndex]) && spaceIndex < lineSpaceWidths.length) {
|
|
27557
|
-
const
|
|
27558
|
-
if (
|
|
27559
|
-
|
|
27560
|
-
lineBounds[charIndex].width = expandedWidth;
|
|
27561
|
-
console.log(`🔤 Line ${lineIndex} space ${spaceIndex}: ${oldWidth.toFixed(1)}px -> ${expandedWidth.toFixed(1)}px`);
|
|
27727
|
+
const charBound = lineBounds[charIndex];
|
|
27728
|
+
if (charBound) {
|
|
27729
|
+
spaceDiffs.push(lineSpaceWidths[spaceIndex] - charBound.width);
|
|
27562
27730
|
}
|
|
27563
27731
|
spaceIndex++;
|
|
27564
27732
|
}
|
|
27565
27733
|
}
|
|
27734
|
+
spaceIndex = 0;
|
|
27735
|
+
let remainingDiff = spaceDiffs.reduce((a, b) => a + b, 0);
|
|
27736
|
+
for (let charIndex = 0; charIndex < line.length; charIndex++) {
|
|
27737
|
+
const charBound = lineBounds[charIndex];
|
|
27738
|
+
if (!charBound) continue;
|
|
27739
|
+
if (isRtl) {
|
|
27740
|
+
charBound.left += remainingDiff;
|
|
27741
|
+
} else {
|
|
27742
|
+
charBound.left += accumulatedSpace;
|
|
27743
|
+
}
|
|
27744
|
+
if (/\s/.test(line[charIndex]) && spaceIndex < spaceDiffs.length) {
|
|
27745
|
+
const diff = spaceDiffs[spaceIndex];
|
|
27746
|
+
const oldWidth = charBound.width;
|
|
27747
|
+
charBound.width += diff;
|
|
27748
|
+
charBound.kernedWidth += diff;
|
|
27749
|
+
console.log(`🔤 Line ${lineIndex} space ${spaceIndex}: ${oldWidth.toFixed(1)}px -> ${charBound.width.toFixed(1)}px`);
|
|
27750
|
+
if (isRtl) {
|
|
27751
|
+
remainingDiff -= diff;
|
|
27752
|
+
} else {
|
|
27753
|
+
accumulatedSpace += diff;
|
|
27754
|
+
}
|
|
27755
|
+
spaceIndex++;
|
|
27756
|
+
}
|
|
27757
|
+
}
|
|
27758
|
+
// also need to update the last charBound
|
|
27759
|
+
const lastBound = lineBounds[line.length];
|
|
27760
|
+
if (lastBound) {
|
|
27761
|
+
if (isRtl) {
|
|
27762
|
+
lastBound.left += remainingDiff;
|
|
27763
|
+
} else {
|
|
27764
|
+
lastBound.left += accumulatedSpace;
|
|
27765
|
+
}
|
|
27766
|
+
}
|
|
27767
|
+
});
|
|
27768
|
+
}
|
|
27769
|
+
|
|
27770
|
+
/**
|
|
27771
|
+
* Apply overlay justify measurements to character bounds
|
|
27772
|
+
* @private
|
|
27773
|
+
*/
|
|
27774
|
+
_applyOverlayJustifySpaces(overlayMeasurements) {
|
|
27775
|
+
this._textLines.forEach((line, lineIndex) => {
|
|
27776
|
+
if (!this.__charBounds || !this.__charBounds[lineIndex]) return;
|
|
27777
|
+
const lineMeasurement = overlayMeasurements[lineIndex];
|
|
27778
|
+
if (!lineMeasurement) return;
|
|
27779
|
+
const {
|
|
27780
|
+
justifiedSpaceWidth
|
|
27781
|
+
} = lineMeasurement;
|
|
27782
|
+
let spaceIndex = 0;
|
|
27783
|
+
line.forEach((char, charIndex) => {
|
|
27784
|
+
if (char === ' ' && this.__charBounds[lineIndex][charIndex]) {
|
|
27785
|
+
const oldWidth = this.__charBounds[lineIndex][charIndex].width;
|
|
27786
|
+
this.__charBounds[lineIndex][charIndex].width = justifiedSpaceWidth;
|
|
27787
|
+
console.log(`🎯 OVERLAY Line ${lineIndex} space ${spaceIndex}: ${oldWidth.toFixed(1)}px -> ${justifiedSpaceWidth.toFixed(1)}px`);
|
|
27788
|
+
spaceIndex++;
|
|
27789
|
+
}
|
|
27790
|
+
});
|
|
27566
27791
|
});
|
|
27567
27792
|
}
|
|
27568
27793
|
|
|
27569
|
-
/**
|
|
27570
|
-
*
|
|
27571
|
-
|
|
27794
|
+
/**
|
|
27795
|
+
* Extract justify measurements from overlay textarea and store them
|
|
27796
|
+
*/
|
|
27797
|
+
extractJustifyMeasurementsFromOverlay(textarea) {
|
|
27798
|
+
const text = textarea.value;
|
|
27799
|
+
if (!text || !this.textAlign.includes('justify')) {
|
|
27800
|
+
return;
|
|
27801
|
+
}
|
|
27802
|
+
|
|
27803
|
+
// Use the same measurement technique as measureLinesWithBrowser
|
|
27804
|
+
const testElement = document.createElement('div');
|
|
27805
|
+
testElement.style.position = 'absolute';
|
|
27806
|
+
testElement.style.left = '-9999px';
|
|
27807
|
+
testElement.style.visibility = 'hidden';
|
|
27808
|
+
|
|
27809
|
+
// Copy all styles from the textarea to ensure identical rendering
|
|
27810
|
+
const computedStyle = window.getComputedStyle(textarea);
|
|
27811
|
+
const stylesToCopy = ['fontSize', 'fontFamily', 'fontWeight', 'fontStyle', 'lineHeight', 'letterSpacing', 'direction', 'textAlign', 'textAlignLast', 'textJustify', 'width', 'padding', 'boxSizing', 'whiteSpace', 'wordBreak', 'overflowWrap'];
|
|
27812
|
+
stylesToCopy.forEach(prop => {
|
|
27813
|
+
testElement.style[prop] = computedStyle[prop];
|
|
27814
|
+
});
|
|
27815
|
+
testElement.textContent = text;
|
|
27816
|
+
document.body.appendChild(testElement);
|
|
27817
|
+
try {
|
|
27818
|
+
// Extract justify space measurements using the same logic
|
|
27819
|
+
const lines = text.split('\n');
|
|
27820
|
+
const justifyMeasurements = {};
|
|
27821
|
+
lines.forEach((line, lineIndex) => {
|
|
27822
|
+
if (line.trim()) {
|
|
27823
|
+
const spaces = (line.match(/\s/g) || []).length;
|
|
27824
|
+
if (spaces > 0) {
|
|
27825
|
+
// Measure natural space width
|
|
27826
|
+
const singleSpaceDiv = document.createElement('div');
|
|
27827
|
+
stylesToCopy.forEach(prop => {
|
|
27828
|
+
singleSpaceDiv.style[prop] = computedStyle[prop];
|
|
27829
|
+
});
|
|
27830
|
+
singleSpaceDiv.textContent = ' ';
|
|
27831
|
+
document.body.appendChild(singleSpaceDiv);
|
|
27832
|
+
const naturalSpaceWidth = singleSpaceDiv.getBoundingClientRect().width;
|
|
27833
|
+
document.body.removeChild(singleSpaceDiv);
|
|
27834
|
+
|
|
27835
|
+
// Measure justified line width
|
|
27836
|
+
const lineDiv = document.createElement('div');
|
|
27837
|
+
stylesToCopy.forEach(prop => {
|
|
27838
|
+
lineDiv.style[prop] = computedStyle[prop];
|
|
27839
|
+
});
|
|
27840
|
+
lineDiv.textContent = line;
|
|
27841
|
+
document.body.appendChild(lineDiv);
|
|
27842
|
+
const lineWidth = lineDiv.getBoundingClientRect().width;
|
|
27843
|
+
const containerWidth = parseFloat(computedStyle.width);
|
|
27844
|
+
|
|
27845
|
+
// Calculate justified space width
|
|
27846
|
+
const nonSpaceText = line.replace(/\s/g, '');
|
|
27847
|
+
const nonSpaceDiv = document.createElement('div');
|
|
27848
|
+
stylesToCopy.forEach(prop => {
|
|
27849
|
+
nonSpaceDiv.style[prop] = computedStyle[prop];
|
|
27850
|
+
});
|
|
27851
|
+
nonSpaceDiv.textContent = nonSpaceText;
|
|
27852
|
+
document.body.appendChild(nonSpaceDiv);
|
|
27853
|
+
const nonSpaceWidth = nonSpaceDiv.getBoundingClientRect().width;
|
|
27854
|
+
const justifiedSpaceWidth = (containerWidth - nonSpaceWidth) / spaces;
|
|
27855
|
+
console.log(`🎯 OVERLAY Line ${lineIndex}: ${spaces} spaces, natural: ${naturalSpaceWidth.toFixed(1)}px -> justified: ${justifiedSpaceWidth.toFixed(1)}px`);
|
|
27856
|
+
justifyMeasurements[lineIndex] = {
|
|
27857
|
+
naturalSpaceWidth,
|
|
27858
|
+
justifiedSpaceWidth,
|
|
27859
|
+
spaceCount: spaces
|
|
27860
|
+
};
|
|
27861
|
+
document.body.removeChild(lineDiv);
|
|
27862
|
+
document.body.removeChild(nonSpaceDiv);
|
|
27863
|
+
}
|
|
27864
|
+
}
|
|
27865
|
+
});
|
|
27866
|
+
|
|
27867
|
+
// Store the measurements
|
|
27868
|
+
this._overlayJustifyMeasurements = justifyMeasurements;
|
|
27869
|
+
console.log('💾 STORED: Overlay justify measurements', justifyMeasurements);
|
|
27870
|
+
} finally {
|
|
27871
|
+
document.body.removeChild(testElement);
|
|
27872
|
+
}
|
|
27873
|
+
}
|
|
27874
|
+
|
|
27875
|
+
/**
|
|
27876
|
+
* Fallback to default Fabric wrapping
|
|
27877
|
+
* @private
|
|
27572
27878
|
*/
|
|
27573
27879
|
_splitTextIntoLinesDefault(text) {
|
|
27574
27880
|
const newText = super._splitTextIntoLines(text),
|
|
@@ -27600,12 +27906,12 @@ class Textbox extends IText {
|
|
|
27600
27906
|
}
|
|
27601
27907
|
}
|
|
27602
27908
|
|
|
27603
|
-
/**
|
|
27604
|
-
* Initialize event listeners for safety snap functionality
|
|
27605
|
-
* @private
|
|
27909
|
+
/**
|
|
27910
|
+
* Initialize event listeners for safety snap functionality
|
|
27911
|
+
* @private
|
|
27606
27912
|
*/
|
|
27607
27913
|
initializeEventListeners() {
|
|
27608
|
-
var _this$
|
|
27914
|
+
var _this$canvas5;
|
|
27609
27915
|
// Track which side is being used for resize to handle position compensation
|
|
27610
27916
|
let resizeOrigin = null;
|
|
27611
27917
|
|
|
@@ -27630,13 +27936,14 @@ class Textbox extends IText {
|
|
|
27630
27936
|
// Use 'modified' event which fires after user releases the mouse
|
|
27631
27937
|
this.on('modified', () => {
|
|
27632
27938
|
const currentResizeOrigin = resizeOrigin; // Capture the value before reset
|
|
27939
|
+
this.initDimensions();
|
|
27633
27940
|
// Small delay to ensure text layout is updated
|
|
27634
27941
|
setTimeout(() => this.safetySnapWidth(currentResizeOrigin), 10);
|
|
27635
27942
|
resizeOrigin = null; // Reset after capturing
|
|
27636
27943
|
});
|
|
27637
27944
|
|
|
27638
27945
|
// Also listen to canvas-level modified event as backup
|
|
27639
|
-
(_this$
|
|
27946
|
+
(_this$canvas5 = this.canvas) === null || _this$canvas5 === void 0 || _this$canvas5.on('object:modified', e => {
|
|
27640
27947
|
if (e.target === this) {
|
|
27641
27948
|
const currentResizeOrigin = resizeOrigin; // Capture the value before reset
|
|
27642
27949
|
setTimeout(() => this.safetySnapWidth(currentResizeOrigin), 10);
|
|
@@ -27645,12 +27952,12 @@ class Textbox extends IText {
|
|
|
27645
27952
|
});
|
|
27646
27953
|
}
|
|
27647
27954
|
|
|
27648
|
-
/**
|
|
27649
|
-
* Safety snap to prevent glyph clipping after manual resize.
|
|
27650
|
-
* Similar to Polotno - checks if any glyphs are too close to edges
|
|
27651
|
-
* and automatically expands width if needed.
|
|
27652
|
-
* @private
|
|
27653
|
-
* @param resizeOrigin - Which side was used for resizing ('left' or 'right')
|
|
27955
|
+
/**
|
|
27956
|
+
* Safety snap to prevent glyph clipping after manual resize.
|
|
27957
|
+
* Similar to Polotno - checks if any glyphs are too close to edges
|
|
27958
|
+
* and automatically expands width if needed.
|
|
27959
|
+
* @private
|
|
27960
|
+
* @param resizeOrigin - Which side was used for resizing ('left' or 'right')
|
|
27654
27961
|
*/
|
|
27655
27962
|
safetySnapWidth(resizeOrigin) {
|
|
27656
27963
|
// For Textbox objects, we always want to check for clipping regardless of isWrapping flag
|
|
@@ -27680,7 +27987,7 @@ class Textbox extends IText {
|
|
|
27680
27987
|
const safetyThreshold = 2; // px - very subtle trigger
|
|
27681
27988
|
|
|
27682
27989
|
if (maxRequiredWidth > this.width - safetyThreshold) {
|
|
27683
|
-
var _this$
|
|
27990
|
+
var _this$canvas6;
|
|
27684
27991
|
// Set width to exactly what's needed + minimal safety margin
|
|
27685
27992
|
const newWidth = maxRequiredWidth + 1; // Add just 1px safety margin
|
|
27686
27993
|
|
|
@@ -27689,7 +27996,7 @@ class Textbox extends IText {
|
|
|
27689
27996
|
const originalTop = this.top;
|
|
27690
27997
|
const widthIncrease = newWidth - this.width;
|
|
27691
27998
|
|
|
27692
|
-
// Change width
|
|
27999
|
+
// Change width
|
|
27693
28000
|
this.set('width', newWidth);
|
|
27694
28001
|
|
|
27695
28002
|
// Force text layout recalculation
|
|
@@ -27701,8 +28008,8 @@ class Textbox extends IText {
|
|
|
27701
28008
|
// When resizing from left, the expansion pushes text right
|
|
27702
28009
|
// Compensate by moving the textbox left by the width increase
|
|
27703
28010
|
this.set({
|
|
27704
|
-
|
|
27705
|
-
|
|
28011
|
+
left: originalLeft - widthIncrease,
|
|
28012
|
+
top: originalTop
|
|
27706
28013
|
});
|
|
27707
28014
|
}
|
|
27708
28015
|
this.setCoords();
|
|
@@ -27713,13 +28020,13 @@ class Textbox extends IText {
|
|
|
27713
28020
|
this.__overlayEditor.refresh();
|
|
27714
28021
|
}, 0);
|
|
27715
28022
|
}
|
|
27716
|
-
(_this$
|
|
28023
|
+
(_this$canvas6 = this.canvas) === null || _this$canvas6 === void 0 || _this$canvas6.requestRenderAll();
|
|
27717
28024
|
}
|
|
27718
28025
|
}
|
|
27719
28026
|
|
|
27720
|
-
/**
|
|
27721
|
-
* Fix character selection mismatch after JSON loading for browser-wrapped fonts
|
|
27722
|
-
* @private
|
|
28027
|
+
/**
|
|
28028
|
+
* Fix character selection mismatch after JSON loading for browser-wrapped fonts
|
|
28029
|
+
* @private
|
|
27723
28030
|
*/
|
|
27724
28031
|
_fixCharacterMappingAfterJsonLoad() {
|
|
27725
28032
|
if (this._usingBrowserWrapping) {
|
|
@@ -27739,9 +28046,9 @@ class Textbox extends IText {
|
|
|
27739
28046
|
}
|
|
27740
28047
|
}
|
|
27741
28048
|
|
|
27742
|
-
/**
|
|
27743
|
-
* Force complete textbox re-initialization (useful after JSON loading)
|
|
27744
|
-
* Overrides Text version with Textbox-specific logic
|
|
28049
|
+
/**
|
|
28050
|
+
* Force complete textbox re-initialization (useful after JSON loading)
|
|
28051
|
+
* Overrides Text version with Textbox-specific logic
|
|
27745
28052
|
*/
|
|
27746
28053
|
forceTextReinitialization() {
|
|
27747
28054
|
console.log('🔄 Force reinitializing Textbox object');
|
|
@@ -27764,7 +28071,7 @@ class Textbox extends IText {
|
|
|
27764
28071
|
// Double-check that justify was applied by checking space widths
|
|
27765
28072
|
if (this.textAlign.includes('justify') && this.__charBounds) {
|
|
27766
28073
|
setTimeout(() => {
|
|
27767
|
-
var _this$
|
|
28074
|
+
var _this$canvas7;
|
|
27768
28075
|
// Verify justify was applied by checking if space widths vary
|
|
27769
28076
|
let hasVariableSpaces = false;
|
|
27770
28077
|
this.__charBounds.forEach((lineBounds, i) => {
|
|
@@ -27793,36 +28100,118 @@ class Textbox extends IText {
|
|
|
27793
28100
|
this.height = this.calcTextHeight();
|
|
27794
28101
|
console.log(`🔧 JUSTIFY: Used calcTextHeight: ${this.height}px`);
|
|
27795
28102
|
}
|
|
27796
|
-
(_this$
|
|
28103
|
+
(_this$canvas7 = this.canvas) === null || _this$canvas7 === void 0 || _this$canvas7.requestRenderAll();
|
|
27797
28104
|
}, 10);
|
|
27798
28105
|
}
|
|
27799
28106
|
}
|
|
27800
28107
|
|
|
27801
|
-
/**
|
|
27802
|
-
*
|
|
27803
|
-
* @
|
|
27804
|
-
|
|
28108
|
+
/**
|
|
28109
|
+
* Fix justify text after JSON loading - call this after fromObject
|
|
28110
|
+
* @public
|
|
28111
|
+
*/
|
|
28112
|
+
fixJustifyAfterJSONLoad() {
|
|
28113
|
+
if (this.textAlign.includes('justify') && this.useOverlayEditing) {
|
|
28114
|
+
console.log('🔧 JSON FIX: Fixing justify text after JSON load');
|
|
28115
|
+
// The issue is that enlargeSpaces() isn't properly updating after JSON load
|
|
28116
|
+
// Workaround: temporarily change width to trigger proper rebuild, then restore
|
|
28117
|
+
setTimeout(() => {
|
|
28118
|
+
const originalWidth = this.width;
|
|
28119
|
+
console.log('🔄 JSON TRICK: Temporarily changing width to force justify rebuild');
|
|
28120
|
+
|
|
28121
|
+
// Temporarily change width by 1px to trigger proper justify recalculation
|
|
28122
|
+
this.width = originalWidth + 1;
|
|
28123
|
+
this.initDimensions();
|
|
28124
|
+
|
|
28125
|
+
// Restore original width - this will trigger the proper justify calculation
|
|
28126
|
+
setTimeout(() => {
|
|
28127
|
+
var _this$canvas8;
|
|
28128
|
+
this.width = originalWidth;
|
|
28129
|
+
this.initDimensions();
|
|
28130
|
+
(_this$canvas8 = this.canvas) === null || _this$canvas8 === void 0 || _this$canvas8.requestRenderAll();
|
|
28131
|
+
console.log('✅ JSON FIX: Restored original width, justify should be fixed');
|
|
28132
|
+
}, 50);
|
|
28133
|
+
}, 100);
|
|
28134
|
+
}
|
|
28135
|
+
}
|
|
28136
|
+
|
|
28137
|
+
/**
|
|
28138
|
+
* Returns object representation of an instance
|
|
28139
|
+
* @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output
|
|
28140
|
+
* @return {Object} object representation of an instance
|
|
27805
28141
|
*/
|
|
27806
28142
|
toObject() {
|
|
27807
28143
|
let propertiesToInclude = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
27808
|
-
|
|
28144
|
+
const obj = super.toObject(['minWidth', 'splitByGrapheme', ...propertiesToInclude]);
|
|
28145
|
+
|
|
28146
|
+
// For justify text with overlay editing, ensure measurements are available
|
|
28147
|
+
if (this.textAlign.includes('justify') && this.useOverlayEditing) {
|
|
28148
|
+
var _charBounds, _charBounds2;
|
|
28149
|
+
// If character bounds don't exist yet, initialize dimensions to calculate them
|
|
28150
|
+
if (!((_charBounds = this.__charBounds) !== null && _charBounds !== void 0 && _charBounds.length)) {
|
|
28151
|
+
console.log('🔧 SERIALIZE: Character bounds missing, initializing dimensions for justify text');
|
|
28152
|
+
this.initDimensions();
|
|
28153
|
+
}
|
|
28154
|
+
|
|
28155
|
+
// Now save the measurements if they exist
|
|
28156
|
+
if ((_charBounds2 = this.__charBounds) !== null && _charBounds2 !== void 0 && _charBounds2.length) {
|
|
28157
|
+
console.log('💾 SERIALIZE: Saving justify measurements to JSON');
|
|
28158
|
+
obj._justifyMeasurements = {
|
|
28159
|
+
__charBounds: this.__charBounds,
|
|
28160
|
+
__lineHeights: this.__lineHeights,
|
|
28161
|
+
__lineWidths: this.__lineWidths,
|
|
28162
|
+
_hasJustifyData: true
|
|
28163
|
+
};
|
|
28164
|
+
} else {
|
|
28165
|
+
console.warn('⚠️ SERIALIZE: Could not generate character bounds for justify text');
|
|
28166
|
+
}
|
|
28167
|
+
}
|
|
28168
|
+
return obj;
|
|
28169
|
+
}
|
|
28170
|
+
|
|
28171
|
+
/**
|
|
28172
|
+
* Override _set to handle justify measurements during JSON loading
|
|
28173
|
+
* @private
|
|
28174
|
+
*/
|
|
28175
|
+
_set(key, value) {
|
|
28176
|
+
const result = super._set(key, value);
|
|
28177
|
+
|
|
28178
|
+
// Restore justify measurements if they exist in the JSON data
|
|
28179
|
+
if (key === '_justifyMeasurements' && value && value._hasJustifyData) {
|
|
28180
|
+
console.log('🔄 DESERIALIZE: Restoring justify measurements from JSON');
|
|
28181
|
+
this.__charBounds = value.__charBounds;
|
|
28182
|
+
this.__lineHeights = value.__lineHeights;
|
|
28183
|
+
this.__lineWidths = value.__lineWidths;
|
|
28184
|
+
|
|
28185
|
+
// Mark that we have restored data so we don't interfere with it
|
|
28186
|
+
this._hasRestoredJustifyData = true;
|
|
28187
|
+
|
|
28188
|
+
// Automatically trigger the fix after JSON loading
|
|
28189
|
+
if (this.textAlign.includes('justify') && this.useOverlayEditing) {
|
|
28190
|
+
console.log('🔄 AUTO-FIX: Calling fixJustifyAfterJSONLoad after restoring justify measurements');
|
|
28191
|
+
// Use setTimeout to ensure this runs after all object initialization is complete
|
|
28192
|
+
setTimeout(() => {
|
|
28193
|
+
this.fixJustifyAfterJSONLoad();
|
|
28194
|
+
}, 10);
|
|
28195
|
+
}
|
|
28196
|
+
}
|
|
28197
|
+
return result;
|
|
27809
28198
|
}
|
|
27810
28199
|
}
|
|
27811
|
-
/**
|
|
27812
|
-
* Minimum width of textbox, in pixels.
|
|
27813
|
-
* @type Number
|
|
27814
|
-
*/
|
|
27815
|
-
/**
|
|
27816
|
-
* Minimum calculated width of a textbox, in pixels.
|
|
27817
|
-
* fixed to 2 so that an empty textbox cannot go to 0
|
|
27818
|
-
* and is still selectable without text.
|
|
27819
|
-
* @type Number
|
|
27820
|
-
*/
|
|
27821
|
-
/**
|
|
27822
|
-
* Use this boolean property in order to split strings that have no white space concept.
|
|
27823
|
-
* this is a cheap way to help with chinese/japanese
|
|
27824
|
-
* @type Boolean
|
|
27825
|
-
* @since 2.6.0
|
|
28200
|
+
/**
|
|
28201
|
+
* Minimum width of textbox, in pixels.
|
|
28202
|
+
* @type Number
|
|
28203
|
+
*/
|
|
28204
|
+
/**
|
|
28205
|
+
* Minimum calculated width of a textbox, in pixels.
|
|
28206
|
+
* fixed to 2 so that an empty textbox cannot go to 0
|
|
28207
|
+
* and is still selectable without text.
|
|
28208
|
+
* @type Number
|
|
28209
|
+
*/
|
|
28210
|
+
/**
|
|
28211
|
+
* Use this boolean property in order to split strings that have no white space concept.
|
|
28212
|
+
* this is a cheap way to help with chinese/japanese
|
|
28213
|
+
* @type Boolean
|
|
28214
|
+
* @since 2.6.0
|
|
27826
28215
|
*/
|
|
27827
28216
|
_defineProperty(Textbox, "type", 'Textbox');
|
|
27828
28217
|
_defineProperty(Textbox, "textLayoutProperties", [...IText.textLayoutProperties, 'width']);
|