Browse Source

Merge branch 'dev' of https://github.com/GrapesJS/grapesjs into collection-component

collection-component
mohamedsalem401 2 years ago
parent
commit
59d104528e
  1. 4
      docs/api/canvas.md
  2. 2
      packages/core/src/canvas/index.ts
  3. 2
      packages/core/src/canvas/types.ts
  4. 2
      packages/core/src/css_composer/view/CssRulesView.ts
  5. 2
      packages/core/src/dom_components/view/ComponentTextView.ts
  6. 7
      packages/core/src/domain_abstract/ui/InputNumber.ts
  7. 8
      packages/core/src/style_manager/model/PropertyFactory.ts
  8. 8
      packages/core/test/specs/style_manager/model/PropertyFactory.ts

4
docs/api/canvas.md

@ -106,7 +106,7 @@ editor.on('canvas:frame:load', ({ window }) => {
});
```
* `canvas:frame:load:head` Frame head loaded in canvas. The event is triggered right after iframe's finished to load the head elemenets (eg. scripts)
* `canvas:frame:load:head` Frame head loaded in canvas. The event is triggered right after iframe's finished to load the head elements (eg. scripts)
```javascript
editor.on('canvas:frame:load:head', ({ window }) => {
@ -246,7 +246,7 @@ passed to it. For instance, you can scroll smoothly by using
const selected = editor.getSelected();
// Scroll smoothly (this behavior can be polyfilled)
canvas.scrollTo(selected, { behavior: 'smooth' });
// Force the scroll, even if the element is alredy visible
// Force the scroll, even if the element is already visible
canvas.scrollTo(selected, { force: true });
```

2
packages/core/src/canvas/index.ts

@ -574,7 +574,7 @@ export default class CanvasModule extends Module<CanvasConfig> {
* const selected = editor.getSelected();
* // Scroll smoothly (this behavior can be polyfilled)
* canvas.scrollTo(selected, { behavior: 'smooth' });
* // Force the scroll, even if the element is alredy visible
* // Force the scroll, even if the element is already visible
* canvas.scrollTo(selected, { force: true });
*/
scrollTo(el: any, opts = {}) {

2
packages/core/src/canvas/types.ts

@ -127,7 +127,7 @@ export enum CanvasEvents {
frameLoad = 'canvas:frame:load',
/**
* @event `canvas:frame:load:head` Frame head loaded in canvas. The event is triggered right after iframe's finished to load the head elemenets (eg. scripts)
* @event `canvas:frame:load:head` Frame head loaded in canvas. The event is triggered right after iframe's finished to load the head elements (eg. scripts)
* @example
* editor.on('canvas:frame:load:head', ({ window }) => {
* console.log('Frame head loaded', window);

2
packages/core/src/css_composer/view/CssRulesView.ts

@ -60,7 +60,7 @@ export default class CssRulesView extends View {
// I have to render keyframes of the same name together
// Unfortunately at the moment I didn't find the way of appending them
// if not staticly, via appendData
// if not statically, via appendData
if (model.get('atRuleType') === 'keyframes') {
const atRule = model.getAtRule();
let atRuleEl = this.atRules[atRule];

2
packages/core/src/dom_components/view/ComponentTextView.ts

@ -160,7 +160,7 @@ export default class ComponentTextView<TComp extends ComponentText = ComponentTe
const contentOpt: ObjectAny = { fromDisable: 1, ...opts };
model.set('content', '', contentOpt);
// If there is a custom RTE the content is just added staticly
// If there is a custom RTE the content is just added statically
// inside 'content'
if (rte?.customRte && !rte.customRte.parseContent) {
comps.length &&

7
packages/core/src/domain_abstract/ui/InputNumber.ts

@ -268,8 +268,11 @@ export default class InputNumber extends Input {
}
}
if (!limitlessMax && !isUndefined(max) && max !== '') val = val > max ? max : val;
if (!limitlessMin && !isUndefined(min) && min !== '') val = val < min ? min : val;
// Apply constraints only if val is a valid number
if (!isNaN(val) && val !== '') {
if (!limitlessMax && !isUndefined(max) && max !== '') val = val > max ? max : val;
if (!limitlessMin && !isUndefined(min) && min !== '') val = val < min ? min : val;
}
return {
force,

8
packages/core/src/style_manager/model/PropertyFactory.ts

@ -342,14 +342,14 @@ export default class PropertyFactory {
extend: 'border-top-right-radius',
id: 'border-top-right-radius-sub',
},
{
extend: 'border-bottom-right-radius',
id: 'border-bottom-right-radius-sub',
},
{
extend: 'border-bottom-left-radius',
id: 'border-bottom-left-radius-sub',
},
{
extend: 'border-bottom-right-radius',
id: 'border-bottom-right-radius-sub',
},
]),
},
'margin',

8
packages/core/test/specs/style_manager/model/PropertyFactory.ts

@ -485,16 +485,16 @@ describe('PropertyFactory', () => {
default: '0',
},
{
property: 'border-bottom-right-radius',
id: 'border-bottom-right-radius-sub',
property: 'border-bottom-left-radius',
id: 'border-bottom-left-radius-sub',
type: 'number',
units: obj.unitsSize,
min: 0,
default: '0',
},
{
property: 'border-bottom-left-radius',
id: 'border-bottom-left-radius-sub',
property: 'border-bottom-right-radius',
id: 'border-bottom-right-radius-sub',
type: 'number',
units: obj.unitsSize,
min: 0,

Loading…
Cancel
Save