@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.mjs
CHANGED
|
@@ -354,7 +354,7 @@ class Cache {
|
|
|
354
354
|
}
|
|
355
355
|
const cache = new Cache();
|
|
356
356
|
|
|
357
|
-
var version = "7.0.1-
|
|
357
|
+
var version = "7.0.1-beta14";
|
|
358
358
|
|
|
359
359
|
// use this syntax so babel plugin see this import here
|
|
360
360
|
const VERSION = version;
|
|
@@ -19183,8 +19183,8 @@ _defineProperty(StyledText, "_styleProperties", styleProperties);
|
|
|
19183
19183
|
// Global measurement context - reused for performance
|
|
19184
19184
|
let measurementContext = null;
|
|
19185
19185
|
|
|
19186
|
-
/**
|
|
19187
|
-
* Get or create the shared measurement context
|
|
19186
|
+
/**
|
|
19187
|
+
* Get or create the shared measurement context
|
|
19188
19188
|
*/
|
|
19189
19189
|
function getMeasurementContext() {
|
|
19190
19190
|
if (!measurementContext) {
|
|
@@ -19197,8 +19197,8 @@ function getMeasurementContext() {
|
|
|
19197
19197
|
return measurementContext;
|
|
19198
19198
|
}
|
|
19199
19199
|
|
|
19200
|
-
/**
|
|
19201
|
-
* Measure a single grapheme
|
|
19200
|
+
/**
|
|
19201
|
+
* Measure a single grapheme
|
|
19202
19202
|
*/
|
|
19203
19203
|
function measureGrapheme(grapheme, options, ctx) {
|
|
19204
19204
|
// Check cache first
|
|
@@ -19231,8 +19231,8 @@ function measureGrapheme(grapheme, options, ctx) {
|
|
|
19231
19231
|
return measurement;
|
|
19232
19232
|
}
|
|
19233
19233
|
|
|
19234
|
-
/**
|
|
19235
|
-
* Measure a grapheme with kerning relative to previous character
|
|
19234
|
+
/**
|
|
19235
|
+
* Measure a grapheme with kerning relative to previous character
|
|
19236
19236
|
*/
|
|
19237
19237
|
function measureGraphemeWithKerning(grapheme, previousGrapheme, options, ctx) {
|
|
19238
19238
|
// Get individual measurement
|
|
@@ -19273,9 +19273,9 @@ function measureGraphemeWithKerning(grapheme, previousGrapheme, options, ctx) {
|
|
|
19273
19273
|
};
|
|
19274
19274
|
}
|
|
19275
19275
|
|
|
19276
|
-
/**
|
|
19277
|
-
* Get a representative character for font metrics measurement
|
|
19278
|
-
* Uses canvas to test which scripts the font actually supports
|
|
19276
|
+
/**
|
|
19277
|
+
* Get a representative character for font metrics measurement
|
|
19278
|
+
* Uses canvas to test which scripts the font actually supports
|
|
19279
19279
|
*/
|
|
19280
19280
|
function getRepresentativeCharacter(fontFamily) {
|
|
19281
19281
|
const context = getMeasurementContext();
|
|
@@ -19364,8 +19364,8 @@ function getRepresentativeCharacter(fontFamily) {
|
|
|
19364
19364
|
return 'M';
|
|
19365
19365
|
}
|
|
19366
19366
|
|
|
19367
|
-
/**
|
|
19368
|
-
* Get font metrics for layout calculations
|
|
19367
|
+
/**
|
|
19368
|
+
* Get font metrics for layout calculations
|
|
19369
19369
|
*/
|
|
19370
19370
|
function getFontMetrics(options) {
|
|
19371
19371
|
var _metrics$fontBounding, _metrics$fontBounding2, _metrics$actualBoundi, _metrics$actualBoundi2;
|
|
@@ -19401,8 +19401,8 @@ function getFontMetrics(options) {
|
|
|
19401
19401
|
return result;
|
|
19402
19402
|
}
|
|
19403
19403
|
|
|
19404
|
-
/**
|
|
19405
|
-
* Apply font styling to canvas context
|
|
19404
|
+
/**
|
|
19405
|
+
* Apply font styling to canvas context
|
|
19406
19406
|
*/
|
|
19407
19407
|
function applyFontStyle(ctx, options) {
|
|
19408
19408
|
const fontDeclaration = getFontDeclaration(options);
|
|
@@ -19419,8 +19419,8 @@ function applyFontStyle(ctx, options) {
|
|
|
19419
19419
|
ctx.textBaseline = 'alphabetic';
|
|
19420
19420
|
}
|
|
19421
19421
|
|
|
19422
|
-
/**
|
|
19423
|
-
* Generate font declaration string
|
|
19422
|
+
/**
|
|
19423
|
+
* Generate font declaration string
|
|
19424
19424
|
*/
|
|
19425
19425
|
function getFontDeclaration(options) {
|
|
19426
19426
|
const {
|
|
@@ -19439,8 +19439,8 @@ function getFontDeclaration(options) {
|
|
|
19439
19439
|
return `${fontStyle} ${fontWeight} ${fontSize}px ${normalizedFamily}`;
|
|
19440
19440
|
}
|
|
19441
19441
|
|
|
19442
|
-
/**
|
|
19443
|
-
* LRU Cache implementation for measurements
|
|
19442
|
+
/**
|
|
19443
|
+
* LRU Cache implementation for measurements
|
|
19444
19444
|
*/
|
|
19445
19445
|
class LRUCache {
|
|
19446
19446
|
constructor() {
|
|
@@ -19502,8 +19502,8 @@ class LRUCache {
|
|
|
19502
19502
|
}
|
|
19503
19503
|
}
|
|
19504
19504
|
|
|
19505
|
-
/**
|
|
19506
|
-
* Advanced measurement cache with font-aware keys
|
|
19505
|
+
/**
|
|
19506
|
+
* Advanced measurement cache with font-aware keys
|
|
19507
19507
|
*/
|
|
19508
19508
|
class MeasurementCache {
|
|
19509
19509
|
constructor() {
|
|
@@ -19530,8 +19530,8 @@ class MeasurementCache {
|
|
|
19530
19530
|
}
|
|
19531
19531
|
}
|
|
19532
19532
|
|
|
19533
|
-
/**
|
|
19534
|
-
* Kerning cache for character pairs
|
|
19533
|
+
/**
|
|
19534
|
+
* Kerning cache for character pairs
|
|
19535
19535
|
*/
|
|
19536
19536
|
class KerningCache {
|
|
19537
19537
|
constructor() {
|
|
@@ -19559,8 +19559,8 @@ class KerningCache {
|
|
|
19559
19559
|
}
|
|
19560
19560
|
}
|
|
19561
19561
|
|
|
19562
|
-
/**
|
|
19563
|
-
* Font metrics cache
|
|
19562
|
+
/**
|
|
19563
|
+
* Font metrics cache
|
|
19564
19564
|
*/
|
|
19565
19565
|
class FontMetricsCache {
|
|
19566
19566
|
constructor() {
|
|
@@ -19595,8 +19595,8 @@ if (typeof document !== 'undefined' && 'fonts' in document) {
|
|
|
19595
19595
|
});
|
|
19596
19596
|
}
|
|
19597
19597
|
|
|
19598
|
-
/**
|
|
19599
|
-
* Clear all measurement caches
|
|
19598
|
+
/**
|
|
19599
|
+
* Clear all measurement caches
|
|
19600
19600
|
*/
|
|
19601
19601
|
function clearAllCaches() {
|
|
19602
19602
|
measurementCache.clear();
|
|
@@ -19604,9 +19604,9 @@ function clearAllCaches() {
|
|
|
19604
19604
|
fontMetricsCache.clear();
|
|
19605
19605
|
}
|
|
19606
19606
|
|
|
19607
|
-
/**
|
|
19608
|
-
* Detect if a font lacks English glyph support
|
|
19609
|
-
* These fonts should use browser-native measurement instead of Fabric's character-by-character measurement
|
|
19607
|
+
/**
|
|
19608
|
+
* Detect if a font lacks English glyph support
|
|
19609
|
+
* These fonts should use browser-native measurement instead of Fabric's character-by-character measurement
|
|
19610
19610
|
*/
|
|
19611
19611
|
function fontLacksEnglishGlyphs(fontFamily) {
|
|
19612
19612
|
if (typeof document === 'undefined') return false;
|
|
@@ -19650,8 +19650,8 @@ function fontLacksEnglishGlyphs(fontFamily) {
|
|
|
19650
19650
|
// Cache for font glyph detection results
|
|
19651
19651
|
const fontGlyphCache = new Map();
|
|
19652
19652
|
|
|
19653
|
-
/**
|
|
19654
|
-
* Cached version of font glyph detection
|
|
19653
|
+
/**
|
|
19654
|
+
* Cached version of font glyph detection
|
|
19655
19655
|
*/
|
|
19656
19656
|
function fontLacksEnglishGlyphsCached(fontFamily) {
|
|
19657
19657
|
if (fontGlyphCache.has(fontFamily)) {
|
|
@@ -19662,17 +19662,17 @@ function fontLacksEnglishGlyphsCached(fontFamily) {
|
|
|
19662
19662
|
return result;
|
|
19663
19663
|
}
|
|
19664
19664
|
|
|
19665
|
-
/**
|
|
19666
|
-
* Unicode and Internationalization Support
|
|
19667
|
-
*
|
|
19668
|
-
* Enhanced Unicode handling for complex scripts, RTL/LTR text,
|
|
19669
|
-
* and grapheme cluster boundary detection.
|
|
19665
|
+
/**
|
|
19666
|
+
* Unicode and Internationalization Support
|
|
19667
|
+
*
|
|
19668
|
+
* Enhanced Unicode handling for complex scripts, RTL/LTR text,
|
|
19669
|
+
* and grapheme cluster boundary detection.
|
|
19670
19670
|
*/
|
|
19671
19671
|
|
|
19672
19672
|
|
|
19673
|
-
/**
|
|
19674
|
-
* Enhanced grapheme segmentation using Intl.Segmenter when available
|
|
19675
|
-
* with fallback to existing graphemeSplit implementation
|
|
19673
|
+
/**
|
|
19674
|
+
* Enhanced grapheme segmentation using Intl.Segmenter when available
|
|
19675
|
+
* with fallback to existing graphemeSplit implementation
|
|
19676
19676
|
*/
|
|
19677
19677
|
function segmentGraphemes(text) {
|
|
19678
19678
|
// Use native Intl.Segmenter if available
|
|
@@ -19692,15 +19692,15 @@ function segmentGraphemes(text) {
|
|
|
19692
19692
|
return graphemeSplit(text);
|
|
19693
19693
|
}
|
|
19694
19694
|
|
|
19695
|
-
/**
|
|
19696
|
-
* Ellipsis Text Truncation System
|
|
19697
|
-
*
|
|
19698
|
-
* Implements text truncation with ellipsis when content exceeds bounds,
|
|
19699
|
-
* using binary search for optimal truncation points.
|
|
19695
|
+
/**
|
|
19696
|
+
* Ellipsis Text Truncation System
|
|
19697
|
+
*
|
|
19698
|
+
* Implements text truncation with ellipsis when content exceeds bounds,
|
|
19699
|
+
* using binary search for optimal truncation points.
|
|
19700
19700
|
*/
|
|
19701
19701
|
|
|
19702
|
-
/**
|
|
19703
|
-
* Apply ellipsis truncation to text based on width/height constraints
|
|
19702
|
+
/**
|
|
19703
|
+
* Apply ellipsis truncation to text based on width/height constraints
|
|
19704
19704
|
*/
|
|
19705
19705
|
function applyEllipsis(text, options) {
|
|
19706
19706
|
const {
|
|
@@ -19770,8 +19770,8 @@ function applyEllipsis(text, options) {
|
|
|
19770
19770
|
};
|
|
19771
19771
|
}
|
|
19772
19772
|
|
|
19773
|
-
/**
|
|
19774
|
-
* Truncate text based on width constraint using binary search
|
|
19773
|
+
/**
|
|
19774
|
+
* Truncate text based on width constraint using binary search
|
|
19775
19775
|
*/
|
|
19776
19776
|
function truncateByWidth(text, maxWidth, ellipsisChar, ellipsisWidth, measureFn) {
|
|
19777
19777
|
const graphemes = segmentGraphemes(text);
|
|
@@ -19821,8 +19821,8 @@ function truncateByWidth(text, maxWidth, ellipsisChar, ellipsisWidth, measureFn)
|
|
|
19821
19821
|
};
|
|
19822
19822
|
}
|
|
19823
19823
|
|
|
19824
|
-
/**
|
|
19825
|
-
* Truncate text based on height constraint
|
|
19824
|
+
/**
|
|
19825
|
+
* Truncate text based on height constraint
|
|
19826
19826
|
*/
|
|
19827
19827
|
function truncateByHeight(text, maxHeight, ellipsisChar, measureFn) {
|
|
19828
19828
|
var _measureFn;
|
|
@@ -19870,19 +19870,19 @@ function truncateByHeight(text, maxHeight, ellipsisChar, measureFn) {
|
|
|
19870
19870
|
return truncateByWidth(lines[0], firstLineWidth, ellipsisChar, 0, measureFn);
|
|
19871
19871
|
}
|
|
19872
19872
|
|
|
19873
|
-
/**
|
|
19874
|
-
* Core Text Layout Engine
|
|
19875
|
-
*
|
|
19876
|
-
* Implements Konva-compatible text layout with support for:
|
|
19877
|
-
* - Multiple wrap modes (word/char/none)
|
|
19878
|
-
* - Ellipsis truncation
|
|
19879
|
-
* - Justify alignment with proper space distribution
|
|
19880
|
-
* - RTL/LTR text direction
|
|
19881
|
-
* - Advanced grapheme handling
|
|
19873
|
+
/**
|
|
19874
|
+
* Core Text Layout Engine
|
|
19875
|
+
*
|
|
19876
|
+
* Implements Konva-compatible text layout with support for:
|
|
19877
|
+
* - Multiple wrap modes (word/char/none)
|
|
19878
|
+
* - Ellipsis truncation
|
|
19879
|
+
* - Justify alignment with proper space distribution
|
|
19880
|
+
* - RTL/LTR text direction
|
|
19881
|
+
* - Advanced grapheme handling
|
|
19882
19882
|
*/
|
|
19883
19883
|
|
|
19884
|
-
/**
|
|
19885
|
-
* Main text layout function - converts text and options into positioned layout
|
|
19884
|
+
/**
|
|
19885
|
+
* Main text layout function - converts text and options into positioned layout
|
|
19886
19886
|
*/
|
|
19887
19887
|
function layoutText(options) {
|
|
19888
19888
|
var _ellipsisResult;
|
|
@@ -20001,8 +20001,8 @@ function layoutText(options) {
|
|
|
20001
20001
|
};
|
|
20002
20002
|
}
|
|
20003
20003
|
|
|
20004
|
-
/**
|
|
20005
|
-
* Layout a single paragraph with wrapping
|
|
20004
|
+
/**
|
|
20005
|
+
* Layout a single paragraph with wrapping
|
|
20006
20006
|
*/
|
|
20007
20007
|
function layoutParagraph(text, options) {
|
|
20008
20008
|
const {
|
|
@@ -20037,8 +20037,8 @@ function layoutParagraph(text, options) {
|
|
|
20037
20037
|
return layoutLines;
|
|
20038
20038
|
}
|
|
20039
20039
|
|
|
20040
|
-
/**
|
|
20041
|
-
* Layout a single line of text (no wrapping)
|
|
20040
|
+
/**
|
|
20041
|
+
* Layout a single line of text (no wrapping)
|
|
20042
20042
|
*/
|
|
20043
20043
|
function layoutSingleLine(text, options) {
|
|
20044
20044
|
let textOffset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
@@ -20108,8 +20108,8 @@ function layoutSingleLine(text, options) {
|
|
|
20108
20108
|
};
|
|
20109
20109
|
}
|
|
20110
20110
|
|
|
20111
|
-
/**
|
|
20112
|
-
* Word-based wrapping algorithm
|
|
20111
|
+
/**
|
|
20112
|
+
* Word-based wrapping algorithm
|
|
20113
20113
|
*/
|
|
20114
20114
|
function wrapByWords(text, maxWidth, options) {
|
|
20115
20115
|
const lines = [];
|
|
@@ -20142,8 +20142,8 @@ function wrapByWords(text, maxWidth, options) {
|
|
|
20142
20142
|
return lines.length > 0 ? lines : [''];
|
|
20143
20143
|
}
|
|
20144
20144
|
|
|
20145
|
-
/**
|
|
20146
|
-
* Character-based wrapping algorithm
|
|
20145
|
+
/**
|
|
20146
|
+
* Character-based wrapping algorithm
|
|
20147
20147
|
*/
|
|
20148
20148
|
function wrapByCharacters(text, maxWidth, options) {
|
|
20149
20149
|
const lines = [];
|
|
@@ -20165,8 +20165,8 @@ function wrapByCharacters(text, maxWidth, options) {
|
|
|
20165
20165
|
return lines.length > 0 ? lines : [''];
|
|
20166
20166
|
}
|
|
20167
20167
|
|
|
20168
|
-
/**
|
|
20169
|
-
* Apply text alignment to lines
|
|
20168
|
+
/**
|
|
20169
|
+
* Apply text alignment to lines
|
|
20170
20170
|
*/
|
|
20171
20171
|
function applyAlignment(lines, align, containerWidth, options) {
|
|
20172
20172
|
return lines.map(line => {
|
|
@@ -20200,8 +20200,8 @@ function applyAlignment(lines, align, containerWidth, options) {
|
|
|
20200
20200
|
});
|
|
20201
20201
|
}
|
|
20202
20202
|
|
|
20203
|
-
/**
|
|
20204
|
-
* Apply justify alignment by expanding spaces
|
|
20203
|
+
/**
|
|
20204
|
+
* Apply justify alignment by expanding spaces
|
|
20205
20205
|
*/
|
|
20206
20206
|
function applyJustification(line, containerWidth, options) {
|
|
20207
20207
|
const spaces = line.graphemes.filter(g => /\s/.test(g)).length;
|
|
@@ -20224,8 +20224,8 @@ function applyJustification(line, containerWidth, options) {
|
|
|
20224
20224
|
return line;
|
|
20225
20225
|
}
|
|
20226
20226
|
|
|
20227
|
-
/**
|
|
20228
|
-
* Calculate vertical alignment offset
|
|
20227
|
+
/**
|
|
20228
|
+
* Calculate vertical alignment offset
|
|
20229
20229
|
*/
|
|
20230
20230
|
function calculateVerticalOffset(contentHeight, containerHeight, align) {
|
|
20231
20231
|
switch (align) {
|
|
@@ -20239,8 +20239,8 @@ function calculateVerticalOffset(contentHeight, containerHeight, align) {
|
|
|
20239
20239
|
}
|
|
20240
20240
|
}
|
|
20241
20241
|
|
|
20242
|
-
/**
|
|
20243
|
-
* Handle height overflow with ellipsis
|
|
20242
|
+
/**
|
|
20243
|
+
* Handle height overflow with ellipsis
|
|
20244
20244
|
*/
|
|
20245
20245
|
function handleHeightOverflow(existingLines, overflowLine, remainingHeight, options) {
|
|
20246
20246
|
// If ellipsis is enabled, try to fit part of the overflow line
|
|
@@ -20269,8 +20269,8 @@ function handleHeightOverflow(existingLines, overflowLine, remainingHeight, opti
|
|
|
20269
20269
|
};
|
|
20270
20270
|
}
|
|
20271
20271
|
|
|
20272
|
-
/**
|
|
20273
|
-
* Create empty line for empty paragraphs
|
|
20272
|
+
/**
|
|
20273
|
+
* Create empty line for empty paragraphs
|
|
20274
20274
|
*/
|
|
20275
20275
|
function createEmptyLine(options) {
|
|
20276
20276
|
const height = options.fontSize * options.lineHeight;
|
|
@@ -20286,8 +20286,8 @@ function createEmptyLine(options) {
|
|
|
20286
20286
|
};
|
|
20287
20287
|
}
|
|
20288
20288
|
|
|
20289
|
-
/**
|
|
20290
|
-
* Measure width of a line of text
|
|
20289
|
+
/**
|
|
20290
|
+
* Measure width of a line of text
|
|
20291
20291
|
*/
|
|
20292
20292
|
function measureLineWidth(text, options) {
|
|
20293
20293
|
const graphemes = segmentGraphemes(text);
|
|
@@ -20304,8 +20304,8 @@ function measureLineWidth(text, options) {
|
|
|
20304
20304
|
return width;
|
|
20305
20305
|
}
|
|
20306
20306
|
|
|
20307
|
-
/**
|
|
20308
|
-
* Convert layout options to measurement options
|
|
20307
|
+
/**
|
|
20308
|
+
* Convert layout options to measurement options
|
|
20309
20309
|
*/
|
|
20310
20310
|
function createMeasurementOptions(options) {
|
|
20311
20311
|
return {
|
|
@@ -20548,15 +20548,15 @@ class TextSVGExportMixin extends FabricObjectSVGExportMixin {
|
|
|
20548
20548
|
}
|
|
20549
20549
|
}
|
|
20550
20550
|
|
|
20551
|
-
/**
|
|
20552
|
-
* Browser Line Break Extraction
|
|
20553
|
-
*
|
|
20554
|
-
* Captures exact line breaks as rendered by the browser to ensure
|
|
20555
|
-
* pixel-perfect consistency between DOM editing and canvas rendering.
|
|
20551
|
+
/**
|
|
20552
|
+
* Browser Line Break Extraction
|
|
20553
|
+
*
|
|
20554
|
+
* Captures exact line breaks as rendered by the browser to ensure
|
|
20555
|
+
* pixel-perfect consistency between DOM editing and canvas rendering.
|
|
20556
20556
|
*/
|
|
20557
20557
|
|
|
20558
|
-
/**
|
|
20559
|
-
* Segment text into graphemes safely using Intl.Segmenter or fallback
|
|
20558
|
+
/**
|
|
20559
|
+
* Segment text into graphemes safely using Intl.Segmenter or fallback
|
|
20560
20560
|
*/
|
|
20561
20561
|
function segmentIntoGraphemes(text) {
|
|
20562
20562
|
if (typeof Intl !== 'undefined' && Intl.Segmenter) {
|
|
@@ -20570,9 +20570,9 @@ function segmentIntoGraphemes(text) {
|
|
|
20570
20570
|
return Array.from(text);
|
|
20571
20571
|
}
|
|
20572
20572
|
|
|
20573
|
-
/**
|
|
20574
|
-
* Extract line break information from a textarea by creating a mirror element
|
|
20575
|
-
* with identical computed styles and measuring grapheme positions.
|
|
20573
|
+
/**
|
|
20574
|
+
* Extract line break information from a textarea by creating a mirror element
|
|
20575
|
+
* with identical computed styles and measuring grapheme positions.
|
|
20576
20576
|
*/
|
|
20577
20577
|
function extractLinesFromDOM(textarea) {
|
|
20578
20578
|
const text = textarea.value;
|
|
@@ -20580,7 +20580,8 @@ function extractLinesFromDOM(textarea) {
|
|
|
20580
20580
|
return {
|
|
20581
20581
|
lines: [],
|
|
20582
20582
|
totalWidth: 0,
|
|
20583
|
-
totalHeight: 0
|
|
20583
|
+
totalHeight: 0,
|
|
20584
|
+
width: 0
|
|
20584
20585
|
};
|
|
20585
20586
|
}
|
|
20586
20587
|
|
|
@@ -20609,6 +20610,8 @@ function extractLinesFromDOM(textarea) {
|
|
|
20609
20610
|
mirror.style.overflow = 'hidden';
|
|
20610
20611
|
mirror.style.resize = 'none';
|
|
20611
20612
|
container.appendChild(mirror);
|
|
20613
|
+
// capture the width the browser is using for layout
|
|
20614
|
+
const width = mirror.clientWidth;
|
|
20612
20615
|
try {
|
|
20613
20616
|
// Segment text into graphemes
|
|
20614
20617
|
const graphemes = segmentIntoGraphemes(text);
|
|
@@ -20659,7 +20662,8 @@ function extractLinesFromDOM(textarea) {
|
|
|
20659
20662
|
return {
|
|
20660
20663
|
lines,
|
|
20661
20664
|
totalWidth,
|
|
20662
|
-
totalHeight
|
|
20665
|
+
totalHeight,
|
|
20666
|
+
width
|
|
20663
20667
|
};
|
|
20664
20668
|
} finally {
|
|
20665
20669
|
// Clean up mirror element
|
|
@@ -20667,16 +20671,16 @@ function extractLinesFromDOM(textarea) {
|
|
|
20667
20671
|
}
|
|
20668
20672
|
}
|
|
20669
20673
|
|
|
20670
|
-
/**
|
|
20671
|
-
* Create a hash of layout-affecting properties to detect when browser lines are still valid
|
|
20674
|
+
/**
|
|
20675
|
+
* Create a hash of layout-affecting properties to detect when browser lines are still valid
|
|
20672
20676
|
*/
|
|
20673
20677
|
function createLayoutHash(target) {
|
|
20674
20678
|
const properties = [target.text, target.width, target.height, target.fontFamily, target.fontSize, target.fontWeight, target.fontStyle, target.lineHeight, target.charSpacing, target.textAlign, target.direction];
|
|
20675
20679
|
return properties.map(p => String(p)).join('|');
|
|
20676
20680
|
}
|
|
20677
20681
|
|
|
20678
|
-
/**
|
|
20679
|
-
* Check if stored browser lines are still valid for the current target state
|
|
20682
|
+
/**
|
|
20683
|
+
* Check if stored browser lines are still valid for the current target state
|
|
20680
20684
|
*/
|
|
20681
20685
|
function areBrowserLinesValid(target, storedHash) {
|
|
20682
20686
|
if (!storedHash || !target.__lastBrowserLines) {
|
|
@@ -20685,40 +20689,46 @@ function areBrowserLinesValid(target, storedHash) {
|
|
|
20685
20689
|
const currentHash = createLayoutHash(target);
|
|
20686
20690
|
return currentHash === storedHash;
|
|
20687
20691
|
}
|
|
20688
|
-
|
|
20689
|
-
|
|
20690
|
-
* Store browser lines on a target object with validity hash
|
|
20692
|
+
/**
|
|
20693
|
+
* Store browser lines on a target object with validity hash
|
|
20691
20694
|
*/
|
|
20692
|
-
function storeBrowserLines(target, lines, layoutHash) {
|
|
20695
|
+
function storeBrowserLines(target, lines, width, layoutHash) {
|
|
20693
20696
|
target.__lastBrowserLines = lines;
|
|
20697
|
+
target.__lastBrowserLinesWidth = width;
|
|
20694
20698
|
target.__lastBrowserLinesHash = createLayoutHash(target);
|
|
20695
20699
|
}
|
|
20696
20700
|
|
|
20697
|
-
/**
|
|
20698
|
-
* Clear stored browser lines from a target object
|
|
20701
|
+
/**
|
|
20702
|
+
* Clear stored browser lines from a target object
|
|
20699
20703
|
*/
|
|
20700
20704
|
function clearBrowserLines(target) {
|
|
20701
20705
|
delete target.__lastBrowserLines;
|
|
20702
20706
|
delete target.__lastBrowserLinesHash;
|
|
20707
|
+
delete target.__lastBrowserLinesWidth;
|
|
20703
20708
|
}
|
|
20704
20709
|
|
|
20705
|
-
/**
|
|
20706
|
-
* Get stored browser lines if they're still valid
|
|
20710
|
+
/**
|
|
20711
|
+
* Get stored browser lines if they're still valid
|
|
20707
20712
|
*/
|
|
20708
20713
|
function getBrowserLines(target) {
|
|
20709
20714
|
const lines = target.__lastBrowserLines;
|
|
20710
20715
|
const hash = target.__lastBrowserLinesHash;
|
|
20711
20716
|
if (lines && areBrowserLinesValid(target, hash)) {
|
|
20712
|
-
return
|
|
20717
|
+
return {
|
|
20718
|
+
lines,
|
|
20719
|
+
totalWidth: 0,
|
|
20720
|
+
totalHeight: 0,
|
|
20721
|
+
width: target.__lastBrowserLinesWidth
|
|
20722
|
+
};
|
|
20713
20723
|
}
|
|
20714
20724
|
return null;
|
|
20715
20725
|
}
|
|
20716
20726
|
|
|
20717
20727
|
let measuringContext;
|
|
20718
20728
|
|
|
20719
|
-
/**
|
|
20720
|
-
* Return a context for measurement of text string.
|
|
20721
|
-
* if created it gets stored for reuse
|
|
20729
|
+
/**
|
|
20730
|
+
* Return a context for measurement of text string.
|
|
20731
|
+
* if created it gets stored for reuse
|
|
20722
20732
|
*/
|
|
20723
20733
|
function getMeasuringContext() {
|
|
20724
20734
|
if (!measuringContext) {
|
|
@@ -20731,17 +20741,17 @@ function getMeasuringContext() {
|
|
|
20731
20741
|
return measuringContext;
|
|
20732
20742
|
}
|
|
20733
20743
|
|
|
20734
|
-
/**
|
|
20735
|
-
* Measure and return the info of a single grapheme.
|
|
20736
|
-
* needs the the info of previous graphemes already filled
|
|
20737
|
-
* Override to customize measuring
|
|
20744
|
+
/**
|
|
20745
|
+
* Measure and return the info of a single grapheme.
|
|
20746
|
+
* needs the the info of previous graphemes already filled
|
|
20747
|
+
* Override to customize measuring
|
|
20738
20748
|
*/
|
|
20739
20749
|
|
|
20740
20750
|
// @TODO this is not complete
|
|
20741
20751
|
|
|
20742
|
-
/**
|
|
20743
|
-
* Text class
|
|
20744
|
-
* @see {@link http://fabricjs.com/fabric-intro-part-2#text}
|
|
20752
|
+
/**
|
|
20753
|
+
* Text class
|
|
20754
|
+
* @see {@link http://fabricjs.com/fabric-intro-part-2#text}
|
|
20745
20755
|
*/
|
|
20746
20756
|
class FabricText extends StyledText {
|
|
20747
20757
|
static getDefaults() {
|
|
@@ -20752,11 +20762,11 @@ class FabricText extends StyledText {
|
|
|
20752
20762
|
}
|
|
20753
20763
|
constructor(text, options) {
|
|
20754
20764
|
super();
|
|
20755
|
-
/**
|
|
20756
|
-
* contains characters bounding boxes
|
|
20757
|
-
* This variable is considered to be protected.
|
|
20758
|
-
* But for how mixins are implemented right now, we can't leave it private
|
|
20759
|
-
* @protected
|
|
20765
|
+
/**
|
|
20766
|
+
* contains characters bounding boxes
|
|
20767
|
+
* This variable is considered to be protected.
|
|
20768
|
+
* But for how mixins are implemented right now, we can't leave it private
|
|
20769
|
+
* @protected
|
|
20760
20770
|
*/
|
|
20761
20771
|
_defineProperty(this, "__charBounds", []);
|
|
20762
20772
|
Object.assign(this, FabricText.ownDefaults);
|
|
@@ -20773,9 +20783,9 @@ class FabricText extends StyledText {
|
|
|
20773
20783
|
this.setCoords();
|
|
20774
20784
|
}
|
|
20775
20785
|
|
|
20776
|
-
/**
|
|
20777
|
-
* If text has a path, it will add the extra information needed
|
|
20778
|
-
* for path and text calculations
|
|
20786
|
+
/**
|
|
20787
|
+
* If text has a path, it will add the extra information needed
|
|
20788
|
+
* for path and text calculations
|
|
20779
20789
|
*/
|
|
20780
20790
|
setPathInfo() {
|
|
20781
20791
|
const path = this.path;
|
|
@@ -20784,16 +20794,24 @@ class FabricText extends StyledText {
|
|
|
20784
20794
|
}
|
|
20785
20795
|
}
|
|
20786
20796
|
|
|
20787
|
-
/**
|
|
20788
|
-
* @private
|
|
20789
|
-
* Divides text into lines of text and lines of graphemes.
|
|
20790
|
-
* Uses browser lines when available for pixel-perfect consistency.
|
|
20797
|
+
/**
|
|
20798
|
+
* @private
|
|
20799
|
+
* Divides text into lines of text and lines of graphemes.
|
|
20800
|
+
* Uses browser lines when available for pixel-perfect consistency.
|
|
20791
20801
|
*/
|
|
20792
20802
|
_splitText() {
|
|
20793
|
-
//
|
|
20794
|
-
|
|
20795
|
-
|
|
20796
|
-
|
|
20803
|
+
// For justify text with overlay editing, always use normal fabric wrapping
|
|
20804
|
+
if (this.textAlign.includes('justify') && this.useOverlayEditing) {
|
|
20805
|
+
console.log('🧹 JUSTIFY OVERLAY: Using fabric wrapping');
|
|
20806
|
+
this.__lastBrowserLines = null;
|
|
20807
|
+
this.__lastBrowserLinesHash = null;
|
|
20808
|
+
} else {
|
|
20809
|
+
// Check if we have valid browser lines for non-justify text
|
|
20810
|
+
const browserLinesInfo = getBrowserLines(this);
|
|
20811
|
+
if (browserLinesInfo && this.useOverlayEditing) {
|
|
20812
|
+
this._browserWrappingWidth = browserLinesInfo.width;
|
|
20813
|
+
return this._splitTextFromBrowserLines(browserLinesInfo.lines);
|
|
20814
|
+
}
|
|
20797
20815
|
}
|
|
20798
20816
|
const newLines = this._splitTextIntoLines(this.text);
|
|
20799
20817
|
this.textLines = newLines.lines;
|
|
@@ -20803,9 +20821,9 @@ class FabricText extends StyledText {
|
|
|
20803
20821
|
return newLines;
|
|
20804
20822
|
}
|
|
20805
20823
|
|
|
20806
|
-
/**
|
|
20807
|
-
* Create TextLinesInfo from browser-extracted lines
|
|
20808
|
-
* @private
|
|
20824
|
+
/**
|
|
20825
|
+
* Create TextLinesInfo from browser-extracted lines
|
|
20826
|
+
* @private
|
|
20809
20827
|
*/
|
|
20810
20828
|
_splitTextFromBrowserLines(browserLines) {
|
|
20811
20829
|
const lines = [];
|
|
@@ -20839,10 +20857,10 @@ class FabricText extends StyledText {
|
|
|
20839
20857
|
return result;
|
|
20840
20858
|
}
|
|
20841
20859
|
|
|
20842
|
-
/**
|
|
20843
|
-
* Initialize or update text dimensions.
|
|
20844
|
-
* Updates this.width and this.height with the proper values.
|
|
20845
|
-
* Does not return dimensions.
|
|
20860
|
+
/**
|
|
20861
|
+
* Initialize or update text dimensions.
|
|
20862
|
+
* Updates this.width and this.height with the proper values.
|
|
20863
|
+
* Does not return dimensions.
|
|
20846
20864
|
*/
|
|
20847
20865
|
initDimensions() {
|
|
20848
20866
|
// Check if font is ready for accurate measurements
|
|
@@ -20888,24 +20906,29 @@ class FabricText extends StyledText {
|
|
|
20888
20906
|
}
|
|
20889
20907
|
}
|
|
20890
20908
|
|
|
20891
|
-
/**
|
|
20892
|
-
* Enlarge space boxes and shift the others
|
|
20909
|
+
/**
|
|
20910
|
+
* Enlarge space boxes and shift the others
|
|
20893
20911
|
*/
|
|
20894
20912
|
enlargeSpaces() {
|
|
20895
20913
|
let diffSpace, currentLineWidth, numberOfSpaces, accumulatedSpace, line, charBound, spaces;
|
|
20896
20914
|
const isRtl = this.direction === 'rtl';
|
|
20915
|
+
// use browser wrapping width if available
|
|
20916
|
+
const justificationWidth = this._browserWrappingWidth || this.width;
|
|
20917
|
+
if (this._browserWrappingWidth) {
|
|
20918
|
+
this._browserWrappingWidth = undefined;
|
|
20919
|
+
}
|
|
20897
20920
|
for (let i = 0, len = this._textLines.length; i < len; i++) {
|
|
20898
|
-
if (!this.textAlign.includes('justify')
|
|
20921
|
+
if (!this.textAlign.includes('justify') || i === len - 1 || this.isEndOfWrapping(i)) {
|
|
20899
20922
|
continue;
|
|
20900
20923
|
}
|
|
20901
20924
|
accumulatedSpace = 0;
|
|
20902
20925
|
line = this._textLines[i];
|
|
20903
20926
|
currentLineWidth = this.getLineWidth(i);
|
|
20904
|
-
if (currentLineWidth <
|
|
20927
|
+
if (currentLineWidth < justificationWidth && (spaces = this.textLines[i].match(this._reSpacesAndTabs))) {
|
|
20905
20928
|
numberOfSpaces = spaces.length;
|
|
20906
|
-
diffSpace = (
|
|
20929
|
+
diffSpace = (justificationWidth - currentLineWidth) / numberOfSpaces;
|
|
20907
20930
|
console.log(`🔧 EnlargeSpaces Line ${i}:`);
|
|
20908
|
-
console.log(` Current width: ${currentLineWidth}, Target: ${
|
|
20931
|
+
console.log(` Current width: ${currentLineWidth}, Target: ${justificationWidth}`);
|
|
20909
20932
|
console.log(` Spaces: ${numberOfSpaces}, diffSpace: ${diffSpace.toFixed(2)}`);
|
|
20910
20933
|
if (isRtl) {
|
|
20911
20934
|
for (let j = 0; j < line.length; j++) {
|
|
@@ -20951,18 +20974,18 @@ class FabricText extends StyledText {
|
|
|
20951
20974
|
}
|
|
20952
20975
|
}
|
|
20953
20976
|
|
|
20954
|
-
/**
|
|
20955
|
-
* Advanced layout using new text engine (Konva-compatible)
|
|
20956
|
-
* @private
|
|
20977
|
+
/**
|
|
20978
|
+
* Advanced layout using new text engine (Konva-compatible)
|
|
20979
|
+
* @private
|
|
20957
20980
|
*/
|
|
20958
20981
|
_layoutTextAdvanced() {
|
|
20959
20982
|
const options = this._getAdvancedLayoutOptions();
|
|
20960
20983
|
return layoutText(options);
|
|
20961
20984
|
}
|
|
20962
20985
|
|
|
20963
|
-
/**
|
|
20964
|
-
* Get advanced layout options from current text properties
|
|
20965
|
-
* @private
|
|
20986
|
+
/**
|
|
20987
|
+
* Get advanced layout options from current text properties
|
|
20988
|
+
* @private
|
|
20966
20989
|
*/
|
|
20967
20990
|
_getAdvancedLayoutOptions() {
|
|
20968
20991
|
return {
|
|
@@ -20984,9 +21007,9 @@ class FabricText extends StyledText {
|
|
|
20984
21007
|
};
|
|
20985
21008
|
}
|
|
20986
21009
|
|
|
20987
|
-
/**
|
|
20988
|
-
* Map Fabric textAlign to Konva align format
|
|
20989
|
-
* @private
|
|
21010
|
+
/**
|
|
21011
|
+
* Map Fabric textAlign to Konva align format
|
|
21012
|
+
* @private
|
|
20990
21013
|
*/
|
|
20991
21014
|
_mapTextAlignToAlign(textAlign) {
|
|
20992
21015
|
switch (textAlign) {
|
|
@@ -21007,8 +21030,8 @@ class FabricText extends StyledText {
|
|
|
21007
21030
|
}
|
|
21008
21031
|
}
|
|
21009
21032
|
|
|
21010
|
-
/**
|
|
21011
|
-
* Enhanced initDimensions that uses advanced layout when enabled
|
|
21033
|
+
/**
|
|
21034
|
+
* Enhanced initDimensions that uses advanced layout when enabled
|
|
21012
21035
|
*/
|
|
21013
21036
|
initDimensionsAdvanced() {
|
|
21014
21037
|
if (!this.enableAdvancedLayout) {
|
|
@@ -21037,9 +21060,9 @@ class FabricText extends StyledText {
|
|
|
21037
21060
|
this.dirty = true;
|
|
21038
21061
|
}
|
|
21039
21062
|
|
|
21040
|
-
/**
|
|
21041
|
-
* Convert new layout format to legacy _textLines and __charBounds format
|
|
21042
|
-
* @private
|
|
21063
|
+
/**
|
|
21064
|
+
* Convert new layout format to legacy _textLines and __charBounds format
|
|
21065
|
+
* @private
|
|
21043
21066
|
*/
|
|
21044
21067
|
_convertLayoutToLegacyFormat(layout) {
|
|
21045
21068
|
this._textLines = layout.lines.map(line => line.graphemes);
|
|
@@ -21061,30 +21084,30 @@ class FabricText extends StyledText {
|
|
|
21061
21084
|
}
|
|
21062
21085
|
}
|
|
21063
21086
|
|
|
21064
|
-
/**
|
|
21065
|
-
* Detect if the text line is ended with an hard break
|
|
21066
|
-
* text and itext do not have wrapping, return false
|
|
21067
|
-
* @return {Boolean}
|
|
21087
|
+
/**
|
|
21088
|
+
* Detect if the text line is ended with an hard break
|
|
21089
|
+
* text and itext do not have wrapping, return false
|
|
21090
|
+
* @return {Boolean}
|
|
21068
21091
|
*/
|
|
21069
21092
|
isEndOfWrapping(lineIndex) {
|
|
21070
21093
|
return lineIndex === this._textLines.length - 1;
|
|
21071
21094
|
}
|
|
21072
21095
|
|
|
21073
|
-
/**
|
|
21074
|
-
* Detect if a line has a linebreak and so we need to account for it when moving
|
|
21075
|
-
* and counting style.
|
|
21076
|
-
* It return always 1 for text and Itext. Textbox has its own implementation
|
|
21077
|
-
* @return Number
|
|
21096
|
+
/**
|
|
21097
|
+
* Detect if a line has a linebreak and so we need to account for it when moving
|
|
21098
|
+
* and counting style.
|
|
21099
|
+
* It return always 1 for text and Itext. Textbox has its own implementation
|
|
21100
|
+
* @return Number
|
|
21078
21101
|
*/
|
|
21079
21102
|
|
|
21080
21103
|
missingNewlineOffset(_lineIndex) {
|
|
21081
21104
|
return 1;
|
|
21082
21105
|
}
|
|
21083
21106
|
|
|
21084
|
-
/**
|
|
21085
|
-
* Returns 2d representation (lineIndex and charIndex) of cursor
|
|
21086
|
-
* @param {Number} selectionStart
|
|
21087
|
-
* @param {Boolean} [skipWrapping] consider the location for unwrapped lines. useful to manage styles.
|
|
21107
|
+
/**
|
|
21108
|
+
* Returns 2d representation (lineIndex and charIndex) of cursor
|
|
21109
|
+
* @param {Number} selectionStart
|
|
21110
|
+
* @param {Boolean} [skipWrapping] consider the location for unwrapped lines. useful to manage styles.
|
|
21088
21111
|
*/
|
|
21089
21112
|
get2DCursorLocation(selectionStart, skipWrapping) {
|
|
21090
21113
|
const lines = skipWrapping ? this._unwrappedTextLines : this._textLines;
|
|
@@ -21104,24 +21127,24 @@ class FabricText extends StyledText {
|
|
|
21104
21127
|
};
|
|
21105
21128
|
}
|
|
21106
21129
|
|
|
21107
|
-
/**
|
|
21108
|
-
* Returns string representation of an instance
|
|
21109
|
-
* @return {String} String representation of text object
|
|
21130
|
+
/**
|
|
21131
|
+
* Returns string representation of an instance
|
|
21132
|
+
* @return {String} String representation of text object
|
|
21110
21133
|
*/
|
|
21111
21134
|
toString() {
|
|
21112
21135
|
return `#<Text (${this.complexity()}): { "text": "${this.text}", "fontFamily": "${this.fontFamily}" }>`;
|
|
21113
21136
|
}
|
|
21114
21137
|
|
|
21115
|
-
/**
|
|
21116
|
-
* Return the dimension and the zoom level needed to create a cache canvas
|
|
21117
|
-
* big enough to host the object to be cached.
|
|
21118
|
-
* @private
|
|
21119
|
-
* @param {Object} dim.x width of object to be cached
|
|
21120
|
-
* @param {Object} dim.y height of object to be cached
|
|
21121
|
-
* @return {Object}.width width of canvas
|
|
21122
|
-
* @return {Object}.height height of canvas
|
|
21123
|
-
* @return {Object}.zoomX zoomX zoom value to unscale the canvas before drawing cache
|
|
21124
|
-
* @return {Object}.zoomY zoomY zoom value to unscale the canvas before drawing cache
|
|
21138
|
+
/**
|
|
21139
|
+
* Return the dimension and the zoom level needed to create a cache canvas
|
|
21140
|
+
* big enough to host the object to be cached.
|
|
21141
|
+
* @private
|
|
21142
|
+
* @param {Object} dim.x width of object to be cached
|
|
21143
|
+
* @param {Object} dim.y height of object to be cached
|
|
21144
|
+
* @return {Object}.width width of canvas
|
|
21145
|
+
* @return {Object}.height height of canvas
|
|
21146
|
+
* @return {Object}.zoomX zoomX zoom value to unscale the canvas before drawing cache
|
|
21147
|
+
* @return {Object}.zoomY zoomY zoom value to unscale the canvas before drawing cache
|
|
21125
21148
|
*/
|
|
21126
21149
|
_getCacheCanvasDimensions() {
|
|
21127
21150
|
const dims = super._getCacheCanvasDimensions();
|
|
@@ -21131,9 +21154,9 @@ class FabricText extends StyledText {
|
|
|
21131
21154
|
return dims;
|
|
21132
21155
|
}
|
|
21133
21156
|
|
|
21134
|
-
/**
|
|
21135
|
-
* @private
|
|
21136
|
-
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21157
|
+
/**
|
|
21158
|
+
* @private
|
|
21159
|
+
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21137
21160
|
*/
|
|
21138
21161
|
_render(ctx) {
|
|
21139
21162
|
const path = this.path;
|
|
@@ -21146,9 +21169,9 @@ class FabricText extends StyledText {
|
|
|
21146
21169
|
this._renderTextDecoration(ctx, 'linethrough');
|
|
21147
21170
|
}
|
|
21148
21171
|
|
|
21149
|
-
/**
|
|
21150
|
-
* @private
|
|
21151
|
-
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21172
|
+
/**
|
|
21173
|
+
* @private
|
|
21174
|
+
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21152
21175
|
*/
|
|
21153
21176
|
_renderText(ctx) {
|
|
21154
21177
|
// Skip text rendering if in overlay editing mode
|
|
@@ -21164,15 +21187,15 @@ class FabricText extends StyledText {
|
|
|
21164
21187
|
}
|
|
21165
21188
|
}
|
|
21166
21189
|
|
|
21167
|
-
/**
|
|
21168
|
-
* Set the font parameter of the context with the object properties or with charStyle
|
|
21169
|
-
* @private
|
|
21170
|
-
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21171
|
-
* @param {Object} [charStyle] object with font style properties
|
|
21172
|
-
* @param {String} [charStyle.fontFamily] Font Family
|
|
21173
|
-
* @param {Number} [charStyle.fontSize] Font size in pixels. ( without px suffix )
|
|
21174
|
-
* @param {String} [charStyle.fontWeight] Font weight
|
|
21175
|
-
* @param {String} [charStyle.fontStyle] Font style (italic|normal)
|
|
21190
|
+
/**
|
|
21191
|
+
* Set the font parameter of the context with the object properties or with charStyle
|
|
21192
|
+
* @private
|
|
21193
|
+
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21194
|
+
* @param {Object} [charStyle] object with font style properties
|
|
21195
|
+
* @param {String} [charStyle.fontFamily] Font Family
|
|
21196
|
+
* @param {Number} [charStyle.fontSize] Font size in pixels. ( without px suffix )
|
|
21197
|
+
* @param {String} [charStyle.fontWeight] Font weight
|
|
21198
|
+
* @param {String} [charStyle.fontStyle] Font style (italic|normal)
|
|
21176
21199
|
*/
|
|
21177
21200
|
_setTextStyles(ctx, charStyle, forMeasuring) {
|
|
21178
21201
|
ctx.textBaseline = 'alphabetic';
|
|
@@ -21192,11 +21215,11 @@ class FabricText extends StyledText {
|
|
|
21192
21215
|
ctx.font = this._getFontDeclaration(charStyle, forMeasuring);
|
|
21193
21216
|
}
|
|
21194
21217
|
|
|
21195
|
-
/**
|
|
21196
|
-
* calculate and return the text Width measuring each line.
|
|
21197
|
-
* @private
|
|
21198
|
-
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21199
|
-
* @return {Number} Maximum width of Text object
|
|
21218
|
+
/**
|
|
21219
|
+
* calculate and return the text Width measuring each line.
|
|
21220
|
+
* @private
|
|
21221
|
+
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21222
|
+
* @return {Number} Maximum width of Text object
|
|
21200
21223
|
*/
|
|
21201
21224
|
calcTextWidth() {
|
|
21202
21225
|
let maxWidth = this.getLineWidth(0);
|
|
@@ -21209,23 +21232,23 @@ class FabricText extends StyledText {
|
|
|
21209
21232
|
return maxWidth;
|
|
21210
21233
|
}
|
|
21211
21234
|
|
|
21212
|
-
/**
|
|
21213
|
-
* @private
|
|
21214
|
-
* @param {String} method Method name ("fillText" or "strokeText")
|
|
21215
|
-
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21216
|
-
* @param {String} line Text to render
|
|
21217
|
-
* @param {Number} left Left position of text
|
|
21218
|
-
* @param {Number} top Top position of text
|
|
21219
|
-
* @param {Number} lineIndex Index of a line in a text
|
|
21235
|
+
/**
|
|
21236
|
+
* @private
|
|
21237
|
+
* @param {String} method Method name ("fillText" or "strokeText")
|
|
21238
|
+
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21239
|
+
* @param {String} line Text to render
|
|
21240
|
+
* @param {Number} left Left position of text
|
|
21241
|
+
* @param {Number} top Top position of text
|
|
21242
|
+
* @param {Number} lineIndex Index of a line in a text
|
|
21220
21243
|
*/
|
|
21221
21244
|
_renderTextLine(method, ctx, line, left, top, lineIndex) {
|
|
21222
21245
|
this._renderChars(method, ctx, line, left, top, lineIndex);
|
|
21223
21246
|
}
|
|
21224
21247
|
|
|
21225
|
-
/**
|
|
21226
|
-
* Renders the text background for lines, taking care of style
|
|
21227
|
-
* @private
|
|
21228
|
-
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21248
|
+
/**
|
|
21249
|
+
* Renders the text background for lines, taking care of style
|
|
21250
|
+
* @private
|
|
21251
|
+
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21229
21252
|
*/
|
|
21230
21253
|
_renderTextLinesBackground(ctx) {
|
|
21231
21254
|
if (!this.textBackgroundColor && !this.styleHas('textBackgroundColor')) {
|
|
@@ -21288,15 +21311,15 @@ class FabricText extends StyledText {
|
|
|
21288
21311
|
this._removeShadow(ctx);
|
|
21289
21312
|
}
|
|
21290
21313
|
|
|
21291
|
-
/**
|
|
21292
|
-
* measure and return the width of a single character.
|
|
21293
|
-
* possibly overridden to accommodate different measure logic or
|
|
21294
|
-
* to hook some external lib for character measurement
|
|
21295
|
-
* @private
|
|
21296
|
-
* @param {String} _char, char to be measured
|
|
21297
|
-
* @param {Object} charStyle style of char to be measured
|
|
21298
|
-
* @param {String} [previousChar] previous char
|
|
21299
|
-
* @param {Object} [prevCharStyle] style of previous char
|
|
21314
|
+
/**
|
|
21315
|
+
* measure and return the width of a single character.
|
|
21316
|
+
* possibly overridden to accommodate different measure logic or
|
|
21317
|
+
* to hook some external lib for character measurement
|
|
21318
|
+
* @private
|
|
21319
|
+
* @param {String} _char, char to be measured
|
|
21320
|
+
* @param {Object} charStyle style of char to be measured
|
|
21321
|
+
* @param {String} [previousChar] previous char
|
|
21322
|
+
* @param {Object} [prevCharStyle] style of previous char
|
|
21300
21323
|
*/
|
|
21301
21324
|
_measureChar(_char, charStyle, previousChar, prevCharStyle) {
|
|
21302
21325
|
const fontCache = cache.getFontCache(charStyle),
|
|
@@ -21341,19 +21364,19 @@ class FabricText extends StyledText {
|
|
|
21341
21364
|
};
|
|
21342
21365
|
}
|
|
21343
21366
|
|
|
21344
|
-
/**
|
|
21345
|
-
* Computes height of character at given position
|
|
21346
|
-
* @param {Number} line the line index number
|
|
21347
|
-
* @param {Number} _char the character index number
|
|
21348
|
-
* @return {Number} fontSize of the character
|
|
21367
|
+
/**
|
|
21368
|
+
* Computes height of character at given position
|
|
21369
|
+
* @param {Number} line the line index number
|
|
21370
|
+
* @param {Number} _char the character index number
|
|
21371
|
+
* @return {Number} fontSize of the character
|
|
21349
21372
|
*/
|
|
21350
21373
|
getHeightOfChar(line, _char) {
|
|
21351
21374
|
return this.getValueOfPropertyAt(line, _char, 'fontSize');
|
|
21352
21375
|
}
|
|
21353
21376
|
|
|
21354
|
-
/**
|
|
21355
|
-
* measure a text line measuring all characters.
|
|
21356
|
-
* @param {Number} lineIndex line number
|
|
21377
|
+
/**
|
|
21378
|
+
* measure a text line measuring all characters.
|
|
21379
|
+
* @param {Number} lineIndex line number
|
|
21357
21380
|
*/
|
|
21358
21381
|
measureLine(lineIndex) {
|
|
21359
21382
|
const lineInfo = this._measureLine(lineIndex);
|
|
@@ -21366,11 +21389,11 @@ class FabricText extends StyledText {
|
|
|
21366
21389
|
return lineInfo;
|
|
21367
21390
|
}
|
|
21368
21391
|
|
|
21369
|
-
/**
|
|
21370
|
-
* measure every grapheme of a line, populating __charBounds
|
|
21371
|
-
* @param {Number} lineIndex
|
|
21372
|
-
* @return {Object} object.width total width of characters
|
|
21373
|
-
* @return {Object} object.numOfSpaces length of chars that match this._reSpacesAndTabs
|
|
21392
|
+
/**
|
|
21393
|
+
* measure every grapheme of a line, populating __charBounds
|
|
21394
|
+
* @param {Number} lineIndex
|
|
21395
|
+
* @return {Object} object.width total width of characters
|
|
21396
|
+
* @return {Object} object.numOfSpaces length of chars that match this._reSpacesAndTabs
|
|
21374
21397
|
*/
|
|
21375
21398
|
_measureLine(lineIndex) {
|
|
21376
21399
|
let width = 0,
|
|
@@ -21433,13 +21456,13 @@ class FabricText extends StyledText {
|
|
|
21433
21456
|
};
|
|
21434
21457
|
}
|
|
21435
21458
|
|
|
21436
|
-
/**
|
|
21437
|
-
* Calculate the angle and the left,top position of the char that follow a path.
|
|
21438
|
-
* It appends it to graphemeInfo to be reused later at rendering
|
|
21439
|
-
* @private
|
|
21440
|
-
* @param {Number} positionInPath to be measured
|
|
21441
|
-
* @param {GraphemeBBox} graphemeInfo current grapheme box information
|
|
21442
|
-
* @param {Object} startingPoint position of the point
|
|
21459
|
+
/**
|
|
21460
|
+
* Calculate the angle and the left,top position of the char that follow a path.
|
|
21461
|
+
* It appends it to graphemeInfo to be reused later at rendering
|
|
21462
|
+
* @private
|
|
21463
|
+
* @param {Number} positionInPath to be measured
|
|
21464
|
+
* @param {GraphemeBBox} graphemeInfo current grapheme box information
|
|
21465
|
+
* @param {Object} startingPoint position of the point
|
|
21443
21466
|
*/
|
|
21444
21467
|
_setGraphemeOnPath(positionInPath, graphemeInfo) {
|
|
21445
21468
|
const centerPosition = positionInPath + graphemeInfo.kernedWidth / 2,
|
|
@@ -21452,13 +21475,13 @@ class FabricText extends StyledText {
|
|
|
21452
21475
|
graphemeInfo.angle = info.angle + (this.pathSide === RIGHT ? Math.PI : 0);
|
|
21453
21476
|
}
|
|
21454
21477
|
|
|
21455
|
-
/**
|
|
21456
|
-
*
|
|
21457
|
-
* @param {String} grapheme to be measured
|
|
21458
|
-
* @param {Number} lineIndex index of the line where the char is
|
|
21459
|
-
* @param {Number} charIndex position in the line
|
|
21460
|
-
* @param {String} [prevGrapheme] character preceding the one to be measured
|
|
21461
|
-
* @returns {GraphemeBBox} grapheme bbox
|
|
21478
|
+
/**
|
|
21479
|
+
*
|
|
21480
|
+
* @param {String} grapheme to be measured
|
|
21481
|
+
* @param {Number} lineIndex index of the line where the char is
|
|
21482
|
+
* @param {Number} charIndex position in the line
|
|
21483
|
+
* @param {String} [prevGrapheme] character preceding the one to be measured
|
|
21484
|
+
* @returns {GraphemeBBox} grapheme bbox
|
|
21462
21485
|
*/
|
|
21463
21486
|
_getGraphemeBox(grapheme, lineIndex, charIndex, prevGrapheme, skipLeft) {
|
|
21464
21487
|
const style = this.getCompleteStyleDeclaration(lineIndex, charIndex),
|
|
@@ -21486,10 +21509,10 @@ class FabricText extends StyledText {
|
|
|
21486
21509
|
return box;
|
|
21487
21510
|
}
|
|
21488
21511
|
|
|
21489
|
-
/**
|
|
21490
|
-
* Calculate height of line at 'lineIndex'
|
|
21491
|
-
* @param {Number} lineIndex index of line to calculate
|
|
21492
|
-
* @return {Number}
|
|
21512
|
+
/**
|
|
21513
|
+
* Calculate height of line at 'lineIndex'
|
|
21514
|
+
* @param {Number} lineIndex index of line to calculate
|
|
21515
|
+
* @return {Number}
|
|
21493
21516
|
*/
|
|
21494
21517
|
getHeightOfLine(lineIndex) {
|
|
21495
21518
|
if (this.__lineHeights[lineIndex]) {
|
|
@@ -21505,8 +21528,8 @@ class FabricText extends StyledText {
|
|
|
21505
21528
|
return this.__lineHeights[lineIndex] = maxHeight * this.lineHeight * this._fontSizeMult;
|
|
21506
21529
|
}
|
|
21507
21530
|
|
|
21508
|
-
/**
|
|
21509
|
-
* Calculate text box height
|
|
21531
|
+
/**
|
|
21532
|
+
* Calculate text box height
|
|
21510
21533
|
*/
|
|
21511
21534
|
calcTextHeight() {
|
|
21512
21535
|
let lineHeight,
|
|
@@ -21518,26 +21541,26 @@ class FabricText extends StyledText {
|
|
|
21518
21541
|
return height;
|
|
21519
21542
|
}
|
|
21520
21543
|
|
|
21521
|
-
/**
|
|
21522
|
-
* @private
|
|
21523
|
-
* @return {Number} Left offset
|
|
21544
|
+
/**
|
|
21545
|
+
* @private
|
|
21546
|
+
* @return {Number} Left offset
|
|
21524
21547
|
*/
|
|
21525
21548
|
_getLeftOffset() {
|
|
21526
21549
|
return this.direction === 'ltr' ? -this.width / 2 : this.width / 2;
|
|
21527
21550
|
}
|
|
21528
21551
|
|
|
21529
|
-
/**
|
|
21530
|
-
* @private
|
|
21531
|
-
* @return {Number} Top offset
|
|
21552
|
+
/**
|
|
21553
|
+
* @private
|
|
21554
|
+
* @return {Number} Top offset
|
|
21532
21555
|
*/
|
|
21533
21556
|
_getTopOffset() {
|
|
21534
21557
|
return -this.height / 2;
|
|
21535
21558
|
}
|
|
21536
21559
|
|
|
21537
|
-
/**
|
|
21538
|
-
* @private
|
|
21539
|
-
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21540
|
-
* @param {String} method Method name ("fillText" or "strokeText")
|
|
21560
|
+
/**
|
|
21561
|
+
* @private
|
|
21562
|
+
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21563
|
+
* @param {String} method Method name ("fillText" or "strokeText")
|
|
21541
21564
|
*/
|
|
21542
21565
|
_renderTextCommon(ctx, method) {
|
|
21543
21566
|
ctx.save();
|
|
@@ -21554,9 +21577,9 @@ class FabricText extends StyledText {
|
|
|
21554
21577
|
ctx.restore();
|
|
21555
21578
|
}
|
|
21556
21579
|
|
|
21557
|
-
/**
|
|
21558
|
-
* @private
|
|
21559
|
-
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21580
|
+
/**
|
|
21581
|
+
* @private
|
|
21582
|
+
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21560
21583
|
*/
|
|
21561
21584
|
_renderTextFill(ctx) {
|
|
21562
21585
|
if (!this.fill && !this.styleHas(FILL)) {
|
|
@@ -21565,9 +21588,9 @@ class FabricText extends StyledText {
|
|
|
21565
21588
|
this._renderTextCommon(ctx, 'fillText');
|
|
21566
21589
|
}
|
|
21567
21590
|
|
|
21568
|
-
/**
|
|
21569
|
-
* @private
|
|
21570
|
-
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21591
|
+
/**
|
|
21592
|
+
* @private
|
|
21593
|
+
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21571
21594
|
*/
|
|
21572
21595
|
_renderTextStroke(ctx) {
|
|
21573
21596
|
if ((!this.stroke || this.strokeWidth === 0) && this.isEmptyStyles()) {
|
|
@@ -21584,14 +21607,14 @@ class FabricText extends StyledText {
|
|
|
21584
21607
|
ctx.restore();
|
|
21585
21608
|
}
|
|
21586
21609
|
|
|
21587
|
-
/**
|
|
21588
|
-
* @private
|
|
21589
|
-
* @param {String} method fillText or strokeText.
|
|
21590
|
-
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21591
|
-
* @param {Array} line Content of the line, splitted in an array by grapheme
|
|
21592
|
-
* @param {Number} left
|
|
21593
|
-
* @param {Number} top
|
|
21594
|
-
* @param {Number} lineIndex
|
|
21610
|
+
/**
|
|
21611
|
+
* @private
|
|
21612
|
+
* @param {String} method fillText or strokeText.
|
|
21613
|
+
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21614
|
+
* @param {Array} line Content of the line, splitted in an array by grapheme
|
|
21615
|
+
* @param {Number} left
|
|
21616
|
+
* @param {Number} top
|
|
21617
|
+
* @param {Number} lineIndex
|
|
21595
21618
|
*/
|
|
21596
21619
|
_renderChars(method, ctx, line, left, top, lineIndex) {
|
|
21597
21620
|
const lineHeight = this.getHeightOfLine(lineIndex),
|
|
@@ -21673,16 +21696,16 @@ class FabricText extends StyledText {
|
|
|
21673
21696
|
ctx.restore();
|
|
21674
21697
|
}
|
|
21675
21698
|
|
|
21676
|
-
/**
|
|
21677
|
-
* This function try to patch the missing gradientTransform on canvas gradients.
|
|
21678
|
-
* transforming a context to transform the gradient, is going to transform the stroke too.
|
|
21679
|
-
* we want to transform the gradient but not the stroke operation, so we create
|
|
21680
|
-
* a transformed gradient on a pattern and then we use the pattern instead of the gradient.
|
|
21681
|
-
* this method has drawbacks: is slow, is in low resolution, needs a patch for when the size
|
|
21682
|
-
* is limited.
|
|
21683
|
-
* @private
|
|
21684
|
-
* @param {TFiller} filler a fabric gradient instance
|
|
21685
|
-
* @return {CanvasPattern} a pattern to use as fill/stroke style
|
|
21699
|
+
/**
|
|
21700
|
+
* This function try to patch the missing gradientTransform on canvas gradients.
|
|
21701
|
+
* transforming a context to transform the gradient, is going to transform the stroke too.
|
|
21702
|
+
* we want to transform the gradient but not the stroke operation, so we create
|
|
21703
|
+
* a transformed gradient on a pattern and then we use the pattern instead of the gradient.
|
|
21704
|
+
* this method has drawbacks: is slow, is in low resolution, needs a patch for when the size
|
|
21705
|
+
* is limited.
|
|
21706
|
+
* @private
|
|
21707
|
+
* @param {TFiller} filler a fabric gradient instance
|
|
21708
|
+
* @return {CanvasPattern} a pattern to use as fill/stroke style
|
|
21686
21709
|
*/
|
|
21687
21710
|
_applyPatternGradientTransformText(filler) {
|
|
21688
21711
|
// TODO: verify compatibility with strokeUniform
|
|
@@ -21738,12 +21761,12 @@ class FabricText extends StyledText {
|
|
|
21738
21761
|
};
|
|
21739
21762
|
}
|
|
21740
21763
|
|
|
21741
|
-
/**
|
|
21742
|
-
* This function prepare the canvas for a stroke style, and stroke and strokeWidth
|
|
21743
|
-
* need to be sent in as defined
|
|
21744
|
-
* @param {CanvasRenderingContext2D} ctx
|
|
21745
|
-
* @param {CompleteTextStyleDeclaration} style with stroke and strokeWidth defined
|
|
21746
|
-
* @returns
|
|
21764
|
+
/**
|
|
21765
|
+
* This function prepare the canvas for a stroke style, and stroke and strokeWidth
|
|
21766
|
+
* need to be sent in as defined
|
|
21767
|
+
* @param {CanvasRenderingContext2D} ctx
|
|
21768
|
+
* @param {CompleteTextStyleDeclaration} style with stroke and strokeWidth defined
|
|
21769
|
+
* @returns
|
|
21747
21770
|
*/
|
|
21748
21771
|
_setStrokeStyles(ctx, _ref) {
|
|
21749
21772
|
let {
|
|
@@ -21758,12 +21781,12 @@ class FabricText extends StyledText {
|
|
|
21758
21781
|
return this.handleFiller(ctx, 'strokeStyle', stroke);
|
|
21759
21782
|
}
|
|
21760
21783
|
|
|
21761
|
-
/**
|
|
21762
|
-
* This function prepare the canvas for a ill style, and fill
|
|
21763
|
-
* need to be sent in as defined
|
|
21764
|
-
* @param {CanvasRenderingContext2D} ctx
|
|
21765
|
-
* @param {CompleteTextStyleDeclaration} style with ill defined
|
|
21766
|
-
* @returns
|
|
21784
|
+
/**
|
|
21785
|
+
* This function prepare the canvas for a ill style, and fill
|
|
21786
|
+
* need to be sent in as defined
|
|
21787
|
+
* @param {CanvasRenderingContext2D} ctx
|
|
21788
|
+
* @param {CompleteTextStyleDeclaration} style with ill defined
|
|
21789
|
+
* @returns
|
|
21767
21790
|
*/
|
|
21768
21791
|
_setFillStyles(ctx, _ref2) {
|
|
21769
21792
|
let {
|
|
@@ -21772,16 +21795,16 @@ class FabricText extends StyledText {
|
|
|
21772
21795
|
return this.handleFiller(ctx, 'fillStyle', fill);
|
|
21773
21796
|
}
|
|
21774
21797
|
|
|
21775
|
-
/**
|
|
21776
|
-
* @private
|
|
21777
|
-
* @param {String} method
|
|
21778
|
-
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21779
|
-
* @param {Number} lineIndex
|
|
21780
|
-
* @param {Number} charIndex
|
|
21781
|
-
* @param {String} _char
|
|
21782
|
-
* @param {Number} left Left coordinate
|
|
21783
|
-
* @param {Number} top Top coordinate
|
|
21784
|
-
* @param {Number} lineHeight Height of the line
|
|
21798
|
+
/**
|
|
21799
|
+
* @private
|
|
21800
|
+
* @param {String} method
|
|
21801
|
+
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21802
|
+
* @param {Number} lineIndex
|
|
21803
|
+
* @param {Number} charIndex
|
|
21804
|
+
* @param {String} _char
|
|
21805
|
+
* @param {Number} left Left coordinate
|
|
21806
|
+
* @param {Number} top Top coordinate
|
|
21807
|
+
* @param {Number} lineHeight Height of the line
|
|
21785
21808
|
*/
|
|
21786
21809
|
_renderChar(method, ctx, lineIndex, charIndex, _char, left, top) {
|
|
21787
21810
|
const decl = this._getStyleDeclaration(lineIndex, charIndex),
|
|
@@ -21810,30 +21833,30 @@ class FabricText extends StyledText {
|
|
|
21810
21833
|
ctx.restore();
|
|
21811
21834
|
}
|
|
21812
21835
|
|
|
21813
|
-
/**
|
|
21814
|
-
* Turns the character into a 'superior figure' (i.e. 'superscript')
|
|
21815
|
-
* @param {Number} start selection start
|
|
21816
|
-
* @param {Number} end selection end
|
|
21836
|
+
/**
|
|
21837
|
+
* Turns the character into a 'superior figure' (i.e. 'superscript')
|
|
21838
|
+
* @param {Number} start selection start
|
|
21839
|
+
* @param {Number} end selection end
|
|
21817
21840
|
*/
|
|
21818
21841
|
setSuperscript(start, end) {
|
|
21819
21842
|
this._setScript(start, end, this.superscript);
|
|
21820
21843
|
}
|
|
21821
21844
|
|
|
21822
|
-
/**
|
|
21823
|
-
* Turns the character into an 'inferior figure' (i.e. 'subscript')
|
|
21824
|
-
* @param {Number} start selection start
|
|
21825
|
-
* @param {Number} end selection end
|
|
21845
|
+
/**
|
|
21846
|
+
* Turns the character into an 'inferior figure' (i.e. 'subscript')
|
|
21847
|
+
* @param {Number} start selection start
|
|
21848
|
+
* @param {Number} end selection end
|
|
21826
21849
|
*/
|
|
21827
21850
|
setSubscript(start, end) {
|
|
21828
21851
|
this._setScript(start, end, this.subscript);
|
|
21829
21852
|
}
|
|
21830
21853
|
|
|
21831
|
-
/**
|
|
21832
|
-
* Applies 'schema' at given position
|
|
21833
|
-
* @private
|
|
21834
|
-
* @param {Number} start selection start
|
|
21835
|
-
* @param {Number} end selection end
|
|
21836
|
-
* @param {Number} schema
|
|
21854
|
+
/**
|
|
21855
|
+
* Applies 'schema' at given position
|
|
21856
|
+
* @private
|
|
21857
|
+
* @param {Number} start selection start
|
|
21858
|
+
* @param {Number} end selection end
|
|
21859
|
+
* @param {Number} schema
|
|
21837
21860
|
*/
|
|
21838
21861
|
_setScript(start, end, schema) {
|
|
21839
21862
|
const loc = this.get2DCursorLocation(start, true),
|
|
@@ -21846,10 +21869,10 @@ class FabricText extends StyledText {
|
|
|
21846
21869
|
this.setSelectionStyles(style, start, end);
|
|
21847
21870
|
}
|
|
21848
21871
|
|
|
21849
|
-
/**
|
|
21850
|
-
* @private
|
|
21851
|
-
* @param {Number} lineIndex index text line
|
|
21852
|
-
* @return {Number} Line left offset
|
|
21872
|
+
/**
|
|
21873
|
+
* @private
|
|
21874
|
+
* @param {Number} lineIndex index text line
|
|
21875
|
+
* @return {Number} Line left offset
|
|
21853
21876
|
*/
|
|
21854
21877
|
_getLineLeftOffset(lineIndex) {
|
|
21855
21878
|
const lineWidth = this.getLineWidth(lineIndex),
|
|
@@ -21899,8 +21922,8 @@ class FabricText extends StyledText {
|
|
|
21899
21922
|
return leftOffset;
|
|
21900
21923
|
}
|
|
21901
21924
|
|
|
21902
|
-
/**
|
|
21903
|
-
* @private
|
|
21925
|
+
/**
|
|
21926
|
+
* @private
|
|
21904
21927
|
*/
|
|
21905
21928
|
_clearCache() {
|
|
21906
21929
|
this._forceClearCache = false;
|
|
@@ -21909,12 +21932,12 @@ class FabricText extends StyledText {
|
|
|
21909
21932
|
this.__charBounds = [];
|
|
21910
21933
|
}
|
|
21911
21934
|
|
|
21912
|
-
/**
|
|
21913
|
-
* Measure a single line given its index. Used to calculate the initial
|
|
21914
|
-
* text bounding box. The values are calculated and stored in __lineWidths cache.
|
|
21915
|
-
* @private
|
|
21916
|
-
* @param {Number} lineIndex line number
|
|
21917
|
-
* @return {Number} Line width
|
|
21935
|
+
/**
|
|
21936
|
+
* Measure a single line given its index. Used to calculate the initial
|
|
21937
|
+
* text bounding box. The values are calculated and stored in __lineWidths cache.
|
|
21938
|
+
* @private
|
|
21939
|
+
* @param {Number} lineIndex line number
|
|
21940
|
+
* @return {Number} Line width
|
|
21918
21941
|
*/
|
|
21919
21942
|
getLineWidth(lineIndex) {
|
|
21920
21943
|
if (this.__lineWidths[lineIndex] !== undefined) {
|
|
@@ -21933,12 +21956,12 @@ class FabricText extends StyledText {
|
|
|
21933
21956
|
return 0;
|
|
21934
21957
|
}
|
|
21935
21958
|
|
|
21936
|
-
/**
|
|
21937
|
-
* Retrieves the value of property at given character position
|
|
21938
|
-
* @param {Number} lineIndex the line number
|
|
21939
|
-
* @param {Number} charIndex the character number
|
|
21940
|
-
* @param {String} property the property name
|
|
21941
|
-
* @returns the value of 'property'
|
|
21959
|
+
/**
|
|
21960
|
+
* Retrieves the value of property at given character position
|
|
21961
|
+
* @param {Number} lineIndex the line number
|
|
21962
|
+
* @param {Number} charIndex the character number
|
|
21963
|
+
* @param {String} property the property name
|
|
21964
|
+
* @returns the value of 'property'
|
|
21942
21965
|
*/
|
|
21943
21966
|
getValueOfPropertyAt(lineIndex, charIndex, property) {
|
|
21944
21967
|
var _charStyle$property;
|
|
@@ -21946,9 +21969,9 @@ class FabricText extends StyledText {
|
|
|
21946
21969
|
return (_charStyle$property = charStyle[property]) !== null && _charStyle$property !== void 0 ? _charStyle$property : this[property];
|
|
21947
21970
|
}
|
|
21948
21971
|
|
|
21949
|
-
/**
|
|
21950
|
-
* @private
|
|
21951
|
-
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21972
|
+
/**
|
|
21973
|
+
* @private
|
|
21974
|
+
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
21952
21975
|
*/
|
|
21953
21976
|
_renderTextDecoration(ctx, type) {
|
|
21954
21977
|
if (!this[type] && !this.styleHas(type)) {
|
|
@@ -22032,10 +22055,10 @@ class FabricText extends StyledText {
|
|
|
22032
22055
|
this._removeShadow(ctx);
|
|
22033
22056
|
}
|
|
22034
22057
|
|
|
22035
|
-
/**
|
|
22036
|
-
* return font declaration string for canvas context
|
|
22037
|
-
* @param {Object} [styleObject] object
|
|
22038
|
-
* @returns {String} font declaration formatted for canvas context.
|
|
22058
|
+
/**
|
|
22059
|
+
* return font declaration string for canvas context
|
|
22060
|
+
* @param {Object} [styleObject] object
|
|
22061
|
+
* @returns {String} font declaration formatted for canvas context.
|
|
22039
22062
|
*/
|
|
22040
22063
|
_getFontDeclaration() {
|
|
22041
22064
|
let {
|
|
@@ -22061,9 +22084,9 @@ class FabricText extends StyledText {
|
|
|
22061
22084
|
return [fontStyle, fontWeight, `${forMeasuring ? this.CACHE_FONT_SIZE : fontSize}px`, parsedFontFamily].join(' ');
|
|
22062
22085
|
}
|
|
22063
22086
|
|
|
22064
|
-
/**
|
|
22065
|
-
* Renders text instance on a specified context
|
|
22066
|
-
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
22087
|
+
/**
|
|
22088
|
+
* Renders text instance on a specified context
|
|
22089
|
+
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
22067
22090
|
*/
|
|
22068
22091
|
render(ctx) {
|
|
22069
22092
|
if (!this.visible) {
|
|
@@ -22078,22 +22101,22 @@ class FabricText extends StyledText {
|
|
|
22078
22101
|
super.render(ctx);
|
|
22079
22102
|
}
|
|
22080
22103
|
|
|
22081
|
-
/**
|
|
22082
|
-
* Override this method to customize grapheme splitting
|
|
22083
|
-
* @todo the util `graphemeSplit` needs to be injectable in some way.
|
|
22084
|
-
* is more comfortable to inject the correct util rather than having to override text
|
|
22085
|
-
* in the middle of the prototype chain
|
|
22086
|
-
* @param {string} value
|
|
22087
|
-
* @returns {string[]} array of graphemes
|
|
22104
|
+
/**
|
|
22105
|
+
* Override this method to customize grapheme splitting
|
|
22106
|
+
* @todo the util `graphemeSplit` needs to be injectable in some way.
|
|
22107
|
+
* is more comfortable to inject the correct util rather than having to override text
|
|
22108
|
+
* in the middle of the prototype chain
|
|
22109
|
+
* @param {string} value
|
|
22110
|
+
* @returns {string[]} array of graphemes
|
|
22088
22111
|
*/
|
|
22089
22112
|
graphemeSplit(value) {
|
|
22090
22113
|
return graphemeSplit(value);
|
|
22091
22114
|
}
|
|
22092
22115
|
|
|
22093
|
-
/**
|
|
22094
|
-
* Returns the text as an array of lines.
|
|
22095
|
-
* @param {String} text text to split
|
|
22096
|
-
* @returns Lines in the text
|
|
22116
|
+
/**
|
|
22117
|
+
* Returns the text as an array of lines.
|
|
22118
|
+
* @param {String} text text to split
|
|
22119
|
+
* @returns Lines in the text
|
|
22097
22120
|
*/
|
|
22098
22121
|
_splitTextIntoLines(text) {
|
|
22099
22122
|
const lines = text.split(this._reNewline),
|
|
@@ -22119,18 +22142,18 @@ class FabricText extends StyledText {
|
|
|
22119
22142
|
};
|
|
22120
22143
|
}
|
|
22121
22144
|
|
|
22122
|
-
/**
|
|
22123
|
-
* Check if text contains Arabic characters
|
|
22124
|
-
* @private
|
|
22145
|
+
/**
|
|
22146
|
+
* Check if text contains Arabic characters
|
|
22147
|
+
* @private
|
|
22125
22148
|
*/
|
|
22126
22149
|
_containsArabicText(text) {
|
|
22127
22150
|
return /[\u0600-\u06FF\u0750-\u077F\uFB50-\uFDFF\uFE70-\uFEFF]/.test(text);
|
|
22128
22151
|
}
|
|
22129
22152
|
|
|
22130
|
-
/**
|
|
22131
|
-
* Returns object representation of an instance
|
|
22132
|
-
* @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output
|
|
22133
|
-
* @return {Object} Object representation of an instance
|
|
22153
|
+
/**
|
|
22154
|
+
* Returns object representation of an instance
|
|
22155
|
+
* @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output
|
|
22156
|
+
* @return {Object} Object representation of an instance
|
|
22134
22157
|
*/
|
|
22135
22158
|
toObject() {
|
|
22136
22159
|
let propertiesToInclude = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
@@ -22173,23 +22196,23 @@ class FabricText extends StyledText {
|
|
|
22173
22196
|
return this;
|
|
22174
22197
|
}
|
|
22175
22198
|
|
|
22176
|
-
/**
|
|
22177
|
-
* Returns complexity of an instance
|
|
22178
|
-
* @return {Number} complexity
|
|
22199
|
+
/**
|
|
22200
|
+
* Returns complexity of an instance
|
|
22201
|
+
* @return {Number} complexity
|
|
22179
22202
|
*/
|
|
22180
22203
|
complexity() {
|
|
22181
22204
|
return 1;
|
|
22182
22205
|
}
|
|
22183
22206
|
|
|
22184
|
-
/**
|
|
22185
|
-
* List of generic font families
|
|
22186
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/font-family#generic-name
|
|
22207
|
+
/**
|
|
22208
|
+
* List of generic font families
|
|
22209
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/font-family#generic-name
|
|
22187
22210
|
*/
|
|
22188
22211
|
|
|
22189
|
-
/**
|
|
22190
|
-
* Returns FabricText instance from an SVG element (<b>not yet implemented</b>)
|
|
22191
|
-
* @param {HTMLElement} element Element to parse
|
|
22192
|
-
* @param {Object} [options] Options object
|
|
22212
|
+
/**
|
|
22213
|
+
* Returns FabricText instance from an SVG element (<b>not yet implemented</b>)
|
|
22214
|
+
* @param {HTMLElement} element Element to parse
|
|
22215
|
+
* @param {Object} [options] Options object
|
|
22193
22216
|
*/
|
|
22194
22217
|
static async fromElement(element, options, cssRules) {
|
|
22195
22218
|
const parsedAttributes = parseAttributes(element, FabricText.ATTRIBUTE_NAMES, cssRules);
|
|
@@ -22228,10 +22251,10 @@ class FabricText extends StyledText {
|
|
|
22228
22251
|
scaledDiff = lineHeightDiff * textHeightScaleFactor,
|
|
22229
22252
|
textHeight = text.getScaledHeight() + scaledDiff;
|
|
22230
22253
|
let offX = 0;
|
|
22231
|
-
/*
|
|
22232
|
-
Adjust positioning:
|
|
22233
|
-
x/y attributes in SVG correspond to the bottom-left corner of text bounding box
|
|
22234
|
-
fabric output by default at top, left.
|
|
22254
|
+
/*
|
|
22255
|
+
Adjust positioning:
|
|
22256
|
+
x/y attributes in SVG correspond to the bottom-left corner of text bounding box
|
|
22257
|
+
fabric output by default at top, left.
|
|
22235
22258
|
*/
|
|
22236
22259
|
if (textAnchor === CENTER) {
|
|
22237
22260
|
offX = text.getScaledWidth() / 2;
|
|
@@ -22249,9 +22272,9 @@ class FabricText extends StyledText {
|
|
|
22249
22272
|
|
|
22250
22273
|
/* _FROM_SVG_END_ */
|
|
22251
22274
|
|
|
22252
|
-
/**
|
|
22253
|
-
* Check if the font is ready for accurate measurements
|
|
22254
|
-
* @private
|
|
22275
|
+
/**
|
|
22276
|
+
* Check if the font is ready for accurate measurements
|
|
22277
|
+
* @private
|
|
22255
22278
|
*/
|
|
22256
22279
|
_isFontReady() {
|
|
22257
22280
|
if (typeof document === 'undefined' || !('fonts' in document)) {
|
|
@@ -22264,9 +22287,9 @@ class FabricText extends StyledText {
|
|
|
22264
22287
|
}
|
|
22265
22288
|
}
|
|
22266
22289
|
|
|
22267
|
-
/**
|
|
22268
|
-
* Schedule re-initialization after font loads
|
|
22269
|
-
* @private
|
|
22290
|
+
/**
|
|
22291
|
+
* Schedule re-initialization after font loads
|
|
22292
|
+
* @private
|
|
22270
22293
|
*/
|
|
22271
22294
|
_scheduleInitAfterFontLoad() {
|
|
22272
22295
|
if (typeof document === 'undefined' || !('fonts' in document)) {
|
|
@@ -22302,8 +22325,8 @@ class FabricText extends StyledText {
|
|
|
22302
22325
|
});
|
|
22303
22326
|
}
|
|
22304
22327
|
|
|
22305
|
-
/**
|
|
22306
|
-
* Force complete text re-initialization (useful after JSON loading)
|
|
22328
|
+
/**
|
|
22329
|
+
* Force complete text re-initialization (useful after JSON loading)
|
|
22307
22330
|
*/
|
|
22308
22331
|
forceTextReinitialization() {
|
|
22309
22332
|
console.log('🔄 Force reinitializing text object');
|
|
@@ -22331,10 +22354,10 @@ class FabricText extends StyledText {
|
|
|
22331
22354
|
}
|
|
22332
22355
|
}
|
|
22333
22356
|
|
|
22334
|
-
/**
|
|
22335
|
-
* Returns FabricText instance from an object representation
|
|
22336
|
-
* @param {Object} object plain js Object to create an instance from
|
|
22337
|
-
* @returns {Promise<FabricText>}
|
|
22357
|
+
/**
|
|
22358
|
+
* Returns FabricText instance from an object representation
|
|
22359
|
+
* @param {Object} object plain js Object to create an instance from
|
|
22360
|
+
* @returns {Promise<FabricText>}
|
|
22338
22361
|
*/
|
|
22339
22362
|
static fromObject(object) {
|
|
22340
22363
|
return this._fromObject({
|
|
@@ -22436,10 +22459,10 @@ class FabricText extends StyledText {
|
|
|
22436
22459
|
});
|
|
22437
22460
|
}
|
|
22438
22461
|
}
|
|
22439
|
-
/**
|
|
22440
|
-
* Properties that requires a text layout recalculation when changed
|
|
22441
|
-
* @type string[]
|
|
22442
|
-
* @protected
|
|
22462
|
+
/**
|
|
22463
|
+
* Properties that requires a text layout recalculation when changed
|
|
22464
|
+
* @type string[]
|
|
22465
|
+
* @protected
|
|
22443
22466
|
*/
|
|
22444
22467
|
_defineProperty(FabricText, "textLayoutProperties", textLayoutProperties);
|
|
22445
22468
|
_defineProperty(FabricText, "cacheProperties", [...cacheProperties, ...additionalProps]);
|
|
@@ -22447,9 +22470,9 @@ _defineProperty(FabricText, "ownDefaults", textDefaultValues);
|
|
|
22447
22470
|
_defineProperty(FabricText, "type", 'Text');
|
|
22448
22471
|
_defineProperty(FabricText, "genericFonts", ['serif', 'sans-serif', 'monospace', 'cursive', 'fantasy', 'system-ui', 'ui-serif', 'ui-sans-serif', 'ui-monospace', 'ui-rounded', 'math', 'emoji', 'fangsong']);
|
|
22449
22472
|
/* _FROM_SVG_START_ */
|
|
22450
|
-
/**
|
|
22451
|
-
* List of attribute names to account for when parsing SVG element (used by {@link FabricText.fromElement})
|
|
22452
|
-
* @see: http://www.w3.org/TR/SVG/text.html#TextElement
|
|
22473
|
+
/**
|
|
22474
|
+
* List of attribute names to account for when parsing SVG element (used by {@link FabricText.fromElement})
|
|
22475
|
+
* @see: http://www.w3.org/TR/SVG/text.html#TextElement
|
|
22453
22476
|
*/
|
|
22454
22477
|
_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'));
|
|
22455
22478
|
applyMixins(FabricText, [TextSVGExportMixin]);
|
|
@@ -22836,8 +22859,8 @@ class OverlayEditor {
|
|
|
22836
22859
|
// We don't need to save/restore them here as it would conflict with IText's restoration
|
|
22837
22860
|
}
|
|
22838
22861
|
|
|
22839
|
-
/**
|
|
22840
|
-
* Get the container element for the overlay (parent of upperCanvasEl)
|
|
22862
|
+
/**
|
|
22863
|
+
* Get the container element for the overlay (parent of upperCanvasEl)
|
|
22841
22864
|
*/
|
|
22842
22865
|
getCanvasContainer() {
|
|
22843
22866
|
const upperCanvas = this.canvas.upperCanvasEl;
|
|
@@ -22851,8 +22874,8 @@ class OverlayEditor {
|
|
|
22851
22874
|
return container;
|
|
22852
22875
|
}
|
|
22853
22876
|
|
|
22854
|
-
/**
|
|
22855
|
-
* Create the overlay DOM structure
|
|
22877
|
+
/**
|
|
22878
|
+
* Create the overlay DOM structure
|
|
22856
22879
|
*/
|
|
22857
22880
|
createOverlayDOM() {
|
|
22858
22881
|
// Host div for positioning and overflow control
|
|
@@ -22907,8 +22930,8 @@ class OverlayEditor {
|
|
|
22907
22930
|
document.body.appendChild(this.hostDiv);
|
|
22908
22931
|
}
|
|
22909
22932
|
|
|
22910
|
-
/**
|
|
22911
|
-
* Attach all event listeners
|
|
22933
|
+
/**
|
|
22934
|
+
* Attach all event listeners
|
|
22912
22935
|
*/
|
|
22913
22936
|
attachEventListeners() {
|
|
22914
22937
|
// Textarea events
|
|
@@ -22928,8 +22951,8 @@ class OverlayEditor {
|
|
|
22928
22951
|
this.setupViewportChangeDetection();
|
|
22929
22952
|
}
|
|
22930
22953
|
|
|
22931
|
-
/**
|
|
22932
|
-
* Remove all event listeners
|
|
22954
|
+
/**
|
|
22955
|
+
* Remove all event listeners
|
|
22933
22956
|
*/
|
|
22934
22957
|
removeEventListeners() {
|
|
22935
22958
|
this.textarea.removeEventListener('input', this.boundHandlers.onInput);
|
|
@@ -22946,16 +22969,16 @@ class OverlayEditor {
|
|
|
22946
22969
|
this.restoreViewportChangeDetection();
|
|
22947
22970
|
}
|
|
22948
22971
|
|
|
22949
|
-
/**
|
|
22950
|
-
* Simple method to refresh positioning when canvas changes
|
|
22972
|
+
/**
|
|
22973
|
+
* Simple method to refresh positioning when canvas changes
|
|
22951
22974
|
*/
|
|
22952
22975
|
updatePosition() {
|
|
22953
22976
|
this.applyOverlayStyle();
|
|
22954
22977
|
}
|
|
22955
22978
|
|
|
22956
|
-
/**
|
|
22957
|
-
* Update the Fabric object bounds to match current textarea size
|
|
22958
|
-
* This ensures Fabric.js selection controls follow the growing textbox
|
|
22979
|
+
/**
|
|
22980
|
+
* Update the Fabric object bounds to match current textarea size
|
|
22981
|
+
* This ensures Fabric.js selection controls follow the growing textbox
|
|
22959
22982
|
*/
|
|
22960
22983
|
updateObjectBounds() {
|
|
22961
22984
|
if (this.isDestroyed) return;
|
|
@@ -22989,15 +23012,15 @@ class OverlayEditor {
|
|
|
22989
23012
|
}
|
|
22990
23013
|
}
|
|
22991
23014
|
|
|
22992
|
-
/**
|
|
22993
|
-
* Convert Fabric charSpacing (1/1000 em) to CSS letter-spacing (px)
|
|
23015
|
+
/**
|
|
23016
|
+
* Convert Fabric charSpacing (1/1000 em) to CSS letter-spacing (px)
|
|
22994
23017
|
*/
|
|
22995
23018
|
letterSpacingPx(charSpacing, fontSize) {
|
|
22996
23019
|
return charSpacing / 1000 * fontSize;
|
|
22997
23020
|
}
|
|
22998
23021
|
|
|
22999
|
-
/**
|
|
23000
|
-
* Detect text direction using first strong directional character
|
|
23022
|
+
/**
|
|
23023
|
+
* Detect text direction using first strong directional character
|
|
23001
23024
|
*/
|
|
23002
23025
|
firstStrongDir(text) {
|
|
23003
23026
|
// Hebrew: \u0590-\u05FF, Arabic: \u0600-\u06FF, \u0750-\u077F, \uFB50-\uFDFF, \uFE70-\uFEFF
|
|
@@ -23036,10 +23059,10 @@ class OverlayEditor {
|
|
|
23036
23059
|
const top = canvasRect.top + scrollY + screenPoint.y;
|
|
23037
23060
|
|
|
23038
23061
|
// 4. Calculate the precise width and height for the container
|
|
23039
|
-
// **THE FIX:** Use
|
|
23040
|
-
// This is the most reliable measure of the object's final rendered dimensions.
|
|
23062
|
+
// **THE FIX:** Use the same width calculation as measureLinesWithBrowser for consistency
|
|
23041
23063
|
const objectBounds = target.getBoundingRect();
|
|
23042
|
-
const
|
|
23064
|
+
const scaleX = target.scaleX || 1;
|
|
23065
|
+
const width = Math.round((target.width * scaleX + padding * 2) * zoom);
|
|
23043
23066
|
const height = Math.round(objectBounds.height * zoom);
|
|
23044
23067
|
|
|
23045
23068
|
// 5. Apply styles to host DIV - absolute positioning like rtl-test.html
|
|
@@ -23061,7 +23084,6 @@ class OverlayEditor {
|
|
|
23061
23084
|
// 6. Style the textarea - match Fabric's exact rendering with padding
|
|
23062
23085
|
const baseFontSize = (_target$fontSize = target.fontSize) !== null && _target$fontSize !== void 0 ? _target$fontSize : 16;
|
|
23063
23086
|
// Use scaleX for font scaling to match Fabric text scaling exactly
|
|
23064
|
-
const scaleX = target.scaleX || 1;
|
|
23065
23087
|
const finalFontSize = baseFontSize * scaleX * zoom;
|
|
23066
23088
|
const fabricLineHeight = target.lineHeight || 1.16;
|
|
23067
23089
|
// **THE FIX:** Use 'border-box' so the width property includes padding.
|
|
@@ -23123,7 +23145,7 @@ class OverlayEditor {
|
|
|
23123
23145
|
this.textarea.style.textAlignLast = 'left';
|
|
23124
23146
|
}
|
|
23125
23147
|
} else if (textAlign === 'justify-right') {
|
|
23126
|
-
// If text is LTR but fabric says justify-right, override to justify-left for better UX
|
|
23148
|
+
// If text is LTR but fabric says justify-right, override to justify-left for better UX
|
|
23127
23149
|
if (autoDetectedDirection === 'ltr') {
|
|
23128
23150
|
this.textarea.style.textAlignLast = 'left';
|
|
23129
23151
|
console.log(' → Overrode justify-right to justify-left for LTR text');
|
|
@@ -23234,8 +23256,8 @@ class OverlayEditor {
|
|
|
23234
23256
|
// Initial bounds are set correctly by Fabric.js - don't force update here
|
|
23235
23257
|
}
|
|
23236
23258
|
|
|
23237
|
-
/**
|
|
23238
|
-
* Debug method to compare textarea and canvas object bounding boxes
|
|
23259
|
+
/**
|
|
23260
|
+
* Debug method to compare textarea and canvas object bounding boxes
|
|
23239
23261
|
*/
|
|
23240
23262
|
debugBoundingBoxComparison() {
|
|
23241
23263
|
const target = this.target;
|
|
@@ -23305,8 +23327,8 @@ class OverlayEditor {
|
|
|
23305
23327
|
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
23306
23328
|
}
|
|
23307
23329
|
|
|
23308
|
-
/**
|
|
23309
|
-
* Debug method to compare text wrapping between textarea and Fabric text object
|
|
23330
|
+
/**
|
|
23331
|
+
* Debug method to compare text wrapping between textarea and Fabric text object
|
|
23310
23332
|
*/
|
|
23311
23333
|
debugTextWrapping() {
|
|
23312
23334
|
const target = this.target;
|
|
@@ -23391,8 +23413,8 @@ class OverlayEditor {
|
|
|
23391
23413
|
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
23392
23414
|
}
|
|
23393
23415
|
|
|
23394
|
-
/**
|
|
23395
|
-
* Focus the textarea and position cursor at end
|
|
23416
|
+
/**
|
|
23417
|
+
* Focus the textarea and position cursor at end
|
|
23396
23418
|
*/
|
|
23397
23419
|
focusTextarea() {
|
|
23398
23420
|
// For overlay editing, we want to keep the object in "selection mode" not "editing mode"
|
|
@@ -23432,8 +23454,8 @@ class OverlayEditor {
|
|
|
23432
23454
|
this.canvas.requestRenderAll();
|
|
23433
23455
|
}
|
|
23434
23456
|
|
|
23435
|
-
/**
|
|
23436
|
-
* Refresh overlay positioning and styling
|
|
23457
|
+
/**
|
|
23458
|
+
* Refresh overlay positioning and styling
|
|
23437
23459
|
*/
|
|
23438
23460
|
refresh() {
|
|
23439
23461
|
if (this.isDestroyed) return;
|
|
@@ -23441,32 +23463,34 @@ class OverlayEditor {
|
|
|
23441
23463
|
// Don't update object bounds on every refresh - only when textarea actually resizes
|
|
23442
23464
|
}
|
|
23443
23465
|
|
|
23444
|
-
/**
|
|
23445
|
-
* Destroy the overlay editor
|
|
23466
|
+
/**
|
|
23467
|
+
* Destroy the overlay editor
|
|
23446
23468
|
*/
|
|
23447
23469
|
destroy() {
|
|
23470
|
+
var _this$target$textAlig;
|
|
23448
23471
|
let commit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
23449
23472
|
if (this.isDestroyed) return;
|
|
23450
23473
|
this.isDestroyed = true;
|
|
23451
23474
|
this.removeEventListeners();
|
|
23452
23475
|
|
|
23453
|
-
//
|
|
23454
|
-
|
|
23455
|
-
|
|
23456
|
-
|
|
23457
|
-
|
|
23458
|
-
|
|
23459
|
-
|
|
23460
|
-
|
|
23476
|
+
// EXTRACT DOM DATA BEFORE REMOVING DOM for justify text preservation
|
|
23477
|
+
let extractedOverlayData = null;
|
|
23478
|
+
if (commit && (_this$target$textAlig = this.target.textAlign) !== null && _this$target$textAlig !== void 0 && _this$target$textAlig.includes('justify')) {
|
|
23479
|
+
try {
|
|
23480
|
+
// Store the DOM structure before destruction
|
|
23481
|
+
const result = extractLinesFromDOM(this.textarea);
|
|
23482
|
+
extractedOverlayData = result.lines;
|
|
23483
|
+
console.log('🔧 DESTROY: Extracted overlay lines before DOM removal');
|
|
23484
|
+
} catch (error) {
|
|
23485
|
+
console.warn('Failed to extract overlay lines before destruction:', error);
|
|
23461
23486
|
}
|
|
23462
23487
|
}
|
|
23463
23488
|
|
|
23464
|
-
//
|
|
23465
|
-
if (this.
|
|
23466
|
-
this.
|
|
23489
|
+
// Restore original opacity but keep overlayEditor reference for commit
|
|
23490
|
+
if (this.target.__overlayOriginalOpacity !== undefined) {
|
|
23491
|
+
this.target.opacity = this.target.__overlayOriginalOpacity;
|
|
23492
|
+
delete this.target.__overlayOriginalOpacity;
|
|
23467
23493
|
}
|
|
23468
|
-
|
|
23469
|
-
// Handle commit/cancel after restoring visibility
|
|
23470
23494
|
if (commit && !this.isComposing) {
|
|
23471
23495
|
const finalText = this.textarea.value;
|
|
23472
23496
|
|
|
@@ -23487,12 +23511,26 @@ class OverlayEditor {
|
|
|
23487
23511
|
console.log(`📝 Overlay Exit: Direction unchanged (${currentDirection}), text: "${finalText.substring(0, 30)}..."`);
|
|
23488
23512
|
}
|
|
23489
23513
|
if (this.onCommit) {
|
|
23514
|
+
// Store extracted overlay data on target for commitOverlayEdit to use
|
|
23515
|
+
if (extractedOverlayData) {
|
|
23516
|
+
this.target._extractedOverlayLines = extractedOverlayData;
|
|
23517
|
+
}
|
|
23490
23518
|
this.onCommit(finalText);
|
|
23491
23519
|
}
|
|
23492
23520
|
} else if (!commit && this.onCancel) {
|
|
23493
23521
|
this.onCancel();
|
|
23494
23522
|
}
|
|
23495
23523
|
|
|
23524
|
+
// Clear overlay editor reference AFTER commit/cancel handlers
|
|
23525
|
+
if (this.target.__overlayEditor === this) {
|
|
23526
|
+
this.target.__overlayEditor = undefined;
|
|
23527
|
+
}
|
|
23528
|
+
|
|
23529
|
+
// Remove DOM after commit/cancel handlers
|
|
23530
|
+
if (this.hostDiv.parentNode) {
|
|
23531
|
+
this.hostDiv.parentNode.removeChild(this.hostDiv);
|
|
23532
|
+
}
|
|
23533
|
+
|
|
23496
23534
|
// Note: Don't restore object cursors since IText manages all cursors in _restoreEditingProps
|
|
23497
23535
|
// Let the IText editing system handle proper restoration of all cursor properties
|
|
23498
23536
|
|
|
@@ -23507,6 +23545,9 @@ class OverlayEditor {
|
|
|
23507
23545
|
// Request canvas re-render
|
|
23508
23546
|
this.canvas.requestRenderAll();
|
|
23509
23547
|
}
|
|
23548
|
+
get textareaElement() {
|
|
23549
|
+
return this.textarea;
|
|
23550
|
+
}
|
|
23510
23551
|
|
|
23511
23552
|
// Event handlers
|
|
23512
23553
|
handleInput() {
|
|
@@ -23610,8 +23651,8 @@ class OverlayEditor {
|
|
|
23610
23651
|
}
|
|
23611
23652
|
}
|
|
23612
23653
|
|
|
23613
|
-
/**
|
|
23614
|
-
* Setup detection for viewport changes (zoom/pan)
|
|
23654
|
+
/**
|
|
23655
|
+
* Setup detection for viewport changes (zoom/pan)
|
|
23615
23656
|
*/
|
|
23616
23657
|
setupViewportChangeDetection() {
|
|
23617
23658
|
// Store original methods
|
|
@@ -23640,8 +23681,8 @@ class OverlayEditor {
|
|
|
23640
23681
|
};
|
|
23641
23682
|
}
|
|
23642
23683
|
|
|
23643
|
-
/**
|
|
23644
|
-
* Restore original viewport methods
|
|
23684
|
+
/**
|
|
23685
|
+
* Restore original viewport methods
|
|
23645
23686
|
*/
|
|
23646
23687
|
restoreViewportChangeDetection() {
|
|
23647
23688
|
if (this.canvas.__originalSetZoom) {
|
|
@@ -23656,8 +23697,8 @@ class OverlayEditor {
|
|
|
23656
23697
|
}
|
|
23657
23698
|
}
|
|
23658
23699
|
|
|
23659
|
-
/**
|
|
23660
|
-
* Enter overlay text editing mode for a text object
|
|
23700
|
+
/**
|
|
23701
|
+
* Enter overlay text editing mode for a text object
|
|
23661
23702
|
*/
|
|
23662
23703
|
function enterTextOverlayEdit(canvas, target, options) {
|
|
23663
23704
|
// If already in overlay editing, destroy existing editor first
|
|
@@ -23681,35 +23722,35 @@ function enterTextOverlayEdit(canvas, target, options) {
|
|
|
23681
23722
|
return editor;
|
|
23682
23723
|
}
|
|
23683
23724
|
|
|
23684
|
-
/**
|
|
23685
|
-
* extend this regex to support non english languages
|
|
23686
|
-
*
|
|
23687
|
-
* - ` ` Matches a SPACE character (char code 32).
|
|
23688
|
-
* - `\n` Matches a LINE FEED character (char code 10).
|
|
23689
|
-
* - `.` Matches a "." character (char code 46).
|
|
23690
|
-
* - `,` Matches a "," character (char code 44).
|
|
23691
|
-
* - `;` Matches a ";" character (char code 59).
|
|
23692
|
-
* - `!` Matches a "!" character (char code 33).
|
|
23693
|
-
* - `\?` Matches a "?" character (char code 63).
|
|
23694
|
-
* - `\-` Matches a "-" character (char code 45).
|
|
23725
|
+
/**
|
|
23726
|
+
* extend this regex to support non english languages
|
|
23727
|
+
*
|
|
23728
|
+
* - ` ` Matches a SPACE character (char code 32).
|
|
23729
|
+
* - `\n` Matches a LINE FEED character (char code 10).
|
|
23730
|
+
* - `.` Matches a "." character (char code 46).
|
|
23731
|
+
* - `,` Matches a "," character (char code 44).
|
|
23732
|
+
* - `;` Matches a ";" character (char code 59).
|
|
23733
|
+
* - `!` Matches a "!" character (char code 33).
|
|
23734
|
+
* - `\?` Matches a "?" character (char code 63).
|
|
23735
|
+
* - `\-` Matches a "-" character (char code 45).
|
|
23695
23736
|
*/
|
|
23696
23737
|
// eslint-disable-next-line no-useless-escape
|
|
23697
23738
|
const reNonWord = /[ \n\.,;!\?\-]/;
|
|
23698
23739
|
class ITextBehavior extends FabricText {
|
|
23699
23740
|
constructor() {
|
|
23700
23741
|
super(...arguments);
|
|
23701
|
-
/**
|
|
23702
|
-
* Helps determining when the text is in composition, so that the cursor
|
|
23703
|
-
* rendering is altered.
|
|
23742
|
+
/**
|
|
23743
|
+
* Helps determining when the text is in composition, so that the cursor
|
|
23744
|
+
* rendering is altered.
|
|
23704
23745
|
*/
|
|
23705
23746
|
_defineProperty(this, "_currentCursorOpacity", 1);
|
|
23706
23747
|
}
|
|
23707
|
-
/**
|
|
23708
|
-
* Keeps track if the IText object was selected before the actual click.
|
|
23709
|
-
* This because we want to delay enter editing by a click.
|
|
23748
|
+
/**
|
|
23749
|
+
* Keeps track if the IText object was selected before the actual click.
|
|
23750
|
+
* This because we want to delay enter editing by a click.
|
|
23710
23751
|
*/
|
|
23711
|
-
/**
|
|
23712
|
-
* Initializes all the interactive behavior of IText
|
|
23752
|
+
/**
|
|
23753
|
+
* Initializes all the interactive behavior of IText
|
|
23713
23754
|
*/
|
|
23714
23755
|
initBehavior() {
|
|
23715
23756
|
this._tick = this._tick.bind(this);
|
|
@@ -23722,8 +23763,8 @@ class ITextBehavior extends FabricText {
|
|
|
23722
23763
|
return super.onDeselect(options);
|
|
23723
23764
|
}
|
|
23724
23765
|
|
|
23725
|
-
/**
|
|
23726
|
-
* @private
|
|
23766
|
+
/**
|
|
23767
|
+
* @private
|
|
23727
23768
|
*/
|
|
23728
23769
|
_animateCursor(_ref) {
|
|
23729
23770
|
let {
|
|
@@ -23748,8 +23789,8 @@ class ITextBehavior extends FabricText {
|
|
|
23748
23789
|
});
|
|
23749
23790
|
}
|
|
23750
23791
|
|
|
23751
|
-
/**
|
|
23752
|
-
* changes the cursor from visible to invisible
|
|
23792
|
+
/**
|
|
23793
|
+
* changes the cursor from visible to invisible
|
|
23753
23794
|
*/
|
|
23754
23795
|
_tick(delay) {
|
|
23755
23796
|
this._currentTickState = this._animateCursor({
|
|
@@ -23760,8 +23801,8 @@ class ITextBehavior extends FabricText {
|
|
|
23760
23801
|
});
|
|
23761
23802
|
}
|
|
23762
23803
|
|
|
23763
|
-
/**
|
|
23764
|
-
* Changes the cursor from invisible to visible
|
|
23804
|
+
/**
|
|
23805
|
+
* Changes the cursor from invisible to visible
|
|
23765
23806
|
*/
|
|
23766
23807
|
_onTickComplete() {
|
|
23767
23808
|
var _this$_currentTickCom;
|
|
@@ -23773,16 +23814,16 @@ class ITextBehavior extends FabricText {
|
|
|
23773
23814
|
});
|
|
23774
23815
|
}
|
|
23775
23816
|
|
|
23776
|
-
/**
|
|
23777
|
-
* Initializes delayed cursor
|
|
23817
|
+
/**
|
|
23818
|
+
* Initializes delayed cursor
|
|
23778
23819
|
*/
|
|
23779
23820
|
initDelayedCursor(restart) {
|
|
23780
23821
|
this.abortCursorAnimation();
|
|
23781
23822
|
this._tick(restart ? 0 : this.cursorDelay);
|
|
23782
23823
|
}
|
|
23783
23824
|
|
|
23784
|
-
/**
|
|
23785
|
-
* Aborts cursor animation, clears all timeouts and clear textarea context if necessary
|
|
23825
|
+
/**
|
|
23826
|
+
* Aborts cursor animation, clears all timeouts and clear textarea context if necessary
|
|
23786
23827
|
*/
|
|
23787
23828
|
abortCursorAnimation() {
|
|
23788
23829
|
let shouldClear = false;
|
|
@@ -23800,9 +23841,9 @@ class ITextBehavior extends FabricText {
|
|
|
23800
23841
|
}
|
|
23801
23842
|
}
|
|
23802
23843
|
|
|
23803
|
-
/**
|
|
23804
|
-
* Restart tue cursor animation if either is in complete state ( between animations )
|
|
23805
|
-
* or if it never started before
|
|
23844
|
+
/**
|
|
23845
|
+
* Restart tue cursor animation if either is in complete state ( between animations )
|
|
23846
|
+
* or if it never started before
|
|
23806
23847
|
*/
|
|
23807
23848
|
restartCursorIfNeeded() {
|
|
23808
23849
|
if ([this._currentTickState, this._currentTickCompleteState].some(cursorAnimation => !cursorAnimation || cursorAnimation.isDone())) {
|
|
@@ -23810,8 +23851,8 @@ class ITextBehavior extends FabricText {
|
|
|
23810
23851
|
}
|
|
23811
23852
|
}
|
|
23812
23853
|
|
|
23813
|
-
/**
|
|
23814
|
-
* Selects entire text
|
|
23854
|
+
/**
|
|
23855
|
+
* Selects entire text
|
|
23815
23856
|
*/
|
|
23816
23857
|
selectAll() {
|
|
23817
23858
|
this.selectionStart = 0;
|
|
@@ -23821,26 +23862,26 @@ class ITextBehavior extends FabricText {
|
|
|
23821
23862
|
return this;
|
|
23822
23863
|
}
|
|
23823
23864
|
|
|
23824
|
-
/**
|
|
23825
|
-
* Selects entire text and updates the visual state
|
|
23865
|
+
/**
|
|
23866
|
+
* Selects entire text and updates the visual state
|
|
23826
23867
|
*/
|
|
23827
23868
|
cmdAll() {
|
|
23828
23869
|
this.selectAll();
|
|
23829
23870
|
this.renderCursorOrSelection();
|
|
23830
23871
|
}
|
|
23831
23872
|
|
|
23832
|
-
/**
|
|
23833
|
-
* Returns selected text
|
|
23834
|
-
* @return {String}
|
|
23873
|
+
/**
|
|
23874
|
+
* Returns selected text
|
|
23875
|
+
* @return {String}
|
|
23835
23876
|
*/
|
|
23836
23877
|
getSelectedText() {
|
|
23837
23878
|
return this._text.slice(this.selectionStart, this.selectionEnd).join('');
|
|
23838
23879
|
}
|
|
23839
23880
|
|
|
23840
|
-
/**
|
|
23841
|
-
* Find new selection index representing start of current word according to current selection index
|
|
23842
|
-
* @param {Number} startFrom Current selection index
|
|
23843
|
-
* @return {Number} New selection index
|
|
23881
|
+
/**
|
|
23882
|
+
* Find new selection index representing start of current word according to current selection index
|
|
23883
|
+
* @param {Number} startFrom Current selection index
|
|
23884
|
+
* @return {Number} New selection index
|
|
23844
23885
|
*/
|
|
23845
23886
|
findWordBoundaryLeft(startFrom) {
|
|
23846
23887
|
let offset = 0,
|
|
@@ -23860,10 +23901,10 @@ class ITextBehavior extends FabricText {
|
|
|
23860
23901
|
return startFrom - offset;
|
|
23861
23902
|
}
|
|
23862
23903
|
|
|
23863
|
-
/**
|
|
23864
|
-
* Find new selection index representing end of current word according to current selection index
|
|
23865
|
-
* @param {Number} startFrom Current selection index
|
|
23866
|
-
* @return {Number} New selection index
|
|
23904
|
+
/**
|
|
23905
|
+
* Find new selection index representing end of current word according to current selection index
|
|
23906
|
+
* @param {Number} startFrom Current selection index
|
|
23907
|
+
* @return {Number} New selection index
|
|
23867
23908
|
*/
|
|
23868
23909
|
findWordBoundaryRight(startFrom) {
|
|
23869
23910
|
let offset = 0,
|
|
@@ -23883,10 +23924,10 @@ class ITextBehavior extends FabricText {
|
|
|
23883
23924
|
return startFrom + offset;
|
|
23884
23925
|
}
|
|
23885
23926
|
|
|
23886
|
-
/**
|
|
23887
|
-
* Find new selection index representing start of current line according to current selection index
|
|
23888
|
-
* @param {Number} startFrom Current selection index
|
|
23889
|
-
* @return {Number} New selection index
|
|
23927
|
+
/**
|
|
23928
|
+
* Find new selection index representing start of current line according to current selection index
|
|
23929
|
+
* @param {Number} startFrom Current selection index
|
|
23930
|
+
* @return {Number} New selection index
|
|
23890
23931
|
*/
|
|
23891
23932
|
findLineBoundaryLeft(startFrom) {
|
|
23892
23933
|
let offset = 0,
|
|
@@ -23898,10 +23939,10 @@ class ITextBehavior extends FabricText {
|
|
|
23898
23939
|
return startFrom - offset;
|
|
23899
23940
|
}
|
|
23900
23941
|
|
|
23901
|
-
/**
|
|
23902
|
-
* Find new selection index representing end of current line according to current selection index
|
|
23903
|
-
* @param {Number} startFrom Current selection index
|
|
23904
|
-
* @return {Number} New selection index
|
|
23942
|
+
/**
|
|
23943
|
+
* Find new selection index representing end of current line according to current selection index
|
|
23944
|
+
* @param {Number} startFrom Current selection index
|
|
23945
|
+
* @return {Number} New selection index
|
|
23905
23946
|
*/
|
|
23906
23947
|
findLineBoundaryRight(startFrom) {
|
|
23907
23948
|
let offset = 0,
|
|
@@ -23913,11 +23954,11 @@ class ITextBehavior extends FabricText {
|
|
|
23913
23954
|
return startFrom + offset;
|
|
23914
23955
|
}
|
|
23915
23956
|
|
|
23916
|
-
/**
|
|
23917
|
-
* Finds index corresponding to beginning or end of a word
|
|
23918
|
-
* @param {Number} selectionStart Index of a character
|
|
23919
|
-
* @param {Number} direction 1 or -1
|
|
23920
|
-
* @return {Number} Index of the beginning or end of a word
|
|
23957
|
+
/**
|
|
23958
|
+
* Finds index corresponding to beginning or end of a word
|
|
23959
|
+
* @param {Number} selectionStart Index of a character
|
|
23960
|
+
* @param {Number} direction 1 or -1
|
|
23961
|
+
* @return {Number} Index of the beginning or end of a word
|
|
23921
23962
|
*/
|
|
23922
23963
|
searchWordBoundary(selectionStart, direction) {
|
|
23923
23964
|
const text = this._text;
|
|
@@ -23935,9 +23976,9 @@ class ITextBehavior extends FabricText {
|
|
|
23935
23976
|
return index;
|
|
23936
23977
|
}
|
|
23937
23978
|
|
|
23938
|
-
/**
|
|
23939
|
-
* Selects the word that contains the char at index selectionStart
|
|
23940
|
-
* @param {Number} selectionStart Index of a character
|
|
23979
|
+
/**
|
|
23980
|
+
* Selects the word that contains the char at index selectionStart
|
|
23981
|
+
* @param {Number} selectionStart Index of a character
|
|
23941
23982
|
*/
|
|
23942
23983
|
selectWord(selectionStart) {
|
|
23943
23984
|
selectionStart = selectionStart !== null && selectionStart !== void 0 ? selectionStart : this.selectionStart;
|
|
@@ -23953,9 +23994,9 @@ class ITextBehavior extends FabricText {
|
|
|
23953
23994
|
this.renderCursorOrSelection();
|
|
23954
23995
|
}
|
|
23955
23996
|
|
|
23956
|
-
/**
|
|
23957
|
-
* Selects the line that contains selectionStart
|
|
23958
|
-
* @param {Number} selectionStart Index of a character
|
|
23997
|
+
/**
|
|
23998
|
+
* Selects the line that contains selectionStart
|
|
23999
|
+
* @param {Number} selectionStart Index of a character
|
|
23959
24000
|
*/
|
|
23960
24001
|
selectLine(selectionStart) {
|
|
23961
24002
|
selectionStart = selectionStart !== null && selectionStart !== void 0 ? selectionStart : this.selectionStart;
|
|
@@ -23967,8 +24008,8 @@ class ITextBehavior extends FabricText {
|
|
|
23967
24008
|
this._updateTextarea();
|
|
23968
24009
|
}
|
|
23969
24010
|
|
|
23970
|
-
/**
|
|
23971
|
-
* Enters editing state
|
|
24011
|
+
/**
|
|
24012
|
+
* Enters editing state
|
|
23972
24013
|
*/
|
|
23973
24014
|
enterEditing(e) {
|
|
23974
24015
|
if (this.isEditing || !this.editable) {
|
|
@@ -23988,8 +24029,8 @@ class ITextBehavior extends FabricText {
|
|
|
23988
24029
|
}
|
|
23989
24030
|
}
|
|
23990
24031
|
|
|
23991
|
-
/**
|
|
23992
|
-
* runs the actual logic that enter from editing state, see {@link enterEditing}
|
|
24032
|
+
/**
|
|
24033
|
+
* runs the actual logic that enter from editing state, see {@link enterEditing}
|
|
23993
24034
|
*/
|
|
23994
24035
|
enterEditingImpl() {
|
|
23995
24036
|
if (this.canvas) {
|
|
@@ -24000,6 +24041,18 @@ class ITextBehavior extends FabricText {
|
|
|
24000
24041
|
|
|
24001
24042
|
// Check if using overlay editing
|
|
24002
24043
|
if (this.useOverlayEditing) {
|
|
24044
|
+
// For justify text, backup the current working state before overlay editing
|
|
24045
|
+
if (this.textAlign.includes('justify')) {
|
|
24046
|
+
console.log('💾 BACKUP: Saving pre-overlay justify state');
|
|
24047
|
+
this._originalText = this.text; // Store original text to detect changes
|
|
24048
|
+
this._preOverlayJustifyState = {
|
|
24049
|
+
__charBounds: JSON.parse(JSON.stringify(this.__charBounds || [])),
|
|
24050
|
+
__lineHeights: [...(this.__lineHeights || [])],
|
|
24051
|
+
__lineWidths: [...(this.__lineWidths || [])],
|
|
24052
|
+
textLines: [...(this.textLines || [])],
|
|
24053
|
+
_textLines: (this._textLines || []).map(line => [...line])
|
|
24054
|
+
};
|
|
24055
|
+
}
|
|
24003
24056
|
this.enterOverlayEditing();
|
|
24004
24057
|
} else {
|
|
24005
24058
|
this.initHiddenTextarea();
|
|
@@ -24013,8 +24066,8 @@ class ITextBehavior extends FabricText {
|
|
|
24013
24066
|
}
|
|
24014
24067
|
}
|
|
24015
24068
|
|
|
24016
|
-
/**
|
|
24017
|
-
* Enter overlay editing mode using DOM textarea overlay
|
|
24069
|
+
/**
|
|
24070
|
+
* Enter overlay editing mode using DOM textarea overlay
|
|
24018
24071
|
*/
|
|
24019
24072
|
enterOverlayEditing() {
|
|
24020
24073
|
this._saveEditingProps();
|
|
@@ -24035,33 +24088,85 @@ class ITextBehavior extends FabricText {
|
|
|
24035
24088
|
});
|
|
24036
24089
|
}
|
|
24037
24090
|
|
|
24038
|
-
/**
|
|
24039
|
-
* Commit overlay editing changes
|
|
24091
|
+
/**
|
|
24092
|
+
* Commit overlay editing changes
|
|
24040
24093
|
*/
|
|
24041
24094
|
commitOverlayEdit(text) {
|
|
24042
24095
|
const overlayEditor = this.__overlayEditor;
|
|
24043
|
-
|
|
24044
|
-
|
|
24045
|
-
|
|
24096
|
+
|
|
24097
|
+
// Update text first so browser line cache uses the new content
|
|
24098
|
+
this.text = text;
|
|
24099
|
+
|
|
24100
|
+
// For justify text, restore pre-overlay state only if text didn't change
|
|
24101
|
+
if (this.textAlign.includes('justify')) {
|
|
24102
|
+
const textChanged = this._originalText !== text;
|
|
24103
|
+
console.log('🔄 JUSTIFY CHECK: Text changed:', textChanged);
|
|
24104
|
+
|
|
24105
|
+
// Only restore backup state if text didn't change
|
|
24106
|
+
if (!textChanged) {
|
|
24107
|
+
const backupState = this._preOverlayJustifyState;
|
|
24108
|
+
if (backupState) {
|
|
24109
|
+
var _this$canvas;
|
|
24110
|
+
console.log('📦 RESTORE: Text unchanged, restoring pre-overlay state');
|
|
24111
|
+
// Restore the working character bounds and measurements (but keep current text)
|
|
24112
|
+
this.__charBounds = JSON.parse(JSON.stringify(backupState.__charBounds));
|
|
24113
|
+
this.__lineHeights = [...backupState.__lineHeights];
|
|
24114
|
+
this.__lineWidths = [...backupState.__lineWidths];
|
|
24115
|
+
this.textLines = [...backupState.textLines];
|
|
24116
|
+
this._textLines = backupState._textLines.map(line => [...line]);
|
|
24117
|
+
|
|
24118
|
+
// Clear the backup
|
|
24119
|
+
delete this._preOverlayJustifyState;
|
|
24120
|
+
delete this._originalText;
|
|
24121
|
+
|
|
24122
|
+
// Just request a render, don't rebuild
|
|
24123
|
+
(_this$canvas = this.canvas) === null || _this$canvas === void 0 || _this$canvas.requestRenderAll();
|
|
24124
|
+
return;
|
|
24125
|
+
}
|
|
24126
|
+
} else {
|
|
24127
|
+
console.log('🆕 REBUILD: Text changed, need to rebuild justify layout');
|
|
24128
|
+
// Clean up backup since we won't use it
|
|
24129
|
+
delete this._preOverlayJustifyState;
|
|
24130
|
+
delete this._originalText;
|
|
24131
|
+
}
|
|
24132
|
+
}
|
|
24133
|
+
if (overlayEditor && overlayEditor.textareaElement) {
|
|
24134
|
+
// For non-justify text, extract browser lines normally
|
|
24135
|
+
try {
|
|
24046
24136
|
const result = extractLinesFromDOM(overlayEditor.textareaElement);
|
|
24047
|
-
storeBrowserLines(this, result.lines);
|
|
24137
|
+
storeBrowserLines(this, result.lines, result.width);
|
|
24048
24138
|
} catch (error) {
|
|
24049
24139
|
console.warn('Failed to extract browser lines:', error);
|
|
24050
24140
|
}
|
|
24051
24141
|
}
|
|
24052
24142
|
|
|
24053
|
-
//
|
|
24054
|
-
this.text = text;
|
|
24143
|
+
// Trigger layout recalculation
|
|
24055
24144
|
this.dirty = true;
|
|
24056
24145
|
this.initDimensions();
|
|
24146
|
+
|
|
24147
|
+
// For justify text, force complete reconstruction after overlay editing
|
|
24148
|
+
if (this.textAlign.includes('justify') && 'enlargeSpaces' in this) {
|
|
24149
|
+
setTimeout(() => {
|
|
24150
|
+
var _this$canvas2;
|
|
24151
|
+
console.log('🔧 FORCE REBUILD: Rebuilding justify text after overlay editing');
|
|
24152
|
+
// Force complete reconstruction of character bounds
|
|
24153
|
+
this.__charBounds = [];
|
|
24154
|
+
this.__lineHeights = [];
|
|
24155
|
+
this.__lineWidths = [];
|
|
24156
|
+
// Re-run initDimensions to rebuild everything
|
|
24157
|
+
this.initDimensions();
|
|
24158
|
+
(_this$canvas2 = this.canvas) === null || _this$canvas2 === void 0 || _this$canvas2.requestRenderAll();
|
|
24159
|
+
}, 20);
|
|
24160
|
+
}
|
|
24057
24161
|
this.setCoords();
|
|
24058
24162
|
this.exitEditing();
|
|
24059
24163
|
this.fire('changed');
|
|
24060
24164
|
this.canvas && this.canvas.requestRenderAll();
|
|
24165
|
+
console.log('🔧 DEBUG: commitOverlayEdit complete');
|
|
24061
24166
|
}
|
|
24062
24167
|
|
|
24063
|
-
/**
|
|
24064
|
-
* Cancel overlay editing without changes
|
|
24168
|
+
/**
|
|
24169
|
+
* Cancel overlay editing without changes
|
|
24065
24170
|
*/
|
|
24066
24171
|
cancelOverlayEdit() {
|
|
24067
24172
|
// Restore original text
|
|
@@ -24069,8 +24174,8 @@ class ITextBehavior extends FabricText {
|
|
|
24069
24174
|
this.exitEditing();
|
|
24070
24175
|
}
|
|
24071
24176
|
|
|
24072
|
-
/**
|
|
24073
|
-
* called by {@link Canvas#textEditingManager}
|
|
24177
|
+
/**
|
|
24178
|
+
* called by {@link Canvas#textEditingManager}
|
|
24074
24179
|
*/
|
|
24075
24180
|
updateSelectionOnMouseMove(e) {
|
|
24076
24181
|
if (this.getActiveControl()) {
|
|
@@ -24098,8 +24203,8 @@ class ITextBehavior extends FabricText {
|
|
|
24098
24203
|
}
|
|
24099
24204
|
}
|
|
24100
24205
|
|
|
24101
|
-
/**
|
|
24102
|
-
* @private
|
|
24206
|
+
/**
|
|
24207
|
+
* @private
|
|
24103
24208
|
*/
|
|
24104
24209
|
_setEditingProps() {
|
|
24105
24210
|
this.hoverCursor = 'text';
|
|
@@ -24111,8 +24216,8 @@ class ITextBehavior extends FabricText {
|
|
|
24111
24216
|
this.lockMovementX = this.lockMovementY = true;
|
|
24112
24217
|
}
|
|
24113
24218
|
|
|
24114
|
-
/**
|
|
24115
|
-
* convert from textarea to grapheme indexes
|
|
24219
|
+
/**
|
|
24220
|
+
* convert from textarea to grapheme indexes
|
|
24116
24221
|
*/
|
|
24117
24222
|
fromStringToGraphemeSelection(start, end, text) {
|
|
24118
24223
|
const smallerTextStart = text.slice(0, start),
|
|
@@ -24131,8 +24236,8 @@ class ITextBehavior extends FabricText {
|
|
|
24131
24236
|
};
|
|
24132
24237
|
}
|
|
24133
24238
|
|
|
24134
|
-
/**
|
|
24135
|
-
* convert from fabric to textarea values
|
|
24239
|
+
/**
|
|
24240
|
+
* convert from fabric to textarea values
|
|
24136
24241
|
*/
|
|
24137
24242
|
fromGraphemeToStringSelection(start, end, graphemes) {
|
|
24138
24243
|
const smallerTextStart = graphemes.slice(0, start),
|
|
@@ -24151,8 +24256,8 @@ class ITextBehavior extends FabricText {
|
|
|
24151
24256
|
};
|
|
24152
24257
|
}
|
|
24153
24258
|
|
|
24154
|
-
/**
|
|
24155
|
-
* @private
|
|
24259
|
+
/**
|
|
24260
|
+
* @private
|
|
24156
24261
|
*/
|
|
24157
24262
|
_updateTextarea() {
|
|
24158
24263
|
console.log('🔤 _updateTextarea called with fabric text:', this.text);
|
|
@@ -24177,8 +24282,8 @@ class ITextBehavior extends FabricText {
|
|
|
24177
24282
|
this.updateTextareaPosition();
|
|
24178
24283
|
}
|
|
24179
24284
|
|
|
24180
|
-
/**
|
|
24181
|
-
* @private
|
|
24285
|
+
/**
|
|
24286
|
+
* @private
|
|
24182
24287
|
*/
|
|
24183
24288
|
updateFromTextArea() {
|
|
24184
24289
|
if (!this.hiddenTextarea) {
|
|
@@ -24198,8 +24303,8 @@ class ITextBehavior extends FabricText {
|
|
|
24198
24303
|
this.updateTextareaPosition();
|
|
24199
24304
|
}
|
|
24200
24305
|
|
|
24201
|
-
/**
|
|
24202
|
-
* @private
|
|
24306
|
+
/**
|
|
24307
|
+
* @private
|
|
24203
24308
|
*/
|
|
24204
24309
|
updateTextareaPosition() {
|
|
24205
24310
|
if (this.selectionStart === this.selectionEnd) {
|
|
@@ -24209,9 +24314,9 @@ class ITextBehavior extends FabricText {
|
|
|
24209
24314
|
}
|
|
24210
24315
|
}
|
|
24211
24316
|
|
|
24212
|
-
/**
|
|
24213
|
-
* @private
|
|
24214
|
-
* @return {Object} style contains style for hiddenTextarea
|
|
24317
|
+
/**
|
|
24318
|
+
* @private
|
|
24319
|
+
* @return {Object} style contains style for hiddenTextarea
|
|
24215
24320
|
*/
|
|
24216
24321
|
_calcTextareaPosition() {
|
|
24217
24322
|
if (!this.canvas) {
|
|
@@ -24258,8 +24363,8 @@ class ITextBehavior extends FabricText {
|
|
|
24258
24363
|
};
|
|
24259
24364
|
}
|
|
24260
24365
|
|
|
24261
|
-
/**
|
|
24262
|
-
* @private
|
|
24366
|
+
/**
|
|
24367
|
+
* @private
|
|
24263
24368
|
*/
|
|
24264
24369
|
_saveEditingProps() {
|
|
24265
24370
|
this._savedProps = {
|
|
@@ -24276,8 +24381,8 @@ class ITextBehavior extends FabricText {
|
|
|
24276
24381
|
};
|
|
24277
24382
|
}
|
|
24278
24383
|
|
|
24279
|
-
/**
|
|
24280
|
-
* @private
|
|
24384
|
+
/**
|
|
24385
|
+
* @private
|
|
24281
24386
|
*/
|
|
24282
24387
|
_restoreEditingProps() {
|
|
24283
24388
|
if (!this._savedProps) {
|
|
@@ -24297,9 +24402,9 @@ class ITextBehavior extends FabricText {
|
|
|
24297
24402
|
delete this._savedProps;
|
|
24298
24403
|
}
|
|
24299
24404
|
|
|
24300
|
-
/**
|
|
24301
|
-
* runs the actual logic that exits from editing state, see {@link exitEditing}
|
|
24302
|
-
* But it does not fire events
|
|
24405
|
+
/**
|
|
24406
|
+
* runs the actual logic that exits from editing state, see {@link exitEditing}
|
|
24407
|
+
* But it does not fire events
|
|
24303
24408
|
*/
|
|
24304
24409
|
exitEditingImpl() {
|
|
24305
24410
|
const hiddenTextarea = this.hiddenTextarea;
|
|
@@ -24320,8 +24425,8 @@ class ITextBehavior extends FabricText {
|
|
|
24320
24425
|
}
|
|
24321
24426
|
}
|
|
24322
24427
|
|
|
24323
|
-
/**
|
|
24324
|
-
* Exits from editing state and fires relevant events
|
|
24428
|
+
/**
|
|
24429
|
+
* Exits from editing state and fires relevant events
|
|
24325
24430
|
*/
|
|
24326
24431
|
exitEditing() {
|
|
24327
24432
|
const isTextChanged = this._textBeforeEdit !== this.text;
|
|
@@ -24340,8 +24445,8 @@ class ITextBehavior extends FabricText {
|
|
|
24340
24445
|
return this;
|
|
24341
24446
|
}
|
|
24342
24447
|
|
|
24343
|
-
/**
|
|
24344
|
-
* @private
|
|
24448
|
+
/**
|
|
24449
|
+
* @private
|
|
24345
24450
|
*/
|
|
24346
24451
|
_removeExtraneousStyles() {
|
|
24347
24452
|
for (const prop in this.styles) {
|
|
@@ -24351,10 +24456,10 @@ class ITextBehavior extends FabricText {
|
|
|
24351
24456
|
}
|
|
24352
24457
|
}
|
|
24353
24458
|
|
|
24354
|
-
/**
|
|
24355
|
-
* remove and reflow a style block from start to end.
|
|
24356
|
-
* @param {Number} start linear start position for removal (included in removal)
|
|
24357
|
-
* @param {Number} end linear end position for removal ( excluded from removal )
|
|
24459
|
+
/**
|
|
24460
|
+
* remove and reflow a style block from start to end.
|
|
24461
|
+
* @param {Number} start linear start position for removal (included in removal)
|
|
24462
|
+
* @param {Number} end linear end position for removal ( excluded from removal )
|
|
24358
24463
|
*/
|
|
24359
24464
|
removeStyleFromTo(start, end) {
|
|
24360
24465
|
const {
|
|
@@ -24407,10 +24512,10 @@ class ITextBehavior extends FabricText {
|
|
|
24407
24512
|
}
|
|
24408
24513
|
}
|
|
24409
24514
|
|
|
24410
|
-
/**
|
|
24411
|
-
* Shifts line styles up or down
|
|
24412
|
-
* @param {Number} lineIndex Index of a line
|
|
24413
|
-
* @param {Number} offset Can any number?
|
|
24515
|
+
/**
|
|
24516
|
+
* Shifts line styles up or down
|
|
24517
|
+
* @param {Number} lineIndex Index of a line
|
|
24518
|
+
* @param {Number} offset Can any number?
|
|
24414
24519
|
*/
|
|
24415
24520
|
shiftLineStyles(lineIndex, offset) {
|
|
24416
24521
|
const clonedStyles = Object.assign({}, this.styles);
|
|
@@ -24425,15 +24530,15 @@ class ITextBehavior extends FabricText {
|
|
|
24425
24530
|
}
|
|
24426
24531
|
}
|
|
24427
24532
|
|
|
24428
|
-
/**
|
|
24429
|
-
* Handle insertion of more consecutive style lines for when one or more
|
|
24430
|
-
* newlines gets added to the text. Since current style needs to be shifted
|
|
24431
|
-
* first we shift the current style of the number lines needed, then we add
|
|
24432
|
-
* new lines from the last to the first.
|
|
24433
|
-
* @param {Number} lineIndex Index of a line
|
|
24434
|
-
* @param {Number} charIndex Index of a char
|
|
24435
|
-
* @param {Number} qty number of lines to add
|
|
24436
|
-
* @param {Array} copiedStyle Array of objects styles
|
|
24533
|
+
/**
|
|
24534
|
+
* Handle insertion of more consecutive style lines for when one or more
|
|
24535
|
+
* newlines gets added to the text. Since current style needs to be shifted
|
|
24536
|
+
* first we shift the current style of the number lines needed, then we add
|
|
24537
|
+
* new lines from the last to the first.
|
|
24538
|
+
* @param {Number} lineIndex Index of a line
|
|
24539
|
+
* @param {Number} charIndex Index of a char
|
|
24540
|
+
* @param {Number} qty number of lines to add
|
|
24541
|
+
* @param {Array} copiedStyle Array of objects styles
|
|
24437
24542
|
*/
|
|
24438
24543
|
insertNewlineStyleObject(lineIndex, charIndex, qty, copiedStyle) {
|
|
24439
24544
|
const newLineStyles = {};
|
|
@@ -24493,12 +24598,12 @@ class ITextBehavior extends FabricText {
|
|
|
24493
24598
|
this._forceClearCache = true;
|
|
24494
24599
|
}
|
|
24495
24600
|
|
|
24496
|
-
/**
|
|
24497
|
-
* Inserts style object for a given line/char index
|
|
24498
|
-
* @param {Number} lineIndex Index of a line
|
|
24499
|
-
* @param {Number} charIndex Index of a char
|
|
24500
|
-
* @param {Number} quantity number Style object to insert, if given
|
|
24501
|
-
* @param {Array} copiedStyle array of style objects
|
|
24601
|
+
/**
|
|
24602
|
+
* Inserts style object for a given line/char index
|
|
24603
|
+
* @param {Number} lineIndex Index of a line
|
|
24604
|
+
* @param {Number} charIndex Index of a char
|
|
24605
|
+
* @param {Number} quantity number Style object to insert, if given
|
|
24606
|
+
* @param {Array} copiedStyle array of style objects
|
|
24502
24607
|
*/
|
|
24503
24608
|
insertCharStyleObject(lineIndex, charIndex, quantity, copiedStyle) {
|
|
24504
24609
|
if (!this.styles) {
|
|
@@ -24547,11 +24652,11 @@ class ITextBehavior extends FabricText {
|
|
|
24547
24652
|
}
|
|
24548
24653
|
}
|
|
24549
24654
|
|
|
24550
|
-
/**
|
|
24551
|
-
* Inserts style object(s)
|
|
24552
|
-
* @param {Array} insertedText Characters at the location where style is inserted
|
|
24553
|
-
* @param {Number} start cursor index for inserting style
|
|
24554
|
-
* @param {Array} [copiedStyle] array of style objects to insert.
|
|
24655
|
+
/**
|
|
24656
|
+
* Inserts style object(s)
|
|
24657
|
+
* @param {Array} insertedText Characters at the location where style is inserted
|
|
24658
|
+
* @param {Number} start cursor index for inserting style
|
|
24659
|
+
* @param {Array} [copiedStyle] array of style objects to insert.
|
|
24555
24660
|
*/
|
|
24556
24661
|
insertNewStyleBlock(insertedText, start, copiedStyle) {
|
|
24557
24662
|
const cursorLoc = this.get2DCursorLocation(start, true),
|
|
@@ -24592,12 +24697,12 @@ class ITextBehavior extends FabricText {
|
|
|
24592
24697
|
}
|
|
24593
24698
|
}
|
|
24594
24699
|
|
|
24595
|
-
/**
|
|
24596
|
-
* Removes characters from start/end
|
|
24597
|
-
* start/end ar per grapheme position in _text array.
|
|
24598
|
-
*
|
|
24599
|
-
* @param {Number} start
|
|
24600
|
-
* @param {Number} end default to start + 1
|
|
24700
|
+
/**
|
|
24701
|
+
* Removes characters from start/end
|
|
24702
|
+
* start/end ar per grapheme position in _text array.
|
|
24703
|
+
*
|
|
24704
|
+
* @param {Number} start
|
|
24705
|
+
* @param {Number} end default to start + 1
|
|
24601
24706
|
*/
|
|
24602
24707
|
removeChars(start) {
|
|
24603
24708
|
let end = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : start + 1;
|
|
@@ -24610,17 +24715,17 @@ class ITextBehavior extends FabricText {
|
|
|
24610
24715
|
this._removeExtraneousStyles();
|
|
24611
24716
|
}
|
|
24612
24717
|
|
|
24613
|
-
/**
|
|
24614
|
-
* insert characters at start position, before start position.
|
|
24615
|
-
* start equal 1 it means the text get inserted between actual grapheme 0 and 1
|
|
24616
|
-
* if style array is provided, it must be as the same length of text in graphemes
|
|
24617
|
-
* if end is provided and is bigger than start, old text is replaced.
|
|
24618
|
-
* start/end ar per grapheme position in _text array.
|
|
24619
|
-
*
|
|
24620
|
-
* @param {String} text text to insert
|
|
24621
|
-
* @param {Array} style array of style objects
|
|
24622
|
-
* @param {Number} start
|
|
24623
|
-
* @param {Number} end default to start + 1
|
|
24718
|
+
/**
|
|
24719
|
+
* insert characters at start position, before start position.
|
|
24720
|
+
* start equal 1 it means the text get inserted between actual grapheme 0 and 1
|
|
24721
|
+
* if style array is provided, it must be as the same length of text in graphemes
|
|
24722
|
+
* if end is provided and is bigger than start, old text is replaced.
|
|
24723
|
+
* start/end ar per grapheme position in _text array.
|
|
24724
|
+
*
|
|
24725
|
+
* @param {String} text text to insert
|
|
24726
|
+
* @param {Array} style array of style objects
|
|
24727
|
+
* @param {Number} start
|
|
24728
|
+
* @param {Number} end default to start + 1
|
|
24624
24729
|
*/
|
|
24625
24730
|
insertChars(text, style, start) {
|
|
24626
24731
|
let end = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : start;
|
|
@@ -24637,9 +24742,9 @@ class ITextBehavior extends FabricText {
|
|
|
24637
24742
|
this._removeExtraneousStyles();
|
|
24638
24743
|
}
|
|
24639
24744
|
|
|
24640
|
-
/**
|
|
24641
|
-
* Set the selectionStart and selectionEnd according to the new position of cursor
|
|
24642
|
-
* mimic the key - mouse navigation when shift is pressed.
|
|
24745
|
+
/**
|
|
24746
|
+
* Set the selectionStart and selectionEnd according to the new position of cursor
|
|
24747
|
+
* mimic the key - mouse navigation when shift is pressed.
|
|
24643
24748
|
*/
|
|
24644
24749
|
setSelectionStartEndWithShift(start, end, newSelection) {
|
|
24645
24750
|
if (newSelection <= start) {
|
|
@@ -24670,36 +24775,36 @@ class ITextBehavior extends FabricText {
|
|
|
24670
24775
|
}
|
|
24671
24776
|
|
|
24672
24777
|
class ITextKeyBehavior extends ITextBehavior {
|
|
24673
|
-
/**
|
|
24674
|
-
* For functionalities on keyDown
|
|
24675
|
-
* Map a special key to a function of the instance/prototype
|
|
24676
|
-
* If you need different behavior for ESC or TAB or arrows, you have to change
|
|
24677
|
-
* this map setting the name of a function that you build on the IText or
|
|
24678
|
-
* your prototype.
|
|
24679
|
-
* the map change will affect all Instances unless you need for only some text Instances
|
|
24680
|
-
* in that case you have to clone this object and assign your Instance.
|
|
24681
|
-
* this.keysMap = Object.assign({}, this.keysMap);
|
|
24682
|
-
* The function must be in IText.prototype.myFunction And will receive event as args[0]
|
|
24778
|
+
/**
|
|
24779
|
+
* For functionalities on keyDown
|
|
24780
|
+
* Map a special key to a function of the instance/prototype
|
|
24781
|
+
* If you need different behavior for ESC or TAB or arrows, you have to change
|
|
24782
|
+
* this map setting the name of a function that you build on the IText or
|
|
24783
|
+
* your prototype.
|
|
24784
|
+
* the map change will affect all Instances unless you need for only some text Instances
|
|
24785
|
+
* in that case you have to clone this object and assign your Instance.
|
|
24786
|
+
* this.keysMap = Object.assign({}, this.keysMap);
|
|
24787
|
+
* The function must be in IText.prototype.myFunction And will receive event as args[0]
|
|
24683
24788
|
*/
|
|
24684
24789
|
|
|
24685
|
-
/**
|
|
24686
|
-
* For functionalities on keyUp + ctrl || cmd
|
|
24790
|
+
/**
|
|
24791
|
+
* For functionalities on keyUp + ctrl || cmd
|
|
24687
24792
|
*/
|
|
24688
24793
|
|
|
24689
|
-
/**
|
|
24690
|
-
* For functionalities on keyDown + ctrl || cmd
|
|
24794
|
+
/**
|
|
24795
|
+
* For functionalities on keyDown + ctrl || cmd
|
|
24691
24796
|
*/
|
|
24692
24797
|
|
|
24693
|
-
/**
|
|
24694
|
-
* DOM container to append the hiddenTextarea.
|
|
24695
|
-
* An alternative to attaching to the document.body.
|
|
24696
|
-
* Useful to reduce laggish redraw of the full document.body tree and
|
|
24697
|
-
* also with modals event capturing that won't let the textarea take focus.
|
|
24698
|
-
* @type HTMLElement
|
|
24798
|
+
/**
|
|
24799
|
+
* DOM container to append the hiddenTextarea.
|
|
24800
|
+
* An alternative to attaching to the document.body.
|
|
24801
|
+
* Useful to reduce laggish redraw of the full document.body tree and
|
|
24802
|
+
* also with modals event capturing that won't let the textarea take focus.
|
|
24803
|
+
* @type HTMLElement
|
|
24699
24804
|
*/
|
|
24700
24805
|
|
|
24701
|
-
/**
|
|
24702
|
-
* Initializes hidden textarea (needed to bring up keyboard in iOS)
|
|
24806
|
+
/**
|
|
24807
|
+
* Initializes hidden textarea (needed to bring up keyboard in iOS)
|
|
24703
24808
|
*/
|
|
24704
24809
|
initHiddenTextarea() {
|
|
24705
24810
|
const doc = this.canvas && getDocumentFromElement(this.canvas.getElement()) || getFabricDocument();
|
|
@@ -24742,17 +24847,17 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
24742
24847
|
this.hiddenTextarea = textarea;
|
|
24743
24848
|
}
|
|
24744
24849
|
|
|
24745
|
-
/**
|
|
24746
|
-
* Override this method to customize cursor behavior on textbox blur
|
|
24850
|
+
/**
|
|
24851
|
+
* Override this method to customize cursor behavior on textbox blur
|
|
24747
24852
|
*/
|
|
24748
24853
|
blur() {
|
|
24749
24854
|
this.abortCursorAnimation();
|
|
24750
24855
|
}
|
|
24751
24856
|
|
|
24752
|
-
/**
|
|
24753
|
-
* Handles keydown event
|
|
24754
|
-
* only used for arrows and combination of modifier keys.
|
|
24755
|
-
* @param {KeyboardEvent} e Event object
|
|
24857
|
+
/**
|
|
24858
|
+
* Handles keydown event
|
|
24859
|
+
* only used for arrows and combination of modifier keys.
|
|
24860
|
+
* @param {KeyboardEvent} e Event object
|
|
24756
24861
|
*/
|
|
24757
24862
|
onKeyDown(e) {
|
|
24758
24863
|
if (!this.isEditing) {
|
|
@@ -24778,11 +24883,11 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
24778
24883
|
}
|
|
24779
24884
|
}
|
|
24780
24885
|
|
|
24781
|
-
/**
|
|
24782
|
-
* Handles keyup event
|
|
24783
|
-
* We handle KeyUp because ie11 and edge have difficulties copy/pasting
|
|
24784
|
-
* if a copy/cut event fired, keyup is dismissed
|
|
24785
|
-
* @param {KeyboardEvent} e Event object
|
|
24886
|
+
/**
|
|
24887
|
+
* Handles keyup event
|
|
24888
|
+
* We handle KeyUp because ie11 and edge have difficulties copy/pasting
|
|
24889
|
+
* if a copy/cut event fired, keyup is dismissed
|
|
24890
|
+
* @param {KeyboardEvent} e Event object
|
|
24786
24891
|
*/
|
|
24787
24892
|
onKeyUp(e) {
|
|
24788
24893
|
if (!this.isEditing || this._copyDone || this.inCompositionMode) {
|
|
@@ -24799,9 +24904,9 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
24799
24904
|
this.canvas && this.canvas.requestRenderAll();
|
|
24800
24905
|
}
|
|
24801
24906
|
|
|
24802
|
-
/**
|
|
24803
|
-
* Handles onInput event
|
|
24804
|
-
* @param {Event} e Event object
|
|
24907
|
+
/**
|
|
24908
|
+
* Handles onInput event
|
|
24909
|
+
* @param {Event} e Event object
|
|
24805
24910
|
*/
|
|
24806
24911
|
onInput(e) {
|
|
24807
24912
|
const fromPaste = this.fromPaste;
|
|
@@ -24938,15 +25043,15 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
24938
25043
|
updateAndFire();
|
|
24939
25044
|
}
|
|
24940
25045
|
|
|
24941
|
-
/**
|
|
24942
|
-
* Composition start
|
|
25046
|
+
/**
|
|
25047
|
+
* Composition start
|
|
24943
25048
|
*/
|
|
24944
25049
|
onCompositionStart() {
|
|
24945
25050
|
this.inCompositionMode = true;
|
|
24946
25051
|
}
|
|
24947
25052
|
|
|
24948
|
-
/**
|
|
24949
|
-
* Composition end
|
|
25053
|
+
/**
|
|
25054
|
+
* Composition end
|
|
24950
25055
|
*/
|
|
24951
25056
|
onCompositionEnd() {
|
|
24952
25057
|
this.inCompositionMode = false;
|
|
@@ -24964,8 +25069,8 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
24964
25069
|
this.updateTextareaPosition();
|
|
24965
25070
|
}
|
|
24966
25071
|
|
|
24967
|
-
/**
|
|
24968
|
-
* Copies selected text
|
|
25072
|
+
/**
|
|
25073
|
+
* Copies selected text
|
|
24969
25074
|
*/
|
|
24970
25075
|
copy() {
|
|
24971
25076
|
if (this.selectionStart === this.selectionEnd) {
|
|
@@ -24984,19 +25089,19 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
24984
25089
|
this._copyDone = true;
|
|
24985
25090
|
}
|
|
24986
25091
|
|
|
24987
|
-
/**
|
|
24988
|
-
* Pastes text
|
|
25092
|
+
/**
|
|
25093
|
+
* Pastes text
|
|
24989
25094
|
*/
|
|
24990
25095
|
paste() {
|
|
24991
25096
|
this.fromPaste = true;
|
|
24992
25097
|
}
|
|
24993
25098
|
|
|
24994
|
-
/**
|
|
24995
|
-
* Finds the width in pixels before the cursor on the same line
|
|
24996
|
-
* @private
|
|
24997
|
-
* @param {Number} lineIndex
|
|
24998
|
-
* @param {Number} charIndex
|
|
24999
|
-
* @return {Number} widthBeforeCursor width before cursor
|
|
25099
|
+
/**
|
|
25100
|
+
* Finds the width in pixels before the cursor on the same line
|
|
25101
|
+
* @private
|
|
25102
|
+
* @param {Number} lineIndex
|
|
25103
|
+
* @param {Number} charIndex
|
|
25104
|
+
* @return {Number} widthBeforeCursor width before cursor
|
|
25000
25105
|
*/
|
|
25001
25106
|
_getWidthBeforeCursor(lineIndex, charIndex) {
|
|
25002
25107
|
let widthBeforeCursor = this._getLineLeftOffset(lineIndex),
|
|
@@ -25008,11 +25113,11 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
25008
25113
|
return widthBeforeCursor;
|
|
25009
25114
|
}
|
|
25010
25115
|
|
|
25011
|
-
/**
|
|
25012
|
-
* Gets start offset of a selection
|
|
25013
|
-
* @param {KeyboardEvent} e Event object
|
|
25014
|
-
* @param {Boolean} isRight
|
|
25015
|
-
* @return {Number}
|
|
25116
|
+
/**
|
|
25117
|
+
* Gets start offset of a selection
|
|
25118
|
+
* @param {KeyboardEvent} e Event object
|
|
25119
|
+
* @param {Boolean} isRight
|
|
25120
|
+
* @return {Number}
|
|
25016
25121
|
*/
|
|
25017
25122
|
getDownCursorOffset(e, isRight) {
|
|
25018
25123
|
const selectionProp = this._getSelectionForOffset(e, isRight),
|
|
@@ -25030,12 +25135,12 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
25030
25135
|
return textAfterCursor.length + indexOnOtherLine + 1 + this.missingNewlineOffset(lineIndex);
|
|
25031
25136
|
}
|
|
25032
25137
|
|
|
25033
|
-
/**
|
|
25034
|
-
* private
|
|
25035
|
-
* Helps finding if the offset should be counted from Start or End
|
|
25036
|
-
* @param {KeyboardEvent} e Event object
|
|
25037
|
-
* @param {Boolean} isRight
|
|
25038
|
-
* @return {Number}
|
|
25138
|
+
/**
|
|
25139
|
+
* private
|
|
25140
|
+
* Helps finding if the offset should be counted from Start or End
|
|
25141
|
+
* @param {KeyboardEvent} e Event object
|
|
25142
|
+
* @param {Boolean} isRight
|
|
25143
|
+
* @return {Number}
|
|
25039
25144
|
*/
|
|
25040
25145
|
_getSelectionForOffset(e, isRight) {
|
|
25041
25146
|
if (e.shiftKey && this.selectionStart !== this.selectionEnd && isRight) {
|
|
@@ -25045,10 +25150,10 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
25045
25150
|
}
|
|
25046
25151
|
}
|
|
25047
25152
|
|
|
25048
|
-
/**
|
|
25049
|
-
* @param {KeyboardEvent} e Event object
|
|
25050
|
-
* @param {Boolean} isRight
|
|
25051
|
-
* @return {Number}
|
|
25153
|
+
/**
|
|
25154
|
+
* @param {KeyboardEvent} e Event object
|
|
25155
|
+
* @param {Boolean} isRight
|
|
25156
|
+
* @return {Number}
|
|
25052
25157
|
*/
|
|
25053
25158
|
getUpCursorOffset(e, isRight) {
|
|
25054
25159
|
const selectionProp = this._getSelectionForOffset(e, isRight),
|
|
@@ -25067,9 +25172,9 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
25067
25172
|
return -this._textLines[lineIndex - 1].length + indexOnOtherLine - textBeforeCursor.length + (1 - missingNewlineOffset);
|
|
25068
25173
|
}
|
|
25069
25174
|
|
|
25070
|
-
/**
|
|
25071
|
-
* for a given width it founds the matching character.
|
|
25072
|
-
* @private
|
|
25175
|
+
/**
|
|
25176
|
+
* for a given width it founds the matching character.
|
|
25177
|
+
* @private
|
|
25073
25178
|
*/
|
|
25074
25179
|
_getIndexOnLine(lineIndex, width) {
|
|
25075
25180
|
const line = this._textLines[lineIndex],
|
|
@@ -25099,9 +25204,9 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
25099
25204
|
return indexOnLine;
|
|
25100
25205
|
}
|
|
25101
25206
|
|
|
25102
|
-
/**
|
|
25103
|
-
* Moves cursor down
|
|
25104
|
-
* @param {KeyboardEvent} e Event object
|
|
25207
|
+
/**
|
|
25208
|
+
* Moves cursor down
|
|
25209
|
+
* @param {KeyboardEvent} e Event object
|
|
25105
25210
|
*/
|
|
25106
25211
|
moveCursorDown(e) {
|
|
25107
25212
|
if (this.selectionStart >= this._text.length && this.selectionEnd >= this._text.length) {
|
|
@@ -25110,9 +25215,9 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
25110
25215
|
this._moveCursorUpOrDown('Down', e);
|
|
25111
25216
|
}
|
|
25112
25217
|
|
|
25113
|
-
/**
|
|
25114
|
-
* Moves cursor up
|
|
25115
|
-
* @param {KeyboardEvent} e Event object
|
|
25218
|
+
/**
|
|
25219
|
+
* Moves cursor up
|
|
25220
|
+
* @param {KeyboardEvent} e Event object
|
|
25116
25221
|
*/
|
|
25117
25222
|
moveCursorUp(e) {
|
|
25118
25223
|
if (this.selectionStart === 0 && this.selectionEnd === 0) {
|
|
@@ -25121,10 +25226,10 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
25121
25226
|
this._moveCursorUpOrDown('Up', e);
|
|
25122
25227
|
}
|
|
25123
25228
|
|
|
25124
|
-
/**
|
|
25125
|
-
* Moves cursor up or down, fires the events
|
|
25126
|
-
* @param {String} direction 'Up' or 'Down'
|
|
25127
|
-
* @param {KeyboardEvent} e Event object
|
|
25229
|
+
/**
|
|
25230
|
+
* Moves cursor up or down, fires the events
|
|
25231
|
+
* @param {String} direction 'Up' or 'Down'
|
|
25232
|
+
* @param {KeyboardEvent} e Event object
|
|
25128
25233
|
*/
|
|
25129
25234
|
_moveCursorUpOrDown(direction, e) {
|
|
25130
25235
|
const offset = this[`get${direction}CursorOffset`](e, this._selectionDirection === RIGHT);
|
|
@@ -25146,9 +25251,9 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
25146
25251
|
}
|
|
25147
25252
|
}
|
|
25148
25253
|
|
|
25149
|
-
/**
|
|
25150
|
-
* Moves cursor with shift
|
|
25151
|
-
* @param {Number} offset
|
|
25254
|
+
/**
|
|
25255
|
+
* Moves cursor with shift
|
|
25256
|
+
* @param {Number} offset
|
|
25152
25257
|
*/
|
|
25153
25258
|
moveCursorWithShift(offset) {
|
|
25154
25259
|
const newSelection = this._selectionDirection === LEFT ? this.selectionStart + offset : this.selectionEnd + offset;
|
|
@@ -25156,9 +25261,9 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
25156
25261
|
return offset !== 0;
|
|
25157
25262
|
}
|
|
25158
25263
|
|
|
25159
|
-
/**
|
|
25160
|
-
* Moves cursor up without shift
|
|
25161
|
-
* @param {Number} offset
|
|
25264
|
+
/**
|
|
25265
|
+
* Moves cursor up without shift
|
|
25266
|
+
* @param {Number} offset
|
|
25162
25267
|
*/
|
|
25163
25268
|
moveCursorWithoutShift(offset) {
|
|
25164
25269
|
if (offset < 0) {
|
|
@@ -25171,9 +25276,9 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
25171
25276
|
return offset !== 0;
|
|
25172
25277
|
}
|
|
25173
25278
|
|
|
25174
|
-
/**
|
|
25175
|
-
* Moves cursor left
|
|
25176
|
-
* @param {KeyboardEvent} e Event object
|
|
25279
|
+
/**
|
|
25280
|
+
* Moves cursor left
|
|
25281
|
+
* @param {KeyboardEvent} e Event object
|
|
25177
25282
|
*/
|
|
25178
25283
|
moveCursorLeft(e) {
|
|
25179
25284
|
if (this.selectionStart === 0 && this.selectionEnd === 0) {
|
|
@@ -25182,11 +25287,11 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
25182
25287
|
this._moveCursorLeftOrRight('Left', e);
|
|
25183
25288
|
}
|
|
25184
25289
|
|
|
25185
|
-
/**
|
|
25186
|
-
* @private
|
|
25187
|
-
* @return {Boolean} true if a change happened
|
|
25188
|
-
*
|
|
25189
|
-
* @todo refactor not to use method name composition
|
|
25290
|
+
/**
|
|
25291
|
+
* @private
|
|
25292
|
+
* @return {Boolean} true if a change happened
|
|
25293
|
+
*
|
|
25294
|
+
* @todo refactor not to use method name composition
|
|
25190
25295
|
*/
|
|
25191
25296
|
_move(e, prop, direction) {
|
|
25192
25297
|
let newValue;
|
|
@@ -25205,23 +25310,23 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
25205
25310
|
return false;
|
|
25206
25311
|
}
|
|
25207
25312
|
|
|
25208
|
-
/**
|
|
25209
|
-
* @private
|
|
25313
|
+
/**
|
|
25314
|
+
* @private
|
|
25210
25315
|
*/
|
|
25211
25316
|
_moveLeft(e, prop) {
|
|
25212
25317
|
return this._move(e, prop, 'Left');
|
|
25213
25318
|
}
|
|
25214
25319
|
|
|
25215
|
-
/**
|
|
25216
|
-
* @private
|
|
25320
|
+
/**
|
|
25321
|
+
* @private
|
|
25217
25322
|
*/
|
|
25218
25323
|
_moveRight(e, prop) {
|
|
25219
25324
|
return this._move(e, prop, 'Right');
|
|
25220
25325
|
}
|
|
25221
25326
|
|
|
25222
|
-
/**
|
|
25223
|
-
* Moves cursor left without keeping selection
|
|
25224
|
-
* @param {KeyboardEvent} e
|
|
25327
|
+
/**
|
|
25328
|
+
* Moves cursor left without keeping selection
|
|
25329
|
+
* @param {KeyboardEvent} e
|
|
25225
25330
|
*/
|
|
25226
25331
|
moveCursorLeftWithoutShift(e) {
|
|
25227
25332
|
let change = true;
|
|
@@ -25236,9 +25341,9 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
25236
25341
|
return change;
|
|
25237
25342
|
}
|
|
25238
25343
|
|
|
25239
|
-
/**
|
|
25240
|
-
* Moves cursor left while keeping selection
|
|
25241
|
-
* @param {KeyboardEvent} e
|
|
25344
|
+
/**
|
|
25345
|
+
* Moves cursor left while keeping selection
|
|
25346
|
+
* @param {KeyboardEvent} e
|
|
25242
25347
|
*/
|
|
25243
25348
|
moveCursorLeftWithShift(e) {
|
|
25244
25349
|
if (this._selectionDirection === RIGHT && this.selectionStart !== this.selectionEnd) {
|
|
@@ -25249,9 +25354,9 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
25249
25354
|
}
|
|
25250
25355
|
}
|
|
25251
25356
|
|
|
25252
|
-
/**
|
|
25253
|
-
* Moves cursor right
|
|
25254
|
-
* @param {KeyboardEvent} e Event object
|
|
25357
|
+
/**
|
|
25358
|
+
* Moves cursor right
|
|
25359
|
+
* @param {KeyboardEvent} e Event object
|
|
25255
25360
|
*/
|
|
25256
25361
|
moveCursorRight(e) {
|
|
25257
25362
|
if (this.selectionStart >= this._text.length && this.selectionEnd >= this._text.length) {
|
|
@@ -25260,10 +25365,10 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
25260
25365
|
this._moveCursorLeftOrRight('Right', e);
|
|
25261
25366
|
}
|
|
25262
25367
|
|
|
25263
|
-
/**
|
|
25264
|
-
* Moves cursor right or Left, fires event
|
|
25265
|
-
* @param {String} direction 'Left', 'Right'
|
|
25266
|
-
* @param {KeyboardEvent} e Event object
|
|
25368
|
+
/**
|
|
25369
|
+
* Moves cursor right or Left, fires event
|
|
25370
|
+
* @param {String} direction 'Left', 'Right'
|
|
25371
|
+
* @param {KeyboardEvent} e Event object
|
|
25267
25372
|
*/
|
|
25268
25373
|
_moveCursorLeftOrRight(direction, e) {
|
|
25269
25374
|
const actionName = `moveCursor${direction}${e.shiftKey ? 'WithShift' : 'WithoutShift'}`;
|
|
@@ -25278,9 +25383,9 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
25278
25383
|
}
|
|
25279
25384
|
}
|
|
25280
25385
|
|
|
25281
|
-
/**
|
|
25282
|
-
* Moves cursor right while keeping selection
|
|
25283
|
-
* @param {KeyboardEvent} e
|
|
25386
|
+
/**
|
|
25387
|
+
* Moves cursor right while keeping selection
|
|
25388
|
+
* @param {KeyboardEvent} e
|
|
25284
25389
|
*/
|
|
25285
25390
|
moveCursorRightWithShift(e) {
|
|
25286
25391
|
if (this._selectionDirection === LEFT && this.selectionStart !== this.selectionEnd) {
|
|
@@ -25291,9 +25396,9 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
25291
25396
|
}
|
|
25292
25397
|
}
|
|
25293
25398
|
|
|
25294
|
-
/**
|
|
25295
|
-
* Moves cursor right without keeping selection
|
|
25296
|
-
* @param {KeyboardEvent} e Event object
|
|
25399
|
+
/**
|
|
25400
|
+
* Moves cursor right without keeping selection
|
|
25401
|
+
* @param {KeyboardEvent} e Event object
|
|
25297
25402
|
*/
|
|
25298
25403
|
moveCursorRightWithoutShift(e) {
|
|
25299
25404
|
let changed = true;
|
|
@@ -25308,8 +25413,8 @@ class ITextKeyBehavior extends ITextBehavior {
|
|
|
25308
25413
|
}
|
|
25309
25414
|
}
|
|
25310
25415
|
|
|
25311
|
-
/**
|
|
25312
|
-
* `LEFT_CLICK === 0`
|
|
25416
|
+
/**
|
|
25417
|
+
* `LEFT_CLICK === 0`
|
|
25313
25418
|
*/
|
|
25314
25419
|
const notALeftClick = e => !!e.button;
|
|
25315
25420
|
class ITextClickBehavior extends ITextKeyBehavior {
|
|
@@ -25327,36 +25432,36 @@ class ITextClickBehavior extends ITextKeyBehavior {
|
|
|
25327
25432
|
super.initBehavior();
|
|
25328
25433
|
}
|
|
25329
25434
|
|
|
25330
|
-
/**
|
|
25331
|
-
* If this method returns true a mouse move operation over a text selection
|
|
25332
|
-
* will not prevent the native mouse event allowing the browser to start a drag operation.
|
|
25333
|
-
* shouldStartDragging can be read 'do not prevent default for mouse move event'
|
|
25334
|
-
* To prevent drag and drop between objects both shouldStartDragging and onDragStart should return false
|
|
25335
|
-
* @returns
|
|
25435
|
+
/**
|
|
25436
|
+
* If this method returns true a mouse move operation over a text selection
|
|
25437
|
+
* will not prevent the native mouse event allowing the browser to start a drag operation.
|
|
25438
|
+
* shouldStartDragging can be read 'do not prevent default for mouse move event'
|
|
25439
|
+
* To prevent drag and drop between objects both shouldStartDragging and onDragStart should return false
|
|
25440
|
+
* @returns
|
|
25336
25441
|
*/
|
|
25337
25442
|
shouldStartDragging() {
|
|
25338
25443
|
return this.draggableTextDelegate.isActive();
|
|
25339
25444
|
}
|
|
25340
25445
|
|
|
25341
|
-
/**
|
|
25342
|
-
* @public override this method to control whether instance should/shouldn't become a drag source,
|
|
25343
|
-
* @see also {@link DraggableTextDelegate#isActive}
|
|
25344
|
-
* To prevent drag and drop between objects both shouldStartDragging and onDragStart should return false
|
|
25345
|
-
* @returns {boolean} should handle event
|
|
25446
|
+
/**
|
|
25447
|
+
* @public override this method to control whether instance should/shouldn't become a drag source,
|
|
25448
|
+
* @see also {@link DraggableTextDelegate#isActive}
|
|
25449
|
+
* To prevent drag and drop between objects both shouldStartDragging and onDragStart should return false
|
|
25450
|
+
* @returns {boolean} should handle event
|
|
25346
25451
|
*/
|
|
25347
25452
|
onDragStart(e) {
|
|
25348
25453
|
return this.draggableTextDelegate.onDragStart(e);
|
|
25349
25454
|
}
|
|
25350
25455
|
|
|
25351
|
-
/**
|
|
25352
|
-
* @public override this method to control whether instance should/shouldn't become a drop target
|
|
25456
|
+
/**
|
|
25457
|
+
* @public override this method to control whether instance should/shouldn't become a drop target
|
|
25353
25458
|
*/
|
|
25354
25459
|
canDrop(e) {
|
|
25355
25460
|
return this.draggableTextDelegate.canDrop(e);
|
|
25356
25461
|
}
|
|
25357
25462
|
|
|
25358
|
-
/**
|
|
25359
|
-
* Default handler for double click, select a word or enter overlay editing
|
|
25463
|
+
/**
|
|
25464
|
+
* Default handler for double click, select a word or enter overlay editing
|
|
25360
25465
|
*/
|
|
25361
25466
|
doubleClickHandler(options) {
|
|
25362
25467
|
// Check if we should enter overlay editing mode
|
|
@@ -25373,8 +25478,8 @@ class ITextClickBehavior extends ITextKeyBehavior {
|
|
|
25373
25478
|
this.renderCursorOrSelection();
|
|
25374
25479
|
}
|
|
25375
25480
|
|
|
25376
|
-
/**
|
|
25377
|
-
* Default handler for triple click, select a line
|
|
25481
|
+
/**
|
|
25482
|
+
* Default handler for triple click, select a line
|
|
25378
25483
|
*/
|
|
25379
25484
|
tripleClickHandler(options) {
|
|
25380
25485
|
if (!this.isEditing) {
|
|
@@ -25384,13 +25489,13 @@ class ITextClickBehavior extends ITextKeyBehavior {
|
|
|
25384
25489
|
this.renderCursorOrSelection();
|
|
25385
25490
|
}
|
|
25386
25491
|
|
|
25387
|
-
/**
|
|
25388
|
-
* Default event handler for the basic functionalities needed on _mouseDown
|
|
25389
|
-
* can be overridden to do something different.
|
|
25390
|
-
* Scope of this implementation is: find the click position, set selectionStart
|
|
25391
|
-
* find selectionEnd, initialize the drawing of either cursor or selection area
|
|
25392
|
-
* initializing a mousedDown on a text area will cancel fabricjs knowledge of
|
|
25393
|
-
* current compositionMode. It will be set to false.
|
|
25492
|
+
/**
|
|
25493
|
+
* Default event handler for the basic functionalities needed on _mouseDown
|
|
25494
|
+
* can be overridden to do something different.
|
|
25495
|
+
* Scope of this implementation is: find the click position, set selectionStart
|
|
25496
|
+
* find selectionEnd, initialize the drawing of either cursor or selection area
|
|
25497
|
+
* initializing a mousedDown on a text area will cancel fabricjs knowledge of
|
|
25498
|
+
* current compositionMode. It will be set to false.
|
|
25394
25499
|
*/
|
|
25395
25500
|
_mouseDownHandler(_ref) {
|
|
25396
25501
|
let {
|
|
@@ -25418,9 +25523,9 @@ class ITextClickBehavior extends ITextKeyBehavior {
|
|
|
25418
25523
|
this.selected || (this.selected = alreadySelected || this.isEditing);
|
|
25419
25524
|
}
|
|
25420
25525
|
|
|
25421
|
-
/**
|
|
25422
|
-
* standard handler for mouse up, overridable
|
|
25423
|
-
* @private
|
|
25526
|
+
/**
|
|
25527
|
+
* standard handler for mouse up, overridable
|
|
25528
|
+
* @private
|
|
25424
25529
|
*/
|
|
25425
25530
|
mouseUpHandler(_ref2) {
|
|
25426
25531
|
let {
|
|
@@ -25451,9 +25556,9 @@ class ITextClickBehavior extends ITextKeyBehavior {
|
|
|
25451
25556
|
}
|
|
25452
25557
|
}
|
|
25453
25558
|
|
|
25454
|
-
/**
|
|
25455
|
-
* Changes cursor location in a text depending on passed pointer (x/y) object
|
|
25456
|
-
* @param {TPointerEvent} e Event object
|
|
25559
|
+
/**
|
|
25560
|
+
* Changes cursor location in a text depending on passed pointer (x/y) object
|
|
25561
|
+
* @param {TPointerEvent} e Event object
|
|
25457
25562
|
*/
|
|
25458
25563
|
setCursorByClick(e) {
|
|
25459
25564
|
const newSelection = this.getSelectionStartFromPointer(e),
|
|
@@ -25471,10 +25576,10 @@ class ITextClickBehavior extends ITextKeyBehavior {
|
|
|
25471
25576
|
}
|
|
25472
25577
|
}
|
|
25473
25578
|
|
|
25474
|
-
/**
|
|
25475
|
-
* Returns index of a character corresponding to where an object was clicked
|
|
25476
|
-
* @param {TPointerEvent} e Event object
|
|
25477
|
-
* @return {Number} Index of a character
|
|
25579
|
+
/**
|
|
25580
|
+
* Returns index of a character corresponding to where an object was clicked
|
|
25581
|
+
* @param {TPointerEvent} e Event object
|
|
25582
|
+
* @return {Number} Index of a character
|
|
25478
25583
|
*/
|
|
25479
25584
|
getSelectionStartFromPointer(e) {
|
|
25480
25585
|
const mouseOffset = this.canvas.getScenePoint(e).transform(invertTransform(this.calcTransformMatrix())).add(new Point(-this._getLeftOffset(), -this._getTopOffset()));
|
|
@@ -25520,15 +25625,15 @@ class ITextClickBehavior extends ITextKeyBehavior {
|
|
|
25520
25625
|
}
|
|
25521
25626
|
}
|
|
25522
25627
|
|
|
25523
|
-
/**
|
|
25524
|
-
* Hit Testing and Cursor Positioning System
|
|
25525
|
-
*
|
|
25526
|
-
* Maps pointer coordinates to text positions and provides cursor rectangles
|
|
25527
|
-
* for interactive text editing with grapheme-aware boundaries.
|
|
25628
|
+
/**
|
|
25629
|
+
* Hit Testing and Cursor Positioning System
|
|
25630
|
+
*
|
|
25631
|
+
* Maps pointer coordinates to text positions and provides cursor rectangles
|
|
25632
|
+
* for interactive text editing with grapheme-aware boundaries.
|
|
25528
25633
|
*/
|
|
25529
25634
|
|
|
25530
|
-
/**
|
|
25531
|
-
* Hit test a point against laid out text to find insertion position
|
|
25635
|
+
/**
|
|
25636
|
+
* Hit test a point against laid out text to find insertion position
|
|
25532
25637
|
*/
|
|
25533
25638
|
function hitTest(x, y, layout, options) {
|
|
25534
25639
|
if (layout.lines.length === 0) {
|
|
@@ -25572,8 +25677,8 @@ function hitTest(x, y, layout, options) {
|
|
|
25572
25677
|
};
|
|
25573
25678
|
}
|
|
25574
25679
|
|
|
25575
|
-
/**
|
|
25576
|
-
* Get cursor rectangle for a given insertion index
|
|
25680
|
+
/**
|
|
25681
|
+
* Get cursor rectangle for a given insertion index
|
|
25577
25682
|
*/
|
|
25578
25683
|
function getCursorRect(insertionIndex, layout, options) {
|
|
25579
25684
|
if (layout.lines.length === 0) {
|
|
@@ -25620,8 +25725,8 @@ function getCursorRect(insertionIndex, layout, options) {
|
|
|
25620
25725
|
|
|
25621
25726
|
// Private helper functions
|
|
25622
25727
|
|
|
25623
|
-
/**
|
|
25624
|
-
* Find which line contains the given Y coordinate
|
|
25728
|
+
/**
|
|
25729
|
+
* Find which line contains the given Y coordinate
|
|
25625
25730
|
*/
|
|
25626
25731
|
function findLineAtY(y, lines) {
|
|
25627
25732
|
var _lines;
|
|
@@ -25644,8 +25749,8 @@ function findLineAtY(y, lines) {
|
|
|
25644
25749
|
};
|
|
25645
25750
|
}
|
|
25646
25751
|
|
|
25647
|
-
/**
|
|
25648
|
-
* Find character position within a line at given X coordinate
|
|
25752
|
+
/**
|
|
25753
|
+
* Find character position within a line at given X coordinate
|
|
25649
25754
|
*/
|
|
25650
25755
|
function findCharAtX(x, line, options) {
|
|
25651
25756
|
if (line.bounds.length === 0) {
|
|
@@ -25751,8 +25856,8 @@ function findCharAtX(x, line, options) {
|
|
|
25751
25856
|
};
|
|
25752
25857
|
}
|
|
25753
25858
|
|
|
25754
|
-
/**
|
|
25755
|
-
* Calculate total insertion index from line and character indices
|
|
25859
|
+
/**
|
|
25860
|
+
* Calculate total insertion index from line and character indices
|
|
25756
25861
|
*/
|
|
25757
25862
|
function calculateInsertionIndex(lineIndex, graphemeIndex, layout) {
|
|
25758
25863
|
let insertionIndex = 0;
|
|
@@ -25771,8 +25876,8 @@ function calculateInsertionIndex(lineIndex, graphemeIndex, layout) {
|
|
|
25771
25876
|
return insertionIndex;
|
|
25772
25877
|
}
|
|
25773
25878
|
|
|
25774
|
-
/**
|
|
25775
|
-
* Find line and grapheme position from insertion index
|
|
25879
|
+
/**
|
|
25880
|
+
* Find line and grapheme position from insertion index
|
|
25776
25881
|
*/
|
|
25777
25882
|
function findPositionFromIndex(insertionIndex, layout) {
|
|
25778
25883
|
let currentIndex = 0;
|
|
@@ -25814,8 +25919,8 @@ function findPositionFromIndex(insertionIndex, layout) {
|
|
|
25814
25919
|
};
|
|
25815
25920
|
}
|
|
25816
25921
|
|
|
25817
|
-
/**
|
|
25818
|
-
* Calculate Y position of a line
|
|
25922
|
+
/**
|
|
25923
|
+
* Calculate Y position of a line
|
|
25819
25924
|
*/
|
|
25820
25925
|
function calculateLineY(lineIndex, layout, options) {
|
|
25821
25926
|
let y = 0;
|
|
@@ -25918,48 +26023,48 @@ const iTextDefaultValues = {
|
|
|
25918
26023
|
|
|
25919
26024
|
// @TODO this is not complete
|
|
25920
26025
|
|
|
25921
|
-
/**
|
|
25922
|
-
* @fires changed
|
|
25923
|
-
* @fires selection:changed
|
|
25924
|
-
* @fires editing:entered
|
|
25925
|
-
* @fires editing:exited
|
|
25926
|
-
* @fires dragstart
|
|
25927
|
-
* @fires drag drag event firing on the drag source
|
|
25928
|
-
* @fires dragend
|
|
25929
|
-
* @fires copy
|
|
25930
|
-
* @fires cut
|
|
25931
|
-
* @fires paste
|
|
25932
|
-
*
|
|
25933
|
-
* #### Supported key combinations
|
|
25934
|
-
* ```
|
|
25935
|
-
* Move cursor: left, right, up, down
|
|
25936
|
-
* Select character: shift + left, shift + right
|
|
25937
|
-
* Select text vertically: shift + up, shift + down
|
|
25938
|
-
* Move cursor by word: alt + left, alt + right
|
|
25939
|
-
* Select words: shift + alt + left, shift + alt + right
|
|
25940
|
-
* Move cursor to line start/end: cmd + left, cmd + right or home, end
|
|
25941
|
-
* Select till start/end of line: cmd + shift + left, cmd + shift + right or shift + home, shift + end
|
|
25942
|
-
* Jump to start/end of text: cmd + up, cmd + down
|
|
25943
|
-
* Select till start/end of text: cmd + shift + up, cmd + shift + down or shift + pgUp, shift + pgDown
|
|
25944
|
-
* Delete character: backspace
|
|
25945
|
-
* Delete word: alt + backspace
|
|
25946
|
-
* Delete line: cmd + backspace
|
|
25947
|
-
* Forward delete: delete
|
|
25948
|
-
* Copy text: ctrl/cmd + c
|
|
25949
|
-
* Paste text: ctrl/cmd + v
|
|
25950
|
-
* Cut text: ctrl/cmd + x
|
|
25951
|
-
* Select entire text: ctrl/cmd + a
|
|
25952
|
-
* Quit editing tab or esc
|
|
25953
|
-
* ```
|
|
25954
|
-
*
|
|
25955
|
-
* #### Supported mouse/touch combination
|
|
25956
|
-
* ```
|
|
25957
|
-
* Position cursor: click/touch
|
|
25958
|
-
* Create selection: click/touch & drag
|
|
25959
|
-
* Create selection: click & shift + click
|
|
25960
|
-
* Select word: double click
|
|
25961
|
-
* Select line: triple click
|
|
25962
|
-
* ```
|
|
26026
|
+
/**
|
|
26027
|
+
* @fires changed
|
|
26028
|
+
* @fires selection:changed
|
|
26029
|
+
* @fires editing:entered
|
|
26030
|
+
* @fires editing:exited
|
|
26031
|
+
* @fires dragstart
|
|
26032
|
+
* @fires drag drag event firing on the drag source
|
|
26033
|
+
* @fires dragend
|
|
26034
|
+
* @fires copy
|
|
26035
|
+
* @fires cut
|
|
26036
|
+
* @fires paste
|
|
26037
|
+
*
|
|
26038
|
+
* #### Supported key combinations
|
|
26039
|
+
* ```
|
|
26040
|
+
* Move cursor: left, right, up, down
|
|
26041
|
+
* Select character: shift + left, shift + right
|
|
26042
|
+
* Select text vertically: shift + up, shift + down
|
|
26043
|
+
* Move cursor by word: alt + left, alt + right
|
|
26044
|
+
* Select words: shift + alt + left, shift + alt + right
|
|
26045
|
+
* Move cursor to line start/end: cmd + left, cmd + right or home, end
|
|
26046
|
+
* Select till start/end of line: cmd + shift + left, cmd + shift + right or shift + home, shift + end
|
|
26047
|
+
* Jump to start/end of text: cmd + up, cmd + down
|
|
26048
|
+
* Select till start/end of text: cmd + shift + up, cmd + shift + down or shift + pgUp, shift + pgDown
|
|
26049
|
+
* Delete character: backspace
|
|
26050
|
+
* Delete word: alt + backspace
|
|
26051
|
+
* Delete line: cmd + backspace
|
|
26052
|
+
* Forward delete: delete
|
|
26053
|
+
* Copy text: ctrl/cmd + c
|
|
26054
|
+
* Paste text: ctrl/cmd + v
|
|
26055
|
+
* Cut text: ctrl/cmd + x
|
|
26056
|
+
* Select entire text: ctrl/cmd + a
|
|
26057
|
+
* Quit editing tab or esc
|
|
26058
|
+
* ```
|
|
26059
|
+
*
|
|
26060
|
+
* #### Supported mouse/touch combination
|
|
26061
|
+
* ```
|
|
26062
|
+
* Position cursor: click/touch
|
|
26063
|
+
* Create selection: click/touch & drag
|
|
26064
|
+
* Create selection: click & shift + click
|
|
26065
|
+
* Select word: double click
|
|
26066
|
+
* Select line: triple click
|
|
26067
|
+
* ```
|
|
25963
26068
|
*/
|
|
25964
26069
|
class IText extends ITextClickBehavior {
|
|
25965
26070
|
static getDefaults() {
|
|
@@ -25974,10 +26079,10 @@ class IText extends ITextClickBehavior {
|
|
|
25974
26079
|
return type === 'itext' ? 'i-text' : type;
|
|
25975
26080
|
}
|
|
25976
26081
|
|
|
25977
|
-
/**
|
|
25978
|
-
* Constructor
|
|
25979
|
-
* @param {String} text Text string
|
|
25980
|
-
* @param {Object} [options] Options object
|
|
26082
|
+
/**
|
|
26083
|
+
* Constructor
|
|
26084
|
+
* @param {String} text Text string
|
|
26085
|
+
* @param {Object} [options] Options object
|
|
25981
26086
|
*/
|
|
25982
26087
|
constructor(text, options) {
|
|
25983
26088
|
super(text, {
|
|
@@ -25987,11 +26092,11 @@ class IText extends ITextClickBehavior {
|
|
|
25987
26092
|
this.initBehavior();
|
|
25988
26093
|
}
|
|
25989
26094
|
|
|
25990
|
-
/**
|
|
25991
|
-
* While editing handle differently
|
|
25992
|
-
* @private
|
|
25993
|
-
* @param {string} key
|
|
25994
|
-
* @param {*} value
|
|
26095
|
+
/**
|
|
26096
|
+
* While editing handle differently
|
|
26097
|
+
* @private
|
|
26098
|
+
* @param {string} key
|
|
26099
|
+
* @param {*} value
|
|
25995
26100
|
*/
|
|
25996
26101
|
_set(key, value) {
|
|
25997
26102
|
if (this.isEditing && this._savedProps && key in this._savedProps) {
|
|
@@ -26006,28 +26111,28 @@ class IText extends ITextClickBehavior {
|
|
|
26006
26111
|
return super._set(key, value);
|
|
26007
26112
|
}
|
|
26008
26113
|
|
|
26009
|
-
/**
|
|
26010
|
-
* Sets selection start (left boundary of a selection)
|
|
26011
|
-
* @param {Number} index Index to set selection start to
|
|
26114
|
+
/**
|
|
26115
|
+
* Sets selection start (left boundary of a selection)
|
|
26116
|
+
* @param {Number} index Index to set selection start to
|
|
26012
26117
|
*/
|
|
26013
26118
|
setSelectionStart(index) {
|
|
26014
26119
|
index = Math.max(index, 0);
|
|
26015
26120
|
this._updateAndFire('selectionStart', index);
|
|
26016
26121
|
}
|
|
26017
26122
|
|
|
26018
|
-
/**
|
|
26019
|
-
* Sets selection end (right boundary of a selection)
|
|
26020
|
-
* @param {Number} index Index to set selection end to
|
|
26123
|
+
/**
|
|
26124
|
+
* Sets selection end (right boundary of a selection)
|
|
26125
|
+
* @param {Number} index Index to set selection end to
|
|
26021
26126
|
*/
|
|
26022
26127
|
setSelectionEnd(index) {
|
|
26023
26128
|
index = Math.min(index, this.text.length);
|
|
26024
26129
|
this._updateAndFire('selectionEnd', index);
|
|
26025
26130
|
}
|
|
26026
26131
|
|
|
26027
|
-
/**
|
|
26028
|
-
* @private
|
|
26029
|
-
* @param {String} property 'selectionStart' or 'selectionEnd'
|
|
26030
|
-
* @param {Number} index new position of property
|
|
26132
|
+
/**
|
|
26133
|
+
* @private
|
|
26134
|
+
* @param {String} property 'selectionStart' or 'selectionEnd'
|
|
26135
|
+
* @param {Number} index new position of property
|
|
26031
26136
|
*/
|
|
26032
26137
|
_updateAndFire(property, index) {
|
|
26033
26138
|
if (this[property] !== index) {
|
|
@@ -26037,9 +26142,9 @@ class IText extends ITextClickBehavior {
|
|
|
26037
26142
|
this._updateTextarea();
|
|
26038
26143
|
}
|
|
26039
26144
|
|
|
26040
|
-
/**
|
|
26041
|
-
* Fires the even of selection changed
|
|
26042
|
-
* @private
|
|
26145
|
+
/**
|
|
26146
|
+
* Fires the even of selection changed
|
|
26147
|
+
* @private
|
|
26043
26148
|
*/
|
|
26044
26149
|
_fireSelectionChanged() {
|
|
26045
26150
|
this.fire('selection:changed');
|
|
@@ -26048,25 +26153,25 @@ class IText extends ITextClickBehavior {
|
|
|
26048
26153
|
});
|
|
26049
26154
|
}
|
|
26050
26155
|
|
|
26051
|
-
/**
|
|
26052
|
-
* Initialize text dimensions. Render all text on given context
|
|
26053
|
-
* or on a offscreen canvas to get the text width with measureText.
|
|
26054
|
-
* Updates this.width and this.height with the proper values.
|
|
26055
|
-
* Does not return dimensions.
|
|
26056
|
-
* @private
|
|
26156
|
+
/**
|
|
26157
|
+
* Initialize text dimensions. Render all text on given context
|
|
26158
|
+
* or on a offscreen canvas to get the text width with measureText.
|
|
26159
|
+
* Updates this.width and this.height with the proper values.
|
|
26160
|
+
* Does not return dimensions.
|
|
26161
|
+
* @private
|
|
26057
26162
|
*/
|
|
26058
26163
|
initDimensions() {
|
|
26059
26164
|
this.isEditing && this.initDelayedCursor();
|
|
26060
26165
|
super.initDimensions();
|
|
26061
26166
|
}
|
|
26062
26167
|
|
|
26063
|
-
/**
|
|
26064
|
-
* Gets style of a current selection/cursor (at the start position)
|
|
26065
|
-
* if startIndex or endIndex are not provided, selectionStart or selectionEnd will be used.
|
|
26066
|
-
* @param {Number} startIndex Start index to get styles at
|
|
26067
|
-
* @param {Number} endIndex End index to get styles at, if not specified selectionEnd or startIndex + 1
|
|
26068
|
-
* @param {Boolean} [complete] get full style or not
|
|
26069
|
-
* @return {Array} styles an array with one, zero or more Style objects
|
|
26168
|
+
/**
|
|
26169
|
+
* Gets style of a current selection/cursor (at the start position)
|
|
26170
|
+
* if startIndex or endIndex are not provided, selectionStart or selectionEnd will be used.
|
|
26171
|
+
* @param {Number} startIndex Start index to get styles at
|
|
26172
|
+
* @param {Number} endIndex End index to get styles at, if not specified selectionEnd or startIndex + 1
|
|
26173
|
+
* @param {Boolean} [complete] get full style or not
|
|
26174
|
+
* @return {Array} styles an array with one, zero or more Style objects
|
|
26070
26175
|
*/
|
|
26071
26176
|
getSelectionStyles() {
|
|
26072
26177
|
let startIndex = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.selectionStart || 0;
|
|
@@ -26075,11 +26180,11 @@ class IText extends ITextClickBehavior {
|
|
|
26075
26180
|
return super.getSelectionStyles(startIndex, endIndex, complete);
|
|
26076
26181
|
}
|
|
26077
26182
|
|
|
26078
|
-
/**
|
|
26079
|
-
* Sets style of a current selection, if no selection exist, do not set anything.
|
|
26080
|
-
* @param {Object} [styles] Styles object
|
|
26081
|
-
* @param {Number} [startIndex] Start index to get styles at
|
|
26082
|
-
* @param {Number} [endIndex] End index to get styles at, if not specified selectionEnd or startIndex + 1
|
|
26183
|
+
/**
|
|
26184
|
+
* Sets style of a current selection, if no selection exist, do not set anything.
|
|
26185
|
+
* @param {Object} [styles] Styles object
|
|
26186
|
+
* @param {Number} [startIndex] Start index to get styles at
|
|
26187
|
+
* @param {Number} [endIndex] End index to get styles at, if not specified selectionEnd or startIndex + 1
|
|
26083
26188
|
*/
|
|
26084
26189
|
setSelectionStyles(styles) {
|
|
26085
26190
|
let startIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.selectionStart || 0;
|
|
@@ -26087,10 +26192,10 @@ class IText extends ITextClickBehavior {
|
|
|
26087
26192
|
return super.setSelectionStyles(styles, startIndex, endIndex);
|
|
26088
26193
|
}
|
|
26089
26194
|
|
|
26090
|
-
/**
|
|
26091
|
-
* Returns 2d representation (lineIndex and charIndex) of cursor (or selection start)
|
|
26092
|
-
* @param {Number} [selectionStart] Optional index. When not given, current selectionStart is used.
|
|
26093
|
-
* @param {Boolean} [skipWrapping] consider the location for unwrapped lines. useful to manage styles.
|
|
26195
|
+
/**
|
|
26196
|
+
* Returns 2d representation (lineIndex and charIndex) of cursor (or selection start)
|
|
26197
|
+
* @param {Number} [selectionStart] Optional index. When not given, current selectionStart is used.
|
|
26198
|
+
* @param {Boolean} [skipWrapping] consider the location for unwrapped lines. useful to manage styles.
|
|
26094
26199
|
*/
|
|
26095
26200
|
get2DCursorLocation() {
|
|
26096
26201
|
let selectionStart = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.selectionStart;
|
|
@@ -26098,9 +26203,9 @@ class IText extends ITextClickBehavior {
|
|
|
26098
26203
|
return super.get2DCursorLocation(selectionStart, skipWrapping);
|
|
26099
26204
|
}
|
|
26100
26205
|
|
|
26101
|
-
/**
|
|
26102
|
-
* @private
|
|
26103
|
-
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
26206
|
+
/**
|
|
26207
|
+
* @private
|
|
26208
|
+
* @param {CanvasRenderingContext2D} ctx Context to render on
|
|
26104
26209
|
*/
|
|
26105
26210
|
render(ctx) {
|
|
26106
26211
|
super.render(ctx);
|
|
@@ -26110,9 +26215,9 @@ class IText extends ITextClickBehavior {
|
|
|
26110
26215
|
this.renderCursorOrSelection();
|
|
26111
26216
|
}
|
|
26112
26217
|
|
|
26113
|
-
/**
|
|
26114
|
-
* @override block cursor/selection logic while rendering the exported canvas
|
|
26115
|
-
* @todo this workaround should be replaced with a more robust solution
|
|
26218
|
+
/**
|
|
26219
|
+
* @override block cursor/selection logic while rendering the exported canvas
|
|
26220
|
+
* @todo this workaround should be replaced with a more robust solution
|
|
26116
26221
|
*/
|
|
26117
26222
|
toCanvasElement(options) {
|
|
26118
26223
|
const isEditing = this.isEditing;
|
|
@@ -26122,9 +26227,9 @@ class IText extends ITextClickBehavior {
|
|
|
26122
26227
|
return canvas;
|
|
26123
26228
|
}
|
|
26124
26229
|
|
|
26125
|
-
/**
|
|
26126
|
-
* Renders cursor or selection (depending on what exists)
|
|
26127
|
-
* it does on the contextTop. If contextTop is not available, do nothing.
|
|
26230
|
+
/**
|
|
26231
|
+
* Renders cursor or selection (depending on what exists)
|
|
26232
|
+
* it does on the contextTop. If contextTop is not available, do nothing.
|
|
26128
26233
|
*/
|
|
26129
26234
|
renderCursorOrSelection() {
|
|
26130
26235
|
if (!this.isEditing || !this.canvas) {
|
|
@@ -26180,12 +26285,12 @@ class IText extends ITextClickBehavior {
|
|
|
26180
26285
|
ctx.restore();
|
|
26181
26286
|
}
|
|
26182
26287
|
|
|
26183
|
-
/**
|
|
26184
|
-
* Finds and returns an array of clip paths that are applied to the parent
|
|
26185
|
-
* group(s) of the current FabricObject instance. The object's hierarchy is
|
|
26186
|
-
* traversed upwards (from the current object towards the root of the canvas),
|
|
26187
|
-
* checking each parent object for the presence of a `clipPath` that is not
|
|
26188
|
-
* absolutely positioned.
|
|
26288
|
+
/**
|
|
26289
|
+
* Finds and returns an array of clip paths that are applied to the parent
|
|
26290
|
+
* group(s) of the current FabricObject instance. The object's hierarchy is
|
|
26291
|
+
* traversed upwards (from the current object towards the root of the canvas),
|
|
26292
|
+
* checking each parent object for the presence of a `clipPath` that is not
|
|
26293
|
+
* absolutely positioned.
|
|
26189
26294
|
*/
|
|
26190
26295
|
findAncestorsWithClipPath() {
|
|
26191
26296
|
const clipPathAncestors = [];
|
|
@@ -26200,13 +26305,13 @@ class IText extends ITextClickBehavior {
|
|
|
26200
26305
|
return clipPathAncestors;
|
|
26201
26306
|
}
|
|
26202
26307
|
|
|
26203
|
-
/**
|
|
26204
|
-
* Returns cursor boundaries (left, top, leftOffset, topOffset)
|
|
26205
|
-
* left/top are left/top of entire text box
|
|
26206
|
-
* leftOffset/topOffset are offset from that left/top point of a text box
|
|
26207
|
-
* @private
|
|
26208
|
-
* @param {number} [index] index from start
|
|
26209
|
-
* @param {boolean} [skipCaching]
|
|
26308
|
+
/**
|
|
26309
|
+
* Returns cursor boundaries (left, top, leftOffset, topOffset)
|
|
26310
|
+
* left/top are left/top of entire text box
|
|
26311
|
+
* leftOffset/topOffset are offset from that left/top point of a text box
|
|
26312
|
+
* @private
|
|
26313
|
+
* @param {number} [index] index from start
|
|
26314
|
+
* @param {boolean} [skipCaching]
|
|
26210
26315
|
*/
|
|
26211
26316
|
_getCursorBoundaries() {
|
|
26212
26317
|
let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.selectionStart;
|
|
@@ -26220,11 +26325,11 @@ class IText extends ITextClickBehavior {
|
|
|
26220
26325
|
return this._getCursorBoundariesOriginal(index, skipCaching);
|
|
26221
26326
|
}
|
|
26222
26327
|
|
|
26223
|
-
/**
|
|
26224
|
-
* Caches and returns cursor left/top offset relative to instance's center point
|
|
26225
|
-
* @private
|
|
26226
|
-
* @param {number} index index from start
|
|
26227
|
-
* @param {boolean} [skipCaching]
|
|
26328
|
+
/**
|
|
26329
|
+
* Caches and returns cursor left/top offset relative to instance's center point
|
|
26330
|
+
* @private
|
|
26331
|
+
* @param {number} index index from start
|
|
26332
|
+
* @param {boolean} [skipCaching]
|
|
26228
26333
|
*/
|
|
26229
26334
|
_getCursorBoundariesOffsets(index, skipCaching) {
|
|
26230
26335
|
if (skipCaching) {
|
|
@@ -26236,9 +26341,9 @@ class IText extends ITextClickBehavior {
|
|
|
26236
26341
|
return this.cursorOffsetCache = this.__getCursorBoundariesOffsets(index);
|
|
26237
26342
|
}
|
|
26238
26343
|
|
|
26239
|
-
/**
|
|
26240
|
-
* Enhanced cursor boundaries using advanced hit testing when available
|
|
26241
|
-
* @private
|
|
26344
|
+
/**
|
|
26345
|
+
* Enhanced cursor boundaries using advanced hit testing when available
|
|
26346
|
+
* @private
|
|
26242
26347
|
*/
|
|
26243
26348
|
_getCursorBoundariesAdvanced(index) {
|
|
26244
26349
|
if (!this.enableAdvancedLayout || !this._layoutTextAdvanced) {
|
|
@@ -26254,9 +26359,9 @@ class IText extends ITextClickBehavior {
|
|
|
26254
26359
|
};
|
|
26255
26360
|
}
|
|
26256
26361
|
|
|
26257
|
-
/**
|
|
26258
|
-
* Enhanced selection start from pointer using BiDi-aware hit testing
|
|
26259
|
-
* @override
|
|
26362
|
+
/**
|
|
26363
|
+
* Enhanced selection start from pointer using BiDi-aware hit testing
|
|
26364
|
+
* @override
|
|
26260
26365
|
*/
|
|
26261
26366
|
getSelectionStartFromPointer(e) {
|
|
26262
26367
|
if (!this.enableAdvancedLayout || !this._layoutTextAdvanced) {
|
|
@@ -26270,9 +26375,9 @@ class IText extends ITextClickBehavior {
|
|
|
26270
26375
|
return Math.min(hitResult.charIndex, this._text.length);
|
|
26271
26376
|
}
|
|
26272
26377
|
|
|
26273
|
-
/**
|
|
26274
|
-
* Original cursor boundaries implementation
|
|
26275
|
-
* @private
|
|
26378
|
+
/**
|
|
26379
|
+
* Original cursor boundaries implementation
|
|
26380
|
+
* @private
|
|
26276
26381
|
*/
|
|
26277
26382
|
_getCursorBoundariesOriginal(index, skipCaching) {
|
|
26278
26383
|
const left = this._getLeftOffset(),
|
|
@@ -26286,10 +26391,10 @@ class IText extends ITextClickBehavior {
|
|
|
26286
26391
|
};
|
|
26287
26392
|
}
|
|
26288
26393
|
|
|
26289
|
-
/**
|
|
26290
|
-
* Calculates cursor left/top offset relative to instance's center point
|
|
26291
|
-
* @private
|
|
26292
|
-
* @param {number} index index from start
|
|
26394
|
+
/**
|
|
26395
|
+
* Calculates cursor left/top offset relative to instance's center point
|
|
26396
|
+
* @private
|
|
26397
|
+
* @param {number} index index from start
|
|
26293
26398
|
*/
|
|
26294
26399
|
__getCursorBoundariesOffsets(index) {
|
|
26295
26400
|
let topOffset = 0,
|
|
@@ -26323,29 +26428,29 @@ class IText extends ITextClickBehavior {
|
|
|
26323
26428
|
return boundaries;
|
|
26324
26429
|
}
|
|
26325
26430
|
|
|
26326
|
-
/**
|
|
26327
|
-
* Renders cursor on context Top, outside the animation cycle, on request
|
|
26328
|
-
* Used for the drag/drop effect.
|
|
26329
|
-
* If contextTop is not available, do nothing.
|
|
26431
|
+
/**
|
|
26432
|
+
* Renders cursor on context Top, outside the animation cycle, on request
|
|
26433
|
+
* Used for the drag/drop effect.
|
|
26434
|
+
* If contextTop is not available, do nothing.
|
|
26330
26435
|
*/
|
|
26331
26436
|
renderCursorAt(selectionStart) {
|
|
26332
26437
|
this._renderCursor(this.canvas.contextTop, this._getCursorBoundaries(selectionStart, true), selectionStart);
|
|
26333
26438
|
}
|
|
26334
26439
|
|
|
26335
|
-
/**
|
|
26336
|
-
* Renders cursor
|
|
26337
|
-
* @param {Object} boundaries
|
|
26338
|
-
* @param {CanvasRenderingContext2D} ctx transformed context to draw on
|
|
26440
|
+
/**
|
|
26441
|
+
* Renders cursor
|
|
26442
|
+
* @param {Object} boundaries
|
|
26443
|
+
* @param {CanvasRenderingContext2D} ctx transformed context to draw on
|
|
26339
26444
|
*/
|
|
26340
26445
|
renderCursor(ctx, boundaries) {
|
|
26341
26446
|
this._renderCursor(ctx, boundaries, this.selectionStart);
|
|
26342
26447
|
}
|
|
26343
26448
|
|
|
26344
|
-
/**
|
|
26345
|
-
* Return the data needed to render the cursor for given selection start
|
|
26346
|
-
* The left,top are relative to the object, while width and height are prescaled
|
|
26347
|
-
* to look think with canvas zoom and object scaling,
|
|
26348
|
-
* so they depend on canvas and object scaling
|
|
26449
|
+
/**
|
|
26450
|
+
* Return the data needed to render the cursor for given selection start
|
|
26451
|
+
* The left,top are relative to the object, while width and height are prescaled
|
|
26452
|
+
* to look think with canvas zoom and object scaling,
|
|
26453
|
+
* so they depend on canvas and object scaling
|
|
26349
26454
|
*/
|
|
26350
26455
|
getCursorRenderingData() {
|
|
26351
26456
|
let selectionStart = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.selectionStart;
|
|
@@ -26368,9 +26473,9 @@ class IText extends ITextClickBehavior {
|
|
|
26368
26473
|
};
|
|
26369
26474
|
}
|
|
26370
26475
|
|
|
26371
|
-
/**
|
|
26372
|
-
* Render the cursor at the given selectionStart.
|
|
26373
|
-
* @param {CanvasRenderingContext2D} ctx transformed context to draw on
|
|
26476
|
+
/**
|
|
26477
|
+
* Render the cursor at the given selectionStart.
|
|
26478
|
+
* @param {CanvasRenderingContext2D} ctx transformed context to draw on
|
|
26374
26479
|
*/
|
|
26375
26480
|
_renderCursor(ctx, boundaries, selectionStart) {
|
|
26376
26481
|
const {
|
|
@@ -26386,10 +26491,10 @@ class IText extends ITextClickBehavior {
|
|
|
26386
26491
|
ctx.fillRect(left, top, width, height);
|
|
26387
26492
|
}
|
|
26388
26493
|
|
|
26389
|
-
/**
|
|
26390
|
-
* Renders text selection
|
|
26391
|
-
* @param {Object} boundaries Object with left/top/leftOffset/topOffset
|
|
26392
|
-
* @param {CanvasRenderingContext2D} ctx transformed context to draw on
|
|
26494
|
+
/**
|
|
26495
|
+
* Renders text selection
|
|
26496
|
+
* @param {Object} boundaries Object with left/top/leftOffset/topOffset
|
|
26497
|
+
* @param {CanvasRenderingContext2D} ctx transformed context to draw on
|
|
26393
26498
|
*/
|
|
26394
26499
|
renderSelection(ctx, boundaries) {
|
|
26395
26500
|
const selection = {
|
|
@@ -26399,8 +26504,8 @@ class IText extends ITextClickBehavior {
|
|
|
26399
26504
|
this._renderSelection(ctx, selection, boundaries);
|
|
26400
26505
|
}
|
|
26401
26506
|
|
|
26402
|
-
/**
|
|
26403
|
-
* Renders drag start text selection
|
|
26507
|
+
/**
|
|
26508
|
+
* Renders drag start text selection
|
|
26404
26509
|
*/
|
|
26405
26510
|
renderDragSourceEffect() {
|
|
26406
26511
|
const dragStartSelection = this.draggableTextDelegate.getDragStartSelection();
|
|
@@ -26411,12 +26516,12 @@ class IText extends ITextClickBehavior {
|
|
|
26411
26516
|
this.renderCursorAt(dragSelection);
|
|
26412
26517
|
}
|
|
26413
26518
|
|
|
26414
|
-
/**
|
|
26415
|
-
* Renders text selection
|
|
26416
|
-
* @private
|
|
26417
|
-
* @param {{ selectionStart: number, selectionEnd: number }} selection
|
|
26418
|
-
* @param {Object} boundaries Object with left/top/leftOffset/topOffset
|
|
26419
|
-
* @param {CanvasRenderingContext2D} ctx transformed context to draw on
|
|
26519
|
+
/**
|
|
26520
|
+
* Renders text selection
|
|
26521
|
+
* @private
|
|
26522
|
+
* @param {{ selectionStart: number, selectionEnd: number }} selection
|
|
26523
|
+
* @param {Object} boundaries Object with left/top/leftOffset/topOffset
|
|
26524
|
+
* @param {CanvasRenderingContext2D} ctx transformed context to draw on
|
|
26420
26525
|
*/
|
|
26421
26526
|
_renderSelection(ctx, selection, boundaries) {
|
|
26422
26527
|
const selectionStart = selection.selectionStart,
|
|
@@ -26478,34 +26583,34 @@ class IText extends ITextClickBehavior {
|
|
|
26478
26583
|
}
|
|
26479
26584
|
}
|
|
26480
26585
|
|
|
26481
|
-
/**
|
|
26482
|
-
* High level function to know the height of the cursor.
|
|
26483
|
-
* the currentChar is the one that precedes the cursor
|
|
26484
|
-
* Returns fontSize of char at the current cursor
|
|
26485
|
-
* Unused from the library, is for the end user
|
|
26486
|
-
* @return {Number} Character font size
|
|
26586
|
+
/**
|
|
26587
|
+
* High level function to know the height of the cursor.
|
|
26588
|
+
* the currentChar is the one that precedes the cursor
|
|
26589
|
+
* Returns fontSize of char at the current cursor
|
|
26590
|
+
* Unused from the library, is for the end user
|
|
26591
|
+
* @return {Number} Character font size
|
|
26487
26592
|
*/
|
|
26488
26593
|
getCurrentCharFontSize() {
|
|
26489
26594
|
const cp = this._getCurrentCharIndex();
|
|
26490
26595
|
return this.getValueOfPropertyAt(cp.l, cp.c, 'fontSize');
|
|
26491
26596
|
}
|
|
26492
26597
|
|
|
26493
|
-
/**
|
|
26494
|
-
* High level function to know the color of the cursor.
|
|
26495
|
-
* the currentChar is the one that precedes the cursor
|
|
26496
|
-
* Returns color (fill) of char at the current cursor
|
|
26497
|
-
* if the text object has a pattern or gradient for filler, it will return that.
|
|
26498
|
-
* Unused by the library, is for the end user
|
|
26499
|
-
* @return {String | TFiller} Character color (fill)
|
|
26598
|
+
/**
|
|
26599
|
+
* High level function to know the color of the cursor.
|
|
26600
|
+
* the currentChar is the one that precedes the cursor
|
|
26601
|
+
* Returns color (fill) of char at the current cursor
|
|
26602
|
+
* if the text object has a pattern or gradient for filler, it will return that.
|
|
26603
|
+
* Unused by the library, is for the end user
|
|
26604
|
+
* @return {String | TFiller} Character color (fill)
|
|
26500
26605
|
*/
|
|
26501
26606
|
getCurrentCharColor() {
|
|
26502
26607
|
const cp = this._getCurrentCharIndex();
|
|
26503
26608
|
return this.getValueOfPropertyAt(cp.l, cp.c, FILL);
|
|
26504
26609
|
}
|
|
26505
26610
|
|
|
26506
|
-
/**
|
|
26507
|
-
* Returns the cursor position for the getCurrent.. functions
|
|
26508
|
-
* @private
|
|
26611
|
+
/**
|
|
26612
|
+
* Returns the cursor position for the getCurrent.. functions
|
|
26613
|
+
* @private
|
|
26509
26614
|
*/
|
|
26510
26615
|
_getCurrentCharIndex() {
|
|
26511
26616
|
const cursorPosition = this.get2DCursorLocation(this.selectionStart, true),
|
|
@@ -26521,52 +26626,52 @@ class IText extends ITextClickBehavior {
|
|
|
26521
26626
|
super.dispose();
|
|
26522
26627
|
}
|
|
26523
26628
|
}
|
|
26524
|
-
/**
|
|
26525
|
-
* Index where text selection starts (or where cursor is when there is no selection)
|
|
26526
|
-
* @type Number
|
|
26629
|
+
/**
|
|
26630
|
+
* Index where text selection starts (or where cursor is when there is no selection)
|
|
26631
|
+
* @type Number
|
|
26527
26632
|
*/
|
|
26528
|
-
/**
|
|
26529
|
-
* Index where text selection ends
|
|
26530
|
-
* @type Number
|
|
26633
|
+
/**
|
|
26634
|
+
* Index where text selection ends
|
|
26635
|
+
* @type Number
|
|
26531
26636
|
*/
|
|
26532
|
-
/**
|
|
26533
|
-
* Color of text selection
|
|
26534
|
-
* @type String
|
|
26637
|
+
/**
|
|
26638
|
+
* Color of text selection
|
|
26639
|
+
* @type String
|
|
26535
26640
|
*/
|
|
26536
|
-
/**
|
|
26537
|
-
* Indicates whether text is in editing mode
|
|
26538
|
-
* @type Boolean
|
|
26641
|
+
/**
|
|
26642
|
+
* Indicates whether text is in editing mode
|
|
26643
|
+
* @type Boolean
|
|
26539
26644
|
*/
|
|
26540
|
-
/**
|
|
26541
|
-
* Indicates whether a text can be edited
|
|
26542
|
-
* @type Boolean
|
|
26645
|
+
/**
|
|
26646
|
+
* Indicates whether a text can be edited
|
|
26647
|
+
* @type Boolean
|
|
26543
26648
|
*/
|
|
26544
|
-
/**
|
|
26545
|
-
* Border color of text object while it's in editing mode
|
|
26546
|
-
* @type String
|
|
26649
|
+
/**
|
|
26650
|
+
* Border color of text object while it's in editing mode
|
|
26651
|
+
* @type String
|
|
26547
26652
|
*/
|
|
26548
|
-
/**
|
|
26549
|
-
* Width of cursor (in px)
|
|
26550
|
-
* @type Number
|
|
26653
|
+
/**
|
|
26654
|
+
* Width of cursor (in px)
|
|
26655
|
+
* @type Number
|
|
26551
26656
|
*/
|
|
26552
|
-
/**
|
|
26553
|
-
* Color of text cursor color in editing mode.
|
|
26554
|
-
* if not set (default) will take color from the text.
|
|
26555
|
-
* if set to a color value that fabric can understand, it will
|
|
26556
|
-
* be used instead of the color of the text at the current position.
|
|
26557
|
-
* @type String
|
|
26657
|
+
/**
|
|
26658
|
+
* Color of text cursor color in editing mode.
|
|
26659
|
+
* if not set (default) will take color from the text.
|
|
26660
|
+
* if set to a color value that fabric can understand, it will
|
|
26661
|
+
* be used instead of the color of the text at the current position.
|
|
26662
|
+
* @type String
|
|
26558
26663
|
*/
|
|
26559
|
-
/**
|
|
26560
|
-
* Delay between cursor blink (in ms)
|
|
26561
|
-
* @type Number
|
|
26664
|
+
/**
|
|
26665
|
+
* Delay between cursor blink (in ms)
|
|
26666
|
+
* @type Number
|
|
26562
26667
|
*/
|
|
26563
|
-
/**
|
|
26564
|
-
* Duration of cursor fade in (in ms)
|
|
26565
|
-
* @type Number
|
|
26668
|
+
/**
|
|
26669
|
+
* Duration of cursor fade in (in ms)
|
|
26670
|
+
* @type Number
|
|
26566
26671
|
*/
|
|
26567
|
-
/**
|
|
26568
|
-
* Indicates whether internal text char widths can be cached
|
|
26569
|
-
* @type Boolean
|
|
26672
|
+
/**
|
|
26673
|
+
* Indicates whether internal text char widths can be cached
|
|
26674
|
+
* @type Boolean
|
|
26570
26675
|
*/
|
|
26571
26676
|
_defineProperty(IText, "ownDefaults", iTextDefaultValues);
|
|
26572
26677
|
_defineProperty(IText, "type", 'IText');
|
|
@@ -26588,11 +26693,11 @@ const textboxDefaultValues = {
|
|
|
26588
26693
|
|
|
26589
26694
|
// @TODO this is not complete
|
|
26590
26695
|
|
|
26591
|
-
/**
|
|
26592
|
-
* Textbox class, based on IText, allows the user to resize the text rectangle
|
|
26593
|
-
* and wraps lines automatically. Textboxes have their Y scaling locked, the
|
|
26594
|
-
* user can only change width. Height is adjusted automatically based on the
|
|
26595
|
-
* wrapping of lines.
|
|
26696
|
+
/**
|
|
26697
|
+
* Textbox class, based on IText, allows the user to resize the text rectangle
|
|
26698
|
+
* and wraps lines automatically. Textboxes have their Y scaling locked, the
|
|
26699
|
+
* user can only change width. Height is adjusted automatically based on the
|
|
26700
|
+
* wrapping of lines.
|
|
26596
26701
|
*/
|
|
26597
26702
|
class Textbox extends IText {
|
|
26598
26703
|
static getDefaults() {
|
|
@@ -26602,10 +26707,10 @@ class Textbox extends IText {
|
|
|
26602
26707
|
};
|
|
26603
26708
|
}
|
|
26604
26709
|
|
|
26605
|
-
/**
|
|
26606
|
-
* Constructor
|
|
26607
|
-
* @param {String} text Text string
|
|
26608
|
-
* @param {Object} [options] Options object
|
|
26710
|
+
/**
|
|
26711
|
+
* Constructor
|
|
26712
|
+
* @param {String} text Text string
|
|
26713
|
+
* @param {Object} [options] Options object
|
|
26609
26714
|
*/
|
|
26610
26715
|
constructor(text, options) {
|
|
26611
26716
|
super(text, {
|
|
@@ -26615,10 +26720,10 @@ class Textbox extends IText {
|
|
|
26615
26720
|
this.initializeEventListeners();
|
|
26616
26721
|
}
|
|
26617
26722
|
|
|
26618
|
-
/**
|
|
26619
|
-
* Creates the default control object.
|
|
26620
|
-
* If you prefer to have on instance of controls shared among all objects
|
|
26621
|
-
* make this function return an empty object and add controls to the ownDefaults object
|
|
26723
|
+
/**
|
|
26724
|
+
* Creates the default control object.
|
|
26725
|
+
* If you prefer to have on instance of controls shared among all objects
|
|
26726
|
+
* make this function return an empty object and add controls to the ownDefaults object
|
|
26622
26727
|
*/
|
|
26623
26728
|
static createControls() {
|
|
26624
26729
|
return {
|
|
@@ -26626,11 +26731,11 @@ class Textbox extends IText {
|
|
|
26626
26731
|
};
|
|
26627
26732
|
}
|
|
26628
26733
|
|
|
26629
|
-
/**
|
|
26630
|
-
* Unlike superclass's version of this function, Textbox does not update
|
|
26631
|
-
* its width.
|
|
26632
|
-
* @private
|
|
26633
|
-
* @override
|
|
26734
|
+
/**
|
|
26735
|
+
* Unlike superclass's version of this function, Textbox does not update
|
|
26736
|
+
* its width.
|
|
26737
|
+
* @private
|
|
26738
|
+
* @override
|
|
26634
26739
|
*/
|
|
26635
26740
|
initDimensions() {
|
|
26636
26741
|
if (!this.initialized) {
|
|
@@ -26698,6 +26803,7 @@ class Textbox extends IText {
|
|
|
26698
26803
|
if (this._usingBrowserWrapping) {
|
|
26699
26804
|
this._browserWrapInitialized = true;
|
|
26700
26805
|
}
|
|
26806
|
+
this.calcTextWidth();
|
|
26701
26807
|
if (this.textAlign.includes(JUSTIFY)) {
|
|
26702
26808
|
// For browser wrapping fonts, apply browser-calculated justify spaces
|
|
26703
26809
|
if (this._usingBrowserWrapping) {
|
|
@@ -26706,15 +26812,8 @@ class Textbox extends IText {
|
|
|
26706
26812
|
return;
|
|
26707
26813
|
}
|
|
26708
26814
|
|
|
26709
|
-
//
|
|
26710
|
-
|
|
26711
|
-
const lastDragTime = this._lastInitDimensionsTime || 0;
|
|
26712
|
-
const isDuringDrag = now - lastDragTime < 200; // 200ms window for drag detection
|
|
26713
|
-
|
|
26714
|
-
if (isDuringDrag) {
|
|
26715
|
-
console.log('🔤 Skipping justify during drag operation to prevent snapping');
|
|
26716
|
-
return;
|
|
26717
|
-
}
|
|
26815
|
+
// Note: Removed drag detection logic that was causing issues
|
|
26816
|
+
// Justify alignment will now apply immediately when needed
|
|
26718
26817
|
|
|
26719
26818
|
// For non-browser-wrapping fonts, use Fabric's justify system
|
|
26720
26819
|
// once text is measured we need to make space fatter to make justified text.
|
|
@@ -26772,11 +26871,40 @@ class Textbox extends IText {
|
|
|
26772
26871
|
} else {
|
|
26773
26872
|
this.height = this.calcTextHeight();
|
|
26774
26873
|
}
|
|
26874
|
+
|
|
26875
|
+
// Double-check that justify was applied by checking space widths
|
|
26876
|
+
// Skip validation during rapid width changes to prevent interference
|
|
26877
|
+
console.log('🔍 JUSTIFY CHECK:', this.textAlign.includes('justify'), !!this.__charBounds, !this._skipJustifyValidation);
|
|
26878
|
+
if (this.textAlign.includes('justify') && this.__charBounds && !this._skipJustifyValidation) {
|
|
26879
|
+
setTimeout(() => {
|
|
26880
|
+
// Verify justify was applied by checking if space widths vary
|
|
26881
|
+
let hasVariableSpaces = false;
|
|
26882
|
+
this.__charBounds.forEach((lineBounds, i) => {
|
|
26883
|
+
if (lineBounds && this._textLines && this._textLines[i]) {
|
|
26884
|
+
const spaces = lineBounds.filter((bound, j) => /\s/.test(this._textLines[i][j]));
|
|
26885
|
+
if (spaces.length > 1) {
|
|
26886
|
+
const firstSpaceWidth = spaces[0].width;
|
|
26887
|
+
hasVariableSpaces = spaces.some(space => Math.abs(space.width - firstSpaceWidth) > 0.1);
|
|
26888
|
+
}
|
|
26889
|
+
}
|
|
26890
|
+
});
|
|
26891
|
+
if (!hasVariableSpaces && this.__charBounds.length > 0) {
|
|
26892
|
+
console.warn(' ⚠️ Justify spaces still uniform - forcing enlargeSpaces again');
|
|
26893
|
+
if (this.enlargeSpaces) {
|
|
26894
|
+
var _this$canvas3;
|
|
26895
|
+
this.enlargeSpaces();
|
|
26896
|
+
(_this$canvas3 = this.canvas) === null || _this$canvas3 === void 0 || _this$canvas3.requestRenderAll();
|
|
26897
|
+
}
|
|
26898
|
+
} else {
|
|
26899
|
+
console.log(' ✅ Justify spaces properly expanded');
|
|
26900
|
+
}
|
|
26901
|
+
}, 10);
|
|
26902
|
+
}
|
|
26775
26903
|
}
|
|
26776
26904
|
|
|
26777
|
-
/**
|
|
26778
|
-
* Schedule justify calculation after font loads (Textbox-specific)
|
|
26779
|
-
* @private
|
|
26905
|
+
/**
|
|
26906
|
+
* Schedule justify calculation after font loads (Textbox-specific)
|
|
26907
|
+
* @private
|
|
26780
26908
|
*/
|
|
26781
26909
|
_scheduleJustifyAfterFontLoad() {
|
|
26782
26910
|
if (typeof document === 'undefined' || !('fonts' in document)) {
|
|
@@ -26790,22 +26918,22 @@ class Textbox extends IText {
|
|
|
26790
26918
|
this._fontJustifyScheduled = true;
|
|
26791
26919
|
const fontSpec = `${this.fontSize}px ${this.fontFamily}`;
|
|
26792
26920
|
document.fonts.load(fontSpec).then(() => {
|
|
26793
|
-
var _this$
|
|
26921
|
+
var _this$canvas4;
|
|
26794
26922
|
this._fontJustifyScheduled = false;
|
|
26795
26923
|
console.log('🔧 Textbox: Font loaded, applying justify alignment');
|
|
26796
26924
|
|
|
26797
26925
|
// Re-run initDimensions to ensure proper justify calculation
|
|
26798
26926
|
this.initDimensions();
|
|
26799
|
-
(_this$
|
|
26927
|
+
(_this$canvas4 = this.canvas) === null || _this$canvas4 === void 0 || _this$canvas4.requestRenderAll();
|
|
26800
26928
|
}).catch(() => {
|
|
26801
26929
|
this._fontJustifyScheduled = false;
|
|
26802
26930
|
console.warn('⚠️ Textbox: Font loading failed, justify may be incorrect');
|
|
26803
26931
|
});
|
|
26804
26932
|
}
|
|
26805
26933
|
|
|
26806
|
-
/**
|
|
26807
|
-
* Advanced dimensions calculation using new layout engine
|
|
26808
|
-
* @private
|
|
26934
|
+
/**
|
|
26935
|
+
* Advanced dimensions calculation using new layout engine
|
|
26936
|
+
* @private
|
|
26809
26937
|
*/
|
|
26810
26938
|
initDimensionsAdvanced() {
|
|
26811
26939
|
if (!this.initialized) {
|
|
@@ -26860,9 +26988,9 @@ class Textbox extends IText {
|
|
|
26860
26988
|
this.dirty = true;
|
|
26861
26989
|
}
|
|
26862
26990
|
|
|
26863
|
-
/**
|
|
26864
|
-
* Generate style map from new layout format
|
|
26865
|
-
* @private
|
|
26991
|
+
/**
|
|
26992
|
+
* Generate style map from new layout format
|
|
26993
|
+
* @private
|
|
26866
26994
|
*/
|
|
26867
26995
|
_generateStyleMapFromLayout(layout) {
|
|
26868
26996
|
const map = {};
|
|
@@ -26884,12 +27012,12 @@ class Textbox extends IText {
|
|
|
26884
27012
|
return map;
|
|
26885
27013
|
}
|
|
26886
27014
|
|
|
26887
|
-
/**
|
|
26888
|
-
* Generate an object that translates the style object so that it is
|
|
26889
|
-
* broken up by visual lines (new lines and automatic wrapping).
|
|
26890
|
-
* The original text styles object is broken up by actual lines (new lines only),
|
|
26891
|
-
* which is only sufficient for Text / IText
|
|
26892
|
-
* @private
|
|
27015
|
+
/**
|
|
27016
|
+
* Generate an object that translates the style object so that it is
|
|
27017
|
+
* broken up by visual lines (new lines and automatic wrapping).
|
|
27018
|
+
* The original text styles object is broken up by actual lines (new lines only),
|
|
27019
|
+
* which is only sufficient for Text / IText
|
|
27020
|
+
* @private
|
|
26893
27021
|
*/
|
|
26894
27022
|
_generateStyleMap(textInfo) {
|
|
26895
27023
|
let realLineCount = 0,
|
|
@@ -26916,10 +27044,10 @@ class Textbox extends IText {
|
|
|
26916
27044
|
return map;
|
|
26917
27045
|
}
|
|
26918
27046
|
|
|
26919
|
-
/**
|
|
26920
|
-
* Returns true if object has a style property or has it on a specified line
|
|
26921
|
-
* @param {Number} lineIndex
|
|
26922
|
-
* @return {Boolean}
|
|
27047
|
+
/**
|
|
27048
|
+
* Returns true if object has a style property or has it on a specified line
|
|
27049
|
+
* @param {Number} lineIndex
|
|
27050
|
+
* @return {Boolean}
|
|
26923
27051
|
*/
|
|
26924
27052
|
styleHas(property, lineIndex) {
|
|
26925
27053
|
if (this._styleMap && !this.isWrapping) {
|
|
@@ -26931,10 +27059,10 @@ class Textbox extends IText {
|
|
|
26931
27059
|
return super.styleHas(property, lineIndex);
|
|
26932
27060
|
}
|
|
26933
27061
|
|
|
26934
|
-
/**
|
|
26935
|
-
* Returns true if object has no styling or no styling in a line
|
|
26936
|
-
* @param {Number} lineIndex , lineIndex is on wrapped lines.
|
|
26937
|
-
* @return {Boolean}
|
|
27062
|
+
/**
|
|
27063
|
+
* Returns true if object has no styling or no styling in a line
|
|
27064
|
+
* @param {Number} lineIndex , lineIndex is on wrapped lines.
|
|
27065
|
+
* @return {Boolean}
|
|
26938
27066
|
*/
|
|
26939
27067
|
isEmptyStyles(lineIndex) {
|
|
26940
27068
|
if (!this.styles) {
|
|
@@ -26971,11 +27099,11 @@ class Textbox extends IText {
|
|
|
26971
27099
|
return true;
|
|
26972
27100
|
}
|
|
26973
27101
|
|
|
26974
|
-
/**
|
|
26975
|
-
* @protected
|
|
26976
|
-
* @param {Number} lineIndex
|
|
26977
|
-
* @param {Number} charIndex
|
|
26978
|
-
* @return {TextStyleDeclaration} a style object reference to the existing one or a new empty object when undefined
|
|
27102
|
+
/**
|
|
27103
|
+
* @protected
|
|
27104
|
+
* @param {Number} lineIndex
|
|
27105
|
+
* @param {Number} charIndex
|
|
27106
|
+
* @return {TextStyleDeclaration} a style object reference to the existing one or a new empty object when undefined
|
|
26979
27107
|
*/
|
|
26980
27108
|
_getStyleDeclaration(lineIndex, charIndex) {
|
|
26981
27109
|
if (this._styleMap && !this.isWrapping) {
|
|
@@ -26989,59 +27117,59 @@ class Textbox extends IText {
|
|
|
26989
27117
|
return super._getStyleDeclaration(lineIndex, charIndex);
|
|
26990
27118
|
}
|
|
26991
27119
|
|
|
26992
|
-
/**
|
|
26993
|
-
* @param {Number} lineIndex
|
|
26994
|
-
* @param {Number} charIndex
|
|
26995
|
-
* @param {Object} style
|
|
26996
|
-
* @private
|
|
27120
|
+
/**
|
|
27121
|
+
* @param {Number} lineIndex
|
|
27122
|
+
* @param {Number} charIndex
|
|
27123
|
+
* @param {Object} style
|
|
27124
|
+
* @private
|
|
26997
27125
|
*/
|
|
26998
27126
|
_setStyleDeclaration(lineIndex, charIndex, style) {
|
|
26999
27127
|
const map = this._styleMap[lineIndex];
|
|
27000
27128
|
super._setStyleDeclaration(map.line, map.offset + charIndex, style);
|
|
27001
27129
|
}
|
|
27002
27130
|
|
|
27003
|
-
/**
|
|
27004
|
-
* @param {Number} lineIndex
|
|
27005
|
-
* @param {Number} charIndex
|
|
27006
|
-
* @private
|
|
27131
|
+
/**
|
|
27132
|
+
* @param {Number} lineIndex
|
|
27133
|
+
* @param {Number} charIndex
|
|
27134
|
+
* @private
|
|
27007
27135
|
*/
|
|
27008
27136
|
_deleteStyleDeclaration(lineIndex, charIndex) {
|
|
27009
27137
|
const map = this._styleMap[lineIndex];
|
|
27010
27138
|
super._deleteStyleDeclaration(map.line, map.offset + charIndex);
|
|
27011
27139
|
}
|
|
27012
27140
|
|
|
27013
|
-
/**
|
|
27014
|
-
* probably broken need a fix
|
|
27015
|
-
* Returns the real style line that correspond to the wrapped lineIndex line
|
|
27016
|
-
* Used just to verify if the line does exist or not.
|
|
27017
|
-
* @param {Number} lineIndex
|
|
27018
|
-
* @returns {Boolean} if the line exists or not
|
|
27019
|
-
* @private
|
|
27141
|
+
/**
|
|
27142
|
+
* probably broken need a fix
|
|
27143
|
+
* Returns the real style line that correspond to the wrapped lineIndex line
|
|
27144
|
+
* Used just to verify if the line does exist or not.
|
|
27145
|
+
* @param {Number} lineIndex
|
|
27146
|
+
* @returns {Boolean} if the line exists or not
|
|
27147
|
+
* @private
|
|
27020
27148
|
*/
|
|
27021
27149
|
_getLineStyle(lineIndex) {
|
|
27022
27150
|
const map = this._styleMap[lineIndex];
|
|
27023
27151
|
return !!this.styles[map.line];
|
|
27024
27152
|
}
|
|
27025
27153
|
|
|
27026
|
-
/**
|
|
27027
|
-
* Set the line style to an empty object so that is initialized
|
|
27028
|
-
* @param {Number} lineIndex
|
|
27029
|
-
* @param {Object} style
|
|
27030
|
-
* @private
|
|
27154
|
+
/**
|
|
27155
|
+
* Set the line style to an empty object so that is initialized
|
|
27156
|
+
* @param {Number} lineIndex
|
|
27157
|
+
* @param {Object} style
|
|
27158
|
+
* @private
|
|
27031
27159
|
*/
|
|
27032
27160
|
_setLineStyle(lineIndex) {
|
|
27033
27161
|
const map = this._styleMap[lineIndex];
|
|
27034
27162
|
super._setLineStyle(map.line);
|
|
27035
27163
|
}
|
|
27036
27164
|
|
|
27037
|
-
/**
|
|
27038
|
-
* Wraps text using the 'width' property of Textbox. First this function
|
|
27039
|
-
* splits text on newlines, so we preserve newlines entered by the user.
|
|
27040
|
-
* Then it wraps each line using the width of the Textbox by calling
|
|
27041
|
-
* _wrapLine().
|
|
27042
|
-
* @param {Array} lines The string array of text that is split into lines
|
|
27043
|
-
* @param {Number} desiredWidth width you want to wrap to
|
|
27044
|
-
* @returns {Array} Array of lines
|
|
27165
|
+
/**
|
|
27166
|
+
* Wraps text using the 'width' property of Textbox. First this function
|
|
27167
|
+
* splits text on newlines, so we preserve newlines entered by the user.
|
|
27168
|
+
* Then it wraps each line using the width of the Textbox by calling
|
|
27169
|
+
* _wrapLine().
|
|
27170
|
+
* @param {Array} lines The string array of text that is split into lines
|
|
27171
|
+
* @param {Number} desiredWidth width you want to wrap to
|
|
27172
|
+
* @returns {Array} Array of lines
|
|
27045
27173
|
*/
|
|
27046
27174
|
_wrapText(lines, desiredWidth) {
|
|
27047
27175
|
this.isWrapping = true;
|
|
@@ -27055,12 +27183,12 @@ class Textbox extends IText {
|
|
|
27055
27183
|
return wrapped;
|
|
27056
27184
|
}
|
|
27057
27185
|
|
|
27058
|
-
/**
|
|
27059
|
-
* For each line of text terminated by an hard line stop,
|
|
27060
|
-
* measure each word width and extract the largest word from all.
|
|
27061
|
-
* The returned words here are the one that at the end will be rendered.
|
|
27062
|
-
* @param {string[]} lines the lines we need to measure
|
|
27063
|
-
*
|
|
27186
|
+
/**
|
|
27187
|
+
* For each line of text terminated by an hard line stop,
|
|
27188
|
+
* measure each word width and extract the largest word from all.
|
|
27189
|
+
* The returned words here are the one that at the end will be rendered.
|
|
27190
|
+
* @param {string[]} lines the lines we need to measure
|
|
27191
|
+
*
|
|
27064
27192
|
*/
|
|
27065
27193
|
getGraphemeDataForRender(lines) {
|
|
27066
27194
|
const splitByGrapheme = this.splitByGrapheme,
|
|
@@ -27093,17 +27221,17 @@ class Textbox extends IText {
|
|
|
27093
27221
|
};
|
|
27094
27222
|
}
|
|
27095
27223
|
|
|
27096
|
-
/**
|
|
27097
|
-
* Helper function to measure a string of text, given its lineIndex and charIndex offset
|
|
27098
|
-
* It gets called when charBounds are not available yet.
|
|
27099
|
-
* Override if necessary
|
|
27100
|
-
* Use with {@link Textbox#wordSplit}
|
|
27101
|
-
*
|
|
27102
|
-
* @param {CanvasRenderingContext2D} ctx
|
|
27103
|
-
* @param {String} text
|
|
27104
|
-
* @param {number} lineIndex
|
|
27105
|
-
* @param {number} charOffset
|
|
27106
|
-
* @returns {number}
|
|
27224
|
+
/**
|
|
27225
|
+
* Helper function to measure a string of text, given its lineIndex and charIndex offset
|
|
27226
|
+
* It gets called when charBounds are not available yet.
|
|
27227
|
+
* Override if necessary
|
|
27228
|
+
* Use with {@link Textbox#wordSplit}
|
|
27229
|
+
*
|
|
27230
|
+
* @param {CanvasRenderingContext2D} ctx
|
|
27231
|
+
* @param {String} text
|
|
27232
|
+
* @param {number} lineIndex
|
|
27233
|
+
* @param {number} charOffset
|
|
27234
|
+
* @returns {number}
|
|
27107
27235
|
*/
|
|
27108
27236
|
_measureWord(word, lineIndex) {
|
|
27109
27237
|
let charOffset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
@@ -27118,26 +27246,26 @@ class Textbox extends IText {
|
|
|
27118
27246
|
return width;
|
|
27119
27247
|
}
|
|
27120
27248
|
|
|
27121
|
-
/**
|
|
27122
|
-
* Override this method to customize word splitting
|
|
27123
|
-
* Use with {@link Textbox#_measureWord}
|
|
27124
|
-
* @param {string} value
|
|
27125
|
-
* @returns {string[]} array of words
|
|
27249
|
+
/**
|
|
27250
|
+
* Override this method to customize word splitting
|
|
27251
|
+
* Use with {@link Textbox#_measureWord}
|
|
27252
|
+
* @param {string} value
|
|
27253
|
+
* @returns {string[]} array of words
|
|
27126
27254
|
*/
|
|
27127
27255
|
wordSplit(value) {
|
|
27128
27256
|
return value.split(this._wordJoiners);
|
|
27129
27257
|
}
|
|
27130
27258
|
|
|
27131
|
-
/**
|
|
27132
|
-
* Wraps a line of text using the width of the Textbox as desiredWidth
|
|
27133
|
-
* and leveraging the known width o words from GraphemeData
|
|
27134
|
-
* @private
|
|
27135
|
-
* @param {Number} lineIndex
|
|
27136
|
-
* @param {Number} desiredWidth width you want to wrap the line to
|
|
27137
|
-
* @param {GraphemeData} graphemeData an object containing all the lines' words width.
|
|
27138
|
-
* @param {Number} reservedSpace space to remove from wrapping for custom functionalities
|
|
27139
|
-
* @returns {Array} Array of line(s) into which the given text is wrapped
|
|
27140
|
-
* to.
|
|
27259
|
+
/**
|
|
27260
|
+
* Wraps a line of text using the width of the Textbox as desiredWidth
|
|
27261
|
+
* and leveraging the known width o words from GraphemeData
|
|
27262
|
+
* @private
|
|
27263
|
+
* @param {Number} lineIndex
|
|
27264
|
+
* @param {Number} desiredWidth width you want to wrap the line to
|
|
27265
|
+
* @param {GraphemeData} graphemeData an object containing all the lines' words width.
|
|
27266
|
+
* @param {Number} reservedSpace space to remove from wrapping for custom functionalities
|
|
27267
|
+
* @returns {Array} Array of line(s) into which the given text is wrapped
|
|
27268
|
+
* to.
|
|
27141
27269
|
*/
|
|
27142
27270
|
_wrapLine(lineIndex, desiredWidth, _ref) {
|
|
27143
27271
|
let {
|
|
@@ -27219,11 +27347,11 @@ class Textbox extends IText {
|
|
|
27219
27347
|
return graphemeLines;
|
|
27220
27348
|
}
|
|
27221
27349
|
|
|
27222
|
-
/**
|
|
27223
|
-
* Detect if the text line is ended with an hard break
|
|
27224
|
-
* text and itext do not have wrapping, return false
|
|
27225
|
-
* @param {Number} lineIndex text to split
|
|
27226
|
-
* @return {Boolean}
|
|
27350
|
+
/**
|
|
27351
|
+
* Detect if the text line is ended with an hard break
|
|
27352
|
+
* text and itext do not have wrapping, return false
|
|
27353
|
+
* @param {Number} lineIndex text to split
|
|
27354
|
+
* @return {Boolean}
|
|
27227
27355
|
*/
|
|
27228
27356
|
isEndOfWrapping(lineIndex) {
|
|
27229
27357
|
if (!this._styleMap[lineIndex + 1]) {
|
|
@@ -27237,12 +27365,12 @@ class Textbox extends IText {
|
|
|
27237
27365
|
return false;
|
|
27238
27366
|
}
|
|
27239
27367
|
|
|
27240
|
-
/**
|
|
27241
|
-
* Detect if a line has a linebreak and so we need to account for it when moving
|
|
27242
|
-
* and counting style.
|
|
27243
|
-
* This is important only for splitByGrapheme at the end of wrapping.
|
|
27244
|
-
* If we are not wrapping the offset is always 1
|
|
27245
|
-
* @return Number
|
|
27368
|
+
/**
|
|
27369
|
+
* Detect if a line has a linebreak and so we need to account for it when moving
|
|
27370
|
+
* and counting style.
|
|
27371
|
+
* This is important only for splitByGrapheme at the end of wrapping.
|
|
27372
|
+
* If we are not wrapping the offset is always 1
|
|
27373
|
+
* @return Number
|
|
27246
27374
|
*/
|
|
27247
27375
|
missingNewlineOffset(lineIndex, skipWrapping) {
|
|
27248
27376
|
if (this.splitByGrapheme && !skipWrapping) {
|
|
@@ -27251,16 +27379,17 @@ class Textbox extends IText {
|
|
|
27251
27379
|
return 1;
|
|
27252
27380
|
}
|
|
27253
27381
|
|
|
27254
|
-
/**
|
|
27255
|
-
* Gets lines of text to render in the Textbox. This function calculates
|
|
27256
|
-
* text wrapping on the fly every time it is called.
|
|
27257
|
-
* @param {String} text text to split
|
|
27258
|
-
* @returns {Array} Array of lines in the Textbox.
|
|
27259
|
-
* @override
|
|
27382
|
+
/**
|
|
27383
|
+
* Gets lines of text to render in the Textbox. This function calculates
|
|
27384
|
+
* text wrapping on the fly every time it is called.
|
|
27385
|
+
* @param {String} text text to split
|
|
27386
|
+
* @returns {Array} Array of lines in the Textbox.
|
|
27387
|
+
* @override
|
|
27260
27388
|
*/
|
|
27261
27389
|
_splitTextIntoLines(text) {
|
|
27262
27390
|
// Check if we need browser wrapping using smart font detection
|
|
27263
|
-
|
|
27391
|
+
// Skip browser wrapping for justify text when using overlay editing to prevent measurement conflicts
|
|
27392
|
+
const needsBrowserWrapping = this.fontFamily && fontLacksEnglishGlyphsCached(this.fontFamily) && !(this.textAlign.includes('justify') && this.useOverlayEditing);
|
|
27264
27393
|
if (needsBrowserWrapping) {
|
|
27265
27394
|
// Cache key based on text content, width, font properties, AND text alignment
|
|
27266
27395
|
const textHash = text.length + text.slice(0, 50); // Include text content in cache key
|
|
@@ -27285,6 +27414,11 @@ class Textbox extends IText {
|
|
|
27285
27414
|
|
|
27286
27415
|
// Mark that we used browser wrapping to prevent dynamicMinWidth modifications
|
|
27287
27416
|
this._usingBrowserWrapping = true;
|
|
27417
|
+
|
|
27418
|
+
// pass the width to enlargeSpaces
|
|
27419
|
+
if (result.width) {
|
|
27420
|
+
this._browserWrappingWidth = result.width;
|
|
27421
|
+
}
|
|
27288
27422
|
return result;
|
|
27289
27423
|
}
|
|
27290
27424
|
|
|
@@ -27303,9 +27437,9 @@ class Textbox extends IText {
|
|
|
27303
27437
|
return newText;
|
|
27304
27438
|
}
|
|
27305
27439
|
|
|
27306
|
-
/**
|
|
27307
|
-
* Use browser's native text wrapping for accurate handling of fonts without English glyphs
|
|
27308
|
-
* @private
|
|
27440
|
+
/**
|
|
27441
|
+
* Use browser's native text wrapping for accurate handling of fonts without English glyphs
|
|
27442
|
+
* @private
|
|
27309
27443
|
*/
|
|
27310
27444
|
_splitTextIntoLinesWithBrowser(text) {
|
|
27311
27445
|
if (typeof document === 'undefined') {
|
|
@@ -27313,26 +27447,47 @@ class Textbox extends IText {
|
|
|
27313
27447
|
return this._splitTextIntoLinesDefault(text);
|
|
27314
27448
|
}
|
|
27315
27449
|
|
|
27450
|
+
// Skip measurement if we just extracted lines from overlay for justify text
|
|
27451
|
+
if (this._skipJustifyMeasurement && this.textAlign.includes('justify')) {
|
|
27452
|
+
console.log('🚫 SKIP: Skipping browser measurement, using stored overlay lines');
|
|
27453
|
+
this._skipJustifyMeasurement = false; // Reset flag
|
|
27454
|
+
return this._splitTextIntoLinesDefault(text);
|
|
27455
|
+
}
|
|
27456
|
+
|
|
27316
27457
|
// Create a hidden element that mimics the overlay editor
|
|
27317
27458
|
const testElement = document.createElement('div');
|
|
27318
27459
|
testElement.style.position = 'absolute';
|
|
27319
27460
|
testElement.style.left = '-9999px';
|
|
27320
27461
|
testElement.style.visibility = 'hidden';
|
|
27321
|
-
|
|
27462
|
+
const scaleX = this.scaleX || 1;
|
|
27463
|
+
const fontSize = this.fontSize * scaleX;
|
|
27464
|
+
const padding = this.padding || 0;
|
|
27465
|
+
testElement.style.fontSize = `${fontSize}px`;
|
|
27322
27466
|
testElement.style.fontFamily = `"${this.fontFamily}"`;
|
|
27323
27467
|
testElement.style.fontWeight = String(this.fontWeight || 'normal');
|
|
27324
27468
|
testElement.style.fontStyle = String(this.fontStyle || 'normal');
|
|
27325
27469
|
testElement.style.lineHeight = String(this.lineHeight || 1.16);
|
|
27326
|
-
testElement.style.
|
|
27470
|
+
testElement.style.letterSpacing = `${(this.charSpacing || 0) / 1000 * fontSize}px`;
|
|
27327
27471
|
testElement.style.direction = this.direction || 'ltr';
|
|
27328
27472
|
testElement.style.whiteSpace = 'pre-wrap';
|
|
27329
27473
|
testElement.style.wordBreak = 'normal';
|
|
27330
27474
|
testElement.style.overflowWrap = 'break-word';
|
|
27331
|
-
|
|
27332
|
-
|
|
27475
|
+
testElement.style.padding = `${padding}px`;
|
|
27476
|
+
testElement.style.boxSizing = 'border-box';
|
|
27477
|
+
testElement.style.width = `${this.width * scaleX + padding * 2}px`;
|
|
27333
27478
|
if (this.textAlign.includes('justify')) {
|
|
27334
27479
|
testElement.style.textAlign = 'justify';
|
|
27335
|
-
|
|
27480
|
+
if (this.direction === 'rtl') {
|
|
27481
|
+
testElement.style.textAlignLast = 'right';
|
|
27482
|
+
} else {
|
|
27483
|
+
testElement.style.textAlignLast = 'left';
|
|
27484
|
+
}
|
|
27485
|
+
testElement.style.textJustify = 'inter-word';
|
|
27486
|
+
testElement.style.unicodeBidi = 'plaintext';
|
|
27487
|
+
testElement.style.wordSpacing = 'normal';
|
|
27488
|
+
// Match font smoothing from overlay editor
|
|
27489
|
+
testElement.style.webkitFontSmoothing = 'auto';
|
|
27490
|
+
testElement.style.mozOsxFontSmoothing = 'auto';
|
|
27336
27491
|
} else {
|
|
27337
27492
|
testElement.style.textAlign = this.textAlign;
|
|
27338
27493
|
}
|
|
@@ -27357,7 +27512,7 @@ class Textbox extends IText {
|
|
|
27357
27512
|
if (i > currentLineStart && (rect.bottom > previousBottom + 5 || i === textLength)) {
|
|
27358
27513
|
// New line detected or end of text
|
|
27359
27514
|
const lineEnd = i === textLength ? i : i - 1;
|
|
27360
|
-
const lineText = text.substring(currentLineStart, lineEnd)
|
|
27515
|
+
const lineText = text.substring(currentLineStart, lineEnd);
|
|
27361
27516
|
if (lineText) {
|
|
27362
27517
|
lines.push(lineText);
|
|
27363
27518
|
// Convert to graphemes for compatibility
|
|
@@ -27380,6 +27535,7 @@ class Textbox extends IText {
|
|
|
27380
27535
|
const offsetHeight = testElement.offsetHeight;
|
|
27381
27536
|
const clientHeight = testElement.clientHeight;
|
|
27382
27537
|
const boundingRect = testElement.getBoundingClientRect();
|
|
27538
|
+
const clientWidth = testElement.clientWidth;
|
|
27383
27539
|
console.log(`🔤 Browser element measurements:`);
|
|
27384
27540
|
console.log(` scrollHeight: ${actualBrowserHeight}px (content + padding + hidden overflow)`);
|
|
27385
27541
|
console.log(` offsetHeight: ${offsetHeight}px (content + padding + border)`);
|
|
@@ -27427,13 +27583,14 @@ class Textbox extends IText {
|
|
|
27427
27583
|
graphemeText: text.split(''),
|
|
27428
27584
|
graphemeLines: graphemeLines,
|
|
27429
27585
|
justifySpaceMeasurements: justifySpaceMeasurements,
|
|
27430
|
-
actualBrowserHeight: adjustedHeight
|
|
27586
|
+
actualBrowserHeight: adjustedHeight,
|
|
27587
|
+
width: clientWidth
|
|
27431
27588
|
};
|
|
27432
27589
|
}
|
|
27433
27590
|
|
|
27434
|
-
/**
|
|
27435
|
-
* Extract justify space measurements from browser
|
|
27436
|
-
* @private
|
|
27591
|
+
/**
|
|
27592
|
+
* Extract justify space measurements from browser
|
|
27593
|
+
* @private
|
|
27437
27594
|
*/
|
|
27438
27595
|
_extractJustifySpaceMeasurements(element, lines) {
|
|
27439
27596
|
console.log(`🔤 Extracting browser justify space measurements for ${lines.length} lines`);
|
|
@@ -27469,9 +27626,9 @@ class Textbox extends IText {
|
|
|
27469
27626
|
return spaceWidths;
|
|
27470
27627
|
}
|
|
27471
27628
|
|
|
27472
|
-
/**
|
|
27473
|
-
* Apply browser-calculated justify space measurements
|
|
27474
|
-
* @private
|
|
27629
|
+
/**
|
|
27630
|
+
* Apply browser-calculated justify space measurements
|
|
27631
|
+
* @private
|
|
27475
27632
|
*/
|
|
27476
27633
|
_applyBrowserJustifySpaces() {
|
|
27477
27634
|
if (!this._textLines || !this.__charBounds) {
|
|
@@ -27479,6 +27636,14 @@ class Textbox extends IText {
|
|
|
27479
27636
|
return;
|
|
27480
27637
|
}
|
|
27481
27638
|
|
|
27639
|
+
// Check for overlay justify measurements first
|
|
27640
|
+
const overlayMeasurements = this._overlayJustifyMeasurements;
|
|
27641
|
+
if (overlayMeasurements) {
|
|
27642
|
+
console.log('🎯 OVERLAY JUSTIFY: Using stored overlay measurements');
|
|
27643
|
+
this._applyOverlayJustifySpaces(overlayMeasurements);
|
|
27644
|
+
return;
|
|
27645
|
+
}
|
|
27646
|
+
|
|
27482
27647
|
// Get space measurements from browser wrapping result
|
|
27483
27648
|
const styleMap = this._styleMap;
|
|
27484
27649
|
if (!styleMap || !styleMap.justifySpaceMeasurements) {
|
|
@@ -27494,23 +27659,164 @@ class Textbox extends IText {
|
|
|
27494
27659
|
const lineBounds = this.__charBounds[lineIndex];
|
|
27495
27660
|
const lineSpaceWidths = spaceWidths[lineIndex];
|
|
27496
27661
|
let spaceIndex = 0;
|
|
27662
|
+
let accumulatedSpace = 0;
|
|
27663
|
+
const isRtl = this.direction === 'rtl';
|
|
27664
|
+
const spaceDiffs = [];
|
|
27665
|
+
|
|
27666
|
+
// First, calculate the difference for each space
|
|
27497
27667
|
for (let charIndex = 0; charIndex < line.length; charIndex++) {
|
|
27498
27668
|
if (/\s/.test(line[charIndex]) && spaceIndex < lineSpaceWidths.length) {
|
|
27499
|
-
const
|
|
27500
|
-
if (
|
|
27501
|
-
|
|
27502
|
-
lineBounds[charIndex].width = expandedWidth;
|
|
27503
|
-
console.log(`🔤 Line ${lineIndex} space ${spaceIndex}: ${oldWidth.toFixed(1)}px -> ${expandedWidth.toFixed(1)}px`);
|
|
27669
|
+
const charBound = lineBounds[charIndex];
|
|
27670
|
+
if (charBound) {
|
|
27671
|
+
spaceDiffs.push(lineSpaceWidths[spaceIndex] - charBound.width);
|
|
27504
27672
|
}
|
|
27505
27673
|
spaceIndex++;
|
|
27506
27674
|
}
|
|
27507
27675
|
}
|
|
27676
|
+
spaceIndex = 0;
|
|
27677
|
+
let remainingDiff = spaceDiffs.reduce((a, b) => a + b, 0);
|
|
27678
|
+
for (let charIndex = 0; charIndex < line.length; charIndex++) {
|
|
27679
|
+
const charBound = lineBounds[charIndex];
|
|
27680
|
+
if (!charBound) continue;
|
|
27681
|
+
if (isRtl) {
|
|
27682
|
+
charBound.left += remainingDiff;
|
|
27683
|
+
} else {
|
|
27684
|
+
charBound.left += accumulatedSpace;
|
|
27685
|
+
}
|
|
27686
|
+
if (/\s/.test(line[charIndex]) && spaceIndex < spaceDiffs.length) {
|
|
27687
|
+
const diff = spaceDiffs[spaceIndex];
|
|
27688
|
+
const oldWidth = charBound.width;
|
|
27689
|
+
charBound.width += diff;
|
|
27690
|
+
charBound.kernedWidth += diff;
|
|
27691
|
+
console.log(`🔤 Line ${lineIndex} space ${spaceIndex}: ${oldWidth.toFixed(1)}px -> ${charBound.width.toFixed(1)}px`);
|
|
27692
|
+
if (isRtl) {
|
|
27693
|
+
remainingDiff -= diff;
|
|
27694
|
+
} else {
|
|
27695
|
+
accumulatedSpace += diff;
|
|
27696
|
+
}
|
|
27697
|
+
spaceIndex++;
|
|
27698
|
+
}
|
|
27699
|
+
}
|
|
27700
|
+
// also need to update the last charBound
|
|
27701
|
+
const lastBound = lineBounds[line.length];
|
|
27702
|
+
if (lastBound) {
|
|
27703
|
+
if (isRtl) {
|
|
27704
|
+
lastBound.left += remainingDiff;
|
|
27705
|
+
} else {
|
|
27706
|
+
lastBound.left += accumulatedSpace;
|
|
27707
|
+
}
|
|
27708
|
+
}
|
|
27709
|
+
});
|
|
27710
|
+
}
|
|
27711
|
+
|
|
27712
|
+
/**
|
|
27713
|
+
* Apply overlay justify measurements to character bounds
|
|
27714
|
+
* @private
|
|
27715
|
+
*/
|
|
27716
|
+
_applyOverlayJustifySpaces(overlayMeasurements) {
|
|
27717
|
+
this._textLines.forEach((line, lineIndex) => {
|
|
27718
|
+
if (!this.__charBounds || !this.__charBounds[lineIndex]) return;
|
|
27719
|
+
const lineMeasurement = overlayMeasurements[lineIndex];
|
|
27720
|
+
if (!lineMeasurement) return;
|
|
27721
|
+
const {
|
|
27722
|
+
justifiedSpaceWidth
|
|
27723
|
+
} = lineMeasurement;
|
|
27724
|
+
let spaceIndex = 0;
|
|
27725
|
+
line.forEach((char, charIndex) => {
|
|
27726
|
+
if (char === ' ' && this.__charBounds[lineIndex][charIndex]) {
|
|
27727
|
+
const oldWidth = this.__charBounds[lineIndex][charIndex].width;
|
|
27728
|
+
this.__charBounds[lineIndex][charIndex].width = justifiedSpaceWidth;
|
|
27729
|
+
console.log(`🎯 OVERLAY Line ${lineIndex} space ${spaceIndex}: ${oldWidth.toFixed(1)}px -> ${justifiedSpaceWidth.toFixed(1)}px`);
|
|
27730
|
+
spaceIndex++;
|
|
27731
|
+
}
|
|
27732
|
+
});
|
|
27508
27733
|
});
|
|
27509
27734
|
}
|
|
27510
27735
|
|
|
27511
|
-
/**
|
|
27512
|
-
*
|
|
27513
|
-
|
|
27736
|
+
/**
|
|
27737
|
+
* Extract justify measurements from overlay textarea and store them
|
|
27738
|
+
*/
|
|
27739
|
+
extractJustifyMeasurementsFromOverlay(textarea) {
|
|
27740
|
+
const text = textarea.value;
|
|
27741
|
+
if (!text || !this.textAlign.includes('justify')) {
|
|
27742
|
+
return;
|
|
27743
|
+
}
|
|
27744
|
+
|
|
27745
|
+
// Use the same measurement technique as measureLinesWithBrowser
|
|
27746
|
+
const testElement = document.createElement('div');
|
|
27747
|
+
testElement.style.position = 'absolute';
|
|
27748
|
+
testElement.style.left = '-9999px';
|
|
27749
|
+
testElement.style.visibility = 'hidden';
|
|
27750
|
+
|
|
27751
|
+
// Copy all styles from the textarea to ensure identical rendering
|
|
27752
|
+
const computedStyle = window.getComputedStyle(textarea);
|
|
27753
|
+
const stylesToCopy = ['fontSize', 'fontFamily', 'fontWeight', 'fontStyle', 'lineHeight', 'letterSpacing', 'direction', 'textAlign', 'textAlignLast', 'textJustify', 'width', 'padding', 'boxSizing', 'whiteSpace', 'wordBreak', 'overflowWrap'];
|
|
27754
|
+
stylesToCopy.forEach(prop => {
|
|
27755
|
+
testElement.style[prop] = computedStyle[prop];
|
|
27756
|
+
});
|
|
27757
|
+
testElement.textContent = text;
|
|
27758
|
+
document.body.appendChild(testElement);
|
|
27759
|
+
try {
|
|
27760
|
+
// Extract justify space measurements using the same logic
|
|
27761
|
+
const lines = text.split('\n');
|
|
27762
|
+
const justifyMeasurements = {};
|
|
27763
|
+
lines.forEach((line, lineIndex) => {
|
|
27764
|
+
if (line.trim()) {
|
|
27765
|
+
const spaces = (line.match(/\s/g) || []).length;
|
|
27766
|
+
if (spaces > 0) {
|
|
27767
|
+
// Measure natural space width
|
|
27768
|
+
const singleSpaceDiv = document.createElement('div');
|
|
27769
|
+
stylesToCopy.forEach(prop => {
|
|
27770
|
+
singleSpaceDiv.style[prop] = computedStyle[prop];
|
|
27771
|
+
});
|
|
27772
|
+
singleSpaceDiv.textContent = ' ';
|
|
27773
|
+
document.body.appendChild(singleSpaceDiv);
|
|
27774
|
+
const naturalSpaceWidth = singleSpaceDiv.getBoundingClientRect().width;
|
|
27775
|
+
document.body.removeChild(singleSpaceDiv);
|
|
27776
|
+
|
|
27777
|
+
// Measure justified line width
|
|
27778
|
+
const lineDiv = document.createElement('div');
|
|
27779
|
+
stylesToCopy.forEach(prop => {
|
|
27780
|
+
lineDiv.style[prop] = computedStyle[prop];
|
|
27781
|
+
});
|
|
27782
|
+
lineDiv.textContent = line;
|
|
27783
|
+
document.body.appendChild(lineDiv);
|
|
27784
|
+
const lineWidth = lineDiv.getBoundingClientRect().width;
|
|
27785
|
+
const containerWidth = parseFloat(computedStyle.width);
|
|
27786
|
+
|
|
27787
|
+
// Calculate justified space width
|
|
27788
|
+
const nonSpaceText = line.replace(/\s/g, '');
|
|
27789
|
+
const nonSpaceDiv = document.createElement('div');
|
|
27790
|
+
stylesToCopy.forEach(prop => {
|
|
27791
|
+
nonSpaceDiv.style[prop] = computedStyle[prop];
|
|
27792
|
+
});
|
|
27793
|
+
nonSpaceDiv.textContent = nonSpaceText;
|
|
27794
|
+
document.body.appendChild(nonSpaceDiv);
|
|
27795
|
+
const nonSpaceWidth = nonSpaceDiv.getBoundingClientRect().width;
|
|
27796
|
+
const justifiedSpaceWidth = (containerWidth - nonSpaceWidth) / spaces;
|
|
27797
|
+
console.log(`🎯 OVERLAY Line ${lineIndex}: ${spaces} spaces, natural: ${naturalSpaceWidth.toFixed(1)}px -> justified: ${justifiedSpaceWidth.toFixed(1)}px`);
|
|
27798
|
+
justifyMeasurements[lineIndex] = {
|
|
27799
|
+
naturalSpaceWidth,
|
|
27800
|
+
justifiedSpaceWidth,
|
|
27801
|
+
spaceCount: spaces
|
|
27802
|
+
};
|
|
27803
|
+
document.body.removeChild(lineDiv);
|
|
27804
|
+
document.body.removeChild(nonSpaceDiv);
|
|
27805
|
+
}
|
|
27806
|
+
}
|
|
27807
|
+
});
|
|
27808
|
+
|
|
27809
|
+
// Store the measurements
|
|
27810
|
+
this._overlayJustifyMeasurements = justifyMeasurements;
|
|
27811
|
+
console.log('💾 STORED: Overlay justify measurements', justifyMeasurements);
|
|
27812
|
+
} finally {
|
|
27813
|
+
document.body.removeChild(testElement);
|
|
27814
|
+
}
|
|
27815
|
+
}
|
|
27816
|
+
|
|
27817
|
+
/**
|
|
27818
|
+
* Fallback to default Fabric wrapping
|
|
27819
|
+
* @private
|
|
27514
27820
|
*/
|
|
27515
27821
|
_splitTextIntoLinesDefault(text) {
|
|
27516
27822
|
const newText = super._splitTextIntoLines(text),
|
|
@@ -27542,12 +27848,12 @@ class Textbox extends IText {
|
|
|
27542
27848
|
}
|
|
27543
27849
|
}
|
|
27544
27850
|
|
|
27545
|
-
/**
|
|
27546
|
-
* Initialize event listeners for safety snap functionality
|
|
27547
|
-
* @private
|
|
27851
|
+
/**
|
|
27852
|
+
* Initialize event listeners for safety snap functionality
|
|
27853
|
+
* @private
|
|
27548
27854
|
*/
|
|
27549
27855
|
initializeEventListeners() {
|
|
27550
|
-
var _this$
|
|
27856
|
+
var _this$canvas5;
|
|
27551
27857
|
// Track which side is being used for resize to handle position compensation
|
|
27552
27858
|
let resizeOrigin = null;
|
|
27553
27859
|
|
|
@@ -27572,13 +27878,14 @@ class Textbox extends IText {
|
|
|
27572
27878
|
// Use 'modified' event which fires after user releases the mouse
|
|
27573
27879
|
this.on('modified', () => {
|
|
27574
27880
|
const currentResizeOrigin = resizeOrigin; // Capture the value before reset
|
|
27881
|
+
this.initDimensions();
|
|
27575
27882
|
// Small delay to ensure text layout is updated
|
|
27576
27883
|
setTimeout(() => this.safetySnapWidth(currentResizeOrigin), 10);
|
|
27577
27884
|
resizeOrigin = null; // Reset after capturing
|
|
27578
27885
|
});
|
|
27579
27886
|
|
|
27580
27887
|
// Also listen to canvas-level modified event as backup
|
|
27581
|
-
(_this$
|
|
27888
|
+
(_this$canvas5 = this.canvas) === null || _this$canvas5 === void 0 || _this$canvas5.on('object:modified', e => {
|
|
27582
27889
|
if (e.target === this) {
|
|
27583
27890
|
const currentResizeOrigin = resizeOrigin; // Capture the value before reset
|
|
27584
27891
|
setTimeout(() => this.safetySnapWidth(currentResizeOrigin), 10);
|
|
@@ -27587,12 +27894,12 @@ class Textbox extends IText {
|
|
|
27587
27894
|
});
|
|
27588
27895
|
}
|
|
27589
27896
|
|
|
27590
|
-
/**
|
|
27591
|
-
* Safety snap to prevent glyph clipping after manual resize.
|
|
27592
|
-
* Similar to Polotno - checks if any glyphs are too close to edges
|
|
27593
|
-
* and automatically expands width if needed.
|
|
27594
|
-
* @private
|
|
27595
|
-
* @param resizeOrigin - Which side was used for resizing ('left' or 'right')
|
|
27897
|
+
/**
|
|
27898
|
+
* Safety snap to prevent glyph clipping after manual resize.
|
|
27899
|
+
* Similar to Polotno - checks if any glyphs are too close to edges
|
|
27900
|
+
* and automatically expands width if needed.
|
|
27901
|
+
* @private
|
|
27902
|
+
* @param resizeOrigin - Which side was used for resizing ('left' or 'right')
|
|
27596
27903
|
*/
|
|
27597
27904
|
safetySnapWidth(resizeOrigin) {
|
|
27598
27905
|
// For Textbox objects, we always want to check for clipping regardless of isWrapping flag
|
|
@@ -27622,7 +27929,7 @@ class Textbox extends IText {
|
|
|
27622
27929
|
const safetyThreshold = 2; // px - very subtle trigger
|
|
27623
27930
|
|
|
27624
27931
|
if (maxRequiredWidth > this.width - safetyThreshold) {
|
|
27625
|
-
var _this$
|
|
27932
|
+
var _this$canvas6;
|
|
27626
27933
|
// Set width to exactly what's needed + minimal safety margin
|
|
27627
27934
|
const newWidth = maxRequiredWidth + 1; // Add just 1px safety margin
|
|
27628
27935
|
|
|
@@ -27631,7 +27938,7 @@ class Textbox extends IText {
|
|
|
27631
27938
|
const originalTop = this.top;
|
|
27632
27939
|
const widthIncrease = newWidth - this.width;
|
|
27633
27940
|
|
|
27634
|
-
// Change width
|
|
27941
|
+
// Change width
|
|
27635
27942
|
this.set('width', newWidth);
|
|
27636
27943
|
|
|
27637
27944
|
// Force text layout recalculation
|
|
@@ -27643,8 +27950,8 @@ class Textbox extends IText {
|
|
|
27643
27950
|
// When resizing from left, the expansion pushes text right
|
|
27644
27951
|
// Compensate by moving the textbox left by the width increase
|
|
27645
27952
|
this.set({
|
|
27646
|
-
|
|
27647
|
-
|
|
27953
|
+
left: originalLeft - widthIncrease,
|
|
27954
|
+
top: originalTop
|
|
27648
27955
|
});
|
|
27649
27956
|
}
|
|
27650
27957
|
this.setCoords();
|
|
@@ -27655,13 +27962,13 @@ class Textbox extends IText {
|
|
|
27655
27962
|
this.__overlayEditor.refresh();
|
|
27656
27963
|
}, 0);
|
|
27657
27964
|
}
|
|
27658
|
-
(_this$
|
|
27965
|
+
(_this$canvas6 = this.canvas) === null || _this$canvas6 === void 0 || _this$canvas6.requestRenderAll();
|
|
27659
27966
|
}
|
|
27660
27967
|
}
|
|
27661
27968
|
|
|
27662
|
-
/**
|
|
27663
|
-
* Fix character selection mismatch after JSON loading for browser-wrapped fonts
|
|
27664
|
-
* @private
|
|
27969
|
+
/**
|
|
27970
|
+
* Fix character selection mismatch after JSON loading for browser-wrapped fonts
|
|
27971
|
+
* @private
|
|
27665
27972
|
*/
|
|
27666
27973
|
_fixCharacterMappingAfterJsonLoad() {
|
|
27667
27974
|
if (this._usingBrowserWrapping) {
|
|
@@ -27681,9 +27988,9 @@ class Textbox extends IText {
|
|
|
27681
27988
|
}
|
|
27682
27989
|
}
|
|
27683
27990
|
|
|
27684
|
-
/**
|
|
27685
|
-
* Force complete textbox re-initialization (useful after JSON loading)
|
|
27686
|
-
* Overrides Text version with Textbox-specific logic
|
|
27991
|
+
/**
|
|
27992
|
+
* Force complete textbox re-initialization (useful after JSON loading)
|
|
27993
|
+
* Overrides Text version with Textbox-specific logic
|
|
27687
27994
|
*/
|
|
27688
27995
|
forceTextReinitialization() {
|
|
27689
27996
|
console.log('🔄 Force reinitializing Textbox object');
|
|
@@ -27706,7 +28013,7 @@ class Textbox extends IText {
|
|
|
27706
28013
|
// Double-check that justify was applied by checking space widths
|
|
27707
28014
|
if (this.textAlign.includes('justify') && this.__charBounds) {
|
|
27708
28015
|
setTimeout(() => {
|
|
27709
|
-
var _this$
|
|
28016
|
+
var _this$canvas7;
|
|
27710
28017
|
// Verify justify was applied by checking if space widths vary
|
|
27711
28018
|
let hasVariableSpaces = false;
|
|
27712
28019
|
this.__charBounds.forEach((lineBounds, i) => {
|
|
@@ -27735,36 +28042,118 @@ class Textbox extends IText {
|
|
|
27735
28042
|
this.height = this.calcTextHeight();
|
|
27736
28043
|
console.log(`🔧 JUSTIFY: Used calcTextHeight: ${this.height}px`);
|
|
27737
28044
|
}
|
|
27738
|
-
(_this$
|
|
28045
|
+
(_this$canvas7 = this.canvas) === null || _this$canvas7 === void 0 || _this$canvas7.requestRenderAll();
|
|
27739
28046
|
}, 10);
|
|
27740
28047
|
}
|
|
27741
28048
|
}
|
|
27742
28049
|
|
|
27743
|
-
/**
|
|
27744
|
-
*
|
|
27745
|
-
* @
|
|
27746
|
-
|
|
28050
|
+
/**
|
|
28051
|
+
* Fix justify text after JSON loading - call this after fromObject
|
|
28052
|
+
* @public
|
|
28053
|
+
*/
|
|
28054
|
+
fixJustifyAfterJSONLoad() {
|
|
28055
|
+
if (this.textAlign.includes('justify') && this.useOverlayEditing) {
|
|
28056
|
+
console.log('🔧 JSON FIX: Fixing justify text after JSON load');
|
|
28057
|
+
// The issue is that enlargeSpaces() isn't properly updating after JSON load
|
|
28058
|
+
// Workaround: temporarily change width to trigger proper rebuild, then restore
|
|
28059
|
+
setTimeout(() => {
|
|
28060
|
+
const originalWidth = this.width;
|
|
28061
|
+
console.log('🔄 JSON TRICK: Temporarily changing width to force justify rebuild');
|
|
28062
|
+
|
|
28063
|
+
// Temporarily change width by 1px to trigger proper justify recalculation
|
|
28064
|
+
this.width = originalWidth + 1;
|
|
28065
|
+
this.initDimensions();
|
|
28066
|
+
|
|
28067
|
+
// Restore original width - this will trigger the proper justify calculation
|
|
28068
|
+
setTimeout(() => {
|
|
28069
|
+
var _this$canvas8;
|
|
28070
|
+
this.width = originalWidth;
|
|
28071
|
+
this.initDimensions();
|
|
28072
|
+
(_this$canvas8 = this.canvas) === null || _this$canvas8 === void 0 || _this$canvas8.requestRenderAll();
|
|
28073
|
+
console.log('✅ JSON FIX: Restored original width, justify should be fixed');
|
|
28074
|
+
}, 50);
|
|
28075
|
+
}, 100);
|
|
28076
|
+
}
|
|
28077
|
+
}
|
|
28078
|
+
|
|
28079
|
+
/**
|
|
28080
|
+
* Returns object representation of an instance
|
|
28081
|
+
* @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output
|
|
28082
|
+
* @return {Object} object representation of an instance
|
|
27747
28083
|
*/
|
|
27748
28084
|
toObject() {
|
|
27749
28085
|
let propertiesToInclude = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
27750
|
-
|
|
28086
|
+
const obj = super.toObject(['minWidth', 'splitByGrapheme', ...propertiesToInclude]);
|
|
28087
|
+
|
|
28088
|
+
// For justify text with overlay editing, ensure measurements are available
|
|
28089
|
+
if (this.textAlign.includes('justify') && this.useOverlayEditing) {
|
|
28090
|
+
var _charBounds, _charBounds2;
|
|
28091
|
+
// If character bounds don't exist yet, initialize dimensions to calculate them
|
|
28092
|
+
if (!((_charBounds = this.__charBounds) !== null && _charBounds !== void 0 && _charBounds.length)) {
|
|
28093
|
+
console.log('🔧 SERIALIZE: Character bounds missing, initializing dimensions for justify text');
|
|
28094
|
+
this.initDimensions();
|
|
28095
|
+
}
|
|
28096
|
+
|
|
28097
|
+
// Now save the measurements if they exist
|
|
28098
|
+
if ((_charBounds2 = this.__charBounds) !== null && _charBounds2 !== void 0 && _charBounds2.length) {
|
|
28099
|
+
console.log('💾 SERIALIZE: Saving justify measurements to JSON');
|
|
28100
|
+
obj._justifyMeasurements = {
|
|
28101
|
+
__charBounds: this.__charBounds,
|
|
28102
|
+
__lineHeights: this.__lineHeights,
|
|
28103
|
+
__lineWidths: this.__lineWidths,
|
|
28104
|
+
_hasJustifyData: true
|
|
28105
|
+
};
|
|
28106
|
+
} else {
|
|
28107
|
+
console.warn('⚠️ SERIALIZE: Could not generate character bounds for justify text');
|
|
28108
|
+
}
|
|
28109
|
+
}
|
|
28110
|
+
return obj;
|
|
28111
|
+
}
|
|
28112
|
+
|
|
28113
|
+
/**
|
|
28114
|
+
* Override _set to handle justify measurements during JSON loading
|
|
28115
|
+
* @private
|
|
28116
|
+
*/
|
|
28117
|
+
_set(key, value) {
|
|
28118
|
+
const result = super._set(key, value);
|
|
28119
|
+
|
|
28120
|
+
// Restore justify measurements if they exist in the JSON data
|
|
28121
|
+
if (key === '_justifyMeasurements' && value && value._hasJustifyData) {
|
|
28122
|
+
console.log('🔄 DESERIALIZE: Restoring justify measurements from JSON');
|
|
28123
|
+
this.__charBounds = value.__charBounds;
|
|
28124
|
+
this.__lineHeights = value.__lineHeights;
|
|
28125
|
+
this.__lineWidths = value.__lineWidths;
|
|
28126
|
+
|
|
28127
|
+
// Mark that we have restored data so we don't interfere with it
|
|
28128
|
+
this._hasRestoredJustifyData = true;
|
|
28129
|
+
|
|
28130
|
+
// Automatically trigger the fix after JSON loading
|
|
28131
|
+
if (this.textAlign.includes('justify') && this.useOverlayEditing) {
|
|
28132
|
+
console.log('🔄 AUTO-FIX: Calling fixJustifyAfterJSONLoad after restoring justify measurements');
|
|
28133
|
+
// Use setTimeout to ensure this runs after all object initialization is complete
|
|
28134
|
+
setTimeout(() => {
|
|
28135
|
+
this.fixJustifyAfterJSONLoad();
|
|
28136
|
+
}, 10);
|
|
28137
|
+
}
|
|
28138
|
+
}
|
|
28139
|
+
return result;
|
|
27751
28140
|
}
|
|
27752
28141
|
}
|
|
27753
|
-
/**
|
|
27754
|
-
* Minimum width of textbox, in pixels.
|
|
27755
|
-
* @type Number
|
|
27756
|
-
*/
|
|
27757
|
-
/**
|
|
27758
|
-
* Minimum calculated width of a textbox, in pixels.
|
|
27759
|
-
* fixed to 2 so that an empty textbox cannot go to 0
|
|
27760
|
-
* and is still selectable without text.
|
|
27761
|
-
* @type Number
|
|
27762
|
-
*/
|
|
27763
|
-
/**
|
|
27764
|
-
* Use this boolean property in order to split strings that have no white space concept.
|
|
27765
|
-
* this is a cheap way to help with chinese/japanese
|
|
27766
|
-
* @type Boolean
|
|
27767
|
-
* @since 2.6.0
|
|
28142
|
+
/**
|
|
28143
|
+
* Minimum width of textbox, in pixels.
|
|
28144
|
+
* @type Number
|
|
28145
|
+
*/
|
|
28146
|
+
/**
|
|
28147
|
+
* Minimum calculated width of a textbox, in pixels.
|
|
28148
|
+
* fixed to 2 so that an empty textbox cannot go to 0
|
|
28149
|
+
* and is still selectable without text.
|
|
28150
|
+
* @type Number
|
|
28151
|
+
*/
|
|
28152
|
+
/**
|
|
28153
|
+
* Use this boolean property in order to split strings that have no white space concept.
|
|
28154
|
+
* this is a cheap way to help with chinese/japanese
|
|
28155
|
+
* @type Boolean
|
|
28156
|
+
* @since 2.6.0
|
|
27768
28157
|
*/
|
|
27769
28158
|
_defineProperty(Textbox, "type", 'Textbox');
|
|
27770
28159
|
_defineProperty(Textbox, "textLayoutProperties", [...IText.textLayoutProperties, 'width']);
|