diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml new file mode 100644 index 000000000..467bd760f --- /dev/null +++ b/.github/workflows/deploy-docs.yml @@ -0,0 +1,96 @@ +name: Deploy Documentation + +on: + push: + branches: [ master ] + # Allow manual triggering + workflow_dispatch: + +jobs: + deploy-docs: + runs-on: ubuntu-latest + # Only run on pushes to master (not PRs) + if: github.ref == 'refs/heads/master' + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '18' + cache: 'yarn' + + - name: Install main dependencies + run: yarn install --frozen-lockfile + + - name: Install Angular dependencies + run: | + cd angular + yarn install --frozen-lockfile + + - name: Build Angular library + run: yarn build:ng + + - name: Build main library + run: | + grunt + webpack + tsc --stripInternal + + - name: Generate all documentation + run: yarn doc:all + + - name: Prepare deployment structure + run: | + mkdir -p deploy + + # Create proper directory structure for GitHub Pages + mkdir -p deploy/docs/html + mkdir -p deploy/angular/docs/html + + # Copy main library HTML documentation + if [ -d "docs/html" ]; then + cp -r docs/html/* deploy/docs/html/ + fi + + # Copy Angular library HTML documentation + if [ -d "angular/docs/html" ]; then + cp -r angular/docs/html/* deploy/angular/docs/html/ + fi + + # Copy redirect index.html to root + if [ -f "docs/index.html" ]; then + cp docs/index.html deploy/ + fi + + # Ensure .nojekyll exists to prevent Jekyll processing + touch deploy/.nojekyll + + # Optional: Add a simple index.html at root if none exists + if [ ! -f "deploy/index.html" ]; then + cat > deploy/index.html << 'EOF' + + +
+Redirecting to API Documentation...
+ + + EOF + fi + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./deploy + keep_files: true + commit_message: 'Deploy documentation from ${{ github.sha }}' diff --git a/README.md b/README.md index 7ac81e8b9..25d9d94c8 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ Join us on Slack: [https://gridstackjs.slack.com](https://join.slack.com/t/grids # Demo and API Documentation -Please visit http://gridstackjs.com and [these demos](http://gridstackjs.com/demo/), and complete [API documentation](https://github.com/gridstack/gridstack.js/tree/master/doc) +Please visit http://gridstackjs.com and [these demos](http://gridstackjs.com/demo/), and complete [API documentation](https://gridstack.github.io/gridstack.js/docs/html/) ([markdown](https://github.com/gridstack/gridstack.js/tree/master/doc)) # Usage diff --git a/angular/typedoc.html.json b/angular/typedoc.html.json index 5caec2359..5b34cd57b 100644 --- a/angular/typedoc.html.json +++ b/angular/typedoc.html.json @@ -27,7 +27,7 @@ "excludePrivate": true, "excludeProtected": false, "excludeInternal": true, - "includeVersion": true, + "includeVersion": false, "sort": ["source-order"], "sortEntryPoints": false, "kindSortOrder": [ @@ -73,6 +73,7 @@ "Angular Guide": "README.md" }, "hostedBaseUrl": "https://gridstack.github.io/gridstack.js/angular/", + "githubPages": true, "gitRevision": "master", "gitRemote": "origin", "name": "GridStack Angular Library" diff --git a/angular/typedoc.json b/angular/typedoc.json index 6383463ca..1e45a2b7d 100644 --- a/angular/typedoc.json +++ b/angular/typedoc.json @@ -29,7 +29,7 @@ "excludePrivate": true, "excludeProtected": false, "excludeInternal": true, - "includeVersion": true, + "includeVersion": false, "sort": ["source-order"], "sortEntryPoints": false, "kindSortOrder": [ diff --git a/docs/api/index.md b/docs/api/index.md index 88a4d3110..39be4aaa0 100644 --- a/docs/api/index.md +++ b/docs/api/index.md @@ -1,4 +1,4 @@ -# gridstack v12.3.0 +# gridstack ## Classes diff --git a/docs/html/classes/DDBaseImplement.html b/docs/html/classes/DDBaseImplement.html index 01fb9c261..2ad8b1ac0 100644 --- a/docs/html/classes/DDBaseImplement.html +++ b/docs/html/classes/DDBaseImplement.html @@ -1,4 +1,4 @@ -AbstractInterface for HTML elements extended with drag & drop options. +
Interface for HTML elements extended with drag & drop options. Used to associate DD configuration with DOM elements.
Method to update the options and return the DD implementation
Interface for HTML elements extended with drag & drop options. +
Interface for HTML elements extended with drag & drop options. Used to associate DD configuration with DOM elements.
Method to update the options and return the DD implementation
StaticinitStaticinitHTML Native Mouse and Touch Events Drag and Drop functionality.
+HTML Native Mouse and Touch Events Drag and Drop functionality.
This class provides the main drag & drop implementation for GridStack, handling resizing, dragging, and dropping of grid items using native HTML5 events. It manages the interaction between different DD components and the grid system.
@@ -33,4 +33,4 @@Global state manager for all Drag & Drop instances.
+Global state manager for all Drag & Drop instances.
This class maintains shared state across all drag & drop operations, ensuring proper coordination between multiple grids and drag/drop elements. All properties are static to provide global access throughout the DD system.
@@ -20,4 +20,4 @@ If set to true or a number (milliseconds), dragging placement and collision detection will only happen after the user pauses movement. This improves performance during rapid mouse movements. -Interface for HTML elements extended with drag & drop options. +
Interface for HTML elements extended with drag & drop options. Used to associate DD configuration with DOM elements.
Method to update the options and return the DD implementation
call this when resize handle needs to be removed and cleaned up
-Main gridstack class - you will need to call GridStack.init() first to initialize your grid.
+
Main gridstack class - you will need to call GridStack.init() first to initialize your grid.
Note: your grid elements MUST have the following classes for the CSS layout to work:
<div class="grid-stack">
<div class="grid-stack-item">
<div class="grid-stack-item-content">Item 1</div>
</div>
</div>
@@ -463,4 +463,4 @@
ProtectedresponseStatic Optionalsavecallback during saving to application can inject extra data for each widget, on top of the grid layout properties
Static Optionalupdatecalled after a widget has been updated (eg: load() into an existing list of children) so application can do extra work
StaticUtilsscoping so users can call GridStack.Utils.sort() for example
-Defines the GridStack engine that handles all grid layout calculations and node positioning. +
Defines the GridStack engine that handles all grid layout calculations and node positioning. This is the core engine that performs grid manipulation without any DOM operations.
The engine manages:
return true if can fit in grid height constrain only (always true if no maxRow)
Collection of utility methods used throughout GridStack. +
Collection of utility methods used throughout GridStack. These are general-purpose helper functions for DOM manipulation, positioning calculations, object operations, and more.
Defines a responsive breakpoint for automatic column count changes. +
Defines a responsive breakpoint for automatic column count changes. Used with the responsive.breakpoints option.
Drag&Drop dragging options
+Drag&Drop dragging options
OptionalstopExtended HTMLElement interface for grid items. +
Extended HTMLElement interface for grid items. All grid item DOM elements implement this interface to provide access to their grid data.
Drag&Drop remove options
+Drag&Drop remove options
OptionalautoOptionalhandlesOptionalmaxOptionalmaxOptionalmaxOptionalmaxOptionalminOptionalminOptionalresizeOptionalstartOptionalstopOptionalautoOptionalhandlesOptionalmaxOptionalmaxOptionalmaxOptionalmaxOptionalminOptionalminOptionalresizeOptionalstartOptionalstopDrag&Drop resize options
+Drag&Drop resize options
Optionalautodo resize handle hide by default until mouse over ? - default: true on desktop, false on mobile
Optionalhandlessides where you can resize from (ex: 'e, se, s, sw, w') - default 'se' (south-east) Note: it is not recommended to resize from the top sides as weird side effect may occur.
-Extended HTMLElement interface for grid items. +
Extended HTMLElement interface for grid items. All grid item DOM elements implement this interface to provide access to their grid data.
options used during creation - similar to GridStackOptions
+options used during creation - similar to GridStackOptions
options used during GridStackEngine.moveNode()
+options used during GridStackEngine.moveNode()
internal runtime descriptions describing the widgets in the grid
+internal runtime descriptions describing the widgets in the grid
Defines the options for a Grid
+Defines the options for a Grid
Optionalsubenable/disable the creation of sub-grids on the fly by dragging items completely
over others (nest) vs partially (push). Forces DDDragOpt.pause=true to accomplish that.
Optionalsublist of differences in options for automatically created sub-grids under us (inside our grid-items)
-GridStack Widget creation options
+GridStack Widget creation options
Interface for HTML elements extended with drag & drop options. +
Interface for HTML elements extended with drag & drop options. Used to associate DD configuration with DOM elements.
Method to update the options and return the DD implementation
Configuration for responsive grid behavior.
+Configuration for responsive grid behavior.
Defines how the grid responds to different screen sizes by changing column counts. NOTE: Make sure to include the appropriate CSS (gridstack-extra.css) to support responsive behavior.
Optionalcolumnmaximum number of columns allowed (default: 12). NOTE: make sure to have correct extra CSS to support this.
Optionalcolumnwanted width to maintain (+-50%) to dynamically pick a column count. NOTE: make sure to have correct extra CSS to support this.
Optionallayoutglobal re-layout mode when changing columns
-Optional callback function called during load() operations. +
Optional callback function called during load() operations. Allows custom handling of widget addition/removal for framework integration.
The parent HTML element
The widget definition
True if adding, false if removing
True if this is a grid operation
The created/modified HTML element, or undefined
-Different layout options when changing the number of columns.
+Different layout options when changing the number of columns.
These options control how widgets are repositioned when the grid column count changes. Note: The new list may be partially filled if there's a cached layout for that size.
Options:
@@ -11,4 +11,4 @@'none': Leave items unchanged unless they don't fit in the new column countOptions for the compact() method to reclaim empty space.
+Options for the compact() method to reclaim empty space.
'list': Keep items in order, move them up sequentially'compact': Find truly empty spaces, may reorder items for optimal fitCallback function type for drag & drop events.
+Callback function type for drag & drop events.
The DOM event that triggered the callback
The grid item element being dragged/dropped
Optionalhelper: GridItemHTMLElementOptional helper element used during drag operations
-Drag & Drop options for drop targets. +
Keys for DD configuration options that can be set via the 'option' command.
-Keys for DD configuration options that can be set via the 'option' command.
+Drag & Drop operation types used throughout the DD system. +
Drag & Drop operation types used throughout the DD system. Can be control commands or configuration objects.
-Values for DD configuration options (numbers or strings with units).
-Values for DD configuration options (numbers or strings with units).
+Type for event callback functions used in drag & drop operations. +
Type for event callback functions used in drag & drop operations. Can return boolean to indicate if the event should continue propagation.
-Drop event handler that receives previous and new node states
-Drop event handler that receives previous and new node states
+Type representing various ways to specify grid elements. +
Type representing various ways to specify grid elements. Can be a CSS selector string, HTMLElement, or GridItemHTMLElement.
-Element-specific event handler that receives event and affected element
-Element-specific event handler that receives event and affected element
+list of possible events, or space separated list of them
-list of possible events, or space separated list of them
+General event handler that receives only the event
-General event handler that receives only the event
+Union type of all possible event handler types
-Union type of all possible event handler types
+Node-based event handler that receives event and array of affected nodes
-Node-based event handler that receives event and array of affected nodes
+Optional callback function for custom widget content rendering. +
Optional callback function for custom widget content rendering. Called during load()/addWidget() to create custom content beyond plain text.
The widget's content container element
The widget definition with content and other properties
-Optional callback function for custom resize-to-content behavior. +
Optional callback function for custom resize-to-content behavior. Called when a widget needs to resize to fit its content.
The grid item element to resize
-Optional callback function called during save() operations. +
Optional callback function called during save() operations. Allows adding custom data to the saved widget structure.
The internal grid node
The widget structure being saved (can be modified)
-Type representing values that can be either numbers or strings (e.g., dimensions with units). +
Type representing values that can be either numbers or strings (e.g., dimensions with units). Used for properties like width, height, margins that accept both numeric and string values.
-ConstDefault values for grid options - used during initialization and when saving out grid configuration. +
ConstDefault values for grid options - used during initialization and when saving out grid configuration. These values are applied when options are not explicitly provided.
-Redirecting to HTML documentation...
+ + diff --git a/typedoc.html.json b/typedoc.html.json index e552cc79b..cda665cbc 100644 --- a/typedoc.html.json +++ b/typedoc.html.json @@ -15,7 +15,7 @@ "excludePrivate": true, "excludeProtected": false, "excludeInternal": true, - "includeVersion": true, + "includeVersion": false, "sort": ["alphabetical"], "kindSortOrder": [ "Class", @@ -57,6 +57,7 @@ "API Reference": "docs/" }, "hostedBaseUrl": "https://gridstack.github.io/gridstack.js/", + "githubPages": true, "gitRevision": "master", "gitRemote": "origin" } diff --git a/typedoc.json b/typedoc.json index dd2902639..7c117bc55 100644 --- a/typedoc.json +++ b/typedoc.json @@ -20,7 +20,7 @@ "excludePrivate": true, "excludeProtected": false, "excludeInternal": true, - "includeVersion": true, + "includeVersion": false, "sort": ["alphabetical"], "kindSortOrder": [ "Class",
Abstract base class for all drag & drop implementations. +
Class DDBaseImplement
AbstractAbstract base class for all drag & drop implementations. Provides common functionality for event handling, enable/disable state, and lifecycle management used by draggable, droppable, and resizable implementations.
Hierarchy (View Summary)
Index
Accessors
Parameters
Name of the event to trigger
DOM event object to pass to the callback
Returns boolean | void
Result from the callback function, if any
-Settings
On This Page
Accessors
Constructors
Methods