* Add tests for component wrapper
* Refactor component data collection
* Add data resolver to wrapper component
* Fix types
* Add collection data source to page
* refactor get and set DataResolver to componentWrapper
* Rename key to __rootData
* add resolverCurrentItem
* Make _resolverCurrentItem private
* update ComponentWrapper tests
* Fix componentWithCollectionsState
* remove collectionsStateMap from Page
* update component wrapper tests
* fix component wrapper tests
* return a copy of records for DataSource.getPath
* Move all collection listeners to component with collection state
* fix style sync in collection items
* fix loop issue
* update data collection tests
* cleanup
* update collection statemap on wrapper change
* Add object test data for wrapper data resolver
* cleanup
* up unit test
* remove duplicated code
* cleanup event path
* update test data to better names
* improve component data collection performance
* cleanup tests and types
* fix performance issue for the new wrapper datasource
* Undo updating component with datacolection tests
* apply comments
* Skip same path update
---------
Co-authored-by: Artur Arseniev <artur.catch@hotmail.it>
* Fix saving dynamic values for cssRules
* Allow using collectionStateMap for styleable models
* Fix bug with undo manager
* refactor resolverWatcher
* Allow CssRules to use collection variable
* Fix undoManager issue for binding data to a component
* update returned value for adding props
* Revert a change to fix tests
* move test files
* Add tests for undomanager with datasources
* update clone and toJSON for cssRule
* Refactor Model data resolver
* update test setup function
* Refactor datasources logic to styleable model
* Add clone and update toJSON in styleableModel
* Refactor CssRule to use styleableModel methods
* Add undomanager to datasources
* refactor component class to use styleableModel methods
* update unit tests for undo manager
* Refactor data resolver watcher
* Fix undoManager in test enviroment
* Remove destroy test editor
* Update Data resolver watchers
* Remove setTimeout from undo manager unit tests
* Fix Selection tracking tests
* Fix missing id in `component.toJSON()`
* Fix styles as string for cssRules
* Fix CssRule type
* Add string style support for ModelResolver.getProps()
* Cleanup ( rename dynamic to data resolver )
* Use fake timers in undo manager tests
* Remove checking duplicated object in undomanager registry
* Fix typescript checks
* Fix lint
* Emit event on setting a style with dynamic value
* Fix event when binding to a data value equals to the previous static value
* Fix dataResolver listening bug after loading a project
* Add style watchers to modelResolverWatcher class
* Remove watcher init from Component
* Add watcher init to styleableModel and refactor styleableModel
* Fix global styles listening to datasources
* cleanup
* fix initial styles not working bug
* Add skip resolve option to component.getStyle
* Add more global styles unit tests
* Improve serialization test
* Add component:input to ComponentsEvents
* Add additional `data:path` events
* Add CssRule mount event
* Switch to a new pathSource event.
The `data:path:SOURCE_ID` doesn't work as it triggers rebuilds of symbols in ComponentDataCollection
* Up comment
* Up data_sources docs
* Up data_sources jsdoc
* Up Module.events TS
* Export types data components
* More TS export
* Up TS
* Up docs API
* fixe ComponentDataVariable dataResolver type 'data-variable' issue
* Improve some types in data resolvers
* Add an options to add dynamic values as plain text 'asPlainText: boolean'
* Make collections loop over objects
* update getItemsCount method
* Trigger `component:styleUpdate` also on the component itself
* Up
* Add type getter to the Component
* Add isVisible property to Property class in StyleManager
* Fix unstylable
* Remove type getter
* Avoid throwing errors if no condition is passed to a DataCondition
* Refactor Condition class
* Remove expecting errors for conditions tests
* Extend and refactor BaseOperator
* Rename and refactor GenericOperator
* Rename and refactor logicalOperator to BooleanOperator
* Refactor StringOperator
* Refactor NumberOperator
* Refactor and fix DataResolverListener
* Update tests for condition Operators
* Rename Condition class to ConditionEvaluator
* Add missing types file
* Update and refactor DataCondition
* Update utils
* Refactor StyleableModel class
* Update ComponentDataCondition
* Refactor ComponentResolverWatcher
* Fix conditional styles
* Rename LogicalGroupStatement to LogicalGroupEvaluator
* Fix tests for DataCondition
* Add setter methods for component data variable
* Add setters and getter to ComponentDataCondition
* Add getters to ComponentDataVariable
* Rename test file
* Make dynamic components undroppable
* Fix collection types
* Update collections ( add setters and getter, first item editable, sync styles )
* Update data collection tests
* Format tests
* Fix some ComponentData collection bugs
* Refactor setStartIndex and setEndIndex
* Fix getComponentDef test
* Fix bug with end index = 0
* fix test for setDataSource
* fix test for HTML updates
* Format
* Add tests for the new option in getDataValue for conditions ( skipDynamicValueResolution )
* rename Operation to DataConditionOperation
* Run __onStyleChange after style changes as before
* Format
* Up BooleanOperator
* Avoid raising errors for wrong dynamic value types
* Refactor DataCondition
* Format
* Refactor how component data variable works internally
* Symbols fix
* Add docs
* Refactor componentDatacondition
* Add types for Datacondition output ( result ) types
* Refactor DataCondition
* Refactor ComponentDataCollection
* Refactor styleableModel
* Add missing files and utils
* Up tests for ComponentDataCondition
* Add new tests for component data condition
* Fix quality check
* Move ComponentDataVariable path and default value to dataResolver property
* Update component data condition structure
* Refactor data condition
* Fix ifTrue and ifFalse position in ComponentDataCondition
* Fix typescript
* Change setIfTrueContent to be setIfTrueComponents
* Fix memory leak for binding to this.postRender
* Cleanup ComponentDataConditionView
* Up tests
* Save ComponentDataVariable on dataResolverChange
* Remove DataCollection componentDef
* Add setCollectionId method
* Replace DataCollectionVariable with DataVariable
* cleanup
* Fix bug
* PR review
* Add new API endpoints
* Add getCollectionsStateMap to ComponentDataVariable
* Fix tests
* up DataSources
* Merge branch 'dev' of https://github.com/GrapesJS/grapesjs into dynamic-values-improvements
* Push branch with refactored datasources
* Fix conditions nested inside collections
* Refactor how collectionsStateMap works
* Add DataVariable static methods
* Fix dataconditions nested inside collections
* format
* Remove collectionsStateMap on component drag
* Fix remainingItems state
* Make the first component item as the main symbol
* make layrable as false
* Update how datacollection components sync styles
---------
Co-authored-by: Artur Arseniev <artur.catch@hotmail.it>
* Avoid throwing errors if no condition is passed to a DataCondition
* Refactor Condition class
* Remove expecting errors for conditions tests
* Extend and refactor BaseOperator
* Rename and refactor GenericOperator
* Rename and refactor logicalOperator to BooleanOperator
* Refactor StringOperator
* Refactor NumberOperator
* Refactor and fix DataResolverListener
* Update tests for condition Operators
* Rename Condition class to ConditionEvaluator
* Add missing types file
* Update and refactor DataCondition
* Update utils
* Refactor StyleableModel class
* Update ComponentDataCondition
* Refactor ComponentResolverWatcher
* Fix conditional styles
* Rename LogicalGroupStatement to LogicalGroupEvaluator
* Fix tests for DataCondition
* Add setter methods for component data variable
* Add setters and getter to ComponentDataCondition
* Add getters to ComponentDataVariable
* Rename test file
* Make dynamic components undroppable
* Fix collection types
* Update collections ( add setters and getter, first item editable, sync styles )
* Update data collection tests
* Format tests
* Fix some ComponentData collection bugs
* Refactor setStartIndex and setEndIndex
* Fix getComponentDef test
* Fix bug with end index = 0
* fix test for setDataSource
* fix test for HTML updates
* Format
* Add tests for the new option in getDataValue for conditions ( skipDynamicValueResolution )
* rename Operation to DataConditionOperation
* Run __onStyleChange after style changes as before
* Format
* Up BooleanOperator
* Avoid raising errors for wrong dynamic value types
* Refactor DataCondition
* Format
* Refactor how component data variable works internally
* Symbols fix
* Add docs
* Refactor componentDatacondition
* Add types for Datacondition output ( result ) types
* Refactor DataCondition
* Refactor ComponentDataCollection
* Refactor styleableModel
* Add missing files and utils
* Up tests for ComponentDataCondition
* Add new tests for component data condition
* Fix quality check
* Move ComponentDataVariable path and default value to dataResolver property
* Update component data condition structure
* Refactor data condition
* Fix ifTrue and ifFalse position in ComponentDataCondition
* Fix typescript
* Change setIfTrueContent to be setIfTrueComponents
* Fix memory leak for binding to this.postRender
* Cleanup ComponentDataConditionView
* Up tests
* Save ComponentDataVariable on dataResolverChange
* Remove DataCollection componentDef
* Add setCollectionId method
* Replace DataCollectionVariable with DataVariable
* cleanup
* Fix bug
* PR review
* Add new API endpoints
* Add getCollectionsStateMap to ComponentDataVariable
* Fix tests
---------
Co-authored-by: Artur Arseniev <artur.catch@hotmail.it>
* feat: enhance typing for ComponentDrag and Dragger, adding optional parameters for improved drag functionality
* feat: add customizable styles for drag guides and containers in ComponentDrag
* feat: enhance drag event handling with improved coordinate tracking
* feat: add drag spot type and enhance drag event handling in ComponentDrag
* feat: add default options for command execution and simplify ComponentDrag styles handling
* fix: cleanup
* feat: enhance ComponentDrag with customizable style options and improved drag handling
* feat: update addStyle method to return style options and enhance drag event data
* feat: enhance drag event handling with structured event properties and cleanup unused code
* feat: add run and stop command tests
* test: improve command run and stop tests with objectContaining assertions
* test: update command run and stop tests to use expect.not.objectContaining for options
* test: simplify assertions in run and stop command tests by removing unnecessary expect.not.objectContaining checks
* test: skip run and stop command tests for default options and add TODOs for future fixes
* refactor: rename drag event properties for clarity and consistency
* refactor: update drag event properties to include origin component and remove last matched component
* refactor: enhance drag event properties to include origin guides and matched guides
* refactor: remove drag event type and clean up default options in configuration
* feat: add types
* refactor: improve guide rendering logic and enhance drag event properties
* refactor: update addStyle type definition to accept component and styles parameters
* refactor: streamline guide rendering logic and separate matched guides retrieval
* refactor: remove unused guidesTarget variable and optimize guide rendering during drag
* refactor: optimize guide rendering performance and enhance drag event handling
* refactor: simplify guide target retrieval and enhance type safety in ComponentDrag
* fix: recalculate guides to prevent issues with initial drag position
* refactor: enhance guide matching logic to improve accuracy during drag operations
* refactor: rename guide matching functions for clarity and consistency
* refactor: clean up deprecated properties in ComponentDrag and improve command test clarity
* refactor: update command test expectations
* refactor: improve command option handling and test clarity
* refactor: remove unused default options and enhance guide matching type definitions
* refactor: clarify guide matching type definitions by specifying units in pixels
* refactor: enhance guide matching logic to include complementary types
* Avoid throwing errors if no condition is passed to a DataCondition
* Refactor Condition class
* Remove expecting errors for conditions tests
* Extend and refactor BaseOperator
* Rename and refactor GenericOperator
* Rename and refactor logicalOperator to BooleanOperator
* Refactor StringOperator
* Refactor NumberOperator
* Refactor and fix DataResolverListener
* Update tests for condition Operators
* Rename Condition class to ConditionEvaluator
* Add missing types file
* Update and refactor DataCondition
* Update utils
* Refactor StyleableModel class
* Update ComponentDataCondition
* Refactor ComponentResolverWatcher
* Fix conditional styles
* Rename LogicalGroupStatement to LogicalGroupEvaluator
* Fix tests for DataCondition
* Add setter methods for component data variable
* Add setters and getter to ComponentDataCondition
* Add getters to ComponentDataVariable
* Rename test file
* Make dynamic components undroppable
* Fix collection types
* Update collections ( add setters and getter, first item editable, sync styles )
* Update data collection tests
* Format tests
* Fix some ComponentData collection bugs
* Refactor setStartIndex and setEndIndex
* Fix getComponentDef test
* Fix bug with end index = 0
* fix test for setDataSource
* fix test for HTML updates
* Format
* Add tests for the new option in getDataValue for conditions ( skipDynamicValueResolution )
* rename Operation to DataConditionOperation
* Run __onStyleChange after style changes as before
* Format
* Up BooleanOperator
* Avoid raising errors for wrong dynamic value types
* Refactor DataCondition
* Format
* Refactor how component data variable works internally
* Symbols fix
* Add docs
* Refactor componentDatacondition
* Add types for Datacondition output ( result ) types
* Refactor DataCondition
* Refactor ComponentDataCollection
* Refactor styleableModel
* Add missing files and utils
* Up tests for ComponentDataCondition
* Add new tests for component data condition
* Fix quality check
* Move ComponentDataVariable path and default value to dataResolver property
* Update component data condition structure
* Refactor data condition
* Fix ifTrue and ifFalse position in ComponentDataCondition
* Fix typescript
* Change setIfTrueContent to be setIfTrueComponents
* Fix memory leak for binding to this.postRender
* Cleanup ComponentDataConditionView
* Up tests
---------
Co-authored-by: Artur Arseniev <artur.catch@hotmail.it>
* Avoid throwing errors if no condition is passed to a DataCondition
* Refactor Condition class
* Remove expecting errors for conditions tests
* Extend and refactor BaseOperator
* Rename and refactor GenericOperator
* Rename and refactor logicalOperator to BooleanOperator
* Refactor StringOperator
* Refactor NumberOperator
* Refactor and fix DataResolverListener
* Update tests for condition Operators
* Rename Condition class to ConditionEvaluator
* Add missing types file
* Update and refactor DataCondition
* Update utils
* Refactor StyleableModel class
* Update ComponentDataCondition
* Refactor ComponentResolverWatcher
* Fix conditional styles
* Rename LogicalGroupStatement to LogicalGroupEvaluator
* Fix tests for DataCondition
* Add setter methods for component data variable
* Add setters and getter to ComponentDataCondition
* Add getters to ComponentDataVariable
* Rename test file
* Make dynamic components undroppable
* Fix collection types
* Update collections ( add setters and getter, first item editable, sync styles )
* Update data collection tests
* Format tests
* Fix some ComponentData collection bugs
* Refactor setStartIndex and setEndIndex
* Fix getComponentDef test
* Fix bug with end index = 0
* fix test for setDataSource
* fix test for HTML updates
* Format
* Add tests for the new option in getDataValue for conditions ( skipDynamicValueResolution )
* rename Operation to DataConditionOperation
* Run __onStyleChange after style changes as before
* Format
* Up BooleanOperator
---------
Co-authored-by: Artur Arseniev <artur.catch@hotmail.it>
* apply bypass for clearing text selection for shift-clicking a component being edited
* did not have prettier extension working properly
---------
Co-authored-by: Chris Benjamin <cbenjamin@stormseed.com>
* Add some operations to strings
* Rename some types for conditional variables
* Ignore type error ( for now )
* Fix tests
* Add tests for the newly added string operations
---------
Co-authored-by: Artur Arseniev <artur.catch@hotmail.it>
* Add frame and page getters to Component
* Allow to skip dom reset in components
* Add detectDocument option to parser config
* Add __attrToString
* Update all configs in modules to avoid objects by reference
* Add tests to detectDocument
* Unskip some tests
* feat: expose class creation
* test: coverage for data-var using .addCollection
* Cleanup
---------
Co-authored-by: Artur Arseniev <artur.catch@hotmail.it>
* Add canMove and getChildren to Sorter
* Make the canvas use Components.canMove function
* Fix StyleManager issue
* Make Sorter dependent on an abstract datastructure
* Remove unneeded properties
* Add drag direction enum
* extract method
* Add default values for the sorter
* reverse avoidSelectOnEnd
* Group related options for the Sorter
* Fix types, and fix canvas sorter
* Add method to clear source element freeze
* Add DropLocationDeterminer class
* Refactor some methods in the sorter
* Refactor endMove method
* Refactor rollback method
* Add DropLocationDeterminer, refactor methods in Sorter class
* Break the sorter into multiple classes
* Fix placeholder class jsdocs
* Fix bug while dropping items near the border
* Refactor DropLocationDeterminer
* Add helping methods to the ComponentSorter
* Remove unwanted fields in DropLocationDeterminer
* Add componentSorter Class
* Refactor DropLocationDeterminer Class
* Rename file
* Fix style manager class
* Move files into a new folder
* Move types to a new file
* Add back the tree class paramater instead of abstract classes
* Fix dropping on the same collection issue
* refactor isInFlow
* Change methods to be accessor methods
* Make component sorter dependant on an abstract node
* Fix bug with dropping into an element with no children
* Fix component layers drag and drop
* Remove the ensure placeholder logic from the StyleManagerSorter
* Refactor event handler types
* export interface SorterEventHandlers
* change to ensurePlaceholderElement method
* Make images droppable
* Add support for dragging and dropping textable components
* Remove container argument from startSort
* Trigger events on starting and ending the dragging
* Add triggering old events and callback functions
* Fix drop issue with the style manager
* Add cancelling the dragging
* Hide placeholder if no target
* Refactor droplocationdeteminer and improve performance
* Fix some bugs
* Fix some callbacks
* trigger 'sorter:drag:validation'
* Disable editable text after dropping
* Remove unused functions
* Fix placeholder direction
* Refactor restnode state
* Run formatter
* Remove unused code and redundent comments
* Fix stack test
* Avoid triggering the drop event twice
* Fix styles being removed when dragging components
* change 'sorter:drag:start' event triggering
* Fix legacyOnMove not being triggered
* Some refactor
* Fix selection after cancelling
* Fix triggering update event without moving any component
* fix the sort of dragged components
* make style manager droppable even if the mouse is outside the continer
* Fix selecting blocks after being dropped
* Fix placeholder for empty containers
* Fix blocks drag cancel issue
* Fix style manager cancel
* Fix autoscroll not stopping issue
* Fix comment components drag
* Fix issue with hidden elements
* Fix selection after dropping
* Format
* Fix position on scroll
* remove console.log
* Change target calculation with scroll
* Fix blocks not activating issue
* Fix block drop in wrapper issue
* Fix dropping multiple components in the same position
* Preserve target canvas spot
* Avoid updating non-text related component on drag/drop
* skip sorter tests
---------
Co-authored-by: Artur Arseniev <artur.catch@hotmail.it>