Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion angular/doc/api/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# GridStack Angular Library v13.1.2
# GridStack Angular Library v13.2.0

## Modules

Expand Down
2 changes: 1 addition & 1 deletion angular/projects/lib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gridstack-angular",
"version": "13.1.2",
"version": "13.2.0",
"peerDependencies": {
"@angular/common": ">=14",
"@angular/core": ">=14"
Expand Down
2 changes: 1 addition & 1 deletion angular/projects/lib/src/lib/base-widget.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* gridstack-item.component.ts 13.1.2
* gridstack-item.component.ts 13.2.0
* Copyright (c) 2022-2024 Alain Dumesny - see GridStack root license
*/

Expand Down
2 changes: 1 addition & 1 deletion angular/projects/lib/src/lib/gridstack-item.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* gridstack-item.component.ts 13.1.2
* gridstack-item.component.ts 13.2.0
* Copyright (c) 2022-2024 Alain Dumesny - see GridStack root license
*/

Expand Down
2 changes: 1 addition & 1 deletion angular/projects/lib/src/lib/gridstack.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* gridstack.component.ts 13.1.2
* gridstack.component.ts 13.2.0
* Copyright (c) 2022-2024 Alain Dumesny - see GridStack root license
*/

Expand Down
2 changes: 1 addition & 1 deletion angular/projects/lib/src/lib/gridstack.module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* gridstack.component.ts 13.1.2
* gridstack.component.ts 13.2.0
* Copyright (c) 2022-2024 Alain Dumesny - see GridStack root license
*/

Expand Down
2 changes: 1 addition & 1 deletion angular/projects/lib/src/lib/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* gridstack-item.component.ts 13.1.2
* gridstack-item.component.ts 13.2.0
* Copyright (c) 2025 Alain Dumesny - see GridStack root license
*/

Expand Down
2 changes: 1 addition & 1 deletion doc/API.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# gridstack v13.1.2
# gridstack v13.2.0

## Classes

Expand Down
4 changes: 2 additions & 2 deletions doc/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Change log
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)*

