@svgrid/grid 1.0.0 → 1.0.2

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.
@@ -122,7 +122,13 @@ const STYLE_TEMPLATE = `
122
122
  bottom: 3px;
123
123
  }
124
124
  `;
125
- class SvGridScrollbarElement extends HTMLElement {
125
+ // Extend a real HTMLElement in the browser, but a harmless stand-in on the
126
+ // server. Evaluating `class X extends HTMLElement` at module load would throw
127
+ // `HTMLElement is not defined` during SSR / prerender; the element is only ever
128
+ // registered + instantiated in the browser (see the guarded define() below).
129
+ const ScrollbarBase = typeof HTMLElement !== 'undefined' ? HTMLElement : class {
130
+ };
131
+ class SvGridScrollbarElement extends ScrollbarBase {
126
132
  constructor() {
127
133
  super(...arguments);
128
134
  this.dragging = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@svgrid/grid",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "SvGrid - a headless-first, Svelte 5-native data grid engine and render component.",
5
5
  "author": "jQWidgets <boikom@jqwidgets.com>",
6
6
  "license": "MIT",
@@ -127,7 +127,14 @@ const STYLE_TEMPLATE = `
127
127
  }
128
128
  `
129
129
 
130
- class SvGridScrollbarElement extends HTMLElement {
130
+ // Extend a real HTMLElement in the browser, but a harmless stand-in on the
131
+ // server. Evaluating `class X extends HTMLElement` at module load would throw
132
+ // `HTMLElement is not defined` during SSR / prerender; the element is only ever
133
+ // registered + instantiated in the browser (see the guarded define() below).
134
+ const ScrollbarBase: typeof HTMLElement =
135
+ typeof HTMLElement !== 'undefined' ? HTMLElement : (class {} as unknown as typeof HTMLElement)
136
+
137
+ class SvGridScrollbarElement extends ScrollbarBase {
131
138
  static get observedAttributes() {
132
139
  return ['orientation', 'viewport-size', 'content-size', 'value', 'step']
133
140
  }