- [13.2.0 (TBD)](#1320-tbd)
- [13.2.0 (2026-08-19)](#1320-2026-08-19)
- [13.1.2 (2026-07-26)](#1312-2026-07-26)
- [13.1.1 (2026-07-25)](#1311-2026-07-25)
- [13.1.0 (2026-07-22)](#1310-2026-07-22)
Expand Down Expand Up @@ -145,7 +145,7 @@ Change log

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## 13.2.0 (TBD)
## 13.2.0 (2026-08-19)
* feat: [#701](https://github.com/gridstack/gridstack.js/issues/701) removed printMode as we support much better printing now that doesn't compromise.
* feat: [#3362](https://github.com/gridstack/gridstack.js/pull/3362) added `PrintOptions.mode` for app custom settings
* fix: [#3357](https://github.com/gridstack/gridstack.js/pull/3357) (react): drop type assertions on useGridStack add/remove helpers - thank you [YOUNGHO8762](https://github.com/YOUNGHO8762)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gridstack",
"version": "13.1.2",
"version": "13.2.0",
"license": "MIT",
"author": "Alain Dumesny <alaind831+github@gmail.com> (https://github.com/adumesny)",
"contributors": [
Expand Down
2 changes: 1 addition & 1 deletion react/doc/api/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# GridStack React Library v13.1.2
# GridStack React Library v13.2.0

## Modules

Expand Down
2 changes: 1 addition & 1 deletion react/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "react",
"private": true,
"version": "13.1.2",
"version": "13.2.0",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
2 changes: 1 addition & 1 deletion src/dd-base-impl.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* dd-base-impl.ts 13.1.2
* dd-base-impl.ts 13.2.0
* Copyright (c) 2021-2025 Alain Dumesny - see GridStack root license
*/

Expand Down
2 changes: 1 addition & 1 deletion src/dd-draggable.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* dd-draggable.ts 13.1.2
* dd-draggable.ts 13.2.0
* Copyright (c) 2021-2025 Alain Dumesny - see GridStack root license
*/

Expand Down
2 changes: 1 addition & 1 deletion src/dd-droppable.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* dd-droppable.ts 13.1.2
* dd-droppable.ts 13.2.0
* Copyright (c) 2021-2025 Alain Dumesny - see GridStack root license
*/

Expand Down
2 changes: 1 addition & 1 deletion src/dd-element.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* dd-elements.ts 13.1.2
* dd-elements.ts 13.2.0
* Copyright (c) 2021-2025 Alain Dumesny - see GridStack root license
*/

Expand Down
2 changes: 1 addition & 1 deletion src/dd-gridstack.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* dd-gridstack.ts 13.1.2
* dd-gridstack.ts 13.2.0
* Copyright (c) 2021-2025 Alain Dumesny - see GridStack root license
*/

Expand Down
2 changes: 1 addition & 1 deletion src/dd-manager.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* dd-manager.ts 13.1.2
* dd-manager.ts 13.2.0
* Copyright (c) 2021-2025 Alain Dumesny - see GridStack root license
*/

Expand Down
2 changes: 1 addition & 1 deletion src/dd-resizable-handle.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* dd-resizable-handle.ts 13.1.2
* dd-resizable-handle.ts 13.2.0
* Copyright (c) 2021-2025 Alain Dumesny - see GridStack root license
*/

Expand Down
2 changes: 1 addition & 1 deletion src/dd-resizable.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* dd-resizable.ts 13.1.2
* dd-resizable.ts 13.2.0
* Copyright (c) 2021-2025 Alain Dumesny - see GridStack root license
*/

Expand Down
2 changes: 1 addition & 1 deletion src/dd-touch.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* touch.ts 13.1.2
* touch.ts 13.2.0
* Copyright (c) 2021-2025 Alain Dumesny - see GridStack root license
*/

Expand Down
2 changes: 1 addition & 1 deletion src/gridstack-engine.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* gridstack-engine.ts 13.1.2
* gridstack-engine.ts 13.2.0
* Copyright (c) 2021-2025 Alain Dumesny - see GridStack root license
*/

Expand Down
2 changes: 1 addition & 1 deletion src/gridstack.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* gridstack SASS styles 13.1.2
* gridstack SASS styles 13.2.0
* Copyright (c) 2021-2025 Alain Dumesny - see GridStack root license
*/

Expand Down
4 changes: 2 additions & 2 deletions src/gridstack.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* GridStack 13.1.2
* GridStack 13.2.0
* https://gridstackjs.com/
*
* Copyright (c) 2021-2025 Alain Dumesny
Expand Down Expand Up @@ -2262,7 +2262,7 @@ export class GridStack {
}

/** @internal current version compiled in code */
static GDRev = '13.1.2';
static GDRev = '13.2.0';

/* ===========================================================================================
* drag&drop methods that used to be stubbed out and implemented in dd-gridstack.ts
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* types.ts 13.1.2
* types.ts 13.2.0
* Copyright (c) 2021-2025 Alain Dumesny - see GridStack root license
*/

Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* utils.ts 13.1.2
* utils.ts 13.2.0
* Copyright (c) 2021-2025 Alain Dumesny - see GridStack root license
*/

Expand Down
2 changes: 1 addition & 1 deletion vue/doc/api/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# GridStack Vue Library v13.1.2
# GridStack Vue Library v13.2.0

## Modules

Expand Down
12 changes: 6 additions & 6 deletions vue/doc/api/registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
function installGridStackVueCallbacks(): void;
```

Defined in: [vue/projects/lib/src/registry.ts:9](https://github.com/adumesny/gridstack.js/blob/master/vue/projects/lib/src/registry.ts#L9)
Defined in: [vue/projects/lib/src/registry.ts:13](https://github.com/adumesny/gridstack.js/blob/master/vue/projects/lib/src/registry.ts#L13)

#### Returns

Expand All @@ -22,14 +22,14 @@ Defined in: [vue/projects/lib/src/registry.ts:9](https://github.com/adumesny/gri
function gsSaveAdditionalVueInfo(node, w): void;
```

Defined in: [vue/projects/lib/src/registry.ts:83](https://github.com/adumesny/gridstack.js/blob/master/vue/projects/lib/src/registry.ts#L83)
Defined in: [vue/projects/lib/src/registry.ts:85](https://github.com/adumesny/gridstack.js/blob/master/vue/projects/lib/src/registry.ts#L85)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `node` | [`GridStackNode`](../../../doc/API.md#gridstacknode) |
| `w` | [`GridStackWidget`](../../../doc/API.md#gridstackwidget) |
| `node` | [`GridStackNode`](types.md#gridstacknode) |
| `w` | [`GridStackWidget`](types.md#gridstackwidget) |

#### Returns

Expand All @@ -43,13 +43,13 @@ Defined in: [vue/projects/lib/src/registry.ts:83](https://github.com/adumesny/gr
function gsUpdateVueComponents(node): void;
```

Defined in: [vue/projects/lib/src/registry.ts:100](https://github.com/adumesny/gridstack.js/blob/master/vue/projects/lib/src/registry.ts#L100)
Defined in: [vue/projects/lib/src/registry.ts:101](https://github.com/adumesny/gridstack.js/blob/master/vue/projects/lib/src/registry.ts#L101)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `node` | [`GridStackNode`](../../../doc/API.md#gridstacknode) |
| `node` | [`GridStackNode`](types.md#gridstacknode) |

#### Returns

Expand Down
2 changes: 1 addition & 1 deletion vue/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vue",
"private": true,
"version": "13.1.2",
"version": "13.2.0",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
6 changes: 3 additions & 3 deletions vue/projects/lib/src/composables.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { computed, inject, onBeforeUnmount, onMounted } from 'vue'
import { Utils } from 'gridstack'
import type { GridStackNode } from 'gridstack'
import type { GridStackElement, GridStackNode } from 'gridstack'
import { GS_CONTEXT_KEY, GS_ITEM_CONTEXT_KEY } from './gridstack-context'
import type { GridStackWidget } from './types'

Expand All @@ -23,10 +23,10 @@ export function useGridStack() {
/** Bumps whenever the layout changes — use as a reactive dependency. */
get layoutVersion() { return ctx.layoutVersion.value },
addWidget(w: GridStackWidget) {
return ctx.grid?.addWidget(w as Parameters<NonNullable<typeof ctx.grid>['addWidget']>[0])
return ctx.grid?.addWidget(w)
},
removeWidget(
el: Parameters<NonNullable<typeof ctx.grid>['removeWidget']>[0],
el: GridStackElement,
removeDOM?: boolean,
triggerEvent?: boolean,
) {
Expand Down
43 changes: 22 additions & 21 deletions vue/projects/lib/src/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@
* Dispatches via DOM `_gridComp` / `_gridItemRef` back-refs (no closure over per-grid state).
*/
import { GridStack, Utils } from 'gridstack'
import type { GridStackNode, GridStackWidget as CoreGridStackWidget } from 'gridstack'
import type { GridHTMLElement, GridItemHTMLElement, GridStackWidget } from './types'
import type {
GridHTMLElement,
GridItemHTMLElement,
GridStackNode,
GridStackWidget,
} from './types'

export function installGridStackVueCallbacks(): void {
if (!GridStack.addRemoveCB) {
Expand Down Expand Up @@ -32,45 +36,43 @@ function nearestGridComp(el: HTMLElement | null): GridHTMLElement['_gridComp'] |
/** @internal */
export function gsCreateVueComponents(
parent: HTMLElement,
w: CoreGridStackWidget,
w: GridStackWidget,
add: boolean,
isGrid: boolean,
): HTMLElement | undefined {
if (add) {
if (isGrid) {
const opt = w as GridStackWidget
const classes = ['grid-stack']
if (opt.class) classes.push(...String(opt.class).split(' ').filter(Boolean))
if (w.class) classes.push(...w.class.split(' ').filter(Boolean))
const el = Utils.createDiv(classes) as GridHTMLElement
// Inherit the host's _gridComp so nested-grid children can register teleport anchors.
const inherited = nearestGridComp(parent)
if (inherited) el._gridComp = inherited
parent?.appendChild(el)
parent.appendChild(el)
return el
}

const gridHost = (parent as GridHTMLElement)._gridComp
if (!gridHost) return undefined

const opt = w as GridStackWidget
const itemClasses = ['grid-stack-item']
if (opt.class) itemClasses.push(...String(opt.class).split(' ').filter(Boolean))
if (w.class) itemClasses.push(...w.class.split(' ').filter(Boolean))
const el = Utils.createDiv(itemClasses) as GridItemHTMLElement
Utils.createDiv(['grid-stack-item-content'], el)

const id = opt.id != null ? String(opt.id) : undefined
const id = w.id
if (id) {
el._gridItemRef = { id, gridComp: gridHost }
if (opt.component) gridHost.registerSyntheticItemId(id)
if (w.component) gridHost.registerSyntheticItemId(id)
}
if (opt.content != null && opt.content !== '') {
const content = el.querySelector('.grid-stack-item-content') as HTMLElement
if (content) content.textContent = String(opt.content)
if (w.content) {
const content = el.querySelector('.grid-stack-item-content')
if (content) content.textContent = w.content
}
return el
}

const el = (w as GridStackWidget).el as GridItemHTMLElement | undefined
const el = w.el as GridItemHTMLElement | undefined
if (el?._gridItemRef) {
const { id, gridComp } = el._gridItemRef
gridComp.unregisterSyntheticItemId(id)
Expand All @@ -82,18 +84,17 @@ export function gsCreateVueComponents(

export function gsSaveAdditionalVueInfo(
node: GridStackNode,
w: CoreGridStackWidget,
w: GridStackWidget,
): void {
const n = node as GridStackNode & { component?: string; props?: Record<string, unknown> }
const out = w as GridStackWidget
if (n.component != null) out.component = n.component
if (n.props != null) out.props = { ...n.props }
if (n.component != null) w.component = n.component
if (n.props != null) w.props = { ...n.props }
// Strip runtime-only fields that must never appear in serialized output.
delete (out as Record<string, unknown>).visibleObservable
delete (w as Record<string, unknown>).visibleObservable
const el = node.el as GridItemHTMLElement | undefined
const id = n.id != null ? String(n.id) : undefined
const id = n.id
if (id && el?._gridItemRef?.gridComp?.mergeWidgetPropsForSave) {
el._gridItemRef.gridComp.mergeWidgetPropsForSave(id, out)
el._gridItemRef.gridComp.mergeWidgetPropsForSave(id, w)
}
}

Expand Down